PageSourceSearch

https://dataprotectionappchile.web.app/assets/index-BgHBPtDI.js

js dataprotectionappchile.web.app collected 2026-10-03 12:20:48 UTC 779,719 bytes, 3,977 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/VerifyRequest-CwSsJtxX.js","assets/loader-jarMLY75.js","assets/file-text-DAqKJ2yN.js","assets/lock-BlVpN-Zu.js","assets/user-DIRregmX.js","assets/circle-alert-CjN7tz2C.js","assets/PublicArcopRequestForm-CuWjZCnn.js","assets/arcopAudit-DiUvrA61.js","assets/resolverSlug-cfYkiMUp.js","assets/shield-check-B1tdQ677.js","assets/external-link-BWC5kjWa.js","assets/PublicCapturaPunto-CBtRhpR6.js","assets/PublicPreferenceCenter-8fLOLOIw.js","assets/dataCategories-UWaUkj9R.js","assets/mail-B8srLhiD.js","assets/check-Cxh8WXr2.js","assets/PublicConsentSigning-CS5JrlRe.js","assets/SignaturePad-ir0UM-vK.js","assets/pen-line-Cim2SG57.js","assets/PublicConsentConfirm-DwiQYiRt.js","assets/ArcopStatusPage-CZbp8Yjj.js","assets/rotate-ccw-KtL49_4f.js","assets/search-Camnh3U9.js","assets/PublicVendorQuestionnaire-BHtr4KPY.js","assets/Dashboard-B763GwFQ.js","assets/square-check-big-CXkEmIsa.js","assets/square--ORUOAu7.js","assets/arrow-right-iFESvb6h.js","assets/useObligations-Cnco0wWZ.js","assets/sparkles--UMZ8TFy.js","assets/user-x-BmgJH_uo.js","assets/users-DyZzDBvL.js","assets/activity-LVAXEawv.js","assets/chart-no-axes-column-BgqETUQ0.js","assets/trending-up-LeisTbIk.js","assets/link-2-DeU3vazX.js","assets/ObligationsCalendarPage-DbZULP1k.js","assets/PageHeader-DSvzo-fN.js","assets/funnel-DaZ-9Han.js","assets/file-warning-C7cOkOvq.js","assets/BoardDashboard-2j60uoT3.js","assets/ComplianceAgent-C1-QMwVm.js","assets/authApi-C2S1Njta.js","assets/scale-DIjOtOHM.js","assets/PieChart-sEd53rjE.js","assets/database-EVw1T6G3.js","assets/LoginPage-BbFcOOL3.js","assets/auditLogger-CQNP42qh.js","assets/ChangePassword-DNSdPKSq.js","assets/VerifyMFA-NM6-9MyR.js","assets/key-round-DyP0fl0_.js","assets/SetupMFAPage-DZoVG_qK.js","assets/wifi-off-CyLhy32N.js","assets/refresh-cw-bSCmTSrA.js","assets/qr-code-BEDjORK0.js","assets/SecuritySettings-I-SymQ9z.js","assets/shield-off-DgkvMJqW.js","assets/monitor-rB0ZCSV9.js","assets/trash-2-DF_GIPVF.js","assets/MPICertification-CSjW3d7W.js","assets/ContextInfoBox-C9XoqG2N.js","assets/jspdf.es.min-C5_r9jLh.js","assets/award-DIyG6xmz.js","assets/badge-check-eWFNWisE.js","assets/circle-dashed-DzyYnDI-.js","assets/book-open-B-rHqEh1.js","assets/paperclip-Dl7IWM2K.js","assets/circle-check-Cy9az61d.js","assets/save-BcUxlSAX.js","assets/upload-C-Z4lUO2.js","assets/download-DxsxlDdz.js","assets/chart-column-BZU9HOtw.js","assets/GovernanceDelegates-Q6u4JH68.js","assets/calendar-C_f04Ula.js","assets/plus-DvIu4kCg.js","assets/user-check-BqwGcyxO.js","assets/ProcessingActivities-CLlQmABP.js","assets/riskEvaluator-qjyZ-94H.js","assets/textoConsentimiento-CN8uPPi6.js","assets/ConfirmationModal-CGqY4ijw.js","assets/zap-BZHWxrHG.js","assets/ratPlantillas-BCnS_GFY.js","assets/map-pin-C3-hBP_n.js","assets/brain-DjfQS_Gq.js","assets/briefcase-qMN-jup7.js","assets/server-NxGwSK21.js","assets/eye-BbU1Y_Rj.js","assets/square-pen-DFfqCL88.js","assets/hard-drive-BZs2bynt.js","assets/globe-CMfSKcp_.js","assets/DataSubjects-COZ40Ri-.js","assets/cruceTitulares-Cx9WaBMY.js","assets/copy-D8RhcY6E.js","assets/send-DI2a1rE3.js","assets/link-CabbMPCG.js","assets/DataSubjectRequests-8IYRxWPw.js","assets/integritySeal-5tSNYL4O.js","assets/wand-sparkles-WyBRAEdp.js","assets/bot-DQAs0pUU.js","assets/CentroTareas-nMaW6aeB.js","assets/message-square-DL3xuJvR.js","assets/ImpactAssessment-D6vkTVnP.js","assets/clipboard-check-Bhm4PJ4D.js","assets/chevron-up-D9cf0iMt.js","assets/jspdf.plugin.autotable-Chc3P4qR.js","assets/ConsentManagement-Bden6Zje.js","assets/heart-handshake-DENScI0d.js","assets/ReportsPage-CcUe2P-O.js","assets/file-spreadsheet-CJszCSjJ.js","assets/MitreCoveragePage-CrZfEfhh.js","assets/SaasMonitoringPage-BcVZ9Cvl.js","assets/settings-C9a2-Cd3.js","assets/SoaVerificationPage-DkEJUvK-.js","assets/BukIntegrationPage-CBD74_E7.js","assets/user-plus-1Ch9nb-1.js","assets/ComplianceAI-CRq2s1UU.js","assets/brain-circuit-CbGP1Ory.js","assets/target-P1qCGJeK.js","assets/InternationalTransfers-BLjsjc-p.js","assets/SensitiveData-BhpHGSzG.js","assets/VideoSurveillance-BbLh7YcO.js","assets/AutomatedAudits-DfHOqctU.js","assets/papaparse.min-CNZgakyG.js","assets/clipboard-list-8ZSVFKQw.js","assets/DataCategoryManagement-COIsVjIc.js","assets/PrivacyDashboard-DyQTBuuI.js","assets/BarChart-DG3t-kcr.js","assets/SecurityScanner-To7lm7PS.js","assets/ComplianceDashboard21663-B0JXagSd.js","assets/useCollection-BQEu2QFP.js","assets/IncidentManagement-WqoTT4wv.js","assets/autoAssignTask-BVN6QmGX.js","assets/AccessLogMonitoring-CQl2HQlh.js","assets/VendorManagement-DQs2XS92.js","assets/building-Cw83dl7w.js","assets/ComplianceRegistry-B5lGZRXO.js","assets/GlobalSocDashboard-CRnSn4Is.js","assets/WazuhGdprCompliance-C3QxIguv.js","assets/PlanningAndContext-DCzV0_nQ.js","assets/index-Dnsp2skW.js","assets/CorporateLayout-BGPD4_9O.js","assets/RiskManagement-DTPloXbY.js","assets/SgsiAiAssistant-BPAXipzX.js","assets/SgsiAiService-p4obvu-8.js","assets/ImplementationAndOperation-qOIj4Dj8.js","assets/UserRoleManagement-MrvgWNWw.js","assets/TrainingManagement-CbfhLLyk.js","assets/VerificationAndMonitoring-B23dppex.js","assets/ManagementReview-DSaxFr_k.js","assets/ContinuousImprovement-7ec1b1sY.js","assets/BusinessContinuityPage-DaG3dZEV.js","assets/TechnicalControls-ZAZXTflp.js","assets/HumanResources-CC96B19I.js","assets/KPIsAndMetrics-tOGvQR-I.js","assets/minus-C_q_dHSq.js","assets/AssetInventory-ClnD_8su.js","assets/CertificationAssistant-8EKqEJBv.js","assets/InternalAudit-406O4qIq.js","assets/PerformanceEvaluation-BhZYHuyf.js","assets/OperationalPlanning-
vendor: 5,128 bytes, lines 1-10
1DbT0mvsi.js","assets/ChangeManagementPage-BB3xFt-i.js","assets/TrainingManagementPage-i3qKuZ3O.js","assets/CybersecurityTrainingPage-Ct1PKhYs.js","assets/purify.es-BYftNTi7.js","assets/ModuleDownloadsPage-BH1oJ6hA.js","assets/WazuhDashboard-BRrigAjA.js","assets/wifi-DUdWOP9Q.js","assets/UpdateLogPage-D9Xz94Tw.js","assets/MonitoringAuditReport-BJJ4_Di_.js","assets/QuickStartGuide-BmE2eVq6.js","assets/AsistenteCumplimiento-Dob7Lk9f.js","assets/camposEmpresa-BpcMCIly.js","assets/CompanyManagementPage-BwQY-xhY.js","assets/UserRoleManagementPage-BeXgnFca.js","assets/RoleManagementPage-zhz4imxY.js","assets/ModuleManagement-Dza2mcf4.js","assets/WazuhConfigPage-Bh2r4trl.js","assets/SuperAdminPanel-Cow2ORHf.js","assets/StatementOfApplicability-BQsFmtdX.js"])))=>i.map(i=>d[i]);
2function _A(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Y4=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vA(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var E0={exports:{}},fc={},w0={exports:{}},re={};/**
3 * @license React
4 * react.production.min.js
5 *
6 * Copyright (c) Facebook, Inc. and its affiliates.
7 *
8 * This source code is licensed under the MIT license found in the
9 * LICENSE file in the root directory of this source tree.
10 */var Ra=Symbol.for("react.element"),EA=Symbol.for("react.portal"),wA=Symbol.for("react.fragment"),TA=Symbol.for("react.strict_mode"),IA=Symbol.for("react.profiler"),AA=Symbol.for("react.provider"),SA=Symbol.for("react.context"),RA=Symbol.for("react.forward_ref"),CA=Symbol.for("react.suspense"),PA=Symbol.for("react.memo"),kA=Symbol.for("react.lazy"),ey=Symbol.iterator;function xA(t){return t===null||typeof t!="object"?null:(t=ey&&t[ey]||t["@@iterator"],typeof t=="function"?t:null)}var T0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I0=Object.assign,A0={};function Ns(t,e,n){this.props=t,this.context=e,this.refs=A0,this.updater=n||T0}Ns.prototype.isReactComponent={};Ns.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Ns.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function S0(){}S0.prototype=Ns.prototype;function Zf(t,e,n){this.props=t,this.context=e,this.refs=A0,this.updater=n||T0}var ep=Zf.prototype=new S0;ep.constructor=Zf;I0(ep,Ns.prototype);ep.isPureReactComponent=!0;var ty=Array.isArray,R0=Object.prototype.hasOwnProperty,tp={current:null},C0={key:!0,ref:!0,__self:!0,__source:!0};function P0(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)R0.call(e,r)&&!C0.hasOwnProperty(r)&&(i[r]=e[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];i.children=u}if(t&&t.defaultProps)for(r in l=t.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:Ra,type:t,key:s,ref:o,props:i,_owner:tp.current}}function bA(t,e){return{$$typeof:Ra,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function np(t){return typeof t=="object"&&t!==null&&t.$$typeof===Ra}function NA(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var ny=/\/+/g;function Ph(t,e){return typeof t=="object"&&t!==null&&t.key!=null?NA(""+t.key):e.toString(36)}function Fl(t,e,n,r,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case Ra:case EA:o=!0}}if(o)return o=t,i=i(o),t=r===""?"."+Ph(o,0):r,ty(i)?(n="",t!=null&&(n=t.replace(ny,"$&/")+"/"),Fl(i,e,n,"",function(c){return c})):i!=null&&(np(i)&&(i=bA(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(ny,"$&/")+"/")+t)),e.push(i)),1;if(o=0,r=r===""?".":r+":",ty(t))for(var l=0;l<t.length;l++){s=t[l];var u=r+Ph(s,l);o+=Fl(s,e,n,u,i)}
vendor: 4,235 bytes, lines 10-18
10else if(u=xA(t),typeof u=="function")for(t=u.call(t),l=0;!(s=t.next()).done;)s=s.value,u=r+Ph(s,l++),o+=Fl(s,e,n,u,i);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function hl(t,e,n){if(t==null)return t;var r=[],i=0;return Fl(t,r,"","",function(s){return e.call(n,s,i++)}),r}function DA(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var vt={current:null},Ul={transition:null},OA={ReactCurrentDispatcher:vt,ReactCurrentBatchConfig:Ul,ReactCurrentOwner:tp};function k0(){throw Error("act(...) is not supported in production builds of React.")}re.Children={map:hl,forEach:function(t,e,n){hl(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return hl(t,function(){e++}),e},toArray:function(t){return hl(t,function(e){return e})||[]},only:function(t){if(!np(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};re.Component=Ns;re.Fragment=wA;re.Profiler=IA;re.PureComponent=Zf;re.StrictMode=TA;re.Suspense=CA;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=OA;re.act=k0;re.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=I0({},t.props),i=t.key,s=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=tp.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(u in e)R0.call(e,u)&&!C0.hasOwnProperty(u)&&(r[u]=e[u]===void 0&&l!==void 0?l[u]:e[u])}var u=arguments.length-2;if(u===1)r.children=n;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:Ra,type:t.type,key:i,ref:s,props:r,_owner:o}};re.createContext=function(t){return t={$$typeof:SA,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:AA,_context:t},t.Consumer=t};re.createElement=P0;re.createFactory=function(t){var e=P0.bind(null,t);return e.type=t,e};re.createRef=function(){return{current:null}};re.forwardRef=function(t){return{$$typeof:RA,render:t}};re.isValidElement=np;re.lazy=function(t){return{$$typeof:kA,_payload:{_status:-1,_result:t},_init:DA}};re.memo=function(t,e){return{$$typeof:PA,type:t,compare:e===void 0?null:e}};re.startTransition=function(t){var e=Ul.transition;Ul.transition={};try{t()}finally{Ul.transition=e}};re.unstable_act=k0;re.useCallback=function(t,e){return vt.current.useCallback(t,e)};re.useContext=function(t){return vt.current.useContext(t)};re.useDebugValue=function(){};re.useDeferredValue=function(t){return vt.current.useDeferredValue(t)};re.useEffect=function(t,e){return vt.current.useEffect(t,e)};re.useId=function(){return vt.current.useId()};re.useImperativeHandle=function(t,e,n){return vt.current.useImperativeHandle(t,e,n)};re.useInsertionEffect=function(t,e){return vt.current.useInsertionEffect(t,e)};re.useLayoutEffect=function(t,e){return vt.current.useLayoutEffect(t,e)};re.useMemo=function(t,e){return vt.current.useMemo(t,e)};re.useReducer=function(t,e,n){return vt.current.useReducer(t,e,n)};re.useRef=function(t){return vt.current.useRef(t)};re.useState=function(t){return vt.current.useState(t)};re.useSyncExternalStore=function(t,e,n){return vt.current.useSyncExternalStore(t,e,n)};re.useTransition=function(){return vt.current.useTransition()};re.version="18.3.1";w0.exports=re;var D=w0.exports;const $=vA(D),VA=_A({__proto__:null,default:$},[D]);/**
11 * @license React
12 * react-jsx-runtime.production.min.js
13 *
14 * Copyright (c) Facebook, Inc. and its affiliates.
15 *
16 * This source code is licensed under the MIT license found in the
17 * LICENSE file in the root directory of this source tree.
18 */var LA=D,MA=Symbol.for("react.element"),FA=Symbol.for("react.fragment"),UA=Object.prototype.hasOwnProperty,jA=LA.__SECRET_INT
vendor: 6,278 bytes, lines 18-34
18ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,zA={key:!0,ref:!0,__self:!0,__source:!0};function x0(t,e,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)UA.call(e,r)&&!zA.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:MA,type:t,key:s,ref:o,props:i,_owner:jA.current}}fc.Fragment=FA;fc.jsx=x0;fc.jsxs=x0;E0.exports=fc;var O=E0.exports,gd={},b0={exports:{}},$t={},N0={exports:{}},D0={};/**
19 * @license React
20 * scheduler.production.min.js
21 *
22 * Copyright (c) Facebook, Inc. and its affiliates.
23 *
24 * This source code is licensed under the MIT license found in the
25 * LICENSE file in the root directory of this source tree.
26 */(function(t){function e(q,J){var K=q.length;q.push(J);e:for(;0<K;){var fe=K-1>>>1,te=q[fe];if(0<i(te,J))q[fe]=J,q[K]=te,K=fe;else break e}}function n(q){return q.length===0?null:q[0]}function r(q){if(q.length===0)return null;var J=q[0],K=q.pop();if(K!==J){q[0]=K;e:for(var fe=0,te=q.length,oe=te>>>1;fe<oe;){var gn=2*(fe+1)-1,Nt=q[gn],qt=gn+1,Te=q[qt];if(0>i(Nt,K))qt<te&&0>i(Te,Nt)?(q[fe]=Te,q[qt]=K,fe=qt):(q[fe]=Nt,q[gn]=K,fe=gn);else if(qt<te&&0>i(Te,K))q[fe]=Te,q[qt]=K,fe=qt;else break e}}return J}function i(q,J){var K=q.sortIndex-J.sortIndex;return K!==0?K:q.id-J.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var u=[],c=[],d=1,p=null,m=3,v=!1,w=!1,P=!1,C=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(q){for(var J=n(c);J!==null;){if(J.callback===null)r(c);else if(J.startTime<=q)r(c),J.sortIndex=J.expirationTime,e(u,J);else break;J=n(c)}}function x(q){if(P=!1,T(q),!w)if(n(u)!==null)w=!0,Wt(F);else{var J=n(c);J!==null&&Zt(x,J.startTime-q)}}function F(q,J){w=!1,P&&(P=!1,E(_),_=-1),v=!0;var K=m;try{for(T(J),p=n(u);p!==null&&(!(p.expirationTime>J)||q&&!k());){var fe=p.callback;if(typeof fe=="function"){p.callback=null,m=p.priorityLevel;var te=fe(p.expirationTime<=J);J=t.unstable_now(),typeof te=="function"?p.callback=te:p===n(u)&&r(u),T(J)}else r(u);p=n(u)}if(p!==null)var oe=!0;else{var gn=n(c);gn!==null&&Zt(x,gn.startTime-J),oe=!1}return oe}finally{p=null,m=K,v=!1}}var U=!1,I=null,_=-1,A=5,S=-1;function k(){return!(t.unstable_now()-S<A)}function b(){if(I!==null){var q=t.unstable_now();S=q;var J=!0;try{J=I(!0,q)}finally{J?R():(U=!1,I=null)}}else U=!1}var R;if(typeof g=="function")R=function(){g(b)};else if(typeof MessageChannel<"u"){var Tt=new MessageChannel,Be=Tt.port2;Tt.port1.onmessage=b,R=function(){Be.postMessage(null)}}else R=function(){C(b,0)};function Wt(q){I=q,U||(U=!0,R())}function Zt(q,J){_=C(function(){q(t.unstable_now())},J)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(q){q.callback=null},t.unstable_continueExecution=function(){w||v||(w=!0,Wt(F))},t.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<q?Math.floor(1e3/q):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return n(u)},t.unstable_next=function(q){switch(m){case 1:case 2:case 3:var J=3;break;default:J=m}var K=m;m=J;try{return q()}finally{m=K}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(q,J){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var K=m;m=q;try{return J()}finally{m=K}},t.unstable_scheduleCallback=function(q,J,K){var fe=t.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?fe+K:fe):K=fe,q){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=K+te,q={id:d++,callback:J,priorityLevel:q,startTime:K,expirationTime:te,sortIndex:-1},K>fe?(q.sortIndex=K,e(c,q),n(u)===null&&q===n(c)&&(P?(E(_),_=-1):P=!0,Zt(x,K-fe))):(q.sortIndex=te,e(u,q),w||v||(w=!0,Wt(F))),q},t.unstable_shouldYield=k,t.unstable_wrapCallback=function(q){var J=m;return function(){var K=m;m=J;try{return q.apply(this,arguments)}finally{m=K}}}})(D0);N0.exports=D0;var $A=N0.exports;/**
27 * @license React
28 * react-dom.production.min.js
29 *
30 * Copyright (c) Facebook, Inc. and its affiliates.
31 *
32 * This source code is licensed under the MIT license found in the
33 * LICENSE file in the root directory of this source tree.
34 */var BA=D,zt=$A;function j(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var O0=new Set,Xo={};function Ai(t,e){ps(t,e),ps(t+"Capture",e)}function ps(t,e){for(Xo[t]=e,t=0;t<e.length;t++)O0.add(e[t])}var qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yd=Object.prototype.hasOwnProperty,WA=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ry={},iy={};function qA(t){return yd.call(iy,t)?!0:yd.call(ry,t)?!1:WA.test(t)?iy[t]=!0:(ry[t]=!0,!1)}function HA(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function GA(t,e,n,r){if(e===null||typeof e>"u"||HA(t,e,n,r))return!0;
vendor: 5,200 bytes, lines 34-35
34if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Et(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var et={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){et[t]=new Et(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];et[e]=new Et(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){et[t]=new Et(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){et[t]=new Et(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){et[t]=new Et(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){et[t]=new Et(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){et[t]=new Et(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){et[t]=new Et(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){et[t]=new Et(t,5,!1,t.toLowerCase(),null,!1,!1)});var rp=/[\-:]([a-z])/g;function ip(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(rp,ip);et[e]=new Et(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(rp,ip);et[e]=new Et(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(rp,ip);et[e]=new Et(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){et[t]=new Et(t,1,!1,t.toLowerCase(),null,!1,!1)});et.xlinkHref=new Et("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){et[t]=new Et(t,1,!1,t.toLowerCase(),null,!0,!0)});function sp(t,e,n,r){var i=et.hasOwnProperty(e)?et[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(GA(e,n,i,r)&&(n=null),r||i===null?qA(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var Zn=BA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,dl=Symbol.for("react.element"),qi=Symbol.for("react.portal"),Hi=Symbol.for("react.fragment"),op=Symbol.for("react.strict_mode"),_d=Symbol.for("react.profiler"),V0=Symbol.for("react.provider"),L0=Symbol.for("react.context"),ap=Symbol.for("react.forward_ref"),vd=Symbol.for("react.suspense"),Ed=Symbol.for("react.suspense_list"),lp=Symbol.for("react.memo"),ur=Symbol.for("react.lazy"),M0=Symbol.for("react.offscreen"),sy=Symbol.iterator;function fo(t){return t===null||typeof t!="object"?null:(t=sy&&t[sy]||t["@@iterator"],typeof t=="function"?t:null)}var Ce=Object.assign,kh;function Io(t){if(kh===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);kh=e&&e[1]||""}return`
35`+kh+t}var xh=!1;function bh(t,e){if(!t||xh)return"";xh=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var r=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){r=c}t.call(e.prototype)}else{try{throw Error()}catch(c){r=c}t()}}
vendor: 16,737 bytes, lines 35-38
35catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
36`),s=r.stack.split(`
37`),o=i.length-1,l=s.length-1;1<=o&&0<=l&&i[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==s[l]){var u=`
38`+i[o].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=o&&0<=l);break}}}finally{xh=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Io(t):""}function KA(t){switch(t.tag){case 5:return Io(t.type);case 16:return Io("Lazy");case 13:return Io("Suspense");case 19:return Io("SuspenseList");case 0:case 2:case 15:return t=bh(t.type,!1),t;case 11:return t=bh(t.type.render,!1),t;case 1:return t=bh(t.type,!0),t;default:return""}}function wd(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Hi:return"Fragment";case qi:return"Portal";case _d:return"Profiler";case op:return"StrictMode";case vd:return"Suspense";case Ed:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case L0:return(t.displayName||"Context")+".Consumer";case V0:return(t._context.displayName||"Context")+".Provider";case ap:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case lp:return e=t.displayName||null,e!==null?e:wd(t.type)||"Memo";case ur:e=t._payload,t=t._init;try{return wd(t(e))}catch{}}return null}function QA(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return wd(e);case 8:return e===op?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Lr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function F0(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function XA(t){var e=F0(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function fl(t){t._valueTracker||(t._valueTracker=XA(t))}function U0(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=F0(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function yu(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Td(t,e){var n=e.checked;return Ce({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function oy(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Lr(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function j0(t,e){e=e.checked,e!=null&&sp(t,"checked",e,!1)}function Id(t,e){j0(t,e);var n=Lr(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Ad(t,e.type,n):e.hasOwnProperty("defaultValue")&&Ad(t,e.type,Lr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function ay(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Ad(t,e,n){(e!=="number"||yu(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Ao=Array.isArray;function is(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Lr(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function Sd(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(j(91));return Ce({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function ly(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(j(92));if(Ao(n)){if(1<n.length)throw Error(j(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Lr(n)}}function z0(t,e){var n=Lr(e.value),r=Lr(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function uy(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function $0(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Rd(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?$0(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var pl,B0=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(pl=pl||document.createElement("div"),pl.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=pl.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Yo(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Oo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},YA=["Webkit","ms","Moz","O"];Object.keys(Oo).forEach(function(t){YA.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Oo[e]=Oo[t]})});function W0(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Oo.hasOwnProperty(t)&&Oo[t]?(""+e).trim():e+"px"}function q0(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=W0(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var JA=Ce({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Cd(t,e){if(e){if(JA[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(j(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(j(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(j(61))}if(e.style!=null&&typeof e.style!="object")throw Error(j(62))}}function Pd(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var kd=null;function up(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var xd=null,ss=null,os=null;function cy(t){if(t=ka(t)){if(typeof xd!="function")throw Error(j(280));var e=t.stateNode;e&&(e=_c(e),xd(t.stateNode,t.type,e))}}function H0(t){ss?os?os.push(t):os=[t]:ss=t}function G0(){if(ss){var t=ss,e=os;if(os=ss=null,cy(t),e)for(t=0;t<e.length;t++)cy(e[t])}}function K0(t,e){return t(e)}function Q0(){}var Nh=!1;function X0(t,e,n){if(Nh)return t(e,n);Nh=!0;try{return K0(t,e,n)}finally{Nh=!1,(ss!==null||os!==null)&&(Q0(),G0())}}function Jo(t,e){var n=t.stateNode;if(n===null)return null;var r=_c(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(j(231,e,typeof n));return n}var bd=!1;if(qn)try{var po={};Object.defineProperty(po,"passive",{get:function(){bd=!0}}),window.addEventListener("test",po,po),window.removeEventListener("test",po,po)}catch{bd=!1}function ZA(t,e,n,r,i,s,o,l,u){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(d){this.onError(d)}}var Vo=!1,_u=null,vu=!1,Nd=null,eS={onError:function(t){Vo=!0,_u=t}};function tS(t,e,n,r,i,s,o,l,u){Vo=!1,_u=null,ZA.apply(eS,arguments)}function nS(t,e,n,r,i,s,o,l,u){if(tS.apply(this,arguments),Vo){if(Vo){var c=_u;Vo=!1,_u=null}else throw Error(j(198));vu||(vu=!0,Nd=c)}}function Si(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function Y0(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function hy(t){if(Si(t)!==t)throw Error(j(188))}function rS(t){var e=t.alternate;if(!e){if(e=Si(t),e===null)throw Error(j(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return hy(i),t;if(s===r)return hy(i),e;s=s.sibling}throw Error(j(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,l=i.child;l;){if(l===n){o=!0,n=i,r=s;break}if(l===r){o=!0,r=i,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,r=i;break}if(l===r){o=!0,r=s,n=i;break}l=l.sibling}if(!o)throw Error(j(189))}}if(n.alternate!==r)throw Error(j(190))}if(n.tag!==3)throw Error(j(188));return n.stateNode.current===n?t:e}function J0(t){return t=rS(t),t!==null?Z0(t):null}function Z0(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Z0(t);if(e!==null)return e;t=t.sibling}return null}var eE=zt.unstable_scheduleCallback,dy=zt.unstable_cancelCallback,iS=zt.unstable_shouldYield,sS=zt.unstable_requestPaint,Ve=zt.unstable_now,oS=zt.unstable_getCurrentPriorityLevel,cp=zt.unstable_ImmediatePriority,tE=zt.unstable_UserBlockingPriority,Eu=zt.unstable_NormalPriority,aS=zt.unstable_LowPriority,nE=zt.unstable_IdlePriority,pc=null,Tn=null;function lS(t){if(Tn&&typeof Tn.onCommitFiberRoot=="function")try{Tn.onCommitFiberRoot(pc,t,void 0,(t.current.flags&128)===128)}catch{}}var an=Math.clz32?Math.clz32:hS,uS=Math.log,cS=Math.LN2;function hS(t){return t>>>=0,t===0?32:31-(uS(t)/cS|0)|0}var ml=64,gl=4194304;function So(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function wu(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=So(l):(s&=o,s!==0&&(r=So(s)))}else o=n&~i,o!==0?r=So(o):s!==0&&(r=So(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-an(e),i=1<<n,r|=t[n],e&=~i;return r}function dS(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fS(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-an(s),l=1<<o,u=i[o];u===-1?(!(l&n)||l&r)&&(i[o]=dS(l,e)):u<=e&&(t.expiredLanes|=l),s&=~l}}function Dd(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function rE(){var t=ml;return ml<<=1,!(ml&4194240)&&(ml=64),t}function Dh(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Ca(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-an(e),t[e]=n}function pS(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-an(n),s=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~s}}function hp(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-an(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var de=0;function iE(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var sE,dp,oE,aE,lE,Od=!1,yl=[],Ir=null,Ar=null,Sr=null,Zo=new Map,ea=new Map,hr=[],mS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function fy(t,e){switch(t){case"focusin":case"focusout":Ir=null;break;case"dragenter":case"dragleave":Ar=null;break;case"mouseover":case"mouseout":Sr=null;break;case"pointerover":case"pointerout":Zo.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":ea.delete(e.pointerId)}}function mo(t,e,n,r,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=ka(e),e!==null&&dp(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function gS(t,e,n,r,i){switch(e){case"focusin":return Ir=mo(Ir,t,e,n,r,i),!0;case"dragenter":return Ar=mo(Ar,t,e,n,r,i),!0;case"mouseover":return Sr=mo(Sr,t,e,n,r,i),!0;case"pointerover":var s=i.pointerId;return Zo.set(s,mo(Zo.get(s)||null,t,e,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,ea.set(s,mo(ea.get(s)||null,t,e,n,r,i)),!0}return!1}function uE(t){var e=si(t.target);if(e!==null){var n=Si(e);if(n!==null){if(e=n.tag,e===13){if(e=Y0(n),e!==null){t.blockedOn=e,lE(t.priority,function(){oE(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function jl(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Vd(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);kd=r,n.target.dispatchEvent(r),kd=null}else return e=ka(n),e!==null&&dp(e),t.blockedOn=n,!1;e.shift()}return!0}function py(t,e,n){jl(t)&&n.delete(e)}function yS(){Od=!1,Ir!==null&&jl(Ir)&&(Ir=null),Ar!==null&&jl(Ar)&&(Ar=null),Sr!==null&&jl(Sr)&&(Sr=null),Zo.forEac
vendor: 9,291 bytes, line 38
38h(py),ea.forEach(py)}function go(t,e){t.blockedOn===e&&(t.blockedOn=null,Od||(Od=!0,zt.unstable_scheduleCallback(zt.unstable_NormalPriority,yS)))}function ta(t){function e(i){return go(i,t)}if(0<yl.length){go(yl[0],t);for(var n=1;n<yl.length;n++){var r=yl[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Ir!==null&&go(Ir,t),Ar!==null&&go(Ar,t),Sr!==null&&go(Sr,t),Zo.forEach(e),ea.forEach(e),n=0;n<hr.length;n++)r=hr[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<hr.length&&(n=hr[0],n.blockedOn===null);)uE(n),n.blockedOn===null&&hr.shift()}var as=Zn.ReactCurrentBatchConfig,Tu=!0;function _S(t,e,n,r){var i=de,s=as.transition;as.transition=null;try{de=1,fp(t,e,n,r)}finally{de=i,as.transition=s}}function vS(t,e,n,r){var i=de,s=as.transition;as.transition=null;try{de=4,fp(t,e,n,r)}finally{de=i,as.transition=s}}function fp(t,e,n,r){if(Tu){var i=Vd(t,e,n,r);if(i===null)Bh(t,e,r,Iu,n),fy(t,r);else if(gS(i,t,e,n,r))r.stopPropagation();else if(fy(t,r),e&4&&-1<mS.indexOf(t)){for(;i!==null;){var s=ka(i);if(s!==null&&sE(s),s=Vd(t,e,n,r),s===null&&Bh(t,e,r,Iu,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Bh(t,e,r,null,n)}}var Iu=null;function Vd(t,e,n,r){if(Iu=null,t=up(r),t=si(t),t!==null)if(e=Si(t),e===null)t=null;else if(n=e.tag,n===13){if(t=Y0(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Iu=t,null}function cE(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(oS()){case cp:return 1;case tE:return 4;case Eu:case aS:return 16;case nE:return 536870912;default:return 16}default:return 16}}var vr=null,pp=null,zl=null;function hE(){if(zl)return zl;var t,e=pp,n=e.length,r,i="value"in vr?vr.value:vr.textContent,s=i.length;for(t=0;t<n&&e[t]===i[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===i[s-r];r++);return zl=i.slice(t,1<r?1-r:void 0)}function $l(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function _l(){return!0}function my(){return!1}function Bt(t){function e(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(n=t[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?_l:my,this.isPropagationStopped=my,this}return Ce(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=_l)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=_l)},persist:function(){},isPersistent:_l}),e}var Ds={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mp=Bt(Ds),Pa=Ce({},Ds,{view:0,detail:0}),ES=Bt(Pa),Oh,Vh,yo,mc=Ce({},Pa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gp,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==yo&&(yo&&t.type==="mousemove"?(Oh=t.screenX-yo.screenX,Vh=t.screenY-yo.screenY):Vh=Oh=0,yo=t),Oh)},movementY:function(t){return"movementY"in t?t.movementY:Vh}}),gy=Bt(mc),wS=Ce({},mc,{dataTransfer:0}),TS=Bt(wS),IS=Ce({},Pa,{relatedTarget:0}),Lh=Bt(IS),AS=Ce({},Ds,{animationName:0,elapsedTime:0,pseudoElement:0}),SS=Bt(AS),RS=Ce({},Ds,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),CS=Bt(RS),PS=Ce({},Ds,{data:0}),yy=Bt(PS),kS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},bS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function NS(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=bS[t])?!!e[t]:!1}function gp(){return NS}var DS=Ce({},Pa,{key:function(t){if(t.key){var e=kS[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=$l(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?xS[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gp,charCode:function(t){return t.type==="keypress"?$l(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?$l(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),OS=Bt(DS),VS=Ce({},mc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_y=Bt(VS),LS=Ce({},Pa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gp}),MS=Bt(LS),FS=Ce({},Ds,{propertyName:0,elapsedTime:0,pseudoElement:0}),US=Bt(FS),jS=Ce({},mc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),zS=Bt(jS),$S=[9,13,27,32],yp=qn&&"CompositionEvent"in window,Lo=null;qn&&"documentMode"in document&&(Lo=document.documentMode);var BS=qn&&"TextEvent"in window&&!Lo,dE=qn&&(!yp||Lo&&8<Lo&&11>=Lo),vy=" ",Ey=!1;function fE(t,e){switch(t){case"keyup":return $S.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pE(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Gi=!1;function WS(t,e){switch(t){case"compositionend":return pE(e);case"keypress":return e.which!==32?null:(Ey=!0,vy);case"textInput":return t=e.data,t===vy&&Ey?null:t;default:return null}}function qS(t,e){if(Gi)return t==="compositionend"||!yp&&fE(t,e)?(t=hE(),zl=pp=vr=null,Gi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return dE&&e.locale!=="ko"?null:e.data;default:return null}}var HS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function wy(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!HS[t.type]:e==="textarea"}function mE(t,e,n,r){H0(r),e=Au(e,"onChange"),0<e.length&&(n=new mp("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Mo=null,na=null;function GS(t){RE(t,0)}function gc(t){var e=Xi(t);if(U0(e))return t}function KS(t,e){if(t==="change")return e}var gE=!1;if(qn){var Mh;if(qn){var Fh="oninput"in document;if(!Fh){var Ty=document.createElement("div");Ty.setAttribute("oninput","return;"),Fh=typeof Ty.oninput=="function"}Mh=Fh}else Mh=!1;gE=Mh&&(!document.documentMode||9<document.documentMode)}function Iy(){Mo&&(Mo.detachEvent("onpropertychange",yE),na=Mo=null)}function yE(t){if(t.propertyName==="value"&&gc(na)){var e=[];mE(e,na,t,up(t)),X0(GS,e)}}function QS(t,e,n){t==="focusin"?(Iy(),Mo=e,na=n,Mo.attachEvent("onpropertychange",yE)):t==="focusout"&&Iy()}function XS(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return gc(na)}function YS(t,e){if(t==="click")return gc(e)}function JS(t,e){if(t==="input"||t==="change")return gc(e)}function ZS(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var un=typeof Object.is=="function"?Object.is:ZS;function ra(t,e){if(un(t,e))return!0;
vendor: 4,808 bytes, line 38
38if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!yd.call(e,i)||!un(t[i],e[i]))return!1}return!0}function Ay(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Sy(t,e){var n=Ay(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ay(n)}}function _E(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?_E(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function vE(){for(var t=window,e=yu();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=yu(t.document)}return e}function _p(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function eR(t){var e=vE(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&_E(n.ownerDocument.documentElement,n)){if(r!==null&&_p(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=Sy(n,s);var o=Sy(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var tR=qn&&"documentMode"in document&&11>=document.documentMode,Ki=null,Ld=null,Fo=null,Md=!1;function Ry(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Md||Ki==null||Ki!==yu(r)||(r=Ki,"selectionStart"in r&&_p(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Fo&&ra(Fo,r)||(Fo=r,r=Au(Ld,"onSelect"),0<r.length&&(e=new mp("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Ki)))}function vl(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Qi={animationend:vl("Animation","AnimationEnd"),animationiteration:vl("Animation","AnimationIteration"),animationstart:vl("Animation","AnimationStart"),transitionend:vl("Transition","TransitionEnd")},Uh={},EE={};qn&&(EE=document.createElement("div").style,"AnimationEvent"in window||(delete Qi.animationend.animation,delete Qi.animationiteration.animation,delete Qi.animationstart.animation),"TransitionEvent"in window||delete Qi.transitionend.transition);function yc(t){if(Uh[t])return Uh[t];if(!Qi[t])return t;var e=Qi[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in EE)return Uh[t]=e[n];return t}var wE=yc("animationend"),TE=yc("animationiteration"),IE=yc("animationstart"),AE=yc("transitionend"),SE=new Map,Cy="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Hr(t,e){SE.set(t,e),Ai(e,[t])}for(var jh=0;jh<Cy.length;jh++){var zh=Cy[jh],nR=zh.toLowerCase(),rR=zh[0].toUpperCase()+zh.slice(1);Hr(nR,"on"+rR)}Hr(wE,"onAnimationEnd");Hr(TE,"onAnimationIteration");Hr(IE,"onAnimationStart");Hr("dblclick","onDoubleClick");Hr("focusin","onFocus");Hr("focusout","onBlur");Hr(AE,"onTransitionEnd");ps("onMouseEnter",["mouseout","mouseover"]);ps("onMouseLeave",["mouseout","mouseover"]);ps("onPointerEnter",["pointerout","pointerover"]);ps("onPointerLeave",["pointerout","pointerover"]);Ai("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));
vendor: 4,770 bytes, line 38
38Ai("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ai("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ai("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ai("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ai("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ro="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),iR=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ro));function Py(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,nS(r,e,void 0,t),t.currentTarget=null}function RE(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var l=r[o],u=l.instance,c=l.currentTarget;if(l=l.listener,u!==s&&i.isPropagationStopped())break e;Py(i,l,c),s=u}else for(o=0;o<r.length;o++){if(l=r[o],u=l.instance,c=l.currentTarget,l=l.listener,u!==s&&i.isPropagationStopped())break e;Py(i,l,c),s=u}}}if(vu)throw t=Nd,vu=!1,Nd=null,t}function ve(t,e){var n=e[$d];n===void 0&&(n=e[$d]=new Set);var r=t+"__bubble";n.has(r)||(CE(e,t,2,!1),n.add(r))}function $h(t,e,n){var r=0;e&&(r|=4),CE(n,t,r,e)}var El="_reactListening"+Math.random().toString(36).slice(2);function ia(t){if(!t[El]){t[El]=!0,O0.forEach(function(n){n!=="selectionchange"&&(iR.has(n)||$h(n,!1,t),$h(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[El]||(e[El]=!0,$h("selectionchange",!1,e))}}function CE(t,e,n,r){switch(cE(e)){case 1:var i=_S;break;case 4:i=vS;break;default:i=fp}n=i.bind(null,e,n,t),i=void 0,!bd||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function Bh(t,e,n,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var u=o.tag;if((u===3||u===4)&&(u=o.stateNode.containerInfo,u===i||u.nodeType===8&&u.parentNode===i))return;o=o.return}for(;l!==null;){if(o=si(l),o===null)return;if(u=o.tag,u===5||u===6){r=s=o;continue e}l=l.parentNode}}r=r.return}X0(function(){var c=s,d=up(n),p=[];e:{var m=SE.get(t);if(m!==void 0){var v=mp,w=t;switch(t){case"keypress":if($l(n)===0)break e;case"keydown":case"keyup":v=OS;break;case"focusin":w="focus",v=Lh;break;case"focusout":w="blur",v=Lh;break;case"beforeblur":case"afterblur":v=Lh;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":v=gy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=TS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=MS;break;case wE:case TE:case IE:v=SS;break;case AE:v=US;break;case"scroll":v=ES;break;case"wheel":v=zS;break;case"copy":case"cut":case"paste":v=CS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=_y}var P=(e&4)!==0,C=!P&&t==="scroll",E=P?m!==null?m+"Capture":null:m;P=[];for(var g=c,T;g!==null;){T=g;var x=T.stateNode;if(T.tag===5&&x!==null&&(T=x,E!==null&&(x=Jo(g,E),x!=null&&P.push(sa(g,x,T)))),C)break;g=g.return}0<P.length&&(m=new v(m,w,null,n,d),p.push({event:m,listeners:P}))}}if(!(e&7)){e:{if(m=t==="mouseover"||t==="pointerover",v=t==="mouseout"||t==="pointerout",m&&n!==kd&&(w=n.relatedTarget||n.fromElement)&&(si(w)||w[Hn]))break e;if((v||m)&&(m=d.window===d?d:(m=d.ownerDocument)?m.defaultView||m.parentWindow:window,v?(w=n.relatedTarget||n.toElement,v=c,w=w?si(w):null,w!==null&&(C=Si(w),w!==C||w.tag!==5&&w.tag!==6)&&(w=null)):(v=null,w=c),v!==w)){if(P=gy,x="onMouseLeave",E="onMouseEnter",g="mouse",(t==="pointerout"||t==="pointerover")&&(P=_y,x="onPointerLeave",E="onPointerEnter",g="pointer"),C=v==null?m:Xi(v),T=w==null?m:Xi(w),m=new P(x,g+"leave",v,n,d),m.target=C,m.relatedTarget=T,x=null,si(d)===c&&(P=new P(E,g+"enter",w,n,d),P.target=T,P.relatedTarget=C,x=P),C=x,v&&w)t:{for(P=v,E=w,g=0,T=P;T;T=Ui(T))g++;for(T=0,x=E;x;x=Ui(x))T++;for(;0<g-T;)P=Ui(P),g--;for(;0<T-g;)E=Ui(E),T--;for(;g--;){if(P===E||E!==null&&P===E.alternate)break t;P=Ui(P),E=Ui(E)}P=null}else P=null;v!==null&&ky(p,m,v,P,!1),w!==null&&C!==null&&ky(p,C,w,P,!0)}}
vendor: 4,716 bytes, lines 38-39
38e:{if(m=c?Xi(c):window,v=m.nodeName&&m.nodeName.toLowerCase(),v==="select"||v==="input"&&m.type==="file")var F=KS;else if(wy(m))if(gE)F=JS;else{F=XS;var U=QS}else(v=m.nodeName)&&v.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(F=YS);if(F&&(F=F(t,c))){mE(p,F,n,d);break e}U&&U(t,m,c),t==="focusout"&&(U=m._wrapperState)&&U.controlled&&m.type==="number"&&Ad(m,"number",m.value)}switch(U=c?Xi(c):window,t){case"focusin":(wy(U)||U.contentEditable==="true")&&(Ki=U,Ld=c,Fo=null);break;case"focusout":Fo=Ld=Ki=null;break;case"mousedown":Md=!0;break;case"contextmenu":case"mouseup":case"dragend":Md=!1,Ry(p,n,d);break;case"selectionchange":if(tR)break;case"keydown":case"keyup":Ry(p,n,d)}var I;if(yp)e:{switch(t){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Gi?fE(t,n)&&(_="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(dE&&n.locale!=="ko"&&(Gi||_!=="onCompositionStart"?_==="onCompositionEnd"&&Gi&&(I=hE()):(vr=d,pp="value"in vr?vr.value:vr.textContent,Gi=!0)),U=Au(c,_),0<U.length&&(_=new yy(_,t,null,n,d),p.push({event:_,listeners:U}),I?_.data=I:(I=pE(n),I!==null&&(_.data=I)))),(I=BS?WS(t,n):qS(t,n))&&(c=Au(c,"onBeforeInput"),0<c.length&&(d=new yy("onBeforeInput","beforeinput",null,n,d),p.push({event:d,listeners:c}),d.data=I))}RE(p,e)})}function sa(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Au(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Jo(t,n),s!=null&&r.unshift(sa(t,s,i)),s=Jo(t,e),s!=null&&r.push(sa(t,s,i))),t=t.return}return r}function Ui(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function ky(t,e,n,r,i){for(var s=e._reactName,o=[];n!==null&&n!==r;){var l=n,u=l.alternate,c=l.stateNode;if(u!==null&&u===r)break;l.tag===5&&c!==null&&(l=c,i?(u=Jo(n,s),u!=null&&o.unshift(sa(n,u,l))):i||(u=Jo(n,s),u!=null&&o.push(sa(n,u,l)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var sR=/\r\n?/g,oR=/\u0000|\uFFFD/g;function xy(t){return(typeof t=="string"?t:""+t).replace(sR,`
39`).replace(oR,"")}function wl(t,e,n){if(e=xy(e),xy(t)!==e&&n)throw Error(j(425))}function Su(){}var Fd=null,Ud=null;function jd(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var zd=typeof setTimeout=="function"?setTimeout:void 0,aR=typeof clearTimeout=="function"?clearTimeout:void 0,by=typeof Promise=="function"?Promise:void 0,lR=typeof queueMicrotask=="function"?queueMicrotask:typeof by<"u"?function(t){return by.resolve(null).then(t).catch(uR)}:zd;function uR(t){setTimeout(function(){throw t})}function Wh(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),ta(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ta(e)}function Rr(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function Ny(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Os=Math.random().toString(36).slice(2),En="__reactFiber$"+Os,oa="__reactProps$"+Os,Hn="__reactContainer$"+Os,$d="__reactEvents$"+Os,cR="__reactListeners$"+Os,hR="__reactHandles$"+Os;function si(t){var e=t[En];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Hn]||n[En]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=Ny(t);t!==null;){if(n=t[En])return n;t=Ny(t)}return e}t=n,n=t.parentNode}return null}function ka(t){return t=t[En]||t[Hn],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Xi(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(j(33))}function _c(t){return t[oa]||null}var Bd=[],Yi=-1;function Gr(t){return{current:t}}function we(t){0>Yi||(t.current=Bd[Yi],Bd[Yi]=null,Yi--)}function ye(t,e){Yi++,Bd[Yi]=t.current,t.current=e}var Mr={},ht=Gr(Mr),kt=Gr(!1),pi=Mr;function ms(t,e){var n=t.type.contextTypes;if(!n)return Mr;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function xt(t){return t=t.childContextTypes,t!=null}function Ru(){we(kt),we(ht)}function Dy(t,e,n){if(ht.current!==Mr)throw Error(j(168));
vendor: 19,758 bytes, line 39
39ye(ht,e),ye(kt,n)}function PE(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(j(108,QA(t)||"Unknown",i));return Ce({},n,r)}function Cu(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Mr,pi=ht.current,ye(ht,t),ye(kt,kt.current),!0}function Oy(t,e,n){var r=t.stateNode;if(!r)throw Error(j(169));n?(t=PE(t,e,pi),r.__reactInternalMemoizedMergedChildContext=t,we(kt),we(ht),ye(ht,t)):we(kt),ye(kt,n)}var Fn=null,vc=!1,qh=!1;function kE(t){Fn===null?Fn=[t]:Fn.push(t)}function dR(t){vc=!0,kE(t)}function Kr(){if(!qh&&Fn!==null){qh=!0;var t=0,e=de;try{var n=Fn;for(de=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Fn=null,vc=!1}catch(i){throw Fn!==null&&(Fn=Fn.slice(t+1)),eE(cp,Kr),i}finally{de=e,qh=!1}}return null}var Ji=[],Zi=0,Pu=null,ku=0,Ht=[],Gt=0,mi=null,Un=1,jn="";function ni(t,e){Ji[Zi++]=ku,Ji[Zi++]=Pu,Pu=t,ku=e}function xE(t,e,n){Ht[Gt++]=Un,Ht[Gt++]=jn,Ht[Gt++]=mi,mi=t;var r=Un;t=jn;var i=32-an(r)-1;r&=~(1<<i),n+=1;var s=32-an(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Un=1<<32-an(e)+i|n<<i|r,jn=s+t}else Un=1<<s|n<<i|r,jn=t}function vp(t){t.return!==null&&(ni(t,1),xE(t,1,0))}function Ep(t){for(;t===Pu;)Pu=Ji[--Zi],Ji[Zi]=null,ku=Ji[--Zi],Ji[Zi]=null;for(;t===mi;)mi=Ht[--Gt],Ht[Gt]=null,jn=Ht[--Gt],Ht[Gt]=null,Un=Ht[--Gt],Ht[Gt]=null}var Ut=null,Lt=null,Ie=!1,sn=null;function bE(t,e){var n=Qt(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function Vy(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Ut=t,Lt=Rr(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Ut=t,Lt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=mi!==null?{id:Un,overflow:jn}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Qt(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Ut=t,Lt=null,!0):!1;default:return!1}}function Wd(t){return(t.mode&1)!==0&&(t.flags&128)===0}function qd(t){if(Ie){var e=Lt;if(e){var n=e;if(!Vy(t,e)){if(Wd(t))throw Error(j(418));e=Rr(n.nextSibling);var r=Ut;e&&Vy(t,e)?bE(r,n):(t.flags=t.flags&-4097|2,Ie=!1,Ut=t)}}else{if(Wd(t))throw Error(j(418));t.flags=t.flags&-4097|2,Ie=!1,Ut=t}}}function Ly(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Ut=t}function Tl(t){if(t!==Ut)return!1;if(!Ie)return Ly(t),Ie=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!jd(t.type,t.memoizedProps)),e&&(e=Lt)){if(Wd(t))throw NE(),Error(j(418));for(;e;)bE(t,e),e=Rr(e.nextSibling)}if(Ly(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(j(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Lt=Rr(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Lt=null}}else Lt=Ut?Rr(t.stateNode.nextSibling):null;return!0}function NE(){for(var t=Lt;t;)t=Rr(t.nextSibling)}function gs(){Lt=Ut=null,Ie=!1}function wp(t){sn===null?sn=[t]:sn.push(t)}var fR=Zn.ReactCurrentBatchConfig;function _o(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(j(309));var r=n.stateNode}if(!r)throw Error(j(147,t));var i=r,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var l=i.refs;o===null?delete l[s]:l[s]=o},e._stringRef=s,e)}if(typeof t!="string")throw Error(j(284));if(!n._owner)throw Error(j(290,t))}return t}function Il(t,e){throw t=Object.prototype.toString.call(e),Error(j(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function My(t){var e=t._init;return e(t._payload)}function DE(t){function e(E,g){if(t){var T=E.deletions;T===null?(E.deletions=[g],E.flags|=16):T.push(g)}}function n(E,g){if(!t)return null;for(;g!==null;)e(E,g),g=g.sibling;return null}function r(E,g){for(E=new Map;g!==null;)g.key!==null?E.set(g.key,g):E.set(g.index,g),g=g.sibling;return E}function i(E,g){return E=xr(E,g),E.index=0,E.sibling=null,E}function s(E,g,T){return E.index=T,t?(T=E.alternate,T!==null?(T=T.index,T<g?(E.flags|=2,g):T):(E.flags|=2,g)):(E.flags|=1048576,g)}function o(E){return t&&E.alternate===null&&(E.flags|=2),E}function l(E,g,T,x){return g===null||g.tag!==6?(g=Jh(T,E.mode,x),g.return=E,g):(g=i(g,T),g.return=E,g)}function u(E,g,T,x){var F=T.type;return F===Hi?d(E,g,T.props.children,x,T.key):g!==null&&(g.elementType===F||typeof F=="object"&&F!==null&&F.$$typeof===ur&&My(F)===g.type)?(x=i(g,T.props),x.ref=_o(E,g,T),x.return=E,x):(x=Ql(T.type,T.key,T.props,null,E.mode,x),x.ref=_o(E,g,T),x.return=E,x)}function c(E,g,T,x){return g===null||g.tag!==4||g.stateNode.containerInfo!==T.containerInfo||g.stateNode.implementation!==T.implementation?(g=Zh(T,E.mode,x),g.return=E,g):(g=i(g,T.children||[]),g.return=E,g)}function d(E,g,T,x,F){return g===null||g.tag!==7?(g=ci(T,E.mode,x,F),g.return=E,g):(g=i(g,T),g.return=E,g)}function p(E,g,T){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Jh(""+g,E.mode,T),g.return=E,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case dl:return T=Ql(g.type,g.key,g.props,null,E.mode,T),T.ref=_o(E,null,g),T.return=E,T;case qi:return g=Zh(g,E.mode,T),g.return=E,g;case ur:var x=g._init;return p(E,x(g._payload),T)}if(Ao(g)||fo(g))return g=ci(g,E.mode,T,null),g.return=E,g;Il(E,g)}return null}function m(E,g,T,x){var F=g!==null?g.key:null;if(typeof T=="string"&&T!==""||typeof T=="number")return F!==null?null:l(E,g,""+T,x);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case dl:return T.key===F?u(E,g,T,x):null;case qi:return T.key===F?c(E,g,T,x):null;case ur:return F=T._init,m(E,g,F(T._payload),x)}if(Ao(T)||fo(T))return F!==null?null:d(E,g,T,x,null);Il(E,T)}return null}function v(E,g,T,x,F){if(typeof x=="string"&&x!==""||typeof x=="number")return E=E.get(T)||null,l(g,E,""+x,F);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case dl:return E=E.get(x.key===null?T:x.key)||null,u(g,E,x,F);case qi:return E=E.get(x.key===null?T:x.key)||null,c(g,E,x,F);case ur:var U=x._init;return v(E,g,T,U(x._payload),F)}if(Ao(x)||fo(x))return E=E.get(T)||null,d(g,E,x,F,null);Il(g,x)}return null}function w(E,g,T,x){for(var F=null,U=null,I=g,_=g=0,A=null;I!==null&&_<T.length;_++){I.index>_?(A=I,I=null):A=I.sibling;var S=m(E,I,T[_],x);if(S===null){I===null&&(I=A);break}t&&I&&S.alternate===null&&e(E,I),g=s(S,g,_),U===null?F=S:U.sibling=S,U=S,I=A}if(_===T.length)return n(E,I),Ie&&ni(E,_),F;if(I===null){for(;_<T.length;_++)I=p(E,T[_],x),I!==null&&(g=s(I,g,_),U===null?F=I:U.sibling=I,U=I);return Ie&&ni(E,_),F}for(I=r(E,I);_<T.length;_++)A=v(I,E,_,T[_],x),A!==null&&(t&&A.alternate!==null&&I.delete(A.key===null?_:A.key),g=s(A,g,_),U===null?F=A:U.sibling=A,U=A);return t&&I.forEach(function(k){return e(E,k)}),Ie&&ni(E,_),F}function P(E,g,T,x){var F=fo(T);if(typeof F!="function")throw Error(j(150));if(T=F.call(T),T==null)throw Error(j(151));for(var U=F=null,I=g,_=g=0,A=null,S=T.next();I!==null&&!S.done;_++,S=T.next()){I.index>_?(A=I,I=null):A=I.sibling;var k=m(E,I,S.value,x);if(k===null){I===null&&(I=A);break}t&&I&&k.alternate===null&&e(E,I),g=s(k,g,_),U===null?F=k:U.sibling=k,U=k,I=A}if(S.done)return n(E,I),Ie&&ni(E,_),F;if(I===null){for(;!S.done;_++,S=T.next())S=p(E,S.value,x),S!==null&&(g=s(S,g,_),U===null?F=S:U.sibling=S,U=S);return Ie&&ni(E,_),F}for(I=r(E,I);!S.done;_++,S=T.next())S=v(I,E,_,S.value,x),S!==null&&(t&&S.alternate!==null&&I.delete(S.key===null?_:S.key),g=s(S,g,_),U===null?F=S:U.sibling=S,U=S);return t&&I.forEach(function(b){return e(E,b)}),Ie&&ni(E,_),F}function C(E,g,T,x){if(typeof T=="object"&&T!==null&&T.type===Hi&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case dl:e:{for(var F=T.key,U=g;U!==null;){if(U.key===F){if(F=T.type,F===Hi){if(U.tag===7){n(E,U.sibling),g=i(U,T.props.children),g.return=E,E=g;break e}}else if(U.elementType===F||typeof F=="object"&&F!==null&&F.$$typeof===ur&&My(F)===U.type){n(E,U.sibling),g=i(U,T.props),g.ref=_o(E,U,T),g.return=E,E=g;break e}n(E,U);break}else e(E,U);U=U.sibling}T.type===Hi?(g=ci(T.props.children,E.mode,x,T.key),g.return=E,E=g):(x=Ql(T.type,T.key,T.props,null,E.mode,x),x.ref=_o(E,g,T),x.return=E,E=x)}return o(E);case qi:e:{for(U=T.key;g!==null;){if(g.key===U)if(g.tag===4&&g.stateNode.containerInfo===T.containerInfo&&g.stateNode.implementation===T.implementation){n(E,g.sibling),g=i(g,T.children||[]),g.return=E,E=g;break e}else{n(E,g);break}else e(E,g);g=g.sibling}g=Zh(T,E.mode,x),g.return=E,E=g}return o(E);case ur:return U=T._init,C(E,g,U(T._payload),x)}if(Ao(T))return w(E,g,T,x);if(fo(T))return P(E,g,T,x);Il(E,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,g!==null&&g.tag===6?(n(E,g.sibling),g=i(g,T),g.return=E,E=g):(n(E,g),g=Jh(T,E.mode,x),g.return=E,E=g),o(E)):n(E,g)}return C}var ys=DE(!0),OE=DE(!1),xu=Gr(null),bu=null,es=null,Tp=null;function Ip(){Tp=es=bu=null}function Ap(t){var e=xu.current;we(xu),t._currentValue=e}function Hd(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function ls(t,e){bu=t,Tp=es=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Ct=!0),t.firstContext=null)}function Yt(t){var e=t._currentValue;if(Tp!==t)if(t={context:t,memoizedValue:e,next:null},es===null){if(bu===null)throw Error(j(308));es=t,bu.dependencies={lanes:0,firstContext:t}}else es=es.next=t;return e}var oi=null;function Sp(t){oi===null?oi=[t]:oi.push(t)}function VE(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Sp(e)):(n.next=i.next,i.next=n),e.interleaved=n,Gn(t,r)}function Gn(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var cr=!1;function Rp(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function LE(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Bn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Cr(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,le&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Gn(t,n)}return i=r.interleaved,i===null?(e.next=e,Sp(r)):(e.next=i.next,i.next=e),r.interleaved=e,Gn(t,n)}function Bl(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,hp(t,n)}}function Fy(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Nu(t,e,n,r){var i=t.updateQueue;cr=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,c=u.next;u.next=null,o===null?s=c:o.next=c,o=u;var d=t.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=c:l.next=c,d.lastBaseUpdate=u))}if(s!==null){var p=i.baseState;o=0,d=c=u=null,l=s;do{var m=l.lane,v=l.eventTime;if((r&m)===m){d!==null&&(d=d.next={eventTime:v,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=t,P=l;switch(m=e,v=n,P.tag){case 1:if(w=P.payload,typeof w=="function"){p=w.call(v,p,m);break e}p=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=P.payload,m=typeof w=="function"?w.call(v,p,m):w,m==null)break e;p=Ce({},p,m);break e;case 2:cr=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,m=i.effects,m===null?i.effects=[l]:m.push(l))}else v={eventTime:v,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(c=d=v,u=p):d=d.next=v,o|=m;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;m=l,l=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(!0);if(d===null&&(u=p),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=d,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);yi|=o,t.lanes=o,t.memoizedState=p}}function Uy(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(j(191,i));i.call(r)}}}var xa={},In=Gr(xa),aa=Gr(xa),la=Gr(xa);function ai(t){if(t===xa)throw Error(j(174));return t}function Cp(t,e){switch(ye(la,e),ye(aa,t),ye(In,xa),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Rd(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Rd(e,t)}we(In),ye(In,e)}function _s(){we(In),we(aa),we(la)}function ME(t){ai(la.current);var e=ai(In.current),n=Rd(e,t.type);e!==n&&(ye(aa,t),ye(In,n))}function Pp(t){aa.current===t&&(we(In),we(aa))}var Ae=Gr(0);function Du(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Hh=[];function kp(){for(var t=0;t<Hh.length;t++)Hh[t]._workInProgressVersionPrimary=null;Hh.length=0}var Wl=Zn.ReactCurrentDispatcher,Gh=Zn.ReactCurrentBatchConfig,gi=0,Se=null,je=null,qe=null,Ou=!1,Uo=!1,ua=0,pR=0;function st(){throw Error(j(321))}function xp(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!un(t[n],e[n]))return!1;return!0}function bp(t,e,n,r,i,s){if(gi=s,Se=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Wl.current=t===null||t.memoizedState===null?_R:vR,t=n(r,i),Uo){s=0;do{if(Uo=!1,ua=0,25<=s)throw Error(j(301));s+=1,qe=je=null,e.updateQueue=null,Wl.current=ER,t=n(r,i)}while(Uo)}if(Wl.current=Vu,e=je!==null&&je.next!==null,gi=0,qe=je=Se=null,Ou=!1,e)throw Error(j(300));return t}function Np(){var t=ua!==0;return ua=0,t}function _n(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qe===null?Se.memoizedState=qe=t:qe=qe.next=t,qe}function Jt(){if(je===null){var t=Se.alternate;t=t!==null?t.memoizedState:null}else t=je.next;var e=qe===null?Se.memoizedState:qe.next;if(e!==null)qe=e,je=t;else{if(t===null)throw Error(j(310));je=t,t={memoizedState:je.memoizedState,baseState:je.baseState,baseQueue:je.baseQueue,queue:je.queue,next:null},qe===null?Se.memoizedState=qe=t:qe=qe.next=t}return qe}function ca(t,e){return typeof e=="function"?e(t):e}function Kh(t){var e=Jt(),n=e.queue;if(n===null)throw Error(j(311));n.lastRenderedReducer=t;var r=je,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var l=o=null,u=null,c=s;do{var d=c.lane;if((gi&d)===d)u!==null&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:t(r,c.action);else{var p={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};u===null?(l=u=p,o=r):u=u.next=p,Se.lanes|=d,yi|=d}c=c.next}while(c!==null&&c!==s);u===null?o=r:u.next=l,un(r,e.memoizedState)||(Ct=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=u,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do s=i.lane,Se.lanes|=s,yi|=s,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Qh(t){var e=Jt(),n=e.queue;if(n===null)throw Error(j(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,s=e.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=t(s,o.action),o=o.next;while(o!==i);un(s,e.memoizedState)||(Ct=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function FE(){}function UE(t,e){var n=Se,r=Jt(),i=e(),s=!un(r.memoizedState,i);if(s&&(r.memoizedState=i,Ct=!0),r=r.queue,Dp($E.bind(null,n,r,t),[t]),r.getSnapshot!==e||s||qe!==null&&qe.memoizedState.tag&1){if(n.flags|=2048,ha(9,zE.bind(null,n,r,i,e),void 0,null),He===null)throw Error(j(349));gi&30||jE(n,e,i)}return i}function jE(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Se.updateQueue,e===null?(e={lastEffect:null,stores:null},Se.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function zE(t,e,n,r){e.value=n,e.getSnapshot=r,BE(e)&&WE(t)}function $E(t,e,n){return n(function(){BE(e)&&WE(t)})}function BE(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!un(t,n)}catch{return!0}}function WE(t){var e=Gn(t,1);e!==null&&ln(e,t,1,-1)}function jy(t){var e=_n();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:t},e.queue=t,t=t.dispatch=yR.bind(null,Se,t),[e.memoizedState,t]}function ha(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Se.updateQueue,e===null?(e={lastEffect:null,stores:null},Se.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function qE(){return Jt().memoizedState}function ql(t,e,n,r){var i=_n();Se.flags|=t,i.memoizedState=ha(1|e,n,void 0,r===void 0?null:r)}function Ec(t,e,n,r){var i=Jt();r=r===void 0?null:r;var s=void 0;if(je!==null){var o=je.memoizedState;if(s=o.destroy,r!==null&&xp(r,o.deps)){i.memoizedState=ha(e,n,s,r);return}}Se.flags|=t,i.memoizedState=ha(1|e,n,s,r)}function zy(t,e){return ql(8390656,8,t,e)}function Dp(t,e){return Ec(2048,8,t,e)}function HE(t,e){return Ec(4,2,t,e)}function GE(t,e){return Ec(4,4,t,e)}function KE(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function QE(t,e,n){return n=n!=null?n.concat([t]):null,Ec(4,4,KE.bind(null,e,t),n)}function Op(){}function XE(t,e){var n=Jt();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&xp(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function YE(t,e){var n=Jt();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&xp(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function JE(t,e,n){return gi&21?(un(n,e)||(n=rE(),Se.lanes|=n,yi|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Ct=!0),t.memoizedState=n)}function mR(t,e){var n=de;de=n!==0&&4>n?n:4,t(!0);var r=Gh.transition;Gh.transition={};try{t(!1),e()}finally{de=n,Gh.transition=r}}function ZE(){return Jt().memoizedState}function gR(t,e,n){var r=kr(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ew(t))tw(e,n);else if(n=VE(t,e,n,r),n!==null){var i=yt();ln(n,t,r,i),nw(n,e,r)}}function yR(t,e,n){var r=kr(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ew(t))tw(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,n);if(i.hasEagerState=!0,i.eagerState=l,un(l,o)){var u=e.interleaved;u===null?(i.next=i,Sp(e)):(i.next=u.next,u.next=i),e.interleaved=i;return}}catch{}finally{}
vendor: 2,766 bytes, line 39
39n=VE(t,e,i,r),n!==null&&(i=yt(),ln(n,t,r,i),nw(n,e,r))}}function ew(t){var e=t.alternate;return t===Se||e!==null&&e===Se}function tw(t,e){Uo=Ou=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function nw(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,hp(t,n)}}var Vu={readContext:Yt,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useInsertionEffect:st,useLayoutEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useMutableSource:st,useSyncExternalStore:st,useId:st,unstable_isNewReconciler:!1},_R={readContext:Yt,useCallback:function(t,e){return _n().memoizedState=[t,e===void 0?null:e],t},useContext:Yt,useEffect:zy,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,ql(4194308,4,KE.bind(null,e,t),n)},useLayoutEffect:function(t,e){return ql(4194308,4,t,e)},useInsertionEffect:function(t,e){return ql(4,2,t,e)},useMemo:function(t,e){var n=_n();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=_n();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=gR.bind(null,Se,t),[r.memoizedState,t]},useRef:function(t){var e=_n();return t={current:t},e.memoizedState=t},useState:jy,useDebugValue:Op,useDeferredValue:function(t){return _n().memoizedState=t},useTransition:function(){var t=jy(!1),e=t[0];return t=mR.bind(null,t[1]),_n().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Se,i=_n();if(Ie){if(n===void 0)throw Error(j(407));n=n()}else{if(n=e(),He===null)throw Error(j(349));gi&30||jE(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,zy($E.bind(null,r,s,t),[t]),r.flags|=2048,ha(9,zE.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=_n(),e=He.identifierPrefix;if(Ie){var n=jn,r=Un;n=(r&~(1<<32-an(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=ua++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=pR++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},vR={readContext:Yt,useCallback:XE,useContext:Yt,useEffect:Dp,useImperativeHandle:QE,useInsertionEffect:HE,useLayoutEffect:GE,useMemo:YE,useReducer:Kh,useRef:qE,useState:function(){return Kh(ca)},useDebugValue:Op,useDeferredValue:function(t){var e=Jt();return JE(e,je.memoizedState,t)},useTransition:function(){var t=Kh(ca)[0],e=Jt().memoizedState;return[t,e]},useMutableSource:FE,useSyncExternalStore:UE,useId:ZE,unstable_isNewReconciler:!1},ER={readContext:Yt,useCallback:XE,useContext:Yt,useEffect:Dp,useImperativeHandle:QE,useInsertionEffect:HE,useLayoutEffect:GE,useMemo:YE,useReducer:Qh,useRef
vendor: 4,996 bytes, lines 39-41
39:qE,useState:function(){return Qh(ca)},useDebugValue:Op,useDeferredValue:function(t){var e=Jt();return je===null?e.memoizedState=t:JE(e,je.memoizedState,t)},useTransition:function(){var t=Qh(ca)[0],e=Jt().memoizedState;return[t,e]},useMutableSource:FE,useSyncExternalStore:UE,useId:ZE,unstable_isNewReconciler:!1};function nn(t,e){if(t&&t.defaultProps){e=Ce({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function Gd(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Ce({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var wc={isMounted:function(t){return(t=t._reactInternals)?Si(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=yt(),i=kr(t),s=Bn(r,i);s.payload=e,n!=null&&(s.callback=n),e=Cr(t,s,i),e!==null&&(ln(e,t,i,r),Bl(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=yt(),i=kr(t),s=Bn(r,i);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=Cr(t,s,i),e!==null&&(ln(e,t,i,r),Bl(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=yt(),r=kr(t),i=Bn(n,r);i.tag=2,e!=null&&(i.callback=e),e=Cr(t,i,r),e!==null&&(ln(e,t,r,n),Bl(e,t,r))}};function $y(t,e,n,r,i,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!ra(n,r)||!ra(i,s):!0}function rw(t,e,n){var r=!1,i=Mr,s=e.contextType;return typeof s=="object"&&s!==null?s=Yt(s):(i=xt(e)?pi:ht.current,r=e.contextTypes,s=(r=r!=null)?ms(t,i):Mr),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=wc,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function By(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&wc.enqueueReplaceState(e,e.state,null)}function Kd(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},Rp(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=Yt(s):(s=xt(e)?pi:ht.current,i.context=ms(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(Gd(t,e,s,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&wc.enqueueReplaceState(i,i.state,null),Nu(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function vs(t,e){try{var n="",r=e;do n+=KA(r),r=r.return;while(r);var i=n}catch(s){i=`
40Error generating stack: `+s.message+`
41`+s.stack}return{value:t,source:e,stack:i,digest:null}}function Xh(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Qd(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var wR=typeof WeakMap=="function"?WeakMap:Map;function iw(t,e,n){n=Bn(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Mu||(Mu=!0,of=r),Qd(t,e)},n}function sw(t,e,n){n=Bn(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){Qd(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Qd(t,e),typeof r!="function"&&(Pr===null?Pr=new Set([this]):Pr.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function Wy(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new wR;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=VR.bind(null,t,e,n),e.then(t,t))}function qy(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Hy(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Bn(-1,1),e.tag=2,Cr(n,e,1))),n.lanes|=1),t)}var TR=Zn.ReactCurrentOwner,Ct=!1;function gt(t,e,n,r){e.child=t===null?OE(e,null,n,r):ys(e,t.child,n,r)}function Gy(t,e,n,r,i){n=n.render;var s=e.ref;return ls(e,i),r=bp(t,e,n,r,s,i),n=Np(),t!==null&&!Ct?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Kn(t,e,i)):(Ie&&n&&vp(e),e.flags|=1,gt(t,e,r,i),e.child)}function Ky(t,e,n,r,i){if(t===null){var s=n.type;return typeof s=="function"&&!$p(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,ow(t,e,s,r,i)):(t=Ql(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:ra,n(o,r)&&t.ref===e.ref)return Kn(t,e,
vendor: 8,994 bytes, line 41
41i)}return e.flags|=1,t=xr(s,r),t.ref=e.ref,t.return=e,e.child=t}function ow(t,e,n,r,i){if(t!==null){var s=t.memoizedProps;if(ra(s,r)&&t.ref===e.ref)if(Ct=!1,e.pendingProps=r=s,(t.lanes&i)!==0)t.flags&131072&&(Ct=!0);else return e.lanes=t.lanes,Kn(t,e,i)}return Xd(t,e,n,r,i)}function aw(t,e,n){var r=e.pendingProps,i=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},ye(ns,Vt),Vt|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,ye(ns,Vt),Vt|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,ye(ns,Vt),Vt|=r}else s!==null?(r=s.baseLanes|n,e.memoizedState=null):r=n,ye(ns,Vt),Vt|=r;return gt(t,e,i,n),e.child}function lw(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Xd(t,e,n,r,i){var s=xt(n)?pi:ht.current;return s=ms(e,s),ls(e,i),n=bp(t,e,n,r,s,i),r=Np(),t!==null&&!Ct?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Kn(t,e,i)):(Ie&&r&&vp(e),e.flags|=1,gt(t,e,n,i),e.child)}function Qy(t,e,n,r,i){if(xt(n)){var s=!0;Cu(e)}else s=!1;if(ls(e,i),e.stateNode===null)Hl(t,e),rw(e,n,r),Kd(e,n,r,i),r=!0;else if(t===null){var o=e.stateNode,l=e.memoizedProps;o.props=l;var u=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Yt(c):(c=xt(n)?pi:ht.current,c=ms(e,c));var d=n.getDerivedStateFromProps,p=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";p||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||u!==c)&&By(e,o,r,c),cr=!1;var m=e.memoizedState;o.state=m,Nu(e,r,o,i),u=e.memoizedState,l!==r||m!==u||kt.current||cr?(typeof d=="function"&&(Gd(e,n,d,r),u=e.memoizedState),(l=cr||$y(e,n,l,r,m,u,c))?(p||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=u),o.props=r,o.state=u,o.context=c,r=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,LE(t,e),l=e.memoizedProps,c=e.type===e.elementType?l:nn(e.type,l),o.props=c,p=e.pendingProps,m=o.context,u=n.contextType,typeof u=="object"&&u!==null?u=Yt(u):(u=xt(n)?pi:ht.current,u=ms(e,u));var v=n.getDerivedStateFromProps;(d=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==p||m!==u)&&By(e,o,r,u),cr=!1,m=e.memoizedState,o.state=m,Nu(e,r,o,i);var w=e.memoizedState;l!==p||m!==w||kt.current||cr?(typeof v=="function"&&(Gd(e,n,v,r),w=e.memoizedState),(c=cr||$y(e,n,c,r,m,w,u)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,w,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,w,u)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=w),o.props=r,o.state=w,o.context=u,r=c):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=1024),r=!1)}return Yd(t,e,n,r,s,i)}function Yd(t,e,n,r,i,s){lw(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&Oy(e,n,!1),Kn(t,e,s);r=e.stateNode,TR.current=e;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=ys(e,t.child,null,s),e.child=ys(e,null,l,s)):gt(t,e,l,s),e.memoizedState=r.state,i&&Oy(e,n,!0),e.child}function uw(t){var e=t.stateNode;e.pendingContext?Dy(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Dy(t,e.context,!1),Cp(t,e.containerInfo)}function Xy(t,e,n,r,i){return gs(),wp(i),e.flags|=256,gt(t,e,n,r),e.child}var Jd={dehydrated:null,treeContext:null,retryLane:0};function Zd(t){return{baseLanes:t,cachePool:null,transitions:null}}function cw(t,e,n){var r=e.pendingProps,i=Ae.current,s=!1,o=(e.flags&128)!==0,l;if((l=o)||(l=t!==null&&t.memoizedState===null?!1:(i&2)!==0),l?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),ye(Ae,i&1),t===null)return qd(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,t=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Ac(o,r,0,null),t=ci(t,r,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=Zd(n),e.memoizedState=Jd,t):Vp(e,o));if(i=t.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return IR(t,e,o,r,l,i,n);if(s){s=r.fallback,o=e.mode,i=t.child,l=i.sibling;var u={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=u,e.deletions=null):(r=xr(i,u),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?s=xr(l,s):(s=ci(s,o,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=t.child.memoizedState,o=o===null?Zd(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~n,e.memoizedState=Jd,r}return s=t.child,t=s.sibling,r=xr(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Vp(t,e){return e=Ac({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Al(t,e,n,r){return r!==null&&wp(r),ys(e,t.child,null,n),t=Vp(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function IR(t,e,n,r,i,s,o){if(n)return e.flags&256?(e.flags&=-257,r=Xh(Error(j(422))),Al(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=Ac({mode:"visible",children:r.children},i,0,null),s=ci(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&ys(e,t.child,null,o),e.child.memoizedState=Zd(o),e.memoizedState=Jd,s);if(!(e.mode&1))return Al(t,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(j(419)),r=Xh(s,r,void 0),Al(t,e,o,r)}if(l=(o&t.childLanes)!==0,Ct||l){if(r=He,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Gn(t,i),ln(r,t,i,-1))}return zp(),r=Xh(Error(j(421))),Al(t,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=LR.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,Lt=Rr(i.nextSibling),Ut=e,Ie=!0,sn=null,t!==null&&(Ht[Gt++]=Un,Ht[Gt++]=jn,Ht[Gt++]=mi,Un=t.id,jn=t.overflow,mi=e),e=Vp(e,r.children),e.flags|=4096,e)}function Yy(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Hd(t.return,e,n)}function Yh(t,e,n,r,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function hw(t,e,n){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(gt(t,e,r.children,n),r=Ae.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Yy(t,n,e);else if(t.tag===19)Yy(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(ye(Ae,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&Du(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Yh(e,!1,i,n,s);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&Du(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Yh(e,!0,n,null,s);break;case"together":Yh(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Hl(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}
vendor: 5,608 bytes, line 41
41function Kn(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),yi|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(j(153));if(e.child!==null){for(t=e.child,n=xr(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=xr(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function AR(t,e,n){switch(e.tag){case 3:uw(e),gs();break;case 5:ME(e);break;case 1:xt(e.type)&&Cu(e);break;case 4:Cp(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;ye(xu,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(ye(Ae,Ae.current&1),e.flags|=128,null):n&e.child.childLanes?cw(t,e,n):(ye(Ae,Ae.current&1),t=Kn(t,e,n),t!==null?t.sibling:null);ye(Ae,Ae.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return hw(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ye(Ae,Ae.current),r)break;return null;case 22:case 23:return e.lanes=0,aw(t,e,n)}return Kn(t,e,n)}var dw,ef,fw,pw;dw=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ef=function(){};fw=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,ai(In.current);var s=null;switch(n){case"input":i=Td(t,i),r=Td(t,r),s=[];break;case"select":i=Ce({},i,{value:void 0}),r=Ce({},r,{value:void 0}),s=[];break;case"textarea":i=Sd(t,i),r=Sd(t,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=Su)}Cd(n,r);var o;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var l=i[c];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Xo.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var u=r[c];if(l=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&u!==l&&(u!=null||l!=null))if(c==="style")if(l){for(o in l)!l.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in u)u.hasOwnProperty(o)&&l[o]!==u[o]&&(n||(n={}),n[o]=u[o])}else n||(s||(s=[]),s.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(s=s||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(s=s||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Xo.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&ve("scroll",t),s||l===u||(s=[])):(s=s||[]).push(c,u))}n&&(s=s||[]).push("style",n);var c=s;(e.updateQueue=c)&&(e.flags|=4)}};pw=function(t,e,n,r){n!==r&&(e.flags|=4)};function vo(t,e){if(!Ie)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function ot(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function SR(t,e,n){var r=e.pendingProps;switch(Ep(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(e),null;case 1:return xt(e.type)&&Ru(),ot(e),null;case 3:return r=e.stateNode,_s(),we(kt),we(ht),kp(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Tl(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,sn!==null&&(uf(sn),sn=null))),ef(t,e),ot(e),null;case 5:Pp(e);var i=ai(la.current);if(n=e.type,t!==null&&e.stateNode!=null)fw(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(j(166));return ot(e),null}if(t=ai(In.current),Tl(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[En]=e,r[oa]=s,t=(e.mode&1)!==0,n){case"dialog":ve("cancel",r),ve("close",r);break;case"iframe":case"object":case"embed":ve("load",r);break;case"video":case"audio":for(i=0;i<Ro.length;i++)ve(Ro[i],r);break;case"source":ve("error",r);break;case"img":case"image":case"link":ve("error",r),ve("load",r);break;case"details":ve("toggle",r);break;case"input":oy(r,s),ve("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ve("invalid",r);break;case"textarea":ly(r,s),ve("invalid",r)}Cd(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="children"?typeof l=="string"?r.textContent!==l&&(s.suppressHydrationWarning!==!0&&wl(r.textContent,l,t),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&wl(r.textContent,l,t),i=["children",""+l]):Xo.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&ve("scroll",r)}switch(n){case"input":fl(r),ay(r,s,!0);break;case"textarea":fl(r),uy(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Su)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=$0(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>
41",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[En]=e,t[oa]=r,dw(t,e,!1,!1),e.stateNode=t;e:{switch(o=Pd(n,r),n){case"dialog":ve("cancel",t),ve("close",t),i=r;break;case"iframe":case"object":case"embed":ve("load",t),i=r;break;case"video":case"audio":for(i=0;i<Ro.length;i++)ve(Ro[i],t);i=r;break;case"source":ve("error",t),i=r;break;case"img":case"image":case"link":ve("error",t),ve("load",t),i=r;break;case"details":ve("toggle",t),i=r;break;case"input":oy(t,r),i=Td(t,r),ve("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=Ce({},r,{value:void 0}),ve("invalid",t);break;case"textarea":ly(t,r),i=Sd(t,r),ve("invalid",t);break;default:i=r}Cd(n,i),l=i;for(s in l)if(l.hasOwnProperty(s)){var u=l[s];s==="style"?q0(t,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&B0(t,u)):s==="children"?typeof u=="string"?(n!=="textarea"||u!=="")&&Yo(t,u):typeof u=="number"&&Yo(t,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Xo.hasOwnProperty(s)?u!=null&&s==="onScroll"&&ve("scroll",t):u!=null&&sp(t,s,u,o))}switch(n){case"input":fl(t),ay(t,r,!1);break;case"textarea":fl(t),uy(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Lr(r.value));break;case"select":t.multiple=!!r.multiple,s=r.value,s!=null?is(t,!!r.multiple,s,!1):r.defaultValue!=null&&is(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Su)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return ot(e),null;case 6:if(t&&e.stateNode!=null)pw(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(j(166));if(n=ai(la.current),ai(In.current),Tl(e)){if(r=e.stateNode,n=e.memoizedProps,r[En]=e,(s=r.nodeValue!==n)&&(t=Ut,t!==null))switch(t.tag){case 3:wl(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&wl(r.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[En]=e,e.stateNode=r}return ot(e),null;case 13:if(we(Ae),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Ie&&Lt!==null&&e.mode&1&&!(e.flags&128))NE(),gs(),e.flags|=98560,s=!1;else if(s=Tl(e),r!==null&&r.dehydrated!==null){if(t===null){if(!s)throw Error(j(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(j(317));s[En]=e}else gs(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;ot(e),s=!1}else sn!==null&&(uf(sn),sn=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||Ae.current&1?ze===0&&(ze=3):zp())),e.updateQueue!==null&&(e.flags|=4),ot(e),null);case 4:return _s(),ef(t,e),t===null&&ia(e.stateNode.containerInfo),ot(e),null;
vendor: 27,472 bytes, line 41
41case 10:return Ap(e.type._context),ot(e),null;case 17:return xt(e.type)&&Ru(),ot(e),null;case 19:if(we(Ae),s=e.memoizedState,s===null)return ot(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)vo(s,!1);else{if(ze!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Du(t),o!==null){for(e.flags|=128,vo(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)s=n,t=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,t=o.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return ye(Ae,Ae.current&1|2),e.child}t=t.sibling}s.tail!==null&&Ve()>Es&&(e.flags|=128,r=!0,vo(s,!1),e.lanes=4194304)}else{if(!r)if(t=Du(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),vo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ie)return ot(e),null}else 2*Ve()-s.renderingStartTime>Es&&n!==1073741824&&(e.flags|=128,r=!0,vo(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Ve(),e.sibling=null,n=Ae.current,ye(Ae,r?n&1|2:n&1),e):(ot(e),null);case 22:case 23:return jp(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Vt&1073741824&&(ot(e),e.subtreeFlags&6&&(e.flags|=8192)):ot(e),null;case 24:return null;case 25:return null}throw Error(j(156,e.tag))}function RR(t,e){switch(Ep(e),e.tag){case 1:return xt(e.type)&&Ru(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return _s(),we(kt),we(ht),kp(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Pp(e),null;case 13:if(we(Ae),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(j(340));gs()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return we(Ae),null;case 4:return _s(),null;case 10:return Ap(e.type._context),null;case 22:case 23:return jp(),null;case 24:return null;default:return null}}var Sl=!1,ut=!1,CR=typeof WeakSet=="function"?WeakSet:Set,G=null;function ts(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xe(t,e,r)}else n.current=null}function tf(t,e,n){try{n()}catch(r){xe(t,e,r)}}var Jy=!1;function PR(t,e){if(Fd=Tu,t=vE(),_p(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,u=-1,c=0,d=0,p=t,m=null;t:for(;;){for(var v;p!==n||i!==0&&p.nodeType!==3||(l=o+i),p!==s||r!==0&&p.nodeType!==3||(u=o+r),p.nodeType===3&&(o+=p.nodeValue.length),(v=p.firstChild)!==null;)m=p,p=v;for(;;){if(p===t)break t;if(m===n&&++c===i&&(l=o),m===s&&++d===r&&(u=o),(v=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=v}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ud={focusedElem:t,selectionRange:n},Tu=!1,G=e;G!==null;)if(e=G,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,G=t;else for(;G!==null;){e=G;try{var w=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var P=w.memoizedProps,C=w.memoizedState,E=e.stateNode,g=E.getSnapshotBeforeUpdate(e.elementType===e.type?P:nn(e.type,P),C);E.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var T=e.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(j(163))}}catch(x){xe(e,e.return,x)}if(t=e.sibling,t!==null){t.return=e.return,G=t;break}G=e.return}return w=Jy,Jy=!1,w}function jo(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&tf(e,n,s)}i=i.next}while(i!==r)}}function Tc(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function nf(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function mw(t){var e=t.alternate;e!==null&&(t.alternate=null,mw(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[En],delete e[oa],delete e[$d],delete e[cR],delete e[hR])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function gw(t){return t.tag===5||t.tag===3||t.tag===4}function Zy(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||gw(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function rf(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Su));else if(r!==4&&(t=t.child,t!==null))for(rf(t,e,n),t=t.sibling;t!==null;)rf(t,e,n),t=t.sibling}function sf(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(sf(t,e,n),t=t.sibling;t!==null;)sf(t,e,n),t=t.sibling}var Qe=null,rn=!1;function ar(t,e,n){for(n=n.child;n!==null;)yw(t,e,n),n=n.sibling}function yw(t,e,n){if(Tn&&typeof Tn.onCommitFiberUnmount=="function")try{Tn.onCommitFiberUnmount(pc,n)}catch{}switch(n.tag){case 5:ut||ts(n,e);case 6:var r=Qe,i=rn;Qe=null,ar(t,e,n),Qe=r,rn=i,Qe!==null&&(rn?(t=Qe,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Qe.removeChild(n.stateNode));break;case 18:Qe!==null&&(rn?(t=Qe,n=n.stateNode,t.nodeType===8?Wh(t.parentNode,n):t.nodeType===1&&Wh(t,n),ta(t)):Wh(Qe,n.stateNode));break;case 4:r=Qe,i=rn,Qe=n.stateNode.containerInfo,rn=!0,ar(t,e,n),Qe=r,rn=i;break;case 0:case 11:case 14:case 15:if(!ut&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&tf(n,e,o),i=i.next}while(i!==r)}ar(t,e,n);break;case 1:if(!ut&&(ts(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){xe(n,e,l)}ar(t,e,n);break;case 21:ar(t,e,n);break;case 22:n.mode&1?(ut=(r=ut)||n.memoizedState!==null,ar(t,e,n),ut=r):ar(t,e,n);break;default:ar(t,e,n)}}function e_(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new CR),e.forEach(function(r){var i=MR.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function tn(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 5:Qe=l.stateNode,rn=!1;break e;case 3:Qe=l.stateNode.containerInfo,rn=!0;break e;case 4:Qe=l.stateNode.containerInfo,rn=!0;break e}l=l.return}if(Qe===null)throw Error(j(160));yw(s,o,i),Qe=null,rn=!1;var u=i.alternate;u!==null&&(u.return=null),i.return=null}catch(c){xe(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)_w(e,t),e=e.sibling}function _w(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(tn(e,t),yn(t),r&4){try{jo(3,t,t.return),Tc(3,t)}catch(P){xe(t,t.return,P)}try{jo(5,t,t.return)}catch(P){xe(t,t.return,P)}}break;case 1:tn(e,t),yn(t),r&512&&n!==null&&ts(n,n.return);break;case 5:if(tn(e,t),yn(t),r&512&&n!==null&&ts(n,n.return),t.flags&32){var i=t.stateNode;try{Yo(i,"")}catch(P){xe(t,t.return,P)}}if(r&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,o=n!==null?n.memoizedProps:s,l=t.type,u=t.updateQueue;if(t.updateQueue=null,u!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&j0(i,s),Pd(l,o);var c=Pd(l,s);for(o=0;o<u.length;o+=2){var d=u[o],p=u[o+1];d==="style"?q0(i,p):d==="dangerouslySetInnerHTML"?B0(i,p):d==="children"?Yo(i,p):sp(i,d,p,c)}switch(l){case"input":Id(i,s);break;case"textarea":z0(i,s);break;case"select":var m=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var v=s.value;v!=null?is(i,!!s.multiple,v,!1):m!==!!s.multiple&&(s.defaultValue!=null?is(i,!!s.multiple,s.defaultValue,!0):is(i,!!s.multiple,s.multiple?[]:"",!1))}i[oa]=s}catch(P){xe(t,t.return,P)}}break;case 6:if(tn(e,t),yn(t),r&4){if(t.stateNode===null)throw Error(j(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(P){xe(t,t.return,P)}}break;case 3:if(tn(e,t),yn(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ta(e.containerInfo)}catch(P){xe(t,t.return,P)}break;case 4:tn(e,t),yn(t);break;case 13:tn(e,t),yn(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Fp=Ve())),r&4&&e_(t);break;case 22:if(d=n!==null&&n.memoizedState!==null,t.mode&1?(ut=(c=ut)||d,tn(e,t),ut=c):tn(e,t),yn(t),r&8192){if(c=t.memoizedState!==null,(t.stateNode.isHidden=c)&&!d&&t.mode&1)for(G=t,d=t.child;d!==null;){for(p=G=d;G!==null;){switch(m=G,v=m.child,m.tag){case 0:case 11:case 14:case 15:jo(4,m,m.return);break;case 1:ts(m,m.return);var w=m.stateNode;if(typeof w.componentWillUnmount=="function"){r=m,n=m.return;try{e=r,w.props=e.memoizedProps,w.state=e.memoizedState,w.componentWillUnmount()}catch(P){xe(r,n,P)}}break;case 5:ts(m,m.return);break;case 22:if(m.memoizedState!==null){n_(p);continue}}v!==null?(v.return=m,G=v):n_(p)}d=d.sibling}e:for(d=null,p=t;;){if(p.tag===5){if(d===null){d=p;try{i=p.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=p.stateNode,u=p.memoizedProps.style,o=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=W0("display",o))}catch(P){xe(t,t.return,P)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=c?"":p.memoizedProps}catch(P){xe(t,t.return,P)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===t)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:tn(e,t),yn(t),r&4&&e_(t);break;case 21:break;default:tn(e,t),yn(t)}}function yn(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(gw(n)){var r=n;break e}n=n.return}throw Error(j(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Yo(i,""),r.flags&=-33);var s=Zy(t);sf(t,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,l=Zy(t);rf(t,l,o);break;default:throw Error(j(161))}}catch(u){xe(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function kR(t,e,n){G=t,vw(t)}function vw(t,e,n){for(var r=(t.mode&1)!==0;G!==null;){var i=G,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Sl;if(!o){var l=i.alternate,u=l!==null&&l.memoizedState!==null||ut;l=Sl;var c=ut;if(Sl=o,(ut=u)&&!c)for(G=i;G!==null;)o=G,u=o.child,o.tag===22&&o.memoizedState!==null?r_(i):u!==null?(u.return=o,G=u):r_(i);for(;s!==null;)G=s,vw(s),s=s.sibling;G=i,Sl=l,ut=c}t_(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,G=s):t_(t)}}function t_(t){for(;G!==null;){var e=G;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:ut||Tc(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!ut)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:nn(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&Uy(e,s,r);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}Uy(e,o,n)}break;case 5:var l=e.stateNode;if(n===null&&e.flags&4){n=l;var u=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&n.focus();break;case"img":u.src&&(n.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var p=d.dehydrated;p!==null&&ta(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(j(163))}ut||e.flags&512&&nf(e)}catch(m){xe(e,e.return,m)}}if(e===t){G=null;break}if(n=e.sibling,n!==null){n.return=e.return,G=n;break}G=e.return}}function n_(t){for(;G!==null;){var e=G;if(e===t){G=null;break}var n=e.sibling;if(n!==null){n.return=e.return,G=n;break}G=e.return}}function r_(t){for(;G!==null;){var e=G;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Tc(4,e)}catch(u){xe(e,n,u)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(u){xe(e,i,u)}}var s=e.return;try{nf(e)}catch(u){xe(e,s,u)}break;case 5:var o=e.return;try{nf(e)}catch(u){xe(e,o,u)}}}catch(u){xe(e,e.return,u)}if(e===t){G=null;break}var l=e.sibling;if(l!==null){l.return=e.return,G=l;break}G=e.return}}var xR=Math.ceil,Lu=Zn.ReactCurrentDispatcher,Lp=Zn.ReactCurrentOwner,Xt=Zn.ReactCurrentBatchConfig,le=0,He=null,Me=null,Je=0,Vt=0,ns=Gr(0),ze=0,da=null,yi=0,Ic=0,Mp=0,zo=null,At=null,Fp=0,Es=1/0,Mn=null,Mu=!1,of=null,Pr=null,Rl=!1,Er=null,Fu=0,$o=0,af=null,Gl=-1,Kl=0;function yt(){return le&6?Ve():Gl!==-1?Gl:Gl=Ve()}function kr(t){return t.mode&1?le&2&&Je!==0?Je&-Je:fR.transition!==null?(Kl===0&&(Kl=rE()),Kl):(t=de,t!==0||(t=window.event,t=t===void 0?16:cE(t.type)),t):1}function ln(t,e,n,r){if(50<$o)throw $o=0,af=null,Error(j(185));Ca(t,n,r),(!(le&2)||t!==He)&&(t===He&&(!(le&2)&&(Ic|=n),ze===4&&dr(t,Je)),bt(t,r),n===1&&le===0&&!(e.mode&1)&&(Es=Ve()+500,vc&&Kr()))}function bt(t,e){var n=t.callbackNode;fS(t,e);var r=wu(t,t===He?Je:0);if(r===0)n!==null&&dy(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&dy(n),e===1)t.tag===0?dR(i_.bind(null,t)):kE(i_.bind(null,t)),lR(function(){!(le&6)&&Kr()}),n=null;else{switch(iE(r)){case 1:n=cp;break;case 4:n=tE;break;case 16:n=Eu;break;case 536870912:n=nE;break;default:n=Eu}n=Cw(n,Ew.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function Ew(t,e){if(Gl=-1,Kl=0,le&6)throw Error(j(327));var n=t.callbackNode;if(us()&&t.callbackNode!==n)return null;var r=wu(t,t===He?Je:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=Uu(t,r);else{e=r;var i=le;le|=2;var s=Tw();(He!==t||Je!==e)&&(Mn=null,Es=Ve()+500,ui(t,e));do try{DR();break}catch(l){ww(t,l)}while(!0);Ip(),Lu.current=s,le=i,Me!==null?e=0:(He=null,Je=0,e=ze)}if(e!==0){if(e===2&&(i=Dd(t),i!==0&&(r=i,e=lf(t,i))),e===1)throw n=da,ui(t,0),dr(t,r),bt(t,Ve()),n;if(e===6)dr(t,r);else{if(i=t.current.alternate,!(r&30)&&!bR(i)&&(e=Uu(t,r),e===2&&(s=Dd(t),s!==0&&(r=s,e=lf(t,s))),e===1))throw n=da,ui(t,0),dr(t,r),bt(t,Ve()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(j(345));case 2:ri(t,At,Mn);break;case 3:if(dr(t,r),(r&130023424)===r&&(e=Fp+500-Ve(),10<e)){if(wu(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){yt(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=zd(ri.bind(null,t,At,Mn),e);break}ri(t,At,Mn);break;case 4:if(dr(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var o=31-an(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=Ve()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*xR(r/1960))-r,10<r){t.timeoutHandle=zd(ri.bind(null,t,At,Mn),r);break}ri(t,At,Mn);break;case 5:ri(t,At,Mn);break;default:throw Error(j(329))}}}return bt(t,Ve()),t.callbackNode===n?Ew.bind(null,t):null}function lf(t,e){var n=zo;return t.current.memoizedState.isDehydrated&&(ui(t,e).flags|=256),t=Uu(t,e),t!==2&&(e=At,At=n,e!==null&&uf(e)),t}function uf(t){At===null?At=t:At.push.apply(At,t)}function bR(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!un(s(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function dr(t,e){for(e&=~Mp,e&=~Ic,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-an(e),r=1<<n;t[n]=-1,e&=~r}}function i_(t){if(le&6)throw Error(j(327));us();var e=wu(t,0);if(!(e&1))return bt(t,Ve()),null;var n=Uu(t,e);if(t.tag!==0&&n===2){var r=Dd(t);r!==0&&(e=r,n=lf(t,r))}if(n===1)throw n=da,ui(t,0),dr(t,e),bt(t,Ve()),n;if(n===6)throw Error(j(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,ri(t,At,Mn),bt(t,Ve()),null}function Up(t,e){var n=le;le|=1;try{return t(e)}finally{le=n,le===0&&(Es=Ve()+500,vc&&Kr())}}function _i(t){Er!==null&&Er.tag===0&&!(le&6)&&us();var e=le;le|=1;var n=Xt.transition,r=de;try{if(Xt.transition=null,de=1,t)return t()}finally{de=r,Xt.transition=n,le=e,!(le&6)&&Kr()}}function jp(){Vt=ns.current,we(ns)}function ui(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,aR(n)),Me!==null)for(n=Me.return;n!==null;){var r=n;switch(Ep(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ru();break;case 3:_s(),we(kt),we(ht),kp();break;case 5:Pp(r);break;case 4:_s();break;case 13:we(Ae);break;case 19:we(Ae);break;case 10:Ap(r.type._context);break;case 22:case 23:jp()}n=n.return}if(He=t,Me=t=xr(t.current,null),Je=Vt=e,ze=0,da=null,Mp=Ic=yi=0,At=zo=null,oi!==null){for(e=0;e<oi.length;e++)if(n=oi[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}oi=null}return t}function ww(t,e){do{var n=Me;try{if(Ip(),Wl.current=Vu,Ou){for(var r=Se.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Ou=!1}if(gi=0,qe=je=Se=null,Uo=!1,ua=0,Lp.current=null,n===null||n.return===null){ze=1,da=e,Me=null;break}e:{var s=t,o=n.return,l=n,u=e;if(e=Je,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var c=u,d=l,p=d.tag;if(!(d.mode&1)&&(p===0||p===11||p===15)){var m=d.alternate;m?(d.updateQueue=m.updateQueue,d.memoizedState=m.memoizedState,d.lanes=m.lanes):(d.updateQueue=null,d.memoizedState=null)}var v=qy(o);if(v!==null){v.flags&=-257,Hy(v,o,l,s,e),v.mode&1&&Wy(s,c,e),e=v,u=c;var w=e.updateQueue;if(w===null){var P=new Set;P.add(u),e.updateQueue=P}else w.add(u);break e}else{if(!(e&1)){Wy(s,c,e),zp();break e}u=Error(j(426))}}else if(Ie&&l.mode&1){var C=qy(o);if(C!==null){!(C.flags&65536)&&(C.flags|=256),Hy(C,o,l,s,e),wp(vs(u,l));break e}}s=u=vs(u,l),ze!==4&&(ze=2),zo===null?zo=[s]:zo.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var E=iw(s,u,e);Fy(s,E);break e;case 1:l=u;var g=s.type,T=s.stateNode;if(!(s.flags&128)&&(typeof g.getDerivedStateFromError=="function"||T!==null&&typeof T.componentDidCatch=="function"&&(Pr===null||!Pr.has(T)))){s.flags|=65536,e&=-e,s.lanes|=e;var x=sw(s,l,e);Fy(s,x);break e}}s=s.return}while(s!==null)}Aw(n)}catch(F){e=F,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(!0)}function Tw(){var t=Lu.current;return Lu.current=Vu,t===null?Vu:t}function zp(){(ze===0||ze===3||ze===2)&&(ze=4),He===null||!(yi&268435455)&&!(Ic&268435455)||dr(He,Je)}function Uu(t,e){var n=le;le|=2;var r=Tw();(He!==t||Je!==e)&&(Mn=null,ui(t,e));do try{NR();break}catch(i){ww(t,i)}while(!0);if(Ip(),le=n,Lu.current=r,Me!==null)throw Error(j(261));return He=null,Je=0,ze}function NR(){for(;Me!==null;)Iw(Me)}function DR(){for(;Me!==null&&!iS();)Iw(Me)}function Iw(t){var e=Rw(t.alternate,t,Vt);t.memoizedProps=t.pendingProps,e===null?Aw(t):Me=e,Lp.current=null}function Aw(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=RR(n,e),n!==null){n.flags&=32767,Me=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{ze=6,Me=null;return}}else if(n=SR(n,e,Vt),n!==null){Me=n;return}if(e=e.sibling,e!==null){Me=e;return}Me=e=t}while(e!==null);ze===0&&(ze=5)}function ri(t,e,n){var r=de,i=Xt.transition;try{Xt.transition=null,de=1,OR(t,e,n,r)}finally{Xt.transition=i,de=r}return null}function OR(t,e,n,r){do us();while(Er!==null);if(le&6)throw Error(j(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(j(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(pS(t,s),t===He&&(Me=He=null,Je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Rl||(Rl=!0,Cw(Eu,function(){return us(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Xt.transition,Xt.transition=null;var o=de;de=1;var l=le;le|=4,Lp.current=null,PR(t,n),_w(n,t),eR(Ud),Tu=!!Fd,Ud=Fd=null,t.current=n,kR(n),sS(),le=l,de=o,Xt.transition=s}else t.current=n;if(Rl&&(Rl=!1,Er=t,Fu=i),s=t.pendingLanes,s===0&&(Pr=null),lS(n.stateNode),bt(t,Ve()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Mu)throw Mu=!1,t=of,of=null,t;return Fu&1&&t.tag!==0&&us(),s=t.pendingLanes,s&1?t===af?$o++:($o=0,af=t):$o=0,Kr(),null}function us(){if(Er!==null){var t=iE(Fu),e=Xt.transition,n=de;try{if(Xt.transition=null,de=16>t?16:t,Er===null)var r=!1;else{if(t=Er,Er=null,Fu=0,le&6)throw Error(j(331));var i=le;for(le|=4,G=t.current;G!==null;){var s=G,o=s.child;if(G.flags&16){var l=s.deletions;if(l!==null){for(var u=0;u<l.length;u++){var c=l[u];for(G=c;G!==null;){var d=G;switch(d.tag){case 0:case 11:case 15:jo(8,d,s)}var p=d.child;if(p!==null)p.return=d,G=p;else for(;G!==null;){d=G;var m=d.sibling,v=d.return;if(mw(d),d===c){G=null;break}if(m!==null){m.return=v,G=m;break}G=v}}}var w=s.alternate;if(w!==null){var P=w.child;if(P!==null){w.child=null;do{var C=P.sibling;P.sibling=null,P=C}while(P!==null)}}G=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,G=o;else e:for(;G!==null;){if(s=G,s.flags&2048)switch(s.tag){case 0:case 11:case 15:jo(9,s,s.return)}var E=s.sibling;if(E!==null){E.return=s.return,G=E;break e}G=s.return}}var g=t.current;for(G=g;G!==null;){o=G;var T=o.child;if(o.subtreeFlags&2064&&T!==null)T.return=o,G=T;else e:for(o=g;G!==null;){if(l=G,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Tc(9,l)}}catch(F){xe(l,l.return,F)}if(l===o){G=null;break e}var x=l.sibling;if(x!==null){x.return=l.return,G=x;break e}G=l.return}}if(le=i,Kr(),Tn&&typeof Tn.onPostCommitFiberRoot=="function")try{Tn.onPostCommitFiberRoot(pc,t)}catch{}r=!0}return r}finally{de=n,Xt.transition=e}}return!1}function s_(t,e,n){e=vs(n,e),e=iw(t,e,1),t=Cr(t,e,1),e=yt(),t!==null&&(Ca(t,1,e),bt(t,e))}function xe(t,e,n){if(t.tag===3)s_(t,t,n);else for(;e!==null;){if(e.tag===3){s_(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Pr===null||!Pr.has(r))){t=vs(n,t),t=sw(e,t,1),e=Cr(e,t,1),t=yt(),e!==null&&(Ca(e,1,t),bt(e,t));break}}e=e.return}}function VR(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=yt(),t.pingedLanes|=t.suspendedLanes&n,He===t&&(Je&n)===n&&(ze===4||ze===3&&(Je&130023424)===Je&&500>Ve()-Fp?ui(t,0):Mp|=n),bt(t,e)}function Sw(t,e){e===0&&(t.mode&1?(e=gl,gl<<=1,!(gl&130023424)&&(gl=4194304)):e=1);var n=yt();t=Gn(t,e),t!==null&&(Ca(t,e,n),bt(t,n))}function LR(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),Sw(t,n)}function MR(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(j(314))}r!==null&&r.delete(e),Sw(t,n)}var Rw;Rw=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||kt.current)Ct=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Ct=!1,AR(t,e,n);Ct=!!(t.flags&131072)}else Ct=!1,Ie&&e.flags&1048576&&xE(e,ku,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Hl(t,e),t=e.pendingProps;var i=ms(e,ht.current);ls(e,n),i=bp(null,e,r,t,i,n);var s=Np();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,xt(r)?(s=!0,Cu(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Rp(e),i.updater=wc,e.stateNode=i,i._reactInternals=e,Kd(e,r,t,n),e=Yd(null,e,r,!0,s,n)):(e.tag=0,Ie&&s&&vp(e),gt(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Hl(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=UR(r),t=nn(r,t),i){case 0:e=Xd(null,e,r,t,n);break e;case 1:e=Qy(null,e,r,t,n);break e;case 11:e=Gy(null,e,r,t,n);break e;case 14:e=Ky(null,e,r,nn(r.type,t),n);break e}throw Error(j(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:nn(r,i),Xd(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:nn(r,i),Qy(t,e,r,i,n);case 3:e:{if(uw(e),t===null)throw Error(j(387));r=e.pendingProps,s=e.memoizedState,i=s.element,LE(t,e),Nu(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=vs(Error(j(423)),e),e=Xy(t,e,r,n,i);break e}else if(r!==i){i=vs(Error(j(424)),e),e=Xy(t,e,r,n,i);break e}else for(Lt=Rr(e.stateNode.containerInfo.firstChild),Ut=e,Ie=!0,sn=null,n=OE(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gs(),r===i){e=Kn(t,e,n);break e}gt(t,e,r,n)}e=e.child}return e;case 5:return ME(e),t===null&&qd(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,jd(r,i)?o=null:s!==null&&jd(r,s)&&(e.flags|=32),lw(t,e),gt(t,e,o,n),e.child;case 6:return t===null&&qd(e),null;case 13:return cw(t,e,n);case 4:return Cp(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=ys(e,null,r,n):gt(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:nn(r,i),Gy(t,e,r,i,n);case 7:return gt(t,e,e.pendingProps,n),e.child;case 8:return gt(t,e,e.pendingProps.children,n),e.child;case 12:return gt(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,ye(xu,r._currentValue),r._currentValue=o,s!==null)if(un(s.value,o)){if(s.children===i.children&&!kt.current){e=Kn(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(s.tag===1){u=Bn(-1,n&-n),u.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),Hd(s.return,n,e),l.lanes|=n;break}u=u.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(j(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Hd(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}gt(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,ls(e,n),i=Yt(i),r=r(i),e.flags|=1,gt(t,e,r,n),e.child;case 14:return r=e.type,i=nn(r,e.pendingProps),i=nn(r.type,i),Ky(t,e,r,i,n);
vendor: 1,664 bytes, line 41
41case 15:return ow(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:nn(r,i),Hl(t,e),e.tag=1,xt(r)?(t=!0,Cu(e)):t=!1,ls(e,n),rw(e,r,i),Kd(e,r,i,n),Yd(null,e,r,!0,t,n);case 19:return hw(t,e,n);case 22:return aw(t,e,n)}throw Error(j(156,e.tag))};function Cw(t,e){return eE(t,e)}function FR(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qt(t,e,n,r){return new FR(t,e,n,r)}function $p(t){return t=t.prototype,!(!t||!t.isReactComponent)}function UR(t){if(typeof t=="function")return $p(t)?1:0;if(t!=null){if(t=t.$$typeof,t===ap)return 11;if(t===lp)return 14}return 2}function xr(t,e){var n=t.alternate;return n===null?(n=Qt(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Ql(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")$p(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Hi:return ci(n.children,i,s,e);case op:o=8,i|=8;break;
vendor: 4,391 bytes, line 41
41case _d:return t=Qt(12,n,e,i|2),t.elementType=_d,t.lanes=s,t;case vd:return t=Qt(13,n,e,i),t.elementType=vd,t.lanes=s,t;case Ed:return t=Qt(19,n,e,i),t.elementType=Ed,t.lanes=s,t;case M0:return Ac(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case V0:o=10;break e;case L0:o=9;break e;case ap:o=11;break e;case lp:o=14;break e;case ur:o=16,r=null;break e}throw Error(j(130,t==null?t:typeof t,""))}return e=Qt(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function ci(t,e,n,r){return t=Qt(7,t,r,e),t.lanes=n,t}function Ac(t,e,n,r){return t=Qt(22,t,r,e),t.elementType=M0,t.lanes=n,t.stateNode={isHidden:!1},t}function Jh(t,e,n){return t=Qt(6,t,null,e),t.lanes=n,t}function Zh(t,e,n){return e=Qt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function jR(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Dh(0),this.expirationTimes=Dh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Bp(t,e,n,r,i,s,o,l,u){return t=new jR(t,e,n,l,u),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Qt(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Rp(s),t}function zR(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:qi,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function Pw(t){if(!t)return Mr;t=t._reactInternals;e:{if(Si(t)!==t||t.tag!==1)throw Error(j(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(xt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(j(171))}if(t.tag===1){var n=t.type;if(xt(n))return PE(t,n,e)}return e}function kw(t,e,n,r,i,s,o,l,u){return t=Bp(n,r,!0,t,i,s,o,l,u),t.context=Pw(null),n=t.current,r=yt(),i=kr(n),s=Bn(r,i),s.callback=e??null,Cr(n,s,i),t.current.lanes=i,Ca(t,i,r),bt(t,r),t}function Sc(t,e,n,r){var i=e.current,s=yt(),o=kr(i);return n=Pw(n),e.context===null?e.context=n:e.pendingContext=n,e=Bn(s,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Cr(i,e,o),t!==null&&(ln(t,i,o,s),Bl(t,i,o)),o}function ju(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function o_(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function Wp(t,e){o_(t,e),(t=t.alternate)&&o_(t,e)}function $R(){return null}var xw=typeof reportError=="function"?reportError:function(t){console.error(t)};function qp(t){this._internalRoot=t}Rc.prototype.render=qp.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(j(409));Sc(t,e,null,null)};Rc.prototype.unmount=qp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;_i(function(){Sc(null,t,null,null)}),e[Hn]=null}};function Rc(t){this._internalRoot=t}Rc.prototype.unstable_scheduleHydration=function(t){if(t){var e=aE();t={blockedOn:null,target:t,priority:e};for(var n=0;n<hr.length&&e!==0&&e<hr[n].priority;n++);hr.splice(n,0,t),n===0&&uE(t)}};function Hp(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Cc(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function a_(){}function BR(t,e,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=ju(o);s.call(c)}}var o=kw(e,r,t,0,null,!1,!1,"",a_);return t._reactRootContainer=o,t[Hn]=o.current,ia(t.nodeType===8?t.parentNode:t),_i(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var c=ju(u);l.call(c)}}var u=Bp(t,0,!1,null,null,!1,!1,"",a_);return t._reactRootContainer=u,t[Hn]=u.current,ia(t.nodeType===8?t.parentNode:t),_i(function(){Sc(e,u,n,r)}),u}function Pc(t,e,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var l=i;
41i=function(){var u=ju(o);l.call(u)}}Sc(e,o,t,i)}else o=BR(n,e,t,i,r);return ju(o)}sE=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=So(e.pendingLanes);n!==0&&(hp(e,n|1),bt(e,Ve()),!(le&6)&&(Es=Ve()+500,Kr()))}break;case 13:_i(function(){var r=Gn(t,1);if(r!==null){var i=yt();ln(r,t,1,i)}}),Wp(t,1)}};dp=function(t){if(t.tag===13){var e=Gn(t,134217728);if(e!==null){var n=yt();ln(e,t,134217728,n)}Wp(t,134217728)}};oE=function(t){if(t.tag===13){var e=kr(t),n=Gn(t,e);if(n!==null){var r=yt();ln(n,t,e,r)}Wp(t,e)}};aE=function(){return de};lE=function(t,e){var n=de;try{return de=t,e()}finally{de=n}};xd=function(t,e,n){switch(e){case"input":if(Id(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=_c(r);if(!i)throw Error(j(90));U0(r),Id(r,i)}}}break;case"textarea":z0(t,n);break;case"select":e=n.value,e!=null&&is(t,!!n.multiple,e,!1)}};K0=Up;Q0=_i;var WR={usingClientEntryPoint:!1,Events:[ka,Xi,_c,H0,G0,Up]},Eo={findFiberByHostInstance:si,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},qR={bundleType:Eo.bundleType,version:Eo.version,rendererPackageName:Eo.rendererPackageName,rendererConfig:Eo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Zn.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=J0(t),t===null?null:t.stateNode},findFiberByHostInstance:Eo.findFiberByHostInstance||$R,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Cl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cl.isDisabled&&Cl.supportsFiber)try{pc=Cl.inject(qR),Tn=Cl}catch{}}$t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=WR;$t.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Hp(e))throw Error(j(200));return zR(t,e,null,n)};$t.createRoot=function(t,e){if(!Hp(t))throw Error(j(299));var n=!1,r="",i=xw;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=Bp(t,1,!1,null,null,n,!1,r,i),t[Hn]=e.current,ia(t.nodeType===8?t.parentNode:t),new qp(e)};$t.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(j(188)):(t=Object.keys(t).join(","),Error(j(268,t)));return t=J0(e),t=t===null?null:t.stateNode,t};$t.flushSync=function(t){return _i(t)};$t.hydrate=function(t,e,n){if(!Cc(e))throw Error(j(200));return Pc(null,t,e,!0,n)};$t.hydrateRoot=function(t,e,n){if(!Hp(t))throw Error(j(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=xw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=kw(e,null,t,1,n??null,i,!1,s,o),t[Hn]=e.current,ia(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new Rc(e)};$t.render=function(t,e,n){if(!Cc(e))throw Error(j(200));return Pc(null,t,e,!1,n)};$t.unmountComponentAtNode=function(t){if(!Cc(t))throw Error(j(40));return t._reactRootContainer?(_i(function(){Pc(null,null,t,!1,function(){t._reactRootContainer=null,t[Hn]=null})}),!0):!1};$t.unstable_batchedUpdates=Up;$t.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Cc(n))throw Error(j(200));if(t==null||t._reactInternals===void 0)throw Error(j(38));return Pc(t,e,n,!1,r)};$t.version="18.3.1-next-f1338f8080-20240426";function bw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(bw)}catch(t){console.error(t)}}bw(),b0.exports=$t;var HR=b0.exports,l_=HR;gd.createRoot=l_.createRoot,gd.hydrateRoot=l_.hydrateRoot;/**
42 * @remix-run/router v1.23.4
43 *
44 * Copyright (c) Remix Software Inc.
45 *
46 * This source code is licensed under the MIT license found in the
47 * LICENSE.md file in the root directory of this source tree.
48 *
49 * @license MIT
50 */function fa(){return fa=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},fa.apply(null,arguments)}var wr;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(wr||(wr={}));const u_="popstate";function GR(t){t===void 0&&(t={});function e(r,i){let{pathname:s,search:o,hash:l}=r.location;return cf("",{pathname:s,search:o,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:zu(i)}return QR(e,n,null,t)}function Re(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Nw(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function KR(){return Math.random().toString(36).substr(2,8)}function c_(t,e){return{usr:t.state,key:t.key,idx:e}}function cf(t,e,n,r){return n===void 0&&(n=null),fa({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Vs(e):e,{state:n,key:e&&e.key||r||KR()})}function zu(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Vs(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function QR(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,l=wr.Pop,u=null,c=d();c==null&&(c=0,o.replaceState(fa({},o.state,{idx:c}),""));function d(){return(o.state||{idx:null}).idx}function p(){l=wr.Pop;let C=d(),E=C==null?null:C-c;c=C,u&&u({action:l,location:P.location,delta:E})}function m(C,E){l=wr.Push;let g=cf(P.location,C,E);c=d()+1;let T=c_(g,c),x=P.createHref(g);try{o.pushState(T,"",x)}catch(F){if(F instanceof DOMException&&F.name==="DataCloneError")throw F;i.location.assign(x)}s&&u&&u({action:l,location:P.location,delta:1})}function v(C,E){l=wr.Replace;let g=cf(P.location,C,E);c=d();let T=c_(g,c),x=P.createHref(g);o.replaceState(T,"",x),s&&u&&u({action:l,location:P.location,delta:0})}function w(C){let E=i.location.origin!=="null"?i.location.origin:i.location.href,g=typeof C=="string"?C:zu(C);return g=g.replace(/ $/,"%20"),Re(E,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,E)}let P={get action(){return l},get location(){return t(i,o)},listen(C){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(u_,p),u=C,()=>{i.removeEventListener(u_,p),u=null}},createHref(C){return e(i,C)},createURL:w,encodeLocation(C){let E=w(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:m,replace:v,go(C){return o.go(C)}};return P}var h_;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(h_||(h_={}));function XR(t,e,n){return n===void 0&&(n="/"),YR(t,e,n)}function YR(t,e,n,r){let i=typeof e=="string"?Vs(e):e,s=ws(i.pathname||"/",n);if(s==null)return null;let o=Dw(t);JR(o);let l=null,u=uC(s);for(let c=0;l==null&&c<o.length;++c)l=aC(o[c],u);return l}function Dw(t,e,n,r){e===void 0&&(e=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,o,l)=>{let u={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};u.relativePath.startsWith("/")&&(Re(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not val
50id. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=br([r,u.relativePath]),d=n.concat(u);s.children&&s.children.length>0&&(Re(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Dw(s.children,e,d,c)),!(s.path==null&&!s.index)&&e.push({path:c,score:sC(c,s.index),routesMeta:d})};return t.forEach((s,o)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))i(s,o);else for(let u of Ow(s.path))i(s,o,u)}),e}function Ow(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=Ow(r.join("/")),l=[];return l.push(...o.map(u=>u===""?s:[s,u].join("/"))),i&&l.push(...o),l.map(u=>t.startsWith("/")&&u===""?"/":u)}function JR(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:oC(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const ZR=/^:[\w-]+$/,eC=3,tC=2,nC=1,rC=10,iC=-2,d_=t=>t==="*";function sC(t,e){let n=t.split("/"),r=n.length;return n.some(d_)&&(r+=iC),e&&(r+=tC),n.filter(i=>!d_(i)).reduce((i,s)=>i+(ZR.test(s)?eC:s===""?nC:rC),r)}function oC(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function aC(t,e,n){let{routesMeta:r}=t,i={},s="/",o=[];for(let l=0;l<r.length;++l){let u=r[l],c=l===r.length-1,d=s==="/"?e:e.slice(s.length)||"/",p=hf({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},d),m=u.route;if(!p)return null;
vendor: 6,959 bytes, lines 50-59
50Object.assign(i,p.params),o.push({params:i,pathname:br([s,p.pathname]),pathnameBase:dC(br([s,p.pathnameBase])),route:m}),p.pathnameBase!=="/"&&(s=br([s,p.pathnameBase]))}return o}function hf(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=lC(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((c,d,p)=>{let{paramName:m,isOptional:v}=d;if(m==="*"){let P=l[p]||"";o=s.slice(0,s.length-P.length).replace(/(.)\/+$/,"$1")}const w=l[p];return v&&!w?c[m]=void 0:c[m]=(w||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:t}}function lC(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),Nw(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function uC(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Nw(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function ws(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function cC(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?Vs(t):t,s;return n?(n=Vw(n),n.startsWith("/")?s=f_(n.substring(1),"/"):s=f_(n,e)):s=e,{pathname:s,search:fC(r),hash:pC(i)}}function f_(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function ed(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"].  Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function hC(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Gp(t,e){let n=hC(t);return e?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Kp(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=Vs(t):(i=fa({},t),Re(!i.pathname||!i.pathname.includes("?"),ed("?","pathname","search",i)),Re(!i.pathname||!i.pathname.includes("#"),ed("#","pathname","hash",i)),Re(!i.search||!i.search.includes("#"),ed("#","search","hash",i)));let s=t===""||i.pathname==="",o=s?"/":i.pathname,l;if(o==null)l=n;else{let p=e.length-1;if(!r&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),p-=1;i.pathname=m.join("/")}l=p>=0?e[p]:"/"}let u=cC(i,l),c=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||d)&&(u.pathname+="/"),u}const Vw=t=>t.replace(/\/\/+/g,"/"),br=t=>Vw(t.join("/")),dC=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),fC=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,pC=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function mC(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const Lw=["post","put","patch","delete"];new Set(Lw);const gC=["get",...Lw];new Set(gC);/**
51 * React Router v6.30.6
52 *
53 * Copyright (c) Remix Software Inc.
54 *
55 * This source code is licensed under the MIT license found in the
56 * LICENSE.md file in the root directory of this source tree.
57 *
58 * @license MIT
59 */function pa(){return pa=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pa.apply(null,arguments)}const kc=D.createContext(null),Mw=D.createContext(null),er=D.createContext(null),xc=D.createContext(null),tr=D.createContext({outlet:null,matches:[],isDataRoute:!1}),Fw=D.createContext(null);function yC(t,e){let{relative:n}=e===void 0?{}:e;Ls()||Re(!1);let{basename:r,navigator:i}=D.useContext(er),{hash:s,pathname:o,search:l}=bc(t,{relative:n}),u=o;return r!=="/"&&(u=o==="/"?r:br([r,o])),i.createHref({pathname:u,search:l,hash:s})}function Ls(){return D.useContext(xc)!=null}function Dn(){return Ls()||Re(!1),D.useContext(xc).location}function Uw(t){D.useContext(er).static||D.useLayoutEffect(t)}function Ms(){let{isDataRoute:t}=D.useContext(tr);return t?xC():_C()}function _C(){Ls()||Re(!1);let t=D.useContext(kc),{basename:e,future:n,navigator:r}=D.useContext(er),{matches:i}=D.useContext(tr),{pathname:s}=Dn(),o=JSON.stringify(Gp(i,n.v7_relativeSplatPath)),l=D.useRef(!1);return Uw(()=>{l.current=!0}),D.useCallback(function(c,d){if(d===void 0&&(d={}),!l.current)return;if(typeof c=="number"){r.go(c);return}let p=Kp(c,JSON.parse(o),s,d.relative==="path");t==null&&e!=="/"&&(p.pathname=p.pathname==="/"?e:br([e,p.pathname])),(d.replace?r.replace:r.push)(p,d.state,d)},[e,r,o,s,t])}function J4(){let{matches:t}=D.useContext(tr),e=t[t.length-1];return e?e.params:{}}function bc(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=D.useContext(er),{matches:i}=D.useContext(tr),{pathname:s}=Dn(),o=JSON.stringify(Gp(i,r.v7_relativeSplatPath));return D.useMemo(()=>Kp(t,JSON.parse(o),s,n==="path"),[t,o,s,n])}function vC(t,e){return EC(t,e)}function EC(t,e,n,r){Ls()||Re(!1);let{navigator:i}=D.useContext(er),{matches:s}=D.useContext(tr),o=s[s.length-1],l=o?o.params:{};o&&o.pathname;let u=o?o.pathnameBase:"/";o&&o.route;let c=Dn(),d;if(e){var p;let C=typeof e=="string"?Vs(e):e;u==="/"||(p=C.pathname)!=null&&p.startsWith(u)||Re(!1),d=C}else d=c;let m=d.pathname||"/",v=m;if(u!=="/"){let C=u.replace(/^\//,"").split("/");v="/"+m.replace(/^\//,"").split("/").slice(C.length).join("/")}let w=XR(t,{pathname:v}),P=SC(w&&w.map(C=>Object.assign({},C,{params:Object.assign({},l,C.params),pathname:br([u,i.encodeLocation?i.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?u:br([u,i.encodeLocation?i.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),s,n,r);return e&&P?D.createElement(xc.Provider,{value:{location:pa({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:wr.Pop}},P):P}function wC(){let t=kC(),e=mC(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return D.createElement(D.Fragment,null,D.createElement("h2",null,"Unexpected Application 
59Error!"),D.createElement("h3",{style:{fontStyle:"italic"}},e),n?D.createElement("pre",{style:i},n):null,null)}const TC=D.createElement(wC,null);class IC extends D.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?D.createElement(tr.Provider,{value:this.props.routeContext},D.createElement(Fw.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function AC(t){let{routeContext:e,match:n,children:r}=t,i=D.useContext(kc);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),D.createElement(tr.Provider,{value:e},r)}function SC(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var s;if(!n)return null;if(n.errors)t=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,l=(i=n)==null?void 0:i.errors;if(l!=null){let d=o.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);d>=0||Re(!1),o=o.slice(0,Math.min(o.length,d+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let p=o[d];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=d),p.route.id){let{loaderData:m,errors:v}=n,w=p.route.loader&&m[p.route.id]===void 0&&(!v||v[p.route.id]===void 0);if(p.route.lazy||w){u=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((d,p,m)=>{let v,w=!1,P=null,C=null;n&&(v=l&&p.route.id?l[p.route.id]:void 0,P=p.route.errorElement||TC,u&&(c<0&&m===0?(bC("route-fallback"),w=!0,C=null):c===m&&(w=!0,C=p.route.hydrateFallbackElement||null)));let E=e.concat(o.slice(0,m+1)),g=()=>{let T;return v?T=P:w?T=C:p.route.Component?T=D.createElement(p.route.Component,null):p.route.element?T=p.route.element:T=d,D.createElement(AC,{match:p,routeContext:{outlet:d,matches:E,isDataRoute:n!=null},children:T})};return n&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?D.createElement(IC,{location:n.location,revalidation:n.revalidation,component:P,error:v,children:g(),routeContext:{outlet:null,matches:E,isDataRoute:!0}}):g()},null)}var jw=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(jw||{}),zw=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(zw||{});function RC(t){let e=D.useContext(kc);return e||Re(!1),e}function CC(t){let e=D.useContext(Mw);return e||Re(!1),e}function PC(t){let e=D.useContext(tr);return e||Re(!1),e}function $w(t){let e=PC(),n=e.matches[e.matches.length-1];return n.route.id||Re(!1),n.route.id}function kC(){var t;let e=D.useContext(Fw),n=CC(),r=$w();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function xC(){let{router:t}=RC(jw.UseNavigateStable),e=$w(zw.UseNavigateStable),n=D.useRef(!1);return Uw(()=>{n.current=!0}),D.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,pa({fromRouteId:e},s)))},[t,e])}const p_={};function bC(t,e,n){p_[t]||(p_[t]=!0)}function NC(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function zi(t){let{to:e,replace:n,state:r,relative:i}=t;Ls()||Re(!1);let{future:s,static:o}=D.useContext(er),{matches:l}=D.useContext(tr),{pathname:u}=Dn(),c=Ms(),d=Kp(e,Gp(l,s.v7_relativeSplatPath),u,i==="path"),p=JSON.stringify(d);return D.useEffect(()=>c(JSON.parse(p),{replace:n,state:r,relative:i}),[c,p,i,n,r]),null}function Xl(t){Re(!1)}function DC(t){let{basename:e="/",children:n=null,location:r,navigationType:i=wr.Pop,navigator:s,static:o=!1,future:l}=t;Ls()&&Re(!1);let u=e.replace(/^\/*/,"/"),c=D.useMemo(()=>({basename:u,navigator:s,static:o,future:pa({v7_relativeSplatPath:!1},l)}),[u,l,s,o]);typeof r=="string"&&(r=Vs(r));
59let{pathname:d="/",search:p="",hash:m="",state:v=null,key:w="default"}=r,P=D.useMemo(()=>{let C=ws(d,u);return C==null?null:{location:{pathname:C,search:p,hash:m,state:v,key:w},navigationType:i}},[u,d,p,m,v,w,i]);return P==null?null:D.createElement(er.Provider,{value:c},D.createElement(xc.Provider,{children:n,value:P}))}function OC(t){let{children:e,location:n}=t;return vC(df(e),n)}new Promise(()=>{});function df(t,e){e===void 0&&(e=[]);let n=[];return D.Children.forEach(t,(r,i)=>{if(!D.isValidElement(r))return;let s=[...e,i];if(r.type===D.Fragment){n.push.apply(n,df(r.props.children,s));return}r.type!==Xl&&Re(!1),!r.props.index||!r.props.children||Re(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=df(r.props.children,s)),n.push(o)}),n}/**
60 * React Router DOM v6.30.6
61 *
62 * Copyright (c) Remix Software Inc.
63 *
64 * This source code is licensed under the MIT license found in the
65 * LICENSE.md file in the root directory of this source tree.
66 *
67 * @license MIT
68 */function $u(){return $u=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},$u.apply(null,arguments)}function Bw(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function VC(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function LC(t,e){return t.button===0&&(!e||e==="_self")&&!VC(t)}function ff(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function MC(t,e){let n=ff(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(s=>{n.append(i,s)})}),n}const FC=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],UC=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],jC="6";try{window.__reactRouterVersion=jC}catch{}const zC=D.createContext({isTransitioning:!1}),$C="startTransition",m_=VA[$C];function BC(t){let{basename:e,children:n,future:r,window:i}=t,s=D.useRef();s.current==null&&(s.current=GR({window:i,v5Compat:!0}));let o=s.current,[l,u]=D.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},d=D.useCallback(p=>{c&&m_?m_(()=>u(p)):u(p)},[u,c]);return D.useLayoutEffect(()=>o.listen(d),[o,d]),D.useEffect(()=>NC(r),[r]),D.createElement(DC,{basename:e,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const WC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",qC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,HC=D.forwardRef(function(e,n){let{onClick:r,relative:i,reloadDocument:s,replace:o,state:l,target:u,to:c,preventScrollReset:d,viewTransition:p}=e,m=Bw(e,FC),{basename:v}=D.useContext(er),w,P=!1;if(typeof c=="string"&&qC.test(c)&&(w=c,WC))try{let T=new URL(window.location.href),x=c.startsWith("//")?new URL(T.protocol+c):new URL(c),F=ws(x.pathname,v);x.origin===T.origin&&F!=null?c=F+x.search+x.hash:P=!0}catch{}let C=yC(c,{relative:i}),E=KC(c,{replace:o,state:l,target:u,preventScrollReset:d,relative:i,viewTransition:p});function g(T){r&&r(T),T.defaultPrevented||E(T)}return D.createElement("a",$u({},m,{href:w||C,onClick:P||s?r:g,ref:n,target:u}))}),pf=D.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:i=!1,className:s="",end:o=!1,style:l,to:u,viewTransition:c,children:d}=e,p=Bw(e,UC),m=bc(u,{relative:p.relative}),v=Dn(),w=D.useContext(Mw),{navigator:P,basename:C}=D.useContext(er),E=w!=null&&QC(m)&&c===!0,g=P.encodeLocation?P.encodeLocation(m).pathname:m.pathname,T=v.pathname,x=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;i||(T=T.toLowerCase(),x=x?x.toLowerCase():null,g=g.toLowerCase()),x&&C&&(x=ws(x,C)||x);const F=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let U=T===g||!o&&T.startsWith(g)&&T.charAt(F)==="/",I=x!=null&&(x===g||!o&&x.startsWith(g)&&x.charAt(g.length)==="/"),_={
68isActive:U,isPending:I,isTransitioning:E},A=U?r:void 0,S;typeof s=="function"?S=s(_):S=[s,U?"active":null,I?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let k=typeof l=="function"?l(_):l;return D.createElement(HC,$u({},p,{"aria-current":A,className:S,ref:n,style:k,to:u,viewTransition:c}),typeof d=="function"?d(_):d)});var mf;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(mf||(mf={}));var g_;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(g_||(g_={}));function GC(t){let e=D.useContext(kc);return e||Re(!1),e}function KC(t,e){let{target:n,replace:r,state:i,preventScrollReset:s,relative:o,viewTransition:l}=e===void 0?{}:e,u=Ms(),c=Dn(),d=bc(t,{relative:o});return D.useCallback(p=>{if(LC(p,n)){p.preventDefault();let m=r!==void 0?r:zu(c)===zu(d);u(t,{replace:m,state:i,preventScrollReset:s,relative:o,viewTransition:l})}},[c,u,d,r,i,n,t,s,o,l])}function Z4(t){let e=D.useRef(ff(t)),n=D.useRef(!1),r=Dn(),i=D.useMemo(()=>MC(r.search,n.current?null:e.current),[r.search]),s=Ms(),o=D.useCallback((l,u)=>{const c=ff(typeof l=="function"?l(i):l);n.current=!0,s("?"+c,u)},[s,i]);return[i,o]}function QC(t,e){e===void 0&&(e={});let n=D.useContext(zC);n==null&&Re(!1);let{basename:r}=GC(mf.useViewTransitionState),i=bc(t,{relative:e.relative});if(!n.isTransitioning)return!1;let s=ws(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ws(n.nextLocation.pathname,r)||n.nextLocation.pathname;return hf(i.pathname,o)!=null||hf(i.pathname,s)!=null}const XC=()=>{};var y_={};/**
69 * @license
70 * Copyright 2017 Google LLC
71 *
72 * Licensed under the Apache License, Version 2.0 (the "License");
73 * you may not use this file except in compliance with the License.
74 * You may obtain a copy of the License at
75 *
76 *   http://www.apache.org/licenses/LICENSE-2.0
77 *
78 * Unless required by applicable law or agreed to in writing, software
79 * distributed under the License is distributed on an "AS IS" BASIS,
80 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
81 * See the License for the specific language governing permissions and
82 * limitations under the License.
83 */const Ww=function(t){const e=[];let n=0;for(let r=0;r<t.length;r++){let i=t.charCodeAt(r);i<128?e[n++]=i:i<2048?(e[n++]=i>>6|192,e[n++]=i&63|128):(i&64512)===55296&&r+1<t.length&&(t.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(t.charCodeAt(++r)&1023),e[n++]=i>>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},YC=function(t){const e=[];let n=0,r=0;for(;n<t.length;){const i=t[n++];if(i<128)e[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=t[n++];e[r++]=String.fromCharCode((i&31)<<6|s&63)}else if(i>239&&i<365){const s=t[n++],o=t[n++],l=t[n++],u=((i&7)<<18|(s&63)<<12|(o&63)<<6|l&63)-65536;e[r++]=String.fromCharCode(55296+(u>>10)),e[r++]=String.fromCharCode(56320+(u&1023))}else{const s=t[n++],o=t[n++];e[r++]=String.fromCharCode((i&15)<<12|(s&63)<<6|o&63)}}return e.join("")},Qp={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<t.length;i+=3){const s=t[i],o=i+1<t.length,l=o?t[i+1]:0,u=i+2<t.length,c=u?t[i+2]:0,d=s>>2,p=(s&3)<<4|l>>4;let m=(l&15)<<2|c>>6,v=c&63;u||(v=64,o||(m=64)),r.push(n[d],n[p],n[m],n[v])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(Ww(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):YC(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<t.length;){const s=n[t.charAt(i++)],l=i<t.length?n[t.charAt(i)]:0;++i;const c=i<t.length?n[t.charAt(i)]:64;++i;const p=i<t.length?n[t.charAt(i)]:64;if(++i,s==null||l==null||c==null||p==null)throw new JC;const m=s<<2|l>>
834;if(r.push(m),c!==64){const v=l<<4&240|c>>2;if(r.push(v),p!==64){const w=c<<6&192|p;r.push(w)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class JC extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const ZC=function(t){const e=Ww(t);return Qp.encodeByteArray(e,!0)},Bu=function(t){return ZC(t).replace(/\./g,"")},qw=function(t){try{return Qp.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
84 * @license
85 * Copyright 2022 Google LLC
86 *
87 * Licensed under the Apache License, Version 2.0 (the "License");
88 * you may not use this file except in compliance with the License.
89 * You may obtain a copy of the License at
90 *
91 *   http://www.apache.org/licenses/LICENSE-2.0
92 *
93 * Unless required by applicable law or agreed to in writing, software
94 * distributed under the License is distributed on an "AS IS" BASIS,
95 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
96 * See the License for the specific language governing permissions and
97 * limitations under the License.
98 */function eP(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
99 * @license
100 * Copyright 2022 Google LLC
101 *
102 * Licensed under the Apache License, Version 2.0 (the "License");
103 * you may not use this file except in compliance with the License.
104 * You may obtain a copy of the License at
105 *
106 *   http://www.apache.org/licenses/LICENSE-2.0
107 *
108 * Unless required by applicable law or agreed to in writing, software
109 * distributed under the License is distributed on an "AS IS" BASIS,
110 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
111 * See the License for the specific language governing permissions and
112 * limitations under the License.
113 */const tP=()=>eP().__FIREBASE_DEFAULTS__,nP=()=>{if(typeof process>"u"||typeof y_>"u")return;const t=y_.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},rP=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&qw(t[1]);return e&&JSON.parse(e)},Nc=()=>{try{return XC()||tP()||nP()||rP()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},Hw=t=>{var e,n;return(n=(e=Nc())===null||e===void 0?void 0:e.emulatorHosts)===null||n===void 0?void 0:n[t]},Xp=t=>{const e=Hw(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},Gw=()=>{var t;return(t=Nc())===null||t===void 0?void 0:t.config},Kw=t=>{var e;return(e=Nc())===null||e===void 0?void 0:e[`_${t}`]};/**
114 * @license
115 * Copyright 2017 Google LLC
116 *
117 * Licensed under the Apache License, Version 2.0 (the "License");
118 * you may not use this file except in compliance with the License.
119 * You may obtain a copy of the License at
120 *
121 *   http://www.apache.org/licenses/LICENSE-2.0
122 *
123 * Unless required by applicable law or agreed to in writing, software
124 * distributed under the License is distributed on an "AS IS" BASIS,
125 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
126 * See the License for the specific language governing permissions and
127 * limitations under the License.
128 */class gf{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}/**
129 * @license
130 * Copyright 2025 Google LLC
131 *
132 * Licensed under the Apache License, Version 2.0 (the "License");
133 * you may not use this file except in compliance with the License.
134 * You may obtain a copy of the License at
135 *
136 *   http://www.apache.org/licenses/LICENSE-2.0
137 *
138 * Unless required by applicable law or agreed to in writing, software
139 * distributed under the License is distributed on an "AS IS" BASIS,
140 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
141 * See the License for the specific language governing permissions and
142 * limitations under the License.
143 */function nr(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}async function Dc(t){return(await fetch(t,{credentials:"include"})).ok}/**
144 * @license
145 * Copyright 2021 Google LLC
146 *
147 * Licensed under the Apache License, Version 2.0 (the "License");
148 * you may not use this file except in compliance with the License.
149 * You may obtain a copy of the License at
150 *
151 *   http://www.apache.org/licenses/LICENSE-2.0
152 *
153 * Unless required by applicable law or agreed to in writing, software
154 * distributed under the License is distributed on an "AS IS" BASIS,
155 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
156 * See the License for the specific language governing permissions and
157 * limitations under the License.
158 */function Qw(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",i=t.iat||0,s=t.sub||t.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}}},t);return[Bu(JSON.stringify(n)),Bu(JSON.stringify(o)),""].join(".")}const Bo={};function iP(){const t={prod:[],emulator:[]};for(const e of Object.keys(Bo))Bo[e]?t.emulator.push(e):t.prod.push(e);return t}function sP(t){let e=document.getElementById(t),n=!1;return e||(e=document.createElement("div"),e.setAttribute("id",t),n=!0),{created:n,element:e}}let __=!1;function Oc(t,e){if(typeof window>"u"||typeof document>"u"||!nr(window.location.host)||Bo[t]===e||Bo[t]||__)return;Bo[t]=e;function n(m){return`__firebase__banner__${m}`}const r="__firebase__banner",s=iP().prod.length>0;function o(){const m=document.getElementById(r);m&&m.remove()}function l(m){m.style.display="flex",m.style.background="#7faaf0",m.style.position="fixed",m.style.bottom="5px",m.style.left="5px",m.style.padding=".5em",m.style.borderRadius="5px",m.style.alignItems="center"}function u(m,v){m.setAttribute("width","24"),m.setAttribute("id",v),m.setAttribute("height","24"),m.setAttribute("viewBox","0 0 24 24"),m.setAttribute("fill","none"),m.style.marginLeft="-6px"}function c(){const m=document.createElement("span");return m.style.cursor="pointer",m.style.marginLeft="16px",m.style.fontSize="24px",m.innerHTML=" &times;",m.onclick=()=>{__=!0,o()},m}function d(m,v){m.setAttribute("id",v),m.innerText="Learn more",m.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",m.setAttribute("target","__blank"),m.style.paddingLeft="5px",m.style.textDecoration="underline"}function p(){const m=sP(r),v=n("text"),w=document.getElementById(v)||document.createElement("span"),P=n("learnmore"),C=document.getElementById(P)||document.createElement("a"),E=n("preprendIcon"),g=document.getElementById(E)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(m.created){const T=m.element;l(T),d(C,P);const x=c();u(g,E),T.append(g,w,C,x),document.body.appendChild(T)}s?(w.innerText="Preview backend disconnected.",g.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
159<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
160</g>
161<defs>
162<clipPath id="clip0_6013_33858">
163<rect width="24" height="24" fill="white"/>
164</clipPath>
165</defs>`):(g.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
166<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 
16612.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
167</g>
168<defs>
169<clipPath id="clip0_6083_34804">
170<rect width="24" height="24" fill="white"/>
171</clipPath>
172</defs>`,w.innerText="Preview backend running in this workspace."),w.setAttribute("id",v)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",p):p()}/**
173 * @license
174 * Copyright 2017 Google LLC
175 *
176 * Licensed under the Apache License, Version 2.0 (the "License");
177 * you may not use this file except in compliance with the License.
178 * You may obtain a copy of the License at
179 *
180 *   http://www.apache.org/licenses/LICENSE-2.0
181 *
182 * Unless required by applicable law or agreed to in writing, software
183 * distributed under the License is distributed on an "AS IS" BASIS,
184 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
185 * See the License for the specific language governing permissions and
186 * limitations under the License.
187 */function dt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function oP(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(dt())}function aP(){var t;const e=(t=Nc())===null||t===void 0?void 0:t.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function lP(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function uP(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function cP(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function hP(){const t=dt();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function dP(){return!aP()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function Xw(){try{return typeof indexedDB=="object"}catch{return!1}}function fP(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var s;e(((s=i.error)===null||s===void 0?void 0:s.message)||"")}}catch(n){e(n)}})}/**
188 * @license
189 * Copyright 2017 Google LLC
190 *
191 * Licensed under the Apache License, Version 2.0 (the "License");
192 * you may not use this file except in compliance with the License.
193 * You may obtain a copy of the License at
194 *
195 *   http://www.apache.org/licenses/LICENSE-2.0
196 *
197 * Unless required by applicable law or agreed to in writing, software
198 * distributed under the License is distributed on an "AS IS" BASIS,
199 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 * See the License for the specific language governing permissions and
201 * limitations under the License.
202 */const pP="FirebaseError";
202class mn extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=pP,Object.setPrototypeOf(this,mn.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Fs.prototype.create)}}class Fs{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},i=`${this.service}/${e}`,s=this.errors[e],o=s?mP(s,r):"Error",l=`${this.serviceName}: ${o} (${i}).`;return new mn(i,l,r)}}function mP(t,e){return t.replace(gP,(n,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const gP=/\{\$([^}]+)}/g;function yP(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Fr(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const i of n){if(!r.includes(i))return!1;const s=t[i],o=e[i];if(v_(s)&&v_(o)){if(!Fr(s,o))return!1}else if(s!==o)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function v_(t){return t!==null&&typeof t=="object"}/**
203 * @license
204 * Copyright 2017 Google LLC
205 *
206 * Licensed under the Apache License, Version 2.0 (the "License");
207 * you may not use this file except in compliance with the License.
208 * You may obtain a copy of the License at
209 *
210 *   http://www.apache.org/licenses/LICENSE-2.0
211 *
212 * Unless required by applicable law or agreed to in writing, software
213 * distributed under the License is distributed on an "AS IS" BASIS,
214 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
215 * See the License for the specific language governing permissions and
216 * limitations under the License.
217 */function ba(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(i=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function Co(t){const e={};return t.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,s]=r.split("=");e[decodeURIComponent(i)]=decodeURIComponent(s)}}),e}function Po(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}function _P(t,e){const n=new vP(t,e);return n.subscribe.bind(n)}class vP{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let i;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");EP(e,["next","error","complete"])?i=e:i={next:e,error:n,complete:r},i.next===void 0&&(i.next=td),i.error===void 0&&(i.error=td),i.complete===void 0&&(i.complete=td);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch{}}),this.observers.push(i),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,e)}sendOne(e,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function EP(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function td(){}/**
218 * @license
219 * Copyright 2021 Google LLC
220 *
221 * Licensed under the Apache License, Version 2.0 (the "License");
222 * you may not use this file except in compliance with the License.
223 * You may obtain a copy of the License at
224 *
225 *   http://www.apache.org/licenses/LICENSE-2.0
226 *
227 * Unless required by applicable law or agreed to in writing, software
228 * distributed under the License is distributed on an "AS IS" BASIS,
229 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
230 * See the License for the specific language governing permissions and
231 * limitations under the License.
232 */function he(t){return t&&t._delegate?t._delegate:t}class cn{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/**
233 * @license
234 * Copyright 2019 Google LLC
235 *
236 * Licensed under the Apache License, Version 2.0 (the "License");
237 * you may not use this file except in compliance with the License.
238 * You may obtain a copy of the License at
239 *
240 *   http://www.apache.org/licenses/LICENSE-2.0
241 *
242 * Unless required by applicable law or agreed to in writing, software
243 * distributed under the License is distributed on an "AS IS" BASIS,
244 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
245 * See the License for the specific language governing permissions and
246 * limitations under the License.
247 */const ii="[DEFAULT]";/**
248 * @license
249 * Copyright 2019 Google LLC
250 *
251 * Licensed under the Apache License, Version 2.0 (the "License");
252 * you may not use this file except in compliance with the License.
253 * You may obtain a copy of the License at
254 *
255 *   http://www.apache.org/licenses/LICENSE-2.0
256 *
257 * Unless required by applicable law or agreed to in writing, software
258 * distributed under the License is distributed on an "AS IS" BASIS,
259 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
260 * See the License for the specific language governing permissions and
261 * limitations under the License.
262 */class wP{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new gf;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){var n;const r=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),i=(n=e==null?void 0:e.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(s){if(i)return null;throw s}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(IP(e))try{this.getOrInitializeService({instanceIdentifier:ii})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(n);try{const s=this.getOrInitializeService({instanceIdentifier:i});r.resolve(s)}catch{}}}}clearInstance(e=ii){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=ii){return this.instances.has(e)}getOptions(e=ii){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[s,o]of this.instancesDeferred.entries()){const l=this.normalizeInstanceIdentifier(s);r===l&&o.resolve(i)}return i}onInit(e,n){var r;const i=this.normalizeInstanceIdentifier(n),s=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;s.add(e),this.onInitCallbacks.set(i,s);const o=this.instances.get(i);return o&&e(o,i),()=>{s.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const i of r)try{i(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:TP(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=ii){return this.component?this.component.multipleInstances?e:ii:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function TP(t){return t===ii?void 0:t}function IP(t){return t.instantiationMode==="EAGER"}/**
263 * @license
264 * Copyright 2019 Google LLC
265 *
266 * Licensed under the Apache License, Version 2.0 (the "License");
267 * you may not use this file except in compliance with the License.
268 * You may obtain a copy of the License at
269 *
270 *   http://www.apache.org/licenses/LICENSE-2.0
271 *
272 * Unless required by applicable law or agreed to in writing, software
273 * distributed under the License is distributed on an "AS IS" BASIS,
274 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
275 * See the License for the specific language governing permissions and
276 * limitations under the License.
277 */class AP{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new wP(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/**
278 * @license
279 * Copyright 2017 Google LLC
280 *
281 * Licensed under the Apache License, Version 2.0 (the "License");
282 * you may not use this file except in compliance with the License.
283 * You may obtain a copy of the License at
284 *
285 *   http://www.apache.org/licenses/LICENSE-2.0
286 *
287 * Unless required by applicable law or agreed to in writing, software
288 * distributed under the License is distributed on an "AS IS" BASIS,
289 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
290 * See the License for the specific language governing permissions and
291 * limitations under the License.
292 */var ie;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(ie||(ie={}));const SP={debug:ie.DEBUG,verbose:ie.VERBOSE,info:ie.INFO,warn:ie.WARN,error:ie.ERROR,silent:ie.SILENT},RP=ie.INFO,CP={[ie.DEBUG]:"log",[ie.VERBOSE]:"log",[ie.INFO]:"info",[ie.WARN]:"warn",[ie.ERROR]:"error"},PP=(t,e,...n)=>{if(e<t.logLevel)return;const r=new Date().toISOString(),i=CP[e];if(i)console[i](`[${r}]  ${t.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class Vc{constructor(e){this.name=e,this._logLevel=RP,this._logHandler=PP,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in ie))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?SP[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,ie.DEBUG,...e),this._logHandler(this,ie.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,ie.VERBOSE,...e),this._logHandler(this,ie.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,ie.INFO,...e),this._logHandler(this,ie.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,ie.WARN,...e),this._logHandler(this,ie.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,ie.ERROR,...e),this._logHandler(this,ie.ERROR,...e)}}const kP=(t,e)=>e.some(n=>t instanceof n);let E_,w_;function xP(){return E_||(E_=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function bP(){return w_||(w_=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Yw=new WeakMap,yf=new WeakMap,Jw=new WeakMap,nd=new WeakMap,Yp=new WeakMap;function NP(t){const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{n(Nr(t.result)),i()},o=()=>{r(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(n=>{n instanceof IDBCursor&&Yw.set(n,t)}).catch(()=>{}),Yp.set(e,t),e}function DP(t){if(yf.has(t))return;const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{n(),i()},o=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});yf.set(t,e)}let _f={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return yf.get(t);if(e==="objectStoreNames")return t.objectStoreNames||Jw.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Nr(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function OP(t){_f=t(_f)}function VP(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(rd(this),e,...n);return Jw.set(r,e.sort?e.sort():[e]),Nr(r)}:bP().includes(t)?function(...e){return t.apply(rd(this),e),Nr(Yw.get(this))}:function(...e){return Nr(t.apply(rd(this),e))}}function LP(t){return typeof t=="function"?VP(t):(t instanceof IDBTransaction&&DP(t),kP(t,xP())?new Proxy(t,_f):t)}function Nr(t){if(t instanceof IDBRequest)return NP(t);if(nd.has(t))return nd.get(t);const e=LP(t);return e!==t&&(nd.set(t,e),Yp.set(e,t)),e}const rd=t=>Yp.get(t);function MP(t,e,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),l=Nr(o);return r&&o.addEventListener("upgradeneeded",u=>{r(Nr(o.result),u.oldVersion,u.newVersion,Nr(o.transaction),u)}),n&&o.addEventListener("blocked",u=>n(u.oldVersion,u.newVersion,u)),l.then(u=>{s&&u.addEventListener("close",()=>s()),i&&u.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),l}const FP=["get","getKey","getAll","getAllKeys","count"],UP=["put","add","delete","clear"],id=new Map;function T_(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(id.get(e))return id.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,i=UP.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||FP.includes(n)))return;const s=async function(o,...l){const u=this.transaction(o,i?"readwrite":"readonly");let c=u.store;
292return r&&(c=c.index(l.shift())),(await Promise.all([c[n](...l),i&&u.done]))[0]};return id.set(e,s),s}OP(t=>({...t,get:(e,n,r)=>T_(e,n)||t.get(e,n,r),has:(e,n)=>!!T_(e,n)||t.has(e,n)}));/**
293 * @license
294 * Copyright 2019 Google LLC
295 *
296 * Licensed under the Apache License, Version 2.0 (the "License");
297 * you may not use this file except in compliance with the License.
298 * You may obtain a copy of the License at
299 *
300 *   http://www.apache.org/licenses/LICENSE-2.0
301 *
302 * Unless required by applicable law or agreed to in writing, software
303 * distributed under the License is distributed on an "AS IS" BASIS,
304 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
305 * See the License for the specific language governing permissions and
306 * limitations under the License.
307 */class jP{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(zP(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function zP(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const vf="@firebase/app",I_="0.13.2";/**
308 * @license
309 * Copyright 2019 Google LLC
310 *
311 * Licensed under the Apache License, Version 2.0 (the "License");
312 * you may not use this file except in compliance with the License.
313 * You may obtain a copy of the License at
314 *
315 *   http://www.apache.org/licenses/LICENSE-2.0
316 *
317 * Unless required by applicable law or agreed to in writing, software
318 * distributed under the License is distributed on an "AS IS" BASIS,
319 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
320 * See the License for the specific language governing permissions and
321 * limitations under the License.
322 */const Qn=new Vc("@firebase/app"),$P="@firebase/app-compat",BP="@firebase/analytics-compat",WP="@firebase/analytics",qP="@firebase/app-check-compat",HP="@firebase/app-check",GP="@firebase/auth",KP="@firebase/auth-compat",QP="@firebase/database",XP="@firebase/data-connect",YP="@firebase/database-compat",JP="@firebase/functions",ZP="@firebase/functions-compat",ek="@firebase/installations",tk="@firebase/installations-compat",nk="@firebase/messaging",rk="@firebase/messaging-compat",ik="@firebase/performance",sk="@firebase/performance-compat",ok="@firebase/remote-config",ak="@firebase/remote-config-compat",lk="@firebase/storage",uk="@firebase/storage-compat",ck="@firebase/firestore",hk="@firebase/ai",dk="@firebase/firestore-compat",fk="firebase",pk="11.10.0";/**
323 * @license
324 * Copyright 2019 Google LLC
325 *
326 * Licensed under the Apache License, Version 2.0 (the "License");
327 * you may not use this file except in compliance with the License.
328 * You may obtain a copy of the License at
329 *
330 *   http://www.apache.org/licenses/LICENSE-2.0
331 *
332 * Unless required by applicable law or agreed to in writing, software
333 * distributed under the License is distributed on an "AS IS" BASIS,
334 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
335 * See the License for the specific language governing permissions and
336 * limitations under the License.
337 */const Ef="[DEFAULT]",mk={[vf]:"fire-core",[$P]:"fire-core-compat",[WP]:"fire-analytics",[BP]:"fire-analytics-compat",[HP]:"fire-app-check",[qP]:"fire-app-check-compat",[GP]:"fire-auth",[KP]:"fire-auth-compat",[QP]:"fire-rtdb",[XP]:"fire-data-connect",[YP]:"fire-rtdb-compat",[JP]:"fire-fn",[ZP]:"fire-fn-compat",[ek]:"fire-iid",[tk]:"fire-iid-compat",[nk]:"fire-fcm",[rk]:"fire-fcm-compat",[ik]:"fire-perf",[sk]:"fire-perf-compat",[ok]:"fire-rc",[ak]:"fire-rc-compat",[lk]:"fire-gcs",[uk]:"fire-gcs-compat",[ck]:"fire-fst",[dk]:"fire-fst-compat",[hk]:"fire-vertex","fire-js":"fire-js",[fk]:"fire-js-all"};/**
338 * @license
339 * Copyright 2019 Google LLC
340 *
341 * Licensed under the Apache License, Version 2.0 (the "License");
342 * you may not use this file except in compliance with the License.
343 * You may obtain a copy of the License at
344 *
345 *   http://www.apache.org/licenses/LICENSE-2.0
346 *
347 * Unless required by applicable law or agreed to in writing, software
348 * distributed under the License is distributed on an "AS IS" BASIS,
349 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
350 * See the License for the specific language governing permissions and
351 * limitations under the License.
352 */const Wu=new Map,gk=new Map,wf=new Map;function A_(t,e){try{t.container.addComponent(e)}catch(n){Qn.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function bn(t){const e=t.name;if(wf.has(e))return Qn.debug(`There were multiple attempts to register component ${e}.`),!1;wf.set(e,t);for(const n of Wu.values())A_(n,t);for(const n of gk.values())A_(n,t);return!0}function Na(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function St(t){return t==null?!1:t.settings!==void 0}/**
353 * @license
354 * Copyright 2019 Google LLC
355 *
356 * Licensed under the Apache License, Version 2.0 (the "License");
357 * you may not use this file except in compliance with the License.
358 * You may obtain a copy of the License at
359 *
360 *   http://www.apache.org/licenses/LICENSE-2.0
361 *
362 * Unless required by applicable law or agreed to in writing, software
363 * distributed under the License is distributed on an "AS IS" BASIS,
364 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
365 * See the License for the specific language governing permissions and
366 * limitations under the License.
367 */const yk={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
367d-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Dr=new Fs("app","Firebase",yk);/**
368 * @license
369 * Copyright 2019 Google LLC
370 *
371 * Licensed under the Apache License, Version 2.0 (the "License");
372 * you may not use this file except in compliance with the License.
373 * You may obtain a copy of the License at
374 *
375 *   http://www.apache.org/licenses/LICENSE-2.0
376 *
377 * Unless required by applicable law or agreed to in writing, software
378 * distributed under the License is distributed on an "AS IS" BASIS,
379 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
380 * See the License for the specific language governing permissions and
381 * limitations under the License.
382 */class _k{constructor(e,n,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new cn("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw Dr.create("app-deleted",{appName:this._name})}}/**
383 * @license
384 * Copyright 2019 Google LLC
385 *
386 * Licensed under the Apache License, Version 2.0 (the "License");
387 * you may not use this file except in compliance with the License.
388 * You may obtain a copy of the License at
389 *
390 *   http://www.apache.org/licenses/LICENSE-2.0
391 *
392 * Unless required by applicable law or agreed to in writing, software
393 * distributed under the License is distributed on an "AS IS" BASIS,
394 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
395 * See the License for the specific language governing permissions and
396 * limitations under the License.
397 */const Ri=pk;function Zw(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r=Object.assign({name:Ef,automaticDataCollectionEnabled:!0},e),i=r.name;if(typeof i!="string"||!i)throw Dr.create("bad-app-name",{appName:String(i)});if(n||(n=Gw()),!n)throw Dr.create("no-options");const s=Wu.get(i);if(s){if(Fr(n,s.options)&&Fr(r,s.config))return s;throw Dr.create("duplicate-app",{appName:i})}const o=new AP(i);for(const u of wf.values())o.addComponent(u);const l=new _k(n,r,o);return Wu.set(i,l),l}function Lc(t=Ef){const e=Wu.get(t);if(!e&&t===Ef&&Gw())return Zw();if(!e)throw Dr.create("no-app",{appName:t});return e}function jt(t,e,n){var r;let i=(r=mk[t])!==null&&r!==void 0?r:t;n&&(i+=`-${n}`);const s=i.match(/\s|\//),o=e.match(/\s|\//);if(s||o){const l=[`Unable to register library "${i}" with version "${e}":`];s&&l.push(`library name "${i}" contains illegal characters (whitespace or "/")`),s&&o&&l.push("and"),o&&l.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Qn.warn(l.join(" "));return}bn(new cn(`${i}-version`,()=>({library:i,version:e}),"VERSION"))}/**
398 * @license
399 * Copyright 2021 Google LLC
400 *
401 * Licensed under the Apache License, Version 2.0 (the "License");
402 * you may not use this file except in compliance with the License.
403 * You may obtain a copy of the License at
404 *
405 *   http://www.apache.org/licenses/LICENSE-2.0
406 *
407 * Unless required by applicable law or agreed to in writing, softw
407are
408 * distributed under the License is distributed on an "AS IS" BASIS,
409 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
410 * See the License for the specific language governing permissions and
411 * limitations under the License.
412 */const vk="firebase-heartbeat-database",Ek=1,ma="firebase-heartbeat-store";let sd=null;function eT(){return sd||(sd=MP(vk,Ek,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(ma)}catch(n){console.warn(n)}}}}).catch(t=>{throw Dr.create("idb-open",{originalErrorMessage:t.message})})),sd}async function wk(t){try{const n=(await eT()).transaction(ma),r=await n.objectStore(ma).get(tT(t));return await n.done,r}catch(e){if(e instanceof mn)Qn.warn(e.message);else{const n=Dr.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});Qn.warn(n.message)}}}async function S_(t,e){try{const r=(await eT()).transaction(ma,"readwrite");await r.objectStore(ma).put(e,tT(t)),await r.done}catch(n){if(n instanceof mn)Qn.warn(n.message);else{const r=Dr.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Qn.warn(r.message)}}}function tT(t){return`${t.name}!${t.options.appId}`}/**
413 * @license
414 * Copyright 2021 Google LLC
415 *
416 * Licensed under the Apache License, Version 2.0 (the "License");
417 * you may not use this file except in compliance with the License.
418 * You may obtain a copy of the License at
419 *
420 *   http://www.apache.org/licenses/LICENSE-2.0
421 *
422 * Unless required by applicable law or agreed to in writing, software
423 * distributed under the License is distributed on an "AS IS" BASIS,
424 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
425 * See the License for the specific language governing permissions and
426 * limitations under the License.
427 */const Tk=1024,Ik=30;class Ak{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new Rk(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,n;try{const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=R_();if(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s))return;if(this._heartbeatsCache.heartbeats.push({date:s,agent:i}),this._heartbeatsCache.heartbeats.length>Ik){const o=Ck(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(o,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){Qn.warn(r)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=R_(),{heartbeatsToSend:r,unsentEntries:i}=Sk(this._heartbeatsCache.heartbeats),s=Bu(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(n){return Qn.warn(n),""}}}function R_(){return new Date().toISOString().substring(0,10)}function Sk(t,e=Tk){const n=[];let r=t.slice();for(const i of t){const s=n.find(o=>o.agent===i.agent);if(s){if(s.dates.push(i.date),C_(n)>e){s.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),C_(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class Rk{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return Xw()?fP().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await wk(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return S_(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var n;if(await this._canUseIndexedDBPromise){const i=await this.read();return S_(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...e.heartbeats]})}else return}}function C_(t){return Bu(JSON.stringify({version:2,heartbeats:t})).length}function Ck(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let r=1;r<t.length;r++)t[r].date<n&&(n=t[r].date,e=r);return e}/**
428 * @license
429 * Copyright 2019 Google LLC
430 *
431 * Licensed under the Apache License, Version 2.0 (the "License");
432 * you may not use this file except in compliance with the License.
433 * You may obtain a copy of the License at
434 *
435 *   http://www.apache.org/licenses/LICENSE-2.0
436 *
437 * Unless required by applicable law or agreed to in writing, software
438 * distributed under the License is distributed on an "AS IS" BASIS,
439 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
440 * See the License for the specific language governing permissions and
441 * limitations under the License.
442 */function Pk(t){bn(new cn("platform-logger",e=>new jP(e),"PRIVATE")),bn(new cn("heartbeat",e=>new Ak(e),"PRIVATE")),jt(vf,I_,t),jt(vf,I_,"esm2017"),jt("fire-js","")}Pk("");function Jp(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function nT(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const kk=nT,rT=new Fs("auth","Firebase",nT());/**
443 * @license
444 * Copyright 2020 Google LLC
445 *
446 * Licensed under the Apache License, Version 2.0 (the "License");
447 * you may not use this file except in compliance with the License.
448 * You may obtain a copy of the License at
449 *
450 *   http://www.apache.org/licenses/LICENSE-2.0
451 *
452 * Unless required by applicable law or agreed to in writing, software
453 * distributed under the License is distributed on an "AS IS" BASIS,
454 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
455 * See the License for the specific language governing permissions and
456 * limitations under the License.
457 */const qu=new Vc("@firebase/auth");function xk(t,...e){qu.logLevel<=ie.WARN&&qu.warn(`Auth (${Ri}): ${t}`,...e)}function Yl(t,...e){qu.logLevel<=ie.ERROR&&qu.error(`Auth (${Ri}): ${t}`,...e)}/**
458 * @license
459 * Copyright 2020 Google LLC
460 *
461 * Licensed under the Apache License, Version 2.0 (the "License");
462 * you may not use this file except in compliance with the License.
463 * You may obtain a copy of the License at
464 *
465 *   http://www.apache.org/licenses/LICENSE-2.0
466 *
467 * Unless required by applicable law or agreed to in writing, software
468 * distributed under the License is distributed on an "AS IS" BASIS,
469 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
470 * See the License for the specific language governing permissions and
471 * limitations under the License.
472 */function hn(t,...e){throw Zp(t,...e)}function An(t,...e){return Zp(t,...e)}function iT(t,e,n){const r=Object.assign(Object.assign({},kk()),{[e]:n});return new Fs("auth","Firebase",r).create(e,{appName:t.name})}function Wn(t){return iT(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Zp(t,...e){if(typeof t!="string"){const n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return rT.create(t,...e)}function X(t,e,...n){if(!t)throw Zp(e,...n)}function zn(t){const e="INTERNAL ASSERTION FAILED: "+t;throw Yl(e),new Error(e)}function Xn(t,e){t||zn(e)}/**
473 * @license
474 * Copyright 2020 Google LLC
475 *
476 * Licensed under the Apache License, Version 2.0 (the "License");
477 * you may not use this file except in compliance with the License.
478 * You may obtain a copy of the License at
479 *
480 *   http://www.apache.org/licenses/LICENSE-2.0
481 *
482 * Unless required by applicable law or agreed to in writing, software
483 * distributed under the License is distributed on an "AS IS" BASIS,
484 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
485 * See the License for the specific language governing permissions and
486 * limitations under the License.
487 */function Tf(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.href)||""}function bk(){return P_()==="http:"||P_()==="https:"}function P_(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.protocol)||null}/**
488 * @license
489 * Copyright 2020 Google LLC
490 *
491 * Licensed under the Apache License, Version 2.0 (the "License");
492 * you may not use this file except in compliance with the License.
493 * You may obtain a copy of the License at
494 *
495 *   http://www.apache.org/licenses/LICENSE-2.0
496 *
497 * Unless required by applicable law or agreed to in writing, software
498 * distributed under the License is distributed on an "AS IS" BASIS,
499 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
500 * See the License for the specific language governing permissions and
501 * limitations under the License.
502 */function Nk(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(bk()||uP()||"connection"in navigator)?navigator.onLine:!0}function Dk(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/**
503 * @license
504 * Copyright 2020 Google LLC
505 *
506 * Licensed under the Apache License, Version 2.0 (the "License");
507 * you may not use this file except in compliance with the License.
508 * You may obtain a copy of the License at
509 *
510 *   http://www.apache.org/licenses/LICENSE-2.0
511 *
512 * Unless required by applicable law or agreed to in writing, software
513 * distributed under the License is distributed on an "AS IS" BASIS,
514 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
515 * See the License for the specific language governing permissions and
516 * limitations under the License.
517 */class Da{constructor(e,n){this.shortDelay=e,this.longDelay=n,Xn(n>e,"Short delay should be less than long delay!"),this.isMobile=oP()||cP()}get(){return Nk()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
518 * @license
519 * Copyright 2020 Google LLC
520 *
521 * Licensed under the Apache License, Version 2.0 (the "License");
522 * you may not use this file except in compliance with the License.
523 * You may obtain a copy of the License at
524 *
525 *   http://www.apache.org/licenses/LICENSE-2.0
526 *
527 * Unless required by applicable law or agreed to in writing, software
528 * distributed under the License is distributed on an "AS IS" BASIS,
529 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
530 * See the License for the specific language governing permissions and
531 * limitations under the License.
532 */function em(t,e){Xn(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}/**
533 * @license
534 * Copyright 2020 Google LLC
535 *
536 * Licensed under the Apache License, Version 2.0 (the "License");
537 * you may not use this file except in compliance with the License.
538 * You may obtain a copy of the License at
539 *
540 *   http://www.apache.org/licenses/LICENSE-2.0
541 *
542 * Unless required by applicable law or agreed to in writing, software
543 * distributed under the License is distributed on an "AS IS" BASIS,
544 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
545 * See the License for the specific language governing permissions and
546 * limitations under the License.
547 */class sT{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;zn("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;zn("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;zn("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
548 * @license
549 * Copyright 2020 Google LLC
550 *
551 * Licensed under the Apache License, Version 2.0 (the "License");
552 * you may not use this file except in compliance with the License.
553 * You may obtain a copy of the License at
554 *
555 *   http://www.apache.org/licenses/LICENSE-2.0
556 *
557 * Unless required by applicable law or agreed to in writing, software
558 * distributed under the License is distributed on an "AS IS" BASIS,
559 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
560 * See the License for the specific language governing permissions and
561 * limitations under the License.
562 */const Ok={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
563 * @license
564 * Copyright 2020 Google LLC
565 *
566 * Licensed under the Apache License, Version 2.0 (the "License");
567 * you may not use this file except in compliance with the License.
568 * You may obtain a copy of the License at
569 *
570 *   http://www.apache.org/licenses/LICENSE-2.0
571 *
572 * Unless required by applicable law or agreed to in writing, software
573 * distributed under the License is distributed on an "AS IS" BASIS,
574 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
575 * See the License for the specific language governing permissions and
576 * limitations under the License.
577 */const Vk=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],Lk=new Da(3e4,6e4);function Qr(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function rr(t,e,n,r,i={}){return oT(t,i,async()=>{let s={},o={};r&&(e==="GET"?o=r:s={body:JSON.stringify(r)});const l=ba(Object.assign({key:t.config.apiKey},o)).slice(1),u=await t._getAdditionalHeaders();u["Content-Type"]="application/json",t.languageCode&&(u["X-Firebase-Locale"]=t.languageCode);const c=Object.assign({method:e,headers:u},s);return lP()||(c.referrerPolicy="no-referrer"),t.emulatorConfig&&nr(t.emulatorConfig.host)&&(c.credentials="include"),sT.fetch()(await aT(t,t.config.apiHost,n,l),c)})}async function oT(t,e,n){t._canInitEmulator=!1;const r=Object.assign(Object.assign({},Ok),e);try{const i=new Fk(t),s=await Promise.race([n(),i.promise]);i.clearNetworkTimeout();const o=await s.json();if("needConfirmation"in o)throw Pl(t,"account-exists-with-different-credential",o);if(s.ok&&!("errorMessage"in o))return o;{const l=s.ok?o.errorMessage:o.error.message,[u,c]=l.split(" : ");if(u==="FEDERATED_USER_ID_ALREADY_LINKED")throw Pl(t,"credential-already-in-use",o);if(u==="EMAIL_EXISTS")throw Pl(t,"email-already-in-use",o);if(u==="USER_DISABLED")throw Pl(t,"user-disabled",o);const d=r[u]||u.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw iT(t,d,c);hn(t,d)}}catch(i){if(i instanceof mn)throw i;hn(t,"network-request-failed",{message:String(i)})}}async function Oa(t,e,n,r,i={}){const s=await rr(t,e,n,r,i);return"mfaPendingCredential"in s&&hn(t,"multi-factor-auth-required",{_serverResponse:s}),s}async function aT(t,e,n,r){const i=`${e}${n}?${r}`,s=t,o=s.config.emulator?em(t.config,i):`${t.config.apiScheme}://${i}`;return Vk.includes(n)&&(await s._persistenceManagerAvailable,s._getPersistenceType()==="COOKIE")?s._getPersistence()._getFinalTarget(o).toString():o}function Mk(t){switch(t){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Fk{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(An(this.auth,"network-request-failed")),Lk.get())})}}function Pl(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=An(t,e,r);return i.customData._tokenResponse=n,i}function k_(t){return t!==void 0&&t.enterprise!==void 0}class Uk{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const n of this.recaptchaEnforcementState)if(n.provider&&n.provider===e)return Mk(n.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PRO
577VIDER")}}async function jk(t,e){return rr(t,"GET","/v2/recaptchaConfig",Qr(t,e))}/**
578 * @license
579 * Copyright 2020 Google LLC
580 *
581 * Licensed under the Apache License, Version 2.0 (the "License");
582 * you may not use this file except in compliance with the License.
583 * You may obtain a copy of the License at
584 *
585 *   http://www.apache.org/licenses/LICENSE-2.0
586 *
587 * Unless required by applicable law or agreed to in writing, software
588 * distributed under the License is distributed on an "AS IS" BASIS,
589 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
590 * See the License for the specific language governing permissions and
591 * limitations under the License.
592 */async function zk(t,e){return rr(t,"POST","/v1/accounts:delete",e)}async function Hu(t,e){return rr(t,"POST","/v1/accounts:lookup",e)}/**
593 * @license
594 * Copyright 2020 Google LLC
595 *
596 * Licensed under the Apache License, Version 2.0 (the "License");
597 * you may not use this file except in compliance with the License.
598 * You may obtain a copy of the License at
599 *
600 *   http://www.apache.org/licenses/LICENSE-2.0
601 *
602 * Unless required by applicable law or agreed to in writing, software
603 * distributed under the License is distributed on an "AS IS" BASIS,
604 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
605 * See the License for the specific language governing permissions and
606 * limitations under the License.
607 */function Wo(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function $k(t,e=!1){const n=he(t),r=await n.getIdToken(e),i=tm(r);X(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const s=typeof i.firebase=="object"?i.firebase:void 0,o=s==null?void 0:s.sign_in_provider;return{claims:i,token:r,authTime:Wo(od(i.auth_time)),issuedAtTime:Wo(od(i.iat)),expirationTime:Wo(od(i.exp)),signInProvider:o||null,signInSecondFactor:(s==null?void 0:s.sign_in_second_factor)||null}}function od(t){return Number(t)*1e3}function tm(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return Yl("JWT malformed, contained fewer than 3 sections"),null;try{const i=qw(n);return i?JSON.parse(i):(Yl("Failed to decode base64 JWT payload"),null)}catch(i){return Yl("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function x_(t){const e=tm(t);return X(e,"internal-error"),X(typeof e.exp<"u","internal-error"),X(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
608 * @license
609 * Copyright 2020 Google LLC
610 *
611 * Licensed under the Apache License, Version 2.0 (the "License");
612 * you may not use this file except in compliance with the License.
613 * You may obtain a copy of the License at
614 *
615 *   http://www.apache.org/licenses/LICENSE-2.0
616 *
617 * Unless required by applicable law or agreed to in writing, software
618 * distributed under the License is distributed on an "AS IS" BASIS,
619 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
620 * See the License for the specific language governing permissions and
621 * limitations under the License.
622 */async function Ts(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof mn&&Bk(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function Bk({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/**
623 * @license
624 * Copyright 2020 Google LLC
625 *
626 * Licensed under the Apache License, Version 2.0 (the "License");
627 * you may not use this file except in compliance with the License.
628 * You may obtain a copy of the License at
629 *
630 *   http://www.apache.org/licenses/LICENSE-2.0
631 *
632 * Unless required by applicable law or agreed to in writing, software
633 * distributed under the License is distributed on an "AS IS" BASIS,
634 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
635 * See the License for the specific language governing permissions and
636 * limitations under the License.
637 */class Wk{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var n;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const i=((n=this.user.stsTokenManager.expirationTime)!==null&&n!==void 0?n:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
638 * @license
639 * Copyright 2020 Google LLC
640 *
641 * Licensed under the Apache License, Version 2.0 (the "License");
642 * you may not use this file except in compliance with the License.
643 * You may obtain a copy of the License at
644 *
645 *   http://www.apache.org/licenses/LICENSE-2.0
646 *
647 * Unless required by applicable law or agreed to in writing, software
648 * distributed under the License is distributed on an "AS IS" BASIS,
649 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
650 * See the License for the specific language governing permissions and
651 * limitations under the License.
652 */class If{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Wo(this.lastLoginAt),this.creationTime=Wo(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
653 * @license
654 * Copyright 2019 Google LLC
655 *
656 * Licensed under the Apache License, Version 2.0 (the "License");
657 * you may not use this file except in compliance with the License.
658 * You may obtain a copy of the License at
659 *
660 *   http://www.apache.org/licenses/LICENSE-2.0
661 *
662 * Unless required by applicable law or agreed to in writing, software
663 * distributed under the License is distributed on an "AS IS" BASIS,
664 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
665 * See the License for the specific language governing permissions and
666 * limitations under the License.
667 */async function Gu(t){var e;const n=t.auth,r=await t.getIdToken(),i=await Ts(t,Hu(n,{idToken:r}));X(i==null?void 0:i.users.length,n,"internal-error");const s=i.users[0];t._notifyReloadListener(s);const o=!((e=s.providerUserInfo)===null||e===void 0)&&e.length?lT(s.providerUserInfo):[],l=Hk(t.providerData,o),u=t.isAnonymous,c=!(t.email&&s.passwordHash)&&!(l!=null&&l.length),d=u?c:!1,p={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:l,metadata:new If(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(t,p)}async function qk(t){const e=he(t);await Gu(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function Hk(t,e){return[...t.filter(r=>!e.some(i=>i.providerId===r.providerId)),...e]}function lT(t){return t.map(e=>{var{providerId:n}=e,r=Jp(e,["providerId"]);return{providerId:n,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/**
668 * @license
669 * Copyright 2020 Google LLC
670 *
671 * Licensed under the Apache License, Version 2.0 (the "License");
672 * you may not use this file except in compliance with the License.
673 * You may obtain a copy of the License at
674 *
675 *   http://www.apache.org/licenses/LICENSE-2.0
676 *
677 * Unless required by applicable law or agreed to in writing, software
678 * distributed under the License is distributed on an "AS IS" BASIS,
679 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
680 * See the License for the specific language governing permissions and
681 * limitations under the License.
682 */async function Gk(t,e){const n=await oT(t,{},async()=>{const r=ba({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:s}=t.config,o=await aT(t,i,"/v1/token",`key=${s}`),l=await t._getAdditionalHeaders();l["Content-Type"]="application/x-www-form-urlencoded";const u={method:"POST",headers:l,body:r};return t.emulatorConfig&&nr(t.emulatorConfig.host)&&(u.credentials="include"),sT.fetch()(o,u)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function Kk(t,e){return rr(t,"POST","/v2/accounts:revokeToken",Qr(t,e))}/**
683 * @license
684 * Copyright 2020 Google LLC
685 *
686 * Licensed under the Apache License, Version 2.0 (the "License");
687 * you may not use this file except in compliance with the License.
688 * You may obtain a copy of the License at
689 *
690 *   http://www.apache.org/licenses/LICENSE-2.0
691 *
692 * Unless required by applicable law or agreed to in writing, software
693 * distributed under the License is distributed on an "AS IS" BASIS,
694 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
695 * See the License for the specific language governing permissions and
696 * limitations under the License.
697 */class cs{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){X(e.idToken,"internal-error"),X(typeof e.idToken<"u","internal-error"),X(typeof e.refreshToken<"u","internal-error");
697const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):x_(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){X(e.length!==0,"internal-error");const n=x_(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(X(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:i,expiresIn:s}=await Gk(e,n);this.updateTokensAndExpiration(r,i,Number(s))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:i,expirationTime:s}=n,o=new cs;return r&&(X(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),i&&(X(typeof i=="string","internal-error",{appName:e}),o.accessToken=i),s&&(X(typeof s=="number","internal-error",{appName:e}),o.expirationTime=s),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new cs,this.toJSON())}_performRefresh(){return zn("not implemented")}}/**
698 * @license
699 * Copyright 2020 Google LLC
700 *
701 * Licensed under the Apache License, Version 2.0 (the "License");
702 * you may not use this file except in compliance with the License.
703 * You may obtain a copy of the License at
704 *
705 *   http://www.apache.org/licenses/LICENSE-2.0
706 *
707 * Unless required by applicable law or agreed to in writing, software
708 * distributed under the License is distributed on an "AS IS" BASIS,
709 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
710 * See the License for the specific language governing permissions and
711 * limitations under the License.
712 */function lr(t,e){X(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class on{constructor(e){var{uid:n,auth:r,stsTokenManager:i}=e,s=Jp(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Wk(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new If(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const n=await Ts(this,this.stsTokenManager.getToken(this.auth,e));return X(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return $k(this,e)}reload(){return qk(this)}_assign(e){this!==e&&(X(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>Object.assign({},n)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new on(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(e){X(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await Gu(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(St(this.auth.app))return Promise.reject(Wn(this.auth));const e=await this.getIdToken();return await Ts(this,zk(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isA
712nonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,n){var r,i,s,o,l,u,c,d;const p=(r=n.displayName)!==null&&r!==void 0?r:void 0,m=(i=n.email)!==null&&i!==void 0?i:void 0,v=(s=n.phoneNumber)!==null&&s!==void 0?s:void 0,w=(o=n.photoURL)!==null&&o!==void 0?o:void 0,P=(l=n.tenantId)!==null&&l!==void 0?l:void 0,C=(u=n._redirectEventId)!==null&&u!==void 0?u:void 0,E=(c=n.createdAt)!==null&&c!==void 0?c:void 0,g=(d=n.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:T,emailVerified:x,isAnonymous:F,providerData:U,stsTokenManager:I}=n;X(T&&I,e,"internal-error");const _=cs.fromJSON(this.name,I);X(typeof T=="string",e,"internal-error"),lr(p,e.name),lr(m,e.name),X(typeof x=="boolean",e,"internal-error"),X(typeof F=="boolean",e,"internal-error"),lr(v,e.name),lr(w,e.name),lr(P,e.name),lr(C,e.name),lr(E,e.name),lr(g,e.name);const A=new on({uid:T,auth:e,email:m,emailVerified:x,displayName:p,isAnonymous:F,photoURL:w,phoneNumber:v,tenantId:P,stsTokenManager:_,createdAt:E,lastLoginAt:g});return U&&Array.isArray(U)&&(A.providerData=U.map(S=>Object.assign({},S))),C&&(A._redirectEventId=C),A}static async _fromIdTokenResponse(e,n,r=!1){const i=new cs;i.updateFromServerResponse(n);const s=new on({uid:n.localId,auth:e,stsTokenManager:i,isAnonymous:r});return await Gu(s),s}static async _fromGetAccountInfoResponse(e,n,r){const i=n.users[0];X(i.localId!==void 0,"internal-error");const s=i.providerUserInfo!==void 0?lT(i.providerUserInfo):[],o=!(i.email&&i.passwordHash)&&!(s!=null&&s.length),l=new cs;l.updateFromIdToken(r);const u=new on({uid:i.localId,auth:e,stsTokenManager:l,isAnonymous:o}),c={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:s,metadata:new If(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(s!=null&&s.length)};return Object.assign(u,c),u}}/**
713 * @license
714 * Copyright 2020 Google LLC
715 *
716 * Licensed under the Apache License, Version 2.0 (the "License");
717 * you may not use this file except in compliance with the License.
718 * You may obtain a copy of the License at
719 *
720 *   http://www.apache.org/licenses/LICENSE-2.0
721 *
722 * Unless required by applicable law or agreed to in writing, software
723 * distributed under the License is distributed on an "AS IS" BASIS,
724 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
725 * See the License for the specific language governing permissions and
726 * limitations under the License.
727 */const b_=new Map;function $n(t){Xn(t instanceof Function,"Expected a class definition");let e=b_.get(t);return e?(Xn(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,b_.set(t,e),e)}/**
728 * @license
729 * Copyright 2019 Google LLC
730 *
731 * Licensed under the Apache License, Version 2.0 (the "License");
732 * you may not use this file except in compliance with the License.
733 * You may obtain a copy of the License at
734 *
735 *   http://www.apache.org/licenses/LICENSE-2.0
736 *
737 * Unless required by applicable law or agreed to in writing, software
738 * distributed under the License is distributed on an "AS IS" BASIS,
739 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
740 * See the License for the specific language governing permissions and
741 * limitations under the License.
742 */class uT{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}uT.type="NONE";const N_=uT;/**
743 * @license
744 * Copyright 2019 Google LLC
745 *
746 * Licensed under the Apache License, Version 2.0 (the "License");
747 * you may not use this file except in compliance with the License.
748 * You may obtain a copy of the License at
749 *
750 *   http://www.apache.org/licenses/LICENSE-2.0
751 *
752 * Unless required by applicable law or agreed to in writing, software
753 * distributed under the License is distributed on an "AS IS" BASIS,
754 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
755 * See the License for the specific language governing permissions and
756 * limitations under the License.
757 */function Jl(t,e,n){return`firebase:${t}:${e}:${n}`}class hs{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:i,name:s}=this.auth;this.fullUserKey=Jl(this.userKey,i.apiKey,s),this.fullPersistenceKey=Jl("persistence",i.apiKey,s),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){const n=await Hu(this.auth,{idToken:e}).catch(()=>{});return n?on._fromGetAccountInfoResponse(this.auth,n,e):null}return on._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new hs($n(N_),e,r);const i=(await Promise.all(n.map(async c=>{if(await c._isAvailable())return c}))).filter(c=>c);let s=i[0]||$n(N_);const o=Jl(r,e.config.apiKey,e.name);let l=null;for(const c of n)try{const d=await c._get(o);if(d){let p;if(typeof d=="string"){const m=await Hu(e,{idToken:d}).catch(()=>{});if(!m)break;p=await on._fromGetAccountInfoResponse(e,m,d)}else p=on._fromJSON(e,d);c!==s&&(l=p),s=c;break}}catch{}const u=i.filter(c=>c._shouldAllowMigration);return!s._shouldAllowMigration||!u.length?new hs(s,e,r):(s=u[0],l&&await s._set(o,l.toJSON()),await Promise.all(n.map(async c=>{if(c!==s)try{await c._remove(o)}catch{}})),new hs(s,e,r))}}/**
758 * @license
759 * Copyright 2020 Google LLC
760 *
761 * Licensed under the Apache License, Version 2.0 (the "License");
762 * you may not use this file except in compliance with the License.
763 * You may obtain a copy of the License at
764 *
765 *   http://www.apache.org/licenses/LICENSE-2.0
766 *
767 * Unless required by applicable law or agreed to in writing, software
768 * distributed under the License is distributed on an "AS IS" BASIS,
769 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
770 * See the License for the specific language governing permissions and
771 * limitations under the License.
772 */function D_(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(fT(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(cT(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(mT(e))return"Blackberry";if(gT(e))return"Webos";if(hT(e))return"Safari";if((e.includes("chrome/")||dT(e))&&!e.includes("edge/"))return"Chrome";if(pT(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function cT(t=dt()){return/firefox\//i.test(t)}function hT(t=dt()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function dT(t=dt()){return/crios\//i.test(t)}function fT(t=dt()){return/iemobile/i.test(t)}function pT(t=dt()){return/android/i.test(t)}function mT(t=dt()){return/blackberry/i.test(t)}function gT(t=dt()){return/webos/i.test(t)}function nm(t=dt()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function Qk(t=dt()){var e;return nm(t)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function Xk(){return hP()&&document.documentMode===10}function yT(t=dt()){return nm(t)||pT(t)||gT(t)||mT(t)||/windows phone/i.test(t)||fT(t)}/**
773 * @license
774 * Copyright 2020 Google LLC
775 *
776 * Licensed under the Apache License, Version 2.0 (the "License");
777 * you may not use this file except in compliance with the License.
778 * You may obtain a copy of the License at
779 *
780 *   http://www.apache.org/licenses/LICENSE-2.0
781 *
782 * Unless required by applicable law or agreed to in writing, software
783 * distributed under the License is distributed on an "AS IS" BASIS,
784 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
785 * See the License for the specific language governing permissions and
786 * limitations under the License.
787 */function _T(t,e=[]){let n;switch(t){case"Browser":n=D_(dt());break;case"Worker":n=`${D_(dt())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${Ri}/${r}`}/**
788 * @license
789 * Copyright 2022 Google LLC
790 *
791 * Licensed under the Apache License, Version 2.0 (the "License");
792 * you may not use this file except in compliance with the License.
793 * You may obtain a copy of the License at
794 *
795 *   http://www.apache.org/licenses/LICENSE-2.0
796 *
797 * Unless required by applicable law or agreed to in writing, software
798 * distributed under the License is distributed on an "AS IS" BASIS,
799 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
800 * See the License for the specific language governing permissions and
801 * limitations under the License.
802 */class Yk{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=s=>new Promise((o,l)=>{try{const u=e(s);o(u)}catch(u){l(u)}});r.onAbort=n,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const i of n)try{i()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/**
803 * @license
804 * Copyright 2023 Google LLC
805 *
806 * Licensed under the Apache License, Version 2.0 (the "License");
807 * you may not use this file except in compliance with the License.
808 * You may obtain a copy of the License at
809 *
810 *   http://www.apache.org/licenses/LICENSE-2.0
811 *
812 * Unless required by applicable law or agreed to in writing, software
813 * distributed under the License is distributed on an "AS IS" BASIS,
814 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
815 * See the License for the specific language governing permissions and
816 * limitations under the License.
817 */async function Jk(t,e={}){return rr(t,"GET","/v2/passwordPolicy",Qr(t,e))}/**
818 * @license
819 * Copyright 2023 Google LLC
820 *
821 * Licensed under the Apache License, Version 2.0 (the "License");
822 * you may not use this file except in compliance with the License.
823 * You may obtain a copy of the License at
824 *
825 *   http://www.apache.org/licenses/LICENSE-2.0
826 *
827 * Unless required by applicable law or agreed to in writing, software
828 * distributed under the License is distributed on an "AS IS" BASIS,
829 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
830 * See the License for the specific language governing permissions and
831 * limitations under the License.
832 */const Zk=6;class ex{constructor(e){var n,r,i,s;const o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(n=o.minPasswordLength)!==null&&n!==void 0?n:Zk,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),o.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),o.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),o.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),o.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(r=e.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(s=e.forceUpgradeOnSignin)!==null&&s!==void 0?s:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var n,r,i,s,o,l;const u={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,u),this.validatePasswordCharacterOptions(e,u),u.isValid&&
832(u.isValid=(n=u.meetsMinPasswordLength)!==null&&n!==void 0?n:!0),u.isValid&&(u.isValid=(r=u.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),u.isValid&&(u.isValid=(i=u.containsLowercaseLetter)!==null&&i!==void 0?i:!0),u.isValid&&(u.isValid=(s=u.containsUppercaseLetter)!==null&&s!==void 0?s:!0),u.isValid&&(u.isValid=(o=u.containsNumericCharacter)!==null&&o!==void 0?o:!0),u.isValid&&(u.isValid=(l=u.containsNonAlphanumericCharacter)!==null&&l!==void 0?l:!0),u}validatePasswordLengthOptions(e,n){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),i&&(n.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let i=0;i<e.length;i++)r=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,i,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}}/**
833 * @license
834 * Copyright 2020 Google LLC
835 *
836 * Licensed under the Apache License, Version 2.0 (the "License");
837 * you may not use this file except in compliance with the License.
838 * You may obtain a copy of the License at
839 *
840 *   http://www.apache.org/licenses/LICENSE-2.0
841 *
842 * Unless required by applicable law or agreed to in writing, software
843 * distributed under the License is distributed on an "AS IS" BASIS,
844 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
845 * See the License for the specific language governing permissions and
846 * limitations under the License.
847 */class tx{constructor(e,n,r,i){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new O_(this),this.idTokenSubscription=new O_(this),this.beforeStateQueue=new Yk(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=rT,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(s=>this._resolvePersistenceManagerAvailable=s)}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=$n(n)),this._initializationPromise=this.queue(async()=>{var r,i,s;if(!this._deleted&&(this.persistenceManager=await hs.create(this,e),(r=this._resolvePersistenceManagerAvailable)===null||r===void 0||r.call(this),!this._deleted)){if(!((i=this._popupRedirectResolver)===null||i===void 0)&&i._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((s=this.currentUser)===null||s===void 0?void 0:s.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const n=await Hu(this,{idToken:e}),r=await on._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var n;if(St(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(l=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(l,l))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let i=r,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,l=i==null?void 0:i._redirectEventId,u=await this.tryRedirectSignIn(e);(!o||o===l)&&(u!=null&&u.user)&&(i=u.user,s=!0)}if(!i)return this.directlySetCurrentUser(null);
847if(!i._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(i)}catch(o){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return X(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await Gu(e)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=Dk()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(St(this.app))return Promise.reject(Wn(this));const n=e?he(e):null;return n&&X(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&X(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return St(this.app)?Promise.reject(Wn(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return St(this.app)?Promise.reject(Wn(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence($n(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await Jk(this),n=new ex(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new Fs("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await Kk(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&$n(e)||this._popupRedirectResolver;X(n,this,"argument-error"),this.redirectPersistenceManager=await hs.create(this,[$n(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(n=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,i){if(this._deleted)return()=>{};const s=typeof n=="function"?n:n.next.bind(n);let o=!1;const l=this._isInitialized?Promise.resolve():this._initializationPromise;if(X(l,this,"internal-error"),l.then(()=>{o||s(this.currentUser)}),typeof n=="function"){const u=e.addObserver(n,r,i);return()=>{o=!0,u()}}else{const u=e.addObserver(n);return()=>{o=!0,u()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return X(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=_T(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());r&&(n["X-Firebase-Client"]=r);const i=await this._getAppCheckToken();return i&&(n["X-Firebase-AppCheck"]=i),n}async _getAppCheckToken(){var e;if(St(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const n=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return n!=null&&n.error&&xk(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function Ci(t){return he(t)}class O_{constructor(e){this.auth=e,this.observer=null,this.addObserver=_P(n=>this.observer=n)}get next(){return X(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
848 * @license
849 * Copyright 2020 Google LLC
850 *
851 * Licensed under the Apache License, Version 2.0 (the "License");
852 * you may not use this file except in compliance with the License.
853 * You may obtain a copy of the License at
854 *
855 *   http://www.apache.org/licenses/LICENSE-2.0
856 *
857 * Unless required by applicable law or agreed to in writing, software
858 * distributed under the License is distributed on an "AS IS" BASIS,
859 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
860 * See the License for the specific language governing permissions and
861 * limitations under the License.
862 */let Mc={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function nx(t){Mc=t}function vT(t){return Mc.loadJS(t)}function rx(){return Mc.recaptchaEnterpriseScript}function ix(){return Mc.gapiScript}function sx(t){return`__${t}${Math.floor(Math.random()*1e6)}`}class ox{constructor(){this.enterprise=new ax}ready(e){e()}execute(e,n){return Promise.resolve("token")}render(e,n){return""}}class ax{ready(e){e()}execute(e,n){return Promise.resolve("token")}render(e,n){return""}}const lx="recaptcha-enterprise",ET="NO_RECAPTCHA";class ux{constructor(e){this.type=lx,this.auth=Ci(e)}async verify(e="verify",n=!1){async function r(s){if(!n){if(s.tenantId==null&&s._agentRecaptchaConfig!=null)return s._agentRecaptchaConfig.siteKey;if(s.tenantId!=null&&s._tenantRecaptchaConfigs[s.tenantId]!==void 0)return s._tenantRecaptchaConfigs[s.tenantId].siteKey}return new Promise(async(o,l)=>{jk(s,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(u=>{if(u.recaptchaKey===void 0)l(new Error("recaptcha Enterprise site key undefined"));else{const c=new Uk(u);return s.tenantId==null?s._agentRecaptchaConfig=c:s._tenantRecaptchaConfigs[s.tenantId]=c,o(c.siteKey)}}).catch(u=>{l(u)})})}function i(s,o,l){const u=window.grecaptcha;k_(u)?u.enterprise.ready(()=>{u.enterprise.execute(s,{action:e}).then(c=>{o(c)}).catch(()=>{o(ET)})}):l(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new ox().execute("siteKey",{action:"verify"}):new Promise((s,o)=>{r(this.auth).then(l=>{if(!n&&k_(window.grecaptcha))i(l,s,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let u=rx();u.length!==0&&(u+=l),vT(u).then(()=>{i(l,s,o)}).catch(c=>{o(c)})}}).catch(l=>{o(l)})})}}async function V_(t,e,n,r=!1,i=!1){const s=new ux(t);let o;if(i)o=ET;else try{o=await s.verify(n)}catch{o=await s.verify(n,!0)}const l=Object.assign({},e);if(n==="mfaSmsEnrollment"||n==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in l){const u=l.phoneEnrollmentInfo.phoneNumber,c=l.phoneEnrollmentInfo.recaptchaToken;Object.assign(l,{phoneEnrollmentInfo:{phoneNumber:u,recaptchaToken:c,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in l){const u=l.phoneSignInInfo.recaptchaToken;Object.assign(l,{phoneSignInInfo:{recaptchaToken:u,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return l}return r?Object.assign(l,{captchaResp:o}):Object.assign(l,{captchaResponse:o}),Object.assign(l,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(l,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),l}async function L_(t,e,n,r,i){var s;if(!((s=t._getRecaptchaConfig())===null||s===void 0)&&s.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const o=await V_(t,e,n,n==="getOobCode");return r(t,o)}else return r(t,e).catch(async o=>{if(o.code==="auth/missing-recaptcha-token"){console.log(`${n} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const l=await V_(t,e,n,n==="getOobCode");return r(t,l)}else return Promise.reject(o)})}/**
863 * @license
864 * Copyright 2020 Google LLC
865 *
866 * Licensed under the Apache License, Version 2.0 (the "License");
867 * you may not use this file except in compliance with the License.
868 * You may obtain a copy of the License at
869 *
870 *   http://www.apache.org/licenses/LICENSE-2.0
871 *
872 * Unless required by applicable law or agreed to in writing, software
873 * distributed under the License is distributed on an "AS IS" BASIS,
874 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
875 * See the License for the specific language governing permissions and
876 * limitations under the License.
877 */function cx(t,e){const n=Na(t,"auth");if(n.isInitialized()){const i=n.getImmediate(),s=n.getOptions();if(Fr(s,e??{}))return i;hn(i,"already-initialized")}return n.initialize({options:e})}function hx(t,e){const n=(e==null?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map($n);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function dx(t,e,n){const r=Ci(t);
877X(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const i=!1,s=wT(e),{host:o,port:l}=fx(e),u=l===null?"":`:${l}`,c={url:`${s}//${o}${u}/`},d=Object.freeze({host:o,port:l,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})});if(!r._canInitEmulator){X(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),X(Fr(c,r.config.emulator)&&Fr(d,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=c,r.emulatorConfig=d,r.settings.appVerificationDisabledForTesting=!0,nr(o)?(Dc(`${s}//${o}${u}`),Oc("Auth",!0)):px()}function wT(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function fx(t){const e=wT(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const s=i[1];return{host:s,port:M_(r.substr(s.length+1))}}else{const[s,o]=r.split(":");return{host:s,port:M_(o)}}}function M_(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function px(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}/**
878 * @license
879 * Copyright 2020 Google LLC
880 *
881 * Licensed under the Apache License, Version 2.0 (the "License");
882 * you may not use this file except in compliance with the License.
883 * You may obtain a copy of the License at
884 *
885 *   http://www.apache.org/licenses/LICENSE-2.0
886 *
887 * Unless required by applicable law or agreed to in writing, software
888 * distributed under the License is distributed on an "AS IS" BASIS,
889 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
890 * See the License for the specific language governing permissions and
891 * limitations under the License.
892 */class rm{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return zn("not implemented")}_getIdTokenResponse(e){return zn("not implemented")}_linkToIdToken(e,n){return zn("not implemented")}_getReauthenticationResolver(e){return zn("not implemented")}}async function mx(t,e){return rr(t,"POST","/v1/accounts:update",e)}async function gx(t,e){return rr(t,"POST","/v1/accounts:signUp",e)}/**
893 * @license
894 * Copyright 2020 Google LLC
895 *
896 * Licensed under the Apache License, Version 2.0 (the "License");
897 * you may not use this file except in compliance with the License.
898 * You may obtain a copy of the License at
899 *
900 *   http://www.apache.org/licenses/LICENSE-2.0
901 *
902 * Unless required by applicable law or agreed to in writing, software
903 * distributed under the License is distributed on an "AS IS" BASIS,
904 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
905 * See the License for the specific language governing permissions and
906 * limitations under the License.
907 */async function yx(t,e){return Oa(t,"POST","/v1/accounts:signInWithPassword",Qr(t,e))}/**
908 * @license
909 * Copyright 2020 Google LLC
910 *
911 * Licensed under the Apache License, Version 2.0 (the "License");
912 * you may not use this file except in compliance with the License.
913 * You may obtain a copy of the License at
914 *
915 *   http://www.apache.org/licenses/LICENSE-2.0
916 *
917 * Unless required by applicable law or agreed to in writing, software
918 * distributed under the License is distributed on an "AS IS" BASIS,
919 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
920 * See the License for the specific language governing permissions and
921 * limitations under the License.
922 */async function _x(t,e){return Oa(t,"POST","/v1/accounts:signInWithEmailLink",Qr(t,e))}async function vx(t,e){return Oa(t,"POST","/v1/accounts:signInWithEmailLink",Qr(t,e))}/**
923 * @license
924 * Copyright 2020 Google LLC
925 *
926 * Licensed under the Apache License, Version 2.0 (the "License");
927 * you may not use this file except in compliance with the License.
928 * You may obtain a copy of the License at
929 *
930 *   http://www.apache.org/licenses/LICENSE-2.0
931 *
932 * Unless required by applicable law or agreed to in writing, software
933 * distributed under the License is distributed on an "AS IS" BASIS,
934 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
935 * See the License for the specific language governing permissions and
936 * limitations under the License.
937 */class ga extends rm{constructor(e,n,r,i=null){super("password",r),this._email=e,this._password=n,this._tenantId=i}static _fromEmailAndPassword(e,n){return new ga(e,n,"password")}static _fromEmailAndCode(e,n,r=null){return new ga(e,n,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e;if(n!=null&&n.email&&(n!=null&&n.password)){if(n.signInMethod==="password")return this._fromEmailAndPassword(n.email,n.password);if(n.signInMethod==="emailLink")return this._fromEmailAndCode(n.email,n.password,n.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return L_(e,n,"signInWithPassword",yx);case"emailLink":return _x(e,{email:this._email,oobCode:this._password});default:hn(e,"internal-error")}}async _linkToIdToken(e,n){switch(this.signInMethod){case"password":const r={idToken:n,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return L_(e,r,"signUpPassword",gx);case"emailLink":return vx(e,{idToken:n,email:this._email,oobCode:this._password});default:hn(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
938 * @license
939 * Copyright 2020 Google LLC
940 *
941 * Licensed under the Apache License, Version 2.0 (the "License");
942 * you may not use this file except in compliance with the License.
943 * You may obtain a copy of the License at
944 *
945 *   http://www.apache.org/licenses/LICENSE-2.0
946 *
947 * Unless required by applicable law or agreed to in writing, software
948 * distributed under the License is distributed on an "AS IS" BASIS,
949 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
950 * See the License for the specific language governing permissions and
951 * limitations under the License.
952 */async function ds(t,e){return Oa(t,"POST","/v1/accounts:signInWithIdp",Qr(t,e))}/**
953 * @license
954 * Copyright 2020 Google LLC
955 *
956 * Licensed under the Apache License, Version 2.0 (the "License");
957 * you may not use this file except in compliance with the License.
958 * You may obtain a copy of the License at
959 *
960 *   http://www.apache.org/licenses/LICENSE-2.0
961 *
962 * Unless required by applicable law or agreed to in writing, software
963 * distributed under the License is distributed on an "AS IS" BASIS,
964 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
965 * See the License for the specific language governing permissions and
966 * limitations under the License.
967 */const Ex="http://localhost";class vi extends rm{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new vi(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):hn("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
967once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:i}=n,s=Jp(n,["providerId","signInMethod"]);if(!r||!i)return null;const o=new vi(r,i);return o.idToken=s.idToken||void 0,o.accessToken=s.accessToken||void 0,o.secret=s.secret,o.nonce=s.nonce,o.pendingToken=s.pendingToken||null,o}_getIdTokenResponse(e){const n=this.buildRequest();return ds(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,ds(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,ds(e,n)}buildRequest(){const e={requestUri:Ex,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=ba(n)}return e}}/**
968 * @license
969 * Copyright 2020 Google LLC
970 *
971 * Licensed under the Apache License, Version 2.0 (the "License");
972 * you may not use this file except in compliance with the License.
973 * You may obtain a copy of the License at
974 *
975 *   http://www.apache.org/licenses/LICENSE-2.0
976 *
977 * Unless required by applicable law or agreed to in writing, software
978 * distributed under the License is distributed on an "AS IS" BASIS,
979 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
980 * See the License for the specific language governing permissions and
981 * limitations under the License.
982 */function wx(t){switch(t){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function Tx(t){const e=Co(Po(t)).link,n=e?Co(Po(e)).deep_link_id:null,r=Co(Po(t)).deep_link_id;return(r?Co(Po(r)).link:null)||r||n||e||t}class im{constructor(e){var n,r,i,s,o,l;const u=Co(Po(e)),c=(n=u.apiKey)!==null&&n!==void 0?n:null,d=(r=u.oobCode)!==null&&r!==void 0?r:null,p=wx((i=u.mode)!==null&&i!==void 0?i:null);X(c&&d&&p,"argument-error"),this.apiKey=c,this.operation=p,this.code=d,this.continueUrl=(s=u.continueUrl)!==null&&s!==void 0?s:null,this.languageCode=(o=u.lang)!==null&&o!==void 0?o:null,this.tenantId=(l=u.tenantId)!==null&&l!==void 0?l:null}static parseLink(e){const n=Tx(e);try{return new im(n)}catch{return null}}}/**
983 * @license
984 * Copyright 2020 Google LLC
985 *
986 * Licensed under the Apache License, Version 2.0 (the "License");
987 * you may not use this file except in compliance with the License.
988 * You may obtain a copy of the License at
989 *
990 *   http://www.apache.org/licenses/LICENSE-2.0
991 *
992 * Unless required by applicable law or agreed to in writing, software
993 * distributed under the License is distributed on an "AS IS" BASIS,
994 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
995 * See the License for the specific language governing permissions and
996 * limitations under the License.
997 */class Us{constructor(){this.providerId=Us.PROVIDER_ID}static credential(e,n){return ga._fromEmailAndPassword(e,n)}static credentialWithLink(e,n){const r=im.parseLink(n);return X(r,"argument-error"),ga._fromEmailAndCode(e,r.code,r.tenantId)}}Us.PROVIDER_ID="password";Us.EMAIL_PASSWORD_SIGN_IN_METHOD="password";Us.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
998 * @license
999 * Copyright 2020 Google LLC
1000 *
1001 * Licensed under the Apache License, Version 2.0 (the "License");
1002 * you may not use this file except in compliance with the License.
1003 * You may obtain a copy of the License at
1004 *
1005 *   http://www.apache.org/licenses/LICENSE-2.0
1006 *
1007 * Unless required by applicable law or agreed to in writing, software
1008 * distributed under the License is distributed on an "AS IS" BASIS,
1009 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010 * See the License for the specific language governing permissions and
1011 * limitations under the License.
1012 */class TT{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/**
1013 * @license
1014 * Copyright 2019 Google LLC
1015 *
1016 * Licensed under the Apache License, Version 2.0 (the "License");
1017 * you may not use this file except in compliance with the License.
1018 * You may obtain a copy of the License at
1019 *
1020 *   http://www.apache.org/licenses/LICENSE-2.0
1021 *
1022 * Unless required by applicable law or agreed to in writing, software
1023 * distributed under the License is distributed on an "AS IS" BASIS,
1024 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1025 * See the License for the specific language governing permissions and
1026 * limitations under the License.
1027 */class Va extends TT{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
1028 * @license
1029 * Copyright 2020 Google LLC
1030 *
1031 * Licensed under the Apache License, Version 2.0 (the "License");
1032 * you may not use this file except in compliance with the License.
1033 * You may obtain a copy of the License at
1034 *
1035 *   http://www.apache.org/licenses/LICENSE-2.0
1036 *
1037 * Unless required by applicable law or agreed to in writing, software
1038 * distributed under the License is distributed on an "AS IS" BASIS,
1039 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1040 * See the License for the specific language governing permissions and
1041 * limitations under the License.
1042 */class fr extends Va{constructor(){super("facebook.com")}static credential(e){return vi._fromParams({providerId:fr.PROVIDER_ID,signInMethod:fr.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return fr.credentialFromTaggedObject(e)}static credentialFromError(e){return fr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return fr.credential(e.oauthAccessToken)}catch{return null}}}fr.FACEBOOK_SIGN_IN_METHOD="facebook.com";fr.PROVIDER_ID="facebook.com";/**
1043 * @license
1044 * Copyright 2020 Google LLC
1045 *
1046 * Licensed under the Apache License, Version 2.0 (the "License");
1047 * you may not use this file except in compliance with the License.
1048 * You may obtain a copy of the License at
1049 *
1050 *   http://www.apache.org/licenses/LICENSE-2.0
1051 *
1052 * Unless required by applicable law or agreed to in writing, software
1053 * distributed under the License is distributed on an "AS IS" BASIS,
1054 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1055 * See the License for the specific language governing permissions and
1056 * limitations under the License.
1057 */class pr extends Va{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return vi._fromParams({providerId:pr.PROVIDER_ID,signInMethod:pr.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return pr.credentialFromTaggedObject(e)}static credentialFromError(e){return pr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return pr.credential(n,r)}catch{return null}}}pr.GOOGLE_SIGN_IN_METHOD="google.com";pr.PROVIDER_ID="google.com";/**
1058 * @license
1059 * Copyright 2020 Google LLC
1060 *
1061 * Licensed under the Apache License, Version 2.0 (the "License");
1062 * you may not use this file except in compliance with the License.
1063 * You may obtain a copy of the License at
1064 *
1065 *   http://www.apache.org/licenses/LICENSE-2.0
1066 *
1067 * Unless required by applicable law or agreed to in writing, software
1068 * distributed under the License is distributed on an "AS IS" BASIS,
1069 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1070 * See the License for the specific language governing permissions and
1071 * limitations under the License.
1072 */class mr extends Va{constructor(){super("github.com")}static credential(e){return vi._fromParams({providerId:mr.PROVIDER_ID,signInMethod:mr.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return mr.credentialFromTaggedObject(e)}static credentialFromError(e){return mr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return mr.credential(e.oauthAccessToken)}catch{return null}}}mr.GITHUB_SIGN_IN_METHOD="github.com";mr.PROVIDER_ID="github.com";/**
1073 * @license
1074 * Copyright 2020 Google LLC
1075 *
1076 * Licensed under the Apache License, Version 2.0 (the "License");
1077 * you may not use this file except in compliance with the License.
1078 * You may obtain a copy of the License at
1079 *
1080 *   http://www.apache.org/licenses/LICENSE-2.0
1081 *
1082 * Unless required by applicable law or agreed to in writing, software
1083 * distributed under the License is distributed on an "AS IS" BASIS,
1084 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1085 * See the License for the specific language governing permissions and
1086 * limitations under the License.
1087 */class gr extends Va{constructor(){super("twitter.com")}static credential(e,n){return vi._fromParams({providerId:gr.PROVIDER_ID,signInMethod:gr.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return gr.credentialFromTaggedObject(e)}static credentialFromError(e){return gr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return gr.credential(n,r)}catch{return null}}}gr.TWITTER_SIGN_IN_METHOD="twitter.com";gr.PROVIDER_ID="twitter.com";/**
1088 * @license
1089 * Copyright 2020 Google LLC
1090 *
1091 * Licensed under the Apache License, Version 2.0 (the "License");
1092 * you may not use this file except in compliance with the License.
1093 * You may obtain a copy of the License at
1094 *
1095 *   http://www.apache.org/licenses/LICENSE-2.0
1096 *
1097 * Unless required by applicable law or agreed to in writing, software
1098 * distributed under the License is distributed on an "AS IS" BASIS,
1099 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1100 * See the License for the specific language governing permissions and
1101 * limitations under the License.
1102 */class Ei{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,i=!1){const s=await on._fromIdTokenResponse(e,r,i),o=F_(r);return new Ei({user:s,providerId:o,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const i=F_(r);return new Ei({user:e,providerId:i,_tokenResponse:r,operationType:n})}}function F_(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/**
1103 * @license
1104 * Copyright 2020 Google LLC
1105 *
1106 * Licensed under the Apache License, Version 2.0 (the "License");
1107 * you may not use this file except in compliance with the License.
1108 * You may obtain a copy of the License at
1109 *
1110 *   http://www.apache.org/licenses/LICENSE-2.0
1111 *
1112 * Unless required by applicable law or agreed to in writing, software
1113 * distributed under the License is distributed on an "AS IS" BASIS,
1114 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1115 * See the License for the specific language governing permissions and
1116 * limitations under the License.
1117 */class Ku extends mn{constructor(e,n,r,i){var s;super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,Ku.prototype),this.customData={appName:e.name,tenantId:(s=e.tenantId)!==null&&s!==void 0?s:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,i){return new Ku(e,n,r,i)}}function IT(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(s=>{throw s.code==="auth/multi-factor-auth-required"?Ku._fromErrorAndOperation(t,s,e,r):s})}async function Ix(t,e,n=!1){const r=await Ts(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return Ei._forOperation(t,"link",r)}/**
1118 * @license
1119 * Copyright 2019 Google LLC
1120 *
1121 * Licensed under the Apache License, Version 2.0 (the "License");
1122 * you may not use this file except in compliance with the License.
1123 * You may obtain a copy of the License at
1124 *
1125 *   http://www.apache.org/licenses/LICENSE-2.0
1126 *
1127 * Unless required by applicable law or agreed to in writing, software
1128 * distributed under the License is distributed on an "AS IS" BASIS,
1129 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1130 * See the License for the specific language governing permissions and
1131 * limitations under the License.
1132 */async function Ax(t,e,n=!1){const{auth:r}=t;if(St(r.app))return Promise.reject(Wn(r));const i="reauthenticate";try{const s=await Ts(t,IT(r,i,e,t),n);X(s.idToken,r,"internal-error");const o=tm(s.idToken);X(o,r,"internal-error");const{sub:l}=o;return X(t.uid===l,r,"user-mismatch"),Ei._forOperation(t,i,s)}catch(s){throw(s==null?void 0:s.code)==="auth/user-not-found"&&hn(r,"user-mismatch"),s}}/**
1133 * @license
1134 * Copyright 2020 Google LLC
1135 *
1136 * Licensed under the Apache License, Version 2.0 (the "License");
1137 * you may not use this file except in compliance with the License.
1138 * You may obtain a copy of the License at
1139 *
1140 *   http://www.apache.org/licenses/LICENSE-2.0
1141 *
1142 * Unless required by applicable law or agreed to in writing, software
1143 * distributed under the License is distributed on an "AS IS" BASIS,
1144 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1145 * See the License for the specific language governing permissions and
1146 * limitations under the License.
1147 */async function AT(t,e,n=!1){if(St(t.app))return Promise.reject(Wn(t));const r="signIn",i=await IT(t,r,e),s=await Ei._fromIdTokenResponse(t,r,i);return n||await t._updateCurrentUser(s.user),s}async function Sx(t,e){return AT(Ci(t),e)}/**
1148 * @license
1149 * Copyright 2020 Google LLC
1150 *
1151 * Licensed under the Apache License, Version 2.0 (the "License");
1152 * you may not use this file except in compliance with the License.
1153 * You may obtain a copy of the License at
1154 *
1155 *   http://www.apache.org/licenses/LICENSE-2.0
1156 *
1157 * Unless required by applicable law or agreed to in writing, software
1158 * distributed under the License is distributed on an "AS IS" BASIS,
1159 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1160 * See the License for the specific language governing permissions and
1161 * limitations under the License.
1162 */async function Rx(t,e){return Oa(t,"POST","/v1/accounts:signInWithCustomToken",Qr(t,e))}/**
1163 * @license
1164 * Copyright 2020 Google LLC
1165 *
1166 * Licensed under the Apache License, Version 2.0 (the "License");
1167 * you may not use this file except in compliance with the License.
1168 * You may obtain a copy of the License at
1169 *
1170 *   http://www.apache.org/licenses/LICENSE-2.0
1171 *
1172 * Unless required by applicable law or agreed to in writing, software
1173 * distributed under the License is distributed on an "AS IS" BASIS,
1174 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1175 * See the License for the specific language governing permissions and
1176 * limitations under the License.
1177 */async function Cx(t,e){if(St(t.app))return Promise.reject(Wn(t));const n=Ci(t),r=await Rx(n,{token:e,returnSecureToken:!0}),i=await Ei._fromIdTokenResponse(n,"signIn",r);return await n._updateCurrentUser(i.user),i}/**
1178 * @license
1179 * Copyright 2020 Google LLC
1180 *
1181 * Licensed under the Apache License, Version 2.0 (the "License");
1182 * you may not use this file except in compliance with the License.
1183 * You may obtain a copy of the License at
1184 *
1185 *   http://www.apache.org/licenses/LICENSE-2.0
1186 *
1187 * Unless required by applicable law or agreed to in writing, software
1188 * distributed under the License is distributed on an "AS IS" BASIS,
1189 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1190 * See the License for the specific language governing permissions and
1191 * limitations under the License.
1192 */async function Px(t){const e=Ci(t);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}function eF(t,e,n){return St(t.app)?Promise.reject(Wn(t)):Sx(he(t),Us.credential(e,n)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&Px(t),r})}function tF(t,e){return kx(he(t),null,e)}async function kx(t,e,n){const{auth:r}=t,s={idToken:await t.getIdToken(),returnSecureToken:!0};n&&(s.password=n);const o=await Ts(t,mx(r,s));await t._updateTokensIfNecessary(o,!0)}function xx(t,e,n,r){return he(t).onIdTokenChanged(e,n,r)}function bx(t,e,n){return he(t).beforeAuthStateChanged(e,n)}function Nx(t,e,n,r){return he(t).onAuthStateChanged(e,n,r)}function Dx(t){return he(t).signOut()}const Qu="__sak";/**
1193 * @license
1194 * Copyright 2019 Google LLC
1195 *
1196 * Licensed under the Apache License, Version 2.0 (the "License");
1197 * you may not use this file except in compliance with the License.
1198 * You may obtain a copy of the License at
1199 *
1200 *   http://www.apache.org/licenses/LICENSE-2.0
1201 *
1202 * Unless required by applicable law or agreed to in writing, software
1203 * distributed under the License is distributed on an "AS IS" BASIS,
1204 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1205 * See the License for the specific language governing permissions and
1206 * limitations under the License.
1207 */class ST{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Qu,"1"),this.storage.removeItem(Qu),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1208 * @license
1209 * Copyright 2020 Google LLC
1210 *
1211 * Licensed under the Apache License, Version 2.0 (the "License");
1212 * you may not use this file except in compliance with the License.
1213 * You may obtain a copy of the License at
1214 *
1215 *   http://www.apache.org/licenses/LICENSE-2.0
1216 *
1217 * Unless required by applicable law or agreed to in writing, software
1218 * distributed under the License is distributed on an "AS IS" BASIS,
1219 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1220 * See the License for the specific language governing permissions and
1221 * limitations under the License.
1222 */const Ox=1e3,Vx=10;class RT extends ST{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=yT(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),i=this.localCache[n];r!==i&&e(n,i,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((o,l,u)=>{this.notifyListeners(o,u)});return}const r=e.key;n?this.detachListener():this.stopPolling();const i=()=>{const o=this.storage.getItem(r);!n&&this.localCache[r]===o||this.notifyListeners(r,o)},s=this.storage.getItem(r);Xk()&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(i,Vx):i()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},Ox)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
1222ject.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}RT.type="LOCAL";const Lx=RT;/**
1223 * @license
1224 * Copyright 2020 Google LLC
1225 *
1226 * Licensed under the Apache License, Version 2.0 (the "License");
1227 * you may not use this file except in compliance with the License.
1228 * You may obtain a copy of the License at
1229 *
1230 *   http://www.apache.org/licenses/LICENSE-2.0
1231 *
1232 * Unless required by applicable law or agreed to in writing, software
1233 * distributed under the License is distributed on an "AS IS" BASIS,
1234 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1235 * See the License for the specific language governing permissions and
1236 * limitations under the License.
1237 */class CT extends ST{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}CT.type="SESSION";const PT=CT;/**
1238 * @license
1239 * Copyright 2019 Google LLC
1240 *
1241 * Licensed under the Apache License, Version 2.0 (the "License");
1242 * you may not use this file except in compliance with the License.
1243 * You may obtain a copy of the License at
1244 *
1245 *   http://www.apache.org/licenses/LICENSE-2.0
1246 *
1247 * Unless required by applicable law or agreed to in writing, software
1248 * distributed under the License is distributed on an "AS IS" BASIS,
1249 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1250 * See the License for the specific language governing permissions and
1251 * limitations under the License.
1252 */function Mx(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
1253 * @license
1254 * Copyright 2019 Google LLC
1255 *
1256 * Licensed under the Apache License, Version 2.0 (the "License");
1257 * you may not use this file except in compliance with the License.
1258 * You may obtain a copy of the License at
1259 *
1260 *   http://www.apache.org/licenses/LICENSE-2.0
1261 *
1262 * Unless required by applicable law or agreed to in writing, software
1263 * distributed under the License is distributed on an "AS IS" BASIS,
1264 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1265 * See the License for the specific language governing permissions and
1266 * limitations under the License.
1267 */class Fc{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(i=>i.isListeningto(e));if(n)return n;const r=new Fc(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:i,data:s}=n.data,o=this.handlersMap[i];if(!(o!=null&&o.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const l=Array.from(o).map(async c=>c(n.origin,s)),u=await Mx(l);n.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:u})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Fc.receivers=[];/**
1268 * @license
1269 * Copyright 2020 Google LLC
1270 *
1271 * Licensed under the Apache License, Version 2.0 (the "License");
1272 * you may not use this file except in compliance with the License.
1273 * You may obtain a copy of the License at
1274 *
1275 *   http://www.apache.org/licenses/LICENSE-2.0
1276 *
1277 * Unless required by applicable law or agreed to in writing, software
1278 * distributed under the License is distributed on an "AS IS" BASIS,
1279 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1280 * See the License for the specific language governing permissions and
1281 * limitations under the License.
1282 */function sm(t="",e=10){let n="";for(let r=0;r<e;r++)n+=Math.floor(Math.random()*10);return t+n}/**
1283 * @license
1284 * Copyright 2019 Google LLC
1285 *
1286 * Licensed under the Apache License, Version 2.0 (the "License");
1287 * you may not use this file except in compliance with the License.
1288 * You may obtain a copy of the License at
1289 *
1290 *   http://www.apache.org/licenses/LICENSE-2.0
1291 *
1292 * Unless required by applicable law or agreed to in writing, software
1293 * distributed under the License is distributed on an "AS IS" BASIS,
1294 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1295 * See the License for the specific language governing permissions and
1296 * limitations under the License.
1297 */class Fx{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,n,r=50){const i=typeof MessageChannel<"u"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let s,o;return new Promise((l,u)=>{const c=sm("",20);i.port1.start();const d=setTimeout(()=>{u(new Error("unsupported_event"))},r);o={messageChannel:i,onMessage(p){const m=p;if(m.data.eventId===c)switch(m.data.status){case"ack":clearTimeout(d),s=setTimeout(()=>{u(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),l(m.data.response);break;default:clearTimeout(d),clearTimeout(s),u(new Error("invalid_response"));break}}},this.handlers.add(o),i.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:c,data:n},[i.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
1298 * @license
1299 * Copyright 2020 Google LLC
1300 *
1301 * Licensed under the Apache License, Version 2.0 (the "License");
1302 * you may not use this file except in compliance with the License.
1303 * You may obtain a copy of the License at
1304 *
1305 *   http://www.apache.org/licenses/LICENSE-2.0
1306 *
1307 * Unless required by applicable law or agreed to in writing, software
1308 * distributed under the License is distributed on an "AS IS" BASIS,
1309 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1310 * See the License for the specific language governing permissions and
1311 * limitations under the License.
1312 */function Sn(){return window}function Ux(t){Sn().location.href=t}/**
1313 * @license
1314 * Copyright 2020 Google LLC.
1315 *
1316 * Licensed under the Apache License, Version 2.0 (the "License");
1317 * you may not use this file except in compliance with the License.
1318 * You may obtain a copy of the License at
1319 *
1320 *   http://www.apache.org/licenses/LICENSE-2.0
1321 *
1322 * Unless required by applicable law or agreed to in writing, software
1323 * distributed under the License is distributed on an "AS IS" BASIS,
1324 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1325 * See the License for the specific language governing permissions and
1326 * limitations under the License.
1327 */function kT(){return typeof Sn().WorkerGlobalScope<"u"&&typeof Sn().importScripts=="function"}async function jx(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function zx(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function $x(){return kT()?self:null}/**
1328 * @license
1329 * Copyright 2019 Google LLC
1330 *
1331 * Licensed under the Apache License, Version 2.0 (the "License");
1332 * you may not use this file except in compliance with the License.
1333 * You may obtain a copy of the License at
1334 *
1335 *   http://www.apache.org/licenses/LICENSE-2.0
1336 *
1337 * Unless required by applicable law or agreed to in writing, software
1338 * distributed under the License is distributed on an "AS IS" BASIS,
1339 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1340 * See the License for the specific language governing permissions and
1341 * limitations under the License.
1342 */const xT="firebaseLocalStorageDb",Bx=1,Xu="firebaseLocalStorage",bT="fbase_key";class La{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function Uc(t,e){return t.transaction([Xu],e?"readwrite":"readonly").objectStore(Xu)}function Wx(){const t=indexedDB.deleteDatabase(xT);
1342return new La(t).toPromise()}function Af(){const t=indexedDB.open(xT,Bx);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore(Xu,{keyPath:bT})}catch(i){n(i)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains(Xu)?e(r):(r.close(),await Wx(),e(await Af()))})})}async function U_(t,e,n){const r=Uc(t,!0).put({[bT]:e,value:n});return new La(r).toPromise()}async function qx(t,e){const n=Uc(t,!1).get(e),r=await new La(n).toPromise();return r===void 0?null:r.value}function j_(t,e){const n=Uc(t,!0).delete(e);return new La(n).toPromise()}const Hx=800,Gx=3;class NT{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Af(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>Gx)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return kT()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Fc._getInstance($x()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)}
1342)),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var e,n;if(this.activeServiceWorker=await jx(),!this.activeServiceWorker)return;this.sender=new Fx(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((n=r[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||zx()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Af();return await U_(e,Qu,"1"),await j_(e,Qu),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>U_(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>qx(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>j_(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(i=>{const s=Uc(i,!1).getAll();return new La(s).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(e.length!==0)for(const{fbase_key:i,value:s}of e)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(s)&&(this.notifyListeners(i,s),n.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),n.push(i));return n}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Hx)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
1342ject.keys(this.listeners).length===0&&this.stopPolling()}}NT.type="LOCAL";const Kx=NT;new Da(3e4,6e4);/**
1343 * @license
1344 * Copyright 2021 Google LLC
1345 *
1346 * Licensed under the Apache License, Version 2.0 (the "License");
1347 * you may not use this file except in compliance with the License.
1348 * You may obtain a copy of the License at
1349 *
1350 *   http://www.apache.org/licenses/LICENSE-2.0
1351 *
1352 * Unless required by applicable law or agreed to in writing, software
1353 * distributed under the License is distributed on an "AS IS" BASIS,
1354 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1355 * See the License for the specific language governing permissions and
1356 * limitations under the License.
1357 */function Qx(t,e){return e?$n(e):(X(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/**
1358 * @license
1359 * Copyright 2019 Google LLC
1360 *
1361 * Licensed under the Apache License, Version 2.0 (the "License");
1362 * you may not use this file except in compliance with the License.
1363 * You may obtain a copy of the License at
1364 *
1365 *   http://www.apache.org/licenses/LICENSE-2.0
1366 *
1367 * Unless required by applicable law or agreed to in writing, software
1368 * distributed under the License is distributed on an "AS IS" BASIS,
1369 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1370 * See the License for the specific language governing permissions and
1371 * limitations under the License.
1372 */class om extends rm{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return ds(e,this._buildIdpRequest())}_linkToIdToken(e,n){return ds(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return ds(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(n.idToken=e),n}}function Xx(t){return AT(t.auth,new om(t),t.bypassAuthState)}function Yx(t){const{auth:e,user:n}=t;return X(n,e,"internal-error"),Ax(n,new om(t),t.bypassAuthState)}async function Jx(t){const{auth:e,user:n}=t;return X(n,e,"internal-error"),Ix(n,new om(t),t.bypassAuthState)}/**
1373 * @license
1374 * Copyright 2020 Google LLC
1375 *
1376 * Licensed under the Apache License, Version 2.0 (the "License");
1377 * you may not use this file except in compliance with the License.
1378 * You may obtain a copy of the License at
1379 *
1380 *   http://www.apache.org/licenses/LICENSE-2.0
1381 *
1382 * Unless required by applicable law or agreed to in writing, software
1383 * distributed under the License is distributed on an "AS IS" BASIS,
1384 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1385 * See the License for the specific language governing permissions and
1386 * limitations under the License.
1387 */class DT{constructor(e,n,r,i,s=!1){this.auth=e,this.resolver=r,this.user=i,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:r,postBody:i,tenantId:s,error:o,type:l}=e;if(o){this.reject(o);return}const u={auth:this.auth,requestUri:n,sessionId:r,tenantId:s||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(l)(u))}catch(c){this.reject(c)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Xx;case"linkViaPopup":case"linkViaRedirect":return Jx;case"reauthViaPopup":case"reauthViaRedirect":return Yx;default:hn(this.auth,"internal-error")}}resolve(e){Xn(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Xn(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1388 * @license
1389 * Copyright 2020 Google LLC
1390 *
1391 * Licensed under the Apache License, Version 2.0 (the "License");
1392 * you may not use this file except in compliance with the License.
1393 * You may obtain a copy of the License at
1394 *
1395 *   http://www.apache.org/licenses/LICENSE-2.0
1396 *
1397 * Unless required by applicable law or agreed to in writing, software
1398 * distributed under the License is distributed on an "AS IS" BASIS,
1399 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1400 * See the License for the specific language governing permissions and
1401 * limitations under the License.
1402 */const Zx=new Da(2e3,1e4);class rs extends DT{constructor(e,n,r,i,s){super(e,n,i,s),this.provider=r,this.authWindow=null,this.pollId=null,rs.currentPopupAction&&rs.currentPopupAction.cancel(),rs.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return X(e,this.auth,"internal-error"),e}async onExecution(){Xn(this.filter.length===1,"Popup operations only handle one event");const e=sm();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(An(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(An(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,rs.currentPopupAction=null}pollUserCancellation(){const e=()=>{var n,r;if(!((r=(n=this.authWindow)===null||n===void 0?void 0:n.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(An(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Zx.get())};e()}}rs.currentPopupAction=null;/**
1403 * @license
1404 * Copyright 2020 Google LLC
1405 *
1406 * Licensed under the Apache License, Version 2.0 (the "License");
1407 * you may not use this file except in compliance with the License.
1408 * You may obtain a copy of the License at
1409 *
1410 *   http://www.apache.org/licenses/LICENSE-2.0
1411 *
1412 * Unless required by applicable law or agreed to in writing, software
1413 * distributed under the License is distributed on an "AS IS" BASIS,
1414 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1415 * See the License for the specific language governing permissions and
1416 * limitations under the License.
1417 */const eb="pendingRedirect",Zl=new Map;class tb extends DT{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=Zl.get(this.auth._key());if(!e){try{const r=await nb(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}Zl.set(this.auth._key(),e)}return this.bypassAuthState||Zl.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function nb(t,e){const n=sb(e),r=ib(t);if(!await r._isAvailable())return!1;const i=await r._get(n)==="true";return await r._remove(n),i}function rb(t,e){Zl.set(t._key(),e)}function ib(t){return $n(t._redirectPersistence)}function sb(t){return Jl(eb,t.config.apiKey,t.name)}async function ob(t,e,n=!1){if(St(t.app))return Promise.reject(Wn(t));const r=Ci(t),i=Qx(r,e),o=await new tb(r,i,n).execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/**
1418 * @license
1419 * Copyright 2020 Google LLC
1420 *
1421 * Licensed under the Apache License, Version 2.0 (the "License");
1422 * you may not use this file except in compliance with the License.
1423 * You may obtain a copy of the License at
1424 *
1425 *   http://www.apache.org/licenses/LICENSE-2.0
1426 *
1427 * Unless required by applicable law or agreed to in writing, softw
1427are
1428 * distributed under the License is distributed on an "AS IS" BASIS,
1429 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1430 * See the License for the specific language governing permissions and
1431 * limitations under the License.
1432 */const ab=10*60*1e3;class lb{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!ub(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var r;if(e.error&&!OT(e)){const i=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";n.onError(An(this.auth,i))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=ab&&this.cachedEventUids.clear(),this.cachedEventUids.has(z_(e))}saveEventToCache(e){this.cachedEventUids.add(z_(e)),this.lastProcessedEventTime=Date.now()}}function z_(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function OT({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function ub(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return OT(t);default:return!1}}/**
1433 * @license
1434 * Copyright 2020 Google LLC
1435 *
1436 * Licensed under the Apache License, Version 2.0 (the "License");
1437 * you may not use this file except in compliance with the License.
1438 * You may obtain a copy of the License at
1439 *
1440 *   http://www.apache.org/licenses/LICENSE-2.0
1441 *
1442 * Unless required by applicable law or agreed to in writing, software
1443 * distributed under the License is distributed on an "AS IS" BASIS,
1444 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1445 * See the License for the specific language governing permissions and
1446 * limitations under the License.
1447 */async function cb(t,e={}){return rr(t,"GET","/v1/projects",e)}/**
1448 * @license
1449 * Copyright 2020 Google LLC
1450 *
1451 * Licensed under the Apache License, Version 2.0 (the "License");
1452 * you may not use this file except in compliance with the License.
1453 * You may obtain a copy of the License at
1454 *
1455 *   http://www.apache.org/licenses/LICENSE-2.0
1456 *
1457 * Unless required by applicable law or agreed to in writing, software
1458 * distributed under the License is distributed on an "AS IS" BASIS,
1459 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1460 * See the License for the specific language governing permissions and
1461 * limitations under the License.
1462 */const hb=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,db=/^https?/;async function fb(t){if(t.config.emulator)return;const{authorizedDomains:e}=await cb(t);for(const n of e)try{if(pb(n))return}catch{}hn(t,"unauthorized-domain")}function pb(t){const e=Tf(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const o=new URL(t);return o.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&o.hostname===r}if(!db.test(n))return!1;if(hb.test(t))return r===t;const i=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/**
1463 * @license
1464 * Copyright 2020 Google LLC.
1465 *
1466 * Licensed under the Apache License, Version 2.0 (the "License");
1467 * you may not use this file except in compliance with the License.
1468 * You may obtain a copy of the License at
1469 *
1470 *   http://www.apache.org/licenses/LICENSE-2.0
1471 *
1472 * Unless required by applicable law or agreed to in writing, softw
1472are
1473 * distributed under the License is distributed on an "AS IS" BASIS,
1474 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1475 * See the License for the specific language governing permissions and
1476 * limitations under the License.
1477 */const mb=new Da(3e4,6e4);function $_(){const t=Sn().___jsl;if(t!=null&&t.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n<t.CP.length;n++)t.CP[n]=null}}function gb(t){return new Promise((e,n)=>{var r,i,s;function o(){$_(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{$_(),n(An(t,"network-request-failed"))},timeout:mb.get()})}if(!((i=(r=Sn().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)e(gapi.iframes.getContext());else if(!((s=Sn().gapi)===null||s===void 0)&&s.load)o();else{const l=sx("iframefcb");return Sn()[l]=()=>{gapi.load?o():n(An(t,"network-request-failed"))},vT(`${ix()}?onload=${l}`).catch(u=>n(u))}}).catch(e=>{throw eu=null,e})}let eu=null;function yb(t){return eu=eu||gb(t),eu}/**
1478 * @license
1479 * Copyright 2020 Google LLC.
1480 *
1481 * Licensed under the Apache License, Version 2.0 (the "License");
1482 * you may not use this file except in compliance with the License.
1483 * You may obtain a copy of the License at
1484 *
1485 *   http://www.apache.org/licenses/LICENSE-2.0
1486 *
1487 * Unless required by applicable law or agreed to in writing, software
1488 * distributed under the License is distributed on an "AS IS" BASIS,
1489 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1490 * See the License for the specific language governing permissions and
1491 * limitations under the License.
1492 */const _b=new Da(5e3,15e3),vb="__/auth/iframe",Eb="emulator/auth/iframe",wb={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Tb=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Ib(t){const e=t.config;X(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?em(e,Eb):`https://${t.config.authDomain}/${vb}`,r={apiKey:e.apiKey,appName:t.name,v:Ri},i=Tb.get(t.config.apiHost);i&&(r.eid=i);const s=t._getFrameworks();return s.length&&(r.fw=s.join(",")),`${n}?${ba(r).slice(1)}`}async function Ab(t){const e=await yb(t),n=Sn().gapi;return X(n,t,"internal-error"),e.open({where:document.body,url:Ib(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:wb,dontclear:!0},r=>new Promise(async(i,s)=>{await r.restyle({setHideOnLeave:!1});const o=An(t,"network-request-failed"),l=Sn().setTimeout(()=>{s(o)},_b.get());function u(){Sn().clearTimeout(l),i(r)}r.ping(u).then(u,()=>{s(o)})}))}/**
1493 * @license
1494 * Copyright 2020 Google LLC.
1495 *
1496 * Licensed under the Apache License, Version 2.0 (the "License");
1497 * you may not use this file except in compliance with the License.
1498 * You may obtain a copy of the License at
1499 *
1500 *   http://www.apache.org/licenses/LICENSE-2.0
1501 *
1502 * Unless required by applicable law or agreed to in writing, software
1503 * distributed under the License is distributed on an "AS IS" BASIS,
1504 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1505 * See the License for the specific language governing permissions and
1506 * limitations under the License.
1507 */const Sb={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Rb=500,Cb=600,Pb="_blank",kb="http://localhost";class B_{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function xb(t,e,n,r=Rb,i=Cb){const s=Math.max((window.screen.availHeight-i)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let l="";const u=Object.assign(Object.assign({},Sb),{width:r.toString(),height:i.toString(),top:s,left:o}),c=dt().toLowerCase();n&&(l=dT(c)?Pb:n),cT(c)&&(e=e||kb,u.scrollbars="yes");const d=Object.entries(u).reduce((m,[v,w])=>`${m}${v}=${w},`,"");if(Qk(c)&&l!=="_self")return bb(e||"",l),new B_(null);const p=window.open(e||"",l,d);X(p,t,"popup-blocked");try{p.focus()}catch{}return new B_(p)}function bb(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");
1507r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/**
1508 * @license
1509 * Copyright 2021 Google LLC
1510 *
1511 * Licensed under the Apache License, Version 2.0 (the "License");
1512 * you may not use this file except in compliance with the License.
1513 * You may obtain a copy of the License at
1514 *
1515 *   http://www.apache.org/licenses/LICENSE-2.0
1516 *
1517 * Unless required by applicable law or agreed to in writing, software
1518 * distributed under the License is distributed on an "AS IS" BASIS,
1519 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1520 * See the License for the specific language governing permissions and
1521 * limitations under the License.
1522 */const Nb="__/auth/handler",Db="emulator/auth/handler",Ob=encodeURIComponent("fac");async function W_(t,e,n,r,i,s){X(t.config.authDomain,t,"auth-domain-config-required"),X(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:Ri,eventId:i};if(e instanceof TT){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",yP(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[d,p]of Object.entries({}))o[d]=p}if(e instanceof Va){const d=e.getScopes().filter(p=>p!=="");d.length>0&&(o.scopes=d.join(","))}t.tenantId&&(o.tid=t.tenantId);const l=o;for(const d of Object.keys(l))l[d]===void 0&&delete l[d];const u=await t._getAppCheckToken(),c=u?`#${Ob}=${encodeURIComponent(u)}`:"";return`${Vb(t)}?${ba(l).slice(1)}${c}`}function Vb({config:t}){return t.emulator?em(t,Db):`https://${t.authDomain}/${Nb}`}/**
1523 * @license
1524 * Copyright 2020 Google LLC
1525 *
1526 * Licensed under the Apache License, Version 2.0 (the "License");
1527 * you may not use this file except in compliance with the License.
1528 * You may obtain a copy of the License at
1529 *
1530 *   http://www.apache.org/licenses/LICENSE-2.0
1531 *
1532 * Unless required by applicable law or agreed to in writing, software
1533 * distributed under the License is distributed on an "AS IS" BASIS,
1534 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1535 * See the License for the specific language governing permissions and
1536 * limitations under the License.
1537 */const ad="webStorageSupport";class Lb{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=PT,this._completeRedirectFn=ob,this._overrideRedirectResult=rb}async _openPopup(e,n,r,i){var s;Xn((s=this.eventManagers[e._key()])===null||s===void 0?void 0:s.manager,"_initialize() not called before _openPopup()");const o=await W_(e,n,r,Tf(),i);return xb(e,o,sm())}async _openRedirect(e,n,r,i){await this._originValidation(e);const s=await W_(e,n,r,Tf(),i);return Ux(s),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:i,promise:s}=this.eventManagers[n];return i?Promise.resolve(i):(Xn(s,"If manager is not set, promise should be"),s)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await Ab(e),r=new lb(e);return n.register("authEvent",i=>(X(i==null?void 0:i.authEvent,e,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(ad,{type:ad},i=>{var s;const o=(s=i==null?void 0:i[0])===null||s===void 0?void 0:s[ad];o!==void 0&&n(!!o),hn(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=fb(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return yT()||hT()||nm()}}const Mb=Lb;var q_="@firebase/auth",H_="1.10.8";/**
1538 * @license
1539 * Copyright 2020 Google LLC
1540 *
1541 * Licensed under the Apache License, Version 2.0 (the "License");
1542 * you may not use this file except in compliance with the License.
1543 * You may obtain a copy of the License at
1544 *
1545 *   http://www.apache.org/licenses/LICENSE-2.0
1546 *
1547 * Unless required by applicable law or agreed to in writing, softw
1547are
1548 * distributed under the License is distributed on an "AS IS" BASIS,
1549 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1550 * See the License for the specific language governing permissions and
1551 * limitations under the License.
1552 */class Fb{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(r=>{e((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){X(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1553 * @license
1554 * Copyright 2020 Google LLC
1555 *
1556 * Licensed under the Apache License, Version 2.0 (the "License");
1557 * you may not use this file except in compliance with the License.
1558 * You may obtain a copy of the License at
1559 *
1560 *   http://www.apache.org/licenses/LICENSE-2.0
1561 *
1562 * Unless required by applicable law or agreed to in writing, software
1563 * distributed under the License is distributed on an "AS IS" BASIS,
1564 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1565 * See the License for the specific language governing permissions and
1566 * limitations under the License.
1567 */function Ub(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function jb(t){bn(new cn("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),s=e.getProvider("app-check-internal"),{apiKey:o,authDomain:l}=r.options;X(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const u={apiKey:o,authDomain:l,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:_T(t)},c=new tx(r,i,s,u);return hx(c,n),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),bn(new cn("auth-internal",e=>{const n=Ci(e.getProvider("auth").getImmediate());return(r=>new Fb(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),jt(q_,H_,Ub(t)),jt(q_,H_,"esm2017")}/**
1568 * @license
1569 * Copyright 2021 Google LLC
1570 *
1571 * Licensed under the Apache License, Version 2.0 (the "License");
1572 * you may not use this file except in compliance with the License.
1573 * You may obtain a copy of the License at
1574 *
1575 *   http://www.apache.org/licenses/LICENSE-2.0
1576 *
1577 * Unless required by applicable law or agreed to in writing, software
1578 * distributed under the License is distributed on an "AS IS" BASIS,
1579 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1580 * See the License for the specific language governing permissions and
1581 * limitations under the License.
1582 */const zb=5*60,$b=Kw("authIdTokenMaxAge")||zb;let G_=null;const Bb=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>$b)return;const i=n==null?void 0:n.token;G_!==i&&(G_=i,await fetch(t,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))};function Wb(t=Lc()){const e=Na(t,"auth");if(e.isInitialized())return e.getImmediate();const n=cx(t,{popupRedirectResolver:Mb,persistence:[Kx,Lx,PT]}),r=Kw("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const s=new URL(r,location.origin);if(location.origin===s.origin){const o=Bb(s.toString());bx(n,o,()=>o(n.currentUser)),xx(n,l=>o(l))}}const i=Hw("auth");return i&&dx(n,`http://${i}`),n}function qb(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}
vendor: 14,372 bytes, lines 1582-1596
1582nx({loadJS(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=i=>{const s=An("internal-error");s.customData=i,n(s)},r.type="text/javascript",r.charset="UTF-8",qb().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});jb("Browser");var K_=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
1583Copyright The Closure Library Authors.
1584SPDX-License-Identifier: Apache-2.0
1585*/var Or,VT;(function(){var t;/** @license
1586
1587 Copyright The Closure Library Authors.
1588 SPDX-License-Identifier: Apache-2.0
1589*/function e(I,_){function A(){}A.prototype=_.prototype,I.D=_.prototype,I.prototype=new A,I.prototype.constructor=I,I.C=function(S,k,b){for(var R=Array(arguments.length-2),Tt=2;Tt<arguments.length;Tt++)R[Tt-2]=arguments[Tt];return _.prototype[k].apply(S,R)}}function n(){this.blockSize=-1}function r(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}e(r,n),r.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function i(I,_,A){A||(A=0);var S=Array(16);if(typeof _=="string")for(var k=0;16>k;++k)S[k]=_.charCodeAt(A++)|_.charCodeAt(A++)<<8|_.charCodeAt(A++)<<16|_.charCodeAt(A++)<<24;else for(k=0;16>k;++k)S[k]=_[A++]|_[A++]<<8|_[A++]<<16|_[A++]<<24;_=I.g[0],A=I.g[1],k=I.g[2];var b=I.g[3],R=_+(b^A&(k^b))+S[0]+3614090360&4294967295;_=A+(R<<7&4294967295|R>>>25),R=b+(k^_&(A^k))+S[1]+3905402710&4294967295,b=_+(R<<12&4294967295|R>>>20),R=k+(A^b&(_^A))+S[2]+606105819&4294967295,k=b+(R<<17&4294967295|R>>>15),R=A+(_^k&(b^_))+S[3]+3250441966&4294967295,A=k+(R<<22&4294967295|R>>>10),R=_+(b^A&(k^b))+S[4]+4118548399&4294967295,_=A+(R<<7&4294967295|R>>>25),R=b+(k^_&(A^k))+S[5]+1200080426&4294967295,b=_+(R<<12&4294967295|R>>>20),R=k+(A^b&(_^A))+S[6]+2821735955&4294967295,k=b+(R<<17&4294967295|R>>>15),R=A+(_^k&(b^_))+S[7]+4249261313&4294967295,A=k+(R<<22&4294967295|R>>>10),R=_+(b^A&(k^b))+S[8]+1770035416&4294967295,_=A+(R<<7&4294967295|R>>>25),R=b+(k^_&(A^k))+S[9]+2336552879&4294967295,b=_+(R<<12&4294967295|R>>>20),R=k+(A^b&(_^A))+S[10]+4294925233&4294967295,k=b+(R<<17&4294967295|R>>>15),R=A+(_^k&(b^_))+S[11]+2304563134&4294967295,A=k+(R<<22&4294967295|R>>>10),R=_+(b^A&(k^b))+S[12]+1804603682&4294967295,_=A+(R<<7&4294967295|R>>>25),R=b+(k^_&(A^k))+S[13]+4254626195&4294967295,b=_+(R<<12&4294967295|R>>>20),R=k+(A^b&(_^A))+S[14]+2792965006&4294967295,k=b+(R<<17&4294967295|R>>>15),R=A+(_^k&(b^_))+S[15]+1236535329&4294967295,A=k+(R<<22&4294967295|R>>>10),R=_+(k^b&(A^k))+S[1]+4129170786&4294967295,_=A+(R<<5&4294967295|R>>>27),R=b+(A^k&(_^A))+S[6]+3225465664&4294967295,b=_+(R<<9&4294967295|R>>>23),R=k+(_^A&(b^_))+S[11]+643717713&4294967295,k=b+(R<<14&4294967295|R>>>18),R=A+(b^_&(k^b))+S[0]+3921069994&4294967295,A=k+(R<<20&4294967295|R>>>12),R=_+(k^b&(A^k))+S[5]+3593408605&4294967295,_=A+(R<<5&4294967295|R>>>27),R=b+(A^k&(_^A))+S[10]+38016083&4294967295,b=_+(R<<9&4294967295|R>>>23),R=k+(_^A&(b^_))+S[15]+3634488961&4294967295,k=b+(R<<14&4294967295|R>>>18),R=A+(b^_&(k^b))+S[4]+3889429448&4294967295,A=k+(R<<20&4294967295|R>>>12),R=_+(k^b&(A^k))+S[9]+568446438&4294967295,_=A+(R<<5&4294967295|R>>>27),R=b+(A^k&(_^A))+S[14]+3275163606&4294967295,b=_+(R<<9&4294967295|R>>>23),R=k+(_^A&(b^_))+S[3]+4107603335&4294967295,k=b+(R<<14&4294967295|R>>>18),R=A+(b^_&(k^b))+S[8]+1163531501&4294967295,A=k+(R<<20&4294967295|R>>>12),R=_+(k^b&(A^k))+S[13]+2850285829&4294967295,_=A+(R<<5&4294967295|R>>>27),R=b+(A^k&(_^A))+S[2]+4243563512&4294967295,b=_+(R<<9&4294967295|R>>>23),R=k+(_^A&(b^_))+S[7]+1735328473&4294967295,k=b+(R<<14&4294967295|R>>>18),R=A+(b^_&(k^b))+S[12]+2368359562&4294967295,A=k+(R<<20&4294967295|R>>>12),R=_+(A^k^b)+S[5]+4294588738&4294967295,_=A+(R<<4&4294967295|R>>>28),R=b+(_^A^k)+S[8]+2272392833&4294967295,b=_+(R<<11&4294967295|R>>>21),R=k+(b^_^A)+S[11]+1839030562&4294967295,k=b+(R<<16&4294967295|R>>>16),R=A+(k^b^_)+S[14]+4259657740&4294967295,A=k+(R<<23&4294967295|R>>>9),R=_+(A^k^b)+S[1]+2763975236&4294967295,_=A+(R<<4&4294967295|R>>>28),R=b+(_^A^k)+S[4]+1272893353&4294967295,b=_+(R<<11&4294967295|R>>>21),R=k+(b^_^A)+S[7]+4139469664&4294967295,k=b+(R<<16&4294967295|R>>>16),R=A+(k^b^_)+S[10]+3200236656&4294967295,A=k+(R<<23&4294967295|R>>>9),R=_+(A^k^b)+S[13]+681279174&4294967295,_=A+(R<<4&4294967295|R>>>28),R=b+(_^A^k)+S[0]+3936430074&4294967295,b=_+(R<<11&4294967295|R>>>21),R=k+(b^_^A)+S[3]+3572445317&4294967295,k=b+(R<<16&4294967295|R>>>16),R=A+(k^b^_)+S[6]+76029189&4294967295,A=k+(R<<23&4294967295|R>>>9),R=_+(A^k^b)+S[9]+3654602809&4294967295,_=A+(R<<4&4294967295|R>>>28),R=b+(_^A^k)+S[12]+3873151461&4294967295,b=_+(R<<11&4294967295|R>>>21),R=k+(b^_^A)+S[15]+530742520&4294967295,k=b+(R<<16&4294967295|R>>>16),R=A+(k^b^_)+S[2]+3299628645&4294967295,A=k+(R<<23&4294967295|R>>>9),R=_+(k^(A|~b))+S[0]+4096336452&4294967295,_=A+(R<<6&4294967295|R>>>26),R=b+(A^(_|~k))+S[7]+1126891415&4294967295,b=_+(R<<10&4294967295|R>>>22),R=k+(_^(b|~A))+S[14]+2878612391&4294967295,k=b+(R<<15&4294967295|R>>>17),R=A+(b^(k|~_))+S[5]+4237533241&4294967295,A=k+(R<<21&4294967295|R>>>11),R=_+(k^(A|~b))+S[12]+1700485571&4294967295,_=A+(R<<6&4294967295|R>>>26),R=b+(A^(_|~k))+S[3]+2399980690&4294967295,b=_+(R<<10&4294967295|R>>>22),R=k+(_^(b|~A))+S[10]+4293915773&4294967295,k=b+(R<<15&4294967295|R>>>17),R=A+(b^(k|~_))+S[1]+2240044497&4294967295,A=k+(R<<21&4294967295|R>>>11),R=_+(k^(A|~b))+S[8]+1873313359&4294967295,_=A+(R<<6&4294967295|R>>>26),R=b+(A^(_|~k))+S[15]+4264355552&4294967295,b=_+(R<<10&4294967295|R>>>22),R=k+(_^(b|~A))+S[6]+2734768916&4294967295,k=b+(R<<15&4294967295|R>>>17),R=A+(b^(k|~_))+S[13]+1309151649&4294967295,A=k+(R<<21&4294967295|R>>>11),R=_+(k^(A|~b))+S[4]+4149444226&4294967295,_=A+(R<<6&4294967295|R>>>26),R=b+(A^(_|~k))+S[11]+3174756917&4294967295,b=_+(R<<10&4294967295|R>>>22),R=k+(_^(b|~A))+S[2]+718787259&4294967295,k=b+(R<<15&4294967295|R>>>17),R=A+(b^(k|~_))+S[9]+3951481745&4294967295,I.g[0]=I.g[0]+_&4294967295,I.g[1]=I.g[1]+(k+(R<<21&4294967295|R>>>11))&4294967295,I.g[2]=I.g[2]+k&4294967295,I.g[3]=I.g[3]+b&4294967295}r.prototype.u=function(I,_){_===void 0&&(_=I.length);for(var A=_-this.blockSize,S=this.B,k=this.h,b=0;b<_;){if(k==0)for(;b<=A;)i(this,I,b),b+=this.blockSize;if(typeof I=="string"){for(;b<_;)if(S[k++]=I.charCodeAt(b++),k==this.blockSize){i(this,S),k=0;break}}else for(;b<_;)if(S[k++]=I[b++],k==this.blockSize){i(this,S),k=0;break}}this.h=k,this.o+=_},r.prototype.v=function(){var I=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);I[0]=128;for(var _=1;_<I.length-8;++_)I[_]=0;var A=8*this.o;for(_=I.length-8;_<I.length;++_)I[_]=A&255,A/=256;for(this.u(I),I=Array(16),_=A=0;4>_;++_)for(var S=0;32>S;S+=8)I[A++]=this.g[_]>>>S&255;return I};function s(I,_){var A=l;return Object.prototype.hasOwnProperty.call(A,I)?A[I]:A[I]=_(I)}function o(I,_){this.h=_;for(var A=[],S=!0,k=I.length-1;0<=k;k--){var b=I[k]|0;S&&b==_||(A[k]=b,S=!1)}this.g=A}var l={};function u(I){return-128<=I&&128>I?s(I,function(_){return new o([_|0],0>_?-1:0)}):new o([I|0],0>I?-1:0)}function c(I){if(isNaN(I)||!isFinite(I))return p;if(0>I)return C(c(-I));for(var _=[],A=1,S=0;I>=A;S++)_[S]=I/A|0,A*=4294967296;return new o(_,0)}function d(I,_){if(I.length==0)throw Error("number format error: empty string");if(_=_||10,2>_||36<_)throw Error("radix out of range: "+_);if(I.charAt(0)=="-")return C(d(I.substring(1),_));if(0<=I.indexOf("-"))throw Error('number format error: interior "-" character');for(var A=c(Math.pow(_,8)),S=p,k=0;k<I.length;k+=8){var b=Math.min(8,I.length-k),R=parseInt(I.substring(k,k+b),_);8>b?(b=c(Math.pow(_,b)),S=S.j(b).add(c(R))):(S=S.j(A),S=S.add(c(R)))}return S}var p=u(0),m=u(1),v=u(16777216);t=o.prototype,t.m=function(){if(P(this))return-C(this).m();for(var I=0,_=1,A=0;A<this.g.length;A++){var S=this.i(A);I+=(0<=S?S:4294967296+S)*_,_*=4294967296}return I},t.toString=function(I){if(I=I||10,2>I||36<I)throw Error("radix out of range: "+I);if(w(this))return"0";if(P(this))return"-"+C(this).toString(I);for(var _=c(Math.pow(I,6)),A=this,S="";;){var k=x(A,_).g;A=E(A,k.j(_));var b=((0<A.g.length?A.g[0]:A.h)>>>0).toString(I);if(A=k,w(A))return b+S;for(;6>b.length;)b="0"+b;S=b+S}},t.i=function(I){return 0>I?0:I<this.g.length?this.g[I]:this.h};function w(I){if(I.h!=0)return!1;for(var _=0;_<I.g.length;_++)if(I.g[_]!=0)return!1;return!0}function P(I){return I.h==-1}t.l=function(I){return I=E(this,I),P(I)?-1:w(I)?0:1};function C(I){for(var _=I.g.length,A=[],S=0;S<_;S++)A[S]=~I.g[S];return new o(A,~I.h).add(m)}t.abs=function(){return P(this)?C(this):this},t.add=function(I){for(var _=Math.max(this.g.length,I.g.length),A=[],S=0,k=0;k<=_;k++){var b=S+(this.i(k)&65535)+(I.i(k)&65535),R=(b>>>16)+(this.i(k)>>>16)+(I.i(k)>>>16);S=R>>>16,b&=65535,R&=65535,A[k]=R<<16|b}return new o(A,A[A.length-1]&-2147483648?-1:0)};function E(I,_){return I.add(C(_))}t.j=function(I){if(w(this)||w(I))return p;if(P(this))return P(I)?C(this).j(C(I)):C(C(this).j(I));if(P(I))return C(this.j(C(I)));if(0>this.l(v)&&0>I.l(v))return c(this.m()*I.m());for(var _=this.g.length+I.g.length,A=[],S=0;S<2*_;S++)A[S]=0;for(S=0;S<this.g.length;S++)for(var k=0;k<I.g.length;k++){var b=this.i(S)>>>16,R=this.i(S)&65535,Tt=I.i(k)>>>16,Be=I.i(k)&65535;A[2*S+2*k]+=R*Be,g(A,2*S+2*k),A[2*S+2*k+1]+=b*Be,g(A,2*S+2*k+1),A[2*S+2*k+1]+=R*Tt,g(A,2*S+2*k+1),A[2*S+2*k+2]+=b*Tt,g(A,2*S+2*k+2)}for(S=0;S<_;S++)A[S]=A[2*S+1]<<16|A[2*S];for(S=_;S<2*_;S++)A[S]=0;return new o(A,0)};function g(I,_){for(;(I[_]&65535)!=I[_];)I[_+1]+=I[_]>>>16,I[_]&=65535,_++}function T(I,_){this.g=I,this.h=_}function x(I,_){if(w(_))throw Error("division by zero");if(w(I))return new T(p,p);if(P(I))return _=x(C(I),_),new T(C(_.g),C(_.h));if(P(_))return _=x(I,C(_)),new T(C(_.g),_.h);if(30<I.g.length){if(P(I)||P(_))throw Error("slowDivide_ only works with positive integers.");for(var A=m,S=_;0>=S.l(I);)A=F(A),S=F(S);var k=U(A,1),b=U(S,1);for(S=U(S,2),A=U(A,2);!w(S);){var R=b.add(S);0>=R.l(I)&&(k=k.add(A),b=R),S=U(S,1),A=U(A,1)}return _=E(I,k.j(_)),new T(k,_)}for(k=p;0<=I.l(_);){for(A=Math.max(1,Math.floor(I.m()/_.m())),S=Math.ceil(Math.log(A)/Math.LN2),S=48>=S?1:Math.pow(2,S-48),b=c(A),R=b.j(_);P(R)||0<R.l(I);)A-=S,b=c(A),R=b.j(_);w(b)&&(b=m),k=k.add(b),I=E(I,R)}return new T(k,I)}t.A=function(I){return x(this,I).h},t.and=function(I){for(var _=Math.max(this.g.length,I.g.length),A=[],S=0;S<_;S++)A[S]=this.i(S)&I.i(S);return new o(A,this.h&I.h)},t.or=function(I){for(var _=Math.max(this.g.length,I.g.length),A=[],S=0;S<_;S++)A[S]=this.i(S)|I.i(S);return new o(A,this.h|I.h)},t.xor=function(I){for(var _=Math.max(this.g.length,I.g.length),A=[],S=0;S<_;S++)A[S]=this.i(S)^I.i(S);return new o(A,this.h^I.h)};function F(I){for(var _=I.g.length+1,A=[],S=0;S<_;S++)A[S]=I.i(S)<<1|I.i(S-1)>>>31;return new o(A,I.h)}function U(I,_){var A=_>>5;_%=32;for(var S=I.g.length-A,k=[],b=0;b<S;b++)k[b]=0<_?I.i(b+A)>>>_|I.i(b+A+1)<<32-_:I.i(b+A);return new o(k,I.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,VT=r,o.prototype.add=o.prototype.add,o.prototype.multiply=o.prototype.j,o.prototype.modulo=o.prototype.A,o.prototype.compare=o.prototype.l,o.prototype.toNumber=o.prototype.m,o.prototype.toString=o.prototype.toString,o.prototype.getBits=o.prototype.i,o.fromNumber=c,o.fromString=d,Or=o}).apply(typeof K_<"u"?K_:typeof self<"u"?self:typeof window<"u"?window:{});var kl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
1590Copyright The Closure Library Authors.
1591SPDX-License-Identifier: Apache-2.0
1592*/var LT,ko,MT,tu,Sf,FT,UT,jT;(function(){var t,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,h,f){return a==Array.prototype||a==Object.prototype||(a[h]=f.value),a};function n(a){a=[typeof globalThis=="object"&&globalThis,a,typeof window=="object"&&window,typeof self=="object"&&self,typeof kl=="object"&&kl];for(var h=0;h<a.length;++h){var f=a[h];if(f&&f.Math==Math)return f}throw Error("Cannot find global object")}var r=n(this);function i(a,h){if(h)e:{var f=r;a=a.split(".");for(var y=0;y<a.length-1;y++){var N=a[y];if(!(N in f))break e;f=f[N]}a=a[a.length-1],y=f[a],h=h(y),h!=y&&h!=null&&e(f,a,{configurable:!0,writable:!0,value:h})}}function s(a,h){a instanceof String&&(a+="");var f=0,y=!1,N={next:function(){if(!y&&f<a.length){var V=f++;return{value:h(V,a[V]),done:!1}}return y=!0,{done:!0,value:void 0}}};return N[Symbol.iterator]=function(){return N},N}i("Array.prototype.values",function(a){return a||function(){return s(this,function(h,f){return f})}});/** @license
1593
1594 Copyright The Closure Library Authors.
1595 SPDX-License-Identifier: Apache-2.0
1596*/var o=o||{},l=this||self;function u(a){var h=typeof a;return h=h!="object"?h:a?Array.isArray(a)?"array":h:"null",h=="array"||h=="object"&&typeof a.length=="number"}function c(a){var h=typeof a;return h=="object"&&a!=null||h=="function"}function d(a,h,f){return a.call.apply(a.bind,arguments)}function p(a,h,f){if(!a)throw Error();if(2<arguments.length){var y=Array.prototype.slice.call(arguments,2);return function(){var N=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(N,y),a.apply(h,N)}}return function(){return a.apply(h,arguments)}}function m(a,h,f){return m=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?d:p,m.apply(null,arguments)}function v(a,h){var f=Array.prototype.slice.call(arguments,1);return function(){var y=f.slice();return y.push.apply(y,arguments),a.apply(this,y)}}function w(a,h){function f(){}f.prototype=h.prototype,a.aa=h.prototype,a.prototype=new f,a.prototype.constructor=a,a.Qb=function(y,N,V){for(var z=Array(arguments.length-2),me=2;me<arguments.length;me++)z[me-2]=arguments[me];return h.prototype[N].apply(y,z)}}function P(a){const h=a.length;if(0<h){const f=Array(h);for(let y=0;y<h;y++)f[y]=a[y];return f}return[]}function C(a,h){for(let f=1;f<arguments.length;f++){const y=arguments[f];if(u(y)){const N=a.length||0,V=y.length||0;a.length=N+V;for(let z=0;z<V;z++)a[N+z]=y[z]}else a.push(y)}}class E{constructor(h,f){this.i=h,this.j=f,this.h=0,this.g=null}get(){let h;return 0<this.h?(this.h--,h=this.g,this.g=h.next,h.next=null):h=this.i(),h}}
1596function g(a){return/^[\s\xa0]*$/.test(a)}function T(){var a=l.navigator;return a&&(a=a.userAgent)?a:""}function x(a){return x[" "](a),a}x[" "]=function(){};var F=T().indexOf("Gecko")!=-1&&!(T().toLowerCase().indexOf("webkit")!=-1&&T().indexOf("Edge")==-1)&&!(T().indexOf("Trident")!=-1||T().indexOf("MSIE")!=-1)&&T().indexOf("Edge")==-1;function U(a,h,f){for(const y in a)h.call(f,a[y],y,a)}function I(a,h){for(const f in a)h.call(void 0,a[f],f,a)}function _(a){const h={};for(const f in a)h[f]=a[f];return h}const A="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function S(a,h){let f,y;for(let N=1;N<arguments.length;N++){y=arguments[N];for(f in y)a[f]=y[f];for(let V=0;V<A.length;V++)f=A[V],Object.prototype.hasOwnProperty.call(y,f)&&(a[f]=y[f])}}function k(a){var h=1;a=a.split(":");const f=[];for(;0<h&&a.length;)f.push(a.shift()),h--;return a.length&&f.push(a.join(":")),f}function b(a){l.setTimeout(()=>{throw a},0)}function R(){var a=J;let h=null;return a.g&&(h=a.g,a.g=a.g.next,a.g||(a.h=null),h.next=null),h}class Tt{constructor(){this.h=this.g=null}add(h,f){const y=Be.get();y.set(h,f),this.h?this.h.next=y:this.g=y,this.h=y}}var Be=new E(()=>new Wt,a=>a.reset());class Wt{constructor(){this.next=this.g=this.h=null}set(h,f){this.h=h,this.g=f,this.next=null}reset(){this.next=this.g=this.h=null}}let Zt,q=!1,J=new Tt,K=()=>{const a=l.Promise.resolve(void 0);Zt=()=>{a.then(fe)}};var fe=()=>{for(var a;a=R();){try{a.h.call(a.g)}catch(f){b(f)}var h=Be;h.j(a),100>h.h&&(h.h++,a.next=h.g,h.g=a)}q=!1};function te(){this.s=this.s,this.C=this.C}te.prototype.s=!1,te.prototype.ma=function(){this.s||(this.s=!0,this.N())},te.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function oe(a,h){this.type=a,this.g=this.target=h,this.defaultPrevented=!1}oe.prototype.h=function(){this.defaultPrevented=!0};var gn=function(){if(!l.addEventListener||!Object.defineProperty)return!1;var a=!1,h=Object.defineProperty({},"passive",{get:function(){a=!0}});try{const f=()=>{};l.addEventListener("test",f,h),l.removeEventListener("test",f,h)}catch{}return a}();function Nt(a,h){if(oe.call(this,a?a.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,a){var f=this.t
vendor: 34,320 bytes, lines 1596-1604
1596ype=a.type,y=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;if(this.target=a.target||a.srcElement,this.g=h,h=a.relatedTarget){if(F){e:{try{x(h.nodeName);var N=!0;break e}catch{}N=!1}N||(h=null)}}else f=="mouseover"?h=a.fromElement:f=="mouseout"&&(h=a.toElement);this.relatedTarget=h,y?(this.clientX=y.clientX!==void 0?y.clientX:y.pageX,this.clientY=y.clientY!==void 0?y.clientY:y.pageY,this.screenX=y.screenX||0,this.screenY=y.screenY||0):(this.clientX=a.clientX!==void 0?a.clientX:a.pageX,this.clientY=a.clientY!==void 0?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0),this.button=a.button,this.key=a.key||"",this.ctrlKey=a.ctrlKey,this.altKey=a.altKey,this.shiftKey=a.shiftKey,this.metaKey=a.metaKey,this.pointerId=a.pointerId||0,this.pointerType=typeof a.pointerType=="string"?a.pointerType:qt[a.pointerType]||"",this.state=a.state,this.i=a,a.defaultPrevented&&Nt.aa.h.call(this)}}w(Nt,oe);var qt={2:"touch",3:"pen",4:"mouse"};Nt.prototype.h=function(){Nt.aa.h.call(this);var a=this.i;a.preventDefault?a.preventDefault():a.returnValue=!1};var Te="closure_listenable_"+(1e6*Math.random()|0),bi=0;function Ks(a,h,f,y,N){this.listener=a,this.proxy=null,this.src=h,this.type=f,this.capture=!!y,this.ha=N,this.key=++bi,this.da=this.fa=!1}function Ni(a){a.da=!0,a.listener=null,a.proxy=null,a.src=null,a.ha=null}function Qs(a){this.src=a,this.g={},this.h=0}Qs.prototype.add=function(a,h,f,y,N){var V=a.toString();a=this.g[V],a||(a=this.g[V]=[],this.h++);var z=Ha(a,h,y,N);return-1<z?(h=a[z],f||(h.fa=!1)):(h=new Ks(h,this.src,V,!!y,N),h.fa=f,a.push(h)),h};function Xs(a,h){var f=h.type;if(f in a.g){var y=a.g[f],N=Array.prototype.indexOf.call(y,h,void 0),V;(V=0<=N)&&Array.prototype.splice.call(y,N,1),V&&(Ni(h),a.g[f].length==0&&(delete a.g[f],a.h--))}}function Ha(a,h,f,y){for(var N=0;N<a.length;++N){var V=a[N];if(!V.da&&V.listener==h&&V.capture==!!f&&V.ha==y)return N}return-1}var Di="closure_lm_"+(1e6*Math.random()|0),Oi={};function lh(a,h,f,y,N){if(Array.isArray(h)){for(var V=0;V<h.length;V++)lh(a,h[V],f,y,N);return null}return f=ig(f),a&&a[Te]?a.K(h,f,c(y)?!!y.capture:!1,N):Ga(a,h,f,!1,y,N)}function Ga(a,h,f,y,N,V){if(!h)throw Error("Invalid event type");var z=c(N)?!!N.capture:!!N,me=ch(a);if(me||(a[Di]=me=new Qs(a)),f=me.add(h,f,y,z,V),f.proxy)return f;if(y=Ys(),f.proxy=y,y.src=a,y.listener=f,a.addEventListener)gn||(N=z),N===void 0&&(N=!1),a.addEventListener(h.toString(),y,N);else if(a.attachEvent)a.attachEvent(uh(h.toString()),y);else if(a.addListener&&a.removeListener)a.addListener(y);else throw Error("addEventListener and attachEvent are unavailable.");return f}function Ys(){function a(f){return h.call(a.src,a.listener,f)}const h=q1;return a}function Js(a,h,f,y,N){if(Array.isArray(h))for(var V=0;V<h.length;V++)Js(a,h[V],f,y,N);else y=c(y)?!!y.capture:!!y,f=ig(f),a&&a[Te]?(a=a.i,h=String(h).toString(),h in a.g&&(V=a.g[h],f=Ha(V,f,y,N),-1<f&&(Ni(V[f]),Array.prototype.splice.call(V,f,1),V.length==0&&(delete a.g[h],a.h--)))):a&&(a=ch(a))&&(h=a.g[h.toString()],a=-1,h&&(a=Ha(h,f,y,N)),(f=-1<a?h[a]:null)&&Ka(f))}function Ka(a){if(typeof a!="number"&&a&&!a.da){var h=a.src;if(h&&h[Te])Xs(h.i,a);else{var f=a.type,y=a.proxy;h.removeEventListener?h.removeEventListener(f,y,a.capture):h.detachEvent?h.detachEvent(uh(f),y):h.addListener&&h.removeListener&&h.removeListener(y),(f=ch(h))?(Xs(f,a),f.h==0&&(f.src=null,h[Di]=null)):Ni(a)}}}function uh(a){return a in Oi?Oi[a]:Oi[a]="on"+a}function q1(a,h){if(a.da)a=!0;else{h=new Nt(h,this);var f=a.listener,y=a.ha||a.src;a.fa&&Ka(a),a=f.call(y,h)}return a}function ch(a){return a=a[Di],a instanceof Qs?a:null}var hh="__closure_events_fn_"+(1e9*Math.random()>>>0);function ig(a){return typeof a=="function"?a:(a[hh]||(a[hh]=function(h){return a.handleEvent(h)}),a[hh])}function nt(){te.call(this),this.i=new Qs(this),this.M=this,this.F=null}w(nt,te),nt.prototype[Te]=!0,nt.prototype.removeEventListener=function(a,h,f,y){Js(this,a,h,f,y)};function ft(a,h){var f,y=a.F;if(y)for(f=[];y;y=y.F)f.push(y);if(a=a.M,y=h.type||h,typeof h=="string")h=new oe(h,a);else if(h instanceof oe)h.target=h.target||a;else{var N=h;h=new oe(y,a),S(h,N)}if(N=!0,f)for(var V=f.length-1;0<=V;V--){var z=h.g=f[V];N=Qa(z,y,!0,h)&&N}if(z=h.g=a,N=Qa(z,y,!0,h)&&N,N=Qa(z,y,!1,h)&&N,f)for(V=0;V<f.length;V++)z=h.g=f[V],N=Qa(z,y,!1,h)&&N}nt.prototype.N=function(){if(nt.aa.N.call(this),this.i){var a=this.i,h;for(h in a.g){for(var f=a.g[h],y=0;y<f.length;y++)Ni(f[y]);delete a.g[h],a.h--}}this.F=null},nt.prototype.K=function(a,h,f,y){return this.i.add(String(a),h,!1,f,y)},nt.prototype.L=function(a,h,f,y){return this.i.add(String(a),h,!0,f,y)};function Qa(a,h,f,y){if(h=a.i.g[String(h)],!h)return!0;h=h.concat();for(var N=!0,V=0;V<h.length;++V){var z=h[V];if(z&&!z.da&&z.capture==f){var me=z.listener,Ke=z.ha||z.src;z.fa&&Xs(a.i,z),N=me.call(Ke,y)!==!1&&N}}return N&&!y.defaultPrevented}function sg(a,h,f){if(typeof a=="function")f&&(a=m(a,f));else if(a&&typeof a.handleEvent=="function")a=m(a.handleEvent,a);else throw Error("Invalid listener argument");return 2147483647<Number(h)?-1:l.setTimeout(a,h||0)}function og(a){a.g=sg(()=>{a.g=null,a.i&&(a.i=!1,og(a))},a.l);const h=a.h;a.h=null,a.m.apply(null,h)}class H1 extends te{constructor(h,f){super(),this.m=h,this.l=f,this.h=null,this.i=!1,this.g=null}j(h){this.h=arguments,this.g?this.i=!0:og(this)}N(){super.N(),this.g&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Zs(a){te.call(this),this.h=a,this.g={}}w(Zs,te);var ag=[];function lg(a){U(a.g,function(h,f){this.g.hasOwnProperty(f)&&Ka(h)},a),a.g={}}Zs.prototype.N=function(){Zs.aa.N.call(this),lg(this)},Zs.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var dh=l.JSON.stringify,G1=l.JSON.parse,K1=class{stringify(a){return l.JSON.stringify(a,void 0)}parse(a){return l.JSON.parse(a,void 0)}};function fh(){}fh.prototype.h=null;function ug(a){return a.h||(a.h=a.i())}function cg(){}var eo={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function ph(){oe.call(this,"d")}w(ph,oe);function mh(){oe.call(this,"c")}w(mh,oe);var Jr={},hg=null;function Xa(){return hg=hg||new nt}Jr.La="serverreachability";function dg(a){oe.call(this,Jr.La,a)}w(dg,oe);function to(a){const h=Xa();ft(h,new dg(h))}Jr.STAT_EVENT="statevent";function fg(a,h){oe.call(this,Jr.STAT_EVENT,a),this.stat=h}w(fg,oe);function pt(a){const h=Xa();ft(h,new fg(h,a))}Jr.Ma="timingevent";function pg(a,h){oe.call(this,Jr.Ma,a),this.size=h}w(pg,oe);function no(a,h){if(typeof a!="function")throw Error("Fn must not be null and must be a function");return l.setTimeout(function(){a()},h)}function ro(){this.g=!0}ro.prototype.xa=function(){this.g=!1};function Q1(a,h,f,y,N,V){a.info(function(){if(a.g)if(V)for(var z="",me=V.split("&"),Ke=0;Ke<me.length;Ke++){var ue=me[Ke].split("=");if(1<ue.length){var rt=ue[0];ue=ue[1];var it=rt.split("_");z=2<=it.length&&it[1]=="type"?z+(rt+"="+ue+"&"):z+(rt+"=redacted&")}}else z=null;else z=V;return"XMLHTTP REQ ("+y+") [attempt "+N+"]: "+h+`
1597`+f+`
1598`+z})}function X1(a,h,f,y,N,V,z){a.info(function(){return"XMLHTTP RESP ("+y+") [ attempt "+N+"]: "+h+`
1599`+f+`
1600`+V+" "+z})}function Vi(a,h,f,y){a.info(function(){return"XMLHTTP TEXT ("+h+"): "+J1(a,f)+(y?" "+y:"")})}function Y1(a,h){a.info(function(){return"TIMEOUT: "+h})}ro.prototype.info=function(){};function J1(a,h){if(!a.g)return h;if(!h)return null;try{var f=JSON.parse(h);if(f){for(a=0;a<f.length;a++)if(Array.isArray(f[a])){var y=f[a];if(!(2>y.length)){var N=y[1];if(Array.isArray(N)&&!(1>N.length)){var V=N[0];if(V!="noop"&&V!="stop"&&V!="close")for(var z=1;z<N.length;z++)N[z]=""}}}}return dh(f)}catch{return h}}var Ya={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},mg={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"},gh;function Ja(){}w(Ja,fh),Ja.prototype.g=function(){return new XMLHttpRequest},Ja.prototype.i=function(){return{}},gh=new Ja;function ir(a,h,f,y){this.j=a,this.i=h,this.l=f,this.R=y||1,this.U=new Zs(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new gg}function gg(){this.i=null,this.g="",this.h=!1}var yg={},yh={};function _h(a,h,f){a.L=1,a.v=nl(Vn(h)),a.m=f,a.P=!0,_g(a,null)}function _g(a,h){a.F=Date.now(),Za(a),a.A=Vn(a.v);var f=a.A,y=a.R;Array.isArray(y)||(y=[String(y)]),Ng(f.i,"t",y),a.C=0,f=a.j.J,a.h=new gg,a.g=Xg(a.j,f?h:null,!a.m),0<a.O&&(a.M=new H1(m(a.Y,a,a.g),a.O)),h=a.U,f=a.g,y=a.ca;var N="readystatechange";Array.isArray(N)||(N&&(ag[0]=N.toString()),N=ag);for(var V=0;V<N.length;V++){var z=lh(f,N[V],y||h.handleEvent,!1,h.h||h);if(!z)break;h.g[z.key]=z}h=a.H?_(a.H):{},a.m?(a.u||(a.u="POST"),h["Content-Type"]="application/x-www-form-urlencoded",a.g.ea(a.A,a.u,a.m,h)):(a.u="GET",a.g.ea(a.A,a.u,null,h)),to(),Q1(a.i,a.u,a.A,a.l,a.R,a.m)}ir.prototype.ca=function(a){a=a.target;const h=this.M;h&&Ln(a)==3?h.j():this.Y(a)},ir.prototype.Y=function(a){try{if(a==this.g)e:{const it=Ln(this.g);var h=this.g.Ba();const Fi=this.g.Z();if(!(3>it)&&(it!=3||this.g&&(this.h.h||this.g.oa()||Ug(this.g)))){this.J||it!=4||h==7||(h==8||0>=Fi?to(3):to(2)),vh(this);var f=this.g.Z();this.X=f;t:if(vg(this)){var y=Ug(this.g);a="";var N=y.length,V=Ln(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){Zr(this),io(this);var z="";break t}this.h.i=new l.TextDecoder}for(h=0;h<N;h++)this.h.h=!0,a+=this.h.i.decode(y[h],{stream:!(V&&h==N-1)});y.length=0,this.h.g+=a,this.C=0,z=this.h.g}else z=this.g.oa();if(this.o=f==200,X1(this.i,this.u,this.A,this.l,this.R,it,f),this.o){if(this.T&&!this.K){t:{if(this.g){var me,Ke=this.g;if((me=Ke.g?Ke.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!g(me)){var ue=me;break t}}ue=null}if(f=ue)Vi(this.i,this.l,f,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,Eh(this,f);else{this.o=!1,this.s=3,pt(12),Zr(this),io(this);break e}}if(this.P){f=!0;let en;for(;!this.J&&this.C<z.length;)if(en=Z1(this,z),en==yh){it==4&&(this.s=4,pt(14),f=!1),Vi(this.i,this.l,null,"[Incomplete Response]");break}else if(en==yg){this.s=4,pt(15),Vi(this.i,this.l,z,"[Invalid Chunk]"),f=!1;break}else Vi(this.i,this.l,en,null),Eh(this,en);if(vg(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),it!=4||z.length!=0||this.h.h||(this.s=1,pt(16),f=!1),this.o=this.o&&f,!f)Vi(this.i,this.l,z,"[Invalid Chunked Response]"),Zr(this),io(this);else if(0<z.length&&!this.W){this.W=!0;var rt=this.j;rt.g==this&&rt.ba&&!rt.M&&(rt.j.info("Great, no buffering proxy detected. Bytes received: "+z.length),Rh(rt),rt.M=!0,pt(11))}}else Vi(this.i,this.l,z,null),Eh(this,z);it==4&&Zr(this),this.o&&!this.J&&(it==4?Hg(this.j,this):(this.o=!1,Za(this)))}else gA(this.g),f==400&&0<z.indexOf("Unknown SID")?(this.s=3,pt(12)):(this.s=0,pt(13)),Zr(this),io(this)}}}catch{}finally{}};function vg(a){return a.g?a.u=="GET"&&a.L!=2&&a.j.Ca:!1}function Z1(a,h){var f=a.C,y=h.indexOf(`
1601`,f);return y==-1?yh:(f=Number(h.substring(f,y)),isNaN(f)?yg:(y+=1,y+f>h.length?yh:(h=h.slice(y,y+f),a.C=y+f,h)))}ir.prototype.cancel=function(){this.J=!0,Zr(this)};function Za(a){a.S=Date.now()+a.I,Eg(a,a.I)}function Eg(a,h){if(a.B!=null)throw Error("WatchDog timer not null");a.B=no(m(a.ba,a),h)}function vh(a){a.B&&(l.clearTimeout(a.B),a.B=null)}ir.prototype.ba=function(){this.B=null;const a=Date.now();0<=a-this.S?(Y1(this.i,this.A),this.L!=2&&(to(),pt(17)),Zr(this),this.s=2,io(this)):Eg(this,this.S-a)};function io(a){a.j.G==0||a.J||Hg(a.j,a)}function Zr(a){vh(a);var h=a.M;h&&typeof h.ma=="function"&&h.ma(),a.M=null,lg(a.U),a.g&&(h=a.g,a.g=null,h.abort(),h.ma())}function Eh(a,h){try{var f=a.j;if(f.G!=0&&(f.g==a||wh(f.h,a))){if(!a.K&&wh(f.h,a)&&f.G==3){try{var y=f.Da.g.parse(h)}catch{y=null}if(Array.isArray(y)&&y.length==3){var N=y;if(N[0]==0){e:if(!f.u){if(f.g)if(f.g.F+3e3<a.F)ll(f),ol(f);else break e;Sh(f),pt(18)}}else f.za=N[1],0<f.za-f.T&&37500>N[2]&&f.F&&f.v==0&&!f.C&&(f.C=no(m(f.Za,f),6e3));if(1>=Ig(f.h)&&f.ca){try{f.ca()}catch{}f.ca=void 0}}else ti(f,11)}else if((a.K||f.g==a)&&ll(f),!g(h))for(N=f.Da.g.parse(h),h=0;h<N.length;h++){let ue=N[h];if(f.T=ue[0],ue=ue[1],f.G==2)if(ue[0]=="c"){f.K=ue[1],f.ia=ue[2];const rt=ue[3];rt!=null&&(f.la=rt,f.j.info("VER="+f.la));const it=ue[4];it!=null&&(f.Aa=it,f.j.info("SVER="+f.Aa));const Fi=ue[5];Fi!=null&&typeof Fi=="number"&&0<Fi&&(y=1.5*Fi,f.L=y,f.j.info("backChannelRequestTimeoutMs_="+y)),y=f;const en=a.g;if(en){const cl=en.g?en.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(cl){var V=y.h;V.g||cl.indexOf("spdy")==-1&&cl.indexOf("quic")==-1&&cl.indexOf("h2")==-1||(V.j=V.l,V.g=new Set,V.h&&(Th(V,V.h),V.h=null))}if(y.D){const Ch=en.g?en.g.getResponseHeader("X-HTTP-Session-Id"):null;Ch&&(y.ya=Ch,_e(y.I,y.D,Ch))}}f.G=3,f.l&&f.l.ua(),f.ba&&(f.R=Date.now()-a.F,f.j.info("Handshake RTT: "+f.R+"ms")),y=f;var z=a;if(y.qa=Qg(y,y.J?y.ia:null,y.W),z.K){Ag(y.h,z);var me=z,Ke=y.L;Ke&&(me.I=Ke),me.B&&(vh(me),Za(me)),y.g=z}else Wg(y);0<f.i.length&&al(f)}else ue[0]!="stop"&&ue[0]!="close"||ti(f,7);else f.G==3&&(ue[0]=="stop"||ue[0]=="close"?ue[0]=="stop"?ti(f,7):Ah(f):ue[0]!="noop"&&f.l&&f.l.ta(ue),f.v=0)}}to(4)}catch{}}var eA=class{constructor(a,h){this.g=a,this.map=h}};function wg(a){this.l=a||10,l.PerformanceNavigationTiming?(a=l.performance.getEntriesByType("navigation"),a=0<a.length&&(a[0].nextHopProtocol=="hq"||a[0].nextHopProtocol=="h2")):a=!!(l.chrome&&l.chrome.loadTimes&&l.chrome.loadTimes()&&l.chrome.loadTimes().wasFetchedViaSpdy),this.j=a?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function Tg(a){return a.h?!0:a.g?a.g.size>=a.j:!1}function Ig(a){return a.h?1:a.g?a.g.size:0}function wh(a,h){return a.h?a.h==h:a.g?a.g.has(h):!1}function Th(a,h){a.g?a.g.add(h):a.h=h}function Ag(a,h){a.h&&a.h==h?a.h=null:a.g&&a.g.has(h)&&a.g.delete(h)}wg.prototype.cancel=function(){if(this.i=Sg(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const a of this.g.values())a.cancel();this.g.clear()}};function Sg(a){if(a.h!=null)return a.i.concat(a.h.D);if(a.g!=null&&a.g.size!==0){let h=a.i;for(const f of a.g.values())h=h.concat(f.D);return h}return P(a.i)}function tA(a){if(a.V&&typeof a.V=="function")return a.V();if(typeof Map<"u"&&a instanceof Map||typeof Set<"u"&&a instanceof Set)return Array.from(a.values());if(typeof a=="string")return a.split("");if(u(a)){for(var h=[],f=a.length,y=0;y<f;y++)h.push(a[y]);return h}h=[],f=0;for(y in a)h[f++]=a[y];return h}function nA(a){if(a.na&&typeof a.na=="function")return a.na();if(!a.V||typeof a.V!="function"){if(typeof Map<"u"&&a instanceof Map)return Array.from(a.keys());if(!(typeof Set<"u"&&a instanceof Set)){if(u(a)||typeof a=="string"){var h=[];a=a.length;for(var f=0;f<a;f++)h.push(f);return h}h=[],f=0;for(const y in a)h[f++]=y;return h}}}function Rg(a,h){if(a.forEach&&typeof a.forEach=="function")a.forEach(h,void 0);else if(u(a)||typeof a=="string")Array.prototype.forEach.call(a,h,void 0);else for(var f=nA(a),y=tA(a),N=y.length,V=0;V<N;V++)h.call(void 0,y[V],f&&f[V],a)}var Cg=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function rA(a,h){if(a){a=a.split("&");for(var f=0;f<a.length;f++){var y=a[f].indexOf("="),N=null;if(0<=y){var V=a[f].substring(0,y);N=a[f].substring(y+1)}else V=a[f];h(V,N?decodeURIComponent(N.replace(/\+/g," ")):"")}}}function ei(a){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,a instanceof ei){this.h=a.h,el(this,a.j),this.o=a.o,this.g=a.g,tl(this,a.s),this.l=a.l;var h=a.i,f=new ao;f.i=h.i,h.g&&(f.g=new Map(h.g),f.h=h.h),Pg(this,f),this.m=a.m}else a&&(h=String(a).match(Cg))?(this.h=!1,el(this,h[1]||"",!0),this.o=so(h[2]||""),this.g=so(h[3]||"",!0),tl(this,h[4]),this.l=so(h[5]||"",!0),Pg(this,h[6]||"",!0),this.m=so(h[7]||"")):(this.h=!1,this.i=new ao(null,this.h))}ei.prototype.toString=function(){var a=[],h=this.j;h&&a.push(oo(h,kg,!0),":");var f=this.g;return(f||h=="file")&&(a.push("//"),(h=this.o)&&a.push(oo(h,kg,!0),"@"),a.push(encodeURIComponent(String(f)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),f=this.s,f!=null&&a.push(":",String(f))),(f=this.l)&&(this.g&&f.charAt(0)!="/"&&a.push("/"),a.push(oo(f,f.charAt(0)=="/"?oA:sA,!0))),(f=this.i.toString())&&a.push("?",f),(f=this.m)&&a.push("#",oo(f,lA)),a.join("")};function Vn(a){return new ei(a)}function el(a,h,f){a.j=f?so(h,!0):h,a.j&&(a.j=a.j.replace(/:$/,""))}function tl(a,h){if(h){if(h=Number(h),isNaN(h)||0>h)throw Error("Bad port number "+h);a.s=h}else a.s=null}function Pg(a,h,f){h instanceof ao?(a.i=h,uA(a.i,a.h)):(f||(h=oo(h,aA)),a.i=new ao(h,a.h))}function _e(a,h,f){a.i.set(h,f)}function nl(a){return _e(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),a}function so(a,h){return a?h?decodeURI(a.replace(/%25/g,"%2525")):decodeURIComponent(a):""}function oo(a,h,f){return typeof a=="string"?(a=encodeURI(a).replace(h,iA),f&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function iA(a){return a=a.charCodeAt(0),"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var kg=/[#\/\?@]/g,sA=/[#\?:]/g,oA=/[#\?]/g,aA=/[#\?@]/g,lA=/#/g;function ao(a,h){this.h=this.g=null,this.i=a||null,this.j=!!h}function sr(a){a.g||(a.g=new Map,a.h=0,a.i&&rA(a.i,function(h,f){a.add(decodeURIComponent(h.replace(/\+/g," ")),f)}))}t=ao.prototype,t.add=function(a,h){sr(this),this.i=null,a=Li(this,a);var f=this.g.get(a);return f||this.g.set(a,f=[]),f.push(h),this.h+=1,this};function xg(a,h){sr(a),h=Li(a,h),a.g.has(h)&&(a.i=null,a.h-=a.g.get(h).length,a.g.delete(h))}function bg(a,h){return sr(a),h=Li(a,h),a.g.has(h)}t.forEach=function(a,h){sr(this),this.g.forEach(function(f,y){f.forEach(function(N){a.call(h,N,y,this)},this)},this)},t.na=function(){sr(this);const a=Array.from(this.g.values()),h=Array.from(this.g.keys()),f=[];for(let y=0;y<h.length;y++){const N=a[y];for(let V=0;V<N.length;V++)f.push(h[y])}return f},t.V=function(a){sr(this);let h=[];if(typeof a=="string")bg(this,a)&&(h=h.concat(this.g.get(Li(this,a))));else{a=Array.from(this.g.values());for(let f=0;f<a.length;f++)h=h.concat(a[f])}return h},t.set=function(a,h){return sr(this),this.i=null,a=Li(this,a),bg(this,a)&&(this.h-=this.g.get(a).length),this.g.set(a,[h]),this.h+=1,this},t.get=function(a,h){return a?(a=this.V(a),0<a.length?String(a[0]):h):h};function Ng(a,h,f){xg(a,h),0<f.length&&(a.i=null,a.g.set(Li(a,h),P(f)),a.h+=f.length)}t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const a=[],h=Array.from(this.g.keys());for(var f=0;f<h.length;f++){var y=h[f];const V=encodeURIComponent(String(y)),z=this.V(y);for(y=0;y<z.length;y++){var N=V;z[y]!==""&&(N+="="+encodeURIComponent(String(z[y]))),a.push(N)}}return this.i=a.join("&")};function Li(a,h){return h=String(h),a.j&&(h=h.toLowerCase()),h}function uA(a,h){h&&!a.j&&(sr(a),a.i=null,a.g.forEach(function(f,y){var N=y.toLowerCase();y!=N&&(xg(this,y),Ng(this,N,f))},a)),a.j=h}function cA(a,h){const f=new ro;if(l.Image){const y=new Image;y.onload=v(or,f,"TestLoadImage: loaded",!0,h,y),y.onerror=v(or,f,"TestLoadImage: error",!1,h,y),y.onabort=v(or,f,"TestLoadImage: abort",!1,h,y),y.ontimeout=v(or,f,"TestLoadImage: timeout",!1,h,y),l.setTimeout(function(){y.ontimeout&&y.ontimeout()},1e4),y.src=a}else h(!1)}function hA(a,h){const f=new ro,y=new AbortController,N=setTimeout(()=>{y.abort(),or(f,"TestPingServer: timeout",!1,h)},1e4);fetch(a,{signal:y.signal}).then(V=>{clearTimeout(N),V.ok?or(f,"TestPingServer: ok",!0,h):or(f,"TestPingServer: server error",!1,h)}).catch(()=>{clearTimeout(N),or(f,"TestPingServer: error",!1,h)})}function or(a,h,f,y,N){try{N&&(N.onload=null,N.onerror=null,N.onabort=null,N.ontimeout=null),y(f)}catch{}}function dA(){this.g=new K1}function fA(a,h,f){const y=f||"";try{Rg(a,function(N,V){let z=N;c(N)&&(z=dh(N)),h.push(y+V+"="+encodeURIComponent(z))})}catch(N){throw h.push(y+"type="+encodeURIComponent("_badmap")),N}}function rl(a){this.l=a.Ub||null,this.j=a.eb||!1}w(rl,fh),rl.prototype.g=function(){return new il(this.l,this.j)},rl.prototype.i=function(a){return function(){return a}}({});function il(a,h){nt.call(this),this.D=a,this.o=h,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}w(il,nt),t=il.prototype,t.open=function(a,h){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=a,this.A=h,this.readyState=1,uo(this)},t.send=function(a){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const h={headers:this.u,method:this.B,credentials:this.m,cache:void 0};a&&(h.body=a),(this.D||l).fetch(new Request(this.A,h)).then(this.Sa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,lo(this)),this.readyState=0},t.Sa=function(a){if(this.g&&(this.l=a,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=a.headers,this.readyState=2,uo(this)),this.g&&(this.readyState=3,uo(this),this.g)))if(this.responseType==="arraybuffer")a.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof l.ReadableStream<"u"&&"body"in a){if(this.j=a.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;Dg(this)}else a.text().then(this.Ra.bind(this),this.ga.bind(this))};function Dg(a){a.j.read().then(a.Pa.bind(a)).catch(a.ga.bind(a))}t.Pa=function(a){if(this.g){if(this.o&&a.value)this.response.push(a.value);else if(!this.o){var h=a.value?a.value:new Uint8Array(0);(h=this.v.decode(h,{stream:!a.done}))&&(this.response=this.responseText+=h)}a.done?lo(this):uo(this),this.readyState==3&&Dg(this)}},t.Ra=function(a){this.g&&(this.response=this.responseText=a,lo(this))},t.Qa=function(a){this.g&&(this.response=a,lo(this))},t.ga=function(){this.g&&lo(this)};function lo(a){a.readyState=4,a.l=null,a.j=null,a.v=null,uo(a)}t.setRequestHeader=function(a,h){this.u.append(a,h)},t.getResponseHeader=function(a){return this.h&&this.h.get(a.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const a=[],h=this.h.entries();for(var f=h.next();!f.done;)f=f.value,a.push(f[0]+": "+f[1]),f=h.next();return a.join(`\r
1602`)};function uo(a){a.onreadystatechange&&a.onreadystatechange.call(a)}Object.defineProperty(il.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(a){this.m=a?"include":"same-origin"}});function Og(a){let h="";return U(a,function(f,y){h+=y,h+=":",h+=f,h+=`\r
1603`}),h}function Ih(a,h,f){e:{for(y in f){var y=!1;break e}y=!0}y||(f=Og(f),typeof a=="string"?f!=null&&encodeURIComponent(String(f)):_e(a,h,f))}function ke(a){nt.call(this),this.headers=new Map,this.o=a||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}w(ke,nt);var pA=/^https?$/i,mA=["POST","PUT"];t=ke.prototype,t.Ha=function(a){this.J=a},t.ea=function(a,h,f,y){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+a);h=h?h.toUpperCase():"GET",this.D=a,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():gh.g(),this.v=this.o?ug(this.o):ug(gh),this.g.onreadystatechange=m(this.Ea,this);try{this.B=!0,this.g.open(h,String(a),!0),this.B=!1}catch(V){Vg(this,V);return}if(a=f||"",f=new Map(this.headers),y)if(Object.getPrototypeOf(y)===Object.prototype)for(var N in y)f.set(N,y[N]);else if(typeof y.keys=="function"&&typeof y.get=="function")for(const V of y.keys())f.set(V,y.get(V));else throw Error("Unknown input type for opt_headers: "+String(y));y=Array.from(f.keys()).find(V=>V.toLowerCase()=="content-type"),N=l.FormData&&a instanceof l.FormData,!(0<=Array.prototype.indexOf.call(mA,h,void 0))||y||N||f.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[V,z]of f)this.g.setRequestHeader(V,z);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{Fg(this),this.u=!0,this.g.send(a),this.u=!1}catch(V){Vg(this,V)}};function Vg(a,h){a.h=!1,a.g&&(a.j=!0,a.g.abort(),a.j=!1),a.l=h,a.m=5,Lg(a),sl(a)}function Lg(a){a.A||(a.A=!0,ft(a,"complete"),ft(a,"error"))}t.abort=function(a){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=a||7,ft(this,"complete"),ft(this,"abort"),sl(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),sl(this,!0)),ke.aa.N.call(this)},t.Ea=function(){this.s||(this.B||this.u||this.j?Mg(this):this.bb())},t.bb=function(){Mg(this)};function Mg(a){if(a.h&&typeof o<"u"&&(!a.v[1]||Ln(a)!=4||a.Z()!=2)){if(a.u&&Ln(a)==4)sg(a.Ea,0,a);else if(ft(a,"readystatechange"),Ln(a)==4){a.h=!1;try{const z=a.Z();e:switch(z){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var h=!0;break e;default:h=!1}var f;if(!(f=h)){var y;if(y=z===0){var N=String(a.D).match(Cg)[1]||null;!N&&l.self&&l.self.location&&(N=l.self.location.protocol.slice(0,-1)),y=!pA.test(N?N.toLowerCase():"")}f=y}if(f)ft(a,"complete"),ft(a,"success");else{a.m=6;try{var V=2<Ln(a)?a.g.statusText:""}catch{V=""}a.l=V+" ["+a.Z()+"]",Lg(a)}}finally{sl(a)}}}}function sl(a,h){if(a.g){Fg(a);const f=a.g,y=a.v[0]?()=>{}:null;a.g=null,a.v=null,h||ft(a,"ready");try{f.onreadystatechange=y}catch{}}}function Fg(a){a.I&&(l.clearTimeout(a.I),a.I=null)}t.isActive=function(){return!!this.g};function Ln(a){return a.g?a.g.readyState:0}t.Z=function(){try{return 2<Ln(this)?this.g.status:-1}catch{return-1}},t.oa=function(){try{return this.g?this.g.responseText:""}catch{return""}},t.Oa=function(a){if(this.g){var h=this.g.responseText;return a&&h.indexOf(a)==0&&(h=h.substring(a.length)),G1(h)}};function Ug(a){try{if(!a.g)return null;if("response"in a.g)return a.g.response;switch(a.H){case"":case"text":return a.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in a.g)return a.g.mozResponseArrayBuffer}return null}catch{return null}}function gA(a){const h={};a=(a.g&&2<=Ln(a)&&a.g.getAllResponseHeaders()||"").split(`\r
1604`);for(let y=0;y<a.length;y++){if(g(a[y]))continue;var f=k(a[y]);const N=f[0];if(f=f[1],typeof f!="string")continue;f=f.trim();const V=h[N]||[];h[N]=V,V.push(f)}I(h,function(y){return y.join(", ")})}t.Ba=function(){return this.m},t.Ka=function(){return typeof this.l=="string"?this.l:String(this.l)};function co(a,h,f){return f&&f.internalChannelParams&&f.internalChannelParams[a]||h}function jg(a){this.Aa=0,this.i=[],this.j=new ro,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=co("failFast",!1,a),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=co("baseRetryDelayMs",5e3,a),this.cb=co("retryDelaySeedMs",1e4,a),this.Wa=co("forwardChannelMaxRetries",2,a),this.wa=co("forwardChannelRequestTimeoutMs",2e4,a),this.pa=a&&a.xmlHttpFactory||void 0,this.Xa=a&&a.Tb||void 0,this.Ca=a&&a.useFetchStreams||!1,this.L=void 0,this.J=a&&a.supportsCrossDomainXhr||!1,this.K="",this.h=new wg(a&&a.concurrentRequestLimit),this.Da=new dA,this.P=a&&a.fastHandshake||!1,this.O=a&&a.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=a&&a.Rb||!1,a&&a.xa&&this.j.xa(),a&&a.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&a&&a.detectBufferingProxy||!1,this.ja=void 0,a&&a.longPollingTimeout&&0<a.longPollingTimeout&&(this.ja=a.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}t=jg.prototype,t.la=8,t.G=1,t.connect=function(a,h,f,y){pt(0),this.W=a,this.H=h||{},f&&y!==void 0&&(this.H.OSID=f,this.H.OAID=y),this.F=this.X,this.I=Qg(this,null,this.W),al(this)};function Ah(a){if(zg(a),a.G==3){var h=a.U++,f=Vn(a.I);if(_e(f,"SID",a.K),_e(f,"RID",h),_e(f,"TYPE","terminate"),ho(a,f),h=new ir(a,a.j,h),h.L=2,h.v=nl(Vn(f)),f=!1,l.navigator&&l.navigator.sendBeacon)try{f=l.navigator.sendBeacon(h.v.toString(),"")}catch{}!f&&l.Image&&(new Image().src=h.v,f=!0),f||(h.g=Xg(h.j,null),h.g.ea(h.v)),h.F=Date.now(),Za(h)}Kg(a)}function ol(a){a.g&&(Rh(a),a.g.cancel(),a.g=null)}function zg(a){ol(a),a.u&&(l.clearTimeout(a.u),a.u=null),ll(a),a.h.cancel(),a.s&&(typeof a.s=="number"&&l.clearTimeout(a.s),a.s=null)}function al(a){if(!Tg(a.h)&&!a.s){a.s=!0;var h=a.Ga;Zt||K(),q||(Zt(),q=!0),J.add(h,a),a.B=0}}function yA(a,h){return Ig(a.h)>=a.h.j-(a.s?1:0)?!1:a.s?(a.i=h.D.concat(a.i),!0):a.G==1||a.G==2||a.B>=(a.Va?0:a.Wa)?!1:(a.s=no(m(a.Ga,a,h),Gg(a,a.B)),a.B++,!0)}t.Ga=function(a){if(this.s)if(this.s=null,this.G==1){if(!a){this.U=Math.floor(1e5*Math.random()),a=this.U++;const N=new ir(this,this.j,a);let V=this.o;if(this.S&&(V?(V=_(V),S(V,this.S)):V=this.S),this.m!==null||this.O||(N.H=V,V=null),this.P)e:{for(var h=0,f=0;f<this.i.length;f++){t:{var y=this.i[f];if("__data__"in y.map&&(y=y.map.__data__,typeof y=="string")){y=y.length;break t}y=void 0}if(y===void 0)break;if(h+=y,4096<h){h=f;break e}if(h===4096||f===this.i.length-1){h=f+1;break e}}h=1e3}else h=1e3;h=Bg(this,N,h),f=Vn(this.I),_e(f,"RID",a),_e(f,"CVER",22),this.D&&_e(f,"X-HTTP-Session-Id",this.D),ho(this,f),V&&(this.O?h="headers="+encodeURIComponent(String(Og(V)))+"&"+h:this.m&&Ih(f,this.m,V)),Th(this.h,N),this.Ua&&_e(f,"TYPE","init"),this.P?(_e(f,"$req",h),_e(f,"SID","null"),N.T=!0,_h(N,f,null)):_h(N,f,h),this.G=2}}else this.G==3&&(a?$g(this,a):this.i.length==0||Tg(this.h)||$g(this))};function $g(a,h){var f;h?f=h.l:f=a.U++;const y=Vn(a.I);_e(y,"SID",a.K),_e(y,"RID",f),_e(y,"AID",a.T),ho(a,y),a.m&&a.o&&Ih(y,a.m,a.o),f=new ir(a,a.j,f,a.B+1),a.m===null&&(f.H=a.o),h&&(a.i=h.D.concat(a.i)),h=Bg(a,f,1e3),f.I=Math.round(.5*a.wa)+Math.round(.5*a.wa*Math.random()),Th(a.h,f),_h(f,y,h)}function ho(a,h){a.H&&U(a.H,function(f,y){_e(h,y,f)}),a.l&&Rg({},function(f,y){_e(h,y,f)})}function Bg(a,h,f){f=Math.min(a.i.length,f);var y=a.l?m(a.l.Na,a.l,a):null;e:{var N=a.i;let V=-1;for(;;){const z=["count="+f];V==-1?0<f?(V=N[0].g,z.push("ofs="+V)):V=0:z.push("ofs="+V);let me=!0;for(let Ke=0;Ke<f;Ke++){let ue=N[Ke].g;const rt=N[Ke].map;if(ue-=V,0>ue)V=Math.max(0,N[Ke].g-100),me=!1;else try{fA(rt,z,"req"+ue+"_")}catch{y&&y(rt)}}if(me){y=z.join("&");break e}}}return a=a.i.splice(0,f),h.D=a,y}function Wg(a){if(!a.g&&!a.u){a.Y=1;var h=a.Fa;Zt||K(),q||(Zt(),q=!0),J.add(h,a),a.v=0}}function Sh(a){return a.g||a.u||3<=a.v?!1:(a.Y++,a.u=no(m(a.Fa,a),Gg(a,a.v)),a.v++,!0)}t.Fa=function(){if(this.u=null,qg(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var a=2*this.R;this.j.info("BP detection timer enabled: "+a),this.A=no(m(this.ab,this),a)}},t.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,pt(10),ol(this),qg(this))};function Rh(a){a.A!=null&&(l.clearTimeout(a.A),a.A=null)}function qg(a){a.g=new ir(a,a.j,"rpc",a.Y),a.m===null&&(a.g.H=a.o),a.g.O=0;var h=Vn(a.qa);_e(h,"RID","rpc"),_e(h,"SID",a.K),_e(h,"AID",a.T),_e(h,"CI",a.F?"0":"1"),!a.F&&a.ja&&_e(h,"TO",a.ja),_e(h,"TYPE","xmlhttp"),ho(a,h),a.m&&a.o&&Ih(h,a.m,a.o),a.L&&(a.g.I=a.L);var f=a.g;a=a.ia,f.L=1,f.v=nl(Vn(h)),f.m=null,f.P=!0,_g(f,a)}t.Za=function(){this.C!=null&&(this.C=null,ol(this),Sh(this),pt(19))};function ll(a){a.C!=null&&(l.clearTimeout(a.C),a.C=null)}function Hg(a,h){var f=null;if(a.g==h){ll(a),Rh(a),a.g=null;var y=2}else if(wh(a.h,h))f=h.D,Ag(a.h,h),y=1;else return;if(a.G!=0){if(h.o)if(y==1){f=h.m?h.m.length:0,h=Date.now()-h.F;var N=a.B;y=Xa(),ft(y,new pg(y,f)),al(a)}else Wg(a);else if(N=h.s,N==3||N==0&&0<h.X||!(y==1&&yA(a,h)||y==2&&Sh(a)))switch(f&&0<f.length&&(h=a.h,h.i=h.i.concat(f)),N){case 1:ti(a,5);break;case 4:ti(a,10);break;case 3:ti(a,6);break;default:ti(a,2)}}}function Gg(a,h){let f=a.Ta+Math.floor(Math.random()*a.cb);return a.isActive()||(f*=2),f*h}function ti(a,h){if(a.j.info("Error code "+h),h==2){var f=m(a.fb,a),y=a.Xa;const N=!y;y=new ei(y||"//www.google.com/images/cleardot.gif"),l.location&&l.location.protocol=="http"||el(y,"https"),nl(y),N?cA(y.toString(),f):hA(y.toString(),f)}else pt(2);a.G=0,a.l&&a.l.sa(h),Kg(a),zg(a)}t.fb=function(a){a?(this.j.info("Successfully pinged google.com"),pt(2)):(this.j.info("Failed to ping google.com"),pt(1))};function Kg(a){if(a.G=0,a.ka=[],a.l){const h=Sg(a.h);(h.length!=0||a.i.length!=0)&&(C(a.ka,h),C(a.ka,a.i),a.h.i.length=0,P(a.i),a.i.length=0),a.l.ra()}}function Qg(a,h,f){var y=f instanceof ei?Vn(f):new ei(f);if(y.g!="")h&&(y.g=h+"."+y.g),tl(y,y.s);else{var N=l.location;y=N.protocol,h=h?h+"."+N.hostname:N.hostname,N=+N.port;var V=new ei(null);y&&el(V,y),h&&(V.g=h),N&&tl(V,N),f&&(V.l=f),y=V}return f=a.D,h=a.ya,f&&h&&_e(y,f,h),_e(y,"VER",a.la),ho(a,y),y}function Xg(a,h,f){if(h&&!a.J)throw Error("Can't create secondary domain capable XhrIo object.");return h=a.Ca&&!a.pa?new ke(new rl({eb:f})):new ke(a.pa),h.Ha(a.J),h}t.isActive=function(){return!!this.l&&this.l.isActive(this)};function Yg(){}t=Yg.prototype,t.ua=function(){},t.ta=function(){},t.sa=function(){},t.ra=function(){},t.isActive=function(){return!0},t.Na=function(){};function ul(){}ul.prototype.g=function(a,h){return new Dt(a,h)};function Dt(a,h){nt.call(this),this.g=new jg(h),this.l=a,this.h=h&&h.messageUrlParams||null,a=h&&h.messageHeaders||null,h&&h.clientProtocolHeaderRequired&&(a?a["X-Client-Protocol"]="webchannel":a={"X-Client-Protocol":"webchannel"}),this.g.o=a,a=h&&h.initMessageHeaders||null,h&&h.messageContentType&&(a?a["X-WebChannel-Content-Type"]=h.messageContentType:a={"X-WebChannel-Content-Type":h.messageContentType}),h&&h.va&&(a?a["X-WebChannel-Client-Profile"]=h.va:a={"X-WebChannel-Client-Profile":h.va}),this.g.S=a,(a=h&&h.Sb)&&!g(a)&&(this.g.m=a),this.v=h&&h.supportsCrossDomainXhr||!1,this.u=h&&h.sendRawJson||!1,(h=h&&h.httpSessionIdParam)&&!g(h)&&(this.g.D=h,a=this.h,a!==null&&h in a&&(a=this.h,h in a&&delete a[h])),this.j=new Mi(this)}w(Dt,nt),Dt.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},Dt.prototype.close=function(){Ah(this.g)},Dt.prototype.o=function(a){var h=this.g;
1604if(typeof a=="string"){var f={};f.__data__=a,a=f}else this.u&&(f={},f.__data__=dh(a),a=f);h.i.push(new eA(h.Ya++,a)),h.G==3&&al(h)},Dt.prototype.N=function(){this.g.l=null,delete this.j,Ah(this.g),delete this.g,Dt.aa.N.call(this)};function Jg(a){ph.call(this),a.__headers__&&(this.headers=a.__headers__,this.statusCode=a.__status__,delete a.__headers__,delete a.__status__);var h=a.__sm__;if(h){e:{for(const f in h){a=f;break e}a=void 0}(this.i=a)&&(a=this.i,h=h!==null&&a in h?h[a]:void 0),this.data=h}else this.data=a}w(Jg,ph);function Zg(){mh.call(this),this.status=1}w(Zg,mh);function Mi(a){this.g=a}w(Mi,Yg),Mi.prototype.ua=function(){ft(this.g,"a")},Mi.prototype.ta=function(a){ft(this.g,new Jg(a))},Mi.prototype.sa=function(a){ft(this.g,new Zg)},Mi.prototype.ra=function(){ft(this.g,"b")},ul.prototype.createWebChannel=ul.prototype.g,Dt.prototype.send=Dt.prototype.o,Dt.prototype.open=Dt.prototype.m,Dt.prototype.close=Dt.prototype.close,jT=function(){return new ul},UT=function(){return Xa()},FT=Jr,Sf={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},Ya.NO_ERROR=0,Ya.TIMEOUT=8,Ya.HTTP_ERROR=6,tu=Ya,mg.COMPLETE="complete",MT=mg,cg.EventType=eo,eo.OPEN="a",eo.CLOSE="b",eo.ERROR="c",eo.MESSAGE="d",nt.prototype.listen=nt.prototype.K,ko=cg,ke.prototype.listenOnce=ke.prototype.L,ke.prototype.getLastError=ke.prototype.Ka,ke.prototype.getLastErrorCode=ke.prototype.Ba,ke.prototype.getStatus=ke.prototype.Z,ke.prototype.getResponseJson=ke.prototype.Oa,ke.prototype.getResponseText=ke.prototype.oa,ke.prototype.send=ke.prototype.ea,ke.prototype.setWithCredentials=ke.prototype.Ha,LT=ke}).apply(typeof kl<"u"?kl:typeof self<"u"?self:typeof window<"u"?window:{});const Q_="@firebase/firestore",X_="4.8.0";/**
1605 * @license
1606 * Copyright 2017 Google LLC
1607 *
1608 * Licensed under the Apache License, Version 2.0 (the "License");
1609 * you may not use this file except in compliance with the License.
1610 * You may obtain a copy of the License at
1611 *
1612 *   http://www.apache.org/licenses/LICENSE-2.0
1613 *
1614 * Unless required by applicable law or agreed to in writing, software
1615 * distributed under the License is distributed on an "AS IS" BASIS,
1616 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1617 * See the License for the specific language governing permissions and
1618 * limitations under the License.
1619 */class lt{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}lt.UNAUTHENTICATED=new lt(null),lt.GOOGLE_CREDENTIALS=new lt("google-credentials-uid"),lt.FIRST_PARTY=new lt("first-party-uid"),lt.MOCK_USER=new lt("mock-user");/**
1620 * @license
1621 * Copyright 2017 Google LLC
1622 *
1623 * Licensed under the Apache License, Version 2.0 (the "License");
1624 * you may not use this file except in compliance with the License.
1625 * You may obtain a copy of the License at
1626 *
1627 *   http://www.apache.org/licenses/LICENSE-2.0
1628 *
1629 * Unless required by applicable law or agreed to in writing, software
1630 * distributed under the License is distributed on an "AS IS" BASIS,
1631 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1632 * See the License for the specific language governing permissions and
1633 * limitations under the License.
1634 */let js="11.10.0";/**
1635 * @license
1636 * Copyright 2017 Google LLC
1637 *
1638 * Licensed under the Apache License, Version 2.0 (the "License");
1639 * you may not use this file except in compliance with the License.
1640 * You may obtain a copy of the License at
1641 *
1642 *   http://www.apache.org/licenses/LICENSE-2.0
1643 *
1644 * Unless required by applicable law or agreed to in writing, software
1645 * distributed under the License is distributed on an "AS IS" BASIS,
1646 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1647 * See the License for the specific language governing permissions and
1648 * limitations under the License.
1649 */const wi=new Vc("@firebase/firestore");function $i(){return wi.logLevel}function H(t,...e){if(wi.logLevel<=ie.DEBUG){const n=e.map(am);wi.debug(`Firestore (${js}): ${t}`,...n)}}function Yn(t,...e){if(wi.logLevel<=ie.ERROR){const n=e.map(am);wi.error(`Firestore (${js}): ${t}`,...n)}}function Ur(t,...e){if(wi.logLevel<=ie.WARN){const n=e.map(am);wi.warn(`Firestore (${js}): ${t}`,...n)}}function am(t){if(typeof t=="string")return t;try{/**
1650* @license
1651* Copyright 2020 Google LLC
1652*
1653* Licensed under the Apache License, Version 2.0 (the "License");
1654* you may not use this file except in compliance with the License.
1655* You may obtain a copy of the License at
1656*
1657*   http://www.apache.org/licenses/LICENSE-2.0
1658*
1659* Unless required by applicable law or agreed to in writing, software
1660* distributed under the License is distributed on an "AS IS" BASIS,
1661* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1662* See the License for the specific language governing permissions and
1663* limitations under the License.
1664*/return function(n){return JSON.stringify(n)}(t)}catch{return t}}/**
1665 * @license
1666 * Copyright 2017 Google LLC
1667 *
1668 * Licensed under the Apache License, Version 2.0 (the "License");
1669 * you may not use this file except in compliance with the License.
1670 * You may obtain a copy of the License at
1671 *
1672 *   http://www.apache.org/licenses/LICENSE-2.0
1673 *
1674 * Unless required by applicable law or agreed to in writing, software
1675 * distributed under the License is distributed on an "AS IS" BASIS,
1676 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1677 * See the License for the specific language governing permissions and
1678 * limitations under the License.
1679 */function Y(t,e,n){let r="Unexpected state";typeof e=="string"?r=e:n=e,zT(t,r,n)}function zT(t,e,n){let r=`FIRESTORE (${js}) INTERNAL ASSERTION FAILED: ${e} (ID: ${t.toString(16)})`;if(n!==void 0)try{r+=" CONTEXT: "+JSON.stringify(n)}catch{r+=" CONTEXT: "+n}throw Yn(r),new Error(r)}function ce(t,e,n,r){let i="Unexpected state";typeof n=="string"?i=n:r=n,t||zT(e,i,r)}function Z(t,e){return t}/**
1680 * @license
1681 * Copyright 2017 Google LLC
1682 *
1683 * Licensed under the Apache License, Version 2.0 (the "License");
1684 * you may not use this file except in compliance with the License.
1685 * You may obtain a copy of the License at
1686 *
1687 *   http://www.apache.org/licenses/LICENSE-2.0
1688 *
1689 * Unless required by applicable law or agreed to in writing, software
1690 * distributed under the License is distributed on an "AS IS" BASIS,
1691 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1692 * See the License for the specific language governing permissions and
1693 * limitations under the License.
1694 */const L={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class B extends mn{constructor(e,n){super(e,n),this.code=e,this.message=n,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/**
1695 * @license
1696 * Copyright 2017 Google LLC
1697 *
1698 * Licensed under the Apache License, Version 2.0 (the "License");
1699 * you may not use this file except in compliance with the License.
1700 * You may obtain a copy of the License at
1701 *
1702 *   http://www.apache.org/licenses/LICENSE-2.0
1703 *
1704 * Unless required by applicable law or agreed to in writing, software
1705 * distributed under the License is distributed on an "AS IS" BASIS,
1706 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1707 * See the License for the specific language governing permissions and
1708 * limitations under the License.
1709 */class Rn{constructor(){this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}}/**
1710 * @license
1711 * Copyright 2017 Google LLC
1712 *
1713 * Licensed under the Apache License, Version 2.0 (the "License");
1714 * you may not use this file except in compliance with the License.
1715 * You may obtain a copy of the License at
1716 *
1717 *   http://www.apache.org/licenses/LICENSE-2.0
1718 *
1719 * Unless required by applicable law or agreed to in writing, software
1720 * distributed under the License is distributed on an "AS IS" BASIS,
1721 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1722 * See the License for the specific language governing permissions and
1723 * limitations under the License.
1724 */class $T{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class Hb{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable(()=>n(lt.UNAUTHENTICATED))}shutdown(){}}class Gb{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class Kb{constructor(e){this.t=e,this.currentUser=lt.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){ce(this.o===void 0,42304);let r=this.i;const i=u=>this.i!==r?(r=this.i,n(u)):Promise.resolve();let s=new Rn;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new Rn,e.enqueueRetryable(()=>i(this.currentUser))};const o=()=>{const u=s;e.enqueueRetryable(async()=>{await u.promise,await i(this.currentUser)})},l=u=>{H("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=u,this.o&&(this.auth.addAuthTokenListener(this.o),o())};this.t.onInit(u=>l(u)),setTimeout(()=>{if(!this.auth){const u=this.t.getImmediate({optional:!0});u?l(u):(H("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new Rn)}},0),o()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==e?(H("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(ce(typeof r.accessToken=="string",31837,{l:r}),new $T(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return ce(e===null||typeof e=="string",2055,{h:e}),new lt(e)}}class Qb{constructor(e,n,r){this.P=e,this.T=n,this.I=r,this.type="FirstParty",this.user=lt.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set("X-Goog-AuthUser",this.P);const e=this.R();return e&&this.A.set("Authorization",e),this.T&&this.A.set("X-Goog-Iam-Authorization-Token",this.T),this.A}}class Xb{constructor(e,n,r){this.P=e,this.T=n,this.I=r}getToken(){return Promise.resolve(new Qb(this.P,this.T,this.I))}start(e,n){e.enqueueRetryable(()=>n(lt.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class Y_{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class Yb{constructor(e,n){this.V=n,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,St(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,n){ce(this.o===void 0,3512);const r=s=>{s.error!=null&&H("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${s.error.message}`);const o=s.token!==this.m;return this.m=s.token,H("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?n(s.token):Promise.resolve()};this.o=s=>{e.enqueueRetryable(()=>r(s))};const i=s=>{H("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=s,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(s=>i(s)),setTimeout(()=>{if(!this.appCheck){const s=this.V.getImmediate({optional:!0});s?i(s):H("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new Y_(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(n=>n?(ce(typeof n.token=="string",44558,{tokenResult:n}),this.m=n.token,new Y_(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}/**
1725 * @license
1726 * Copyright 2020 Google LLC
1727 *
1728 * Licensed under the Apache License, Version 2.0 (the "License");
1729 * you may not use this file except in compliance with the License.
1730 * You may obtain a copy of the License at
1731 *
1732 *   http://www.apache.org/licenses/LICENSE-2.0
1733 *
1734 * Unless required by applicable law or agreed to in writing, software
1735 * distributed under the License is distributed on an "AS IS" BASIS,
1736 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1737 * See the License for the specific language governing permissions and
1738 * limitations under the License.
1739 */function Jb(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let r=0;r<t;r++)n[r]=Math.floor(256*Math.random());return n}/**
1740 * @license
1741 * Copyright 2023 Google LLC
1742 *
1743 * Licensed under the Apache License, Version 2.0 (the "License");
1744 * you may not use this file except in compliance with the License.
1745 * You may obtain a copy of the License at
1746 *
1747 *   http://www.apache.org/licenses/LICENSE-2.0
1748 *
1749 * Unless required by applicable law or agreed to in writing, software
1750 * distributed under the License is distributed on an "AS IS" BASIS,
1751 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1752 * See the License for the specific language governing permissions and
1753 * limitations under the License.
1754 */function BT(){return new TextEncoder}/**
1755 * @license
1756 * Copyright 2017 Google LLC
1757 *
1758 * Licensed under the Apache License, Version 2.0 (the "License");
1759 * you may not use this file except in compliance with the License.
1760 * You may obtain a copy of the License at
1761 *
1762 *   http://www.apache.org/licenses/LICENSE-2.0
1763 *
1764 * Unless required by applicable law or agreed to in writing, software
1765 * distributed under the License is distributed on an "AS IS" BASIS,
1766 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1767 * See the License for the specific language governing permissions and
1768 * limitations under the License.
1769 */class lm{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=62*Math.floor(4.129032258064516);let r="";for(;r.length<20;){const i=Jb(40);for(let s=0;s<i.length;++s)r.length<20&&i[s]<n&&(r+=e.charAt(i[s]%62))}return r}}function ne(t,e){return t<e?-1:t>e?1:0}function Rf(t,e){let n=0;for(;n<t.length&&n<e.length;){const r=t.codePointAt(n),i=e.codePointAt(n);if(r!==i){if(r<128&&i<128)return ne(r,i);{const s=BT(),o=Zb(s.encode(J_(t,n)),s.encode(J_(e,n)));return o!==0?o:ne(r,i)}}n+=r>65535?2:1}return ne(t.length,e.length)}function J_(t,e){return t.codePointAt(e)>65535?t.substring(e,e+2):t.substring(e,e+1)}function Zb(t,e){for(let n=0;n<t.length&&n<e.length;++n)if(t[n]!==e[n])return ne(t[n],e[n]);return ne(t.length,e.length)}function Is(t,e,n){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}/**
1770 * @license
1771 * Copyright 2017 Google LLC
1772 *
1773 * Licensed under the Apache License, Version 2.0 (the "License");
1774 * you may not use this file except in compliance with the License.
1775 * You may obtain a copy of the License at
1776 *
1777 *   http://www.apache.org/licenses/LICENSE-2.0
1778 *
1779 * Unless required by applicable law or agreed to in writing, software
1780 * distributed under the License is distributed on an "AS IS" BASIS,
1781 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1782 * See the License for the specific language governing permissions and
1783 * limitations under the License.
1784 */const Z_="__name__";class vn{constructor(e,n,r){n===void 0?n=0:n>e.length&&Y(637,{offset:n,range:e.length}),r===void 0?r=e.length-n:r>e.length-n&&Y(1746,{length:r,range:e.length-n}),this.segments=e,this.offset=n,this.len=r}get length(){return this.len}isEqual(e){return vn.comparator(this,e)===0}child(e){const n=this.segments.slice(this.offset,this.limit());return e instanceof vn?e.forEach(r=>{n.push(r)}):n.push(e),this.construct(n)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length<this.length)return!1;for(let n=0;n<this.length;n++)if(this.get(n)!==e.get(n))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let n=0;n<this.length;n++)if(this.get(n)!==e.get(n))return!1;return!0}forEach(e){for(let n=this.offset,r=this.limit();n<r;n++)e(this.segments[n])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,n){const r=Math.min(e.length,n.length);for(let i=0;i<r;i++){const s=vn.compareSegments(e.get(i),n.get(i));if(s!==0)return s}return ne(e.length,n.length)}static compareSegments(e,n){const r=vn.isNumericId(e),i=vn.isNumericId(n);return r&&!i?-1:!r&&i?1:r&&i?vn.extractNumericId(e).compare(vn.extractNumericId(n)):Rf(e,n)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return Or.fromString(e.substring(4,e.length-2))}}class ge extends vn{construct(e,n,r){return new ge(e,n,r)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}
1784toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const n=[];for(const r of e){if(r.indexOf("//")>=0)throw new B(L.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);n.push(...r.split("/").filter(i=>i.length>0))}return new ge(n)}static emptyPath(){return new ge([])}}const eN=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Ye extends vn{construct(e,n,r){return new Ye(e,n,r)}static isValidIdentifier(e){return eN.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Ye.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===Z_}static keyField(){return new Ye([Z_])}static fromServerFormat(e){const n=[];let r="",i=0;const s=()=>{if(r.length===0)throw new B(L.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(r),r=""};let o=!1;for(;i<e.length;){const l=e[i];if(l==="\\"){if(i+1===e.length)throw new B(L.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const u=e[i+1];if(u!=="\\"&&u!=="."&&u!=="`")throw new B(L.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);r+=u,i+=2}else l==="`"?(o=!o,i++):l!=="."||o?(r+=l,i++):(s(),i++)}if(s(),o)throw new B(L.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new Ye(n)}static emptyPath(){return new Ye([])}}/**
1785 * @license
1786 * Copyright 2017 Google LLC
1787 *
1788 * Licensed under the Apache License, Version 2.0 (the "License");
1789 * you may not use this file except in compliance with the License.
1790 * You may obtain a copy of the License at
1791 *
1792 *   http://www.apache.org/licenses/LICENSE-2.0
1793 *
1794 * Unless required by applicable law or agreed to in writing, software
1795 * distributed under the License is distributed on an "AS IS" BASIS,
1796 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1797 * See the License for the specific language governing permissions and
1798 * limitations under the License.
1799 */class Q{constructor(e){this.path=e}static fromPath(e){return new Q(ge.fromString(e))}static fromName(e){return new Q(ge.fromString(e).popFirst(5))}static empty(){return new Q(ge.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&ge.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,n){return ge.comparator(e.path,n.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new Q(new ge(e.slice()))}}/**
1800 * @license
1801 * Copyright 2017 Google LLC
1802 *
1803 * Licensed under the Apache License, Version 2.0 (the "License");
1804 * you may not use this file except in compliance with the License.
1805 * You may obtain a copy of the License at
1806 *
1807 *   http://www.apache.org/licenses/LICENSE-2.0
1808 *
1809 * Unless required by applicable law or agreed to in writing, software
1810 * distributed under the License is distributed on an "AS IS" BASIS,
1811 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1812 * See the License for the specific language governing permissions and
1813 * limitations under the License.
1814 */function um(t,e,n){if(!n)throw new B(L.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function tN(t,e,n,r){if(e===!0&&r===!0)throw new B(L.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function ev(t){if(!Q.isDocumentKey(t))throw new B(L.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function tv(t){if(Q.isDocumentKey(t))throw new B(L.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function WT(t){return typeof t=="object"&&t!==null&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}function jc(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{const e=function(r){return r.constructor?r.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":Y(12329,{type:typeof t})}function Ze(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new B(L.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=jc(t);throw new B(L.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}function nN(t,e){if(e<=0)throw new B(L.INVALID_ARGUMENT,`Function ${t}() requires a positive number, but it was: ${e}.`)}/**
1815 * @license
1816 * Copyright 2025 Google LLC
1817 *
1818 * Licensed under the Apache License, Version 2.0 (the "License");
1819 * you may not use this file except in compliance with the License.
1820 * You may obtain a copy of the License at
1821 *
1822 *   http://www.apache.org/licenses/LICENSE-2.0
1823 *
1824 * Unless required by applicable law or agreed to in writing, software
1825 * distributed under the License is distributed on an "AS IS" BASIS,
1826 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1827 * See the License for the specific language governing permissions and
1828 * limitations under the License.
1829 */function Ue(t,e){const n={typeString:t};return e&&(n.value=e),n}function Ma(t,e){if(!WT(t))throw new B(L.INVALID_ARGUMENT,"JSON must be an object");let n;for(const r in e)if(e[r]){const i=e[r].typeString,s="value"in e[r]?{value:e[r].value}:void 0;if(!(r in t)){n=`JSON missing required field: '${r}'`;break}const o=t[r];if(i&&typeof o!==i){n=`JSON field '${r}' must be a ${i}.`;break}if(s!==void 0&&o!==s.value){n=`Expected '${r}' field to equal '${s.value}'`;break}}if(n)throw new B(L.INVALID_ARGUMENT,n);return!0}/**
1830 * @license
1831 * Copyright 2017 Google LLC
1832 *
1833 * Licensed under the Apache License, Version 2.0 (the "License");
1834 * you may not use this file except in compliance with the License.
1835 * You may obtain a copy of the License at
1836 *
1837 *   http://www.apache.org/licenses/LICENSE-2.0
1838 *
1839 * Unless required by applicable law or agreed to in writing, software
1840 * distributed under the License is distributed on an "AS IS" BASIS,
1841 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1842 * See the License for the specific language governing permissions and
1843 * limitations under the License.
1844 */const nv=-62135596800,rv=1e6;class Ee{static now(){return Ee.fromMillis(Date.now())}static fromDate(e){return Ee.fromMillis(e.getTime())}static fromMillis(e){const n=Math.floor(e/1e3),r=Math.floor((e-1e3*n)*rv);return new Ee(n,r)}constructor(e,n){if(this.seconds=e,this.nanoseconds=n,n<0)throw new B(L.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new B(L.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(e<nv)throw new B(L.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new B(L.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/rv}_compareTo(e){return this.seconds===e.seconds?ne(this.nanoseconds,e.nanoseconds):ne(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:Ee._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(Ma(e,Ee._jsonSchema))return new Ee(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-nv;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}Ee._jsonSchemaVersion="firestore/timestamp/1.0",Ee._jsonSchema={type:Ue("string",Ee._jsonSchemaVersion),seconds:Ue("number"),nanoseconds:Ue("number")};/**
1845 * @license
1846 * Copyright 2017 Google LLC
1847 *
1848 * Licensed under the Apache License, Version 2.0 (the "License");
1849 * you may not use this file except in compliance with the License.
1850 * You may obtain a copy of the License at
1851 *
1852 *   http://www.apache.org/licenses/LICENSE-2.0
1853 *
1854 * Unless required by applicable law or agreed to in writing, software
1855 * distributed under the License is distributed on an "AS IS" BASIS,
1856 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1857 * See the License for the specific language governing permissions and
1858 * limitations under the License.
1859 */class ee{static fromTimestamp(e){return new ee(e)}static min(){return new ee(new Ee(0,0))}static max(){return new ee(new Ee(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}/**
1860 * @license
1861 * Copyright 2021 Google LLC
1862 *
1863 * Licensed under the Apache License, Version 2.0 (the "License");
1864 * you may not use this file except in compliance with the License.
1865 * You may obtain a copy of the License at
1866 *
1867 *   http://www.apache.org/licenses/LICENSE-2.0
1868 *
1869 * Unless required by applicable law or agreed to in writing, software
1870 * distributed under the License is distributed on an "AS IS" BASIS,
1871 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1872 * See the License for the specific language governing permissions and
1873 * limitations under the License.
1874 */const ya=-1;function rN(t,e){const n=t.toTimestamp().seconds,r=t.toTimestamp().nanoseconds+1,i=ee.fromTimestamp(r===1e9?new Ee(n+1,0):new Ee(n,r));return new jr(i,Q.empty(),e)}function iN(t){return new jr(t.readTime,t.key,ya)}class jr{constructor(e,n,r){this.readTime=e,this.documentKey=n,this.largestBatchId=r}static min(){return new jr(ee.min(),Q.empty(),ya)}static max(){return new jr(ee.max(),Q.empty(),ya)}}function sN(t,e){let n=t.readTime.compareTo(e.readTime);return n!==0?n:(n=Q.comparator(t.documentKey,e.documentKey),n!==0?n:ne(t.largestBatchId,e.largestBatchId))}/**
1875 * @license
1876 * Copyright 2020 Google LLC
1877 *
1878 * Licensed under the Apache License, Version 2.0 (the "License");
1879 * you may not use this file except in compliance with the License.
1880 * You may obtain a copy of the License at
1881 *
1882 *   http://www.apache.org/licenses/LICENSE-2.0
1883 *
1884 * Unless required by applicable law or agreed to in writing, software
1885 * distributed under the License is distributed on an "AS IS" BASIS,
1886 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1887 * See the License for the specific language governing permissions and
1888 * limitations under the License.
1889 */const oN="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class aN{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}/**
1890 * @license
1891 * Copyright 2017 Google LLC
1892 *
1893 * Licensed under the Apache License, Version 2.0 (the "License");
1894 * you may not use this file except in compliance with the License.
1895 * You may obtain a copy of the License at
1896 *
1897 *   http://www.apache.org/licenses/LICENSE-2.0
1898 *
1899 * Unless required by applicable law or agreed to in writing, software
1900 * distributed under the License is distributed on an "AS IS" BASIS,
1901 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1902 * See the License for the specific language governing permissions and
1903 * limitations under the License.
1904 */async function zs(t){if(t.code!==L.FAILED_PRECONDITION||t.message!==oN)throw t;H("LocalStore","Unexpectedly lost primary lease")}/**
1905 * @license
1906 * Copyright 2017 Google LLC
1907 *
1908 * Licensed under the Apache License, Version 2.0 (the "License");
1909 * you may not use this file except in compliance with the License.
1910 * You may obtain a copy of the License at
1911 *
1912 *   http://www.apache.org/licenses/LICENSE-2.0
1913 *
1914 * Unless required by applicable law or agreed to in writing, software
1915 * distributed under the License is distributed on an "AS IS" BASIS,
1916 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1917 * See the License for the specific language governing permissions and
1918 * limitations under the License.
1919 */class M{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)},n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)})}catch(e){return this.next(void 0,e)}next(e,n){return this.callbackAttached&&Y(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new M((r,i)=>{this.nextCallback=s=>{this.wrapSuccess(e,s).next(r,i)},this.catchCallback=s=>{this.wrapFailure(n,s).next(r,i)}})}toPromise(){return new Promise((e,n)=>{this.next(e,n)})}wrapUserFunction(e){try{const n=e();return n instanceof M?n:M.resolve(n)}catch(n){return M.reject(n)}}wrapSuccess(e,n){return e?this.wrapUserFunction(()=>e(n)):M.resolve(n)}wrapFailure(e,n){return e?this.wrapUserFunction(()=>e(n)):M.reject(n)}static resolve(e){return new M((n,r)=>{n(e)})}static reject(e){return new M((n,r)=>{r(e)})}static waitFor(e){return new M((n,r)=>{let i=0,s=0,o=!1;e.forEach(l=>{++i,l.next(()=>{++s,o&&s===i&&n()},u=>r(u))}),o=!0,s===i&&n()})}static or(e){let n=M.resolve(!1);for(const r of e)n=n.next(i=>i?M.resolve(i):r());return n}static forEach(e,n){const r=[];return e.forEach((i,s)=>{r.push(n.call(this,i,s))}),this.waitFor(r)}static mapArray(e,n){return new M((r,i)=>{const s=e.length,o=new Array(s);let l=0;for(let u=0;u<s;u++){const c=u;n(e[c]).next(d=>{o[c]=d,++l,l===s&&r(o)},d=>i(d))}})}static doWhile(e,n){return new M((r,i)=>{const s=()=>{e()===!0?n().next(()=>{s()},i):r()};s()})}}function lN(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}function $s(t){return t.name==="IndexedDbTransactionError"}/**
1920 * @license
1921 * Copyright 2018 Google LLC
1922 *
1923 * Licensed under the Apache License, Version 2.0 (the "License");
1924 * you may not use this file except in compliance with the License.
1925 * You may obtain a copy of the License at
1926 *
1927 *   http://www.apache.org/licenses/LICENSE-2.0
1928 *
1929 * Unless required by applicable law or agreed to in writing, software
1930 * distributed under the License is distributed on an "AS IS" BASIS,
1931 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1932 * See the License for the specific language governing permissions and
1933 * limitations under the License.
1934 */class zc{constructor(e,n){this.previousValue=e,n&&(n.sequenceNumberHandler=r=>this._e(r),this.ae=r=>n.writeSequenceNumber(r))}_e(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ae&&this.ae(e),e}}zc.ue=-1;/**
1935 * @license
1936 * Copyright 2017 Google LLC
1937 *
1938 * Licensed under the Apache License, Version 2.0 (the "License");
1939 * you may not use this file except in compliance with the License.
1940 * You may obtain a copy of the License at
1941 *
1942 *   http://www.apache.org/licenses/LICENSE-2.0
1943 *
1944 * Unless required by applicable law or agreed to in writing, software
1945 * distributed under the License is distributed on an "AS IS" BASIS,
1946 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1947 * See the License for the specific language governing permissions and
1948 * limitations under the License.
1949 */const cm=-1;function $c(t){return t==null}function Yu(t){return t===0&&1/t==-1/0}function uN(t){return typeof t=="number"&&Number.isInteger(t)&&!Yu(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}/**
1950 * @license
1951 * Copyright 2017 Google LLC
1952 *
1953 * Licensed under the Apache License, Version 2.0 (the "License");
1954 * you may not use this file except in compliance with the License.
1955 * You may obtain a copy of the License at
1956 *
1957 *   http://www.apache.org/licenses/LICENSE-2.0
1958 *
1959 * Unless required by applicable law or agreed to in writing, software
1960 * distributed under the License is distributed on an "AS IS" BASIS,
1961 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1962 * See the License for the specific language governing permissions and
1963 * limitations under the License.
1964 */const qT="�";function cN(t){let e="";for(let n=0;n<t.length;n++)e.length>0&&(e=iv(e)),e=hN(t.get(n),e);return iv(e)}function hN(t,e){let n=e;const r=t.length;for(let i=0;i<r;i++){const s=t.charAt(i);switch(s){case"\0":n+="��";break;case qT:n+="��";break;default:n+=s}}return n}function iv(t){return t+qT+"�"}/**
1965 * @license
1966 * Copyright 2017 Google LLC
1967 *
1968 * Licensed under the Apache License, Version 2.0 (the "License");
1969 * you may not use this file except in compliance with the License.
1970 * You may obtain a copy of the License at
1971 *
1972 *   http://www.apache.org/licenses/LICENSE-2.0
1973 *
1974 * Unless required by applicable law or agreed to in writing, software
1975 * distributed under the License is distributed on an "AS IS" BASIS,
1976 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1977 * See the License for the specific language governing permissions and
1978 * limitations under the License.
1979 */function sv(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Xr(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function dN(t,e){const n=[];for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.push(e(t[r],r,t));return n}function HT(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}/**
1980 * @license
1981 * Copyright 2017 Google LLC
1982 *
1983 * Licensed under the Apache License, Version 2.0 (the "License");
1984 * you may not use this file except in compliance with the License.
1985 * You may obtain a copy of the License at
1986 *
1987 *   http://www.apache.org/licenses/LICENSE-2.0
1988 *
1989 * Unless required by applicable law or agreed to in writing, software
1990 * distributed under the License is distributed on an "AS IS" BASIS,
1991 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1992 * See the License for the specific language governing permissions and
1993 * limitations under the License.
1994 */class Pe{constructor(e,n){this.comparator=e,this.root=n||Xe.EMPTY}insert(e,n){return new Pe(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,Xe.BLACK,null,
1994null))}remove(e){return new Pe(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Xe.BLACK,null,null))}get(e){let n=this.root;for(;!n.isEmpty();){const r=this.comparator(e,n.key);if(r===0)return n.value;r<0?n=n.left:r>0&&(n=n.right)}return null}indexOf(e){let n=0,r=this.root;for(;!r.isEmpty();){const i=this.comparator(e,r.key);if(i===0)return n+r.left.size;i<0?r=r.left:(n+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((n,r)=>(e(n,r),!1))}toString(){const e=[];return this.inorderTraversal((n,r)=>(e.push(`${n}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new xl(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new xl(this.root,e,this.comparator,!1)}getReverseIterator(){return new xl(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new xl(this.root,e,this.comparator,!0)}}class xl{constructor(e,n,r,i){this.isReverse=i,this.nodeStack=[];let s=1;for(;!e.isEmpty();)if(s=n?r(e.key,n):1,n&&i&&(s*=-1),s<0)e=this.isReverse?e.left:e.right;else{if(s===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const n={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return n}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Xe{constructor(e,n,r,i,s){this.key=e,this.value=n,this.color=r??Xe.RED,this.left=i??Xe.EMPTY,this.right=s??Xe.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,n,r,i,s){return new Xe(e??this.key,n??this.value,r??this.color,i??this.left,s??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,r){let i=this;const s=r(e,i.key);return i=s<0?i.copy(null,null,null,i.left.insert(e,n,r),null):s===0?i.copy(null,n,null,null,null):i.copy(null,null,null,null,i.right.insert(e,n,r)),i.fixUp()}removeMin(){if(this.left.isEmpty())return Xe.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,n){let r,i=this;if(n(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),n(e,i.key)===0){if(i.right.isEmpty())return Xe.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,Xe.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Xe.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Y(43730,{key:this.key,value:this.value});if(this.right.isRed())throw Y(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw Y(27949);return e+(this.isRed()?0:1)}}Xe.EMPTY=null,Xe.RED=!0,Xe.BLACK=!1;
1994Xe.EMPTY=new class{constructor(){this.size=0}get key(){throw Y(57766)}get value(){throw Y(16141)}get color(){throw Y(16727)}get left(){throw Y(29726)}get right(){throw Y(36894)}copy(e,n,r,i,s){return this}insert(e,n,r){return new Xe(e,n)}remove(e,n){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/**
1995 * @license
1996 * Copyright 2017 Google LLC
1997 *
1998 * Licensed under the Apache License, Version 2.0 (the "License");
1999 * you may not use this file except in compliance with the License.
2000 * You may obtain a copy of the License at
2001 *
2002 *   http://www.apache.org/licenses/LICENSE-2.0
2003 *
2004 * Unless required by applicable law or agreed to in writing, software
2005 * distributed under the License is distributed on an "AS IS" BASIS,
2006 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2007 * See the License for the specific language governing permissions and
2008 * limitations under the License.
2009 */class $e{constructor(e){this.comparator=e,this.data=new Pe(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((n,r)=>(e(n),!1))}forEachInRange(e,n){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const i=r.getNext();if(this.comparator(i.key,e[1])>=0)return;n(i.key)}}forEachWhile(e,n){let r;for(r=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null}getIterator(){return new ov(this.data.getIterator())}getIteratorFrom(e){return new ov(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let n=this;return n.size<e.size&&(n=e,e=this),e.forEach(r=>{n=n.add(r)}),n}isEqual(e){if(!(e instanceof $e)||this.size!==e.size)return!1;const n=this.data.getIterator(),r=e.data.getIterator();for(;n.hasNext();){const i=n.getNext().key,s=r.getNext().key;if(this.comparator(i,s)!==0)return!1}return!0}toArray(){const e=[];return this.forEach(n=>{e.push(n)}),e}toString(){const e=[];return this.forEach(n=>e.push(n)),"SortedSet("+e.toString()+")"}copy(e){const n=new $e(this.comparator);return n.data=e,n}}class ov{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/**
2010 * @license
2011 * Copyright 2020 Google LLC
2012 *
2013 * Licensed under the Apache License, Version 2.0 (the "License");
2014 * you may not use this file except in compliance with the License.
2015 * You may obtain a copy of the License at
2016 *
2017 *   http://www.apache.org/licenses/LICENSE-2.0
2018 *
2019 * Unless required by applicable law or agreed to in writing, software
2020 * distributed under the License is distributed on an "AS IS" BASIS,
2021 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2022 * See the License for the specific language governing permissions and
2023 * limitations under the License.
2024 */class Mt{constructor(e){this.fields=e,e.sort(Ye.comparator)}static empty(){return new Mt([])}unionWith(e){let n=new $e(Ye.comparator);for(const r of this.fields)n=n.add(r);for(const r of e)n=n.add(r);return new Mt(n.toArray())}covers(e){for(const n of this.fields)if(n.isPrefixOf(e))return!0;return!1}isEqual(e){return Is(this.fields,e.fields,(n,r)=>n.isEqual(r))}}/**
2025 * @license
2026 * Copyright 2023 Google LLC
2027 *
2028 * Licensed under the Apache License, Version 2.0 (the "License");
2029 * you may not use this file except in compliance with the License.
2030 * You may obtain a copy of the License at
2031 *
2032 *   http://www.apache.org/licenses/LICENSE-2.0
2033 *
2034 * Unless required by applicable law or agreed to in writing, software
2035 * distributed under the License is distributed on an "AS IS" BASIS,
2036 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2037 * See the License for the specific language governing permissions and
2038 * limitations under the License.
2039 */class GT extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/**
2040 * @license
2041 * Copyright 2020 Google LLC
2042 *
2043 * Licensed under the Apache License, Version 2.0 (the "License");
2044 * you may not use this file except in compliance with the License.
2045 * You may obtain a copy of the License at
2046 *
2047 *   http://www.apache.org/licenses/LICENSE-2.0
2048 *
2049 * Unless required by applicable law or agreed to in writing, software
2050 * distributed under the License is distributed on an "AS IS" BASIS,
2051 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2052 * See the License for the specific language governing permissions and
2053 * limitations under the License.
2054 */class tt{constructor(e){this.binaryString=e}static fromBase64String(e){const n=function(i){try{return atob(i)}catch(s){throw typeof DOMException<"u"&&s instanceof DOMException?new GT("Invalid base64 string: "+s):s}}(e);return new tt(n)}static fromUint8Array(e){const n=function(i){let s="";for(let o=0;o<i.length;++o)s+=String.fromCharCode(i[o]);return s}(e);return new tt(n)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return function(n){return btoa(n)}(this.binaryString)}toUint8Array(){return function(n){const r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return r}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return ne(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}tt.EMPTY_BYTE_STRING=new tt("");const fN=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function zr(t){if(ce(!!t,39018),typeof t=="string"){let e=0;const n=fN.exec(t);if(ce(!!n,46558,{timestamp:t}),n[1]){let i=n[1];i=(i+"000000000").substr(0,9),e=Number(i)}const r=new Date(t);return{seconds:Math.floor(r.getTime()/1e3),nanos:e}}return{seconds:Oe(t.seconds),nanos:Oe(t.nanos)}}function Oe(t){return typeof t=="number"?t:typeof t=="string"?Number(t):0}function $r(t){return typeof t=="string"?tt.fromBase64String(t):tt.fromUint8Array(t)}/**
2055 * @license
2056 * Copyright 2020 Google LLC
2057 *
2058 * Licensed under the Apache License, Version 2.0 (the "License");
2059 * you may not use this file except in compliance with the License.
2060 * You may obtain a copy of the License at
2061 *
2062 *   http://www.apache.org/licenses/LICENSE-2.0
2063 *
2064 * Unless required by applicable law or agreed to in writing, software
2065 * distributed under the License is distributed on an "AS IS" BASIS,
2066 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2067 * See the License for the specific language governing permissions and
2068 * limitations under the License.
2069 */const KT="server_timestamp",QT="__type__",XT="__previous_value__",YT="__local_write_time__";function hm(t){var e,n;return((n=(((e=t==null?void 0:t.mapValue)===null||e===void 0?void 0:e.fields)||{})[QT])===null||n===void 0?void 0:n.stringValue)===KT}function Bc(t){const e=t.mapValue.fields[XT];return hm(e)?Bc(e):e}function _a(t){const e=zr(t.mapValue.fields[YT].timestampValue);return new Ee(e.seconds,e.nanos)}/**
2070 * @license
2071 * Copyright 2017 Google LLC
2072 *
2073 * Licensed under the Apache License, Version 2.0 (the "License");
2074 * you may not use this file except in compliance with the License.
2075 * You may obtain a copy of the License at
2076 *
2077 *   http://www.apache.org/licenses/LICENSE-2.0
2078 *
2079 * Unless required by applicable law or agreed to in writing, software
2080 * distributed under the License is distributed on an "AS IS" BASIS,
2081 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2082 * See the License for the specific language governing permissions and
2083 * limitations under the License.
2084 */class pN{constructor(e,n,r,i,s,o,l,u,c,d){this.databaseId=e,this.appId=n,this.persistenceKey=r,this.host=i,this.ssl=s,this.forceLongPolling=o,this.autoDetectLongPolling=l,this.longPollingOptions=u,this.useFetchStreams=c,this.isUsingEmulator=d}}const Ju="(default)";class va{constructor(e,n){this.projectId=e,this.database=n||Ju}static empty(){return new va("","")}get isDefaultDatabase(){return this.database===Ju}isEqual(e){return e instanceof va&&e.projectId===this.projectId&&e.database===this.database}}/**
2085 * @license
2086 * Copyright 2020 Google LLC
2087 *
2088 * Licensed under the Apache License, Version 2.0 (the "License");
2089 * you may not use this file except in compliance with the License.
2090 * You may obtain a copy of the License at
2091 *
2092 *   http://www.apache.org/licenses/LICENSE-2.0
2093 *
2094 * Unless required by applicable law or agreed to in writing, software
2095 * distributed under the License is distributed on an "AS IS" BASIS,
2096 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2097 * See the License for the specific language governing permissions and
2098 * limitations under the License.
2099 */const JT="__type__",mN="__max__",bl={mapValue:{}},ZT="__vector__",Zu="value";function Br(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?hm(t)?4:yN(t)?9007199254740991:gN(t)?10:11:Y(28295,{value:t})}function Nn(t,e){if(t===e)return!0;const n=Br(t);if(n!==Br(e))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return _a(t).isEqual(_a(e));case 3:return function(i,s){if(typeof i.timestampValue=="string"&&typeof s.timestampValue=="string"&&i.timestampValue.length===s.timestampValue.length)return i.timestampValue===s.timestampValue;const o=zr(i.timestampValue),l=zr(s.timestampValue);return o.seconds===l.seconds&&o.nanos===l.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(i,s){return $r(i.bytesValue).isEqual($r(s.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(i,s){return Oe(i.geoPointValue.latitude)===Oe(s.geoPointValue.latitude)&&Oe(i.geoPointValue.longitude)===Oe(s.geoPointValue.longitude)}(t,e);case 2:return function(i,s){if("integerValue"in i&&"integerValue"in s)return Oe(i.integerValue)===Oe(s.integerValue);if("doubleValue"in i&&"doubleValue"in s){const o=Oe(i.doubleValue),l=Oe(s.doubleValue);return o===l?Yu(o)===Yu(l):isNaN(o)&&isNaN(l)}return!1}(t,e);case 9:return Is(t.arrayValue.values||[],e.arrayValue.values||[],Nn);case 10:case 11:return function(i,s){const o=i.mapValue.fields||{},l=s.mapValue.fields||{};if(sv(o)!==sv(l))return!1;for(const u in o)if(o.hasOwnProperty(u)&&(l[u]===void 0||!Nn(o[u],l[u])))return!1;return!0}(t,e);default:return Y(52216,{left:t})}}function Ea(t,e){return(t.values||[]).find(n=>Nn(n,e))!==void 0}function As(t,e){if(t===e)return 0;const n=Br(t),r=Br(e);if(n!==r)return ne(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return ne(t.booleanValue,e.booleanValue);case 2:return function(s,o){const l=Oe(s.integerValue||s.doubleValue),u=Oe(o.integerValue||o.doubleValue);return l<u?-1:l>u?1:l===u?0:isNaN(l)?isNaN(u)?0:-1:1}(t,e);case 3:return av(t.timestampValue,e.timestampValue);case 4:return av(_a(t),_a(e));case 5:return Rf(t.stringValue,e.stringValue);case 6:return function(s,o){const l=$r(s),u=$r(o);return l.compareTo(u)}(t.bytesValue,e.bytesValue);case 7:return function(s,o){const l=s.split("/"),u=o.split("/");for(let c=0;c<l.length&&c<u.length;c++){const d=ne(l[c],u[c]);if(d!==0)return d}return ne(l.length,u.length)}(t.referenceValue,e.referenceValue);case 8:return function(s,o){const l=ne(Oe(s.latitude),Oe(o.latitude));return l!==0?l:ne(Oe(s.longitude),Oe(o.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return lv(t.arrayValue,e.arrayValue);case 10:return function(s,o){var l,u,c,d;const p=s.fields||{},m=o.fields||{},v=(l=p[Zu])===null||l===void 0?void 0:l.arrayValue,w=(u=m[Zu])===null||u===void 0?void 0:u.arrayValue,P=ne(((c=v==null?void 0:v.values)===null||c===void 0?void 0:c.length)||0,((d=w==null?void 0:w.values)===null||d===void 0?void 0:d.length)||0);return P!==0?P:lv(v,w)}(t.mapValue,e.mapValue);case 11:return function(s,o){if(s===bl.mapValue&&o===bl.mapValue)return 0;if(s===bl.mapValue)return 1;if(o===bl.mapValue)return-1;const l=s.fields||{},u=Object.keys(l),c=o.fields||{},d=Object.keys(c);u.sort(),d.sort();for(let p=0;p<u.length&&p<d.length;++p){const m=Rf(u[p],d[p]);if(m!==0)return m;const v=As(l[u[p]],c[d[p]]);if(v!==0)return v}return ne(u.length,d.length)}(t.mapValue,e.mapValue);default:throw Y(23264,{le:n})}}function av(t,e){if(typeof t=="string"&&typeof e=="string"&&t.length===e.length)return ne(t,e);const n=zr(t),r=zr(e),i=ne(n.seconds,r.seconds);return i!==0?i:ne(n.nanos,r.nanos)}function lv(t,e){const n=t.values||[],r=e.values||[];for(let i=0;i<n.length&&i<r.length;++i){const s=As(n[i],r[i]);if(s)return s}return ne(n.length,r.length)}function Ss(t){return Cf(t)}function Cf(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(n){const r=zr(n);return`time(${r.seconds},${r.nanos})`}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?function(n){return $r(n).toBase64()}(t.bytesValue):"referenceValue"in t?function(n){return Q.fromName(n).toString()}(t.referenceValue):"geoPointValue"in t?function(n){return`geo(${n.latitude},${n.longitude})`}(t.geoPointValue):"arrayValue"in t?function(n){let r="[",i=!0;for(const s of n.values||[])i?i=!1:r+=",",r+=Cf(s);return r+"]"}(t.arrayValue):"mapValue"in t?function(n){const r=Object.keys(n.fields||{}).sort();let i="{",s=!0;for(const o of r)s?s=!1:i+=",",i+=`${o}:${Cf(n.fields[o])}`;return i+"}"}(t.mapValue):Y(61005,{value:t})}function nu(t){switch(Br(t)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const e=Bc(t);return e?16+nu(e):16;case 5:return 2*t.stringValue.length;case 6:return $r(t.bytesValue).approximateByteSize();case 7:return t.referenceValue.length;case 9:return function(r){return(r.values||[]).reduce((i,s)=>i+nu(s),0)}(t.arrayValue);case 10:case 11:return function(r){let i=0;return Xr(r.fields,(s,o)=>{i+=s.length+nu(o)}),i}(t.mapValue);default:throw Y(13486,{value:t})}}function uv(t,e){return{referenceValue:`projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`}}function Pf(t){return!!t&&"integerValue"in t}function dm(t){return!!t&&"arrayValue"in t}function cv(t){return!!t&&"nullValue"in t}function hv(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function ru(t){return!!t&&"mapValue"in t}function gN(t){var e,n;return((n=(((e=t==null?void 0:t.mapValue)===null||e===void 0?void 0:e.fields)||{})[JT])===null||n===void 0?void 0:n.stringValue)===ZT}function qo(t){if(t.geoPointValue)return{geoPointValue:Object.assign({},t.geoPointValue)};if(t.timestampValue&&typeof t.timestampValue=="object")return{timestampValue:Object.assign({},t.timestampValue)};if(t.mapValue){const e={mapValue:{fields:{}}};return Xr(t.mapValue.fields,(n,r)=>e.mapValue.fields[n]=qo(r)),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=qo(t.arrayValue.values[n]);return e}return Object.assign({},t)}function yN(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue===mN}/**
2100 * @license
2101 * Copyright 2017 Google LLC
2102 *
2103 * Licensed under the Apache License, Version 2.0 (the "License");
2104 * you may not use this file except in compliance with the License.
2105 * You may obtain a copy of the License at
2106 *
2107 *   http://www.apache.org/licenses/LICENSE-2.0
2108 *
2109 * Unless required by applicable law or agreed to in writing, software
2110 * distributed under the License is distributed on an "AS IS" BASIS,
2111 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2112 * See the License for the specific language governing permissions and
2113 * limitations under the License.
2114 */class Rt{constructor(e){this.value=e}static empty(){return new Rt({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let n=this.value;for(let r=0;r<e.length-1;++r)if(n=(n.mapValue.fields||{})[e.get(r)],!ru(n))return null;return n=(n.mapValue.fields||{})[e.lastSegment()],n||null}}set(e,n){this.getFieldsMap(e.popLast())[e.lastSegment()]=qo(n)}setAll(e){let n=Ye.emptyPath(),r={},i=[];e.forEach((o,l)=>{if(!n.isImmediateParentOf(l)){const u=this.getFieldsMap(n);this.applyChanges(u,r,i),r={},i=[],n=l.popLast()}o?r[l.lastSegment()]=qo(o):i.push(l.lastSegment())});const s=this.getFieldsMap(n);this.applyChanges(s,r,i)}delete(e){const n=this.field(e.popLast());ru(n)&&n.mapValue.fields&&delete n.mapValue.fields[e.lastSegment()]}isEqual(e){return Nn(this.value,e.value)}getFieldsMap(e){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let r=0;r<e.length;++r){let i=n.mapValue.fields[e.get(r)];ru(i)&&i.mapValue.fields||(i={mapValue:{fields:{}}},n.mapValue.fields[e.get(r)]=i),n=i}return n.mapValue.fields}applyChanges(e,n,r){Xr(n,(i,s)=>e[i]=s);for(const i of r)delete e[i]}clone(){return new Rt(qo(this.value))}}function eI(t){const e=[];return Xr(t.fields,(n,r)=>{const i=new Ye([n]);if(ru(r)){const s=eI(r.mapValue).fields;
2114if(s.length===0)e.push(i);else for(const o of s)e.push(i.child(o))}else e.push(i)}),new Mt(e)}/**
2115 * @license
2116 * Copyright 2017 Google LLC
2117 *
2118 * Licensed under the Apache License, Version 2.0 (the "License");
2119 * you may not use this file except in compliance with the License.
2120 * You may obtain a copy of the License at
2121 *
2122 *   http://www.apache.org/licenses/LICENSE-2.0
2123 *
2124 * Unless required by applicable law or agreed to in writing, software
2125 * distributed under the License is distributed on an "AS IS" BASIS,
2126 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2127 * See the License for the specific language governing permissions and
2128 * limitations under the License.
2129 */class ct{constructor(e,n,r,i,s,o,l){this.key=e,this.documentType=n,this.version=r,this.readTime=i,this.createTime=s,this.data=o,this.documentState=l}static newInvalidDocument(e){return new ct(e,0,ee.min(),ee.min(),ee.min(),Rt.empty(),0)}static newFoundDocument(e,n,r,i){return new ct(e,1,n,ee.min(),r,i,0)}static newNoDocument(e,n){return new ct(e,2,n,ee.min(),ee.min(),Rt.empty(),0)}static newUnknownDocument(e,n){return new ct(e,3,n,ee.min(),ee.min(),Rt.empty(),2)}convertToFoundDocument(e,n){return!this.createTime.isEqual(ee.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=n,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=Rt.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=Rt.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=ee.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof ct&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new ct(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}/**
2130 * @license
2131 * Copyright 2022 Google LLC
2132 *
2133 * Licensed under the Apache License, Version 2.0 (the "License");
2134 * you may not use this file except in compliance with the License.
2135 * You may obtain a copy of the License at
2136 *
2137 *   http://www.apache.org/licenses/LICENSE-2.0
2138 *
2139 * Unless required by applicable law or agreed to in writing, software
2140 * distributed under the License is distributed on an "AS IS" BASIS,
2141 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2142 * See the License for the specific language governing permissions and
2143 * limitations under the License.
2144 */class ec{constructor(e,n){this.position=e,this.inclusive=n}}function dv(t,e,n){let r=0;for(let i=0;i<t.position.length;i++){const s=e[i],o=t.position[i];if(s.field.isKeyField()?r=Q.comparator(Q.fromName(o.referenceValue),n.key):r=As(o,n.data.field(s.field)),s.dir==="desc"&&(r*=-1),r!==0)break}return r}function fv(t,e){if(t===null)return e===null;if(e===null||t.inclusive!==e.inclusive||t.position.length!==e.position.length)return!1;for(let n=0;n<t.position.length;n++)if(!Nn(t.position[n],e.position[n]))return!1;return!0}/**
2145 * @license
2146 * Copyright 2022 Google LLC
2147 *
2148 * Licensed under the Apache License, Version 2.0 (the "License");
2149 * you may not use this file except in compliance with the License.
2150 * You may obtain a copy of the License at
2151 *
2152 *   http://www.apache.org/licenses/LICENSE-2.0
2153 *
2154 * Unless required by applicable law or agreed to in writing, softw
2154are
2155 * distributed under the License is distributed on an "AS IS" BASIS,
2156 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2157 * See the License for the specific language governing permissions and
2158 * limitations under the License.
2159 */class wa{constructor(e,n="asc"){this.field=e,this.dir=n}}function _N(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}/**
2160 * @license
2161 * Copyright 2022 Google LLC
2162 *
2163 * Licensed under the Apache License, Version 2.0 (the "License");
2164 * you may not use this file except in compliance with the License.
2165 * You may obtain a copy of the License at
2166 *
2167 *   http://www.apache.org/licenses/LICENSE-2.0
2168 *
2169 * Unless required by applicable law or agreed to in writing, software
2170 * distributed under the License is distributed on an "AS IS" BASIS,
2171 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2172 * See the License for the specific language governing permissions and
2173 * limitations under the License.
2174 */class tI{}class Fe extends tI{constructor(e,n,r){super(),this.field=e,this.op=n,this.value=r}static create(e,n,r){return e.isKeyField()?n==="in"||n==="not-in"?this.createKeyFieldInFilter(e,n,r):new EN(e,n,r):n==="array-contains"?new IN(e,r):n==="in"?new AN(e,r):n==="not-in"?new SN(e,r):n==="array-contains-any"?new RN(e,r):new Fe(e,n,r)}static createKeyFieldInFilter(e,n,r){return n==="in"?new wN(e,r):new TN(e,r)}matches(e){const n=e.data.field(this.field);return this.op==="!="?n!==null&&n.nullValue===void 0&&this.matchesComparison(As(n,this.value)):n!==null&&Br(this.value)===Br(n)&&this.matchesComparison(As(n,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return Y(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class dn extends tI{constructor(e,n){super(),this.filters=e,this.op=n,this.he=null}static create(e,n){return new dn(e,n)}matches(e){return nI(this)?this.filters.find(n=>!n.matches(e))===void 0:this.filters.find(n=>n.matches(e))!==void 0}getFlattenedFilters(){return this.he!==null||(this.he=this.filters.reduce((e,n)=>e.concat(n.getFlattenedFilters()),[])),this.he}getFilters(){return Object.assign([],this.filters)}}function nI(t){return t.op==="and"}function rI(t){return vN(t)&&nI(t)}function vN(t){for(const e of t.filters)if(e instanceof dn)return!1;return!0}function kf(t){if(t instanceof Fe)return t.field.canonicalString()+t.op.toString()+Ss(t.value);if(rI(t))return t.filters.map(e=>kf(e)).join(",");{const e=t.filters.map(n=>kf(n)).join(",");return`${t.op}(${e})`}}function iI(t,e){return t instanceof Fe?function(r,i){return i instanceof Fe&&r.op===i.op&&r.field.isEqual(i.field)&&Nn(r.value,i.value)}(t,e):t instanceof dn?function(r,i){return i instanceof dn&&r.op===i.op&&r.filters.length===i.filters.length?r.filters.reduce((s,o,l)=>s&&iI(o,i.filters[l]),!0):!1}(t,e):void Y(19439)}function sI(t){return t instanceof Fe?function(n){return`${n.field.canonicalString()} ${n.op} ${Ss(n.value)}`}(t):t instanceof dn?function(n){return n.op.toString()+" {"+n.getFilters().map(sI).join(" ,")+"}"}(t):"Filter"}class EN extends Fe{constructor(e,n,r){super(e,n,r),this.key=Q.fromName(r.referenceValue)}matches(e){const n=Q.comparator(e.key,this.key);return this.matchesComparison(n)}}class wN extends Fe{constructor(e,n){super(e,"in",n),this.keys=oI("in",n)}matches(e){return this.keys.some(n=>n.isEqual(e.key))}}class TN extends Fe{constructor(e,n){super(e,"not-in",n),this.keys=oI("not-in",n)}matches(e){return!this.keys.some(n=>n.isEqual(e.key))}}function oI(t,e){var n;return(((n=e.arrayValue)===null||n===void 0?void 0:n.values)||[]).map(r=>Q.fromName(r.referenceValue))}class IN extends Fe{constructor(e,n){super(e,"array-contains",n)}matches(e){const n=e.data.field(this.field);return dm(n)&&Ea(n.arrayValue,this.value)}}class AN extends Fe{constructor(e,n){super(e,"in",n)}matches(e){const n=e.data.field(this.field);return n!==null&&Ea(this.value.arrayValue,n)}}class SN extends Fe{constructor(e,n){super(e,"not-in",n)}matches(e){if(Ea(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=e.data.field(this.field);return n!==null&&n.nullValue===void 0&&!Ea(this.value.arrayValue,n)}}class RN extends Fe{constructor(e,n){super(e,"array-contains-any",n)}matches(e){const n=e.data.field(this.field);return!(!dm(n)||!n.arrayValue.values)&&n.arrayValue.values.some(r=>Ea(this.value.arrayValue,r))}}/**
2175 * @license
2176 * Copyright 2019 Google LLC
2177 *
2178 * Licensed under the Apache License, Version 2.0 (the "License");
2179 * you may not use this file except in compliance with the License.
2180 * You may obtain a copy of the License at
2181 *
2182 *   http://www.apache.org/licenses/LICENSE-2.0
2183 *
2184 * Unless required by applicable law or agreed to in writing, software
2185 * distributed under the License is distributed on an "AS IS" BASIS,
2186 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2187 * See the License for the specific language governing permissions and
2188 * limitations under the License.
2189 */class CN{constructor(e,n=null,r=[],i=[],s=null,o=null,l=null){this.path=e,this.collectionGroup=n,this.orderBy=r,this.filters=i,this.limit=s,this.startAt=o,this.endAt=l,this.Pe=null}}function pv(t,e=null,n=[],r=[],i=null,s=null,o=null){return new CN(t,e,n,r,i,s,o)}function fm(t){const e=Z(t);if(e.Pe===null){let n=e.path.canonicalString();e.collectionGroup!==null&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map(r=>kf(r)).join(","),n+="|ob:",n+=e.orderBy.map(r=>function(s){return s.field.canonicalString()+s.dir}(r)).join(","),$c(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=e.startAt.inclusive?"b:":"a:",n+=e.startAt.position.map(r=>Ss(r)).join(",")),e.endAt&&(n+="|ub:",n+=e.endAt.inclusive?"a:":"b:",n+=e.endAt.position.map(r=>Ss(r)).join(",")),e.Pe=n}return e.Pe}function pm(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n<t.orderBy.length;n++)if(!_N(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(let n=0;n<t.filters.length;n++)if(!iI(t.filters[n],e.filters[n]))return!1;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!fv(t.startAt,e.startAt)&&fv(t.endAt,e.endAt)}function xf(t){return Q.isDocumentKey(t.path)&&t.collectionGroup===null&&t.filters.length===0}/**
2190 * @license
2191 * Copyright 2017 Google LLC
2192 *
2193 * Licensed under the Apache License, Version 2.0 (the "License");
2194 * you may not use this file except in compliance with the License.
2195 * You may obtain a copy of the License at
2196 *
2197 *   http://www.apache.org/licenses/LICENSE-2.0
2198 *
2199 * Unless required by applicable law or agreed to in writing, software
2200 * distributed under the License is distributed on an "AS IS" BASIS,
2201 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2202 * See the License for the specific language governing permissions and
2203 * limitations under the License.
2204 */class Pi{constructor(e,n=null,r=[],i=[],s=null,o="F",l=null,u=null){this.path=e,this.collectionGroup=n,this.explicitOrderBy=r,this.filters=i,this.limit=s,this.limitType=o,this.startAt=l,this.endAt=u,this.Te=null,this.Ie=null,this.de=null,this.startAt,this.endAt}}function PN(t,e,n,r,i,s,o,l){return new Pi(t,e,n,r,i,s,o,l)}function Wc(t){return new Pi(t)}function mv(t){return t.filters.length===0&&t.limit===null&&t.startAt==null&&t.endAt==null&&(t.explicitOrderBy.length===0||t.explicitOrderBy.length===1&&t.explicitOrderBy[0].field.isKeyField())}function aI(t){return t.collectionGroup!==null}function Ho(t){const e=Z(t);if(e.Te===null){e.Te=[];const n=new Set;for(const s of e.explicitOrderBy)e.Te.push(s),n.add(s.field.canonicalString());const r=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let l=new $e(Ye.comparator);return o.filters.forEach(u=>{u.getFlattenedFilters().forEach(c=>{c.isInequality()&&(l=l.add(c.field))})}),l})(e).forEach(s=>{n.has(s.canonicalString())||s.isKeyField()||e.Te.push(new wa(s,r))}),n.has(Ye.keyField().canonicalString())||e.Te.push(new wa(Ye.keyField(),r))}return e.Te}function Cn(t){const e=Z(t);return e.Ie||(e.Ie=lI(e,Ho(t))),e.Ie}function kN(t){const e=Z(t);return e.de||(e.de=lI(e,t.explicitOrderBy)),e.de}function lI(t,e){if(t.limitType==="F")return pv(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(i=>{const s=i.dir==="desc"?"asc":"desc";return new wa(i.field,s)});const n=t.endAt?new ec(t.endAt.position,t.endAt.inclusive):null,r=t.startAt?new ec(t.startAt.position,t.startAt.inclusive):null;return pv(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}}function bf(t,e){const n=t.filters.concat([e]);return new Pi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}function tc(t,e,n){return new Pi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function qc(t,e){return pm(Cn(t),Cn(e))&&t.limitType===e.limitType}function uI(t){return`${fm(Cn(t))}|lt:${t.limitType}`}function Bi(t){return`Query(target=${function(n){let r=n.path.canonicalString();return n.collectionGroup!==null&&(r+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(r+=`, filters: [${n.filters.map(i=>sI(i)).join(", ")}]`),$c(n.limit)||(r+=", limit: "+n.limit),n.orderBy.length>0&&(r+=`, orderBy: [${n.orderBy.map(i=>function(o){return`${o.field.canonicalString()} (${o.dir})`}(i)).join(", ")}]`),n.startAt&&(r+=", startAt: ",r+=n.startAt.inclusive?"b:":"a:",r+=n.startAt.position.map(i=>Ss(i)).join(",")),n.endAt&&(r+=", endAt: ",r+=n.endAt.inclusive?"a:":"b:",r+=n.endAt.position.map(i=>Ss(i)).join(",")),`Target(${r})`}(Cn(t))}; limitType=${t.limitType})`}function Hc(t,e){return e.isFoundDocument()&&function(r,i){const s=i.key.path;return r.collectionGroup!==null?i.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(s):Q.isDocumentKey(r.path)?r.path.isEqual(s):r.path.isImmediateParentOf(s)}(t,e)&&function(r,i){for(const s of Ho(r))if(!s.field.isKeyField()&&i.data.field(s.field)===null)return!1;return!0}(t,e)&&function(r,i){for(const s of r.filters)if(!s.matches(i))return!1;return!0}(t,e)&&function(r,i){return!(r.startAt&&!function(o,l,u){const c=dv(o,l,u);return o.inclusive?c<=0:c<0}(r.startAt,Ho(r),i)||r.endAt&&!function(o,l,u){const c=dv(o,l,u);return o.inclusive?c>=0:c>0}(r.endAt,Ho(r),i))}(t,e)}function xN(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function cI(t){return(e,n)=>{let r=!1;for(const i of Ho(t)){const s=bN(i,e,n);if(s!==0)return s;r=r||i.field.isKeyField()}return 0}}function bN(t,e,n){const r=t.field.isKeyField()?Q.comparator(e.key,n.key):function(s,o,l){const u=o.data.field(s),c=l.data.field(s);return u!==null&&c!==null?As(u,c):Y(42886)}
2204(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return Y(19790,{direction:t.dir})}}/**
2205 * @license
2206 * Copyright 2017 Google LLC
2207 *
2208 * Licensed under the Apache License, Version 2.0 (the "License");
2209 * you may not use this file except in compliance with the License.
2210 * You may obtain a copy of the License at
2211 *
2212 *   http://www.apache.org/licenses/LICENSE-2.0
2213 *
2214 * Unless required by applicable law or agreed to in writing, software
2215 * distributed under the License is distributed on an "AS IS" BASIS,
2216 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2217 * See the License for the specific language governing permissions and
2218 * limitations under the License.
2219 */class ki{constructor(e,n){this.mapKeyFn=e,this.equalsFn=n,this.inner={},this.innerSize=0}get(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r!==void 0){for(const[i,s]of r)if(this.equalsFn(i,e))return s}}has(e){return this.get(e)!==void 0}set(e,n){const r=this.mapKeyFn(e),i=this.inner[r];if(i===void 0)return this.inner[r]=[[e,n]],void this.innerSize++;for(let s=0;s<i.length;s++)if(this.equalsFn(i[s][0],e))return void(i[s]=[e,n]);i.push([e,n]),this.innerSize++}delete(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r===void 0)return!1;for(let i=0;i<r.length;i++)if(this.equalsFn(r[i][0],e))return r.length===1?delete this.inner[n]:r.splice(i,1),this.innerSize--,!0;return!1}forEach(e){Xr(this.inner,(n,r)=>{for(const[i,s]of r)e(i,s)})}isEmpty(){return HT(this.inner)}size(){return this.innerSize}}/**
2220 * @license
2221 * Copyright 2017 Google LLC
2222 *
2223 * Licensed under the Apache License, Version 2.0 (the "License");
2224 * you may not use this file except in compliance with the License.
2225 * You may obtain a copy of the License at
2226 *
2227 *   http://www.apache.org/licenses/LICENSE-2.0
2228 *
2229 * Unless required by applicable law or agreed to in writing, software
2230 * distributed under the License is distributed on an "AS IS" BASIS,
2231 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2232 * See the License for the specific language governing permissions and
2233 * limitations under the License.
2234 */const NN=new Pe(Q.comparator);function Jn(){return NN}const hI=new Pe(Q.comparator);function xo(...t){let e=hI;for(const n of t)e=e.insert(n.key,n);return e}function dI(t){let e=hI;return t.forEach((n,r)=>e=e.insert(n,r.overlayedDocument)),e}function li(){return Go()}function fI(){return Go()}function Go(){return new ki(t=>t.toString(),(t,e)=>t.isEqual(e))}const DN=new Pe(Q.comparator),ON=new $e(Q.comparator);function se(...t){let e=ON;for(const n of t)e=e.add(n);return e}const VN=new $e(ne);function LN(){return VN}/**
2235 * @license
2236 * Copyright 2020 Google LLC
2237 *
2238 * Licensed under the Apache License, Version 2.0 (the "License");
2239 * you may not use this file except in compliance with the License.
2240 * You may obtain a copy of the License at
2241 *
2242 *   http://www.apache.org/licenses/LICENSE-2.0
2243 *
2244 * Unless required by applicable law or agreed to in writing, software
2245 * distributed under the License is distributed on an "AS IS" BASIS,
2246 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2247 * See the License for the specific language governing permissions and
2248 * limitations under the License.
2249 */function mm(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Yu(e)?"-0":e}}function pI(t){return{integerValue:""+t}}function mI(t,e){return uN(e)?pI(e):mm(t,e)}/**
2250 * @license
2251 * Copyright 2018 Google LLC
2252 *
2253 * Licensed under the Apache License, Version 2.0 (the "License");
2254 * you may not use this file except in compliance with the License.
2255 * You may obtain a copy of the License at
2256 *
2257 *   http://www.apache.org/licenses/LICENSE-2.0
2258 *
2259 * Unless required by applicable law or agreed to in writing, software
2260 * distributed under the License is distributed on an "AS IS" BASIS,
2261 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2262 * See the License for the specific language governing permissions and
2263 * limitations under the License.
2264 */class Gc{constructor(){this._=void 0}}function MN(t,e,n){return t instanceof Ta?function(i,s){const o={fields:{[QT]:{stringValue:KT},[YT]:{timestampValue:{seconds:i.seconds,nanos:i.nanoseconds}}}};return s&&hm(s)&&(s=Bc(s)),s&&(o.fields[XT]=s),{mapValue:o}}(n,e):t instanceof Rs?yI(t,e):t instanceof Ia?_I(t,e):function(i,s){const o=gI(i,s),l=gv(o)+gv(i.Ee);
2264return Pf(o)&&Pf(i.Ee)?pI(l):mm(i.serializer,l)}(t,e)}function FN(t,e,n){return t instanceof Rs?yI(t,e):t instanceof Ia?_I(t,e):n}function gI(t,e){return t instanceof Aa?function(r){return Pf(r)||function(s){return!!s&&"doubleValue"in s}(r)}(e)?e:{integerValue:0}:null}class Ta extends Gc{}class Rs extends Gc{constructor(e){super(),this.elements=e}}function yI(t,e){const n=vI(e);for(const r of t.elements)n.some(i=>Nn(i,r))||n.push(r);return{arrayValue:{values:n}}}class Ia extends Gc{constructor(e){super(),this.elements=e}}function _I(t,e){let n=vI(e);for(const r of t.elements)n=n.filter(i=>!Nn(i,r));return{arrayValue:{values:n}}}class Aa extends Gc{constructor(e,n){super(),this.serializer=e,this.Ee=n}}function gv(t){return Oe(t.integerValue||t.doubleValue)}function vI(t){return dm(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}/**
2265 * @license
2266 * Copyright 2017 Google LLC
2267 *
2268 * Licensed under the Apache License, Version 2.0 (the "License");
2269 * you may not use this file except in compliance with the License.
2270 * You may obtain a copy of the License at
2271 *
2272 *   http://www.apache.org/licenses/LICENSE-2.0
2273 *
2274 * Unless required by applicable law or agreed to in writing, software
2275 * distributed under the License is distributed on an "AS IS" BASIS,
2276 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2277 * See the License for the specific language governing permissions and
2278 * limitations under the License.
2279 */class gm{constructor(e,n){this.field=e,this.transform=n}}function UN(t,e){return t.field.isEqual(e.field)&&function(r,i){return r instanceof Rs&&i instanceof Rs||r instanceof Ia&&i instanceof Ia?Is(r.elements,i.elements,Nn):r instanceof Aa&&i instanceof Aa?Nn(r.Ee,i.Ee):r instanceof Ta&&i instanceof Ta}(t.transform,e.transform)}class jN{constructor(e,n){this.version=e,this.transformResults=n}}class _t{constructor(e,n){this.updateTime=e,this.exists=n}static none(){return new _t}static exists(e){return new _t(void 0,e)}static updateTime(e){return new _t(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function iu(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}class Kc{}function EI(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new Qc(t.key,_t.none()):new Fa(t.key,t.data,_t.none());{const n=t.data,r=Rt.empty();let i=new $e(Ye.comparator);for(let s of e.fields)if(!i.has(s)){let o=n.field(s);o===null&&s.length>1&&(s=s.popLast(),o=n.field(s)),o===null?r.delete(s):r.set(s,o),i=i.add(s)}return new Yr(t.key,r,new Mt(i.toArray()),_t.none())}}function zN(t,e,n){t instanceof Fa?function(i,s,o){const l=i.value.clone(),u=_v(i.fieldTransforms,s,o.transformResults);l.setAll(u),s.convertToFoundDocument(o.version,l).setHasCommittedMutations()}(t,e,n):t instanceof Yr?function(i,s,o){if(!iu(i.precondition,s))return void s.convertToUnknownDocument(o.version);const l=_v(i.fieldTransforms,s,o.transformResults),u=s.data;u.setAll(wI(i)),u.setAll(l),s.convertToFoundDocument(o.version,u).setHasCommittedMutations()}(t,e,n):function(i,s,o){s.convertToNoDocument(o.version).setHasCommittedMutations()}(0,e,n)}function Ko(t,e,n,r){return t instanceof Fa?function(s,o,l,u){if(!iu(s.precondition,o))return l;const c=s.value.clone(),d=vv(s.fieldTransforms,u,o);return c.setAll(d),o.convertToFoundDocument(o.version,c).setHasLocalMutations(),null}(t,e,n,r):t instanceof Yr?function(s,o,l,u){if(!iu(s.precondition,o))return l;const c=vv(s.fieldTransforms,u,o),d=o.data;return d.setAll(wI(s)),d.setAll(c),o.convertToFoundDocument(o.version,d).setHasLocalMutations(),l===null?null:l.unionWith(s.fieldMask.fields).unionWith(s.fieldTransforms.map(p=>p.field))}(t,e,n,r):function(s,o,l){return iu(s.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):l}(t,e,n)}function $N(t,e){let n=null;for(const r of t.fieldTransforms){const i=e.data.field(r.field),s=gI(r.transform,i||null);s!=null&&(n===null&&(n=Rt.empty()),n.set(r.field,s))}return n||null}function yv(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(r,i){return r===void 0&&i===void 0||!(!r||!i)&&Is(r,i,(s,o)=>UN(s,o))}(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class Fa extends Kc{constructor(e,n,r,i=[]){super(),this.key=e,this.value=n,this.prec
2279ondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class Yr extends Kc{constructor(e,n,r,i,s=[]){super(),this.key=e,this.data=n,this.fieldMask=r,this.precondition=i,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function wI(t){const e=new Map;return t.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=t.data.field(n);e.set(n,r)}}),e}function _v(t,e,n){const r=new Map;ce(t.length===n.length,32656,{Ae:n.length,Re:t.length});for(let i=0;i<n.length;i++){const s=t[i],o=s.transform,l=e.data.field(s.field);r.set(s.field,FN(o,l,n[i]))}return r}function vv(t,e,n){const r=new Map;for(const i of t){const s=i.transform,o=n.data.field(i.field);r.set(i.field,MN(s,o,e))}return r}class Qc extends Kc{constructor(e,n){super(),this.key=e,this.precondition=n,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class BN extends Kc{constructor(e,n){super(),this.key=e,this.precondition=n,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}/**
2280 * @license
2281 * Copyright 2017 Google LLC
2282 *
2283 * Licensed under the Apache License, Version 2.0 (the "License");
2284 * you may not use this file except in compliance with the License.
2285 * You may obtain a copy of the License at
2286 *
2287 *   http://www.apache.org/licenses/LICENSE-2.0
2288 *
2289 * Unless required by applicable law or agreed to in writing, software
2290 * distributed under the License is distributed on an "AS IS" BASIS,
2291 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2292 * See the License for the specific language governing permissions and
2293 * limitations under the License.
2294 */class WN{constructor(e,n,r,i){this.batchId=e,this.localWriteTime=n,this.baseMutations=r,this.mutations=i}applyToRemoteDocument(e,n){const r=n.mutationResults;for(let i=0;i<this.mutations.length;i++){const s=this.mutations[i];s.key.isEqual(e.key)&&zN(s,e,r[i])}}applyToLocalView(e,n){for(const r of this.baseMutations)r.key.isEqual(e.key)&&(n=Ko(r,e,n,this.localWriteTime));for(const r of this.mutations)r.key.isEqual(e.key)&&(n=Ko(r,e,n,this.localWriteTime));return n}applyToLocalDocumentSet(e,n){const r=fI();return this.mutations.forEach(i=>{const s=e.get(i.key),o=s.overlayedDocument;let l=this.applyToLocalView(o,s.mutatedFields);l=n.has(i.key)?null:l;const u=EI(o,l);u!==null&&r.set(i.key,u),o.isValidDocument()||o.convertToNoDocument(ee.min())}),r}keys(){return this.mutations.reduce((e,n)=>e.add(n.key),se())}isEqual(e){return this.batchId===e.batchId&&Is(this.mutations,e.mutations,(n,r)=>yv(n,r))&&Is(this.baseMutations,e.baseMutations,(n,r)=>yv(n,r))}}class ym{constructor(e,n,r,i){this.batch=e,this.commitVersion=n,this.mutationResults=r,this.docVersions=i}static from(e,n,r){ce(e.mutations.length===r.length,58842,{Ve:e.mutations.length,me:r.length});let i=function(){return DN}();const s=e.mutations;for(let o=0;o<s.length;o++)i=i.insert(s[o].key,r[o].version);return new ym(e,n,r,i)}}/**
2295 * @license
2296 * Copyright 2022 Google LLC
2297 *
2298 * Licensed under the Apache License, Version 2.0 (the "License");
2299 * you may not use this file except in compliance with the License.
2300 * You may obtain a copy of the License at
2301 *
2302 *   http://www.apache.org/licenses/LICENSE-2.0
2303 *
2304 * Unless required by applicable law or agreed to in writing, software
2305 * distributed under the License is distributed on an "AS IS" BASIS,
2306 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2307 * See the License for the specific language governing permissions and
2308 * limitations under the License.
2309 */class qN{constructor(e,n){this.largestBatchId=e,this.mutation=n}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{
2310      largestBatchId: ${this.largestBatchId},
2311      mutation: ${this.mutation.toString()}
2312    }`}}/**
2313 * @license
2314 * Copyright 2023 Google LLC
2315 *
2316 * Licensed under the Apache License, Version 2.0 (the "License");
2317 * you may not use this file except in compliance with the License.
2318 * You may obtain a copy of the License at
2319 *
2320 *   http://www.apache.org/licenses/LICENSE-2.0
2321 *
2322 * Unless required by applicable law or agreed to in writing, softw
2322are
2323 * distributed under the License is distributed on an "AS IS" BASIS,
2324 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2325 * See the License for the specific language governing permissions and
2326 * limitations under the License.
2327 */class HN{constructor(e,n,r){this.alias=e,this.aggregateType=n,this.fieldPath=r}}/**
2328 * @license
2329 * Copyright 2017 Google LLC
2330 *
2331 * Licensed under the Apache License, Version 2.0 (the "License");
2332 * you may not use this file except in compliance with the License.
2333 * You may obtain a copy of the License at
2334 *
2335 *   http://www.apache.org/licenses/LICENSE-2.0
2336 *
2337 * Unless required by applicable law or agreed to in writing, software
2338 * distributed under the License is distributed on an "AS IS" BASIS,
2339 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2340 * See the License for the specific language governing permissions and
2341 * limitations under the License.
2342 */class GN{constructor(e,n){this.count=e,this.unchangedNames=n}}/**
2343 * @license
2344 * Copyright 2017 Google LLC
2345 *
2346 * Licensed under the Apache License, Version 2.0 (the "License");
2347 * you may not use this file except in compliance with the License.
2348 * You may obtain a copy of the License at
2349 *
2350 *   http://www.apache.org/licenses/LICENSE-2.0
2351 *
2352 * Unless required by applicable law or agreed to in writing, software
2353 * distributed under the License is distributed on an "AS IS" BASIS,
2354 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2355 * See the License for the specific language governing permissions and
2356 * limitations under the License.
2357 */var Le,ae;function KN(t){switch(t){case L.OK:return Y(64938);case L.CANCELLED:case L.UNKNOWN:case L.DEADLINE_EXCEEDED:case L.RESOURCE_EXHAUSTED:case L.INTERNAL:case L.UNAVAILABLE:case L.UNAUTHENTICATED:return!1;case L.INVALID_ARGUMENT:case L.NOT_FOUND:case L.ALREADY_EXISTS:case L.PERMISSION_DENIED:case L.FAILED_PRECONDITION:case L.ABORTED:case L.OUT_OF_RANGE:case L.UNIMPLEMENTED:case L.DATA_LOSS:return!0;default:return Y(15467,{code:t})}}function TI(t){if(t===void 0)return Yn("GRPC error has no .code"),L.UNKNOWN;switch(t){case Le.OK:return L.OK;case Le.CANCELLED:return L.CANCELLED;case Le.UNKNOWN:return L.UNKNOWN;case Le.DEADLINE_EXCEEDED:return L.DEADLINE_EXCEEDED;case Le.RESOURCE_EXHAUSTED:return L.RESOURCE_EXHAUSTED;case Le.INTERNAL:return L.INTERNAL;case Le.UNAVAILABLE:return L.UNAVAILABLE;case Le.UNAUTHENTICATED:return L.UNAUTHENTICATED;case Le.INVALID_ARGUMENT:return L.INVALID_ARGUMENT;case Le.NOT_FOUND:return L.NOT_FOUND;case Le.ALREADY_EXISTS:return L.ALREADY_EXISTS;case Le.PERMISSION_DENIED:return L.PERMISSION_DENIED;case Le.FAILED_PRECONDITION:return L.FAILED_PRECONDITION;case Le.ABORTED:return L.ABORTED;case Le.OUT_OF_RANGE:return L.OUT_OF_RANGE;case Le.UNIMPLEMENTED:return L.UNIMPLEMENTED;case Le.DATA_LOSS:return L.DATA_LOSS;default:return Y(39323,{code:t})}}(ae=Le||(Le={}))[ae.OK=0]="OK",ae[ae.CANCELLED=1]="CANCELLED",ae[ae.UNKNOWN=2]="UNKNOWN",ae[ae.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",ae[ae.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",ae[ae.NOT_FOUND=5]="NOT_FOUND",ae[ae.ALREADY_EXISTS=6]="ALREADY_EXISTS",ae[ae.PERMISSION_DENIED=7]="PERMISSION_DENIED",ae[ae.UNAUTHENTICATED=16]="UNAUTHENTICATED",ae[ae.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",ae[ae.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",ae[ae.ABORTED=10]="ABORTED",ae[ae.OUT_OF_RANGE=11]="OUT_OF_RANGE",ae[ae.UNIMPLEMENTED=12]="UNIMPLEMENTED",ae[ae.INTERNAL=13]="INTERNAL",ae[ae.UNAVAILABLE=14]="UNAVAILABLE",ae[ae.DATA_LOSS=15]="DATA_LOSS";/**
2358 * @license
2359 * Copyright 2022 Google LLC
2360 *
2361 * Licensed under the Apache License, Version 2.0 (the "License");
2362 * you may not use this file except in compliance with the License.
2363 * You may obtain a copy of the License at
2364 *
2365 *   http://www.apache.org/licenses/LICENSE-2.0
2366 *
2367 * Unless required by applicable law or agreed to in writing, software
2368 * distributed under the License is distributed on an "AS IS" BASIS,
2369 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2370 * See the License for the specific language governing permissions and
2371 * limitations under the License.
2372 */const QN=new Or([4294967295,4294967295],0);function Ev(t){const e=BT().encode(t),n=new VT;return n.update(e),new Uint8Array(n.digest())}function wv(t){const e=new DataView(t.buffer),n=e.getUint32(0,!0),r=e.getUint32(4,!0),i=e.getUint32(8,!0),s=e.getUint32(12,!0);return[new Or([n,r],0),new Or([i,s],0)]}class _m{constructor(e,n,r){if(this.bitmap=e,this.padding=n,this.hashCount=r,n<0||n>=8)throw new bo(`Invalid padding: ${n}`);if(r<0)throw new bo(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new bo(`Invalid hash count: ${r}`);if(e.length===0&&n!==0)throw new bo(`Invalid padding when bitmap length is 0: ${n}`);this.fe=8*e.length-n,this.ge=Or.fromNumber(this.fe)}pe(e,n,r){let i=e.add(n.multiply(Or.fromNumber(r)));return i.compare(QN)===1&&(i=new Or([i.getBits(0),i.getBits(1)],0)),i.modulo(this.ge).toNumber()}ye(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(this.fe===0)return!1;const n=Ev(e),[r,i]=wv(n);for(let s=0;s<this.hashCount;s++){const o=this.pe(r,i,s);if(!this.ye(o))return!1}return!0}static create(e,n,r){const i=e%8==0?0:8-e%8,s=new Uint8Array(Math.ceil(e/8)),o=new _m(s,i,n);return r.forEach(l=>o.insert(l)),o}insert(e){if(this.fe===0)return;const n=Ev(e),[r,i]=wv(n);for(let s=0;s<this.hashCount;s++){const o=this.pe(r,i,s);this.we(o)}}we(e){const n=Math.floor(e/8),r=e%8;this.bitmap[n]|=1<<r}}
2372class bo extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}/**
2373 * @license
2374 * Copyright 2017 Google LLC
2375 *
2376 * Licensed under the Apache License, Version 2.0 (the "License");
2377 * you may not use this file except in compliance with the License.
2378 * You may obtain a copy of the License at
2379 *
2380 *   http://www.apache.org/licenses/LICENSE-2.0
2381 *
2382 * Unless required by applicable law or agreed to in writing, software
2383 * distributed under the License is distributed on an "AS IS" BASIS,
2384 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2385 * See the License for the specific language governing permissions and
2386 * limitations under the License.
2387 */class Xc{constructor(e,n,r,i,s){this.snapshotVersion=e,this.targetChanges=n,this.targetMismatches=r,this.documentUpdates=i,this.resolvedLimboDocuments=s}static createSynthesizedRemoteEventForCurrentChange(e,n,r){const i=new Map;return i.set(e,Ua.createSynthesizedTargetChangeForCurrentChange(e,n,r)),new Xc(ee.min(),i,new Pe(ne),Jn(),se())}}class Ua{constructor(e,n,r,i,s){this.resumeToken=e,this.current=n,this.addedDocuments=r,this.modifiedDocuments=i,this.removedDocuments=s}static createSynthesizedTargetChangeForCurrentChange(e,n,r){return new Ua(r,n,se(),se(),se())}}/**
2388 * @license
2389 * Copyright 2017 Google LLC
2390 *
2391 * Licensed under the Apache License, Version 2.0 (the "License");
2392 * you may not use this file except in compliance with the License.
2393 * You may obtain a copy of the License at
2394 *
2395 *   http://www.apache.org/licenses/LICENSE-2.0
2396 *
2397 * Unless required by applicable law or agreed to in writing, software
2398 * distributed under the License is distributed on an "AS IS" BASIS,
2399 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2400 * See the License for the specific language governing permissions and
2401 * limitations under the License.
2402 */class su{constructor(e,n,r,i){this.Se=e,this.removedTargetIds=n,this.key=r,this.be=i}}class II{constructor(e,n){this.targetId=e,this.De=n}}class AI{constructor(e,n,r=tt.EMPTY_BYTE_STRING,i=null){this.state=e,this.targetIds=n,this.resumeToken=r,this.cause=i}}class Tv{constructor(){this.ve=0,this.Ce=Iv(),this.Fe=tt.EMPTY_BYTE_STRING,this.Me=!1,this.xe=!0}get current(){return this.Me}get resumeToken(){return this.Fe}get Oe(){return this.ve!==0}get Ne(){return this.xe}Be(e){e.approximateByteSize()>0&&(this.xe=!0,this.Fe=e)}Le(){let e=se(),n=se(),r=se();return this.Ce.forEach((i,s)=>{switch(s){case 0:e=e.add(i);break;case 2:n=n.add(i);break;case 1:r=r.add(i);break;default:Y(38017,{changeType:s})}}),new Ua(this.Fe,this.Me,e,n,r)}ke(){this.xe=!1,this.Ce=Iv()}qe(e,n){this.xe=!0,this.Ce=this.Ce.insert(e,n)}Qe(e){this.xe=!0,this.Ce=this.Ce.remove(e)}$e(){this.ve+=1}Ue(){this.ve-=1,ce(this.ve>=0,3241,{ve:this.ve})}Ke(){this.xe=!0,this.Me=!0}}class XN{constructor(e){this.We=e,this.Ge=new Map,this.ze=Jn(),this.je=Nl(),this.Je=Nl(),this.He=new Pe(ne)}Ye(e){for(const n of e.Se)e.be&&e.be.isFoundDocument()?this.Ze(n,e.be):this.Xe(n,e.key,e.be);for(const n of e.removedTargetIds)this.Xe(n,e.key,e.be)}et(e){this.forEachTarget(e,n=>{const r=this.tt(n);switch(e.state){case 0:this.nt(n)&&r.Be(e.resumeToken);break;case 1:r.Ue(),r.Oe||r.ke(),r.Be(e.resumeToken);break;case 2:r.Ue(),r.Oe||this.removeTarget(n);break;case 3:this.nt(n)&&(r.Ke(),r.Be(e.resumeToken));break;case 4:this.nt(n)&&(this.rt(n),r.Be(e.resumeToken));break;default:Y(56790,{state:e.state})}})}forEachTarget(e,n){e.targetIds.length>0?e.targetIds.forEach(n):this.Ge.forEach((r,i)=>{this.nt(i)&&n(i)})}it(e){const n=e.targetId,r=e.De.count,i=this.st(n);if(i){const s=i.target;if(xf(s))if(r===0){const o=new Q(s.path);this.Xe(n,o,ct.newNoDocument(o,ee.min()))}else ce(r===1,20013,{expectedCount:r});else{const o=this.ot(n);if(o!==r){const l=this._t(e),u=l?this.ut(l,e,o):1;if(u!==0){this.rt(n);const c=u===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.He=this.He.insert(n,c)}}}}}_t(e){const n=e.De.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:r="",padding:i=0},hashCount:s=0}=n;let o,l;try{o=$r(r).toUint8Array()}catch(u){if(u instanceof GT)return Ur("Decoding the base64 bloom filter in existence filter failed ("+u.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw u}try{l=new _m(o,i,s)}catch(u){return Ur(u instanceof bo?"BloomFilter error: ":"Applying bloom filter failed: ",u),null}return l.fe===0?null:l}ut(e,n,r){return n.De.count===r-this.ht(e,n.targetId)?0:2}ht(e,n){const r=this.We.getRemoteKeysForTarget(n);let i=0;return r.forEach(s=>{const o=this.We.lt(),l=`projects/${o.projectId}/databases/${o.database}/documents/${s.path.canonicalString()}`;e.mightContain(l)||(this.Xe(n,s,null),i++)}),i}Pt(e){const n=new Map;this.Ge.forEach((s,o)=>{const l=this.st(o);if(l){if(s.current&&xf(l.target)){const u=new Q(l.target.path);this.Tt(u).has(o)||this.It(o,u)||this.Xe(o,u,ct.newNoDocument(u,e))}s.Ne&&(n.set(o,s.Le()),s.ke())}});let r=se();this.Je.forEach((s,o)=>{let l=!0;o.forEachWhile(u=>{const c=this.st(u);return!c||c.purpose==="TargetPurposeLimboResolution"||(l=!1,!1)}),l&&(r=r.add(s))}),this.ze.forEach((s,o)=>o.setReadTime(e));const i=new Xc(e,n,this.He,this.ze,r);return this.ze=Jn(),this.je=Nl(),this.Je=Nl(),this.He=new Pe(ne),i}Ze(e,n){if(!this.nt(e))return;const r=this.It(e,n.key)?2:0;this.tt(e).qe(n.key,r),this.ze=this.ze.insert(n.key,n),this.je=this.je.insert(n.key,this.Tt(n.key).add(e)),this.Je=this.Je.insert(n.key,this.dt(n.key).add(e))}Xe(e,n,r){if(!this.nt(e))return;const i=this.tt(e);this.It(e,n)?i.qe(n,1):i.Qe(n),this.Je=this.Je.insert(n,this.dt(n).delete(e)),this.Je=this.Je.insert(n,this.dt(n).add(e)),r&&(this.ze=this.ze.insert(n,r))}removeTarget(e){this.Ge.delete(e)}ot(e){const n=this.tt(e).Le();return this.We.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size}$e(e){this.tt(e).$e()}tt(e){let n=this.Ge.get(e);return n||(n=new Tv,this.Ge.set(e,n)),n}dt(e){let n=this.Je.get(e);return n||(n=new $e(ne),this.Je=this.Je.insert(e,n)),n}Tt(e){let n=this.je.get(e);return n||(n=new $e(ne),this.je=this.je.insert(e,n)),n}nt(e){const n=this.st(e)!==null;return n||H("WatchChangeAggregator","Detected inactive target",e),n}st(e){const n=this.Ge.get(e);return n&&n.Oe?null:this.We.Et(e)}rt(e){this.Ge.set(e,new Tv),this.We.getRemoteKeysForTarget(e).forEach(n=>{this.Xe(e,n,null)})}It(e,n){return this.We.getRemoteKeysForTarget(e).has(n)}}function Nl(){return new Pe(Q.comparator)}function Iv(){return new Pe(Q.comparator)}const YN={asc:"ASCENDING",desc:"DESCENDING"},JN={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},ZN={and:"AND",or:"OR"};class e2{constructor(e,n){this.databaseId=e,this.useProto3Json=n}}function Nf(t,e){return t.useProto3Json||$c(e)?e:{value:e}}function nc(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function SI(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function t2(t,e){return nc(t,e.toTimestamp())}function Pn(t){return ce(!!t,49232),ee.fromTimestamp(function(n){const r=zr(n);return new Ee(r.seconds,r.nanos)}(t))}function vm(t,e){return Df(t,e).canonicalString()}function Df(t,e){const n=function(i){return new ge(["projects",i.projectId,"databases",i.database])}(t).child("documents");return e===void 0?n:n.child(e)}function RI(t){const e=ge.fromString(t);return ce(NI(e),10190,{key:e.toString()}),e}function Of(t,e){return vm(t.databaseId,e.path)}function ld(t,e){const n=RI(e);if(n.get(1)!==t.databaseId.projectId)throw new B(L.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new B(L.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new Q(PI(n))}function CI(t,e){return vm(t.databaseId,e)}function n2(t){const e=RI(t);return e.length===4?ge.emptyPath():PI(e)}function Vf(t){return new ge(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function PI(t){return ce(t.length>4&&t.get(4)==="documents",29091,{key:t.toString()}),t.popFirst(5)}function Av(t,e,n){return{name:Of(t,e),fields:n.value.mapValue.fields}}function r2(t,e){let n;if("targetChange"in e){e.targetChange;const r=function(c){return c==="NO_CHANGE"?0:c==="ADD"?1:c==="REMOVE"?2:c==="CURRENT"?3:c==="RESET"?4:Y(39313,{state:c})}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],s=function(c,d){return c.useProto3Json?(ce(d===void 0||typeof d=="str
2402ing",58123),tt.fromBase64String(d||"")):(ce(d===void 0||d instanceof Buffer||d instanceof Uint8Array,16193),tt.fromUint8Array(d||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,l=o&&function(c){const d=c.code===void 0?L.UNKNOWN:TI(c.code);return new B(d,c.message||"")}(o);n=new AI(r,i,s,l||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const i=ld(t,r.document.name),s=Pn(r.document.updateTime),o=r.document.createTime?Pn(r.document.createTime):ee.min(),l=new Rt({mapValue:{fields:r.document.fields}}),u=ct.newFoundDocument(i,s,o,l),c=r.targetIds||[],d=r.removedTargetIds||[];n=new su(c,d,u.key,u)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const i=ld(t,r.document),s=r.readTime?Pn(r.readTime):ee.min(),o=ct.newNoDocument(i,s),l=r.removedTargetIds||[];n=new su([],l,o.key,o)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const i=ld(t,r.document),s=r.removedTargetIds||[];n=new su([],s,i,null)}else{if(!("filter"in e))return Y(11601,{At:e});{e.filter;const r=e.filter;r.targetId;const{count:i=0,unchangedNames:s}=r,o=new GN(i,s),l=r.targetId;n=new II(l,o)}}return n}function i2(t,e){let n;if(e instanceof Fa)n={update:Av(t,e.key,e.value)};else if(e instanceof Qc)n={delete:Of(t,e.key)};else if(e instanceof Yr)n={update:Av(t,e.key,e.data),updateMask:f2(e.fieldMask)};else{if(!(e instanceof BN))return Y(16599,{Rt:e.type});n={verify:Of(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map(r=>function(s,o){const l=o.transform;if(l instanceof Ta)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(l instanceof Rs)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:l.elements}};if(l instanceof Ia)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:l.elements}};if(l instanceof Aa)return{fieldPath:o.field.canonicalString(),increment:l.Ee};throw Y(20930,{transform:o.transform})}(0,r))),e.precondition.isNone||(n.currentDocument=function(i,s){return s.updateTime!==void 0?{updateTime:t2(i,s.updateTime)}:s.exists!==void 0?{exists:s.exists}:Y(27497)}(t,e.precondition)),n}function s2(t,e){return t&&t.length>0?(ce(e!==void 0,14353),t.map(n=>function(i,s){let o=i.updateTime?Pn(i.updateTime):Pn(s);return o.isEqual(ee.min())&&(o=Pn(s)),new jN(o,i.transformResults||[])}(n,e))):[]}function o2(t,e){return{documents:[CI(t,e.path)]}}function kI(t,e){const n={structuredQuery:{}},r=e.path;let i;e.collectionGroup!==null?(i=r,n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(i=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=CI(t,i);const s=function(c){if(c.length!==0)return bI(dn.create(c,"and"))}(e.filters);s&&(n.structuredQuery.where=s);const o=function(c){if(c.length!==0)return c.map(d=>function(m){return{field:yr(m.field),direction:c2(m.dir)}}(d))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);const l=Nf(t,e.limit);return l!==null&&(n.structuredQuery.limit=l),e.startAt&&(n.structuredQuery.startAt=function(c){return{before:c.inclusive,values:c.position}}(e.startAt)),e.endAt&&(n.structuredQuery.endAt=function(c){return{before:!c.inclusive,values:c.position}}(e.endAt)),{Vt:n,parent:i}}function a2(t,e,n,r){const{Vt:i,parent:s}=kI(t,e),o={},l=[];let u=0;return n.forEach(c=>{const d="aggregate_"+u++;o[d]=c.alias,c.aggregateType==="count"?l.push({alias:d,count:{}}):c.aggregateType==="avg"?l.push({alias:d,avg:{field:yr(c.fieldPath)}}):c.aggregateType==="sum"&&l.push({alias:d,sum:{field:yr(c.fieldPath)}})}),{request:{structuredAggregationQuery:{aggregations:l,structuredQuery:i.structuredQuery},parent:i.parent},ft:o,parent:s}}function l2(t){let e=n2(t.parent);const n=t.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){ce(r===1,65062);const d=n.from[0];d.allDescendants?i=d.collectionId:e=e.child(d.collectionId)}let s=[];n.where&&(s=function(p){const m=xI(p);return m instanceof dn&&rI(m)?m.getFilters():[m]}(n.where));let o=[];n.orderBy&&(o=function(p){return p.map(m=>function(w){return new wa(Wi(w.field),function(C){switch(C){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(w.direction))}(m))}(n.orderBy));let l=null;n.limit&&(l=function(p){let m;return m=typeof p=="object"?p.value:p,$c(m)?null:m}(n.limit));let u=null;n.startAt&&(u=function(p){const m=!!p.before,v=p.values||[];return new ec(v,m)}(n.startAt));let c=null;return n.endAt&&(c=function(p){const m=!p.before,v=p.values||[];return new ec(v,m)}(n.endAt)),PN(e,i,o,s,l,"F",u,c)}function u2(t,e){const n=function(i){switch(i){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return Y(28987,{purpose:i})}}(e.purpose);return n==null?null:{"goog-listen-tags":n}}function xI(t){return t.unaryFilter!==void 0?function(n){switch(n.unaryFilter.op){case"IS_NAN":const r=Wi(n.unaryFilter.field);return Fe.create(r,"==",{doubleValue:NaN});case"IS_NULL":const i=Wi(n.unaryFilter.field);return Fe.create(i,"==",{nullValue:"NULL_VALUE"});
2402case"IS_NOT_NAN":const s=Wi(n.unaryFilter.field);return Fe.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=Wi(n.unaryFilter.field);return Fe.create(o,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return Y(61313);default:return Y(60726)}}(t):t.fieldFilter!==void 0?function(n){return Fe.create(Wi(n.fieldFilter.field),function(i){switch(i){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return Y(58110);default:return Y(50506)}}(n.fieldFilter.op),n.fieldFilter.value)}(t):t.compositeFilter!==void 0?function(n){return dn.create(n.compositeFilter.filters.map(r=>xI(r)),function(i){switch(i){case"AND":return"and";case"OR":return"or";default:return Y(1026)}}(n.compositeFilter.op))}(t):Y(30097,{filter:t})}function c2(t){return YN[t]}function h2(t){return JN[t]}function d2(t){return ZN[t]}function yr(t){return{fieldPath:t.canonicalString()}}function Wi(t){return Ye.fromServerFormat(t.fieldPath)}function bI(t){return t instanceof Fe?function(n){if(n.op==="=="){if(hv(n.value))return{unaryFilter:{field:yr(n.field),op:"IS_NAN"}};if(cv(n.value))return{unaryFilter:{field:yr(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(hv(n.value))return{unaryFilter:{field:yr(n.field),op:"IS_NOT_NAN"}};if(cv(n.value))return{unaryFilter:{field:yr(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:yr(n.field),op:h2(n.op),value:n.value}}}(t):t instanceof dn?function(n){const r=n.getFilters().map(i=>bI(i));return r.length===1?r[0]:{compositeFilter:{op:d2(n.op),filters:r}}}(t):Y(54877,{filter:t})}function f2(t){const e=[];return t.fields.forEach(n=>e.push(n.canonicalString())),{fieldPaths:e}}function NI(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}/**
2403 * @license
2404 * Copyright 2017 Google LLC
2405 *
2406 * Licensed under the Apache License, Version 2.0 (the "License");
2407 * you may not use this file except in compliance with the License.
2408 * You may obtain a copy of the License at
2409 *
2410 *   http://www.apache.org/licenses/LICENSE-2.0
2411 *
2412 * Unless required by applicable law or agreed to in writing, software
2413 * distributed under the License is distributed on an "AS IS" BASIS,
2414 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2415 * See the License for the specific language governing permissions and
2416 * limitations under the License.
2417 */class Tr{constructor(e,n,r,i,s=ee.min(),o=ee.min(),l=tt.EMPTY_BYTE_STRING,u=null){this.target=e,this.targetId=n,this.purpose=r,this.sequenceNumber=i,this.snapshotVersion=s,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=l,this.expectedCount=u}withSequenceNumber(e){return new Tr(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,n){return new Tr(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Tr(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Tr(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/**
2418 * @license
2419 * Copyright 2017 Google LLC
2420 *
2421 * Licensed under the Apache License, Version 2.0 (the "License");
2422 * you may not use this file except in compliance with the License.
2423 * You may obtain a copy of the License at
2424 *
2425 *   http://www.apache.org/licenses/LICENSE-2.0
2426 *
2427 * Unless required by applicable law or agreed to in writing, software
2428 * distributed under the License is distributed on an "AS IS" BASIS,
2429 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2430 * See the License for the specific language governing permissions and
2431 * limitations under the License.
2432 */class p2{constructor(e){this.gt=e}}function m2(t){const e=l2({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?tc(e,e.limit,"L"):e}/**
2433 * @license
2434 * Copyright 2019 Google LLC
2435 *
2436 * Licensed under the Apache License, Version 2.0 (the "License");
2437 * you may not use this file except in compliance with the License.
2438 * You may obtain a copy of the License at
2439 *
2440 *   http://www.apache.org/licenses/LICENSE-2.0
2441 *
2442 * Unless required by applicable law or agreed to in writing, software
2443 * distributed under the License is distributed on an "AS IS" BASIS,
2444 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2445 * See the License for the specific language governing permissions and
2446 * limitations under the License.
2447 */class g2{constructor(){this.Dn=new y2}addToCollectionParentIndex(e,n){return this.Dn.add(n),M.resolve()}getCollectionParents(e,n){return M.resolve(this.Dn.getEntries(n))}addFieldIndex(e,n){return M.resolve()}deleteFieldIndex(e,n){return M.resolve()}deleteAllFieldIndexes(e){return M.resolve()}createTargetIndexes(e,n){return M.resolve()}getDocumentsMatchingTarget(e,n){return M.resolve(null)}getIndexType(e,n){return M.resolve(0)}getFieldIndexes(e,n){return M.resolve([])}getNextCollectionGroupToUpdate(e){return M.resolve(null)}getMinOffset(e,n){return M.resolve(jr.min())}getMinOffsetFromCollectionGroup(e,n){return M.resolve(jr.min())}updateCollectionGroup(e,n,r){return M.resolve()}updateIndexEntries(e,n){return M.resolve()}}class y2{constructor(){this.index={}}add(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n]||new $e(ge.comparator),s=!i.has(r);return this.index[n]=i.add(r),s}has(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n];return i&&i.has(r)}getEntries(e){return(this.index[e]||new $e(ge.comparator)).toArray()}}/**
2448 * @license
2449 * Copyright 2018 Google LLC
2450 *
2451 * Licensed under the Apache License, Version 2.0 (the "License");
2452 * you may not use this file except in compliance with the License.
2453 * You may obtain a copy of the License at
2454 *
2455 *   http://www.apache.org/licenses/LICENSE-2.0
2456 *
2457 * Unless required by applicable law or agreed to in writing, software
2458 * distributed under the License is distributed on an "AS IS" BASIS,
2459 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2460 * See the License for the specific language governing permissions and
2461 * limitations under the License.
2462 */const Sv={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},DI=41943040;class It{static withCacheSize(e){return new It(e,It.DEFAULT_COLLECTION_PERCENTILE,It.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,n,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=n,this.maximumSequenceNumbersToCollect=r}}/**
2463 * @license
2464 * Copyright 2017 Google LLC
2465 *
2466 * Licensed under the Apache License, Version 2.0 (the "License");
2467 * you may not use this file except in compliance with the License.
2468 * You may obtain a copy of the License at
2469 *
2470 *   http://www.apache.org/licenses/LICENSE-2.0
2471 *
2472 * Unless required by applicable law or agreed to in writing, software
2473 * distributed under the License is distributed on an "AS IS" BASIS,
2474 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2475 * See the License for the specific language governing permissions and
2476 * limitations under the License.
2477 */It.DEFAULT_COLLECTION_PERCENTILE=10,It.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,It.DEFAULT=new It(DI,It.DEFAULT_COLLECTION_PERCENTILE,It.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),It.DISABLED=new It(-1,0,0);/**
2478 * @license
2479 * Copyright 2017 Google LLC
2480 *
2481 * Licensed under the Apache License, Version 2.0 (the "License");
2482 * you may not use this file except in compliance with the License.
2483 * You may obtain a copy of the License at
2484 *
2485 *   http://www.apache.org/licenses/LICENSE-2.0
2486 *
2487 * Unless required by applicable law or agreed to in writing, software
2488 * distributed under the License is distributed on an "AS IS" BASIS,
2489 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2490 * See the License for the specific language governing permissions and
2491 * limitations under the License.
2492 */class Cs{constructor(e){this._r=e}next(){return this._r+=2,this._r}static ar(){return new Cs(0)}static ur(){return new Cs(-1)}}/**
2493 * @license
2494 * Copyright 2020 Google LLC
2495 *
2496 * Licensed under the Apache License, Version 2.0 (the "License");
2497 * you may not use this file except in compliance with the License.
2498 * You may obtain a copy of the License at
2499 *
2500 *   http://www.apache.org/licenses/LICENSE-2.0
2501 *
2502 * Unless required by applicable law or agreed to in writing, software
2503 * distributed under the License is distributed on an "AS IS" BASIS,
2504 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2505 * See the License for the specific language governing permissions and
2506 * limitations under the License.
2507 */const Rv="LruGarbageCollector",_2=1048576;function Cv([t,e],[n,r]){const i=ne(t,n);return i===0?ne(e,r):i}class v2{constructor(e){this.Tr=e,this.buffer=new $e(Cv),this.Ir=0}dr(){return++this.Ir}Er(e){const n=[e,this.dr()];if(this.buffer.size<this.Tr)this.buffer=this.buffer.add(n);else{const r=this.buffer.last();Cv(n,r)<0&&(this.buffer=this.buffer.delete(r).add(n))}}get maxValue(){return this.buffer.last()[0]}}class E2{constructor(e,n,r){this.garbageCollector=e,this.asyncQueue=n,this.localStore=r,this.Ar=null}start(){this.garbageCollector.params.cacheSizeCollectionThreshold!==-1&&this.Rr(6e4)}stop(){this.Ar&&(this.Ar.cancel(),this.Ar=null)}get started(){return this.Ar!==null}Rr(e){H(Rv,`Garbage collection scheduled in ${e}ms`),this.Ar=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,async()=>{this.Ar=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(n){$s(n)?H(Rv,"Ignoring IndexedDB error during garbage collection: ",n):await zs(n)}await this.Rr(3e5)})}}class w2{constructor(e,n){this.Vr=e,this.params=n}calculateTargetCount(e,n){return this.Vr.mr(e).next(r=>Math.floor(n/100*r))}nthSequenceNumber(e,n){if(n===0)return M.resolve(zc.ue);const r=new v2(n);return this.Vr.forEachTarget(e,i=>r.Er(i.sequenceNumber)).next(()=>this.Vr.gr(e,i=>r.Er(i))).next(()=>r.maxValue)}removeTargets(e,n,r){return this.Vr.removeTargets(e,n,r)}removeOrphanedDocuments(e,n){return this.Vr.removeOrphanedDocuments(e,n)}collect(e,n){return this.params.cacheSizeCollectionThreshold===-1?(H("LruGarbageCollector","Garbage collection skipped; disabled"),M.resolve(Sv)):this.getCacheSize(e).next(r=>r<this.params.cacheSizeCollectionThreshold?(H("LruGarbageCollector",`Garbage collection skipped; Cache size ${r} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),Sv):this.pr(e,n))}getCacheSize(e){return this.Vr.getCacheSize(e)}pr(e,n){let r,i,s,o,l,u,c;const d=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(p=>(p>this.params.maximumSequenceNumbersToCollect?(H("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${p}`),i=this.params.maximumSequenceNumbersToCollect):i=p,o=Date.now(),this.nthSequenceNumber(e,i))).next(p=>(r=p,l=Date.now(),this.removeTargets(e,r,n))).next(p=>(s=p,u=Date.now(),this.removeOrphanedDocuments(e,r))).next(p=>(c=Date.now(),$i()<=ie.DEBUG&&H("LruGarbageCollector",`LRU Garbage Collection
2508	Counted targets in ${o-d}ms
2509	Determined least recently used ${i} in `+(l-o)+`ms
2510	Removed ${s} targets in `+(u-l)+`ms
2511	Removed ${p} documents in `+(c-u)+`ms
2512Total Duration: ${c-d}ms`),M.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:s,documentsRemoved:p})))}}function T2(t,e){return new w2(t,e)}/**
2513 * @license
2514 * Copyright 2017 Google LLC
2515 *
2516 * Licensed under the Apache License, Version 2.0 (the "License");
2517 * you may not use this file except in compliance with the License.
2518 * You may obtain a copy of the License at
2519 *
2520 *   http://www.apache.org/licenses/LICENSE-2.0
2521 *
2522 * Unless required by applicable law or agreed to in writing, software
2523 * distributed under the License is distributed on an "AS IS" BASIS,
2524 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2525 * See the License for the specific language governing permissions and
2526 * limitations under the License.
2527 */class I2{constructor(){this.changes=new ki(e=>e.toString(),(e,n)=>e.isEqual(n)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,n){this.assertNotApplied(),this.changes.set(e,ct.newInvalidDocument(e).setReadTime(n))}getEntry(e,n){this.assertNotApplied();const r=this.changes.get(n);return r!==void 0?M.resolve(r):this.getFromCache(e,n)}getEntries(e,n){return this.getAllFromCache(e,n)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}
2527assertNotApplied(){}}/**
2528 * @license
2529 * Copyright 2017 Google LLC
2530 *
2531 * Licensed under the Apache License, Version 2.0 (the "License");
2532 * you may not use this file except in compliance with the License.
2533 * You may obtain a copy of the License at
2534 *
2535 *   http://www.apache.org/licenses/LICENSE-2.0
2536 *
2537 * Unless required by applicable law or agreed to in writing, software
2538 * distributed under the License is distributed on an "AS IS" BASIS,
2539 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2540 * See the License for the specific language governing permissions and
2541 * limitations under the License.
2542 *//**
2543 * @license
2544 * Copyright 2022 Google LLC
2545 *
2546 * Licensed under the Apache License, Version 2.0 (the "License");
2547 * you may not use this file except in compliance with the License.
2548 * You may obtain a copy of the License at
2549 *
2550 *   http://www.apache.org/licenses/LICENSE-2.0
2551 *
2552 * Unless required by applicable law or agreed to in writing, software
2553 * distributed under the License is distributed on an "AS IS" BASIS,
2554 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2555 * See the License for the specific language governing permissions and
2556 * limitations under the License.
2557 */class A2{constructor(e,n){this.overlayedDocument=e,this.mutatedFields=n}}/**
2558 * @license
2559 * Copyright 2017 Google LLC
2560 *
2561 * Licensed under the Apache License, Version 2.0 (the "License");
2562 * you may not use this file except in compliance with the License.
2563 * You may obtain a copy of the License at
2564 *
2565 *   http://www.apache.org/licenses/LICENSE-2.0
2566 *
2567 * Unless required by applicable law or agreed to in writing, software
2568 * distributed under the License is distributed on an "AS IS" BASIS,
2569 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2570 * See the License for the specific language governing permissions and
2571 * limitations under the License.
2572 */class S2{constructor(e,n,r,i){this.remoteDocumentCache=e,this.mutationQueue=n,this.documentOverlayCache=r,this.indexManager=i}getDocument(e,n){let r=null;return this.documentOverlayCache.getOverlay(e,n).next(i=>(r=i,this.remoteDocumentCache.getEntry(e,n))).next(i=>(r!==null&&Ko(r.mutation,i,Mt.empty(),Ee.now()),i))}getDocuments(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.getLocalViewOfDocuments(e,r,se()).next(()=>r))}getLocalViewOfDocuments(e,n,r=se()){const i=li();return this.populateOverlays(e,i,n).next(()=>this.computeViews(e,n,i,r).next(s=>{let o=xo();return s.forEach((l,u)=>{o=o.insert(l,u.overlayedDocument)}),o}))}getOverlayedDocuments(e,n){const r=li();return this.populateOverlays(e,r,n).next(()=>this.computeViews(e,n,r,se()))}populateOverlays(e,n,r){const i=[];return r.forEach(s=>{n.has(s)||i.push(s)}),this.documentOverlayCache.getOverlays(e,i).next(s=>{s.forEach((o,l)=>{n.set(o,l)})})}computeViews(e,n,r,i){let s=Jn();const o=Go(),l=function(){return Go()}();return n.forEach((u,c)=>{const d=r.get(c.key);i.has(c.key)&&(d===void 0||d.mutation instanceof Yr)?s=s.insert(c.key,c):d!==void 0?(o.set(c.key,d.mutation.getFieldMask()),Ko(d.mutation,c,d.mutation.getFieldMask(),Ee.now())):o.set(c.key,Mt.empty())}),this.recalculateAndSaveOverlays(e,s).next(u=>(u.forEach((c,d)=>o.set(c,d)),n.forEach((c,d)=>{var p;return l.set(c,new A2(d,(p=o.get(c))!==null&&p!==void 0?p:null))}),l))}recalculateAndSaveOverlays(e,n){const r=Go();let i=new Pe((o,l)=>o-l),s=se();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,n).next(o=>{for(const l of o)l.keys().forEach(u=>{const c=n.get(u);if(c===null)return;let d=r.get(u)||Mt.empty();d=l.applyToLocalView(c,d),r.set(u,d);const p=(i.get(l.batchId)||se()).add(u);i=i.insert(l.batchId,p)})}).next(()=>{const o=[],l=i.getReverseIterator();for(;l.hasNext();){const u=l.getNext(),c=u.key,d=u.value,p=fI();d.forEach(m=>{if(!s.has(m)){const v=EI(n.get(m),r.get(m));v!==null&&p.set(m,v),s=s.add(m)}}),o.push(this.documentOverlayCache.saveOverlays(e,c,p))}return M.waitFor(o)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,n,r,i){return function(o){return Q.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0}(n)?this.getDocumentsMatchingDocumentQuery(e,n.path):aI(n)?this.getDocumentsMatchingCollectionGroupQuery(e,n,r,i):this.getDocumentsMatchingCollectionQuery(e,n,r,i)}getNextDocuments(e,n,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,n,r,i).next(s=>{const o=i-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,n,r.largestBatchId,i-s.size):M.resolve(li());let l=ya,u=s;return o.next(c=>
2572M.forEach(c,(d,p)=>(l<p.largestBatchId&&(l=p.largestBatchId),s.get(d)?M.resolve():this.remoteDocumentCache.getEntry(e,d).next(m=>{u=u.insert(d,m)}))).next(()=>this.populateOverlays(e,c,s)).next(()=>this.computeViews(e,u,c,se())).next(d=>({batchId:l,changes:dI(d)})))})}getDocumentsMatchingDocumentQuery(e,n){return this.getDocument(e,new Q(n)).next(r=>{let i=xo();return r.isFoundDocument()&&(i=i.insert(r.key,r)),i})}getDocumentsMatchingCollectionGroupQuery(e,n,r,i){const s=n.collectionGroup;let o=xo();return this.indexManager.getCollectionParents(e,s).next(l=>M.forEach(l,u=>{const c=function(p,m){return new Pi(m,null,p.explicitOrderBy.slice(),p.filters.slice(),p.limit,p.limitType,p.startAt,p.endAt)}(n,u.child(s));return this.getDocumentsMatchingCollectionQuery(e,c,r,i).next(d=>{d.forEach((p,m)=>{o=o.insert(p,m)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(e,n,r,i){let s;return this.documentOverlayCache.getOverlaysForCollection(e,n.path,r.largestBatchId).next(o=>(s=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,n,r,s,i))).next(o=>{s.forEach((u,c)=>{const d=c.getKey();o.get(d)===null&&(o=o.insert(d,ct.newInvalidDocument(d)))});let l=xo();return o.forEach((u,c)=>{const d=s.get(u);d!==void 0&&Ko(d.mutation,c,Mt.empty(),Ee.now()),Hc(n,c)&&(l=l.insert(u,c))}),l})}}/**
2573 * @license
2574 * Copyright 2020 Google LLC
2575 *
2576 * Licensed under the Apache License, Version 2.0 (the "License");
2577 * you may not use this file except in compliance with the License.
2578 * You may obtain a copy of the License at
2579 *
2580 *   http://www.apache.org/licenses/LICENSE-2.0
2581 *
2582 * Unless required by applicable law or agreed to in writing, software
2583 * distributed under the License is distributed on an "AS IS" BASIS,
2584 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2585 * See the License for the specific language governing permissions and
2586 * limitations under the License.
2587 */class R2{constructor(e){this.serializer=e,this.Br=new Map,this.Lr=new Map}getBundleMetadata(e,n){return M.resolve(this.Br.get(n))}saveBundleMetadata(e,n){return this.Br.set(n.id,function(i){return{id:i.id,version:i.version,createTime:Pn(i.createTime)}}(n)),M.resolve()}getNamedQuery(e,n){return M.resolve(this.Lr.get(n))}saveNamedQuery(e,n){return this.Lr.set(n.name,function(i){return{name:i.name,query:m2(i.bundledQuery),readTime:Pn(i.readTime)}}(n)),M.resolve()}}/**
2588 * @license
2589 * Copyright 2022 Google LLC
2590 *
2591 * Licensed under the Apache License, Version 2.0 (the "License");
2592 * you may not use this file except in compliance with the License.
2593 * You may obtain a copy of the License at
2594 *
2595 *   http://www.apache.org/licenses/LICENSE-2.0
2596 *
2597 * Unless required by applicable law or agreed to in writing, software
2598 * distributed under the License is distributed on an "AS IS" BASIS,
2599 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2600 * See the License for the specific language governing permissions and
2601 * limitations under the License.
2602 */class C2{constructor(){this.overlays=new Pe(Q.comparator),this.kr=new Map}getOverlay(e,n){return M.resolve(this.overlays.get(n))}getOverlays(e,n){const r=li();return M.forEach(n,i=>this.getOverlay(e,i).next(s=>{s!==null&&r.set(i,s)})).next(()=>r)}saveOverlays(e,n,r){return r.forEach((i,s)=>{this.wt(e,n,s)}),M.resolve()}removeOverlaysForBatchId(e,n,r){const i=this.kr.get(r);return i!==void 0&&(i.forEach(s=>this.overlays=this.overlays.remove(s)),this.kr.delete(r)),M.resolve()}getOverlaysForCollection(e,n,r){const i=li(),s=n.length+1,o=new Q(n.child("")),l=this.overlays.getIteratorFrom(o);for(;l.hasNext();){const u=l.getNext().value,c=u.getKey();if(!n.isPrefixOf(c.path))break;c.path.length===s&&u.largestBatchId>r&&i.set(u.getKey(),u)}return M.resolve(i)}getOverlaysForCollectionGroup(e,n,r,i){let s=new Pe((c,d)=>c-d);const o=this.overlays.getIterator();for(;o.hasNext();){const c=o.getNext().value;if(c.getKey().getCollectionGroup()===n&&c.largestBatchId>r){let d=s.get(c.largestBatchId);d===null&&(d=li(),s=s.insert(c.largestBatchId,d)),d.set(c.getKey(),c)}}const l=li(),u=s.getIterator();for(;u.hasNext()&&(u.getNext().value.forEach((c,d)=>l.set(c,d)),!(l.size()>=i)););return M.resolve(l)}wt(e,n,r){const i=this.overlays.get(r.key);if(i!==null){const o=this.kr.get(i.largestBatchId).delete(r.key);this.kr.set(i.largestBatchId,o)}this.overlays=this.overlays.insert(r.key,new qN(n,r));let s=this.kr.get(n);s===void 0&&(s=se(),this.kr.set(n,s)),this.kr.set(n,s.add(r.key))}}/**
2603 * @license
2604 * Copyright 2024 Google LLC
2605 *
2606 * Licensed under the Apache License, Version 2.0 (the "License");
2607 * you may not use this file except in compliance with the License.
2608 * You may obtain a copy of the License at
2609 *
2610 *   http://www.apache.org/licenses/LICENSE-2.0
2611 *
2612 * Unless required by applicable law or agreed to in writing, software
2613 * distributed under the License is distributed on an "AS IS" BASIS,
2614 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2615 * See the License for the specific language governing permissions and
2616 * limitations under the License.
2617 */class P2{constructor(){this.sessionToken=tt.EMPTY_BYTE_STRING}getSessionToken(e){return M.resolve(this.sessionToken)}setSessionToken(e,n){return this.sessionToken=n,M.resolve()}}/**
2618 * @license
2619 * Copyright 2017 Google LLC
2620 *
2621 * Licensed under the Apache License, Version 2.0 (the "License");
2622 * you may not use this file except in compliance with the License.
2623 * You may obtain a copy of the License at
2624 *
2625 *   http://www.apache.org/licenses/LICENSE-2.0
2626 *
2627 * Unless required by applicable law or agreed to in writing, software
2628 * distributed under the License is distributed on an "AS IS" BASIS,
2629 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2630 * See the License for the specific language governing permissions and
2631 * limitations under the License.
2632 */class Em{constructor(){this.qr=new $e(We.Qr),this.$r=new $e(We.Ur)}isEmpty(){return this.qr.isEmpty()}addReference(e,n){const r=new We(e,n);this.qr=this.qr.add(r),this.$r=this.$r.add(r)}Kr(e,n){e.forEach(r=>this.addReference(r,n))}removeReference(e,n){this.Wr(new We(e,n))}Gr(e,n){e.forEach(r=>this.removeReference(r,n))}zr(e){const n=new Q(new ge([])),r=new We(n,e),i=new We(n,e+1),s=[];return this.$r.forEachInRange([r,i],o=>{this.Wr(o),s.push(o.key)}),s}jr(){this.qr.forEach(e=>this.Wr(e))}Wr(e){this.qr=this.qr.delete(e),this.$r=this.$r.delete(e)}Jr(e){const n=new Q(new ge([])),r=new We(n,e),i=new We(n,e+1);let s=se();return this.$r.forEachInRange([r,i],o=>{s=s.add(o.key)}),s}containsKey(e){const n=new We(e,0),r=this.qr.firstAfterOrEqual(n);return r!==null&&e.isEqual(r.key)}}class We{constructor(e,n){this.key=e,this.Hr=n}static Qr(e,n){return Q.comparator(e.key,n.key)||ne(e.Hr,n.Hr)}static Ur(e,n){return ne(e.Hr,n.Hr)||Q.comparator(e.key,n.key)}}/**
2633 * @license
2634 * Copyright 2017 Google LLC
2635 *
2636 * Licensed under the Apache License, Version 2.0 (the "License");
2637 * you may not use this file except in compliance with the License.
2638 * You may obtain a copy of the License at
2639 *
2640 *   http://www.apache.org/licenses/LICENSE-2.0
2641 *
2642 * Unless required by applicable law or agreed to in writing, software
2643 * distributed under the License is distributed on an "AS IS" BASIS,
2644 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2645 * See the License for the specific language governing permissions and
2646 * limitations under the License.
2647 */class k2{constructor(e,n){this.indexManager=e,this.referenceDelegate=n,this.mutationQueue=[],this.er=1,this.Yr=new $e(We.Qr)}checkEmpty(e){return M.resolve(this.mutationQueue.length===0)}addMutationBatch(e,n,r,i){const s=this.er;this.er++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new WN(s,n,r,i);this.mutationQueue.push(o);for(const l of i)this.Yr=this.Yr.add(new We(l.key,s)),this.indexManager.addToCollectionParentIndex(e,l.key.path.popLast());return M.resolve(o)}lookupMutationBatch(e,n){return M.resolve(this.Zr(n))}getNextMutationBatchAfterBatchId(e,n){const r=n+1,i=this.Xr(r),s=i<0?0:i;return M.resolve(this.mutationQueue.length>s?this.mutationQueue[s]:null)}getHighestUnacknowledgedBatchId(){return M.resolve(this.mutationQueue.length===0?cm:this.er-1)}getAllMutationBatches(e){return M.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,n){const r=new We(n,0),i=new We(n,Number.POSITIVE_INFINITY),s=[];return this.Yr.forEachInRange([r,i],o=>{const l=this.Zr(o.Hr);s.push(l)}),M.resolve(s)}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new $e(ne);return n.forEach(i=>{const s=new We(i,0),o=new We(i,Number.POSITIVE_INFINITY);this.Yr.forEachInRange([s,o],l=>{r=r.add(l.Hr)})}),M.resolve(this.ei(r))}getAllMutationBatchesAffectingQuery(e,n){const r=n.path,i=r.length+1;let s=r;Q.isDocumentKey(s)||(s=s.child(""));const o=new We(new Q(s),0);let l=new $e(ne);return this.Yr.forEachWhile(u=>{const c=u.key.path;return!!r.isPrefixOf(c)&&(c.length===i&&(l=l.add(u.Hr)),!0)},o),M.resolve(this.ei(l))}ei(e){const n=[];return e.forEach(r=>{const i=this.Zr(r);i!==null&&n.push(i)}),n}removeMutationBatch(e,n){ce(this.ti(n.batchId,"removed")===0,55003),this.mutation
2647Queue.shift();let r=this.Yr;return M.forEach(n.mutations,i=>{const s=new We(i.key,n.batchId);return r=r.delete(s),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.Yr=r})}rr(e){}containsKey(e,n){const r=new We(n,0),i=this.Yr.firstAfterOrEqual(r);return M.resolve(n.isEqual(i&&i.key))}performConsistencyCheck(e){return this.mutationQueue.length,M.resolve()}ti(e,n){return this.Xr(e)}Xr(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Zr(e){const n=this.Xr(e);return n<0||n>=this.mutationQueue.length?null:this.mutationQueue[n]}}/**
2648 * @license
2649 * Copyright 2017 Google LLC
2650 *
2651 * Licensed under the Apache License, Version 2.0 (the "License");
2652 * you may not use this file except in compliance with the License.
2653 * You may obtain a copy of the License at
2654 *
2655 *   http://www.apache.org/licenses/LICENSE-2.0
2656 *
2657 * Unless required by applicable law or agreed to in writing, software
2658 * distributed under the License is distributed on an "AS IS" BASIS,
2659 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2660 * See the License for the specific language governing permissions and
2661 * limitations under the License.
2662 */class x2{constructor(e){this.ni=e,this.docs=function(){return new Pe(Q.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,n){const r=n.key,i=this.docs.get(r),s=i?i.size:0,o=this.ni(n);return this.docs=this.docs.insert(r,{document:n.mutableCopy(),size:o}),this.size+=o-s,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)}getEntry(e,n){const r=this.docs.get(n);return M.resolve(r?r.document.mutableCopy():ct.newInvalidDocument(n))}getEntries(e,n){let r=Jn();return n.forEach(i=>{const s=this.docs.get(i);r=r.insert(i,s?s.document.mutableCopy():ct.newInvalidDocument(i))}),M.resolve(r)}getDocumentsMatchingQuery(e,n,r,i){let s=Jn();const o=n.path,l=new Q(o.child("__id-9223372036854775808__")),u=this.docs.getIteratorFrom(l);for(;u.hasNext();){const{key:c,value:{document:d}}=u.getNext();if(!o.isPrefixOf(c.path))break;c.path.length>o.length+1||sN(iN(d),r)<=0||(i.has(d.key)||Hc(n,d))&&(s=s.insert(d.key,d.mutableCopy()))}return M.resolve(s)}getAllFromCollectionGroup(e,n,r,i){Y(9500)}
2662ri(e,n){return M.forEach(this.docs,r=>n(r))}newChangeBuffer(e){return new b2(this)}getSize(e){return M.resolve(this.size)}}class b2 extends I2{constructor(e){super(),this.Or=e}applyChanges(e){const n=[];return this.changes.forEach((r,i)=>{i.isValidDocument()?n.push(this.Or.addEntry(e,i)):this.Or.removeEntry(r)}),M.waitFor(n)}getFromCache(e,n){return this.Or.getEntry(e,n)}getAllFromCache(e,n){return this.Or.getEntries(e,n)}}/**
2663 * @license
2664 * Copyright 2017 Google LLC
2665 *
2666 * Licensed under the Apache License, Version 2.0 (the "License");
2667 * you may not use this file except in compliance with the License.
2668 * You may obtain a copy of the License at
2669 *
2670 *   http://www.apache.org/licenses/LICENSE-2.0
2671 *
2672 * Unless required by applicable law or agreed to in writing, software
2673 * distributed under the License is distributed on an "AS IS" BASIS,
2674 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2675 * See the License for the specific language governing permissions and
2676 * limitations under the License.
2677 */class N2{constructor(e){this.persistence=e,this.ii=new ki(n=>fm(n),pm),this.lastRemoteSnapshotVersion=ee.min(),this.highestTargetId=0,this.si=0,this.oi=new Em,this.targetCount=0,this._i=Cs.ar()}forEachTarget(e,n){return this.ii.forEach((r,i)=>n(i)),M.resolve()}getLastRemoteSnapshotVersion(e){return M.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return M.resolve(this.si)}allocateTargetId(e){return this.highestTargetId=this._i.next(),M.resolve(this.highestTargetId)}setTargetsMetadata(e,n,r){return r&&(this.lastRemoteSnapshotVersion=r),n>this.si&&(this.si=n),M.resolve()}hr(e){this.ii.set(e.target,e);const n=e.targetId;n>this.highestTargetId&&(this._i=new Cs(n),this.highestTargetId=n),e.sequenceNumber>this.si&&(this.si=e.sequenceNumber)}addTargetData(e,n){return this.hr(n),this.targetCount+=1,M.resolve()}updateTargetData(e,n){return this.hr(n),M.resolve()}removeTargetData(e,n){return this.ii.delete(n.target),this.oi.zr(n.targetId),this.targetCount-=1,M.resolve()}removeTargets(e,n,r){let i=0;const s=[];return this.ii.forEach((o,l)=>{l.sequenceNumber<=n&&r.get(l.targetId)===null&&(this.ii.delete(o),s.push(this.removeMatchingKeysForTargetId(e,l.targetId)),i++)}),M.waitFor(s).next(()=>i)}getTargetCount(e){return M.resolve(this.targetCount)}getTargetData(e,n){const r=this.ii.get(n)||null;return M.resolve(r)}addMatchingKeys(e,n,r){return this.oi.Kr(n,r),M.resolve()}removeMatchingKeys(e,n,r){this.oi.Gr(n,r);const i=this.persistence.referenceDelegate,s=[];return i&&n.forEach(o=>{s.push(i.markPotentiallyOrphaned(e,o))}),M.waitFor(s)}removeMatchingKeysForTargetId(e,n){return this.oi.zr(n),M.resolve()}getMatchingKeysForTargetId(e,n){const r=this.oi.Jr(n);return M.resolve(r)}containsKey(e,n){return M.resolve(this.oi.containsKey(n))}}/**
2678 * @license
2679 * Copyright 2017 Google LLC
2680 *
2681 * Licensed under the Apache License, Version 2.0 (the "License");
2682 * you may not use this file except in compliance with the License.
2683 * You may obtain a copy of the License at
2684 *
2685 *   http://www.apache.org/licenses/LICENSE-2.0
2686 *
2687 * Unless required by applicable law or agreed to in writing, software
2688 * distributed under the License is distributed on an "AS IS" BASIS,
2689 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2690 * See the License for the specific language governing permissions and
2691 * limitations under the License.
2692 */class OI{constructor(e,n){this.ai={},this.overlays={},this.ui=new zc(0),this.ci=!1,this.ci=!0,this.li=new P2,this.referenceDelegate=e(this),this.hi=new N2(this),this.indexManager=new g2,this.remoteDocumentCache=function(i){return new x2(i)}(r=>this.referenceDelegate.Pi(r)),this.serializer=new p2(n),this.Ti=new R2(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.ci=!1,Promise.resolve()}get started(){return this.ci}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let n=this.overlays[e.toKey()];return n||(n=new C2,this.overlays[e.toKey()]=n),n}getMutationQueue(e,n){let r=this.ai[e.toKey()];return r||(r=new k2(n,this.referenceDelegate),this.ai[e.toKey()]=r),r}getGlobalsCache(){return this.li}getTargetCache(){return this.hi}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ti}runTransaction(e,n,r){H("MemoryPersistence","Starting transaction:",e);const i=new D2(this.ui.next());return this.referenceDelegate.Ii(),r(i).next(s=>this.referenceDelegate.di(i).next(()=>s)).toPromise().then(s=>(i.raiseOnCommittedEvent(),s))}Ei(e,n){return M.or(Object.values(this.ai).map(r=>()=>r.containsKey(e,n)))}}class D2 extends aN{constructor(e){super(),this.currentSequenceNumber=e}}class wm{constructor(e){this.persistence=e,this.Ai=new Em,this.Ri=null}static Vi(e){return new wm(e)}get mi(){if(this.Ri)return this.Ri;throw Y(60996)}addReference(e,n,r){return this.Ai.addReference(r,n),this.mi.delete(r.toString()),M.resolve()}removeReference(e,n,r){return this.Ai.removeReference(r,n),this.mi.add(r.toString()),M.resolve()}markPotentiallyOrphaned(e,n){return this.mi.add(n.toString()),M.resolve()}
2692removeTarget(e,n){this.Ai.zr(n.targetId).forEach(i=>this.mi.add(i.toString()));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,n.targetId).next(i=>{i.forEach(s=>this.mi.add(s.toString()))}).next(()=>r.removeTargetData(e,n))}Ii(){this.Ri=new Set}di(e){const n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return M.forEach(this.mi,r=>{const i=Q.fromPath(r);return this.fi(e,i).next(s=>{s||n.removeEntry(i,ee.min())})}).next(()=>(this.Ri=null,n.apply(e)))}updateLimboDocument(e,n){return this.fi(e,n).next(r=>{r?this.mi.delete(n.toString()):this.mi.add(n.toString())})}Pi(e){return 0}fi(e,n){return M.or([()=>M.resolve(this.Ai.containsKey(n)),()=>this.persistence.getTargetCache().containsKey(e,n),()=>this.persistence.Ei(e,n)])}}class rc{constructor(e,n){this.persistence=e,this.gi=new ki(r=>cN(r.path),(r,i)=>r.isEqual(i)),this.garbageCollector=T2(this,n)}static Vi(e,n){return new rc(e,n)}Ii(){}di(e){return M.resolve()}forEachTarget(e,n){return this.persistence.getTargetCache().forEachTarget(e,n)}mr(e){const n=this.yr(e);return this.persistence.getTargetCache().getTargetCount(e).next(r=>n.next(i=>r+i))}yr(e){let n=0;return this.gr(e,r=>{n++}).next(()=>n)}gr(e,n){return M.forEach(this.gi,(r,i)=>this.Sr(e,r,i).next(s=>s?M.resolve():n(i)))}removeTargets(e,n,r){return this.persistence.getTargetCache().removeTargets(e,n,r)}removeOrphanedDocuments(e,n){let r=0;const i=this.persistence.getRemoteDocumentCache(),s=i.newChangeBuffer();return i.ri(e,o=>this.Sr(e,o,n).next(l=>{l||(r++,s.removeEntry(o,ee.min()))})).next(()=>s.apply(e)).next(()=>r)}markPotentiallyOrphaned(e,n){return this.gi.set(n,e.currentSequenceNumber),M.resolve()}removeTarget(e,n){const r=n.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,n,r){return this.gi.set(r,e.currentSequenceNumber),M.resolve()}removeReference(e,n,r){return this.gi.set(r,e.currentSequenceNumber),M.resolve()}updateLimboDocument(e,n){return this.gi.set(n,e.currentSequenceNumber),M.resolve()}Pi(e){let n=e.key.toString().length;return e.isFoundDocument()&&(n+=nu(e.data.value)),n}Sr(e,n,r){return M.or([()=>this.persistence.Ei(e,n),()=>this.persistence.getTargetCache().containsKey(e,n),()=>{const i=this.gi.get(n);return M.resolve(i!==void 0&&i>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}/**
2693 * @license
2694 * Copyright 2017 Google LLC
2695 *
2696 * Licensed under the Apache License, Version 2.0 (the "License");
2697 * you may not use this file except in compliance with the License.
2698 * You may obtain a copy of the License at
2699 *
2700 *   http://www.apache.org/licenses/LICENSE-2.0
2701 *
2702 * Unless required by applicable law or agreed to in writing, software
2703 * distributed under the License is distributed on an "AS IS" BASIS,
2704 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2705 * See the License for the specific language governing permissions and
2706 * limitations under the License.
2707 */class Tm{constructor(e,n,r,i){this.targetId=e,this.fromCache=n,this.Is=r,this.ds=i}static Es(e,n){let r=se(),i=se();for(const s of n.docChanges)switch(s.type){case 0:r=r.add(s.doc.key);break;case 1:i=i.add(s.doc.key)}return new Tm(e,n.fromCache,r,i)}}/**
2708 * @license
2709 * Copyright 2023 Google LLC
2710 *
2711 * Licensed under the Apache License, Version 2.0 (the "License");
2712 * you may not use this file except in compliance with the License.
2713 * You may obtain a copy of the License at
2714 *
2715 *   http://www.apache.org/licenses/LICENSE-2.0
2716 *
2717 * Unless required by applicable law or agreed to in writing, software
2718 * distributed under the License is distributed on an "AS IS" BASIS,
2719 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2720 * See the License for the specific language governing permissions and
2721 * limitations under the License.
2722 */class O2{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}/**
2723 * @license
2724 * Copyright 2019 Google LLC
2725 *
2726 * Licensed under the Apache License, Version 2.0 (the "License");
2727 * you may not use this file except in compliance with the License.
2728 * You may obtain a copy of the License at
2729 *
2730 *   http://www.apache.org/licenses/LICENSE-2.0
2731 *
2732 * Unless required by applicable law or agreed to in writing, software
2733 * distributed under the License is distributed on an "AS IS" BASIS,
2734 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2735 * See the License for the specific language governing permissions and
2736 * limitations under the License.
2737 */class V2{constructor(){this.As=!1,this.Rs=!1,this.Vs=100,this.fs=function(){return dP()?8:lN(dt())>0?6:4}()}initialize(e,n){this.gs=e,this.indexManager=n,this.As=!0}getDocumentsMatchingQuery(e,n,r,i){const s={result:null};return this.ps(e,n).next(o=>{s.result=o}).next(()=>{if(!s.result)return this.ys(e,n,i,r).next(o=>{s.result=o})}).next(()=>{if(s.result)return;const o=new O2;return this.ws(e,n,o).next(l=>{if(s.result=l,this.Rs)return this.Ss(e,n,o,l.size)})}).next(()=>s.result)}Ss(e,n,r,i){return r.documentReadCount<this.Vs?($i()<=ie.DEBUG&&H("QueryEngine","SDK will not create cache indexes for query:",Bi(n),"since it only creates cache indexes for collection contains","more than or equal to",this.Vs,"documents"),M.resolve()):($i()<=ie.DEBUG&&H("QueryEngine","Query:",Bi(n),"scans",r.documentReadCount,"local documents and returns",i,"documents as results."),r.documentReadCount>this.fs*i?($i()<=ie.DEBUG&&H("QueryEngine","The SDK decides to create cache indexes for query:",Bi(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Cn(n))):M.resolve())}ps(e,n){if(mv(n))return M.resolve(null);let r=Cn(n);return this.indexManager.getIndexType(e,r).next(i=>i===0?null:(n.limit!==null&&i===1&&(n=tc(n,null,"F"),r=Cn(n)),this.indexManager.getDocumentsMatchingTarget(e,r).next(s=>{const o=se(...s);return this.gs.getDocuments(e,o).next(l=>this.indexManager.getMinOffset(e,r).next(u=>{const c=this.bs(n,l);return this.Ds(n,c,o,u.readTime)?this.ps(e,tc(n,null,"F")):this.vs(e,c,n,u)}))})))}ys(e,n,r,i){return mv(n)||i.isEqual(ee.min())?M.resolve(null):this.gs.getDocuments(e,r).next(s=>{const o=this.bs(n,s);return this.Ds(n,o,r,i)?M.resolve(null):($i()<=ie.DEBUG&&H("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),Bi(n)),this.vs(e,o,n,rN(i,ya)).next(l=>l))})}bs(e,n){let r=new $e(cI(e));return n.forEach((i,s)=>{Hc(e,s)&&(r=r.add(s))}),r}Ds(e,n,r,i){if(e.limit===null)return!1;if(r.size!==n.size)return!0;const s=e.limitType==="F"?n.last():n.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(i)>0)}ws(e,n,r){return $i()<=ie.DEBUG&&H("QueryEngine","Using full collection scan to execute query:",Bi(n)),this.gs.getDocumentsMatchingQuery(e,n,jr.min(),r)}vs(e,n,r,i){return this.gs.getDocumentsMatchingQuery(e,r,i).next(s=>(n.forEach(o=>{s=s.insert(o.key,o)}),s))}}/**
2738 * @license
2739 * Copyright 2020 Google LLC
2740 *
2741 * Licensed under the Apache License, Version 2.0 (the "License");
2742 * you may not use this file except in compliance with the License.
2743 * You may obtain a copy of the License at
2744 *
2745 *   http://www.apache.org/licenses/LICENSE-2.0
2746 *
2747 * Unless required by applicable law or agreed to in writing, software
2748 * distributed under the License is distributed on an "AS IS" BASIS,
2749 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2750 * See the License for the specific language governing permissions and
2751 * limitations under the License.
2752 */const Im="LocalStore",L2=3e8;class M2{constructor(e,n,r,i){this.persistence=e,this.Cs=n,this.serializer=i,this.Fs=new Pe(ne),this.Ms=new ki(s=>fm(s),pm),this.xs=new Map,this.Os=e.getRemoteDocumentCache(),this.hi=e.getTargetCache(),this.Ti=e.getBundleCache(),this.Ns(r)}Ns(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new S2(this.Os,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Os.setIndexManager(this.indexManager),this.Cs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",n=>e.collect(n,this.Fs))}}function F2(t,e,n,r){return new M2(t,e,n,r)}async function VI(t,e){const n=Z(t);return await n.persistence.runTransaction("Handle user change","readonly",r=>{let i;
2752return n.mutationQueue.getAllMutationBatches(r).next(s=>(i=s,n.Ns(e),n.mutationQueue.getAllMutationBatches(r))).next(s=>{const o=[],l=[];let u=se();for(const c of i){o.push(c.batchId);for(const d of c.mutations)u=u.add(d.key)}for(const c of s){l.push(c.batchId);for(const d of c.mutations)u=u.add(d.key)}return n.localDocuments.getDocuments(r,u).next(c=>({Bs:c,removedBatchIds:o,addedBatchIds:l}))})})}function U2(t,e){const n=Z(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{const i=e.batch.keys(),s=n.Os.newChangeBuffer({trackRemovals:!0});return function(l,u,c,d){const p=c.batch,m=p.keys();let v=M.resolve();return m.forEach(w=>{v=v.next(()=>d.getEntry(u,w)).next(P=>{const C=c.docVersions.get(w);ce(C!==null,48541),P.version.compareTo(C)<0&&(p.applyToRemoteDocument(P,c),P.isValidDocument()&&(P.setReadTime(c.commitVersion),d.addEntry(P)))})}),v.next(()=>l.mutationQueue.removeMutationBatch(u,p))}(n,r,e,s).next(()=>s.apply(r)).next(()=>n.mutationQueue.performConsistencyCheck(r)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(r,i,e.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(l){let u=se();for(let c=0;c<l.mutationResults.length;++c)l.mutationResults[c].transformResults.length>0&&(u=u.add(l.batch.mutations[c].key));return u}(e))).next(()=>n.localDocuments.getDocuments(r,i))})}function LI(t){const e=Z(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",n=>e.hi.getLastRemoteSnapshotVersion(n))}function j2(t,e){const n=Z(t),r=e.snapshotVersion;let i=n.Fs;return n.persistence.runTransaction("Apply remote event","readwrite-primary",s=>{const o=n.Os.newChangeBuffer({trackRemovals:!0});i=n.Fs;const l=[];
2752e.targetChanges.forEach((d,p)=>{const m=i.get(p);if(!m)return;l.push(n.hi.removeMatchingKeys(s,d.removedDocuments,p).next(()=>n.hi.addMatchingKeys(s,d.addedDocuments,p)));let v=m.withSequenceNumber(s.currentSequenceNumber);e.targetMismatches.get(p)!==null?v=v.withResumeToken(tt.EMPTY_BYTE_STRING,ee.min()).withLastLimboFreeSnapshotVersion(ee.min()):d.resumeToken.approximateByteSize()>0&&(v=v.withResumeToken(d.resumeToken,r)),i=i.insert(p,v),function(P,C,E){return P.resumeToken.approximateByteSize()===0||C.snapshotVersion.toMicroseconds()-P.snapshotVersion.toMicroseconds()>=L2?!0:E.addedDocuments.size+E.modifiedDocuments.size+E.removedDocuments.size>0}(m,v,d)&&l.push(n.hi.updateTargetData(s,v))});let u=Jn(),c=se();if(e.documentUpdates.forEach(d=>{e.resolvedLimboDocuments.has(d)&&l.push(n.persistence.referenceDelegate.updateLimboDocument(s,d))}),l.push(z2(s,o,e.documentUpdates).next(d=>{u=d.Ls,c=d.ks})),!r.isEqual(ee.min())){const d=n.hi.getLastRemoteSnapshotVersion(s).next(p=>n.hi.setTargetsMetadata(s,s.currentSequenceNumber,r));l.push(d)}return M.waitFor(l).next(()=>o.apply(s)).next(()=>n.localDocuments.getLocalViewOfDocuments(s,u,c)).next(()=>u)}).then(s=>(n.Fs=i,s))}function z2(t,e,n){let r=se(),i=se();return n.forEach(s=>r=r.add(s)),e.getEntries(t,r).next(s=>{let o=Jn();return n.forEach((l,u)=>{const c=s.get(l);u.isFoundDocument()!==c.isFoundDocument()&&(i=i.add(l)),u.isNoDocument()&&u.version.isEqual(ee.min())?(e.removeEntry(l,u.readTime),o=o.insert(l,u)):!c.isValidDocument()||u.version.compareTo(c.version)>0||u.version.compareTo(c.version)===0&&c.hasPendingWrites?(e.addEntry(u),o=o.insert(l,u)):H(Im,"Ignoring outdated watch update for ",l,". Current version:",c.version," Watch version:",u.version)}),{Ls:o,ks:i}})}function $2(t,e){const n=Z(t);return n.persistence.runTransaction("Get next mutation batch","readonly",r=>(e===void 0&&(e=cm),n.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function B2(t,e){const n=Z(t);return n.persistence.runTransaction("Allocate target","readwrite",r=>{let i;return n.hi.getTargetData(r,e).next(s=>s?(i=s,M.resolve(i)):n.hi.allocateTargetId(r).next(o=>(i=new Tr(e,o,"TargetPurposeListen",r.currentSequenceNumber),n.hi.addTargetData(r,i).next(()=>i))))}).then(r=>{const i=n.Fs.get(r.targetId);return(i===null||r.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(n.Fs=n.Fs.insert(r.targetId,r),n.Ms.set(e,r.targetId)),r})}async function Lf(t,e,n){const r=Z(t),i=r.Fs.get(e),s=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",s,o=>r.persistence.referenceDelegate.removeTarget(o,i))}catch(o){if(!$s(o))throw o;H(Im,`Failed to update sequence numbers for target ${e}: ${o}`)}r.Fs=r.Fs.remove(e),r.Ms.delete(i.target)}function Pv(t,e,n){const r=Z(t);let i=ee.min(),s=se();return r.persistence.runTransaction("Execute query","readwrite",o=>function(u,c,d){const p=Z(u),m=p.Ms.get(d);return m!==void 0?M.resolve(p.Fs.get(m)):p.hi.getTargetData(c,d)}(r,o,Cn(e)).next(l=>{if(l)return i=l.lastLimboFreeSnapshotVersion,r.hi.getMatchingKeysForTargetId(o,l.targetId).next(u=>{s=u})}).next(()=>r.Cs.getDocumentsMatchingQuery(o,e,n?i:ee.min(),n?s:se())).next(l=>(W2(r,xN(e),l),{documents:l,qs:s})))}function W2(t,e,n){let r=t.xs.get(e)||ee.min();n.forEach((i,s)=>{s.readTime.compareTo(r)>0&&(r=s.readTime)}),t.xs.set(e,r)}class kv{constructor(){this.activeTargetIds=LN()}Gs(e){this.activeTargetIds=this.activeTargetIds.add(e)}zs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Ws(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class q2{constructor(){this.Fo=new kv,this.Mo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,n,r){}addLocalQueryTarget(e,n=!0){return n&&this.Fo.Gs(e),this.Mo[e]||"not-current"}updateQueryState(e,n,r){this.Mo[e]=n}removeLocalQueryTarget(e){this.Fo.zs(e)}isLocalQueryTarget(e){return this.Fo.activeTargetIds.has(e)}clearQueryState(e){delete this.Mo[e]}getAllActiveQueryTargets(){return this.Fo.activeTargetIds}isActiveQueryTarget(e){return this.Fo.activeTargetIds.has(e)}start(){return this.Fo=new kv,Promise.resolve()}handleUserChange(e,n,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/**
2753 * @license
2754 * Copyright 2019 Google LLC
2755 *
2756 * Licensed under the Apache License, Version 2.0 (the "License");
2757 * you may not use this file except in compliance with the License.
2758 * You may obtain a copy of the License at
2759 *
2760 *   http://www.apache.org/licenses/LICENSE-2.0
2761 *
2762 * Unless required by applicable law or agreed to in writing, software
2763 * distributed under the License is distributed on an "AS IS" BASIS,
2764 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2765 * See the License for the specific language governing permissions and
2766 * limitations under the License.
2767 */class H2{xo(e){}shutdown(){}}/**
2768 * @license
2769 * Copyright 2019 Google LLC
2770 *
2771 * Licensed under the Apache License, Version 2.0 (the "License");
2772 * you may not use this file except in compliance with the License.
2773 * You may obtain a copy of the License at
2774 *
2775 *   http://www.apache.org/licenses/LICENSE-2.0
2776 *
2777 * Unless required by applicable law or agreed to in writing, software
2778 * distributed under the License is distributed on an "AS IS" BASIS,
2779 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2780 * See the License for the specific language governing permissions and
2781 * limitations under the License.
2782 */const xv="ConnectivityMonitor";class bv{constructor(){this.Oo=()=>this.No(),this.Bo=()=>this.Lo(),this.ko=[],this.qo()}xo(e){this.ko.push(e)}shutdown(){window.removeEventListener("online",this.Oo),window.removeEventListener("offline",this.Bo)}qo(){window.addEventListener("online",this.Oo),window.addEventListener("offline",this.Bo)}No(){H(xv,"Network connectivity changed: AVAILABLE");for(const e of this.ko)e(0)}Lo(){H(xv,"Network connectivity changed: UNAVAILABLE");for(const e of this.ko)e(1)}static C(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/**
2783 * @license
2784 * Copyright 2023 Google LLC
2785 *
2786 * Licensed under the Apache License, Version 2.0 (the "License");
2787 * you may not use this file except in compliance with the License.
2788 * You may obtain a copy of the License at
2789 *
2790 *   http://www.apache.org/licenses/LICENSE-2.0
2791 *
2792 * Unless required by applicable law or agreed to in writing, software
2793 * distributed under the License is distributed on an "AS IS" BASIS,
2794 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2795 * See the License for the specific language governing permissions and
2796 * limitations under the License.
2797 */let Dl=null;function Mf(){return Dl===null?Dl=function(){return 268435456+Math.round(2147483648*Math.random())}():Dl++,"0x"+Dl.toString(16)}/**
2798 * @license
2799 * Copyright 2020 Google LLC
2800 *
2801 * Licensed under the Apache License, Version 2.0 (the "License");
2802 * you may not use this file except in compliance with the License.
2803 * You may obtain a copy of the License at
2804 *
2805 *   http://www.apache.org/licenses/LICENSE-2.0
2806 *
2807 * Unless required by applicable law or agreed to in writing, software
2808 * distributed under the License is distributed on an "AS IS" BASIS,
2809 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2810 * See the License for the specific language governing permissions and
2811 * limitations under the License.
2812 */const ud="RestConnection",G2={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class K2{get Qo(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const n=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.$o=n+"://"+e.host,this.Uo=`projects/${r}/databases/${i}`,this.Ko=this.databaseId.database===Ju?`project_id=${r}`:`project_id=${r}&database_id=${i}`}Wo(e,n,r,i,s){const o=Mf(),l=this.Go(e,n.toUriEncodedString());H(ud,`Sending RPC '${e}' ${o}:`,l,r);const u={"google-cloud-resource-prefix":this.Uo,"x-goog-request-params":this.Ko};this.zo(u,i,s);const{host:c}=new URL(l),d=nr(c);return this.jo(e,l,u,r,d).then(p=>(H(ud,`Received RPC '${e}' ${o}: `,p),p),p=>{throw Ur(ud,`RPC '${e}' ${o} failed with error: `,p,"url: ",l,"request:",r),p})}Jo(e,n,r,i,s,o){return this.Wo(e,n,r,i,s)}zo(e,n,r){e["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+js}(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),n&&n.headers.forEac
2812h((i,s)=>e[s]=i),r&&r.headers.forEach((i,s)=>e[s]=i)}Go(e,n){const r=G2[e];return`${this.$o}/v1/${n}:${r}`}terminate(){}}/**
2813 * @license
2814 * Copyright 2017 Google LLC
2815 *
2816 * Licensed under the Apache License, Version 2.0 (the "License");
2817 * you may not use this file except in compliance with the License.
2818 * You may obtain a copy of the License at
2819 *
2820 *   http://www.apache.org/licenses/LICENSE-2.0
2821 *
2822 * Unless required by applicable law or agreed to in writing, software
2823 * distributed under the License is distributed on an "AS IS" BASIS,
2824 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2825 * See the License for the specific language governing permissions and
2826 * limitations under the License.
2827 */class Q2{constructor(e){this.Ho=e.Ho,this.Yo=e.Yo}Zo(e){this.Xo=e}e_(e){this.t_=e}n_(e){this.r_=e}onMessage(e){this.i_=e}close(){this.Yo()}send(e){this.Ho(e)}s_(){this.Xo()}o_(){this.t_()}__(e){this.r_(e)}a_(e){this.i_(e)}}/**
2828 * @license
2829 * Copyright 2017 Google LLC
2830 *
2831 * Licensed under the Apache License, Version 2.0 (the "License");
2832 * you may not use this file except in compliance with the License.
2833 * You may obtain a copy of the License at
2834 *
2835 *   http://www.apache.org/licenses/LICENSE-2.0
2836 *
2837 * Unless required by applicable law or agreed to in writing, software
2838 * distributed under the License is distributed on an "AS IS" BASIS,
2839 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2840 * See the License for the specific language governing permissions and
2841 * limitations under the License.
2842 */const at="WebChannelConnection";class X2 extends K2{constructor(e){super(e),this.u_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}jo(e,n,r,i,s){const o=Mf();return new Promise((l,u)=>{const c=new LT;c.setWithCredentials(!0),c.listenOnce(MT.COMPLETE,()=>{try{switch(c.getLastErrorCode()){case tu.NO_ERROR:const p=c.getResponseJson();H(at,`XHR for RPC '${e}' ${o} received:`,JSON.stringify(p)),l(p);break;case tu.TIMEOUT:H(at,`RPC '${e}' ${o} timed out`),u(new B(L.DEADLINE_EXCEEDED,"Request time out"));break;case tu.HTTP_ERROR:const m=c.getStatus();if(H(at,`RPC '${e}' ${o} failed with status:`,m,"response text:",c.getResponseText()),m>0){let v=c.getResponseJson();Array.isArray(v)&&(v=v[0]);const w=v==null?void 0:v.error;if(w&&w.status&&w.message){const P=function(E){const g=E.toLowerCase().replace(/_/g,"-");return Object.values(L).indexOf(g)>=0?g:L.UNKNOWN}(w.status);u(new B(P,w.message))}else u(new B(L.UNKNOWN,"Server responded with status "+c.getStatus()))}else u(new B(L.UNAVAILABLE,"Connection failed."));break;default:Y(9055,{c_:e,streamId:o,l_:c.getLastErrorCode(),h_:c.getLastError()})}}finally{H(at,`RPC '${e}' ${o} completed.`)}});const d=JSON.stringify(i);H(at,`RPC '${e}' ${o} sending request:`,i),c.send(n,"POST",d,r,15)})}P_(e,n,r){const i=Mf(),s=[this.$o,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=jT(),l=UT(),u={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},c=this.longPollingOptions.timeoutSeconds;c!==void 0&&(u.longPollingTimeout=Math.round(1e3*c)),this.useFetchStreams&&(u.useFetchStreams=!0),this.zo(u.initMessageHeaders,n,r),u.encodeInitMessageHeaders=!0;const d=s.join("");H(at,`Creating RPC '${e}' stream ${i}: ${d}`,u);const p=o.createWebChannel(d,u);this.T_(p);let m=!1,v=!1;const w=new Q2({Ho:C=>{v?H(at,`Not sending because RPC '${e}' stream ${i} is closed:`,C):(m||(H(at,`Opening RPC '${e}' stream ${i} transport.`),p.open(),m=!0),H(at,`RPC '${e}' stream ${i} sending:`,C),p.send(C))},Yo:()=>p.close()}),P=(C,E,g)=>{C.listen(E,T=>{try{g(T)}catch(x){setTimeout(()=>{throw x},0)}})};return P(p,ko.EventType.OPEN,()=>{v||(H(at,`RPC '${e}' stream ${i} transport opened.`),w.s_())}),P(p,ko.EventType.CLOSE,()=>{v||(v=!0,H(at,`RPC '${e}' stream ${i} transport closed`),w.__(),this.I_(p))}
2842),P(p,ko.EventType.ERROR,C=>{v||(v=!0,Ur(at,`RPC '${e}' stream ${i} transport errored. Name:`,C.name,"Message:",C.message),w.__(new B(L.UNAVAILABLE,"The operation could not be completed")))}),P(p,ko.EventType.MESSAGE,C=>{var E;if(!v){const g=C.data[0];ce(!!g,16349);const T=g,x=(T==null?void 0:T.error)||((E=T[0])===null||E===void 0?void 0:E.error);if(x){H(at,`RPC '${e}' stream ${i} received error:`,x);const F=x.status;let U=function(A){const S=Le[A];if(S!==void 0)return TI(S)}(F),I=x.message;U===void 0&&(U=L.INTERNAL,I="Unknown error status: "+F+" with message "+x.message),v=!0,w.__(new B(U,I)),p.close()}else H(at,`RPC '${e}' stream ${i} received:`,g),w.a_(g)}}),P(l,FT.STAT_EVENT,C=>{C.stat===Sf.PROXY?H(at,`RPC '${e}' stream ${i} detected buffering proxy`):C.stat===Sf.NOPROXY&&H(at,`RPC '${e}' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{w.o_()},0),w}terminate(){this.u_.forEach(e=>e.close()),this.u_=[]}T_(e){this.u_.push(e)}I_(e){this.u_=this.u_.filter(n=>n===e)}}function cd(){return typeof document<"u"?document:null}/**
2843 * @license
2844 * Copyright 2020 Google LLC
2845 *
2846 * Licensed under the Apache License, Version 2.0 (the "License");
2847 * you may not use this file except in compliance with the License.
2848 * You may obtain a copy of the License at
2849 *
2850 *   http://www.apache.org/licenses/LICENSE-2.0
2851 *
2852 * Unless required by applicable law or agreed to in writing, software
2853 * distributed under the License is distributed on an "AS IS" BASIS,
2854 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2855 * See the License for the specific language governing permissions and
2856 * limitations under the License.
2857 */function Yc(t){return new e2(t,!0)}/**
2858 * @license
2859 * Copyright 2017 Google LLC
2860 *
2861 * Licensed under the Apache License, Version 2.0 (the "License");
2862 * you may not use this file except in compliance with the License.
2863 * You may obtain a copy of the License at
2864 *
2865 *   http://www.apache.org/licenses/LICENSE-2.0
2866 *
2867 * Unless required by applicable law or agreed to in writing, software
2868 * distributed under the License is distributed on an "AS IS" BASIS,
2869 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2870 * See the License for the specific language governing permissions and
2871 * limitations under the License.
2872 */class MI{constructor(e,n,r=1e3,i=1.5,s=6e4){this.Fi=e,this.timerId=n,this.d_=r,this.E_=i,this.A_=s,this.R_=0,this.V_=null,this.m_=Date.now(),this.reset()}reset(){this.R_=0}f_(){this.R_=this.A_}g_(e){this.cancel();const n=Math.floor(this.R_+this.p_()),r=Math.max(0,Date.now()-this.m_),i=Math.max(0,n-r);i>0&&H("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.R_} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.V_=this.Fi.enqueueAfterDelay(this.timerId,i,()=>(this.m_=Date.now(),e())),this.R_*=this.E_,this.R_<this.d_&&(this.R_=this.d_),this.R_>this.A_&&(this.R_=this.A_)}y_(){this.V_!==null&&(this.V_.skipDelay(),this.V_=null)}cancel(){this.V_!==null&&(this.V_.cancel(),this.V_=null)}p_(){return(Math.random()-.5)*this.R_}}/**
2873 * @license
2874 * Copyright 2017 Google LLC
2875 *
2876 * Licensed under the Apache License, Version 2.0 (the "License");
2877 * you may not use this file except in compliance with the License.
2878 * You may obtain a copy of the License at
2879 *
2880 *   http://www.apache.org/licenses/LICENSE-2.0
2881 *
2882 * Unless required by applicable law or agreed to in writing, software
2883 * distributed under the License is distributed on an "AS IS" BASIS,
2884 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2885 * See the License for the specific language governing permissions and
2886 * limitations under the License.
2887 */const Nv="PersistentStream";class FI{constructor(e,n,r,i,s,o,l,u){this.Fi=e,this.w_=r,this.S_=i,this.connection=s,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=l,this.listener=u,this.state=0,this.b_=0,this.D_=null,this.v_=null,this.stream=null,this.C_=0,this.F_=new MI(e,n)}M_(){return this.state===1||this.state===5||this.x_()}x_(){return this.state===2||this.state===3}start(){this.C_=0,this.state!==4?this.auth():this.O_()}async stop(){this.M_()&&await this.close(0)}N_(){this.state=0,this.F_.reset()}B_(){this.x_()&&this.D_===null&&(this.D_=this.Fi.enqueueAfterDelay(this.w_,6e4,()=>this.L_()))}k_(e){this.q_(),this.stream.send(e)}async L_(){if(this.x_())return this.close(0)}q_(){this.D_&&(this.D_.cancel(),this.D_=null)}Q_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,n){this.q_(),this.Q_(),this.F_.cancel(),this.b_++,e!==4?this.F_.reset():n&&n.code===L.RESOURCE_EXHAUSTED?(Yn(n.toString()),Yn("Using maximum backoff delay to prevent overloading the backend."),this.F_.f_()):n&&n.code===L.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.U_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.n_(n)}U_(){}auth(){this.state=1;const e=this.K_(this.b_),n=this.b_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,i])=>{this.b_===n&&this.W_(r,i)},r=>{e(()=>{const i=new B(L.UNKNOWN,"Fetching auth token failed: "+r.message);return this.G_(i)})})}W_(e,n){const r=this.K_(this.b_);this.stream=this.z_(e,n),this.stream.Zo(()=>{r(()=>this.listener.Zo())}),this.stream.e_(()=>{r(()=>(this.state=2,this.v_=this.Fi.enqueueAfterDelay(this.S_,1e4,()=>(this.x_()&&(this.state=3),Promise.resolve())),this.listener.e_()))}),this.stream.n_(i=>{r(()=>this.G_(i))}),this.stream.onMessage(i=>{r(()=>++this.C_==1?this.j_(i):this.onNext(i))})}O_(){this.state=5,this.F_.g_(async()=>{this.state=0,this.start()})}G_(e){return H(Nv,`close with error: ${e}`),this.stream=null,this.close(4,e)}K_(e){return n=>{this.Fi.enqueueAndForget(()=>this.b_===e?n():(H(Nv,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class Y2 extends FI{constructor(e,n,r,i,s,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,r,i,o),this.serializer
2887=s}z_(e,n){return this.connection.P_("Listen",e,n)}j_(e){return this.onNext(e)}onNext(e){this.F_.reset();const n=r2(this.serializer,e),r=function(s){if(!("targetChange"in s))return ee.min();const o=s.targetChange;return o.targetIds&&o.targetIds.length?ee.min():o.readTime?Pn(o.readTime):ee.min()}(e);return this.listener.J_(n,r)}H_(e){const n={};n.database=Vf(this.serializer),n.addTarget=function(s,o){let l;const u=o.target;if(l=xf(u)?{documents:o2(s,u)}:{query:kI(s,u).Vt},l.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){l.resumeToken=SI(s,o.resumeToken);const c=Nf(s,o.expectedCount);c!==null&&(l.expectedCount=c)}else if(o.snapshotVersion.compareTo(ee.min())>0){l.readTime=nc(s,o.snapshotVersion.toTimestamp());const c=Nf(s,o.expectedCount);c!==null&&(l.expectedCount=c)}return l}(this.serializer,e);const r=u2(this.serializer,e);r&&(n.labels=r),this.k_(n)}Y_(e){const n={};n.database=Vf(this.serializer),n.removeTarget=e,this.k_(n)}}class J2 extends FI{constructor(e,n,r,i,s,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",n,r,i,o),this.serializer=s}get Z_(){return this.C_>0}start(){this.lastStreamToken=void 0,super.start()}U_(){this.Z_&&this.X_([])}z_(e,n){return this.connection.P_("Write",e,n)}j_(e){return ce(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,ce(!e.writeResults||e.writeResults.length===0,55816),this.listener.ea()}onNext(e){ce(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.F_.reset();const n=s2(e.writeResults,e.commitTime),r=Pn(e.commitTime);return this.listener.ta(r,n)}na(){const e={};e.database=Vf(this.serializer),this.k_(e)}X_(e){const n={streamToken:this.lastStreamToken,writes:e.map(r=>i2(this.serializer,r))};this.k_(n)}}/**
2888 * @license
2889 * Copyright 2017 Google LLC
2890 *
2891 * Licensed under the Apache License, Version 2.0 (the "License");
2892 * you may not use this file except in compliance with the License.
2893 * You may obtain a copy of the License at
2894 *
2895 *   http://www.apache.org/licenses/LICENSE-2.0
2896 *
2897 * Unless required by applicable law or agreed to in writing, software
2898 * distributed under the License is distributed on an "AS IS" BASIS,
2899 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2900 * See the License for the specific language governing permissions and
2901 * limitations under the License.
2902 */class Z2{}class eD extends Z2{constructor(e,n,r,i){super(),this.authCredentials=e,this.appCheckCredentials=n,this.connection=r,this.serializer=i,this.ra=!1}ia(){if(this.ra)throw new B(L.FAILED_PRECONDITION,"The client has already been terminated.")}Wo(e,n,r,i){return this.ia(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,o])=>this.connection.Wo(e,Df(n,r),i,s,o)).catch(s=>{throw s.name==="FirebaseError"?(s.code===L.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new B(L.UNKNOWN,s.toString())})}Jo(e,n,r,i,s){return this.ia(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,l])=>this.connection.Jo(e,Df(n,r),i,o,l,s)).catch(o=>{throw o.name==="FirebaseError"?(o.code===L.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new B(L.UNKNOWN,o.toString())})}terminate(){this.ra=!0,this.connection.terminate()}}class tD{constructor(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this.sa=0,this.oa=null,this._a=!0}aa(){this.sa===0&&(this.ua("Unknown"),this.oa=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.oa=null,this.ca("Backend didn't respond within 10 seconds."),this.ua("Offline"),Promise.resolve())))}la(e){this.state==="Online"?this.ua("Unknown"):(this.sa++,this.sa>=1&&(this.ha(),this.ca(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ua("Offline")))}set(e){this.ha(),this.sa=0,e==="Online"&&(this._a=!1),this.ua(e)}ua(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}ca(e){const n=`Could not reach Cloud Firestore backend. ${e}
2903This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this._a?(Yn(n),this._a=!1):H("OnlineStateTracker",n)}ha(){this.oa!==null&&(this.oa.cancel(),this.oa=null)}}/**
2904 * @license
2905 * Copyright 2017 Google LLC
2906 *
2907 * Licensed under the Apache License, Version 2.0 (the "License");
2908 * you may not use this file except in compliance with the License.
2909 * You may obtain a copy of the License at
2910 *
2911 *   http://www.apache.org/licenses/LICENSE-2.0
2912 *
2913 * Unless required by applicable law or agreed to in writing, software
2914 * distributed under the License is distributed on an "AS IS" BASIS,
2915 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2916 * See the License for the specific language governing permissions and
2917 * limitations under the License.
2918 */const Ti="RemoteStore";class nD{constructor(e,n,r,i,s){this.localStore=e,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.Pa=[],this.Ta=new Map,this.Ia=new Set,this.da=[],this.Ea=s,this.Ea.xo(o=>{r.enqueueAndForget(async()=>{xi(this)&&(H(Ti,"Restarting streams for network reachability change."),await async function(u){const c=Z(u);c.Ia.add(4),await ja(c),c.Aa.set("Unknown"),c.Ia.delete(4),await Jc(c)}(this))})}),this.Aa=new tD(r,i)}}async function Jc(t){if(xi(t))for(const e of t.da)await e(!0)}async function ja(t){for(const e of t.da)await e(!1)}function UI(t,e){const n=Z(t);n.Ta.has(e.targetId)||(n.Ta.set(e.targetId,e),Cm(n)?Rm(n):Bs(n).x_()&&Sm(n,e))}function Am(t,e){const n=Z(t),r=Bs(n);n.Ta.delete(e),r.x_()&&jI(n,e),n.Ta.size===0&&(r.x_()?r.B_():xi(n)&&n.Aa.set("Unknown"))}function Sm(t,e){if(t.Ra.$e(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(ee.min())>0){const n=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(n)}Bs(t).H_(e)}function jI(t,e){t.Ra.$e(e),Bs(t).Y_(e)}function Rm(t){t.Ra=new XN({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),Et:e=>t.Ta.get(e)||null,lt:()=>t.datastore.serializer.databaseId}),Bs(t).start(),t.Aa.aa()}function Cm(t){return xi(t)&&!Bs(t).M_()&&t.Ta.size>0}function xi(t){return Z(t).Ia.size===0}function zI(t){t.Ra=void 0}async function rD(t){t.Aa.set("Online")}async function iD(t){t.Ta.forEach((e,n)=>{Sm(t,e)})}async function sD(t,e){zI(t),Cm(t)?(t.Aa.la(e),Rm(t)):t.Aa.set("Unknown")}async function oD(t,e,n){if(t.Aa.set("Online"),e instanceof AI&&e.state===2&&e.cause)try{await async function(i,s){const o=s.cause;for(const l of s.targetIds)i.Ta.has(l)&&(await i.remoteSyncer.rejectListen(l,o),i.Ta.delete(l),i.Ra.removeTarget(l))}(t,e)}catch(r){H(Ti,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),await ic(t,r)}else if(e instanceof su?t.Ra.Ye(e):e instanceof II?t.Ra.it(e):t.Ra.et(e),!n.isEqual(ee.min()))try{const r=await LI(t.localStore);n.compareTo(r)>=0&&await function(s,o){const l=s.Ra.Pt(o);
2918return l.targetChanges.forEach((u,c)=>{if(u.resumeToken.approximateByteSize()>0){const d=s.Ta.get(c);d&&s.Ta.set(c,d.withResumeToken(u.resumeToken,o))}}),l.targetMismatches.forEach((u,c)=>{const d=s.Ta.get(u);if(!d)return;s.Ta.set(u,d.withResumeToken(tt.EMPTY_BYTE_STRING,d.snapshotVersion)),jI(s,u);const p=new Tr(d.target,u,c,d.sequenceNumber);Sm(s,p)}),s.remoteSyncer.applyRemoteEvent(l)}(t,n)}catch(r){H(Ti,"Failed to raise snapshot:",r),await ic(t,r)}}async function ic(t,e,n){if(!$s(e))throw e;t.Ia.add(1),await ja(t),t.Aa.set("Offline"),n||(n=()=>LI(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{H(Ti,"Retrying IndexedDB access"),await n(),t.Ia.delete(1),await Jc(t)})}function $I(t,e){return e().catch(n=>ic(t,n,e))}async function Zc(t){const e=Z(t),n=Wr(e);let r=e.Pa.length>0?e.Pa[e.Pa.length-1].batchId:cm;for(;aD(e);)try{const i=await $2(e.localStore,r);if(i===null){e.Pa.length===0&&n.B_();break}r=i.batchId,lD(e,i)}catch(i){await ic(e,i)}BI(e)&&WI(e)}function aD(t){return xi(t)&&t.Pa.length<10}function lD(t,e){t.Pa.push(e);const n=Wr(t);n.x_()&&n.Z_&&n.X_(e.mutations)}function BI(t){return xi(t)&&!Wr(t).M_()&&t.Pa.length>0}function WI(t){Wr(t).start()}async function uD(t){Wr(t).na()}async function cD(t){const e=Wr(t);for(const n of t.Pa)e.X_(n.mutations)}async function hD(t,e,n){const r=t.Pa.shift(),i=ym.from(r,e,n);await $I(t,()=>t.remoteSyncer.applySuccessfulWrite(i)),await Zc(t)}async function dD(t,e){e&&Wr(t).Z_&&await async function(r,i){if(function(o){return KN(o)&&o!==L.ABORTED}(i.code)){const s=r.Pa.shift();Wr(r).N_(),await $I(r,()=>r.remoteSyncer.rejectFailedWrite(s.batchId,i)),await Zc(r)}}(t,e),BI(t)&&WI(t)}async function Dv(t,e){const n=Z(t);n.asyncQueue.verifyOperationInProgress(),H(Ti,"RemoteStore received new credentials");const r=xi(n);n.Ia.add(3),await ja(n),r&&n.Aa.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.Ia.delete(3),await Jc(n)}async function fD(t,e){const n=Z(t);e?(n.Ia.delete(2),await Jc(n)):e||(n.Ia.add(2),await ja(n),n.Aa.set("Unknown"))}
2918function Bs(t){return t.Va||(t.Va=function(n,r,i){const s=Z(n);return s.ia(),new Y2(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(t.datastore,t.asyncQueue,{Zo:rD.bind(null,t),e_:iD.bind(null,t),n_:sD.bind(null,t),J_:oD.bind(null,t)}),t.da.push(async e=>{e?(t.Va.N_(),Cm(t)?Rm(t):t.Aa.set("Unknown")):(await t.Va.stop(),zI(t))})),t.Va}function Wr(t){return t.ma||(t.ma=function(n,r,i){const s=Z(n);return s.ia(),new J2(r,s.connection,s.authCredentials,s.appCheckCredentials,s.serializer,i)}(t.datastore,t.asyncQueue,{Zo:()=>Promise.resolve(),e_:uD.bind(null,t),n_:dD.bind(null,t),ea:cD.bind(null,t),ta:hD.bind(null,t)}),t.da.push(async e=>{e?(t.ma.N_(),await Zc(t)):(await t.ma.stop(),t.Pa.length>0&&(H(Ti,`Stopping write stream with ${t.Pa.length} pending writes`),t.Pa=[]))})),t.ma}/**
2919 * @license
2920 * Copyright 2017 Google LLC
2921 *
2922 * Licensed under the Apache License, Version 2.0 (the "License");
2923 * you may not use this file except in compliance with the License.
2924 * You may obtain a copy of the License at
2925 *
2926 *   http://www.apache.org/licenses/LICENSE-2.0
2927 *
2928 * Unless required by applicable law or agreed to in writing, software
2929 * distributed under the License is distributed on an "AS IS" BASIS,
2930 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2931 * See the License for the specific language governing permissions and
2932 * limitations under the License.
2933 */class Pm{constructor(e,n,r,i,s){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=i,this.removalCallback=s,this.deferred=new Rn,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(o=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,i,s){const o=Date.now()+r,l=new Pm(e,n,o,i,s);return l.start(r),l}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new B(L.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function km(t,e){if(Yn("AsyncQueue",`${e}: ${t}`),$s(t))return new B(L.UNAVAILABLE,`${e}: ${t}`);throw t}/**
2934 * @license
2935 * Copyright 2017 Google LLC
2936 *
2937 * Licensed under the Apache License, Version 2.0 (the "License");
2938 * you may not use this file except in compliance with the License.
2939 * You may obtain a copy of the License at
2940 *
2941 *   http://www.apache.org/licenses/LICENSE-2.0
2942 *
2943 * Unless required by applicable law or agreed to in writing, software
2944 * distributed under the License is distributed on an "AS IS" BASIS,
2945 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2946 * See the License for the specific language governing permissions and
2947 * limitations under the License.
2948 */class fs{static emptySet(e){return new fs(e.comparator)}constructor(e){this.comparator=e?(n,r)=>e(n,r)||Q.comparator(n.key,r.key):(n,r)=>Q.comparator(n.key,r.key),this.keyedMap=xo(),this.sortedSet=new Pe(this.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const n=this.keyedMap.get(e);return n?this.sortedSet.indexOf(n):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((n,r)=>(e(n),!1))}add(e){const n=this.delete(e.key);return n.copy(n.keyedMap.insert(e.key,e),n.sortedSet.insert(e,null))}delete(e){const n=this.get(e);return n?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(n)):this}isEqual(e){if(!(e instanceof fs)||this.size!==e.size)return!1;const n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;n.hasNext();){const i=n.getNext().key,s=r.getNext().key;if(!i.isEqual(s))return!1}return!0}toString(){const e=[];return this.forEach(n=>{e.push(n.toString())}),e.length===0?"DocumentSet ()":`DocumentSet (
2949  `+e.join(`  
2950`)+`
2951)`}copy(e,n){const r=new fs;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r}}/**
2952 * @license
2953 * Copyright 2017 Google LLC
2954 *
2955 * Licensed under the Apache License, Version 2.0 (the "License");
2956 * you may not use this file except in compliance with the License.
2957 * You may obtain a copy of the License at
2958 *
2959 *   http://www.apache.org/licenses/LICENSE-2.0
2960 *
2961 * Unless required by applicable law or agreed to in writing, software
2962 * distributed under the License is distributed on an "AS IS" BASIS,
2963 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2964 * See the License for the specific language governing permissions and
2965 * limitations under the License.
2966 */class Ov{constructor(){this.fa=new Pe(Q.comparator)}track(e){const n=e.doc.key,r=this.fa.get(n);r?e.type!==0&&r.type===3?this.fa=this.fa.insert(n,e):e.type===3&&r.type!==1?this.fa=this.fa.insert(n,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.fa=this.fa.insert(n,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.fa=this.fa.insert(n,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.fa=this.fa.remove(n):e.type===1&&r.type===2?this.fa=this.fa.insert(n,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.fa=this.fa.insert(n,{type:2,doc:e.doc}):Y(63341,{At:e,ga:r}):this.fa=this.fa.insert(n,e)}pa(){const e=[];return this.fa.inorderTraversal((n,r)=>{e.push(r)}),e}}class Ps{constructor(e,n,r,i,s,o,l,u,c){this.query=e,this.docs=n,this.oldDocs=r,this.docChanges=i,this.mutatedKeys=s,this.fromCache=o,this.syncStateChanged=l,this.excludesMetadataChanges=u,this.hasCachedResults=c}static fromInitialDocuments(e,n,r,i,s){const o=[];return n.forEach(l=>{o.push({type:0,doc:l})}),new Ps(e,n,fs.emptySet(n),o,r,i,!0,!1,s)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&qc(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const n=this.docChanges,r=e.docChanges;if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(n[i].type!==r[i].type||!n[i].doc.isEqual(r[i].doc))return!1;return!0}}/**
2967 * @license
2968 * Copyright 2017 Google LLC
2969 *
2970 * Licensed under the Apache License, Version 2.0 (the "License");
2971 * you may not use this file except in compliance with the License.
2972 * You may obtain a copy of the License at
2973 *
2974 *   http://www.apache.org/licenses/LICENSE-2.0
2975 *
2976 * Unless required by applicable law or agreed to in writing, software
2977 * distributed under the License is distributed on an "AS IS" BASIS,
2978 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2979 * See the License for the specific language governing permissions and
2980 * limitations under the License.
2981 */class pD{constructor(){this.ya=void 0,this.wa=[]}Sa(){return this.wa.some(e=>e.ba())}}class mD{constructor(){this.queries=Vv(),this.onlineState="Unknown",this.Da=new Set}terminate(){(function(n,r){const i=Z(n),s=i.queries;i.queries=Vv(),s.forEach((o,l)=>{for(const u of l.wa)u.onError(r)})})(this,new B(L.ABORTED,"Firestore shutting down"))}}function Vv(){return new ki(t=>uI(t),qc)}async function xm(t,e){const n=Z(t);let r=3;const i=e.query;let s=n.queries.get(i);s?!s.Sa()&&e.ba()&&(r=2):(s=new pD,r=e.ba()?0:1);try{switch(r){case 0:s.ya=await n.onListen(i,!0);break;case 1:s.ya=await n.onListen(i,!1);break;case 2:await n.onFirstRemoteStoreListen(i)}}catch(o){const l=km(o,`Initialization of query '${Bi(e.query)}' failed`);return void e.onError(l)}n.queries.set(i,s),s.wa.push(e),e.va(n.onlineState),s.ya&&e.Ca(s.ya)&&Nm(n)}async function bm(t,e){const n=Z(t),r=e.query;let i=3;const s=n.queries.get(r);if(s){const o=s.wa.indexOf(e);o>=0&&(s.wa.splice(o,1),s.wa.length===0?i=e.ba()?0:1:!s.Sa()&&e.ba()&&(i=2))}switch(i){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function gD(t,e){const n=Z(t);let r=!1;for(const i of e){const s=i.query,o=n.queries.get(s);if(o){for(const l of o.wa)l.Ca(i)&&(r=!0);o.ya=i}}r&&Nm(n)}function yD(t,e,n){const r=Z(t),i=r.queries.get(e);if(i)for(const s of i.wa)s.onError(n);r.queries.delete(e)}function Nm(t){t.Da.forEach(e=>{e.next()})}var Ff,Lv;(Lv=Ff||(Ff={})).Fa="default",Lv.Cache="cache";class Dm{constructor(e,n,r){this.query=e,this.Ma=n,this.xa=!1,this.Oa=null,this.onlineState="Unknown",this.options=r||{}}Ca(e){if(!this.options.includeMetadataChanges){const r=[];for(const i of e.docChanges)i.type!==3&&r.push(i);e=new Ps(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let n=!1;return this.xa?this.Na(e)&&(this.Ma.next(e),n=!0):this.Ba(e,this.onlineState)&&(this.La(e),n=!0),this.Oa=e,n}onError(e){this.Ma.error(e)}va(e){this.onlineState=e;let n=!1;return this.Oa&&!this.xa&&this.Ba(this.Oa,e)&&(this.La(this.Oa),n=!0),n}Ba(e,n){if(!e.fromCache||!this.ba())return!0;const r=n!=="Offline";return(!this.options.ka||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||n==="Offline")}Na(e){if(e.docChanges.length>0)return!0;const n=this.Oa&&this.Oa.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}La(e){e=Ps.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.xa=!0,this.Ma.next(e)}ba(){return this.options.source!==Ff.Cache}}/**
2982 * @license
2983 * Copyright 2017 Google LLC
2984 *
2985 * Licensed under the Apache License, Version 2.0 (the "License");
2986 * you may not use this file except in compliance with the License.
2987 * You may obtain a copy of the License at
2988 *
2989 *   http://www.apache.org/licenses/LICENSE-2.0
2990 *
2991 * Unless required by applicable law or agreed to in writing, software
2992 * distributed under the License is distributed on an "AS IS" BASIS,
2993 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2994 * See the License for the specific language governing permissions and
2995 * limitations under the License.
2996 */class qI{constructor(e){this.key=e}}class HI{constructor(e){this.key=e}}class _D{constructor(e,n){this.query=e,this.Ha=n,this.Ya=null,this.hasCachedResults=!1,this.current=!1,this.Za=se(),this.mutatedKeys=se(),this.Xa=cI(e),this.eu=new fs(this.Xa)}get tu(){return this.Ha}nu(e,n){const r=n?n.ru:new Ov,i=n?n.eu:this.eu;let s=n?n.mutatedKeys:this.mutatedKeys,o=i,l=!1;const u=this.query.limitType==="F"&&i.size===this.query.limit?i.last():null,c=this.query.limitType==="L"&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((d,p)=>{const m=i.get(d),v=Hc(this.query,p)?p:null,w=!!m&&this.mutatedKeys.has(m.key),P=!!v&&(v.hasLocalMutations||this.mutatedKeys.has(v.key)&&v.hasCommittedMutations);let C=!1;m&&v?m.data.isEqual(v.data)?w!==P&&(r.track({type:3,doc:v}),C=!0):this.iu(m,v)||(r.track({type:2,doc:v}),C=!0,(u&&this.Xa(v,u)>0||c&&this.Xa(v,c)<0)&&(l=!0)):!m&&v?(r.track({type:0,doc:v}),C=!0):m&&!v&&(r.track({type:1,doc:m}),C=!0,(u||c)&&(l=!0)),C&&(v?(o=o.add(v),s=P?s.add(d):s.delete(d)):(o=o.delete(d),s=s.delete(d)))}),this.query.limit!==null)for(;o.size>this.query.limit;){const d=this.query.limitType==="F"?o.last():o.first();o=o.delete(d.key),s=s.delete(d.key),r.track({type:1,doc:d})}return{eu:o,ru:r,Ds:l,mutatedKeys:s}}iu(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(e,n,r,i){const s=this.eu;this.eu=e.eu,this.mutatedKeys=e.mutatedKeys;const o=e.ru.pa();o.sort((d,p)=>function(v,w){const P=C=>{switch(C){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Y(20277,{At:C})}};return P(v)-P(w)}(d.type,p.type)||this.Xa(d.doc,p.doc)),this.su(r),i=i!=null&&i;const l=n&&!i?this.ou():[],u=this.Za.size===0&&this.current&&!i?1:0,c=u!==this.Ya;return this.Ya=u,o.length!==0||c?{snapshot:new Ps(this.query,e.eu,s,o,e.mutatedKeys,u===0,c,!1,!!r&&r.resumeToken.approximateByteSize()>0),_u:l}:{_u:l}}va(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({eu:this.eu,ru:new Ov,mutatedKeys:this.mutatedKeys,Ds:!1},!1)):{_u:[]}}au(e){return!this.Ha.has(e)&&!!this.eu.has(e)&&!this.eu.get(e).hasLocalMutations}su(e){e&&(e.addedDocuments.forEach(n=>this.Ha=this.Ha.add(n)),e.modifiedDocuments.forEach(n=>{}),e.removedDocuments.forEach(n=>this.Ha=this.Ha.delete(n)),this.current=e.current)}ou(){if(!this.current)return[];const e=this.Za;this.Za=se(),this.eu.forEach(r=>{this.au(r.key)&&(this.Za=this.Za.add(r.key))});const n=[];return e.forEach(r=>{this.Za.has(r)||n.push(new HI(r))}
2996),this.Za.forEach(r=>{e.has(r)||n.push(new qI(r))}),n}uu(e){this.Ha=e.qs,this.Za=se();const n=this.nu(e.documents);return this.applyChanges(n,!0)}cu(){return Ps.fromInitialDocuments(this.query,this.eu,this.mutatedKeys,this.Ya===0,this.hasCachedResults)}}const Om="SyncEngine";class vD{constructor(e,n,r){this.query=e,this.targetId=n,this.view=r}}class ED{constructor(e){this.key=e,this.lu=!1}}class wD{constructor(e,n,r,i,s,o){this.localStore=e,this.remoteStore=n,this.eventManager=r,this.sharedClientState=i,this.currentUser=s,this.maxConcurrentLimboResolutions=o,this.hu={},this.Pu=new ki(l=>uI(l),qc),this.Tu=new Map,this.Iu=new Set,this.du=new Pe(Q.comparator),this.Eu=new Map,this.Au=new Em,this.Ru={},this.Vu=new Map,this.mu=Cs.ur(),this.onlineState="Unknown",this.fu=void 0}get isPrimaryClient(){return this.fu===!0}}async function TD(t,e,n=!0){const r=JI(t);let i;const s=r.Pu.get(e);return s?(r.sharedClientState.addLocalQueryTarget(s.targetId),i=s.view.cu()):i=await GI(r,e,n,!0),i}async function ID(t,e){const n=JI(t);await GI(n,e,!0,!1)}async function GI(t,e,n,r){const i=await B2(t.localStore,Cn(e)),s=i.targetId,o=t.sharedClientState.addLocalQueryTarget(s,n);let l;return r&&(l=await AD(t,e,s,o==="current",i.resumeToken)),t.isPrimaryClient&&n&&UI(t.remoteStore,i),l}async function AD(t,e,n,r,i){t.gu=(p,m,v)=>async function(P,C,E,g){let T=C.view.nu(E);T.Ds&&(T=await Pv(P.localStore,C.query,!1).then(({documents:I})=>C.view.nu(I,T)));const x=g&&g.targetChanges.get(C.targetId),F=g&&g.targetMismatches.get(C.targetId)!=null,U=C.view.applyChanges(T,P.isPrimaryClient,x,F);return Fv(P,C.targetId,U._u),U.snapshot}(t,p,m,v);const s=await Pv(t.localStore,e,!0),o=new _D(e,s.qs),l=o.nu(s.documents),u=Ua.createSynthesizedTargetChangeForCurrentChange(n,r&&t.onlineState!=="Offline",i),c=o.applyChanges(l,t.isPrimaryClient,u);Fv(t,n,c._u);const d=new vD(e,n,o);return t.Pu.set(e,d),t.Tu.has(n)?t.Tu.get(n).push(e):t.Tu.set(n,[e]),c.snapshot}async function SD(t,e,n){const r=Z(t),i=r.Pu.get(e),s=r.Tu.get(i.targetId);if(s.length>1)return r.Tu.set(i.targetId,s.filter(o=>!qc(o,e))),void r.Pu.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedCl
2996ientState.isActiveQueryTarget(i.targetId)||await Lf(r.localStore,i.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(i.targetId),n&&Am(r.remoteStore,i.targetId),Uf(r,i.targetId)}).catch(zs)):(Uf(r,i.targetId),await Lf(r.localStore,i.targetId,!0))}async function RD(t,e){const n=Z(t),r=n.Pu.get(e),i=n.Tu.get(r.targetId);n.isPrimaryClient&&i.length===1&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),Am(n.remoteStore,r.targetId))}async function CD(t,e,n){const r=OD(t);try{const i=await function(o,l){const u=Z(o),c=Ee.now(),d=l.reduce((v,w)=>v.add(w.key),se());let p,m;return u.persistence.runTransaction("Locally write mutations","readwrite",v=>{let w=Jn(),P=se();return u.Os.getEntries(v,d).next(C=>{w=C,w.forEach((E,g)=>{g.isValidDocument()||(P=P.add(E))})}).next(()=>u.localDocuments.getOverlayedDocuments(v,w)).next(C=>{p=C;const E=[];for(const g of l){const T=$N(g,p.get(g.key).overlayedDocument);T!=null&&E.push(new Yr(g.key,T,eI(T.value.mapValue),_t.exists(!0)))}return u.mutationQueue.addMutationBatch(v,c,E,l)}).next(C=>{m=C;const E=C.applyToLocalDocumentSet(p,P);return u.documentOverlayCache.saveOverlays(v,C.batchId,E)})}).then(()=>({batchId:m.batchId,changes:dI(p)}))}(r.localStore,e);r.sharedClientState.addPendingMutation(i.batchId),function(o,l,u){let c=o.Ru[o.currentUser.toKey()];c||(c=new Pe(ne)),c=c.insert(l,u),o.Ru[o.currentUser.toKey()]=c}(r,i.batchId,n),await za(r,i.changes),await Zc(r.remoteStore)}catch(i){const s=km(i,"Failed to persist write");n.reject(s)}}async function KI(t,e){const n=Z(t);try{const r=await j2(n.localStore,e);
2996e.targetChanges.forEach((i,s)=>{const o=n.Eu.get(s);o&&(ce(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1,22616),i.addedDocuments.size>0?o.lu=!0:i.modifiedDocuments.size>0?ce(o.lu,14607):i.removedDocuments.size>0&&(ce(o.lu,42227),o.lu=!1))}),await za(n,r,e)}catch(r){await zs(r)}}function Mv(t,e,n){const r=Z(t);if(r.isPrimaryClient&&n===0||!r.isPrimaryClient&&n===1){const i=[];r.Pu.forEach((s,o)=>{const l=o.view.va(e);l.snapshot&&i.push(l.snapshot)}),function(o,l){const u=Z(o);u.onlineState=l;let c=!1;u.queries.forEach((d,p)=>{for(const m of p.wa)m.va(l)&&(c=!0)}),c&&Nm(u)}(r.eventManager,e),i.length&&r.hu.J_(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function PD(t,e,n){const r=Z(t);r.sharedClientState.updateQueryState(e,"rejected",n);const i=r.Eu.get(e),s=i&&i.key;if(s){let o=new Pe(Q.comparator);o=o.insert(s,ct.newNoDocument(s,ee.min()));const l=se().add(s),u=new Xc(ee.min(),new Map,new Pe(ne),o,l);await KI(r,u),r.du=r.du.remove(s),r.Eu.delete(e),Vm(r)}else await Lf(r.localStore,e,!1).then(()=>Uf(r,e,n)).catch(zs)}async function kD(t,e){const n=Z(t),r=e.batch.batchId;try{const i=await U2(n.localStore,e);XI(n,r,null),QI(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await za(n,i)}catch(i){await zs(i)}}async function xD(t,e,n){const r=Z(t);try{const i=await function(o,l){const u=Z(o);return u.persistence.runTransaction("Reject batch","readwrite-primary",c=>{let d;return u.mutationQueue.lookupMutationBatch(c,l).next(p=>(ce(p!==null,37113),d=p.keys(),u.mutationQueue.removeMutationBatch(c,p))).next(()=>u.mutationQueue.performConsistencyCheck(c)).next(()=>u.documentOverlayCache.removeOverlaysForBatchId(c,d,l)).next(()=>u.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(c,d)).next(()=>u.localDocuments.getDocuments(c,d))})}(r.localStore,e);XI(r,e,n),QI(r,e),r.sharedClientState.updateMutationState(e,"rejected",n),await za(r,i)}catch(i){await zs(i)}}function QI(t,e){(t.Vu.get(e)||[]).forEach(n=>{n.resolve()}),t.Vu.delete(e)}function XI(t,e,n){const r=Z(t);let i=r.Ru[r.currentUser.toKey()];if(i){const s=i.get(e);s&&(n?s.reject(n):s.resolve(),i=i.remove(e)),r.Ru[r.currentUser.toKey()]=i}}
2996function Uf(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const r of t.Tu.get(e))t.Pu.delete(r),n&&t.hu.pu(r,n);t.Tu.delete(e),t.isPrimaryClient&&t.Au.zr(e).forEach(r=>{t.Au.containsKey(r)||YI(t,r)})}function YI(t,e){t.Iu.delete(e.path.canonicalString());const n=t.du.get(e);n!==null&&(Am(t.remoteStore,n),t.du=t.du.remove(e),t.Eu.delete(n),Vm(t))}function Fv(t,e,n){for(const r of n)r instanceof qI?(t.Au.addReference(r.key,e),bD(t,r)):r instanceof HI?(H(Om,"Document no longer in limbo: "+r.key),t.Au.removeReference(r.key,e),t.Au.containsKey(r.key)||YI(t,r.key)):Y(19791,{yu:r})}function bD(t,e){const n=e.key,r=n.path.canonicalString();t.du.get(n)||t.Iu.has(r)||(H(Om,"New document in limbo: "+n),t.Iu.add(r),Vm(t))}function Vm(t){for(;t.Iu.size>0&&t.du.size<t.maxConcurrentLimboResolutions;){const e=t.Iu.values().next().value;t.Iu.delete(e);const n=new Q(ge.fromString(e)),r=t.mu.next();t.Eu.set(r,new ED(n)),t.du=t.du.insert(n,r),UI(t.remoteStore,new Tr(Cn(Wc(n.path)),r,"TargetPurposeLimboResolution",zc.ue))}}async function za(t,e,n){const r=Z(t),i=[],s=[],o=[];r.Pu.isEmpty()||(r.Pu.forEach((l,u)=>{o.push(r.gu(u,e,n).then(c=>{var d;if((c||n)&&r.isPrimaryClient){const p=c?!c.fromCache:(d=n==null?void 0:n.targetChanges.get(u.targetId))===null||d===void 0?void 0:d.current;
2996r.sharedClientState.updateQueryState(u.targetId,p?"current":"not-current")}if(c){i.push(c);const p=Tm.Es(u.targetId,c);s.push(p)}}))}),await Promise.all(o),r.hu.J_(i),await async function(u,c){const d=Z(u);try{await d.persistence.runTransaction("notifyLocalViewChanges","readwrite",p=>M.forEach(c,m=>M.forEach(m.Is,v=>d.persistence.referenceDelegate.addReference(p,m.targetId,v)).next(()=>M.forEach(m.ds,v=>d.persistence.referenceDelegate.removeReference(p,m.targetId,v)))))}catch(p){if(!$s(p))throw p;H(Im,"Failed to update sequence numbers: "+p)}for(const p of c){const m=p.targetId;if(!p.fromCache){const v=d.Fs.get(m),w=v.snapshotVersion,P=v.withLastLimboFreeSnapshotVersion(w);d.Fs=d.Fs.insert(m,P)}}}(r.localStore,s))}async function ND(t,e){const n=Z(t);if(!n.currentUser.isEqual(e)){H(Om,"User change. New user:",e.toKey());const r=await VI(n.localStore,e);n.currentUser=e,function(s,o){s.Vu.forEach(l=>{l.forEach(u=>{u.reject(new B(L.CANCELLED,o))})}),s.Vu.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await za(n,r.Bs)}}function DD(t,e){const n=Z(t),r=n.Eu.get(e);if(r&&r.lu)return se().add(r.key);{let i=se();const s=n.Tu.get(e);if(!s)return i;for(const o of s){const l=n.Pu.get(o);i=i.unionWith(l.view.tu)}return i}}function JI(t){const e=Z(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=KI.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=DD.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=PD.bind(null,e),e.hu.J_=gD.bind(null,e.eventManager),e.hu.pu=yD.bind(null,e.eventManager),e}function OD(t){const e=Z(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=kD.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=xD.bind(null,e),e}class sc{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=Yc(e.databaseInfo.databaseId),this.sharedClientState=this.bu(e),this.persistence=this.Du(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Cu(e,this.localStore),this.indexBackfillerScheduler=this.Fu(e,this.localStore)}Cu(e,n){return null}Fu(e,n){return null}vu(e){return F2(this.persistence,new V2,e.initialUser,this.serializer)}Du(e){return new OI(wm.Vi,this.serializer)}bu(e){return new q2}async terminate(){var e,n;(e=this.gcScheduler)===null||e===void 0||e.stop(),(n=this.indexBackfillerScheduler)===null||n===void 0||n.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}sc.provider={build:()=>new sc};class VD extends sc{constructor(e){super(),this.cacheSizeBytes=e}Cu(e,n){ce(this.persistence.referenceDelegate instanceof rc,46915);const r=this.persistence.referenceDelegate.garbageCollector;return new E2(r,e.asyncQueue,n)}Du(e){const n=this.cacheSizeBytes!==void 0?It.withCacheSize(this.cacheSizeBytes):It.DEFAULT;return new OI(r=>rc.Vi(r,n),this.serializer)}}class jf{async initialize(e,n){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>Mv(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=ND.bind(null,this.syncEngine),await fD(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new mD}()}createDatastore(e){const n=Yc(e.databaseInfo.databaseId),r=function(s){return new X2(s)}(e.databaseInfo);return function(s,o,l,u){return new eD(s,o,l,u)}(e.authCredentials,e.appCheckCredentials,r,n)}createRemoteStore(e){return function(r,i,s,o,l){return new nD(r,i,s,o,l)}(this.localStore,this.datastore,e.asyncQueue,n=>Mv(this.syncEngine,n,0),function(){return bv.C()?new bv:new H2}())}createSyncEngine(e,n){return function(i,s,o,l,u,c,d){const p=new wD(i,s,o,l,u,c);return d&&(p.fu=!0),p}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,n)}async terminate(){var e,n;await async function(i){const s=Z(i);H(Ti,"RemoteStore shutting down."),s.Ia.add(5),await ja(s),s.Ea.shutdown(),s.Aa.set("Unknown")}(this.remoteStore),(e=this.datastore)===null||e===void 0||e.terminate(),(n=this.eventManager)===null||n===void 0||n.terminate()}}jf.provider={build:()=>new jf};/**
2997 * @license
2998 * Copyright 2020 Google LLC
2999 *
3000 * Licensed under the Apache License, Version 2.0 (the "License");
3001 * you may not use this file except in compliance with the License.
3002 * You may obtain a copy of the License at
3003 *
3004 *   http://www.apache.org/licenses/LICENSE-2.0
3005 *
3006 * Unless required by applicable law or agreed to in writing, software
3007 * distributed under the License is distributed on an "AS IS" BASIS,
3008 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3009 * See the License for the specific language governing permissions and
3010 * limitations under the License.
3011 *//**
3012 * @license
3013 * Copyright 2017 Google LLC
3014 *
3015 * Licensed under the Apache License, Version 2.0 (the "License");
3016 * you may not use this file except in compliance with the License.
3017 * You may obtain a copy of the License at
3018 *
3019 *   http://www.apache.org/licenses/LICENSE-2.0
3020 *
3021 * Unless required by applicable law or agreed to in writing, software
3022 * distributed under the License is distributed on an "AS IS" BASIS,
3023 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3024 * See the License for the specific language governing permissions and
3025 * limitations under the License.
3026 */class Lm{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.xu(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.xu(this.observer.error,e):Yn("Uncaught Error in snapshot listener:",e.toString()))}Ou(){this.muted=!0}xu(e,n){setTimeout(()=>{this.muted||e(n)},0)}}/**
3027 * @license
3028 * Copyright 2017 Google LLC
3029 *
3030 * Licensed under the Apache License, Version 2.0 (the "License");
3031 * you may not use this file except in compliance with the License.
3032 * You may obtain a copy of the License at
3033 *
3034 *   http://www.apache.org/licenses/LICENSE-2.0
3035 *
3036 * Unless required by applicable law or agreed to in writing, software
3037 * distributed under the License is distributed on an "AS IS" BASIS,
3038 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3039 * See the License for the specific language governing permissions and
3040 * limitations under the License.
3041 */const qr="FirestoreClient";class LD{constructor(e,n,r,i,s){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=i,this.user=lt.UNAUTHENTICATED,this.clientId=lm.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=s,this.authCredentials.start(r,async o=>{H(qr,"Received user=",o.uid),await this.authCredentialListener(o),this.user=o}),this.appCheckCredentials.start(r,o=>(H(qr,"Received new app check token=",o),this.appCheckCredentialListener(o,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new Rn;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){const r=km(n,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}async function hd(t,e){t.asyncQueue.verifyOperationInProgress(),H(qr,"Initializing OfflineComponentProvider");const n=t.configuration;await e.initialize(n);let r=n.initialUser;t.setCredentialChangeListener(async i=>{r.isEqual(i)||(await VI(e.localStore,i),r=i)}),e.persistence.setDatabaseDeletedListener(()=>{Ur("Terminating Firestore due to IndexedDb database deletion"),t.terminate().then(()=>{H("Terminating Firestore due to IndexedDb database deletion completed successfully")}).catch(i=>{Ur("Terminating Firestore due to IndexedDb database deletion failed",i)})}),t._offlineComponents=e}async function Uv(t,e){t.asyncQueue.verifyOperationInProgress();const n=await MD(t);H(qr,"Initializing OnlineComponentProvider"),await e.initialize(n,t.configuration),t.setCredentialChangeListener(r=>Dv(e.remoteStore,r)),t.setAppCheckTokenChangeListener((r,i)=>Dv(e.remoteStore,i)),t._onlineComponents=e}async function MD(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){H(qr,"Using user provided OfflineComponentProvider");try{await hd(t,t._uninitializedComponentsProvider._offline)}catch(e){const n=e;if(!function(i){return i.name==="FirebaseError"?i.code===L.FAILED_PRECONDITION||i.code===L.UNIMPLEMENT
3041ED:!(typeof DOMException<"u"&&i instanceof DOMException)||i.code===22||i.code===20||i.code===11}(n))throw n;Ur("Error using user provided cache. Falling back to memory cache: "+n),await hd(t,new sc)}}else H(qr,"Using default OfflineComponentProvider"),await hd(t,new VD(void 0));return t._offlineComponents}async function Mm(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(H(qr,"Using user provided OnlineComponentProvider"),await Uv(t,t._uninitializedComponentsProvider._online)):(H(qr,"Using default OnlineComponentProvider"),await Uv(t,new jf))),t._onlineComponents}function FD(t){return Mm(t).then(e=>e.syncEngine)}function UD(t){return Mm(t).then(e=>e.datastore)}async function oc(t){const e=await Mm(t),n=e.eventManager;return n.onListen=TD.bind(null,e.syncEngine),n.onUnlisten=SD.bind(null,e.syncEngine),n.onFirstRemoteStoreListen=ID.bind(null,e.syncEngine),n.onLastRemoteStoreUnlisten=RD.bind(null,e.syncEngine),n}function jD(t,e,n={}){const r=new Rn;return t.asyncQueue.enqueueAndForget(async()=>function(s,o,l,u,c){const d=new Lm({next:m=>{d.Ou(),o.enqueueAndForget(()=>bm(s,p));const v=m.docs.has(l);!v&&m.fromCache?c.reject(new B(L.UNAVAILABLE,"Failed to get document because the client is offline.")):v&&m.fromCache&&u&&u.source==="server"?c.reject(new B(L.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):c.resolve(m)},error:m=>c.reject(m)}),p=new Dm(Wc(l.path),d,{includeMetadataChanges:!0,ka:!0});return xm(s,p)}(await oc(t),t.asyncQueue,e,n,r)),r.promise}function zD(t,e,n={}){const r=new Rn;return t.asyncQueue.enqueueAndForget(async()=>function(s,o,l,u,c){const d=new Lm({next:m=>{d.Ou(),o.enqueueAndForget(()=>bm(s,p)),m.fromCache&&u.source==="server"?c.reject(new B(L.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):c.resolve(m)},error:m=>c.reject(m)}),p=new Dm(l,d,{includeMetadataChanges:!0,ka:!0});return xm(s,p)}(await oc(t),t.asyncQueue,e,n,r)),r.promise}function $D(t,e,n){const r=new Rn;return t.asyncQueue.enqueueAndForget(async()=>{try{const i=await UD(t);r.resolve(async function(o,l,u){var c;const d=Z(o),{request:p,ft:m,parent:v}=a2(d.serializer,kN(l),u);d.connection.Qo||delete p.parent;const w=(await d.Jo("RunAggregationQuery",d.serializer.databaseId,v,p,1)).filter(C=>!!C.result);ce(w.length===1,64727);const P=(c=w[0].result)===null||c===void 0?void 0:c.aggregateFields;return Object.keys(P).reduce((C,E)=>(C[m[E]]=P[E],C),{})}(i,e,n))}catch(i){r.reject(i)}}),r.promise}/**
3042 * @license
3043 * Copyright 2023 Google LLC
3044 *
3045 * Licensed under the Apache License, Version 2.0 (the "License");
3046 * you may not use this file except in compliance with the License.
3047 * You may obtain a copy of the License at
3048 *
3049 *   http://www.apache.org/licenses/LICENSE-2.0
3050 *
3051 * Unless required by applicable law or agreed to in writing, software
3052 * distributed under the License is distributed on an "AS IS" BASIS,
3053 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3054 * See the License for the specific language governing permissions and
3055 * limitations under the License.
3056 */function ZI(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}/**
3057 * @license
3058 * Copyright 2020 Google LLC
3059 *
3060 * Licensed under the Apache License, Version 2.0 (the "License");
3061 * you may not use this file except in compliance with the License.
3062 * You may obtain a copy of the License at
3063 *
3064 *   http://www.apache.org/licenses/LICENSE-2.0
3065 *
3066 * Unless required by applicable law or agreed to in writing, software
3067 * distributed under the License is distributed on an "AS IS" BASIS,
3068 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3069 * See the License for the specific language governing permissions and
3070 * limitations under the License.
3071 */const jv=new Map;/**
3072 * @license
3073 * Copyright 2020 Google LLC
3074 *
3075 * Licensed under the Apache License, Version 2.0 (the "License");
3076 * you may not use this file except in compliance with the License.
3077 * You may obtain a copy of the License at
3078 *
3079 *   http://www.apache.org/licenses/LICENSE-2.0
3080 *
3081 * Unless required by applicable law or agreed to in writing, software
3082 * distributed under the License is distributed on an "AS IS" BASIS,
3083 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3084 * See the License for the specific language governing permissions and
3085 * limitations under the License.
3086 */const e1="firestore.googleapis.com",zv=!0;class $v{constructor(e){var n,r;if(e.host===void 0){if(e.ssl!==void 0)throw new B(L.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=e1,this.ssl=zv}else this.host=e.host,this.ssl=(n=e.ssl)!==null&&n!==void 0?n:zv;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=DI;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<_2)throw new B(L.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}tN("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=ZI((r=e.experimentalLongPollingOptions)!==null&&r!==void 0?r:{}),function(s){if(s.timeoutSeconds!==void 0){if(isNaN(s.timeoutSeconds))throw new B(L.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (must not be NaN)`);if(s.timeoutSeconds<5)throw new B(L.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (minimum allowed value is 5)`);if(s.timeoutSeconds>30)throw new B(L.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(r,i){return r.timeoutSeconds===i.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class $a{constructor(e,n,r,i){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new $v({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new B(L.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new B(L.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new $v(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new Hb;switch(r.type){case"firstParty":return new Xb(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new B(L.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const r=jv.get(n);r&&(H("ComponentProvider","Removing Datastore"),jv.delete(n),r.terminate())}(this),Promise.resolve()}}function BD(t,e,n,r={}){var i;t=Ze(t,$a);const s=nr(e),o=t._getSettings(),l=Object.assign(Object.assign({},o),{emulatorOptions:t._getEmulatorOptions()}),u=`${e}:${n}`;s&&(Dc(`https://${u}`),Oc("Firestore",!0)),o.host!==e1&&o.host!==u&&Ur("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const c=Object.assign(Object.assign({},o),{host:u,ssl:s,emulatorOptions:r});if(!Fr(c,l)&&(t._setSettings(c),r.mockUserToken)){let d,p;
3086if(typeof r.mockUserToken=="string")d=r.mockUserToken,p=lt.MOCK_USER;else{d=Qw(r.mockUserToken,(i=t._app)===null||i===void 0?void 0:i.options.projectId);const m=r.mockUserToken.sub||r.mockUserToken.user_id;if(!m)throw new B(L.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");p=new lt(m)}t._authCredentials=new Gb(new $T(d,p))}}/**
3087 * @license
3088 * Copyright 2020 Google LLC
3089 *
3090 * Licensed under the Apache License, Version 2.0 (the "License");
3091 * you may not use this file except in compliance with the License.
3092 * You may obtain a copy of the License at
3093 *
3094 *   http://www.apache.org/licenses/LICENSE-2.0
3095 *
3096 * Unless required by applicable law or agreed to in writing, software
3097 * distributed under the License is distributed on an "AS IS" BASIS,
3098 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3099 * See the License for the specific language governing permissions and
3100 * limitations under the License.
3101 */class On{constructor(e,n,r){this.converter=n,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new On(this.firestore,e,this._query)}}class be{constructor(e,n,r){this.converter=n,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Vr(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new be(this.firestore,e,this._key)}toJSON(){return{type:be._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,n,r){if(Ma(n,be._jsonSchema))return new be(e,r||null,new Q(ge.fromString(n.referencePath)))}}be._jsonSchemaVersion="firestore/documentReference/1.0",be._jsonSchema={type:Ue("string",be._jsonSchemaVersion),referencePath:Ue("string")};class Vr extends On{constructor(e,n,r){super(e,n,Wc(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new be(this.firestore,null,new Q(e))}withConverter(e){return new Vr(this.firestore,e,this._path)}}function ks(t,e,...n){if(t=he(t),um("collection","path",e),t instanceof $a){const r=ge.fromString(e,...n);return tv(r),new Vr(t,null,r)}{if(!(t instanceof be||t instanceof Vr))throw new B(L.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(ge.fromString(e,...n));return tv(r),new Vr(t.firestore,null,r)}}function rF(t,e){if(t=Ze(t,$a),um("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new B(L.INVALID_ARGUMENT,`Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new On(t,null,function(r){return new Pi(ge.emptyPath(),r)}(e))}function t1(t,e,...n){if(t=he(t),arguments.length===1&&(e=lm.newId()),um("doc","path",e),t instanceof $a){const r=ge.fromString(e,...n);return ev(r),new be(t,null,new Q(r))}{if(!(t instanceof be||t instanceof Vr))throw new B(L.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(ge.fromString(e,...n));return ev(r),new be(t.firestore,t instanceof Vr?t.converter:null,new Q(r))}}/**
3102 * @license
3103 * Copyright 2020 Google LLC
3104 *
3105 * Licensed under the Apache License, Version 2.0 (the "License");
3106 * you may not use this file except in compliance with the License.
3107 * You may obtain a copy of the License at
3108 *
3109 *   http://www.apache.org/licenses/LICENSE-2.0
3110 *
3111 * Unless required by applicable law or agreed to in writing, software
3112 * distributed under the License is distributed on an "AS IS" BASIS,
3113 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3114 * See the License for the specific language governing permissions and
3115 * limitations under the License.
3116 */const Bv="AsyncQueue";class Wv{constructor(e=Promise.resolve()){this.Zu=[],this.Xu=!1,this.ec=[],this.tc=null,this.nc=!1,this.rc=!1,this.sc=[],this.F_=new MI(this,"async_queue_retry"),this.oc=()=>{const r=cd();r&&H(Bv,"Visibility state changed to "+r.visibilityState),this.F_.y_()},this._c=e;const n=cd();n&&typeof n.addEventListener=="function"&&n.addEventListener("visibilitychange",this.oc)}get isShuttingDown(){return this.Xu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.ac(),this.uc(e)}enterRestrictedMode(e){if(!this.Xu){this.Xu=!0,this.rc=e||!1;const n=cd();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.oc)}}enqueue(e){if(this.ac(),this.Xu)return new Promise(()=>{});const n=new Rn;return this.uc(()=>this.Xu&&this.rc?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Zu.push(e),this.cc()))}async cc(){if(this.Zu.length!==0){try{await this.Zu[0](),this.Zu.shift(),this.F_.reset()}catch(e){if(!$s(e))throw e;H(Bv,"Operation failed with retryable error: "+e)}this.Zu.length>0&&this.F_.g_(()=>this.cc())}}uc(e){const n=this._c.then(()=>(this.nc=!0,e().catch(r=>{throw this.tc=r,this.nc=!1,Yn("INTERNAL UNHANDLED ERROR: ",qv(r)),r}).then(r=>(this.nc=!1,r))));return this._c=n,n}enqueueAfterDelay(e,n,r){this.ac(),this.sc.indexOf(e)>-1&&(n=0);const i=Pm.createAndSchedule(this,e,n,r,s=>this.lc(s));return this.ec.push(i),i}ac(){this.tc&&Y(47125,{hc:qv(this.tc)})}verifyOperationInProgress(){}async Pc(){let e;do e=this._c,await e;while(e!==this._c)}Tc(e){for(const n of this.ec)if(n.timerId===e)return!0;return!1}Ic(e){return this.Pc().then(()=>{this.ec.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this.ec)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.Pc()})}dc(e){this.sc.push(e)}lc(e){const n=this.ec.indexOf(e);this.ec.splice(n,1)}}function qv(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+`
3117`+t.stack),e}/**
3118 * @license
3119 * Copyright 2017 Google LLC
3120 *
3121 * Licensed under the Apache License, Version 2.0 (the "License");
3122 * you may not use this file except in compliance with the License.
3123 * You may obtain a copy of the License at
3124 *
3125 *   http://www.apache.org/licenses/LICENSE-2.0
3126 *
3127 * Unless required by applicable law or agreed to in writing, software
3128 * distributed under the License is distributed on an "AS IS" BASIS,
3129 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3130 * See the License for the specific language governing permissions and
3131 * limitations under the License.
3132 */function Hv(t){return function(n,r){if(typeof n!="object"||n===null)return!1;const i=n;for(const s of r)if(s in i&&typeof i[s]=="function")return!0;return!1}(t,["next","error","complete"])}class fn extends $a{constructor(e,n,r,i){super(e,n,r,i),this.type="firestore",this._queue=new Wv,this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new Wv(e),this._firestoreClient=void 0,await e}}}function WD(t,e){const n=typeof t=="object"?t:Lc(),r=typeof t=="string"?t:Ju,i=Na(n,"firestore").getImmediate({identifier:r});if(!i._initialized){const s=Xp("firestore");s&&BD(i,...s)}return i}function Ws(t){if(t._terminated)throw new B(L.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||qD(t),t._firestoreClient}function qD(t){var e,n,r;const i=t._freezeSettings(),s=function(l,u,c,d){return new pN(l,u,c,d.host,d.ssl,d.experimentalForceLongPolling,d.experimentalAutoDetectLongPolling,ZI(d.experimentalLongPollingOptions),d.useFetchStreams,d.isUsingEmulator)}(t._databaseId,((e=t._app)===null||e===void 0?void 0:e.options.appId)||"",t._persistenceKey,i);t._componentsProvider||!((n=i.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((r=i.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(t._componentsProvider={_offline:i.localCache._offlineComponentProvider,_online:i.localCache._onlineComponentProvider}),t._firestoreClient=new LD(t._authCredentials,t._appCheckCredentials,t._queue,s,t._componentsProvider&&function(l){const u=l==null?void 0:l._online.build();return{_offline:l==null?void 0:l._offline.build(u),_online:u}}(t._componentsProvider))}/**
3133 * @license
3134 * Copyright 2020 Google LLC
3135 *
3136 * Licensed under the Apache License, Version 2.0 (the "License");
3137 * you may not use this file except in compliance with the License.
3138 * You may obtain a copy of the License at
3139 *
3140 *   http://www.apache.org/licenses/LICENSE-2.0
3141 *
3142 * Unless required by applicable law or agreed to in writing, software
3143 * distributed under the License is distributed on an "AS IS" BASIS,
3144 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3145 * See the License for the specific language governing permissions and
3146 * limitations under the License.
3147 *//**
3148 * @license
3149 * Copyright 2022 Google LLC
3150 *
3151 * Licensed under the Apache License, Version 2.0 (the "License");
3152 * you may not use this file except in compliance with the License.
3153 * You may obtain a copy of the License at
3154 *
3155 *   http://www.apache.org/licenses/LICENSE-2.0
3156 *
3157 * Unless required by applicable law or agreed to in writing, software
3158 * distributed under the License is distributed on an "AS IS" BASIS,
3159 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3160 * See the License for the specific language governing permissions and
3161 * limitations under the License.
3162 */class HD{constructor(e="count",n){this._internalFieldPath=n,this.type="AggregateField",this.aggregateType=e}}class GD{constructor(e,n,r){this._userDataWriter=n,this._data=r,this.type="AggregateQuerySnapshot",this.query=e}data(){return this._userDataWriter.convertObjectMap(this._data)}}/**
3163 * @license
3164 * Copyright 2020 Google LLC
3165 *
3166 * Licensed under the Apache License, Version 2.0 (the "License");
3167 * you may not use this file except in compliance with the License.
3168 * You may obtain a copy of the License at
3169 *
3170 *   http://www.apache.org/licenses/LICENSE-2.0
3171 *
3172 * Unless required by applicable law or agreed to in writing, software
3173 * distributed under the License is distributed on an "AS IS" BASIS,
3174 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3175 * See the License for the specific language governing permissions and
3176 * limitations under the License.
3177 */class Kt{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Kt(tt.fromBase64String(e))}catch(n){throw new B(L.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(e){return new Kt(tt.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:Kt._jsonSchemaVersion,bytes:this.toBase64()}}
3177static fromJSON(e){if(Ma(e,Kt._jsonSchema))return Kt.fromBase64String(e.bytes)}}Kt._jsonSchemaVersion="firestore/bytes/1.0",Kt._jsonSchema={type:Ue("string",Kt._jsonSchemaVersion),bytes:Ue("string")};/**
3178 * @license
3179 * Copyright 2020 Google LLC
3180 *
3181 * Licensed under the Apache License, Version 2.0 (the "License");
3182 * you may not use this file except in compliance with the License.
3183 * You may obtain a copy of the License at
3184 *
3185 *   http://www.apache.org/licenses/LICENSE-2.0
3186 *
3187 * Unless required by applicable law or agreed to in writing, software
3188 * distributed under the License is distributed on an "AS IS" BASIS,
3189 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3190 * See the License for the specific language governing permissions and
3191 * limitations under the License.
3192 */class Ba{constructor(...e){for(let n=0;n<e.length;++n)if(e[n].length===0)throw new B(L.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Ye(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}/**
3193 * @license
3194 * Copyright 2020 Google LLC
3195 *
3196 * Licensed under the Apache License, Version 2.0 (the "License");
3197 * you may not use this file except in compliance with the License.
3198 * You may obtain a copy of the License at
3199 *
3200 *   http://www.apache.org/licenses/LICENSE-2.0
3201 *
3202 * Unless required by applicable law or agreed to in writing, software
3203 * distributed under the License is distributed on an "AS IS" BASIS,
3204 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3205 * See the License for the specific language governing permissions and
3206 * limitations under the License.
3207 */class qs{constructor(e){this._methodName=e}}/**
3208 * @license
3209 * Copyright 2017 Google LLC
3210 *
3211 * Licensed under the Apache License, Version 2.0 (the "License");
3212 * you may not use this file except in compliance with the License.
3213 * You may obtain a copy of the License at
3214 *
3215 *   http://www.apache.org/licenses/LICENSE-2.0
3216 *
3217 * Unless required by applicable law or agreed to in writing, software
3218 * distributed under the License is distributed on an "AS IS" BASIS,
3219 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3220 * See the License for the specific language governing permissions and
3221 * limitations under the License.
3222 */class kn{constructor(e,n){if(!isFinite(e)||e<-90||e>90)throw new B(L.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new B(L.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return ne(this._lat,e._lat)||ne(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:kn._jsonSchemaVersion}}static fromJSON(e){if(Ma(e,kn._jsonSchema))return new kn(e.latitude,e.longitude)}}kn._jsonSchemaVersion="firestore/geoPoint/1.0",kn._jsonSchema={type:Ue("string",kn._jsonSchemaVersion),latitude:Ue("number"),longitude:Ue("number")};/**
3223 * @license
3224 * Copyright 2024 Google LLC
3225 *
3226 * Licensed under the Apache License, Version 2.0 (the "License");
3227 * you may not use this file except in compliance with the License.
3228 * You may obtain a copy of the License at
3229 *
3230 *   http://www.apache.org/licenses/LICENSE-2.0
3231 *
3232 * Unless required by applicable law or agreed to in writing, software
3233 * distributed under the License is distributed on an "AS IS" BASIS,
3234 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3235 * See the License for the specific language governing permissions and
3236 * limitations under the License.
3237 */class xn{constructor(e){this._values=(e||[]).map(n=>n)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(r,i){if(r.length!==i.length)return!1;for(let s=0;s<r.length;++s)if(r[s]!==i[s])return!1;return!0}(this._values,e._values)}toJSON(){return{type:xn._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(e){if(Ma(e,xn._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every(n=>typeof n=="number"))return new xn(e.vectorValues);throw new B(L.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}xn._jsonSchemaVersion="firestore/vectorValue/1.0",xn._jsonSchema={type:Ue("string",xn._jsonSchemaVersion),vectorValues:Ue("object")};/**
3238 * @license
3239 * Copyright 2017 Google LLC
3240 *
3241 * Licensed under the Apache License, Version 2.0 (the "License");
3242 * you may not use this file except in compliance with the License.
3243 * You may obtain a copy of the License at
3244 *
3245 *   http://www.apache.org/licenses/LICENSE-2.0
3246 *
3247 * Unless required by applicable law or agreed to in writing, software
3248 * distributed under the License is distributed on an "AS IS" BASIS,
3249 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3250 * See the License for the specific language governing permissions and
3251 * limitations under the License.
3252 */const KD=/^__.*__$/;class QD{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return this.fieldMask!==null?new Yr(e,this.data,this.fieldMask,n,this.fieldTransforms):new Fa(e,this.data,n,this.fieldTransforms)}}class n1{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return new Yr(e,this.data,this.fieldMask,n,this.fieldTransforms)}}function r1(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Y(40011,{Ec:t})}}class eh{constructor(e,n,r,i,s,o){this.settings=e,this.databaseId=n,this.serializer=r,this.ignoreUndefinedProperties=i,s===void 0&&this.Ac(),this.fieldTransforms=s||[],this.fieldMask=o||[]}get path(){return this.settings.path}get Ec(){return this.settings.Ec}Rc(e){return new eh(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Vc(e){var n;const r=(n=this.path)===null||n===void 0?void 0:n.child(e),i=this.Rc({path:r,mc:!1});return i.fc(e),i}gc(e){var n;const r=(n=this.path)===null||n===void 0?void 0:n.child(e),i=this.Rc({path:r,mc:!1});return i.Ac(),i}yc(e){return this.Rc({path:void 0,mc:!0})}wc(e){return ac(e,this.settings.methodName,this.settings.Sc||!1,this.path,this.settings.bc)}contains(e){return this.fieldMask.find(n=>e.isPrefixOf(n))!==void 0||this.fieldTransforms.find(n=>e.isPrefixOf(n.field))!==void 0}Ac(){if(this.path)for(let e=0;e<this.path.length;e++)this.fc(this.path.get(e))}fc(e){if(e.length===0)throw this.wc("Document fields must not be empty");if(r1(this.Ec)&&KD.test(e))throw this.wc('Document fields cannot begin and end with "__"')}}class XD{constructor(e,n,r){this.databaseId=e,this.ignoreUndefinedProperties=n,this.serializer=r||Yc(e)}Dc(e,n,r,i=!1){return new eh({Ec:e,methodName:n,bc:r,path:Ye.emptyPath(),mc:!1,Sc:i},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function Wa(t){const e=t._freezeSettings(),n=Yc(t._databaseId);return new XD(t._databaseId,!!e.ignoreUndefinedProperties,n)}function Fm(t,e,n,r,i,s={}){const o=t.Dc(s.merge||s.mergeFields?2:0,e,n,i);$m("Data must be an object, but it was:",o,r);const l=o1(r,o);let u,c;if(s.merge)u=new Mt(o.fieldMask),c=o.fieldTransforms;else if(s.mergeFields){const d=[];for(const p of s.mergeFields){const m=zf(e,p,n);if(!o.contains(m))throw new B(L.INVALID_ARGUMENT,`Field '${m}' is specified in your field mask but missing from your input data.`);l1(d,m)||d.push(m)}u=new Mt(d),c=o.fieldTransforms.filter(p=>u.covers(p.field))}else u=null,c=o.fieldTransforms;return new QD(new Rt(l),u,c)}class th extends qs{_toFieldTransform(e){if(e.Ec!==2)throw e.Ec===1?e.wc(`${this._methodName}() can only appear at the top level of your update data`):e.wc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof th}}function YD(t,e,n){return new eh({Ec:3,bc:e.settings.bc,methodName:t._methodName,mc:n},e.databaseId,e.serializer,e.ignoreUndefinedProperties)}class Um extends qs{_toFieldTransform(e){return new gm(e.path,new Ta)}isEqual(e){return e instanceof Um}}class jm extends qs{constructor(e,n){super(e),this.vc=n}_toFieldTransform(e){const n=YD(this,e,!0),r=this.vc.map(s=>Hs(s,n)),i=new Rs(r);return new gm(e.path,i)}isEqual(e){return e instanceof jm&&Fr(this.vc,e.vc)}}class zm extends qs{constructor(e,n){super(e),this.Cc=n}_toFieldTransform(e){const n=new Aa(e.serializer,mI(e.serializer,this.Cc));return new gm(e.path,n)}isEqual(e){return e instanceof zm&&this.Cc===e.Cc}}function i1(t,e,n,r){const i=t.Dc(1,e,n);$m("Data must be an object, but it was:",i,r);const s=[],o=Rt.empty();Xr(r,(u,c)=>{const d=Bm(e,u,n);c=he(c);const p=i.gc(d);if(c instanceof th)s.push(d);else{const m=Hs(c,p);m!=null&&(s.push(d),o.set(d,m))}});const l=new Mt(s);return new n1(o,l,i.fieldTransforms)}function s1(t,e,n,r,i,s){const o=t.Dc(1,e,n),l=[zf(e,r,n)],u=[i];if(s.length%2!=0)throw new B(L.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let m=0;m<s.length;m+=2)l.push(zf(e,s[m])),u.push(s[m+1]);const c=[],d=Rt.empty();for(let m=l.length-1;m>=0;--m)if(!l1(c,l[m])){const v=l[m];let w=u[m];w=he(w);const P=o.gc(v);if(w instanceof th)c.push(v);else{const C=Hs(w,P);C!=null&&(c.push(v),d.set(v,C))}}const p=new Mt(c);return new n1(d,p,o.fieldTransforms)}function JD(t,e,n,r=!1){return Hs(n,t.Dc(r?4:3,e))}function Hs(t,e){if(a1(t=he(t)))return $m("Unsupported field value:",e,t),o1(t,e);if(t instanceof qs)return function(r,i){if(!r1(i.Ec))throw i.wc(`${r._methodName}
3252() can only be used with update() and set()`);if(!i.path)throw i.wc(`${r._methodName}() is not currently supported inside arrays`);const s=r._toFieldTransform(i);s&&i.fieldTransforms.push(s)}(t,e),null;if(t===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.mc&&e.Ec!==4)throw e.wc("Nested arrays are not supported");return function(r,i){const s=[];let o=0;for(const l of r){let u=Hs(l,i.yc(o));u==null&&(u={nullValue:"NULL_VALUE"}),s.push(u),o++}return{arrayValue:{values:s}}}(t,e)}return function(r,i){if((r=he(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return mI(i.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const s=Ee.fromDate(r);return{timestampValue:nc(i.serializer,s)}}if(r instanceof Ee){const s=new Ee(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:nc(i.serializer,s)}}if(r instanceof kn)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof Kt)return{bytesValue:SI(i.serializer,r._byteString)};if(r instanceof be){const s=i.databaseId,o=r.firestore._databaseId;if(!o.isEqual(s))throw i.wc(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${s.projectId}/${s.database}`);return{referenceValue:vm(r.firestore._databaseId||i.databaseId,r._key.path)}}if(r instanceof xn)return function(o,l){return{mapValue:{fields:{[JT]:{stringValue:ZT},[Zu]:{arrayValue:{values:o.toArray().map(c=>{if(typeof c!="number")throw l.wc("VectorValues must only contain numeric values.");return mm(l.serializer,c)})}}}}}}(r,i);throw i.wc(`Unsupported field value: ${jc(r)}`)}(t,e)}function o1(t,e){const n={};return HT(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Xr(t,(r,i)=>{const s=Hs(i,e.Vc(r));s!=null&&(n[r]=s)}),{mapValue:{fields:n}}}function a1(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof Ee||t instanceof kn||t instanceof Kt||t instanceof be||t instanceof qs||t instanceof xn)}function $m(t,e,n){if(!a1(n)||!WT(n)){const r=jc(n);throw r==="an object"?e.wc(t+" a custom object"):e.wc(t+" "+r)}}function zf(t,e,n){if((e=he(e))instanceof Ba)return e._internalPath;if(typeof e=="string")return Bm(t,e);throw ac("Field path arguments must be of type string or ",t,!1,void 0,n)}const ZD=new RegExp("[~\\*/\\[\\]]");function Bm(t,e,n){if(e.search(ZD)>=0)throw ac(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new Ba(...e.split("."))._internalPath}catch{throw ac(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function ac(t,e,n,r,i){const s=r&&!r.isEmpty(),o=i!==void 0;let l=`Function ${e}() called with invalid data`;n&&(l+=" (via `toFirestore()`)"),l+=". ";let u="";return(s||o)&&(u+=" (found",s&&(u+=` in field ${r}`),o&&(u+=` in document ${i}`),u+=")"),new B(L.INVALID_ARGUMENT,l+t+u)}function l1(t,e){return t.some(n=>n.isEqual(e))}/**
3253 * @license
3254 * Copyright 2020 Google LLC
3255 *
3256 * Licensed under the Apache License, Version 2.0 (the "License");
3257 * you may not use this file except in compliance with the License.
3258 * You may obtain a copy of the License at
3259 *
3260 *   http://www.apache.org/licenses/LICENSE-2.0
3261 *
3262 * Unless required by applicable law or agreed to in writing, software
3263 * distributed under the License is distributed on an "AS IS" BASIS,
3264 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3265 * See the License for the specific language governing permissions and
3266 * limitations under the License.
3267 */class u1{constructor(e,n,r,i,s){this._firestore=e,this._userDataWriter=n,this._key=r,this._document=i,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new be(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new eO(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const n=this._document.data.field(nh("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}}class eO extends u1{data(){return super.data()}}function nh(t,e){return typeof e=="string"?Bm(t,e):e instanceof Ba?e._internalPath:e._delegate._internalPath}/**
3268 * @license
3269 * Copyright 2020 Google LLC
3270 *
3271 * Licensed under the Apache License, Version 2.0 (the "License");
3272 * you may not use this file except in compliance with the License.
3273 * You may obtain a copy of the License at
3274 *
3275 *   http://www.apache.org/licenses/LICENSE-2.0
3276 *
3277 * Unless required by applicable law or agreed to in writing, software
3278 * distributed under the License is distributed on an "AS IS" BASIS,
3279 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3280 * See the License for the specific language governing permissions and
3281 * limitations under the License.
3282 */function c1(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new B(L.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class Wm{}class qm extends Wm{}function xs(t,e,...n){let r=[];e instanceof Wm&&r.push(e),r=r.concat(n),function(s){const o=s.filter(u=>u instanceof Hm).length,l=s.filter(u=>u instanceof rh).length;if(o>1||o>0&&l>0)throw new B(L.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(r);for(const i of r)t=i._apply(t);return t}class rh extends qm{constructor(e,n,r){super(),this._field=e,this._op=n,this._value=r,this.type="where"}static _create(e,n,r){return new rh(e,n,r)}_apply(e){const n=this._parse(e);return h1(e._query,n),new On(e.firestore,e.converter,bf(e._query,n))}_parse(e){const n=Wa(e.firestore);return function(s,o,l,u,c,d,p){let m;if(c.isKeyField()){if(d==="array-contains"||d==="array-contains-any")throw new B(L.INVALID_ARGUMENT,`Invalid Query. You can't perform '${d}' queries on documentId().`);if(d==="in"||d==="not-in"){Kv(p,d);const w=[];for(const P of p)w.push(Gv(u,s,P));m={arrayValue:{values:w}}}else m=Gv(u,s,p)}else d!=="in"&&d!=="not-in"&&d!=="array-contains-any"||Kv(p,d),m=JD(l,o,p,d==="in"||d==="not-in");return Fe.create(c,d,m)}(e._query,"where",n,e.firestore._databaseId,this._field,this._op,this._value)}}function tO(t,e,n){const r=e,i=nh("where",t);return rh._create(i,r,n)}class Hm extends Wm{constructor(e,n){super(),this.type=e,this._queryConstraints=n}static _create(e,n){return new Hm(e,n)}_parse(e){const n=this._queryConstraints.map(r=>r._parse(e)).filter(r=>r.getFilters().length>0);return n.length===1?n[0]:dn.create(n,this._getOperator())}_apply(e){const n=this._parse(e);return n.getFilters().length===0?e:(function(i,s){let o=i;const l=s.getFlattenedFilters();for(const u of l)h1(o,u),o=bf(o,u)}(e._query,n),new On(e.firestore,e.converter,bf(e._query,n)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}class Gm extends qm{constructor(e,n){super(),this._field=e,this._direction=n,this.type="orderBy"}static _create(e,n){return new Gm(e,n)}_apply(e){const n=function(i,s,o){if(i.startAt!==null)throw new B(L.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(i.endAt!==null)throw new B(L.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new wa(s,o)}(e._query,this._field,this._direction);return new On(e.firestore,e.converter,function(i,s){const o=i.explicitOrderBy.concat([s]);return new Pi(i.path,i.collectionGroup,o,i.filters.slice(),i.limit,i.limitType,i.startAt,i.endAt)}(e._query,n))}}function lc(t,e="asc"){const n=e,r=nh("orderBy",t);return Gm._create(r,n)}class Km extends qm{constructor(e,n,r){super(),this.type=e,this._limit=n,this._limitType=r}static _create(e,n,r){return new Km(e,n,r)}_apply(e){return new On(e.firestore,e.converter,tc(e._query,this._limit,this._limitType))}}function iF(t){return nN("limit",t),Km._create("limit",t,"F")}function Gv(t,e,n){if(typeof(n=he(n))=="string"){if(n==="")throw new B(L.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!aI(e)&&n.indexOf("/")!==-1)throw new B(L.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);const r=e.path.child(ge.fromString(n));if(!Q.isDocumentKey(r))throw new B(L.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return uv(t,new Q(r))}if(n instanceof be)return uv(t,n._key);throw new B(L.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${jc(n)}.`)}function Kv(t,e){if(!Array.isArray(t)||t.length===0)throw new B(L.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function h1(t,e){const n=function(i,s){for(const o of i)for(const l of o.getFlattenedFilters())if(s.indexOf(l.op)>=0)return l.op;return null}(t.filters,function(i){switch(i){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(n!==null)throw n===e.op?new B(L.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new B(L.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}class nO{convertValue(e,n="none"){switch(Br(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Oe(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes($r(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 11:return this.convertObject(e.mapValue,n);case 10:return this.convertVectorValue(e.mapValue);default:throw Y(62114,{value:e})}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){const r={};return Xr(e,(i,s)=>{r[i]=this.convertValue(s,n)}),r}convertVectorValue(e){var n,r,i;const s=(i=(r=(n=e.fields)===null||n===void 0?void 0:n[Zu].arrayValue)===null||r===void 0?void 0:r.values)===null||i===void 0?void 0:i.map(o=>Oe(o.doubleValue));return new xn(s)}convertGeoPoint(e){return new kn(Oe(e.latitude),Oe(e.longitude))}convertArray(e,n){return(e.values||[]).map(r=>this.convertValue(r,n))}convertServerTimestamp(e,n){switch(n){case"previous":const r=Bc(e);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(_a(e));default:return null}}convertTimestamp(e){const n=zr(e);return new Ee(n.seconds,n.nanos)}convertDocumentKey(e,n){const r=ge.fromString(e);ce(NI(r),9688,{name:e});const i=new va(r.get(1),r.get(3)),s=new Q(r.popFirst(5));return i.isEqual(n)||Yn(`Document ${s} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),s}}/**
3283 * @license
3284 * Copyright 2020 Google LLC
3285 *
3286 * Licensed under the Apache License, Version 2.0 (the "License");
3287 * you may not use this file except in compliance with the License.
3288 * You may obtain a copy of the License at
3289 *
3290 *   http://www.apache.org/licenses/LICENSE-2.0
3291 *
3292 * Unless required by applicable law or agreed to in writing, software
3293 * distributed under the License is distributed on an "AS IS" BASIS,
3294 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3295 * See the License for the specific language governing permissions and
3296 * limitations under the License.
3297 */function Qm(t,e,n){let r;return r=t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e,r}function rO(){return new HD("count")}class No{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class hi extends u1{constructor(e,n,r,i,s,o){super(e,n,r,i,o),this._firestore=e,this._firestoreImpl=e,this.metadata=s}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const n=new ou(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,n={}){if(this._document){const r=this._document.data.field(nh("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new B(L.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,n={};return n.type=hi._jsonSchemaVersion,n.bundle="",n.bundleSource="DocumentSnapshot",n.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?n:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),n.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),n)}}hi._jsonSchemaVersion="firestore/documentSnapshot/1.0",hi._jsonSchema={type:Ue("string",hi._jsonSchemaVersion),bundleSource:Ue("string","DocumentSnapshot"),bundleName:Ue("string"),bundle:Ue("string")};class ou extends hi{data(e={}){return super.data(e)}}class di{constructor(e,n,r,i){this._firestore=e,this._userDataWriter=n,this._snapshot=i,this.metadata=new No(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){const e=[];return this.forEach(n=>e.push(n)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,n){this._snapshot.docs.forEach(r=>{e.call(n,new ou(this._firestore,this._userDataWriter,r.key,r,new No(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new B(L.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=function(i,s){if(i._snapshot.oldDocs.isEmpty()){let o=0;return i._snapshot.docChanges.map(l=>{const u=new ou(i._firestore,i._userDataWriter,l.doc.key,l.doc,new No(i._snapshot.mutatedKeys.has(l.doc.key),i._snapshot.fromCache),i.query.converter);return l.doc,{type:"added",doc:u,oldIndex:-1,newIndex:o++}})}{let o=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(l=>s||l.type!==3).map(l=>{const u=new ou(i._firestore,i._userDataWriter,l.doc.key,l.doc,new No(i._snapshot.mutatedKeys.has(l.doc.key),i._snapshot.fromCache),i.query.converter);let c=-1,d=-1;return l.type!==0&&(c=o.indexOf(l.doc.key),o=o.delete(l.doc.key)),l.type!==1&&(o=o.add(l.doc),d=o.indexOf(l.doc.key)),{type:iO(l.type),doc:u,oldIndex:c,newIndex:d}})}}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new B(L.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};
3297e.type=di._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=lm.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const n=[],r=[],i=[];return this.docs.forEach(s=>{s._document!==null&&(n.push(s._document),r.push(this._userDataWriter.convertObjectMap(s._document.data.value.mapValue.fields,"previous")),i.push(s.ref.path))}),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function iO(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Y(61501,{type:t})}}/**
3298 * @license
3299 * Copyright 2020 Google LLC
3300 *
3301 * Licensed under the Apache License, Version 2.0 (the "License");
3302 * you may not use this file except in compliance with the License.
3303 * You may obtain a copy of the License at
3304 *
3305 *   http://www.apache.org/licenses/LICENSE-2.0
3306 *
3307 * Unless required by applicable law or agreed to in writing, software
3308 * distributed under the License is distributed on an "AS IS" BASIS,
3309 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3310 * See the License for the specific language governing permissions and
3311 * limitations under the License.
3312 */function sO(t){t=Ze(t,be);const e=Ze(t.firestore,fn);return jD(Ws(e),t._key).then(n=>d1(e,t,n))}di._jsonSchemaVersion="firestore/querySnapshot/1.0",di._jsonSchema={type:Ue("string",di._jsonSchemaVersion),bundleSource:Ue("string","QuerySnapshot"),bundleName:Ue("string"),bundle:Ue("string")};class ih extends nO{constructor(e){super(),this.firestore=e}convertBytes(e){return new Kt(e)}convertReference(e){const n=this.convertDocumentKey(e,this.firestore._databaseId);return new be(this.firestore,null,n)}}function oO(t){t=Ze(t,On);const e=Ze(t.firestore,fn),n=Ws(e),r=new ih(e);return c1(t._query),zD(n,t._query).then(i=>new di(e,r,t,i))}function sF(t,e,n){t=Ze(t,be);const r=Ze(t.firestore,fn),i=Qm(t.converter,e,n);return qa(r,[Fm(Wa(r),"setDoc",t._key,i,t.converter!==null,n).toMutation(t._key,_t.none())])}function oF(t,e,n,...r){t=Ze(t,be);const i=Ze(t.firestore,fn),s=Wa(i);let o;return o=typeof(e=he(e))=="string"||e instanceof Ba?s1(s,"updateDoc",t._key,e,n,r):i1(s,"updateDoc",t._key,e),qa(i,[o.toMutation(t._key,_t.exists(!0))])}function aF(t){return qa(Ze(t.firestore,fn),[new Qc(t._key,_t.none())])}function lF(t,e){const n=Ze(t.firestore,fn),r=t1(t),i=Qm(t.converter,e);return qa(n,[Fm(Wa(t.firestore),"addDoc",r._key,i,t.converter!==null,{}).toMutation(r._key,_t.exists(!1))]).then(()=>r)}function Sa(t,...e){var n,r,i;t=he(t);let s={includeMetadataChanges:!1,source:"default"},o=0;typeof e[o]!="object"||Hv(e[o])||(s=e[o++]);const l={includeMetadataChanges:s.includeMetadataChanges,source:s.source};if(Hv(e[o])){const p=e[o];e[o]=(n=p.next)===null||n===void 0?void 0:n.bind(p),e[o+1]=(r=p.error)===null||r===void 0?void 0:r.bind(p),e[o+2]=(i=p.complete)===null||i===void 0?void 0:i.bind(p)}let u,c,d;if(t instanceof be)c=Ze(t.firestore,fn),d=Wc(t._key.path),u={next:p=>{e[o]&&e[o](d1(c,t,p))},error:e[o+1],complete:e[o+2]};else{const p=Ze(t,On);c=Ze(p.firestore,fn),d=p._query;const m=new ih(c);u={next:v=>{e[o]&&e[o](new di(c,m,p,v))},error:e[o+1],complete:e[o+2]},c1(t._query)}return function(m,v,w,P){const C=new Lm(P),E=new Dm(v,C,w);return m.asyncQueue.enqueueAndForget(async()=>xm(await oc(m),E)),()=>{C.Ou(),m.asyncQueue.enqueueAndForget(async()=>bm(await oc(m),E))}}(Ws(c),d,l,u)}function qa(t,e){return function(r,i){const s=new Rn;return r.asyncQueue.enqueueAndForget(async()=>CD(await FD(r),i,s)),s.promise}(Ws(t),e)}function d1(t,e,n){const r=n.docs.get(e._key),i=new ih(t);return new hi(t,i,e._key,r,new No(n.hasPendingWrites,n.fromCache),e.converter)}function uF(t){return aO(t,{count:rO()})}function aO(t,e){const n=Ze(t.firestore,fn),r=Ws(n),i=dN(e,(s,o)=>new HN(o,s.aggregateType,s._internalFieldPath));return $D(r,t._query,i).then(s=>function(l,u,c){const d=new ih(l);return new GD(u,d,c)}(n,t,s))}/**
3313 * @license
3314 * Copyright 2020 Google LLC
3315 *
3316 * Licensed under the Apache License, Version 2.0 (the "License");
3317 * you may not use this file except in compliance with the License.
3318 * You may obtain a copy of the License at
3319 *
3320 *   http://www.apache.org/licenses/LICENSE-2.0
3321 *
3322 * Unless required by applicable law or agreed to in writing, softw
3322are
3323 * distributed under the License is distributed on an "AS IS" BASIS,
3324 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3325 * See the License for the specific language governing permissions and
3326 * limitations under the License.
3327 */class lO{constructor(e,n){this._firestore=e,this._commitHandler=n,this._mutations=[],this._committed=!1,this._dataReader=Wa(e)}set(e,n,r){this._verifyNotCommitted();const i=dd(e,this._firestore),s=Qm(i.converter,n,r),o=Fm(this._dataReader,"WriteBatch.set",i._key,s,i.converter!==null,r);return this._mutations.push(o.toMutation(i._key,_t.none())),this}update(e,n,r,...i){this._verifyNotCommitted();const s=dd(e,this._firestore);let o;return o=typeof(n=he(n))=="string"||n instanceof Ba?s1(this._dataReader,"WriteBatch.update",s._key,n,r,i):i1(this._dataReader,"WriteBatch.update",s._key,n),this._mutations.push(o.toMutation(s._key,_t.exists(!0))),this}delete(e){this._verifyNotCommitted();const n=dd(e,this._firestore);return this._mutations=this._mutations.concat(new Qc(n._key,_t.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new B(L.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function dd(t,e){if((t=he(t)).firestore!==e)throw new B(L.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}function cF(){return new Um("serverTimestamp")}function hF(...t){return new jm("arrayUnion",t)}function dF(t){return new zm("increment",t)}/**
3328 * @license
3329 * Copyright 2020 Google LLC
3330 *
3331 * Licensed under the Apache License, Version 2.0 (the "License");
3332 * you may not use this file except in compliance with the License.
3333 * You may obtain a copy of the License at
3334 *
3335 *   http://www.apache.org/licenses/LICENSE-2.0
3336 *
3337 * Unless required by applicable law or agreed to in writing, software
3338 * distributed under the License is distributed on an "AS IS" BASIS,
3339 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3340 * See the License for the specific language governing permissions and
3341 * limitations under the License.
3342 */function fF(t){return Ws(t=Ze(t,fn)),new lO(t,e=>qa(t,e))}(function(e,n=!0){(function(i){js=i})(Ri),bn(new cn("firestore",(r,{instanceIdentifier:i,options:s})=>{const o=r.getProvider("app").getImmediate(),l=new fn(new Kb(r.getProvider("auth-internal")),new Yb(o,r.getProvider("app-check-internal")),function(c,d){if(!Object.prototype.hasOwnProperty.apply(c.options,["projectId"]))throw new B(L.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new va(c.options.projectId,d)}(o,i),o);return s=Object.assign({useFetchStreams:n},s),l._setSettings(s),l},"PUBLIC").setMultipleInstances(!0)),jt(Q_,X_,e),jt(Q_,X_,"esm2017")})();var uO="firebase",cO="11.10.0";/**
3343 * @license
3344 * Copyright 2020 Google LLC
3345 *
3346 * Licensed under the Apache License, Version 2.0 (the "License");
3347 * you may not use this file except in compliance with the License.
3348 * You may obtain a copy of the License at
3349 *
3350 *   http://www.apache.org/licenses/LICENSE-2.0
3351 *
3352 * Unless required by applicable law or agreed to in writing, software
3353 * distributed under the License is distributed on an "AS IS" BASIS,
3354 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3355 * See the License for the specific language governing permissions and
3356 * limitations under the License.
3357 */jt(uO,cO,"app");/**
3358 * @license
3359 * Copyright 2017 Google LLC
3360 *
3361 * Licensed under the Apache License, Version 2.0 (the "License");
3362 * you may not use this file except in compliance with the License.
3363 * You may obtain a copy of the License at
3364 *
3365 *   http://www.apache.org/licenses/LICENSE-2.0
3366 *
3367 * Unless required by applicable law or agreed to in writing, software
3368 * distributed under the License is distributed on an "AS IS" BASIS,
3369 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3370 * See the License for the specific language governing permissions and
3371 * limitations under the License.
3372 */const hO="type.googleapis.com/google.protobuf.Int64Value",dO="type.googleapis.com/google.protobuf.UInt64Value";function f1(t,e){const n={};for(const r in t)t.hasOwnProperty(r)&&(n[r]=e(t[r]));return n}function uc(t){if(t==null)return null;if(t instanceof Number&&(t=t.valueOf()),typeof t=="number"&&isFinite(t)||t===!0||t===!1||Object.prototype.toString.call(t)==="[object String]")return t;if(t instanceof Date)return t.toISOString();if(Array.isArray(t))return t.map(e=>uc(e));if(typeof t=="function"||typeof t=="object")return f1(t,e=>uc(e));throw new Error("Data cannot be encoded in JSON: "+t)}function bs(t){if(t==null)return t;if(t["@type"])switch(t["@type"]){case hO:case dO:{const e=Number(t.value);if(isNaN(e))throw new Error("Data cannot be decoded from JSON: "+t);return e}default:throw new Error("Data cannot be decoded from JSON: "+t)}return Array.isArray(t)?t.map(e=>bs(e)):typeof t=="function"||typeof t=="object"?f1(t,e=>bs(e)):t}/**
3373 * @license
3374 * Copyright 2020 Google LLC
3375 *
3376 * Licensed under the Apache License, Version 2.0 (the "License");
3377 * you may not use this file except in compliance with the License.
3378 * You may obtain a copy of the License at
3379 *
3380 *   http://www.apache.org/licenses/LICENSE-2.0
3381 *
3382 * Unless required by applicable law or agreed to in writing, software
3383 * distributed under the License is distributed on an "AS IS" BASIS,
3384 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3385 * See the License for the specific language governing permissions and
3386 * limitations under the License.
3387 */const Xm="functions";/**
3388 * @license
3389 * Copyright 2017 Google LLC
3390 *
3391 * Licensed under the Apache License, Version 2.0 (the "License");
3392 * you may not use this file except in compliance with the License.
3393 * You may obtain a copy of the License at
3394 *
3395 *   http://www.apache.org/licenses/LICENSE-2.0
3396 *
3397 * Unless required by applicable law or agreed to in writing, software
3398 * distributed under the License is distributed on an "AS IS" BASIS,
3399 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3400 * See the License for the specific language governing permissions and
3401 * limitations under the License.
3402 */const Qv={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class Pt extends mn{constructor(e,n,r){super(`${Xm}/${e}`,n||""),this.details=r,Object.setPrototypeOf(this,Pt.prototype)}}function fO(t){if(t>=200&&t<300)return"ok";switch(t){case 0:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 500:return"internal";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}function cc(t,e){let n=fO(t),r=n,i;try{const s=e&&e.error;if(s){const o=s.status;if(typeof o=="string"){if(!Qv[o])return new Pt("internal","internal");n=Qv[o],r=o}const l=s.message;typeof l=="string"&&(r=l),i=s.details,i!==void 0&&(i=bs(i))}}catch{}return n==="ok"?null:new Pt(n,r,i)}/**
3403 * @license
3404 * Copyright 2017 Google LLC
3405 *
3406 * Licensed under the Apache License, Version 2.0 (the "License");
3407 * you may not use this file except in compliance with the License.
3408 * You may obtain a copy of the License at
3409 *
3410 *   http://www.apache.org/licenses/LICENSE-2.0
3411 *
3412 * Unless required by applicable law or agreed to in writing, software
3413 * distributed under the License is distributed on an "AS IS" BASIS,
3414 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3415 * See the License for the specific language governing permissions and
3416 * limitations under the License.
3417 */class pO{constructor(e,n,r,i){this.app=e,this.auth=null,this.messaging=null,this.appCheck=null,this.serverAppAppCheckToken=null,St(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.auth=n.getImmediate({optional:!0}),this.messaging=r.getImmediate({optional:!0}),this.auth||n.get().then(s=>this.auth=s,()=>{}),this.messaging||r.get().then(s=>this.messaging=s,()=>{}),this.appCheck||i==null||i.get().then(s=>this.appCheck=s,()=>{})}async getAuthToken(){if(this.auth)try{const e=await this.auth.getToken();return e==null?void 0:e.accessToken}catch{return}}async getMessagingToken(){if(!(!this.messaging||!("Notification"in self)||Notification.permission!=="granted"))try{return await this.messaging.getToken()}catch{return}}async getAppCheckToken(e){if(this.serverAppAppCheckToken)return this.serverAppAppCheckToken;if(this.appCheck){const n=e?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return n.error?null:n.token}return null}async getContext(e){const n=await this.getAuthToken(),r=await this.getMessagingToken(),i=await this.getAppCheckToken(e);
3417return{authToken:n,messagingToken:r,appCheckToken:i}}}/**
3418 * @license
3419 * Copyright 2017 Google LLC
3420 *
3421 * Licensed under the Apache License, Version 2.0 (the "License");
3422 * you may not use this file except in compliance with the License.
3423 * You may obtain a copy of the License at
3424 *
3425 *   http://www.apache.org/licenses/LICENSE-2.0
3426 *
3427 * Unless required by applicable law or agreed to in writing, software
3428 * distributed under the License is distributed on an "AS IS" BASIS,
3429 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3430 * See the License for the specific language governing permissions and
3431 * limitations under the License.
3432 */const $f="us-central1",mO=/^data: (.*?)(?:\n|$)/;function gO(t){let e=null;return{promise:new Promise((n,r)=>{e=setTimeout(()=>{r(new Pt("deadline-exceeded","deadline-exceeded"))},t)}),cancel:()=>{e&&clearTimeout(e)}}}class yO{constructor(e,n,r,i,s=$f,o=(...l)=>fetch(...l)){this.app=e,this.fetchImpl=o,this.emulatorOrigin=null,this.contextProvider=new pO(e,n,r,i),this.cancelAllRequests=new Promise(l=>{this.deleteService=()=>Promise.resolve(l())});try{const l=new URL(s);this.customDomain=l.origin+(l.pathname==="/"?"":l.pathname),this.region=$f}catch{this.customDomain=null,this.region=s}}_delete(){return this.deleteService()}_url(e){const n=this.app.options.projectId;return this.emulatorOrigin!==null?`${this.emulatorOrigin}/${n}/${this.region}/${e}`:this.customDomain!==null?`${this.customDomain}/${e}`:`https://${this.region}-${n}.cloudfunctions.net/${e}`}}function _O(t,e,n){const r=nr(e);t.emulatorOrigin=`http${r?"s":""}://${e}:${n}`,r&&(Dc(t.emulatorOrigin),Oc("Functions",!0))}function vO(t,e,n){const r=i=>wO(t,e,i,{});return r.stream=(i,s)=>IO(t,e,i,s),r}async function EO(t,e,n,r){n["Content-Type"]="application/json";let i;try{i=await r(t,{method:"POST",body:JSON.stringify(e),headers:n})}catch{return{status:0,json:null}}let s=null;try{s=await i.json()}catch{}return{status:i.status,json:s}}async function p1(t,e){const n={},r=await t.contextProvider.getContext(e.limitedUseAppCheckTokens);return r.authToken&&(n.Authorization="Bearer "+r.authToken),r.messagingToken&&(n["Firebase-Instance-ID-Token"]=r.messagingToken),r.appCheckToken!==null&&(n["X-Firebase-AppCheck"]=r.appCheckToken),n}function wO(t,e,n,r){const i=t._url(e);return TO(t,i,n,r)}async function TO(t,e,n,r){n=uc(n);const i={data:n},s=await p1(t,r),o=r.timeout||7e4,l=gO(o),u=await Promise.race([EO(e,i,s,t.fetchImpl),l.promise,t.cancelAllRequests]);if(l.cancel(),!u)throw new Pt("cancelled","Firebase Functions instance was deleted.");const c=cc(u.status,u.json);if(c)throw c;if(!u.json)throw new Pt("internal","Response is not valid JSON object.");let d=u.json.data;if(typeof d>"u"&&(d=u.json.result),typeof d>"u")throw new Pt("internal","Response is missing data field.");return{data:bs(d)}}function IO(t,e,n,r){const i=t._url(e);return AO(t,i,n,r||{})}async function AO(t,e,n,r){var i;n=uc(n);const s={data:n},o=await p1(t,r);o["Content-Type"]="application/json",o.Accept="text/event-stream";let l;try{l=await t.fetchImpl(e,{method:"POST",body:JSON.stringify(s),headers:o,signal:r==null?void 0:r.signal})}catch(v){if(v instanceof Error&&v.name==="AbortError"){const P=new Pt("cancelled","Request was cancelled.");return{data:Promise.reject(P),stream:{[Symbol.asyncIterator](){return{next(){return Promise.reject(P)}}}}}}const w=cc(0,null);return{data:Promise.reject(w),stream:{[Symbol.asyncIterator](){return{next(){return Promise.reject(w)}}}}}}let u,c;const d=new Promise((v,w)=>{u=v,c=w});(i=r==null?void 0:r.signal)===null||i===void 0||i.addEventListener("abort",()=>{const v=new Pt("cancelled","Request was cancelled.");c(v)});const p=l.body.getReader(),m=SO(p,u,c,r==null?void 0:r.signal);return{stream:{[Symbol.asyncIterator](){const v=m.getReader();return{async next(){const{value:w,done:P}=await v.read();return{value:w,done:P}},async return(){return await v.cancel(),{done:!0,value:void 0}}}}},data:d}}function SO(t,e,n,r){const i=(o,l)=>{const u=o.match(mO);if(!u)return;const c=u[1];try{const d=JSON.parse(c);if("result"in d){e(bs(d.result));return}if("message"in d){l.enqueue(bs(d.message));return}if("error"in d){const p=cc(0,d);l.error(p),n(p);return}}catch(d){if(d instanceof Pt){l.error(d),n(d);return}}},s=new TextDecoder;return new ReadableStream({start(o){let l="";return u();async function u(){if(r!=null&&r.aborted){const c=new Pt("cancelled","Request was cancelled");return o.error(c),n(c),Promise.resolve()}try{const{value:c,done:d}=await t.read();if(d){l.trim()&&i(l.trim(),o),o.close();return}if(r!=null&&r.aborted){const m=new Pt("cancelled","Request was cancelled");o.error(m),n(m),await t.cancel();return}l+=s.decode(c,{stream:!0});const p=l.split(`
3433`);l=p.pop()||"";for(const m of p)m.trim()&&i(m.trim(),o);return u()}catch(c){const d=c instanceof Pt?c:cc(0,null);o.error(d),n(d)}}},cancel(){return t.cancel()}})}const Xv="@firebase/functions",Yv="0.12.9";/**
3434 * @license
3435 * Copyright 2019 Google LLC
3436 *
3437 * Licensed under the Apache License, Version 2.0 (the "License");
3438 * you may not use this file except in compliance with the License.
3439 * You may obtain a copy of the License at
3440 *
3441 *   http://www.apache.org/licenses/LICENSE-2.0
3442 *
3443 * Unless required by applicable law or agreed to in writing, software
3444 * distributed under the License is distributed on an "AS IS" BASIS,
3445 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3446 * See the License for the specific language governing permissions and
3447 * limitations under the License.
3448 */const RO="auth-internal",CO="app-check-internal",PO="messaging-internal";function kO(t){const e=(n,{instanceIdentifier:r})=>{const i=n.getProvider("app").getImmediate(),s=n.getProvider(RO),o=n.getProvider(PO),l=n.getProvider(CO);return new yO(i,s,o,l,r)};bn(new cn(Xm,e,"PUBLIC").setMultipleInstances(!0)),jt(Xv,Yv,t),jt(Xv,Yv,"esm2017")}/**
3449 * @license
3450 * Copyright 2020 Google LLC
3451 *
3452 * Licensed under the Apache License, Version 2.0 (the "License");
3453 * you may not use this file except in compliance with the License.
3454 * You may obtain a copy of the License at
3455 *
3456 *   http://www.apache.org/licenses/LICENSE-2.0
3457 *
3458 * Unless required by applicable law or agreed to in writing, software
3459 * distributed under the License is distributed on an "AS IS" BASIS,
3460 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3461 * See the License for the specific language governing permissions and
3462 * limitations under the License.
3463 */function xO(t=Lc(),e=$f){const r=Na(he(t),Xm).getImmediate({identifier:e}),i=Xp("functions");return i&&bO(r,...i),r}function bO(t,e,n){_O(he(t),e,n)}function pF(t,e,n){return vO(he(t),e)}kO();/**
3464 * @license
3465 * Copyright 2017 Google LLC
3466 *
3467 * Licensed under the Apache License, Version 2.0 (the "License");
3468 * you may not use this file except in compliance with the License.
3469 * You may obtain a copy of the License at
3470 *
3471 *   http://www.apache.org/licenses/LICENSE-2.0
3472 *
3473 * Unless required by applicable law or agreed to in writing, software
3474 * distributed under the License is distributed on an "AS IS" BASIS,
3475 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3476 * See the License for the specific language governing permissions and
3477 * limitations under the License.
3478 */const m1="firebasestorage.googleapis.com",g1="storageBucket",NO=2*60*1e3,DO=10*60*1e3;/**
3479 * @license
3480 * Copyright 2017 Google LLC
3481 *
3482 * Licensed under the Apache License, Version 2.0 (the "License");
3483 * you may not use this file except in compliance with the License.
3484 * You may obtain a copy of the License at
3485 *
3486 *   http://www.apache.org/licenses/LICENSE-2.0
3487 *
3488 * Unless required by applicable law or agreed to in writing, software
3489 * distributed under the License is distributed on an "AS IS" BASIS,
3490 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3491 * See the License for the specific language governing permissions and
3492 * limitations under the License.
3493 */class De extends mn{constructor(e,n,r=0){super(fd(e),`Firebase Storage: ${n} (${fd(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,De.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return fd(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
3494${this.customData.serverResponse}`:this.message=this._baseMessage}}var Ne;(function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVALID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(Ne||(Ne={}));function fd(t){return"storage/"+t}function Ym(){const t="An unknown error occurred, please check the error payload for server response.";return new De(Ne.UNKNOWN,t)}function OO(t){return new De(Ne.OBJECT_NOT_FOUND,"Object '"+t+"' does not exist.")}function VO(t){return new De(Ne.QUOTA_EXCEEDED,"Quota for bucket '"+t+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function LO(){const t="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new De(Ne.UNAUTHENTICATED,t)}function MO(){return new De(Ne.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function FO(t){return new De(Ne.UNAUTHORIZED,"User does not have permission to access '"+t+"'.")}function UO(){return new De(Ne.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function jO(){return new De(Ne.CANCELED,"User canceled the upload/download.")}function zO(t){return new De(Ne.INVALID_URL,"Invalid URL '"+t+"'.")}function $O(t){return new De(Ne.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function BO(){return new De(Ne.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+g1+"' property when initializing the app?")}function WO(){return new De(Ne.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function qO(){return new De(Ne.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function HO(t){return new De(Ne.UNSUPPORTED_ENVIRONMENT,`${t} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function Bf(t){return new De(Ne.INVALID_ARGUMENT,t)}function y1(){return new De(Ne.APP_DELETED,"The Firebase app was deleted.")}function GO(t){return new De(Ne.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function Qo(t,e){return new De(Ne.INVALID_FORMAT,"String does not match format '"+t+"': "+e)}function wo(t){throw new De(Ne.INTERNAL_ERROR,"Internal error: "+t)}/**
3495 * @license
3496 * Copyright 2017 Google LLC
3497 *
3498 * Licensed under the Apache License, Version 2.0 (the "License");
3499 * you may not use this file except in compliance with the License.
3500 * You may obtain a copy of the License at
3501 *
3502 *   http://www.apache.org/licenses/LICENSE-2.0
3503 *
3504 * Unless required by applicable law or agreed to in writing, software
3505 * distributed under the License is distributed on an "AS IS" BASIS,
3506 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3507 * See the License for the specific language governing permissions and
3508 * limitations under the License.
3509 */class Ft{constructor(e,n){this.bucket=e,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,n){let r;try{r=Ft.makeFromUrl(e,n)}catch{return new Ft(e,"")}if(r.path==="")return r;throw $O(e)}static makeFromUrl(e,n){let r=null;const i="([A-Za-z0-9.\\-_]+)";function s(x){x.path.charAt(x.path.length-1)==="/"&&(x.path_=x.path_.slice(0,-1))}const o="(/(.*))?$",l=new RegExp("^gs://"+i+o,"i"),u={bucket:1,path:3};function c(x){x.path_=decodeURIComponent(x.path)}const d="v[A-Za-z0-9_]+",p=n.replace(/[.]/g,"\\."),m="(/([^?#]*).*)?$",v=new RegExp(`^https?://${p}/${d}/b/${i}/o${m}`,"i"),w={bucket:1,path:3},P=n===m1?"(?:storage.googleapis.com|storage.cloud.google.com)":n,C="([^?#]*)",E=new RegExp(`^https?://${P}/${i}/${C}`,"i"),T=[{regex:l,indices:u,postModify:s},{regex:v,indices:w,postModify:c},{regex:E,indices:{bucket:1,path:2},postModify:c}];for(let x=0;x<T.length;x++){const F=T[x],U=F.regex.exec(e);if(U){const I=U[F.indices.bucket];let _=U[F.indices.path];_||(_=""),r=new Ft(I,_),F.postModify(r);break}}if(r==null)throw zO(e);return r}}class KO{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}/**
3510 * @license
3511 * Copyright 2017 Google LLC
3512 *
3513 * Licensed under the Apache License, Version 2.0 (the "License");
3514 * you may not use this file except in compliance with the License.
3515 * You may obtain a copy of the License at
3516 *
3517 *   http://www.apache.org/licenses/LICENSE-2.0
3518 *
3519 * Unless required by applicable law or agreed to in writing, software
3520 * distributed under the License is distributed on an "AS IS" BASIS,
3521 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3522 * See the License for the specific language governing permissions and
3523 * limitations under the License.
3524 */function QO(t,e,n){let r=1,i=null,s=null,o=!1,l=0;function u(){return l===2}let c=!1;function d(...C){c||(c=!0,e.apply(null,C))}function p(C){i=setTimeout(()=>{i=null,t(v,u())},C)}function m(){s&&clearTimeout(s)}function v(C,...E){if(c){m();return}if(C){m(),d.call(null,C,...E);return}if(u()||o){m(),d.call(null,C,...E);return}r<64&&(r*=2);let T;l===1?(l=2,T=0):T=(r+Math.random())*1e3,p(T)}let w=!1;function P(C){w||(w=!0,m(),!c&&(i!==null?(C||(l=2),clearTimeout(i),p(0)):C||(l=1)))}return p(0),s=setTimeout(()=>{o=!0,P(!0)},n),P}function XO(t){t(!1)}/**
3525 * @license
3526 * Copyright 2017 Google LLC
3527 *
3528 * Licensed under the Apache License, Version 2.0 (the "License");
3529 * you may not use this file except in compliance with the License.
3530 * You may obtain a copy of the License at
3531 *
3532 *   http://www.apache.org/licenses/LICENSE-2.0
3533 *
3534 * Unless required by applicable law or agreed to in writing, software
3535 * distributed under the License is distributed on an "AS IS" BASIS,
3536 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3537 * See the License for the specific language governing permissions and
3538 * limitations under the License.
3539 */function YO(t){return t!==void 0}function JO(t){return typeof t=="object"&&!Array.isArray(t)}function Jm(t){return typeof t=="string"||t instanceof String}function Jv(t){return Zm()&&t instanceof Blob}function Zm(){return typeof Blob<"u"}function Zv(t,e,n,r){if(r<e)throw Bf(`Invalid value for '${t}'. Expected ${e} or greater.`);if(r>n)throw Bf(`Invalid value for '${t}'. Expected ${n} or less.`)}/**
3540 * @license
3541 * Copyright 2017 Google LLC
3542 *
3543 * Licensed under the Apache License, Version 2.0 (the "License");
3544 * you may not use this file except in compliance with the License.
3545 * You may obtain a copy of the License at
3546 *
3547 *   http://www.apache.org/licenses/LICENSE-2.0
3548 *
3549 * Unless required by applicable law or agreed to in writing, software
3550 * distributed under the License is distributed on an "AS IS" BASIS,
3551 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3552 * See the License for the specific language governing permissions and
3553 * limitations under the License.
3554 */function sh(t,e,n){let r=e;return n==null&&(r=`https://${e}`),`${n}://${r}/v0${t}`}function _1(t){const e=encodeURIComponent;let n="?";for(const r in t)if(t.hasOwnProperty(r)){const i=e(r)+"="+e(t[r]);n=n+i+"&"}return n=n.slice(0,-1),n}var fi;(function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"})(fi||(fi={}));/**
3555 * @license
3556 * Copyright 2022 Google LLC
3557 *
3558 * Licensed under the Apache License, Version 2.0 (the "License");
3559 * you may not use this file except in compliance with the License.
3560 * You may obtain a copy of the License at
3561 *
3562 *   http://www.apache.org/licenses/LICENSE-2.0
3563 *
3564 * Unless required by applicable law or agreed to in writing, software
3565 * distributed under the License is distributed on an "AS IS" BASIS,
3566 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3567 * See the License for the specific language governing permissions and
3568 * limitations under the License.
3569 */function ZO(t,e){const n=t>=500&&t<600,i=[408,429].indexOf(t)!==-1,s=e.indexOf(t)!==-1;return n||i||s}/**
3570 * @license
3571 * Copyright 2017 Google LLC
3572 *
3573 * Licensed under the Apache License, Version 2.0 (the "License");
3574 * you may not use this file except in compliance with the License.
3575 * You may obtain a copy of the License at
3576 *
3577 *   http://www.apache.org/licenses/LICENSE-2.0
3578 *
3579 * Unless required by applicable law or agreed to in writing, software
3580 * distributed under the License is distributed on an "AS IS" BASIS,
3581 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3582 * See the License for the specific language governing permissions and
3583 * limitations under the License.
3584 */class eV{constructor(e,n,r,i,s,o,l,u,c,d,p,m=!0,v=!1){this.url_=e,this.method_=n,this.headers_=r,this.body_=i,this.successCodes_=s,this.additionalRetryCodes_=o,this.callback_=l,this.errorCallback_=u,this.timeout_=c,this.progressCallback_=d,this.connectionFactory_=p,this.retry=m,this.isUsingEmulator=v,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((w,P)=>{this.resolve_=w,this.reject_=P,this.start_()})}start_(){const e=(r,i)=>{if(i){r(!1,new Ol(!1,null,!0));return}const s=this.connectionFactory_();this.pendingConnection_=s;const o=l=>{const u=l.loaded,c=l.lengthComputable?l.total:-1;this.progressCallback_!==null&&this.progressCallback_(u,c)};this.progressCallback_!==null&&s.addUploadProgressListener(o),s.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&s.removeUploadProgressListener(o),this.pendingConnection_=null;const l=s.getErrorCode()===fi.NO_ERROR,u=s.getStatus();if(!l||ZO(u,this.additionalRetryCodes_)&&this.retry){const d=s.getErrorCode()===fi.ABORT;r(!1,new Ol(!1,null,d));return}const c=this.successCodes_.indexOf(u)!==-1;r(!0,new Ol(c,s))})},n=(r,i)=>{const s=this.resolve_,o=this.reject_,l=i.connection;if(i.wasSuccessCode)try{const u=this.callback_(l,l.getResponse());YO(u)?s(u):s()}catch(u){o(u)}else if(l!==null){const u=Ym();u.serverResponse=l.getErrorText(),this.errorCallback_?o(this.errorCallback_(l,u)):o(u)}else if(i.canceled){const u=this.appDelete_?y1():jO();o(u)}else{const u=UO();o(u)}};this.canceled_?n(!1,new Ol(!1,null,!0)):this.backoffId_=QO(e,n,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&XO(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class Ol{constructor(e,n,r){this.wasSuccessCode=e,this.connection=n,this.canceled=!!r}}function tV(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function nV(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function rV(t,e){e&&(t["X-Firebase-GMPID"]=e)}function iV(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}
3584function sV(t,e,n,r,i,s,o=!0,l=!1){const u=_1(t.urlParams),c=t.url+u,d=Object.assign({},t.headers);return rV(d,e),tV(d,n),nV(d,s),iV(d,r),new eV(c,t.method,d,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,i,o,l)}/**
3585 * @license
3586 * Copyright 2017 Google LLC
3587 *
3588 * Licensed under the Apache License, Version 2.0 (the "License");
3589 * you may not use this file except in compliance with the License.
3590 * You may obtain a copy of the License at
3591 *
3592 *   http://www.apache.org/licenses/LICENSE-2.0
3593 *
3594 * Unless required by applicable law or agreed to in writing, software
3595 * distributed under the License is distributed on an "AS IS" BASIS,
3596 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3597 * See the License for the specific language governing permissions and
3598 * limitations under the License.
3599 */function oV(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function aV(...t){const e=oV();if(e!==void 0){const n=new e;for(let r=0;r<t.length;r++)n.append(t[r]);return n.getBlob()}else{if(Zm())return new Blob(t);throw new De(Ne.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}}function lV(t,e,n){return t.webkitSlice?t.webkitSlice(e,n):t.mozSlice?t.mozSlice(e,n):t.slice?t.slice(e,n):null}/**
3600 * @license
3601 * Copyright 2021 Google LLC
3602 *
3603 * Licensed under the Apache License, Version 2.0 (the "License");
3604 * you may not use this file except in compliance with the License.
3605 * You may obtain a copy of the License at
3606 *
3607 *   http://www.apache.org/licenses/LICENSE-2.0
3608 *
3609 * Unless required by applicable law or agreed to in writing, software
3610 * distributed under the License is distributed on an "AS IS" BASIS,
3611 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3612 * See the License for the specific language governing permissions and
3613 * limitations under the License.
3614 */function uV(t){if(typeof atob>"u")throw HO("base-64");return atob(t)}/**
3615 * @license
3616 * Copyright 2017 Google LLC
3617 *
3618 * Licensed under the Apache License, Version 2.0 (the "License");
3619 * you may not use this file except in compliance with the License.
3620 * You may obtain a copy of the License at
3621 *
3622 *   http://www.apache.org/licenses/LICENSE-2.0
3623 *
3624 * Unless required by applicable law or agreed to in writing, software
3625 * distributed under the License is distributed on an "AS IS" BASIS,
3626 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3627 * See the License for the specific language governing permissions and
3628 * limitations under the License.
3629 */const wn={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class pd{constructor(e,n){this.data=e,this.contentType=n||null}}function cV(t,e){switch(t){case wn.RAW:return new pd(v1(e));case wn.BASE64:case wn.BASE64URL:return new pd(E1(t,e));case wn.DATA_URL:return new pd(dV(e),fV(e))}throw Ym()}function v1(t){const e=[];for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);if(r<=127)e.push(r);else if(r<=2047)e.push(192|r>>6,128|r&63);else if((r&64512)===55296)if(!(n<t.length-1&&(t.charCodeAt(n+1)&64512)===56320))e.push(239,191,189);else{const s=r,o=t.charCodeAt(++n);r=65536|(s&1023)<<10|o&1023,e.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|r&63)}else(r&64512)===56320?e.push(239,191,189):e.push(224|r>>12,128|r>>6&63,128|r&63)}return new Uint8Array(e)}function hV(t){let e;try{e=decodeURIComponent(t)}catch{throw Qo(wn.DATA_URL,"Malformed data URL.")}return v1(e)}function E1(t,e){switch(t){case wn.BASE64:{const i=e.indexOf("-")!==-1,s=e.indexOf("_")!==-1;if(i||s)throw Qo(t,"Invalid character '"+(i?"-":"_")+"' found: is it base64url encoded?");break}case wn.BASE64URL:{const i=e.indexOf("+")!==-1,s=e.indexOf("/")!==-1;if(i||s)throw Qo(t,"Invalid character '"+(i?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=uV(e)}catch(i){throw i.message.includes("polyfill")?i:Qo(t,"Invalid character found")}const r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return r}class w1{constructor(e){this.base64=!1,this.contentType=null;const n=e.match(/^data:([^,]+)?,/);if(n===null)throw Qo(wn.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const r=n[1]||null;r!=null&&(this.base64=pV(r,";base64"),this.contentType=this.base64?r.substring(0,r.length-7):r),this.rest=e.substring(e.indexOf(",")+1)}}function dV(t){const e=new w1(t);return e.base64?E1(wn.BASE64,e.rest):hV(e.rest)}function fV(t){return new w1(t).contentType}function pV(t,e){return t.length>=e.length?t.substring(t.length-e.length)===e:!1}/**
3630 * @license
3631 * Copyright 2017 Google LLC
3632 *
3633 * Licensed under the Apache License, Version 2.0 (the "License");
3634 * you may not use this file except in compliance with the License.
3635 * You may obtain a copy of the License at
3636 *
3637 *   http://www.apache.org/licenses/LICENSE-2.0
3638 *
3639 * Unless required by applicable law or agreed to in writing, software
3640 * distributed under the License is distributed on an "AS IS" BASIS,
3641 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3642 * See the License for the specific language governing permissions and
3643 * limitations under the License.
3644 */class _r{constructor(e,n){let r=0,i="";Jv(e)?(this.data_=e,r=e.size,i=e.type):e instanceof ArrayBuffer?(n?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),r=this.data_.length):e instanceof Uint8Array&&(n?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),r=e.length),this.size_=r,this.type_=i}size(){return this.size_}type(){return this.type_}slice(e,n){if(Jv(this.data_)){const r=this.data_,i=lV(r,e,n);return i===null?null:new _r(i)}else{const r=new Uint8Array(this.data_.buffer,e,n-e);return new _r(r,!0)}}static getBlob(...e){if(Zm()){const n=e.map(r=>r instanceof _r?r.data_:r);return new _r(aV.apply(null,n))}else{const n=e.map(o=>Jm(o)?cV(wn.RAW,o).data:o.data_);let r=0;n.forEach(o=>{r+=o.byteLength});const i=new Uint8Array(r);let s=0;return n.forEach(o=>{for(let l=0;l<o.length;l++)i[s++]=o[l]}),new _r(i,!0)}}uploadData(){return this.data_}}/**
3645 * @license
3646 * Copyright 2017 Google LLC
3647 *
3648 * Licensed under the Apache License, Version 2.0 (the "License");
3649 * you may not use this file except in compliance with the License.
3650 * You may obtain a copy of the License at
3651 *
3652 *   http://www.apache.org/licenses/LICENSE-2.0
3653 *
3654 * Unless required by applicable law or agreed to in writing, software
3655 * distributed under the License is distributed on an "AS IS" BASIS,
3656 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3657 * See the License for the specific language governing permissions and
3658 * limitations under the License.
3659 */function T1(t){let e;try{e=JSON.parse(t)}catch{return null}return JO(e)?e:null}/**
3660 * @license
3661 * Copyright 2017 Google LLC
3662 *
3663 * Licensed under the Apache License, Version 2.0 (the "License");
3664 * you may not use this file except in compliance with the License.
3665 * You may obtain a copy of the License at
3666 *
3667 *   http://www.apache.org/licenses/LICENSE-2.0
3668 *
3669 * Unless required by applicable law or agreed to in writing, software
3670 * distributed under the License is distributed on an "AS IS" BASIS,
3671 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3672 * See the License for the specific language governing permissions and
3673 * limitations under the License.
3674 */function mV(t){if(t.length===0)return null;const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function gV(t,e){const n=e.split("/").filter(r=>r.length>0).join("/");return t.length===0?n:t+"/"+n}function I1(t){const e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}/**
3675 * @license
3676 * Copyright 2017 Google LLC
3677 *
3678 * Licensed under the Apache License, Version 2.0 (the "License");
3679 * you may not use this file except in compliance with the License.
3680 * You may obtain a copy of the License at
3681 *
3682 *   http://www.apache.org/licenses/LICENSE-2.0
3683 *
3684 * Unless required by applicable law or agreed to in writing, software
3685 * distributed under the License is distributed on an "AS IS" BASIS,
3686 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3687 * See the License for the specific language governing permissions and
3688 * limitations under the License.
3689 */function yV(t,e){return e}class mt{constructor(e,n,r,i){this.server=e,this.local=n||e,this.writable=!!r,this.xform=i||yV}}let Vl=null;function _V(t){return!Jm(t)||t.length<2?t:I1(t)}function A1(){if(Vl)return Vl;const t=[];t.push(new mt("bucket")),t.push(new mt("generation")),t.push(new mt("metageneration")),t.push(new mt("name","fullPath",!0));function e(s,o){return _V(o)}const n=new mt("name");n.xform=e,t.push(n);function r(s,o){return o!==void 0?Number(o):o}const i=new mt("size");return i.xform=r,t.push(i),t.push(new mt("timeCreated")),t.push(new mt("updated")),t.push(new mt("md5Hash",null,!0)),t.push(new mt("cacheControl",null,!0)),t.push(new mt("contentDisposition",null,!0)),t.push(new mt("contentEncoding",null,!0)),t.push(new mt("contentLanguage",null,!0)),t.push(new mt("contentType",null,!0)),t.push(new mt("metadata","customMetadata",!0)),Vl=t,Vl}function vV(t,e){function n(){const r=t.bucket,i=t.fullPath,s=new Ft(r,i);return e._makeStorageReference(s)}Object.defineProperty(t,"ref",{get:n})}function EV(t,e,n){const r={};r.type="file";const i=n.length;for(let s=0;s<i;s++){const o=n[s];r[o.local]=o.xform(r,e[o.server])}return vV(r,t),r}function S1(t,e,n){const r=T1(e);return r===null?null:EV(t,r,n)}function wV(t,e,n,r){const i=T1(e);if(i===null||!Jm(i.downloadTokens))return null;const s=i.downloadTokens;if(s.length===0)return null;const o=encodeURIComponent;return s.split(",").map(c=>{const d=t.bucket,p=t.fullPath,m="/b/"+o(d)+"/o/"+o(p),v=sh(m,n,r),w=_1({alt:"media",token:c});return v+w})[0]}function TV(t,e){const n={},r=e.length;for(let i=0;i<r;i++){const s=e[i];s.writable&&(n[s.server]=t[s.local])}return JSON.stringify(n)}class eg{constructor(e,n,r,i){this.url=e,this.method=n,this.handler=r,this.timeout=i,this.urlParam
vendor: 1,504 bytes, lines 3689-3704
3689s={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}/**
3690 * @license
3691 * Copyright 2017 Google LLC
3692 *
3693 * Licensed under the Apache License, Version 2.0 (the "License");
3694 * you may not use this file except in compliance with the License.
3695 * You may obtain a copy of the License at
3696 *
3697 *   http://www.apache.org/licenses/LICENSE-2.0
3698 *
3699 * Unless required by applicable law or agreed to in writing, software
3700 * distributed under the License is distributed on an "AS IS" BASIS,
3701 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3702 * See the License for the specific language governing permissions and
3703 * limitations under the License.
3704 */function R1(t){if(!t)throw Ym()}function IV(t,e){function n(r,i){const s=S1(t,i,e);return R1(s!==null),s}return n}function AV(t,e){function n(r,i){const s=S1(t,i,e);return R1(s!==null),wV(s,i,t.host,t._protocol)}return n}function C1(t){function e(n,r){let i;return n.getStatus()===401?n.getErrorText().includes("Firebase App Check token is invalid")?i=MO():i=LO():n.getStatus()===402?i=VO(t.bucket):n.getStatus()===403?i=FO(t.path):i=r,i.status=n.getStatus(),i.serverResponse=r.serverResponse,i}return e}function P1(t){const e=C1(t);function n(r,i){let s=e(r,i);return r.getStatus()===404&&(s=OO(t.path)),s.serverResponse=i.serverResponse,s}return n}function SV(t,e,n){const r=e.fullServerUrl(),i=sh(r,t.host,t._protocol),s="GET",o=t.maxOperationRetryTime,l=ne
3704w eg(i,s,AV(t,n),o);return l.errorHandler=P1(e),l}function RV(t,e){const n=e.fullServerUrl(),r=sh(n,t.host,t._protocol),i="DELETE",s=t.maxOperationRetryTime;function o(u,c){}const l=new eg(r,i,o,s);return l.successCodes=[200,204],l.errorHandler=P1(e),l}function CV(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}function PV(t,e,n){const r=Object.assign({},n);return r.fullPath=t.path,r.size=e.size(),r.contentType||(r.contentType=CV(null,e)),r}function kV(t,e,n,r,i){const s=e.bucketOnlyServerUrl(),o={"X-Goog-Upload-Protocol":"multipart"};function l(){let T="";for(let x=0;x<2;x++)T=T+Math.random().toString().slice(2);return T}const u=l();o["Content-Type"]="multipart/related; boundary="+u;const c=PV(e,r,i),d=TV(c,n),p="--"+u+`\r
3705Content-Type: application/json; charset=utf-8\r
3706\r
3707`+d+`\r
3708--`+u+`\r
3709Content-Type: `+c.contentType+`\r
3710\r
3711`,m=`\r
3712--`+u+"--",v=_r.getBlob(p,r,m);if(v===null)throw WO();const w={name:c.fullPath},P=sh(s,t.host,t._protocol),C="POST",E=t.maxUploadRetryTime,g=new eg(P,C,IV(t,n),E);return g.urlParams=w,g.headers=o,g.body=v.uploadData(),g.errorHandler=C1(e),g}class xV{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=fi.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=fi.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=fi.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,n,r,i,s){if(this.sent_)throw wo("cannot .send() more than once");if(nr(e)&&r&&(this.xhr_.withCredentials=!0),this.sent_=!0,this.xhr_.open(n,e,!0),s!==void 0)for(const o in s)s.hasOwnProperty(o)&&this.xhr_.setRequestHeader(o,s[o].toString());return i!==void 0?this.xhr_.send(i):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw wo("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw wo("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw wo("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw wo("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",e)}}class bV extends xV{initXhr(){this.xhr_.responseType="text"}}function tg(){return new bV}/**
3713 * @license
3714 * Copyright 2019 Google LLC
3715 *
3716 * Licensed under the Apache License, Version 2.0 (the "License");
3717 * you may not use this file except in compliance with the License.
3718 * You may obtain a copy of the License at
3719 *
3720 *   http://www.apache.org/licenses/LICENSE-2.0
3721 *
3722 * Unless required by applicable law or agreed to in writing, software
3723 * distributed under the License is distributed on an "AS IS" BASIS,
3724 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3725 * See the License for the specific language governing permissions and
3726 * limitations under the License.
3727 */class Ii{constructor(e,n){this._service=e,n instanceof Ft?this._location=n:this._location=Ft.makeFromUrl(n,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,n){return new Ii(e,n)}get root(){const e=new Ft(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return I1(this._location.path)}get storage(){return this._service}get parent(){const e=mV(this._location.path);if(e===null)return null;const n=new Ft(this._location.bucket,e);return new Ii(this._service,n)}_throwIfRoot(e){if(this._location.path==="")throw GO(e)}}function NV(t,e,n){t._throwIfRoot("uploadBytes");const r=kV(t.storage,t._location,A1(),new _r(e,!0),n);return t.storage.makeRequestWithTokens(r,tg).then(i=>({metadata:i,ref:t}))}function DV(t){t._throwIfRoot("getDownloadURL");const e=SV(t.storage,t._location,A1());return t.storage.makeRequestWithTokens(e,tg).then(n=>{if(n===null)throw qO();return n})}function OV(t){t._throwIfRoot("deleteObject");const e=RV(t.storage,t._location);return t.storage.makeRequestWithTokens(e,tg)}function VV(t,e){const n=gV(t._location.path,e),r=new Ft(t._location.bucket,n);return new Ii(t.storage,r)}/**
3728 * @license
3729 * Copyright 2017 Google LLC
3730 *
3731 * Licensed under the Apache License, Version 2.0 (the "License");
3732 * you may not use this file except in compliance with the License.
3733 * You may obtain a copy of the License at
3734 *
3735 *   http://www.apache.org/licenses/LICENSE-2.0
3736 *
3737 * Unless required by applicable law or agreed to in writing, software
3738 * distributed under the License is distributed on an "AS IS" BASIS,
3739 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3740 * See the License for the specific language governing permissions and
3741 * limitations under the License.
3742 */function LV(t){return/^[A-Za-z]+:\/\//.test(t)}function MV(t,e){return new Ii(t,e)}function k1(t,e){if(t instanceof ng){const n=t;if(n._bucket==null)throw BO();const r=new Ii(n,n._bucket);return e!=null?k1(r,e):r}else return e!==void 0?VV(t,e):t}function FV(t,e){if(e&&LV(e)){if(t instanceof ng)return MV(t,e);throw Bf("To use ref(service, url), the first argument must be a Storage instance.")}else return k1(t,e)}function e0(t,e){const n=e==null?void 0:e[g1];return n==null?null:Ft.makeFromBucketSpec(n,t)}function UV(t,e,n,r={}){t.host=`${e}:${n}`;const i=nr(e);i&&(Dc(`https://${t.host}/b`),Oc("Storage",!0)),t._isUsingEmulator=!0,t._protocol=i?"https":"http";const{mockUserToken:s}=r;s&&(t._overrideAuthToken=typeof s=="string"?s:Qw(s,t.app.options.projectId))}class ng{constructor(e,n,r,i,s,o=!1){this.app=e,this._authProvider=n,this._appCheckProvider=r,this._url=i,this._firebaseVersion=s,this._isUsingEmulator=o,this._bucket=null,this._host=m1,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=NO,this._maxUploadRetryTime=DO,this._requests=new Set,i!=null?this._bucket=Ft.makeFromBucketSpec(i,this._host):this._bucket=e0(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=Ft.makeFromBucketSpec(this._url,e):this._bucket=e0(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){Zv("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){Zv("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const n=await e.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){if(St(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new Ii(this,e)}_makeRequest(e,n,r,i,s=!0){if(this._deleted)return new KO(y1());{const o=sV(e,this._appId,r,i,n,this._firebaseVersion,s,this._isUsingEmulator);return this._requests.add(o),o.getPromise().then(()=>this._requests.delete(o),()=>this._requests.delete(o)),o}}async makeRequestWithTokens(e,n){const[r,i]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,n,r,i).getPromise()}}const t0="@firebase/storage",n0="0.13.14";/**
3743 * @license
3744 * Copyright 2020 Google LLC
3745 *
3746 * Licensed under the Apache License, Version 2.0 (the "License");
3747 * you may not use this file except in compliance with the License.
3748 * You may obtain a copy of the License at
3749 *
3750 *   http://www.apache.org/licenses/LICENSE-2.0
3751 *
3752 * Unless required by applicable law or agreed to in writing, software
3753 * distributed under the License is distributed on an "AS IS" BASIS,
3754 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3755 * See the License for the specific language governing permissions and
3756 * limitations under the License.
3757 */const x1="storage";function mF(t,e,n){return t=he(t),NV(t,e,n)}function gF(t){return t=he(t),DV(t)}function yF(t){return t=he(t),OV(t)}function _F(t,e){return t=he(t),FV(t,e)}function jV(t=Lc(),e){t=he(t);const r=Na(t,x1).getImmediate({identifier:e}),i=Xp("storage");return i&&zV(r,...i),r}function zV(t,e,n,r={}){UV(t,e,n,r)}function $V(t,{instanceIdentifier:e}){const n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal"),i=t.getProvider("app-check-internal");return new ng(n,r,i,e,Ri)}function BV(){bn(new cn(x1,$V,"PUBLIC").setMultipleInstances(!0)),jt(t0,n0,""),jt(t0,n0,"esm2017")}BV();/**
3758 * @license
3759 * Copyright 2020 Google LLC
3760 *
3761 * Licensed under the Apache License, Version 2.0 (the "License");
3762 * you may not use this file except in compliance with the License.
3763 * You may obtain a copy of the License at
3764 *
3765 *   http://www.apache.org/licenses/LICENSE-2.0
3766 *
3767 * Unless required by applicable law or agreed to in writing, software
3768 * distributed under the License is distributed on an "AS IS" BASIS,
3769 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3770 * See the License for the specific language governing permissions and
3771 * limitations under the License.
3772 */const WV=new Map,qV={activated:!1,tokenObservers:[]};function pn(t){return WV.get(t)||Object.assign({},qV)}const r0={RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3};/**
3773 * @license
3774 * Copyright 2020 Google LLC
3775 *
3776 * Licensed under the Apache License, Version 2.0 (the "License");
3777 * you may not use this file except in compliance with the License.
3778 * You may obtain a copy of the License at
3779 *
3780 *   http://www.apache.org/licenses/LICENSE-2.0
3781 *
3782 * Unless required by applicable law or agreed to in writing, software
3783 * distributed under the License is distributed on an "AS IS" BASIS,
3784 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3785 * See the License for the specific language governing permissions and
3786 * limitations under the License.
3787 */class HV{constructor(e,n,r,i,s){if(this.operation=e,this.retryPolicy=n,this.getWaitDuration=r,this.lowerBound=i,this.upperBound=s,this.pending=null,this.nextErrorWaitInterval=i,i>s)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}async process(e){this.stop();try{this.pending=new gf,this.pending.promise.catch(n=>{}),await GV(this.getNextRun(e)),this.pending.resolve(),await this.pending.promise,this.pending=new gf,this.pending.promise.catch(n=>{}),await this.operation(),this.pending.resolve(),await this.pending.promise,this.process(!0).catch(()=>{})}catch(n){this.retryPolicy(n)?this.process(!1).catch(()=>{}):this.stop()}}getNextRun(e){if(e)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{const n=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),n}}}function GV(t){return new Promise(e=>{setTimeout(e,t)})}/**
3788 * @license
3789 * Copyright 2020 Google LLC
3790 *
3791 * Licensed under the Apache License, Version 2.0 (the "License");
3792 * you may not use this file except in compliance with the License.
3793 * You may obtain a copy of the License at
3794 *
3795 *   http://www.apache.org/licenses/LICENSE-2.0
3796 *
3797 * Unless required by applicable law or agreed to in writing, software
3798 * distributed under the License is distributed on an "AS IS" BASIS,
3799 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3800 * See the License for the specific language governing permissions and
3801 * limitations under the License.
3802 */const KV={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.","initial-throttle":"{$httpStatus} error. Attempts allowed again after {$time}",throttled:"Requests throttled due to previous {$httpStatus} error. Attempts allowed again after {$time}"},hc=new Fs("appCheck","AppCheck",KV);function b1(t){if(!pn(t).activated)throw hc.create("use-before-activation",{appName:t.name})}/**
3803 * @license
3804 * Copyright 2020 Google LLC
3805 *
3806 * Licensed under the Apache License, Version 2.0 (the "License");
3807 * you may not use this file except in compliance with the License.
3808 * You may obtain a copy of the License at
3809 *
3810 *   http://www.apache.org/licenses/LICENSE-2.0
3811 *
3812 * Unless required by applicable law or agreed to in writing, software
3813 * distributed under the License is distributed on an "AS IS" BASIS,
3814 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3815 * See the License for the specific language governing permissions and
3816 * limitations under the License.
3817 */const QV="firebase-app-check-database",XV=1,Wf="firebase-app-check-store";let Ll=null;function YV(){return Ll||(Ll=new Promise((t,e)=>{try{const n=indexedDB.open(QV,XV);n.onsuccess=r=>{t(r.target.result)},n.onerror=r=>{var i;e(hc.create("storage-open",{originalErrorMessage:(i=r.target.error)===null||i===void 0?void 0:i.message}))},n.onupgradeneeded=r=>{const i=r.target.result;switch(r.oldVersion){case 0:i.createObjectStore(Wf,{keyPath:"compositeKey"})}}}catch(n){e(hc.create("storage-open",{originalErrorMessage:n==null?void 0:n.message}))}}),Ll)}function JV(t,e){return ZV(eL(t),e)}async function ZV(t,e){const r=(await YV()).transaction(Wf,"readwrite"),s=r.objectStore(Wf).put({compositeKey:t,value:e});return new Promise((o,l)=>{s.onsuccess=u=>{o()},r.onerror=u=>{var c;l(hc.create("storage-set",{originalErrorMessage:(c=u.target.error)===null||c===void 0?void 0:c.message}))}})}function eL(t){return`${t.options.appId}-${t.name}`}/**
3818 * @license
3819 * Copyright 2020 Google LLC
3820 *
3821 * Licensed under the Apache License, Version 2.0 (the "License");
3822 * you may not use this file except in compliance with the License.
3823 * You may obtain a copy of the License at
3824 *
3825 *   http://www.apache.org/licenses/LICENSE-2.0
3826 *
3827 * Unless required by applicable law or agreed to in writing, software
3828 * distributed under the License is distributed on an "AS IS" BASIS,
3829 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3830 * See the License for the specific language governing permissions and
3831 * limitations under the License.
3832 */const qf=new Vc("@firebase/app-check");function i0(t,e){return Xw()?JV(t,e).catch(n=>{qf.warn(`Failed to write token to IndexedDB. Error: ${n}`)}):Promise.resolve()}/**
3833 * @license
3834 * Copyright 2020 Google LLC
3835 *
3836 * Licensed under the Apache License, Version 2.0 (the "License");
3837 * you may not use this file except in compliance with the License.
3838 * You may obtain a copy of the License at
3839 *
3840 *   http://www.apache.org/licenses/LICENSE-2.0
3841 *
3842 * Unless required by applicable law or agreed to in writing, software
3843 * distributed under the License is distributed on an "AS IS" BASIS,
3844 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3845 * See the License for the specific language governing permissions and
3846 * limitations under the License.
3847 */const tL={error:"UNKNOWN_ERROR"};function nL(t){return Qp.encodeString(JSON.stringify(t),!1)}async function Hf(t,e=!1,n=!1){const r=t.app;b1(r);const i=pn(r);let s=i.token,o;if(s&&!Do(s)&&(i.token=void 0,s=void 0),!s){const c=await i.cachedTokenPromise;c&&(Do(c)?s=c:await i0(r,void 0))}if(!e&&s&&Do(s))return{token:s.token};let l=!1;try{i.exchangeTokenPromise||(i.exchangeTokenPromise=i.provider.getToken().finally(()=>{i.exchangeTokenPromise=void 0}),l=!0),s=await pn(r).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"||c.code==="appCheck/initial-throttle"?qf.warn(c.message):n&&qf.error(c),o=c}let u;return s?o?Do(s)?u={token:s.token,internalError:o}:u=o0(o):(u={token:s.token},i.token=s,await i0(r,s)):u=o0(o),l&&oL(r,u),u}async function rL(t){const e=t.app;b1(e);const{provider:n}=pn(e);{const{token:r}=await n.getToken();return{token:r}}}function iL(t,e,n,r){const{app:i}=t,s=pn(i),o={next:n,error:r,type:e};if(s.tokenObservers=[...s.tokenObservers,o],s.token&&Do(s.token)){const l=s.token;Promise.resolve().then(()=>{n({token:l.token}),s0(t)}).catch(()=>{})}s.cachedTokenPromise.then(()=>s0(t))}function N1(t,e){const n=pn(t),r=n.tokenObservers.filter(i=>i.next!==e);r.length===0&&n.tokenRefresher&&n.tokenRefresher.isRunning()&&n.tokenRefresher.stop(),n.tokenObservers=r}function s0(t){const{app:e}
3847=t,n=pn(e);let r=n.tokenRefresher;r||(r=sL(t),n.tokenRefresher=r),!r.isRunning()&&n.isTokenAutoRefreshEnabled&&r.start()}function sL(t){const{app:e}=t;return new HV(async()=>{const n=pn(e);let r;if(n.token?r=await Hf(t,!0):r=await Hf(t),r.error)throw r.error;if(r.internalError)throw r.internalError},()=>!0,()=>{const n=pn(e);if(n.token){let r=n.token.issuedAtTimeMillis+(n.token.expireTimeMillis-n.token.issuedAtTimeMillis)*.5+3e5;const i=n.token.expireTimeMillis-5*60*1e3;return r=Math.min(r,i),Math.max(0,r-Date.now())}else return 0},r0.RETRIAL_MIN_WAIT,r0.RETRIAL_MAX_WAIT)}function oL(t,e){const n=pn(t).tokenObservers;for(const r of n)try{r.type==="EXTERNAL"&&e.error!=null?r.error(e.error):r.next(e)}catch{}}function Do(t){return t.expireTimeMillis-Date.now()>0}function o0(t){return{token:nL(tL),error:t}}/**
3848 * @license
3849 * Copyright 2020 Google LLC
3850 *
3851 * Licensed under the Apache License, Version 2.0 (the "License");
3852 * you may not use this file except in compliance with the License.
3853 * You may obtain a copy of the License at
3854 *
3855 *   http://www.apache.org/licenses/LICENSE-2.0
3856 *
3857 * Unless required by applicable law or agreed to in writing, software
3858 * distributed under the License is distributed on an "AS IS" BASIS,
3859 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3860 * See the License for the specific language governing permissions and
3861 * limitations under the License.
3862 */class aL{constructor(e,n){this.app=e,this.heartbeatServiceProvider=n}_delete(){const{tokenObservers:e}=pn(this.app);for(const n of e)N1(this.app,n.next);return Promise.resolve()}}function lL(t,e){return new aL(t,e)}function uL(t){return{getToken:e=>Hf(t,e),getLimitedUseToken:()=>rL(t),addTokenListener:e=>iL(t,"INTERNAL",e),removeTokenListener:e=>N1(t.app,e)}}const cL="@firebase/app-check",hL="0.10.1",dL="app-check",a0="app-check-internal";function fL(){bn(new cn(dL,t=>{const e=t.getProvider("app").getImmediate(),n=t.getProvider("heartbeat");return lL(e,n)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,e,n)=>{t.getProvider(a0).initialize()})),bn(new cn(a0,t=>{const e=t.getProvider("app-check").getImmediate();return uL(e)},"PUBLIC").setInstantiationMode("EXPLICIT")),jt(cL,hL)}fL();const au={apiKey:"AIzaSyCEd0lMM6hG5q2xT9R4_lBPO-M2Q-a3cBM",authDomain:"dataprotectionappchile.firebaseapp.com",projectId:"dataprotectionappchile",storageBucket:"dataprotectionappchile.firebasestorage.app",messagingSenderId:"312512497554",appId:"1:312512497554:web:7ab1ae8ca7457f5619234b"};(!au.apiKey||!au.authDomain||!au.projectId)&&console.error("Error: Faltan variables de entorno de Firebase. Revisa tu archivo .env.");const oh=Zw(au),ji=Wb(oh),D1=WD(oh),vF=xO(oh,"southamerica-west1"),EF=jV(oh),Gf="https://datashield.up.railway.app";console.log("📡 Conectando a:",Gf);const pL="modulepreload",mL=function(t){return"/"+t},l0={},W=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(u=>{if(u=mL(u),u in l0)return;l0[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const p=document.createElement("link");if(p.rel=c?"stylesheet":pL,c||(p.as="script"),p.crossOrigin="",p.href=u,l&&p.setAttribute("nonce",l),document.head.appendChild(p),c)return new Promise((m,v)=>{p.addEventListener("load",m),p.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return e().catch(s)})},gL=$.lazy(()=>W(()=>import("./VerifyRequest-CwSsJtxX.js"),__vite__mapDeps([0,1,2,3,4,5]))),u0=$.lazy(()=>W(()=>import("./PublicArcopRequestForm-CuWjZCnn.js"),__vite__mapDeps([6,7,8,1,5,9,10]))),yL=$.lazy(()=>W(()=>import("./PublicCapturaPunto-CBtRhpR6.js"),__vite__mapDeps([11,5,1,9]))),_L=$.lazy(()=>W(()=>import("./PublicPreferenceCenter-8fLOLOIw.js"),__vite__mapDeps([12,13,8,1,9,14,15]))),vL=$.lazy(()=>W(()=>import("./PublicConsentSigning-CS5JrlRe.js"),__vite__mapDeps([16,17,18,15,1,14,9,2]))),EL=$.lazy(()=>W(()=>import("./PublicConsentConfirm-DwiQYiRt.js"),__vite__mapDeps([19,1,9,15]))),wL=$.lazy(()=>W(()=>import("./ArcopStatusPage-CZbp8Yjj.js"),__vite__mapDeps([20,1,21,22,2,14,5]))),TL=$.lazy(()=>W(()=>import("./PublicVendorQuestionnaire-BHtr4KPY.js"),__vite__mapDeps([23,1]))),IL=$.lazy(()=>W(()=>import("./Dashboard-B763GwFQ.js"),__vite__mapDeps([24,25,26,27,28,9,29,30,31,3,2,32,33,34,35]))),AL=$.lazy(()=>W(()=>import("./ObligationsCalendarPage-DbZULP1k.js"),__vite__mapDeps([36,37,28,38,1,9,39]))),SL=$.lazy(()=>W(()=>import("./BoardDashboard-2j60uoT3.js"),__vite__mapDeps([40,41,42,13,43,29,1,32,9,34,44,45]))),RL=$.lazy(()=>W(()=>import("./LoginPage-BbFcOOL3.js"),__vite__mapDeps([46,47,14,3,1]))),CL=$.lazy(()=>W(()=>import("./ChangePassword-DNSdPKSq.js"),__vite__mapDeps([48,1,3]))),PL=$.lazy(()=>W(()=>import("./VerifyMFA-NM6-9MyR.js"),__vite__mapDeps([49,9,50,1]))),kL=$.lazy(()=>W(()=>import("./SetupMFAPage-DZoVG_qK.js"),__vite__mapDeps([51,9,1,52,53,54]))),xL=$.lazy(()=>W(()=>import("./SecuritySettings-I-SymQ9z.js"),__vite__mapDeps([55,9,50,56,1,54,57,53,58]))),bL=$.lazy(()=>W(()=>import("./MPICertification-CSjW3d7W.js"),__vite__mapDeps([59,37,60,61,1,62,63,64,65,66,29,67,68,3,69,2,70,71,9]))),NL=$.lazy(()=>W(()=>import("./GovernanceDelegates-Q6u4JH68.js"),__vite__mapDeps([72,37,60,61,9,1,31,70,65,14,73,64,74,75,63,3,15,18,68,69]))),DL=$.lazy(()=>W(()=>import("./ProcessingActivities-CLlQmABP.js"),__vite__mapDeps([76,61,77,13,78,79,41,42,2,31,45,29,1,35,25,80,26,58,4,74,37,60,81,75,32,82,83,84,85,86,70,87,88,89]))),OL=$.lazy(()=>W(()=>import("./DataSubjects-COZ40Ri-.js"),__vite__mapDeps([90,79,60,41,42,13,37,91,78,1,31,69,74,22,35,87,58,29,15,92,93,2,94,53,5]))),VL=$.lazy(()=>W(()=>import("./DataSubjectRequests-8IYRxWPw.js"),__vite__mapDeps([95,37,41,42,13,7,61,96,4,14,1,97,35,25,26,68,70,93,45,2,79,75,22,74,10,98,94,5,56,9,86,53,58,69,87,29,15,92]))),LL=$.lazy(()=>W(()=>import("./CentroTareas-nMaW6aeB.js"),__vite__mapDeps([99,1,38,9,94,100,4,68,5]))),ML=$.lazy(()=>W(()=>import("./ImpactAssessment-D6vkTVnP.js"),__vite__mapDeps([101,60,41,42,13,47,2,102,25,58,74,69,5,35,1,68,79,80,26,4,18,103,10,83,53,29,37,77,61,104,32,94,70,31,86]))),FL=$.lazy(()=>W(()=>import("./ConsentManagement-Bden6Zje.js"),__vite__mapDeps([105,79,96,13,91,78,17,18,15,41,42,1,97,2,9,53,60,37,35,70,39,106,31,74,22,103,87,5]))),UL=$.lazy(()=>W(()=>import("./ReportsPage-CcUe2P-O.js"),__vite__mapDeps([107,37,41,42,13,96,108,62,2,35,31,106,33,29,38,45,1,70]))),jL=$.lazy(()=>W(()=>import("./MitreCoveragePage-CrZfEfhh.js"),__vite__mapDeps([109,37,42,53,1,32]))),zL=$.lazy(()=>W(()=>import("./SaasMonitoringPage-BcVZ9Cvl.js"),__vite__mapDeps([110,37,42,53,1,111,32,31]))),$L=$.lazy(()=>W(()=>import("./SoaVerificationPage-DkEJUvK-.js"),__vite__mapDeps([112,37,42,63,53,1,68,103]))),BL=$.lazy(()=>W(()=>import("./BukIntegrationPage-CBD74_E7.js"),__vite__mapDeps([113,37,42,1,68,53,86,31,114]))),WL=$.lazy(()=>W(()=>import("./ComplianceAI-CRq2s1UU.js"),__vite__mapDeps([115,60,37,98,116,80,83,117,100,86,34]))),qL=$.lazy(()=>W(()=>import("./InternationalTransfers-BLjsjc-p.js"),__vite__mapDeps([118,79,60,37,1,89,2,74,10,82,87,58]))),HL=$.lazy(()=>W(()=>import("./SensitiveData-BhpHGSzG.js"),__vite__mapDeps([119,79,60,1,74,45,31,87,58,86]))),GL=$.lazy(()=>W(()=>import("./VideoSurveillance-BbLh7YcO.js"),__vite__mapDeps([120,79,60,1,74,86,2,82,87,58,31]))),KL=$.lazy(()=>W(()=>import("./AutomatedAudits-DfHOqctU.js"),__vite__mapDeps([121,61,104,122,37,123,108,2,22,18,84,4,68]))),QL=$.lazy(()=>W(()=>import("./DataCategoryManagement-COIsVjIc.js"),__vite__mapDeps([124,60,41,42,13,1,97,74,87,58]))),XL=$.lazy(()=>W(()=>import("./PrivacyDashboard-DyQTBuuI.js"),__vite__mapDeps([125,1,9,38,31,35,62,3,30,10,67,5,43,44,126,106,75]))),YL=$.lazy(()=>W(()=>import("./SecurityScanner-To7lm7PS.js"),__vite__mapDeps([127,61,104,89,85,2,68]))),JL=$.lazy(()=>W(()=>import("./ComplianceDashboard21663-B0JXagSd.js"),__vite__mapDeps([128,2,85,32,88,93,129,1,9,67,5,10,33,44,126]))),ZL=$.lazy(()=>W(()=>import("./IncidentManagement-WqoTT4wv.js"),__vite__mapDeps([130,61,37,60,41,42,13,47,
3862131,1,65,53,93,2,29,68,116,80,25]))),eM=$.lazy(()=>W(()=>import("./AccessLogMonitoring-CQl2HQlh.js"),__vite__mapDeps([132,32,70,22]))),tM=$.lazy(()=>W(()=>import("./VendorManagement-DQs2XS92.js"),__vite__mapDeps([133,34,3,79,9,1,93,134,70,74,22,38,102,2,87,58]))),nM=$.lazy(()=>W(()=>import("./ComplianceRegistry-B5lGZRXO.js"),__vite__mapDeps([135,37,79,70,74,87,2,80,31,1,38,58]))),rM=$.lazy(()=>W(()=>import("./GlobalSocDashboard-CRnSn4Is.js"),__vite__mapDeps([136,32,89,22,67,2]))),iM=$.lazy(()=>W(()=>import("./WazuhGdprCompliance-C3QxIguv.js"),__vite__mapDeps([137,42,1,32]))),sM=$.lazy(()=>W(()=>import("./SgsiDashboard-RETSM2b_.js"),[])),oM=$.lazy(()=>W(()=>import("./PlanningAndContext-DCzV0_nQ.js"),__vite__mapDeps([138,139,41,42,13,29,140,1]))),aM=$.lazy(()=>W(()=>import("./RiskManagement-DTPloXbY.js"),__vite__mapDeps([141,139,47,131,42,140,79,41,13,142,98,103,1,29,5,70,143]))),lM=$.lazy(()=>W(()=>import("./ImplementationAndOperation-qOIj4Dj8.js"),__vite__mapDeps([144,60,41,42,13,1,29,94,139,145,79,146,140,129,66,67]))),uM=$.lazy(()=>W(()=>import("./VerificationAndMonitoring-B23dppex.js"),__vite__mapDeps([147,139,1,148,60]))),cM=$.lazy(()=>W(()=>import("./ContinuousImprovement-7ec1b1sY.js"),__vite__mapDeps([149,139,60,41,42,13,1,29]))),hM=$.lazy(()=>W(()=>import("./BusinessContinuityPage-DaG3dZEV.js"),__vite__mapDeps([150,61,104,2,80,74,87,58,73,37,9]))),dM=$.lazy(()=>W(()=>import("./TechnicalControls-ZAZXTflp.js"),__vite__mapDeps([151,61,104,1,2,87,31,73]))),fM=$.lazy(()=>W(()=>import("./HumanResources-CC96B19I.js"),__vite__mapDeps([152,61,104,122,1,2,31,65,62,117,69,70,74,87,73]))),pM=$.lazy(()=>W(()=>import("./KPIsAndMetrics-tOGvQR-I.js"),__vite__mapDeps([153,61,104,1,74,71,87,117,73,154,34]))),mM=$.lazy(()=>W(()=>import("./AssetInventory-ClnD_8su.js"),__vite__mapDeps([155,42,47,79,85,57,74,4,35,32,114,2,1,58,53,45]))),gM=$.lazy(()=>W(()=>import("./CertificationAssistant-8EKqEJBv.js"),__vite__mapDeps([156,143,41,42,13,98,53,1,29,70]))),yM=$.lazy(()=>W(()=>import("./InternalAudit-406O4qIq.js"),__vite__mapDeps([157,142,98,103,1,29,5,70,143,41,42,13,79,74,123,58]))),_M=$.lazy(()=>W(()=>import("./PerformanceEvaluation-BhZYHuyf.js"),__vite__mapDeps([158,142,98,103,1,29,5,70,143,41,42,13,74,34,154,58]))),vM=$.lazy(()=>W(()=>import("./OperationalPlanning-DbT0mvsi.js"),__vite__mapDeps([159,142,98,103,1,29,5,70,143,41,42,13,79,74,117,26,25,58]))),EM=$.lazy(()=>W(()=>import("./ChangeManagementPage-BB3xFt-i.js"),__vite__mapDeps([160,142,98,103,1,29,5,70,143,41,42,13,74,58]))),wM=$.lazy(()=>W(()=>import("./ManagementReview-DSaxFr_k.js"),__vite__mapDeps([148,139,60,1]))),TM=$.lazy(()=>W(()=>import("./TrainingManagementPage-i3qKuZ3O.js"),__vite__mapDeps([161,146,139,140,41,42,13,129,1,29,66,67]))),IM=$.lazy(()=>W(()=>import("./CybersecurityTrainingPage-Ct1PKhYs.js"),__vite__mapDeps([162,163]))),AM=$.lazy(()=>W(()=>import("./ModuleDownloadsPage-BH1oJ6hA.js"),__vite__mapDeps([164,61,9,65,111,2,70,22,38,1,67,29]))),SM=$.lazy(()=>W(()=>import("./WazuhDashboard-BRrigAjA.js"),__vite__mapDeps([165,37,42,32,53,22,85,166,52]))),RM=$.lazy(()=>W(()=>import("./UpdateLogPage-D9Xz94Tw.js"),__vite__mapDeps([167,42,37,61,104,53,70,22,38,85]))),CM=$.lazy(()=>W(()=>import("./MonitoringAuditReport-BJJ4_Di_.js"),__vite__mapDeps([168,61,104,42]))),PM=$.lazy(()=>W(()=>import("./WindowsHardeningDashboard-iKjorALU.js"),[])),kM=$.lazy(()=>W(()=>import("./QuickStartGuide-BmE2eVq6.js"),__vite__mapDeps([169,31,2,27,117,111,65]))),xM=$.lazy(()=>W(()=>import("./AsistenteCumplimiento-Dob7Lk9f.js"),__vite__mapDeps([170,171,13,78,37,1,82,27,3,15]))),bM=$.lazy(()=>W(()=>import("./CompanyManagementPage-BwQY-xhY.js"),__vite__mapDeps([172,171,139,81,13,43,82,114,123,85,1,74,58,166,61]))),NM=$.lazy(()=>W(()=>import("./UserRoleManagementPage-BeXgnFca.js"),__vite__mapDeps([173,145,139,79,1]))),DM=$.lazy(()=>W(()=>import("./RoleManagementPage-zhz4imxY.js"),__vite__mapDeps([174,139,1]))),OM=$.lazy(()=>W(()=>import("./ModuleManagement-Dza2mcf4.js"),__vite__mapDeps([175,1,134]))),VM=$.lazy(()=>W(()=>import("./WazuhConfigPage-Bh2r4trl.js"),__vite__mapDeps([176,42,85,53,1,111,166,52,68,86,3,94,92,21,70,57]))),LM=$.lazy(()=>W(()=>import("./SuperAdminPanel-Cow2ORHf.js"),__vite__mapDeps([177,42,1,89,53,31,166,85,111,2,32,114,34,52]))),MM=$.lazy(()=>W(()=>import("./StatementOfApplicability-BQsFmtdX.js"),__vite__mapDeps([178,139,140,41,42,13,1,29]))),FM=({title:t})=>O.jsxs("div",{className:"p-8 text-center",children:[O.jsx("h1",{className:"text-2xl font-bold text-[#00BFFF] mb-4",children:t}),O.jsx("div",{className:"bg-[#101C40] p-6 rounded-xl border border-gray-700 inline-block",children:O.jsx("p",{className:"text-gray-300",children:"🚧 Módulo en construcción o reestructuración."})})]}),O1=[{path:"/verify-request",label:"Verificación de Identidad ARSOP",type:"public",element:gL},{path:"/captura/:slug/:puntoId",label:"Captura de consentimiento",type:"public",element:yL},{path:"/solicitud-arcop/:slug",label:"Portal ARSOP",type:"public",element:u0},{path:"/solicitud-arcop",label:"Portal ARSOP (genérico)",type:"public",element:u0},{path:"/seguimiento-arcop",label:"Seguimiento de Solicitud ARSOP",type:"public",element:wL},{path:"/cuestionario-proveedor/:token",label:"Cuestionario de Seguridad — Proveedor",type:"public",element:TL},{path:"/preferencias/:slug",label:"Centro de Preferencias",type:"public",element:_L},{path:"/firmar/:token",label:"Firma de Documentos",type:"public",element:vL},{path:"/preferencias-confirmar/:token",label:"Confirmar Consentimiento",type:"public",element:EL},{path:"/login",label:"Iniciar Sesión",type:"public",element:RL},{path:"/change-password",label:"Cambiar Contraseña",type:"public",element:CL},{path:"/verify-mfa",label:"Verificación MFA",type:"public",element:PL},{path:"/setup-mfa",label:"Configurar MFA",type:"public",element:kL},{path:"/security-settings",label:"Seguridad de Cuenta",type:"main",element:xL},{path:"/",label:"Inicio",type:"main",element:IL},{path:"/privacy-dashboard",label:"Dashboard Privacidad (21.719)",type:"ley21719",element:XL},{path:"/board-view",label:"Visión Directorio",type:"main",element:SL},{path:"/mpi-certification",label:"Modelo de Prevención (MPI)",type:"ley21719",element:bL},{path:"/governance-delegates",label:"Gobernanza y Designación de Delegados",type:"ley21719",element:NL},{path:"/processing-activities",label:"Actividades de Tratamiento",type:"ley21719",element:DL},{path:"/data-subjects",label:"Gestión de Titulares",type:"ley21719",element:OL},{path:"/data-subject-requests",label:"Derechos ARSOP",type:"ley21719",element:VL},{path:"/tasks",label:"Plan de Acción",type:"main",element:LL},{path:"/obligations-calendar",label:"Calendario de Obligaciones",type:"main",element:AL},{path:"/impact-assessment",label:"Evaluación de Impacto (EIPD)",type:"ley21719",element:ML},{path:"/consent-management",label:"Consentimientos",type:"ley21719",element:FL},{path:"/reports",label:"Reportes y Dossier",type:"ley21719",element:UL},{path:"/integrations-buk",label:"Conector BUK (RRHH)",type:"ley21719",element:BL},{path:"/compliance-ai",label:"IA de Cumplimiento",type:"ley21719",element:WL},{path:"/international-transfers",label:"Transferencias Internacionales",type:"ley21719",element:qL},{path:"/sensitive-data",label:"Datos Sensibles",type:"ley21719",element:HL},{path:"/video-surveillance",label:"Videovigilancia",type:"ley21719",element:GL},{path:"/automated-audits",label:"Auditorías Automatizadas",type:"ley21719",element:KL},{path:"/data-categories",label:"Categorías de Datos",type:"ley21719",element:QL},{path:"/security-scanner",label:"Centro de Auditoría",type:"ley21663",element:YL},{path:"/compliance-dashboard-21663",label:"Dashboard Ciberseguridad",type:"ley21663",element:JL},{path:"/incidents",label:"Gestión de Incidentes",type:"ley21663",element:ZL},{path:"/mitre-coverage",label:"Cobertura MITRE ATT&CK",type:"ley21663",element:jL},{path:"/saas-monitoring",label:"Monitoreo SaaS (M365)",type:"ley21663",element:zL},{path:"/vendor-management",label:"Gestión de Terceros",type:"ley21663",element:tM},{path:"/access-logs",label:"Registros de Acceso",type:"ley21663",element:eM}
3862,{path:"/wazuh-compliance",label:"Auditoría Técnica Wazuh",type:"ley21663",element:iM},{path:"/update-log",label:"Bitácora de Actualizaciones",type:"ley21663",element:RM},{path:"/monitoring-audit-report",label:"Reportes de Monitoreo",type:"ley21663",element:CM},{path:"/compliance-registry",label:"Registro de Cumplimiento",type:"ley21663",element:nM},{path:"/sgsi",label:"Dashboard SGSI",type:"sgsi",element:sM},{path:"/sgsi/asset-inventory",label:"Inventario de Activos",type:"sgsi",element:mM},{path:"/sgsi/risk-management",label:"Matriz de Riesgos",type:"sgsi",element:aM},{path:"/sgsi/planning",label:"Planificación y Contexto",type:"sgsi",element:oM},{path:"/sgsi/business-continuity",label:"Continuidad de Negocio",type:"sgsi",element:hM},{path:"/sgsi/implementation-operation",label:"Implementación y Operación",type:"sgsi",element:lM},{path:"/sgsi/verification-monitoring",label:"Verificación y Monitoreo",type:"sgsi",element:uM},{path:"/sgsi/continuous-improvement",label:"Mejora Continua",type:"sgsi",element:cM},{path:"/soa",label:"Declaración de Aplicabilidad (SoA)",type:"sgsi",element:MM},{path:"/soa-verification",label:"Verificación Continua (SCA)",type:"sgsi",element:$L},{path:"/sgsi/technical-controls",label:"Controles Técnicos",type:"sgsi",element:dM},{path:"/sgsi/human-resources",label:"Recursos Humanos",type:"sgsi",element:fM},{path:"/sgsi/kpis-metrics",label:"KPIs y Métricas",type:"sgsi",element:pM},{path:"/sgsi/ai-certification",label:"Asistente de Certificación IA",type:"sgsi",element:gM},{path:"/sgsi/internal-audit",label:"Auditorías Internas",type:"sgsi",element:yM},{path:"/sgsi/performance-evaluation",label:"Evaluación del Desempeño",type:"sgsi",element:_M},{path:"/sgsi/operational-planning",label:"Planificación Operacional",type:"sgsi",element:vM},{path:"/sgsi/change-management",label:"Gestión de Cambios",type:"sgsi",element:EM},{path:"/sgsi/management-review",label:"Revisión por la Dirección",type:"sgsi",element:wM},{path:"/wazuh",label:"Wazuh Dashboard",type:"other",element:SM},{path:"/windows-hardening",label:"Windows Hardening Console",type:"other",element:PM},{path:"/training-management",label:"Gestión de Capacitaciones",type:"training",element:TM},{path:"/cybersecurity-training",label:"Capacitación en Ciberseguridad",type:"training",element:IM},{path:"/module-downloads",label:"Descarga de Módulos",type:"other",element:AM},{path:"/asistente",label:"Asistente de Cumplimiento",type:"other",element:xM},{path:"/quick-start",label:"Guía de Inicio Rápido",type:"other",element:kM},{path:"/global-soc",label:"SOC Global",type:"admin",element:rM},{path:"/admin/companies",label:"Gestión de Empresas",type:"admin",element:bM},{path:"/admin/users",label:"Gestión de Usuarios",type:"admin",element:NM},{path:"/admin/roles",label:"Gestión de Puestos",type:"admin",element:DM},{path:"/admin/modules",label:"Gestión de Módulos",type:"admin",element:OM},{path:"/admin/wazuh-config",label:"Configuración Wazuh",type:"admin",element:VM},{path:"/admin/super-panel",label:"Panel SuperAdmin",type:"admin",element:LM},{path:"*",label:"404",type:"fallback",element:FM,props:{title:"Página no encontrada"}}],Ml="ds_device_token",UM=12*60*60*1e3,jM=O1.filter(t=>t.type==="public").map(t=>t.path.split("/:")[0]);function zM(t){return jM.some(e=>t===e||t.startsWith(e+"/"))}const V1=D.createContext(),$M=({children:t})=>{const[e,n]=D.useState(null),[r,i]=D.useState(null),[s,o]=D.useState(""),[l,u]=D.useState(""),[c,d]=D.useState(null),[p,m]=D.useState(""),[v,w]=D.useState(!1),[P,C]=D.useState(!1),[E,g]=D.useState(!1),[T,x]=D.useState(!1),[F,U]=D.useState(!0),[I,_]=D.useState(null),[A,S]=D.useState(!1),[k,b]=D.useState(""),[R,Tt]=D.useState(""),Be=Ms(),Wt=Dn(),Zt=D.useCallback(async()=>{var K,fe;try{const te=(K=ji.currentUser)==null?void 0:K.uid;te&&sessionStorage.removeItem(`mfa_ok_${te}`);try{const oe=await((fe=ji.currentUser)==null?void 0:fe.getIdToken());oe&&await fetch(`${Gf}/api/auth/logout`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${oe}`}})}catch{}await Dx(ji),n(null),o(""),d(null),x(!1),g(!1),Be("/login")}catch(te){console.error("Error al cerrar sesión:",te)}},[Be]),q=D.useCallback(K=>{sessionStorage.setItem(`mfa_ok_${K}`,"1"),x(!1),Be("/")},[Be]);D.useEffect(()=>{let K=!0;const fe=Nx(ji,async te=>{if(te){const oe=te.uid;(async()=>{try{const Nt=t1(D1,"users",oe),qt=await sO(Nt);if(qt.exists()){const Te=qt.data(),bi=Te.clientId||Te.companyId||"";let Ks=Te.role||Te.roleId||"";!Ks&&bi&&Te.clients&&Te.clients[bi]&&(Ks=Te.clients[bi]);const Ni=Te.areaId||"";if(Te.forcePasswordChange===!0){K&&(n(te),i(oe),w(!0),U(!1)),Wt.pathname!=="/change-password"&&Be("/change-password");return}if(K&&w(!1),Te.forceMfaSetup===!0||Te.mfaEnabled!==!0){K&&(n(te),i(oe),C(!0),U(!1)),Wt.pathname!=="/setup-mfa"&&Be("/setup-mfa");return}if(K&&C(!1),Te.mfaEnabled===!0){const Di=(await te.getIdTokenResult()).claims,Oi=typeof Di.mfaAt=="number"&&Date.now()-Di.mfaAt<UM;if(Oi||sessionStorage.removeItem(`mfa_ok_${oe}`),!(Oi&&sessionStorage.getItem(`mfa_ok_${oe}`))){const Ga=localStorage.getItem(Ml);let Ys=!1;if(Ga){try{const Js=await te.getIdToken();Ys=(await(await fetch(`${Gf}/api/auth/device/check`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${Js}`},body:JSON.stringify({deviceToken:Ga})})).json()).trusted===!0}catch{localStorage.removeItem(Ml)}Ys||localStorage.removeItem(Ml)}if(!Ys){K&&(n(te),i(oe),g(!0),x(!0),U(!1)),Wt.pathname!=="/verify-mfa"&&Be("/verify-mfa");return}await te.getIdToken(!0),sessionStorage.setItem(`mfa_ok_${oe}`,"1")}}K&&(n(te),i(oe),o(bi),u(Ni),d(Ks),m(Te.appId||"default"),g(Te.mfaEnabled===!0),x(!1),C(!1),_(null));const Xs=new URLSearchParams(window.location.search).get("fresh")==="1";["/login","/verify-mfa"].includes(Wt.pathname)&&!Xs&&Be("/")}else console.error("Perfil de usuario no encontrado en Firestore."),K&&_({title:"Error de Cuenta",content:"Tu usuario no tiene un perfil asociad
3862o."})}catch(Nt){console.error("Error cargando perfil:",Nt),K&&_({title:"Error de Conexión",content:"No se pudo cargar tu perfil. Revisa tu conexión."})}finally{K&&U(!1)}})()}else{if(typeof __initial_auth_token<"u"&&__initial_auth_token)try{await Cx(ji,__initial_auth_token);return}catch{console.error("Token inicial inválido")}K&&(n(null),i(null),o(""),d(null),x(!1),g(!1),U(!1)),zM(Wt.pathname)||Be("/login")}});return()=>{K=!1,fe()}},[Be,Wt.pathname]);const J={user:e,userId:r,clientId:s,userAreaId:l,userRole:c,appId:p,forcePasswordChange:v,forceMfaSetup:P,mfaEnabled:E,mfaPending:T,setMfaPending:x,completeMfa:q,loading:F,error:I,setError:_,handleLogout:Zt,DS_DEVICE_TOKEN_KEY:Ml,showModal:A,setShowModal:S,modalContent:k,setModalContent:b,modalTitle:R,setModalTitle:Tt,auth:ji};return O.jsx(V1.Provider,{value:J,children:t})},L1=()=>D.useContext(V1),Gs=D.createContext(null),BM=({children:t})=>{const{user:e,userId:n,userRole:r,userAreaId:i,clientId:s,loading:o,handleLogout:l,logout:u}=L1(),[c,d]=D.useState(null),[p,m]=D.useState(null),v=D.useMemo(()=>{if(!r)return!1;const T=String(r).toLowerCase().trim();return["superadmin","super_admin","master","dev","platform_owner"].includes(T)},[r]),w=D.useMemo(()=>{if(!r)return!1;const T=String(r).toLowerCase().trim();return v||["admin","manager","dpo","ciso","director general","administrador"].includes(T)},[r,v]),C=(v||["globalAdmin","admin","superadmin"].includes(r))&&c?c:s,g={db:D1,auth:e,authUser:e,loading:o,handleLogout:l,logout:l,userId:n,userRole:r,isSuperAdmin:v,isPlatformAdmin:v,isCompanyAdmin:w,clientId:C,userAreaId:w&&p?p:w?"General":i,adminSelectedClient:c,setAdminSelectedClient:d,adminSelectedArea:p,setAdminSelectedArea:m,originalClientId:s,originalAreaId:i};return O.jsx(Gs.Provider,{value:g,children:!o&&t})};/**
3863 * @license lucide-react v0.534.0 - ISC
3864 *
3865 * This source code is licensed under the ISC license.
3866 * See the LICENSE file in the root directory of this source tree.
3867 */const WM=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qM=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),c0=t=>{const e=qM(t);return e.charAt(0).toUpperCase()+e.slice(1)},M1=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),HM=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
3868 * @license lucide-react v0.534.0 - ISC
3869 *
3870 * This source code is licensed under the ISC license.
3871 * See the LICENSE file in the root directory of this source tree.
3872 */var GM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
3873 * @license lucide-react v0.534.0 - ISC
3874 *
3875 * This source code is licensed under the ISC license.
3876 * See the LICENSE file in the root directory of this source tree.
3877 */const KM=D.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...l},u)=>D.createElement("svg",{ref:u,...GM,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:M1("lucide",i),...!s&&!HM(l)&&{"aria-hidden":"true"},...l},[...o.map(([c,d])=>D.createElement(c,d)),...Array.isArray(s)?s:[s]]));/**
3878 * @license lucide-react v0.534.0 - ISC
3879 *
3880 * This source code is licensed under the ISC license.
3881 * See the LICENSE file in the root directory of this source tree.
3882 */const wt=(t,e)=>{const n=D.forwardRef(({className:r,...i},s)=>D.createElement(KM,{ref:s,iconNode:e,className:M1(`lucide-${WM(c0(t))}`,`lucide-${t}`,r),...i}));return n.displayName=c0(t),n};/**
3883 * @license lucide-react v0.534.0 - ISC
3884 *
3885 * This source code is licensed under the ISC license.
3886 * See the LICENSE file in the root directory of this source tree.
3887 */const QM=[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]],XM=wt("building-2",QM);/**
3888 * @license lucide-react v0.534.0 - ISC
3889 *
3890 * This source code is licensed under the ISC license.
3891 * See the LICENSE file in the root directory of this source tree.
3892 */const YM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],JM=wt("chevron-down",YM);/**
3893 * @license lucide-react v0.534.0 - ISC
3894 *
3895 * This source code is licensed under the ISC license.
3896 * See the LICENSE file in the root directory of this source tree.
3897 */const ZM=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],F1=wt("chevron-right",ZM);/**
3898 * @license lucide-react v0.534.0 - ISC
3899 *
3900 * This source code is licensed under the ISC license.
3901 * See the LICENSE file in the root directory of this source tree.
3902 */const e4=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],t4=wt("circle-check-big",e4);/**
3903 * @license lucide-react v0.534.0 - ISC
3904 *
3905 * This source code is licensed under the ISC license.
3906 * See the LICENSE file in the root directory of this source tree.
3907 */const n4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],r4=wt("circle-x",n4);
3907/**
3908 * @license lucide-react v0.534.0 - ISC
3909 *
3910 * This source code is licensed under the ISC license.
3911 * See the LICENSE file in the root directory of this source tree.
3912 */const i4=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],U1=wt("clock",i4);/**
3913 * @license lucide-react v0.534.0 - ISC
3914 *
3915 * This source code is licensed under the ISC license.
3916 * See the LICENSE file in the root directory of this source tree.
3917 */const s4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],o4=wt("info",s4);/**
3918 * @license lucide-react v0.534.0 - ISC
3919 *
3920 * This source code is licensed under the ISC license.
3921 * See the LICENSE file in the root directory of this source tree.
3922 */const a4=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],l4=wt("layers",a4);/**
3923 * @license lucide-react v0.534.0 - ISC
3924 *
3925 * This source code is licensed under the ISC license.
3926 * See the LICENSE file in the root directory of this source tree.
3927 */const u4=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],c4=wt("log-out",u4);/**
3928 * @license lucide-react v0.534.0 - ISC
3929 *
3930 * This source code is licensed under the ISC license.
3931 * See the LICENSE file in the root directory of this source tree.
3932 */const h4=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],d4=wt("menu",h4);/**
3933 * @license lucide-react v0.534.0 - ISC
3934 *
3935 * This source code is licensed under the ISC license.
3936 * See the LICENSE file in the root directory of this source tree.
3937 */const f4=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],p4=wt("radio",f4);/**
3938 * @license lucide-react v0.534.0 - ISC
3939 *
3940 * This source code is licensed under the ISC license.
3941 * See the LICENSE file in the root directory of this source tree.
3942 */const m4=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],g4=wt("shield-alert",m4);/**
3943 * @license lucide-react v0.534.0 - ISC
3944 *
3945 * This source code is licensed under the ISC license.
3946 * See the LICENSE file in the root directory of this source tree.
3947 */const y4=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],_4=wt("shield",y4);/**
3948 * @license lucide-react v0.534.0 - ISC
3949 *
3950 * This source code is licensed under the ISC license.
3951 * See the LICENSE file in the root directory of this source tree.
3952 */const v4=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],j1=wt("triangle-alert",v4);/**
3953 * @license lucide-react v0.534.0 - ISC
3954 *
3955 * This source code is licensed under the ISC license.
3956 * See the LICENSE file in the root directory of this source tree.
3957 */const E4=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ah=wt("x",E4),z1=D.createContext(),h0={success:{icon:O.jsx(t4,{className:"w-5 h-5 text-green-400"}),bgClass:"bg-green-900/40 border-green-500/50",textClass:"text-green-100"},error:{icon:O.jsx(r4,{className:"w-5 h-5 text-red-400"}),bgClass:"bg-red-900/40 border-red-500/50",textClass:"text-red-100"},warning:{icon:O.jsx(j1,{className:"w-5 h-5 text-yellow-400"}),bgClass:"bg-yellow-900/40 border-yellow-500/50",textClass:"text-yellow-100"},info:{icon:O.jsx(o4,{className:"w-5 h-5 text-blue-400"}),bgClass:"bg-blue-900/40 border-blue-500/50",textClass:"text-blue-100"}},w4=({children:t})=>{const[e,n]=D.useState([]),r=D.useCallback((s,o="info",l=4e3)=>{const u=Date.now().toString()+Math.random().toString(36).substr(2,5);n(c=>[...c,{id:u,message:s,type:o}]),l>0&&setTimeout(()=>{i(u)},l)},[]),i=D.useCallback(s=>{n(o=>o.filter(l=>l.id!==s))},[]);return O.jsxs(z1.Provider,{value:{showToast:r},children:[t,O.jsx("div",{className:"fixed bottom-6 right-6 z-[9999] flex flex-col gap-3 pointer-events-none",children:e.map(s=>{const o=h0[s.type]||h0.info;return O.jsxs("div",{className:`pointer-events-auto flex items-center p-4 rounded-xl border backdrop-blur-md shadow-2xl transition-all duration-300 animate-in slide-in-from-right-8 fade-in ${o.bgClass}`,role:"alert",children:[O.jsx("div",{className:"flex-shrink-0 mr-3",children:o.icon}),O.jsx("div",{className:`text-sm font-medium ${o.textClass}`,children:s.message}),O.jsx("button",{onClick:()=>i(s.id),className:"ml-4 flex-shrink-0 text-gray-400 hover:text-white transition-colors p-1","aria-label":"Cerrar notificación",children:O.jsx(ah,{className:"w-4 h-4"})})]},s.id)})})]})},wF=()=>{const t=D.useContext(z1);if(!t)throw new Error("useToast debe ser usado dentro de un ToastProvider");return t},$1=()=>{const{db:t,clientId:e,userRole:n,isSuperAdmin:r,isCompanyAdmin:i}
3957=D.useContext(Gs),[s,o]=D.useState(new Set),[l,u]=D.useState(!0);return D.useEffect(()=>{let m=!0;return(async()=>{if(r||i){m&&(o(new Set(["all"])),u(!1));return}if(!e||!t){m&&(o(new Set),u(!1));return}try{const w=ks(t,"clients",e,"modules"),P=await oO(w);if(m){const C=new Set;P.docs.forEach(E=>{const g=E.data();g.enabled&&C.add(g.moduleId)}),o(C),u(!1)}}catch(w){console.error("Error loading user modules:",w),m&&(o(new Set),u(!1))}})(),()=>{m=!1}},[t,e,n]),{hasModuleAccess:m=>r||i||s.has("all")?!0:s.has(m),hasAnyModuleAccess:m=>r||i||s.has("all")?!0:m.some(v=>s.has(v)),getEnabledModules:()=>Array.from(s),loading:l,isAdmin:r||i}},TF=({moduleId:t,children:e,fallback:n=null})=>{const{hasModuleAccess:r,loading:i}=$1();return i?O.jsx("div",{className:"flex justify-center items-center p-8",children:O.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-[#00BFFF]"})}):r(t)?e:n||O.jsxs("div",{className:"bg-yellow-900/50 border border-yellow-500 text-yellow-200 p-6 rounded-lg text-center",children:[O.jsx("h3",{className:"font-bold text-lg mb-2",children:"🔒 Módulo No Disponible"}),O.jsx("p",{className:"text-sm",children:"Este módulo no está incluido en tu plan de suscripción actual. Contacta al administrador para actualizar tu plan."})]})},T4=[{path:"/",label:"Inicio",type:"link",icon:"🏠"},{path:"/board-view",label:"Visión Directorio",type:"link",icon:"📊"},{path:"/obligations-calendar",label:"Calendario de Obligaciones",type:"link",icon:"📅"},{label:"Ley 21.719 — Privacidad",type:"accordion",icon:"🛡️",items:[{path:"/privacy-dashboard",label:"Dashboard Privacidad",moduleId:"dpo-dashboard"},{path:"/mpi-certification",label:"Modelo de Prevención (MPI)",moduleId:"mpi-certification"},{path:"/governance-delegates",label:"Gobernanza y Delegados",moduleId:"governance-delegates"},{path:"/processing-activities",label:"Actividades de Tratamiento",moduleId:"processing-activities"},{path:"/data-subjects",label:"Gestión de Titulares",moduleId:"data-subjects"},{path:"/integrations-buk",label:"Conector BUK (RRHH)",moduleId:"data-subjects"},{path:"/data-subject-requests",label:"Derechos ARSOP",moduleId:"arcop-requests"},{path:"/consent-management",label:"Consentimientos",moduleId:"processing-activities"},{path:"/reports",label:"Reportes y Dossier",moduleId:"processing-activities"},{path:"/impact-assessment",label:"Evaluación de Impacto (EIPD)",moduleId:"impact-assessment"},{path:"/tasks",label:"Centro de Tareas"},{path:"/compliance-ai",label:"IA de Cumplimiento",moduleId:"compliance-ai"},{path:"/international-transfers",label:"Transferencias Internacionales",moduleId:"international-transfers"}]},{label:"Ley 21.663 — Ciberseguridad",type:"accordion",icon:"🔒",items:[{path:"/compliance-dashboard-21663",label:"Dashboard Ciberseguridad",moduleId:"compliance-dashboard-21663"},{path:"/incidents",label:"Gestión de Incidentes",moduleId:"incidents"},{path:"/compliance-registry",label:"Registro de Cumplimiento",moduleId:"compliance-registry"},{path:"/vendor-management",label:"Gestión de Terceros",moduleId:"vendor-management"},{path:"/wazuh",label:"Monitorización Wazuh (SIEM)"},{path:"/saas-monitoring",label:"Monitoreo SaaS (M365)"},{path:"/mitre-coverage",label:"Cobertura MITRE ATT&CK"},{path:"/wazuh-compliance",label:"Auditoría Técnica Wazuh"},{path:"/windows-hardening",label:"Windows Hardening"},{path:"/update-log",label:"Bitácora de Actualizaciones"},{path:"/security-scanner",label:"Escáner de Vulnerabilidades",moduleId:"automated-audits"},{path:"/access-logs",label:"Registros de Acceso",moduleId:"access-logs"},{path:"/automated-audits",label:"Bitácora de Auditoría",moduleId:"automated-audits"},{path:"/monitoring-audit-report",label:"Reportes de Monitoreo"}]},{label:"ISO 27001 — SGSI",type:"accordion",icon:"🏢",maxHeight:"1400px",items:[{path:"/sgsi",label:"Dashboard SGSI",moduleId:"sgsi-dashboard"},{path:"/sgsi/ai-certification",label:"🤖 Asistente Certificación IA",moduleId:"sgsi-dashboard"},{type:"separator",label:"Contexto y Liderazgo (4-5)"},{path:"/sgsi/planning",label:"Planificación y Contexto",moduleId:"planning-context"},{type:"separator",label:"Planificación (6)"},{path:"/sgsi/risk-management",label:"Gestión de Riesgos",moduleId:"risk-management"},{path:"/soa",label:"Decl. de Aplicabilidad (SoA)",moduleId:"risk-management"},{path:"/soa-verification",label:"Verificación Continua (SCA)",moduleId:"risk-management"},{type:"separator",label:"Apoyo y Operación (7-8)"},{path:"/sgsi/implementation-operation",label:"Implementación y Operación",moduleId:"implementation-operation"},{path:"/sgsi/operational-planning",label:"Planificación Operacional",moduleId:"operational-planning"},{path:"/sgsi/change-management",label:"Gestión de Cambios",moduleId:"change-management"},{path:"/sgsi/asset-inventory",label:"Inventario de Activos",moduleId:"technical-control
3957s"},{path:"/sgsi/technical-controls",label:"Controles Técnicos (Anexo A)",moduleId:"technical-controls"},{path:"/sgsi/business-continuity",label:"Continuidad del Negocio",moduleId:"business-continuity"},{path:"/sgsi/human-resources",label:"Recursos Humanos",moduleId:"human-resources"},{type:"separator",label:"Evaluación del Desempeño (9)"},{path:"/sgsi/internal-audit",label:"Auditorías Internas",moduleId:"internal-audit"},{path:"/sgsi/performance-evaluation",label:"Evaluación del Desempeño",moduleId:"performance-evaluation"},{path:"/sgsi/verification-monitoring",label:"Verificación y Monitoreo",moduleId:"verification-monitoring"},{path:"/sgsi/kpis-metrics",label:"KPIs y Métricas",moduleId:"kpis-metrics"},{path:"/sgsi/management-review",label:"Revisión por la Dirección",moduleId:"management-review"},{type:"separator",label:"Mejora Continua (10)"},{path:"/sgsi/continuous-improvement",label:"Mejora Continua",moduleId:"continuous-improvement"},{type:"separator",label:"Recursos"},{path:"/training-management",label:"Capacitación y Concienciación",moduleId:"training-management"},{path:"/module-downloads",label:"Documentación SGSI",moduleId:"module-downloads"}]},{label:"Administración",type:"accordion",icon:"⚙️",adminOnly:!0,items:[{path:"/admin/super-panel",label:"Panel SuperAdmin"},{path:"/admin/companies",label:"Gestión de Empresas"},{path:"/admin/users",label:"Gestión de Usuarios"},{path:"/admin/roles",label:"Gestión de Puestos"},{path:"/admin/modules",label:"Gestión de Módulos"},{path:"/admin/wazuh-config",label:"Configuración Wazuh SIEM"}]},{path:"/quick-start",label:"Guía Rápida",type:"link",icon:"🚀",moduleId:"quick-start"}],I4=({menu:t,location:e,hasAccess:n,modulesConfigured:r})=>{const i=m=>!m.moduleId||!r?!0:n(m.moduleId),s=t.items.filter(m=>m.path&&i(m)),o=m=>m==="/"?e.pathname==="/":e.pathname.startsWith(m),[l,u]=D.useState(s.some(m=>o(m.path)));if(D.useEffect(()=>{s.some(m=>o(m.path))&&u(!0)},[e.pathname]),s.length===0)return null;const c=t.maxHeight||"600px",d=[];t.items.forEach((m,v)=>{m.type==="separator"?d.push({...m,_index:v}):m.path&&i(m)&&d.push(m)});const p=d.filter((m,v)=>m.type!=="separator"?!0:d.slice(v+1).some(w=>w.type!=="separator"));return O.jsxs("div",{className:"mb-1",children:[O.jsxs("button",{onClick:()=>u(!l),className:`w-full flex justify-between items-center text-left px-4 py-3 rounded-lg transition-all duration-200 group ${l?"bg-white/5 text-white":"text-gray-400 hover:bg-white/5 hover:text-white"}`,children:[O.jsxs("span",{className:"flex items-center gap-3",children:[O.jsx("span",{className:"text-lg group-hover:scale-110 transition-transform",children:t.icon}),O.jsx("span",{className:"text-sm font-medium",children:t.label})]}),O.jsx(JM,{size:16,className:`transition-transform duration-300 ${l?"rotate-180":""}`})]}),O.jsx("div",{className:`overflow-hidden transition-all duration-300 ease-in-out ${l?"opacity-100":"max-h-0 opacity-0"}`,style:l?{maxHeight:c}:{},children:O.jsx("ul",{className:"mt-1 ml-4 border-l border-white/10 pl-2 space-y-0.5 py-1",children:p.map((m,v)=>m.type==="separator"?O.jsx("li",{className:"pt-3 pb-1 px-2",children:O.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest text-[#00BFFF]/60 block border-b border-white/5 pb-1",children:m.label})},`sep-${m._index}`):O.jsx("li",{children:O.jsx(pf,{to:m.path,className:({isActive:w})=>`block w-full text-left px-4 py-2 text-xs rounded-md transition-all duration-200 ${w?"text-[#00BFFF] font-bold bg-[#00BFFF]/10 border-r-2 border-[#00BFFF]":"text-gray-400 hover:text-white hover:bg-white/5"}`,children:m.label})},m.path))})})]})},A4=({isOpen:t,setIsOpen:e})=>{const n=Dn(),{db:r,isSuperAdmin:i,handleLogout:s,adminSelectedClient:o,setAdminSelectedClient:l,adminSelectedArea:u,setAdminSelectedArea:c}=D.useContext(Gs),{hasModuleAccess:d,getEnabledModules:p,loading:m}=$1(),v=!m&&p().length>0,[w,P]=D.useState([]),[C,E]=D.useState([]);return D.useEffect(()=>{if(i&&r){const g=ks(r,"companies"),T=xs(g,lc("name")),x=Sa(T,F=>{const U=F.docs.map(I=>{const _=I.data();return{id:I.id,name:_.name||_.companyName||_.razonSocial||"Sin Nombre",..._}}).filter(I=>I.id!=="global_admin_client"&&I.id!=="admin"&&I.name!=="Sin Nombre");P(U)},F=>{console.error("Error escuchando empresas:",F)});return()=>x()}},[i,r]),D.useEffect(()=>{if(i&&o&&r){const g=ks(r,"companies",o,"areas"),T=xs(g,lc("name")),x=Sa(T,F=>{const U=F.docs.map(I=>({id:I.id,...I.data()}));E(U)},F=>{console.warn("No se encontraron áreas:",F.message),E([])});return()=>x()}else E([])},[o,i,r]),O.jsxs("div",{className:`w-72 h-full fixed top-0 left-0 bg-[#050B19] text-gray-200 flex flex-col border-r border-white/5 shadow-2xl z-50 transition-transform duration-300 md:translate-x-0 ${t?"translate-x-0":"-translate-x-full"}`,children:[O.jsxs("div",{className:"h-16 flex justify-between items-center px-6 border-b border-white/5 bg-[#0A1128] shrink-0",children:[O.jsxs("div",{className:"flex items-center",children:[O.jsx("img",{src:"/logo.png",alt:"DataShield",className:"h-8 w-auto mr-3",onError:g=>g.target.style.display="none"}),O.jsx("span",{className:"text-xl font-bold text-white tracking-wide",children:"DataShield"})]}),O.jsx("button",{className:"md:hidden text-gray-400 hover:text-white bg-gray-800/50 p-1.5 rounded-lg active:scale-95 transition-transform",onClick:()=>e&&e(!1),children:O.jsx(ah,{size:20})})]}),i&&O.jsxs("div",{className:"mx-4 mt-4 p-4 bg-[#101C40] rounded-xl border border-[#00BFFF]/30 shadow-lg relative overflow-hidden group flex-shrink-0",children:[O.jsx("div",{className:"absolute top-0 left-0 w-1 h-full bg-[#00BFFF]"}),O.jsxs("div",{className:"flex items-center gap-2 mb-3 text-[#00BFFF] text-[10px] font-black uppercase tracking-widest",children:[O.jsx(g4,{size:12})," Supervisión Global"]}),O.jsxs("div",{className:"mb-3 space-y-1",children:[O.jsxs("label",{className:"text-[10px] text-gray-400 flex items-center gap-1",children:[O.jsx(XM,{size:10})," Empresa"]}),O.jsxs("select",{className:"w-full bg-[#050B19] text-xs border border-gray-700 rounded-lg p-2 text-white focus:border-[#00BFFF] outline-none transition-colors cursor-pointer hover:border-gray-500",onChange:g=>l(g.target.value),value:o||"",children:[O.jsx("option",{value:"",children:"-- Seleccionar --"}),w.map(g=>O.jsx("option",{value:g.id,children:g.name||g.id},g.id))]})]}),O.jsxs("div",{className:"space-y-1",children:[O.jsxs("label",{className:"text-[10px] text-gray-400 flex items-center gap-1",children:[O.jsx(l4,{size:10})," Área"]}),O.jsxs("select",{className:"w-full bg-[#050B19] text-xs border border-gray-700 rounded-lg p-2 text-white focus:border-[#00BFFF] outline-none disabled:opacity-30 transition-colors cursor-pointer hover:border-gray-500",onChange:g=>c(g.target.value),value:u||"",disabled:!o,children:[O.jsx("option",{value:"",children:"-- General --"}),C.map(g=>O.jsx("option",{value:g.id,children:g.name},g.id))]})]})]}),O.jsx("nav",{className:"flex-grow overflow-y-auto px-2 py-4 custom-scrollbar space-y-1",children:T4.map(g=>g.adminOnly&&!i?null:g.type==="link"?g.moduleId&&v&&!d(g.moduleId)?null:O.jsxs(pf,{to:g.path,className:({isActive:T})=>`w-full flex items-center px-4 py-3 text-sm font-medium rounded-lg transition-all duration-200 group ${T?"bg-[#00BFFF]/10 text-[#00BFFF] border-l-2 border-[#00BFFF]":"text-gray-400 hover:bg-white/5 hover:text-white"}`,children:[O.jsx("span",{className:"mr-3 text-lg group-hover:scale-110 transition-transform",children:g.icon}),g.label]},g.path):g.type==="accordion"?O.jsx(I4,{menu:g,location:n,hasAccess:d,modulesConfigured:v},g.label):null)}),O.jsxs("div",{className:"p-4 border-t border-white/5 bg-[#050B19] space-y-2",children:[O.jsxs(pf,{to:"/security-settings",className:({isActive:g})=>`w-full flex items-center gap-2 px-4 py-2 rounded-lg text-xs transition-all duration-200 ${g?"bg-[#00BFFF]/20 text-[#00BFFF]":"text-gray-400 hover:bg-white/5 hover:text-white"}`,children:[O.jsx(_4,{size:14})," Seguridad de Cuenta"]}),O.jsxs("button",{onClick:s,className:"w-full flex items-center justify-center gap-2 bg-red-900/20 text-red-400 hover:bg-red-600 hover:text-white font-bold px-4 py-3 rounded-xl text-xs transition-all duration-300 shadow-md group",children:[O.jsx(c4,{size:16,className:"group-hover:-translate-x-1 transition-transform"})," Cerrar Sesión"]})]})]})},S4=30,d0=5;function R4(t){if(!t)return 0;
3957try{const e=new Date-new Date(t);return Math.floor(e/(1e3*60*60*24))}catch{return 0}}function C4(){const{db:t,clientId:e,userAreaId:n,userRole:r}=D.useContext(Gs),i=Ms(),[s,o]=D.useState([]),[l,u]=D.useState(!1);D.useEffect(()=>{if(!e)return;u(!1);const v=r==="admin"||r==="manager"||!n||n==="General",w=ks(t,"clients",e,"data-subject-requests"),P=v?xs(w,lc("requestDate","asc")):xs(w,tO("areaId","==",n),lc("requestDate","asc")),C=Sa(P,E=>{o(E.docs.map(g=>({id:g.id,...g.data()})))});return()=>C()},[t,e,n,r]);const c=D.useMemo(()=>{const v=["respondido","Completada","rechazado","cerrado"];return s.filter(w=>!v.includes(w.status)).map(w=>{const P=R4(w.requestDate),C=S4-P;return{...w,daysLeft:C,elapsed:P}}).filter(w=>w.daysLeft<=d0).sort((w,P)=>w.daysLeft-P.daysLeft)},[s]);if(!c.length||l)return null;const d=c.filter(v=>v.daysLeft<=0),p=c.filter(v=>v.daysLeft>0),m=d.length>0;return O.jsx("div",{className:`w-full border-b z-20 transition-all ${m?"bg-red-900/30 border-red-500/40":"bg-amber-900/20 border-amber-500/30"}`,children:O.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[O.jsx("div",{className:`flex-shrink-0 ${m?"text-red-400":"text-amber-400"}`,children:m?O.jsx(j1,{size:16,className:"animate-pulse"}):O.jsx(U1,{size:16})}),O.jsxs("div",{className:"flex-1 min-w-0",children:[m&&d.length>0&&O.jsxs("span",{className:"text-red-300 text-xs font-bold mr-2",children:["🚨 ",d.length," solicitud",d.length!==1?"es":""," ARCOP vencida",d.length!==1?"s":""," (Art. 11 Ley 21.719)"]}),p.length>0&&O.jsxs("span",{className:"text-amber-300 text-xs",children:["⏰ ",p.length," solicitud",p.length!==1?"es":""," vence",p.length!==1?"n":""," en ≤",d0," días"," · ",p.slice(0,2).map(v=>`"${v.requesterName||v.requesterEmail||v.id.slice(0,6)}" (${v.daysLeft}d)`).join(" · "),p.length>2?` · +${p.length-2} más`:""]})]}),O.jsxs("button",{onClick:()=>i("/data-subject-requests"),className:`flex-shrink-0 flex items-center gap-1 text-xs font-bold px-3 py-1.5 rounded-lg transition-colors ${m?"bg-red-900/50 border border-red-500/40 text-red-300 hover:bg-red-800/60":"bg-amber-900/40 border border-amber-500/30 text-amber-300 hover:bg-amber-800/50"}`,children:["Atender ",O.jsx(F1,{size:12})]}),O.jsx("button",{onClick:()=>u(!0),className:"flex-shrink-0 text-gray-600 hover:text-gray-400 transition-colors ml-1",children:O.jsx(ah,{size:14})})]})})}const To={CSIRT_ALERTA_TEMPRANA:{id:"csirt-3h",label:"CSIRT ANCI — Alerta temprana (3h)",norma:"Ley 21.663 Art. 9",ms:3*60*60*1e3,desde:"confirmadoEl",cumplidoSi:"csirtAlertSentAt",aplicaSi:t=>t.isSignificantEffect},CSIRT_REPORTE_COMPLETO:{id:"csirt-72h",label:"CSIRT ANCI — Reporte completo (72h)",norma:"Ley 21.663 Art. 9",ms:72*60*60*1e3,desde:"confirmadoEl",cumplidoSi:"csirtFullReportSentAt",aplicaSi:t=>t.isSignificantEffect},CSIRT_REPORTE_FINAL:{id:"csirt-final",label:"CSIRT ANCI — Reporte final (post-contención)",norma:"Ley 21.663 Art. 9",ms:null,desde:"containedAt",cumplidoSi:"csirtFinalReportSentAt",aplicaSi:t=>t.isSignificantEffect&&!!t.containedAt},BRECHA_AGENCIA:{id:"brecha-72h",label:"Agencia de Datos — Notificación de brecha (72h)",norma:"Ley 21.719",ms:72*60*60*1e3,desde:"detectedAt",cumplidoSi:"agencyNotifiedAt",aplicaSi:t=>t.isPersonalDataBreach},BRECHA_TITULAR:{id:"brecha-titular",label:"Titulares — Comunicación de brecha (sin demora)",norma:"Ley 21.719",ms:72*60*60*1e3,desde:"detectedAt",cumplidoSi:"dataSubjectsNotifiedAt",aplicaSi:t=>t.isPersonalDataBreach&&t.highRiskToSubjects}};function P4(t){if(!t)return null;if(typeof t=="object"&&t.seconds)return t.seconds*1e3;const e=new Date(t).getTime();return Number.isNaN(e)?null:e}function k4(t){if(t==null)return{display:"—",expired:!1,critical:!1,pending:!0};if(t<=0)return{display:"VENCIDA",expired:!0,critical:!0};const e=Math.floor(t/36e5),n=Math.floor(t%36e5/6e4),r=Math.floor(t%6e4/1e3),i=t<60*6e4;return{display:`${e}h ${n.toString().padStart(2,"0")}m ${r.toString().padStart(2,"0")}s`,expired:!1,critical:i}}function f0(t,e,n=Date.now()){if(!t.aplicaSi(e))return null;if(e[t.cumplidoSi])return{...t,cumplido:!0};const r=P4(e[t.desde]);if(r==null)return{...t,pendiente:!0};if(t.ms==null)return{...t,sinContador:!0};const i=r+t.ms-n;return{...t,msLeft:i,countdown:k4(i)}}const p0=["closed","cerrado","resolved","resuelto"];function x4(){const{db:t,clientId:e}=D.useContext(Gs),n=Ms(),[r,i]=D.useState([]),[s,o]=D.useState([]),[l,u]=D.use
3957State(Date.now()),[c,d]=D.useState(!1);D.useEffect(()=>{if(!e)return;const v=Sa(xs(ks(t,"clients",e,"incidents")),P=>{i(P.docs.map(C=>({id:C.id,...C.data()}))),d(!1)}),w=Sa(xs(ks(t,"clients",e,"incidents")),()=>{});return()=>{v(),w()}},[t,e]),D.useEffect(()=>{const v=setInterval(()=>u(Date.now()),1e3);return()=>clearInterval(v)},[]);const p=D.useMemo(()=>{const v=[],w=[To.CSIRT_ALERTA_TEMPRANA,To.CSIRT_REPORTE_COMPLETO,To.CSIRT_REPORTE_FINAL],P=[To.BRECHA_AGENCIA,To.BRECHA_TITULAR];for(const C of r)if(!p0.includes(C.status))for(const E of w){const g=f0(E,C,l);g&&g.countdown&&!g.cumplido&&v.push({...g,ref:C,route:"/incident-management"})}for(const C of s)if(!p0.includes(C.status))for(const E of P){const g=f0(E,C,l);g&&g.countdown&&!g.cumplido&&v.push({...g,ref:C,route:"/breach-management"})}return v.sort((C,E)=>(C.msLeft??0)-(E.msLeft??0))},[r,s,l]);if(!p.length||c)return null;const m=p.some(v=>v.countdown.critical||v.countdown.expired);return O.jsx("div",{className:`w-full border-b z-20 ${m?"bg-red-950/50 border-red-600/60":"bg-orange-950/30 border-orange-500/40"}`,children:O.jsxs("div",{className:"flex items-center gap-3 px-4 py-2",children:[O.jsx("div",{className:`flex-shrink-0 ${m?"text-red-400":"text-orange-400"}`,children:O.jsx(p4,{size:15,className:"animate-pulse"})}),O.jsx("span",{className:`flex-shrink-0 text-[11px] font-bold uppercase tracking-wide ${m?"text-red-300":"text-orange-300"}`,children:"Plazos legales"}),O.jsxs("div",{className:"flex-1 flex flex-wrap gap-2 min-w-0",children:[p.slice(0,4).map((v,w)=>O.jsxs("span",{className:`font-mono text-[11px] font-bold px-2 py-0.5 rounded border ${v.countdown.expired?"text-red-200 bg-red-900/50 border-red-500/70 animate-pulse":v.countdown.critical?"text-orange-200 bg-orange-900/50 border-orange-500/60 animate-pulse":"text-yellow-300 bg-yellow-900/20 border-yellow-700/40"}`,children:[v.countdown.display,O.jsx("span",{className:"text-[9px] font-normal ml-1.5 opacity-70",children:v.label})]},`${v.id}-${v.ref.id}-${w}`)),p.length>4&&O.jsxs("span",{className:"text-xs text-gray-500",children:["+",p.length-4," más"]})]}),O.jsxs("button",{onClick:()=>n(p[0].route),className:`flex-shrink-0 flex items-center gap-1 text-[11px] font-bold px-3 py-1.5 rounded-lg border transition-colors ${m?"bg-red-900/50 border-red-500/40 text-red-300 hover:bg-red-800/60":"bg-orange-900/40 border-orange-500/30 text-orange-300 hover:bg-orange-800/50"}`,children:["Gestionar ",O.jsx(F1,{size:11})]}),O.jsx("button",{onClick:()=>d(!0),className:"flex-shrink-0 text-gray-600 hover:text-gray-400 ml-1",children:O.jsx(ah,{size:14})})]})})}const m0=30*60*1e3,b4=2*60*1e3;function N4({onLogout:t,onWarning:e,onActivity:n}){const r=D.useRef(null),i=D.useRef(null),s=D.useCallback(()=>{clearTimeout(r.current),clearTimeout(i.current),n&&n(),i.current=setTimeout(()=>{e&&e()},m0-b4),r.current=setTimeout(()=>{t&&t()},m0)},[t,e,n]);D.useEffect(()=>{const o=["mousemove","keydown","mousedown","scroll","touchstart"];return o.forEach(l=>window.addEventListener(l,s,{passive:!0})),s(),()=>{o.forEach(l=>window.removeEventListener(l,s)),clearTimeout(r.current),clearTimeout(i.current)}},[s])}const md=2*60;function D4({children:t,fondoCarga:e="bg-[#050B19]"}){const{user:n,loading:r,forcePasswordChange:i,forceMfaSetup:s,mfaPending:o,handleLogout:l}=L1(),[u,c]=D.useState(!1),[d,p]=D.useState(!1),[m,v]=D.useState(md);D.useEffect(()=>{if(!r)return;const E=setTimeout(()=>c(!0),8e3);return()=>clearTimeout(E)},[r]);const w=D.useCallback(async()=>{p(!1),await l()},[l]),P=D.useCallback(()=>{p(!0),v(md)},[]),C=D.useCallback(()=>{p(!1)},[]);return N4({onLogout:w,onWarning:P,onActivity:C}),D.useEffect(()=>{if(!d)return;if(m<=0){w();return}const E=setTimeout(()=>v(g=>g-1),1e3);return()=>clearTimeout(E)},[d,m,w]),u?O.jsx(zi,{to:"/login",replace:!0}):r?O.jsx("div",{className:`min-h-screen ${e} flex items-center justify-center text-white font-mono`,children:O.jsxs("div",{className:"flex flex-col items-center gap-4",children:[O.jsx("div",{className:"w-8 h-8 border-4 border-[#00BFFF] border-t-transparent rounded-full animate-spin"}),O.jsx("p",{className:"text-sm tracking-widest animate-pulse",children:"VERIFICANDO CREDENCIALES..."})]})}):n?i?O.jsx(zi,{to:"/change-password",replace:!0}):s?O.jsx(zi,{to:"/setup-mfa",replace:!0}):o?O.jsx(zi,{to:"/verify-mfa",replace:!0}):O.jsxs(O.Fragment,{children:[d&&O.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/70 backdrop-blur-sm",children:O.jsxs("div",{className:"bg-[#101C40] border border-yellow-500/50 rounded-xl shadow-2xl p-8 max-w-sm w-full mx-4 text-center",children:[O.jsx("div",{className:"bg-yellow-500/20 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4",children:O.jsx(U1,{className:"text-yellow-400",size:32})}),O.jsx("h3",{className:"text-white text-xl font-bold mb-2",children:"Sesión por expirar"}),O.jsx("p",{className:"text-gray-400 text-sm mb-4",children:"Tu sesión cerrará por inactividad en"}),O.jsxs("div",{className:"text-4xl font-mono font-bold text-yellow-400 mb-6",children:[Math.floor(m/60),":",String(m%60).padStart(2,"0")]}),O.jsx("button",{onClick:()=>{p(!1),v(md)},className:"w-full bg-[#00BFFF] hover:bg-blue-600 text-white font-bold py-3 px-4 roun
3957ded-lg transition",children:"Continuar sesión"})]})}),t]}):O.jsx(zi,{to:"/login",replace:!0})}const B1=({Element:t,title:e})=>{const[n,r]=D.useState(!1),i=Dn();return D.useEffect(()=>{r(!1)},[i]),O.jsx(D4,{children:O.jsx(O4,{Element:t,isSidebarOpen:n,setIsSidebarOpen:r})})};function O4({Element:t,isSidebarOpen:e,setIsSidebarOpen:n}){return O.jsxs("div",{className:"flex bg-[#050B19] min-h-screen text-gray-300 font-sans overflow-hidden",children:[O.jsx(A4,{isOpen:e,setIsOpen:n}),e&&O.jsx("div",{className:"fixed inset-0 bg-black/60 z-40 md:hidden backdrop-blur-sm transition-opacity cursor-pointer",onClick:()=>n(!1)}),O.jsxs("div",{className:"flex-1 md:ml-72 flex flex-col transition-all duration-300 w-full h-screen overflow-hidden",children:[O.jsxs("div",{className:"md:hidden flex items-center justify-between bg-[#0A1128] p-4 border-b border-gray-800 shrink-0 z-30 shadow-md",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx("img",{src:"/logo.png",alt:"DataShield",className:"h-6 w-auto",onError:r=>r.target.style.display="none"}),O.jsx("span",{className:"text-white font-bold tracking-wide",children:"DataShield"})]}),O.jsx("button",{onClick:()=>n(!0),className:"p-2 text-gray-400 hover:text-white bg-gray-800/50 rounded-lg active:scale-95 transition-all",children:O.jsx(d4,{size:24})})]}),O.jsx(C4,{}),O.jsx(x4,{}),O.jsx("main",{className:"flex-1 p-4 md:p-6 overflow-y-auto overflow-x-hidden w-full relative",children:O.jsx(t,{})})]})]})}function V4({element:t,title:e}){const{isSuperAdmin:n,isCompanyAdmin:r}=D.useContext(Gs);return!n&&!r?O.jsx(zi,{to:"/",replace:!0}):O.jsx(B1,{Element:t,title:e})}function L4(){return O.jsx(D.Suspense,{fallback:O.jsx("div",{className:"p-10 text-white text-center",children:"Cargando Sistema..."}),children:O.jsx(OC,{children:O1.map((t,e)=>t.type==="public"?O.jsx(Xl,{path:t.path,element:O.jsx(t.element,{})},e):t.type==="admin"?O.jsx(Xl,{path:t.path,element:O.jsx(V4,{element:t.element,title:t.label})},e):O.jsx(Xl,{path:t.path,element:O.jsx(B1,{Element:t.element,title:t.label})},e))})})}function M4(){return O.jsx($M,{children:O.jsx(BM,{children:O.jsx(w4,{children:O.jsx(L4,{})})})})}/*! *****************************************************************************
3958Copyright (c) Microsoft Corporation.
3959
3960Permission to use, copy, modify, and/or distribute this software for any
3961purpose with or without fee is hereby granted.
3962
3963THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
3964REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
3965AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
3966INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
3967LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
3968OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
3969PERFORMANCE OF THIS SOFTWARE.
3970***************************************************************************** */var Kf=function(){return Kf=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Kf.apply(this,arguments)},Qf,F4=function(t){var e;t?function(n){if(n)for(;n.lastChild;)n.lastChild.remove()}(typeof t=="string"?document.getElementById(t):t):(e=document.querySelector(".grecaptcha-badge"))&&e.parentNode&&document.body.removeChild(e.parentNode)},U4=function(t,e){F4(e),window.___grecaptcha_cfg=void 0;var n=document.querySelector("#"+t);n&&n.remove(),function(){var r=document.querySelector('script[src^="https://www.gstatic.com/recaptcha/releases"]');r&&r.remove()}()},j4=function(t){var e=t.render,n=t.onLoadCallbackName,r=t.language,i=t.onLoad,s=t.useRecaptchaNet,o=t.useEnterprise,l=t.scriptProps,u=l===void 0?{}:l,c=u.nonce,d=c===void 0?"":c,p=u.defer,m=p!==void 0&&p,v=u.async,w=v!==void 0&&v,P=u.id,C=P===void 0?"":P,E=u.appendTo,g=C||"google-recaptcha-v3";if(function(F){return!!document.querySelector("#"+F)}(g))i();else{var T=function(F){return"https://www."+(F.useRecaptchaNet?"recaptcha.net":"google.com")+"/recaptcha/"+(F.useEnterprise?"enterprise.js":"api.js")}({useEnterprise:o,useRecaptchaNet:s}),x=document.createElement("script");x.id=g,x.src=T+"?render="+e+(e==="explicit"?"&onload="+n:"")+(r?"&hl="+r:""),d&&(x.nonce=d),x.defer=!!m,x.async=!!w,x.onload=i,(E==="body"?document.body:document.getElementsByTagName("head")[0]).appendChild(x)}},g0=function(t){console.warn(t)};(function(t){t.SCRIPT_NOT_AVAILABLE="Recaptcha script is not available"})(Qf||(Qf={}));var rg=D.createContext({executeRecaptcha:function(){throw Error("GoogleReCaptcha Context has not yet been implemented, if you are using useGoogleReCaptcha hook, make sure the hook is called 
3970inside component wrapped by GoogleRecaptchaProvider")}});rg.Consumer;function z4(t){var e=t.reCaptchaKey,n=t.useEnterprise,r=n!==void 0&&n,i=t.useRecaptchaNet,s=i!==void 0&&i,o=t.scriptProps,l=t.language,u=t.container,c=t.children,d=D.useState(null),p=d[0],m=d[1],v=D.useRef(e),w=JSON.stringify(o),P=JSON.stringify(u==null?void 0:u.parameters);D.useEffect(function(){if(e){var g=(o==null?void 0:o.id)||"google-recaptcha-v3",T=(o==null?void 0:o.onLoadCallbackName)||"onRecaptchaLoadCallback";return window[T]=function(){var x=r?window.grecaptcha.enterprise:window.grecaptcha,F=Kf({badge:"inline",size:"invisible",sitekey:e},(u==null?void 0:u.parameters)||{});v.current=x.render(u==null?void 0:u.element,F)},j4({render:u!=null&&u.element?"explicit":e,onLoadCallbackName:T,useEnterprise:r,useRecaptchaNet:s,scriptProps:o,language:l,onLoad:function(){if(window&&window.grecaptcha){var x=r?window.grecaptcha.enterprise:window.grecaptcha;x.ready(function(){m(x)})}else g0("<GoogleRecaptchaProvider /> "+Qf.SCRIPT_NOT_AVAILABLE)}}),function(){U4(g,u==null?void 0:u.element)}}g0("<GoogleReCaptchaProvider /> recaptcha key not provided")},[r,s,w,P,l,e,u==null?void 0:u.element]);var C=D.useCallback(function(g){if(!p||!p.execute)throw new Error("<GoogleReCaptchaProvider /> Google Recaptcha has not been loaded");return p.execute(v.current,{action:g})},[p,v]),E=D.useMemo(function(){return{executeRecaptcha:p?C:void 0,container:u==null?void 0:u.element}},[C,p,u==null?void 0:u.element]);return $.createElement(rg.Provider,{value:E},c)}var IF=function(){return D.useContext(rg)};function W1(t,e){return t(e={exports:{}},e.exports),e.exports;/** @license React v16.13.1
3971 * react-is.production.min.js
3972 *
3973 * Copyright (c) Facebook, Inc. and its affiliates.
3974 *
3975 * This source code is licensed under the MIT license found in the
3976 * LICENSE file in the root directory of this source tree.
3977 */}var Ge=typeof Symbol=="function"&&Symbol.for,Xf=Ge?Symbol.for("react.element"):60103,Yf=Ge?Symbol.for("react.portal"):60106,lu=Ge?Symbol.for("react.fragment"):60107,uu=Ge?Symbol.for("react.strict_mode"):60108,cu=Ge?Symbol.for("react.profiler"):60114,hu=Ge?Symbol.for("react.provider"):60109,du=Ge?Symbol.for("react.context"):60110,Jf=Ge?Symbol.for("react.async_mode"):60111,dc=Ge?Symbol.for("react.concurrent_mode"):60111,fu=Ge?Symbol.for("react.forward_ref"):60112,pu=Ge?Symbol.for("react.suspense"):60113,$4=Ge?Symbol.for("react.suspense_list"):60120,mu=Ge?Symbol.for("react.memo"):60115,gu=Ge?Symbol.for("react.lazy"):60116,B4=Ge?Symbol.for("react.block"):60121,W4=Ge?Symbol.for("react.fundamental"):60117,q4=Ge?Symbol.for("react.responder"):60118,H4=Ge?Symbol.for("react.scope"):60119;function Ot(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Xf:switch(t=t.type){case Jf:case dc:case lu:case cu:case uu:case pu:return t;default:switch(t=t&&t.$$typeof){case du:case fu:case gu:case mu:case hu:return t;default:return e}}case Yf:return e}}}function y0(t){return Ot(t)===dc}var G4={AsyncMode:Jf,ConcurrentMode:dc,ContextConsumer:du,ContextProvider:hu,Element:Xf,ForwardRef:fu,Fragment:lu,Lazy:gu,Memo:mu,Portal:Yf,Profiler:cu,StrictMode:uu,Suspense:pu,isAsyncMode:function(t){return y0(t)||Ot(t)===Jf},isConcurrentMode:y0,isContextConsumer:function(t){return Ot(t)===du},isContextProvider:function(t){return Ot(t)===hu},isElement:function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Xf},isForwardRef:function(t){return Ot(t)===fu},isFragment:function(t){return Ot(t)===lu},isLazy:function(t){return Ot(t)===gu},isMemo:function(t){return Ot(t)===mu},isPortal:function(t){return Ot(t)===Yf},isProfiler:function(t){return Ot(t)===cu},isStrictMode:function(t){return Ot(t)===uu},isSuspense:function(t){return Ot(t)===pu},isValidElementType:function(t){return typeof t=="string"||typeof t=="function"||t===lu||t===dc||t===cu||t===uu||t===pu||t===$4||typeof t=="object"&&t!==null&&(t.$$typeof===gu||t.$$typeof===mu||t.$$typeof===hu||t.$$typeof===du||t.$$typeof===fu||t.$$typeof===W4||t.$$typeof===q4||t.$$typeof===H4||t.$$typeof===B4)},typeOf:Ot},pe=W1(function(t,e){}),_0=(pe.AsyncMode,pe.ConcurrentMode,pe.ContextConsumer,pe.ContextProvider,pe.Element,pe.ForwardRef,pe.Fragment,pe.Lazy,pe.Memo,pe.Portal,pe.Profiler,pe.StrictMode,pe.Suspense,pe.isAsyncMode,pe.isConcurrentMode,pe.isContextConsumer,pe.isContextProvider,pe.isElement,pe.isForwardRef,pe.isFragment,pe.isLazy,pe.isMemo,pe.isPortal,pe.isProfiler,pe.isStrictMode,pe.isSuspense,pe.isValidElementType,pe.typeOf,W1(function(t){t.exports=G4})),K4={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},v0={};v0[_0.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},v0[_0.Memo]=K4;const Q4=document.getElementById("root"),X4=gd.createRoot(Q4);X4.render(O.jsx($.StrictMode,{children:O.jsx(z4,{reCaptchaKey:void 0,children:O.jsx(BC,{children:O.jsx(M4,{})})})}));export{hF as $,wt as A,P4 as B,r4 as C,To as D,f0 as E,Gs as F,IF as G,Wb as H,o4 as I,Dx as J,Gf as K,eF as L,WD as M,Nx as N,tF as O,c4 as P,wF as Q,$ as R,_4 as S,j1 as T,sF as U,fF as V,aF as W,ah as X,uF as Y,JM as Z,Dn as _,U1 as a,l4 as a0,_F as a1,EF as a2,mF as a3,gF as a4,yF as a5,dF as a6,vA as a7,HR as a8,VA as a9,W as aa,Y4 as ab,HC as ac,p4 as ad,rF as ae,XM as af,ji as ag,jV as ah,TF as ai,Ee as aj,t4 as b,F1 as c,t1 as d,D1 as e,lF as f,sO as g,ks as h,J4 as i,O as j,Ms as k,xO as l,g4 as m,oO as n,pF as o,iF as p,xs as q,D as r,cF as s,vF as t,Z4 as u,L1 as v,tO as w,lc as x,Sa as y,oF as z};

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