PageSourceSearch

https://platzreservierung-ag.web.app/assets/index-CHOPhIUZ.js

js platzreservierung-ag.web.app collected 2026-10-03 12:32:47 UTC 763,722 bytes, 3,280 lines download raw bytes

vendor: 4,743 bytes, lines 1-17
1(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function i(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(o){if(o.ep)return;o.ep=!0;const c=i(o);fetch(o.href,c)}})();function H_(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Qf={exports:{}},Lo={};/**
2 * @license React
3 * react-jsx-runtime.production.js
4 *
5 * Copyright (c) Meta Platforms, Inc. and affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var tv;function $x(){if(tv)return Lo;tv=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function i(s,o,c){var f=null;if(c!==void 0&&(f=""+c),o.key!==void 0&&(f=""+o.key),"key"in o){c={};for(var y in o)y!=="key"&&(c[y]=o[y])}else c=o;return o=c.ref,{$$typeof:r,type:s,key:f,ref:o!==void 0?o:null,props:c}}return Lo.Fragment=e,Lo.jsx=i,Lo.jsxs=i,Lo}var nv;function Xx(){return nv||(nv=1,Qf.exports=$x()),Qf.exports}var m=Xx(),Yf={exports:{}},Oe={};/**
10 * @license React
11 * react.production.js
12 *
13 * Copyright (c) Meta Platforms, Inc. and affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var iv;function Jx(){if(iv)return Oe;iv=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),f=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),S=Symbol.iterator;function z(M){return M===null||typeof M!="object"?null:(M=S&&M[S]||M["@@iterator"],typeof M=="function"?M:null)}var Q={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ie=Object.assign,X={};function ge(M,Y,ne){this.props=M,this.context=Y,this.refs=X,this.updater=ne||Q}ge.prototype.isReactComponent={},ge.prototype.setState=function(M,Y){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,Y,"setState")},ge.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function Te(){}Te.prototype=ge.prototype;function we(M,Y,ne){this.props=M,this.context=Y,this.refs=X,this.updater=ne||Q}var He=we.prototype=new Te;He.constructor=we,ie(He,ge.prototype),He.isPureReactComponent=!0;var ze=Array.isArray;function Ve(){}var I={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function N(M,Y,ne){var le=ne.ref;return{$$typeof:r,type:M,key:Y,ref:le!==void 0?le:null,props:ne}}function j(M,Y){return N(M.type,Y,M.props)}function R(M){return typeof M=="object"&&M!==null&&M.$$typeof===r}function V(M){var Y={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(ne){return Y[ne]})}var C=/\/+/g;function Ne(M,Y){return typeof M=="object"&&M!==null&&M.key!=null?V(""+M.key):Y.toString(36)}function qe(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(Ve,Ve):(M.status="pending",M.then(function(Y){M.status==="pending"&&(M.status="fulfilled",M.value=Y)},function(Y){M.status==="pending"&&(M.status="rejected",M.reason=Y)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function G(M,Y,ne,le,be){var he=typeof M;(he==="undefined"||he==="boolean")&&(M=null);var H=!1;if(M===null)H=!0;else switch(he){case"bigint":case"string":case"number":H=!0;break;case"object":switch(M.$$typeof){case r:case e:H=!0;break;case T:return H=M._init,G(H(M._payload),Y,ne,le,be)}}if(H)return be=be(M),H=le===""?"."+Ne(M,0):le,ze(be)?(ne="",H!=null&&(ne=H.replace(C,"$&/")+"/"),G(be,Y,ne,"",function(Fe){return Fe})):be!=null&&(R(be)&&(be=j(be,ne+(be.key==null||M&&M.key===be.key?"":(""+be.key).replace(C,"$&/")+"/")+H)),Y.push(be)),1;H=0;var Ee=le===""?".":le+":";if(ze(M))for(var Se=0;Se<M.length;Se++)le=M[Se],he=Ee+Ne(le,Se),H+=G(le,Y,ne,he,be);
vendor: 18,043 bytes, lines 17-43
17else if(Se=z(M),typeof Se=="function")for(M=Se.call(M),Se=0;!(le=M.next()).done;)le=le.value,he=Ee+Ne(le,Se++),H+=G(le,Y,ne,he,be);else if(he==="object"){if(typeof M.then=="function")return G(qe(M),Y,ne,le,be);throw Y=String(M),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return H}function re(M,Y,ne){if(M==null)return M;var le=[],be=0;return G(M,le,"","",function(he){return Y.call(ne,he,be++)}),le}function fe(M){if(M._status===-1){var Y=M._result;Y=Y(),Y.then(function(ne){(M._status===0||M._status===-1)&&(M._status=1,M._result=ne)},function(ne){(M._status===0||M._status===-1)&&(M._status=2,M._result=ne)}),M._status===-1&&(M._status=0,M._result=Y)}if(M._status===1)return M._result.default;throw M._result}var Be=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},Ke={map:re,forEach:function(M,Y,ne){re(M,function(){Y.apply(this,arguments)},ne)},count:function(M){var Y=0;return re(M,function(){Y++}),Y},toArray:function(M){return re(M,function(Y){return Y})||[]},only:function(M){if(!R(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return Oe.Activity=A,Oe.Children=Ke,Oe.Component=ge,Oe.Fragment=i,Oe.Profiler=o,Oe.PureComponent=we,Oe.StrictMode=s,Oe.Suspense=_,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(M){return I.H.useMemoCache(M)}},Oe.cache=function(M){return function(){return M.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(M,Y,ne){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var le=ie({},M.props),be=M.key;if(Y!=null)for(he in Y.key!==void 0&&(be=""+Y.key),Y)!w.call(Y,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&Y.ref===void 0||(le[he]=Y[he]);var he=arguments.length-2;if(he===1)le.children=ne;else if(1<he){for(var H=Array(he),Ee=0;Ee<he;Ee++)H[Ee]=arguments[Ee+2];le.children=H}return N(M.type,be,le)},Oe.createContext=function(M){return M={$$typeof:f,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:c,_context:M},M},Oe.createElement=function(M,Y,ne){var le,be={},he=null;if(Y!=null)for(le in Y.key!==void 0&&(he=""+Y.key),Y)w.call(Y,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(be[le]=Y[le]);var H=arguments.length-2;if(H===1)be.children=ne;else if(1<H){for(var Ee=Array(H),Se=0;Se<H;Se++)Ee[Se]=arguments[Se+2];be.children=Ee}if(M&&M.defaultProps)for(le in H=M.defaultProps,H)be[le]===void 0&&(be[le]=H[le]);return N(M,he,be)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(M){return{$$typeof:y,render:M}},Oe.isValidElement=R,Oe.lazy=function(M){return{$$typeof:T,_payload:{_status:-1,_result:M},_init:fe}},Oe.memo=function(M,Y){return{$$typeof:p,type:M,compare:Y===void 0?null:Y}},Oe.startTransition=function(M){var Y=I.T,ne={};I.T=ne;try{var le=M(),be=I.S;be!==null&&be(ne,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(Ve,Be)}catch(he){Be(he)}finally{Y!==null&&ne.types!==null&&(Y.types=ne.types),I.T=Y}},Oe.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Oe.use=function(M){return I.H.use(M)},Oe.useActionState=function(M,Y,ne){return I.H.useActionState(M,Y,ne)},Oe.useCallback=function(M,Y){return I.H.useCallback(M,Y)},Oe.useContext=function(M){return I.H.useContext(M)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(M,Y){return I.H.useDeferredValue(M,Y)},Oe.useEffect=function(M,Y){return I.H.useEffect(M,Y)},Oe.useEffectEvent=function(M){return I.H.useEffectEvent(M)},Oe.useId=function(){return I.H.useId()},Oe.useImperativeHandle=function(M,Y,ne){return I.H.useImperativeHandle(M,Y,ne)},Oe.useInsertionEffect=function(M,Y){return I.H.useInsertionEffect(M,Y)},Oe.useLayoutEffect=function(M,Y){return I.H.useLayoutEffect(M,Y)},Oe.useMemo=function(M,Y){return I.H.useMemo(M,Y)},Oe.useOptimistic=function(M,Y){return I.H.useOptimistic(M,Y)},Oe.useReducer=function(M,Y,ne){return I.H.useReducer(M,Y,ne)},Oe.useRef=function(M){return I.H.useRef(M)},Oe.useState=function(M){return I.H.useState(M)},Oe.useSyncExternalStore=function(M,Y,ne){return I.H.useSyncExternalStore(M,Y,ne)},Oe.useTransition=function(){return I.H.useTransition()},Oe.version="19.2.4",Oe}var rv;function Lm(){return rv||(rv=1,Yf.exports=Jx()),Yf.exports}var ye=Lm();const Zx=H_(ye);var $f={exports:{}},Uo={},Xf={exports:{}},Jf={};/**
18 * @license React
19 * scheduler.production.js
20 *
21 * Copyright (c) Meta Platforms, Inc. and affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */var sv;function Wx(){return sv||(sv=1,(function(r){function e(G,re){var fe=G.length;G.push(re);e:for(;0<fe;){var Be=fe-1>>>1,Ke=G[Be];if(0<o(Ke,re))G[Be]=re,G[fe]=Ke,fe=Be;else break e}}function i(G){return G.length===0?null:G[0]}function s(G){if(G.length===0)return null;var re=G[0],fe=G.pop();if(fe!==re){G[0]=fe;e:for(var Be=0,Ke=G.length,M=Ke>>>1;Be<M;){var Y=2*(Be+1)-1,ne=G[Y],le=Y+1,be=G[le];if(0>o(ne,fe))le<Ke&&0>o(be,ne)?(G[Be]=be,G[le]=fe,Be=le):(G[Be]=ne,G[Y]=fe,Be=Y);else if(le<Ke&&0>o(be,fe))G[Be]=be,G[le]=fe,Be=le;else break e}}return re}function o(G,re){var fe=G.sortIndex-re.sortIndex;return fe!==0?fe:G.id-re.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;r.unstable_now=function(){return c.now()}}else{var f=Date,y=f.now();r.unstable_now=function(){return f.now()-y}}var _=[],p=[],T=1,A=null,S=3,z=!1,Q=!1,ie=!1,X=!1,ge=typeof setTimeout=="function"?setTimeout:null,Te=typeof clearTimeout=="function"?clearTimeout:null,we=typeof setImmediate<"u"?setImmediate:null;function He(G){for(var re=i(p);re!==null;){if(re.callback===null)s(p);else if(re.startTime<=G)s(p),re.sortIndex=re.expirationTime,e(_,re);else break;re=i(p)}}function ze(G){if(ie=!1,He(G),!Q)if(i(_)!==null)Q=!0,Ve||(Ve=!0,V());else{var re=i(p);re!==null&&qe(ze,re.startTime-G)}}var Ve=!1,I=-1,w=5,N=-1;function j(){return X?!0:!(r.unstable_now()-N<w)}function R(){if(X=!1,Ve){var G=r.unstable_now();N=G;var re=!0;try{e:{Q=!1,ie&&(ie=!1,Te(I),I=-1),z=!0;var fe=S;try{t:{for(He(G),A=i(_);A!==null&&!(A.expirationTime>G&&j());){var Be=A.callback;if(typeof Be=="function"){A.callback=null,S=A.priorityLevel;var Ke=Be(A.expirationTime<=G);if(G=r.unstable_now(),typeof Ke=="function"){A.callback=Ke,He(G),re=!0;break t}A===i(_)&&s(_),He(G)}else s(_);A=i(_)}if(A!==null)re=!0;else{var M=i(p);M!==null&&qe(ze,M.startTime-G),re=!1}}break e}finally{A=null,S=fe,z=!1}re=void 0}}finally{re?V():Ve=!1}}}var V;if(typeof we=="function")V=function(){we(R)};else if(typeof MessageChannel<"u"){var C=new MessageChannel,Ne=C.port2;C.port1.onmessage=R,V=function(){Ne.postMessage(null)}}else V=function(){ge(R,0)};function qe(G,re){I=ge(function(){G(r.unstable_now())},re)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(G){G.callback=null},r.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<G?Math.floor(1e3/G):5},r.unstable_getCurrentPriorityLevel=function(){return S},r.unstable_next=function(G){switch(S){case 1:case 2:case 3:var re=3;break;default:re=S}var fe=S;S=re;try{return G()}finally{S=fe}},r.unstable_requestPaint=function(){X=!0},r.unstable_runWithPriority=function(G,re){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var fe=S;S=G;try{return re()}finally{S=fe}},r.unstable_scheduleCallback=function(G,re,fe){var Be=r.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?Be+fe:Be):fe=Be,G){case 1:var Ke=-1;break;case 2:Ke=250;break;case 5:Ke=1073741823;break;case 4:Ke=1e4;break;default:Ke=5e3}return Ke=fe+Ke,G={id:T++,callback:re,priorityLevel:G,startTime:fe,expirationTime:Ke,sortIndex:-1},fe>Be?(G.sortIndex=fe,e(p,G),i(_)===null&&G===i(p)&&(ie?(Te(I),I=-1):ie=!0,qe(ze,fe-Be))):(G.sortIndex=Ke,e(_,G),Q||z||(Q=!0,Ve||(Ve=!0,V()))),G},r.unstable_shouldYield=j,r.unstable_wrapCallback=function(G){var re=S;return function(){var fe=S;S=re;try{return G.apply(this,arguments)}finally{S=fe}}}})(Jf)),Jf}var av;function e1(){return av||(av=1,Xf.exports=Wx()),Xf.exports}var Zf={exports:{}},Nn={};/**
26 * @license React
27 * react-dom.production.js
28 *
29 * Copyright (c) Meta Platforms, Inc. and affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var lv;function t1(){if(lv)return Nn;lv=1;var r=Lm();function e(_){var p="https://react.dev/errors/"+_;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var T=2;T<arguments.length;T++)p+="&args[]="+encodeURIComponent(arguments[T])}return"Minified React error #"+_+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(e(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(_,p,T){var A=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:A==null?null:""+A,children:_,containerInfo:p,implementation:T}}var f=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(_,p){if(_==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Nn.createPortal=function(_,p){var T=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(e(299));return c(_,p,null,T)},Nn.flushSync=function(_){var p=f.T,T=s.p;try{if(f.T=null,s.p=2,_)return _()}finally{f.T=p,s.p=T,s.d.f()}},Nn.preconnect=function(_,p){typeof _=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(_,p))},Nn.prefetchDNS=function(_){typeof _=="string"&&s.d.D(_)},Nn.preinit=function(_,p){if(typeof _=="string"&&p&&typeof p.as=="string"){var T=p.as,A=y(T,p.crossOrigin),S=typeof p.integrity=="string"?p.integrity:void 0,z=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;T==="style"?s.d.S(_,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:A,integrity:S,fetchPriority:z}):T==="script"&&s.d.X(_,{crossOrigin:A,integrity:S,fetchPriority:z,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Nn.preinitModule=function(_,p){if(typeof _=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var T=y(p.as,p.crossOrigin);s.d.M(_,{crossOrigin:T,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(_)},Nn.preload=function(_,p){if(typeof _=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var T=p.as,A=y(T,p.crossOrigin);s.d.L(_,T,{crossOrigin:A,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Nn.preloadModule=function(_,p){if(typeof _=="string")if(p){var T=y(p.as,p.crossOrigin);s.d.m(_,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:T,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(_)},Nn.requestFormReset=function(_){s.d.r(_)},Nn.unstable_batchedUpdates=function(_,p){return _(p)},Nn.useFormState=function(_,p,T){return f.H.useFormState(_,p,T)},Nn.useFormStatus=function(){return f.H.useHostTransitionStatus()},Nn.version="19.2.4",Nn}var ov;function n1(){if(ov)return Zf.exports;ov=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),Zf.exports=t1(),Zf.exports}/**
34 * @license React
35 * react-dom-client.production.js
36 *
37 * Copyright (c) Meta Platforms, Inc. and affiliates.
38 *
39 * This source code is licensed under the MIT license found in the
40 * LICENSE file in the root directory of this source tree.
41 */var uv;function i1(){if(uv)return Uo;uv=1;var r=e1(),e=Lm(),i=n1();function s(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var n=t,a=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(a=n.return),t=n.return;while(t)}return n.tag===3?a:null}function f(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function y(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function _(t){if(c(t)!==t)throw Error(s(188))}function p(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(s(188));return n!==t?null:t}for(var a=t,l=n;;){var h=a.return;if(h===null)break;var d=h.alternate;if(d===null){if(l=h.return,l!==null){a=l;continue}break}if(h.child===d.child){for(d=h.child;d;){if(d===a)return _(h),t;if(d===l)return _(h),n;d=d.sibling}throw Error(s(188))}if(a.return!==l.return)a=h,l=d;else{for(var v=!1,E=h.child;E;){if(E===a){v=!0,a=h,l=d;break}if(E===l){v=!0,l=h,a=d;break}E=E.sibling}if(!v){for(E=d.child;E;){if(E===a){v=!0,a=d,l=h;break}if(E===l){v=!0,l=d,a=h;break}E=E.sibling}if(!v)throw Error(s(189))}}if(a.alternate!==l)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?t:n}function T(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=T(t),n!==null)return n;t=t.sibling}return null}var A=Object.assign,S=Symbol.for("react.element"),z=Symbol.for("react.transitional.element"),Q=Symbol.for("react.portal"),ie=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),ge=Symbol.for("react.profiler"),Te=Symbol.for("react.consumer"),we=Symbol.for("react.context"),He=Symbol.for("react.forward_ref"),ze=Symbol.for("react.suspense"),Ve=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),j=Symbol.for("react.memo_cache_sentinel"),R=Symbol.iterator;function V(t){return t===null||typeof t!="object"?null:(t=R&&t[R]||t["@@iterator"],typeof t=="function"?t:null)}var C=Symbol.for("react.client.reference");function Ne(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===C?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ie:return"Fragment";case ge:return"Profiler";case X:return"StrictMode";case ze:return"Suspense";case Ve:return"SuspenseList";case N:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case Q:return"Portal";case we:return t.displayName||"Context";case Te:return(t._context.displayName||"Context")+".Consumer";case He:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case I:return n=t.displayName||null,n!==null?n:Ne(t.type)||"Memo";case w:n=t._payload,t=t._init;try{return Ne(t(n))}catch{}}return null}var qe=Array.isArray,G=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},Be=[],Ke=-1;function M(t){return{current:t}}function Y(t){0>Ke||(t.current=Be[Ke],Be[Ke]=null,Ke--)}function ne(t,n){Ke++,Be[Ke]=t.current,t.current=n}var le=M(null),be=M(null),he=M(null),H=M(null);function Ee(t,n){switch(ne(he,n),ne(be,t),ne(le,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?A0(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=A0(n),t=S0(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Y(le),ne(le,t)}function Se(){Y(le),Y(be),Y(he)}function Fe(t){t.memoizedState!==null&&ne(H,t);var n=le.current,a=S0(n,t.type);n!==a&&(ne(be,t),ne(le,a))}function jt(t){be.current===t&&(Y(le),Y(be)),H.current===t&&(Y(H),Oo._currentValue=fe)}var Rt,Un;function dn(t){if(Rt===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);Rt=n&&n[1]||"",Un=-1<a.stack.indexOf(`
42    at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43`+Rt+t+Un}var fn=!1;function Pn(t,n){if(!t||fn)return"";fn=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(n){var J=function(){throw Error()};if(Object.defineProperty(J.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(J,[])}catch(F){var B=F}Reflect.construct(t,[],J)}else{try{J.call()}catch(F){B=F}t.call(J.prototype)}}else{try{throw Error()}catch(F){B=F}(J=t())&&typeof J.catch=="function"&&J.catch(function(){})}}
vendor: 4,674 bytes, lines 43-48
43catch(F){if(F&&B&&typeof F.stack=="string")return[F.stack,B.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=l.DetermineComponentFrameRoot(),v=d[0],E=d[1];if(v&&E){var D=v.split(`
44`),P=E.split(`
45`);for(h=l=0;l<D.length&&!D[l].includes("DetermineComponentFrameRoot");)l++;for(;h<P.length&&!P[h].includes("DetermineComponentFrameRoot");)h++;if(l===D.length||h===P.length)for(l=D.length-1,h=P.length-1;1<=l&&0<=h&&D[l]!==P[h];)h--;for(;1<=l&&0<=h;l--,h--)if(D[l]!==P[h]){if(l!==1||h!==1)do if(l--,h--,0>h||D[l]!==P[h]){var K=`
46`+D[l].replace(" at new "," at ");return t.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",t.displayName)),K}while(1<=l&&0<=h);break}}}finally{fn=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?dn(a):""}function ee(t,n){switch(t.tag){case 26:case 27:case 5:return dn(t.type);case 16:return dn("Lazy");case 13:return t.child!==n&&n!==null?dn("Suspense Fallback"):dn("Suspense");case 19:return dn("SuspenseList");case 0:case 15:return Pn(t.type,!1);case 11:return Pn(t.type.render,!1);case 1:return Pn(t.type,!0);case 31:return dn("Activity");default:return""}}function se(t){try{var n="",a=null;do n+=ee(t,a),a=t,t=t.return;while(t);return n}catch(l){return`
47Error generating stack: `+l.message+`
48`+l.stack}}var oe=Object.prototype.hasOwnProperty,ue=r.unstable_scheduleCallback,ve=r.unstable_cancelCallback,nt=r.unstable_shouldYield,ke=r.unstable_requestPaint,wt=r.unstable_now,Ft=r.unstable_getCurrentPriorityLevel,zi=r.unstable_ImmediatePriority,Si=r.unstable_UserBlockingPriority,Jn=r.unstable_NormalPriority,Ll=r.unstable_LowPriority,Vs=r.unstable_IdlePriority,ks=r.log,Aa=r.unstable_setDisableYieldValue,Zn=null,Vt=null;function Mn(t){if(typeof ks=="function"&&Aa(t),Vt&&typeof Vt.setStrictMode=="function")try{Vt.setStrictMode(Zn,t)}catch{}}var te=Math.clz32?Math.clz32:mn,lt=Math.log,rt=Math.LN2;function mn(t){return t>>>=0,t===0?32:31-(lt(t)/rt|0)|0}var Gt=256,ui=262144,xt=4194304;function xn(t){var n=t&42;if(n!==0)return n;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Re(t,n,a){var l=t.pendingLanes;if(l===0)return 0;var h=0,d=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var E=l&134217727;return E!==0?(l=E&~d,l!==0?h=xn(l):(v&=E,v!==0?h=xn(v):a||(a=E&~t,a!==0&&(h=xn(a))))):(E=l&~d,E!==0?h=xn(E):v!==0?h=xn(v):a||(a=l&~t,a!==0&&(h=xn(a)))),h===0?0:n!==0&&n!==h&&(n&d)===0&&(d=h&-h,a=n&-n,d>=a||d===32&&(a&4194048)!==0)?n:h}function st(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function Pt(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32: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 n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function at(){var t=xt;return xt<<=1,(xt&62914560)===0&&(xt=4194304),t}function mt(t){for(var n=[],a=0;31>a;a++)n.push(t);return n}function et(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function An(t,n,a,l,h,d){var v=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var E=t.entanglements,D=t.expirationTimes,P=t.hiddenUpdates;for(a=v&~a;0<a;){var K=31-te(a),J=1<<K;E[K]=0,D[K]=-1;var B=P[K];if(B!==null)for(P[K]=null,K=0;K<B.length;K++){var F=B[K];F!==null&&(F.lane&=-536870913)}a&=~J}l!==0&&Sn(t,l,0),d!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=d&~(v&~n))}function Sn(t,n,a){t.pendingLanes|=n,t.suspendedLanes&=~n;var l=31-te(n);t.entangledLanes|=n,t.entanglements[l]=t.entanglements[l]|1073741824|a&261930}function On(t,n){var a=t.entangledLanes|=n;for(t=t.entanglements;a;){var l=31-te(a),h=1<<l;
vendor: 8,553 bytes, line 48
48h&n|t[l]&n&&(t[l]|=n),a&=~h}}function vt(t,n){var a=n&-n;return a=(a&42)!==0?1:sn(a),(a&(t.suspendedLanes|n))!==0?0:a}function sn(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function wn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function an(){var t=re.p;return t!==0?t:(t=window.event,t===void 0?32:Y0(t.type))}function jn(t,n){var a=re.p;try{return re.p=t,n()}finally{re.p=a}}var zn=Math.random().toString(36).slice(2),Ct="__reactFiber$"+zn,tn="__reactProps$"+zn,Vn="__reactContainer$"+zn,Pr="__reactEvents$"+zn,Ul="__reactListeners$"+zn,_u="__reactHandles$"+zn,bu="__reactResources$"+zn,Bi="__reactMarker$"+zn;function Sa(t){delete t[Ct],delete t[tn],delete t[Pr],delete t[Ul],delete t[_u]}function Hi(t){var n=t[Ct];if(n)return n;for(var a=t.parentNode;a;){if(n=a[Vn]||a[Ct]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(t=M0(t);t!==null;){if(a=t[Ct])return a;t=M0(t)}return n}t=a,a=t.parentNode}return null}function ci(t){if(t=t[Ct]||t[Vn]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function Wn(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(s(33))}function qi(t){var n=t[bu];return n||(n=t[bu]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Kt(t){t[Bi]=!0}var Pl=new Set,zl={};function Fi(t,n){Gi(t,n),Gi(t+"Capture",n)}function Gi(t,n){for(zl[t]=n,t=0;t<n.length;t++)Pl.add(n[t])}var Bl=RegExp("^[: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]*$"),Hl={},ql={};function Tu(t){return oe.call(ql,t)?!0:oe.call(Hl,t)?!1:Bl.test(t)?ql[t]=!0:(Hl[t]=!0,!1)}function wa(t,n,a){if(Tu(n))if(a===null)t.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var l=n.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+a)}}function ei(t,n,a){if(a===null)t.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+a)}}function Qt(t,n,a,l){if(l===null)t.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(n,a,""+l)}}function ln(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function zr(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Fl(t,n,a){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var h=l.get,d=l.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return h.call(this)},set:function(v){a=""+v,d.call(this,v)}}),Object.defineProperty(t,n,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(v){a=""+v},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function gt(t){if(!t._valueTracker){var n=zr(t)?"checked":"value";t._valueTracker=Fl(t,n,""+t[n])}}function Ls(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var a=n.getValue(),l="";return t&&(l=zr(t)?t.checked?"true":"false":t.value),t=l,t!==a?(n.setValue(t),!0):!1}function Ki(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}}var Us=/[\n"\\]/g;function Bn(t){return t.replace(Us,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Na(t,n,a,l,h,d,v,E){t.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.type=v:t.removeAttribute("type"),n!=null?v==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+ln(n)):t.value!==""+ln(n)&&(t.value=""+ln(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?Gl(t,v,ln(n)):a!=null?Gl(t,v,ln(a)):l!=null&&t.removeAttribute("value"),h==null&&d!=null&&(t.defaultChecked=!!d),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.name=""+ln(E):t.removeAttribute("name")}function Eu(t,n,a,l,h,d,v,E){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(t.type=d),n!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||n!=null)){gt(t);return}a=a!=null?""+ln(a):"",n=n!=null?""+ln(n):a,E||n===t.value||(t.value=n),t.defaultValue=n}l=l??h,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=E?t.checked:!!l,t.defaultChecked=!!l,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),gt(t)}function Gl(t,n,a){n==="number"&&Ki(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Br(t,n,a,l){if(t=t.options,n){n={};for(var h=0;h<a.length;h++)n["$"+a[h]]=!0;for(a=0;a<t.length;a++)h=n.hasOwnProperty("$"+t[a].value),t[a].selected!==h&&(t[a].selected=h),h&&l&&(t[a].defaultSelected=!0)}else{for(a=""+ln(a),n=null,h=0;h<t.length;h++){if(t[h].value===a){t[h].selected=!0,l&&(t[h].defaultSelected=!0);return}n!==null||t[h].disabled||(n=t[h])}n!==null&&(n.selected=!0)}}function xu(t,n,a){if(n!=null&&(n=""+ln(n),n!==t.value&&(t.value=n),a==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=a!=null?""+ln(a):""}function Hr(t,n,a,l){if(n==null){if(l!=null){if(a!=null)throw Error(s(92));if(qe(l)){if(1<l.length)throw Error(s(93));l=l[0]}a=l}a==null&&(a=""),n=a}a=ln(n),t.defaultValue=a,l=t.textContent,l===a&&l!==""&&l!==null&&(t.value=l),gt(t)}function Hn(t,n){if(n){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=n;return}}t.textContent=n}var Au=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Kl(t,n,a){var l=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":l?t.setProperty(n,a):typeof a!="number"||a===0||Au.has(n)?n==="float"?t.cssFloat=a:t[n]=(""+a).trim():t[n]=a+"px"}function Ql(t,n,a){if(n!=null&&typeof n!="object")throw Error(s(62));if(t=t.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||n!=null&&n.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var h in n)l=n[h],n.hasOwnProperty(h)&&a[h]!==l&&Kl(t,h,l)}else for(var d in n)n.hasOwnProperty(d)&&Kl(t,d,n[d])}function Ia(t){if(t.indexOf("-")===-1)return!1;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 Su=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRen
48dering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),qr=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ra(t){return qr.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function wi(){}var Yl=null;function hi(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Fr=null,Qi=null;function Ps(t){var n=ci(t);if(n&&(t=n.stateNode)){var a=t[tn]||null;e:switch(t=n.stateNode,n.type){case"input":if(Na(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Bn(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var l=a[n];if(l!==t&&l.form===t.form){var h=l[tn]||null;if(!h)throw Error(s(90));Na(l,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(n=0;n<a.length;n++)l=a[n],l.form===t.form&&Ls(l)}break e;case"textarea":xu(t,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&Br(t,!!a.multiple,n,!1)}}}var Ca=!1;function Gr(t,n,a){if(Ca)return t(n,a);Ca=!0;try{var l=t(n);return l}finally{if(Ca=!1,(Fr!==null||Qi!==null)&&(vc(),Fr&&(n=Fr,t=Qi,Qi=Fr=null,Ps(n),t)))for(n=0;n<t.length;n++)Ps(t[n])}}function Ni(t,n){var a=t.stateNode;if(a===null)return null;var l=a[tn]||null;if(l===null)return null;a=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(s(231,n,typeof a));return a}var di=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zs=!1;if(di)try{var _t={};Object.defineProperty(_t,"passive",{get:function(){zs=!0}}),window.addEventListener("test",_t,_t),window.removeEventListener("test",_t,_t)}catch{zs=!1}var Yi=null,$l=null,Bs=null;
vendor: 6,601 bytes, line 48
48function Xl(){if(Bs)return Bs;var t,n=$l,a=n.length,l,h="value"in Yi?Yi.value:Yi.textContent,d=h.length;for(t=0;t<a&&n[t]===h[t];t++);var v=a-t;for(l=1;l<=v&&n[a-l]===h[d-l];l++);return Bs=h.slice(t,1<l?1-l:void 0)}function Hs(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function cr(){return!0}function Ii(){return!1}function gn(t){function n(a,l,h,d,v){this._reactName=a,this._targetInst=h,this.type=l,this.nativeEvent=d,this.target=v,this.currentTarget=null;for(var E in t)t.hasOwnProperty(E)&&(a=t[E],this[E]=a?a(d):d[E]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?cr:Ii,this.isPropagationStopped=Ii,this}return A(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=cr)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=cr)},persist:function(){},isPersistent:cr}),n}var hr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$i=gn(hr),Kr=A({},hr,{view:0,detail:0}),Jl=gn(Kr),Qr,Da,Xi,Ma=A({},Kr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yr,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!==Xi&&(Xi&&t.type==="mousemove"?(Qr=t.screenX-Xi.screenX,Da=t.screenY-Xi.screenY):Da=Qr=0,Xi=t),Qr)},movementY:function(t){return"movementY"in t?t.movementY:Da}}),Zl=gn(Ma),qs=A({},Ma,{dataTransfer:0}),wu=gn(qs),Nu=A({},Kr,{relatedTarget:0}),Fs=gn(Nu),Wl=A({},hr,{animationName:0,elapsedTime:0,pseudoElement:0}),Iu=gn(Wl),Oa=A({},hr,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Ru=gn(Oa),Cu=A({},hr,{data:0}),Ji=gn(Cu),Du={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mu={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"},Ou={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ju(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Ou[t])?!!n[t]:!1}function Yr(){return ju}var kn=A({},Kr,{key:function(t){if(t.key){var n=Du[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Hs(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Mu[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yr,charCode:function(t){return t.type==="keypress"?Hs(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Hs(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Vu=gn(kn),ku=A({},Ma,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dr=gn(ku),u=A({},Kr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yr}),g=gn(u),b=A({},hr,{propertyName:0,elapsedTime:0,pseudoElement:0}),x=gn(b),L=A({},Ma,{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}),q=gn(L),ae=A({},hr,{newState:0,oldState:0}),Le=gn(ae),zt=[9,13,27,32],ct=di&&"CompositionEvent"in window,Dt=null;di&&"documentMode"in document&&(Dt=document.documentMode);var fi=di&&"TextEvent"in window&&!Dt,Zi=di&&(!ct||Dt&&8<Dt&&11>=Dt),Ri=" ",Ci=!1;function Gs(t,n){switch(t){case"keyup":return zt.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ja(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Va=!1;function _E(t,n){switch(t){case"compositionend":return ja(n);case"keypress":return n.which!==32?null:(Ci=!0,Ri);case"textInput":return t=n.data,t===Ri&&Ci?null:t;default:return null}}function bE(t,n){if(Va)return t==="compositionend"||!ct&&Gs(t,n)?(t=Xl(),Bs=$l=Yi=null,Va=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Zi&&n.locale!=="ko"?null:n.data;default:return null}}var TE={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 Vg(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!TE[t.type]:n==="textarea"}function kg(t,n,a,l){Fr?Qi?Qi.push(l):Qi=[l]:Fr=l,n=Sc(n,"onChange"),0<n.length&&(a=new $i("onChange","change",null,a,l),t.push({event:a,listeners:n}))}var eo=null,to=null;function EE(t){v0(t,0)}function Lu(t){var n=Wn(t);if(Ls(n))return t}function Lg(t,n){if(t==="change")return n}var Ug=!1;if(di){var Wh;if(di){var ed="oninput"in document;if(!ed){var Pg=document.createElement("div");Pg.setAttribute("oninput","return;"),ed=typeof Pg.oninput=="function"}Wh=ed}else Wh=!1;Ug=Wh&&(!document.documentMode||9<document.documentMode)}function zg(){eo&&(eo.detachEvent("onpropertychange",Bg),to=eo=null)}function Bg(t){if(t.propertyName==="value"&&Lu(to)){var n=[];kg(n,to,t,hi(t)),Gr(EE,n)}}function xE(t,n,a){t==="focusin"?(zg(),eo=n,to=a,eo.attachEvent("onpropertychange",Bg)):t==="focusout"&&zg()}function AE(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Lu(to)}function SE(t,n){if(t==="click")return Lu(n)}function wE(t,n){if(t==="input"||t==="change")return Lu(n)}function NE(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var ti=typeof Object.is=="function"?Object.is:NE;function no(t,n){if(ti(t,n))return!0;
vendor: 23,841 bytes, line 48
48if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var a=Object.keys(t),l=Object.keys(n);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var h=a[l];if(!oe.call(n,h)||!ti(t[h],n[h]))return!1}return!0}function Hg(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function qg(t,n){var a=Hg(t);t=0;for(var l;a;){if(a.nodeType===3){if(l=t+a.textContent.length,t<=n&&l>=n)return{node:a,offset:n-t};t=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Hg(a)}}function Fg(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Fg(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function Gg(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Ki(t.document);n instanceof t.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)t=n.contentWindow;else break;n=Ki(t.document)}return n}function td(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var IE=di&&"documentMode"in document&&11>=document.documentMode,ka=null,nd=null,io=null,id=!1;function Kg(t,n,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;id||ka==null||ka!==Ki(l)||(l=ka,"selectionStart"in l&&td(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),io&&no(io,l)||(io=l,l=Sc(nd,"onSelect"),0<l.length&&(n=new $i("onSelect","select",null,n,a),t.push({event:n,listeners:l}),n.target=ka)))}function Ks(t,n){var a={};return a[t.toLowerCase()]=n.toLowerCase(),a["Webkit"+t]="webkit"+n,a["Moz"+t]="moz"+n,a}var La={animationend:Ks("Animation","AnimationEnd"),animationiteration:Ks("Animation","AnimationIteration"),animationstart:Ks("Animation","AnimationStart"),transitionrun:Ks("Transition","TransitionRun"),transitionstart:Ks("Transition","TransitionStart"),transitioncancel:Ks("Transition","TransitionCancel"),transitionend:Ks("Transition","TransitionEnd")},rd={},Qg={};di&&(Qg=document.createElement("div").style,"AnimationEvent"in window||(delete La.animationend.animation,delete La.animationiteration.animation,delete La.animationstart.animation),"TransitionEvent"in window||delete La.transitionend.transition);function Qs(t){if(rd[t])return rd[t];if(!La[t])return t;var n=La[t],a;for(a in n)if(n.hasOwnProperty(a)&&a in Qg)return rd[t]=n[a];return t}var Yg=Qs("animationend"),$g=Qs("animationiteration"),Xg=Qs("animationstart"),RE=Qs("transitionrun"),CE=Qs("transitionstart"),DE=Qs("transitioncancel"),Jg=Qs("transitionend"),Zg=new Map,sd="abort auxClick beforeToggle 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(" ");sd.push("scrollEnd");function Di(t,n){Zg.set(t,n),Fi(n,[t])}var Uu=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},mi=[],Ua=0,ad=0;function Pu(){for(var t=Ua,n=ad=Ua=0;n<t;){var a=mi[n];mi[n++]=null;var l=mi[n];mi[n++]=null;var h=mi[n];mi[n++]=null;var d=mi[n];if(mi[n++]=null,l!==null&&h!==null){var v=l.pending;v===null?h.next=h:(h.next=v.next,v.next=h),l.pending=h}d!==0&&Wg(a,h,d)}}function zu(t,n,a,l){mi[Ua++]=t,mi[Ua++]=n,mi[Ua++]=a,mi[Ua++]=l,ad|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function ld(t,n,a,l){return zu(t,n,a,l),Bu(t)}function Ys(t,n){return zu(t,null,null,n),Bu(t)}function Wg(t,n,a){t.lanes|=a;var l=t.alternate;l!==null&&(l.lanes|=a);for(var h=!1,d=t.return;d!==null;)d.childLanes|=a,l=d.alternate,l!==null&&(l.childLanes|=a),d.tag===22&&(t=d.stateNode,t===null||t._visibility&1||(h=!0)),t=d,d=d.return;return t.tag===3?(d=t.stateNode,h&&n!==null&&(h=31-te(a),t=d.hiddenUpdates,l=t[h],l===null?t[h]=[n]:l.push(n),n.lane=a|536870912),d):null}function Bu(t){if(50<wo)throw wo=0,yf=null,Error(s(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var Pa={};function ME(t,n,a,l){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ni(t,n,a,l){return new ME(t,n,a,l)}function od(t){return t=t.prototype,!(!t||!t.isReactComponent)}function fr(t,n){var a=t.alternate;return a===null?(a=ni(t.tag,n,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=n,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,n=t.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function ep(t,n){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,n=a.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Hu(t,n,a,l,h,d){var v=0;if(l=t,typeof t=="function")od(t)&&(v=1);else if(typeof t=="string")v=Lx(t,a,le.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case N:return t=ni(31,a,n,h),t.elementType=N,t.lanes=d,t;case ie:return $s(a.children,h,d,n);case X:v=8,h|=24;break;case ge:return t=ni(12,a,n,h|2),t.elementType=ge,t.lanes=d,t;case ze:return t=ni(13,a,n,h),t.elementType=ze,t.lanes=d,t;case Ve:return t=ni(19,a,n,h),t.elementType=Ve,t.lanes=d,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case we:v=10;break e;case Te:v=9;break e;case He:v=11;break e;case I:v=14;break e;case w:v=16,l=null;break e}v=29,a=Error(s(130,t===null?"null":typeof t,"")),l=null}return n=ni(v,a,n,h),n.elementType=t,n.type=l,n.lanes=d,n}function $s(t,n,a,l){return t=ni(7,t,l,n),t.lanes=a,t}function ud(t,n,a){return t=ni(6,t,null,n),t.lanes=a,t}function tp(t){var n=ni(18,null,null,0);return n.stateNode=t,n}function cd(t,n,a){return n=ni(4,t.children!==null?t.children:[],t.key,n),n.lanes=a,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var np=new WeakMap;function gi(t,n){if(typeof t=="object"&&t!==null){var a=np.get(t);return a!==void 0?a:(n={value:t,source:n,stack:se(n)},np.set(t,n),n)}return{value:t,source:n,stack:se(n)}}var za=[],Ba=0,qu=null,ro=0,pi=[],yi=0,$r=null,Wi=1,er="";function mr(t,n){za[Ba++]=ro,za[Ba++]=qu,qu=t,ro=n}function ip(t,n,a){pi[yi++]=Wi,pi[yi++]=er,pi[yi++]=$r,$r=t;var l=Wi;t=er;var h=32-te(l)-1;l&=~(1<<h),a+=1;var d=32-te(n)+h;if(30<d){var v=h-h%5;d=(l&(1<<v)-1).toString(32),l>>=v,h-=v,Wi=1<<32-te(n)+h|a<<h|l,er=d+t}else Wi=1<<d|a<<h|l,er=t}function hd(t){t.return!==null&&(mr(t,1),ip(t,1,0))}function dd(t){for(;t===qu;)qu=za[--Ba],za[Ba]=null,ro=za[--Ba],za[Ba]=null;for(;t===$r;)$r=pi[--yi],pi[yi]=null,er=pi[--yi],pi[yi]=null,Wi=pi[--yi],pi[yi]=null}function rp(t,n){pi[yi++]=Wi,pi[yi++]=er,pi[yi++]=$r,Wi=n.id,er=n.overflow,$r=t}var pn=null,Nt=null,tt=!1,Xr=null,vi=!1,fd=Error(s(519));function Jr(t){var n=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw so(gi(n,t)),fd}function sp(t){var n=t.stateNode,a=t.type,l=t.memoizedProps;switch(n[Ct]=t,n[tn]=l,a){case"dialog":Ye("cancel",n),Ye("close",n);break;case"iframe":case"object":case"embed":Ye("load",n);break;case"video":case"audio":for(a=0;a<Io.length;a++)Ye(Io[a],n);break;case"source":Ye("error",n);break;case"img":case"image":case"link":Ye("error",n),Ye("load",n);break;case"details":Ye("toggle",n);break;case"input":Ye("invalid",n),Eu(n,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ye("invalid",n);break;case"textarea":Ye("invalid",n),Hr(n,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||l.suppressHydrationWarning===!0||E0(n.textContent,a)?(l.popover!=null&&(Ye("beforetoggle",n),Ye("toggle",n)),l.onScroll!=null&&Ye("scroll",n),l.onScrollEnd!=null&&Ye("scrollend",n),l.onClick!=null&&(n.onclick=wi),n=!0):n=!1,n||Jr(t,!0)}function ap(t){for(pn=t.return;pn;)switch(pn.tag){case 5:case 31:case 13:vi=!1;return;case 27:case 3:vi=!0;return;default:pn=pn.return}}function Ha(t){if(t!==pn)return!1;if(!tt)return ap(t),tt=!0,!1;var n=t.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Mf(t.type,t.memoizedProps)),a=!a),a&&Nt&&Jr(t),ap(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Nt=D0(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Nt=D0(t)}else n===27?(n=Nt,hs(t.type)?(t=Lf,Lf=null,Nt=t):Nt=n):Nt=pn?bi(t.stateNode.nextSibling):null;return!0}function Xs(){Nt=pn=null,tt=!1}function md(){var t=Xr;return t!==null&&(Kn===null?Kn=t:Kn.push.apply(Kn,t),Xr=null),t}function so(t){Xr===null?Xr=[t]:Xr.push(t)}var gd=M(null),Js=null,gr=null;function Zr(t,n,a){ne(gd,n._currentValue),n._currentValue=a}function pr(t){t._currentValue=gd.current,Y(gd)}function pd(t,n,a){for(;t!==null;){var l=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),t===a)break;t=t.return}}function yd(t,n,a,l){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var d=h.dependencies;if(d!==null){var v=h.child;d=d.firstContext;e:for(;d!==null;){var E=d;d=h;for(var D=0;D<n.length;D++)if(E.context===n[D]){d.lanes|=a,E=d.alternate,E!==null&&(E.lanes|=a),pd(d.return,a,t),l||(v=null);break e}d=E.next}}else if(h.tag===18){if(v=h.return,v===null)throw Error(s(341));v.lanes|=a,d=v.alternate,d!==null&&(d.lanes|=a),pd(v,a,t),v=null}else v=h.child;if(v!==null)v.return=h;else for(v=h;v!==null;){if(v===t){v=null;break}if(h=v.sibling,h!==null){h.return=v.return,v=h;break}v=v.return}h=v}}function qa(t,n,a,l){t=null;for(var h=n,d=!1;h!==null;){if(!d){if((h.flags&524288)!==0)d=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var v=h.alternate;if(v===null)throw Error(s(387));if(v=v.memoizedProps,v!==null){var E=h.type;ti(h.pendingProps.value,v.value)||(t!==null?t.push(E):t=[E])}}else if(h===H.current){if(v=h.alternate,v===null)throw Error(s(387));v.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(Oo):t=[Oo])}h=h.return}t!==null&&yd(n,t,a,l),n.flags|=262144}function Fu(t){for(t=t.firstContext;t!==null;){if(!ti(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Zs(t){Js=t,gr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function yn(t){return lp(Js,t)}function Gu(t,n){return Js===null&&Zs(t),lp(t,n)}function lp(t,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},gr===null){if(t===null)throw Error(s(308));gr=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else gr=gr.next=n;return a}var OE=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(a,l){t.push(l)}};this.abort=function(){n.aborted=!0,t.forEach(function(a){return a()})}},jE=r.unstable_scheduleCallback,VE=r.unstable_NormalPriority,Yt={$$typeof:we,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vd(){return{controller:new OE,data:new Map,refCount:0}}function ao(t){t.refCount--,t.refCount===0&&jE(VE,function(){t.controller.abort()})}var lo=null,_d=0,Fa=0,Ga=null;function kE(t,n){if(lo===null){var a=lo=[];_d=0,Fa=xf(),Ga={status:"pending",value:void 0,then:function(l){a.push(l)}}}return _d++,n.then(op,op),n}function op(){if(--_d===0&&lo!==null){Ga!==null&&(Ga.status="fulfilled");var t=lo;lo=null,Fa=0,Ga=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function LE(t,n){var a=[],l={status:"pending",value:null,reason:null,then:function(h){a.push(h)}};return t.then(function(){l.status="fulfilled",l.value=n;for(var h=0;h<a.length;h++)(0,a[h])(n)},function(h){for(l.status="rejected",l.reason=h,h=0;h<a.length;h++)(0,a[h])(void 0)}),l}var up=G.S;G.S=function(t,n){Ky=wt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&kE(t,n),up!==null&&up(t,n)};var Ws=M(null);function bd(){var t=Ws.current;return t!==null?t:At.pooledCache}function Ku(t,n){n===null?ne(Ws,Ws.current):ne(Ws,n.pool)}function cp(){var t=bd();return t===null?null:{parent:Yt._currentValue,pool:t}}var Ka=Error(s(460)),Td=Error(s(474)),Qu=Error(s(542)),Yu={then:function(){}};function hp(t){return t=t.status,t==="fulfilled"||t==="rejected"}function dp(t,n,a){switch(a=t[a],a===void 0?t.push(n):a!==n&&(n.then(wi,wi),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,mp(t),t;default:if(typeof n.status=="string")n.then(wi,wi);else{if(t=At,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=n,t.status="pending",t.then(function(l){if(n.status==="pending"){var h=n;h.status="fulfilled",h.value=l}},function(l){if(n.status==="pending"){var h=n;h.status="rejected",h.reason=l}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,mp(t),t}throw ta=n,Ka}}function ea(t){try{var n=t._init;return n(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ta=a,Ka):a}}var ta=null;function fp(){if(ta===null)throw Error(s(459));var t=ta;return ta=null,t}function mp(t){if(t===Ka||t===Qu)throw Error(s(483))}var Qa=null,oo=0;function $u(t){var n=oo;return oo+=1,Qa===null&&(Qa=[]),dp(Qa,t,n)}function uo(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Xu(t,n){throw n.$$typeof===S?Error(s(525)):(t=Object.prototype.toString.call(n),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function gp(t){function n(k,O){if(t){var U=k.deletions;U===null?(k.deletions=[O],k.flags|=16):U.push(O)}}function a(k,O){if(!t)return null;for(;O!==null;)n(k,O),O=O.sibling;return null}function l(k){for(var O=new Map;k!==null;)k.key!==null?O.set(k.key,k):O.set(k.index,k),k=k.sibling;return O}function h(k,O){return k=fr(k,O),k.index=0,k.sibling=null,k}function d(k,O,U){return k.index=U,t?(U=k.alternate,U!==null?(U=U.index,U<O?(k.flags|=67108866,O):U):(k.flags|=67108866,O)):(k.flags|=1048576,O)}function v(k){return t&&k.alternate===null&&(k.flags|=67108866),k}function E(k,O,U,$){return O===null||O.tag!==6?(O=ud(U,k.mode,$),O.return=k,O):(O=h(O,U),O.return=k,O)}function D(k,O,U,$){var xe=U.type;return xe===ie?K(k,O,U.props.children,$,U.key):O!==null&&(O.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===w&&ea(xe)===O.type)?(O=h(O,U.props),uo(O,U),O.return=k,O):(O=Hu(U.type,U.key,U.props,null,k.mode,$),uo(O,U),O.return=k,O)}function P(k,O,U,$){return O===null||O.tag!==4||O.stateNode.containerInfo!==U.containerInfo||O.stateNode.implementation!==U.implementation?(O=cd(U,k.mode,$),O.return=k,O):(O=h(O,U.children||[]),O.return=k,O)}function K(k,O,U,$,xe){return O===null||O.tag!==7?(O=$s(U,k.mode,$,xe),O.return=k,O):(O=h(O,U),O.return=k,O)}function J(k,O,U){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return O=ud(""+O,k.mode,U),O.return=k,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case z:return U=Hu(O.type,O.key,O.props,null,k.mode,U),uo(U,O),U.return=k,U;case Q:return O=cd(O,k.mode,U),O.return=k,O;case w:return O=ea(O),J(k,O,U)}if(qe(O)||V(O))return O=$s(O,k.mode,U,null),O.return=k,O;if(typeof O.then=="function")return J(k,$u(O),U);if(O.$$typeof===we)return J(k,Gu(k,O),U);Xu(k,O)}return null}function B(k,O,U,$){var xe=O!==null?O.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return xe!==null?null:E(k,O,""+U,$);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case z:return U.key===xe?D(k,O,U,$):null;case Q:return U.key===xe?P(k,O,U,$):null;case w:return U=ea(U),B(k,O,U,$)}if(qe(U)||V(U))return xe!==null?null:K(k,O,U,$,null);if(typeof U.then=="function")return B(k,O,$u(U),$);if(U.$$typeof===we)return B(k,O,Gu(k,U),$);Xu(k,U)}return null}function F(k,O,U,$,xe){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return k=k.get(U)||null,E(O,k,""+$,xe);if(typeof $=="object"&&$!==null){switch($.$$typeof){case z:return k=k.get($.key===null?U:$.key)||null,D(O,k,$,xe);case Q:return k=k.get($.key===null?U:$.key)||null,P(O,k,$,xe);case w:return $=ea($),F(k,O,U,$,xe)}if(qe($)||V($))return k=k.get(U)||null,K(O,k,$,xe,null);if(typeof $.then=="function")return F(k,O,U,$u($),xe);if($.$$typeof===we)return F(k,O,U,Gu(O,$),xe);Xu(O,$)}return null}function me(k,O,U,$){for(var xe=null,ot=null,pe=O,Pe=O=0,Xe=null;pe!==null&&Pe<U.length;Pe++){pe.index>Pe?(Xe=pe,pe=null):Xe=pe.sibling;var ut=B(k,pe,U[Pe],$);if(ut===null){pe===null&&(pe=Xe);break}t&&pe&&ut.alternate===null&&n(k,pe),O=d(ut,O,Pe),ot===null?xe=ut:ot.sibling=ut,ot=ut,pe=Xe}if(Pe===U.length)return a(k,pe),tt&&mr(k,Pe),xe;if(pe===null){for(;Pe<U.length;Pe++)pe=J(k,U[Pe],$),pe!==null&&(O=d(pe,O,Pe),ot===null?xe=pe:ot.sibling=pe,ot=pe);return tt&&mr(k,Pe),xe}for(pe=l(pe);Pe<U.length;Pe++)Xe=F(pe,k,Pe,U[Pe],$),Xe!==null&&(t&&Xe.alternate!==null&&pe.delete(Xe.key===null?Pe:Xe.key),O=d(Xe,O,Pe),ot===null?xe=Xe:ot.sibling=Xe,ot=Xe);return t&&pe.forEach(function(ps){return n(k,ps)}),tt&&mr(k,Pe),xe}function Ie(k,O,U,$){if(U==null)throw Error(s(151));for(var xe=null,ot=null,pe=O,Pe=O=0,Xe=null,ut=U.next();pe!==null&&!ut.done;Pe++,ut=U.next()){pe.index>Pe?(Xe=pe,pe=null):Xe=pe.sibling;var ps=B(k,pe,ut.value,$);if(ps===null){pe===null&&(pe=Xe);break}t&&pe&&ps.alternate===null&&n(k,pe),O=d(ps,O,Pe),ot===null?xe=ps:ot.sibling=ps,ot=ps,pe=Xe}if(ut.done)return a(k,pe),tt&&mr(k,Pe),xe;if(pe===null){for(;!ut.done;Pe++,ut=U.next())ut=J(k,ut.value,$),ut!==null&&(O=d(ut,O,Pe),ot===null?xe=ut:ot.sibling=ut,ot=ut);return tt&&mr(k,Pe),xe}for(pe=l(pe);!ut.done;Pe++,ut=U.next())ut=F(pe,k,Pe,ut.value,$),ut!==null&&(t&&ut.alternate!==null&&pe.delete(ut.key===null?Pe:ut.key),O=d(ut,O,Pe),ot===null?xe=ut:ot.sibling=ut,ot=ut);return t&&pe.forEach(function(Yx){return n(k,Yx)}),tt&&mr(k,Pe),xe}function Et(k,O,U,$){if(typeof U=="object"&&U!==null&&U.type===ie&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case z:e:{for(var xe=U.key;O!==null;){if(O.key===xe){if(xe=U.type,xe===ie){if(O.tag===7){a(k,O.sibling),$=h(O,U.props.children),$.return=k,k=$;break e}}else if(O.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===w&&ea(xe)===O.type){a(k,O.sibling),$=h(O,U.props),uo($,U),$.return=k,k=$;break e}a(k,O);break}else n(k,O);O=O.sibling}U.type===ie?($=$s(U.props.children,k.mode,$,U.key),$.return=k,k=$):($=Hu(U.type,U.key,U.props,null,k.mode,$),uo($,U),$.return=k,k=$)}return v(k);case Q:e:{for(xe=U.key;O!==null;){if(O.key===xe)if(O.tag===4&&O.stateNode.containerInfo===U.containerInfo&&O.stateNode.implementation===U.implementation){a(k,O.sibling),$=h(O,U.children||[]),$.return=k,k=$;break e}else{a(k,O);break}else n(k,O);O=O.sibling}$=cd(U,k.mode,$),$.return=k,k=$}return v(k);case w:return U=ea(U),Et(k,O,U,$)}if(qe(U))return me(k,O,U,$);if(V(U)){if(xe=V(U),typeof xe!="function")throw Error(s(150));return U=xe.call(U),Ie(k,O,U,$)}if(typeof U.then=="function")return Et(k,O,$u(U),$);if(U.$$typeof===we)return Et(k,O,Gu(k,U),$);Xu(k,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,O!==null&&O.tag===6?(a(k,O.sibling),$=h(O,U),$.return=k,k=$):(a(k,O),$=ud(U,k.mode,$),$.return=k,k=$),v(k)):a(k,O)}return function(k,O,U,$){try{oo=0;var xe=Et(k,O,U,$);return Qa=null,xe}catch(pe){if(pe===Ka||pe===Qu)throw pe;var ot=ni(29,pe,null,k.mode);return ot.lanes=$,ot.return=k,ot}finally{}}}var na=gp(!0),pp=gp(!1),Wr=!1;function Ed(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xd(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function es(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function ts(t,n,a){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(ht&2)!==0){var h=l.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),l.pending=n,n=Bu(t),Wg(t,null,a),n}return zu(t,l,n,a),Bu(t)}function co(t,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var l=n.lanes;l&=t.pendingLanes,a|=l,n.lanes=a,On(t,a)}}function Ad(t,n){var a=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var h=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var v={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?h=d=v:d=d.next=v,a=a.next}while(a!==null);d===null?h=d=n:d=d.next=n}else h=d=n;a={baseState:l.baseState,firstBaseUpdate:h,lastBaseUpdate:d,shared:l.shared,callbacks:l.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=n:t.next=n,a.lastBaseUpdate=n}var Sd=!1;function ho(){if(Sd){var t=Ga;if(t!==null)throw t}}function fo(t,n,a,l){Sd=!1;var h=t.updateQueue;Wr=!1;var d=h.firstBaseUpdate,v=h.lastBaseUpdate,E=h.shared.pending;if(E!==null){h.shared.pending=null;var D=E,P=D.next;D.next=null,v===null?d=P:v.next=P,v=D;var K=t.alternate;K!==null&&(K=K.updateQueue,E=K.lastBaseUpdate,E!==v&&(E===null?K.firstBaseUpdate=P:E.next=P,K.lastBaseUpdate=D))}if(d!==null){var J=h.baseState;v=0,K=P=D=null,E=d;do{var B=E.lane&-536870913,F=B!==E.lane;if(F?($e&B)===B:(l&B)===B){B!==0&&B===Fa&&(Sd=!0),K!==null&&(K=K.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var me=t,Ie=E;B=n;var Et=a;switch(Ie.tag){case 1:if(me=Ie.payload,typeof me=="function"){J=me.call(Et,J,B);break e}J=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=Ie.payload,B=typeof me=="function"?me.call(Et,J,B):me,B==null)break e;J=A({},J,B);break e;case 2:Wr=!0}}B=E.callback,B!==null&&(t.flags|=64,F&&(t.flags|=8192),F=h.callbacks,F===null?h.callbacks=[B]:F.push(B))}else F={lane:B,tag:E.tag,payload:E.payload,callback:E.callback,next:null},K===null?(P=K=F,D=J):K=K.next=F,v|=B;if(E=E.next,E===null){if(E=h.shared.pending,E===null)break;F=E,E=F.next,F.next=null,h.lastBaseUpdate=F,h.shared.pending=null}}while(!0);K===null&&(D=J),h.baseState=D,h.firstBaseUpdate=P,h.lastBaseUpdate=K,d===null&&(h.shared.lanes=0),as|=v,t.lanes=v,t.memoizedState=J}}function yp(t,n){if(typeof t!="function")throw Error(s(191,t));t.call(n)}function vp(t,n){var a=t.callbacks;
vendor: 4,465 bytes, line 48
48if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)yp(a[t],n)}var Ya=M(null),Ju=M(0);function _p(t,n){t=Sr,ne(Ju,t),ne(Ya,n),Sr=t|n.baseLanes}function wd(){ne(Ju,Sr),ne(Ya,Ya.current)}function Nd(){Sr=Ju.current,Y(Ya),Y(Ju)}var ii=M(null),_i=null;function ns(t){var n=t.alternate;ne(Bt,Bt.current&1),ne(ii,t),_i===null&&(n===null||Ya.current!==null||n.memoizedState!==null)&&(_i=t)}function Id(t){ne(Bt,Bt.current),ne(ii,t),_i===null&&(_i=t)}function bp(t){t.tag===22?(ne(Bt,Bt.current),ne(ii,t),_i===null&&(_i=t)):is()}function is(){ne(Bt,Bt.current),ne(ii,ii.current)}function ri(t){Y(ii),_i===t&&(_i=null),Y(Bt)}var Bt=M(0);function Zu(t){for(var n=t;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Vf(a)||kf(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var yr=0,Ue=null,bt=null,$t=null,Wu=!1,$a=!1,ia=!1,ec=0,mo=0,Xa=null,UE=0;function kt(){throw Error(s(321))}function Rd(t,n){if(n===null)return!1;for(var a=0;a<n.length&&a<t.length;a++)if(!ti(t[a],n[a]))return!1;return!0}function Cd(t,n,a,l,h,d){return yr=d,Ue=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,G.H=t===null||t.memoizedState===null?iy:Gd,ia=!1,d=a(l,h),ia=!1,$a&&(d=Ep(n,a,l,h)),Tp(t),d}function Tp(t){G.H=yo;var n=bt!==null&&bt.next!==null;if(yr=0,$t=bt=Ue=null,Wu=!1,mo=0,Xa=null,n)throw Error(s(300));t===null||Xt||(t=t.dependencies,t!==null&&Fu(t)&&(Xt=!0))}function Ep(t,n,a,l){Ue=t;var h=0;do{if($a&&(Xa=null),mo=0,$a=!1,25<=h)throw Error(s(301));if(h+=1,$t=bt=null,t.updateQueue!=null){var d=t.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}G.H=ry,d=n(a,l)}while($a);return d}function PE(){var t=G.H,n=t.useState()[0];return n=typeof n.then=="function"?go(n):n,t=t.useState()[0],(bt!==null?bt.memoizedState:null)!==t&&(Ue.flags|=1024),n}function Dd(){var t=ec!==0;return ec=0,t}function Md(t,n,a){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~a}function Od(t){if(Wu){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Wu=!1}yr=0,$t=bt=Ue=null,$a=!1,mo=ec=0,Xa=null}function Ln(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $t===null?Ue.memoizedState=$t=t:$t=$t.next=t,$t}function Ht(){if(bt===null){var t=Ue.alternate;t=t!==null?t.memoizedState:null}else t=bt.next;var n=$t===null?Ue.memoizedState:$t.next;if(n!==null)$t=n,bt=t;else{if(t===null)throw Ue.alternate===null?Error(s(467)):Error(s(310));bt=t,t={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},$t===null?Ue.memoizedState=$t=t:$t=$t.next=t}return $t}function tc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function go(t){var n=mo;return mo+=1,Xa===null&&(Xa=[]),t=dp(Xa,t,n),n=Ue,($t===null?n.memoizedState:$t.next)===null&&(n=n.alternate,G.H=n===null||n.memoizedState===null?iy:Gd),t}function nc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return go(t);if(t.$$typeof===we)return yn(t)}throw Error(s(438,String(t)))}function jd(t){var n=null,a=Ue.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var l=Ue.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(n={data:l.data.map(function(h){return h.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=tc(),Ue.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(t),l=0;l<t;l++)a[l]=j;return n.index++,a}function vr(t,n){return typeof n=="function"?n(t):n}function ic(t){var n=Ht();return Vd(n,bt,t)}function Vd(t,n,a){var l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=a;var h=t.baseQueue,d=l.pending;if(d!==null){if(h!==null){var v=h.next;h.next=d.next,d.next=v}n.baseQueue=h=d,l.pending=null}if(d=t.baseState,h===null)t.memoizedState=d;else{n=h.next;var E=v=null,D=null,P=n,K=!1;do{var J=P.lane&-536870913;if(J!==P.lane?($e&J)===J:(yr&J)===J){var B=P.revertLane;if(B===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}
vendor: 12,257 bytes, line 48
48),J===Fa&&(K=!0);else if((yr&B)===B){P=P.next,B===Fa&&(K=!0);continue}else J={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},D===null?(E=D=J,v=d):D=D.next=J,Ue.lanes|=B,as|=B;J=P.action,ia&&a(d,J),d=P.hasEagerState?P.eagerState:a(d,J)}else B={lane:J,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},D===null?(E=D=B,v=d):D=D.next=B,Ue.lanes|=J,as|=J;P=P.next}while(P!==null&&P!==n);if(D===null?v=d:D.next=E,!ti(d,t.memoizedState)&&(Xt=!0,K&&(a=Ga,a!==null)))throw a;t.memoizedState=d,t.baseState=v,t.baseQueue=D,l.lastRenderedState=d}return h===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function kd(t){var n=Ht(),a=n.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var l=a.dispatch,h=a.pending,d=n.memoizedState;if(h!==null){a.pending=null;var v=h=h.next;do d=t(d,v.action),v=v.next;while(v!==h);ti(d,n.memoizedState)||(Xt=!0),n.memoizedState=d,n.baseQueue===null&&(n.baseState=d),a.lastRenderedState=d}return[d,l]}function xp(t,n,a){var l=Ue,h=Ht(),d=tt;if(d){if(a===void 0)throw Error(s(407));a=a()}else a=n();var v=!ti((bt||h).memoizedState,a);if(v&&(h.memoizedState=a,Xt=!0),h=h.queue,Pd(wp.bind(null,l,h,t),[t]),h.getSnapshot!==n||v||$t!==null&&$t.memoizedState.tag&1){if(l.flags|=2048,Ja(9,{destroy:void 0},Sp.bind(null,l,h,a,n),null),At===null)throw Error(s(349));d||(yr&127)!==0||Ap(l,n,a)}return a}function Ap(t,n,a){t.flags|=16384,t={getSnapshot:n,value:a},n=Ue.updateQueue,n===null?(n=tc(),Ue.updateQueue=n,n.stores=[t]):(a=n.stores,a===null?n.stores=[t]:a.push(t))}function Sp(t,n,a,l){n.value=a,n.getSnapshot=l,Np(n)&&Ip(t)}function wp(t,n,a){return a(function(){Np(n)&&Ip(t)})}function Np(t){var n=t.getSnapshot;t=t.value;try{var a=n();return!ti(t,a)}catch{return!0}}function Ip(t){var n=Ys(t,2);n!==null&&Qn(n,t,2)}function Ld(t){var n=Ln();if(typeof t=="function"){var a=t;if(t=a(),ia){Mn(!0);try{a()}finally{Mn(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vr,lastRenderedState:t},n}function Rp(t,n,a,l){return t.baseState=a,Vd(t,bt,typeof l=="function"?l:vr)}function zE(t,n,a,l,h){if(ac(t))throw Error(s(485));if(t=n.action,t!==null){var d={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){d.listeners.push(v)}};G.T!==null?a(!0):d.isTransition=!1,l(d),a=n.pending,a===null?(d.next=n.pending=d,Cp(n,d)):(d.next=a.next,n.pending=a.next=d)}}function Cp(t,n){var a=n.action,l=n.payload,h=t.state;if(n.isTransition){var d=G.T,v={};G.T=v;try{var E=a(h,l),D=G.S;D!==null&&D(v,E),Dp(t,n,E)}catch(P){Ud(t,n,P)}finally{d!==null&&v.types!==null&&(d.types=v.types),G.T=d}}else try{d=a(h,l),Dp(t,n,d)}catch(P){Ud(t,n,P)}}function Dp(t,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){Mp(t,n,l)},function(l){return Ud(t,n,l)}):Mp(t,n,a)}function Mp(t,n,a){n.status="fulfilled",n.value=a,Op(n),t.state=a,n=t.pending,n!==null&&(a=n.next,a===n?t.pending=null:(a=a.next,n.next=a,Cp(t,a)))}function Ud(t,n,a){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do n.status="rejected",n.reason=a,Op(n),n=n.next;while(n!==l)}t.action=null}function Op(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function jp(t,n){return n}function Vp(t,n){if(tt){var a=At.formState;if(a!==null){e:{var l=Ue;if(tt){if(Nt){t:{for(var h=Nt,d=vi;h.nodeType!==8;){if(!d){h=null;break t}if(h=bi(h.nextSibling),h===null){h=null;break t}}d=h.data,h=d==="F!"||d==="F"?h:null}if(h){Nt=bi(h.nextSibling),l=h.data==="F!";break e}}Jr(l)}l=!1}l&&(n=a[0])}}return a=Ln(),a.memoizedState=a.baseState=n,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jp,lastRenderedState:n},a.queue=l,a=ey.bind(null,Ue,l),l.dispatch=a,l=Ld(!1),d=Fd.bind(null,Ue,!1,l.queue),l=Ln(),h={state:n,dispatch:null,action:t,pending:null},l.queue=h,a=zE.bind(null,Ue,h,d,a),h.dispatch=a,l.memoizedState=t,[n,a,!1]}function kp(t){var n=Ht();return Lp(n,bt,t)}function Lp(t,n,a){if(n=Vd(t,n,jp)[0],t=ic(vr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var l=go(n)}catch(v){throw v===Ka?Qu:v}else l=n;n=Ht();var h=n.queue,d=h.dispatch;return a!==n.memoizedState&&(Ue.flags|=2048,Ja(9,{destroy:void 0},BE.bind(null,h,a),null)),[l,d,t]}function BE(t,n){t.action=n}function Up(t){var n=Ht(),a=bt;if(a!==null)return Lp(n,a,t);Ht(),n=n.memoizedState,a=Ht();var l=a.queue.dispatch;return a.memoizedState=t,[n,l,!1]}function Ja(t,n,a,l){return t={tag:t,create:a,deps:l,inst:n,next:null},n=Ue.updateQueue,n===null&&(n=tc(),Ue.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=t.next=t:(l=a.next,a.next=t,t.next=l,n.lastEffect=t),t}function Pp(){return Ht().memoizedState}function rc(t,n,a,l){var h=Ln();Ue.flags|=t,h.memoizedState=Ja(1|n,{destroy:void 0},a,l===void 0?null:l)}function sc(t,n,a,l){var h=Ht();l=l===void 0?null:l;var d=h.memoizedState.inst;bt!==null&&l!==null&&Rd(l,bt.memoizedState.deps)?h.memoizedState=Ja(n,d,a,l):(Ue.flags|=t,h.memoizedState=Ja(1|n,d,a,l))}function zp(t,n){rc(8390656,8,t,n)}function Pd(t,n){sc(2048,8,t,n)}function HE(t){Ue.flags|=4;var n=Ue.updateQueue;if(n===null)n=tc(),Ue.updateQueue=n,n.events=[t];else{var a=n.events;a===null?n.events=[t]:a.push(t)}}function Bp(t){var n=Ht().memoizedState;return HE({ref:n,nextImpl:t}),function(){if((ht&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}function Hp(t,n){return sc(4,2,t,n)}function qp(t,n){return sc(4,4,t,n)}function Fp(t,n){if(typeof n=="function"){t=t();var a=n(t);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function Gp(t,n,a){a=a!=null?a.concat([t]):null,sc(4,4,Fp.bind(null,n,t),a)}function zd(){}function Kp(t,n){var a=Ht();n=n===void 0?null:n;var l=a.memoizedState;return n!==null&&Rd(n,l[1])?l[0]:(a.memoizedState=[t,n],t)}function Qp(t,n){var a=Ht();n=n===void 0?null:n;var l=a.memoizedState;if(n!==null&&Rd(n,l[1]))return l[0];if(l=t(),ia){Mn(!0);try{t()}finally{Mn(!1)}}return a.memoizedState=[l,n],l}function Bd(t,n,a){return a===void 0||(yr&1073741824)!==0&&($e&261930)===0?t.memoizedState=n:(t.memoizedState=a,t=Yy(),Ue.lanes|=t,as|=t,a)}function Yp(t,n,a,l){return ti(a,n)?a:Ya.current!==null?(t=Bd(t,a,l),ti(t,n)||(Xt=!0),t):(yr&42)===0||(yr&1073741824)!==0&&($e&261930)===0?(Xt=!0,t.memoizedState=a):(t=Yy(),Ue.lanes|=t,as|=t,n)}function $p(t,n,a,l,h){var d=re.p;re.p=d!==0&&8>d?d:8;var v=G.T,E={};G.T=E,Fd(t,!1,n,a);try{var D=h(),P=G.S;if(P!==null&&P(E,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var K=LE(D,l);po(t,n,K,li(t))}else po(t,n,l,li(t))}catch(J){po(t,n,{then:function(){},status:"rejected",reason:J},li())}finally{re.p=d,v!==null&&E.types!==null&&(v.types=E.types),G.T=v}}function qE(){}function Hd(t,n,a,l){if(t.tag!==5)throw Error(s(476));var h=Xp(t).queue;$p(t,h,n,fe,a===null?qE:function(){return Jp(t),a(l)})}function Xp(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vr,lastRenderedState:fe},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vr,lastRenderedState:a},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Jp(t){var n=Xp(t);n.next===null&&(n=t.alternate.memoizedState),po(t,n.next.queue,{},li())}function qd(){return yn(Oo)}function Zp(){return Ht().memoizedState}function Wp(){return Ht().memoizedState}function FE(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var a=li();t=es(a);var l=ts(n,t,a);l!==null&&(Qn(l,n,a),co(l,n,a)),n={cache:vd()},t.payload=n;return}n=n.return}}function GE(t,n,a){var l=li();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ac(t)?ty(n,a):(a=ld(t,n,a,l),a!==null&&(Qn(a,t,l),ny(a,n,l)))}function ey(t,n,a){var l=li();po(t,n,a,l)}function po(t,n,a,l){var h={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(ac(t))ty(n,h);else{var d=t.alternate;if(t.lanes===0&&(d===null||d.lanes===0)&&(d=n.lastRenderedReducer,d!==null))try{var v=n.lastRenderedState,E=d(v,a);if(h.hasEagerState=!0,h.eagerState=E,ti(E,v))return zu(t,n,h,0),At===null&&Pu(),!1}catch{}finally{}if(a=ld(t,n,h,l),a!==null)return Qn(a,t,l),ny(a,n,l),!0}return!1}function Fd(t,n,a,l){if(l={lane:2,revertLane:xf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ac(t)){if(n)throw Error(s(479))}else n=ld(t,a,l,2),n!==null&&Qn(n,t,2)}function ac(t){var n=t.alternate;return t===Ue||n!==null&&n===Ue}function ty(t,n){$a=Wu=!0;var a=t.pending;a===null?n.next=n:(n.next=a.next,a.next=n),t.pending=n}function ny(t,n,a){if((a&4194048)!==0){var l=n.lanes;l&=t.pendingLanes,a|=l,n.lanes=a,On(t,a)}}var yo={readContext:yn,use:nc,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useLayoutEffect:kt,useInsertionEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useSyncExternalStore:kt,useId:kt,useHostTransitionStatus:kt,useFormState:kt,useActionState:kt,useOptimistic:kt,useMemoCache:kt,useCacheRefresh:kt};yo.useEffectEvent=kt;var iy={readContext:yn,use:nc,useCallback:function(t,n){return Ln().memoizedState=[t,n===void 0?null:n],t},useContext:yn,useEffect:zp,useImperativeHandle:function(t,n,a){a=a!=null?a.concat([t]):null,rc(4194308,4,Fp.bind(null,n,t),a)},useLayoutEffect:function(t,n){return rc(4194308,4,t,n)},useInsertionEffect:function(t,n){rc(4,2,t,n)},useMemo:function(t,n){var a=Ln();n=n===void 0?null:n;var l=t();if(ia){Mn(!0);try{t()}finally{Mn(!1)}}return a.memoizedState=[l,n],l},useReducer:function(t,n,a){var l=Ln();if(a!==void 0){var h=a(n);if(ia){Mn(!0);try{a(n)}finally{Mn(!1)}}}else h=n;return l.memoizedState=l.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},l.queue=t,t=t.dispatch=GE.bind(null,Ue,t),[l.memoizedState,t]},useRef:function(t){var n=Ln();return t={current:t},n.memoizedState=t},useState:function(t){t=Ld(t);var n=t.queue,a=ey.bind(null,Ue,n);return n.dispatch=a,[t.memoizedState,a]},useDebugValue:zd,useDeferredValue:function(t,n){var a=Ln();return Bd(a,t,n)},useTransition:function(){var t=Ld(!1);return t=$p.bind(null,Ue,t.queue,!0,!1),Ln().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,a){var l=Ue,h=Ln();if(tt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=n(),At===null)throw Error(s(349));($e&127)!==0||Ap(l,n,a)}h.memoizedState=a;var d={value:a,getSnapshot:n};return h.queue=d,zp(wp.bind(null,l,d,t),[t]),l.flags|=2048,Ja(9,{destroy:void 0},Sp.bind(null,l,d,a,n),null),a},useId:function(){var t=Ln(),n=At.identifierPrefix;if(tt){var a=er,l=Wi;a=(l&~(1<<32-te(l)-1)).toString(32)+a,n="_"+n+"R_"+a,a=ec++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=UE++,n="_"+n+"r_"+a.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:qd,useFormState:Vp,useActionState:Vp,useOptimistic:function(t){var n=Ln();n.memoizedState=n.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Fd.bind(null,Ue,!0,a),a.dispatch=n,[t,n]},useMemoCache:jd,useCacheRefresh:function(){return Ln().memoizedState=FE.bind(null,Ue)},useEffectEvent:function(t){var n=Ln(),a={impl:t};return n.memoizedState=a,function(){if((ht&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},Gd={readContext:yn,use:nc,useCallback:Kp,useContext:yn,useEffect:Pd,useImperativeHandle:Gp,useInsertionEffect:Hp,useLayoutEffect:qp,useMemo:Qp,useReducer:ic,useRef:Pp,useState:function(){return ic(vr)},useDebugValue:zd,useDeferredValue:function(t,n){var a=Ht();return Yp(a,bt.memoizedState,t,n)},useTransition:function(){var t=ic(vr)[0],n=Ht().memoizedState;return[typeof t=="boolean"?t:go(t),n]},useSyncExternalStore:xp,useId:Zp,useHostTransitionStatus:qd,useFormState:kp,useActionState:kp,useOptimistic:function(t,n){var a=Ht();return Rp(a,bt,t,n)},useMemoCache:jd,useCacheRefresh:Wp};Gd.useEffectEvent=Bp;var ry={readContext:yn,use:nc,useCallback:Kp,useContext:yn,useEffect:Pd,useImperativeHandle:Gp,useInsertionEffect:Hp,useLayoutEffect:qp,useMemo:Qp,useReducer:kd,useRef
vendor: 6,274 bytes, line 48
48:Pp,useState:function(){return kd(vr)},useDebugValue:zd,useDeferredValue:function(t,n){var a=Ht();return bt===null?Bd(a,t,n):Yp(a,bt.memoizedState,t,n)},useTransition:function(){var t=kd(vr)[0],n=Ht().memoizedState;return[typeof t=="boolean"?t:go(t),n]},useSyncExternalStore:xp,useId:Zp,useHostTransitionStatus:qd,useFormState:Up,useActionState:Up,useOptimistic:function(t,n){var a=Ht();return bt!==null?Rp(a,bt,t,n):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:jd,useCacheRefresh:Wp};ry.useEffectEvent=Bp;function Kd(t,n,a,l){n=t.memoizedState,a=a(l,n),a=a==null?n:A({},n,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Qd={enqueueSetState:function(t,n,a){t=t._reactInternals;var l=li(),h=es(l);h.payload=n,a!=null&&(h.callback=a),n=ts(t,h,l),n!==null&&(Qn(n,t,l),co(n,t,l))},enqueueReplaceState:function(t,n,a){t=t._reactInternals;var l=li(),h=es(l);h.tag=1,h.payload=n,a!=null&&(h.callback=a),n=ts(t,h,l),n!==null&&(Qn(n,t,l),co(n,t,l))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var a=li(),l=es(a);l.tag=2,n!=null&&(l.callback=n),n=ts(t,l,a),n!==null&&(Qn(n,t,a),co(n,t,a))}};function sy(t,n,a,l,h,d,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,d,v):n.prototype&&n.prototype.isPureReactComponent?!no(a,l)||!no(h,d):!0}function ay(t,n,a,l){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,l),n.state!==t&&Qd.enqueueReplaceState(n,n.state,null)}function ra(t,n){var a=n;if("ref"in n){a={};for(var l in n)l!=="ref"&&(a[l]=n[l])}if(t=t.defaultProps){a===n&&(a=A({},a));for(var h in t)a[h]===void 0&&(a[h]=t[h])}return a}function ly(t){Uu(t)}function oy(t){console.error(t)}function uy(t){Uu(t)}function lc(t,n){try{var a=t.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(l){setTimeout(function(){throw l})}}function cy(t,n,a){try{var l=t.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Yd(t,n,a){return a=es(a),a.tag=3,a.payload={element:null},a.callback=function(){lc(t,n)},a}function hy(t){return t=es(t),t.tag=3,t}function dy(t,n,a,l){var h=a.type.getDerivedStateFromError;if(typeof h=="function"){var d=l.value;t.payload=function(){return h(d)},t.callback=function(){cy(n,a,l)}}var v=a.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){cy(n,a,l),typeof h!="function"&&(ls===null?ls=new Set([this]):ls.add(this));var E=l.stack;this.componentDidCatch(l.value,{componentStack:E!==null?E:""})})}function KE(t,n,a,l,h){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(n=a.alternate,n!==null&&qa(n,a,h,!0),a=ii.current,a!==null){switch(a.tag){case 31:case 13:return _i===null?_c():a.alternate===null&&Lt===0&&(Lt=3),a.flags&=-257,a.flags|=65536,a.lanes=h,l===Yu?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([l]):n.add(l),bf(t,l,h)),!1;case 22:return a.flags|=65536,l===Yu?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([l]):a.add(l)),bf(t,l,h)),!1}throw Error(s(435,a.tag))}return bf(t,l,h),_c(),!1}if(tt)return n=ii.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=h,l!==fd&&(t=Error(s(422),{cause:l}),so(gi(t,a)))):(l!==fd&&(n=Error(s(423),{cause:l}),so(gi(n,a))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,l=gi(l,a),h=Yd(t.stateNode,l,h),Ad(t,h),Lt!==4&&(Lt=2)),!1;var d=Error(s(520),{cause:l});if(d=gi(d,a),So===null?So=[d]:So.push(d),Lt!==4&&(Lt=2),n===null)return!0;l=gi(l,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,t=h&-h,a.lanes|=t,t=Yd(a.stateNode,l,t),Ad(a,t),!1;case 1:if(n=a.type,d=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(ls===null||!ls.has(d))))return a.flags|=65536,h&=-h,a.lanes|=h,h=hy(h),dy(h,t,a,l),Ad(a,h),!1}a=a.return}while(a!==null);return!1}var $d=Error(s(461)),Xt=!1;function vn(t,n,a,l){n.child=t===null?pp(n,null,a,l):na(n,t.child,a,l)}function fy(t,n,a,l,h){a=a.render;var d=n.ref;if("ref"in l){var v={};for(var E in l)E!=="ref"&&(v[E]=l[E])}else v=l;return Zs(n),l=Cd(t,n,a,v,d,h),E=Dd(),t!==null&&!Xt?(Md(t,n,h),_r(t,n,h)):(tt&&E&&hd(n),n.flags|=1,vn(t,n,l,h),n.child)}function my(t,n,a,l,h){if(t===null){var d=a.type;return typeof d=="function"&&!od(d)&&d.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=d,gy(t,n,d,l,h)):(t=Hu(a.type,null,l,n,n.mode,h),t.ref=n.ref,t.return=n,n.child=t)}if(d=t.child,!rf(t,h)){var v=d.memoizedProps;if(a=a.compare,a=a!==null?a:no,a(v,l)&&t.ref===n.ref)return _r(t,n,h)}return n.flags|=1,t=fr(d,l),t.ref=n.ref,t.return=n,n.child=t}function gy(t,n,a,l,h){if(t!==null){var d=t.memoizedProps;if(no(d,l)&&t.ref===n.ref)if(Xt=!1,n.pendingProps=l=d,rf(t,h))(t.flags&131072)!==0&&(Xt=!0);else return n.lanes=t.lanes,_r(t,n,h)}return Xd(t,n,a,l,h)}function py(t,n,a,l){var h=l.children,d=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((n.flags&128)!==0){if(d=d!==null?d.baseLanes|a:a,t!==null){for(l=n.child=t.child,h=0;l!==null;)h=h|l.lanes|l.childLanes,l=l.sibling;l=h&~d}else l=0,n.child=null;return yy(t,n,d,a,l)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ku(n,d!==null?d.cachePool:null),d!==null?_p(n,d):wd(),bp(n);else return l=n.lanes=536870912,yy(t,n,d!==null?d.baseLanes|a:a,a,l)}else d!==null?(Ku(n,d.cachePool),_p(n,d),is(),n.memoizedState=null):(t!==null&&Ku(n,null),wd(),is());return vn(t,n,h,a),n.child}function vo(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function yy(t,n,a,l,h){var d=bd();return d=d===null?null:{parent:Yt._currentValue,pool:d},n.memoizedState={baseLanes:a,cachePool:d},t!==null&&Ku(n,null),wd(),bp(n),t!==null&&qa(t,n,l,!0),n.childLanes=h,null}function oc(t,n){return n=cc({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}
vendor: 4,161 bytes, line 48
48function vy(t,n,a){return na(n,t.child,null,a),t=oc(n,n.pendingProps),t.flags|=2,ri(n),n.memoizedState=null,t}function QE(t,n,a){var l=n.pendingProps,h=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(tt){if(l.mode==="hidden")return t=oc(n,l),n.lanes=536870912,vo(null,t);if(Id(n),(t=Nt)?(t=C0(t,vi),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:$r!==null?{id:Wi,overflow:er}:null,retryLane:536870912,hydrationErrors:null},a=tp(t),a.return=n,n.child=a,pn=n,Nt=null)):t=null,t===null)throw Jr(n);return n.lanes=536870912,null}return oc(n,l)}var d=t.memoizedState;if(d!==null){var v=d.dehydrated;if(Id(n),h)if(n.flags&256)n.flags&=-257,n=vy(t,n,a);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(s(558));else if(Xt||qa(t,n,a,!1),h=(a&t.childLanes)!==0,Xt||h){if(l=At,l!==null&&(v=vt(l,a),v!==0&&v!==d.retryLane))throw d.retryLane=v,Ys(t,v),Qn(l,t,v),$d;_c(),n=vy(t,n,a)}else t=d.treeContext,Nt=bi(v.nextSibling),pn=n,tt=!0,Xr=null,vi=!1,t!==null&&rp(n,t),n=oc(n,l),n.flags|=4096;return n}return t=fr(t.child,{mode:l.mode,children:l.children}),t.ref=n.ref,n.child=t,t.return=n,t}function uc(t,n){var a=n.ref;if(a===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(n.flags|=4194816)}}function Xd(t,n,a,l,h){return Zs(n),a=Cd(t,n,a,l,void 0,h),l=Dd(),t!==null&&!Xt?(Md(t,n,h),_r(t,n,h)):(tt&&l&&hd(n),n.flags|=1,vn(t,n,a,h),n.child)}function _y(t,n,a,l,h,d){return Zs(n),n.updateQueue=null,a=Ep(n,l,a,h),Tp(t),l=Dd(),t!==null&&!Xt?(Md(t,n,d),_r(t,n,d)):(tt&&l&&hd(n),n.flags|=1,vn(t,n,a,d),n.child)}function by(t,n,a,l,h){if(Zs(n),n.stateNode===null){var d=Pa,v=a.contextType;typeof v=="object"&&v!==null&&(d=yn(v)),d=new a(l,d),n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Qd,n.stateNode=d,d._reactInternals=n,d=n.stateNode,d.props=l,d.state=n.memoizedState,d.refs={},Ed(n),v=a.contextType,d.context=typeof v=="object"&&v!==null?yn(v):Pa,d.state=n.memoizedState,v=a.getDerivedStateFromProps,typeof v=="function"&&(Kd(n,a,v,l),d.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(v=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),v!==d.state&&Qd.enqueueReplaceState(d,d.state,null),fo(n,l,d,h),ho(),d.state=n.memoizedState),typeof d.componentDidMount=="function"&&(n.flags|=4194308),l=!0}else if(t===null){d=n.stateNode;var E=n.memoizedProps,D=ra(a,E);d.props=D;var P=d.context,K=a.contextType;v=Pa,typeof K=="object"&&K!==null&&(v=yn(K));var J=a.getDerivedStateFromProps;K=typeof J=="function"||typeof d.getSnapshotBeforeUpdate=="function",E=n.pendingProps!==E,K||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(E||P!==v)&&ay(n,d,l,v),Wr=!1;var B=n.memoizedState;d.state=B,fo(n,l,d,h),ho(),P=n.memoizedState,E||B!==P||Wr?(typeof J=="function"&&(Kd(n,a,J,l),P=n.memoizedState),(D=Wr||sy(n,a,D,l,B,P,v))?(K||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(n.flags|=4194308)):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=P),d.props=l,d.state=P,d.context=v,l=D):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{d=n.stateNode,xd(t,n),v=n.memoizedProps,K=ra(a,v),d.props=K,J=n.pendingProps,B=d.context,P=a.contextType,D=Pa,typeof P=="object"&&P!==null&&(D=yn(P)),E=a.getDerivedStateFromProps,(P=typeof E=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(v!==J||B!==D)&&ay(n,d,l,D),Wr=!1,B=n.memoizedState,d.state=B,fo(n,l,d,h),ho();var F=n.memoizedState;
vendor: 8,848 bytes, line 48
48v!==J||B!==F||Wr||t!==null&&t.dependencies!==null&&Fu(t.dependencies)?(typeof E=="function"&&(Kd(n,a,E,l),F=n.memoizedState),(K=Wr||sy(n,a,K,l,B,F,D)||t!==null&&t.dependencies!==null&&Fu(t.dependencies))?(P||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(l,F,D),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(l,F,D)),typeof d.componentDidUpdate=="function"&&(n.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof d.componentDidUpdate!="function"||v===t.memoizedProps&&B===t.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&B===t.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=F),d.props=l,d.state=F,d.context=D,l=K):(typeof d.componentDidUpdate!="function"||v===t.memoizedProps&&B===t.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&B===t.memoizedState||(n.flags|=1024),l=!1)}return d=l,uc(t,n),l=(n.flags&128)!==0,d||l?(d=n.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:d.render(),n.flags|=1,t!==null&&l?(n.child=na(n,t.child,null,h),n.child=na(n,null,a,h)):vn(t,n,a,h),n.memoizedState=d.state,t=n.child):t=_r(t,n,h),t}function Ty(t,n,a,l){return Xs(),n.flags|=256,vn(t,n,a,l),n.child}var Jd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zd(t){return{baseLanes:t,cachePool:cp()}}function Wd(t,n,a){return t=t!==null?t.childLanes&~a:0,n&&(t|=ai),t}function Ey(t,n,a){var l=n.pendingProps,h=!1,d=(n.flags&128)!==0,v;if((v=d)||(v=t!==null&&t.memoizedState===null?!1:(Bt.current&2)!==0),v&&(h=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,t===null){if(tt){if(h?ns(n):is(),(t=Nt)?(t=C0(t,vi),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:$r!==null?{id:Wi,overflow:er}:null,retryLane:536870912,hydrationErrors:null},a=tp(t),a.return=n,n.child=a,pn=n,Nt=null)):t=null,t===null)throw Jr(n);return kf(t)?n.lanes=32:n.lanes=536870912,null}var E=l.children;return l=l.fallback,h?(is(),h=n.mode,E=cc({mode:"hidden",children:E},h),l=$s(l,h,a,null),E.return=n,l.return=n,E.sibling=l,n.child=E,l=n.child,l.memoizedState=Zd(a),l.childLanes=Wd(t,v,a),n.memoizedState=Jd,vo(null,l)):(ns(n),ef(n,E))}var D=t.memoizedState;if(D!==null&&(E=D.dehydrated,E!==null)){if(d)n.flags&256?(ns(n),n.flags&=-257,n=tf(t,n,a)):n.memoizedState!==null?(is(),n.child=t.child,n.flags|=128,n=null):(is(),E=l.fallback,h=n.mode,l=cc({mode:"visible",children:l.children},h),E=$s(E,h,a,null),E.flags|=2,l.return=n,E.return=n,l.sibling=E,n.child=l,na(n,t.child,null,a),l=n.child,l.memoizedState=Zd(a),l.childLanes=Wd(t,v,a),n.memoizedState=Jd,n=vo(null,l));else if(ns(n),kf(E)){if(v=E.nextSibling&&E.nextSibling.dataset,v)var P=v.dgst;v=P,l=Error(s(419)),l.stack="",l.digest=v,so({value:l,source:null,stack:null}),n=tf(t,n,a)}else if(Xt||qa(t,n,a,!1),v=(a&t.childLanes)!==0,Xt||v){if(v=At,v!==null&&(l=vt(v,a),l!==0&&l!==D.retryLane))throw D.retryLane=l,Ys(t,l),Qn(v,t,l),$d;Vf(E)||_c(),n=tf(t,n,a)}else Vf(E)?(n.flags|=192,n.child=t.child,n=null):(t=D.treeContext,Nt=bi(E.nextSibling),pn=n,tt=!0,Xr=null,vi=!1,t!==null&&rp(n,t),n=ef(n,l.children),n.flags|=4096);return n}return h?(is(),E=l.fallback,h=n.mode,D=t.child,P=D.sibling,l=fr(D,{mode:"hidden",children:l.children}),l.subtreeFlags=D.subtreeFlags&65011712,P!==null?E=fr(P,E):(E=$s(E,h,a,null),E.flags|=2),E.return=n,l.return=n,l.sibling=E,n.child=l,vo(null,l),l=n.child,E=t.child.memoizedState,E===null?E=Zd(a):(h=E.cachePool,h!==null?(D=Yt._currentValue,h=h.parent!==D?{parent:D,pool:D}:h):h=cp(),E={baseLanes:E.baseLanes|a,cachePool:h}),l.memoizedState=E,l.childLanes=Wd(t,v,a),n.memoizedState=Jd,vo(t.child,l)):(ns(n),a=t.child,t=a.sibling,a=fr(a,{mode:"visible",children:l.children}),a.return=n,a.sibling=null,t!==null&&(v=n.deletions,v===null?(n.deletions=[t],n.flags|=16):v.push(t)),n.child=a,n.memoizedState=null,a)}function ef(t,n){return n=cc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function cc(t,n){return t=ni(22,t,null,n),t.lanes=0,t}function tf(t,n,a){return na(n,t.child,null,a),t=ef(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function xy(t,n,a){t.lanes|=n;var l=t.alternate;l!==null&&(l.lanes|=n),pd(t.return,n,a)}function nf(t,n,a,l,h,d){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:h,treeForkCount:d}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=l,v.tail=a,v.tailMode=h,v.treeForkCount=d)}function Ay(t,n,a){var l=n.pendingProps,h=l.revealOrder,d=l.tail;l=l.children;var v=Bt.current,E=(v&2)!==0;if(E?(v=v&1|2,n.flags|=128):v&=1,ne(Bt,v),vn(t,n,l,a),l=tt?ro:0,!E&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&xy(t,a,n);else if(t.tag===19)xy(t,a,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(h){case"forwards":for(a=n.child,h=null;a!==null;)t=a.alternate,t!==null&&Zu(t)===null&&(h=a),a=a.sibling;a=h,a===null?(h=n.child,n.child=null):(h=a.sibling,a.sibling=null),nf(n,!1,h,a,d,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,h=n.child,n.child=null;h!==null;){if(t=h.alternate,t!==null&&Zu(t)===null){n.child=h;break}t=h.sibling,h.sibling=a,a=h,h=t}nf(n,!0,a,null,d,l);break;case"together":nf(n,!1,null,null,void 0,l);break;default:n.memoizedState=null}return n.child}function _r(t,n,a){if(t!==null&&(n.dependencies=t.dependencies),as|=n.lanes,(a&n.childLanes)===0)if(t!==null){if(qa(t,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(s(153));if(n.child!==null){for(t=n.child,a=fr(t,t.pendingProps),n.child=a,a.return=n;t.sibling!==null;)t=t.sibling,a=a.sibling=fr(t,t.pendingProps),a.return=n;a.sibling=null}return n.child}function rf(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&Fu(t)))}function YE(t,n,a){switch(n.tag){case 3:Ee(n,n.stateNode.containerInfo),Zr(n,Yt,t.memoizedState.cache),Xs();break;case 27:case 5:Fe(n);break;case 4:Ee(n,n.stateNode.containerInfo);break;case 10:Zr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Id(n),null;break;case 13:var l=n.memoizedState;if(l!==null)return l.dehydrated!==null?(ns(n),n.flags|=128,null):(a&n.child.childLanes)!==0?Ey(t,n,a):(ns(n),t=_r(t,n,a),t!==null?t.sibling:null);ns(n);break;case 19:var h=(t.flags&128)!==0;if(l=(a&n.childLanes)!==0,l||(qa(t,n,a,!1),l=(a&n.childLanes)!==0),h){if(l)return Ay(t,n,a);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),ne(Bt,Bt.current),l)break;return null;case 22:return n.lanes=0,py(t,n,a,n.pendingProps);case 24:Zr(n,Yt,t.memoizedState.cache)}return _r(t,n,a)}function Sy(t,n,a){if(t!==null)if(t.memoizedProps!==n.pendingProps)Xt=!0;else{if(!rf(t,a)&&(n.flags&128)===0)return Xt=!1,YE(t,n,a);Xt=(t.flags&131072)!==0}else Xt=!1,tt&&(n.flags&1048576)!==0&&ip(n,ro,n.index);switch(n.lanes=0,n.tag){case 16:e:{var l=n.pendingProps;if(t=ea(n.elementType),n.type=t,typeof t=="function")od(t)?(l=ra(t,l),n.tag=1,n=by(null,n,t,l,a)):(n.tag=0,n=Xd(null,n,t,l,a));else{if(t!=null){var h=t.$$typeof;if(h===He){n.tag=11,n=fy(null,n,t,l,a);break e}else if(h===I){n.tag=14,n=my(null,n,t,l,a);break e}}throw n=Ne(t)||t,Error(s(306,n,""))}}return n;case 0:return Xd(t,n,n.type,n.pendingProps,a);case 1:return l=n.type,h=ra(l,n.pendingProps),by(t,n,l,h,a);case 3:e:{if(Ee(n,n.stateNode.containerInfo),t===null)throw Error(s(387));l=n.pendingProps;var d=n.memoizedState;h=d.element,xd(t,n),fo(n,l,null,a);var v=n.memoizedState;if(l=v.cache,Zr(n,Yt,l),l!==d.cache&&yd(n,[Yt],a,!0),ho(),l=v.element,d.isDehydrated)if(d={element:l,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=d,n.memoizedState=d,n.flags&256){n=Ty(t,n,l,a);break e}else if(l!==h){h=gi(Error(s(424)),n),so(h),n=Ty(t,n,l,a);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Nt=bi(t.firstChild),pn=n,tt=!0,Xr=null,vi=!0,a=pp(n,null,l,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Xs(),l===h){n=_r(t,n,a);break e}vn(t,n,l,a)}n=n.child}return n;case 26:return uc(t,n),t===null?(a=k0(n.type,null,n.pendingProps,null))?n.memoizedState=a:tt||(a=n.type,t=n.pendingProps,l=wc(he.current).createElement(a),l[Ct]=n,l[tn]=t,_n(l,a,t),Kt(l),n.stateNode=l):n.memoizedState=k0(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Fe(n),t===null&&tt&&(l=n.stateNode=O0(n.type,n.pendingProps,he.current),pn=n,vi=!0,h=Nt,hs(n.type)?(Lf=h,Nt=bi(l.firstChild)):Nt=h),vn(t,n,n.pe
vendor: 1,758 bytes, line 48
48ndingProps.children,a),uc(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&tt&&((h=l=Nt)&&(l=Ax(l,n.type,n.pendingProps,vi),l!==null?(n.stateNode=l,pn=n,Nt=bi(l.firstChild),vi=!1,h=!0):h=!1),h||Jr(n)),Fe(n),h=n.type,d=n.pendingProps,v=t!==null?t.memoizedProps:null,l=d.children,Mf(h,d)?l=null:v!==null&&Mf(h,v)&&(n.flags|=32),n.memoizedState!==null&&(h=Cd(t,n,PE,null,null,a),Oo._currentValue=h),uc(t,n),vn(t,n,l,a),n.child;case 6:return t===null&&tt&&((t=a=Nt)&&(a=Sx(a,n.pendingProps,vi),a!==null?(n.stateNode=a,pn=n,Nt=null,t=!0):t=!1),t||Jr(n)),null;case 13:return Ey(t,n,a);case 4:return Ee(n,n.stateNode.containerInfo),l=n.pendingProps,t===null?n.child=na(n,null,l,a):vn(t,n,l,a),n.child;case 11:return fy(t,n,n.type,n.pendingProps,a);case 7:return vn(t,n,n.pendingProps,a),n.child;case 8:return vn(t,n,n.pendingProps.children,a),n.child;case 12:return vn(t,n,n.pendingProps.children,a),n.child;case 10:return l=n.pendingProps,Zr(n,n.type,l.value),vn(t,n,l.children,a),n.child;case 9:return h=n.type._context,l=n.pendingProps.children,Zs(n),h=yn(h),l=l(h),n.flags|=1,vn(t,n,l,a),n.child;case 14:return my(t,n,n.type,n.pendingProps,a);case 15:return gy(t,n,n.type,n.pendingProps,a);case 19:return Ay(t,n,a);case 31:return QE(t,n,a);case 22:return py(t,n,a,n.pendingProps);case 24:return Zs(n),l=yn(Yt),t===null?(h=bd(),h===null&&(h=At,d=vd(),h.pooledCache=d,d.refCount++,d!==null&&(h.pooledCacheLanes|=a),h=d),n.memoizedState={parent:l,cache:h},Ed(n),Zr(n,Yt,h)):((t.lanes&a)!==0&&(xd(t,n),fo(n,null,null,a),ho()),h=t.memoizedState,d=n.memoizedState,h.parent!==l?(h={parent:l,cache:l},n.memoizedState=h,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=h),Zr(n,Yt,l)):(l=d.cache,Zr(n,Yt,l),l!==h.cache&&yd(n,[Yt],a,!0))),vn(t,n,n.pe
vendor: 4,271 bytes, line 48
48ndingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(s(156,n.tag))}function br(t){t.flags|=4}function sf(t,n,a,l,h){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(Zy())t.flags|=8192;else throw ta=Yu,Td}else t.flags&=-16777217}function wy(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!B0(n))if(Zy())t.flags|=8192;else throw ta=Yu,Td}function hc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?at():536870912,t.lanes|=n,tl|=n)}function _o(t,n){if(!tt)switch(t.tailMode){case"hidden":n=t.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function It(t){var n=t.alternate!==null&&t.alternate.child===t.child,a=0,l=0;if(n)for(var h=t.child;h!==null;)a|=h.lanes|h.childLanes,l|=h.subtreeFlags&65011712,l|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)a|=h.lanes|h.childLanes,l|=h.subtreeFlags,l|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=l,t.childLanes=a,n}function $E(t,n,a){var l=n.pendingProps;switch(dd(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(n),null;case 1:return It(n),null;case 3:return a=n.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),pr(Yt),Se(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(Ha(n)?br(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,md())),It(n),null;case 26:var h=n.type,d=n.memoizedState;return t===null?(br(n),d!==null?(It(n),wy(n,d)):(It(n),sf(n,h,null,l,a))):d?d!==t.memoizedState?(br(n),It(n),wy(n,d)):(It(n),n.flags&=-16777217):(t=t.memoizedProps,t!==l&&br(n),It(n),sf(n,h,t,l,a)),null;case 27:if(jt(n),a=he.current,h=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==l&&br(n);else{if(!l){if(n.stateNode===null)throw Error(s(166));return It(n),null}t=le.current,Ha(n)?sp(n):(t=O0(h,l,a),n.stateNode=t,br(n))}return It(n),null;case 5:if(jt(n),h=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==l&&br(n);else{if(!l){if(n.stateNode===null)throw Error(s(166));return It(n),null}if(d=le.current,Ha(n))sp(n);else{var v=wc(he.current);switch(d){case 1:d=v.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:d=v.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":d=v.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":d=v.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":d=v.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof l.is=="string"?v.createElement("select",{is:l.is}):v.createElement("select"),l.multiple?d.multiple=!0:l.size&&(d.size=l.size);break;default:d=typeof l.is=="string"?v.createElement(h,{is:l.is}):v.createElement(h)}}d[Ct]=n,d[tn]=l;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)d.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===n)break e;for(;v.sibling===null;){if(v.return===null||v.return===n)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}n.stateNode=d;e:switch(_n(d,h,l),h){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&br(n)}}return It(n),sf(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,a),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==l&&br(n);else{if(typeof l!="string"&&n.stateNode===null)throw Error(s(166));if(t=he.current,Ha(n)){if(t=n.stateNode,a=n.memoizedProps,l=null,h=pn,h!==null)switch(h.tag){case 27:case 5:l=h.memoizedProps}t[Ct]=n,t=!!(t.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||E0(t.nodeValue,a)),t||Jr(n,!0)}else t=wc(t).createTextNode(l),t[Ct]=n,n.stateNode=t}return It(n),null;case 31:if(a=n.memoizedState,t===null||t.memoizedState!==null){if(l=Ha(n),a!==null){if(t===null){if(!l)throw Error(s(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557)
vendor: 11,881 bytes, line 48
48);t[Ct]=n}else Xs(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;It(n),t=!1}else a=md(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return n.flags&256?(ri(n),n):(ri(n),null);if((n.flags&128)!==0)throw Error(s(558))}return It(n),null;case 13:if(l=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Ha(n),l!==null&&l.dehydrated!==null){if(t===null){if(!h)throw Error(s(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(s(317));h[Ct]=n}else Xs(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;It(n),h=!1}else h=md(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return n.flags&256?(ri(n),n):(ri(n),null)}return ri(n),(n.flags&128)!==0?(n.lanes=a,n):(a=l!==null,t=t!==null&&t.memoizedState!==null,a&&(l=n.child,h=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(h=l.alternate.memoizedState.cachePool.pool),d=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(d=l.memoizedState.cachePool.pool),d!==h&&(l.flags|=2048)),a!==t&&a&&(n.child.flags|=8192),hc(n,n.updateQueue),It(n),null);case 4:return Se(),t===null&&Nf(n.stateNode.containerInfo),It(n),null;case 10:return pr(n.type),It(n),null;case 19:if(Y(Bt),l=n.memoizedState,l===null)return It(n),null;if(h=(n.flags&128)!==0,d=l.rendering,d===null)if(h)_o(l,!1);else{if(Lt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(d=Zu(t),d!==null){for(n.flags|=128,_o(l,!1),t=d.updateQueue,n.updateQueue=t,hc(n,t),n.subtreeFlags=0,t=a,a=n.child;a!==null;)ep(a,t),a=a.sibling;return ne(Bt,Bt.current&1|2),tt&&mr(n,l.treeForkCount),n.child}t=t.sibling}l.tail!==null&&wt()>pc&&(n.flags|=128,h=!0,_o(l,!1),n.lanes=4194304)}else{if(!h)if(t=Zu(d),t!==null){if(n.flags|=128,h=!0,t=t.updateQueue,n.updateQueue=t,hc(n,t),_o(l,!0),l.tail===null&&l.tailMode==="hidden"&&!d.alternate&&!tt)return It(n),null}else 2*wt()-l.renderingStartTime>pc&&a!==536870912&&(n.flags|=128,h=!0,_o(l,!1),n.lanes=4194304);l.isBackwards?(d.sibling=n.child,n.child=d):(t=l.last,t!==null?t.sibling=d:n.child=d,l.last=d)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=wt(),t.sibling=null,a=Bt.current,ne(Bt,h?a&1|2:a&1),tt&&mr(n,l.treeForkCount),t):(It(n),null);case 22:case 23:return ri(n),Nd(),l=n.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(n.flags|=8192):l&&(n.flags|=8192),l?(a&536870912)!==0&&(n.flags&128)===0&&(It(n),n.subtreeFlags&6&&(n.flags|=8192)):It(n),a=n.updateQueue,a!==null&&hc(n,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),l=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),l!==a&&(n.flags|=2048),t!==null&&Y(Ws),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),pr(Yt),It(n),null;case 25:return null;case 30:return null}throw Error(s(156,n.tag))}function XE(t,n){switch(dd(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return pr(Yt),Se(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return jt(n),null;case 31:if(n.memoizedState!==null){if(ri(n),n.alternate===null)throw Error(s(340));Xs()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(ri(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(s(340));Xs()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return Y(Bt),null;case 4:return Se(),null;case 10:return pr(n.type),null;case 22:case 23:return ri(n),Nd(),t!==null&&Y(Ws),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return pr(Yt),null;case 25:return null;default:return null}}function Ny(t,n){switch(dd(n),n.tag){case 3:pr(Yt),Se();break;case 26:case 27:case 5:jt(n);break;case 4:Se();break;case 31:n.memoizedState!==null&&ri(n);break;case 13:ri(n);break;case 19:Y(Bt);break;case 10:pr(n.type);break;case 22:case 23:ri(n),Nd(),t!==null&&Y(Ws);break;case 24:pr(Yt)}}function bo(t,n){try{var a=n.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var h=l.next;a=h;do{if((a.tag&t)===t){l=void 0;var d=a.create,v=a.inst;l=d(),v.destroy=l}a=a.next}while(a!==h)}}catch(E){yt(n,n.return,E)}}function rs(t,n,a){try{var l=n.updateQueue,h=l!==null?l.lastEffect:null;if(h!==null){var d=h.next;l=d;do{if((l.tag&t)===t){var v=l.inst,E=v.destroy;if(E!==void 0){v.destroy=void 0,h=n;var D=a,P=E;try{P()}catch(K){yt(h,D,K)}}}l=l.next}while(l!==d)}}catch(K){yt(n,n.return,K)}}function Iy(t){var n=t.updateQueue;if(n!==null){var a=t.stateNode;try{vp(n,a)}catch(l){yt(t,t.return,l)}}}function Ry(t,n,a){a.props=ra(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(l){yt(t,n,l)}}function To(t,n){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof a=="function"?t.refCleanup=a(l):a.current=l}}catch(h){yt(t,n,h)}}function tr(t,n){var a=t.ref,l=t.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(h){yt(t,n,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(h){yt(t,n,h)}else a.current=null}function Cy(t){var n=t.type,a=t.memoizedProps,l=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(h){yt(t,t.return,h)}}function af(t,n,a){try{var l=t.stateNode;vx(l,t.type,a,n),l[tn]=n}catch(h){yt(t,t.return,h)}}function Dy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&hs(t.type)||t.tag===4}function lf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Dy(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.tag===27&&hs(t.type)||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 of(t,n,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(t),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=wi));else if(l!==4&&(l===27&&hs(t.type)&&(a=t.stateNode,n=null),t=t.child,t!==null))for(of(t,n,a),t=t.sibling;t!==null;)of(t,n,a),t=t.sibling}function dc(t,n,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,n?a.insertBefore(t,n):a.appendChild(t);else if(l!==4&&(l===27&&hs(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(dc(t,n,a),t=t.sibling;t!==null;)dc(t,n,a),t=t.sibling}function My(t){var n=t.stateNode,a=t.memoizedProps;try{for(var l=t.type,h=n.attributes;h.length;)n.removeAttributeNode(h[0]);_n(n,l,a),n[Ct]=t,n[tn]=a}catch(d){yt(t,t.return,d)}}var Tr=!1,Jt=!1,uf=!1,Oy=typeof WeakSet=="function"?WeakSet:Set,on=null;function JE(t,n){if(t=t.containerInfo,Cf=Oc,t=Gg(t),td(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var h=l.anchorOffset,d=l.focusNode;l=l.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break e}var v=0,E=-1,D=-1,P=0,K=0,J=t,B=null;t:for(;;){for(var F;J!==a||h!==0&&J.nodeType!==3||(E=v+h),J!==d||l!==0&&J.nodeType!==3||(D=v+l),J.nodeType===3&&(v+=J.nodeValue.length),(F=J.firstChild)!==null;)B=J,J=F;for(;;){if(J===t)break t;if(B===a&&++P===h&&(E=v),B===d&&++K===l&&(D=v),(F=J.nextSibling)!==null)break;J=B,B=J.parentNode}J=F}a=E===-1||D===-1?null:{start:E,end:D}}else a=null}a=a||{start:0,end:0}}else a=null;for(Df={focusedElem:t,selectionRange:a},Oc=!1,on=n;on!==null;)if(n=on,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,on=t;else for(;on!==null;){switch(n=on,d=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)h=t[a],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&d!==null){t=void 0,a=n,h=d.memoizedProps,d=d.memoizedState,l=a.stateNode;try{var me=ra(a.type,h);t=l.getSnapshotBeforeUpdate(me,d),l.__reactInternalSnapshotBeforeUpdate=t}catch(Ie){yt(a,a.return,Ie)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,a=t.nodeType,a===9)jf(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":jf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=n.sibling,t!==null){t.return=n.return,on=t;break}on=n.return}}function jy(t,n,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:xr(t,a),l&4&&bo(5,a);break;case 1:if(xr(t,a),l&4)if(t=a.stateNode,n===null)try{t.componentDidMount()}catch(v){yt(a,a.return,v)}else{var h=ra(a.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(h,n,t.__reactInternalSnapshotBeforeUpdate)}catch(v){yt(a,a.return,v)}}l&64&&Iy(a),l&512&&To(a,a.return);break;case 3:if(xr(t,a),l&64&&(t=a.updateQueue,t!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{vp(t,n)}catch(v){yt(a,a.return,v)}}break;case 27:n===null&&l&4&&My(a);case 26:case 5:xr(t,a),n===null&&l&4&&Cy(a),l&512&&To(a,a.return);break;case 12:xr(t,a);break;case 31:xr(t,a),l&4&&Ly(t,a);break;case 13:xr(t,a),l&4&&Uy(t,a),l&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=ax.bind(null,a),wx(t,a))));break;case 22:if(l=a.memoizedState!==null||Tr,!l){n=n!==null&&n.memoizedState!==null||Jt,h=Tr;var d=Jt;Tr=l,(Jt=n)&&!d?Ar(t,a,(a.subtreeFlags&8772)!==0):xr(t,a),Tr=h,Jt=d}break;case 30:break;default:xr(t,a)}}function Vy(t){var n=t.alternate;n!==null&&(t.alternate=null,Vy(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Sa(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Mt=null,qn=!1;function Er(t,n,a){for(a=a.child;a!==null;)ky(t,n,a),a=a.sibling}function ky(t,n,a){if(Vt&&typeof Vt.onCommitFiberUnmount=="function")try{Vt.onCommitFiberUnmount(Zn,a)}catch{}switch(a.tag){case 26:Jt||tr(a,n),Er(t,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Jt||tr(a,n);var l=Mt,h=qn;hs(a.type)&&(Mt=a.stateNode,qn=!1),Er(t,n,a),Co(a.stateNode),Mt=l,qn=h;break;case 5:Jt||tr(a,n);case 6:if(l=Mt,h=qn,Mt=null,Er(t,n,a),Mt=l,qn=h,Mt!==null)if(qn)try{(Mt.nodeType===9?Mt.body:Mt.nodeName==="HTML"?Mt.ownerDocument.body:Mt).removeChild(a.stateNode)}catch(d){yt(a,n,d)}else try{Mt.removeChild(a.stateNode)}catch(d){yt(a,n,d)}break;case 18:Mt!==null&&(qn?(t=Mt,I0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),ul(t)):I0(Mt,a.stateNode));break;case 4:l=Mt,h=qn,Mt=a.stateNode.containerInfo,qn=!0,Er(t,n,a),Mt=l,qn=h;break;case 0:case 11:case 14:case 15:rs(2,a,n),Jt||rs(4,a,n),Er(t,n,a);break;case 1:Jt||(tr(a,n),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Ry(a,n,l)),Er(t,n,a);break;case 21:Er(t,n,a);break;case 22:Jt=(l=Jt)||a.memoizedState!==null,Er(t,n,a),Jt=l;break;default:Er(t,n,a)}}function Ly(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ul(t)}catch(a){yt(n,n.return,a)}}}function Uy(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ul(t)}catch(a){yt(n,n.return,a)}}function ZE(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Oy),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Oy),n;default:throw Error(s(435,t.tag))}}function fc(t,n){var a=ZE(t);
vendor: 6,590 bytes, line 48
48n.forEach(function(l){if(!a.has(l)){a.add(l);var h=lx.bind(null,t,l);l.then(h,h)}})}function Fn(t,n){var a=n.deletions;if(a!==null)for(var l=0;l<a.length;l++){var h=a[l],d=t,v=n,E=v;e:for(;E!==null;){switch(E.tag){case 27:if(hs(E.type)){Mt=E.stateNode,qn=!1;break e}break;case 5:Mt=E.stateNode,qn=!1;break e;case 3:case 4:Mt=E.stateNode.containerInfo,qn=!0;break e}E=E.return}if(Mt===null)throw Error(s(160));ky(d,v,h),Mt=null,qn=!1,d=h.alternate,d!==null&&(d.return=null),h.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Py(n,t),n=n.sibling}var Mi=null;function Py(t,n){var a=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Fn(n,t),Gn(t),l&4&&(rs(3,t,t.return),bo(3,t),rs(5,t,t.return));break;case 1:Fn(n,t),Gn(t),l&512&&(Jt||a===null||tr(a,a.return)),l&64&&Tr&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var h=Mi;if(Fn(n,t),Gn(t),l&512&&(Jt||a===null||tr(a,a.return)),l&4){var d=a!==null?a.memoizedState:null;if(l=t.memoizedState,a===null)if(l===null)if(t.stateNode===null){e:{l=t.type,a=t.memoizedProps,h=h.ownerDocument||h;t:switch(l){case"title":d=h.getElementsByTagName("title")[0],(!d||d[Bi]||d[Ct]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=h.createElement(l),h.head.insertBefore(d,h.querySelector("head > title"))),_n(d,l,a),d[Ct]=t,Kt(d),l=d;break e;case"link":var v=P0("link","href",h).get(l+(a.href||""));if(v){for(var E=0;E<v.length;E++)if(d=v[E],d.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&d.getAttribute("rel")===(a.rel==null?null:a.rel)&&d.getAttribute("title")===(a.title==null?null:a.title)&&d.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){v.splice(E,1);break t}}d=h.createElement(l),_n(d,l,a),h.head.appendChild(d);break;case"meta":if(v=P0("meta","content",h).get(l+(a.content||""))){for(E=0;E<v.length;E++)if(d=v[E],d.getAttribute("content")===(a.content==null?null:""+a.content)&&d.getAttribute("name")===(a.name==null?null:a.name)&&d.getAttribute("property")===(a.property==null?null:a.property)&&d.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&d.getAttribute("charset")===(a.charSet==null?null:a.charSet)){v.splice(E,1);break t}}d=h.createElement(l),_n(d,l,a),h.head.appendChild(d);break;default:throw Error(s(468,l))}d[Ct]=t,Kt(d),l=d}t.stateNode=l}else z0(h,t.type,t.stateNode);else t.stateNode=U0(h,l,t.memoizedProps);else d!==l?(d===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):d.count--,l===null?z0(h,t.type,t.stateNode):U0(h,l,t.memoizedProps)):l===null&&t.stateNode!==null&&af(t,t.memoizedProps,a.memoizedProps)}break;case 27:Fn(n,t),Gn(t),l&512&&(Jt||a===null||tr(a,a.return)),a!==null&&l&4&&af(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Fn(n,t),Gn(t),l&512&&(Jt||a===null||tr(a,a.return)),t.flags&32){h=t.stateNode;try{Hn(h,"")}catch(me){yt(t,t.return,me)}}l&4&&t.stateNode!=null&&(h=t.memoizedProps,af(t,h,a!==null?a.memoizedProps:h)),l&1024&&(uf=!0);break;case 6:if(Fn(n,t),Gn(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,a=t.stateNode;try{a.nodeValue=l}catch(me){yt(t,t.return,me)}}break;case 3:if(Rc=null,h=Mi,Mi=Nc(n.containerInfo),Fn(n,t),Mi=h,Gn(t),l&4&&a!==null&&a.memoizedState.isDehydrated)try{ul(n.containerInfo)}catch(me){yt(t,t.return,me)}uf&&(uf=!1,zy(t));break;case 4:l=Mi,Mi=Nc(t.stateNode.containerInfo),Fn(n,t),Gn(t),Mi=l;break;case 12:Fn(n,t),Gn(t);break;case 31:Fn(n,t),Gn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,fc(t,l)));break;case 13:Fn(n,t),Gn(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(gc=wt()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,fc(t,l)));break;case 22:h=t.memoizedState!==null;var D=a!==null&&a.memoizedState!==null,P=Tr,K=Jt;if(Tr=P||h,Jt=K||D,Fn(n,t),Jt=K,Tr=P,Gn(t),l&8192)e:for(n=t.stateNode,n._visibility=h?n._visibility&-2:n._visibility|1,h&&(a===null||D||Tr||Jt||sa(t)),a=null,n=t;;){if(n.tag===5||n.tag===26){if(a===null){D=a=n;try{if(d=D.stateNode,h)v=d.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{E=D.stateNode;var J=D.memoizedProps.style,B=J!=null&&J.hasOwnProperty("display")?J.display:null;E.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch(me){yt(D,D.return,me)}}}else if(n.tag===6){if(a===null){D=n;try{D.stateNode.nodeValue=h?"":D.memoizedProps}catch(me){yt(D,D.return,me)}}}else if(n.tag===18){if(a===null){D=n;try{var F=D.stateNode;h?R0(F,!0):R0(D.stateNode,!1)}catch(me){yt(D,D.return,me)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}l&4&&(l=t.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,fc(t,a))));break;case 19:Fn(n,t),Gn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,fc(t,l)));break;case 30:break;case 21:break;default:Fn(n,t),Gn(t)}}function Gn(t){var n=t.flags;if(n&2){try{for(var a,l=t.return;l!==null;){if(Dy(l)){a=l;break}l=l.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var h=a.stateNode,d=lf(t);dc(t,d,h);break;case 5:var v=a.stateNode;a.flags&32&&(Hn(v,""),a.flags&=-33);var E=lf(t);dc(t,E,v);break;case 3:case 4:var D=a.stateNode.containerInfo,P=lf(t);of(t,P,D);break;default:throw Error(s(161))}}catch(K){yt(t,t.return,K)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function zy(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;zy(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function xr(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)jy(t,n.alternate,n),n=n.sibling}function sa(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:rs(4,n,n.return),sa(n);break;case 1:tr(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&Ry(n,n.return,a),sa(n);break;case 27:Co(n.stateNode);case 26:case 5:tr(n,n.return),sa(n);break;case 22:n.memoizedState===null&&sa(n);break;case 30:sa(n);break;default:sa(n)}t=t.sibling}}function Ar(t,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var l=n.alternate,h=t,d=n,v=d.flags;switch(d.tag){case 0:case 11:case 15:Ar(h,d,a),bo(4,d);break;case 1:if(Ar(h,d,a),l=d,h=l.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(P){yt(l,l.return,P)}if(l=d,h=l.updateQueue,h!==null){var E=l.stateNode;try{var D=h.shared.hiddenCallbacks;
vendor: 4,760 bytes, line 48
48if(D!==null)for(h.shared.hiddenCallbacks=null,h=0;h<D.length;h++)yp(D[h],E)}catch(P){yt(l,l.return,P)}}a&&v&64&&Iy(d),To(d,d.return);break;case 27:My(d);case 26:case 5:Ar(h,d,a),a&&l===null&&v&4&&Cy(d),To(d,d.return);break;case 12:Ar(h,d,a);break;case 31:Ar(h,d,a),a&&v&4&&Ly(h,d);break;case 13:Ar(h,d,a),a&&v&4&&Uy(h,d);break;case 22:d.memoizedState===null&&Ar(h,d,a),To(d,d.return);break;case 30:break;default:Ar(h,d,a)}n=n.sibling}}function cf(t,n){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&ao(a))}function hf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ao(t))}function Oi(t,n,a,l){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)By(t,n,a,l),n=n.sibling}function By(t,n,a,l){var h=n.flags;switch(n.tag){case 0:case 11:case 15:Oi(t,n,a,l),h&2048&&bo(9,n);break;case 1:Oi(t,n,a,l);break;case 3:Oi(t,n,a,l),h&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&ao(t)));break;case 12:if(h&2048){Oi(t,n,a,l),t=n.stateNode;try{var d=n.memoizedProps,v=d.id,E=d.onPostCommit;typeof E=="function"&&E(v,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(D){yt(n,n.return,D)}}else Oi(t,n,a,l);break;case 31:Oi(t,n,a,l);break;case 13:Oi(t,n,a,l);break;case 23:break;case 22:d=n.stateNode,v=n.alternate,n.memoizedState!==null?d._visibility&2?Oi(t,n,a,l):Eo(t,n):d._visibility&2?Oi(t,n,a,l):(d._visibility|=2,Za(t,n,a,l,(n.subtreeFlags&10256)!==0||!1)),h&2048&&cf(v,n);break;case 24:Oi(t,n,a,l),h&2048&&hf(n.alternate,n);break;default:Oi(t,n,a,l)}}function Za(t,n,a,l,h){for(h=h&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var d=t,v=n,E=a,D=l,P=v.flags;switch(v.tag){case 0:case 11:case 15:Za(d,v,E,D,h),bo(8,v);break;case 23:break;case 22:var K=v.stateNode;v.memoizedState!==null?K._visibility&2?Za(d,v,E,D,h):Eo(d,v):(K._visibility|=2,Za(d,v,E,D,h)),h&&P&2048&&cf(v.alternate,v);break;case 24:Za(d,v,E,D,h),h&&P&2048&&hf(v.alternate,v);break;default:Za(d,v,E,D,h)}n=n.sibling}}function Eo(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=t,l=n,h=l.flags;switch(l.tag){case 22:Eo(a,l),h&2048&&cf(l.alternate,l);break;case 24:Eo(a,l),h&2048&&hf(l.alternate,l);break;default:Eo(a,l)}n=n.sibling}}var xo=8192;function Wa(t,n,a){if(t.subtreeFlags&xo)for(t=t.child;t!==null;)Hy(t,n,a),t=t.sibling}function Hy(t,n,a){switch(t.tag){case 26:Wa(t,n,a),t.flags&xo&&t.memoizedState!==null&&Ux(a,Mi,t.memoizedState,t.memoizedProps);break;case 5:Wa(t,n,a);break;case 3:case 4:var l=Mi;Mi=Nc(t.stateNode.containerInfo),Wa(t,n,a),Mi=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=xo,xo=16777216,Wa(t,n,a),xo=l):Wa(t,n,a));break;default:Wa(t,n,a)}}function qy(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Ao(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var l=n[a];on=l,Gy(l,t)}qy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fy(t),t=t.sibling}function Fy(t){switch(t.tag){case 0:case 11:case 15:Ao(t),t.flags&2048&&rs(9,t,t.return);break;case 3:Ao(t);break;case 12:Ao(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,mc(t)):Ao(t);break;default:Ao(t)}}function mc(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var l=n[a];on=l,Gy(l,t)}qy(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:rs(8,n,n.return),mc(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,mc(n));break;default:mc(n)}t=t.sibling}}function Gy(t,n){for(;on!==null;){var a=on;switch(a.tag){case 0:case 11:case 15:rs(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ao(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,on=l;else e:for(a=t;on!==null;){l=on;var h=l.sibling,d=l.return;if(Vy(l),l===a){on=null;break e}if(h!==null){h.return=d,on=h;break e}on=d}}}var WE={getCacheForType:function(t){var n=yn(Yt),a=n.data.get(t);return a===void 0&&(a=t(),n.data.set(t,a)),a},cacheSignal:function(){return yn(Yt).controller.signal}},ex=typeof WeakMap=="function"?WeakMap:Map,ht=0,At=null,Qe=null,$e=0,pt=0,si=null,ss=!1,el=!1,df=!1,Sr=0,Lt=0,as=0,aa=0,ff=0,ai=0,tl=0,So=null,Kn=null,mf=!1,gc=0,Ky=0,pc=1/0,yc=null,ls=null,nn=0,os=null,nl=null,wr=0,gf=0,pf=null,Qy=null,wo=0,yf=null;
vendor: 18,152 bytes, line 48
48function li(){return(ht&2)!==0&&$e!==0?$e&-$e:G.T!==null?xf():an()}function Yy(){if(ai===0)if(($e&536870912)===0||tt){var t=ui;ui<<=1,(ui&3932160)===0&&(ui=262144),ai=t}else ai=536870912;return t=ii.current,t!==null&&(t.flags|=32),ai}function Qn(t,n,a){(t===At&&(pt===2||pt===9)||t.cancelPendingCommit!==null)&&(il(t,0),us(t,$e,ai,!1)),et(t,a),((ht&2)===0||t!==At)&&(t===At&&((ht&2)===0&&(aa|=a),Lt===4&&us(t,$e,ai,!1)),nr(t))}function $y(t,n,a){if((ht&6)!==0)throw Error(s(327));var l=!a&&(n&127)===0&&(n&t.expiredLanes)===0||st(t,n),h=l?ix(t,n):_f(t,n,!0),d=l;do{if(h===0){el&&!l&&us(t,n,0,!1);break}else{if(a=t.current.alternate,d&&!tx(a)){h=_f(t,n,!1),d=!1;continue}if(h===2){if(d=n,t.errorRecoveryDisabledLanes&d)var v=0;else v=t.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var E=t;h=So;var D=E.current.memoizedState.isDehydrated;if(D&&(il(E,v).flags|=256),v=_f(E,v,!1),v!==2){if(df&&!D){E.errorRecoveryDisabledLanes|=d,aa|=d,h=4;break e}d=Kn,Kn=h,d!==null&&(Kn===null?Kn=d:Kn.push.apply(Kn,d))}h=v}if(d=!1,h!==2)continue}}if(h===1){il(t,0),us(t,n,0,!0);break}e:{switch(l=t,d=h,d){case 0:case 1:throw Error(s(345));case 4:if((n&4194048)!==n)break;case 6:us(l,n,ai,!ss);break e;case 2:Kn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((n&62914560)===n&&(h=gc+300-wt(),10<h)){if(us(l,n,ai,!ss),Re(l,0,!0)!==0)break e;wr=n,l.timeoutHandle=w0(Xy.bind(null,l,a,Kn,yc,mf,n,ai,aa,tl,ss,d,"Throttled",-0,0),h);break e}Xy(l,a,Kn,yc,mf,n,ai,aa,tl,ss,d,null,-0,0)}}break}while(!0);nr(t)}function Xy(t,n,a,l,h,d,v,E,D,P,K,J,B,F){if(t.timeoutHandle=-1,J=n.subtreeFlags,J&8192||(J&16785408)===16785408){J={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:wi},Hy(n,d,J);var me=(d&62914560)===d?gc-wt():(d&4194048)===d?Ky-wt():0;if(me=Px(J,me),me!==null){wr=d,t.cancelPendingCommit=me(r0.bind(null,t,n,d,a,l,h,v,E,D,K,J,null,B,F)),us(t,d,v,!P);return}}r0(t,n,d,a,l,h,v,E,D)}function tx(t){for(var n=t;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var h=a[l],d=h.getSnapshot;h=h.value;try{if(!ti(d(),h))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function us(t,n,a,l){n&=~ff,n&=~aa,t.suspendedLanes|=n,t.pingedLanes&=~n,l&&(t.warmLanes|=n),l=t.expirationTimes;for(var h=n;0<h;){var d=31-te(h),v=1<<d;l[d]=-1,h&=~v}a!==0&&Sn(t,a,n)}function vc(){return(ht&6)===0?(No(0),!1):!0}function vf(){if(Qe!==null){if(pt===0)var t=Qe.return;else t=Qe,gr=Js=null,Od(t),Qa=null,oo=0,t=Qe;for(;t!==null;)Ny(t.alternate,t),t=t.return;Qe=null}}function il(t,n){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,Tx(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),wr=0,vf(),At=t,Qe=a=fr(t.current,null),$e=n,pt=0,si=null,ss=!1,el=st(t,n),df=!1,tl=ai=ff=aa=as=Lt=0,Kn=So=null,mf=!1,(n&8)!==0&&(n|=n&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=n;0<l;){var h=31-te(l),d=1<<h;n|=t[h],l&=~d}return Sr=n,Pu(),a}function Jy(t,n){Ue=null,G.H=yo,n===Ka||n===Qu?(n=fp(),pt=3):n===Td?(n=fp(),pt=4):pt=n===$d?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,si=n,Qe===null&&(Lt=1,lc(t,gi(n,t.current)))}function Zy(){var t=ii.current;return t===null?!0:($e&4194048)===$e?_i===null:($e&62914560)===$e||($e&536870912)!==0?t===_i:!1}function Wy(){var t=G.H;return G.H=yo,t===null?yo:t}function e0(){var t=G.A;return G.A=WE,t}function _c(){Lt=4,ss||($e&4194048)!==$e&&ii.current!==null||(el=!0),(as&134217727)===0&&(aa&134217727)===0||At===null||us(At,$e,ai,!1)}function _f(t,n,a){var l=ht;ht|=2;var h=Wy(),d=e0();(At!==t||$e!==n)&&(yc=null,il(t,n)),n=!1;var v=Lt;e:do try{if(pt!==0&&Qe!==null){var E=Qe,D=si;switch(pt){case 8:vf(),v=6;break e;case 3:case 2:case 9:case 6:ii.current===null&&(n=!0);var P=pt;if(pt=0,si=null,rl(t,E,D,P),a&&el){v=0;break e}break;default:P=pt,pt=0,si=null,rl(t,E,D,P)}}nx(),v=Lt;break}catch(K){Jy(t,K)}while(!0);return n&&t.shellSuspendCounter++,gr=Js=null,ht=l,G.H=h,G.A=d,Qe===null&&(At=null,$e=0,Pu()),v}function nx(){for(;Qe!==null;)t0(Qe)}function ix(t,n){var a=ht;ht|=2;var l=Wy(),h=e0();At!==t||$e!==n?(yc=null,pc=wt()+500,il(t,n)):el=st(t,n);e:do try{if(pt!==0&&Qe!==null){n=Qe;var d=si;t:switch(pt){case 1:pt=0,si=null,rl(t,n,d,1);break;case 2:case 9:if(hp(d)){pt=0,si=null,n0(n);break}n=function(){pt!==2&&pt!==9||At!==t||(pt=7),nr(t)},d.then(n,n);break e;case 3:pt=7;break e;case 4:pt=5;break e;case 7:hp(d)?(pt=0,si=null,n0(n)):(pt=0,si=null,rl(t,n,d,7));break;case 5:var v=null;switch(Qe.tag){case 26:v=Qe.memoizedState;case 5:case 27:var E=Qe;if(v?B0(v):E.stateNode.complete){pt=0,si=null;var D=E.sibling;if(D!==null)Qe=D;else{var P=E.return;P!==null?(Qe=P,bc(P)):Qe=null}break t}}pt=0,si=null,rl(t,n,d,5);break;case 6:pt=0,si=null,rl(t,n,d,6);break;case 8:vf(),Lt=6;break e;default:throw Error(s(462))}}rx();break}catch(K){Jy(t,K)}while(!0);return gr=Js=null,G.H=l,G.A=h,ht=a,Qe!==null?0:(At=null,$e=0,Pu(),Lt)}function rx(){for(;Qe!==null&&!nt();)t0(Qe)}function t0(t){var n=Sy(t.alternate,t,Sr);t.memoizedProps=t.pendingProps,n===null?bc(t):Qe=n}function n0(t){var n=t,a=n.alternate;switch(n.tag){case 15:case 0:n=_y(a,n,n.pendingProps,n.type,void 0,$e);break;case 11:n=_y(a,n,n.pendingProps,n.type.render,n.ref,$e);break;case 5:Od(n);default:Ny(a,n),n=Qe=ep(n,Sr),n=Sy(a,n,Sr)}t.memoizedProps=t.pendingProps,n===null?bc(t):Qe=n}function rl(t,n,a,l){gr=Js=null,Od(n),Qa=null,oo=0;var h=n.return;try{if(KE(t,h,n,a,$e)){Lt=1,lc(t,gi(a,t.current)),Qe=null;return}}catch(d){if(h!==null)throw Qe=h,d;Lt=1,lc(t,gi(a,t.current)),Qe=null;return}n.flags&32768?(tt||l===1?t=!0:el||($e&536870912)!==0?t=!1:(ss=t=!0,(l===2||l===9||l===3||l===6)&&(l=ii.current,l!==null&&l.tag===13&&(l.flags|=16384))),i0(n,t)):bc(n)}function bc(t){var n=t;do{if((n.flags&32768)!==0){i0(n,ss);return}t=n.return;var a=$E(n.alternate,n,Sr);if(a!==null){Qe=a;return}if(n=n.sibling,n!==null){Qe=n;return}Qe=n=t}while(n!==null);Lt===0&&(Lt=5)}function i0(t,n){do{var a=XE(t.alternate,t);if(a!==null){a.flags&=32767,Qe=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(t=t.sibling,t!==null)){Qe=t;return}Qe=t=a}while(t!==null);Lt=6,Qe=null}function r0(t,n,a,l,h,d,v,E,D){t.cancelPendingCommit=null;do Tc();while(nn!==0);if((ht&6)!==0)throw Error(s(327));if(n!==null){if(n===t.current)throw Error(s(177));if(d=n.lanes|n.childLanes,d|=ad,An(t,a,d,v,E,D),t===At&&(Qe=At=null,$e=0),nl=n,os=t,wr=a,gf=d,pf=h,Qy=l,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,ox(Jn,function(){return u0(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||l){l=G.T,G.T=null,h=re.p,re.p=2,v=ht,ht|=4;try{JE(t,n,a)}finally{ht=v,re.p=h,G.T=l}}nn=1,s0(),a0(),l0()}}function s0(){if(nn===1){nn=0;var t=os,n=nl,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=G.T,G.T=null;var l=re.p;re.p=2;var h=ht;ht|=4;try{Py(n,t);var d=Df,v=Gg(t.containerInfo),E=d.focusedElem,D=d.selectionRange;if(v!==E&&E&&E.ownerDocument&&Fg(E.ownerDocument.documentElement,E)){if(D!==null&&td(E)){var P=D.start,K=D.end;if(K===void 0&&(K=P),"selectionStart"in E)E.selectionStart=P,E.selectionEnd=Math.min(K,E.value.length);else{var J=E.ownerDocument||document,B=J&&J.defaultView||window;if(B.getSelection){var F=B.getSelection(),me=E.textContent.length,Ie=Math.min(D.start,me),Et=D.end===void 0?Ie:Math.min(D.end,me);!F.extend&&Ie>Et&&(v=Et,Et=Ie,Ie=v);var k=qg(E,Ie),O=qg(E,Et);if(k&&O&&(F.rangeCount!==1||F.anchorNode!==k.node||F.anchorOffset!==k.offset||F.focusNode!==O.node||F.focusOffset!==O.offset)){var U=J.createRange();U.setStart(k.node,k.offset),F.removeAllRanges(),Ie>Et?(F.addRange(U),F.extend(O.node,O.offset)):(U.setEnd(O.node,O.offset),F.addRange(U))}}}}for(J=[],F=E;F=F.parentNode;)F.nodeType===1&&J.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<J.length;E++){var $=J[E];$.element.scrollLeft=$.left,$.element.scrollTop=$.top}}Oc=!!Cf,Df=Cf=null}finally{ht=h,re.p=l,G.T=a}}t.current=n,nn=2}}function a0(){if(nn===2){nn=0;var t=os,n=nl,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=G.T,G.T=null;var l=re.p;re.p=2;var h=ht;ht|=4;try{jy(t,n.alternate,n)}finally{ht=h,re.p=l,G.T=a}}nn=3}}function l0(){if(nn===4||nn===3){nn=0,ke();var t=os,n=nl,a=wr,l=Qy;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?nn=5:(nn=0,nl=os=null,o0(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(ls=null),wn(a),n=n.stateNode,Vt&&typeof Vt.onCommitFiberRoot=="function")try{Vt.onCommitFiberRoot(Zn,n,void 0,(n.current.flags&128)===128)}catch{}if(l!==null){n=G.T,h=re.p,re.p=2,G.T=null;try{for(var d=t.onRecoverableError,v=0;v<l.length;v++){var E=l[v];d(E.value,{componentStack:E.stack})}}finally{G.T=n,re.p=h}}(wr&3)!==0&&Tc(),nr(t),h=t.pendingLanes,(a&261930)!==0&&(h&42)!==0?t===yf?wo++:(wo=0,yf=t):wo=0,No(0)}}function o0(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,ao(n)))}function Tc(){return s0(),a0(),l0(),u0()}function u0(){if(nn!==5)return!1;var t=os,n=gf;gf=0;var a=wn(wr),l=G.T,h=re.p;try{re.p=32>a?32:a,G.T=null,a=pf,pf=null;var d=os,v=wr;if(nn=0,nl=os=null,wr=0,(ht&6)!==0)throw Error(s(331));var E=ht;if(ht|=4,Fy(d.current),By(d,d.current,v,a),ht=E,No(0,!1),Vt&&typeof Vt.onPostCommitFiberRoot=="function")try{Vt.onPostCommitFiberRoot(Zn,d)}catch{}return!0}finally{re.p=h,G.T=l,o0(t,n)}}function c0(t,n,a){n=gi(a,n),n=Yd(t.stateNode,n,2),t=ts(t,n,2),t!==null&&(et(t,2),nr(t))}function yt(t,n,a){if(t.tag===3)c0(t,t,a);else for(;n!==null;){if(n.tag===3){c0(n,t,a);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ls===null||!ls.has(l))){t=gi(a,t),a=hy(2),l=ts(n,a,2),l!==null&&(dy(a,l,n,t),et(l,2),nr(l));break}}n=n.return}}function bf(t,n,a){var l=t.pingCache;if(l===null){l=t.pingCache=new ex;var h=new Set;l.set(n,h)}else h=l.get(n),h===void 0&&(h=new Set,l.set(n,h));h.has(a)||(df=!0,h.add(a),t=sx.bind(null,t,n,a),n.then(t,t))}function sx(t,n,a){var l=t.pingCache;l!==null&&l.delete(n),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,At===t&&($e&a)===a&&(Lt===4||Lt===3&&($e&62914560)===$e&&300>wt()-gc?(ht&2)===0&&il(t,0):ff|=a,tl===$e&&(tl=0)),nr(t)}function h0(t,n){n===0&&(n=at()),t=Ys(t,n),t!==null&&(et(t,n),nr(t))}function ax(t){var n=t.memoizedState,a=0;n!==null&&(a=n.retryLane),h0(t,a)}function lx(t,n){var a=0;switch(t.tag){case 31:case 13:var l=t.stateNode,h=t.memoizedState;h!==null&&(a=h.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(n),h0(t,a)}function ox(t,n){return ue(t,n)}var Ec=null,sl=null,Tf=!1,xc=!1,Ef=!1,cs=0;function nr(t){t!==sl&&t.next===null&&(sl===null?Ec=sl=t:sl=sl.next=t),xc=!0,Tf||(Tf=!0,cx())}function No(t,n){if(!Ef&&xc){Ef=!0;do for(var a=!1,l=Ec;l!==null;){if(t!==0){var h=l.pendingLanes;if(h===0)var d=0;else{var v=l.suspendedLanes,E=l.pingedLanes;d=(1<<31-te(42|t)+1)-1,d&=h&~(v&~E),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,g0(l,d))}else d=$e,d=Re(l,l===At?d:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(d&3)===0||st(l,d)||(a=!0,g0(l,d));l=l.next}while(a);Ef=!1}}function ux(){d0()}function d0(){xc=Tf=!1;var t=0;cs!==0&&bx()&&(t=cs);for(var n=wt(),a=null,l=Ec;l!==null;){var h=l.next,d=f0(l,n);d===0?(l.next=null,a===null?Ec=h:a.next=h,h===null&&(sl=a)):(a=l,(t!==0||(d&3)!==0)&&(xc=!0)),l=h}nn!==0&&nn!==5||No(t),cs!==0&&(cs=0)}function f0(t,n){for(var a=t.suspendedLanes,l=t.pingedLanes,h=t.expirationTimes,d=t.pendingLanes&-62914561;0<d;){var v=31-te(d),E=1<<v,D=h[v];D===-1?((E&a)===0||(E&l)!==0)&&(h[v]=Pt(E,n)):D<=n&&(t.expiredLanes|=E),d&=~E}if(n=At,a=$e,a=Re(t,t===n?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,a===0||t===n&&(pt===2||pt===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&ve(l),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||st(t,a)){if(n=a&-a,n===t.callbackPriority)return n;switch(l!==null&&ve(l),wn(a)){case 2:case 8:a=Si;break;case 32:a=Jn;break;case 268435456:a=Vs;break;default:a=Jn}return l=m0.bind(null,t),a=ue(a,l),t.callbackPriority=n,t.callbackNode=a,n}return l!==null&&l!==null&&ve(l),t.callbackPriority=2,t.callbackNode=null,2}function m0(t,n){if(nn!==0&&nn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Tc()&&t.callbackNode!==a)return null;var l=$e;return l=Re(t,t===At?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:($y(t,l,n),f0(t,wt()),t.callbackNode!=null&&t.callbackNode===a?m0.bind(null,t):null)}function g0(t,n){if(Tc())return null;$y(t,n,!0)}function cx(){Ex(function(){(ht&6)!==0?ue(zi,ux):d0()})}function xf(){if(cs===0){var t=Fa;t===0&&(t=Gt,Gt<<=1,(Gt&261888)===0&&(Gt=256)),cs=t}return cs}function p0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ra(""+t)}function y0(t,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,t.id&&a.setAttribute("form",t.id),n.parentNode.insertBefore(a,n),t=new FormData(t),a.parentNode.removeChild(a),t}function hx(t,n,a,l,h){if(n==="submit"&&a&&a.stateNode===h){var d=p0((h[tn]||null).action),v=l.submitter;v&&(n=(n=v[tn]||null)?p0(n.formAction):v.getAttribute("formAction"),n!==null&&(d=n,v=null));var E=new $i("action","action",null,l,h);t.push({event:E,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(cs!==0){var D=v?y0(h,v):new FormData(h);Hd(a,{pending:!0,data:D,method:h.method,action:d},null,D)}}else typeof d=="function"&&(E.preventDefault(),D=v?y0(h,v):new FormData(h),Hd(a,{pending:!0,data:D,method:h.method,action:d},d,D))},currentTarget:h}]})}}for(var Af=0;Af<sd.length;Af++){var Sf=sd[Af],dx=Sf.toLowerCase(),fx=Sf[0].toUpperCase()+Sf.slice(1);Di(dx,"on"+fx)}Di(Yg,"onAnimationEnd"),Di($g,"onAnimationIteration"),Di(Xg,"onAnimationStart"),Di("dblclick","onDoubleClick"),Di("focusin","onFocus"),Di("focusout","onBlur"),Di(RE,"onTransitionRun"),Di(CE,"onTransitionStart"),Di(DE,"onTransitionCancel"),Di(Jg,"onTransitionEnd"),Gi("onMouseEnter",["mouseout","mouseover"]),Gi("onMouseLeave",["mouseout","mouseover"]),Gi("onPointerEnter",["pointerout","pointerover"]),Gi("onPointerLeave",["pointerout","pointerover"]),Fi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Fi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Fi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Fi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Fi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Fi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Io="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(" "),mx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Io));function v0(t,n){n=(n&4)!==0;for(var a=0;a<t.length;a++){var l=t[a],h=l.event;l=l.listeners;e:{var d=void 0;if(n)for(var v=l.length-1;0<=v;v--){var E=l[v],D=E.instance,P=E.currentTarget;if(E=E.listener,D!==d&&h.isPropagationStopped())break e;d=E,h.currentTarget=P;try{d(h)}catch(K){Uu(K)}h.currentTarget=null,d=D}else for(v=0;v<l.length;v++){if(E=l[v],D=E.instance,P=E.currentTarget,E=E.listener,D!==d&&h.isPropagationStopped())break e;d=E,h.currentTarget=P;try{d(h)}catch(K){Uu(K)}h.currentTarget=null,d=D}}}}function Ye(t,n){var a=n[Pr];a===void 0&&(a=n[Pr]=new Set);var l=t+"__bubble";a.has(l)||(_0(n,t,2,!1),a.add(l))}function wf(t,n,a){var l=0;n&&(l|=4),_0(a,t,l,n)}var Ac="_reactListening"+Math.random().toString(36).slice(2);function Nf(t){if(!t[Ac]){t[Ac]=!0,Pl.forEach(function(a){a!=="selectionchange"&&(mx.has(a)||wf(a,!1,t),wf(a,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Ac]||(n[Ac]=!0,wf("selectionchange",!1,n))}}function _0(t,n,a,l){switch(Y0(n)){case 2:var h=Hx;break;case 8:h=qx;break;default:h=Hf}a=h.bind(null,n,a,t),h=void 0,!zs||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),l?h!==void 0?t.addEventListener(n,a,{capture:!0,passive:h}):t.addEventListener(n,a,!0):h!==void 0?t.addEventListener(n,a,{passive:h}):t.addEventListener(n,a,!1)}function If(t,n,a,l,h){var d=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var v=l.tag;if(v===3||v===4){var E=l.stateNode.containerInfo;if(E===h)break;if(v===4)for(v=l.return;v!==null;){var D=v.tag;if((D===3||D===4)&&v.stateNode.containerInfo===h)return;v=v.return}for(;E!==null;){if(v=Hi(E),v===null)return;if(D=v.tag,D===5||D===6||D===26||D===27){l=d=v;continue e}E=E.parentNode}}l=l.return}Gr(function(){var P=d,K=hi(a),J=[];e:{var B=Zg.get(t);if(B!==void 0){var F=$i,me=t;switch(t){case"keypress":if(Hs(a)===0)break e;case"keydown":case"keyup":F=Vu;break;case"focusin":me="focus",F=Fs;break;case"focusout":me="blur",F=Fs;break;case"beforeblur":case"afterblur":F=Fs;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":F=Zl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=wu;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=g;break;case Yg:case $g:case Xg:F=Iu;break;case Jg:F=x;break;case"scroll":case"scrollend":F=Jl;break;case"wheel":F=q;break;case"copy":case"cut":case"paste":F=Ru;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=dr;break;case"toggle":case"beforetoggle":F=Le}var Ie=(n&4)!==0,Et=!Ie&&(t==="scroll"||t==="scrollend"),k=Ie?B!==null?B+"
48Capture":null:B;Ie=[];for(var O=P,U;O!==null;){var $=O;if(U=$.stateNode,$=$.tag,$!==5&&$!==26&&$!==27||U===null||k===null||($=Ni(O,k),$!=null&&Ie.push(Ro(O,$,U))),Et)break;O=O.return}0<Ie.length&&(B=new F(B,me,null,a,K),J.push({event:B,listeners:Ie}))}}if((n&7)===0){e:{if(B=t==="mouseover"||t==="pointerover",F=t==="mouseout"||t==="pointerout",B&&a!==Yl&&(me=a.relatedTarget||a.fromElement)&&(Hi(me)||me[Vn]))break e;if((F||B)&&(B=K.window===K?K:(B=K.ownerDocument)?B.defaultView||B.parentWindow:window,F?(me=a.relatedTarget||a.toElement,F=P,me=me?Hi(me):null,me!==null&&(Et=c(me),Ie=me.tag,me!==Et||Ie!==5&&Ie!==27&&Ie!==6)&&(me=null)):(F=null,me=P),F!==me)){if(Ie=Zl,$="onMouseLeave",k="onMouseEnter",O="mouse",(t==="pointerout"||t==="pointerover")&&(Ie=dr,$="onPointerLeave",k="onPointerEnter",O="pointer"),Et=F==null?B:Wn(F),U=me==null?B:Wn(me),B=new Ie($,O+"leave",F,a,K),B.target=Et,B.relatedTarget=U,$=null,Hi(K)===P&&(Ie=new Ie(k,O+"enter",me,a,K),Ie.target=U,Ie.relatedTarget=Et,$=Ie),Et=$,F&&me)t:{for(Ie=gx,k=F,O=me,U=0,$=k;$;$=Ie($))U++;$=0;for(var xe=O;xe;xe=Ie(xe))$++;for(;0<U-$;)k=Ie(k),U--;for(;0<$-U;)O=Ie(O),$--;for(;U--;){if(k===O||O!==null&&k===O.alternate){Ie=k;break t}k=Ie(k),O=Ie(O)}Ie=null}else Ie=null;F!==null&&b0(J,B,F,Ie,!1),me!==null&&Et!==null&&b0(J,Et,me,Ie,!0)}}
vendor: 5,189 bytes, lines 48-49
48e:{if(B=P?Wn(P):window,F=B.nodeName&&B.nodeName.toLowerCase(),F==="select"||F==="input"&&B.type==="file")var ot=Lg;else if(Vg(B))if(Ug)ot=wE;else{ot=AE;var pe=xE}else F=B.nodeName,!F||F.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?P&&Ia(P.elementType)&&(ot=Lg):ot=SE;if(ot&&(ot=ot(t,P))){kg(J,ot,a,K);break e}pe&&pe(t,B,P),t==="focusout"&&P&&B.type==="number"&&P.memoizedProps.value!=null&&Gl(B,"number",B.value)}switch(pe=P?Wn(P):window,t){case"focusin":(Vg(pe)||pe.contentEditable==="true")&&(ka=pe,nd=P,io=null);break;case"focusout":io=nd=ka=null;break;case"mousedown":id=!0;break;case"contextmenu":case"mouseup":case"dragend":id=!1,Kg(J,a,K);break;case"selectionchange":if(IE)break;case"keydown":case"keyup":Kg(J,a,K)}var Pe;if(ct)e:{switch(t){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else Va?Gs(t,a)&&(Xe="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(Xe="onCompositionStart");Xe&&(Zi&&a.locale!=="ko"&&(Va||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&Va&&(Pe=Xl()):(Yi=K,$l="value"in Yi?Yi.value:Yi.textContent,Va=!0)),pe=Sc(P,Xe),0<pe.length&&(Xe=new Ji(Xe,t,null,a,K),J.push({event:Xe,listeners:pe}),Pe?Xe.data=Pe:(Pe=ja(a),Pe!==null&&(Xe.data=Pe)))),(Pe=fi?_E(t,a):bE(t,a))&&(Xe=Sc(P,"onBeforeInput"),0<Xe.length&&(pe=new Ji("onBeforeInput","beforeinput",null,a,K),J.push({event:pe,listeners:Xe}),pe.data=Pe)),hx(J,t,P,a,K)}v0(J,n)})}function Ro(t,n,a){return{instance:t,listener:n,currentTarget:a}}function Sc(t,n){for(var a=n+"Capture",l=[];t!==null;){var h=t,d=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||d===null||(h=Ni(t,a),h!=null&&l.unshift(Ro(t,h,d)),h=Ni(t,n),h!=null&&l.push(Ro(t,h,d))),t.tag===3)return l;t=t.return}return[]}function gx(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function b0(t,n,a,l,h){for(var d=n._reactName,v=[];a!==null&&a!==l;){var E=a,D=E.alternate,P=E.stateNode;if(E=E.tag,D!==null&&D===l)break;E!==5&&E!==26&&E!==27||P===null||(D=P,h?(P=Ni(a,d),P!=null&&v.unshift(Ro(a,P,D))):h||(P=Ni(a,d),P!=null&&v.push(Ro(a,P,D)))),a=a.return}v.length!==0&&t.push({event:n,listeners:v})}var px=/\r\n?/g,yx=/\u0000|\uFFFD/g;function T0(t){return(typeof t=="string"?t:""+t).replace(px,`
49`).replace(yx,"")}function E0(t,n){return n=T0(n),T0(t)===n}function Tt(t,n,a,l,h,d){switch(a){case"children":typeof l=="string"?n==="body"||n==="textarea"&&l===""||Hn(t,l):(typeof l=="number"||typeof l=="bigint")&&n!=="body"&&Hn(t,""+l);break;case"className":ei(t,"class",l);break;case"tabIndex":ei(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ei(t,a,l);break;case"style":Ql(t,l,d);break;case"data":if(n!=="object"){ei(t,"data",l);break}case"src":case"href":if(l===""&&(n!=="a"||a!=="href")){t.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Ra(""+l),t.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(a==="formAction"?(n!=="input"&&Tt(t,n,"name",h.name,h,null),Tt(t,n,"formEncType",h.formEncType,h,null),Tt(t,n,"formMethod",h.formMethod,h,null),Tt(t,n,"formTarget",h.formTarget,h,null)):(Tt(t,n,"encType",h.encType,h,null),Tt(t,n,"method",h.method,h,null),Tt(t,n,"target",h.target,h,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=Ra(""+l),t.setAttribute(a,l);break;case"onClick":l!=null&&(t.onclick=wi);break;case"onScroll":l!=null&&Ye("scroll",t);break;case"onScrollEnd":l!=null&&Ye("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(h.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}a=Ra(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,""+l):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
49ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":l===!0?t.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,l):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(a,l):t.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(a):t.setAttribute(a,l);break;case"popover":Ye("beforetoggle",t),Ye("toggle",t),wa(t,"popover",l);break;case"xlinkActuate":Qt(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Qt(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Qt(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Qt(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Qt(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Qt(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Qt(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Qt(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Qt(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":wa(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Su.get(a)||a,wa(t,a,l))}}function Rf(t,n,a,l,h,d){switch(a){case"style":Ql(t,l,d);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(h.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"children":typeof l=="string"?Hn(t,l):(typeof l=="number"||typeof l=="bigint")&&Hn(t,""+l);break;case"onScroll":l!=null&&Ye("scroll",t);break;case"onScrollEnd":l!=null&&Ye("scrollend",t);break;case"onClick":l!=null&&(t.onclick=wi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zl.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(h=a.endsWith("Capture"),n=a.slice(2,h?a.length-7:void 0),d=t[tn]||null,d=d!=null?d[a]:null,typeof d=="function"&&t.removeEventListener(n,d,h),typeof l=="function")){typeof d!="function"&&d!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(n,l,h);break e}a in t?t[a]=l:l===!0?t.setAttribute(a,""):wa(t,a,l)}}}function _n(t,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",t),Ye("load",t);var l=!1,h=!1,d;for(d in a)if(a.hasOwnProperty(d)){var v=a[d];if(v!=null)switch(d){case"src":l=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:Tt(t,n,d,v,a,null)}}h&&Tt(t,n,"srcSet",a.srcSet,a,null),l&&Tt(t,n,"src",a.src,a,null);return;case"input":Ye("invalid",t);var E=d=v=h=null,D=null,P=null;for(l in a)if(a.hasOwnProperty(l)){var K=a[l];if(K!=null)switch(l){case"name":h=K;break;case"type":v=K;break;case"checked":D=K;break;case"defaultChecked":P=K;break;case"value":d=K;break;case"defaultValue":E=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(s(137,n));break;default:Tt(t,n,l,K,a,null)}}Eu(t,d,E,D,P,v,h,!1);return;case"select":Ye("invalid",t),l=v=d=null;for(h in a)if(a.hasOwnProperty(h)&&(E=a[h],E!=null))switch(h){case"value":d=E;break;case"defaultValue":v=E;break;case"multiple":l=E;default:Tt(t,n,h,E,a,null)}n=d,a=v,t.multiple=!!l,n!=null?Br(t,!!l,n,!1):a!=null&&Br(t,!!l,a,!0);return;case"textarea":Ye("invalid",t),d=h=l=null;for(v in a)if(a.hasOwnProperty(v)&&(E=a[v],E!=null))switch(v){case"value":l=E;break;case"defaultValue":h=E;break;case"children":d=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(s(91));break;default:Tt(t,n,v,E,a,null)}Hr(t,l,h,d);return;case"option":for(D in a)if(a.hasOwnProperty(D)&&(l=a[D],l!=null))switch(D){case"selected":t.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Tt(t,n,D,l,a,null)}return;case"dialog":Ye("beforetoggle",t),Ye("toggle",t),Ye("cancel",t),Ye("close",t);break;case"iframe":case"object":Ye("load",t);break;case"video":case"audio":for(l=0;l<Io.length;l++)Ye(Io[l],t);break;case"image":Ye("error",t),Ye("load",t);break;case"details":Ye("toggle",t);break;case"embed":case"source":case"link":Ye("error",t),Ye("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(P in a)if(a.hasOwnProperty(P)&&(l=a[P],l!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,n));default:Tt(t,n,P,l,a,null)}return;default:if(Ia(n)){for(K in a)a.hasOwnProperty(K)&&(l=a[K],l!==void 0&&Rf(t,n,K,l,a,void 0));return}}for(E in a)a.hasOwnProperty(E)&&(l=a[E],l!=null&&Tt(t,n,E,l,a,null))}function vx(t,n,a,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,d=null,v=null,E=null,D=null,P=null,K=null;for(F in a){var J=a[F];if(a.hasOwnProperty(F)&&J!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":D=J;default:l.hasOwnProperty(F)||Tt(t,n,F,null,l,J)}}for(var B in l){var F=l[B];if(J=a[B],l.hasOwnProperty(B)&&(F!=null||J!=null))switch(B){case"type":d=F;break;case"name":h=F;break;case"checked":P=F;break;case"defaultChecked":K=F;break;case"value":v=F;break;case"defaultValue":E=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(s(137,n));break;default:F!==J&&Tt(t,n,B,F,l,J)}}Na(t,v,E,D,P,K,d,h);return;case"select":F=v=E=B=null;for(d in a)if(D=a[d],a.hasOwnProperty(d)&&D!=null)switch(d){case"value":break;case"multiple":F=D;default:l.hasOwnProperty(d)||Tt(t,n,d,null,l,D)}for(h in l)if(d=l[h],D=a[h],l.hasOwnProperty(h)&&(d!=null||D!=null))switch(h){case"value":B=d;break;case"defaultValue":E=d;break;case"multiple":v=d;default:d!==D&&Tt(t,n,h,d,l,D)}n=E,a=v,l=F,B!=null?Br(t,!!a,B,!1):!!l!=!!a&&(n!=null?Br(t,!!a,n,!0):Br(t,!!a,a?[]:"",!1));return;case"textarea":F=B=null;for(E in a)if(h=a[E],a.hasOwnProperty(E)&&h!=null&&!l.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:Tt(t,n,E,null,l,h)}for(v in l)if(h=l[v],d=a[v],l.hasOwnProperty(v)&&(h!=null||d!=null))switch(v){case"value":B=h;break;case"defaultValue":F=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(s(91));break;default:h!==d&&Tt(t,n,v,h,l,d)}xu(t,B,F);return;case"option":for(var me in a)if(B=a[me],a.hasOwnProperty(me)&&B!=null&&!l.hasOwnProperty(me))switch(me){case"selected":t.selected=!1;break;default:Tt(t,n,me,null,l,B)}for(D in l)if(B=l[D],F=a[D],l.hasOwnProperty(D)&&B!==F&&(B!=null||F!=null))switch(D){case"selected":t.selected=B&&typeof B!="function"&&typeof B!="symbol";break;default:Tt(t,n,D,B,l,F)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ie in a)B=a[Ie],a.hasOwnProperty(Ie)&&B!=null&&!l.hasOwnProperty(Ie)&&Tt(t,n,Ie,null,l,B);for(P in l)if(B=l[P],F=a[P],l.hasOwnProperty(P)&&B!==F&&(B!=null||F!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(s(137,n));break;default:Tt(t,n,P,B,l,F)}return;default:if(Ia(n)){for(var Et in a)B=a[Et],a.hasOwnProperty(Et)&&B!==void 0&&!l.hasOwnProperty(Et)&&Rf(t,n,Et,void 0,l,B);for(K in l)B=l[K],F=a[K],!l.hasOwnProperty(K)||B===F||B===void 0&&F===void 0||Rf(t,n,K,B,l,F);return}}for(var k in a)B=a[k],a.hasOwnProperty(k)&&B!=null&&!l.hasOwnProperty(k)&&Tt(t,n,k,null,l,B);for(J in l)B=l[J],F=a[J],!l.hasOwnProperty(J)||B===F||B==null&&F==null||Tt(t,n,J,B,l,F)}function x0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _x(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var h=a[l],d=h.transferSize,v=h.initiatorType,E=h.duration;if(d&&E&&x0(v)){for(v=0,E=h.responseEnd,l+=1;l<a.length;l++){var D=a[l],P=D.startTime;if(P>E)break;var K=D.transferSize,J=D.initiatorType;K&&x0(J)&&(D=D.responseEnd,v+=K*(D<E?1:(E-P)/(D-P)))}if(--l,n+=8*(d+v)/(h.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Cf=null,Df=null;function wc(t){return t.nodeType===9?t:t.ownerDocument}function A0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function S0(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Mf(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Of=null;function bx(){var t=window.event;return t&&t.type==="popstate"?t===Of?!1:(Of=t,!0):(Of=null,!1)}var w0=typeof setTimeout=="function"?setTimeout:void 0,Tx=typeof clearTimeout=="function"?clearTimeout:void 0,N0=typeof Promise=="function"?Promise:void 0,Ex=typeof queueMicrotask=="function"?queueMicrotask:typeof N0<"u"?function(t){return N0.resolve(null).then(t).cat
vendor: 13,730 bytes, line 49
49ch(xx)}:w0;function xx(t){setTimeout(function(){throw t})}function hs(t){return t==="head"}function I0(t,n){var a=n,l=0;do{var h=a.nextSibling;if(t.removeChild(a),h&&h.nodeType===8)if(a=h.data,a==="/$"||a==="/&"){if(l===0){t.removeChild(h),ul(n);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")Co(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Co(a);for(var d=a.firstChild;d;){var v=d.nextSibling,E=d.nodeName;d[Bi]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&d.rel.toLowerCase()==="stylesheet"||a.removeChild(d),d=v}}else a==="body"&&Co(t.ownerDocument.body);a=h}while(a);ul(n)}function R0(t,n){var a=t;t=0;do{var l=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=l}while(a)}function jf(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":jf(a),Sa(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function Ax(t,n,a,l){for(;t.nodeType===1;){var h=a;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[Bi])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(d=t.getAttribute("rel"),d==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(d!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(d=t.getAttribute("src"),(d!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&d&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var d=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===d)return t}else return t;if(t=bi(t.nextSibling),t===null)break}return null}function Sx(t,n,a){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=bi(t.nextSibling),t===null))return null;return t}function C0(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=bi(t.nextSibling),t===null))return null;return t}function Vf(t){return t.data==="$?"||t.data==="$~"}function kf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function wx(t,n){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||a.readyState!=="loading")n();else{var l=function(){n(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function bi(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var Lf=null;function D0(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(n===0)return bi(t.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}t=t.nextSibling}return null}function M0(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return t;n--}else a!=="/$"&&a!=="/&"||n++}t=t.previousSibling}return null}function O0(t,n,a){switch(n=wc(a),t){case"html":if(t=n.documentElement,!t)throw Error(s(452));return t;case"head":if(t=n.head,!t)throw Error(s(453));return t;case"body":if(t=n.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function Co(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Sa(t)}var Ti=new Map,j0=new Set;function Nc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Nr=re.d;re.d={f:Nx,r:Ix,D:Rx,C:Cx,L:Dx,m:Mx,X:jx,S:Ox,M:Vx};function Nx(){var t=Nr.f(),n=vc();return t||n}function Ix(t){var n=ci(t);n!==null&&n.tag===5&&n.type==="form"?Jp(n):Nr.r(t)}var al=typeof document>"u"?null:document;function V0(t,n,a){var l=al;if(l&&typeof n=="string"&&n){var h=Bn(n);h='link[rel="'+t+'"][href="'+h+'"]',typeof a=="string"&&(h+='[crossorigin="'+a+'"]'),j0.has(h)||(j0.add(h),t={rel:t,crossOrigin:a,href:n},l.querySelector(h)===null&&(n=l.createElement("link"),_n(n,"link",t),Kt(n),l.head.appendChild(n)))}}function Rx(t){Nr.D(t),V0("dns-prefetch",t,null)}function Cx(t,n){Nr.C(t,n),V0("preconnect",t,n)}function Dx(t,n,a){Nr.L(t,n,a);var l=al;if(l&&t&&n){var h='link[rel="preload"][as="'+Bn(n)+'"]';n==="image"&&a&&a.imageSrcSet?(h+='[imagesrcset="'+Bn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(h+='[imagesizes="'+Bn(a.imageSizes)+'"]')):h+='[href="'+Bn(t)+'"]';var d=h;switch(n){case"style":d=ll(t);break;case"script":d=ol(t)}Ti.has(d)||(t=A({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:t,as:n},a),Ti.set(d,t),l.querySelector(h)!==null||n==="style"&&l.querySelector(Do(d))||n==="script"&&l.querySelector(Mo(d))||(n=l.createElement("link"),_n(n,"link",t),Kt(n),l.head.appendChild(n)))}}function Mx(t,n){Nr.m(t,n);var a=al;if(a&&t){var l=n&&typeof n.as=="string"?n.as:"script",h='link[rel="modulepreload"][as="'+Bn(l)+'"][href="'+Bn(t)+'"]',d=h;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=ol(t)}if(!Ti.has(d)&&(t=A({rel:"modulepreload",href:t},n),Ti.set(d,t),a.querySelector(h)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Mo(d)))return}l=a.createElement("link"),_n(l,"link",t),Kt(l),a.head.appendChild(l)}}}function Ox(t,n,a){Nr.S(t,n,a);var l=al;if(l&&t){var h=qi(l).hoistableStyles,d=ll(t);n=n||"default";var v=h.get(d);if(!v){var E={loading:0,preload:null};if(v=l.querySelector(Do(d)))E.loading=5;else{t=A({rel:"stylesheet",href:t,"data-precedence":n},a),(a=Ti.get(d))&&Uf(t,a);var D=v=l.createElement("link");Kt(D),_n(D,"link",t),D._p=new Promise(function(P,K){D.onload=P,D.onerror=K}),D.addEventListener("load",function(){E.loading|=1}),D.addEventListener("error",function(){E.loading|=2}),E.loading|=4,Ic(v,n,l)}v={type:"stylesheet",instance:v,count:1,state:E},h.set(d,v)}}}function jx(t,n){Nr.X(t,n);var a=al;if(a&&t){var l=qi(a).hoistableScripts,h=ol(t),d=l.get(h);d||(d=a.querySelector(Mo(h)),d||(t=A({src:t,async:!0},n),(n=Ti.get(h))&&Pf(t,n),d=a.createElement("script"),Kt(d),_n(d,"link",t),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(h,d))}}function Vx(t,n){Nr.M(t,n);var a=al;if(a&&t){var l=qi(a).hoistableScripts,h=ol(t),d=l.get(h);d||(d=a.querySelector(Mo(h)),d||(t=A({src:t,async:!0,type:"module"},n),(n=Ti.get(h))&&Pf(t,n),d=a.createElement("script"),Kt(d),_n(d,"link",t),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},l.set(h,d))}}function k0(t,n,a,l){var h=(h=he.current)?Nc(h):null;if(!h)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=ll(a.href),a=qi(h).hoistableStyles,l=a.get(n),l||(l={type:"style",instance:null,count:0,state:null},a.set(n,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=ll(a.href);var d=qi(h).hoistableStyles,v=d.get(t);if(v||(h=h.ownerDocument||h,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(t,v),(d=h.querySelector(Do(t)))&&!d._p&&(v.instance=d,v.state.loading=5),Ti.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ti.set(t,a),d||kx(h,t,a,v.state))),n&&l===null)throw Error(s(528,""));return v}if(n&&l!==null)throw Error(s(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=ol(a),a=qi(h).hoistableScripts,l=a.get(n),l||(l={type:"script",instance:null,count:0,state:null},a.set(n,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function ll(t){return'href="'+Bn(t)+'"'}function Do(t){return'link[rel="stylesheet"]['+t+"]"}function L0(t){return A({},t,{"data-precedence":t.precedence,precedence:null})}function kx(t,n,a,l){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?l.loading=1:(n=t.createElement("link"),l.preload=n,n.addEventListener("load",function(){return l.loading|=1}),n.addEventListener("error",function(){return l.loading|=2}),_n(n,"link",a),Kt(n),t.head.appendChild(n))}function ol(t){return'[src="'+Bn(t)+'"]'}function Mo(t){return"script[async]"+t}function U0(t,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var l=t.querySelector('style[data-href~="'+Bn(a.href)+'"]');if(l)return n.instance=l,Kt(l),l;var h=A({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Kt(l),_n(l,"style",h),Ic(l,a.precedence,t),n.instance=l;case"stylesheet":h=ll(a.href);var d=t.querySelector(Do(h));if(d)return n.state.loading|=4,n.instance=d,Kt(d),d;l=L0(a),(h=Ti.get(h))&&Uf(l,h),d=(t.ownerDocument||t).createElement("link"),Kt(d);var v=d;return v._p=new Promise(function(E,D){v.onload=E,v.onerror=D}),_n(d,"link",l),n.state.loading|=4,Ic(d,a.precedence,t),n.instance=d;case"script":return d=ol(a.src),(h=t.querySelector(Mo(d)))?(n.instance=h,Kt(h),h):(l=a,(h=Ti.get(d))&&(l=A({},a),Pf(l,h)),t=t.ownerDocument||t,h=t.createElement("script"),Kt(h),_n(h,"link",l),t.head.appendChild(h),n.instance=h);case"void":return null;default:throw Error(s(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(l=n.instance,n.state.loading|=4,Ic(l,a.precedence,t));return n.instance}function Ic(t,n,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=l.length?l[l.length-1]:null,d=h,v=0;v<l.length;v++){var E=l[v];if(E.dataset.precedence===n)d=E;else if(d!==h)break}d?d.parentNode.insertBefore(t,d.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(t,n.firstChild))}function Uf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Pf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Rc=null;function P0(t,n,a){if(Rc===null){var l=new Map,h=Rc=new Map;h.set(a,l)}else h=Rc,l=h.get(a),l||(l=new Map,h.set(a,l));if(l.has(t))return l;for(l.set(t,null),a=a.getElementsByTagName(t),h=0;h<a.length;h++){var d=a[h];if(!(d[Bi]||d[Ct]||t==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var v=d.getAttribute(n)||"";v=t+v;var E=l.get(v);E?E.push(d):l.set(v,[d])}}return l}function z0(t,n,a){t=t.ownerDocument||t,t.head.insertBefore(a,n==="title"?t.querySelector("head > title"):null)}function Lx(t,n,a){if(a===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function B0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Ux(t,n,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var h=ll(l.href),d=n.querySelector(Do(h));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Cc.bind(t),n.then(t,t)),a.state.loading|=4,a.instance=d,Kt(d);return}d=n.ownerDocument||n,l=L0(l),(h=Ti.get(h))&&Uf(l,h),d=d.createElement("link"),Kt(d);var v=d;v._p=new Promise(function(E,D){v.onload=E,v.onerror=D}),_n(d,"link",l),a.instance=d}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=Cc.bind(t),n.addEventListener("load",a),n.addEventListener("error",a))}}var zf=0;function Px(t,n){return t.stylesheets&&t.count===0&&Mc(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var l=setTimeout(function(){if(t.stylesheets&&Mc(t,t.stylesheets),t.unsuspend){var d=t.unsuspend;t.unsuspend=null,d()}},6e4+n);0<t.imgBytes&&zf===0&&(zf=62500*_x());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Mc(t,t.stylesheets),t.unsuspend)){var d=t.unsuspend;t.unsuspend=null,d()}},(t.imgBytes>zf?50:800)+n);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(h)}}:null}function Cc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Dc=null;function Mc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Dc=new Map,n.forEac
vendor: 6,896 bytes, line 49
49h(zx,t),Dc=null,Cc.call(t))}function zx(t,n){if(!(n.state.loading&4)){var a=Dc.get(t);if(a)var l=a.get(null);else{a=new Map,Dc.set(t,a);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<h.length;d++){var v=h[d];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(a.set(v.dataset.precedence,v),l=v)}l&&a.set(null,l)}h=n.instance,v=h.getAttribute("data-precedence"),d=a.get(v)||l,d===l&&a.set(null,h),a.set(v,h),this.count++,l=Cc.bind(this),h.addEventListener("load",l),h.addEventListener("error",l),d?d.parentNode.insertBefore(h,d.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),n.state.loading|=4}}var Oo={$$typeof:we,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function Bx(t,n,a,l,h,d,v,E,D){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=mt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mt(0),this.hiddenUpdates=mt(null),this.identifierPrefix=l,this.onUncaughtError=h,this.onCaughtError=d,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function H0(t,n,a,l,h,d,v,E,D,P,K,J){return t=new Bx(t,n,a,v,D,P,K,J,E),n=1,d===!0&&(n|=24),d=ni(3,null,null,n),t.current=d,d.stateNode=t,n=vd(),n.refCount++,t.pooledCache=n,n.refCount++,d.memoizedState={element:l,isDehydrated:a,cache:n},Ed(d),t}function q0(t){return t?(t=Pa,t):Pa}function F0(t,n,a,l,h,d){h=q0(h),l.context===null?l.context=h:l.pendingContext=h,l=es(n),l.payload={element:a},d=d===void 0?null:d,d!==null&&(l.callback=d),a=ts(t,l,n),a!==null&&(Qn(a,t,n),co(a,t,n))}function G0(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<n?a:n}}function Bf(t,n){G0(t,n),(t=t.alternate)&&G0(t,n)}function K0(t){if(t.tag===13||t.tag===31){var n=Ys(t,67108864);n!==null&&Qn(n,t,67108864),Bf(t,67108864)}}function Q0(t){if(t.tag===13||t.tag===31){var n=li();n=sn(n);var a=Ys(t,n);a!==null&&Qn(a,t,n),Bf(t,n)}}var Oc=!0;function Hx(t,n,a,l){var h=G.T;G.T=null;var d=re.p;try{re.p=2,Hf(t,n,a,l)}finally{re.p=d,G.T=h}}function qx(t,n,a,l){var h=G.T;G.T=null;var d=re.p;try{re.p=8,Hf(t,n,a,l)}finally{re.p=d,G.T=h}}function Hf(t,n,a,l){if(Oc){var h=qf(l);if(h===null)If(t,n,l,jc,a),$0(t,l);else if(Gx(h,t,n,a,l))l.stopPropagation();else if($0(t,l),n&4&&-1<Fx.indexOf(t)){for(;h!==null;){var d=ci(h);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var v=xn(d.pendingLanes);if(v!==0){var E=d;for(E.pendingLanes|=2,E.entangledLanes|=2;v;){var D=1<<31-te(v);E.entanglements[1]|=D,v&=~D}nr(d),(ht&6)===0&&(pc=wt()+500,No(0))}}break;case 31:case 13:E=Ys(d,2),E!==null&&Qn(E,d,2),vc(),Bf(d,2)}if(d=qf(l),d===null&&If(t,n,l,jc,a),d===h)break;h=d}h!==null&&l.stopPropagation()}else If(t,n,l,null,a)}}function qf(t){return t=hi(t),Ff(t)}var jc=null;function Ff(t){if(jc=null,t=Hi(t),t!==null){var n=c(t);if(n===null)t=null;else{var a=n.tag;if(a===13){if(t=f(n),t!==null)return t;t=null}else if(a===31){if(t=y(n),t!==null)return t;t=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return jc=t,null}function Y0(t){switch(t){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ft()){case zi:return 2;case Si:return 8;case Jn:case Ll:return 32;case Vs:return 268435456;default:return 32}default:return 32}}var Gf=!1,ds=null,fs=null,ms=null,jo=new Map,Vo=new Map,gs=[],Fx="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".split(" ");function $0(t,n){switch(t){case"focusin":case"focusout":ds=null;break;case"dragenter":case"dragleave":fs=null;break;case"mouseover":case"mouseout":ms=null;break;case"pointerover":case"pointerout":jo.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vo.delete(n.pointerId)}}function ko(t,n,a,l,h,d){return t===null||t.nativeEvent!==d?(t={blockedOn:n,domEventName:a,eventSystemFlags:l,nativeEvent:d,targetContainers:[h]},n!==null&&(n=ci(n),n!==null&&K0(n)),t):(t.eventSystemFlags|=l,n=t.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),t)}function Gx(t,n,a,l,h){switch(n){case"focusin":return ds=ko(ds,t,n,a,l,h),!0;case"dragenter":return fs=ko(fs,t,n,a,l,h),!0;case"mouseover":return ms=ko(ms,t,n,a,l,h),!0;case"pointerover":var d=h.pointerId;return jo.set(d,ko(jo.get(d)||null,t,n,a,l,h)),!0;case"gotpointercapture":return d=h.pointerId,Vo.set(d,ko(Vo.get(d)||null,t,n,a,l,h)),!0}return!1}function X0(t){var n=Hi(t.target);if(n!==null){var a=c(n);if(a!==null){if(n=a.tag,n===13){if(n=f(a),n!==null){t.blockedOn=n,jn(t.priority,function(){Q0(a)});return}}else if(n===31){if(n=y(a),n!==null){t.blockedOn=n,jn(t.priority,function(){Q0(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Vc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var a=qf(t.nativeEvent);if(a===null){a=t.nativeEvent;var l=new a.constructor(a.type,a);Yl=l,a.target.dispatchEvent(l),Yl=null}else return n=ci(a),n!==null&&K0(n),t.blockedOn=a,!1;n.shift()}return!0}function J0(t,n,a){Vc(t)&&a.delete(n)}function Kx(){Gf=!1,ds!==null&&Vc(ds)&&(ds=null),fs!==null&&Vc(fs)&&(fs=null),ms!==null&&Vc(ms)&&(ms=null),jo.forEac
vendor: 4,782 bytes, lines 49-53
49h(J0),Vo.forEach(J0)}function kc(t,n){t.blockedOn===n&&(t.blockedOn=null,Gf||(Gf=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Kx)))}var Lc=null;function Z0(t){Lc!==t&&(Lc=t,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){Lc===t&&(Lc=null);for(var n=0;n<t.length;n+=3){var a=t[n],l=t[n+1],h=t[n+2];if(typeof l!="function"){if(Ff(l||a)===null)continue;break}var d=ci(a);d!==null&&(t.splice(n,3),n-=3,Hd(d,{pending:!0,data:h,method:a.method,action:l},l,h))}}))}function ul(t){function n(D){return kc(D,t)}ds!==null&&kc(ds,t),fs!==null&&kc(fs,t),ms!==null&&kc(ms,t),jo.forEach(n),Vo.forEach(n);for(var a=0;a<gs.length;a++){var l=gs[a];l.blockedOn===t&&(l.blockedOn=null)}for(;0<gs.length&&(a=gs[0],a.blockedOn===null);)X0(a),a.blockedOn===null&&gs.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var h=a[l],d=a[l+1],v=h[tn]||null;if(typeof d=="function")v||Z0(a);else if(v){var E=null;if(d&&d.hasAttribute("formAction")){if(h=d,v=d[tn]||null)E=v.formAction;else if(Ff(h)!==null)continue}else E=v.action;typeof E=="function"?a[l+1]=E:(a.splice(l,3),l-=3),Z0(a)}}}function W0(){function t(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(v){return h=v})},focusReset:"manual",scroll:"manual"})}function n(){h!==null&&(h(),h=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),h!==null&&(h(),h=null)}}}function Kf(t){this._internalRoot=t}Uc.prototype.render=Kf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(s(409));var a=n.current,l=li();F0(a,l,t,n,null,null)},Uc.prototype.unmount=Kf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;F0(t.current,2,null,t,null,null),vc(),n[Vn]=null}};function Uc(t){this._internalRoot=t}Uc.prototype.unstable_scheduleHydration=function(t){if(t){var n=an();t={blockedOn:null,target:t,priority:n};for(var a=0;a<gs.length&&n!==0&&n<gs[a].priority;a++);gs.splice(a,0,t),a===0&&X0(t)}};var ev=e.version;if(ev!=="19.2.4")throw Error(s(527,ev,"19.2.4"));re.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=p(n),t=t!==null?T(t):null,t=t===null?null:t.stateNode,t};var Qx={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pc.isDisabled&&Pc.supportsFiber)try{Zn=Pc.inject(Qx),Vt=Pc}catch{}}return Uo.createRoot=function(t,n){if(!o(t))throw Error(s(299));var a=!1,l="",h=ly,d=oy,v=uy;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(h=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=H0(t,1,!1,null,null,a,l,null,h,d,v,W0),t[Vn]=n.current,Nf(t),new Kf(n)},Uo.hydrateRoot=function(t,n,a){if(!o(t))throw Error(s(299));var l=!1,h="",d=ly,v=oy,E=uy,D=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(d=a.onUncaughtError),a.onCaughtError!==void 0&&(v=a.onCaughtError),a.onRecoverableError!==void 0&&(E=a.onRecoverableError),a.formState!==void 0&&(D=a.formState)),n=H0(t,1,!0,n,a??null,l,h,D,d,v,E,W0),n.context=q0(null),a=n.current,l=li(),l=sn(l),h=es(l),h.callback=null,ts(a,h,l),a=l,n.current.lanes=a,et(n,a),nr(n),t[Vn]=n.current,Nf(t),new Uc(n)},Uo.version="19.2.4",Uo}var cv;function r1(){if(cv)return $f.exports;cv=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),$f.exports=i1(),$f.exports}var s1=r1();const a1=H_(s1);var _e=(r=>(r.MEMBER="MEMBER",r.ADMIN="ADMIN",r.MODERATOR="MODERATOR",r))(_e||{}),Ge=(r=>(r.GAME="GAME",r.TRAINING="TRAINING",r.EVENT="EVENT",r.MAINTENANCE="MAINTENANCE",r))(Ge||{});const l1=()=>{};var hv={};/**
50 * @license
51 * Copyright 2017 Google LLC
52 *
53 * Licensed under the Apache License, Version 2.0 (the "License");
54 * you may not use this file except in compliance with the License.
55 * You may obtain a copy of the License at
56 *
57 *   http://www.apache.org/licenses/LICENSE-2.0
58 *
59 * Unless required by applicable law or agreed to in writing, software
60 * distributed under the License is distributed on an "AS IS" BASIS,
61 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
62 * See the License for the specific language governing permissions and
63 * limitations under the License.
64 */const q_=function(r){const e=[];let i=0;for(let s=0;s<r.length;s++){let o=r.charCodeAt(s);o<128?e[i++]=o:o<2048?(e[i++]=o>>6|192,e[i++]=o&63|128):(o&64512)===55296&&s+1<r.length&&(r.charCodeAt(s+1)&64512)===56320?(o=65536+((o&1023)<<10)+(r.charCodeAt(++s)&1023),e[i++]=o>>18|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128,e[i++]=o&63|128):(e[i++]=o>>12|224,e[i++]=o>>6&63|128,e[i++]=o&63|128)}return e},o1=function(r){const e=[];let i=0,s=0;for(;i<r.length;){const o=r[i++];if(o<128)e[s++]=String.fromCharCode(o);else if(o>191&&o<224){const c=r[i++];e[s++]=String.fromCharCode((o&31)<<6|c&63)}else if(o>239&&o<365){const c=r[i++],f=r[i++],y=r[i++],_=((o&7)<<18|(c&63)<<12|(f&63)<<6|y&63)-65536;e[s++]=String.fromCharCode(55296+(_>>10)),e[s++]=String.fromCharCode(56320+(_&1023))}else{const c=r[i++],f=r[i++];e[s++]=String.fromCharCode((o&15)<<12|(c&63)<<6|f&63)}}return e.join("")},F_={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(r,e){if(!Array.isArray(r))throw Error("encodeByteArray takes an array as a parameter");this.init_();const i=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,s=[];for(let o=0;o<r.length;o+=3){const c=r[o],f=o+1<r.length,y=f?r[o+1]:0,_=o+2<r.length,p=_?r[o+2]:0,T=c>>2,A=(c&3)<<4|y>>4;let S=(y&15)<<2|p>>6,z=p&63;_||(z=64,f||(S=64)),s.push(i[T],i[A],i[S],i[z])}return s.join("")},encodeString(r,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(r):this.encodeByteArray(q_(r),e)},decodeString(r,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(r):o1(this.decodeStringToByteArray(r,e))},decodeStringToByteArray(r,e){this.init_();const i=e?this.charToByteMapWebSafe_:this.charToByteMap_,s=[];for(let o=0;o<r.length;){const c=i[r.charAt(o++)],y=o<r.length?i[r.charAt(o)]:0;++o;const p=o<r.length?i[r.charAt(o)]:64;++o;const A=o<r.length?i[r.charAt(o)]:64;if(++o,c==null||y==null||p==null||A==null)throw new u1;const S=c<<2|y>>4;if(s.push(S),p!==64){const z=y<<4&240|p>>2;if(s.push(z),A!==64){const Q=p<<6&192|A;s.push(Q)}}}return s},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let r=0;r<this.ENCODED_VALS.length;r++)this.byteToCharMap_[r]=this.ENCODED_VALS.charAt(r),this.charToByteMap_[this.byteToCharMap_[r]]=r,this.byteToCharMapWebSafe_[r]=this.ENCODED_VALS_WEBSAFE.charAt(r),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[r]]=r,r>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(r)]=r,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(r)]=r)}}};class u1 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const c1=function(r){const e=q_(r);return F_.encodeByteArray(e,!0)},rh=function(r){return c1(r).replace(/\./g,"")},G_=function(r){try{return F_.decodeString(r,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
65 * @license
66 * Copyright 2022 Google LLC
67 *
68 * Licensed under the Apache License, Version 2.0 (the "License");
69 * you may not use this file except in compliance with the License.
70 * You may obtain a copy of the License at
71 *
72 *   http://www.apache.org/licenses/LICENSE-2.0
73 *
74 * Unless required by applicable law or agreed to in writing, software
75 * distributed under the License is distributed on an "AS IS" BASIS,
76 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
77 * See the License for the specific language governing permissions and
78 * limitations under the License.
79 */function h1(){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.")}/**
80 * @license
81 * Copyright 2022 Google LLC
82 *
83 * Licensed under the Apache License, Version 2.0 (the "License");
84 * you may not use this file except in compliance with the License.
85 * You may obtain a copy of the License at
86 *
87 *   http://www.apache.org/licenses/LICENSE-2.0
88 *
89 * Unless required by applicable law or agreed to in writing, software
90 * distributed under the License is distributed on an "AS IS" BASIS,
91 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
92 * See the License for the specific language governing permissions and
93 * limitations under the License.
94 */const d1=()=>h1().__FIREBASE_DEFAULTS__,f1=()=>{if(typeof process>"u"||typeof hv>"u")return;const r=hv.__FIREBASE_DEFAULTS__;if(r)return JSON.parse(r)},m1=()=>{if(typeof document>"u")return;let r;try{r=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=r&&G_(r[1]);return e&&JSON.parse(e)},Sh=()=>{try{return l1()||d1()||f1()||m1()}catch(r){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${r}`);return}},K_=r=>{var e,i;return(i=(e=Sh())==null?void 0:e.emulatorHosts)==null?void 0:i[r]},g1=r=>{const e=K_(r);if(!e)return;const i=e.lastIndexOf(":");if(i<=0||i+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const s=parseInt(e.substring(i+1),10);return e[0]==="["?[e.substring(1,i-1),s]:[e.substring(0,i),s]},Q_=()=>{var r;return(r=Sh())==null?void 0:r.config},Y_=r=>{var e;return(e=Sh())==null?void 0:e[`_${r}`]};/**
95 * @license
96 * Copyright 2017 Google LLC
97 *
98 * Licensed under the Apache License, Version 2.0 (the "License");
99 * you may not use this file except in compliance with the License.
100 * You may obtain a copy of the License at
101 *
102 *   http://www.apache.org/licenses/LICENSE-2.0
103 *
104 * Unless required by applicable law or agreed to in writing, software
105 * distributed under the License is distributed on an "AS IS" BASIS,
106 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
107 * See the License for the specific language governing permissions and
108 * limitations under the License.
109 */class p1{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,i)=>{this.resolve=e,this.reject=i})}wrapCallback(e){return(i,s)=>{i?this.reject(i):this.resolve(s),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(i):e(i,s))}}}/**
110 * @license
111 * Copyright 2025 Google LLC
112 *
113 * Licensed under the Apache License, Version 2.0 (the "License");
114 * you may not use this file except in compliance with the License.
115 * You may obtain a copy of the License at
116 *
117 *   http://www.apache.org/licenses/LICENSE-2.0
118 *
119 * Unless required by applicable law or agreed to in writing, software
120 * distributed under the License is distributed on an "AS IS" BASIS,
121 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
122 * See the License for the specific language governing permissions and
123 * limitations under the License.
124 */function Rl(r){try{return(r.startsWith("http://")||r.startsWith("https://")?new URL(r).hostname:r).endsWith(".cloudworkstations.dev")}catch{return!1}}async function $_(r){return(await fetch(r,{credentials:"include"})).ok}/**
125 * @license
126 * Copyright 2021 Google LLC
127 *
128 * Licensed under the Apache License, Version 2.0 (the "License");
129 * you may not use this file except in compliance with the License.
130 * You may obtain a copy of the License at
131 *
132 *   http://www.apache.org/licenses/LICENSE-2.0
133 *
134 * Unless required by applicable law or agreed to in writing, software
135 * distributed under the License is distributed on an "AS IS" BASIS,
136 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
137 * See the License for the specific language governing permissions and
138 * limitations under the License.
139 */function y1(r,e){if(r.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const i={alg:"none",type:"JWT"},s=e||"demo-project",o=r.iat||0,c=r.sub||r.user_id;if(!c)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const f={iss:`https://securetoken.google.com/${s}`,aud:s,iat:o,exp:o+3600,auth_time:o,sub:c,user_id:c,firebase:{sign_in_provider:"custom",identities:{}},...r};return[rh(JSON.stringify(i)),rh(JSON.stringify(f)),""].join(".")}const Fo={};function v1(){const r={prod:[],emulator:[]};for(const e of Object.keys(Fo))Fo[e]?r.emulator.push(e):r.prod.push(e);return r}function _1(r){let e=document.getElementById(r),i=!1;return e||(e=document.createElement("div"),e.setAttribute("id",r),i=!0),{created:i,element:e}}let dv=!1;function X_(r,e){if(typeof window>"u"||typeof document>"u"||!Rl(window.location.host)||Fo[r]===e||Fo[r]||dv)return;Fo[r]=e;function i(S){return`__firebase__banner__${S}`}const s="__firebase__banner",c=v1().prod.length>0;function f(){const S=document.getElementById(s);S&&S.remove()}function y(S){S.style.display="flex",S.style.background="#7faaf0",S.style.position="fixed",S.style.bottom="5px",S.style.left="5px",S.style.padding=".5em",S.style.borderRadius="5px",S.style.alignItems="center"}function _(S,z){S.setAttribute("width","24"),S.setAttribute("id",z),S.setAttribute("height","24"),S.setAttribute("viewBox","0 0 24 24"),S.setAttribute("fill","none"),S.style.marginLeft="-6px"}function p(){const S=document.createElement("span");
139return S.style.cursor="pointer",S.style.marginLeft="16px",S.style.fontSize="24px",S.innerHTML=" &times;",S.onclick=()=>{dv=!0,f()},S}function T(S,z){S.setAttribute("id",z),S.innerText="Learn more",S.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",S.setAttribute("target","__blank"),S.style.paddingLeft="5px",S.style.textDecoration="underline"}function A(){const S=_1(s),z=i("text"),Q=document.getElementById(z)||document.createElement("span"),ie=i("learnmore"),X=document.getElementById(ie)||document.createElement("a"),ge=i("preprendIcon"),Te=document.getElementById(ge)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(S.created){const we=S.element;y(we),T(X,ie);const He=p();_(Te,ge),we.append(Te,Q,X,He),document.body.appendChild(we)}c?(Q.innerText="Preview backend disconnected.",Te.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
140<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"/>
141</g>
142<defs>
143<clipPath id="clip0_6013_33858">
144<rect width="24" height="24" fill="white"/>
145</clipPath>
146</defs>`):(Te.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
147<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.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"/>
148</g>
149<defs>
150<clipPath id="clip0_6083_34804">
151<rect width="24" height="24" fill="white"/>
152</clipPath>
153</defs>`,Q.innerText="Preview backend running in this workspace."),Q.setAttribute("id",z)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",A):A()}/**
154 * @license
155 * Copyright 2017 Google LLC
156 *
157 * Licensed under the Apache License, Version 2.0 (the "License");
158 * you may not use this file except in compliance with the License.
159 * You may obtain a copy of the License at
160 *
161 *   http://www.apache.org/licenses/LICENSE-2.0
162 *
163 * Unless required by applicable law or agreed to in writing, software
164 * distributed under the License is distributed on an "AS IS" BASIS,
165 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
166 * See the License for the specific language governing permissions and
167 * limitations under the License.
168 */function Dn(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function b1(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Dn())}function T1(){var e;const r=(e=Sh())==null?void 0:e.forceEnvironment;if(r==="node")return!0;
168if(r==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function E1(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function x1(){const r=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof r=="object"&&r.id!==void 0}function A1(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function S1(){const r=Dn();return r.indexOf("MSIE ")>=0||r.indexOf("Trident/")>=0}function w1(){return!T1()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function N1(){try{return typeof indexedDB=="object"}catch{return!1}}function I1(){return new Promise((r,e)=>{try{let i=!0;const s="validate-browser-context-for-indexeddb-analytics-module",o=self.indexedDB.open(s);o.onsuccess=()=>{o.result.close(),i||self.indexedDB.deleteDatabase(s),r(!0)},o.onupgradeneeded=()=>{i=!1},o.onerror=()=>{var c;e(((c=o.error)==null?void 0:c.message)||"")}}catch(i){e(i)}})}/**
169 * @license
170 * Copyright 2017 Google LLC
171 *
172 * Licensed under the Apache License, Version 2.0 (the "License");
173 * you may not use this file except in compliance with the License.
174 * You may obtain a copy of the License at
175 *
176 *   http://www.apache.org/licenses/LICENSE-2.0
177 *
178 * Unless required by applicable law or agreed to in writing, software
179 * distributed under the License is distributed on an "AS IS" BASIS,
180 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
181 * See the License for the specific language governing permissions and
182 * limitations under the License.
183 */const R1="FirebaseError";class Ur extends Error{constructor(e,i,s){super(i),this.code=e,this.customData=s,this.name=R1,Object.setPrototypeOf(this,Ur.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,au.prototype.create)}}class au{constructor(e,i,s){this.service=e,this.serviceName=i,this.errors=s}create(e,...i){const s=i[0]||{},o=`${this.service}/${e}`,c=this.errors[e],f=c?C1(c,s):"Error",y=`${this.serviceName}: ${f} (${o}).`;return new Ur(o,y,s)}}function C1(r,e){return r.replace(D1,(i,s)=>{const o=e[s];return o!=null?String(o):`<${s}?>`})}const D1=/\{\$([^}]+)}/g;function M1(r){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e))return!1;return!0}function fa(r,e){if(r===e)return!0;const i=Object.keys(r),s=Object.keys(e);for(const o of i){if(!s.includes(o))return!1;const c=r[o],f=e[o];if(fv(c)&&fv(f)){if(!fa(c,f))return!1}else if(c!==f)return!1}for(const o of s)if(!i.includes(o))return!1;return!0}function fv(r){return r!==null&&typeof r=="object"}/**
184 * @license
185 * Copyright 2017 Google LLC
186 *
187 * Licensed under the Apache License, Version 2.0 (the "License");
188 * you may not use this file except in compliance with the License.
189 * You may obtain a copy of the License at
190 *
191 *   http://www.apache.org/licenses/LICENSE-2.0
192 *
193 * Unless required by applicable law or agreed to in writing, software
194 * distributed under the License is distributed on an "AS IS" BASIS,
195 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
196 * See the License for the specific language governing permissions and
197 * limitations under the License.
198 */function lu(r){const e=[];for(const[i,s]of Object.entries(r))Array.isArray(s)?s.forEach(o=>{e.push(encodeURIComponent(i)+"="+encodeURIComponent(o))}):e.push(encodeURIComponent(i)+"="+encodeURIComponent(s));return e.length?"&"+e.join("&"):""}function O1(r,e){const i=new j1(r,e);return i.subscribe.bind(i)}class j1{constructor(e,i){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=i,this.task.then(()=>{e(this)}).catch(s=>{this.error(s)})}next(e){this.forEachObserver(i=>{i.next(e)})}error(e){this.forEachObserver(i=>{i.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,i,s){let o;if(e===void 0&&i===void 0&&s===void 0)throw new Error("Missing Observer.");V1(e,["next","error","complete"])?o=e:o={next:e,error:i,complete:s},o.next===void 0&&(o.next=Wf),o.error===void 0&&(o.error=Wf),o.complete===void 0&&(o.complete=Wf);const c=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?o.error(this.finalError):o.complete()}catch{}}),this.observers.push(o),c}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 i=0;i<this.observers.length;i++)this.sendOne(i,e)}sendOne(e,i){this.task.then(()=>
198{if(this.observers!==void 0&&this.observers[e]!==void 0)try{i(this.observers[e])}catch(s){typeof console<"u"&&console.error&&console.error(s)}})}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 V1(r,e){if(typeof r!="object"||r===null)return!1;for(const i of e)if(i in r&&typeof r[i]=="function")return!0;return!1}function Wf(){}/**
199 * @license
200 * Copyright 2021 Google LLC
201 *
202 * Licensed under the Apache License, Version 2.0 (the "License");
203 * you may not use this file except in compliance with the License.
204 * You may obtain a copy of the License at
205 *
206 *   http://www.apache.org/licenses/LICENSE-2.0
207 *
208 * Unless required by applicable law or agreed to in writing, software
209 * distributed under the License is distributed on an "AS IS" BASIS,
210 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
211 * See the License for the specific language governing permissions and
212 * limitations under the License.
213 */function cn(r){return r&&r._delegate?r._delegate:r}class ma{constructor(e,i,s){this.name=e,this.instanceFactory=i,this.type=s,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}}/**
214 * @license
215 * Copyright 2019 Google LLC
216 *
217 * Licensed under the Apache License, Version 2.0 (the "License");
218 * you may not use this file except in compliance with the License.
219 * You may obtain a copy of the License at
220 *
221 *   http://www.apache.org/licenses/LICENSE-2.0
222 *
223 * Unless required by applicable law or agreed to in writing, software
224 * distributed under the License is distributed on an "AS IS" BASIS,
225 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
226 * See the License for the specific language governing permissions and
227 * limitations under the License.
228 */const la="[DEFAULT]";/**
229 * @license
230 * Copyright 2019 Google LLC
231 *
232 * Licensed under the Apache License, Version 2.0 (the "License");
233 * you may not use this file except in compliance with the License.
234 * You may obtain a copy of the License at
235 *
236 *   http://www.apache.org/licenses/LICENSE-2.0
237 *
238 * Unless required by applicable law or agreed to in writing, software
239 * distributed under the License is distributed on an "AS IS" BASIS,
240 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
241 * See the License for the specific language governing permissions and
242 * limitations under the License.
243 */class k1{constructor(e,i){this.name=e,this.container=i,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const i=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(i)){const s=new p1;if(this.instancesDeferred.set(i,s),this.isInitialized(i)||this.shouldAutoInitialize())try{const o=this.getOrInitializeService({instanceIdentifier:i});o&&s.resolve(o)}catch{}}return this.instancesDeferred.get(i).promise}getImmediate(e){const i=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),s=(e==null?void 0:e.optional)??!1;if(this.isInitialized(i)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:i})}catch(o){if(s)return null;throw o}else{if(s)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(U1(e))try{this.getOrInitializeService({instanceIdentifier:la})}catch{}for(const[i,s]of this.instancesDeferred.entries()){const o=this.normalizeInstanceIdentifier(i);try{const c=this.getOrInitializeService({instanceIdentifier:o});s.resolve(c)}catch{}}}}clearInstance(e=la){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(i=>"INTERNAL"in i).map(i=>
243i.INTERNAL.delete()),...e.filter(i=>"_delete"in i).map(i=>i._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=la){return this.instances.has(e)}getOptions(e=la){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:i={}}=e,s=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(s))throw Error(`${this.name}(${s}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const o=this.getOrInitializeService({instanceIdentifier:s,options:i});for(const[c,f]of this.instancesDeferred.entries()){const y=this.normalizeInstanceIdentifier(c);s===y&&f.resolve(o)}return o}onInit(e,i){const s=this.normalizeInstanceIdentifier(i),o=this.onInitCallbacks.get(s)??new Set;o.add(e),this.onInitCallbacks.set(s,o);const c=this.instances.get(s);return c&&e(c,s),()=>{o.delete(e)}}invokeOnInitCallbacks(e,i){const s=this.onInitCallbacks.get(i);if(s)for(const o of s)try{o(e,i)}catch{}}getOrInitializeService({instanceIdentifier:e,options:i={}}){let s=this.instances.get(e);if(!s&&this.component&&(s=this.component.instanceFactory(this.container,{instanceIdentifier:L1(e),options:i}),this.instances.set(e,s),this.instancesOptions.set(e,i),this.invokeOnInitCallbacks(s,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,s)}catch{}return s||null}normalizeInstanceIdentifier(e=la){return this.component?this.component.multipleInstances?e:la:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function L1(r){return r===la?void 0:r}function U1(r){return r.instantiationMode==="EAGER"}/**
244 * @license
245 * Copyright 2019 Google LLC
246 *
247 * Licensed under the Apache License, Version 2.0 (the "License");
248 * you may not use this file except in compliance with the License.
249 * You may obtain a copy of the License at
250 *
251 *   http://www.apache.org/licenses/LICENSE-2.0
252 *
253 * Unless required by applicable law or agreed to in writing, software
254 * distributed under the License is distributed on an "AS IS" BASIS,
255 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
256 * See the License for the specific language governing permissions and
257 * limitations under the License.
258 */class P1{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const i=this.getProvider(e.name);if(i.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);i.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 i=new k1(e,this);return this.providers.set(e,i),i}getProviders(){return Array.from(this.providers.values())}}/**
259 * @license
260 * Copyright 2017 Google LLC
261 *
262 * Licensed under the Apache License, Version 2.0 (the "License");
263 * you may not use this file except in compliance with the License.
264 * You may obtain a copy of the License at
265 *
266 *   http://www.apache.org/licenses/LICENSE-2.0
267 *
268 * Unless required by applicable law or agreed to in writing, software
269 * distributed under the License is distributed on an "AS IS" BASIS,
270 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
271 * See the License for the specific language governing permissions and
272 * limitations under the License.
273 */var Je;(function(r){r[r.DEBUG=0]="DEBUG",r[r.VERBOSE=1]="VERBOSE",r[r.INFO=2]="INFO",r[r.WARN=3]="WARN",r[r.ERROR=4]="ERROR",r[r.SILENT=5]="SILENT"})(Je||(Je={}));const z1={debug:Je.DEBUG,verbose:Je.VERBOSE,info:Je.INFO,warn:Je.WARN,error:Je.ERROR,silent:Je.SILENT},B1=Je.INFO,H1={[Je.DEBUG]:"log",[Je.VERBOSE]:"log",[Je.INFO]:"info",[Je.WARN]:"warn",[Je.ERROR]:"error"},q1=(r,e,...i)=>{if(e<r.logLevel)return;const s=new Date().toISOString(),o=H1[e];if(o)console[o](`[${s}]  ${r.name}:`,...i);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class Um{constructor(e){this.name=e,this._logLevel=B1,this._logHandler=q1,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Je))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?z1[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,Je.DEBUG,...e),this._logHandler(this,Je.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,Je.VERBOSE,...e),this._logHandler(this,Je.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,Je.INFO,...e),this._logHandler(this,Je.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,Je.WARN,...e),this._logHandler(this,Je.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,Je.ERROR,...e),this._logHandler(this,Je.ERROR,...e)}}const F1=(r,e)=>e.some(i=>r instanceof i);let mv,gv;function G1(){return mv||(mv=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function K1(){return gv||(gv=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const J_=new WeakMap,hm=new WeakMap,Z_=new WeakMap,em=new WeakMap,Pm=new WeakMap;function Q1(r){const e=new Promise((i,s)=>{const o=()=>{r.removeEventListener("success",c),r.removeEventListener("error",f)},c=()=>{i(Es(r.result)),o()},f=()=>{s(r.error),o()};r.addEventListener("success",c),r.addEventListener("error",f)});return e.then(i=>{i instanceof IDBCursor&&J_.set(i,r)}).catch(()=>{}),Pm.set(e,r),e}function Y1(r){if(hm.has(r))return;const e=new Promise((i,s)=>{const o=()=>{r.removeEventListener("complete",c),r.removeEventListener("error",f),r.removeEventListener("abort",f)},c=()=>{i(),o()},f=()=>{s(r.error||new DOMException("AbortError","AbortError")),o()};r.addEventListener("complete",c),r.addEventListener("error",f),r.addEventListener("abort",f)});hm.set(r,e)}let dm={get(r,e,i){if(r instanceof IDBTransaction){if(e==="done")return hm.get(r);if(e==="objectStoreNames")return r.objectStoreNames||Z_.get(r);if(e==="store")return i.objectStoreNames[1]?void 0:i.objectStore(i.objectStoreNames[0])}return Es(r[e])},set(r,e,i){return r[e]=i,!0},has(r,e){return r instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in r}};function $1(r){dm=r(dm)}function X1(r){return r===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...i){const s=r.call(tm(this),e,...i);return Z_.set(s,e.sort?e.sort():[e]),Es(s)}:K1().includes(r)?function(...e){return r.apply(tm(this),e),Es(J_.get(this))}:function(...e){return Es(r.apply(tm(this),e))}}function J1(r){return typeof r=="function"?X1(r):(r instanceof IDBTransaction&&Y1(r),F1(r,G1())?new Proxy(r,dm):r)}function Es(r){if(r instanceof IDBRequest)return Q1(r);if(em.has(r))return em.get(r);const e=J1(r);return e!==r&&(em.set(r,e),Pm.set(e,r)),e}const tm=r=>Pm.get(r);function Z1(r,e,{blocked:i,upgrade:s,blocking:o,terminated:c}={}){const f=indexedDB.open(r,e),y=Es(f);return s&&f.addEventListener("upgradeneeded",_=>{s(Es(f.result),_.oldVersion,_.newVersion,Es(f.transaction),_)}),i&&f.addEventListener("blocked",_=>i(_.oldVersion,_.newVersion,_)),y.then(_=>{c&&_.addEventListener("close",()=>c()),o&&_.addEventListener("versionchange",p=>o(p.oldVersion,p.newVersion,p))}).catch(()=>{}),y}const W1=["get","getKey","getAll","getAllKeys","count"],eA=["put","add","delete","clear"],nm=new Map;function pv(r,e){if(!(r instanceof IDBDatabase&&!(e in r)&&typeof e=="string"))return;if(nm.get(e))return nm.get(e);const i=e.replace(/FromIndex$/,""),s=e!==i,o=eA.includes(i);if(!(i in(s?IDBIndex:IDBObjectStore).prototype)||!(o||W1.includes(i)))return;const c=async function(f,...y){const _=this.transaction(f,o?"readwrite":"readonly");let p=_.store;
273return s&&(p=p.index(y.shift())),(await Promise.all([p[i](...y),o&&_.done]))[0]};return nm.set(e,c),c}$1(r=>({...r,get:(e,i,s)=>pv(e,i)||r.get(e,i,s),has:(e,i)=>!!pv(e,i)||r.has(e,i)}));/**
274 * @license
275 * Copyright 2019 Google LLC
276 *
277 * Licensed under the Apache License, Version 2.0 (the "License");
278 * you may not use this file except in compliance with the License.
279 * You may obtain a copy of the License at
280 *
281 *   http://www.apache.org/licenses/LICENSE-2.0
282 *
283 * Unless required by applicable law or agreed to in writing, software
284 * distributed under the License is distributed on an "AS IS" BASIS,
285 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286 * See the License for the specific language governing permissions and
287 * limitations under the License.
288 */class tA{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(i=>{if(nA(i)){const s=i.getImmediate();return`${s.library}/${s.version}`}else return null}).filter(i=>i).join(" ")}}function nA(r){const e=r.getComponent();return(e==null?void 0:e.type)==="VERSION"}const fm="@firebase/app",yv="0.14.8";/**
289 * @license
290 * Copyright 2019 Google LLC
291 *
292 * Licensed under the Apache License, Version 2.0 (the "License");
293 * you may not use this file except in compliance with the License.
294 * You may obtain a copy of the License at
295 *
296 *   http://www.apache.org/licenses/LICENSE-2.0
297 *
298 * Unless required by applicable law or agreed to in writing, software
299 * distributed under the License is distributed on an "AS IS" BASIS,
300 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
301 * See the License for the specific language governing permissions and
302 * limitations under the License.
303 */const Mr=new Um("@firebase/app"),iA="@firebase/app-compat",rA="@firebase/analytics-compat",sA="@firebase/analytics",aA="@firebase/app-check-compat",lA="@firebase/app-check",oA="@firebase/auth",uA="@firebase/auth-compat",cA="@firebase/database",hA="@firebase/data-connect",dA="@firebase/database-compat",fA="@firebase/functions",mA="@firebase/functions-compat",gA="@firebase/installations",pA="@firebase/installations-compat",yA="@firebase/messaging",vA="@firebase/messaging-compat",_A="@firebase/performance",bA="@firebase/performance-compat",TA="@firebase/remote-config",EA="@firebase/remote-config-compat",xA="@firebase/storage",AA="@firebase/storage-compat",SA="@firebase/firestore",wA="@firebase/ai",NA="@firebase/firestore-compat",IA="firebase",RA="12.9.0";/**
304 * @license
305 * Copyright 2019 Google LLC
306 *
307 * Licensed under the Apache License, Version 2.0 (the "License");
308 * you may not use this file except in compliance with the License.
309 * You may obtain a copy of the License at
310 *
311 *   http://www.apache.org/licenses/LICENSE-2.0
312 *
313 * Unless required by applicable law or agreed to in writing, software
314 * distributed under the License is distributed on an "AS IS" BASIS,
315 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
316 * See the License for the specific language governing permissions and
317 * limitations under the License.
318 */const mm="[DEFAULT]",CA={[fm]:"fire-core",[iA]:"fire-core-compat",[sA]:"fire-analytics",[rA]:"fire-analytics-compat",[lA]:"fire-app-check",[aA]:"fire-app-check-compat",[oA]:"fire-auth",[uA]:"fire-auth-compat",[cA]:"fire-rtdb",[hA]:"fire-data-connect",[dA]:"fire-rtdb-compat",[fA]:"fire-fn",[mA]:"fire-fn-compat",[gA]:"fire-iid",[pA]:"fire-iid-compat",[yA]:"fire-fcm",[vA]:"fire-fcm-compat",[_A]:"fire-perf",[bA]:"fire-perf-compat",[TA]:"fire-rc",[EA]:"fire-rc-compat",[xA]:"fire-gcs",[AA]:"fire-gcs-compat",[SA]:"fire-fst",[NA]:"fire-fst-compat",[wA]:"fire-vertex","fire-js":"fire-js",[IA]:"fire-js-all"};/**
319 * @license
320 * Copyright 2019 Google LLC
321 *
322 * Licensed under the Apache License, Version 2.0 (the "License");
323 * you may not use this file except in compliance with the License.
324 * You may obtain a copy of the License at
325 *
326 *   http://www.apache.org/licenses/LICENSE-2.0
327 *
328 * Unless required by applicable law or agreed to in writing, software
329 * distributed under the License is distributed on an "AS IS" BASIS,
330 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
331 * See the License for the specific language governing permissions and
332 * limitations under the License.
333 */const sh=new Map,DA=new Map,gm=new Map;function vv(r,e){try{r.container.addComponent(e)}catch(i){Mr.debug(`Component ${e.name} failed to register with FirebaseApp ${r.name}`,i)}}function bl(r){const e=r.name;if(gm.has(e))return Mr.debug(`There were multiple attempts to register component ${e}.`),!1;gm.set(e,r);for(const i of sh.values())vv(i,r);for(const i of DA.values())vv(i,r);return!0}function zm(r,e){const i=r.container.getProvider("heartbeat").getImmediate({optional:!0});return i&&i.triggerHeartbeat(),r.container.getProvider(e)}function Vi(r){return r==null?!1:r.settings!==void 0}/**
334 * @license
335 * Copyright 2019 Google LLC
336 *
337 * Licensed under the Apache License, Version 2.0 (the "License");
338 * you may not use this file except in compliance with the License.
339 * You may obtain a copy of the License at
340 *
341 *   http://www.apache.org/licenses/LICENSE-2.0
342 *
343 * Unless required by applicable law or agreed to in writing, software
344 * distributed under the License is distributed on an "AS IS" BASIS,
345 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
346 * See the License for the specific language governing permissions and
347 * limitations under the License.
348 */const MA={"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
348d-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."},xs=new au("app","Firebase",MA);/**
349 * @license
350 * Copyright 2019 Google LLC
351 *
352 * Licensed under the Apache License, Version 2.0 (the "License");
353 * you may not use this file except in compliance with the License.
354 * You may obtain a copy of the License at
355 *
356 *   http://www.apache.org/licenses/LICENSE-2.0
357 *
358 * Unless required by applicable law or agreed to in writing, software
359 * distributed under the License is distributed on an "AS IS" BASIS,
360 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
361 * See the License for the specific language governing permissions and
362 * limitations under the License.
363 */class OA{constructor(e,i,s){this._isDeleted=!1,this._options={...e},this._config={...i},this._name=i.name,this._automaticDataCollectionEnabled=i.automaticDataCollectionEnabled,this._container=s,this.container.addComponent(new ma("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 xs.create("app-deleted",{appName:this._name})}}/**
364 * @license
365 * Copyright 2019 Google LLC
366 *
367 * Licensed under the Apache License, Version 2.0 (the "License");
368 * you may not use this file except in compliance with the License.
369 * You may obtain a copy of the License at
370 *
371 *   http://www.apache.org/licenses/LICENSE-2.0
372 *
373 * Unless required by applicable law or agreed to in writing, software
374 * distributed under the License is distributed on an "AS IS" BASIS,
375 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
376 * See the License for the specific language governing permissions and
377 * limitations under the License.
378 */const Cl=RA;function W_(r,e={}){let i=r;typeof e!="object"&&(e={name:e});const s={name:mm,automaticDataCollectionEnabled:!0,...e},o=s.name;if(typeof o!="string"||!o)throw xs.create("bad-app-name",{appName:String(o)});if(i||(i=Q_()),!i)throw xs.create("no-options");const c=sh.get(o);if(c){if(fa(i,c.options)&&fa(s,c.config))return c;throw xs.create("duplicate-app",{appName:o})}const f=new P1(o);for(const _ of gm.values())f.addComponent(_);const y=new OA(i,s,f);return sh.set(o,y),y}function eb(r=mm){const e=sh.get(r);if(!e&&r===mm&&Q_())return W_();if(!e)throw xs.create("no-app",{appName:r});return e}function As(r,e,i){let s=CA[r]??r;i&&(s+=`-${i}`);const o=s.match(/\s|\//),c=e.match(/\s|\//);if(o||c){const f=[`Unable to register library "${s}" with version "${e}":`];o&&f.push(`library name "${s}" contains illegal characters (whitespace or "/")`),o&&c&&f.push("and"),c&&f.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Mr.warn(f.join(" "));return}bl(new ma(`${s}-version`,()=>({library:s,version:e}),"VERSION"))}/**
379 * @license
380 * Copyright 2021 Google LLC
381 *
382 * Licensed under the Apache License, Version 2.0 (the "License");
383 * you may not use this file except in compliance with the License.
384 * You may obtain a copy of the License at
385 *
386 *   http://www.apache.org/licenses/LICENSE-2.0
387 *
388 * Unless required by applicable law or agreed to in writing, softw
388are
389 * distributed under the License is distributed on an "AS IS" BASIS,
390 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
391 * See the License for the specific language governing permissions and
392 * limitations under the License.
393 */const jA="firebase-heartbeat-database",VA=1,Jo="firebase-heartbeat-store";let im=null;function tb(){return im||(im=Z1(jA,VA,{upgrade:(r,e)=>{switch(e){case 0:try{r.createObjectStore(Jo)}catch(i){console.warn(i)}}}}).catch(r=>{throw xs.create("idb-open",{originalErrorMessage:r.message})})),im}async function kA(r){try{const i=(await tb()).transaction(Jo),s=await i.objectStore(Jo).get(nb(r));return await i.done,s}catch(e){if(e instanceof Ur)Mr.warn(e.message);else{const i=xs.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});Mr.warn(i.message)}}}async function _v(r,e){try{const s=(await tb()).transaction(Jo,"readwrite");await s.objectStore(Jo).put(e,nb(r)),await s.done}catch(i){if(i instanceof Ur)Mr.warn(i.message);else{const s=xs.create("idb-set",{originalErrorMessage:i==null?void 0:i.message});Mr.warn(s.message)}}}function nb(r){return`${r.name}!${r.options.appId}`}/**
394 * @license
395 * Copyright 2021 Google LLC
396 *
397 * Licensed under the Apache License, Version 2.0 (the "License");
398 * you may not use this file except in compliance with the License.
399 * You may obtain a copy of the License at
400 *
401 *   http://www.apache.org/licenses/LICENSE-2.0
402 *
403 * Unless required by applicable law or agreed to in writing, software
404 * distributed under the License is distributed on an "AS IS" BASIS,
405 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
406 * See the License for the specific language governing permissions and
407 * limitations under the License.
408 */const LA=1024,UA=30;class PA{constructor(e){this.container=e,this._heartbeatsCache=null;const i=this.container.getProvider("app").getImmediate();this._storage=new BA(i),this._heartbeatsCachePromise=this._storage.read().then(s=>(this._heartbeatsCache=s,s))}async triggerHeartbeat(){var e,i;try{const o=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),c=bv();if(((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((i=this._heartbeatsCache)==null?void 0:i.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===c||this._heartbeatsCache.heartbeats.some(f=>f.date===c))return;if(this._heartbeatsCache.heartbeats.push({date:c,agent:o}),this._heartbeatsCache.heartbeats.length>UA){const f=HA(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(f,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(s){Mr.warn(s)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const i=bv(),{heartbeatsToSend:s,unsentEntries:o}=zA(this._heartbeatsCache.heartbeats),c=rh(JSON.stringify({version:2,heartbeats:s}));return this._heartbeatsCache.lastSentHeartbeatDate=i,o.length>0?(this._heartbeatsCache.heartbeats=o,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),c}catch(i){return Mr.warn(i),""}}}function bv(){return new Date().toISOString().substring(0,10)}function zA(r,e=LA){const i=[];let s=r.slice();for(const o of r){const c=i.find(f=>f.agent===o.agent);if(c){if(c.dates.push(o.date),Tv(i)>e){c.dates.pop();break}}else if(i.push({agent:o.agent,dates:[o.date]}),Tv(i)>e){i.pop();break}s=s.slice(1)}return{heartbeatsToSend:i,unsentEntries:s}}class BA{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return N1()?I1().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const i=await kA(this.app);return i!=null&&i.heartbeats?i:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const s=await this.read();return _v(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??s.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){const s=await this.read();return _v(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??s.lastSentHeartbeatDate,heartbeats:[...s.heartbeats,...e.heartbeats]})}else return}}function Tv(r){return rh(JSON.stringify({version:2,heartbeats:r})).length}function HA(r){if(r.length===0)return-1;let e=0,i=r[0].date;for(let s=1;s<r.length;s++)r[s].date<i&&(i=r[s].date,e=s);return e}/**
409 * @license
410 * Copyright 2019 Google LLC
411 *
412 * Licensed under the Apache License, Version 2.0 (the "License");
413 * you may not use this file except in compliance with the License.
414 * You may obtain a copy of the License at
415 *
416 *   http://www.apache.org/licenses/LICENSE-2.0
417 *
418 * Unless required by applicable law or agreed to in writing, software
419 * distributed under the License is distributed on an "AS IS" BASIS,
420 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
421 * See the License for the specific language governing permissions and
422 * limitations under the License.
423 */function qA(r){bl(new ma("platform-logger",e=>new tA(e),"PRIVATE")),bl(new ma("heartbeat",e=>new PA(e),"PRIVATE")),As(fm,yv,r),As(fm,yv,"esm2020"),As("fire-js","")}qA("");function ib(){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 FA=ib,rb=new au("auth","Firebase",ib());/**
424 * @license
425 * Copyright 2020 Google LLC
426 *
427 * Licensed under the Apache License, Version 2.0 (the "License");
428 * you may not use this file except in compliance with the License.
429 * You may obtain a copy of the License at
430 *
431 *   http://www.apache.org/licenses/LICENSE-2.0
432 *
433 * Unless required by applicable law or agreed to in writing, software
434 * distributed under the License is distributed on an "AS IS" BASIS,
435 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
436 * See the License for the specific language governing permissions and
437 * limitations under the License.
438 */const ah=new Um("@firebase/auth");function GA(r,...e){ah.logLevel<=Je.WARN&&ah.warn(`Auth (${Cl}): ${r}`,...e)}function Qc(r,...e){ah.logLevel<=Je.ERROR&&ah.error(`Auth (${Cl}): ${r}`,...e)}/**
439 * @license
440 * Copyright 2020 Google LLC
441 *
442 * Licensed under the Apache License, Version 2.0 (the "License");
443 * you may not use this file except in compliance with the License.
444 * You may obtain a copy of the License at
445 *
446 *   http://www.apache.org/licenses/LICENSE-2.0
447 *
448 * Unless required by applicable law or agreed to in writing, software
449 * distributed under the License is distributed on an "AS IS" BASIS,
450 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
451 * See the License for the specific language governing permissions and
452 * limitations under the License.
453 */function or(r,...e){throw Hm(r,...e)}function Li(r,...e){return Hm(r,...e)}function Bm(r,e,i){const s={...FA(),[e]:i};return new au("auth","Firebase",s).create(e,{appName:r.name})}function ca(r){return Bm(r,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function KA(r,e,i){const s=i;if(!(e instanceof s))throw s.name!==e.constructor.name&&or(r,"argument-error"),Bm(r,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Hm(r,...e){if(typeof r!="string"){const i=e[0],s=[...e.slice(1)];return s[0]&&(s[0].appName=r.name),r._errorFactory.create(i,...s)}return rb.create(r,...e)}function De(r,e,...i){if(!r)throw Hm(e,...i)}function Rr(r){const e="INTERNAL ASSERTION FAILED: "+r;throw Qc(e),new Error(e)}function Or(r,e){r||Rr(e)}/**
454 * @license
455 * Copyright 2020 Google LLC
456 *
457 * Licensed under the Apache License, Version 2.0 (the "License");
458 * you may not use this file except in compliance with the License.
459 * You may obtain a copy of the License at
460 *
461 *   http://www.apache.org/licenses/LICENSE-2.0
462 *
463 * Unless required by applicable law or agreed to in writing, software
464 * distributed under the License is distributed on an "AS IS" BASIS,
465 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
466 * See the License for the specific language governing permissions and
467 * limitations under the License.
468 */function pm(){var r;return typeof self<"u"&&((r=self.location)==null?void 0:r.href)||""}function QA(){return Ev()==="http:"||Ev()==="https:"}function Ev(){var r;return typeof self<"u"&&((r=self.location)==null?void 0:r.protocol)||null}/**
469 * @license
470 * Copyright 2020 Google LLC
471 *
472 * Licensed under the Apache License, Version 2.0 (the "License");
473 * you may not use this file except in compliance with the License.
474 * You may obtain a copy of the License at
475 *
476 *   http://www.apache.org/licenses/LICENSE-2.0
477 *
478 * Unless required by applicable law or agreed to in writing, software
479 * distributed under the License is distributed on an "AS IS" BASIS,
480 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
481 * See the License for the specific language governing permissions and
482 * limitations under the License.
483 */function YA(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(QA()||x1()||"connection"in navigator)?navigator.onLine:!0}function $A(){if(typeof navigator>"u")return null;const r=navigator;return r.languages&&r.languages[0]||r.language||null}/**
484 * @license
485 * Copyright 2020 Google LLC
486 *
487 * Licensed under the Apache License, Version 2.0 (the "License");
488 * you may not use this file except in compliance with the License.
489 * You may obtain a copy of the License at
490 *
491 *   http://www.apache.org/licenses/LICENSE-2.0
492 *
493 * Unless required by applicable law or agreed to in writing, software
494 * distributed under the License is distributed on an "AS IS" BASIS,
495 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
496 * See the License for the specific language governing permissions and
497 * limitations under the License.
498 */class ou{constructor(e,i){this.shortDelay=e,this.longDelay=i,Or(i>e,"Short delay should be less than long delay!"),this.isMobile=b1()||A1()}get(){return YA()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
499 * @license
500 * Copyright 2020 Google LLC
501 *
502 * Licensed under the Apache License, Version 2.0 (the "License");
503 * you may not use this file except in compliance with the License.
504 * You may obtain a copy of the License at
505 *
506 *   http://www.apache.org/licenses/LICENSE-2.0
507 *
508 * Unless required by applicable law or agreed to in writing, software
509 * distributed under the License is distributed on an "AS IS" BASIS,
510 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
511 * See the License for the specific language governing permissions and
512 * limitations under the License.
513 */function qm(r,e){Or(r.emulator,"Emulator should always be set here");const{url:i}=r.emulator;return e?`${i}${e.startsWith("/")?e.slice(1):e}`:i}/**
514 * @license
515 * Copyright 2020 Google LLC
516 *
517 * Licensed under the Apache License, Version 2.0 (the "License");
518 * you may not use this file except in compliance with the License.
519 * You may obtain a copy of the License at
520 *
521 *   http://www.apache.org/licenses/LICENSE-2.0
522 *
523 * Unless required by applicable law or agreed to in writing, software
524 * distributed under the License is distributed on an "AS IS" BASIS,
525 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
526 * See the License for the specific language governing permissions and
527 * limitations under the License.
528 */class sb{static initialize(e,i,s){this.fetchImpl=e,i&&(this.headersImpl=i),s&&(this.responseImpl=s)}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;Rr("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;Rr("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;Rr("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
529 * @license
530 * Copyright 2020 Google LLC
531 *
532 * Licensed under the Apache License, Version 2.0 (the "License");
533 * you may not use this file except in compliance with the License.
534 * You may obtain a copy of the License at
535 *
536 *   http://www.apache.org/licenses/LICENSE-2.0
537 *
538 * Unless required by applicable law or agreed to in writing, software
539 * distributed under the License is distributed on an "AS IS" BASIS,
540 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
541 * See the License for the specific language governing permissions and
542 * limitations under the License.
543 */const XA={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"};/**
544 * @license
545 * Copyright 2020 Google LLC
546 *
547 * Licensed under the Apache License, Version 2.0 (the "License");
548 * you may not use this file except in compliance with the License.
549 * You may obtain a copy of the License at
550 *
551 *   http://www.apache.org/licenses/LICENSE-2.0
552 *
553 * Unless required by applicable law or agreed to in writing, software
554 * distributed under the License is distributed on an "AS IS" BASIS,
555 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
556 * See the License for the specific language governing permissions and
557 * limitations under the License.
558 */const JA=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],ZA=new ou(3e4,6e4);function Fm(r,e){return r.tenantId&&!e.tenantId?{...e,tenantId:r.tenantId}:e}async function Dl(r,e,i,s,o={}){return ab(r,o,async()=>{let c={},f={};
558s&&(e==="GET"?f=s:c={body:JSON.stringify(s)});const y=lu({key:r.config.apiKey,...f}).slice(1),_=await r._getAdditionalHeaders();_["Content-Type"]="application/json",r.languageCode&&(_["X-Firebase-Locale"]=r.languageCode);const p={method:e,headers:_,...c};return E1()||(p.referrerPolicy="no-referrer"),r.emulatorConfig&&Rl(r.emulatorConfig.host)&&(p.credentials="include"),sb.fetch()(await lb(r,r.config.apiHost,i,y),p)})}async function ab(r,e,i){r._canInitEmulator=!1;const s={...XA,...e};try{const o=new eS(r),c=await Promise.race([i(),o.promise]);o.clearNetworkTimeout();const f=await c.json();if("needConfirmation"in f)throw zc(r,"account-exists-with-different-credential",f);if(c.ok&&!("errorMessage"in f))return f;{const y=c.ok?f.errorMessage:f.error.message,[_,p]=y.split(" : ");if(_==="FEDERATED_USER_ID_ALREADY_LINKED")throw zc(r,"credential-already-in-use",f);if(_==="EMAIL_EXISTS")throw zc(r,"email-already-in-use",f);if(_==="USER_DISABLED")throw zc(r,"user-disabled",f);const T=s[_]||_.toLowerCase().replace(/[_\s]+/g,"-");if(p)throw Bm(r,T,p);or(r,T)}}catch(o){if(o instanceof Ur)throw o;or(r,"network-request-failed",{message:String(o)})}}async function WA(r,e,i,s,o={}){const c=await Dl(r,e,i,s,o);return"mfaPendingCredential"in c&&or(r,"multi-factor-auth-required",{_serverResponse:c}),c}async function lb(r,e,i,s){const o=`${e}${i}?${s}`,c=r,f=c.config.emulator?qm(r.config,o):`${r.config.apiScheme}://${o}`;return JA.includes(i)&&(await c._persistenceManagerAvailable,c._getPersistenceType()==="COOKIE")?c._getPersistence()._getFinalTarget(f).toString():f}class eS{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((i,s)=>{this.timer=setTimeout(()=>s(Li(this.auth,"network-request-failed")),ZA.get())})}}function zc(r,e,i){const s={appName:r.name};i.email&&(s.email=i.email),i.phoneNumber&&(s.phoneNumber=i.phoneNumber);const o=Li(r,e,s);return o.customData._tokenResponse=i,o}/**
559 * @license
560 * Copyright 2020 Google LLC
561 *
562 * Licensed under the Apache License, Version 2.0 (the "License");
563 * you may not use this file except in compliance with the License.
564 * You may obtain a copy of the License at
565 *
566 *   http://www.apache.org/licenses/LICENSE-2.0
567 *
568 * Unless required by applicable law or agreed to in writing, software
569 * distributed under the License is distributed on an "AS IS" BASIS,
570 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
571 * See the License for the specific language governing permissions and
572 * limitations under the License.
573 */async function tS(r,e){return Dl(r,"POST","/v1/accounts:delete",e)}async function lh(r,e){return Dl(r,"POST","/v1/accounts:lookup",e)}/**
574 * @license
575 * Copyright 2020 Google LLC
576 *
577 * Licensed under the Apache License, Version 2.0 (the "License");
578 * you may not use this file except in compliance with the License.
579 * You may obtain a copy of the License at
580 *
581 *   http://www.apache.org/licenses/LICENSE-2.0
582 *
583 * Unless required by applicable law or agreed to in writing, software
584 * distributed under the License is distributed on an "AS IS" BASIS,
585 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
586 * See the License for the specific language governing permissions and
587 * limitations under the License.
588 */function Go(r){if(r)try{const e=new Date(Number(r));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function nS(r,e=!1){const i=cn(r),s=await i.getIdToken(e),o=Gm(s);De(o&&o.exp&&o.auth_time&&o.iat,i.auth,"internal-error");const c=typeof o.firebase=="object"?o.firebase:void 0,f=c==null?void 0:c.sign_in_provider;return{claims:o,token:s,authTime:Go(rm(o.auth_time)),issuedAtTime:Go(rm(o.iat)),expirationTime:Go(rm(o.exp)),signInProvider:f||null,signInSecondFactor:(c==null?void 0:c.sign_in_second_factor)||null}}function rm(r){return Number(r)*1e3}function Gm(r){const[e,i,s]=r.split(".");if(e===void 0||i===void 0||s===void 0)return Qc("JWT malformed, contained fewer than 3 sections"),null;try{const o=G_(i);return o?JSON.parse(o):(Qc("Failed to decode base64 JWT payload"),null)}catch(o){return Qc("Caught error parsing JWT payload as JSON",o==null?void 0:o.toString()),null}}function xv(r){const e=Gm(r);return De(e,"internal-error"),De(typeof e.exp<"u","internal-error"),De(typeof e.iat
588<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
589 * @license
590 * Copyright 2020 Google LLC
591 *
592 * Licensed under the Apache License, Version 2.0 (the "License");
593 * you may not use this file except in compliance with the License.
594 * You may obtain a copy of the License at
595 *
596 *   http://www.apache.org/licenses/LICENSE-2.0
597 *
598 * Unless required by applicable law or agreed to in writing, software
599 * distributed under the License is distributed on an "AS IS" BASIS,
600 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
601 * See the License for the specific language governing permissions and
602 * limitations under the License.
603 */async function Zo(r,e,i=!1){if(i)return e;try{return await e}catch(s){throw s instanceof Ur&&iS(s)&&r.auth.currentUser===r&&await r.auth.signOut(),s}}function iS({code:r}){return r==="auth/user-disabled"||r==="auth/user-token-expired"}/**
604 * @license
605 * Copyright 2020 Google LLC
606 *
607 * Licensed under the Apache License, Version 2.0 (the "License");
608 * you may not use this file except in compliance with the License.
609 * You may obtain a copy of the License at
610 *
611 *   http://www.apache.org/licenses/LICENSE-2.0
612 *
613 * Unless required by applicable law or agreed to in writing, software
614 * distributed under the License is distributed on an "AS IS" BASIS,
615 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
616 * See the License for the specific language governing permissions and
617 * limitations under the License.
618 */class rS{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){if(e){const i=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),i}else{this.errorBackoff=3e4;const s=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,s)}}schedule(e=!1){if(!this.isRunning)return;const i=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},i)}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()}}/**
619 * @license
620 * Copyright 2020 Google LLC
621 *
622 * Licensed under the Apache License, Version 2.0 (the "License");
623 * you may not use this file except in compliance with the License.
624 * You may obtain a copy of the License at
625 *
626 *   http://www.apache.org/licenses/LICENSE-2.0
627 *
628 * Unless required by applicable law or agreed to in writing, software
629 * distributed under the License is distributed on an "AS IS" BASIS,
630 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
631 * See the License for the specific language governing permissions and
632 * limitations under the License.
633 */class ym{constructor(e,i){this.createdAt=e,this.lastLoginAt=i,this._initializeTime()}_initializeTime(){this.lastSignInTime=Go(this.lastLoginAt),this.creationTime=Go(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
634 * @license
635 * Copyright 2019 Google LLC
636 *
637 * Licensed under the Apache License, Version 2.0 (the "License");
638 * you may not use this file except in compliance with the License.
639 * You may obtain a copy of the License at
640 *
641 *   http://www.apache.org/licenses/LICENSE-2.0
642 *
643 * Unless required by applicable law or agreed to in writing, software
644 * distributed under the License is distributed on an "AS IS" BASIS,
645 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
646 * See the License for the specific language governing permissions and
647 * limitations under the License.
648 */async function oh(r){var A;const e=r.auth,i=await r.getIdToken(),s=await Zo(r,lh(e,{idToken:i}));De(s==null?void 0:s.users.length,e,"internal-error");const o=s.users[0];r._notifyReloadListener(o);const c=(A=o.providerUserInfo)!=null&&A.length?ob(o.providerUserInfo):[],f=aS(r.providerData,c),y=r.isAnonymous,_=!(r.email&&o.passwordHash)&&!(f!=null&&f.length),p=y?_:!1,T={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:f,metadata:new ym(o.createdAt,o.lastLoginAt),isAnonymous:p};Object.assign(r,T)}async function sS(r){const e=cn(r);await oh(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function aS(r,e){return[...r.filter(s=>
648!e.some(o=>o.providerId===s.providerId)),...e]}function ob(r){return r.map(({providerId:e,...i})=>({providerId:e,uid:i.rawId||"",displayName:i.displayName||null,email:i.email||null,phoneNumber:i.phoneNumber||null,photoURL:i.photoUrl||null}))}/**
649 * @license
650 * Copyright 2020 Google LLC
651 *
652 * Licensed under the Apache License, Version 2.0 (the "License");
653 * you may not use this file except in compliance with the License.
654 * You may obtain a copy of the License at
655 *
656 *   http://www.apache.org/licenses/LICENSE-2.0
657 *
658 * Unless required by applicable law or agreed to in writing, software
659 * distributed under the License is distributed on an "AS IS" BASIS,
660 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
661 * See the License for the specific language governing permissions and
662 * limitations under the License.
663 */async function lS(r,e){const i=await ab(r,{},async()=>{const s=lu({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:o,apiKey:c}=r.config,f=await lb(r,o,"/v1/token",`key=${c}`),y=await r._getAdditionalHeaders();y["Content-Type"]="application/x-www-form-urlencoded";const _={method:"POST",headers:y,body:s};return r.emulatorConfig&&Rl(r.emulatorConfig.host)&&(_.credentials="include"),sb.fetch()(f,_)});return{accessToken:i.access_token,expiresIn:i.expires_in,refreshToken:i.refresh_token}}async function oS(r,e){return Dl(r,"POST","/v2/accounts:revokeToken",Fm(r,e))}/**
664 * @license
665 * Copyright 2020 Google LLC
666 *
667 * Licensed under the Apache License, Version 2.0 (the "License");
668 * you may not use this file except in compliance with the License.
669 * You may obtain a copy of the License at
670 *
671 *   http://www.apache.org/licenses/LICENSE-2.0
672 *
673 * Unless required by applicable law or agreed to in writing, software
674 * distributed under the License is distributed on an "AS IS" BASIS,
675 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
676 * See the License for the specific language governing permissions and
677 * limitations under the License.
678 */class gl{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){De(e.idToken,"internal-error"),De(typeof e.idToken<"u","internal-error"),De(typeof e.refreshToken<"u","internal-error");const i="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):xv(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,i)}updateFromIdToken(e){De(e.length!==0,"internal-error");const i=xv(e);this.updateTokensAndExpiration(e,null,i)}async getToken(e,i=!1){return!i&&this.accessToken&&!this.isExpired?this.accessToken:(De(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,i){const{accessToken:s,refreshToken:o,expiresIn:c}=await lS(e,i);this.updateTokensAndExpiration(s,o,Number(c))}updateTokensAndExpiration(e,i,s){this.refreshToken=i||null,this.accessToken=e||null,this.expirationTime=Date.now()+s*1e3}static fromJSON(e,i){const{refreshToken:s,accessToken:o,expirationTime:c}=i,f=new gl;return s&&(De(typeof s=="string","internal-error",{appName:e}),f.refreshToken=s),o&&(De(typeof o=="string","internal-error",{appName:e}),f.accessToken=o),c&&(De(typeof c=="number","internal-error",{appName:e}),f.expirationTime=c),f}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 gl,this.toJSON())}_performRefresh(){return Rr("not implemented")}}/**
679 * @license
680 * Copyright 2020 Google LLC
681 *
682 * Licensed under the Apache License, Version 2.0 (the "License");
683 * you may not use this file except in compliance with the License.
684 * You may obtain a copy of the License at
685 *
686 *   http://www.apache.org/licenses/LICENSE-2.0
687 *
688 * Unless required by applicable law or agreed to in writing, softw
688are
689 * distributed under the License is distributed on an "AS IS" BASIS,
690 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
691 * See the License for the specific language governing permissions and
692 * limitations under the License.
693 */function ys(r,e){De(typeof r=="string"||typeof r>"u","internal-error",{appName:e})}class ki{constructor({uid:e,auth:i,stsTokenManager:s,...o}){this.providerId="firebase",this.proactiveRefresh=new rS(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=i,this.stsTokenManager=s,this.accessToken=s.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.providerData=o.providerData?[...o.providerData]:[],this.metadata=new ym(o.createdAt||void 0,o.lastLoginAt||void 0)}async getIdToken(e){const i=await Zo(this,this.stsTokenManager.getToken(this.auth,e));return De(i,this.auth,"internal-error"),this.accessToken!==i&&(this.accessToken=i,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),i}getIdTokenResult(e){return nS(this,e)}reload(){return sS(this)}_assign(e){this!==e&&(De(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(i=>({...i})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const i=new ki({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return i.metadata._copy(this.metadata),i}_onReload(e){De(!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,i=!1){let s=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),s=!0),i&&await oh(this),await this.auth._persistUserIfCurrent(this),s&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Vi(this.auth.app))return Promise.reject(ca(this.auth));const e=await this.getIdToken();return await Zo(this,tS(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...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,i){const s=i.displayName??void 0,o=i.email??void 0,c=i.phoneNumber??void 0,f=i.photoURL??void 0,y=i.tenantId??void 0,_=i._redirectEventId??void 0,p=i.createdAt??void 0,T=i.lastLoginAt??void 0,{uid:A,emailVerified:S,isAnonymous:z,providerData:Q,stsTokenManager:ie}=i;De(A&&ie,e,"internal-error");const X=gl.fromJSON(this.name,ie);De(typeof A=="string",e,"internal-error"),ys(s,e.name),ys(o,e.name),De(typeof S=="boolean",e,"internal-error"),De(typeof z=="boolean",e,"internal-error"),ys(c,e.name),ys(f,e.name),ys(y,e.name),ys(_,e.name),ys(p,e.name),ys(T,e.name);const ge=new ki({uid:A,auth:e,email:o,emailVerified:S,displayName:s,isAnonymous:z,photoURL:f,phoneNumber:c,tenantId:y,stsTokenManager:X,createdAt:p,lastLoginAt:T});return Q&&Array.isArray(Q)&&(ge.providerData=Q.map(Te=>({...Te}))),_&&(ge._redirectEventId=_),ge}static async _fromIdTokenResponse(e,i,s=!1){const o=new gl;o.updateFromServerResponse(i);const c=new ki({uid:i.localId,auth:e,stsTokenManager:o,isAnonymous:s});return await oh(c),c}static async _fromGetAccountInfoResponse(e,i,s){const o=i.users[0];De(o.localId!==void 0,"internal-error");const c=o.providerUserInfo!==void 0?ob(o.providerUserInfo):[],f=!(o.email&&o.passwordHash)&&!(c!=null&&c.length),y=new gl;y.updateFromIdToken(s);const _=new ki({uid:o.localId,auth:e,stsTokenManager:y,isAnonymous:f}),p={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:c,metadata:new ym(o.createdAt,o.lastLoginAt),isAnonymous:!(o.email&&o.passwordHash)&&!(c!=null&&c.length)};return Object.assign(_,p),_}}/**
694 * @license
695 * Copyright 2020 Google LLC
696 *
697 * Licensed under the Apache License, Version 2.0 (the "License");
698 * you may not use this file except in compliance with the License.
699 * You may obtain a copy of the License at
700 *
701 *   http://www.apache.org/licenses/LICENSE-2.0
702 *
703 * Unless required by applicable law or agreed to in writing, software
704 * distributed under the License is distributed on an "AS IS" BASIS,
705 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
706 * See the License for the specific language governing permissions and
707 * limitations under the License.
708 */const Av=new Map;function Cr(r){Or(r instanceof Function,"Expected a class definition");let e=Av.get(r);return e?(Or(e instanceof r,"Instance stored in cache mismatched with class"),e):(e=new r,Av.set(r,e),e)}/**
709 * @license
710 * Copyright 2019 Google LLC
711 *
712 * Licensed under the Apache License, Version 2.0 (the "License");
713 * you may not use this file except in compliance with the License.
714 * You may obtain a copy of the License at
715 *
716 *   http://www.apache.org/licenses/LICENSE-2.0
717 *
718 * Unless required by applicable law or agreed to in writing, software
719 * distributed under the License is distributed on an "AS IS" BASIS,
720 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
721 * See the License for the specific language governing permissions and
722 * limitations under the License.
723 */class ub{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,i){this.storage[e]=i}async _get(e){const i=this.storage[e];return i===void 0?null:i}async _remove(e){delete this.storage[e]}_addListener(e,i){}_removeListener(e,i){}}ub.type="NONE";const Sv=ub;/**
724 * @license
725 * Copyright 2019 Google LLC
726 *
727 * Licensed under the Apache License, Version 2.0 (the "License");
728 * you may not use this file except in compliance with the License.
729 * You may obtain a copy of the License at
730 *
731 *   http://www.apache.org/licenses/LICENSE-2.0
732 *
733 * Unless required by applicable law or agreed to in writing, software
734 * distributed under the License is distributed on an "AS IS" BASIS,
735 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
736 * See the License for the specific language governing permissions and
737 * limitations under the License.
738 */function Yc(r,e,i){return`firebase:${r}:${e}:${i}`}class pl{constructor(e,i,s){this.persistence=e,this.auth=i,this.userKey=s;const{config:o,name:c}=this.auth;this.fullUserKey=Yc(this.userKey,o.apiKey,c),this.fullPersistenceKey=Yc("persistence",o.apiKey,c),this.boundEventHandler=i._onStorageEvent.bind(i),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 i=await lh(this.auth,{idToken:e}).catch(()=>{});return i?ki._fromGetAccountInfoResponse(this.auth,i,e):null}return ki._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 i=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,i)return this.setCurrentUser(i)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,i,s="authUser"){if(!i.length)return new pl(Cr(Sv),e,s);const o=(await Promise.all(i.map(async p=>{if(await p._isAvailable())return p}))).filter(p=>p);let c=o[0]||Cr(Sv);const f=Yc(s,e.config.apiKey,e.name);let y=null;for(const p of i)try{const T=await p._get(f);if(T){let A;if(typeof T=="string"){const S=await lh(e,{idToken:T}).catch(()=>{});if(!S)break;A=await ki._fromGetAccountInfoResponse(e,S,T)}else A=ki._fromJSON(e,T);p!==c&&(y=A),c=p;break}}catch{}const _=o.filter(p=>p._shouldAllowMigration);return!c._shouldAllowMigration||!_.length?new pl(c,e,s):(c=_[0],y&&await c._set(f,y.toJSON()),await Promise.all(i.map(async p=>{if(p!==c)try{await p._remove(f)}catch{}})),new pl(c,e,s))}}/**
739 * @license
740 * Copyright 2020 Google LLC
741 *
742 * Licensed under the Apache License, Version 2.0 (the "License");
743 * you may not use this file except in compliance with the License.
744 * You may obtain a copy of the License at
745 *
746 *   http://www.apache.org/licenses/LICENSE-2.0
747 *
748 * Unless required by applicable law or agreed to in writing, software
749 * distributed under the License is distributed on an "AS IS" BASIS,
750 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
751 * See the License for the specific language governing permissions and
752 * limitations under the License.
753 */function wv(r){const e=r.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(fb(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(cb(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(gb(e))return"Blackberry";if(pb(e))return"Webos";if(hb(e))return"Safari";if((e.includes("chrome/")||db(e))&&!e.includes("edge/"))return"Chrome";if(mb(e))return"Android";{const i=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,s=r.match(i);if((s==null?void 0:s.length)===2)return s[1]}return"Other"}function cb(r=Dn()){return/firefox\//i.test(r)}function hb(r=Dn()){const e=r.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function db(r=Dn()){return/crios\//i.test(r)}function fb(r=Dn()){return/iemobile/i.test(r)}function mb(r=Dn()){return/android/i.test(r)}function gb(r=Dn()){return/blackberry/i.test(r)}function pb(r=Dn()){return/webos/i.test(r)}function Km(r=Dn()){return/iphone|ipad|ipod/i.test(r)||/macintosh/i.test(r)&&/mobile/i.test(r)}function uS(r=Dn()){var e;return Km(r)&&!!((e=window.navigator)!=null&&e.standalone)}function cS(){return S1()&&document.documentMode===10}function yb(r=Dn()){return Km(r)||mb(r)||pb(r)||gb(r)||/windows phone/i.test(r)||fb(r)}/**
754 * @license
755 * Copyright 2020 Google LLC
756 *
757 * Licensed under the Apache License, Version 2.0 (the "License");
758 * you may not use this file except in compliance with the License.
759 * You may obtain a copy of the License at
760 *
761 *   http://www.apache.org/licenses/LICENSE-2.0
762 *
763 * Unless required by applicable law or agreed to in writing, software
764 * distributed under the License is distributed on an "AS IS" BASIS,
765 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
766 * See the License for the specific language governing permissions and
767 * limitations under the License.
768 */function vb(r,e=[]){let i;switch(r){case"Browser":i=wv(Dn());break;case"Worker":i=`${wv(Dn())}-${r}`;break;default:i=r}const s=e.length?e.join(","):"FirebaseCore-web";return`${i}/JsCore/${Cl}/${s}`}/**
769 * @license
770 * Copyright 2022 Google LLC
771 *
772 * Licensed under the Apache License, Version 2.0 (the "License");
773 * you may not use this file except in compliance with the License.
774 * You may obtain a copy of the License at
775 *
776 *   http://www.apache.org/licenses/LICENSE-2.0
777 *
778 * Unless required by applicable law or agreed to in writing, software
779 * distributed under the License is distributed on an "AS IS" BASIS,
780 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
781 * See the License for the specific language governing permissions and
782 * limitations under the License.
783 */class hS{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,i){const s=c=>new Promise((f,y)=>{try{const _=e(c);f(_)}catch(_){y(_)}});s.onAbort=i,this.queue.push(s);const o=this.queue.length-1;return()=>{this.queue[o]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const i=[];try{for(const s of this.queue)await s(e),s.onAbort&&i.push(s.onAbort)}catch(s){i.reverse();for(const o of i)try{o()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:s==null?void 0:s.message})}}}/**
784 * @license
785 * Copyright 2023 Google LLC
786 *
787 * Licensed under the Apache License, Version 2.0 (the "License");
788 * you may not use this file except in compliance with the License.
789 * You may obtain a copy of the License at
790 *
791 *   http://www.apache.org/licenses/LICENSE-2.0
792 *
793 * Unless required by applicable law or agreed to in writing, softw
793are
794 * distributed under the License is distributed on an "AS IS" BASIS,
795 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
796 * See the License for the specific language governing permissions and
797 * limitations under the License.
798 */async function dS(r,e={}){return Dl(r,"GET","/v2/passwordPolicy",Fm(r,e))}/**
799 * @license
800 * Copyright 2023 Google LLC
801 *
802 * Licensed under the Apache License, Version 2.0 (the "License");
803 * you may not use this file except in compliance with the License.
804 * You may obtain a copy of the License at
805 *
806 *   http://www.apache.org/licenses/LICENSE-2.0
807 *
808 * Unless required by applicable law or agreed to in writing, software
809 * distributed under the License is distributed on an "AS IS" BASIS,
810 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
811 * See the License for the specific language governing permissions and
812 * limitations under the License.
813 */const fS=6;class mS{constructor(e){var s;const i=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=i.minPasswordLength??fS,i.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=i.maxPasswordLength),i.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=i.containsLowercaseCharacter),i.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=i.containsUppercaseCharacter),i.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=i.containsNumericCharacter),i.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=i.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((s=e.allowedNonAlphanumericCharacters)==null?void 0:s.join(""))??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const i={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,i),this.validatePasswordCharacterOptions(e,i),i.isValid&&(i.isValid=i.meetsMinPasswordLength??!0),i.isValid&&(i.isValid=i.meetsMaxPasswordLength??!0),i.isValid&&(i.isValid=i.containsLowercaseLetter??!0),i.isValid&&(i.isValid=i.containsUppercaseLetter??!0),i.isValid&&(i.isValid=i.containsNumericCharacter??!0),i.isValid&&(i.isValid=i.containsNonAlphanumericCharacter??!0),i}validatePasswordLengthOptions(e,i){const s=this.customStrengthOptions.minPasswordLength,o=this.customStrengthOptions.maxPasswordLength;s&&(i.meetsMinPasswordLength=e.length>=s),o&&(i.meetsMaxPasswordLength=e.length<=o)}validatePasswordCharacterOptions(e,i){this.updatePasswordCharacterOptionsStatuses(i,!1,!1,!1,!1);let s;for(let o=0;o<e.length;o++)s=e.charAt(o),this.updatePasswordCharacterOptionsStatuses(i,s>="a"&&s<="z",s>="A"&&s<="Z",s>="0"&&s<="9",this.allowedNonAlphanumericCharacters.includes(s))}updatePasswordCharacterOptionsStatuses(e,i,s,o,c){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=i)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=s)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=o)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=c))}}/**
814 * @license
815 * Copyright 2020 Google LLC
816 *
817 * Licensed under the Apache License, Version 2.0 (the "License");
818 * you may not use this file except in compliance with the License.
819 * You may obtain a copy of the License at
820 *
821 *   http://www.apache.org/licenses/LICENSE-2.0
822 *
823 * Unless required by applicable law or agreed to in writing, software
824 * distributed under the License is distributed on an "AS IS" BASIS,
825 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
826 * See the License for the specific language governing permissions and
827 * limitations under the License.
828 */class gS{constructor(e,i,s,o){this.app=e,this.heartbeatServiceProvider=i,this.appCheckServiceProvider=s,this.config=o,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Nv(this),this.idTokenSubscription=new Nv(this),this.beforeStateQueue=new hS(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=rb,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=o.sdkClientVersion,this._persistenceManagerAvailable=new Promise(c=>this._resolvePersistenceManagerAvailable=c)}_initializeWithPersistence(e,i){return i&&(this._popupRedirectResolver=Cr(i)),this._initializationPromise=this.queue(async()=>{var s,o,c;if(!this._deleted&&(this.persistenceManager=await pl.create(this,e),(s=this._resolvePersistenceManagerAvailable)==null||s.call(this),!this._deleted)){if
828((o=this._popupRedirectResolver)!=null&&o._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(i),this.lastNotifiedUid=((c=this.currentUser)==null?void 0:c.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 i=await lh(this,{idToken:e}),s=await ki._fromGetAccountInfoResponse(this,i,e);await this.directlySetCurrentUser(s)}catch(i){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",i),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var c;if(Vi(this.app)){const f=this.app.settings.authIdToken;return f?new Promise(y=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(f).then(y,y))}):this.directlySetCurrentUser(null)}const i=await this.assertedPersistence.getCurrentUser();let s=i,o=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const f=(c=this.redirectUser)==null?void 0:c._redirectEventId,y=s==null?void 0:s._redirectEventId,_=await this.tryRedirectSignIn(e);(!f||f===y)&&(_!=null&&_.user)&&(s=_.user,o=!0)}if(!s)return this.directlySetCurrentUser(null);if(!s._redirectEventId){if(o)try{await this.beforeStateQueue.runMiddleware(s)}catch(f){s=i,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(f))}return s?this.reloadAndSetCurrentUserOrClear(s):this.directlySetCurrentUser(null)}return De(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===s._redirectEventId?this.directlySetCurrentUser(s):this.reloadAndSetCurrentUserOrClear(s)}async tryRedirectSignIn(e){let i=null;try{i=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return i}async reloadAndSetCurrentUserOrClear(e){try{await oh(e)}catch(i){if((i==null?void 0:i.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=$A()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Vi(this.app))return Promise.reject(ca(this));const i=e?cn(e):null;return i&&De(i.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(i&&i._clone(this))}async _updateCurrentUser(e,i=!1){if(!this._deleted)return e&&De(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),i||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Vi(this.app)?Promise.reject(ca(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Vi(this.app)?Promise.reject(ca(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Cr(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const i=this._getPasswordPolicyInternal();return i.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):i.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await dS(this),i=new mS(e);this.tenantId===null?this._projectPasswordPolicy=i:this._tenantPasswordPolicies[this.tenantId]=i}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new au("auth","Firebase",e())}onAuthStateChanged(e,i,s){return this.registerStateListener(this.authStateSubscription,e,i,s)}beforeAuthStateChanged(e,i){return this.beforeStateQueue.pushCallback(e,i)}onIdTokenChanged(e,i,s){return this.registerStateListener(this.idTokenSubscription,e,i,s)}authStateReady(){return new Promise((e,i)=>{if(this.currentUser)e();else{const s=this.onAuthStateChanged(()=>{s(),e()},i)}})}async revokeAccessToken(e){if(this.currentUser){const i=await this.currentUser.getIdToken(),s={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:i};this.tenantId!=null&&(s.tenantId=this.tenantId),await oS(this,s)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)==null?void 0:e.toJSON()}}async _setRedirectUser(e,i){const s=await this.getOrInitRedirectPersistenceManager(i);return e===null?s.removeCurrentUser():s.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const i=e&&Cr(e)||this._popupRedirectResolver;De(i,this,"argument-error"),this.redirectPersistenceManager=await pl.create(this,[Cr(i._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var i,s;return this._isInitialized&&await this.queue(async()=>{}),((i=this._currentUser)==null?void 0:i._redirectEventId)===e?this._currentUser:((s=this.redirectUser)==null?void 0:s._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 i;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=((i=this.currentUser)==null?void 0:i.uid)??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,i,s,o){if(this._deleted)return()=>{};const c=typeof i=="function"?i:i.next.bind(i);let f=!1;const y=this._isInitialized?Promise.resolve():this._initializationPromise;if(De(y,this,"internal-error"),y.then(()=>{f||c(this.currentUser)}),typeof i=="function"){const _=e.addObserver(i,s,o);return()=>{f=!0,_()}}else{const _=e.addObserver(i);return()=>{f=!0,_()}}}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 De(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=vb(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var o;const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const i=await((o=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:o.getHeartbeatsHeader());i&&(e["X-Firebase-Client"]=i);const s=await this._getAppCheckToken();return s&&(e["X-Firebase-AppCheck"]=s),e}async _getAppCheckToken(){var i;if(Vi(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await((i=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:i.getToken());return e!=null&&e.error&&GA(`Error while retrieving App Check token: ${e.error}`),e==null?void 0:e.token}}function wh(r){return cn(r)}class Nv{constructor(e){this.auth=e,this.observer=null,this.addObserver=O1(i=>this.observer=i)}get next(){return De(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
829 * @license
830 * Copyright 2020 Google LLC
831 *
832 * Licensed under the Apache License, Version 2.0 (the "License");
833 * you may not use this file except in compliance with the License.
834 * You may obtain a copy of the License at
835 *
836 *   http://www.apache.org/licenses/LICENSE-2.0
837 *
838 * Unless required by applicable law or agreed to in writing, software
839 * distributed under the License is distributed on an "AS IS" BASIS,
840 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
841 * See the License for the specific language governing permissions and
842 * limitations under the License.
843 */let Qm={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function pS(r){Qm=r}function yS(r){return Qm.loadJS(r)}function vS(){return Qm.gapiScript}function _S(r){return`__${r}${Math.floor(Math.random()*1e6)}`}/**
844 * @license
845 * Copyright 2020 Google LLC
846 *
847 * Licensed under the Apache License, Version 2.0 (the "License");
848 * you may not use this file except in compliance with the License.
849 * You may obtain a copy of the License at
850 *
851 *   http://www.apache.org/licenses/LICENSE-2.0
852 *
853 * Unless required by applicable law or agreed to in writing, software
854 * distributed under the License is distributed on an "AS IS" BASIS,
855 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
856 * See the License for the specific language governing permissions and
857 * limitations under the License.
858 */function bS(r,e){const i=zm(r,"auth");if(i.isInitialized()){const o=i.getImmediate(),c=i.getOptions();if(fa(c,e??{}))return o;or(o,"already-initialized")}return i.initialize({options:e})}function TS(r,e){const i=(e==null?void 0:e.persistence)||[],s=(Array.isArray(i)?i:[i]).map(Cr);e!=null&&e.errorMap&&r._updateErrorMap(e.errorMap),r._initializeWithPersistence(s,e==null?void 0:e.popupRedirectResolver)}function ES(r,e,i){const s=wh(r);De(/^https?:\/\//.test(e),s,"invalid-emulator-scheme");const o=!1,c=_b(e),{host:f,port:y}=xS(e),_=y===null?"":`:${y}`,p={url:`${c}//${f}${_}/`},T=Object.freeze({host:f,port:y,protocol:c.replace(":",""),options:Object.freeze({disableWarnings:o})});if(!s._canInitEmulator){De(s.config.emulator&&s.emulatorConfig,s,"emulator-config-failed"),De(fa(p,s.config.emulator)&&fa(T,s.emulatorConfig),s,"emulator-config-failed");return}s.config.emulator=p,s.emulatorConfig=T,s.settings.appVerificationDisabledForTesting=!0,Rl(f)?($_(`${c}//${f}${_}`),X_("Auth",!0)):AS()}function _b(r){const e=r.indexOf(":");return e<0?"":r.substr(0,e+1)}function xS(r){const e=_b(r),i=/(\/\/)?([^?#/]+)/.exec(r.substr(e.length));if(!i)return{host:"",port:null};const s=i[2].split("@").pop()||"",o=/^(\[[^\]]+\])(:|$)/.exec(s);if(o){const c=o[1];return{host:c,port:Iv(s.substr(c.length+1))}}else{const[c,f]=s.split(":");return{host:c,port:Iv(f)}}}function Iv(r){if(!r)return null;const e=Number(r);return isNaN(e)?null:e}function AS(){function r(){const e=document.createElement("p"),i=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",i.position="fixed",i.width="100%",i.backgroundColor="#ffffff",i.border=".1em solid #000000",i.color="#b50000",i.bottom="0px",i.left="0px",i.margin="0px",i.zIndex="10000",i.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",r):r())}/**
859 * @license
860 * Copyright 2020 Google LLC
861 *
862 * Licensed under the Apache License, Version 2.0 (the "License");
863 * you may not use this file except in compliance with the License.
864 * You may obtain a copy of the License at
865 *
866 *   http://www.apache.org/licenses/LICENSE-2.0
867 *
868 * Unless required by applicable law or agreed to in writing, software
869 * distributed under the License is distributed on an "AS IS" BASIS,
870 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
871 * See the License for the specific language governing permissions and
872 * limitations under the License.
873 */class bb{constructor(e,i){this.providerId=e,this.signInMethod=i}toJSON(){return Rr("not implemented")}_getIdTokenResponse(e){return Rr("not implemented")}_linkToIdToken(e,i){return Rr("not implemented")}_getReauthenticationResolver(e){return Rr("not implemented")}}/**
874 * @license
875 * Copyright 2020 Google LLC
876 *
877 * Licensed under the Apache License, Version 2.0 (the "License");
878 * you may not use this file except in compliance with the License.
879 * You may obtain a copy of the License at
880 *
881 *   http://www.apache.org/licenses/LICENSE-2.0
882 *
883 * Unless required by applicable law or agreed to in writing, software
884 * distributed under the License is distributed on an "AS IS" BASIS,
885 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
886 * See the License for the specific language governing permissions and
887 * limitations under the License.
888 */async function yl(r,e){return WA(r,"POST","/v1/accounts:signInWithIdp",Fm(r,e))}/**
889 * @license
890 * Copyright 2020 Google LLC
891 *
892 * Licensed under the Apache License, Version 2.0 (the "License");
893 * you may not use this file except in compliance with the License.
894 * You may obtain a copy of the License at
895 *
896 *   http://www.apache.org/licenses/LICENSE-2.0
897 *
898 * Unless required by applicable law or agreed to in writing, software
899 * distributed under the License is distributed on an "AS IS" BASIS,
900 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
901 * See the License for the specific language governing permissions and
902 * limitations under the License.
903 */const SS="http://localhost";class ga extends bb{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const i=new ga(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(i.idToken=e.idToken),e.accessToken&&(i.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(i.nonce=e.nonce),e.pendingToken&&(i.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(i.accessToken=e.oauthToken,i.secret=e.oauthTokenSecret):or("argument-error"),i}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
903once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const i=typeof e=="string"?JSON.parse(e):e,{providerId:s,signInMethod:o,...c}=i;if(!s||!o)return null;const f=new ga(s,o);return f.idToken=c.idToken||void 0,f.accessToken=c.accessToken||void 0,f.secret=c.secret,f.nonce=c.nonce,f.pendingToken=c.pendingToken||null,f}_getIdTokenResponse(e){const i=this.buildRequest();return yl(e,i)}_linkToIdToken(e,i){const s=this.buildRequest();return s.idToken=i,yl(e,s)}_getReauthenticationResolver(e){const i=this.buildRequest();return i.autoCreate=!1,yl(e,i)}buildRequest(){const e={requestUri:SS,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const i={};this.idToken&&(i.id_token=this.idToken),this.accessToken&&(i.access_token=this.accessToken),this.secret&&(i.oauth_token_secret=this.secret),i.providerId=this.providerId,this.nonce&&!this.pendingToken&&(i.nonce=this.nonce),e.postBody=lu(i)}return e}}/**
904 * @license
905 * Copyright 2020 Google LLC
906 *
907 * Licensed under the Apache License, Version 2.0 (the "License");
908 * you may not use this file except in compliance with the License.
909 * You may obtain a copy of the License at
910 *
911 *   http://www.apache.org/licenses/LICENSE-2.0
912 *
913 * Unless required by applicable law or agreed to in writing, software
914 * distributed under the License is distributed on an "AS IS" BASIS,
915 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
916 * See the License for the specific language governing permissions and
917 * limitations under the License.
918 */class Ym{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}}/**
919 * @license
920 * Copyright 2019 Google LLC
921 *
922 * Licensed under the Apache License, Version 2.0 (the "License");
923 * you may not use this file except in compliance with the License.
924 * You may obtain a copy of the License at
925 *
926 *   http://www.apache.org/licenses/LICENSE-2.0
927 *
928 * Unless required by applicable law or agreed to in writing, software
929 * distributed under the License is distributed on an "AS IS" BASIS,
930 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
931 * See the License for the specific language governing permissions and
932 * limitations under the License.
933 */class uu extends Ym{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
934 * @license
935 * Copyright 2020 Google LLC
936 *
937 * Licensed under the Apache License, Version 2.0 (the "License");
938 * you may not use this file except in compliance with the License.
939 * You may obtain a copy of the License at
940 *
941 *   http://www.apache.org/licenses/LICENSE-2.0
942 *
943 * Unless required by applicable law or agreed to in writing, software
944 * distributed under the License is distributed on an "AS IS" BASIS,
945 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
946 * See the License for the specific language governing permissions and
947 * limitations under the License.
948 */class vs extends uu{constructor(){super("facebook.com")}static credential(e){return ga._fromParams({providerId:vs.PROVIDER_ID,signInMethod:vs.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return vs.credentialFromTaggedObject(e)}static credentialFromError(e){return vs.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return vs.credential(e.oauthAccessToken)}catch{return null}}}vs.FACEBOOK_SIGN_IN_METHOD="facebook.com";vs.PROVIDER_ID="facebook.com";/**
949 * @license
950 * Copyright 2020 Google LLC
951 *
952 * Licensed under the Apache License, Version 2.0 (the "License");
953 * you may not use this file except in compliance with the License.
954 * You may obtain a copy of the License at
955 *
956 *   http://www.apache.org/licenses/LICENSE-2.0
957 *
958 * Unless required by applicable law or agreed to in writing, softw
958are
959 * distributed under the License is distributed on an "AS IS" BASIS,
960 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
961 * See the License for the specific language governing permissions and
962 * limitations under the License.
963 */class Ir extends uu{constructor(){super("google.com"),this.addScope("profile")}static credential(e,i){return ga._fromParams({providerId:Ir.PROVIDER_ID,signInMethod:Ir.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:i})}static credentialFromResult(e){return Ir.credentialFromTaggedObject(e)}static credentialFromError(e){return Ir.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:i,oauthAccessToken:s}=e;if(!i&&!s)return null;try{return Ir.credential(i,s)}catch{return null}}}Ir.GOOGLE_SIGN_IN_METHOD="google.com";Ir.PROVIDER_ID="google.com";/**
964 * @license
965 * Copyright 2020 Google LLC
966 *
967 * Licensed under the Apache License, Version 2.0 (the "License");
968 * you may not use this file except in compliance with the License.
969 * You may obtain a copy of the License at
970 *
971 *   http://www.apache.org/licenses/LICENSE-2.0
972 *
973 * Unless required by applicable law or agreed to in writing, software
974 * distributed under the License is distributed on an "AS IS" BASIS,
975 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
976 * See the License for the specific language governing permissions and
977 * limitations under the License.
978 */class _s extends uu{constructor(){super("github.com")}static credential(e){return ga._fromParams({providerId:_s.PROVIDER_ID,signInMethod:_s.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return _s.credentialFromTaggedObject(e)}static credentialFromError(e){return _s.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return _s.credential(e.oauthAccessToken)}catch{return null}}}_s.GITHUB_SIGN_IN_METHOD="github.com";_s.PROVIDER_ID="github.com";/**
979 * @license
980 * Copyright 2020 Google LLC
981 *
982 * Licensed under the Apache License, Version 2.0 (the "License");
983 * you may not use this file except in compliance with the License.
984 * You may obtain a copy of the License at
985 *
986 *   http://www.apache.org/licenses/LICENSE-2.0
987 *
988 * Unless required by applicable law or agreed to in writing, software
989 * distributed under the License is distributed on an "AS IS" BASIS,
990 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
991 * See the License for the specific language governing permissions and
992 * limitations under the License.
993 */class bs extends uu{constructor(){super("twitter.com")}static credential(e,i){return ga._fromParams({providerId:bs.PROVIDER_ID,signInMethod:bs.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:i})}static credentialFromResult(e){return bs.credentialFromTaggedObject(e)}static credentialFromError(e){return bs.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:i,oauthTokenSecret:s}=e;if(!i||!s)return null;try{return bs.credential(i,s)}catch{return null}}}bs.TWITTER_SIGN_IN_METHOD="twitter.com";bs.PROVIDER_ID="twitter.com";/**
994 * @license
995 * Copyright 2020 Google LLC
996 *
997 * Licensed under the Apache License, Version 2.0 (the "License");
998 * you may not use this file except in compliance with the License.
999 * You may obtain a copy of the License at
1000 *
1001 *   http://www.apache.org/licenses/LICENSE-2.0
1002 *
1003 * Unless required by applicable law or agreed to in writing, software
1004 * distributed under the License is distributed on an "AS IS" BASIS,
1005 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1006 * See the License for the specific language governing permissions and
1007 * limitations under the License.
1008 */class Tl{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,i,s,o=!1){const c=await ki._fromIdTokenResponse(e,s,o),f=Rv(s);
vendor: 4,825 bytes, lines 1008-1072
1008return new Tl({user:c,providerId:f,_tokenResponse:s,operationType:i})}static async _forOperation(e,i,s){await e._updateTokensIfNecessary(s,!0);const o=Rv(s);return new Tl({user:e,providerId:o,_tokenResponse:s,operationType:i})}}function Rv(r){return r.providerId?r.providerId:"phoneNumber"in r?"phone":null}/**
1009 * @license
1010 * Copyright 2020 Google LLC
1011 *
1012 * Licensed under the Apache License, Version 2.0 (the "License");
1013 * you may not use this file except in compliance with the License.
1014 * You may obtain a copy of the License at
1015 *
1016 *   http://www.apache.org/licenses/LICENSE-2.0
1017 *
1018 * Unless required by applicable law or agreed to in writing, software
1019 * distributed under the License is distributed on an "AS IS" BASIS,
1020 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1021 * See the License for the specific language governing permissions and
1022 * limitations under the License.
1023 */class uh extends Ur{constructor(e,i,s,o){super(i.code,i.message),this.operationType=s,this.user=o,Object.setPrototypeOf(this,uh.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:i.customData._serverResponse,operationType:s}}static _fromErrorAndOperation(e,i,s,o){return new uh(e,i,s,o)}}function Tb(r,e,i,s){return(e==="reauthenticate"?i._getReauthenticationResolver(r):i._getIdTokenResponse(r)).catch(c=>{throw c.code==="auth/multi-factor-auth-required"?uh._fromErrorAndOperation(r,c,e,s):c})}async function wS(r,e,i=!1){const s=await Zo(r,e._linkToIdToken(r.auth,await r.getIdToken()),i);return Tl._forOperation(r,"link",s)}/**
1024 * @license
1025 * Copyright 2019 Google LLC
1026 *
1027 * Licensed under the Apache License, Version 2.0 (the "License");
1028 * you may not use this file except in compliance with the License.
1029 * You may obtain a copy of the License at
1030 *
1031 *   http://www.apache.org/licenses/LICENSE-2.0
1032 *
1033 * Unless required by applicable law or agreed to in writing, software
1034 * distributed under the License is distributed on an "AS IS" BASIS,
1035 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1036 * See the License for the specific language governing permissions and
1037 * limitations under the License.
1038 */async function NS(r,e,i=!1){const{auth:s}=r;if(Vi(s.app))return Promise.reject(ca(s));const o="reauthenticate";try{const c=await Zo(r,Tb(s,o,e,r),i);De(c.idToken,s,"internal-error");const f=Gm(c.idToken);De(f,s,"internal-error");const{sub:y}=f;return De(r.uid===y,s,"user-mismatch"),Tl._forOperation(r,o,c)}catch(c){throw(c==null?void 0:c.code)==="auth/user-not-found"&&or(s,"user-mismatch"),c}}/**
1039 * @license
1040 * Copyright 2020 Google LLC
1041 *
1042 * Licensed under the Apache License, Version 2.0 (the "License");
1043 * you may not use this file except in compliance with the License.
1044 * You may obtain a copy of the License at
1045 *
1046 *   http://www.apache.org/licenses/LICENSE-2.0
1047 *
1048 * Unless required by applicable law or agreed to in writing, software
1049 * distributed under the License is distributed on an "AS IS" BASIS,
1050 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1051 * See the License for the specific language governing permissions and
1052 * limitations under the License.
1053 */async function IS(r,e,i=!1){if(Vi(r.app))return Promise.reject(ca(r));const s="signIn",o=await Tb(r,s,e),c=await Tl._fromIdTokenResponse(r,s,o);return i||await r._updateCurrentUser(c.user),c}function RS(r,e,i,s){return cn(r).onIdTokenChanged(e,i,s)}function CS(r,e,i){return cn(r).beforeAuthStateChanged(e,i)}function DS(r,e,i,s){return cn(r).onAuthStateChanged(e,i,s)}function MS(r){return cn(r).signOut()}const ch="__sak";/**
1054 * @license
1055 * Copyright 2019 Google LLC
1056 *
1057 * Licensed under the Apache License, Version 2.0 (the "License");
1058 * you may not use this file except in compliance with the License.
1059 * You may obtain a copy of the License at
1060 *
1061 *   http://www.apache.org/licenses/LICENSE-2.0
1062 *
1063 * Unless required by applicable law or agreed to in writing, software
1064 * distributed under the License is distributed on an "AS IS" BASIS,
1065 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1066 * See the License for the specific language governing permissions and
1067 * limitations under the License.
1068 */class Eb{constructor(e,i){this.storageRetriever=e,this.type=i}_isAvailable(){try{return this.storage?(this.storage.setItem(ch,"1"),this.storage.removeItem(ch),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,i){return this.storage.setItem(e,JSON.stringify(i)),Promise.resolve()}_get(e){const i=this.storage.getItem(e);return Promise.resolve(i?JSON.parse(i):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1069 * @license
1070 * Copyright 2020 Google LLC
1071 *
1072 * Licensed under the Apache License, Version 2.0 (the "License");
1073 * you may not use this file except in compliance with the License.
1074 * You may obtain a copy of the License at
1075 *
1076 *   http://www.apache.org/licenses/LICENSE-2.0
1077 *
1078 * Unless required by applicable law or agreed to in writing, software
1079 * distributed under the License is distributed on an "AS IS" BASIS,
1080 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1081 * See the License for the specific language governing permissions and
1082 * limitations under the License.
1083 */const OS=1e3,jS=10;class xb extends Eb{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,i)=>this.onStorageEvent(e,i),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=yb(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const i of Object.keys(this.listeners)){const s=this.storage.getItem(i),o=this.localCache[i];s!==o&&e(i,o,s)}}onStorageEvent(e,i=!1){if(!e.key){this.forAllChangedKeys((f,y,_)=>{this.notifyListeners(f,_)});return}const s=e.key;i?this.detachListener():this.stopPolling();const o=()=>{const f=this.storage.getItem(s);!i&&this.localCache[s]===f||this.notifyListeners(s,f)},c=this.storage.getItem(s);cS()&&c!==e.newValue&&e.newValue!==e.oldValue?setTimeout(o,jS):o()}notifyListeners(e,i){this.localCache[e]=i;const s=this.listeners[e];if(s)for(const o of Array.from(s))o(i&&JSON.parse(i))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,i,s)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:i,newValue:s}),!0)})},OS)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,i){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(i)}_removeListener(e,i){this.listeners[e]&&(this.listeners[e].delete(i),this.listeners[e].size===0&&delete this.listeners[e]),Ob
1083ject.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,i){await super._set(e,i),this.localCache[e]=JSON.stringify(i)}async _get(e){const i=await super._get(e);return this.localCache[e]=JSON.stringify(i),i}async _remove(e){await super._remove(e),delete this.localCache[e]}}xb.type="LOCAL";const VS=xb;/**
1084 * @license
1085 * Copyright 2020 Google LLC
1086 *
1087 * Licensed under the Apache License, Version 2.0 (the "License");
1088 * you may not use this file except in compliance with the License.
1089 * You may obtain a copy of the License at
1090 *
1091 *   http://www.apache.org/licenses/LICENSE-2.0
1092 *
1093 * Unless required by applicable law or agreed to in writing, software
1094 * distributed under the License is distributed on an "AS IS" BASIS,
1095 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1096 * See the License for the specific language governing permissions and
1097 * limitations under the License.
1098 */class Ab extends Eb{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,i){}_removeListener(e,i){}}Ab.type="SESSION";const Sb=Ab;/**
1099 * @license
1100 * Copyright 2019 Google LLC
1101 *
1102 * Licensed under the Apache License, Version 2.0 (the "License");
1103 * you may not use this file except in compliance with the License.
1104 * You may obtain a copy of the License at
1105 *
1106 *   http://www.apache.org/licenses/LICENSE-2.0
1107 *
1108 * Unless required by applicable law or agreed to in writing, software
1109 * distributed under the License is distributed on an "AS IS" BASIS,
1110 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111 * See the License for the specific language governing permissions and
1112 * limitations under the License.
1113 */function kS(r){return Promise.all(r.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(i){return{fulfilled:!1,reason:i}}}))}/**
1114 * @license
1115 * Copyright 2019 Google LLC
1116 *
1117 * Licensed under the Apache License, Version 2.0 (the "License");
1118 * you may not use this file except in compliance with the License.
1119 * You may obtain a copy of the License at
1120 *
1121 *   http://www.apache.org/licenses/LICENSE-2.0
1122 *
1123 * Unless required by applicable law or agreed to in writing, software
1124 * distributed under the License is distributed on an "AS IS" BASIS,
1125 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1126 * See the License for the specific language governing permissions and
1127 * limitations under the License.
1128 */class Nh{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const i=this.receivers.find(o=>o.isListeningto(e));if(i)return i;const s=new Nh(e);return this.receivers.push(s),s}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const i=e,{eventId:s,eventType:o,data:c}=i.data,f=this.handlersMap[o];if(!(f!=null&&f.size))return;i.ports[0].postMessage({status:"ack",eventId:s,eventType:o});const y=Array.from(f).map(async p=>p(i.origin,c)),_=await kS(y);i.ports[0].postMessage({status:"done",eventId:s,eventType:o,response:_})}_subscribe(e,i){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(i)}_unsubscribe(e,i){this.handlersMap[e]&&i&&this.handlersMap[e].delete(i),(!i||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Nh.receivers=[];/**
1129 * @license
1130 * Copyright 2020 Google LLC
1131 *
1132 * Licensed under the Apache License, Version 2.0 (the "License");
1133 * you may not use this file except in compliance with the License.
1134 * You may obtain a copy of the License at
1135 *
1136 *   http://www.apache.org/licenses/LICENSE-2.0
1137 *
1138 * Unless required by applicable law or agreed to in writing, software
1139 * distributed under the License is distributed on an "AS IS" BASIS,
1140 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1141 * See the License for the specific language governing permissions and
1142 * limitations under the License.
1143 */function $m(r="",e=10){let i="";for(let s=0;s<e;s++)i+=Math.floor(Math.random()*10);return r+i}/**
1144 * @license
1145 * Copyright 2019 Google LLC
1146 *
1147 * Licensed under the Apache License, Version 2.0 (the "License");
1148 * you may not use this file except in compliance with the License.
1149 * You may obtain a copy of the License at
1150 *
1151 *   http://www.apache.org/licenses/LICENSE-2.0
1152 *
1153 * Unless required by applicable law or agreed to in writing, software
1154 * distributed under the License is distributed on an "AS IS" BASIS,
1155 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1156 * See the License for the specific language governing permissions and
1157 * limitations under the License.
1158 */class LS{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,i,s=50){const o=typeof MessageChannel<"u"?new MessageChannel:null;if(!o)throw new Error("connection_unavailable");let c,f;return new Promise((y,_)=>{const p=$m("",20);o.port1.start();const T=setTimeout(()=>{_(new Error("unsupported_event"))},s);f={messageChannel:o,onMessage(A){const S=A;if(S.data.eventId===p)switch(S.data.status){case"ack":clearTimeout(T),c=setTimeout(()=>{_(new Error("timeout"))},3e3);break;case"done":clearTimeout(c),y(S.data.response);break;default:clearTimeout(T),clearTimeout(c),_(new Error("invalid_response"));break}}},this.handlers.add(f),o.port1.addEventListener("message",f.onMessage),this.target.postMessage({eventType:e,eventId:p,data:i},[o.port2])}).finally(()=>{f&&this.removeMessageHandler(f)})}}/**
1159 * @license
1160 * Copyright 2020 Google LLC
1161 *
1162 * Licensed under the Apache License, Version 2.0 (the "License");
1163 * you may not use this file except in compliance with the License.
1164 * You may obtain a copy of the License at
1165 *
1166 *   http://www.apache.org/licenses/LICENSE-2.0
1167 *
1168 * Unless required by applicable law or agreed to in writing, software
1169 * distributed under the License is distributed on an "AS IS" BASIS,
1170 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1171 * See the License for the specific language governing permissions and
1172 * limitations under the License.
1173 */function rr(){return window}function US(r){rr().location.href=r}/**
1174 * @license
1175 * Copyright 2020 Google LLC.
1176 *
1177 * Licensed under the Apache License, Version 2.0 (the "License");
1178 * you may not use this file except in compliance with the License.
1179 * You may obtain a copy of the License at
1180 *
1181 *   http://www.apache.org/licenses/LICENSE-2.0
1182 *
1183 * Unless required by applicable law or agreed to in writing, software
1184 * distributed under the License is distributed on an "AS IS" BASIS,
1185 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1186 * See the License for the specific language governing permissions and
1187 * limitations under the License.
1188 */function wb(){return typeof rr().WorkerGlobalScope<"u"&&typeof rr().importScripts=="function"}async function PS(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function zS(){var r;return((r=navigator==null?void 0:navigator.serviceWorker)==null?void 0:r.controller)||null}function BS(){return wb()?self:null}/**
1189 * @license
1190 * Copyright 2019 Google LLC
1191 *
1192 * Licensed under the Apache License, Version 2.0 (the "License");
1193 * you may not use this file except in compliance with the License.
1194 * You may obtain a copy of the License at
1195 *
1196 *   http://www.apache.org/licenses/LICENSE-2.0
1197 *
1198 * Unless required by applicable law or agreed to in writing, software
1199 * distributed under the License is distributed on an "AS IS" BASIS,
1200 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1201 * See the License for the specific language governing permissions and
1202 * limitations under the License.
1203 */const Nb="firebaseLocalStorageDb",HS=1,hh="firebaseLocalStorage",Ib="fbase_key";class cu{constructor(e){this.request=e}toPromise(){return new Promise((e,i)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{i(this.request.error)})})}}function Ih(r,e){return r.transaction([hh],e?"readwrite":"readonly").objectStore(hh)}function qS(){const r=indexedDB.deleteDatabase(Nb);
1203return new cu(r).toPromise()}function vm(){const r=indexedDB.open(Nb,HS);return new Promise((e,i)=>{r.addEventListener("error",()=>{i(r.error)}),r.addEventListener("upgradeneeded",()=>{const s=r.result;try{s.createObjectStore(hh,{keyPath:Ib})}catch(o){i(o)}}),r.addEventListener("success",async()=>{const s=r.result;s.objectStoreNames.contains(hh)?e(s):(s.close(),await qS(),e(await vm()))})})}async function Cv(r,e,i){const s=Ih(r,!0).put({[Ib]:e,value:i});return new cu(s).toPromise()}async function FS(r,e){const i=Ih(r,!1).get(e),s=await new cu(i).toPromise();return s===void 0?null:s.value}function Dv(r,e){const i=Ih(r,!0).delete(e);return new cu(i).toPromise()}const GS=800,KS=3;class Rb{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 vm(),this.db)}async _withRetries(e){let i=0;for(;;)try{const s=await this._openDb();return await e(s)}catch(s){if(i++>KS)throw s;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return wb()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Nh._getInstance(BS()),this.receiver._subscribe("keyChanged",async(e,i)=>({keyProcessed:(await this._poll()).includes(i.key)})),this.receiver._subscribe("ping",async(e,i)=>["keyChanged"])}async initializeSender(){var i,s;if(this.activeServiceWorker=await PS(),!this.activeServiceWorker)return;this.sender=new LS(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&(i=e[0])!=null&&i.fulfilled&&(s=e[0])!=null&&s.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||zS()!==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 vm();return await Cv(e,ch,"1"),await Dv(e,ch),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,i){return this._withPendingWrite(async()=>(await this._withRetries(s=>Cv(s,e,i)),this.localCache[e]=i,this.notifyServiceWorker(e)))}async _get(e){const i=await this._withRetries(s=>FS(s,e));return this.localCache[e]=i,i}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(i=>Dv(i,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(o=>{const c=Ih(o,!1).getAll();return new cu(c).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const i=[],s=new Set;if(e.length!==0)for(const{fbase_key:o,value:c}of e)s.add(o),JSON.stringify(this.localCache[o])!==JSON.stringify(c)&&(this.notifyListeners(o,c),i.push(o));for(const o of Object.keys(this.localCache))this.localCache[o]&&!s.has(o)&&(this.notifyListeners(o,null),i.push(o));return i}notifyListeners(e,i){this.localCache[e]=i;const s=this.listeners[e];if(s)for(const o of Array.from(s))o(i)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),GS)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,i){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(i)}_removeListener(e,i){this.listeners[e]&&(this.listeners[e].delete(i),this.listeners[e].size===0&&delete this.listeners[e]),Ob
vendor: 4,318 bytes, lines 1203-1252
1203ject.keys(this.listeners).length===0&&this.stopPolling()}}Rb.type="LOCAL";const QS=Rb;new ou(3e4,6e4);/**
1204 * @license
1205 * Copyright 2021 Google LLC
1206 *
1207 * Licensed under the Apache License, Version 2.0 (the "License");
1208 * you may not use this file except in compliance with the License.
1209 * You may obtain a copy of the License at
1210 *
1211 *   http://www.apache.org/licenses/LICENSE-2.0
1212 *
1213 * Unless required by applicable law or agreed to in writing, software
1214 * distributed under the License is distributed on an "AS IS" BASIS,
1215 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1216 * See the License for the specific language governing permissions and
1217 * limitations under the License.
1218 */function Cb(r,e){return e?Cr(e):(De(r._popupRedirectResolver,r,"argument-error"),r._popupRedirectResolver)}/**
1219 * @license
1220 * Copyright 2019 Google LLC
1221 *
1222 * Licensed under the Apache License, Version 2.0 (the "License");
1223 * you may not use this file except in compliance with the License.
1224 * You may obtain a copy of the License at
1225 *
1226 *   http://www.apache.org/licenses/LICENSE-2.0
1227 *
1228 * Unless required by applicable law or agreed to in writing, software
1229 * distributed under the License is distributed on an "AS IS" BASIS,
1230 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1231 * See the License for the specific language governing permissions and
1232 * limitations under the License.
1233 */class Xm extends bb{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return yl(e,this._buildIdpRequest())}_linkToIdToken(e,i){return yl(e,this._buildIdpRequest(i))}_getReauthenticationResolver(e){return yl(e,this._buildIdpRequest())}_buildIdpRequest(e){const i={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&&(i.idToken=e),i}}function YS(r){return IS(r.auth,new Xm(r),r.bypassAuthState)}function $S(r){const{auth:e,user:i}=r;return De(i,e,"internal-error"),NS(i,new Xm(r),r.bypassAuthState)}async function XS(r){const{auth:e,user:i}=r;return De(i,e,"internal-error"),wS(i,new Xm(r),r.bypassAuthState)}/**
1234 * @license
1235 * Copyright 2020 Google LLC
1236 *
1237 * Licensed under the Apache License, Version 2.0 (the "License");
1238 * you may not use this file except in compliance with the License.
1239 * You may obtain a copy of the License at
1240 *
1241 *   http://www.apache.org/licenses/LICENSE-2.0
1242 *
1243 * Unless required by applicable law or agreed to in writing, software
1244 * distributed under the License is distributed on an "AS IS" BASIS,
1245 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1246 * See the License for the specific language governing permissions and
1247 * limitations under the License.
1248 */class Db{constructor(e,i,s,o,c=!1){this.auth=e,this.resolver=s,this.user=o,this.bypassAuthState=c,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(i)?i:[i]}execute(){return new Promise(async(e,i)=>{this.pendingPromise={resolve:e,reject:i};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(s){this.reject(s)}})}async onAuthEvent(e){const{urlResponse:i,sessionId:s,postBody:o,tenantId:c,error:f,type:y}=e;if(f){this.reject(f);return}const _={auth:this.auth,requestUri:i,sessionId:s,tenantId:c||void 0,postBody:o||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(y)(_))}catch(p){this.reject(p)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return YS;case"linkViaPopup":case"linkViaRedirect":return XS;case"reauthViaPopup":case"reauthViaRedirect":return $S;default:or(this.auth,"internal-error")}}resolve(e){Or(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Or(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()}}/**
1249 * @license
1250 * Copyright 2020 Google LLC
1251 *
1252 * Licensed under the Apache License, Version 2.0 (the "License");
1253 * you may not use this file except in compliance with the License.
1254 * You may obtain a copy of the License at
1255 *
1256 *   http://www.apache.org/licenses/LICENSE-2.0
1257 *
1258 * Unless required by applicable law or agreed to in writing, software
1259 * distributed under the License is distributed on an "AS IS" BASIS,
1260 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261 * See the License for the specific language governing permissions and
1262 * limitations under the License.
1263 */const JS=new ou(2e3,1e4);async function ZS(r,e,i){if(Vi(r.app))return Promise.reject(Li(r,"operation-not-supported-in-this-environment"));const s=wh(r);KA(r,e,Ym);const o=Cb(s,i);return new oa(s,"signInViaPopup",e,o).executeNotNull()}class oa extends Db{constructor(e,i,s,o,c){super(e,i,o,c),this.provider=s,this.authWindow=null,this.pollId=null,oa.currentPopupAction&&oa.currentPopupAction.cancel(),oa.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return De(e,this.auth,"internal-error"),e}async onExecution(){Or(this.filter.length===1,"Popup operations only handle one event");const e=$m();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(i=>{this.reject(i)}),this.resolver._isIframeWebStorageSupported(this.auth,i=>{i||this.reject(Li(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)==null?void 0:e.associatedEvent)||null}cancel(){this.reject(Li(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,oa.currentPopupAction=null}pollUserCancellation(){const e=()=>{var i,s;if((s=(i=this.authWindow)==null?void 0:i.window)!=null&&s.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Li(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,JS.get())};e()}}oa.currentPopupAction=null;/**
1264 * @license
1265 * Copyright 2020 Google LLC
1266 *
1267 * Licensed under the Apache License, Version 2.0 (the "License");
1268 * you may not use this file except in compliance with the License.
1269 * You may obtain a copy of the License at
1270 *
1271 *   http://www.apache.org/licenses/LICENSE-2.0
1272 *
1273 * Unless required by applicable law or agreed to in writing, software
1274 * distributed under the License is distributed on an "AS IS" BASIS,
1275 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1276 * See the License for the specific language governing permissions and
1277 * limitations under the License.
1278 */const WS="pendingRedirect",$c=new Map;class ew extends Db{constructor(e,i,s=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],i,void 0,s),this.eventId=null}async execute(){let e=$c.get(this.auth._key());if(!e){try{const s=await tw(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(s)}catch(i){e=()=>Promise.reject(i)}$c.set(this.auth._key(),e)}return this.bypassAuthState||$c.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 i=await this.auth._redirectUserForId(e.eventId);if(i)return this.user=i,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function tw(r,e){const i=rw(e),s=iw(r);if(!await s._isAvailable())return!1;const o=await s._get(i)==="true";return await s._remove(i),o}function nw(r,e){$c.set(r._key(),e)}function iw(r){return Cr(r._redirectPersistence)}function rw(r){return Yc(WS,r.config.apiKey,r.name)}async function sw(r,e,i=!1){if(Vi(r.app))return Promise.reject(ca(r));const s=wh(r),o=Cb(s,e),f=await new ew(s,o,i).execute();return f&&!i&&(delete f.user._redirectEventId,await s._persistUserIfCurrent(f.user),await s._setRedirectUser(null,e)),f}/**
1279 * @license
1280 * Copyright 2020 Google LLC
1281 *
1282 * Licensed under the Apache License, Version 2.0 (the "License");
1283 * you may not use this file except in compliance with the License.
1284 * You may obtain a copy of the License at
1285 *
1286 *   http://www.apache.org/licenses/LICENSE-2.0
1287 *
1288 * Unless required by applicable law or agreed to in writing, softw
1288are
1289 * distributed under the License is distributed on an "AS IS" BASIS,
1290 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1291 * See the License for the specific language governing permissions and
1292 * limitations under the License.
1293 */const aw=600*1e3;class lw{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 i=!1;return this.consumers.forEach(s=>{this.isEventForConsumer(e,s)&&(i=!0,this.sendToConsumer(e,s),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!ow(e)||(this.hasHandledPotentialRedirect=!0,i||(this.queuedRedirectEvent=e,i=!0)),i}sendToConsumer(e,i){var s;if(e.error&&!Mb(e)){const o=((s=e.error.code)==null?void 0:s.split("auth/")[1])||"internal-error";i.onError(Li(this.auth,o))}else i.onAuthEvent(e)}isEventForConsumer(e,i){const s=i.eventId===null||!!e.eventId&&e.eventId===i.eventId;return i.filter.includes(e.type)&&s}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=aw&&this.cachedEventUids.clear(),this.cachedEventUids.has(Mv(e))}saveEventToCache(e){this.cachedEventUids.add(Mv(e)),this.lastProcessedEventTime=Date.now()}}function Mv(r){return[r.type,r.eventId,r.sessionId,r.tenantId].filter(e=>e).join("-")}function Mb({type:r,error:e}){return r==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function ow(r){switch(r.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Mb(r);default:return!1}}/**
1294 * @license
1295 * Copyright 2020 Google LLC
1296 *
1297 * Licensed under the Apache License, Version 2.0 (the "License");
1298 * you may not use this file except in compliance with the License.
1299 * You may obtain a copy of the License at
1300 *
1301 *   http://www.apache.org/licenses/LICENSE-2.0
1302 *
1303 * Unless required by applicable law or agreed to in writing, software
1304 * distributed under the License is distributed on an "AS IS" BASIS,
1305 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1306 * See the License for the specific language governing permissions and
1307 * limitations under the License.
1308 */async function uw(r,e={}){return Dl(r,"GET","/v1/projects",e)}/**
1309 * @license
1310 * Copyright 2020 Google LLC
1311 *
1312 * Licensed under the Apache License, Version 2.0 (the "License");
1313 * you may not use this file except in compliance with the License.
1314 * You may obtain a copy of the License at
1315 *
1316 *   http://www.apache.org/licenses/LICENSE-2.0
1317 *
1318 * Unless required by applicable law or agreed to in writing, software
1319 * distributed under the License is distributed on an "AS IS" BASIS,
1320 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1321 * See the License for the specific language governing permissions and
1322 * limitations under the License.
1323 */const cw=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,hw=/^https?/;async function dw(r){if(r.config.emulator)return;const{authorizedDomains:e}=await uw(r);for(const i of e)try{if(fw(i))return}catch{}or(r,"unauthorized-domain")}function fw(r){const e=pm(),{protocol:i,hostname:s}=new URL(e);if(r.startsWith("chrome-extension://")){const f=new URL(r);return f.hostname===""&&s===""?i==="chrome-extension:"&&r.replace("chrome-extension://","")===e.replace("chrome-extension://",""):i==="chrome-extension:"&&f.hostname===s}if(!hw.test(i))return!1;if(cw.test(r))return s===r;const o=r.replace(/\./g,"\\.");return new RegExp("^(.+\\."+o+"|"+o+")$","i").test(s)}/**
1324 * @license
1325 * Copyright 2020 Google LLC.
1326 *
1327 * Licensed under the Apache License, Version 2.0 (the "License");
1328 * you may not use this file except in compliance with the License.
1329 * You may obtain a copy of the License at
1330 *
1331 *   http://www.apache.org/licenses/LICENSE-2.0
1332 *
1333 * Unless required by applicable law or agreed to in writing, softw
1333are
1334 * distributed under the License is distributed on an "AS IS" BASIS,
1335 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1336 * See the License for the specific language governing permissions and
1337 * limitations under the License.
1338 */const mw=new ou(3e4,6e4);function Ov(){const r=rr().___jsl;if(r!=null&&r.H){for(const e of Object.keys(r.H))if(r.H[e].r=r.H[e].r||[],r.H[e].L=r.H[e].L||[],r.H[e].r=[...r.H[e].L],r.CP)for(let i=0;i<r.CP.length;i++)r.CP[i]=null}}function gw(r){return new Promise((e,i)=>{var o,c,f;function s(){Ov(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{Ov(),i(Li(r,"network-request-failed"))},timeout:mw.get()})}if((c=(o=rr().gapi)==null?void 0:o.iframes)!=null&&c.Iframe)e(gapi.iframes.getContext());else if((f=rr().gapi)!=null&&f.load)s();else{const y=_S("iframefcb");return rr()[y]=()=>{gapi.load?s():i(Li(r,"network-request-failed"))},yS(`${vS()}?onload=${y}`).catch(_=>i(_))}}).catch(e=>{throw Xc=null,e})}let Xc=null;function pw(r){return Xc=Xc||gw(r),Xc}/**
1339 * @license
1340 * Copyright 2020 Google LLC.
1341 *
1342 * Licensed under the Apache License, Version 2.0 (the "License");
1343 * you may not use this file except in compliance with the License.
1344 * You may obtain a copy of the License at
1345 *
1346 *   http://www.apache.org/licenses/LICENSE-2.0
1347 *
1348 * Unless required by applicable law or agreed to in writing, software
1349 * distributed under the License is distributed on an "AS IS" BASIS,
1350 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1351 * See the License for the specific language governing permissions and
1352 * limitations under the License.
1353 */const yw=new ou(5e3,15e3),vw="__/auth/iframe",_w="emulator/auth/iframe",bw={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Tw=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Ew(r){const e=r.config;De(e.authDomain,r,"auth-domain-config-required");const i=e.emulator?qm(e,_w):`https://${r.config.authDomain}/${vw}`,s={apiKey:e.apiKey,appName:r.name,v:Cl},o=Tw.get(r.config.apiHost);o&&(s.eid=o);const c=r._getFrameworks();return c.length&&(s.fw=c.join(",")),`${i}?${lu(s).slice(1)}`}async function xw(r){const e=await pw(r),i=rr().gapi;return De(i,r,"internal-error"),e.open({where:document.body,url:Ew(r),messageHandlersFilter:i.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:bw,dontclear:!0},s=>new Promise(async(o,c)=>{await s.restyle({setHideOnLeave:!1});const f=Li(r,"network-request-failed"),y=rr().setTimeout(()=>{c(f)},yw.get());function _(){rr().clearTimeout(y),o(s)}s.ping(_).then(_,()=>{c(f)})}))}/**
1354 * @license
1355 * Copyright 2020 Google LLC.
1356 *
1357 * Licensed under the Apache License, Version 2.0 (the "License");
1358 * you may not use this file except in compliance with the License.
1359 * You may obtain a copy of the License at
1360 *
1361 *   http://www.apache.org/licenses/LICENSE-2.0
1362 *
1363 * Unless required by applicable law or agreed to in writing, software
1364 * distributed under the License is distributed on an "AS IS" BASIS,
1365 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1366 * See the License for the specific language governing permissions and
1367 * limitations under the License.
1368 */const Aw={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Sw=500,ww=600,Nw="_blank",Iw="http://localhost";class jv{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Rw(r,e,i,s=Sw,o=ww){const c=Math.max((window.screen.availHeight-o)/2,0).toString(),f=Math.max((window.screen.availWidth-s)/2,0).toString();let y="";const _={...Aw,width:s.toString(),height:o.toString(),top:c,left:f},p=Dn().toLowerCase();i&&(y=db(p)?Nw:i),cb(p)&&(e=e||Iw,_.scrollbars="yes");const T=Object.entries(_).reduce((S,[z,Q])=>`${S}${z}=${Q},`,"");if(uS(p)&&y!=="_self")return Cw(e||"",y),new jv(null);const A=window.open(e||"",y,T);De(A,r,"popup-blocked");try{A.focus()}catch{}return new jv(A)}function Cw(r,e){const i=document.createElement("a");i.href=r,i.target=e;const s=document.createEvent("MouseEvent");
1368s.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),i.dispatchEvent(s)}/**
1369 * @license
1370 * Copyright 2021 Google LLC
1371 *
1372 * Licensed under the Apache License, Version 2.0 (the "License");
1373 * you may not use this file except in compliance with the License.
1374 * You may obtain a copy of the License at
1375 *
1376 *   http://www.apache.org/licenses/LICENSE-2.0
1377 *
1378 * Unless required by applicable law or agreed to in writing, software
1379 * distributed under the License is distributed on an "AS IS" BASIS,
1380 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1381 * See the License for the specific language governing permissions and
1382 * limitations under the License.
1383 */const Dw="__/auth/handler",Mw="emulator/auth/handler",Ow=encodeURIComponent("fac");async function Vv(r,e,i,s,o,c){De(r.config.authDomain,r,"auth-domain-config-required"),De(r.config.apiKey,r,"invalid-api-key");const f={apiKey:r.config.apiKey,appName:r.name,authType:i,redirectUrl:s,v:Cl,eventId:o};if(e instanceof Ym){e.setDefaultLanguage(r.languageCode),f.providerId=e.providerId||"",M1(e.getCustomParameters())||(f.customParameters=JSON.stringify(e.getCustomParameters()));for(const[T,A]of Object.entries({}))f[T]=A}if(e instanceof uu){const T=e.getScopes().filter(A=>A!=="");T.length>0&&(f.scopes=T.join(","))}r.tenantId&&(f.tid=r.tenantId);const y=f;for(const T of Object.keys(y))y[T]===void 0&&delete y[T];const _=await r._getAppCheckToken(),p=_?`#${Ow}=${encodeURIComponent(_)}`:"";return`${jw(r)}?${lu(y).slice(1)}${p}`}function jw({config:r}){return r.emulator?qm(r,Mw):`https://${r.authDomain}/${Dw}`}/**
1384 * @license
1385 * Copyright 2020 Google LLC
1386 *
1387 * Licensed under the Apache License, Version 2.0 (the "License");
1388 * you may not use this file except in compliance with the License.
1389 * You may obtain a copy of the License at
1390 *
1391 *   http://www.apache.org/licenses/LICENSE-2.0
1392 *
1393 * Unless required by applicable law or agreed to in writing, software
1394 * distributed under the License is distributed on an "AS IS" BASIS,
1395 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1396 * See the License for the specific language governing permissions and
1397 * limitations under the License.
1398 */const sm="webStorageSupport";class Vw{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Sb,this._completeRedirectFn=sw,this._overrideRedirectResult=nw}async _openPopup(e,i,s,o){var f;Or((f=this.eventManagers[e._key()])==null?void 0:f.manager,"_initialize() not called before _openPopup()");const c=await Vv(e,i,s,pm(),o);return Rw(e,c,$m())}async _openRedirect(e,i,s,o){await this._originValidation(e);const c=await Vv(e,i,s,pm(),o);return US(c),new Promise(()=>{})}_initialize(e){const i=e._key();if(this.eventManagers[i]){const{manager:o,promise:c}=this.eventManagers[i];return o?Promise.resolve(o):(Or(c,"If manager is not set, promise should be"),c)}const s=this.initAndGetManager(e);return this.eventManagers[i]={promise:s},s.catch(()=>{delete this.eventManagers[i]}),s}async initAndGetManager(e){const i=await xw(e),s=new lw(e);return i.register("authEvent",o=>(De(o==null?void 0:o.authEvent,e,"invalid-auth-event"),{status:s.onEvent(o.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:s},this.iframes[e._key()]=i,s}_isIframeWebStorageSupported(e,i){this.iframes[e._key()].send(sm,{type:sm},o=>{var f;const c=(f=o==null?void 0:o[0])==null?void 0:f[sm];c!==void 0&&i(!!c),or(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const i=e._key();return this.originValidationPromises[i]||(this.originValidationPromises[i]=dw(e)),this.originValidationPromises[i]}get _shouldInitProactively(){return yb()||hb()||Km()}}const kw=Vw;var kv="@firebase/auth",Lv="1.12.0";/**
1399 * @license
1400 * Copyright 2020 Google LLC
1401 *
1402 * Licensed under the Apache License, Version 2.0 (the "License");
1403 * you may not use this file except in compliance with the License.
1404 * You may obtain a copy of the License at
1405 *
1406 *   http://www.apache.org/licenses/LICENSE-2.0
1407 *
1408 * Unless required by applicable law or agreed to in writing, softw
1408are
1409 * distributed under the License is distributed on an "AS IS" BASIS,
1410 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1411 * See the License for the specific language governing permissions and
1412 * limitations under the License.
1413 */class Lw{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)==null?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 i=this.auth.onIdTokenChanged(s=>{e((s==null?void 0:s.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,i),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const i=this.internalListeners.get(e);i&&(this.internalListeners.delete(e),i(),this.updateProactiveRefresh())}assertAuthConfigured(){De(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1414 * @license
1415 * Copyright 2020 Google LLC
1416 *
1417 * Licensed under the Apache License, Version 2.0 (the "License");
1418 * you may not use this file except in compliance with the License.
1419 * You may obtain a copy of the License at
1420 *
1421 *   http://www.apache.org/licenses/LICENSE-2.0
1422 *
1423 * Unless required by applicable law or agreed to in writing, software
1424 * distributed under the License is distributed on an "AS IS" BASIS,
1425 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1426 * See the License for the specific language governing permissions and
1427 * limitations under the License.
1428 */function Uw(r){switch(r){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function Pw(r){bl(new ma("auth",(e,{options:i})=>{const s=e.getProvider("app").getImmediate(),o=e.getProvider("heartbeat"),c=e.getProvider("app-check-internal"),{apiKey:f,authDomain:y}=s.options;De(f&&!f.includes(":"),"invalid-api-key",{appName:s.name});const _={apiKey:f,authDomain:y,clientPlatform:r,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:vb(r)},p=new gS(s,o,c,_);return TS(p,i),p},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,i,s)=>{e.getProvider("auth-internal").initialize()})),bl(new ma("auth-internal",e=>{const i=wh(e.getProvider("auth").getImmediate());return(s=>new Lw(s))(i)},"PRIVATE").setInstantiationMode("EXPLICIT")),As(kv,Lv,Uw(r)),As(kv,Lv,"esm2020")}/**
1429 * @license
1430 * Copyright 2021 Google LLC
1431 *
1432 * Licensed under the Apache License, Version 2.0 (the "License");
1433 * you may not use this file except in compliance with the License.
1434 * You may obtain a copy of the License at
1435 *
1436 *   http://www.apache.org/licenses/LICENSE-2.0
1437 *
1438 * Unless required by applicable law or agreed to in writing, software
1439 * distributed under the License is distributed on an "AS IS" BASIS,
1440 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1441 * See the License for the specific language governing permissions and
1442 * limitations under the License.
1443 */const zw=300,Bw=Y_("authIdTokenMaxAge")||zw;let Uv=null;const Hw=r=>async e=>{const i=e&&await e.getIdTokenResult(),s=i&&(new Date().getTime()-Date.parse(i.issuedAtTime))/1e3;if(s&&s>Bw)return;const o=i==null?void 0:i.token;Uv!==o&&(Uv=o,await fetch(r,{method:o?"POST":"DELETE",headers:o?{Authorization:`Bearer ${o}`}:{}}))};function qw(r=eb()){const e=zm(r,"auth");if(e.isInitialized())return e.getImmediate();const i=bS(r,{popupRedirectResolver:kw,persistence:[QS,VS,Sb]}),s=Y_("authTokenSyncURL");if(s&&typeof isSecureContext=="boolean"&&isSecureContext){const c=new URL(s,location.origin);if(location.origin===c.origin){const f=Hw(c.toString());CS(i,f,()=>f(i.currentUser)),RS(i,y=>f(y))}}const o=K_("auth");return o&&ES(i,`http://${o}`),i}function Fw(){var r;return((r=document.getElementsByTagName("head"))==null?void 0:r[0])??document}pS({loadJS(r){return new Promise((e,i)=>{const s=document.createElement("script");s.setAttribute("src",r),s.onload=e,s.onerror=o=>{const c=Li("internal-error");c.customData=o,i(c)},s.type="text/javascript",s.charset="UTF-8",Fw().appendChild(s)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});Pw("Browser");var Pv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
1444Copyright The Closure Library Authors.
1445SPDX-License-Identifier: Apache-2.0
1446*/var Ss,Ob;(function(){var r;/** @license
1447
1448 Copyright The Closure Library Authors.
1449 SPDX-License-Identifier: Apache-2.0
1450*/function e(I,w){function N(){}N.prototype=w.prototype,I.F=w.prototype,I.prototype=new N,I.prototype.constructor=I,I.D=function(j,R,V){for(var C=Array(arguments.length-2),Ne=2;Ne<arguments.length;Ne++)C[Ne-2]=arguments[Ne];return w.prototype[R].apply(j,C)}}function i(){this.blockSize=-1}function s(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.C=Array(this.blockSize),this.o=this.h=0,this.u()}e(s,i),s.prototype.u=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function o(I,w,N){N||(N=0);const j=Array(16);if(typeof w=="string")for(var R=0;R<16;
vendor: 3,841 bytes, line 1450
1450++R)j[R]=w.charCodeAt(N++)|w.charCodeAt(N++)<<8|w.charCodeAt(N++)<<16|w.charCodeAt(N++)<<24;else for(R=0;R<16;++R)j[R]=w[N++]|w[N++]<<8|w[N++]<<16|w[N++]<<24;w=I.g[0],N=I.g[1],R=I.g[2];let V=I.g[3],C;C=w+(V^N&(R^V))+j[0]+3614090360&4294967295,w=N+(C<<7&4294967295|C>>>25),C=V+(R^w&(N^R))+j[1]+3905402710&4294967295,V=w+(C<<12&4294967295|C>>>20),C=R+(N^V&(w^N))+j[2]+606105819&4294967295,R=V+(C<<17&4294967295|C>>>15),C=N+(w^R&(V^w))+j[3]+3250441966&4294967295,N=R+(C<<22&4294967295|C>>>10),C=w+(V^N&(R^V))+j[4]+4118548399&4294967295,w=N+(C<<7&4294967295|C>>>25),C=V+(R^w&(N^R))+j[5]+1200080426&4294967295,V=w+(C<<12&4294967295|C>>>20),C=R+(N^V&(w^N))+j[6]+2821735955&4294967295,R=V+(C<<17&4294967295|C>>>15),C=N+(w^R&(V^w))+j[7]+4249261313&4294967295,N=R+(C<<22&4294967295|C>>>10),C=w+(V^N&(R^V))+j[8]+1770035416&4294967295,w=N+(C<<7&4294967295|C>>>25),C=V+(R^w&(N^R))+j[9]+2336552879&4294967295,V=w+(C<<12&4294967295|C>>>20),C=R+(N^V&(w^N))+j[10]+4294925233&4294967295,R=V+(C<<17&4294967295|C>>>15),C=N+(w^R&(V^w))+j[11]+2304563134&4294967295,N=R+(C<<22&4294967295|C>>>10),C=w+(V^N&(R^V))+j[12]+1804603682&4294967295,w=N+(C<<7&4294967295|C>>>25),C=V+(R^w&(N^R))+j[13]+4254626195&4294967295,V=w+(C<<12&4294967295|C>>>20),C=R+(N^V&(w^N))+j[14]+2792965006&4294967295,R=V+(C<<17&4294967295|C>>>15),C=N+(w^R&(V^w))+j[15]+1236535329&4294967295,N=R+(C<<22&4294967295|C>>>10),C=w+(R^V&(N^R))+j[1]+4129170786&4294967295,w=N+(C<<5&4294967295|C>>>27),C=V+(N^R&(w^N))+j[6]+3225465664&4294967295,V=w+(C<<9&4294967295|C>>>23),C=R+(w^N&(V^w))+j[11]+643717713&4294967295,R=V+(C<<14&4294967295|C>>>18),C=N+(V^w&(R^V))+j[0]+3921069994&4294967295,N=R+(C<<20&4294967295|C>>>12),C=w+(R^V&(N^R))+j[5]+3593408605&4294967295,w=N+(C<<5&4294967295|C>>>27),C=V+(N^R&(w^N))+j[10]+38016083&4294967295,V=w+(C<<9&4294967295|C>>>23),C=R+(w^N&(V^w))+j[15]+3634488961&4294967295,R=V+(C<<14&4294967295|C>>>18),C=N+(V^w&(R^V))+j[4]+3889429448&4294967295,N=R+(C<<20&4294967295|C>>>12),C=w+(R^V&(N^R))+j[9]+568446438&4294967295,w=N+(C<<5&4294967295|C>>>27),C=V+(N^R&(w^N))+j[14]+3275163606&4294967295,V=w+(C<<9&4294967295|C>>>23),C=R+(w^N&(V^w))+j[3]+4107603335&4294967295,R=V+(C<<14&4294967295|C>>>18),C=N+(V^w&(R^V))+j[8]+1163531501&4294967295,N=R+(C<<20&4294967295|C>>>12),C=w+(R^V&(N^R))+j[13]+2850285829&4294967295,w=N+(C<<5&4294967295|C>>>27),C=V+(N^R&(w^N))+j[2]+4243563512&4294967295,V=w+(C<<9&4294967295|C>>>23),C=R+(w^N&(V^w))+j[7]+1735328473&4294967295,R=V+(C<<14&4294967295|C>>>18),C=N+(V^w&(R^V))+j[12]+2368359562&4294967295,N=R+(C<<20&4294967295|C>>>12),C=w+(N^R^V)+j[5]+4294588738&4294967295,w=N+(C<<4&4294967295|C>>>28),C=V+(w^N^R)+j[8]+2272392833&4294967295,V=w+(C<<11&4294967295|C>>>21),C=R+(V^w^N)+j[11]+1839030562&4294967295,R=V+(C<<16&4294967295|C>>>16),C=N+(R^V^w)+j[14]+4259657740&4294967295,N=R+(C<<23&4294967295|C>>>9),C=w+(N^R^V)+j[1]+2763975236&4294967295,w=N+(C<<4&4294967295|C>>>28),C=V+(w^N^R)+j[4]+1272893353&4294967295,V=w+(C<<11&4294967295|C>>>21),C=R+(V^w^N)+j[7]+4139469664&4294967295,R=V+(C<<16&4294967295|C>>>16),C=N+(R^V^w)+j[10]+3200236656&4294967295,N=R+(C<<23&4294967295|C>>>9),C=w+(N^R^V)+j[13]+681279174&4294967295,w=N+(C<<4&4294967295|C>>>28),C=V+(w^N^R)+j[0]+3936430074&4294967295,V=w+(C<<11&4294967295|C>>>21),C=R+(V^w^N)+j[3]+3572445317&4294967295,R=V+(C<<16&4294967295|C>>>16),C=N+(R^V^w)+j[6]+76029189&4294967295,N=R+(C<<23&4294967295|C>>>9),C=w+(N^R^V)+j[9]+3654602809&4294967295,w=N+(C<<4&4294967295|C>>>28),C=V+(w^N^R)+j[12]+3873151461&4294967295,V=w+(C<<11&4294967295|C>>>21),C=R+(V^w^N)+j[15]+530742520&4294967295,R=V+(C<<16&4294967295|C>>>16),C=N+(R^V^w)+j[2]+3299628645&4294967295,N=R+(C<<23&4294967295|C>>>9),C=w+(R^(N|~V))+j[0]+4096336452&4294967295,w=N+(C<<6&4294967295|C>>>26),C=V+(N^(w|~R))+j[7]+1126891415&4294967295,V=w+(C<<10&4294967295|C>>>22),C=R+(w^(V|~N))+j[14]+2878612391&4294967295,R=V+(C<<15&4294967295|C>>>
145017),C=N+(V^(R|~w))+j[5]+4237533241&4294967295,N=R+(C<<21&4294967295|C>>>11),C=w+(R^(N|~V))+j[12]+1700485571&4294967295,w=N+(C<<6&4294967295|C>>>26),C=V+(N^(w|~R))+j[3]+2399980690&4294967295,V=w+(C<<10&4294967295|C>>>22),C=R+(w^(V|~N))+j[10]+4293915773&4294967295,R=V+(C<<15&4294967295|C>>>17),C=N+(V^(R|~w))+j[1]+2240044497&4294967295,N=R+(C<<21&4294967295|C>>>11),C=w+(R^(N|~V))+j[8]+1873313359&4294967295,w=N+(C<<6&4294967295|C>>>26),C=V+(N^(w|~R))+j[15]+4264355552&4294967295,V=w+(C<<10&4294967295|C>>>22),C=R+(w^(V|~N))+j[6]+2734768916&4294967295,R=V+(C<<15&4294967295|C>>>17),C=N+(V^(R|~w))+j[13]+1309151649&4294967295,N=R+(C<<21&4294967295|C>>>11),C=w+(R^(N|~V))+j[4]+4149444226&4294967295,w=N+(C<<6&4294967295|C>>>26),C=V+(N^(w|~R))+j[11]+3174756917&4294967295,V=w+(C<<10&4294967295|C>>>22),C=R+(w^(V|~N))+j[2]+718787259&4294967295,R=V+(C<<15&4294967295|C>>>17),C=N+(V^(R|~w))+j[9]+3951481745&4294967295,I.g[0]=I.g[0]+w&4294967295,I.g[1]=I.g[1]+(R+(C<<21&4294967295|C>>>11))&4294967295,I.g[2]=I.g[2]+R&4294967295,I.g[3]=I.g[3]+V&4294967295}s.prototype.v=function(I,w){w===void 0&&(w=I.length);const N=w-this.blockSize,j=this.C;let R=this.h,V=0;for(;V<w;){if(R==0)for(;V<=N;)o(this,I,V),V+=this.blockSize;if(typeof I=="string"){for(;V<w;)if(j[R++]=I.charCodeAt(V++),R==this.blockSize){o(this,j),R=0;break}}else for(;V<w;)if(j[R++]=I[V++],R==this.blockSize){o(this,j),R=0;break}}this.h=R,this.o+=w},s.prototype.A=function(){var I=Array((this.h<56?this.blockSize:this.blockSize*2)-this.h);I[0]=128;for(var w=1;w<I.length-8;++w)I[w]=0;w=this.o*8;for(var N=I.length-8;N<I.length;++N)I[N]=w&255,w/=256;for(this.v(I),I=Array(16),w=0,N=0;N<4;++N)for(let j=0;j<32;j+=8)I[w++]=this.g[N]>>>j&255;return I};function c(I,w){var N=y;return Object.prototype.hasOwnProperty.call(N,I)?N[I]:N[I]=w(I)}function f(I,w){this.h=w;const N=[];let j=!0;for(let R=I.length-1;R>=0;R--){const V=I[R]|0;j&&V==w||(N[R]=V,j=!1)}this.g=N}var y={};function _(I){return-128<=I&&I<128?c(I,function(w){return new f([w|0],w<0?-1:0)}):new f([I|0],I<0?-1:0)}function p(I){if(isNaN(I)||!isFinite(I))return A;if(I<0)return X(p(-I));const w=[];let N=1;for(let j=0;I>=N;j++)w[j]=I/N|0,N*=4294967296;return new f(w,0)}function T(I,w){if(I.length==0)throw Error("number format error: empty string");if(w=w||10,w<2||36<w)throw Error("radix out of range: "+w);if(I.charAt(0)=="-")return X(T(I.substring(1),w));if(I.indexOf("-")>=0)throw Error('number format error: interior "-" character');const N=p(Math.pow(w,8));let j=A;for(let V=0;V<I.length;V+=8){var R=Math.min(8,I.length-V);const C=parseInt(I.substring(V,V+R),w);R<8?(R=p(Math.pow(w,R)),j=j.j(R).add(p(C))):(j=j.j(N),j=j.add(p(C)))}return j}var A=_(0),S=_(1),z=_(16777216);r=f.prototype,r.m=function(){if(ie(this))return-X(this).m();let I=0,w=1;for(let N=0;N<this.g.length;N++){const j=this.i(N);I+=(j>=0?j:4294967296+j)*w,w*=4294967296}return I},r.toString=function(I){if(I=I||10,I<2||36<I)throw Error("radix out of range: "+I);if(Q(this))return"0";if(ie(this))return"-"+X(this).toString(I);const w=p(Math.pow(I,6));var N=this;let j="";for(;;){const R=He(N,w).g;N=ge(N,R.j(w));let V=((N.g.length>0?N.g[0]:N.h)>>>0).toString(I);if(N=R,Q(N))return V+j;for(;V.length<6;)V="0"+V;j=V+j}},r.i=function(I){return I<0?0:I<this.g.length?this.g[I]:this.h};function Q(I){if(I.h!=0)return!1;for(let w=0;w<I.g.length;w++)if(I.g[w]!=0)return!1;return!0}function ie(I){return I.h==-1}r.l=function(I){return I=ge(this,I),ie(I)?-1:Q(I)?0:1};function X(I){const w=I.g.length,N=[];for(let j=0;j<w;j++)N[j]=~I.g[j];return new f(N,~I.h).add(S)}r.abs=function(){return ie(this)?X(this):this},r.add=function(I){const w=Math.max(this.g.length,I.g.length),N=[];let j=0;for(let R=0;R<=w;R++){let V=j+(this.i(R)&65535)+(I.i(R)&65535),C=(V>>>16)+(this.i(R)>>>16)+(I.i(R)>>>16);j=C>>>16,V&=65535,C&=65535,N[R]=C<<16|V}return new f(N,N[N.length-1]&-2147483648?-1:0)};function ge(I,w){return I.add(X(w))}r.j=function(I){if(Q(this)||Q(I))return A;if(ie(this))return ie(I)?X(this).j(X(I)):X(X(this).j(I));if(ie(I))return X(this.j(X(I)));if(this.l(z)<0&&I.l(z)<0)return p(this.m()*I.m());const w=this.g.length+I.g.length,N=[];for(var j=0;j<2*w;j++)N[j]=0;for(j=0;j<this.g.length;j++)for(let R=0;R<I.g.length;R++){const V=this.i(j)>>>16,C=this.i(j)&65535,Ne=I.i(R)>>>16,qe=I.i(R)&65535;N[2*j+2*R]+=C*qe,Te(N,2*j+2*R),N[2*j+2*R+1]+=V*qe,Te(N,2*j+2*R+1),N[2*j+2*R+1]+=C*Ne,Te(N,2*j+2*R+1),N[2*j+2*R+2]+=V*Ne,Te(N,2*j+2*R+2)}for(I=0;I<w;I++)N[I]=N[2*I+1]<<16|N[2*I];for(I=w;I<2*w;I++)N[I]=0;return new f(N,0)};function Te(I,w){for(;(I[w]&65535)!=I[w];)I[w+1]+=I[w]>>>16,I[w]&=65535,w++}function we(I,w){this.g=I,this.h=w}function He(I,w){if(Q(w))throw Error("division by zero");if(Q(I))return new we(A,A);if(ie(I))return w=He(X(I),w),new we(X(w.g),X(w.h));if(ie(w))return w=He(I,X(w)),new we(X(w.g),w.h);if(I.g.length>
145030){if(ie(I)||ie(w))throw Error("slowDivide_ only works with positive integers.");for(var N=S,j=w;j.l(I)<=0;)N=ze(N),j=ze(j);var R=Ve(N,1),V=Ve(j,1);for(j=Ve(j,2),N=Ve(N,2);!Q(j);){var C=V.add(j);C.l(I)<=0&&(R=R.add(N),V=C),j=Ve(j,1),N=Ve(N,1)}return w=ge(I,R.j(w)),new we(R,w)}for(R=A;I.l(w)>=0;){for(N=Math.max(1,Math.floor(I.m()/w.m())),j=Math.ceil(Math.log(N)/Math.LN2),j=j<=48?1:Math.pow(2,j-48),V=p(N),C=V.j(w);ie(C)||C.l(I)>0;)N-=j,V=p(N),C=V.j(w);Q(V)&&(V=S),R=R.add(V),I=ge(I,C)}return new we(R,I)}r.B=function(I){return He(this,I).h},r.and=function(I){const w=Math.max(this.g.length,I.g.length),N=[];for(let j=0;j<w;j++)N[j]=this.i(j)&I.i(j);return new f(N,this.h&I.h)},r.or=function(I){const w=Math.max(this.g.length,I.g.length),N=[];for(let j=0;j<w;j++)N[j]=this.i(j)|I.i(j);return new f(N,this.h|I.h)},r.xor=function(I){const w=Math.max(this.g.length,I.g.length),N=[];for(let j=0;j<w;j++)N[j]=this.i(j)^I.i(j);return new f(N,this.h^I.h)};function ze(I){const w=I.g.length+1,N=[];for(let j=0;j<w;j++)N[j]=I.i(j)<<1|I.i(j-1)>>>31;return new f(N,I.h)}function Ve(I,w){const N=w>>5;w%=32;const j=I.g.length-N,R=[];for(let V=0;V<j;V++)R[V]=w>0?I.i(V+N)>>>w|I.i(V+N+1)<<32-w:I.i(V+N);return new f(R,I.h)}s.prototype.digest=s.prototype.A,s.prototype.reset=s.prototype.u,s.prototype.update=s.prototype.v,Ob=s,f.prototype.add=f.prototype.add,f.prototype.multiply=f.prototype.j,f.prototype.modulo=f.prototype.B,f.prototype.compare=f.prototype.l,f.prototype.toNumber=f.prototype.m,f.prototype.toString=f.prototype.toString,f.prototype.getBits=f.prototype.i,f.fromNumber=p,f.fromString=T,Ss=f}).apply(typeof Pv<"u"?Pv:typeof self<"u"?self:typeof window<"u"?window:{});var Bc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
1451Copyright The Closure Library Authors.
1452SPDX-License-Identifier: Apache-2.0
1453*/var jb,zo,Vb,Jc,_m,kb,Lb,Ub;(function(){var r,e=Object.defineProperty;function i(u){u=[typeof globalThis=="object"&&globalThis,u,typeof window=="object"&&window,typeof self=="object"&&self,typeof Bc=="object"&&Bc];for(var g=0;g<u.length;++g){var b=u[g];if(b&&b.Math==Math)return b}throw Error("Cannot find global object")}var s=i(this);function o(u,g){if(g)e:{var b=s;u=u.split(".");for(var x=0;x<u.length-1;x++){var L=u[x];if(!(L in b))break e;b=b[L]}u=u[u.length-1],x=b[u],g=g(x),g!=x&&g!=null&&e(b,u,{configurable:!0,writable:!0,value:g})}}o("Symbol.dispose",function(u){return u||Symbol("Symbol.dispose")}),o("Array.prototype.values",function(u){return u||function(){return this[Symbol.iterator]()}}),o("Object.entries",function(u){return u||function(g){var b=[],x;for(x in g)Object.prototype.hasOwnProperty.call(g,x)&&b.push([x,g[x]]);return b}});/** @license
1454
1455 Copyright The Closure Library Authors.
1456 SPDX-License-Identifier: Apache-2.0
1457*/var c=c||{},f=this||self;function y(u){var g=typeof u;return g=="object"&&u!=null||g=="function"}function _(u,g,b){return u.call.apply(u.bind,arguments)}function p(u,g,b){return p=_,p.apply(null,arguments)}function T(u,g){var b=Array.prototype.slice.call(arguments,1);return function(){var x=b.slice();return x.push.apply(x,arguments),u.apply(this,x)}}function A(u,g){function b(){}b.prototype=g.prototype,u.Z=g.prototype,u.prototype=new b,u.prototype.constructor=u,u.Ob=function(x,L,q){for(var ae=Array(arguments.length-2),Le=2;Le<arguments.length;Le++)ae[Le-2]=arguments[Le];return g.prototype[L].apply(x,ae)}}var S=typeof AsyncContext<"u"&&typeof AsyncContext.Snapshot=="function"?u=>u&&AsyncContext.Snapshot.wrap(u):u=>u;function z(u){const g=u.length;if(g>0){const b=Array(g);for(let x=0;x<g;x++)b[x]=u[x];return b}return[]}function Q(u,g){for(let x=1;x<arguments.length;x++){const L=arguments[x];var b=typeof L;if(b=b!="object"?b:L?Array.isArray(L)?"array":b:"null",b=="array"||b=="object"&&typeof L.length=="number"){b=u.length||0;const q=L.length||0;u.length=b+q;for(let ae=0;ae<q;ae++)u[b+ae]=L[ae]}else u.push(L)}}class ie{constructor(g,b){this.i=g,this.j=b,this.h=0,this.g=null}get(){let g;return this.h>0?(this.h--,g=this.g,this.g=g.next,g.next=null):g=this.i(),g}}function X(u){f.setTimeout(()=>{throw u},0)}function ge(){var u=I;let g=null;return u.g&&(g=u.g,u.g=u.g.next,u.g||(u.h=null),g.next=null),g}class Te{constructor(){this.h=this.g=null}add(g,b){const x=we.get();x.set(g,b),this.h?this.h.next=x:this.g=x,this.h=x}}var we=new ie(()=>new He,u=>u.reset());class He{constructor(){this.next=this.g=this.h=null}set(g,b){this.h=g,this.g=b,this.next=null}reset(){this.next=this.g=this.h=null}}let ze,Ve=!1,I=new Te,w=()=>{const u=Promise.resolve(void 0);ze=()=>{u.then(N)}};function N(){for(var u;u=ge();){try{u.h.call(u.g)}catch(b){X(b)}var g=we;g.j(u),g.h<100&&(g.h++,u.next=g.g,g.g=u)}Ve=!1}function j(){this.u=this.u,this.C=this.C}j.prototype.u=!1,j.prototype.dispose=function(){this.u||(this.u=!0,this.N())},j.prototype[Symbol.dispose]=function(){this.dispose()},j.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function R(u,g){this.type=u,this.g=this.target=g,this.defaultPrevented=!1}R.prototype.h=function(){this.defaultPrevented=!0};var V=(function(){if(!f.addEventListener||!Object.defineProperty)return!1;var u=!1,g=Object.defineProperty({},"passive",{get:function(){u=!0}});try{const b=()=>{};f.addEventListener("test",b,g),f.removeEventListener("test",b,g)}catch{}return u})();function C(u){return/^[\s\xa0]*$/.test(u)}function Ne(u,g){R.call(this,u?u.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,u&&this.init(u,g)}
1457A(Ne,R),Ne.prototype.init=function(u,g){const b=this.type=u.type,x=u.changedTouches&&u.changedTouches.length?u.changedTouches[0]:null;this.target=u.target||u.srcElement,this.g=g,g=u.relatedTarget,g||(b=="mouseover"?g=u.fromElement:b=="mouseout"&&(g=u.toElement)),this.relatedTarget=g,x?(this.clientX=x.clientX!==void 0?x.clientX:x.pageX,this.clientY=x.clientY!==void 0?x.clientY:x.pageY,this.screenX=x.screenX||0,this.screenY=x.screenY||0):(this.clientX=u.clientX!==void 0?u.clientX:u.pageX,this.clientY=u.clientY!==void 0?u.clientY:u.pageY,this.screenX=u.screenX||0,this.screenY=u.screenY||0),this.button=u.button,this.key=u.key||"",this.ctrlKey=u.ctrlKey,this.altKey=u.altKey,this.shiftKey=u.shiftKey,this.metaKey=u.metaKey,this.pointerId=u.pointerId||0,this.pointerType=u.pointerType,this.state=u.state,this.i=u,u.defaultPrevented&&Ne.Z.h.call(this)},Ne.prototype.h=function(){Ne.Z.h.call(this);const u=this.i;u.preventDefault?u.preventDefault():u.returnValue=!1};var qe="closure_listenable_"+(Math.random()*1e6|0),G=0;function re(u,g,b,x,L){this.listener=u,this.proxy=null,this.src=g,this.type=b,this.capture=!!x,this.ha=L,this.key=++G,this.da=this.fa=!1}function fe(u){u.da=!0,u.listener=null,u.proxy=null,u.src=null,u.ha=null}function Be(u,g,b){for(const x in u)g.call(b,u[x],x,u)}function Ke(u,g){for(const b in u)g.call(void 0,u[b],b,u)}function M(u){const g={};for(const b in u)g[b]=u[b];return g}const Y="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function ne(u,g){let b,x;for(let L=1;L<arguments.length;L++){x=arguments[L];for(b in x)u[b]=x[b];for(let q=0;q<Y.length;q++)b=Y[q],Object.prototype.hasOwnProperty.call(x,b)&&(u[b]=x[b])}}function le(u){this.src=u,this.g={},this.h=0}le.prototype.add=function(u,g,b,x,L){const q=u.toString();u=this.g[q],u||(u=this.g[q]=[],this.h++);const ae=he(u,g,x,L);return ae>-1?(g=u[ae],b||(g.fa=!1)):(g=new re(g,this.src,q,!!x,L),g.fa=b,u.push(g)),g};function be(u,g){const b=g.type;if(b in u.g){var x=u.g[b],L=Array.prototype.indexOf.call(x,g,void 0),q;(q=L>=0)&&Array.prototype.splice.call(x,L,1),q&&(fe(g),u.g[b].length==0&&(delete u.g[b],u.h--))}}function he(u,g,b,x){for(let L=0;L<u.length;++L){const q=u[L];if(!q.da&&q.listener==g&&q.capture==!!b&&q.ha==x)return L}return-1}var H="closure_lm_"+(Math.random()*1e6|0),Ee={};function Se(u,g,b,x,L){if(Array.isArray(g)){for(let q=0;q<g.length;q++)Se(u,g[q],b,x,L);return null}return b=se(b),u&&u[qe]?u.J(g,b,y(x)?!!x.capture:!1,L):Fe(u,g,b,!1,x,L)}function Fe(u,g,b,x,L,q){if(!g)throw Error("Invalid event type");const ae=y(L)?!!L.capture:!!L;let Le=Pn(u);if(Le||(u[H]=Le=new le(u)),b=Le.add(g,b,x,ae,q),b.proxy)return b;if(x=jt(),b.proxy=x,x.src=u,x.listener=b,u.addEventListener)V||(L=ae),L===void 0&&(L=!1),u.addEventListener(g.toString(),x,L);else if(u.attachEvent)u.attachEvent(dn(g.toString()),x);else if(u.addListener&&u.removeListener)u.addListener(x);else throw Error("addEventListener and attachEvent are unavailable.");return b}function jt(){function u(b){return g.call(u.src,u.listener,b)}const g=fn;return u}function Rt(u,g,b,x,L){if(Array.isArray(g))for(var q=0;q<g.length;q++)Rt(u,g[q],b,x,L);else x=y(x)?!!x.capture:!!x,b=se(b),u&&u[qe]?(u=u.i,q=String(g).toString(),q in u.g&&(g=u.g[q],b=he(g,b,x,L),b>-1&&(fe(g[b]),Array.prototype.splice.call(g,b,1),g.length==0&&(delete u.g[q],u.h--)))):u&&(u=Pn(u))&&(g=u.g[g.toString()],u=-1,g&&(u=he(g,b,x,L)),(b=u>-1?g[u]:null)&&Un(b))}function Un(u){if(typeof u!="number"&&u&&!u.da){var g=u.src;if(g&&g[qe])be(g.i,u);else{var b=u.type,x=u.proxy;g.removeEventListener?g.removeEventListener(b,x,u.capture):g.detachEvent?g.detachEvent(dn(b),x):g.addListener&&g.removeListener&&g.removeListener(x),(b=Pn(g))?(be(b,u),b.h==0&&(b.src=null,g[H]=null)):fe(u)}}}function dn(u){return u in Ee?Ee[u]:Ee[u]="on"+u}function fn(u,g){if(u.da)u=!0;else{g=new Ne(g,this);const b=u.listener,x=u.ha||u.src;u.fa&&Un(u),u=b.call(x,g)}return u}function Pn(u){return u=u[H],u instanceof le?u:null}var ee="__closure_events_fn_"+(Math.random()*1e9>>>0);function se(u){return typeof u=="function"?u:(u[ee]||(u[ee]=function(g){return u.handleEvent(g)}),u[ee])}function oe(){j.call(this),this.i=new le(this),this.M=this,this.G=null}A(oe,j),oe.prototype[qe]=!0,oe.prototype.removeEventListener=function(u,g,b,x){Rt(this,u,g,b,x)};function ue(u,g){var b,x=u.G;if(x)for(b=[];x;x=x.G)b.push(x);if(u=u.M,x=g.type||g,typeof g=="string")g=new R(g,u);else if(g instanceof R)g.target=g.target||u;else{var L=g;g=new R(x,u),ne(g,L)}L=!0;let q,ae;if(b)for(ae=b.length-1;ae>=0;ae--)q=g.g=b[ae],L=ve(q,x,!0,g)&&L;
1457if(q=g.g=u,L=ve(q,x,!0,g)&&L,L=ve(q,x,!1,g)&&L,b)for(ae=0;ae<b.length;ae++)q=g.g=b[ae],L=ve(q,x,!1,g)&&L}oe.prototype.N=function(){if(oe.Z.N.call(this),this.i){var u=this.i;for(const g in u.g){const b=u.g[g];for(let x=0;x<b.length;x++)fe(b[x]);delete u.g[g],u.h--}}this.G=null},oe.prototype.J=function(u,g,b,x){return this.i.add(String(u),g,!1,b,x)},oe.prototype.K=function(u,g,b,x){return this.i.add(String(u),g,!0,b,x)};function ve(u,g,b,x){if(g=u.i.g[String(g)],!g)return!0;g=g.concat();let L=!0;for(let q=0;q<g.length;++q){const ae=g[q];if(ae&&!ae.da&&ae.capture==b){const Le=ae.listener,zt=ae.ha||ae.src;ae.fa&&be(u.i,ae),L=Le.call(zt,x)!==!1&&L}}return L&&!x.defaultPrevented}function nt(u,g){if(typeof u!="function")if(u&&typeof u.handleEvent=="function")u=p(u.handleEvent,u);else throw Error("Invalid listener argument");return Number(g)>2147483647?-1:f.setTimeout(u,g||0)}function ke(u){u.g=nt(()=>{u.g=null,u.i&&(u.i=!1,ke(u))},u.l);const g=u.h;u.h=null,u.m.apply(null,g)}class wt extends j{constructor(g,b){super(),this.m=g,this.l=b,this.h=null,this.i=!1,this.g=null}j(g){this.h=arguments,this.g?this.i=!0:ke(this)}N(){super.N(),this.g&&(f.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Ft(u){j.call(this),this.h=u,this.g={}}A(Ft,j);var zi=[];function Si(u){Be(u.g,function(g,b){this.g.hasOwnProperty(b)&&Un(g)},u),u.g={}}Ft.prototype.N=function(){Ft.Z.N.call(this),Si(this)},Ft.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Jn=f.JSON.stringify,Ll=f.JSON.parse,Vs=class{stringify(u){return f.JSON.stringify(u,void 0)}parse(u){return f.JSON.parse(u,void 0)}};function ks(){}function Aa(){}var Zn={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function Vt(){R.call(this,"d")}A(Vt,R);function Mn(){R.call(this,"c")}A(Mn,R);var te={},lt=null;function rt(){return lt=lt||new oe}te.Ia="serverreachability";function mn(u){R.call(this,te.Ia,u)}A(mn,R);function Gt(u){const g=rt();ue(g,new mn(g))}te.STAT_EVENT="statevent";function ui(u,g){R.call(this,te.STAT_EVENT,u),this.stat=g}A(ui,R);function xt(u){const g=rt();ue(g,new ui(g,u))}te.Ja="timingevent";function xn(u,g){R.call(this,te.Ja,u),this.size=g}A(xn,R);function Re(u,g){if(typeof u!="function")throw Error("Fn must not be null and must be a function");return f.setTimeout(function(){u()},g)}function st(){this.g=!0}st.prototype.ua=function(){this.g=!1};function Pt(u,g,b,x,L,q){u.info(function(){if(u.g)if(q){var ae="",Le=q.split("&");for(let ct=0;ct<Le.length;ct++){var zt=Le[ct].split("=");if(zt.length>1){const Dt=zt[0];zt=zt[1];const fi=Dt.split("_");ae=fi.length>=2&&fi[1]=="type"?ae+(Dt+"="+zt+"&"):ae+(Dt+"=redacted&")}}}else ae=null;else ae=q;return"XMLHTTP REQ ("+x+") [attempt "+L+"]: "+g+`
1458`+b+`
1459`+ae})}function at(u,g,b,x,L,q,ae){u.info(function(){return"XMLHTTP RESP ("+x+") [ attempt "+L+"]: "+g+`
1460`+b+`
1461`+q+" "+ae})}function mt(u,g,b,x){u.info(function(){return"XMLHTTP TEXT ("+g+"): "+An(u,b)+(x?" "+x:"")})}function et(u,g){u.info(function(){return"TIMEOUT: "+g})}st.prototype.info=function(){};function An(u,g){if(!u.g)return g;if(!g)return null;try{const q=JSON.parse(g);if(q){for(u=0;u<q.length;u++)if(Array.isArray(q[u])){var b=q[u];if(!(b.length<2)){var x=b[1];if(Array.isArray(x)&&!(x.length<1)){var L=x[0];if(L!="noop"&&L!="stop"&&L!="close")for(let ae=1;ae<x.length;ae++)x[ae]=""}}}}return Jn(q)}catch{return g}}var Sn={NO_ERROR:0,cb:1,qb:2,pb:3,kb:4,ob:5,rb:6,Ga:7,TIMEOUT:8,ub:9},On={ib:"complete",Fb:"success",ERROR:"error",Ga:"abort",xb:"ready",yb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",wb:"progress",lb:"downloadprogress",Nb:"uploadprogress"},vt;function sn(){}A(sn,ks),sn.prototype.g=function(){return new XMLHttpRequest},vt=new sn;function wn(u){return encodeURIComponent(String(u))}function an(u){var g=1;u=u.split(":");const b=[];for(;g>0&&u.length;)b.push(u.shift()),g--;return u.length&&b.push(u.join(":")),b}function jn(u,g,b,x){this.j=u,this.i=g,this.l=b,this.S=x||1,this.V=new Ft(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new zn}function zn(){this.i=null,this.g="",this.h=!1}var Ct={},tn={};function Vn(u,g,b){u.M=1,u.A=Ls(Qt(g)),u.u=b,u.R=!0,Pr(u,null)}function Pr(u,g){u.F=Date.now(),Bi(u),u.B=Qt(u.A);var b=u.B,x=u.S;Array.isArray(x)||(x=[String(x)]),Ia(b.i,"t",x),u.C=0,b=u.j.L,u.h=new zn,u.g=Ou(u.j,b?g:null,!u.u),u.P>0&&(u.O=new wt(p(u.Y,u,u.g),u.P)),g=u.V,b=u.g,x=u.ba;var L="readystatechange";Array.isArray(L)||(L&&(zi[0]=L.toString()),L=zi);for(let q=0;q<L.length;q++){const ae=Se(b,L[q],x||g.handleEvent,!1,g.h||g);if(!ae)break;
1461g.g[ae.key]=ae}g=u.J?M(u.J):{},u.u?(u.v||(u.v="POST"),g["Content-Type"]="application/x-www-form-urlencoded",u.g.ea(u.B,u.v,u.u,g)):(u.v="GET",u.g.ea(u.B,u.v,null,g)),Gt(),Pt(u.i,u.v,u.B,u.l,u.S,u.u)}jn.prototype.ba=function(u){u=u.target;const g=this.O;g&&Ii(u)==3?g.j():this.Y(u)},jn.prototype.Y=function(u){try{if(u==this.g)e:{const Le=Ii(this.g),zt=this.g.ya(),ct=this.g.ca();if(!(Le<3)&&(Le!=3||this.g&&(this.h.h||this.g.la()||gn(this.g)))){this.K||Le!=4||zt==7||(zt==8||ct<=0?Gt(3):Gt(2)),Hi(this);var g=this.g.ca();this.X=g;var b=Ul(this);if(this.o=g==200,at(this.i,this.v,this.B,this.l,this.S,Le,g),this.o){if(this.U&&!this.L){t:{if(this.g){var x,L=this.g;if((x=L.g?L.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!C(x)){var q=x;break t}}q=null}if(u=q)mt(this.i,this.l,u,"Initial handshake response via X-HTTP-Initial-Response"),this.L=!0,qi(this,u);else{this.o=!1,this.m=3,xt(12),Wn(this),ci(this);break e}}if(this.R){u=!0;let Dt;for(;!this.K&&this.C<b.length;)if(Dt=bu(this,b),Dt==tn){Le==4&&(this.m=4,xt(14),u=!1),mt(this.i,this.l,null,"[Incomplete Response]");break}else if(Dt==Ct){this.m=4,xt(15),mt(this.i,this.l,b,"[Invalid Chunk]"),u=!1;break}else mt(this.i,this.l,Dt,null),qi(this,Dt);if(_u(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),Le!=4||b.length!=0||this.h.h||(this.m=1,xt(16),u=!1),this.o=this.o&&u,!u)mt(this.i,this.l,b,"[Invalid Chunked Response]"),Wn(this),ci(this);else if(b.length>0&&!this.W){this.W=!0;var ae=this.j;ae.g==this&&ae.aa&&!ae.P&&(ae.j.info("Great, no buffering proxy detected. Bytes received: "+b.length),Wl(ae),ae.P=!0,xt(11))}}else mt(this.i,this.l,b,null),qi(this,b);Le==4&&Wn(this),this.o&&!this.K&&(Le==4?Ru(this.j,this):(this.o=!1,Bi(this)))}else hr(this.g),g==400&&b.indexOf("Unknown SID")>0?(this.m=3,xt(12)):(this.m=0,xt(13)),Wn(this),ci(this)}}}catch{}finally{}};function Ul(u){if(!_u(u))return u.g.la();const g=gn(u.g);if(g==="")return"";let b="";const x=g.length,L=Ii(u.g)==4;if(!u.h.i){if(typeof TextDecoder>"u")return Wn(u),ci(u),"";u.h.i=new f.TextDecoder}for(let q=0;q<x;q++)u.h.h=!0,b+=u.h.i.decode(g[q],{stream:!(L&&q==x-1)});return g.length=0,u.h.g+=b,u.C=0,u.h.g}function _u(u){return u.g?u.v=="GET"&&u.M!=2&&u.j.Aa:!1}function bu(u,g){var b=u.C,x=g.indexOf(`
1462`,b);return x==-1?tn:(b=Number(g.substring(b,x)),isNaN(b)?Ct:(x+=1,x+b>g.length?tn:(g=g.slice(x,x+b),u.C=x+b,g)))}jn.prototype.cancel=function(){this.K=!0,Wn(this)};function Bi(u){u.T=Date.now()+u.H,Sa(u,u.H)}function Sa(u,g){if(u.D!=null)throw Error("WatchDog timer not null");u.D=Re(p(u.aa,u),g)}function Hi(u){u.D&&(f.clearTimeout(u.D),u.D=null)}jn.prototype.aa=function(){this.D=null;const u=Date.now();u-this.T>=0?(et(this.i,this.B),this.M!=2&&(Gt(),xt(17)),Wn(this),this.m=2,ci(this)):Sa(this,this.T-u)};function ci(u){u.j.I==0||u.K||Ru(u.j,u)}function Wn(u){Hi(u);var g=u.O;g&&typeof g.dispose=="function"&&g.dispose(),u.O=null,Si(u.V),u.g&&(g=u.g,u.g=null,g.abort(),g.dispose())}function qi(u,g){try{var b=u.j;if(b.I!=0&&(b.g==u||Gi(b.h,u))){if(!u.L&&Gi(b.h,u)&&b.I==3){try{var x=b.Ba.g.parse(g)}catch{x=null}if(Array.isArray(x)&&x.length==3){var L=x;if(L[0]==0){e:if(!b.v){if(b.g)if(b.g.F+3e3<u.F)Oa(b),Qr(b);else break e;Fs(b),xt(18)}}else b.xa=L[1],0<b.xa-b.K&&L[2]<37500&&b.F&&b.A==0&&!b.C&&(b.C=Re(p(b.Va,b),6e3));Fi(b.h)<=1&&b.ta&&(b.ta=void 0)}else Ji(b,11)}else if((u.L||b.g==u)&&Oa(b),!C(g))for(L=b.Ba.g.parse(g),g=0;g<L.length;g++){let ct=L[g];const Dt=ct[0];if(!(Dt<=b.K))if(b.K=Dt,ct=ct[1],b.I==2)if(ct[0]=="c"){b.M=ct[1],b.ba=ct[2];const fi=ct[3];fi!=null&&(b.ka=fi,b.j.info("VER="+b.ka));const Zi=ct[4];Zi!=null&&(b.za=Zi,b.j.info("SVER="+b.za));const Ri=ct[5];Ri!=null&&typeof Ri=="number"&&Ri>0&&(x=1.5*Ri,b.O=x,b.j.info("backChannelRequestTimeoutMs_="+x)),x=b;const Ci=u.g;if(Ci){const Gs=Ci.g?Ci.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(Gs){var q=x.h;q.g||Gs.indexOf("spdy")==-1&&Gs.indexOf("quic")==-1&&Gs.indexOf("h2")==-1||(q.j=q.l,q.g=new Set,q.h&&(Bl(q,q.h),q.h=null))}if(x.G){const ja=Ci.g?Ci.g.getResponseHeader("X-HTTP-Session-Id"):null;ja&&(x.wa=ja,gt(x.J,x.G,ja))}}b.I=3,b.l&&b.l.ra(),b.aa&&(b.T=Date.now()-u.F,b.j.info("Handshake RTT: "+b.T+"ms")),x=b;var ae=u;if(x.na=Mu(x,x.L?x.ba:null,x.W),ae.L){Hl(x.h,ae);var Le=ae,zt=x.O;zt&&(Le.H=zt),Le.D&&(Hi(Le),Bi(Le)),x.g=ae}else Nu(x);b.i.length>0&&Xi(b)}else ct[0]!="stop"&&ct[0]!="close"||Ji(b,7);else b.I==3&&(ct[0]=="stop"||ct[0]=="close"?ct[0]=="stop"?Ji(b,7):Jl(b):ct[0]!="noop"&&b.l&&b.l.qa(ct),b.A=0)}}Gt(4)}catch{}}var Kt=class{constructor(u,g){this.g=u,this.map=g}};function Pl(u){this.l=u||10,f.PerformanceNavigationTiming?(u=f.performance.getEntriesByType("navigation"),u=u.length>0&&(u[0].nextHopProtocol=="hq"||u[0].nextHopProtocol=="h2")):u=!!(f.chrome&&f.chrome.loadTimes&&f.chrome.loadTimes()&&f.chrome.loadTimes().wasFetchedViaSpdy),this.j=u?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function zl(u){return u.h?!0:u.g?u.g.size>=u.j:!1}function Fi(u){return u.h?1:u.g?u.g.size:0}function Gi(u,g){return u.h?u.h==g:u.g?u.g.has(g):!1}function Bl(u,g){u.g?u.g.add(g):u.h=g}function Hl(u,g){u.h&&u.h==g?u.h=null:u.g&&u.g.has(g)&&u.g.delete(g)}Pl.prototype.cancel=function(){if(this.i=ql(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const u of this.g.values())u.cancel();this.g.clear()}};function ql(u){if(u.h!=null)return u.i.concat(u.h.G);if(u.g!=null&&u.g.size!==0){let g=u.i;for(const b of u.g.values())g=g.concat(b.G);return g}return z(u.i)}var Tu=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function wa(u,g){if(u){u=u.split("&");for(let b=0;b<u.length;b++){const x=u[b].indexOf("=");let L,q=null;x>=0?(L=u[b].substring(0,x),q=u[b].substring(x+1)):L=u[b],g(L,q?decodeURIComponent(q.replace(/\+/g," ")):"")}}}function ei(u){this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1;let g;u instanceof ei?(this.l=u.l,ln(this,u.j),this.o=u.o,this.g=u.g,zr(this,u.u),this.h=u.h,Fl(this,Su(u.i)),this.m=u.m):u&&(g=String(u).match(Tu))?(this.l=!1,ln(this,g[1]||"",!0),this.o=Ki(g[2]||""),this.g=Ki(g[3]||"",!0),zr(this,g[4]),this.h=Ki(g[5]||"",!0),Fl(this,g[6]||"",!0),this.m=Ki(g[7]||"")):(this.l=!1,this.i=new Hr(null,this.l))}ei.prototype.toString=function(){const u=[];var g=this.j;g&&u.push(Us(g,Na,!0),":");var b=this.g;
1462return(b||g=="file")&&(u.push("//"),(g=this.o)&&u.push(Us(g,Na,!0),"@"),u.push(wn(b).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),b=this.u,b!=null&&u.push(":",String(b))),(b=this.h)&&(this.g&&b.charAt(0)!="/"&&u.push("/"),u.push(Us(b,b.charAt(0)=="/"?Gl:Eu,!0))),(b=this.i.toString())&&u.push("?",b),(b=this.m)&&u.push("#",Us(b,xu)),u.join("")},ei.prototype.resolve=function(u){const g=Qt(this);let b=!!u.j;b?ln(g,u.j):b=!!u.o,b?g.o=u.o:b=!!u.g,b?g.g=u.g:b=u.u!=null;var x=u.h;if(b)zr(g,u.u);else if(b=!!u.h){if(x.charAt(0)!="/")if(this.g&&!this.h)x="/"+x;else{var L=g.h.lastIndexOf("/");L!=-1&&(x=g.h.slice(0,L+1)+x)}if(L=x,L==".."||L==".")x="";else if(L.indexOf("./")!=-1||L.indexOf("/.")!=-1){x=L.lastIndexOf("/",0)==0,L=L.split("/");const q=[];for(let ae=0;ae<L.length;){const Le=L[ae++];Le=="."?x&&ae==L.length&&q.push(""):Le==".."?((q.length>1||q.length==1&&q[0]!="")&&q.pop(),x&&ae==L.length&&q.push("")):(q.push(Le),x=!0)}x=q.join("/")}else x=L}return b?g.h=x:b=u.i.toString()!=="",b?Fl(g,Su(u.i)):b=!!u.m,b&&(g.m=u.m),g};function Qt(u){return new ei(u)}function ln(u,g,b){u.j=b?Ki(g,!0):g,u.j&&(u.j=u.j.replace(/:$/,""))}function zr(u,g){if(g){if(g=Number(g),isNaN(g)||g<0)throw Error("Bad port number "+g);u.u=g}else u.u=null}function Fl(u,g,b){g instanceof Hr?(u.i=g,Ra(u.i,u.l)):(b||(g=Us(g,Br)),u.i=new Hr(g,u.l))}function gt(u,g,b){u.i.set(g,b)}function Ls(u){return gt(u,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^Date.now()).toString(36)),u}function Ki(u,g){return u?g?decodeURI(u.replace(/%25/g,"%2525")):decodeURIComponent(u):""}function Us(u,g,b){return typeof u=="string"?(u=encodeURI(u).replace(g,Bn),b&&(u=u.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),u):null}function Bn(u){return u=u.charCodeAt(0),"%"+(u>>4&15).toString(16)+(u&15).toString(16)}var Na=/[#\/\?@]/g,Eu=/[#\?:]/g,Gl=/[#\?]/g,Br=/[#\?@]/g,xu=/#/g;function Hr(u,g){this.h=this.g=null,this.i=u||null,this.j=!!g}function Hn(u){u.g||(u.g=new Map,u.h=0,u.i&&wa(u.i,function(g,b){u.add(decodeURIComponent(g.replace(/\+/g," ")),b)}))}r=Hr.prototype,r.add=function(u,g){Hn(this),this.i=null,u=qr(this,u);let b=this.g.get(u);return b||this.g.set(u,b=[]),b.push(g),this.h+=1,this};function Au(u,g){Hn(u),g=qr(u,g),u.g.has(g)&&(u.i=null,u.h-=u.g.get(g).length,u.g.delete(g))}function Kl(u,g){return Hn(u),g=qr(u,g),u.g.has(g)}r.forEach=function(u,g){Hn(this),this.g.forEach(function(b,x){b.forEach(function(L){u.call(g,L,x,this)},this)},this)};function Ql(u,g){Hn(u);let b=[];if(typeof g=="string")Kl(u,g)&&(b=b.concat(u.g.get(qr(u,g))));else for(u=Array.from(u.g.values()),g=0;g<u.length;g++)b=b.concat(u[g]);return b}r.set=function(u,g){return Hn(this),this.i=null,u=qr(this,u),Kl(this,u)&&(this.h-=this.g.get(u).length),this.g.set(u,[g]),this.h+=1,this},r.get=function(u,g){return u?(u=Ql(this,u),u.length>0?String(u[0]):g):g};function Ia(u,g,b){Au(u,g),b.length>0&&(u.i=null,u.g.set(qr(u,g),z(b)),u.h+=b.length)}r.toString=function(){if(this.i)return this.i;if(!this.g)return"";const u=[],g=Array.from(this.g.keys());for(let x=0;x<g.length;x++){var b=g[x];const L=wn(b);b=Ql(this,b);for(let q=0;q<b.length;q++){let ae=L;b[q]!==""&&(ae+="="+wn(b[q])),u.push(ae)}}return this.i=u.join("&")};function Su(u){const g=new Hr;return g.i=u.i,u.g&&(g.g=new Map(u.g),g.h=u.h),g}function qr(u,g){return g=String(g),u.j&&(g=g.toLowerCase()),g}function Ra(u,g){g&&!u.j&&(Hn(u),u.i=null,u.g.forEach(function(b,x){const L=x.toLowerCase();x!=L&&(Au(this,x),Ia(this,L,b))},u)),u.j=g}function wi(u,g){const b=new st;if(f.Image){const x=new Image;x.onload=T(hi,b,"TestLoadImage: loaded",!0,g,x),x.onerror=T(hi,b,"TestLoadImage: error",!1,g,x),x.onabort=T(hi,b,"TestLoadImage: abort",!1,g,x),x.ontimeout=T(hi,b,"TestLoadImage: timeout",!1,g,x),f.setTimeout(function(){x.ontimeout&&x.ontimeout()},1e4),x.src=u}else g(!1)}function Yl(u,g){const b=new st,x=new AbortController,L=setTimeout(()=>{x.abort(),hi(b,"TestPingServer: timeout",!1,g)},1e4);fetch(u,{signal:x.signal}).then(q=>{clearTimeout(L),q.ok?hi(b,"TestPingServer: ok",!0,g):hi(b,"TestPingServer: server error",!1,g)}).catch(()=>{clearTimeout(L),hi(b,"TestPingServer: error",!1,g)})}
vendor: 6,855 bytes, lines 1462-1465
1462function hi(u,g,b,x,L){try{L&&(L.onload=null,L.onerror=null,L.onabort=null,L.ontimeout=null),x(b)}catch{}}function Fr(){this.g=new Vs}function Qi(u){this.i=u.Sb||null,this.h=u.ab||!1}A(Qi,ks),Qi.prototype.g=function(){return new Ps(this.i,this.h)};function Ps(u,g){oe.call(this),this.H=u,this.o=g,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}A(Ps,oe),r=Ps.prototype,r.open=function(u,g){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.F=u,this.D=g,this.readyState=1,Ni(this)},r.send=function(u){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const g={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};u&&(g.body=u),(this.H||f).fetch(new Request(this.D,g)).then(this.Pa.bind(this),this.ga.bind(this))},r.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&this.readyState!=4&&(this.g=!1,Gr(this)),this.readyState=0},r.Pa=function(u){if(this.g&&(this.l=u,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=u.headers,this.readyState=2,Ni(this)),this.g&&(this.readyState=3,Ni(this),this.g)))if(this.responseType==="arraybuffer")u.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(typeof f.ReadableStream<"u"&&"body"in u){if(this.j=u.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.B=new TextDecoder;Ca(this)}else u.text().then(this.Oa.bind(this),this.ga.bind(this))};function Ca(u){u.j.read().then(u.Ma.bind(u)).catch(u.ga.bind(u))}r.Ma=function(u){if(this.g){if(this.o&&u.value)this.response.push(u.value);else if(!this.o){var g=u.value?u.value:new Uint8Array(0);(g=this.B.decode(g,{stream:!u.done}))&&(this.response=this.responseText+=g)}u.done?Gr(this):Ni(this),this.readyState==3&&Ca(this)}},r.Oa=function(u){this.g&&(this.response=this.responseText=u,Gr(this))},r.Na=function(u){this.g&&(this.response=u,Gr(this))},r.ga=function(){this.g&&Gr(this)};function Gr(u){u.readyState=4,u.l=null,u.j=null,u.B=null,Ni(u)}r.setRequestHeader=function(u,g){this.A.append(u,g)},r.getResponseHeader=function(u){return this.h&&this.h.get(u.toLowerCase())||""},r.getAllResponseHeaders=function(){if(!this.h)return"";const u=[],g=this.h.entries();for(var b=g.next();!b.done;)b=b.value,u.push(b[0]+": "+b[1]),b=g.next();return u.join(`\r
1463`)};function Ni(u){u.onreadystatechange&&u.onreadystatechange.call(u)}Object.defineProperty(Ps.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(u){this.m=u?"include":"same-origin"}});function di(u){let g="";return Be(u,function(b,x){g+=x,g+=":",g+=b,g+=`\r
1464`}),g}function zs(u,g,b){e:{for(x in b){var x=!1;break e}x=!0}x||(b=di(b),typeof u=="string"?b!=null&&wn(b):gt(u,g,b))}function _t(u){oe.call(this),this.headers=new Map,this.L=u||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}A(_t,oe);var Yi=/^https?$/i,$l=["POST","PUT"];r=_t.prototype,r.Fa=function(u){this.H=u},r.ea=function(u,g,b,x){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+u);g=g?g.toUpperCase():"GET",this.D=u,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():vt.g(),this.g.onreadystatechange=S(p(this.Ca,this));try{this.B=!0,this.g.open(g,String(u),!0),this.B=!1}catch(q){Bs(this,q);return}if(u=b||"",b=new Map(this.headers),x)if(Object.getPrototypeOf(x)===Object.prototype)for(var L in x)b.set(L,x[L]);else if(typeof x.keys=="function"&&typeof x.get=="function")for(const q of x.keys())b.set(q,x.get(q));else throw Error("Unknown input type for opt_headers: "+String(x));x=Array.from(b.keys()).find(q=>q.toLowerCase()=="content-type"),L=f.FormData&&u instanceof f.FormData,!(Array.prototype.indexOf.call($l,g,void 0)>=0)||x||L||b.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[q,ae]of b)this.g.setRequestHeader(q,ae);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(u),this.v=!1}catch(q){Bs(this,q)}};function Bs(u,g){u.h=!1,u.g&&(u.j=!0,u.g.abort(),u.j=!1),u.l=g,u.o=5,Xl(u),cr(u)}function Xl(u){u.A||(u.A=!0,ue(u,"complete"),ue(u,"error"))}r.abort=function(u){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=u||7,ue(this,"complete"),ue(this,"abort"),cr(this))},r.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),cr(this,!0)),_t.Z.N.call(this)},r.Ca=function(){this.u||(this.B||this.v||this.j?Hs(this):this.Xa())},r.Xa=function(){Hs(this)};function Hs(u){if(u.h&&typeof c<"u"){if(u.v&&Ii(u)==4)setTimeout(u.Ca.bind(u),0);else if(ue(u,"readystatechange"),Ii(u)==4){u.h=!1;try{const q=u.ca();e:switch(q){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var g=!0;break e;default:g=!1}var b;if(!(b=g)){var x;if(x=q===0){let ae=String(u.D).match(Tu)[1]||null;!ae&&f.self&&f.self.location&&(ae=f.self.location.protocol.slice(0,-1)),x=!Yi.test(ae?ae.toLowerCase():"")}b=x}if(b)ue(u,"complete"),ue(u,"success");else{u.o=6;try{var L=Ii(u)>2?u.g.statusText:""}catch{L=""}u.l=L+" ["+u.ca()+"]",Xl(u)}}finally{cr(u)}}}}function cr(u,g){if(u.g){u.m&&(clearTimeout(u.m),u.m=null);const b=u.g;u.g=null,g||ue(u,"ready");try{b.onreadystatechange=null}catch{}}}r.isActive=function(){return!!this.g};function Ii(u){return u.g?u.g.readyState:0}r.ca=function(){try{return Ii(this)>2?this.g.status:-1}catch{return-1}},r.la=function(){try{return this.g?this.g.responseText:""}catch{return""}},r.La=function(u){if(this.g){var g=this.g.responseText;return u&&g.indexOf(u)==0&&(g=g.substring(u.length)),Ll(g)}};function gn(u){try{if(!u.g)return null;if("response"in u.g)return u.g.response;switch(u.F){case"":case"text":return u.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in u.g)return u.g.mozResponseArrayBuffer}return null}catch{return null}}function hr(u){const g={};u=(u.g&&Ii(u)>=2&&u.g.getAllResponseHeaders()||"").split(`\r
1465`);for(let x=0;x<u.length;x++){if(C(u[x]))continue;var b=an(u[x]);const L=b[0];if(b=b[1],typeof b!="string")continue;b=b.trim();const q=g[L]||[];g[L]=q,q.push(b)}Ke(g,function(x){return x.join(", ")})}r.ya=function(){return this.o},r.Ha=function(){return typeof this.l=="string"?this.l:String(this.l)};
vendor: 4,172 bytes, line 1465
1465function $i(u,g,b){return b&&b.internalChannelParams&&b.internalChannelParams[u]||g}function Kr(u){this.za=0,this.i=[],this.j=new st,this.ba=this.na=this.J=this.W=this.g=this.wa=this.G=this.H=this.u=this.U=this.o=null,this.Ya=this.V=0,this.Sa=$i("failFast",!1,u),this.F=this.C=this.v=this.m=this.l=null,this.X=!0,this.xa=this.K=-1,this.Y=this.A=this.D=0,this.Qa=$i("baseRetryDelayMs",5e3,u),this.Za=$i("retryDelaySeedMs",1e4,u),this.Ta=$i("forwardChannelMaxRetries",2,u),this.va=$i("forwardChannelRequestTimeoutMs",2e4,u),this.ma=u&&u.xmlHttpFactory||void 0,this.Ua=u&&u.Rb||void 0,this.Aa=u&&u.useFetchStreams||!1,this.O=void 0,this.L=u&&u.supportsCrossDomainXhr||!1,this.M="",this.h=new Pl(u&&u.concurrentRequestLimit),this.Ba=new Fr,this.S=u&&u.fastHandshake||!1,this.R=u&&u.encodeInitMessageHeaders||!1,this.S&&this.R&&(this.R=!1),this.Ra=u&&u.Pb||!1,u&&u.ua&&this.j.ua(),u&&u.forceLongPolling&&(this.X=!1),this.aa=!this.S&&this.X&&u&&u.detectBufferingProxy||!1,this.ia=void 0,u&&u.longPollingTimeout&&u.longPollingTimeout>0&&(this.ia=u.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}r=Kr.prototype,r.ka=8,r.I=1,r.connect=function(u,g,b,x){xt(0),this.W=u,this.H=g||{},b&&x!==void 0&&(this.H.OSID=b,this.H.OAID=x),this.F=this.X,this.J=Mu(this,null,this.W),Xi(this)};function Jl(u){if(Da(u),u.I==3){var g=u.V++,b=Qt(u.J);if(gt(b,"SID",u.M),gt(b,"RID",g),gt(b,"TYPE","terminate"),qs(u,b),g=new jn(u,u.j,g),g.M=2,g.A=Ls(Qt(b)),b=!1,f.navigator&&f.navigator.sendBeacon)try{b=f.navigator.sendBeacon(g.A.toString(),"")}catch{}!b&&f.Image&&(new Image().src=g.A,b=!0),b||(g.g=Ou(g.j,null),g.g.ea(g.A)),g.F=Date.now(),Bi(g)}Du(u)}function Qr(u){u.g&&(Wl(u),u.g.cancel(),u.g=null)}function Da(u){Qr(u),u.v&&(f.clearTimeout(u.v),u.v=null),Oa(u),u.h.cancel(),u.m&&(typeof u.m=="number"&&f.clearTimeout(u.m),u.m=null)}function Xi(u){if(!zl(u.h)&&!u.m){u.m=!0;var g=u.Ea;ze||w(),Ve||(ze(),Ve=!0),I.add(g,u),u.D=0}}function Ma(u,g){return Fi(u.h)>=u.h.j-(u.m?1:0)?!1:u.m?(u.i=g.G.concat(u.i),!0):u.I==1||u.I==2||u.D>=(u.Sa?0:u.Ta)?!1:(u.m=Re(p(u.Ea,u,g),Cu(u,u.D)),u.D++,!0)}r.Ea=function(u){if(this.m)if(this.m=null,this.I==1){if(!u){this.V=Math.floor(Math.random()*1e5),u=this.V++;const L=new jn(this,this.j,u);let q=this.o;if(this.U&&(q?(q=M(q),ne(q,this.U)):q=this.U),this.u!==null||this.R||(L.J=q,q=null),this.S)e:{for(var g=0,b=0;b<this.i.length;b++){t:{var x=this.i[b];if("__data__"in x.map&&(x=x.map.__data__,typeof x=="string")){x=x.length;break t}x=void 0}if(x===void 0)break;if(g+=x,g>4096){g=b;break e}if(g===4096||b===this.i.length-1){g=b+1;break e}}g=1e3}else g=1e3;g=wu(this,L,g),b=Qt(this.J),gt(b,"RID",u),gt(b,"CVER",22),this.G&&gt(b,"X-HTTP-Session-Id",this.G),qs(this,b),q&&(this.R?g="headers="+wn(di(q))+"&"+g:this.u&&zs(b,this.u,q)),Bl(this.h,L),this.Ra&&gt(b,"TYPE","init"),this.S?(gt(b,"$req",g),gt(b,"SID","null"),L.U=!0,Vn(L,b,null)):Vn(L,b,g),this.I=2}}else this.I==3&&(u?Zl(this,u):this.i.length==0||zl(this.h)||Zl(this))};function Zl(u,g){var b;g?b=g.l:b=u.V++;const x=Qt(u.J);gt(x,"SID",u.M),gt(x,"RID",b),gt(x,"AID",u.K),qs(u,x),u.u&&u.o&&zs(x,u.u,u.o),b=new jn(u,u.j,b,u.D+1),u.u===null&&(b.J=u.o),g&&(u.i=g.G.concat(u.i)),g=wu(u,b,1e3),b.H=Math.round(u.va*.5)+Math.round(u.va*.5*Math.random()),Bl(u.h,b),Vn(b,x,g)}function qs(u,g){u.H&&Be(u.H,function(b,x){gt(g,x,b)}),u.l&&Be({},function(b,x){gt(g,x,b)})}function wu(u,g,b){b=Math.min(u.i.length,b);const x=u.l?p(u.l.Ka,u.l,u):null;e:{var L=u.i;let Le=-1;for(;;){const zt=["count="+b];Le==-1?b>0?(Le=L[0].g,zt.push("ofs="+Le)):Le=0:zt.push("ofs="+Le);let ct=!0;for(let Dt=0;Dt<b;Dt++){var q=L[Dt].g;const fi=L[Dt].map;if(q-=Le,q<0)Le=Math.max(0,L[Dt].g-100),ct=!1;else try{q="req"+q+"_"||"";try{var ae=fi instanceof Map?fi:Object.entries(fi);for(const[Zi,Ri]of ae){let Ci=Ri;y(Ri)&&(Ci=Jn(Ri)),zt.push(q+Zi+"="+encodeURIComponent(Ci))}}catch(Zi){throw zt.push(q+"type="+encodeURIComponent("_badmap")),Zi}}catch{x&&x(fi)}}if(ct){ae=zt.join("&");break e}}ae=void 0}return u=u.i.splice(0,b),g.G=u,ae}function Nu(u){if(!u.g&&!u.v){u.Y=1;var g=u.Da;ze||w(),Ve||(ze(),Ve=!0),I.add(g,u),u.A=0}}function Fs(u){return u.g||u.v||u.A>=3?!1:(u.Y++,u.v=Re(p(u.Da,u),Cu(u,u.A)),u.A++,!0)}
vendor: 5,497 bytes, lines 1465-1469
1465r.Da=function(){if(this.v=null,Iu(this),this.aa&&!(this.P||this.g==null||this.T<=0)){var u=4*this.T;this.j.info("BP detection timer enabled: "+u),this.B=Re(p(this.Wa,this),u)}},r.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,xt(10),Qr(this),Iu(this))};function Wl(u){u.B!=null&&(f.clearTimeout(u.B),u.B=null)}function Iu(u){u.g=new jn(u,u.j,"rpc",u.Y),u.u===null&&(u.g.J=u.o),u.g.P=0;var g=Qt(u.na);gt(g,"RID","rpc"),gt(g,"SID",u.M),gt(g,"AID",u.K),gt(g,"CI",u.F?"0":"1"),!u.F&&u.ia&&gt(g,"TO",u.ia),gt(g,"TYPE","xmlhttp"),qs(u,g),u.u&&u.o&&zs(g,u.u,u.o),u.O&&(u.g.H=u.O);var b=u.g;u=u.ba,b.M=1,b.A=Ls(Qt(g)),b.u=null,b.R=!0,Pr(b,u)}r.Va=function(){this.C!=null&&(this.C=null,Qr(this),Fs(this),xt(19))};function Oa(u){u.C!=null&&(f.clearTimeout(u.C),u.C=null)}function Ru(u,g){var b=null;if(u.g==g){Oa(u),Wl(u),u.g=null;var x=2}else if(Gi(u.h,g))b=g.G,Hl(u.h,g),x=1;else return;if(u.I!=0){if(g.o)if(x==1){b=g.u?g.u.length:0,g=Date.now()-g.F;var L=u.D;x=rt(),ue(x,new xn(x,b)),Xi(u)}else Nu(u);else if(L=g.m,L==3||L==0&&g.X>0||!(x==1&&Ma(u,g)||x==2&&Fs(u)))switch(b&&b.length>0&&(g=u.h,g.i=g.i.concat(b)),L){case 1:Ji(u,5);break;case 4:Ji(u,10);break;case 3:Ji(u,6);break;default:Ji(u,2)}}}function Cu(u,g){let b=u.Qa+Math.floor(Math.random()*u.Za);return u.isActive()||(b*=2),b*g}function Ji(u,g){if(u.j.info("Error code "+g),g==2){var b=p(u.bb,u),x=u.Ua;const L=!x;x=new ei(x||"//www.google.com/images/cleardot.gif"),f.location&&f.location.protocol=="http"||ln(x,"https"),Ls(x),L?wi(x.toString(),b):Yl(x.toString(),b)}else xt(2);u.I=0,u.l&&u.l.pa(g),Du(u),Da(u)}r.bb=function(u){u?(this.j.info("Successfully pinged google.com"),xt(2)):(this.j.info("Failed to ping google.com"),xt(1))};function Du(u){if(u.I=0,u.ja=[],u.l){const g=ql(u.h);(g.length!=0||u.i.length!=0)&&(Q(u.ja,g),Q(u.ja,u.i),u.h.i.length=0,z(u.i),u.i.length=0),u.l.oa()}}function Mu(u,g,b){var x=b instanceof ei?Qt(b):new ei(b);if(x.g!="")g&&(x.g=g+"."+x.g),zr(x,x.u);else{var L=f.location;x=L.protocol,g=g?g+"."+L.hostname:L.hostname,L=+L.port;const q=new ei(null);x&&ln(q,x),g&&(q.g=g),L&&zr(q,L),b&&(q.h=b),x=q}return b=u.G,g=u.wa,b&&g&&gt(x,b,g),gt(x,"VER",u.ka),qs(u,x),x}function Ou(u,g,b){if(g&&!u.L)throw Error("Can't create secondary domain capable XhrIo object.");return g=u.Aa&&!u.ma?new _t(new Qi({ab:b})):new _t(u.ma),g.Fa(u.L),g}r.isActive=function(){return!!this.l&&this.l.isActive(this)};function ju(){}r=ju.prototype,r.ra=function(){},r.qa=function(){},r.pa=function(){},r.oa=function(){},r.isActive=function(){return!0},r.Ka=function(){};function Yr(){}Yr.prototype.g=function(u,g){return new kn(u,g)};function kn(u,g){oe.call(this),this.g=new Kr(g),this.l=u,this.h=g&&g.messageUrlParams||null,u=g&&g.messageHeaders||null,g&&g.clientProtocolHeaderRequired&&(u?u["X-Client-Protocol"]="webchannel":u={"X-Client-Protocol":"webchannel"}),this.g.o=u,u=g&&g.initMessageHeaders||null,g&&g.messageContentType&&(u?u["X-WebChannel-Content-Type"]=g.messageContentType:u={"X-WebChannel-Content-Type":g.messageContentType}),g&&g.sa&&(u?u["X-WebChannel-Client-Profile"]=g.sa:u={"X-WebChannel-Client-Profile":g.sa}),this.g.U=u,(u=g&&g.Qb)&&!C(u)&&(this.g.u=u),this.A=g&&g.supportsCrossDomainXhr||!1,this.v=g&&g.sendRawJson||!1,(g=g&&g.httpSessionIdParam)&&!C(g)&&(this.g.G=g,u=this.h,u!==null&&g in u&&(u=this.h,g in u&&delete u[g])),this.j=new dr(this)}A(kn,oe),kn.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},kn.prototype.close=function(){Jl(this.g)},kn.prototype.o=function(u){var g=this.g;if(typeof u=="string"){var b={};b.__data__=u,u=b}else this.v&&(b={},b.__data__=Jn(u),u=b);g.i.push(new Kt(g.Ya++,u)),g.I==3&&Xi(g)},kn.prototype.N=function(){this.g.l=null,delete this.j,Jl(this.g),delete this.g,kn.Z.N.call(this)};function Vu(u){Vt.call(this),u.__headers__&&(this.headers=u.__headers__,this.statusCode=u.__status__,delete u.__headers__,delete u.__status__);var g=u.__sm__;if(g){e:{for(const b in g){u=b;break e}u=void 0}(this.i=u)&&(u=this.i,g=g!==null&&u in g?g[u]:void 0),this.data=g}else this.data=u}A(Vu,Vt);function ku(){Mn.call(this),this.status=1}A(ku,Mn);function dr(u){this.g=u}A(dr,ju),dr.prototype.ra=function(){ue(this.g,"a")},dr.prototype.qa=function(u){ue(this.g,new Vu(u))},dr.prototype.pa=function(u){ue(this.g,new ku)},dr.prototype.oa=function(){ue(this.g,"b")},Yr.prototype.createWebChannel=Yr.prototype.g,kn.prototype.send=kn.prototype.o,kn.prototype.open=kn.prototype.m,kn.prototype.close=kn.prototype.close,Ub=function(){return new Yr},Lb=function(){return rt()},kb=te,_m={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},Sn.NO_ERROR=0,Sn.TIMEOUT=8,Sn.HTTP_ERROR=6,Jc=Sn,On.COMPLETE="complete",Vb=On,Aa.EventType=Zn,Zn.OPEN="a",Zn.CLOSE="b",Zn.ERROR="c",Zn.MESSAGE="d",oe.prototype.listen=oe.prototype.J,zo=Aa,_t.prototype.listenOnce=_t.prototype.K,_t.prototype.getLastError=_t.prototype.Ha,_t.prototype.getLastErrorCode=_t.prototype.ya,_t.prototype.getStatus=_t.prototype.ca,_t.prototype.getResponseJson=_t.prototype.La,_t.prototype.getResponseText=_t.prototype.la,_t.prototype.send=_t.prototype.ea,_t.prototype.setWithCredentials=_t.prototype.Fa,jb=_t}).apply(typeof Bc<"u"?Bc:typeof self<"u"?self:typeof window<"u"?window:{});/**
1466 * @license
1467 * Copyright 2017 Google LLC
1468 *
1469 * Licensed under the Apache License, Version 2.0 (the "License");
1470 * you may not use this file except in compliance with the License.
1471 * You may obtain a copy of the License at
1472 *
1473 *   http://www.apache.org/licenses/LICENSE-2.0
1474 *
1475 * Unless required by applicable law or agreed to in writing, software
1476 * distributed under the License is distributed on an "AS IS" BASIS,
1477 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1478 * See the License for the specific language governing permissions and
1479 * limitations under the License.
1480 */class Rn{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}}Rn.UNAUTHENTICATED=new Rn(null),Rn.GOOGLE_CREDENTIALS=new Rn("google-credentials-uid"),Rn.FIRST_PARTY=new Rn("first-party-uid"),Rn.MOCK_USER=new Rn("mock-user");/**
1481 * @license
1482 * Copyright 2017 Google LLC
1483 *
1484 * Licensed under the Apache License, Version 2.0 (the "License");
1485 * you may not use this file except in compliance with the License.
1486 * You may obtain a copy of the License at
1487 *
1488 *   http://www.apache.org/licenses/LICENSE-2.0
1489 *
1490 * Unless required by applicable law or agreed to in writing, software
1491 * distributed under the License is distributed on an "AS IS" BASIS,
1492 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1493 * See the License for the specific language governing permissions and
1494 * limitations under the License.
1495 */let Ml="12.9.0";function Gw(r){Ml=r}/**
1496 * @license
1497 * Copyright 2020 Google LLC
1498 *
1499 * Licensed under the Apache License, Version 2.0 (the "License");
1500 * you may not use this file except in compliance with the License.
1501 * You may obtain a copy of the License at
1502 *
1503 *   http://www.apache.org/licenses/LICENSE-2.0
1504 *
1505 * Unless required by applicable law or agreed to in writing, software
1506 * distributed under the License is distributed on an "AS IS" BASIS,
1507 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1508 * See the License for the specific language governing permissions and
1509 * limitations under the License.
1510 *//**
1511 * @license
1512 * Copyright 2017 Google LLC
1513 *
1514 * Licensed under the Apache License, Version 2.0 (the "License");
1515 * you may not use this file except in compliance with the License.
1516 * You may obtain a copy of the License at
1517 *
1518 *   http://www.apache.org/licenses/LICENSE-2.0
1519 *
1520 * Unless required by applicable law or agreed to in writing, software
1521 * distributed under the License is distributed on an "AS IS" BASIS,
1522 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1523 * See the License for the specific language governing permissions and
1524 * limitations under the License.
1525 */const pa=new Um("@firebase/firestore");function hl(){return pa.logLevel}function de(r,...e){if(pa.logLevel<=Je.DEBUG){const i=e.map(Jm);pa.debug(`Firestore (${Ml}): ${r}`,...i)}}function jr(r,...e){if(pa.logLevel<=Je.ERROR){const i=e.map(Jm);pa.error(`Firestore (${Ml}): ${r}`,...i)}}function ya(r,...e){if(pa.logLevel<=Je.WARN){const i=e.map(Jm);pa.warn(`Firestore (${Ml}): ${r}`,...i)}}function Jm(r){if(typeof r=="string")return r;try{return(function(i){return JSON.stringify(i)})(r)}catch{return r}}/**
1526 * @license
1527 * Copyright 2017 Google LLC
1528 *
1529 * Licensed under the Apache License, Version 2.0 (the "License");
1530 * you may not use this file except in compliance with the License.
1531 * You may obtain a copy of the License at
1532 *
1533 *   http://www.apache.org/licenses/LICENSE-2.0
1534 *
1535 * Unless required by applicable law or agreed to in writing, software
1536 * distributed under the License is distributed on an "AS IS" BASIS,
1537 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1538 * See the License for the specific language governing permissions and
1539 * limitations under the License.
1540 */function Ce(r,e,i){let s="Unexpected state";typeof e=="string"?s=e:i=e,Pb(r,s,i)}function Pb(r,e,i){let s=`FIRESTORE (${Ml}) INTERNAL ASSERTION FAILED: ${e} (ID: ${r.toString(16)})`;if(i!==void 0)try{s+=" CONTEXT: "+JSON.stringify(i)}catch{s+=" CONTEXT: "+i}throw jr(s),new Error(s)}function ft(r,e,i,s){let o="Unexpected state";
vendor: 5,858 bytes, lines 1540-1585
1540typeof i=="string"?o=i:s=i,r||Pb(e,o,s)}function je(r,e){return r}/**
1541 * @license
1542 * Copyright 2017 Google LLC
1543 *
1544 * Licensed under the Apache License, Version 2.0 (the "License");
1545 * you may not use this file except in compliance with the License.
1546 * You may obtain a copy of the License at
1547 *
1548 *   http://www.apache.org/licenses/LICENSE-2.0
1549 *
1550 * Unless required by applicable law or agreed to in writing, software
1551 * distributed under the License is distributed on an "AS IS" BASIS,
1552 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1553 * See the License for the specific language governing permissions and
1554 * limitations under the License.
1555 */const Z={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 ce extends Ur{constructor(e,i){super(e,i),this.code=e,this.message=i,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/**
1556 * @license
1557 * Copyright 2017 Google LLC
1558 *
1559 * Licensed under the Apache License, Version 2.0 (the "License");
1560 * you may not use this file except in compliance with the License.
1561 * You may obtain a copy of the License at
1562 *
1563 *   http://www.apache.org/licenses/LICENSE-2.0
1564 *
1565 * Unless required by applicable law or agreed to in writing, software
1566 * distributed under the License is distributed on an "AS IS" BASIS,
1567 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1568 * See the License for the specific language governing permissions and
1569 * limitations under the License.
1570 */class Dr{constructor(){this.promise=new Promise(((e,i)=>{this.resolve=e,this.reject=i}))}}/**
1571 * @license
1572 * Copyright 2017 Google LLC
1573 *
1574 * Licensed under the Apache License, Version 2.0 (the "License");
1575 * you may not use this file except in compliance with the License.
1576 * You may obtain a copy of the License at
1577 *
1578 *   http://www.apache.org/licenses/LICENSE-2.0
1579 *
1580 * Unless required by applicable law or agreed to in writing, software
1581 * distributed under the License is distributed on an "AS IS" BASIS,
1582 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1583 * See the License for the specific language governing permissions and
1584 * limitations under the License.
1585 */class zb{constructor(e,i){this.user=i,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class Kw{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,i){e.enqueueRetryable((()=>i(Rn.UNAUTHENTICATED)))}shutdown(){}}class Qw{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,i){this.changeListener=i,e.enqueueRetryable((()=>i(this.token.user)))}shutdown(){this.changeListener=null}}class Yw{constructor(e){this.t=e,this.currentUser=Rn.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,i){ft(this.o===void 0,42304);let s=this.i;const o=_=>this.i!==s?(s=this.i,i(_)):Promise.resolve();let c=new Dr;this.o=()=>{this.i++,this.currentUser=this.u(),c.resolve(),c=new Dr,e.enqueueRetryable((()=>o(this.currentUser)))};const f=()=>{const _=c;e.enqueueRetryable((async()=>{await _.promise,await o(this.currentUser)}))},y=_=>{de("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=_,this.o&&(this.auth.addAuthTokenListener(this.o),f())};this.t.onInit((_=>y(_))),setTimeout((()=>{if(!this.auth){const _=this.t.getImmediate({optional:!0});_?y(_):(de("FirebaseAuthCredentialsProvider","Auth not yet detected"),c.resolve(),c=new Dr)}}),0),f()}getToken(){const e=this.i,i=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(i).then((s=>this.i!==e?(de("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):s?(ft(typeof s.accessToken=="string",31837,{l:s}),new zb(s.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 ft(e===null||typeof e=="string",2055,{h:e}),new Rn(e)}}class $w{constructor(e,i,s){this.P=e,this.T=i,this.I=s,this.type="FirstParty",this.user=Rn.FIRST_PARTY,this.R=new Map}A(){return this.I?this.I():null}get headers(){this.R.set("X-Goog-AuthUser",this.P);const e=this.A();return e&&this.R.set("Authorization",e),this.T&&this.R.set("X-Goog-Iam-Authorization-Token",this.T),this.R}}class Xw{constructor(e,i,s){this.P=e,this.T=i,this.I=s}getToken(){return Promise.resolve(new $w(this.P,this.T,this.I))}start(e,i){e.enqueueRetryable((()=>i(Rn.FIRST_PARTY)))}shutdown(){}invalidateToken(){}}class zv{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 Jw{constructor(e,i){this.V=i,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,Vi(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,i){ft(this.o===void 0,3512);const s=c=>{c.error!=null&&de("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${c.error.message}`);const f=c.token!==this.m;return this.m=c.token,de("FirebaseAppCheckTokenProvider",`Received ${f?"new":"existing"} token.`),f?i(c.token):Promise.resolve()};this.o=c=>{e.enqueueRetryable((()=>s(c)))};const o=c=>{de("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=c,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit((c=>o(c))),setTimeout((()=>
1585{if(!this.appCheck){const c=this.V.getImmediate({optional:!0});c?o(c):de("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}}),0)}getToken(){if(this.p)return Promise.resolve(new zv(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then((i=>i?(ft(typeof i.token=="string",44558,{tokenResult:i}),this.m=i.token,new zv(i.token)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}/**
1586 * @license
1587 * Copyright 2020 Google LLC
1588 *
1589 * Licensed under the Apache License, Version 2.0 (the "License");
1590 * you may not use this file except in compliance with the License.
1591 * You may obtain a copy of the License at
1592 *
1593 *   http://www.apache.org/licenses/LICENSE-2.0
1594 *
1595 * Unless required by applicable law or agreed to in writing, software
1596 * distributed under the License is distributed on an "AS IS" BASIS,
1597 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1598 * See the License for the specific language governing permissions and
1599 * limitations under the License.
1600 */function Zw(r){const e=typeof self<"u"&&(self.crypto||self.msCrypto),i=new Uint8Array(r);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(i);else for(let s=0;s<r;s++)i[s]=Math.floor(256*Math.random());return i}/**
1601 * @license
1602 * Copyright 2017 Google LLC
1603 *
1604 * Licensed under the Apache License, Version 2.0 (the "License");
1605 * you may not use this file except in compliance with the License.
1606 * You may obtain a copy of the License at
1607 *
1608 *   http://www.apache.org/licenses/LICENSE-2.0
1609 *
1610 * Unless required by applicable law or agreed to in writing, software
1611 * distributed under the License is distributed on an "AS IS" BASIS,
1612 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1613 * See the License for the specific language governing permissions and
1614 * limitations under the License.
1615 */class Zm{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=62*Math.floor(4.129032258064516);let s="";for(;s.length<20;){const o=Zw(40);for(let c=0;c<o.length;++c)s.length<20&&o[c]<i&&(s+=e.charAt(o[c]%62))}return s}}function Ze(r,e){return r<e?-1:r>e?1:0}function bm(r,e){const i=Math.min(r.length,e.length);for(let s=0;s<i;s++){const o=r.charAt(s),c=e.charAt(s);if(o!==c)return am(o)===am(c)?Ze(o,c):am(o)?1:-1}return Ze(r.length,e.length)}const Ww=55296,eN=57343;function am(r){const e=r.charCodeAt(0);return e>=Ww&&e<=eN}function El(r,e,i){return r.length===e.length&&r.every(((s,o)=>i(s,e[o])))}/**
1616 * @license
1617 * Copyright 2017 Google LLC
1618 *
1619 * Licensed under the Apache License, Version 2.0 (the "License");
1620 * you may not use this file except in compliance with the License.
1621 * You may obtain a copy of the License at
1622 *
1623 *   http://www.apache.org/licenses/LICENSE-2.0
1624 *
1625 * Unless required by applicable law or agreed to in writing, software
1626 * distributed under the License is distributed on an "AS IS" BASIS,
1627 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1628 * See the License for the specific language governing permissions and
1629 * limitations under the License.
1630 */const Bv="__name__";class ir{constructor(e,i,s){i===void 0?i=0:i>e.length&&Ce(637,{offset:i,range:e.length}),s===void 0?s=e.length-i:s>e.length-i&&Ce(1746,{length:s,range:e.length-i}),this.segments=e,this.offset=i,this.len=s}get length(){return this.len}isEqual(e){return ir.comparator(this,e)===0}child(e){const i=this.segments.slice(this.offset,this.limit());return e instanceof ir?e.forEach((s=>{i.push(s)})):i.push(e),this.construct(i)}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 i=0;i<this.length;i++)if(this.get(i)!==e.get(i))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let i=0;i<this.length;i++)if(this.get(i)!==e.get(i))return!1;return!0}forEach(e){for(let i=this.offset,s=this.limit();i<s;i++)e(this.segments[i])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,i){const s=Math.min(e.length,i.length);for(let o=0;o<s;o++){const c=ir.compareSegments(e.get(o),i.get(o));if(c!==0)return c}return Ze(e.length,i.length)}static compareSegments(e,i){const s=ir.isNumericId(e),o=ir.isNumericId(i);return s&&!o?-1:!s&&o?1:s&&o?ir.extractNumericId(e).compare(ir.extractNumericId(i)):bm(e,i)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return Ss.fromString(e.substring(4,e.length-2))}}class St extends ir{construct(e,i,s){return new St(e,i,s)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}
1630toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const i=[];for(const s of e){if(s.indexOf("//")>=0)throw new ce(Z.INVALID_ARGUMENT,`Invalid segment (${s}). Paths must not contain // in them.`);i.push(...s.split("/").filter((o=>o.length>0)))}return new St(i)}static emptyPath(){return new St([])}}const tN=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Tn extends ir{construct(e,i,s){return new Tn(e,i,s)}static isValidIdentifier(e){return tN.test(e)}canonicalString(){return this.toArray().map((e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Tn.isValidIdentifier(e)||(e="`"+e+"`"),e))).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===Bv}static keyField(){return new Tn([Bv])}static fromServerFormat(e){const i=[];let s="",o=0;const c=()=>{if(s.length===0)throw new ce(Z.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);i.push(s),s=""};let f=!1;for(;o<e.length;){const y=e[o];if(y==="\\"){if(o+1===e.length)throw new ce(Z.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const _=e[o+1];if(_!=="\\"&&_!=="."&&_!=="`")throw new ce(Z.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);s+=_,o+=2}else y==="`"?(f=!f,o++):y!=="."||f?(s+=y,o++):(c(),o++)}if(c(),f)throw new ce(Z.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new Tn(i)}static emptyPath(){return new Tn([])}}/**
1631 * @license
1632 * Copyright 2017 Google LLC
1633 *
1634 * Licensed under the Apache License, Version 2.0 (the "License");
1635 * you may not use this file except in compliance with the License.
1636 * You may obtain a copy of the License at
1637 *
1638 *   http://www.apache.org/licenses/LICENSE-2.0
1639 *
1640 * Unless required by applicable law or agreed to in writing, software
1641 * distributed under the License is distributed on an "AS IS" BASIS,
1642 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1643 * See the License for the specific language governing permissions and
1644 * limitations under the License.
1645 */class Ae{constructor(e){this.path=e}static fromPath(e){return new Ae(St.fromString(e))}static fromName(e){return new Ae(St.fromString(e).popFirst(5))}static empty(){return new Ae(St.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&&St.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,i){return St.comparator(e.path,i.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new Ae(new St(e.slice()))}}/**
1646 * @license
1647 * Copyright 2017 Google LLC
1648 *
1649 * Licensed under the Apache License, Version 2.0 (the "License");
1650 * you may not use this file except in compliance with the License.
1651 * You may obtain a copy of the License at
1652 *
1653 *   http://www.apache.org/licenses/LICENSE-2.0
1654 *
1655 * Unless required by applicable law or agreed to in writing, software
1656 * distributed under the License is distributed on an "AS IS" BASIS,
1657 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1658 * See the License for the specific language governing permissions and
1659 * limitations under the License.
1660 */function Bb(r,e,i){if(!i)throw new ce(Z.INVALID_ARGUMENT,`Function ${r}() cannot be called with an empty ${e}.`)}function nN(r,e,i,s){if(e===!0&&s===!0)throw new ce(Z.INVALID_ARGUMENT,`${r} and ${i} cannot be used together.`)}function Hv(r){if(!Ae.isDocumentKey(r))throw new ce(Z.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${r} has ${r.length}.`)}function qv(r){if(Ae.isDocumentKey(r))throw new ce(Z.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${r} has ${r.length}.`)}function Hb(r){return typeof r=="object"&&r!==null&&(Object.getPrototypeOf(r)===Object.prototype||Object.getPrototypeOf(r)===null)}function Rh(r){if(r===void 0)return"undefined";if(r===null)return"null";if(typeof r=="string")return r.length>20&&(r=`${r.substring(0,20)}...`),JSON.stringify(r);if(typeof r=="number"||typeof r=="boolean")return""+r;if(typeof r=="object"){if(r instanceof Array)return"an array";{const e=(function(s){return s.constructor?s.constructor.name:null})(r);return e?`a custom ${e} object`:"an object"}}return typeof r=="function"?"a function":Ce(12329,{type:typeof r})}function Xn(r,e){if("_delegate"in r&&(r=r._delegate),!(r instanceof e)){if(e.name===r.constructor.name)throw new ce(Z.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const i=Rh(r);throw new ce(Z.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${i}`)}}return r}/**
1661 * @license
1662 * Copyright 2025 Google LLC
1663 *
1664 * Licensed under the Apache License, Version 2.0 (the "License");
1665 * you may not use this file except in compliance with the License.
1666 * You may obtain a copy of the License at
1667 *
1668 *   http://www.apache.org/licenses/LICENSE-2.0
1669 *
1670 * Unless required by applicable law or agreed to in writing, software
1671 * distributed under the License is distributed on an "AS IS" BASIS,
1672 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1673 * See the License for the specific language governing permissions and
1674 * limitations under the License.
1675 */function en(r,e){const i={typeString:r};return e&&(i.value=e),i}function hu(r,e){if(!Hb(r))throw new ce(Z.INVALID_ARGUMENT,"JSON must be an object");let i;for(const s in e)if(e[s]){const o=e[s].typeString,c="value"in e[s]?{value:e[s].value}:void 0;if(!(s in r)){i=`JSON missing required field: '${s}'`;break}const f=r[s];if(o&&typeof f!==o){i=`JSON field '${s}' must be a ${o}.`;break}if(c!==void 0&&f!==c.value){i=`Expected '${s}' field to equal '${c.value}'`;break}}if(i)throw new ce(Z.INVALID_ARGUMENT,i);return!0}/**
1676 * @license
1677 * Copyright 2017 Google LLC
1678 *
1679 * Licensed under the Apache License, Version 2.0 (the "License");
1680 * you may not use this file except in compliance with the License.
1681 * You may obtain a copy of the License at
1682 *
1683 *   http://www.apache.org/licenses/LICENSE-2.0
1684 *
1685 * Unless required by applicable law or agreed to in writing, software
1686 * distributed under the License is distributed on an "AS IS" BASIS,
1687 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1688 * See the License for the specific language governing permissions and
1689 * limitations under the License.
1690 */const Fv=-62135596800,Gv=1e6;class dt{static now(){return dt.fromMillis(Date.now())}static fromDate(e){return dt.fromMillis(e.getTime())}static fromMillis(e){const i=Math.floor(e/1e3),s=Math.floor((e-1e3*i)*Gv);return new dt(i,s)}constructor(e,i){if(this.seconds=e,this.nanoseconds=i,i<0)throw new ce(Z.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+i);if(i>=1e9)throw new ce(Z.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+i);if(e<Fv)throw new ce(Z.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new ce(Z.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/Gv}_compareTo(e){return this.seconds===e.seconds?Ze(this.nanoseconds,e.nanoseconds):Ze(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:dt._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(hu(e,dt._jsonSchema))return new dt(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-Fv;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}dt._jsonSchemaVersion="firestore/timestamp/1.0",dt._jsonSchema={type:en("string",dt._jsonSchemaVersion),seconds:en("number"),nanoseconds:en("number")};/**
1691 * @license
1692 * Copyright 2017 Google LLC
1693 *
1694 * Licensed under the Apache License, Version 2.0 (the "License");
1695 * you may not use this file except in compliance with the License.
1696 * You may obtain a copy of the License at
1697 *
1698 *   http://www.apache.org/licenses/LICENSE-2.0
1699 *
1700 * Unless required by applicable law or agreed to in writing, software
1701 * distributed under the License is distributed on an "AS IS" BASIS,
1702 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1703 * See the License for the specific language governing permissions and
1704 * limitations under the License.
1705 */class Me{static fromTimestamp(e){return new Me(e)}static min(){return new Me(new dt(0,0))}static max(){return new Me(new dt(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}}/**
1706 * @license
1707 * Copyright 2021 Google LLC
1708 *
1709 * Licensed under the Apache License, Version 2.0 (the "License");
1710 * you may not use this file except in compliance with the License.
1711 * You may obtain a copy of the License at
1712 *
1713 *   http://www.apache.org/licenses/LICENSE-2.0
1714 *
1715 * Unless required by applicable law or agreed to in writing, software
1716 * distributed under the License is distributed on an "AS IS" BASIS,
1717 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1718 * See the License for the specific language governing permissions and
1719 * limitations under the License.
1720 */const Wo=-1;function iN(r,e){const i=r.toTimestamp().seconds,s=r.toTimestamp().nanoseconds+1,o=Me.fromTimestamp(s===1e9?new dt(i+1,0):new dt(i,s));return new Ns(o,Ae.empty(),e)}function rN(r){return new Ns(r.readTime,r.key,Wo)}class Ns{constructor(e,i,s){this.readTime=e,this.documentKey=i,this.largestBatchId=s}static min(){return new Ns(Me.min(),Ae.empty(),Wo)}static max(){return new Ns(Me.max(),Ae.empty(),Wo)}}function sN(r,e){let i=r.readTime.compareTo(e.readTime);return i!==0?i:(i=Ae.comparator(r.documentKey,e.documentKey),i!==0?i:Ze(r.largestBatchId,e.largestBatchId))}/**
1721 * @license
1722 * Copyright 2020 Google LLC
1723 *
1724 * Licensed under the Apache License, Version 2.0 (the "License");
1725 * you may not use this file except in compliance with the License.
1726 * You may obtain a copy of the License at
1727 *
1728 *   http://www.apache.org/licenses/LICENSE-2.0
1729 *
1730 * Unless required by applicable law or agreed to in writing, software
1731 * distributed under the License is distributed on an "AS IS" BASIS,
1732 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1733 * See the License for the specific language governing permissions and
1734 * limitations under the License.
1735 */const aN="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class lN{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach((e=>e()))}}/**
1736 * @license
1737 * Copyright 2017 Google LLC
1738 *
1739 * Licensed under the Apache License, Version 2.0 (the "License");
1740 * you may not use this file except in compliance with the License.
1741 * You may obtain a copy of the License at
1742 *
1743 *   http://www.apache.org/licenses/LICENSE-2.0
1744 *
1745 * Unless required by applicable law or agreed to in writing, software
1746 * distributed under the License is distributed on an "AS IS" BASIS,
1747 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1748 * See the License for the specific language governing permissions and
1749 * limitations under the License.
1750 */async function Ol(r){if(r.code!==Z.FAILED_PRECONDITION||r.message!==aN)throw r;de("LocalStore","Unexpectedly lost primary lease")}/**
1751 * @license
1752 * Copyright 2017 Google LLC
1753 *
1754 * Licensed under the Apache License, Version 2.0 (the "License");
1755 * you may not use this file except in compliance with the License.
1756 * You may obtain a copy of the License at
1757 *
1758 *   http://www.apache.org/licenses/LICENSE-2.0
1759 *
1760 * Unless required by applicable law or agreed to in writing, software
1761 * distributed under the License is distributed on an "AS IS" BASIS,
1762 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1763 * See the License for the specific language governing permissions and
1764 * limitations under the License.
1765 */class W{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e((i=>{this.isDone=!0,this.result=i,this.nextCallback&&this.nextCallback(i)}),(i=>{this.isDone=!0,this.error=i,this.catchCallback&&this.catchCallback(i)}))}catch(e){return this.next(void 0,e)}next(e,i){return this.callbackAttached&&Ce(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(i,this.error):this.wrapSuccess(e,this.result):new W(((s,o)=>{this.nextCallback=c=>{this.wrapSuccess(e,c).next(s,o)},this.catchCallback=c=>{this.wrapFailure(i,c).next(s,o)}}))}toPromise(){return new Promise(((e,i)=>{this.next(e,i)}))}wrapUserFunction(e){try{const i=e();return i instanceof W?i:W.resolve(i)}catch(i){return W.reject(i)}}wrapSuccess(e,i){return e?this.wrapUserFunction((()=>e(i))):W.resolve(i)}wrapFailure(e,i){return e?this.wrapUserFunction((()=>e(i))):W.reject(i)}static resolve(e){return new W(((i,s)=>{i(e)}))}static reject(e){return new W(((i,s)=>{s(e)}))}static waitFor(e){return new W(((i,s)=>{let o=0,c=0,f=!1;e.forEach((y=>{++o,y.next((()=>{++c,f&&c===o&&i()}),(_=>s(_)))})),f=!0,c===o&&i()}))}static or(e){let i=W.resolve(!1);for(const s of e)i=i.next((o=>o?W.resolve(o):s()));return i}static forEach(e,i){const s=[];return e.forEach(((o,c)=>{s.push(i.call(this,o,c))}
1765)),this.waitFor(s)}static mapArray(e,i){return new W(((s,o)=>{const c=e.length,f=new Array(c);let y=0;for(let _=0;_<c;_++){const p=_;i(e[p]).next((T=>{f[p]=T,++y,y===c&&s(f)}),(T=>o(T)))}}))}static doWhile(e,i){return new W(((s,o)=>{const c=()=>{e()===!0?i().next((()=>{c()}),o):s()};c()}))}}function oN(r){const e=r.match(/Android ([\d.]+)/i),i=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(i)}function jl(r){return r.name==="IndexedDbTransactionError"}/**
1766 * @license
1767 * Copyright 2018 Google LLC
1768 *
1769 * Licensed under the Apache License, Version 2.0 (the "License");
1770 * you may not use this file except in compliance with the License.
1771 * You may obtain a copy of the License at
1772 *
1773 *   http://www.apache.org/licenses/LICENSE-2.0
1774 *
1775 * Unless required by applicable law or agreed to in writing, software
1776 * distributed under the License is distributed on an "AS IS" BASIS,
1777 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1778 * See the License for the specific language governing permissions and
1779 * limitations under the License.
1780 */class Ch{constructor(e,i){this.previousValue=e,i&&(i.sequenceNumberHandler=s=>this.ae(s),this.ue=s=>i.writeSequenceNumber(s))}ae(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ue&&this.ue(e),e}}Ch.ce=-1;/**
1781 * @license
1782 * Copyright 2017 Google LLC
1783 *
1784 * Licensed under the Apache License, Version 2.0 (the "License");
1785 * you may not use this file except in compliance with the License.
1786 * You may obtain a copy of the License at
1787 *
1788 *   http://www.apache.org/licenses/LICENSE-2.0
1789 *
1790 * Unless required by applicable law or agreed to in writing, software
1791 * distributed under the License is distributed on an "AS IS" BASIS,
1792 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1793 * See the License for the specific language governing permissions and
1794 * limitations under the License.
1795 */const Wm=-1;function Dh(r){return r==null}function dh(r){return r===0&&1/r==-1/0}function uN(r){return typeof r=="number"&&Number.isInteger(r)&&!dh(r)&&r<=Number.MAX_SAFE_INTEGER&&r>=Number.MIN_SAFE_INTEGER}/**
1796 * @license
1797 * Copyright 2017 Google LLC
1798 *
1799 * Licensed under the Apache License, Version 2.0 (the "License");
1800 * you may not use this file except in compliance with the License.
1801 * You may obtain a copy of the License at
1802 *
1803 *   http://www.apache.org/licenses/LICENSE-2.0
1804 *
1805 * Unless required by applicable law or agreed to in writing, software
1806 * distributed under the License is distributed on an "AS IS" BASIS,
1807 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1808 * See the License for the specific language governing permissions and
1809 * limitations under the License.
1810 */const qb="�";function cN(r){let e="";for(let i=0;i<r.length;i++)e.length>0&&(e=Kv(e)),e=hN(r.get(i),e);return Kv(e)}function hN(r,e){let i=e;const s=r.length;for(let o=0;o<s;o++){const c=r.charAt(o);switch(c){case"\0":i+="��";break;case qb:i+="��";break;default:i+=c}}return i}function Kv(r){return r+qb+"�"}/**
1811 * @license
1812 * Copyright 2017 Google LLC
1813 *
1814 * Licensed under the Apache License, Version 2.0 (the "License");
1815 * you may not use this file except in compliance with the License.
1816 * You may obtain a copy of the License at
1817 *
1818 *   http://www.apache.org/licenses/LICENSE-2.0
1819 *
1820 * Unless required by applicable law or agreed to in writing, software
1821 * distributed under the License is distributed on an "AS IS" BASIS,
1822 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1823 * See the License for the specific language governing permissions and
1824 * limitations under the License.
1825 */function Qv(r){let e=0;for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&e++;return e}function Os(r,e){for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&e(i,r[i])}function Fb(r){for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e))return!1;return!0}/**
1826 * @license
1827 * Copyright 2017 Google LLC
1828 *
1829 * Licensed under the Apache License, Version 2.0 (the "License");
1830 * you may not use this file except in compliance with the License.
1831 * You may obtain a copy of the License at
1832 *
1833 *   http://www.apache.org/licenses/LICENSE-2.0
1834 *
1835 * Unless required by applicable law or agreed to in writing, softw
vendor: 4,980 bytes, lines 1835-1840
1835are
1836 * distributed under the License is distributed on an "AS IS" BASIS,
1837 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1838 * See the License for the specific language governing permissions and
1839 * limitations under the License.
1840 */class Ot{constructor(e,i){this.comparator=e,this.root=i||bn.EMPTY}insert(e,i){return new Ot(this.comparator,this.root.insert(e,i,this.comparator).copy(null,null,bn.BLACK,null,null))}remove(e){return new Ot(this.comparator,this.root.remove(e,this.comparator).copy(null,null,bn.BLACK,null,null))}get(e){let i=this.root;for(;!i.isEmpty();){const s=this.comparator(e,i.key);if(s===0)return i.value;s<0?i=i.left:s>0&&(i=i.right)}return null}indexOf(e){let i=0,s=this.root;for(;!s.isEmpty();){const o=this.comparator(e,s.key);if(o===0)return i+s.left.size;o<0?s=s.left:(i+=s.left.size+1,s=s.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(((i,s)=>(e(i,s),!1)))}toString(){const e=[];return this.inorderTraversal(((i,s)=>(e.push(`${i}:${s}`),!1))),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new Hc(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new Hc(this.root,e,this.comparator,!1)}getReverseIterator(){return new Hc(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new Hc(this.root,e,this.comparator,!0)}}class Hc{constructor(e,i,s,o){this.isReverse=o,this.nodeStack=[];let c=1;for(;!e.isEmpty();)if(c=i?s(e.key,i):1,i&&o&&(c*=-1),c<0)e=this.isReverse?e.left:e.right;else{if(c===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const i={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 i}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 bn{constructor(e,i,s,o,c){this.key=e,this.value=i,this.color=s??bn.RED,this.left=o??bn.EMPTY,this.right=c??bn.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,i,s,o,c){return new bn(e??this.key,i??this.value,s??this.color,o??this.left,c??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,i,s){let o=this;const c=s(e,o.key);return o=c<0?o.copy(null,null,null,o.left.insert(e,i,s),null):c===0?o.copy(null,i,null,null,null):o.copy(null,null,null,null,o.right.insert(e,i,s)),o.fixUp()}removeMin(){if(this.left.isEmpty())return bn.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,i){let s,o=this;if(i(e,o.key)<0)o.left.isEmpty()||o.left.isRed()||o.left.left.isRed()||(o=o.moveRedLeft()),o=o.copy(null,null,null,o.left.remove(e,i),null);else{if(o.left.isRed()&&(o=o.rotateRight()),o.right.isEmpty()||o.right.isRed()||o.right.left.isRed()||(o=o.moveRedRight()),i(e,o.key)===0){if(o.right.isEmpty())return bn.EMPTY;s=o.right.min(),o=o.copy(s.key,s.value,null,null,o.right.removeMin())}o=o.copy(null,null,null,null,o.right.remove(e,i))}return o.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,bn.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,bn.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),i=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,i)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Ce(43730,{key:this.key,value:this.value});if(this.right.isRed())throw Ce(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw Ce(27949);return e+(this.isRed()?0:1)}}bn.EMPTY=null,bn.RED=!0,bn.BLACK=!1;
vendor: 4,232 bytes, lines 1840-1884
1840bn.EMPTY=new class{constructor(){this.size=0}get key(){throw Ce(57766)}get value(){throw Ce(16141)}get color(){throw Ce(16727)}get left(){throw Ce(29726)}get right(){throw Ce(36894)}copy(e,i,s,o,c){return this}insert(e,i,s){return new bn(e,i)}remove(e,i){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}};/**
1841 * @license
1842 * Copyright 2017 Google LLC
1843 *
1844 * Licensed under the Apache License, Version 2.0 (the "License");
1845 * you may not use this file except in compliance with the License.
1846 * You may obtain a copy of the License at
1847 *
1848 *   http://www.apache.org/licenses/LICENSE-2.0
1849 *
1850 * Unless required by applicable law or agreed to in writing, software
1851 * distributed under the License is distributed on an "AS IS" BASIS,
1852 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1853 * See the License for the specific language governing permissions and
1854 * limitations under the License.
1855 */class rn{constructor(e){this.comparator=e,this.data=new Ot(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(((i,s)=>(e(i),!1)))}forEachInRange(e,i){const s=this.data.getIteratorFrom(e[0]);for(;s.hasNext();){const o=s.getNext();if(this.comparator(o.key,e[1])>=0)return;i(o.key)}}forEachWhile(e,i){let s;for(s=i!==void 0?this.data.getIteratorFrom(i):this.data.getIterator();s.hasNext();)if(!e(s.getNext().key))return}firstAfterOrEqual(e){const i=this.data.getIteratorFrom(e);return i.hasNext()?i.getNext().key:null}getIterator(){return new Yv(this.data.getIterator())}getIteratorFrom(e){return new Yv(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 i=this;return i.size<e.size&&(i=e,e=this),e.forEach((s=>{i=i.add(s)})),i}isEqual(e){if(!(e instanceof rn)||this.size!==e.size)return!1;const i=this.data.getIterator(),s=e.data.getIterator();for(;i.hasNext();){const o=i.getNext().key,c=s.getNext().key;if(this.comparator(o,c)!==0)return!1}return!0}toArray(){const e=[];return this.forEach((i=>{e.push(i)})),e}toString(){const e=[];return this.forEach((i=>e.push(i))),"SortedSet("+e.toString()+")"}copy(e){const i=new rn(this.comparator);return i.data=e,i}}class Yv{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/**
1856 * @license
1857 * Copyright 2020 Google LLC
1858 *
1859 * Licensed under the Apache License, Version 2.0 (the "License");
1860 * you may not use this file except in compliance with the License.
1861 * You may obtain a copy of the License at
1862 *
1863 *   http://www.apache.org/licenses/LICENSE-2.0
1864 *
1865 * Unless required by applicable law or agreed to in writing, software
1866 * distributed under the License is distributed on an "AS IS" BASIS,
1867 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1868 * See the License for the specific language governing permissions and
1869 * limitations under the License.
1870 */class oi{constructor(e){this.fields=e,e.sort(Tn.comparator)}static empty(){return new oi([])}unionWith(e){let i=new rn(Tn.comparator);for(const s of this.fields)i=i.add(s);for(const s of e)i=i.add(s);return new oi(i.toArray())}covers(e){for(const i of this.fields)if(i.isPrefixOf(e))return!0;return!1}isEqual(e){return El(this.fields,e.fields,((i,s)=>i.isEqual(s)))}}/**
1871 * @license
1872 * Copyright 2023 Google LLC
1873 *
1874 * Licensed under the Apache License, Version 2.0 (the "License");
1875 * you may not use this file except in compliance with the License.
1876 * You may obtain a copy of the License at
1877 *
1878 *   http://www.apache.org/licenses/LICENSE-2.0
1879 *
1880 * Unless required by applicable law or agreed to in writing, software
1881 * distributed under the License is distributed on an "AS IS" BASIS,
1882 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1883 * See the License for the specific language governing permissions and
1884 * limitations under the License.
1885 */class Gb extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/**
1886 * @license
1887 * Copyright 2020 Google LLC
1888 *
1889 * Licensed under the Apache License, Version 2.0 (the "License");
1890 * you may not use this file except in compliance with the License.
1891 * You may obtain a copy of the License at
1892 *
1893 *   http://www.apache.org/licenses/LICENSE-2.0
1894 *
1895 * Unless required by applicable law or agreed to in writing, software
1896 * distributed under the License is distributed on an "AS IS" BASIS,
1897 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1898 * See the License for the specific language governing permissions and
1899 * limitations under the License.
1900 */class En{constructor(e){this.binaryString=e}static fromBase64String(e){const i=(function(o){try{return atob(o)}catch(c){throw typeof DOMException<"u"&&c instanceof DOMException?new Gb("Invalid base64 string: "+c):c}})(e);return new En(i)}static fromUint8Array(e){const i=(function(o){let c="";for(let f=0;f<o.length;++f)c+=String.fromCharCode(o[f]);return c})(e);return new En(i)}[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(i){return btoa(i)})(this.binaryString)}toUint8Array(){return(function(i){const s=new Uint8Array(i.length);for(let o=0;o<i.length;o++)s[o]=i.charCodeAt(o);return s})(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return Ze(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}En.EMPTY_BYTE_STRING=new En("");const dN=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Is(r){if(ft(!!r,39018),typeof r=="string"){let e=0;const i=dN.exec(r);if(ft(!!i,46558,{timestamp:r}),i[1]){let o=i[1];o=(o+"000000000").substr(0,9),e=Number(o)}const s=new Date(r);return{seconds:Math.floor(s.getTime()/1e3),nanos:e}}return{seconds:qt(r.seconds),nanos:qt(r.nanos)}}function qt(r){return typeof r=="number"?r:typeof r=="string"?Number(r):0}function Rs(r){return typeof r=="string"?En.fromBase64String(r):En.fromUint8Array(r)}/**
1901 * @license
1902 * Copyright 2020 Google LLC
1903 *
1904 * Licensed under the Apache License, Version 2.0 (the "License");
1905 * you may not use this file except in compliance with the License.
1906 * You may obtain a copy of the License at
1907 *
1908 *   http://www.apache.org/licenses/LICENSE-2.0
1909 *
1910 * Unless required by applicable law or agreed to in writing, software
1911 * distributed under the License is distributed on an "AS IS" BASIS,
1912 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1913 * See the License for the specific language governing permissions and
1914 * limitations under the License.
1915 */const Kb="server_timestamp",Qb="__type__",Yb="__previous_value__",$b="__local_write_time__";function eg(r){var i,s;return((s=(((i=r==null?void 0:r.mapValue)==null?void 0:i.fields)||{})[Qb])==null?void 0:s.stringValue)===Kb}function Mh(r){const e=r.mapValue.fields[Yb];return eg(e)?Mh(e):e}function eu(r){const e=Is(r.mapValue.fields[$b].timestampValue);return new dt(e.seconds,e.nanos)}/**
1916 * @license
1917 * Copyright 2017 Google LLC
1918 *
1919 * Licensed under the Apache License, Version 2.0 (the "License");
1920 * you may not use this file except in compliance with the License.
1921 * You may obtain a copy of the License at
1922 *
1923 *   http://www.apache.org/licenses/LICENSE-2.0
1924 *
1925 * Unless required by applicable law or agreed to in writing, software
1926 * distributed under the License is distributed on an "AS IS" BASIS,
1927 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1928 * See the License for the specific language governing permissions and
1929 * limitations under the License.
1930 */class fN{constructor(e,i,s,o,c,f,y,_,p,T,A){this.databaseId=e,this.appId=i,this.persistenceKey=s,this.host=o,this.ssl=c,this.forceLongPolling=f,this.autoDetectLongPolling=y,this.longPollingOptions=_,this.useFetchStreams=p,this.isUsingEmulator=T,this.apiKey=A}}const fh="(default)";class tu{constructor(e,i){this.projectId=e,this.database=i||fh}static empty(){return new tu("","")}get isDefaultDatabase(){return this.database===fh}isEqual(e){return e instanceof tu&&e.projectId===this.projectId&&e.database===this.database}}function mN(r,e){if(!Object.prototype.hasOwnProperty.apply(r.options,["projectId"]))throw new ce(Z.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new tu(r.options.projectId,e)}/**
1931 * @license
1932 * Copyright 2020 Google LLC
1933 *
1934 * Licensed under the Apache License, Version 2.0 (the "License");
1935 * you may not use this file except in compliance with the License.
1936 * You may obtain a copy of the License at
1937 *
1938 *   http://www.apache.org/licenses/LICENSE-2.0
1939 *
1940 * Unless required by applicable law or agreed to in writing, software
1941 * distributed under the License is distributed on an "AS IS" BASIS,
1942 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1943 * See the License for the specific language governing permissions and
1944 * limitations under the License.
1945 */const Xb="__type__",gN="__max__",qc={mapValue:{}},Jb="__vector__",mh="value";function Cs(r){return"nullValue"in r?0:"booleanValue"in r?1:"integerValue"in r||"doubleValue"in r?2:"timestampValue"in r?3:"stringValue"in r?5:"bytesValue"in r?6:"referenceValue"in r?7:"geoPointValue"in r?8:"arrayValue"in r?9:"mapValue"in r?eg(r)?4:yN(r)?9007199254740991:pN(r)?10:11:Ce(28295,{value:r})}function ur(r,e){if(r===e)return!0;const i=Cs(r);if(i!==Cs(e))return!1;switch(i){case 0:case 9007199254740991:return!0;case 1:return r.booleanValue===e.booleanValue;case 4:return eu(r).isEqual(eu(e));case 3:return(function(o,c){if(typeof o.timestampValue=="string"&&typeof c.timestampValue=="string"&&o.timestampValue.length===c.timestampValue.length)return o.timestampValue===c.timestampValue;const f=Is(o.timestampValue),y=Is(c.timestampValue);return f.seconds===y.seconds&&f.nanos===y.nanos})(r,e);case 5:return r.stringValue===e.stringValue;case 6:return(function(o,c){return Rs(o.bytesValue).isEqual(Rs(c.bytesValue))})(r,e);case 7:return r.referenceValue===e.referenceValue;case 8:return(function(o,c){return qt(o.geoPointValue.latitude)===qt(c.geoPointValue.latitude)&&qt(o.geoPointValue.longitude)===qt(c.geoPointValue.longitude)})(r,e);case 2:return(function(o,c){if("integerValue"in o&&"integerValue"in c)return qt(o.integerValue)===qt(c.integerValue);if("doubleValue"in o&&"doubleValue"in c){const f=qt(o.doubleValue),y=qt(c.doubleValue);return f===y?dh(f)===dh(y):isNaN(f)&&isNaN(y)}return!1})(r,e);case 9:return El(r.arrayValue.values||[],e.arrayValue.values||[],ur);case 10:case 11:return(function(o,c){const f=o.mapValue.fields||{},y=c.mapValue.fields||{};if(Qv(f)!==Qv(y))return!1;for(const _ in f)if(f.hasOwnProperty(_)&&(y[_]===void 0||!ur(f[_],y[_])))return!1;return!0})(r,e);default:return Ce(52216,{left:r})}}function nu(r,e){return(r.values||[]).find((i=>ur(i,e)))!==void 0}function xl(r,e){if(r===e)return 0;const i=Cs(r),s=Cs(e);if(i!==s)return Ze(i,s);switch(i){case 0:case 9007199254740991:return 0;case 1:return Ze(r.booleanValue,e.booleanValue);case 2:return(function(c,f){const y=qt(c.integerValue||c.doubleValue),_=qt(f.integerValue||f.doubleValue);return y<_?-1:y>_?1:y===_?0:isNaN(y)?isNaN(_)?0:-1:1})(r,e);case 3:return $v(r.timestampValue,e.timestampValue);case 4:return $v(eu(r),eu(e));case 5:return bm(r.stringValue,e.stringValue);case 6:return(function(c,f){const y=Rs(c),_=Rs(f);return y.compareTo(_)})(r.bytesValue,e.bytesValue);case 7:return(function(c,f){const y=c.split("/"),_=f.split("/");for(let p=0;p<y.length&&p<_.length;p++){const T=Ze(y[p],_[p]);if(T!==0)return T}return Ze(y.length,_.length)})(r.referenceValue,e.referenceValue);case 8:return(function(c,f){const y=Ze(qt(c.latitude),qt(f.latitude));return y!==0?y:Ze(qt(c.longitude),qt(f.longitude))})(r.geoPointValue,e.geoPointValue);case 9:return Xv(r.arrayValue,e.arrayValue);case 10:return(function(c,f){var S,z,Q,ie;const y=c.fields||{},_=f.fields||{},p=(S=y[mh])==null?void 0:S.arrayValue,T=(z=_[mh])==null?void 0:z.arrayValue,A=Ze(((Q=p==null?void 0:p.values)==null?void 0:Q.length)||0,((ie=T==null?void 0:T.values)==null?void 0:ie.length)||0);return A!==0?A:Xv(p,T)})(r.mapValue,e.mapValue);case 11:return(function(c,f){if(c===qc.mapValue&&f===qc.mapValue)return 0;if(c===qc.mapValue)return 1;if(f===qc.mapValue)return-1;const y=c.fields||{},_=Object.keys(y),p=f.fields||{},T=Object.keys(p);_.sort(),T.sort();for(let A=0;A<_.length&&A<T.length;++A){const S=bm(_[A],T[A]);if(S!==0)return S;const z=xl(y[_[A]],p[T[A]]);if(z!==0)return z}return Ze(_.length,T.length)})(r.mapValue,e.mapValue);default:throw Ce(23264,{he:i})}}function $v(r,e){if(typeof r=="string"&&typeof e=="string"&&r.length===e.length)return Ze(r,e);const i=Is(r),s=Is(e),o=Ze(i.seconds,s.seconds);return o!==0?o:Ze(i.nanos,s.nanos)}function Xv(r,e){const i=r.values||[],s=e.values||[];for(let o=0;o<i.length&&o<s.length;++o){const c=xl(i[o],s[o]);if(c)return c}return Ze(i.length,s.length)}function Al(r){return Tm(r)}function Tm(r){return"nullValue"in r?"null":"booleanValue"in r?""+r.booleanValue:"integerValue"in r?""+r.integerValue:"doubleValue"in r?""+r.doubleValue:"timestampValue"in r?(function(i){const s=Is(i);return`time(${s.seconds},${s.nanos})`})(r.timestampValue):"stringValue"in r?r.stringValue:"bytesValue"in r?(function(i){return Rs(i).toBase64()})(r.bytesValue):"referenceValue"in r?(function(i){return Ae.fromName(i).toString()})(r.referenceValue):"geoPointValue"in r?(function(i){return`geo(${i.latitude},${i.longitude})`})(r.geoPointValue):"arrayValue"in r?(function(i){let s="[",o=!0;for(const c of i.values||[])o?o=!1:s+=",",s+=Tm(c);return s+"]"})(r.arrayValue):"mapValue"in r?(function(i){const s=Object.keys(i.fields||{}).sort();let o="{",c=!0;for(const f of s)c?c=!1:o+=",",o+=`${f}:${Tm(i.fields[f])}`;return o+"}"})(r.mapValue):Ce(61005,{value:r})}function Zc(r){switch(Cs(r)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const e=Mh(r);return e?16+Zc(e):16;case 5:return 2*r.stringValue.length;case 6:return Rs(r.bytesValue).approximateByteSize();case 7:return r.referenceValue.length;case 9:return(function(s){return(s.values||[]).reduce(((o,c)=>o+Zc(c)),0)})(r.arrayValue);case 10:case 11:return(function(s){let o=0;
vendor: 3,006 bytes, lines 1945-1960
1945return Os(s.fields,((c,f)=>{o+=c.length+Zc(f)})),o})(r.mapValue);default:throw Ce(13486,{value:r})}}function Jv(r,e){return{referenceValue:`projects/${r.projectId}/databases/${r.database}/documents/${e.path.canonicalString()}`}}function Em(r){return!!r&&"integerValue"in r}function tg(r){return!!r&&"arrayValue"in r}function Zv(r){return!!r&&"nullValue"in r}function Wv(r){return!!r&&"doubleValue"in r&&isNaN(Number(r.doubleValue))}function Wc(r){return!!r&&"mapValue"in r}function pN(r){var i,s;return((s=(((i=r==null?void 0:r.mapValue)==null?void 0:i.fields)||{})[Xb])==null?void 0:s.stringValue)===Jb}function Ko(r){if(r.geoPointValue)return{geoPointValue:{...r.geoPointValue}};if(r.timestampValue&&typeof r.timestampValue=="object")return{timestampValue:{...r.timestampValue}};if(r.mapValue){const e={mapValue:{fields:{}}};return Os(r.mapValue.fields,((i,s)=>e.mapValue.fields[i]=Ko(s))),e}if(r.arrayValue){const e={arrayValue:{values:[]}};for(let i=0;i<(r.arrayValue.values||[]).length;++i)e.arrayValue.values[i]=Ko(r.arrayValue.values[i]);return e}return{...r}}function yN(r){return(((r.mapValue||{}).fields||{}).__type__||{}).stringValue===gN}/**
1946 * @license
1947 * Copyright 2017 Google LLC
1948 *
1949 * Licensed under the Apache License, Version 2.0 (the "License");
1950 * you may not use this file except in compliance with the License.
1951 * You may obtain a copy of the License at
1952 *
1953 *   http://www.apache.org/licenses/LICENSE-2.0
1954 *
1955 * Unless required by applicable law or agreed to in writing, software
1956 * distributed under the License is distributed on an "AS IS" BASIS,
1957 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1958 * See the License for the specific language governing permissions and
1959 * limitations under the License.
1960 */class $n{constructor(e){this.value=e}static empty(){return new $n({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let i=this.value;for(let s=0;s<e.length-1;++s)if(i=(i.mapValue.fields||{})[e.get(s)],!Wc(i))return null;return i=(i.mapValue.fields||{})[e.lastSegment()],i||null}}set(e,i){this.getFieldsMap(e.popLast())[e.lastSegment()]=Ko(i)}setAll(e){let i=Tn.emptyPath(),s={},o=[];e.forEach(((f,y)=>{if(!i.isImmediateParentOf(y)){const _=this.getFieldsMap(i);this.applyChanges(_,s,o),s={},o=[],i=y.popLast()}f?s[y.lastSegment()]=Ko(f):o.push(y.lastSegment())}));const c=this.getFieldsMap(i);this.applyChanges(c,s,o)}delete(e){const i=this.field(e.popLast());Wc(i)&&i.mapValue.fields&&delete i.mapValue.fields[e.lastSegment()]}isEqual(e){return ur(this.value,e.value)}getFieldsMap(e){let i=this.value;i.mapValue.fields||(i.mapValue={fields:{}});for(let s=0;s<e.length;++s){let o=i.mapValue.fields[e.get(s)];Wc(o)&&o.mapValue.fields||(o={mapValue:{fields:{}}},i.mapValue.fields[e.get(s)]=o),i=o}return i.mapValue.fields}applyChanges(e,i,s){Os(i,((o,c)=>e[o]=c));for(const o of s)delete e[o]}clone(){return new $n(Ko(this.value))}}function Zb(r){const e=[];return Os(r.fields,((i,s)=>{const o=new Tn([i]);if(Wc(s)){const c=Zb(s.mapValue).fields;
vendor: 4,181 bytes, lines 1960-2000
1960if(c.length===0)e.push(o);else for(const f of c)e.push(o.child(f))}else e.push(o)})),new oi(e)}/**
1961 * @license
1962 * Copyright 2017 Google LLC
1963 *
1964 * Licensed under the Apache License, Version 2.0 (the "License");
1965 * you may not use this file except in compliance with the License.
1966 * You may obtain a copy of the License at
1967 *
1968 *   http://www.apache.org/licenses/LICENSE-2.0
1969 *
1970 * Unless required by applicable law or agreed to in writing, software
1971 * distributed under the License is distributed on an "AS IS" BASIS,
1972 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1973 * See the License for the specific language governing permissions and
1974 * limitations under the License.
1975 */class Cn{constructor(e,i,s,o,c,f,y){this.key=e,this.documentType=i,this.version=s,this.readTime=o,this.createTime=c,this.data=f,this.documentState=y}static newInvalidDocument(e){return new Cn(e,0,Me.min(),Me.min(),Me.min(),$n.empty(),0)}static newFoundDocument(e,i,s,o){return new Cn(e,1,i,Me.min(),s,o,0)}static newNoDocument(e,i){return new Cn(e,2,i,Me.min(),Me.min(),$n.empty(),0)}static newUnknownDocument(e,i){return new Cn(e,3,i,Me.min(),Me.min(),$n.empty(),2)}convertToFoundDocument(e,i){return!this.createTime.isEqual(Me.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=i,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=$n.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=$n.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=Me.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 Cn&&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 Cn(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}})`}}/**
1976 * @license
1977 * Copyright 2022 Google LLC
1978 *
1979 * Licensed under the Apache License, Version 2.0 (the "License");
1980 * you may not use this file except in compliance with the License.
1981 * You may obtain a copy of the License at
1982 *
1983 *   http://www.apache.org/licenses/LICENSE-2.0
1984 *
1985 * Unless required by applicable law or agreed to in writing, software
1986 * distributed under the License is distributed on an "AS IS" BASIS,
1987 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1988 * See the License for the specific language governing permissions and
1989 * limitations under the License.
1990 */class gh{constructor(e,i){this.position=e,this.inclusive=i}}function e_(r,e,i){let s=0;for(let o=0;o<r.position.length;o++){const c=e[o],f=r.position[o];if(c.field.isKeyField()?s=Ae.comparator(Ae.fromName(f.referenceValue),i.key):s=xl(f,i.data.field(c.field)),c.dir==="desc"&&(s*=-1),s!==0)break}return s}function t_(r,e){if(r===null)return e===null;if(e===null||r.inclusive!==e.inclusive||r.position.length!==e.position.length)return!1;for(let i=0;i<r.position.length;i++)if(!ur(r.position[i],e.position[i]))return!1;return!0}/**
1991 * @license
1992 * Copyright 2022 Google LLC
1993 *
1994 * Licensed under the Apache License, Version 2.0 (the "License");
1995 * you may not use this file except in compliance with the License.
1996 * You may obtain a copy of the License at
1997 *
1998 *   http://www.apache.org/licenses/LICENSE-2.0
1999 *
2000 * Unless required by applicable law or agreed to in writing, softw
2000are
2001 * distributed under the License is distributed on an "AS IS" BASIS,
2002 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2003 * See the License for the specific language governing permissions and
2004 * limitations under the License.
2005 */class ph{constructor(e,i="asc"){this.field=e,this.dir=i}}function vN(r,e){return r.dir===e.dir&&r.field.isEqual(e.field)}/**
2006 * @license
2007 * Copyright 2022 Google LLC
2008 *
2009 * Licensed under the Apache License, Version 2.0 (the "License");
2010 * you may not use this file except in compliance with the License.
2011 * You may obtain a copy of the License at
2012 *
2013 *   http://www.apache.org/licenses/LICENSE-2.0
2014 *
2015 * Unless required by applicable law or agreed to in writing, software
2016 * distributed under the License is distributed on an "AS IS" BASIS,
2017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2018 * See the License for the specific language governing permissions and
2019 * limitations under the License.
2020 */class Wb{}class Wt extends Wb{constructor(e,i,s){super(),this.field=e,this.op=i,this.value=s}static create(e,i,s){return e.isKeyField()?i==="in"||i==="not-in"?this.createKeyFieldInFilter(e,i,s):new bN(e,i,s):i==="array-contains"?new xN(e,s):i==="in"?new AN(e,s):i==="not-in"?new SN(e,s):i==="array-contains-any"?new wN(e,s):new Wt(e,i,s)}static createKeyFieldInFilter(e,i,s){return i==="in"?new TN(e,s):new EN(e,s)}matches(e){const i=e.data.field(this.field);return this.op==="!="?i!==null&&i.nullValue===void 0&&this.matchesComparison(xl(i,this.value)):i!==null&&Cs(this.value)===Cs(i)&&this.matchesComparison(xl(i,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 Ce(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class Pi extends Wb{constructor(e,i){super(),this.filters=e,this.op=i,this.Pe=null}static create(e,i){return new Pi(e,i)}matches(e){return eT(this)?this.filters.find((i=>!i.matches(e)))===void 0:this.filters.find((i=>i.matches(e)))!==void 0}getFlattenedFilters(){return this.Pe!==null||(this.Pe=this.filters.reduce(((e,i)=>e.concat(i.getFlattenedFilters())),[])),this.Pe}getFilters(){return Object.assign([],this.filters)}}function eT(r){return r.op==="and"}function tT(r){return _N(r)&&eT(r)}function _N(r){for(const e of r.filters)if(e instanceof Pi)return!1;return!0}function xm(r){if(r instanceof Wt)return r.field.canonicalString()+r.op.toString()+Al(r.value);if(tT(r))return r.filters.map((e=>xm(e))).join(",");{const e=r.filters.map((i=>xm(i))).join(",");return`${r.op}(${e})`}}function nT(r,e){return r instanceof Wt?(function(s,o){return o instanceof Wt&&s.op===o.op&&s.field.isEqual(o.field)&&ur(s.value,o.value)})(r,e):r instanceof Pi?(function(s,o){return o instanceof Pi&&s.op===o.op&&s.filters.length===o.filters.length?s.filters.reduce(((c,f,y)=>c&&nT(f,o.filters[y])),!0):!1})(r,e):void Ce(19439)}function iT(r){return r instanceof Wt?(function(i){return`${i.field.canonicalString()} ${i.op} ${Al(i.value)}`})(r):r instanceof Pi?(function(i){return i.op.toString()+" {"+i.getFilters().map(iT).join(" ,")+"}"})(r):"Filter"}class bN extends Wt{constructor(e,i,s){super(e,i,s),this.key=Ae.fromName(s.referenceValue)}matches(e){const i=Ae.comparator(e.key,this.key);return this.matchesComparison(i)}}class TN extends Wt{constructor(e,i){super(e,"in",i),this.keys=rT("in",i)}matches(e){return this.keys.some((i=>i.isEqual(e.key)))}}class EN extends Wt{constructor(e,i){super(e,"not-in",i),this.keys=rT("not-in",i)}matches(e){return!this.keys.some((i=>i.isEqual(e.key)))}}function rT(r,e){var i;return(((i=e.arrayValue)==null?void 0:i.values)||[]).map((s=>Ae.fromName(s.referenceValue)))}class xN extends Wt{constructor(e,i){super(e,"array-contains",i)}matches(e){const i=e.data.field(this.field);return tg(i)&&nu(i.arrayValue,this.value)}}class AN extends Wt{constructor(e,i){super(e,"in",i)}matches(e){const i=e.data.field(this.field);return i!==null&&nu(this.value.arrayValue,i)}}class SN extends Wt{constructor(e,i){super(e,"not-in",i)}matches(e){if(nu(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const i=e.data.field(this.field);return i!==null&&i.nullValue===void 0&&!nu(this.value.arrayValue,i)}}class wN extends Wt{constructor(e,i){super(e,"array-contains-any",i)}matches(e){const i=e.data.field(this.field);return!(!tg(i)||!i.arrayValue.values)&&i.arrayValue.values.some((s=>nu(this.value.arrayValue,s)))}}/**
2021 * @license
2022 * Copyright 2019 Google LLC
2023 *
2024 * Licensed under the Apache License, Version 2.0 (the "License");
2025 * you may not use this file except in compliance with the License.
2026 * You may obtain a copy of the License at
2027 *
2028 *   http://www.apache.org/licenses/LICENSE-2.0
2029 *
2030 * Unless required by applicable law or agreed to in writing, software
2031 * distributed under the License is distributed on an "AS IS" BASIS,
2032 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2033 * See the License for the specific language governing permissions and
2034 * limitations under the License.
2035 */class NN{constructor(e,i=null,s=[],o=[],c=null,f=null,y=null){this.path=e,this.collectionGroup=i,this.orderBy=s,this.filters=o,this.limit=c,this.startAt=f,this.endAt=y,this.Te=null}}function n_(r,e=null,i=[],s=[],o=null,c=null,f=null){return new NN(r,e,i,s,o,c,f)}function ng(r){const e=je(r);if(e.Te===null){let i=e.path.canonicalString();e.collectionGroup!==null&&(i+="|cg:"+e.collectionGroup),i+="|f:",i+=e.filters.map((s=>xm(s))).join(","),i+="|ob:",i+=e.orderBy.map((s=>(function(c){return c.field.canonicalString()+c.dir})(s))).join(","),Dh(e.limit)||(i+="|l:",i+=e.limit),e.startAt&&(i+="|lb:",i+=e.startAt.inclusive?"b:":"a:",i+=e.startAt.position.map((s=>Al(s))).join(",")),e.endAt&&(i+="|ub:",i+=e.endAt.inclusive?"a:":"b:",i+=e.endAt.position.map((s=>Al(s))).join(",")),e.Te=i}return e.Te}function ig(r,e){if(r.limit!==e.limit||r.orderBy.length!==e.orderBy.length)return!1;for(let i=0;i<r.orderBy.length;i++)if(!vN(r.orderBy[i],e.orderBy[i]))return!1;if(r.filters.length!==e.filters.length)return!1;for(let i=0;i<r.filters.length;i++)if(!nT(r.filters[i],e.filters[i]))return!1;return r.collectionGroup===e.collectionGroup&&!!r.path.isEqual(e.path)&&!!t_(r.startAt,e.startAt)&&t_(r.endAt,e.endAt)}function Am(r){return Ae.isDocumentKey(r.path)&&r.collectionGroup===null&&r.filters.length===0}/**
2036 * @license
2037 * Copyright 2017 Google LLC
2038 *
2039 * Licensed under the Apache License, Version 2.0 (the "License");
2040 * you may not use this file except in compliance with the License.
2041 * You may obtain a copy of the License at
2042 *
2043 *   http://www.apache.org/licenses/LICENSE-2.0
2044 *
2045 * Unless required by applicable law or agreed to in writing, software
2046 * distributed under the License is distributed on an "AS IS" BASIS,
2047 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2048 * See the License for the specific language governing permissions and
2049 * limitations under the License.
2050 */class du{constructor(e,i=null,s=[],o=[],c=null,f="F",y=null,_=null){this.path=e,this.collectionGroup=i,this.explicitOrderBy=s,this.filters=o,this.limit=c,this.limitType=f,this.startAt=y,this.endAt=_,this.Ie=null,this.Ee=null,this.Re=null,this.startAt,this.endAt}}function IN(r,e,i,s,o,c,f,y){return new du(r,e,i,s,o,c,f,y)}function Oh(r){return new du(r)}function i_(r){return r.filters.length===0&&r.limit===null&&r.startAt==null&&r.endAt==null&&(r.explicitOrderBy.length===0||r.explicitOrderBy.length===1&&r.explicitOrderBy[0].field.isKeyField())}function RN(r){return Ae.isDocumentKey(r.path)&&r.collectionGroup===null&&r.filters.length===0}function sT(r){return r.collectionGroup!==null}function Qo(r){const e=je(r);if(e.Ie===null){e.Ie=[];const i=new Set;for(const c of e.explicitOrderBy)e.Ie.push(c),i.add(c.field.canonicalString());const s=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(f){let y=new rn(Tn.comparator);return f.filters.forEach((_=>{_.getFlattenedFilters().forEach((p=>{p.isInequality()&&(y=y.add(p.field))}))})),y})(e).forEach((c=>{i.has(c.canonicalString())||c.isKeyField()||e.Ie.push(new ph(c,s))})),i.has(Tn.keyField().canonicalString())||e.Ie.push(new ph(Tn.keyField(),s))}return e.Ie}function sr(r){const e=je(r);return e.Ee||(e.Ee=CN(e,Qo(r))),e.Ee}function CN(r,e){if(r.limitType==="F")return n_(r.path,r.collectionGroup,e,r.filters,r.limit,r.startAt,r.endAt);{e=e.map((o=>{const c=o.dir==="desc"?"asc":"desc";return new ph(o.field,c)}));const i=r.endAt?new gh(r.endAt.position,r.endAt.inclusive):null,s=r.startAt?new gh(r.startAt.position,r.startAt.inclusive):null;return n_(r.path,r.collectionGroup,e,r.filters,r.limit,i,s)}}function Sm(r,e){const i=r.filters.concat([e]);return new du(r.path,r.collectionGroup,r.explicitOrderBy.slice(),i,r.limit,r.limitType,r.startAt,r.endAt)}function wm(r,e,i){return new du(r.path,r.collectionGroup,r.explicitOrderBy.slice(),r.filters.slice(),e,i,r.startAt,r.endAt)}function jh(r,e){return ig(sr(r),sr(e))&&r.limitType===e.limitType}function aT(r){return`${ng(sr(r))}|lt:${r.limitType}`}function dl(r){return`Query(target=${(function(i){let s=i.path.canonicalString();return i.collectionGroup!==null&&(s+=" collectionGroup="+i.collectionGroup),i.filters.length>0&&(s+=`, filters: [${i.filters.map((o=>iT(o))).join(", ")}]`),Dh(i.limit)||(s+=", limit: "+i.limit),i.orderBy.length>0&&(s+=`, orderBy: [${i.orderBy.map((o=>(function(f){return`${f.field.canonicalString()} (${f.dir})`}
2050)(o))).join(", ")}]`),i.startAt&&(s+=", startAt: ",s+=i.startAt.inclusive?"b:":"a:",s+=i.startAt.position.map((o=>Al(o))).join(",")),i.endAt&&(s+=", endAt: ",s+=i.endAt.inclusive?"a:":"b:",s+=i.endAt.position.map((o=>Al(o))).join(",")),`Target(${s})`})(sr(r))}; limitType=${r.limitType})`}function Vh(r,e){return e.isFoundDocument()&&(function(s,o){const c=o.key.path;return s.collectionGroup!==null?o.key.hasCollectionId(s.collectionGroup)&&s.path.isPrefixOf(c):Ae.isDocumentKey(s.path)?s.path.isEqual(c):s.path.isImmediateParentOf(c)})(r,e)&&(function(s,o){for(const c of Qo(s))if(!c.field.isKeyField()&&o.data.field(c.field)===null)return!1;return!0})(r,e)&&(function(s,o){for(const c of s.filters)if(!c.matches(o))return!1;return!0})(r,e)&&(function(s,o){return!(s.startAt&&!(function(f,y,_){const p=e_(f,y,_);return f.inclusive?p<=0:p<0})(s.startAt,Qo(s),o)||s.endAt&&!(function(f,y,_){const p=e_(f,y,_);return f.inclusive?p>=0:p>0})(s.endAt,Qo(s),o))})(r,e)}function DN(r){return r.collectionGroup||(r.path.length%2==1?r.path.lastSegment():r.path.get(r.path.length-2))}function lT(r){return(e,i)=>{let s=!1;for(const o of Qo(r)){const c=MN(o,e,i);if(c!==0)return c;s=s||o.field.isKeyField()}return 0}}function MN(r,e,i){const s=r.field.isKeyField()?Ae.comparator(e.key,i.key):(function(c,f,y){const _=f.data.field(c),p=y.data.field(c);return _!==null&&p!==null?xl(_,p):Ce(42886)})(r.field,e,i);switch(r.dir){case"asc":return s;case"desc":return-1*s;default:return Ce(19790,{direction:r.dir})}}/**
2051 * @license
2052 * Copyright 2017 Google LLC
2053 *
2054 * Licensed under the Apache License, Version 2.0 (the "License");
2055 * you may not use this file except in compliance with the License.
2056 * You may obtain a copy of the License at
2057 *
2058 *   http://www.apache.org/licenses/LICENSE-2.0
2059 *
2060 * Unless required by applicable law or agreed to in writing, software
2061 * distributed under the License is distributed on an "AS IS" BASIS,
2062 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2063 * See the License for the specific language governing permissions and
2064 * limitations under the License.
2065 */class ba{constructor(e,i){this.mapKeyFn=e,this.equalsFn=i,this.inner={},this.innerSize=0}get(e){const i=this.mapKeyFn(e),s=this.inner[i];if(s!==void 0){for(const[o,c]of s)if(this.equalsFn(o,e))return c}}has(e){return this.get(e)!==void 0}set(e,i){const s=this.mapKeyFn(e),o=this.inner[s];if(o===void 0)return this.inner[s]=[[e,i]],void this.innerSize++;for(let c=0;c<o.length;c++)if(this.equalsFn(o[c][0],e))return void(o[c]=[e,i]);o.push([e,i]),this.innerSize++}delete(e){const i=this.mapKeyFn(e),s=this.inner[i];if(s===void 0)return!1;for(let o=0;o<s.length;o++)if(this.equalsFn(s[o][0],e))return s.length===1?delete this.inner[i]:s.splice(o,1),this.innerSize--,!0;return!1}forEach(e){Os(this.inner,((i,s)=>{for(const[o,c]of s)e(o,c)}))}isEmpty(){return Fb(this.inner)}size(){return this.innerSize}}/**
2066 * @license
2067 * Copyright 2017 Google LLC
2068 *
2069 * Licensed under the Apache License, Version 2.0 (the "License");
2070 * you may not use this file except in compliance with the License.
2071 * You may obtain a copy of the License at
2072 *
2073 *   http://www.apache.org/licenses/LICENSE-2.0
2074 *
2075 * Unless required by applicable law or agreed to in writing, software
2076 * distributed under the License is distributed on an "AS IS" BASIS,
2077 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2078 * See the License for the specific language governing permissions and
2079 * limitations under the License.
2080 */const ON=new Ot(Ae.comparator);function Vr(){return ON}const oT=new Ot(Ae.comparator);function Bo(...r){let e=oT;for(const i of r)e=e.insert(i.key,i);return e}function uT(r){let e=oT;return r.forEach(((i,s)=>e=e.insert(i,s.overlayedDocument))),e}function ua(){return Yo()}function cT(){return Yo()}function Yo(){return new ba((r=>r.toString()),((r,e)=>r.isEqual(e)))}const jN=new Ot(Ae.comparator),VN=new rn(Ae.comparator);function We(...r){let e=VN;for(const i of r)e=e.add(i);return e}const kN=new rn(Ze);function LN(){return kN}/**
2081 * @license
2082 * Copyright 2020 Google LLC
2083 *
2084 * Licensed under the Apache License, Version 2.0 (the "License");
2085 * you may not use this file except in compliance with the License.
2086 * You may obtain a copy of the License at
2087 *
2088 *   http://www.apache.org/licenses/LICENSE-2.0
2089 *
2090 * Unless required by applicable law or agreed to in writing, software
2091 * distributed under the License is distributed on an "AS IS" BASIS,
2092 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2093 * See the License for the specific language governing permissions and
2094 * limitations under the License.
2095 */function rg(r,e){if(r.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:dh(e)?"-0":e}}function hT(r){return{integerValue:""+r}}function UN(r,e){return uN(e)?hT(e):rg(r,e)}/**
2096 * @license
2097 * Copyright 2018 Google LLC
2098 *
2099 * Licensed under the Apache License, Version 2.0 (the "License");
2100 * you may not use this file except in compliance with the License.
2101 * You may obtain a copy of the License at
2102 *
2103 *   http://www.apache.org/licenses/LICENSE-2.0
2104 *
2105 * Unless required by applicable law or agreed to in writing, software
2106 * distributed under the License is distributed on an "AS IS" BASIS,
2107 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2108 * See the License for the specific language governing permissions and
2109 * limitations under the License.
2110 */class kh{constructor(){this._=void 0}}function PN(r,e,i){return r instanceof iu?(function(o,c){const f={fields:{[Qb]:{stringValue:Kb},[$b]:{timestampValue:{seconds:o.seconds,nanos:o.nanoseconds}}}};return c&&eg(c)&&(c=Mh(c)),c&&(f.fields[Yb]=c),{mapValue:f}})(i,e):r instanceof ru?fT(r,e):r instanceof su?mT(r,e):(function(o,c){const f=dT(o,c),y=r_(f)+r_(o.Ae);return Em(f)&&Em(o.Ae)?hT(y):rg(o.serializer,y)})(r,e)}function zN(r,e,i){return r instanceof ru?fT(r,e):r instanceof su?mT(r,e):i}function dT(r,e){return r instanceof yh?(function(s){return Em(s)||(function(c){return!!c&&"doubleValue"in c})(s)})(e)?e:{integerValue:0}:null}class iu extends kh{}class ru extends kh{constructor(e){super(),this.elements=e}}function fT(r,e){const i=gT(e);for(const s of r.elements)i.some((o=>ur(o,s)))||i.push(s);return{arrayValue:{values:i}}}class su extends kh{constructor(e){super(),this.elements=e}}function mT(r,e){let i=gT(e);for(const s of r.elements)i=i.filter((o=>!ur(o,s)));return{arrayValue:{values:i}}}class yh extends kh{constructor(e,i){super(),this.serializer=e,this.Ae=i}}function r_(r){return qt(r.integerValue||r.doubleValue)}function gT(r){return tg(r)&&r.arrayValue.values?r.arrayValue.values.slice():[]}/**
2111 * @license
2112 * Copyright 2017 Google LLC
2113 *
2114 * Licensed under the Apache License, Version 2.0 (the "License");
2115 * you may not use this file except in compliance with the License.
2116 * You may obtain a copy of the License at
2117 *
2118 *   http://www.apache.org/licenses/LICENSE-2.0
2119 *
2120 * Unless required by applicable law or agreed to in writing, software
2121 * distributed under the License is distributed on an "AS IS" BASIS,
2122 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2123 * See the License for the specific language governing permissions and
2124 * limitations under the License.
2125 */class BN{constructor(e,i){this.field=e,this.transform=i}}function HN(r,e){return r.field.isEqual(e.field)&&(function(s,o){return s instanceof ru&&o instanceof ru||s instanceof su&&o instanceof su?El(s.elements,o.elements,ur):s instanceof yh&&o instanceof yh?ur(s.Ae,o.Ae):s instanceof iu&&o instanceof iu})(r.transform,e.transform)}class qN{constructor(e,i){this.version=e,this.transformResults=i}}class xi{constructor(e,i){this.updateTime=e,this.exists=i}static none(){return new xi}static exists(e){return new xi(void 0,e)}static updateTime(e){return new xi(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 eh(r,e){return r.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(r.updateTime):r.exists===void 0||r.exists===e.isFoundDocument()}class Lh{}function pT(r,e){if(!r.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return r.isNoDocument()?new sg(r.key,xi.none()):new fu(r.key,r.data,xi.none());{const i=r.data,s=$n.empty();let o=new rn(Tn.comparator);for(let c of e.fields)if(!o.has(c)){let f=i.field(c);f===null&&c.length>1&&(c=c.popLast(),f=i.field(c)),f===null?s.delete(c):s.set(c,f),o=o.add(c)}return new js(r.key,s,new oi(o.toArray()),xi.none())}}function FN(r,e,i){r instanceof fu?(function(o,c,f){const y=o.value.clone(),_=a_(o.fieldTransforms,c,f.transformResults);y.setAll(_),c.convertToFoundDocument(f.version,y).setHasCommittedMutations()})(r,e,i):r instanceof js?(function(o,c,f){if(!eh(o.precondition,c))return void c.convertToUnknownDocument(f.version);const y=a_(o.fieldTransforms,c,f.transformResults),_=c.data;_.setAll(yT(o)),_.setAll(y),c.convertToFoundDocument(f.version,_).setHasCommittedMutations()})(r,e,i):(function(o,c,f){c.convertToNoDocument(f.version).setHasCommittedMutations()})(0,e,i)}function $o(r,e,i,s){return r instanceof fu?(function(c,f,y,_){if(!eh(c.precondition,f))return y;const p=c.value.clone(),T=l_(c.fieldTransforms,_,f);return p.setAll(T),f.convertToFoundDocument(f.version,p).setHasLocalMutations(),null})(r,e,i,s):r instanceof js?(function(c,f,y,_){if(!eh(c.precondition,f))return y;const p=l_(c.fieldTransforms,_,f),T=f.data;
2125return T.setAll(yT(c)),T.setAll(p),f.convertToFoundDocument(f.version,T).setHasLocalMutations(),y===null?null:y.unionWith(c.fieldMask.fields).unionWith(c.fieldTransforms.map((A=>A.field)))})(r,e,i,s):(function(c,f,y){return eh(c.precondition,f)?(f.convertToNoDocument(f.version).setHasLocalMutations(),null):y})(r,e,i)}function GN(r,e){let i=null;for(const s of r.fieldTransforms){const o=e.data.field(s.field),c=dT(s.transform,o||null);c!=null&&(i===null&&(i=$n.empty()),i.set(s.field,c))}return i||null}function s_(r,e){return r.type===e.type&&!!r.key.isEqual(e.key)&&!!r.precondition.isEqual(e.precondition)&&!!(function(s,o){return s===void 0&&o===void 0||!(!s||!o)&&El(s,o,((c,f)=>HN(c,f)))})(r.fieldTransforms,e.fieldTransforms)&&(r.type===0?r.value.isEqual(e.value):r.type!==1||r.data.isEqual(e.data)&&r.fieldMask.isEqual(e.fieldMask))}class fu extends Lh{constructor(e,i,s,o=[]){super(),this.key=e,this.value=i,this.precondition=s,this.fieldTransforms=o,this.type=0}getFieldMask(){return null}}class js extends Lh{constructor(e,i,s,o,c=[]){super(),this.key=e,this.data=i,this.fieldMask=s,this.precondition=o,this.fieldTransforms=c,this.type=1}getFieldMask(){return this.fieldMask}}function yT(r){const e=new Map;return r.fieldMask.fields.forEach((i=>{if(!i.isEmpty()){const s=r.data.field(i);e.set(i,s)}})),e}function a_(r,e,i){const s=new Map;ft(r.length===i.length,32656,{Ve:i.length,de:r.length});for(let o=0;o<i.length;o++){const c=r[o],f=c.transform,y=e.data.field(c.field);s.set(c.field,zN(f,y,i[o]))}return s}function l_(r,e,i){const s=new Map;for(const o of r){const c=o.transform,f=i.data.field(o.field);s.set(o.field,PN(c,f,e))}return s}class sg extends Lh{constructor(e,i){super(),this.key=e,this.precondition=i,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class KN extends Lh{constructor(e,i){super(),this.key=e,this.precondition=i,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}/**
2126 * @license
2127 * Copyright 2017 Google LLC
2128 *
2129 * Licensed under the Apache License, Version 2.0 (the "License");
2130 * you may not use this file except in compliance with the License.
2131 * You may obtain a copy of the License at
2132 *
2133 *   http://www.apache.org/licenses/LICENSE-2.0
2134 *
2135 * Unless required by applicable law or agreed to in writing, software
2136 * distributed under the License is distributed on an "AS IS" BASIS,
2137 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2138 * See the License for the specific language governing permissions and
2139 * limitations under the License.
2140 */class QN{constructor(e,i,s,o){this.batchId=e,this.localWriteTime=i,this.baseMutations=s,this.mutations=o}applyToRemoteDocument(e,i){const s=i.mutationResults;for(let o=0;o<this.mutations.length;o++){const c=this.mutations[o];c.key.isEqual(e.key)&&FN(c,e,s[o])}}applyToLocalView(e,i){for(const s of this.baseMutations)s.key.isEqual(e.key)&&(i=$o(s,e,i,this.localWriteTime));for(const s of this.mutations)s.key.isEqual(e.key)&&(i=$o(s,e,i,this.localWriteTime));return i}applyToLocalDocumentSet(e,i){const s=cT();return this.mutations.forEach((o=>{const c=e.get(o.key),f=c.overlayedDocument;let y=this.applyToLocalView(f,c.mutatedFields);y=i.has(o.key)?null:y;const _=pT(f,y);_!==null&&s.set(o.key,_),f.isValidDocument()||f.convertToNoDocument(Me.min())})),s}keys(){return this.mutations.reduce(((e,i)=>e.add(i.key)),We())}isEqual(e){return this.batchId===e.batchId&&El(this.mutations,e.mutations,((i,s)=>s_(i,s)))&&El(this.baseMutations,e.baseMutations,((i,s)=>s_(i,s)))}}class ag{constructor(e,i,s,o){this.batch=e,this.commitVersion=i,this.mutationResults=s,this.docVersions=o}static from(e,i,s){ft(e.mutations.length===s.length,58842,{me:e.mutations.length,fe:s.length});let o=(function(){return jN})();const c=e.mutations;for(let f=0;f<c.length;f++)o=o.insert(c[f].key,s[f].version);return new ag(e,i,s,o)}}/**
2141 * @license
2142 * Copyright 2022 Google LLC
2143 *
2144 * Licensed under the Apache License, Version 2.0 (the "License");
2145 * you may not use this file except in compliance with the License.
2146 * You may obtain a copy of the License at
2147 *
2148 *   http://www.apache.org/licenses/LICENSE-2.0
2149 *
2150 * Unless required by applicable law or agreed to in writing, softw
2150are
2151 * distributed under the License is distributed on an "AS IS" BASIS,
2152 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2153 * See the License for the specific language governing permissions and
2154 * limitations under the License.
2155 */class YN{constructor(e,i){this.largestBatchId=e,this.mutation=i}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{
2156      largestBatchId: ${this.largestBatchId},
2157      mutation: ${this.mutation.toString()}
2158    }`}}/**
2159 * @license
2160 * Copyright 2017 Google LLC
2161 *
2162 * Licensed under the Apache License, Version 2.0 (the "License");
2163 * you may not use this file except in compliance with the License.
2164 * You may obtain a copy of the License at
2165 *
2166 *   http://www.apache.org/licenses/LICENSE-2.0
2167 *
2168 * Unless required by applicable law or agreed to in writing, software
2169 * distributed under the License is distributed on an "AS IS" BASIS,
2170 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2171 * See the License for the specific language governing permissions and
2172 * limitations under the License.
2173 */class $N{constructor(e,i){this.count=e,this.unchangedNames=i}}/**
2174 * @license
2175 * Copyright 2017 Google LLC
2176 *
2177 * Licensed under the Apache License, Version 2.0 (the "License");
2178 * you may not use this file except in compliance with the License.
2179 * You may obtain a copy of the License at
2180 *
2181 *   http://www.apache.org/licenses/LICENSE-2.0
2182 *
2183 * Unless required by applicable law or agreed to in writing, software
2184 * distributed under the License is distributed on an "AS IS" BASIS,
2185 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2186 * See the License for the specific language governing permissions and
2187 * limitations under the License.
2188 */var Zt,it;function XN(r){switch(r){case Z.OK:return Ce(64938);case Z.CANCELLED:case Z.UNKNOWN:case Z.DEADLINE_EXCEEDED:case Z.RESOURCE_EXHAUSTED:case Z.INTERNAL:case Z.UNAVAILABLE:case Z.UNAUTHENTICATED:return!1;case Z.INVALID_ARGUMENT:case Z.NOT_FOUND:case Z.ALREADY_EXISTS:case Z.PERMISSION_DENIED:case Z.FAILED_PRECONDITION:case Z.ABORTED:case Z.OUT_OF_RANGE:case Z.UNIMPLEMENTED:case Z.DATA_LOSS:return!0;default:return Ce(15467,{code:r})}}function vT(r){if(r===void 0)return jr("GRPC error has no .code"),Z.UNKNOWN;switch(r){case Zt.OK:return Z.OK;case Zt.CANCELLED:return Z.CANCELLED;case Zt.UNKNOWN:return Z.UNKNOWN;case Zt.DEADLINE_EXCEEDED:return Z.DEADLINE_EXCEEDED;case Zt.RESOURCE_EXHAUSTED:return Z.RESOURCE_EXHAUSTED;case Zt.INTERNAL:return Z.INTERNAL;case Zt.UNAVAILABLE:return Z.UNAVAILABLE;case Zt.UNAUTHENTICATED:return Z.UNAUTHENTICATED;case Zt.INVALID_ARGUMENT:return Z.INVALID_ARGUMENT;case Zt.NOT_FOUND:return Z.NOT_FOUND;case Zt.ALREADY_EXISTS:return Z.ALREADY_EXISTS;case Zt.PERMISSION_DENIED:return Z.PERMISSION_DENIED;case Zt.FAILED_PRECONDITION:return Z.FAILED_PRECONDITION;case Zt.ABORTED:return Z.ABORTED;case Zt.OUT_OF_RANGE:return Z.OUT_OF_RANGE;case Zt.UNIMPLEMENTED:return Z.UNIMPLEMENTED;case Zt.DATA_LOSS:return Z.DATA_LOSS;default:return Ce(39323,{code:r})}}(it=Zt||(Zt={}))[it.OK=0]="OK",it[it.CANCELLED=1]="CANCELLED",it[it.UNKNOWN=2]="UNKNOWN",it[it.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",it[it.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",it[it.NOT_FOUND=5]="NOT_FOUND",it[it.ALREADY_EXISTS=6]="ALREADY_EXISTS",it[it.PERMISSION_DENIED=7]="PERMISSION_DENIED",it[it.UNAUTHENTICATED=16]="UNAUTHENTICATED",it[it.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",it[it.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",it[it.ABORTED=10]="ABORTED",it[it.OUT_OF_RANGE=11]="OUT_OF_RANGE",it[it.UNIMPLEMENTED=12]="UNIMPLEMENTED",it[it.INTERNAL=13]="INTERNAL",it[it.UNAVAILABLE=14]="UNAVAILABLE",it[it.DATA_LOSS=15]="DATA_LOSS";/**
2189 * @license
2190 * Copyright 2023 Google LLC
2191 *
2192 * Licensed under the Apache License, Version 2.0 (the "License");
2193 * you may not use this file except in compliance with the License.
2194 * You may obtain a copy of the License at
2195 *
2196 *   http://www.apache.org/licenses/LICENSE-2.0
2197 *
2198 * Unless required by applicable law or agreed to in writing, software
2199 * distributed under the License is distributed on an "AS IS" BASIS,
2200 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2201 * See the License for the specific language governing permissions and
2202 * limitations under the License.
2203 */function JN(){return new TextEncoder}/**
2204 * @license
2205 * Copyright 2022 Google LLC
2206 *
2207 * Licensed under the Apache License, Version 2.0 (the "License");
2208 * you may not use this file except in compliance with the License.
2209 * You may obtain a copy of the License at
2210 *
2211 *   http://www.apache.org/licenses/LICENSE-2.0
2212 *
2213 * Unless required by applicable law or agreed to in writing, software
2214 * distributed under the License is distributed on an "AS IS" BASIS,
2215 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2216 * See the License for the specific language governing permissions and
2217 * limitations under the License.
2218 */const ZN=new Ss([4294967295,4294967295],0);function o_(r){const e=JN().encode(r),i=new Ob;return i.update(e),new Uint8Array(i.digest())}function u_(r){const e=new DataView(r.buffer),i=e.getUint32(0,!0),s=e.getUint32(4,!0),o=e.getUint32(8,!0),c=e.getUint32(12,!0);return[new Ss([i,s],0),new Ss([o,c],0)]}class lg{constructor(e,i,s){if(this.bitmap=e,this.padding=i,this.hashCount=s,i<0||i>=8)throw new Ho(`Invalid padding: ${i}`);if(s<0)throw new Ho(`Invalid hash count: ${s}`);if(e.length>0&&this.hashCount===0)throw new Ho(`Invalid hash count: ${s}`);if(e.length===0&&i!==0)throw new Ho(`Invalid padding when bitmap length is 0: ${i}`);this.ge=8*e.length-i,this.pe=Ss.fromNumber(this.ge)}ye(e,i,s){let o=e.add(i.multiply(Ss.fromNumber(s)));return o.compare(ZN)===1&&(o=new Ss([o.getBits(0),o.getBits(1)],0)),o.modulo(this.pe).toNumber()}we(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(this.ge===0)return!1;const i=o_(e),[s,o]=u_(i);for(let c=0;c<this.hashCount;c++){const f=this.ye(s,o,c);if(!this.we(f))return!1}return!0}static create(e,i,s){const o=e%8==0?0:8-e%8,c=new Uint8Array(Math.ceil(e/8)),f=new lg(c,o,i);return s.forEach((y=>f.insert(y))),f}insert(e){if(this.ge===0)return;const i=o_(e),[s,o]=u_(i);for(let c=0;c<this.hashCount;c++){const f=this.ye(s,o,c);this.be(f)}}be(e){const i=Math.floor(e/8),s=e%8;this.bitmap[i]|=1<<s}}class Ho extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}/**
2219 * @license
2220 * Copyright 2017 Google LLC
2221 *
2222 * Licensed under the Apache License, Version 2.0 (the "License");
2223 * you may not use this file except in compliance with the License.
2224 * You may obtain a copy of the License at
2225 *
2226 *   http://www.apache.org/licenses/LICENSE-2.0
2227 *
2228 * Unless required by applicable law or agreed to in writing, software
2229 * distributed under the License is distributed on an "AS IS" BASIS,
2230 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2231 * See the License for the specific language governing permissions and
2232 * limitations under the License.
2233 */class Uh{constructor(e,i,s,o,c){this.snapshotVersion=e,this.targetChanges=i,this.targetMismatches=s,this.documentUpdates=o,this.resolvedLimboDocuments=c}static createSynthesizedRemoteEventForCurrentChange(e,i,s){const o=new Map;return o.set(e,mu.createSynthesizedTargetChangeForCurrentChange(e,i,s)),new Uh(Me.min(),o,new Ot(Ze),Vr(),We())}}class mu{constructor(e,i,s,o,c){this.resumeToken=e,this.current=i,this.addedDocuments=s,this.modifiedDocuments=o,this.removedDocuments=c}static createSynthesizedTargetChangeForCurrentChange(e,i,s){return new mu(s,i,We(),We(),We())}}/**
2234 * @license
2235 * Copyright 2017 Google LLC
2236 *
2237 * Licensed under the Apache License, Version 2.0 (the "License");
2238 * you may not use this file except in compliance with the License.
2239 * You may obtain a copy of the License at
2240 *
2241 *   http://www.apache.org/licenses/LICENSE-2.0
2242 *
2243 * Unless required by applicable law or agreed to in writing, software
2244 * distributed under the License is distributed on an "AS IS" BASIS,
2245 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2246 * See the License for the specific language governing permissions and
2247 * limitations under the License.
2248 */class th{constructor(e,i,s,o){this.Se=e,this.removedTargetIds=i,this.key=s,this.De=o}}class _T{constructor(e,i){this.targetId=e,this.Ce=i}}class bT{constructor(e,i,s=En.EMPTY_BYTE_STRING,o=null){this.state=e,this.targetIds=i,this.resumeToken=s,this.cause=o}}class c_{constructor(){this.ve=0,this.Fe=h_(),this.Me=En.EMPTY_BYTE_STRING,this.xe=!1,this.Oe=!0}get current(){return this.xe}get resumeToken(){return this.Me}get Ne(){return this.ve!==0}get Be(){return this.Oe}Le(e){e.approximateByteSize()>0&&(this.Oe=!0,this.Me=e)}ke(){let e=We(),i=We(),s=We();return this.Fe.forEach(((o,c)=>{switch(c){case 0:e=e.add(o);break;case 2:i=i.add(o);break;case 1:s=s.add(o);break;default:Ce(38017,{changeType:c})}})),new mu(this.Me,this.xe,e,i,s)}Ke(){this.Oe=!1,this.Fe=h_()}qe(e,i){this.Oe=!0,this.Fe=this.Fe.insert(e,i)}Ue(e){this.Oe=!0,this.Fe=this.Fe.remove(e)}$e(){this.ve+=1}We(){this.ve-=1,ft(this.ve>=0,3241,{ve:this.ve})}Qe(){this.Oe=!0,this.xe=!0}}class WN{constructor(e){this.Ge=e,this.ze=new Map,this.je=Vr(),this.He=Fc(),this.Je=Fc(),this.Ze=new Ot(Ze)}Xe(e){for(const i of e.Se)e.De&&e.De.isFoundDocument()?this.Ye(i,e.De):this.et(i,e.key,e.De);for(const i of e.removedTargetIds)this.et(i,e.key,e.De)}tt(e){this.forEachTarget(e,(i=>{const s=this.nt(i);switch(e.state){case 0:this.rt(i)&&s.Le(e.resumeToken);break;case 1:s.We(),s.Ne||s.Ke(),s.Le(e.resumeToken);break;case 2:s.We(),s.Ne||this.removeTarget(i);break;case 3:this.rt(i)&&(s.Qe(),s.Le(e.resumeToken));break;case 4:this.rt(i)&&(this.it(i),s.Le(e.resumeToken));break;default:Ce(56790,{state:e.state})}}))}forEachTarget(e,i){e.targetIds.length>0?e.targetIds.forEach(i):this.ze.forEach(((s,o)=>
2248{this.rt(o)&&i(o)}))}st(e){const i=e.targetId,s=e.Ce.count,o=this.ot(i);if(o){const c=o.target;if(Am(c))if(s===0){const f=new Ae(c.path);this.et(i,f,Cn.newNoDocument(f,Me.min()))}else ft(s===1,20013,{expectedCount:s});else{const f=this._t(i);if(f!==s){const y=this.ut(e),_=y?this.ct(y,e,f):1;if(_!==0){this.it(i);const p=_===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ze=this.Ze.insert(i,p)}}}}}ut(e){const i=e.Ce.unchangedNames;if(!i||!i.bits)return null;const{bits:{bitmap:s="",padding:o=0},hashCount:c=0}=i;let f,y;try{f=Rs(s).toUint8Array()}catch(_){if(_ instanceof Gb)return ya("Decoding the base64 bloom filter in existence filter failed ("+_.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw _}try{y=new lg(f,o,c)}catch(_){return ya(_ instanceof Ho?"BloomFilter error: ":"Applying bloom filter failed: ",_),null}return y.ge===0?null:y}ct(e,i,s){return i.Ce.count===s-this.Pt(e,i.targetId)?0:2}Pt(e,i){const s=this.Ge.getRemoteKeysForTarget(i);let o=0;return s.forEach((c=>{const f=this.Ge.ht(),y=`projects/${f.projectId}/databases/${f.database}/documents/${c.path.canonicalString()}`;e.mightContain(y)||(this.et(i,c,null),o++)})),o}Tt(e){const i=new Map;this.ze.forEach(((c,f)=>{const y=this.ot(f);if(y){if(c.current&&Am(y.target)){const _=new Ae(y.target.path);this.It(_).has(f)||this.Et(f,_)||this.et(f,_,Cn.newNoDocument(_,e))}c.Be&&(i.set(f,c.ke()),c.Ke())}}));let s=We();this.Je.forEach(((c,f)=>{let y=!0;f.forEachWhile((_=>{const p=this.ot(_);return!p||p.purpose==="TargetPurposeLimboResolution"||(y=!1,!1)})),y&&(s=s.add(c))})),this.je.forEach(((c,f)=>f.setReadTime(e)));const o=new Uh(e,i,this.Ze,this.je,s);return this.je=Vr(),this.He=Fc(),this.Je=Fc(),this.Ze=new Ot(Ze),o}Ye(e,i){if(!this.rt(e))return;const s=this.Et(e,i.key)?2:0;this.nt(e).qe(i.key,s),this.je=this.je.insert(i.key,i),this.He=this.He.insert(i.key,this.It(i.key).add(e)),this.Je=this.Je.insert(i.key,this.Rt(i.key).add(e))}et(e,i,s){if(!this.rt(e))return;const o=this.nt(e);this.Et(e,i)?o.qe(i,1):o.Ue(i),this.Je=this.Je.insert(i,this.Rt(i).delete(e)),this.Je=this.Je.insert(i,this.Rt(i).add(e)),s&&(this.je=this.je.insert(i,s))}removeTarget(e){this.ze.delete(e)}_t(e){const i=this.nt(e).ke();return this.Ge.getRemoteKeysForTarget(e).size+i.addedDocuments.size-i.removedDocuments.size}$e(e){this.nt(e).$e()}nt(e){let i=this.ze.get(e);return i||(i=new c_,this.ze.set(e,i)),i}Rt(e){let i=this.Je.get(e);return i||(i=new rn(Ze),this.Je=this.Je.insert(e,i)),i}It(e){let i=this.He.get(e);return i||(i=new rn(Ze),this.He=this.He.insert(e,i)),i}rt(e){const i=this.ot(e)!==null;return i||de("WatchChangeAggregator","Detected inactive target",e),i}ot(e){const i=this.ze.get(e);return i&&i.Ne?null:this.Ge.At(e)}it(e){this.ze.set(e,new c_),this.Ge.getRemoteKeysForTarget(e).forEach((i=>{this.et(e,i,null)}))}Et(e,i){return this.Ge.getRemoteKeysForTarget(e).has(i)}}function Fc(){return new Ot(Ae.comparator)}function h_(){return new Ot(Ae.comparator)}const e2={asc:"ASCENDING",desc:"DESCENDING"},t2={"<":"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"},n2={and:"AND",or:"OR"};class i2{constructor(e,i){this.databaseId=e,this.useProto3Json=i}}function Nm(r,e){return r.useProto3Json||Dh(e)?e:{value:e}}function vh(r,e){return r.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function TT(r,e){return r.useProto3Json?e.toBase64():e.toUint8Array()}function r2(r,e){return vh(r,e.toTimestamp())}function ar(r){return ft(!!r,49232),Me.fromTimestamp((function(i){const s=Is(i);return new dt(s.seconds,s.nanos)})(r))}function og(r,e){return Im(r,e).canonicalString()}function Im(r,e){const i=(function(o){return new St(["projects",o.projectId,"databases",o.database])})(r).child("documents");return e===void 0?i:i.child(e)}function ET(r){const e=St.fromString(r);return ft(NT(e),10190,{key:e.toString()}),e}function Rm(r,e){return og(r.databaseId,e.path)}function lm(r,e){const i=ET(e);if(i.get(1)!==r.databaseId.projectId)throw new ce(Z.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+i.get(1)+" vs "+r.databaseId.projectId);if(i.get(3)!==r.databaseId.database)throw new ce(Z.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+i.get(3)+" vs "+r.databaseId.database);return new Ae(AT(i))}function xT(r,e){return og(r.databaseId,e)}function s2(r){const e=ET(r);return e.length===4?St.emptyPath():AT(e)}function Cm(r){return new St(["projects",r.databaseId.projectId,"databases",r.databaseId.database]).canonicalString()}function AT(r){return ft(r.length>4&&r.get(4)==="documents",29091,{key:r.toString()}),r.popFirst(5)}function d_(r,e,i){return{name:Rm(r,e),fields:i.value.mapValue.fields}}function a2(r,e){let i;if("targetChange"in e){e.targetChange;const s=(function(p){return p==="NO_CHANGE"?0:p==="ADD"?1:p==="REMOVE"?2:p==="CURRENT"?3:p==="RESET"?4:Ce(39313,{state:p})})(e.targetChange.targetChangeType||"NO_CHANGE"),o=e.targetChange.targetIds||[],c=(function(p,T){return p.useProto3Json?(ft(T===void 0||typeof T=="string",58123),En.fromBase64String(T||"")):(ft(T===void 0||T instanceof Buffer||T instanceof Uint8Array,16193),En.fromUint8Array(T||new Uint8Array))})(r,e.targetChange.resumeToken),f=e.targetChange.cause,y=f&&(function(p){const T=p.code===void 0?Z.UNKNOWN:vT(p.code);return new ce(T,p.message||"")})(f);i=new bT(s,o,c,y||null)}else if("documentChange"in e){e.documentChange;const s=e.documentChange;s.document,s.document.name,s.document.updateTime;const o=lm(r,s.document.name),c=ar(s.document.updateTime),f=s.document.createTime?ar(s.document.createTime):Me.min(),y=new $n({mapValue:{fields:s.document.fields}}),_=Cn.newFoundDocument(o,c,f,y),p=s.targetIds||[],T=s.removedTargetIds||[];i=new th(p,T,_.key,_)}else if("documentDelete"in e){e.documentDelete;const s=e.documentDelete;s.document;const o=lm(r,s.document),c=s.readTime?ar(s.readTime):Me.min(),f=Cn.newNoDocument(o,c),y=s.removedTargetIds||[];i=new th([],y,f.key,f)}else if("documentRemove"in e){e.documentRemove;const s=e.documentRemove;s.document;const o=lm(r,s.document),c=s.removedTargetIds||[];i=new th([],c,o,null)}else{if(!("filter"in e))return Ce(11601,{Vt:e});{e.filter;const s=e.filter;s.targetId;const{count:o=0,unchangedNames:c}=s,f=new $N(o,c),y=s.targetId;i=new _T(y,f)}}return i}function l2(r,e){let i;if(e instanceof fu)i={update:d_(r,e.key,e.value)};else if(e instanceof sg)i={delete:Rm(r,e.key)};else if(e instanceof js)i={update:d_(r,e.key,e.data),updateMask:p2(e.fieldMask)};else{if(!(e instanceof KN))return Ce(16599,{dt:e.type});i={verify:Rm(r,e.key)}}return e.fieldTransforms.length>0&&(i.updateTransforms=e.fieldTransforms.map((s=>(function(c,f){const y=f.transform;if(y instanceof iu)return{fieldPath:f.field.canonicalString(),setToServerValue:"REQUEST_TIME"};
2248if(y instanceof ru)return{fieldPath:f.field.canonicalString(),appendMissingElements:{values:y.elements}};if(y instanceof su)return{fieldPath:f.field.canonicalString(),removeAllFromArray:{values:y.elements}};if(y instanceof yh)return{fieldPath:f.field.canonicalString(),increment:y.Ae};throw Ce(20930,{transform:f.transform})})(0,s)))),e.precondition.isNone||(i.currentDocument=(function(o,c){return c.updateTime!==void 0?{updateTime:r2(o,c.updateTime)}:c.exists!==void 0?{exists:c.exists}:Ce(27497)})(r,e.precondition)),i}function o2(r,e){return r&&r.length>0?(ft(e!==void 0,14353),r.map((i=>(function(o,c){let f=o.updateTime?ar(o.updateTime):ar(c);return f.isEqual(Me.min())&&(f=ar(c)),new qN(f,o.transformResults||[])})(i,e)))):[]}function u2(r,e){return{documents:[xT(r,e.path)]}}function c2(r,e){const i={structuredQuery:{}},s=e.path;let o;e.collectionGroup!==null?(o=s,i.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(o=s.popLast(),i.structuredQuery.from=[{collectionId:s.lastSegment()}]),i.parent=xT(r,o);const c=(function(p){if(p.length!==0)return wT(Pi.create(p,"and"))})(e.filters);c&&(i.structuredQuery.where=c);const f=(function(p){if(p.length!==0)return p.map((T=>(function(S){return{field:fl(S.field),direction:f2(S.dir)}})(T)))})(e.orderBy);f&&(i.structuredQuery.orderBy=f);const y=Nm(r,e.limit);return y!==null&&(i.structuredQuery.limit=y),e.startAt&&(i.structuredQuery.startAt=(function(p){return{before:p.inclusive,values:p.position}})(e.startAt)),e.endAt&&(i.structuredQuery.endAt=(function(p){return{before:!p.inclusive,values:p.position}})(e.endAt)),{ft:i,parent:o}}function h2(r){let e=s2(r.parent);const i=r.structuredQuery,s=i.from?i.from.length:0;let o=null;if(s>0){ft(s===1,65062);const T=i.from[0];T.allDescendants?o=T.collectionId:e=e.child(T.collectionId)}let c=[];i.where&&(c=(function(A){const S=ST(A);
2248return S instanceof Pi&&tT(S)?S.getFilters():[S]})(i.where));let f=[];i.orderBy&&(f=(function(A){return A.map((S=>(function(Q){return new ph(ml(Q.field),(function(X){switch(X){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}})(Q.direction))})(S)))})(i.orderBy));let y=null;i.limit&&(y=(function(A){let S;return S=typeof A=="object"?A.value:A,Dh(S)?null:S})(i.limit));let _=null;i.startAt&&(_=(function(A){const S=!!A.before,z=A.values||[];return new gh(z,S)})(i.startAt));let p=null;return i.endAt&&(p=(function(A){const S=!A.before,z=A.values||[];return new gh(z,S)})(i.endAt)),IN(e,o,f,c,y,"F",_,p)}function d2(r,e){const i=(function(o){switch(o){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return Ce(28987,{purpose:o})}})(e.purpose);return i==null?null:{"goog-listen-tags":i}}function ST(r){return r.unaryFilter!==void 0?(function(i){switch(i.unaryFilter.op){case"IS_NAN":const s=ml(i.unaryFilter.field);return Wt.create(s,"==",{doubleValue:NaN});case"IS_NULL":const o=ml(i.unaryFilter.field);return Wt.create(o,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const c=ml(i.unaryFilter.field);return Wt.create(c,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const f=ml(i.unaryFilter.field);return Wt.create(f,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return Ce(61313);default:return Ce(60726)}})(r):r.fieldFilter!==void 0?(function(i){return Wt.create(ml(i.fieldFilter.field),(function(o){switch(o){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 Ce(58110);default:return Ce(50506)}})(i.fieldFilter.op),i.fieldFilter.value)})(r):r.compositeFilter!==void 0?(function(i){return Pi.create(i.compositeFilter.filters.map((s=>ST(s))),(function(o){switch(o){case"AND":return"and";case"OR":return"or";default:return Ce(1026)}})(i.compositeFilter.op))})(r):Ce(30097,{filter:r})}function f2(r){return e2[r]}function m2(r){return t2[r]}function g2(r){return n2[r]}function fl(r){return{fieldPath:r.canonicalString()}}function ml(r){return Tn.fromServerFormat(r.fieldPath)}function wT(r){return r instanceof Wt?(function(i){if(i.op==="=="){if(Wv(i.value))return{unaryFilter:{field:fl(i.field),op:"IS_NAN"}};if(Zv(i.value))return{unaryFilter:{field:fl(i.field),op:"IS_NULL"}}}else if(i.op==="!="){if(Wv(i.value))return{unaryFilter:{field:fl(i.field),op:"IS_NOT_NAN"}};if(Zv(i.value))return{unaryFilter:{field:fl(i.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:fl(i.field),op:m2(i.op),value:i.value}}})(r):r instanceof Pi?(function(i){const s=i.getFilters().map((o=>wT(o)));return s.length===1?s[0]:{compositeFilter:{op:g2(i.op),filters:s}}})(r):Ce(54877,{filter:r})}function p2(r){const e=[];return r.fields.forEach((i=>e.push(i.canonicalString()))),{fieldPaths:e}}function NT(r){return r.length>=4&&r.get(0)==="projects"&&r.get(2)==="databases"}function IT(r){return!!r&&typeof r._toProto=="function"&&r._protoValueType==="ProtoValue"}/**
2249 * @license
2250 * Copyright 2017 Google LLC
2251 *
2252 * Licensed under the Apache License, Version 2.0 (the "License");
2253 * you may not use this file except in compliance with the License.
2254 * You may obtain a copy of the License at
2255 *
2256 *   http://www.apache.org/licenses/LICENSE-2.0
2257 *
2258 * Unless required by applicable law or agreed to in writing, software
2259 * distributed under the License is distributed on an "AS IS" BASIS,
2260 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2261 * See the License for the specific language governing permissions and
2262 * limitations under the License.
2263 */class Ts{constructor(e,i,s,o,c=Me.min(),f=Me.min(),y=En.EMPTY_BYTE_STRING,_=null){this.target=e,this.targetId=i,this.purpose=s,this.sequenceNumber=o,this.snapshotVersion=c,this.lastLimboFreeSnapshotVersion=f,this.resumeToken=y,this.expectedCount=_}withSequenceNumber(e){return new Ts(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,i){return new Ts(this.target,this.targetId,this.purpose,this.sequenceNumber,i,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Ts(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Ts(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/**
2264 * @license
2265 * Copyright 2017 Google LLC
2266 *
2267 * Licensed under the Apache License, Version 2.0 (the "License");
2268 * you may not use this file except in compliance with the License.
2269 * You may obtain a copy of the License at
2270 *
2271 *   http://www.apache.org/licenses/LICENSE-2.0
2272 *
2273 * Unless required by applicable law or agreed to in writing, software
2274 * distributed under the License is distributed on an "AS IS" BASIS,
2275 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2276 * See the License for the specific language governing permissions and
2277 * limitations under the License.
2278 */class y2{constructor(e){this.yt=e}}function v2(r){const e=h2({parent:r.parent,structuredQuery:r.structuredQuery});return r.limitType==="LAST"?wm(e,e.limit,"L"):e}/**
2279 * @license
2280 * Copyright 2019 Google LLC
2281 *
2282 * Licensed under the Apache License, Version 2.0 (the "License");
2283 * you may not use this file except in compliance with the License.
2284 * You may obtain a copy of the License at
2285 *
2286 *   http://www.apache.org/licenses/LICENSE-2.0
2287 *
2288 * Unless required by applicable law or agreed to in writing, software
2289 * distributed under the License is distributed on an "AS IS" BASIS,
2290 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2291 * See the License for the specific language governing permissions and
2292 * limitations under the License.
2293 */class _2{constructor(){this.Sn=new b2}addToCollectionParentIndex(e,i){return this.Sn.add(i),W.resolve()}getCollectionParents(e,i){return W.resolve(this.Sn.getEntries(i))}addFieldIndex(e,i){return W.resolve()}deleteFieldIndex(e,i){return W.resolve()}deleteAllFieldIndexes(e){return W.resolve()}createTargetIndexes(e,i){return W.resolve()}getDocumentsMatchingTarget(e,i){return W.resolve(null)}getIndexType(e,i){return W.resolve(0)}getFieldIndexes(e,i){return W.resolve([])}getNextCollectionGroupToUpdate(e){return W.resolve(null)}getMinOffset(e,i){return W.resolve(Ns.min())}getMinOffsetFromCollectionGroup(e,i){return W.resolve(Ns.min())}updateCollectionGroup(e,i,s){return W.resolve()}updateIndexEntries(e,i){return W.resolve()}}class b2{constructor(){this.index={}}add(e){const i=e.lastSegment(),s=e.popLast(),o=this.index[i]||new rn(St.comparator),c=!o.has(s);return this.index[i]=o.add(s),c}has(e){const i=e.lastSegment(),s=e.popLast(),o=this.index[i];return o&&o.has(s)}getEntries(e){return(this.index[e]||new rn(St.comparator)).toArray()}}/**
2294 * @license
2295 * Copyright 2018 Google LLC
2296 *
2297 * Licensed under the Apache License, Version 2.0 (the "License");
2298 * you may not use this file except in compliance with the License.
2299 * You may obtain a copy of the License at
2300 *
2301 *   http://www.apache.org/licenses/LICENSE-2.0
2302 *
2303 * Unless required by applicable law or agreed to in writing, software
2304 * distributed under the License is distributed on an "AS IS" BASIS,
2305 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2306 * See the License for the specific language governing permissions and
2307 * limitations under the License.
2308 */const f_={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},RT=41943040;class Yn{static withCacheSize(e){return new Yn(e,Yn.DEFAULT_COLLECTION_PERCENTILE,Yn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,i,s){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=i,this.maximumSequenceNumbersToCollect=s}}/**
2309 * @license
2310 * Copyright 2017 Google LLC
2311 *
2312 * Licensed under the Apache License, Version 2.0 (the "License");
2313 * you may not use this file except in compliance with the License.
2314 * You may obtain a copy of the License at
2315 *
2316 *   http://www.apache.org/licenses/LICENSE-2.0
2317 *
2318 * Unless required by applicable law or agreed to in writing, software
2319 * distributed under the License is distributed on an "AS IS" BASIS,
2320 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2321 * See the License for the specific language governing permissions and
2322 * limitations under the License.
2323 */Yn.DEFAULT_COLLECTION_PERCENTILE=10,Yn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Yn.DEFAULT=new Yn(RT,Yn.DEFAULT_COLLECTION_PERCENTILE,Yn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Yn.DISABLED=new Yn(-1,0,0);/**
2324 * @license
2325 * Copyright 2017 Google LLC
2326 *
2327 * Licensed under the Apache License, Version 2.0 (the "License");
2328 * you may not use this file except in compliance with the License.
2329 * You may obtain a copy of the License at
2330 *
2331 *   http://www.apache.org/licenses/LICENSE-2.0
2332 *
2333 * Unless required by applicable law or agreed to in writing, software
2334 * distributed under the License is distributed on an "AS IS" BASIS,
2335 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2336 * See the License for the specific language governing permissions and
2337 * limitations under the License.
2338 */class Sl{constructor(e){this.sr=e}next(){return this.sr+=2,this.sr}static _r(){return new Sl(0)}static ar(){return new Sl(-1)}}/**
2339 * @license
2340 * Copyright 2020 Google LLC
2341 *
2342 * Licensed under the Apache License, Version 2.0 (the "License");
2343 * you may not use this file except in compliance with the License.
2344 * You may obtain a copy of the License at
2345 *
2346 *   http://www.apache.org/licenses/LICENSE-2.0
2347 *
2348 * Unless required by applicable law or agreed to in writing, software
2349 * distributed under the License is distributed on an "AS IS" BASIS,
2350 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2351 * See the License for the specific language governing permissions and
2352 * limitations under the License.
2353 */const m_="LruGarbageCollector",T2=1048576;function g_([r,e],[i,s]){const o=Ze(r,i);return o===0?Ze(e,s):o}class E2{constructor(e){this.Pr=e,this.buffer=new rn(g_),this.Tr=0}Ir(){return++this.Tr}Er(e){const i=[e,this.Ir()];if(this.buffer.size<this.Pr)this.buffer=this.buffer.add(i);else{const s=this.buffer.last();g_(i,s)<0&&(this.buffer=this.buffer.delete(s).add(i))}}get maxValue(){return this.buffer.last()[0]}}class x2{constructor(e,i,s){this.garbageCollector=e,this.asyncQueue=i,this.localStore=s,this.Rr=null}start(){this.garbageCollector.params.cacheSizeCollectionThreshold!==-1&&this.Ar(6e4)}stop(){this.Rr&&(this.Rr.cancel(),this.Rr=null)}get started(){return this.Rr!==null}Ar(e){de(m_,`Garbage collection scheduled in ${e}ms`),this.Rr=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,(async()=>{this.Rr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(i){jl(i)?de(m_,"Ignoring IndexedDB error during garbage collection: ",i):await Ol(i)}await this.Ar(3e5)}))}}class A2{constructor(e,i){this.Vr=e,this.params=i}calculateTargetCount(e,i){return this.Vr.dr(e).next((s=>Math.floor(i/100*s)))}nthSequenceNumber(e,i){if(i===0)return W.resolve(Ch.ce);const s=new E2(i);return this.Vr.forEachTarget(e,(o=>s.Er(o.sequenceNumber))).next((()=>this.Vr.mr(e,(o=>s.Er(o))))).next((()=>s.maxValue))}removeTargets(e,i,s){return this.Vr.removeTargets(e,i,s)}removeOrphanedDocuments(e,i){return this.Vr.removeOrphanedDocuments(e,i)}collect(e,i){return this.params.cacheSizeCollectionThreshold===-1?(de("LruGarbageCollector","Garbage collection skipped; disabled"),W.resolve(f_)):this.getCacheSize(e).next((s=>s<this.params.cacheSizeCollectionThreshold?(de("LruGarbageCollector",`Garbage collection skipped; Cache size ${s} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),f_):this.gr(e,i)))}getCacheSize(e){return this.Vr.getCacheSize(e)}gr(e,i){let s,o,c,f,y,_,p;const T=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next((A=>(A>this.params.maximumSequenceNumbersToCollect?(de("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${A}`),o=this.params.maximumSequenceNumbersToCollect):o=A,f=Date.now(),this.nthSequenceNumber(e,o)))).next((A=>(s=A,y=Date.now(),this.removeTargets(e,s,i)))).next((A=>(c=A,_=Date.now(),this.removeOrphanedDocuments(e,s)))).next((A=>(p=Date.now(),hl()<=Je.DEBUG&&de("LruGarbageCollector",`LRU Garbage Collection
2354	Counted targets in ${f-T}ms
2355	Determined least recently used ${o} in `+(y-f)+`ms
2356	Removed ${c} targets in `+(_-y)+`ms
2357	Removed ${A} documents in `+(p-_)+`ms
2358Total Duration: ${p-T}ms`),W.resolve({didRun:!0,sequenceNumbersCollected:o,targetsRemoved:c,documentsRemoved:A}))))}}function S2(r,e){return new A2(r,e)}/**
2359 * @license
2360 * Copyright 2017 Google LLC
2361 *
2362 * Licensed under the Apache License, Version 2.0 (the "License");
2363 * you may not use this file except in compliance with the License.
2364 * You may obtain a copy of the License at
2365 *
2366 *   http://www.apache.org/licenses/LICENSE-2.0
2367 *
2368 * Unless required by applicable law or agreed to in writing, software
2369 * distributed under the License is distributed on an "AS IS" BASIS,
2370 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2371 * See the License for the specific language governing permissions and
2372 * limitations under the License.
2373 */class w2{constructor(){this.changes=new ba((e=>e.toString()),((e,i)=>e.isEqual(i))),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,i){this.assertNotApplied(),this.changes.set(e,Cn.newInvalidDocument(e).setReadTime(i))}getEntry(e,i){this.assertNotApplied();const s=this.changes.get(i);return s!==void 0?W.resolve(s):this.getFromCache(e,i)}getEntries(e,i){return this.getAllFromCache(e,i)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/**
2374 * @license
2375 * Copyright 2017 Google LLC
2376 *
2377 * Licensed under the Apache License, Version 2.0 (the "License");
2378 * you may not use this file except in compliance with the License.
2379 * You may obtain a copy of the License at
2380 *
2381 *   http://www.apache.org/licenses/LICENSE-2.0
2382 *
2383 * Unless required by applicable law or agreed to in writing, software
2384 * distributed under the License is distributed on an "AS IS" BASIS,
2385 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2386 * See the License for the specific language governing permissions and
2387 * limitations under the License.
2388 *//**
2389 * @license
2390 * Copyright 2022 Google LLC
2391 *
2392 * Licensed under the Apache License, Version 2.0 (the "License");
2393 * you may not use this file except in compliance with the License.
2394 * You may obtain a copy of the License at
2395 *
2396 *   http://www.apache.org/licenses/LICENSE-2.0
2397 *
2398 * Unless required by applicable law or agreed to in writing, software
2399 * distributed under the License is distributed on an "AS IS" BASIS,
2400 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2401 * See the License for the specific language governing permissions and
2402 * limitations under the License.
2403 */class N2{constructor(e,i){this.overlayedDocument=e,this.mutatedFields=i}}/**
2404 * @license
2405 * Copyright 2017 Google LLC
2406 *
2407 * Licensed under the Apache License, Version 2.0 (the "License");
2408 * you may not use this file except in compliance with the License.
2409 * You may obtain a copy of the License at
2410 *
2411 *   http://www.apache.org/licenses/LICENSE-2.0
2412 *
2413 * Unless required by applicable law or agreed to in writing, software
2414 * distributed under the License is distributed on an "AS IS" BASIS,
2415 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2416 * See the License for the specific language governing permissions and
2417 * limitations under the License.
2418 */class I2{constructor(e,i,s,o){this.remoteDocumentCache=e,this.mutationQueue=i,this.documentOverlayCache=s,this.indexManager=o}getDocument(e,i){let s=null;return this.documentOverlayCache.getOverlay(e,i).next((o=>(s=o,this.remoteDocumentCache.getEntry(e,i)))).next((o=>(s!==null&&$o(s.mutation,o,oi.empty(),dt.now()),o)))}getDocuments(e,i){return this.remoteDocumentCache.getEntries(e,i).next((s=>this.getLocalViewOfDocuments(e,s,We()).next((()=>s))))}getLocalViewOfDocuments(e,i,s=We()){const o=ua();return this.populateOverlays(e,o,i).next((()=>this.computeViews(e,i,o,s).next((c=>{let f=Bo();return c.forEach(((y,_)=>{f=f.insert(y,_.overlayedDocument)})),f}))))}getOverlayedDocuments(e,i){const s=ua();return this.populateOverlays(e,s,i).next((()=>this.computeViews(e,i,s,We())))}populateOverlays(e,i,s){const o=[];return s.forEach((c=>{i.has(c)||o.push(c)})),this.documentOverlayCache.getOverlays(e,o).next((c=>{c.forEach(((f,y)=>{i.set(f,y)}))}))}computeViews(e,i,s,o){let c=Vr();const f=Yo(),y=(function(){return Yo()})();return i.forEach(((_,p)=>{const T=s.get(p.key);o.has(p.key)&&(T===void 0||T.mutation instanceof js)?c=c.insert(p.key,p):T!==void 0?(f.set(p.key,T.mutation.getFieldMask()),$o(T.mutation,p,T.mutation.getFieldMask(),dt.now())):f.set(p.key,oi.empty())})),this.recalculateAndSaveOverlays(e,c).next((_=>(_.forEach(((p,T)=>
vendor: 2,439 bytes, line 2418
2418f.set(p,T))),i.forEach(((p,T)=>y.set(p,new N2(T,f.get(p)??null)))),y)))}recalculateAndSaveOverlays(e,i){const s=Yo();let o=new Ot(((f,y)=>f-y)),c=We();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,i).next((f=>{for(const y of f)y.keys().forEach((_=>{const p=i.get(_);if(p===null)return;let T=s.get(_)||oi.empty();T=y.applyToLocalView(p,T),s.set(_,T);const A=(o.get(y.batchId)||We()).add(_);o=o.insert(y.batchId,A)}))})).next((()=>{const f=[],y=o.getReverseIterator();for(;y.hasNext();){const _=y.getNext(),p=_.key,T=_.value,A=cT();T.forEach((S=>{if(!c.has(S)){const z=pT(i.get(S),s.get(S));z!==null&&A.set(S,z),c=c.add(S)}})),f.push(this.documentOverlayCache.saveOverlays(e,p,A))}return W.waitFor(f)})).next((()=>s))}recalculateAndSaveOverlaysForDocumentKeys(e,i){return this.remoteDocumentCache.getEntries(e,i).next((s=>this.recalculateAndSaveOverlays(e,s)))}getDocumentsMatchingQuery(e,i,s,o){return RN(i)?this.getDocumentsMatchingDocumentQuery(e,i.path):sT(i)?this.getDocumentsMatchingCollectionGroupQuery(e,i,s,o):this.getDocumentsMatchingCollectionQuery(e,i,s,o)}getNextDocuments(e,i,s,o){return this.remoteDocumentCache.getAllFromCollectionGroup(e,i,s,o).next((c=>{const f=o-c.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,i,s.largestBatchId,o-c.size):W.resolve(ua());let y=Wo,_=c;return f.next((p=>W.forEach(p,((T,A)=>(y<A.largestBatchId&&(y=A.largestBatchId),c.get(T)?W.resolve():this.remoteDocumentCache.getEntry(e,T).next((S=>{_=_.insert(T,S)}))))).next((()=>this.populateOverlays(e,p,c))).next((()=>this.computeViews(e,_,p,We()))).next((T=>({batchId:y,changes:uT(T)})))))}))}getDocumentsMatchingDocumentQuery(e,i){return this.getDocument(e,new Ae(i)).next((s=>{let o=Bo();return s.isFoundDocument()&&(o=o.insert(s.key,s)),o}))}getDocumentsMatchingCollectionGroupQuery(e,i,s,o){const c=i.collectionGroup;let f=Bo();return this.indexManager.getCollectionParents(e,c).next((y=>W.forEach(y,(_=>{const p=(function(A,S){return new du(S,null,A.explicitOrderBy.slice(),A.filters.slice(),A.limit,A.limitType,A.startAt,A.endAt)})(i,_.child(c));return this.getDocumentsMatchingCollectionQuery(e,p,s,o).next((T=>{T.forEach(((A,S)=>{f=f.insert(A,S)}))}))})).next((()=>f))))}getDocumentsMatchingCollectionQuery(e,i,s,o){let c;return this.documentOverlayCache.getOverlaysForCollection(e,i.path,s.largestBatchId).next((f=>(c=f,this.remoteDocumentCache.getDocumentsMatchingQuery(e,i,s,c,o)))).next((f=>
2418{c.forEach(((_,p)=>{const T=p.getKey();f.get(T)===null&&(f=f.insert(T,Cn.newInvalidDocument(T)))}));let y=Bo();return f.forEach(((_,p)=>{const T=c.get(_);T!==void 0&&$o(T.mutation,p,oi.empty(),dt.now()),Vh(i,p)&&(y=y.insert(_,p))})),y}))}}/**
2419 * @license
2420 * Copyright 2020 Google LLC
2421 *
2422 * Licensed under the Apache License, Version 2.0 (the "License");
2423 * you may not use this file except in compliance with the License.
2424 * You may obtain a copy of the License at
2425 *
2426 *   http://www.apache.org/licenses/LICENSE-2.0
2427 *
2428 * Unless required by applicable law or agreed to in writing, software
2429 * distributed under the License is distributed on an "AS IS" BASIS,
2430 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2431 * See the License for the specific language governing permissions and
2432 * limitations under the License.
2433 */class R2{constructor(e){this.serializer=e,this.Nr=new Map,this.Br=new Map}getBundleMetadata(e,i){return W.resolve(this.Nr.get(i))}saveBundleMetadata(e,i){return this.Nr.set(i.id,(function(o){return{id:o.id,version:o.version,createTime:ar(o.createTime)}})(i)),W.resolve()}getNamedQuery(e,i){return W.resolve(this.Br.get(i))}saveNamedQuery(e,i){return this.Br.set(i.name,(function(o){return{name:o.name,query:v2(o.bundledQuery),readTime:ar(o.readTime)}})(i)),W.resolve()}}/**
2434 * @license
2435 * Copyright 2022 Google LLC
2436 *
2437 * Licensed under the Apache License, Version 2.0 (the "License");
2438 * you may not use this file except in compliance with the License.
2439 * You may obtain a copy of the License at
2440 *
2441 *   http://www.apache.org/licenses/LICENSE-2.0
2442 *
2443 * Unless required by applicable law or agreed to in writing, software
2444 * distributed under the License is distributed on an "AS IS" BASIS,
2445 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2446 * See the License for the specific language governing permissions and
2447 * limitations under the License.
2448 */class C2{constructor(){this.overlays=new Ot(Ae.comparator),this.Lr=new Map}getOverlay(e,i){return W.resolve(this.overlays.get(i))}getOverlays(e,i){const s=ua();return W.forEach(i,(o=>this.getOverlay(e,o).next((c=>{c!==null&&s.set(o,c)})))).next((()=>s))}saveOverlays(e,i,s){return s.forEach(((o,c)=>{this.bt(e,i,c)})),W.resolve()}removeOverlaysForBatchId(e,i,s){const o=this.Lr.get(s);return o!==void 0&&(o.forEach((c=>this.overlays=this.overlays.remove(c))),this.Lr.delete(s)),W.resolve()}getOverlaysForCollection(e,i,s){const o=ua(),c=i.length+1,f=new Ae(i.child("")),y=this.overlays.getIteratorFrom(f);for(;y.hasNext();){const _=y.getNext().value,p=_.getKey();if(!i.isPrefixOf(p.path))break;p.path.length===c&&_.largestBatchId>s&&o.set(_.getKey(),_)}return W.resolve(o)}getOverlaysForCollectionGroup(e,i,s,o){let c=new Ot(((p,T)=>p-T));const f=this.overlays.getIterator();for(;f.hasNext();){const p=f.getNext().value;if(p.getKey().getCollectionGroup()===i&&p.largestBatchId>s){let T=c.get(p.largestBatchId);T===null&&(T=ua(),c=c.insert(p.largestBatchId,T)),T.set(p.getKey(),p)}}const y=ua(),_=c.getIterator();for(;_.hasNext()&&(_.getNext().value.forEach(((p,T)=>y.set(p,T))),!(y.size()>=o)););return W.resolve(y)}bt(e,i,s){const o=this.overlays.get(s.key);if(o!==null){const f=this.Lr.get(o.largestBatchId).delete(s.key);this.Lr.set(o.largestBatchId,f)}this.overlays=this.overlays.insert(s.key,new YN(i,s));let c=this.Lr.get(i);c===void 0&&(c=We(),this.Lr.set(i,c)),this.Lr.set(i,c.add(s.key))}}/**
2449 * @license
2450 * Copyright 2024 Google LLC
2451 *
2452 * Licensed under the Apache License, Version 2.0 (the "License");
2453 * you may not use this file except in compliance with the License.
2454 * You may obtain a copy of the License at
2455 *
2456 *   http://www.apache.org/licenses/LICENSE-2.0
2457 *
2458 * Unless required by applicable law or agreed to in writing, software
2459 * distributed under the License is distributed on an "AS IS" BASIS,
2460 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2461 * See the License for the specific language governing permissions and
2462 * limitations under the License.
2463 */class D2{constructor(){this.sessionToken=En.EMPTY_BYTE_STRING}getSessionToken(e){return W.resolve(this.sessionToken)}setSessionToken(e,i){return this.sessionToken=i,W.resolve()}}/**
2464 * @license
2465 * Copyright 2017 Google LLC
2466 *
2467 * Licensed under the Apache License, Version 2.0 (the "License");
2468 * you may not use this file except in compliance with the License.
2469 * You may obtain a copy of the License at
2470 *
2471 *   http://www.apache.org/licenses/LICENSE-2.0
2472 *
2473 * Unless required by applicable law or agreed to in writing, software
2474 * distributed under the License is distributed on an "AS IS" BASIS,
2475 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2476 * See the License for the specific language governing permissions and
2477 * limitations under the License.
2478 */class ug{constructor(){this.kr=new rn(un.Kr),this.qr=new rn(un.Ur)}isEmpty(){return this.kr.isEmpty()}addReference(e,i){const s=new un(e,i);this.kr=this.kr.add(s),this.qr=this.qr.add(s)}$r(e,i){e.forEach((s=>this.addReference(s,i)))}removeReference(e,i){this.Wr(new un(e,i))}Qr(e,i){e.forEach((s=>this.removeReference(s,i)))}Gr(e){const i=new Ae(new St([])),s=new un(i,e),o=new un(i,e+1),c=[];return this.qr.forEachInRange([s,o],(f=>{this.Wr(f),c.push(f.key)})),c}zr(){this.kr.forEach((e=>this.Wr(e)))}Wr(e){this.kr=this.kr.delete(e),this.qr=this.qr.delete(e)}jr(e){const i=new Ae(new St([])),s=new un(i,e),o=new un(i,e+1);let c=We();return this.qr.forEachInRange([s,o],(f=>{c=c.add(f.key)})),c}containsKey(e){const i=new un(e,0),s=this.kr.firstAfterOrEqual(i);return s!==null&&e.isEqual(s.key)}}class un{constructor(e,i){this.key=e,this.Hr=i}static Kr(e,i){return Ae.comparator(e.key,i.key)||Ze(e.Hr,i.Hr)}static Ur(e,i){return Ze(e.Hr,i.Hr)||Ae.comparator(e.key,i.key)}}/**
2479 * @license
2480 * Copyright 2017 Google LLC
2481 *
2482 * Licensed under the Apache License, Version 2.0 (the "License");
2483 * you may not use this file except in compliance with the License.
2484 * You may obtain a copy of the License at
2485 *
2486 *   http://www.apache.org/licenses/LICENSE-2.0
2487 *
2488 * Unless required by applicable law or agreed to in writing, software
2489 * distributed under the License is distributed on an "AS IS" BASIS,
2490 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2491 * See the License for the specific language governing permissions and
2492 * limitations under the License.
2493 */class M2{constructor(e,i){this.indexManager=e,this.referenceDelegate=i,this.mutationQueue=[],this.Yn=1,this.Jr=new rn(un.Kr)}checkEmpty(e){return W.resolve(this.mutationQueue.length===0)}addMutationBatch(e,i,s,o){const c=this.Yn;this.Yn++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const f=new QN(c,i,s,o);this.mutationQueue.push(f);for(const y of o)this.Jr=this.Jr.add(new un(y.key,c)),this.indexManager.addToCollectionParentIndex(e,y.key.path.popLast());return W.resolve(f)}lookupMutationBatch(e,i){return W.resolve(this.Zr(i))}getNextMutationBatchAfterBatchId(e,i){const s=i+1,o=this.Xr(s),c=o<0?0:o;return W.resolve(this.mutationQueue.length>c?this.mutationQueue[c]:null)}getHighestUnacknowledgedBatchId(){return W.resolve(this.mutationQueue.length===0?Wm:this.Yn-1)}getAllMutationBatches(e){return W.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,i){const s=new un(i,0),o=new un(i,Number.POSITIVE_INFINITY),c=[];return this.Jr.forEachInRange([s,o],(f=>{const y=this.Zr(f.Hr);c.push(y)})),W.resolve(c)}getAllMutationBatchesAffectingDocumentKeys(e,i){let s=new rn(Ze);return i.forEach((o=>{const c=new un(o,0),f=new un(o,Number.POSITIVE_INFINITY);this.Jr.forEachInRange([c,f],(y=>{s=s.add(y.Hr)}))})),W.resolve(this.Yr(s))}getAllMutationBatchesAffectingQuery(e,i){const s=i.path,o=s.length+1;let c=s;Ae.isDocumentKey(c)||(c=c.child(""));const f=new un(new Ae(c),0);let y=new rn(Ze);return this.Jr.forEachWhile((_=>
vendor: 11,907 bytes, lines 2493-2572
2493{const p=_.key.path;return!!s.isPrefixOf(p)&&(p.length===o&&(y=y.add(_.Hr)),!0)}),f),W.resolve(this.Yr(y))}Yr(e){const i=[];return e.forEach((s=>{const o=this.Zr(s);o!==null&&i.push(o)})),i}removeMutationBatch(e,i){ft(this.ei(i.batchId,"removed")===0,55003),this.mutationQueue.shift();let s=this.Jr;return W.forEach(i.mutations,(o=>{const c=new un(o.key,i.batchId);return s=s.delete(c),this.referenceDelegate.markPotentiallyOrphaned(e,o.key)})).next((()=>{this.Jr=s}))}nr(e){}containsKey(e,i){const s=new un(i,0),o=this.Jr.firstAfterOrEqual(s);return W.resolve(i.isEqual(o&&o.key))}performConsistencyCheck(e){return this.mutationQueue.length,W.resolve()}ei(e,i){return this.Xr(e)}Xr(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Zr(e){const i=this.Xr(e);return i<0||i>=this.mutationQueue.length?null:this.mutationQueue[i]}}/**
2494 * @license
2495 * Copyright 2017 Google LLC
2496 *
2497 * Licensed under the Apache License, Version 2.0 (the "License");
2498 * you may not use this file except in compliance with the License.
2499 * You may obtain a copy of the License at
2500 *
2501 *   http://www.apache.org/licenses/LICENSE-2.0
2502 *
2503 * Unless required by applicable law or agreed to in writing, software
2504 * distributed under the License is distributed on an "AS IS" BASIS,
2505 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2506 * See the License for the specific language governing permissions and
2507 * limitations under the License.
2508 */class O2{constructor(e){this.ti=e,this.docs=(function(){return new Ot(Ae.comparator)})(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,i){const s=i.key,o=this.docs.get(s),c=o?o.size:0,f=this.ti(i);return this.docs=this.docs.insert(s,{document:i.mutableCopy(),size:f}),this.size+=f-c,this.indexManager.addToCollectionParentIndex(e,s.path.popLast())}removeEntry(e){const i=this.docs.get(e);i&&(this.docs=this.docs.remove(e),this.size-=i.size)}getEntry(e,i){const s=this.docs.get(i);return W.resolve(s?s.document.mutableCopy():Cn.newInvalidDocument(i))}getEntries(e,i){let s=Vr();return i.forEach((o=>{const c=this.docs.get(o);s=s.insert(o,c?c.document.mutableCopy():Cn.newInvalidDocument(o))})),W.resolve(s)}getDocumentsMatchingQuery(e,i,s,o){let c=Vr();const f=i.path,y=new Ae(f.child("__id-9223372036854775808__")),_=this.docs.getIteratorFrom(y);for(;_.hasNext();){const{key:p,value:{document:T}}=_.getNext();if(!f.isPrefixOf(p.path))break;p.path.length>f.length+1||sN(rN(T),s)<=0||(o.has(T.key)||Vh(i,T))&&(c=c.insert(T.key,T.mutableCopy()))}return W.resolve(c)}getAllFromCollectionGroup(e,i,s,o){Ce(9500)}ni(e,i){return W.forEach(this.docs,(s=>i(s)))}newChangeBuffer(e){return new j2(this)}getSize(e){return W.resolve(this.size)}}class j2 extends w2{constructor(e){super(),this.Mr=e}applyChanges(e){const i=[];return this.changes.forEach(((s,o)=>{o.isValidDocument()?i.push(this.Mr.addEntry(e,o)):this.Mr.removeEntry(s)})),W.waitFor(i)}getFromCache(e,i){return this.Mr.getEntry(e,i)}getAllFromCache(e,i){return this.Mr.getEntries(e,i)}}/**
2509 * @license
2510 * Copyright 2017 Google LLC
2511 *
2512 * Licensed under the Apache License, Version 2.0 (the "License");
2513 * you may not use this file except in compliance with the License.
2514 * You may obtain a copy of the License at
2515 *
2516 *   http://www.apache.org/licenses/LICENSE-2.0
2517 *
2518 * Unless required by applicable law or agreed to in writing, software
2519 * distributed under the License is distributed on an "AS IS" BASIS,
2520 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2521 * See the License for the specific language governing permissions and
2522 * limitations under the License.
2523 */class V2{constructor(e){this.persistence=e,this.ri=new ba((i=>ng(i)),ig),this.lastRemoteSnapshotVersion=Me.min(),this.highestTargetId=0,this.ii=0,this.si=new ug,this.targetCount=0,this.oi=Sl._r()}forEachTarget(e,i){return this.ri.forEach(((s,o)=>i(o))),W.resolve()}getLastRemoteSnapshotVersion(e){return W.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return W.resolve(this.ii)}allocateTargetId(e){return this.highestTargetId=this.oi.next(),W.resolve(this.highestTargetId)}setTargetsMetadata(e,i,s){return s&&(this.lastRemoteSnapshotVersion=s),i>this.ii&&(this.ii=i),W.resolve()}lr(e){this.ri.set(e.target,e);const i=e.targetId;i>this.highestTargetId&&(this.oi=new Sl(i),this.highestTargetId=i),e.sequenceNumber>this.ii&&(this.ii=e.sequenceNumber)}addTargetData(e,i){return this.lr(i),this.targetCount+=1,W.resolve()}updateTargetData(e,i){return this.lr(i),W.resolve()}removeTargetData(e,i){return this.ri.delete(i.target),this.si.Gr(i.targetId),this.targetCount-=1,W.resolve()}removeTargets(e,i,s){let o=0;const c=[];return this.ri.forEach(((f,y)=>{y.sequenceNumber<=i&&s.get(y.targetId)===null&&(this.ri.delete(f),c.push(this.removeMatchingKeysForTargetId(e,y.targetId)),o++)})),W.waitFor(c).next((()=>o))}getTargetCount(e){return W.resolve(this.targetCount)}getTargetData(e,i){const s=this.ri.get(i)||null;return W.resolve(s)}addMatchingKeys(e,i,s){return this.si.$r(i,s),W.resolve()}removeMatchingKeys(e,i,s){this.si.Qr(i,s);const o=this.persistence.referenceDelegate,c=[];return o&&i.forEach((f=>{c.push(o.markPotentiallyOrphaned(e,f))})),W.waitFor(c)}removeMatchingKeysForTargetId(e,i){return this.si.Gr(i),W.resolve()}getMatchingKeysForTargetId(e,i){const s=this.si.jr(i);return W.resolve(s)}containsKey(e,i){return W.resolve(this.si.containsKey(i))}}/**
2524 * @license
2525 * Copyright 2017 Google LLC
2526 *
2527 * Licensed under the Apache License, Version 2.0 (the "License");
2528 * you may not use this file except in compliance with the License.
2529 * You may obtain a copy of the License at
2530 *
2531 *   http://www.apache.org/licenses/LICENSE-2.0
2532 *
2533 * Unless required by applicable law or agreed to in writing, software
2534 * distributed under the License is distributed on an "AS IS" BASIS,
2535 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2536 * See the License for the specific language governing permissions and
2537 * limitations under the License.
2538 */class CT{constructor(e,i){this._i={},this.overlays={},this.ai=new Ch(0),this.ui=!1,this.ui=!0,this.ci=new D2,this.referenceDelegate=e(this),this.li=new V2(this),this.indexManager=new _2,this.remoteDocumentCache=(function(o){return new O2(o)})((s=>this.referenceDelegate.hi(s))),this.serializer=new y2(i),this.Pi=new R2(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.ui=!1,Promise.resolve()}get started(){return this.ui}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let i=this.overlays[e.toKey()];return i||(i=new C2,this.overlays[e.toKey()]=i),i}getMutationQueue(e,i){let s=this._i[e.toKey()];return s||(s=new M2(i,this.referenceDelegate),this._i[e.toKey()]=s),s}getGlobalsCache(){return this.ci}getTargetCache(){return this.li}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Pi}runTransaction(e,i,s){de("MemoryPersistence","Starting transaction:",e);const o=new k2(this.ai.next());return this.referenceDelegate.Ti(),s(o).next((c=>this.referenceDelegate.Ii(o).next((()=>c)))).toPromise().then((c=>(o.raiseOnCommittedEvent(),c)))}Ei(e,i){return W.or(Object.values(this._i).map((s=>()=>s.containsKey(e,i))))}}class k2 extends lN{constructor(e){super(),this.currentSequenceNumber=e}}class cg{constructor(e){this.persistence=e,this.Ri=new ug,this.Ai=null}static Vi(e){return new cg(e)}get di(){if(this.Ai)return this.Ai;throw Ce(60996)}addReference(e,i,s){return this.Ri.addReference(s,i),this.di.delete(s.toString()),W.resolve()}removeReference(e,i,s){return this.Ri.removeReference(s,i),this.di.add(s.toString()),W.resolve()}markPotentiallyOrphaned(e,i){return this.di.add(i.toString()),W.resolve()}removeTarget(e,i){this.Ri.Gr(i.targetId).forEach((o=>this.di.add(o.toString())));const s=this.persistence.getTargetCache();return s.getMatchingKeysForTargetId(e,i.targetId).next((o=>{o.forEach((c=>this.di.add(c.toString())))})).next((()=>s.removeTargetData(e,i)))}Ti(){this.Ai=new Set}Ii(e){const i=this.persistence.getRemoteDocumentCache().newChangeBuffer();return W.forEach(this.di,(s=>{const o=Ae.fromPath(s);return this.mi(e,o).next((c=>{c||i.removeEntry(o,Me.min())}))})).next((()=>(this.Ai=null,i.apply(e))))}updateLimboDocument(e,i){return this.mi(e,i).next((s=>{s?this.di.delete(i.toString()):this.di.add(i.toString())}))}hi(e){return 0}mi(e,i){return W.or([()=>W.resolve(this.Ri.containsKey(i)),()=>this.persistence.getTargetCache().containsKey(e,i),()=>this.persistence.Ei(e,i)])}}class _h{constructor(e,i){this.persistence=e,this.fi=new ba((s=>cN(s.path)),((s,o)=>s.isEqual(o))),this.garbageCollector=S2(this,i)}static Vi(e,i){return new _h(e,i)}Ti(){}Ii(e){return W.resolve()}forEachTarget(e,i){return this.persistence.getTargetCache().forEachTarget(e,i)}dr(e){const i=this.pr(e);return this.persistence.getTargetCache().getTargetCount(e).next((s=>i.next((o=>s+o))))}pr(e){let i=0;return this.mr(e,(s=>{i++})).next((()=>i))}mr(e,i){return W.forEach(this.fi,((s,o)=>this.wr(e,s,o).next((c=>c?W.resolve():i(o)))))}removeTargets(e,i,s){return this.persistence.getTargetCache().removeTargets(e,i,s)}removeOrphanedDocuments(e,i){let s=0;const o=this.persistence.getRemoteDocumentCache(),c=o.newChangeBuffer();return o.ni(e,(f=>this.wr(e,f,i).next((y=>{y||(s++,c.removeEntry(f,Me.min()))})))).next((()=>c.apply(e))).next((()=>s))}markPotentiallyOrphaned(e,i){return this.fi.set(i,e.currentSequenceNumber),W.resolve()}removeTarget(e,i){const s=i.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,s)}addReference(e,i,s){return this.fi.set(s,e.currentSequenceNumber),W.resolve()}removeReference(e,i,s){return this.fi.set(s,e.currentSequenceNumber),W.resolve()}updateLimboDocument(e,i){return this.fi.set(i,e.currentSequenceNumber),W.resolve()}hi(e){let i=e.key.toString().length;return e.isFoundDocument()&&(i+=Zc(e.data.value)),i}wr(e,i,s){return W.or([()=>this.persistence.Ei(e,i),()=>this.persistence.getTargetCache().containsKey(e,i),()=>{const o=this.fi.get(i);return W.resolve(o!==void 0&&o>s)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}/**
2539 * @license
2540 * Copyright 2017 Google LLC
2541 *
2542 * Licensed under the Apache License, Version 2.0 (the "License");
2543 * you may not use this file except in compliance with the License.
2544 * You may obtain a copy of the License at
2545 *
2546 *   http://www.apache.org/licenses/LICENSE-2.0
2547 *
2548 * Unless required by applicable law or agreed to in writing, software
2549 * distributed under the License is distributed on an "AS IS" BASIS,
2550 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2551 * See the License for the specific language governing permissions and
2552 * limitations under the License.
2553 */class hg{constructor(e,i,s,o){this.targetId=e,this.fromCache=i,this.Ts=s,this.Is=o}static Es(e,i){let s=We(),o=We();for(const c of i.docChanges)switch(c.type){case 0:s=s.add(c.doc.key);break;case 1:o=o.add(c.doc.key)}return new hg(e,i.fromCache,s,o)}}/**
2554 * @license
2555 * Copyright 2023 Google LLC
2556 *
2557 * Licensed under the Apache License, Version 2.0 (the "License");
2558 * you may not use this file except in compliance with the License.
2559 * You may obtain a copy of the License at
2560 *
2561 *   http://www.apache.org/licenses/LICENSE-2.0
2562 *
2563 * Unless required by applicable law or agreed to in writing, software
2564 * distributed under the License is distributed on an "AS IS" BASIS,
2565 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2566 * See the License for the specific language governing permissions and
2567 * limitations under the License.
2568 */class L2{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}/**
2569 * @license
2570 * Copyright 2019 Google LLC
2571 *
2572 * Licensed under the Apache License, Version 2.0 (the "License");
2573 * you may not use this file except in compliance with the License.
2574 * You may obtain a copy of the License at
2575 *
2576 *   http://www.apache.org/licenses/LICENSE-2.0
2577 *
2578 * Unless required by applicable law or agreed to in writing, software
2579 * distributed under the License is distributed on an "AS IS" BASIS,
2580 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2581 * See the License for the specific language governing permissions and
2582 * limitations under the License.
2583 */class U2{constructor(){this.Rs=!1,this.As=!1,this.Vs=100,this.ds=(function(){return w1()?8:oN(Dn())>0?6:4})()}initialize(e,i){this.fs=e,this.indexManager=i,this.Rs=!0}getDocumentsMatchingQuery(e,i,s,o){const c={result:null};return this.gs(e,i).next((f=>{c.result=f})).next((()=>{if(!c.result)return this.ps(e,i,o,s).next((f=>{c.result=f}))})).next((()=>{if(c.result)return;const f=new L2;return this.ys(e,i,f).next((y=>{if(c.result=y,this.As)return this.ws(e,i,f,y.size)}))})).next((()=>c.result))}ws(e,i,s,o){return s.documentReadCount<this.Vs?(hl()<=Je.DEBUG&&de("QueryEngine","SDK will not create cache indexes for query:",dl(i),"since it only creates cache indexes for collection contains","more than or equal to",this.Vs,"documents"),W.resolve()):(hl()<=Je.DEBUG&&de("QueryEngine","Query:",dl(i),"scans",s.documentReadCount,"local documents and returns",o,"documents as results."),s.documentReadCount>this.ds*o?(hl()<=Je.DEBUG&&de("QueryEngine","The SDK decides to create cache indexes for query:",dl(i),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,sr(i))):W.resolve())}gs(e,i){if(i_(i))return W.resolve(null);let s=sr(i);return this.indexManager.getIndexType(e,s).next((o=>o===0?null:(i.limit!==null&&o===1&&(i=wm(i,null,"F"),s=sr(i)),this.indexManager.getDocumentsMatchingTarget(e,s).next((c=>{const f=We(...c);return this.fs.getDocuments(e,f).next((y=>this.indexManager.getMinOffset(e,s).next((_=>{const p=this.bs(i,y);return this.Ss(i,p,f,_.readTime)?this.gs(e,wm(i,null,"F")):this.Ds(e,p,i,_)}))))})))))}ps(e,i,s,o){return i_(i)||o.isEqual(Me.min())?W.resolve(null):this.fs.getDocuments(e,s).next((c=>{const f=this.bs(i,c);return this.Ss(i,f,s,o)?W.resolve(null):(hl()<=Je.DEBUG&&de("QueryEngine","Re-using previous result from %s to execute query: %s",o.toString(),dl(i)),this.Ds(e,f,i,iN(o,Wo)).next((y=>y)))}))}bs(e,i){let s=new rn(lT(e));return i.forEach(((o,c)=>{Vh(e,c)&&(s=s.add(c))})),s}Ss(e,i,s,o){if(e.limit===null)return!1;if(s.size!==i.size)return!0;const c=e.limitType==="F"?i.last():i.first();return!!c&&(c.hasPendingWrites||c.version.compareTo(o)>0)}ys(e,i,s){return hl()<=Je.DEBUG&&de("QueryEngine","Using full collection scan to execute query:",dl(i)),this.fs.getDocumentsMatchingQuery(e,i,Ns.min(),s)}Ds(e,i,s,o){return this.fs.getDocumentsMatchingQuery(e,s,o).next((c=>(i.forEach((f=>{c=c.insert(f.key,f)})),c)))}}/**
2584 * @license
2585 * Copyright 2020 Google LLC
2586 *
2587 * Licensed under the Apache License, Version 2.0 (the "License");
2588 * you may not use this file except in compliance with the License.
2589 * You may obtain a copy of the License at
2590 *
2591 *   http://www.apache.org/licenses/LICENSE-2.0
2592 *
2593 * Unless required by applicable law or agreed to in writing, software
2594 * distributed under the License is distributed on an "AS IS" BASIS,
2595 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2596 * See the License for the specific language governing permissions and
2597 * limitations under the License.
2598 */const dg="LocalStore",P2=3e8;class z2{constructor(e,i,s,o){this.persistence=e,this.Cs=i,this.serializer=o,this.vs=new Ot(Ze),this.Fs=new ba((c=>ng(c)),ig),this.Ms=new Map,this.xs=e.getRemoteDocumentCache(),this.li=e.getTargetCache(),this.Pi=e.getBundleCache(),this.Os(s)}Os(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new I2(this.xs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.xs.setIndexManager(this.indexManager),this.Cs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(i=>e.collect(i,this.vs)))}}
2598function B2(r,e,i,s){return new z2(r,e,i,s)}async function DT(r,e){const i=je(r);return await i.persistence.runTransaction("Handle user change","readonly",(s=>{let o;return i.mutationQueue.getAllMutationBatches(s).next((c=>(o=c,i.Os(e),i.mutationQueue.getAllMutationBatches(s)))).next((c=>{const f=[],y=[];let _=We();for(const p of o){f.push(p.batchId);for(const T of p.mutations)_=_.add(T.key)}for(const p of c){y.push(p.batchId);for(const T of p.mutations)_=_.add(T.key)}return i.localDocuments.getDocuments(s,_).next((p=>({Ns:p,removedBatchIds:f,addedBatchIds:y})))}))}))}function H2(r,e){const i=je(r);return i.persistence.runTransaction("Acknowledge batch","readwrite-primary",(s=>{const o=e.batch.keys(),c=i.xs.newChangeBuffer({trackRemovals:!0});return(function(y,_,p,T){const A=p.batch,S=A.keys();let z=W.resolve();return S.forEach((Q=>{z=z.next((()=>T.getEntry(_,Q))).next((ie=>{const X=p.docVersions.get(Q);ft(X!==null,48541),ie.version.compareTo(X)<0&&(A.applyToRemoteDocument(ie,p),ie.isValidDocument()&&(ie.setReadTime(p.commitVersion),T.addEntry(ie)))}))})),z.next((()=>y.mutationQueue.removeMutationBatch(_,A)))})(i,s,e,c).next((()=>c.apply(s))).next((()=>i.mutationQueue.performConsistencyCheck(s))).next((()=>i.documentOverlayCache.removeOverlaysForBatchId(s,o,e.batch.batchId))).next((()=>i.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(s,(function(y){let _=We();for(let p=0;p<y.mutationResults.length;++p)y.mutationResults[p].transformResults.length>0&&(_=_.add(y.batch.mutations[p].key));return _})(e)))).next((()=>i.localDocuments.getDocuments(s,o)))}))}function MT(r){const e=je(r);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(i=>e.li.getLastRemoteSnapshotVersion(i)))}function q2(r,e){const i=je(r),s=e.snapshotVersion;let o=i.vs;return i.persistence.runTransaction("Apply remote event","readwrite-primary",(c=>{const f=i.xs.newChangeBuffer({trackRemovals:!0});o=i.vs;const y=[];
2598e.targetChanges.forEach(((T,A)=>{const S=o.get(A);if(!S)return;y.push(i.li.removeMatchingKeys(c,T.removedDocuments,A).next((()=>i.li.addMatchingKeys(c,T.addedDocuments,A))));let z=S.withSequenceNumber(c.currentSequenceNumber);e.targetMismatches.get(A)!==null?z=z.withResumeToken(En.EMPTY_BYTE_STRING,Me.min()).withLastLimboFreeSnapshotVersion(Me.min()):T.resumeToken.approximateByteSize()>0&&(z=z.withResumeToken(T.resumeToken,s)),o=o.insert(A,z),(function(ie,X,ge){return ie.resumeToken.approximateByteSize()===0||X.snapshotVersion.toMicroseconds()-ie.snapshotVersion.toMicroseconds()>=P2?!0:ge.addedDocuments.size+ge.modifiedDocuments.size+ge.removedDocuments.size>0})(S,z,T)&&y.push(i.li.updateTargetData(c,z))}));let _=Vr(),p=We();if(e.documentUpdates.forEach((T=>{e.resolvedLimboDocuments.has(T)&&y.push(i.persistence.referenceDelegate.updateLimboDocument(c,T))})),y.push(F2(c,f,e.documentUpdates).next((T=>{_=T.Bs,p=T.Ls}))),!s.isEqual(Me.min())){const T=i.li.getLastRemoteSnapshotVersion(c).next((A=>i.li.setTargetsMetadata(c,c.currentSequenceNumber,s)));y.push(T)}return W.waitFor(y).next((()=>f.apply(c))).next((()=>i.localDocuments.getLocalViewOfDocuments(c,_,p))).next((()=>_))})).then((c=>(i.vs=o,c)))}function F2(r,e,i){let s=We(),o=We();return i.forEach((c=>s=s.add(c))),e.getEntries(r,s).next((c=>{let f=Vr();return i.forEach(((y,_)=>{const p=c.get(y);_.isFoundDocument()!==p.isFoundDocument()&&(o=o.add(y)),_.isNoDocument()&&_.version.isEqual(Me.min())?(e.removeEntry(y,_.readTime),f=f.insert(y,_)):!p.isValidDocument()||_.version.compareTo(p.version)>0||_.version.compareTo(p.version)===0&&p.hasPendingWrites?(e.addEntry(_),f=f.insert(y,_)):de(dg,"Ignoring outdated watch update for ",y,". Current version:",p.version," Watch version:",_.version)})),{Bs:f,Ls:o}}))}function G2(r,e){const i=je(r);return i.persistence.runTransaction("Get next mutation batch","readonly",(s=>(e===void 0&&(e=Wm),i.mutationQueue.getNextMutationBatchAfterBatchId(s,e))))}function K2(r,e){const i=je(r);return i.persistence.runTransaction("Allocate target","readwrite",(s=>{let o;return i.li.getTargetData(s,e).next((c=>c?(o=c,W.resolve(o)):i.li.allocateTargetId(s).next((f=>(o=new Ts(e,f,"TargetPurposeListen",s.currentSequenceNumber),i.li.addTargetData(s,o).next((()=>o)))))))})).then((s=>{const o=i.vs.get(s.targetId);return(o===null||s.snapshotVersion.compareTo(o.snapshotVersion)>0)&&(i.vs=i.vs.insert(s.targetId,s),i.Fs.set(e,s.targetId)),s}))}async function Dm(r,e,i){const s=je(r),o=s.vs.get(e),c=i?"readwrite":"readwrite-primary";try{i||await s.persistence.runTransaction("Release target",c,(f=>s.persistence.referenceDelegate.removeTarget(f,o)))}catch(f){if(!jl(f))throw f;de(dg,`Failed to update sequence numbers for target ${e}: ${f}`)}s.vs=s.vs.remove(e),s.Fs.delete(o.target)}function p_(r,e,i){const s=je(r);let o=Me.min(),c=We();return s.persistence.runTransaction("Execute query","readwrite",(f=>(function(_,p,T){const A=je(_),S=A.Fs.get(T);return S!==void 0?W.resolve(A.vs.get(S)):A.li.getTargetData(p,T)})(s,f,sr(e)).next((y=>{if(y)return o=y.lastLimboFreeSnapshotVersion,s.li.getMatchingKeysForTargetId(f,y.targetId).next((_=>{c=_}))})).next((()=>s.Cs.getDocumentsMatchingQuery(f,e,i?o:Me.min(),i?c:We()))).next((y=>(Q2(s,DN(e),y),{documents:y,ks:c})))))}function Q2(r,e,i){let s=r.Ms.get(e)||Me.min();i.forEach(((o,c)=>{c.readTime.compareTo(s)>0&&(s=c.readTime)})),r.Ms.set(e,s)}class y_{constructor(){this.activeTargetIds=LN()}Qs(e){this.activeTargetIds=this.activeTargetIds.add(e)}Gs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Ws(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class Y2{constructor(){this.vo=new y_,this.Fo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,i,s){}addLocalQueryTarget(e,i=!0){return i&&this.vo.Qs(e),this.Fo[e]||"not-current"}updateQueryState(e,i,s){this.Fo[e]=i}removeLocalQueryTarget(e){this.vo.Gs(e)}isLocalQueryTarget(e){return this.vo.activeTargetIds.has(e)}clearQueryState(e){delete this.Fo[e]}getAllActiveQueryTargets(){return this.vo.activeTargetIds}isActiveQueryTarget(e){return this.vo.activeTargetIds.has(e)}start(){return this.vo=new y_,Promise.resolve()}handleUserChange(e,i,s){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/**
2599 * @license
2600 * Copyright 2019 Google LLC
2601 *
2602 * Licensed under the Apache License, Version 2.0 (the "License");
2603 * you may not use this file except in compliance with the License.
2604 * You may obtain a copy of the License at
2605 *
2606 *   http://www.apache.org/licenses/LICENSE-2.0
2607 *
2608 * Unless required by applicable law or agreed to in writing, software
2609 * distributed under the License is distributed on an "AS IS" BASIS,
2610 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2611 * See the License for the specific language governing permissions and
2612 * limitations under the License.
2613 */class $2{Mo(e){}shutdown(){}}/**
2614 * @license
2615 * Copyright 2019 Google LLC
2616 *
2617 * Licensed under the Apache License, Version 2.0 (the "License");
2618 * you may not use this file except in compliance with the License.
2619 * You may obtain a copy of the License at
2620 *
2621 *   http://www.apache.org/licenses/LICENSE-2.0
2622 *
2623 * Unless required by applicable law or agreed to in writing, software
2624 * distributed under the License is distributed on an "AS IS" BASIS,
2625 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2626 * See the License for the specific language governing permissions and
2627 * limitations under the License.
2628 */const v_="ConnectivityMonitor";class __{constructor(){this.xo=()=>this.Oo(),this.No=()=>this.Bo(),this.Lo=[],this.ko()}Mo(e){this.Lo.push(e)}shutdown(){window.removeEventListener("online",this.xo),window.removeEventListener("offline",this.No)}ko(){window.addEventListener("online",this.xo),window.addEventListener("offline",this.No)}Oo(){de(v_,"Network connectivity changed: AVAILABLE");for(const e of this.Lo)e(0)}Bo(){de(v_,"Network connectivity changed: UNAVAILABLE");for(const e of this.Lo)e(1)}static v(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/**
2629 * @license
2630 * Copyright 2023 Google LLC
2631 *
2632 * Licensed under the Apache License, Version 2.0 (the "License");
2633 * you may not use this file except in compliance with the License.
2634 * You may obtain a copy of the License at
2635 *
2636 *   http://www.apache.org/licenses/LICENSE-2.0
2637 *
2638 * Unless required by applicable law or agreed to in writing, software
2639 * distributed under the License is distributed on an "AS IS" BASIS,
2640 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2641 * See the License for the specific language governing permissions and
2642 * limitations under the License.
2643 */let Gc=null;function Mm(){return Gc===null?Gc=(function(){return 268435456+Math.round(2147483648*Math.random())})():Gc++,"0x"+Gc.toString(16)}/**
2644 * @license
2645 * Copyright 2020 Google LLC
2646 *
2647 * Licensed under the Apache License, Version 2.0 (the "License");
2648 * you may not use this file except in compliance with the License.
2649 * You may obtain a copy of the License at
2650 *
2651 *   http://www.apache.org/licenses/LICENSE-2.0
2652 *
2653 * Unless required by applicable law or agreed to in writing, software
2654 * distributed under the License is distributed on an "AS IS" BASIS,
2655 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2656 * See the License for the specific language governing permissions and
2657 * limitations under the License.
2658 */const om="RestConnection",X2={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery",ExecutePipeline:"executePipeline"};class J2{get Ko(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const i=e.ssl?"https":"http",s=encodeURIComponent(this.databaseId.projectId),o=encodeURIComponent(this.databaseId.database);this.qo=i+"://"+e.host,this.Uo=`projects/${s}/databases/${o}`,this.$o=this.databaseId.database===fh?`project_id=${s}`:`project_id=${s}&database_id=${o}`}Wo(e,i,s,o,c){const f=Mm(),y=this.Qo(e,i.toUriEncodedString());de(om,`Sending RPC '${e}' ${f}:`,y,s);const _={"google-cloud-resource-prefix":this.Uo,"x-goog-request-params":this.$o};this.Go(_,o,c);const{host:p}=new URL(y),T=Rl(p);return this.zo(e,y,_,s,T).then((A=>(de(om,`Received RPC '${e}' ${f}: `,A),A)),(A=>
vendor: 4,402 bytes, lines 2658-2688
2658{throw ya(om,`RPC '${e}' ${f} failed with error: `,A,"url: ",y,"request:",s),A}))}jo(e,i,s,o,c,f){return this.Wo(e,i,s,o,c)}Go(e,i,s){e["X-Goog-Api-Client"]=(function(){return"gl-js/ fire/"+Ml})(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),i&&i.headers.forEach(((o,c)=>e[c]=o)),s&&s.headers.forEach(((o,c)=>e[c]=o))}Qo(e,i){const s=X2[e];let o=`${this.qo}/v1/${i}:${s}`;return this.databaseInfo.apiKey&&(o=`${o}?key=${encodeURIComponent(this.databaseInfo.apiKey)}`),o}terminate(){}}/**
2659 * @license
2660 * Copyright 2017 Google LLC
2661 *
2662 * Licensed under the Apache License, Version 2.0 (the "License");
2663 * you may not use this file except in compliance with the License.
2664 * You may obtain a copy of the License at
2665 *
2666 *   http://www.apache.org/licenses/LICENSE-2.0
2667 *
2668 * Unless required by applicable law or agreed to in writing, software
2669 * distributed under the License is distributed on an "AS IS" BASIS,
2670 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2671 * See the License for the specific language governing permissions and
2672 * limitations under the License.
2673 */class Z2{constructor(e){this.Ho=e.Ho,this.Jo=e.Jo}Zo(e){this.Xo=e}Yo(e){this.e_=e}t_(e){this.n_=e}onMessage(e){this.r_=e}close(){this.Jo()}send(e){this.Ho(e)}i_(){this.Xo()}s_(){this.e_()}o_(e){this.n_(e)}__(e){this.r_(e)}}/**
2674 * @license
2675 * Copyright 2017 Google LLC
2676 *
2677 * Licensed under the Apache License, Version 2.0 (the "License");
2678 * you may not use this file except in compliance with the License.
2679 * You may obtain a copy of the License at
2680 *
2681 *   http://www.apache.org/licenses/LICENSE-2.0
2682 *
2683 * Unless required by applicable law or agreed to in writing, software
2684 * distributed under the License is distributed on an "AS IS" BASIS,
2685 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2686 * See the License for the specific language governing permissions and
2687 * limitations under the License.
2688 */const In="WebChannelConnection",Po=(r,e,i)=>{r.listen(e,(s=>{try{i(s)}catch(o){setTimeout((()=>{throw o}),0)}}))};class vl extends J2{constructor(e){super(e),this.a_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}static u_(){if(!vl.c_){const e=Lb();Po(e,kb.STAT_EVENT,(i=>{i.stat===_m.PROXY?de(In,"STAT_EVENT: detected buffering proxy"):i.stat===_m.NOPROXY&&de(In,"STAT_EVENT: detected no buffering proxy")})),vl.c_=!0}}zo(e,i,s,o,c){const f=Mm();return new Promise(((y,_)=>{const p=new jb;p.setWithCredentials(!0),p.listenOnce(Vb.COMPLETE,(()=>{try{switch(p.getLastErrorCode()){case Jc.NO_ERROR:const A=p.getResponseJson();de(In,`XHR for RPC '${e}' ${f} received:`,JSON.stringify(A)),y(A);break;case Jc.TIMEOUT:de(In,`RPC '${e}' ${f} timed out`),_(new ce(Z.DEADLINE_EXCEEDED,"Request time out"));break;case Jc.HTTP_ERROR:const S=p.getStatus();if(de(In,`RPC '${e}' ${f} failed with status:`,S,"response text:",p.getResponseText()),S>0){let z=p.getResponseJson();Array.isArray(z)&&(z=z[0]);const Q=z==null?void 0:z.error;if(Q&&Q.status&&Q.message){const ie=(function(ge){const Te=ge.toLowerCase().replace(/_/g,"-");return Object.values(Z).indexOf(Te)>=0?Te:Z.UNKNOWN})(Q.status);_(new ce(ie,Q.message))}else _(new ce(Z.UNKNOWN,"Server responded with status "+p.getStatus()))}else _(new ce(Z.UNAVAILABLE,"Connection failed."));break;default:Ce(9055,{l_:e,streamId:f,h_:p.getLastErrorCode(),P_:p.getLastError()})}}finally{de(In,`RPC '${e}' ${f} completed.`)}}));const T=JSON.stringify(o);de(In,`RPC '${e}' ${f} sending request:`,o),p.send(i,"POST",T,s,15)}))}T_(e,i,s){const o=Mm(),c=[this.qo,"/","google.firestore.v1.Firestore","/",e,"/channel"],f=this.createWebChannelTransport(),y={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},_=this.longPollingOptions.timeoutSeconds;_!==void 0&&(y.longPollingTimeout=Math.round(1e3*_)),this.useFetchStreams&&(y.useFetchStreams=!0),this.Go(y.initMessageHeaders,i,s),y.encodeInitMessageHeaders=!0;const p=c.join("");de(In,`Creating RPC '${e}' stream ${o}: ${p}
2688`,y);const T=f.createWebChannel(p,y);this.I_(T);let A=!1,S=!1;const z=new Z2({Ho:Q=>{S?de(In,`Not sending because RPC '${e}' stream ${o} is closed:`,Q):(A||(de(In,`Opening RPC '${e}' stream ${o} transport.`),T.open(),A=!0),de(In,`RPC '${e}' stream ${o} sending:`,Q),T.send(Q))},Jo:()=>T.close()});return Po(T,zo.EventType.OPEN,(()=>{S||(de(In,`RPC '${e}' stream ${o} transport opened.`),z.i_())})),Po(T,zo.EventType.CLOSE,(()=>{S||(S=!0,de(In,`RPC '${e}' stream ${o} transport closed`),z.o_(),this.E_(T))})),Po(T,zo.EventType.ERROR,(Q=>{S||(S=!0,ya(In,`RPC '${e}' stream ${o} transport errored. Name:`,Q.name,"Message:",Q.message),z.o_(new ce(Z.UNAVAILABLE,"The operation could not be completed")))})),Po(T,zo.EventType.MESSAGE,(Q=>{var ie;if(!S){const X=Q.data[0];ft(!!X,16349);const ge=X,Te=(ge==null?void 0:ge.error)||((ie=ge[0])==null?void 0:ie.error);if(Te){de(In,`RPC '${e}' stream ${o} received error:`,Te);const we=Te.status;let He=(function(I){const w=Zt[I];if(w!==void 0)return vT(w)})(we),ze=Te.message;we==="NOT_FOUND"&&ze.includes("database")&&ze.includes("does not exist")&&ze.includes(this.databaseId.database)&&ya(`Database '${this.databaseId.database}' not found. Please check your project configuration.`),He===void 0&&(He=Z.INTERNAL,ze="Unknown error status: "+we+" with message "+Te.message),S=!0,z.o_(new ce(He,ze)),T.close()}else de(In,`RPC '${e}' stream ${o} received:`,X),z.__(X)}})),vl.u_(),setTimeout((()=>{z.s_()}),0),z}terminate(){this.a_.forEach((e=>e.close())),this.a_=[]}I_(e){this.a_.push(e)}E_(e){this.a_=this.a_.filter((i=>i===e))}Go(e,i,s){super.Go(e,i,s),this.databaseInfo.apiKey&&(e["x-goog-api-key"]=this.databaseInfo.apiKey)}createWebChannelTransport(){return Ub()}}/**
2689 * @license
2690 * Copyright 2020 Google LLC
2691 *
2692 * Licensed under the Apache License, Version 2.0 (the "License");
2693 * you may not use this file except in compliance with the License.
2694 * You may obtain a copy of the License at
2695 *
2696 *   http://www.apache.org/licenses/LICENSE-2.0
2697 *
2698 * Unless required by applicable law or agreed to in writing, software
2699 * distributed under the License is distributed on an "AS IS" BASIS,
2700 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2701 * See the License for the specific language governing permissions and
2702 * limitations under the License.
2703 */function W2(r){return new vl(r)}function um(){return typeof document<"u"?document:null}/**
2704 * @license
2705 * Copyright 2020 Google LLC
2706 *
2707 * Licensed under the Apache License, Version 2.0 (the "License");
2708 * you may not use this file except in compliance with the License.
2709 * You may obtain a copy of the License at
2710 *
2711 *   http://www.apache.org/licenses/LICENSE-2.0
2712 *
2713 * Unless required by applicable law or agreed to in writing, software
2714 * distributed under the License is distributed on an "AS IS" BASIS,
2715 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2716 * See the License for the specific language governing permissions and
2717 * limitations under the License.
2718 */function Ph(r){return new i2(r,!0)}/**
2719 * @license
2720 * Copyright 2017 Google LLC
2721 *
2722 * Licensed under the Apache License, Version 2.0 (the "License");
2723 * you may not use this file except in compliance with the License.
2724 * You may obtain a copy of the License at
2725 *
2726 *   http://www.apache.org/licenses/LICENSE-2.0
2727 *
2728 * Unless required by applicable law or agreed to in writing, software
2729 * distributed under the License is distributed on an "AS IS" BASIS,
2730 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2731 * See the License for the specific language governing permissions and
2732 * limitations under the License.
2733 */vl.c_=!1;class OT{constructor(e,i,s=1e3,o=1.5,c=6e4){this.Ci=e,this.timerId=i,this.R_=s,this.A_=o,this.V_=c,this.d_=0,this.m_=null,this.f_=Date.now(),this.reset()}reset(){this.d_=0}g_(){this.d_=this.V_}p_(e){this.cancel();const i=Math.floor(this.d_+this.y_()),s=Math.max(0,Date.now()-this.f_),o=Math.max(0,i-s);o>0&&de("ExponentialBackoff",`Backing off for ${o} ms (base delay: ${this.d_} ms, delay with jitter: ${i} ms, last attempt: ${s} ms ago)`),this.m_=this.Ci.enqueueAfterDelay(this.timerId,o,(()=>
2733(this.f_=Date.now(),e()))),this.d_*=this.A_,this.d_<this.R_&&(this.d_=this.R_),this.d_>this.V_&&(this.d_=this.V_)}w_(){this.m_!==null&&(this.m_.skipDelay(),this.m_=null)}cancel(){this.m_!==null&&(this.m_.cancel(),this.m_=null)}y_(){return(Math.random()-.5)*this.d_}}/**
2734 * @license
2735 * Copyright 2017 Google LLC
2736 *
2737 * Licensed under the Apache License, Version 2.0 (the "License");
2738 * you may not use this file except in compliance with the License.
2739 * You may obtain a copy of the License at
2740 *
2741 *   http://www.apache.org/licenses/LICENSE-2.0
2742 *
2743 * Unless required by applicable law or agreed to in writing, software
2744 * distributed under the License is distributed on an "AS IS" BASIS,
2745 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2746 * See the License for the specific language governing permissions and
2747 * limitations under the License.
2748 */const b_="PersistentStream";class jT{constructor(e,i,s,o,c,f,y,_){this.Ci=e,this.b_=s,this.S_=o,this.connection=c,this.authCredentialsProvider=f,this.appCheckCredentialsProvider=y,this.listener=_,this.state=0,this.D_=0,this.C_=null,this.v_=null,this.stream=null,this.F_=0,this.M_=new OT(e,i)}x_(){return this.state===1||this.state===5||this.O_()}O_(){return this.state===2||this.state===3}start(){this.F_=0,this.state!==4?this.auth():this.N_()}async stop(){this.x_()&&await this.close(0)}B_(){this.state=0,this.M_.reset()}L_(){this.O_()&&this.C_===null&&(this.C_=this.Ci.enqueueAfterDelay(this.b_,6e4,(()=>this.k_())))}K_(e){this.q_(),this.stream.send(e)}async k_(){if(this.O_())return this.close(0)}q_(){this.C_&&(this.C_.cancel(),this.C_=null)}U_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,i){this.q_(),this.U_(),this.M_.cancel(),this.D_++,e!==4?this.M_.reset():i&&i.code===Z.RESOURCE_EXHAUSTED?(jr(i.toString()),jr("Using maximum backoff delay to prevent overloading the backend."),this.M_.g_()):i&&i.code===Z.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.W_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.t_(i)}W_(){}auth(){this.state=1;const e=this.Q_(this.D_),i=this.D_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then((([s,o])=>{this.D_===i&&this.G_(s,o)}),(s=>{e((()=>{const o=new ce(Z.UNKNOWN,"Fetching auth token failed: "+s.message);return this.z_(o)}))}))}G_(e,i){const s=this.Q_(this.D_);this.stream=this.j_(e,i),this.stream.Zo((()=>{s((()=>this.listener.Zo()))})),this.stream.Yo((()=>{s((()=>(this.state=2,this.v_=this.Ci.enqueueAfterDelay(this.S_,1e4,(()=>(this.O_()&&(this.state=3),Promise.resolve()))),this.listener.Yo())))})),this.stream.t_((o=>{s((()=>this.z_(o)))})),this.stream.onMessage((o=>{s((()=>++this.F_==1?this.H_(o):this.onNext(o)))}))}N_(){this.state=5,this.M_.p_((async()=>{this.state=0,this.start()}))}z_(e){return de(b_,`close with error: ${e}`),this.stream=null,this.close(4,e)}Q_(e){return i=>{this.Ci.enqueueAndForget((()=>this.D_===e?i():(de(b_,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class eI extends jT{constructor(e,i,s,o,c,f){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",i,s,o,f),this.serializer=c}j_(e,i){return this.connection.T_("Listen",e,i)}H_(e){return this.onNext(e)}onNext(e){this.M_.reset();const i=a2(this.serializer,e),s=(function(c){if(!("targetChange"in c))return Me.min();const f=c.targetChange;return f.targetIds&&f.targetIds.length?Me.min():f.readTime?ar(f.readTime):Me.min()})(e);return this.listener.J_(i,s)}Z_(e){const i={};i.database=Cm(this.serializer),i.addTarget=(function(c,f){let y;const _=f.target;if(y=Am(_)?{documents:u2(c,_)}:{query:c2(c,_).ft},y.targetId=f.targetId,f.resumeToken.approximateByteSize()>0){y.resumeToken=TT(c,f.resumeToken);const p=Nm(c,f.expectedCount);p!==null&&(y.expectedCount=p)}else if(f.snapshotVersion.compareTo(Me.min())>0){y.readTime=vh(c,f.snapshotVersion.toTimestamp());const p=Nm(c,f.expectedCount);p!==null&&(y.expectedCount=p)}return y})(this.serializer,e);const s=d2(this.serializer,e);s&&(i.labels=s),this.K_(i)}X_(e){const i={};i.database=Cm(this.serializer),i.removeTarget=e,this.K_(i)}}class tI extends jT{constructor(e,i,s,o,c,f){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",i,s,o,f),this.serializer
2748=c}get Y_(){return this.F_>0}start(){this.lastStreamToken=void 0,super.start()}W_(){this.Y_&&this.ea([])}j_(e,i){return this.connection.T_("Write",e,i)}H_(e){return ft(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,ft(!e.writeResults||e.writeResults.length===0,55816),this.listener.ta()}onNext(e){ft(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.M_.reset();const i=o2(e.writeResults,e.commitTime),s=ar(e.commitTime);return this.listener.na(s,i)}ra(){const e={};e.database=Cm(this.serializer),this.K_(e)}ea(e){const i={streamToken:this.lastStreamToken,writes:e.map((s=>l2(this.serializer,s)))};this.K_(i)}}/**
2749 * @license
2750 * Copyright 2017 Google LLC
2751 *
2752 * Licensed under the Apache License, Version 2.0 (the "License");
2753 * you may not use this file except in compliance with the License.
2754 * You may obtain a copy of the License at
2755 *
2756 *   http://www.apache.org/licenses/LICENSE-2.0
2757 *
2758 * Unless required by applicable law or agreed to in writing, software
2759 * distributed under the License is distributed on an "AS IS" BASIS,
2760 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2761 * See the License for the specific language governing permissions and
2762 * limitations under the License.
2763 */class nI{}class iI extends nI{constructor(e,i,s,o){super(),this.authCredentials=e,this.appCheckCredentials=i,this.connection=s,this.serializer=o,this.ia=!1}sa(){if(this.ia)throw new ce(Z.FAILED_PRECONDITION,"The client has already been terminated.")}Wo(e,i,s,o){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([c,f])=>this.connection.Wo(e,Im(i,s),o,c,f))).catch((c=>{throw c.name==="FirebaseError"?(c.code===Z.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),c):new ce(Z.UNKNOWN,c.toString())}))}jo(e,i,s,o,c){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([f,y])=>this.connection.jo(e,Im(i,s),o,f,y,c))).catch((f=>{throw f.name==="FirebaseError"?(f.code===Z.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),f):new ce(Z.UNKNOWN,f.toString())}))}terminate(){this.ia=!0,this.connection.terminate()}}function rI(r,e,i,s){return new iI(r,e,i,s)}class sI{constructor(e,i){this.asyncQueue=e,this.onlineStateHandler=i,this.state="Unknown",this.oa=0,this._a=null,this.aa=!0}ua(){this.oa===0&&(this.ca("Unknown"),this._a=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(()=>(this._a=null,this.la("Backend didn't respond within 10 seconds."),this.ca("Offline"),Promise.resolve()))))}ha(e){this.state==="Online"?this.ca("Unknown"):(this.oa++,this.oa>=1&&(this.Pa(),this.la(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ca("Offline")))}set(e){this.Pa(),this.oa=0,e==="Online"&&(this.aa=!1),this.ca(e)}ca(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}la(e){const i=`Could not reach Cloud Firestore backend. ${e}
2764This 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.aa?(jr(i),this.aa=!1):de("OnlineStateTracker",i)}Pa(){this._a!==null&&(this._a.cancel(),this._a=null)}}/**
2765 * @license
2766 * Copyright 2017 Google LLC
2767 *
2768 * Licensed under the Apache License, Version 2.0 (the "License");
2769 * you may not use this file except in compliance with the License.
2770 * You may obtain a copy of the License at
2771 *
2772 *   http://www.apache.org/licenses/LICENSE-2.0
2773 *
2774 * Unless required by applicable law or agreed to in writing, software
2775 * distributed under the License is distributed on an "AS IS" BASIS,
2776 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2777 * See the License for the specific language governing permissions and
2778 * limitations under the License.
2779 */const va="RemoteStore";class aI{constructor(e,i,s,o,c){this.localStore=e,this.datastore=i,this.asyncQueue=s,this.remoteSyncer={},this.Ta=[],this.Ia=new Map,this.Ea=new Set,this.Ra=[],this.Aa=c,this.Aa.Mo((f=>{s.enqueueAndForget((async()=>
2779{Ta(this)&&(de(va,"Restarting streams for network reachability change."),await(async function(_){const p=je(_);p.Ea.add(4),await gu(p),p.Va.set("Unknown"),p.Ea.delete(4),await zh(p)})(this))}))})),this.Va=new sI(s,o)}}async function zh(r){if(Ta(r))for(const e of r.Ra)await e(!0)}async function gu(r){for(const e of r.Ra)await e(!1)}function VT(r,e){const i=je(r);i.Ia.has(e.targetId)||(i.Ia.set(e.targetId,e),pg(i)?gg(i):Vl(i).O_()&&mg(i,e))}function fg(r,e){const i=je(r),s=Vl(i);i.Ia.delete(e),s.O_()&&kT(i,e),i.Ia.size===0&&(s.O_()?s.L_():Ta(i)&&i.Va.set("Unknown"))}function mg(r,e){if(r.da.$e(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(Me.min())>0){const i=r.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(i)}Vl(r).Z_(e)}function kT(r,e){r.da.$e(e),Vl(r).X_(e)}function gg(r){r.da=new WN({getRemoteKeysForTarget:e=>r.remoteSyncer.getRemoteKeysForTarget(e),At:e=>r.Ia.get(e)||null,ht:()=>r.datastore.serializer.databaseId}),Vl(r).start(),r.Va.ua()}function pg(r){return Ta(r)&&!Vl(r).x_()&&r.Ia.size>0}function Ta(r){return je(r).Ea.size===0}function LT(r){r.da=void 0}async function lI(r){r.Va.set("Online")}async function oI(r){r.Ia.forEach(((e,i)=>{mg(r,e)}))}async function uI(r,e){LT(r),pg(r)?(r.Va.ha(e),gg(r)):r.Va.set("Unknown")}async function cI(r,e,i){if(r.Va.set("Online"),e instanceof bT&&e.state===2&&e.cause)try{await(async function(o,c){const f=c.cause;for(const y of c.targetIds)o.Ia.has(y)&&(await o.remoteSyncer.rejectListen(y,f),o.Ia.delete(y),o.da.removeTarget(y))})(r,e)}catch(s){de(va,"Failed to remove targets %s: %s ",e.targetIds.join(","),s),await bh(r,s)}else if(e instanceof th?r.da.Xe(e):e instanceof _T?r.da.st(e):r.da.tt(e),!i.isEqual(Me.min()))try{const s=await MT(r.localStore);i.compareTo(s)>=0&&await(function(c,f){const y=c.da.Tt(f);
vendor: 4,230 bytes, lines 2779-2794
2779return y.targetChanges.forEach(((_,p)=>{if(_.resumeToken.approximateByteSize()>0){const T=c.Ia.get(p);T&&c.Ia.set(p,T.withResumeToken(_.resumeToken,f))}})),y.targetMismatches.forEach(((_,p)=>{const T=c.Ia.get(_);if(!T)return;c.Ia.set(_,T.withResumeToken(En.EMPTY_BYTE_STRING,T.snapshotVersion)),kT(c,_);const A=new Ts(T.target,_,p,T.sequenceNumber);mg(c,A)})),c.remoteSyncer.applyRemoteEvent(y)})(r,i)}catch(s){de(va,"Failed to raise snapshot:",s),await bh(r,s)}}async function bh(r,e,i){if(!jl(e))throw e;r.Ea.add(1),await gu(r),r.Va.set("Offline"),i||(i=()=>MT(r.localStore)),r.asyncQueue.enqueueRetryable((async()=>{de(va,"Retrying IndexedDB access"),await i(),r.Ea.delete(1),await zh(r)}))}function UT(r,e){return e().catch((i=>bh(r,i,e)))}async function Bh(r){const e=je(r),i=Ds(e);let s=e.Ta.length>0?e.Ta[e.Ta.length-1].batchId:Wm;for(;hI(e);)try{const o=await G2(e.localStore,s);if(o===null){e.Ta.length===0&&i.L_();break}s=o.batchId,dI(e,o)}catch(o){await bh(e,o)}PT(e)&&zT(e)}function hI(r){return Ta(r)&&r.Ta.length<10}function dI(r,e){r.Ta.push(e);const i=Ds(r);i.O_()&&i.Y_&&i.ea(e.mutations)}function PT(r){return Ta(r)&&!Ds(r).x_()&&r.Ta.length>0}function zT(r){Ds(r).start()}async function fI(r){Ds(r).ra()}async function mI(r){const e=Ds(r);for(const i of r.Ta)e.ea(i.mutations)}async function gI(r,e,i){const s=r.Ta.shift(),o=ag.from(s,e,i);await UT(r,(()=>r.remoteSyncer.applySuccessfulWrite(o))),await Bh(r)}async function pI(r,e){e&&Ds(r).Y_&&await(async function(s,o){if((function(f){return XN(f)&&f!==Z.ABORTED})(o.code)){const c=s.Ta.shift();Ds(s).B_(),await UT(s,(()=>s.remoteSyncer.rejectFailedWrite(c.batchId,o))),await Bh(s)}})(r,e),PT(r)&&zT(r)}async function T_(r,e){const i=je(r);i.asyncQueue.verifyOperationInProgress(),de(va,"RemoteStore received new credentials");const s=Ta(i);i.Ea.add(3),await gu(i),s&&i.Va.set("Unknown"),await i.remoteSyncer.handleCredentialChange(e),i.Ea.delete(3),await zh(i)}async function yI(r,e){const i=je(r);e?(i.Ea.delete(2),await zh(i)):e||(i.Ea.add(2),await gu(i),i.Va.set("Unknown"))}function Vl(r){return r.ma||(r.ma=(function(i,s,o){const c=je(i);return c.sa(),new eI(s,c.connection,c.authCredentials,c.appCheckCredentials,c.serializer,o)})(r.datastore,r.asyncQueue,{Zo:lI.bind(null,r),Yo:oI.bind(null,r),t_:uI.bind(null,r),J_:cI.bind(null,r)}),r.Ra.push((async e=>{e?(r.ma.B_(),pg(r)?gg(r):r.Va.set("Unknown")):(await r.ma.stop(),LT(r))}))),r.ma}function Ds(r){return r.fa||(r.fa=(function(i,s,o){const c=je(i);return c.sa(),new tI(s,c.connection,c.authCredentials,c.appCheckCredentials,c.serializer,o)})(r.datastore,r.asyncQueue,{Zo:()=>Promise.resolve(),Yo:fI.bind(null,r),t_:pI.bind(null,r),ta:mI.bind(null,r),na:gI.bind(null,r)}),r.Ra.push((async e=>{e?(r.fa.B_(),await Bh(r)):(await r.fa.stop(),r.Ta.length>0&&(de(va,`Stopping write stream with ${r.Ta.length} pending writes`),r.Ta=[]))}))),r.fa}/**
2780 * @license
2781 * Copyright 2017 Google LLC
2782 *
2783 * Licensed under the Apache License, Version 2.0 (the "License");
2784 * you may not use this file except in compliance with the License.
2785 * You may obtain a copy of the License at
2786 *
2787 *   http://www.apache.org/licenses/LICENSE-2.0
2788 *
2789 * Unless required by applicable law or agreed to in writing, software
2790 * distributed under the License is distributed on an "AS IS" BASIS,
2791 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2792 * See the License for the specific language governing permissions and
2793 * limitations under the License.
2794 */class yg{constructor(e,i,s,o,c){this.asyncQueue=e,this.timerId=i,this.targetTimeMs=s,this.op=o,this.removalCallback=c,this.deferred=new Dr,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((f=>{}))}get promise(){return this.deferred.promise}static createAndSchedule(e,i,s,o,c){const f=Date.now()+s,y=new yg(e,i,f,o,c);return y.start(s),y}start(e){this.timerHandle=setTimeout((()=>this.handleDelayElapsed()),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new ce(Z.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget((()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then((e=>
2794this.deferred.resolve(e)))):Promise.resolve()))}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function vg(r,e){if(jr("AsyncQueue",`${e}: ${r}`),jl(r))return new ce(Z.UNAVAILABLE,`${e}: ${r}`);throw r}/**
2795 * @license
2796 * Copyright 2017 Google LLC
2797 *
2798 * Licensed under the Apache License, Version 2.0 (the "License");
2799 * you may not use this file except in compliance with the License.
2800 * You may obtain a copy of the License at
2801 *
2802 *   http://www.apache.org/licenses/LICENSE-2.0
2803 *
2804 * Unless required by applicable law or agreed to in writing, software
2805 * distributed under the License is distributed on an "AS IS" BASIS,
2806 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2807 * See the License for the specific language governing permissions and
2808 * limitations under the License.
2809 */class _l{static emptySet(e){return new _l(e.comparator)}constructor(e){this.comparator=e?(i,s)=>e(i,s)||Ae.comparator(i.key,s.key):(i,s)=>Ae.comparator(i.key,s.key),this.keyedMap=Bo(),this.sortedSet=new Ot(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 i=this.keyedMap.get(e);return i?this.sortedSet.indexOf(i):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal(((i,s)=>(e(i),!1)))}add(e){const i=this.delete(e.key);return i.copy(i.keyedMap.insert(e.key,e),i.sortedSet.insert(e,null))}delete(e){const i=this.get(e);return i?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(i)):this}isEqual(e){if(!(e instanceof _l)||this.size!==e.size)return!1;const i=this.sortedSet.getIterator(),s=e.sortedSet.getIterator();for(;i.hasNext();){const o=i.getNext().key,c=s.getNext().key;if(!o.isEqual(c))return!1}return!0}toString(){const e=[];return this.forEach((i=>{e.push(i.toString())})),e.length===0?"DocumentSet ()":`DocumentSet (
2810  `+e.join(`  
2811`)+`
2812)`}copy(e,i){const s=new _l;return s.comparator=this.comparator,s.keyedMap=e,s.sortedSet=i,s}}/**
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 E_{constructor(){this.ga=new Ot(Ae.comparator)}track(e){const i=e.doc.key,s=this.ga.get(i);s?e.type!==0&&s.type===3?this.ga=this.ga.insert(i,e):e.type===3&&s.type!==1?this.ga=this.ga.insert(i,{type:s.type,doc:e.doc}):e.type===2&&s.type===2?this.ga=this.ga.insert(i,{type:2,doc:e.doc}):e.type===2&&s.type===0?this.ga=this.ga.insert(i,{type:0,doc:e.doc}):e.type===1&&s.type===0?this.ga=this.ga.remove(i):e.type===1&&s.type===2?this.ga=this.ga.insert(i,{type:1,doc:s.doc}):e.type===0&&s.type===1?this.ga=this.ga.insert(i,{type:2,doc:e.doc}):Ce(63341,{Vt:e,pa:s}):this.ga=this.ga.insert(i,e)}ya(){const e=[];return this.ga.inorderTraversal(((i,s)=>{e.push(s)})),e}}class wl{constructor(e,i,s,o,c,f,y,_,p){this.query=e,this.docs=i,this.oldDocs=s,this.docChanges=o,this.mutatedKeys=c,this.fromCache=f,this.syncStateChanged=y,this.excludesMetadataChanges=_,this.hasCachedResults=p}static fromInitialDocuments(e,i,s,o,c){const f=[];return i.forEach((y=>{f.push({type:0,doc:y})})),new wl(e,i,_l.emptySet(i),f,s,o,!0,!1,c)}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)&&jh(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const i=this.docChanges,s=e.docChanges;if(i.length!==s.length)return!1;for(let o=0;o<i.length;o++)if(i[o].type!==s[o].type||!i[o].doc.isEqual(s[o].doc))return!1;return!0}}/**
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 */class vI{constructor(){this.wa=void 0,this.ba=[]}Sa(){return this.ba.some((e=>e.Da()))}}class _I{constructor(){this.queries=x_(),this.onlineState="Unknown",this.Ca=new Set}terminate(){(function(i,s){const o=je(i),c=o.queries;o.queries=x_(),c.forEach(((f,y)=>{for(const _ of y.ba)_.onError(s)}))})(this,new ce(Z.ABORTED,"Firestore shutting down"))}}function x_(){return new ba((r=>aT(r)),jh)}async function _g(r,e){const i=je(r);let s=3;const o=e.query;let c=i.queries.get(o);c?!c.Sa()&&e.Da()&&(s=2):(c=new vI,s=e.Da()?0:1);try{switch(s){case 0:c.wa=await i.onListen(o,!0);break;case 1:c.wa=await i.onListen(o,!1);break;case 2:await i.onFirstRemoteStoreListen(o)}}catch(f){const y=vg(f,`Initialization of query '${dl(e.query)}' failed`);return void e.onError(y)}i.queries.set(o,c),c.ba.push(e),e.va(i.onlineState),c.wa&&e.Fa(c.wa)&&Tg(i)}async function bg(r,e){const i=je(r),s=e.query;let o=3;const c=i.queries.get(s);if(c){const f=c.ba.indexOf(e);f>=0&&(c.ba.splice(f,1),c.ba.length===0?o=e.Da()?0:1:!c.Sa()&&e.Da()&&(o=2))}switch(o){case 0:return i.queries.delete(s),i.onUnlisten(s,!0);case 1:return i.queries.delete(s),i.onUnlisten(s,!1);case 2:return i.onLastRemoteStoreUnlisten(s);default:return}}function bI(r,e){const i=je(r);let s=!1;for(const o of e){const c=o.query,f=i.queries.get(c);if(f){for(const y of f.ba)y.Fa(o)&&(s=!0);f.wa=o}}s&&Tg(i)}function TI(r,e,i){const s=je(r),o=s.queries.get(e);if(o)for(const c of o.ba)c.onError(i);s.queries.delete(e)}function Tg(r){r.Ca.forEach((e=>{e.next()}))}var Om,A_;(A_=Om||(Om={})).Ma="default",A_.Cache="cache";class Eg{constructor(e,i,s){this.query=e,this.xa=i,this.Oa=!1,this.Na=null,this.onlineState="Unknown",this.options=s||{}}Fa(e){if(!this.options.includeMetadataChanges){const s=[];for(const o of e.docChanges)o.type!==3&&s.push(o);e=new wl(e.query,e.docs,e.oldDocs,s,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let i=!1;return this.Oa?this.Ba(e)&&(this.xa.next(e),i=!0):this.La(e,this.onlineState)&&(this.ka(e),i=!0),this.Na=e,i}onError(e){this.xa.error(e)}va(e){this.onlineState=e;let i=!1;return this.Na&&!this.Oa&&this.La(this.Na,e)&&(this.ka(this.Na),i=!0),i}La(e,i){if(!e.fromCache||!this.Da())return!0;const s=i!=="Offline";return(!this.options.Ka||!s)&&(!e.docs.isEmpty()||e.hasCachedResults||i==="Offline")}Ba(e){if(e.docChanges.length>0)return!0;const i=this.Na&&this.Na.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!i)&&this.options.includeMetadataChanges===!0}ka(e){e=wl.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Oa=!0,this.xa.next(e)}Da(){return this.options.source!==Om.Cache}}/**
2843 * @license
2844 * Copyright 2017 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 */class BT{constructor(e){this.key=e}}class HT{constructor(e){this.key=e}}class EI{constructor(e,i){this.query=e,this.Za=i,this.Xa=null,this.hasCachedResults=!1,this.current=!1,this.Ya=We(),this.mutatedKeys=We(),this.eu=lT(e),this.tu=new _l(this.eu)}get nu(){return this.Za}ru(e,i){const s=i?i.iu:new E_,o=i?i.tu:this.tu;let c=i?i.mutatedKeys:this.mutatedKeys,f=o,y=!1;const _=this.query.limitType==="F"&&o.size===this.query.limit?o.last():null,p=this.query.limitType==="L"&&o.size===this.query.limit?o.first():null;if(e.inorderTraversal(((T,A)=>{const S=o.get(T),z=Vh(this.query,A)?A:null,Q=!!S&&this.mutatedKeys.has(S.key),ie=!!z&&(z.hasLocalMutations||this.mutatedKeys.has(z.key)&&z.hasCommittedMutations);let X=!1;S&&z?S.data.isEqual(z.data)?Q!==ie&&(s.track({type:3,doc:z}),X=!0):this.su(S,z)||(s.track({type:2,doc:z}),X=!0,(_&&this.eu(z,_)>0||p&&this.eu(z,p)<0)&&(y=!0)):!S&&z?(s.track({type:0,doc:z}),X=!0):S&&!z&&(s.track({type:1,doc:S}),X=!0,(_||p)&&(y=!0)),X&&(z?(f=f.add(z),c=ie?c.add(T):c.delete(T)):(f=f.delete(T),c=c.delete(T)))})),this.query.limit!==null)for(;f.size>this.query.limit;){const T=this.query.limitType==="F"?f.last():f.first();f=f.delete(T.key),c=c.delete(T.key),s.track({type:1,doc:T})}return{tu:f,iu:s,Ss:y,mutatedKeys:c}}su(e,i){return e.hasLocalMutations&&i.hasCommittedMutations&&!i.hasLocalMutations}
2857applyChanges(e,i,s,o){const c=this.tu;this.tu=e.tu,this.mutatedKeys=e.mutatedKeys;const f=e.iu.ya();f.sort(((T,A)=>(function(z,Q){const ie=X=>{switch(X){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Ce(20277,{Vt:X})}};return ie(z)-ie(Q)})(T.type,A.type)||this.eu(T.doc,A.doc))),this.ou(s),o=o??!1;const y=i&&!o?this._u():[],_=this.Ya.size===0&&this.current&&!o?1:0,p=_!==this.Xa;return this.Xa=_,f.length!==0||p?{snapshot:new wl(this.query,e.tu,c,f,e.mutatedKeys,_===0,p,!1,!!s&&s.resumeToken.approximateByteSize()>0),au:y}:{au:y}}va(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({tu:this.tu,iu:new E_,mutatedKeys:this.mutatedKeys,Ss:!1},!1)):{au:[]}}uu(e){return!this.Za.has(e)&&!!this.tu.has(e)&&!this.tu.get(e).hasLocalMutations}ou(e){e&&(e.addedDocuments.forEach((i=>this.Za=this.Za.add(i))),e.modifiedDocuments.forEach((i=>{})),e.removedDocuments.forEach((i=>this.Za=this.Za.delete(i))),this.current=e.current)}_u(){if(!this.current)return[];const e=this.Ya;this.Ya=We(),this.tu.forEach((s=>{this.uu(s.key)&&(this.Ya=this.Ya.add(s.key))}));const i=[];return e.forEach((s=>{this.Ya.has(s)||i.push(new HT(s))})),this.Ya.forEach((s=>{e.has(s)||i.push(new BT(s))})),i}cu(e){this.Za=e.ks,this.Ya=We();const i=this.ru(e.documents);return this.applyChanges(i,!0)}lu(){return wl.fromInitialDocuments(this.query,this.tu,this.mutatedKeys,this.Xa===0,this.hasCachedResults)}}const xg="SyncEngine";class xI{constructor(e,i,s){this.query=e,this.targetId=i,this.view=s}}class AI{constructor(e){this.key=e,this.hu=!1}}class SI{constructor(e,i,s,o,c,f){this.localStore=e,this.remoteStore=i,this.eventManager=s,this.sharedClientState=o,this.currentUser=c,this.maxConcurrentLimboResolutions=f,this.Pu={},this.Tu=new ba((y=>aT(y)),jh),this.Iu=new Map,this.Eu=new Set,this.Ru=new Ot(Ae.comparator),this.Au=new Map,this.Vu=new ug,this.du={},this.mu=new Map,this.fu=Sl.ar(),this.onlineState="Unknown",this.gu=void 0}get isPrimaryClient(){return this.gu===!0}}async function wI(r,e,i=!0){const s=YT(r);let o;const c=s.Tu.get(e);return c?(s.sharedClientState.addLocalQueryTarget(c.targetId),o=c.view.lu()):o=await qT(s,e,i,!0),o}async function NI(r,e){const i=YT(r);await qT(i,e,!0,!1)}async function qT(r,e,i,s){const o=await K2(r.localStore,sr(e)),c=o.targetId,f=r.sharedClientState.addLocalQueryTarget(c,i);let y;return s&&(y=await II(r,e,c,f==="current",o.resumeToken)),r.isPrimaryClient&&i&&VT(r.remoteStore,o),y}async function II(r,e,i,s,o){r.pu=(A,S,z)=>(async function(ie,X,ge,Te){let we=X.view.ru(ge);we.Ss&&(we=await p_(ie.localStore,X.query,!1).then((({documents:I})=>X.view.ru(I,we))));const He=Te&&Te.targetChanges.get(X.targetId),ze=Te&&Te.targetMismatches.get(X.targetId)!=null,Ve=X.view.applyChanges(we,ie.isPrimaryClient,He,ze);return w_(ie,X.targetId,Ve.au),Ve.snapshot})(r,A,S,z);const c=await p_(r.localStore,e,!0),f=new EI(e,c.ks),y=f.ru(c.documents),_=mu.createSynthesizedTargetChangeForCurrentChange(i,s&&r.onlineState!=="Offline",o),p=f.applyChanges(y,r.isPrimaryClient,_);w_(r,i,p.au);const T=new xI(e,i,f);return r.Tu.set(e,T),r.Iu.has(i)?r.Iu.get(i).push(e):r.Iu.set(i,[e]),p.snapshot}async function RI(r,e,i){const s=je(r),o=s.Tu.get(e),c=s.Iu.get(o.targetId);if(c.length>1)return s.Iu.set(o.targetId,c.filter((f=>!jh(f,e)))),void s.Tu.delete(e);s.isPrimaryClient?(s.sharedClientState.removeLocalQueryTarget(o.targetId),s.sharedClientState.isActiveQueryTarget(o.targetId)||await Dm(s.localStore,o.targetId,!1).then((()=>{s.sharedClientState.clearQueryState(o.targetId),i&&fg(s.remoteStore,o.targetId),jm(s,o.targetId)})).catch(Ol)):(jm(s,o.targetId),await Dm(s.localStore,o.targetId,!0))}async function CI(r,e){const i=je(r),s=i.Tu.get(e),o=i.Iu.get(s.targetId);i.isPrimaryClient&&o.length===1&&(i.sharedClientState.removeLocalQueryTarget(s.targetId),fg(i.remoteStore,s.targetId))}async function DI(r,e,i){const s=UI(r);try{const o=await(function(f,y){const _=je(f),p=dt.now(),T=y.reduce(((z,Q)=>z.add(Q.key)),We());let A,S;return _.persistence.runTransaction("Locally write mutations","readwrite",(z=>{let Q=Vr(),ie=We();return _.xs.getEntries(z,T).next((X=>{Q=X,Q.forEach(((ge,Te)=>{Te.isValidDocument()||(ie=ie.add(ge))}))})).next((()=>_.localDocuments.getOverlayedDocuments(z,Q))).next((X=>{A=X;const ge=[];for(const Te of y){const we=GN(Te,A.get(Te.key).overlayedDocument);we!=null&&ge.push(new js(Te.key,we,Zb(we.value.mapValue),xi.exists(!0)))}
2857return _.mutationQueue.addMutationBatch(z,p,ge,y)})).next((X=>{S=X;const ge=X.applyToLocalDocumentSet(A,ie);return _.documentOverlayCache.saveOverlays(z,X.batchId,ge)}))})).then((()=>({batchId:S.batchId,changes:uT(A)})))})(s.localStore,e);s.sharedClientState.addPendingMutation(o.batchId),(function(f,y,_){let p=f.du[f.currentUser.toKey()];p||(p=new Ot(Ze)),p=p.insert(y,_),f.du[f.currentUser.toKey()]=p})(s,o.batchId,i),await pu(s,o.changes),await Bh(s.remoteStore)}catch(o){const c=vg(o,"Failed to persist write");i.reject(c)}}async function FT(r,e){const i=je(r);try{const s=await q2(i.localStore,e);e.targetChanges.forEach(((o,c)=>{const f=i.Au.get(c);f&&(ft(o.addedDocuments.size+o.modifiedDocuments.size+o.removedDocuments.size<=1,22616),o.addedDocuments.size>0?f.hu=!0:o.modifiedDocuments.size>0?ft(f.hu,14607):o.removedDocuments.size>0&&(ft(f.hu,42227),f.hu=!1))})),await pu(i,s,e)}catch(s){await Ol(s)}}function S_(r,e,i){const s=je(r);if(s.isPrimaryClient&&i===0||!s.isPrimaryClient&&i===1){const o=[];s.Tu.forEach(((c,f)=>{const y=f.view.va(e);y.snapshot&&o.push(y.snapshot)})),(function(f,y){const _=je(f);_.onlineState=y;let p=!1;_.queries.forEach(((T,A)=>{for(const S of A.ba)S.va(y)&&(p=!0)})),p&&Tg(_)})(s.eventManager,e),o.length&&s.Pu.J_(o),s.onlineState=e,s.isPrimaryClient&&s.sharedClientState.setOnlineState(e)}}async function MI(r,e,i){const s=je(r);s.sharedClientState.updateQueryState(e,"rejected",i);const o=s.Au.get(e),c=o&&o.key;if(c){let f=new Ot(Ae.comparator);f=f.insert(c,Cn.newNoDocument(c,Me.min()));const y=We().add(c),_=new Uh(Me.min(),new Map,new Ot(Ze),f,y);await FT(s,_),s.Ru=s.Ru.remove(c),s.Au.delete(e),Ag(s)}else await Dm(s.localStore,e,!1).then((()=>jm(s,e,i))).catch(Ol)}async function OI(r,e){const i=je(r),s=e.batch.batchId;try{const o=await H2(i.localStore,e);KT(i,s,null),GT(i,s),i.sharedClientState.updateMutationState(s,"acknowledged"),await pu(i,o)}catch(o){await Ol(o)}}async function jI(r,e,i){const s=je(r);try{const o=await(function(f,y){const _=je(f);return _.persistence.runTransaction("Reject batch","readwrite-primary",(p=>{let T;return _.mutationQueue.lookupMutationBatch(p,y).next((A=>(ft(A!==null,37113),T=A.keys(),_.mutationQueue.removeMutationBatch(p,A)))).next((()=>_.mutationQueue.performConsistencyCheck(p))).next((()=>_.documentOverlayCache.removeOverlaysForBatchId(p,T,y))).next((()=>_.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(p,T))).next((()=>_.localDocuments.getDocuments(p,T)))}))})(s.localStore,e);KT(s,e,i),GT(s,e),s.sharedClientState.updateMutationState(e,"rejected",i),await pu(s,o)}catch(o){await Ol(o)}}function GT(r,e){(r.mu.get(e)||[]).forEach((i=>{i.resolve()})),r.mu.delete(e)}function KT(r,e,i){const s=je(r);let o=s.du[s.currentUser.toKey()];if(o){const c=o.get(e);c&&(i?c.reject(i):c.resolve(),o=o.remove(e)),s.du[s.currentUser.toKey()]=o}}function jm(r,e,i=null){r.sharedClientState.removeLocalQueryTarget(e);for(const s of r.Iu.get(e))r.Tu.delete(s),i&&r.Pu.yu(s,i);r.Iu.delete(e),r.isPrimaryClient&&r.Vu.Gr(e).forEach((s=>{r.Vu.containsKey(s)||QT(r,s)}))}function QT(r,e){r.Eu.delete(e.path.canonicalString());const i=r.Ru.get(e);i!==null&&(fg(r.remoteStore,i),r.Ru=r.Ru.remove(e),r.Au.delete(i),Ag(r))}function w_(r,e,i){for(const s of i)s instanceof BT?(r.Vu.addReference(s.key,e),VI(r,s)):s instanceof HT?(de(xg,"Document no longer in limbo: "+s.key),r.Vu.removeReference(s.key,e),r.Vu.containsKey(s.key)||QT(r,s.key)):Ce(19791,{wu:s})}function VI(r,e){const i=e.key,s=i.path.canonicalString();r.Ru.get(i)||r.Eu.has(s)||(de(xg,"New document in limbo: "+i),r.Eu.add(s),Ag(r))}function Ag(r){for(;r.Eu.size>0&&r.Ru.size<r.maxConcurrentLimboResolutions;){const e=r.Eu.values().next().value;r.Eu.delete(e);const i=new Ae(St.fromString(e)),s=r.fu.next();r.Au.set(s,new AI(i)),r.Ru=r.Ru.insert(i,s),VT(r.remoteStore,new Ts(sr(Oh(i.path)),s,"TargetPurposeLimboResolution",Ch.ce))}}async function pu(r,e,i){const s=je(r),o=[],c=[],f=[];s.Tu.isEmpty()||(s.Tu.forEach(((y,_)=>{f.push(s.pu(_,e,i).then((p=>{var T;if((p||i)&&s.isPrimaryClient){const A=p?!p.fromCache:(T=i==null?void 0:i.targetChanges.get(_.targetId))==null?void 0:T.current;
2857s.sharedClientState.updateQueryState(_.targetId,A?"current":"not-current")}if(p){o.push(p);const A=hg.Es(_.targetId,p);c.push(A)}})))})),await Promise.all(f),s.Pu.J_(o),await(async function(_,p){const T=je(_);try{await T.persistence.runTransaction("notifyLocalViewChanges","readwrite",(A=>W.forEach(p,(S=>W.forEach(S.Ts,(z=>T.persistence.referenceDelegate.addReference(A,S.targetId,z))).next((()=>W.forEach(S.Is,(z=>T.persistence.referenceDelegate.removeReference(A,S.targetId,z)))))))))}catch(A){if(!jl(A))throw A;de(dg,"Failed to update sequence numbers: "+A)}for(const A of p){const S=A.targetId;if(!A.fromCache){const z=T.vs.get(S),Q=z.snapshotVersion,ie=z.withLastLimboFreeSnapshotVersion(Q);T.vs=T.vs.insert(S,ie)}}})(s.localStore,c))}async function kI(r,e){const i=je(r);if(!i.currentUser.isEqual(e)){de(xg,"User change. New user:",e.toKey());const s=await DT(i.localStore,e);i.currentUser=e,(function(c,f){c.mu.forEach((y=>{y.forEach((_=>{_.reject(new ce(Z.CANCELLED,f))}))})),c.mu.clear()})(i,"'waitForPendingWrites' promise is rejected due to a user change."),i.sharedClientState.handleUserChange(e,s.removedBatchIds,s.addedBatchIds),await pu(i,s.Ns)}}function LI(r,e){const i=je(r),s=i.Au.get(e);if(s&&s.hu)return We().add(s.key);{let o=We();const c=i.Iu.get(e);if(!c)return o;for(const f of c){const y=i.Tu.get(f);o=o.unionWith(y.view.nu)}return o}}function YT(r){const e=je(r);return e.remoteStore.remoteSyncer.applyRemoteEvent=FT.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=LI.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=MI.bind(null,e),e.Pu.J_=bI.bind(null,e.eventManager),e.Pu.yu=TI.bind(null,e.eventManager),e}function UI(r){const e=je(r);return e.remoteStore.remoteSyncer.applySuccessfulWrite=OI.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=jI.bind(null,e),e}class Th{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=Ph(e.databaseInfo.databaseId),this.sharedClientState=this.Du(e),this.persistence=this.Cu(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Fu(e,this.localStore),this.indexBackfillerScheduler=this.Mu(e,this.localStore)}Fu(e,i){return null}Mu(e,i){return null}vu(e){return B2(this.persistence,new U2,e.initialUser,this.serializer)}Cu(e){return new CT(cg.Vi,this.serializer)}Du(e){return new Y2}async terminate(){var e,i;(e=this.gcScheduler)==null||e.stop(),(i=this.indexBackfillerScheduler)==null||i.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}Th.provider={build:()=>new Th};class PI extends Th{constructor(e){super(),this.cacheSizeBytes=e}Fu(e,i){ft(this.persistence.referenceDelegate instanceof _h,46915);const s=this.persistence.referenceDelegate.garbageCollector;return new x2(s,e.asyncQueue,i)}Cu(e){const i=this.cacheSizeBytes!==void 0?Yn.withCacheSize(this.cacheSizeBytes):Yn.DEFAULT;return new CT((s=>_h.Vi(s,i)),this.serializer)}}class Vm{async initialize(e,i){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(i),this.remoteStore=this.createRemoteStore(i),this.eventManager=this.createEventManager(i),this.syncEngine=this.createSyncEngine(i,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=s=>S_(this.syncEngine,s,1),this.remoteStore.remoteSyncer.handleCredentialChange=kI.bind(null,this.syncEngine),await yI(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return(function(){return new _I})()}createDatastore(e){const i=Ph(e.databaseInfo.databaseId),s=W2(e.databaseInfo);return rI(e.authCredentials,e.appCheckCredentials,s,i)}createRemoteStore(e){return(function(s,o,c,f,y){return new aI(s,o,c,f,y)})(this.localStore,this.datastore,e.asyncQueue,(i=>S_(this.syncEngine,i,0)),(function(){return __.v()?new __:new $2})())}createSyncEngine(e,i){return(function(o,c,f,y,_,p,T){const A=new SI(o,c,f,y,_,p);return T&&(A.gu=!0),A})(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,i)}async terminate(){var e,i;await(async function(o){const c=je(o);de(va,"RemoteStore shutting down."),c.Ea.add(5),await gu(c),c.Aa.shutdown(),c.Va.set("Unknown")})(this.remoteStore),(e=this.datastore)==null||e.terminate(),(i=this.eventManager)==null||i.terminate()}}Vm.provider={build:()=>new Vm};/**
2858 * @license
2859 * Copyright 2020 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 *//**
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 */class Sg{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Ou(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Ou(this.observer.error,e):jr("Uncaught Error in snapshot listener:",e.toString()))}Nu(){this.muted=!0}Ou(e,i){setTimeout((()=>{this.muted||e(i)}),0)}}/**
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 */const Ms="FirestoreClient";class zI{constructor(e,i,s,o,c){this.authCredentials=e,this.appCheckCredentials=i,this.asyncQueue=s,this._databaseInfo=o,this.user=Rn.UNAUTHENTICATED,this.clientId=Zm.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=c,this.authCredentials.start(s,(async f=>{de(Ms,"Received user=",f.uid),await this.authCredentialListener(f),this.user=f})),this.appCheckCredentials.start(s,(f=>(de(Ms,"Received new app check token=",f),this.appCheckCredentialListener(f,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 Dr;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(i){const s=vg(i,"Failed to shutdown persistence");e.reject(s)}})),e.promise}}async function cm(r,e){r.asyncQueue.verifyOperationInProgress(),de(Ms,"Initializing OfflineComponentProvider");const i=r.configuration;await e.initialize(i);let s=i.initialUser;r.setCredentialChangeListener((async o=>{s.isEqual(o)||(await DT(e.localStore,o),s=o)})),e.persistence.setDatabaseDeletedListener((()=>r.terminate())),r._offlineComponents=e}async function N_(r,e){r.asyncQueue.verifyOperationInProgress();const i=await BI(r);de(Ms,"Initializing OnlineComponentProvider"),await e.initialize(i,r.configuration),r.setCredentialChangeListener((s=>T_(e.remoteStore,s))),r.setAppCheckTokenChangeListener(((s,o)=>T_(e.remoteStore,o))),r._onlineComponents=e}async function BI(r){if(!r._offlineComponents)if(r._uninitializedComponentsProvider){de(Ms,"Using user provided OfflineComponentProvider");try{await cm(r,r._uninitializedComponentsProvider._offline)}catch(e){const i=e;if(!(function(o){return o.name==="FirebaseError"?o.code===Z.FAILED_PRECONDITION||o.code===Z.UNIMPLEMENT
2902ED:!(typeof DOMException<"u"&&o instanceof DOMException)||o.code===22||o.code===20||o.code===11})(i))throw i;ya("Error using user provided cache. Falling back to memory cache: "+i),await cm(r,new Th)}}else de(Ms,"Using default OfflineComponentProvider"),await cm(r,new PI(void 0));return r._offlineComponents}async function $T(r){return r._onlineComponents||(r._uninitializedComponentsProvider?(de(Ms,"Using user provided OnlineComponentProvider"),await N_(r,r._uninitializedComponentsProvider._online)):(de(Ms,"Using default OnlineComponentProvider"),await N_(r,new Vm))),r._onlineComponents}function HI(r){return $T(r).then((e=>e.syncEngine))}async function Eh(r){const e=await $T(r),i=e.eventManager;return i.onListen=wI.bind(null,e.syncEngine),i.onUnlisten=RI.bind(null,e.syncEngine),i.onFirstRemoteStoreListen=NI.bind(null,e.syncEngine),i.onLastRemoteStoreUnlisten=CI.bind(null,e.syncEngine),i}function qI(r,e,i,s){const o=new Sg(s),c=new Eg(e,o,i);return r.asyncQueue.enqueueAndForget((async()=>_g(await Eh(r),c))),()=>{o.Nu(),r.asyncQueue.enqueueAndForget((async()=>bg(await Eh(r),c)))}}function FI(r,e,i={}){const s=new Dr;return r.asyncQueue.enqueueAndForget((async()=>(function(c,f,y,_,p){const T=new Sg({next:S=>{T.Nu(),f.enqueueAndForget((()=>bg(c,A)));const z=S.docs.has(y);!z&&S.fromCache?p.reject(new ce(Z.UNAVAILABLE,"Failed to get document because the client is offline.")):z&&S.fromCache&&_&&_.source==="server"?p.reject(new ce(Z.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.)')):p.resolve(S)},error:S=>p.reject(S)}),A=new Eg(Oh(y.path),T,{includeMetadataChanges:!0,Ka:!0});return _g(c,A)})(await Eh(r),r.asyncQueue,e,i,s))),s.promise}function GI(r,e,i={}){const s=new Dr;return r.asyncQueue.enqueueAndForget((async()=>(function(c,f,y,_,p){const T=new Sg({next:S=>{T.Nu(),f.enqueueAndForget((()=>bg(c,A))),S.fromCache&&_.source==="server"?p.reject(new ce(Z.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.)')):p.resolve(S)},error:S=>p.reject(S)}),A=new Eg(y,T,{includeMetadataChanges:!0,Ka:!0});return _g(c,A)})(await Eh(r),r.asyncQueue,e,i,s))),s.promise}function KI(r,e){const i=new Dr;return r.asyncQueue.enqueueAndForget((async()=>DI(await HI(r),e,i))),i.promise}/**
2903 * @license
2904 * Copyright 2023 Google LLC
2905 *
2906 * Licensed under the Apache License, Version 2.0 (the "License");
2907 * you may not use this file except in compliance with the License.
2908 * You may obtain a copy of the License at
2909 *
2910 *   http://www.apache.org/licenses/LICENSE-2.0
2911 *
2912 * Unless required by applicable law or agreed to in writing, software
2913 * distributed under the License is distributed on an "AS IS" BASIS,
2914 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2915 * See the License for the specific language governing permissions and
2916 * limitations under the License.
2917 */function XT(r){const e={};return r.timeoutSeconds!==void 0&&(e.timeoutSeconds=r.timeoutSeconds),e}/**
2918 * @license
2919 * Copyright 2020 Google LLC
2920 *
2921 * Licensed under the Apache License, Version 2.0 (the "License");
2922 * you may not use this file except in compliance with the License.
2923 * You may obtain a copy of the License at
2924 *
2925 *   http://www.apache.org/licenses/LICENSE-2.0
2926 *
2927 * Unless required by applicable law or agreed to in writing, software
2928 * distributed under the License is distributed on an "AS IS" BASIS,
2929 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2930 * See the License for the specific language governing permissions and
2931 * limitations under the License.
2932 */const QI="ComponentProvider",I_=new Map;function YI(r,e,i,s,o){return new fN(r,e,i,o.host,o.ssl,o.experimentalForceLongPolling,o.experimentalAutoDetectLongPolling,XT(o.experimentalLongPollingOptions),o.useFetchStreams,o.isUsingEmulator,s)}/**
2933 * @license
2934 * Copyright 2020 Google LLC
2935 *
2936 * Licensed under the Apache License, Version 2.0 (the "License");
2937 * you may not use this file except in compliance with the License.
2938 * You may obtain a copy of the License at
2939 *
2940 *   http://www.apache.org/licenses/LICENSE-2.0
2941 *
2942 * Unless required by applicable law or agreed to in writing, software
2943 * distributed under the License is distributed on an "AS IS" BASIS,
2944 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2945 * See the License for the specific language governing permissions and
2946 * limitations under the License.
2947 */const JT="firestore.googleapis.com",R_=!0;class C_{constructor(e){if(e.host===void 0){if(e.ssl!==void 0)throw new ce(Z.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=JT,this.ssl=R_}else this.host=e.host,this.ssl=e.ssl??R_;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=RT;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<T2)throw new ce(Z.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}nN("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=XT(e.experimentalLongPollingOptions??{}),(function(s){if(s.timeoutSeconds!==void 0){if(isNaN(s.timeoutSeconds))throw new ce(Z.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (must not be NaN)`);if(s.timeoutSeconds<5)throw new ce(Z.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (minimum allowed value is 5)`);if(s.timeoutSeconds>30)throw new ce(Z.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(s,o){return s.timeoutSeconds===o.timeoutSeconds})(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class Hh{constructor(e,i,s,o){this._authCredentials=e,this._appCheckCredentials=i,this._databaseId=s,this._app=o,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new C_({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new ce(Z.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 ce(Z.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 C_(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=(function(s){if(!s)return new Kw;switch(s.type){case"firstParty":return new Xw(s.sessionIndex||"0",s.iamToken||null,s.authTokenFactory||null);case"provider":return s.client;default:throw new ce(Z.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(i){const s=I_.get(i);s&&(de(QI,"Removing Datastore"),I_.delete(i),s.terminate())})(this),Promise.resolve()}}function $I(r,e,i,s={}){var p;r=Xn(r,Hh);const o=Rl(e),c=r._getSettings(),f={...c,emulatorOptions:r._getEmulatorOptions()},y=`${e}:${i}`;o&&($_(`https://${y}`),X_("Firestore",!0)),c.host!==JT&&c.host!==y&&ya("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const _={...c,host:y,ssl:o,emulatorOptions:s};if(!fa(_,f)&&(r._setSettings(_),s.mockUserToken)){let T,A;if(typeof s.mockUserToken=="string")T=s.mockUserToken,A=Rn.MOCK_USER;else{T=y1(s.mockUserToken,(p=r._app)==null?void 0:p.options.projectId);const S=s.mockUserToken.sub||s.mockUserToken.user_id;if(!S)throw new ce(Z.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");A=new Rn(S)}r._authCredentials=new Qw(new zb(T,A))}}/**
2948 * @license
2949 * Copyright 2020 Google LLC
2950 *
2951 * Licensed under the Apache License, Version 2.0 (the "License");
2952 * you may not use this file except in compliance with the License.
2953 * You may obtain a copy of the License at
2954 *
2955 *   http://www.apache.org/licenses/LICENSE-2.0
2956 *
2957 * Unless required by applicable law or agreed to in writing, software
2958 * distributed under the License is distributed on an "AS IS" BASIS,
2959 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2960 * See the License for the specific language governing permissions and
2961 * limitations under the License.
2962 */class Ea{constructor(e,i,s){this.converter=i,this._query=s,this.type="query",this.firestore=e}withConverter(e){return new Ea(this.firestore,e,this._query)}}class Ut{constructor(e,i,s){this.converter=i,this._key=s,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 ws(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Ut(this.firestore,e,this._key)}toJSON(){return{type:Ut._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,i,s){if(hu(i,Ut._jsonSchema))return new Ut(e,s||null,new Ae(St.fromString(i.referencePath)))}}Ut._jsonSchemaVersion="firestore/documentReference/1.0",Ut._jsonSchema={type:en("string",Ut._jsonSchemaVersion),referencePath:en("string")};
2962class ws extends Ea{constructor(e,i,s){super(e,i,Oh(s)),this._path=s,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 Ut(this.firestore,null,new Ae(e))}withConverter(e){return new ws(this.firestore,e,this._path)}}function xa(r,e,...i){if(r=cn(r),Bb("collection","path",e),r instanceof Hh){const s=St.fromString(e,...i);return qv(s),new ws(r,null,s)}{if(!(r instanceof Ut||r instanceof ws))throw new ce(Z.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=r._path.child(St.fromString(e,...i));return qv(s),new ws(r.firestore,null,s)}}function Ai(r,e,...i){if(r=cn(r),arguments.length===1&&(e=Zm.newId()),Bb("doc","path",e),r instanceof Hh){const s=St.fromString(e,...i);return Hv(s),new Ut(r,null,new Ae(s))}{if(!(r instanceof Ut||r instanceof ws))throw new ce(Z.INVALID_ARGUMENT,"Expected first argument to doc() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=r._path.child(St.fromString(e,...i));return Hv(s),new Ut(r.firestore,r instanceof ws?r.converter:null,new Ae(s))}}/**
2963 * @license
2964 * Copyright 2020 Google LLC
2965 *
2966 * Licensed under the Apache License, Version 2.0 (the "License");
2967 * you may not use this file except in compliance with the License.
2968 * You may obtain a copy of the License at
2969 *
2970 *   http://www.apache.org/licenses/LICENSE-2.0
2971 *
2972 * Unless required by applicable law or agreed to in writing, software
2973 * distributed under the License is distributed on an "AS IS" BASIS,
2974 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2975 * See the License for the specific language governing permissions and
2976 * limitations under the License.
2977 */const D_="AsyncQueue";class M_{constructor(e=Promise.resolve()){this.Yu=[],this.ec=!1,this.tc=[],this.nc=null,this.rc=!1,this.sc=!1,this.oc=[],this.M_=new OT(this,"async_queue_retry"),this._c=()=>{const s=um();s&&de(D_,"Visibility state changed to "+s.visibilityState),this.M_.w_()},this.ac=e;const i=um();i&&typeof i.addEventListener=="function"&&i.addEventListener("visibilitychange",this._c)}get isShuttingDown(){return this.ec}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.uc(),this.cc(e)}enterRestrictedMode(e){if(!this.ec){this.ec=!0,this.sc=e||!1;const i=um();i&&typeof i.removeEventListener=="function"&&i.removeEventListener("visibilitychange",this._c)}}enqueue(e){if(this.uc(),this.ec)return new Promise((()=>{}));const i=new Dr;return this.cc((()=>this.ec&&this.sc?Promise.resolve():(e().then(i.resolve,i.reject),i.promise))).then((()=>i.promise))}enqueueRetryable(e){this.enqueueAndForget((()=>(this.Yu.push(e),this.lc())))}async lc(){if(this.Yu.length!==0){try{await this.Yu[0](),this.Yu.shift(),this.M_.reset()}catch(e){if(!jl(e))throw e;de(D_,"Operation failed with retryable error: "+e)}this.Yu.length>0&&this.M_.p_((()=>this.lc()))}}cc(e){const i=this.ac.then((()=>(this.rc=!0,e().catch((s=>{throw this.nc=s,this.rc=!1,jr("INTERNAL UNHANDLED ERROR: ",O_(s)),s})).then((s=>(this.rc=!1,s))))));return this.ac=i,i}enqueueAfterDelay(e,i,s){this.uc(),this.oc.indexOf(e)>-1&&(i=0);const o=yg.createAndSchedule(this,e,i,s,(c=>this.hc(c)));return this.tc.push(o),o}uc(){this.nc&&Ce(47125,{Pc:O_(this.nc)})}verifyOperationInProgress(){}async Tc(){let e;do e=this.ac,await e;while(e!==this.ac)}Ic(e){for(const i of this.tc)if(i.timerId===e)return!0;return!1}Ec(e){return this.Tc().then((()=>{this.tc.sort(((i,s)=>i.targetTimeMs-s.targetTimeMs));for(const i of this.tc)if(i.skipDelay(),e!=="all"&&i.timerId===e)break;return this.Tc()}))}Rc(e){this.oc.push(e)}hc(e){const i=this.tc.indexOf(e);this.tc.splice(i,1)}}function O_(r){let e=r.message||"";return r.stack&&(e=r.stack.includes(r.message)?r.stack:r.message+`
2978`+r.stack),e}class kr extends Hh{constructor(e,i,s,o){super(e,i,s,o),this.type="firestore",this._queue=new M_,this._persistenceKey=(o==null?void 0:o.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new M_(e),this._firestoreClient=void 0,await e}}}function XI(r,e){const i=typeof r=="object"?r:eb(),s=typeof r=="string"?r:fh,o=zm(i,"firestore").getImmediate({identifier:s});if(!o._initialized){const c=g1("firestore");c&&$I(o,...c)}return o}function qh(r){if(r._terminated)throw new ce(Z.FAILED_PRECONDITION,"The client has already been terminated.");return r._firestoreClient||JI(r),r._firestoreClient}function JI(r){var s,o,c,f;const e=r._freezeSettings(),i=YI(r._databaseId,((s=r._app)==null?void 0:s.options.appId)||"",r._persistenceKey,(o=r._app)==null?void 0:o.options.apiKey,e);r._componentsProvider||(c=e.localCache)!=null&&c._offlineComponentProvider&&((f=e.localCache)!=null&&f._onlineComponentProvider)&&(r._componentsProvider={_offline:e.localCache._offlineComponentProvider,_online:e.localCache._onlineComponentProvider}),r._firestoreClient=new zI(r._authCredentials,r._appCheckCredentials,r._queue,i,r._componentsProvider&&(function(_){const p=_==null?void 0:_._online.build();return{_offline:_==null?void 0:_._offline.build(p),_online:p}})(r._componentsProvider))}/**
2979 * @license
2980 * Copyright 2020 Google LLC
2981 *
2982 * Licensed under the Apache License, Version 2.0 (the "License");
2983 * you may not use this file except in compliance with the License.
2984 * You may obtain a copy of the License at
2985 *
2986 *   http://www.apache.org/licenses/LICENSE-2.0
2987 *
2988 * Unless required by applicable law or agreed to in writing, software
2989 * distributed under the License is distributed on an "AS IS" BASIS,
2990 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2991 * See the License for the specific language governing permissions and
2992 * limitations under the License.
2993 */class Ei{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Ei(En.fromBase64String(e))}catch(i){throw new ce(Z.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+i)}}static fromUint8Array(e){return new Ei(En.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:Ei._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(hu(e,Ei._jsonSchema))return Ei.fromBase64String(e.bytes)}}Ei._jsonSchemaVersion="firestore/bytes/1.0",Ei._jsonSchema={type:en("string",Ei._jsonSchemaVersion),bytes:en("string")};/**
2994 * @license
2995 * Copyright 2020 Google LLC
2996 *
2997 * Licensed under the Apache License, Version 2.0 (the "License");
2998 * you may not use this file except in compliance with the License.
2999 * You may obtain a copy of the License at
3000 *
3001 *   http://www.apache.org/licenses/LICENSE-2.0
3002 *
3003 * Unless required by applicable law or agreed to in writing, software
3004 * distributed under the License is distributed on an "AS IS" BASIS,
3005 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3006 * See the License for the specific language governing permissions and
3007 * limitations under the License.
3008 */class wg{constructor(...e){for(let i=0;i<e.length;++i)if(e[i].length===0)throw new ce(Z.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Tn(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}/**
3009 * @license
3010 * Copyright 2020 Google LLC
3011 *
3012 * Licensed under the Apache License, Version 2.0 (the "License");
3013 * you may not use this file except in compliance with the License.
3014 * You may obtain a copy of the License at
3015 *
3016 *   http://www.apache.org/licenses/LICENSE-2.0
3017 *
3018 * Unless required by applicable law or agreed to in writing, software
3019 * distributed under the License is distributed on an "AS IS" BASIS,
3020 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3021 * See the License for the specific language governing permissions and
3022 * limitations under the License.
3023 */class Fh{constructor(e){this._methodName=e}}/**
3024 * @license
3025 * Copyright 2017 Google LLC
3026 *
3027 * Licensed under the Apache License, Version 2.0 (the "License");
3028 * you may not use this file except in compliance with the License.
3029 * You may obtain a copy of the License at
3030 *
3031 *   http://www.apache.org/licenses/LICENSE-2.0
3032 *
3033 * Unless required by applicable law or agreed to in writing, software
3034 * distributed under the License is distributed on an "AS IS" BASIS,
3035 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3036 * See the License for the specific language governing permissions and
3037 * limitations under the License.
3038 */class lr{constructor(e,i){if(!isFinite(e)||e<-90||e>90)throw new ce(Z.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(i)||i<-180||i>180)throw new ce(Z.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+i);this._lat=e,this._long=i}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return Ze(this._lat,e._lat)||Ze(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:lr._jsonSchemaVersion}}static fromJSON(e){if(hu(e,lr._jsonSchema))return new lr(e.latitude,e.longitude)}}lr._jsonSchemaVersion="firestore/geoPoint/1.0",lr._jsonSchema={type:en("string",lr._jsonSchemaVersion),latitude:en("number"),longitude:en("number")};/**
3039 * @license
3040 * Copyright 2024 Google LLC
3041 *
3042 * Licensed under the Apache License, Version 2.0 (the "License");
3043 * you may not use this file except in compliance with the License.
3044 * You may obtain a copy of the License at
3045 *
3046 *   http://www.apache.org/licenses/LICENSE-2.0
3047 *
3048 * Unless required by applicable law or agreed to in writing, software
3049 * distributed under the License is distributed on an "AS IS" BASIS,
3050 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3051 * See the License for the specific language governing permissions and
3052 * limitations under the License.
3053 */class Ui{constructor(e){this._values=(e||[]).map((i=>i))}toArray(){return this._values.map((e=>e))}isEqual(e){return(function(s,o){if(s.length!==o.length)return!1;for(let c=0;c<s.length;++c)if(s[c]!==o[c])return!1;return!0})(this._values,e._values)}toJSON(){return{type:Ui._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(e){if(hu(e,Ui._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every((i=>typeof i=="number")))return new Ui(e.vectorValues);throw new ce(Z.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}Ui._jsonSchemaVersion="firestore/vectorValue/1.0",Ui._jsonSchema={type:en("string",Ui._jsonSchemaVersion),vectorValues:en("object")};/**
3054 * @license
3055 * Copyright 2017 Google LLC
3056 *
3057 * Licensed under the Apache License, Version 2.0 (the "License");
3058 * you may not use this file except in compliance with the License.
3059 * You may obtain a copy of the License at
3060 *
3061 *   http://www.apache.org/licenses/LICENSE-2.0
3062 *
3063 * Unless required by applicable law or agreed to in writing, software
3064 * distributed under the License is distributed on an "AS IS" BASIS,
3065 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3066 * See the License for the specific language governing permissions and
3067 * limitations under the License.
3068 */const ZI=/^__.*__$/;class WI{constructor(e,i,s){this.data=e,this.fieldMask=i,this.fieldTransforms=s}toMutation(e,i){return this.fieldMask!==null?new js(e,this.data,this.fieldMask,i,this.fieldTransforms):new fu(e,this.data,i,this.fieldTransforms)}}class ZT{constructor(e,i,s){this.data=e,this.fieldMask=i,this.fieldTransforms=s}toMutation(e,i){return new js(e,this.data,this.fieldMask,i,this.fieldTransforms)}}function WT(r){switch(r){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Ce(40011,{dataSource:r})}}class Ng{constructor(e,i,s,o,c,f){this.settings=e,this.databaseId=i,this.serializer=s,this.ignoreUndefinedProperties=o,c===void 0&&this.validatePath(),this.fieldTransforms=c||[],this.fieldMask=f||[]}get path(){return this.settings.path}get dataSource(){return this.settings.dataSource}contextWith(e){return new Ng({...this.settings,...e},this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}childContextForField(e){var o;const i=(o=this.path)==null?void 0:o.child(e),s=this.contextWith({path:i,arrayElement:!1});return s.validatePathSegment(e),s}childContextForFieldPath(e){var o;const i=(o=this.path)==null?void 0:o.child(e),s=this.contextWith({path:i,arrayElement:!1});return s.validatePath(),s}childContextForArray(e){return this.contextWith({path:void 0,arrayElement:!0})}createError(e){return xh(e,this.settings.methodName,this.settings.hasConverter||!1,this.path,this.settings.targetDoc)}contains(e){return this.fieldMask.find((i=>e.isPrefixOf(i)))!==void 0||this.fieldTransforms.find((i=>e.isPrefixOf(i.field)))!==void 0}validatePath(){if(this.path)for(let e=0;e<this.path.length;e++)this.validatePathSegment(this.path.get(e))}validatePathSegment(e){if(e.length===0)throw this.createError("Document fields must not be empty");if(WT(this.dataSource)&&ZI.test(e))throw this.createError('Document fields cannot begin and end with "__"')}}class eR{constructor(e,i,s){this.databaseId=e,this.ignoreUndefinedProperties=i,this.serializer=s||Ph(e)}createContext(e,i,s,o=!1){return new Ng({dataSource:e,methodName:i,targetDoc:s,path:Tn.emptyPath(),arrayElement:!1,hasConverter:o},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function Gh(r){const e=r._freezeSettings(),i=Ph(r._databaseId);return new eR(r._databaseId,!!e.ignoreUndefinedProperties,i)}function eE(r,e,i,s,o,c={}){const f=r.createContext(c.merge||c.mergeFields?2:0,e,i,o);Rg("Data must be an object, but it was:",f,s);const y=tE(s,f);let _,p;if(c.merge)_=new oi(f.fieldMask),p=f.fieldTransforms;else if(c.mergeFields){const T=[];for(const A of c.mergeFields){const S=Nl(e,A,i);if(!f.contains(S))throw new ce(Z.INVALID_ARGUMENT,`Field '${S}' is specified in your field mask but missing from your input data.`);rE(T,S)||T.push(S)}_=new oi(T),p=f.fieldTransforms.filter((A=>_.covers(A.field)))}else _=null,p=f.fieldTransforms;return new WI(new $n(y),_,p)}class Kh extends Fh{_toFieldTransform(e){if(e.dataSource!==2)throw e.dataSource===1?e.createError(`${this._methodName}() can only appear at the top level of your update data`):e.createError(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof Kh}}class Ig extends Fh{_toFieldTransform(e){return new BN(e.path,new iu)}isEqual(e){return e instanceof Ig}}function tR(r,e,i,s){const o=r.createContext(1,e,i);Rg("Data must be an object, but it was:",o,s);const c=[],f=$n.empty();Os(s,((_,p)=>{const T=iE(e,_,i);p=cn(p);const A=o.childContextForFieldPath(T);if(p instanceof Kh)c.push(T);else{const S=yu(p,A);S!=null&&(c.push(T),f.set(T,S))}}));const y=new oi(c);return new ZT(f,y,o.fieldTransforms)}function nR(r,e,i,s,o,c){const f=r.createContext(1,e,i),y=[Nl(e,s,i)],_=[o];if(c.length%2!=0)throw new ce(Z.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let S=0;S<c.length;S+=2)y.push(Nl(e,c[S])),_.push(c[S+1]);const p=[],T=$n.empty();for(let S=y.length-1;S>=0;--S)if(!rE(p,y[S])){const z=y[S];let Q=_[S];Q=cn(Q);const ie=f.childContextForFieldPath(z);if(Q instanceof Kh)p.push(z);else{const X=yu(Q,ie);X!=null&&(p.push(z),T.set(z,X))}}const A=new oi(p);return new ZT(T,A,f.fieldTransforms)}function iR(r,e,i,s=!1){return yu(i,r.createContext(s?4:3,e))}function yu(r,e){if(nE(r=cn(r)))return Rg("Unsupported field value:",e,r),tE(r,e);if(r instanceof Fh)return(function(s,o){if(!WT(o.dataSource))throw o.createError(`${s._methodName}
3068() can only be used with update() and set()`);if(!o.path)throw o.createError(`${s._methodName}() is not currently supported inside arrays`);const c=s._toFieldTransform(o);c&&o.fieldTransforms.push(c)})(r,e),null;if(r===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),r instanceof Array){if(e.settings.arrayElement&&e.dataSource!==4)throw e.createError("Nested arrays are not supported");return(function(s,o){const c=[];let f=0;for(const y of s){let _=yu(y,o.childContextForArray(f));_==null&&(_={nullValue:"NULL_VALUE"}),c.push(_),f++}return{arrayValue:{values:c}}})(r,e)}return(function(s,o){if((s=cn(s))===null)return{nullValue:"NULL_VALUE"};if(typeof s=="number")return UN(o.serializer,s);if(typeof s=="boolean")return{booleanValue:s};if(typeof s=="string")return{stringValue:s};if(s instanceof Date){const c=dt.fromDate(s);return{timestampValue:vh(o.serializer,c)}}if(s instanceof dt){const c=new dt(s.seconds,1e3*Math.floor(s.nanoseconds/1e3));return{timestampValue:vh(o.serializer,c)}}if(s instanceof lr)return{geoPointValue:{latitude:s.latitude,longitude:s.longitude}};if(s instanceof Ei)return{bytesValue:TT(o.serializer,s._byteString)};if(s instanceof Ut){const c=o.databaseId,f=s.firestore._databaseId;if(!f.isEqual(c))throw o.createError(`Document reference is for database ${f.projectId}/${f.database} but should be for database ${c.projectId}/${c.database}`);return{referenceValue:og(s.firestore._databaseId||o.databaseId,s._key.path)}}if(s instanceof Ui)return(function(f,y){const _=f instanceof Ui?f.toArray():f;return{mapValue:{fields:{[Xb]:{stringValue:Jb},[mh]:{arrayValue:{values:_.map((T=>{if(typeof T!="number")throw y.createError("VectorValues must only contain numeric values.");return rg(y.serializer,T)}))}}}}}})(s,o);if(IT(s))return s._toProto(o.serializer);throw o.createError(`Unsupported field value: ${Rh(s)}`)})(r,e)}function tE(r,e){const i={};return Fb(r)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Os(r,((s,o)=>{const c=yu(o,e.childContextForField(s));c!=null&&(i[s]=c)})),{mapValue:{fields:i}}}function nE(r){return!(typeof r!="object"||r===null||r instanceof Array||r instanceof Date||r instanceof dt||r instanceof lr||r instanceof Ei||r instanceof Ut||r instanceof Fh||r instanceof Ui||IT(r))}function Rg(r,e,i){if(!nE(i)||!Hb(i)){const s=Rh(i);throw s==="an object"?e.createError(r+" a custom object"):e.createError(r+" "+s)}}
vendor: 4,204 bytes, lines 3068-3102
3068function Nl(r,e,i){if((e=cn(e))instanceof wg)return e._internalPath;if(typeof e=="string")return iE(r,e);throw xh("Field path arguments must be of type string or ",r,!1,void 0,i)}const rR=new RegExp("[~\\*/\\[\\]]");function iE(r,e,i){if(e.search(rR)>=0)throw xh(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,r,!1,void 0,i);try{return new wg(...e.split("."))._internalPath}catch{throw xh(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,r,!1,void 0,i)}}function xh(r,e,i,s,o){const c=s&&!s.isEmpty(),f=o!==void 0;let y=`Function ${e}() called with invalid data`;i&&(y+=" (via `toFirestore()`)"),y+=". ";let _="";return(c||f)&&(_+=" (found",c&&(_+=` in field ${s}`),f&&(_+=` in document ${o}`),_+=")"),new ce(Z.INVALID_ARGUMENT,y+r+_)}function rE(r,e){return r.some((i=>i.isEqual(e)))}/**
3069 * @license
3070 * Copyright 2020 Google LLC
3071 *
3072 * Licensed under the Apache License, Version 2.0 (the "License");
3073 * you may not use this file except in compliance with the License.
3074 * You may obtain a copy of the License at
3075 *
3076 *   http://www.apache.org/licenses/LICENSE-2.0
3077 *
3078 * Unless required by applicable law or agreed to in writing, software
3079 * distributed under the License is distributed on an "AS IS" BASIS,
3080 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3081 * See the License for the specific language governing permissions and
3082 * limitations under the License.
3083 */class sR{convertValue(e,i="none"){switch(Cs(e)){case 0:return null;case 1:return e.booleanValue;case 2:return qt(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,i);case 5:return e.stringValue;case 6:return this.convertBytes(Rs(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,i);case 11:return this.convertObject(e.mapValue,i);case 10:return this.convertVectorValue(e.mapValue);default:throw Ce(62114,{value:e})}}convertObject(e,i){return this.convertObjectMap(e.fields,i)}convertObjectMap(e,i="none"){const s={};return Os(e,((o,c)=>{s[o]=this.convertValue(c,i)})),s}convertVectorValue(e){var s,o,c;const i=(c=(o=(s=e.fields)==null?void 0:s[mh].arrayValue)==null?void 0:o.values)==null?void 0:c.map((f=>qt(f.doubleValue)));return new Ui(i)}convertGeoPoint(e){return new lr(qt(e.latitude),qt(e.longitude))}convertArray(e,i){return(e.values||[]).map((s=>this.convertValue(s,i)))}convertServerTimestamp(e,i){switch(i){case"previous":const s=Mh(e);return s==null?null:this.convertValue(s,i);case"estimate":return this.convertTimestamp(eu(e));default:return null}}convertTimestamp(e){const i=Is(e);return new dt(i.seconds,i.nanos)}convertDocumentKey(e,i){const s=St.fromString(e);ft(NT(s),9688,{name:e});const o=new tu(s.get(1),s.get(3)),c=new Ae(s.popFirst(5));return o.isEqual(i)||jr(`Document ${c} contains a document reference within a different database (${o.projectId}/${o.database}) which is not supported. It will be treated as a reference in the current database (${i.projectId}/${i.database}) instead.`),c}}/**
3084 * @license
3085 * Copyright 2024 Google LLC
3086 *
3087 * Licensed under the Apache License, Version 2.0 (the "License");
3088 * you may not use this file except in compliance with the License.
3089 * You may obtain a copy of the License at
3090 *
3091 *   http://www.apache.org/licenses/LICENSE-2.0
3092 *
3093 * Unless required by applicable law or agreed to in writing, software
3094 * distributed under the License is distributed on an "AS IS" BASIS,
3095 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3096 * See the License for the specific language governing permissions and
3097 * limitations under the License.
3098 */class Cg extends sR{constructor(e){super(),this.firestore=e}convertBytes(e){return new Ei(e)}convertReference(e){const i=this.convertDocumentKey(e,this.firestore._databaseId);return new Ut(this.firestore,null,i)}}function Qh(){return new Ig("serverTimestamp")}const j_="@firebase/firestore",V_="4.11.0";/**
3099 * @license
3100 * Copyright 2017 Google LLC
3101 *
3102 * Licensed under the Apache License, Version 2.0 (the "License");
3103 * you may not use this file except in compliance with the License.
3104 * You may obtain a copy of the License at
3105 *
3106 *   http://www.apache.org/licenses/LICENSE-2.0
3107 *
3108 * Unless required by applicable law or agreed to in writing, software
3109 * distributed under the License is distributed on an "AS IS" BASIS,
3110 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3111 * See the License for the specific language governing permissions and
3112 * limitations under the License.
3113 */function k_(r){return(function(i,s){if(typeof i!="object"||i===null)return!1;const o=i;for(const c of s)if(c in o&&typeof o[c]=="function")return!0;return!1})(r,["next","error","complete"])}/**
3114 * @license
3115 * Copyright 2020 Google LLC
3116 *
3117 * Licensed under the Apache License, Version 2.0 (the "License");
3118 * you may not use this file except in compliance with the License.
3119 * You may obtain a copy of the License at
3120 *
3121 *   http://www.apache.org/licenses/LICENSE-2.0
3122 *
3123 * Unless required by applicable law or agreed to in writing, software
3124 * distributed under the License is distributed on an "AS IS" BASIS,
3125 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3126 * See the License for the specific language governing permissions and
3127 * limitations under the License.
3128 */class sE{constructor(e,i,s,o,c){this._firestore=e,this._userDataWriter=i,this._key=s,this._document=o,this._converter=c}get id(){return this._key.path.lastSegment()}get ref(){return new Ut(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new aR(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}_fieldsProto(){var e;return((e=this._document)==null?void 0:e.data.clone().value.mapValue.fields)??void 0}get(e){if(this._document){const i=this._document.data.field(Nl("DocumentSnapshot.get",e));if(i!==null)return this._userDataWriter.convertValue(i)}}}class aR extends sE{data(){return super.data()}}/**
3129 * @license
3130 * Copyright 2020 Google LLC
3131 *
3132 * Licensed under the Apache License, Version 2.0 (the "License");
3133 * you may not use this file except in compliance with the License.
3134 * You may obtain a copy of the License at
3135 *
3136 *   http://www.apache.org/licenses/LICENSE-2.0
3137 *
3138 * Unless required by applicable law or agreed to in writing, software
3139 * distributed under the License is distributed on an "AS IS" BASIS,
3140 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3141 * See the License for the specific language governing permissions and
3142 * limitations under the License.
3143 */function aE(r){if(r.limitType==="L"&&r.explicitOrderBy.length===0)throw new ce(Z.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class Dg{}class lR extends Dg{}function oR(r,e,...i){let s=[];e instanceof Dg&&s.push(e),s=s.concat(i),(function(c){const f=c.filter((_=>_ instanceof Mg)).length,y=c.filter((_=>_ instanceof Yh)).length;if(f>1||f>0&&y>0)throw new ce(Z.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(...)))`.")})(s);for(const o of s)r=o._apply(r);return r}class Yh extends lR{constructor(e,i,s){super(),this._field=e,this._op=i,this._value=s,this.type="where"}static _create(e,i,s){return new Yh(e,i,s)}_apply(e){const i=this._parse(e);return lE(e._query,i),new Ea(e.firestore,e.converter,Sm(e._query,i))}_parse(e){const i=Gh(e.firestore);return(function(c,f,y,_,p,T,A){let S;if(p.isKeyField()){if(T==="array-contains"||T==="array-contains-any")throw new ce(Z.INVALID_ARGUMENT,`Invalid Query. You can't perform '${T}' queries on documentId().`);if(T==="in"||T==="not-in"){U_(A,T);const Q=[];for(const ie of A)Q.push(L_(_,c,ie));S={arrayValue:{values:Q}}}else S=L_(_,c,A)}else T!=="in"&&T!=="not-in"&&T!=="array-contains-any"||U_(A,T),S=iR(y,f,A,T==="in"||T==="not-in");return Wt.create(p,T,S)})(e._query,"where",i,e.firestore._databaseId,this._field,this._op,this._value)}}function uR(r,e,i){const s=e,o=Nl("where",r);return Yh._create(o,s,i)}class Mg extends Dg{constructor(e,i){super(),this.type=e,this._queryConstraints=i}static _create(e,i){return new Mg(e,i)}_parse(e){const i=this._queryConstraints.map((s=>s._parse(e))).filter((s=>s.getFilters().length>0));return i.length===1?i[0]:Pi.create(i,this._getOperator())}_apply(e){const i=this._parse(e);return i.getFilters().length===0?e:((function(o,c){let f=o;const y=c.getFlattenedFilters();for(const _ of y)lE(f,_),f=Sm(f,_)})(e._query,i),new Ea(e.firestore,e.converter,Sm(e._query,i)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}
3143function L_(r,e,i){if(typeof(i=cn(i))=="string"){if(i==="")throw new ce(Z.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!sT(e)&&i.indexOf("/")!==-1)throw new ce(Z.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${i}' contains a '/' character.`);const s=e.path.child(St.fromString(i));if(!Ae.isDocumentKey(s))throw new ce(Z.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);return Jv(r,new Ae(s))}if(i instanceof Ut)return Jv(r,i._key);throw new ce(Z.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Rh(i)}.`)}function U_(r,e){if(!Array.isArray(r)||r.length===0)throw new ce(Z.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function lE(r,e){const i=(function(o,c){for(const f of o)for(const y of f.getFlattenedFilters())if(c.indexOf(y.op)>=0)return y.op;return null})(r.filters,(function(o){switch(o){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(i!==null)throw i===e.op?new ce(Z.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new ce(Z.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${i.toString()}' filters.`)}function oE(r,e,i){let s;return s=r?i&&(i.merge||i.mergeFields)?r.toFirestore(e,i):r.toFirestore(e):e,s}class qo{constructor(e,i){this.hasPendingWrites=e,this.fromCache=i}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class ha extends sE{constructor(e,i,s,o,c,f){super(e,i,s,o,f),this._firestore=e,this._firestoreImpl=e,this.metadata=c}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const i=new nh(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(i,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,i={}){if(this._document){const s=this._document.data.field(Nl("DocumentSnapshot.get",e));if(s!==null)return this._userDataWriter.convertValue(s,i.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new ce(Z.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,i={};return i.type=ha._jsonSchemaVersion,i.bundle="",i.bundleSource="DocumentSnapshot",i.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?i:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),i.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),i)}}ha._jsonSchemaVersion="firestore/documentSnapshot/1.0",ha._jsonSchema={type:en("string",ha._jsonSchemaVersion),bundleSource:en("string","DocumentSnapshot"),bundleName:en("string"),bundle:en("string")};class nh extends ha{data(e={}){return super.data(e)}}class da{constructor(e,i,s,o){this._firestore=e,this._userDataWriter=i,this._snapshot=o,this.metadata=new qo(o.hasPendingWrites,o.fromCache),this.query=s}get docs(){const e=[];return this.forEach((i=>e.push(i))),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,i){this._snapshot.docs.forEach((s=>{e.call(i,new nh(this._firestore,this._userDataWriter,s.key,s,new qo(this._snapshot.mutatedKeys.has(s.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(e={}){const i=!!e.includeMetadataChanges;if(i&&this._snapshot.excludesMetadataChanges)throw new ce(Z.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===i||(this._cachedChanges=(function(o,c){if(o._snapshot.oldDocs.isEmpty()){let f=0;return o._snapshot.docChanges.map((y=>{const _=new nh(o._firestore,o._userDataWriter,y.doc.key,y.doc,new qo(o._snapshot.mutatedKeys.has(y.doc.key),o._snapshot.fromCache),o.query.converter);return y.doc,{type:"added",doc:_,oldIndex:-1,newIndex:f++}}))}{let f=o._snapshot.oldDocs;return o._snapshot.docChanges.filter((y=>c||y.type!==3)).map((y=>{const _=new nh(o._firestore,o._userDataWriter,y.doc.key,y.doc,new qo(o._snapshot.mutatedKeys.has(y.doc.key),o._snapshot.fromCache),o.query.converter);let p=-1,T=-1;return y.type!==0&&(p=f.indexOf(y.doc.key),f=f.delete(y.doc.key)),y.type!==1&&(f=f.add(y.doc),T=f.indexOf(y.doc.key)),{type:cR(y.type),doc:_,oldIndex:p,newIndex:T}}))}})(this,i),this._cachedChangesIncludeMetadataChanges=i),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new ce(Z.FAILED_PRECONDITION,"QuerySnapsh
3143ot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=da._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=Zm.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const i=[],s=[],o=[];return this.docs.forEach((c=>{c._document!==null&&(i.push(c._document),s.push(this._userDataWriter.convertObjectMap(c._document.data.value.mapValue.fields,"previous")),o.push(c.ref.path))})),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function cR(r){switch(r){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Ce(61501,{type:r})}}/**
3144 * @license
3145 * Copyright 2022 Google LLC
3146 *
3147 * Licensed under the Apache License, Version 2.0 (the "License");
3148 * you may not use this file except in compliance with the License.
3149 * You may obtain a copy of the License at
3150 *
3151 *   http://www.apache.org/licenses/LICENSE-2.0
3152 *
3153 * Unless required by applicable law or agreed to in writing, software
3154 * distributed under the License is distributed on an "AS IS" BASIS,
3155 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3156 * See the License for the specific language governing permissions and
3157 * limitations under the License.
3158 */da._jsonSchemaVersion="firestore/querySnapshot/1.0",da._jsonSchema={type:en("string",da._jsonSchemaVersion),bundleSource:en("string","QuerySnapshot"),bundleName:en("string"),bundle:en("string")};/**
3159 * @license
3160 * Copyright 2020 Google LLC
3161 *
3162 * Licensed under the Apache License, Version 2.0 (the "License");
3163 * you may not use this file except in compliance with the License.
3164 * You may obtain a copy of the License at
3165 *
3166 *   http://www.apache.org/licenses/LICENSE-2.0
3167 *
3168 * Unless required by applicable law or agreed to in writing, software
3169 * distributed under the License is distributed on an "AS IS" BASIS,
3170 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3171 * See the License for the specific language governing permissions and
3172 * limitations under the License.
3173 */function hR(r){r=Xn(r,Ut);const e=Xn(r.firestore,kr),i=qh(e);return FI(i,r._key).then((s=>uE(e,r,s)))}function dR(r){r=Xn(r,Ea);const e=Xn(r.firestore,kr),i=qh(e),s=new Cg(e);return aE(r._query),GI(i,r._query).then((o=>new da(e,s,r,o)))}function _a(r,e,i){r=Xn(r,Ut);const s=Xn(r.firestore,kr),o=oE(r.converter,e,i),c=Gh(s);return Xh(s,[eE(c,"setDoc",r._key,o,r.converter!==null,i).toMutation(r._key,xi.none())])}function fR(r,e,i,...s){r=Xn(r,Ut);const o=Xn(r.firestore,kr),c=Gh(o);let f;return f=typeof(e=cn(e))=="string"||e instanceof wg?nR(c,"updateDoc",r._key,e,i,s):tR(c,"updateDoc",r._key,e),Xh(o,[f.toMutation(r._key,xi.exists(!0))])}function mR(r){return Xh(Xn(r.firestore,kr),[new sg(r._key,xi.none())])}function vu(r,e){const i=Xn(r.firestore,kr),s=Ai(r),o=oE(r.converter,e),c=Gh(r.firestore);return Xh(i,[eE(c,"addDoc",s._key,o,r.converter!==null,{}).toMutation(s._key,xi.exists(!1))]).then((()=>s))}function $h(r,...e){var p,T,A;r=cn(r);let i={includeMetadataChanges:!1,source:"default"},s=0;typeof e[s]!="object"||k_(e[s])||(i=e[s++]);const o={includeMetadataChanges:i.includeMetadataChanges,source:i.source};if(k_(e[s])){const S=e[s];e[s]=(p=S.next)==null?void 0:p.bind(S),e[s+1]=(T=S.error)==null?void 0:T.bind(S),e[s+2]=(A=S.complete)==null?void 0:A.bind(S)}let c,f,y;if(r instanceof Ut)f=Xn(r.firestore,kr),y=Oh(r._key.path),c={next:S=>{e[s]&&e[s](uE(f,r,S))},error:e[s+1],complete:e[s+2]};else{const S=Xn(r,Ea);f=Xn(S.firestore,kr),y=S._query;const z=new Cg(f);c={next:Q=>{e[s]&&e[s](new da(f,z,S,Q))},error:e[s+1],complete:e[s+2]},aE(r._query)}const _=qh(f);return qI(_,y,o,c)}function Xh(r,e){const i=qh(r);return KI(i,e)}function uE(r,e,i){const s=i.docs.get(e._key),o=new Cg(r);return new ha(r,o,e._key,s,new qo(i.hasPendingWrites,i.fromCache),e.converter)}(function(e,i=!0){Gw(Cl),bl(new ma("firestore",((s,{instanceIdentifier:o,options:c})=>{const f=s.getProvider("app").getImmediate(),y=new kr(new Yw(s.getProvider("auth-internal")),new Jw(f,s.getProvider("app-check-internal")),mN(f,o),f);return c={useFetchStreams:i,...c},y._setSettings(c),y}),"PUBLIC").setMultipleInstances(!0)),As(j_,V_,e),As(j_,V_,"esm2020")})();var gR="firebase",pR="12.9.0";/**
3174 * @license
3175 * Copyright 2020 Google LLC
3176 *
3177 * Licensed under the Apache License, Version 2.0 (the "License");
3178 * you may not use this file except in compliance with the License.
3179 * You may obtain a copy of the License at
3180 *
3181 *   http://www.apache.org/licenses/LICENSE-2.0
3182 *
3183 * Unless required by applicable law or agreed to in writing, software
3184 * distributed under the License is distributed on an "AS IS" BASIS,
3185 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3186 * See the License for the specific language governing permissions and
3187 * limitations under the License.
3188 */As(gR,pR,"app");const yR={apiKey:"AIzaSyCZ6YBqkcJbYdfrSnSnjviqvT3cNBO_Pyc",authDomain:"platzreservierung-ag.firebaseapp.com",projectId:"platzreservierung-ag",storageBucket:"platzreservierung-ag.firebasestorage.app",messagingSenderId:"373559526680",appId:"1:373559526680:web:484ce94d23d60fe0ec8a6d"},cE=W_(yR),Og=qw(cE),hn=XI(cE),Jh="users",jg=new Ir;jg.setCustomParameters({prompt:"select_account"});jg.addScope("https://www.googleapis.com/auth/user.addresses.read");const hE=async r=>{var c,f,y;const e=Ai(hn,Jh,r.uid),i=await hR(e);let s=_e.MEMBER;i.exists()?(s=i.data().role,(i.data().name!==r.displayName||i.data().avatarUrl!==r.photoURL)&&await _a(e,{name:r.displayName||((c=r.email)==null?void 0:c.split("@")[0])||"Unbekannt",email:r.email,avatarUrl:r.photoURL||`https://ui-avatars.com/api/?name=${r.email}&background=random`,role:s},{merge:!0})):await _a(e,{name:r.displayName||((f=r.email)==null?void 0:f.split("@")[0])||"Unbekannt",email:r.email,avatarUrl:r.photoURL||`https://ui-avatars.com/api/?name=${r.email}&background=random`,role:s,profileComplete:!1});const o=i.exists()?i.data():null;return{id:r.uid,name:r.displayName||((y=r.email)==null?void 0:y.split("@")[0])||"Unbekannt",email:r.email||"",avatarUrl:r.photoURL||`https://ui-avatars.com/api/?name=${r.email}&background=random`,role:s,address:o==null?void 0:o.address,isClubMember:o==null?void 0:o.isClubMember,profileComplete:(o==null?void 0:o.profileComplete)??!1}},vR=r=>DS(Og,async e=>{if(e){const i=await hE(e);r(i)}else r(null)}),_R=async()=>{try{const r=await ZS(Og,jg);return await hE(r.user)}catch(r){throw console.error("Error during Google Login:",r),r}},bR=async()=>{try{await MS(Og)}catch(r){console.error("Error during logout:",r)}},Kc=async()=>(await dR(xa(hn,Jh))).docs.map(e=>({id:e.id,name:e.data().name,email:e.data().email,avatarUrl:e.data().avatarUrl,role:e.data().role,address:e.data().address,isClubMember:e.data().isClubMember,profileComplete:e.data().profileComplete})),TR=async(r,e)=>{const i=Ai(hn,Jh,r);await _a(i,{...e},{merge:!0})},ER=async(r,e)=>{const i=Ai(hn,Jh,r);await _a(i,{role:e},{merge:!0})},Xo={1:"Straßen-Seite",2:"Au-Seite"},Ah={[Ge.GAME]:"Spiel",[Ge.TRAINING]:"Training",[Ge.EVENT]:"Event",[Ge.MAINTENANCE]:"Sperre/Wartung"},ih={openingHour:8,closingHour:22,courtNames:{1:"Straßen-Seite",2:"Au-Seite"},maxDaysInAdvance:14,maxDurationPerDay:120,maxActiveBookings:3,bookingPermissions:{court1:[_e.ADMIN,_e.MODERATOR,_e.MEMBER],court2:[_e.ADMIN,_e.MODERATOR,_e.MEMBER],recurring:[_e.ADMIN,_e.MODERATOR],game:[_e.ADMIN,_e.MODERATOR,_e.MEMBER],training:[_e.ADMIN,_e.MODERATOR],event:[_e.ADMIN,_e.MODERATOR],maintenance:[_e.ADMIN,_e.MODERATOR]}},ji={[Ge.GAME]:"bg-blue-100 border-blue-300 text-blue-800",[Ge.TRAINING]:"bg-sky-100 border-sky-300 text-sky-800",[Ge.EVENT]:"bg-purple-100 border-purple-300 text-purple-800",[Ge.MAINTENANCE]:"bg-red-100 border-red-300 text-red-800"};new Date(new Date().setHours(10,0,0,0)).toISOString(),new Date(new Date().setHours(12,0,0,0)).toISOString(),Ge.TRAINING;const dE={websiteUrl:"https://example.com",membershipUrl:"https://example.com/mitglied-werden",impressum:`
3189    <h4 class="font-bold text-lg mb-2">Angaben gemäß § 5 TMG</h4>
3190    <p class="mb-2">
3191      <strong>BeachVolleyball Club e.V.</strong><br />
3192      Musterstraße 123<br />
3193      12345 Musterstadt
3194    </p>
3195    <p class="mb-2">
3196      <strong>Vertreten durch:</strong><br />
3197      Max Mustermann (1. Vorsitzender)<br />
3198      Erika Musterfrau (2. Vorsitzende)
3199    </p>
3200    <p class="mb-2">
3201      <strong>Kontakt:</strong><br />
3202      Telefon: +49 (0) 123 44 55 66<br />
3203      E-Mail: [email protected]
3204    </p>
3205    <p>
3206      <strong>Registereintrag:</strong><br />
3207      Eintragung im Vereinsregister.<br />
3208      Registergericht: Amtsgericht Musterstadt<br />
3209      Registernummer: VR 12345
3210    </p>
3211  `,agb:`
3212    <h4 class="font-bold text-lg mb-2">Allgemeine Geschäftsbedingungen</h4>
3213    <p class="mb-2"><strong>1. Buchung und Stornierung</strong><br/>
3214    Buchungen sind verbindlich. Eine kostenfreie Stornierung ist bis zu 24 Stunden vor Spielbeginn möglich. Danach wird die volle Platzgebühr fällig, sofern kein Ersatz gefunden wird.</p>
3215    
3216    <p class="mb-2"><strong>
32162. Haftung</strong><br/>
3217    Der Verein haftet nicht für den Verlust von Wertgegenständen oder für Verletzungen, die während der Nutzung der Anlage entstehen, soweit diese nicht auf grober Fahrlässigkeit des Vereins beruhen. Die Nutzung erfolgt auf eigene Gefahr.</p>
3218    
3219    <p><strong>3. Datenschutz</strong><br/>
3220    Personenbezogene Daten werden ausschließlich zur Abwicklung der Buchung und für den Vereinsbetrieb gespeichert. Eine Weitergabe an Dritte erfolgt nicht.</p>
3221  `,rules:`
3222    <h4 class="font-bold text-lg mb-2">Platzordnung & Regeln</h4>
3223    <ul class="list-disc pl-5 space-y-2">
3224      <li><strong>Platzpflege:</strong> Nach dem Spiel ist der Platz mit dem Rechen abzuziehen. Löcher sind vorher zu schließen.</li>
3225      <li><strong>Sauberkeit:</strong> Jeglicher Müll (Flaschen, Tape-Reste, Verpackungen) ist wieder mitzunehmen oder in die vorgesehenen Mülleimer zu entsorgen.</li>
3226      <li><strong>Fairplay:</strong> Wir pflegen einen respektvollen Umgang miteinander. Lautstärke ist auf ein verträgliches Maß zu beschränken, um Anwohner nicht zu stören.</li>
3227      <li><strong>Glasverbot:</strong> Auf den Sandflächen ist die Nutzung von Glasflaschen strengstens untersagt (Verletzungsgefahr!).</li>
3228      <li><strong>Pünktlichkeit:</strong> Der Platz ist pünktlich zum Ende der Buchungszeit freizumachen, damit nachfolgende Spieler rechtzeitig beginnen können.</li>
3229    </ul>
3230  `},fE={ccAddress:"[email protected]",fromAddress:"[email protected]",bookingSubject:"Buchungsbestätigung: {{date}}",bookingTemplate:`
3231    <h3>Buchungsbestätigung</h3>
3232    <p>Hallo {{userName}},</p>
3233    <p>vielen Dank für deine Buchung. Hier sind die Details:</p>
3234    <ul>
3235      <li><strong>Datum:</strong> {{date}}</li>
3236      <li><strong>Zeit:</strong> {{startTime}} - {{endTime}} Uhr</li>
3237      <li><strong>Platz:</strong> {{courtName}}</li>
3238      <li><strong>Typ:</strong> {{type}}</li>
3239    </ul>
3240    <p>Viel Spaß beim Spielen!</p>
3241    <p>Dein BeachVolley Team</p>
3242  `,cancellationSubject:"Stornierung: {{date}}",cancellationTemplate:`
3243    <h3>Stornierungsbestätigung</h3>
3244    <p>Hallo {{userName}},</p>
3245    <p>deine Buchung wurde erfolgreich storniert:</p>
3246    <ul>
3247      <li><strong>Datum:</strong> {{date}}</li>
3248      <li><strong>Zeit:</strong> {{startTime}} - {{endTime}} Uhr</li>
3249      <li><strong>Platz:</strong> {{courtName}}</li>
3250    </ul>
3251    <p>Wir hoffen dich bald wieder zu sehen.</p>
3252    <p>Dein BeachVolley Team</p>
3253  `,updateSubject:"Buchungsänderung: {{date}}",updateTemplate:`
3254    <h3>Buchungsänderung</h3>
3255    <p>Hallo {{userName}},</p>
3256    <p>deine Buchung wurde geändert. Hier sind die neuen Daten:</p>
3257    <ul>
3258      <li><strong>Datum:</strong> {{date}}</li>
3259      <li><strong>Zeit:</strong> {{startTime}} - {{endTime}} Uhr</li>
3260      <li><strong>Platz:</strong> {{courtName}}</li>
3261    </ul>
3262    <p>Bitte beachte die Änderungen.</p>
3263    <p>Dein BeachVolley Team</p>
3264  `},xR=({isOpen:r,onClose:e,onConfirm:i,onUpdate:s,user:o,selectedDate:c,initialCourtId:f=1,initialStartHour:y,existingBookings:_,bookingToEdit:p,systemSettings:T})=>{const A=o.role===_e.ADMIN,S=o.role===_e.MODERATOR,z=A||S,Q=!!p,ie=p&&p.userId===o.id,X=!Q||ie||z,ge=T.bookingPermissions.court1.includes(o.role),Te=T.bookingPermissions.court2.includes(o.role),we=T.bookingPermissions.recurring.includes(o.role),He=T.bookingPermissions.game.includes(o.role),ze=T.bookingPermissions.training.includes(o.role),Ve=T.bookingPermissions.event.includes(o.role),I=T.bookingPermissions.maintenance.includes(o.role),w=()=>He?Ge.GAME:ze?Ge.TRAINING:Ve?Ge.EVENT:I?Ge.MAINTENANCE:Ge.GAME,[N,j]=ye.useState(""),[R,V]=ye.useState(Ge.GAME),[C,Ne]=ye.useState(null),[qe,G]=ye.useState(f),[re,fe]=ye.useState(8),[Be,Ke]=ye.useState(0),[M,Y]=ye.useState(1),[ne,le]=ye.useState([f]),[be,he]=ye.useState(""),[H,Ee]=ye.useState(""),[Se,Fe]=ye.useState(`${T.openingHour}:00`),[jt,Rt]=ye.useState(`${T.openingHour+1}:00`),[Un,dn]=ye.useState(!1),[fn,Pn]=ye.useState(!1),[ee,se]=ye.useState("WEEKLY"),[oe,ue]=ye.useState("COUNT"),[ve,nt]=ye.useState(""),[ke,wt]=ye.useState(10),[Ft,zi]=ye.useState(!1),[Si,Jn]=ye.useState(!1);if(ye.useEffect(()=>{if(r)if(Ne(null),zi(!1),Jn(!1),p){const te=new Date(p.startTime),lt=new Date(p.endTime);
3264j(p.description||""),V(p.type),G(p.courtId);const rt=_.find(Re=>Re.id!==p.id&&Re.startTime===p.startTime&&Re.endTime===p.endTime&&Re.userId===p.userId&&Re.courtId!==p.courtId);le(rt?[p.courtId,rt.courtId]:[p.courtId]);const mn=Re=>Re.toISOString().split("T")[0],Gt=Re=>Re.toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"});he(mn(te)),Ee(mn(lt)),Fe(Gt(te)),Rt(Gt(lt));const ui=te.getHours(),xt=lt.getHours();ui===T.openingHour&&xt===T.closingHour?dn(!0):dn(!1),fe(te.getHours()),Ke(te.getMinutes());const xn=(lt.getTime()-te.getTime())/(1e3*60*60);if(Y(Math.max(1,Math.min(2,Math.round(xn)))),p.seriesId){const Re=_.filter(at=>at.seriesId===p.seriesId).sort((at,mt)=>new Date(at.startTime).getTime()-new Date(mt.startTime).getTime()),st=Re.filter(at=>new Date(at.startTime)>=te),Pt=new Set(st.map(at=>at.startTime)).size;if(wt(Pt),ue("COUNT"),st.length>0){const at=st[st.length-1];nt(mn(new Date(at.startTime)))}if(Re.length>1){const at=Re.findIndex(et=>et.id===p.id);let mt=Re[at+1];!mt&&at>0&&(mt=Re[at-1]),mt&&(Math.abs(new Date(mt.startTime).getTime()-te.getTime())/864e5>=6?se("WEEKLY"):se("DAILY"))}else se("WEEKLY")}Pn(!1)}else{j(""),V(w()),f===1&&!ge&&Te?(G(2),le([2])):f===2&&!Te&&ge?(G(1),le([1])):(G(f),le([f]));const te=y||Math.max(T.openingHour,Math.min(new Date().getHours()+1,T.closingHour-1));fe(te),Ke(0),Y(1);const lt=c.toISOString().split("T")[0];he(lt),Ee(lt),Fe(`${String(te).padStart(2,"0")}:00`),Rt(`${String(te+1).padStart(2,"0")}:00`),dn(!1),Pn(!1),se("WEEKLY"),ue("COUNT"),wt(10);const rt=new Date(c);rt.setMonth(rt.getMonth()+2),nt(rt.toISOString().split("T")[0])}},[r,f,c,p,_,y,T,ge,Te,He,ze,Ve,I]),!r)return null;const Ll=te=>{const lt=te.target.value;he(lt),Ee(lt)},Vs=(te,lt)=>{const rt=`${String(te).padStart(2,"0")}:${String(lt).padStart(2,"0")}`;Fe(rt);let mn=te+1;mn>T.closingHour&&(mn=T.closingHour);const Gt=`${String(mn).padStart(2,"0")}:${String(lt).padStart(2,"0")}`;Rt(Gt)},ks=(te,lt)=>{const rt=`${String(te).padStart(2,"0")}:${String(lt).padStart(2,"0")}`;Rt(rt)},Aa=()=>{if(!s||!p)return;if(!Si){Jn(!0);return}let te=[p.id];if(!Ft){const lt=_.find(rt=>rt.id!==p.id&&rt.startTime===p.startTime&&rt.endTime===p.endTime&&rt.userId===p.userId&&rt.courtId!==p.courtId);lt&&te.push(lt.id)}Ft&&p.seriesId&&(te=_.filter(rt=>rt.seriesId===p.seriesId).map(rt=>rt.id)),s([],te),e()},Zn=te=>{if(te.preventDefault(),Ne(null),R===Ge.GAME&&!He){Ne("Keine Berechtigung für Spiele.");return}if(R===Ge.TRAINING&&!ze){Ne("Keine Berechtigung für Training.");return}if(R===Ge.EVENT&&!Ve){Ne("Keine Berechtigung für Events.");return}if(R===Ge.MAINTENANCE&&!I){Ne("Keine Berechtigung für Sperren.");return}if(!z){const Re=new Date(c);Re.setHours(re,Be,0,0);const st=new Date(Re);st.setHours(Re.getHours()+M,Re.getMinutes(),0,0);const Pt=new Date;if(Pt.setDate(Pt.getDate()+T.maxDaysInAdvance),Pt.setHours(23,59,59,999),Re>Pt){Ne(`Buchungen sind nur ${T.maxDaysInAdvance} Tage im Voraus möglich.`);return}if(qe===1&&!ge){Ne(`Du hast keine Berechtigung für ${T.courtNames[1]}.`);return}if(qe===2&&!Te){Ne(`Du hast keine Berechtigung für ${T.courtNames[2]}.`);return}if(M*60>T.maxDurationPerDay){Ne(`Maximale Buchungsdauer ist ${T.maxDurationPerDay/60} Stunden.`);return}const at=_.filter(vt=>{if(p&&vt.id===p.id)return!1;const sn=new Date(vt.startTime);return vt.userId===o.id&&sn.toDateString()===Re.toDateString()}),mt=M*60;if(at.reduce((vt,sn)=>vt+(new Date(sn.endTime).getTime()-new Date(sn.startTime).getTime())/(1e3*60),0)+mt>T.maxDurationPerDay){Ne(`Du hast das tägliche Limit von ${T.maxDurationPerDay/60} Stunden überschritten.`);return}const An=_.filter(vt=>p&&vt.id===p.id?!1:vt.userId===o.id&&new Date(vt.endTime)>new Date);if(An.length>=T.maxActiveBookings){Ne(`Du hast bereits ${An.length} aktive Buchungen (Maximum: ${T.maxActiveBookings}).`);return}if(_.some(vt=>{if(p&&vt.id===p.id||vt.courtId!==qe)return!1;const sn=new Date(vt.startTime).getTime(),wn=new Date(vt.endTime).getTime();return Re.getTime()<wn&&st.getTime()>sn})){Ne(`Platz ${qe} ist zu dieser Zeit belegt.`);return}const On={courtId:qe,startTime:Re.toISOString(),endTime:st.toISOString(),type:R,description:N};Q&&p&&s?s([{...p,...On}],[]):i([On]),e();return}if(ne.includes(1)&&!ge){Ne(`Du hast keine Berechtigung für ${T.courtNames[1]}.`);return}if(ne.includes(2)&&!Te){Ne(`Du hast keine Berechtigung für ${T.courtNames[2]}.`);return}if(fn&&!we){Ne("Du hast keine Berechtigung für Serientermine.");return}const lt=Un?`${String(T.openingHour).padStart(2,"0")}:00`:Se,rt=Un?`${String(T.closingHour).padStart(2,"0")}:00`:jt,mn=new Date(`${be}T${lt}`),Gt=new Date(`${H}T${rt}`);if(Gt<=mn){Ne("Das Enddatum muss nach dem Startdatum liegen.");return}
3264if(Q&&p&&s){if(ne.length===0){Ne("Bitte mindestens einen Platz auswählen.");return}const Re=[],st=[];if(Ft&&p.seriesId){const Pt=_.filter(an=>an.seriesId===p.seriesId),at=new Date(p.startTime);Pt.filter(an=>new Date(an.startTime)>=at).forEach(an=>st.push(an.id));let et=[],An=[],Sn=new Date(mn),On=new Date(Gt),vt=0;const sn=oe==="COUNT"?ke:100,wn=oe==="DATE"?new Date(`${ve}T23:59:59`):null;for(;!(oe==="COUNT"&&vt>=sn||oe==="DATE"&&wn&&Sn>wn||vt>365);){et.push(new Date(Sn)),An.push(new Date(On)),vt++;const an=ee==="WEEKLY"?7:1;Sn.setDate(Sn.getDate()+an),On.setDate(On.getDate()+an)}for(let an=0;an<et.length;an++){const jn=et[an],zn=An[an];for(const Ct of ne){if(_.some(Vn=>{if(st.includes(Vn.id)||Vn.courtId!==Ct)return!1;const Pr=new Date(Vn.startTime).getTime(),Ul=new Date(Vn.endTime).getTime();return jn.getTime()<Ul&&zn.getTime()>Pr})){Ne(`Kollision am ${jn.toLocaleDateString("de-DE")} auf Platz ${Ct}. Serie konnte nicht geändert werden.`);return}Re.push({courtId:Ct,startTime:jn.toISOString(),endTime:zn.toISOString(),type:R,description:N,seriesId:p.seriesId})}}}else{let Pt=_.filter(et=>et.startTime===p.startTime&&et.endTime===p.endTime&&et.userId===p.userId&&et.type===p.type);const at=new Date(new Date(p.startTime).setHours(parseInt(lt.split(":")[0]),parseInt(lt.split(":")[1]),0,0)),mt=new Date(at);mt.setHours(parseInt(rt.split(":")[0]),parseInt(rt.split(":")[1]),0,0);for(const et of[1,2]){const An=Pt.find(On=>On.courtId===et);if(ne.includes(et))if(An)Re.push({...An,startTime:at.toISOString(),endTime:mt.toISOString(),type:R,description:N});else{if(_.some(vt=>{if(vt.courtId!==et)return!1;const sn=new Date(vt.startTime).getTime(),wn=new Date(vt.endTime).getTime();return at.getTime()<wn&&mt.getTime()>sn})){Ne(`Platz ${et} ist belegt.`);return}Re.push({courtId:et,startTime:at.toISOString(),endTime:mt.toISOString(),type:R,description:N,seriesId:p.seriesId})}else An&&st.push(An.id)}}s(Re,st),e();return}if(ne.length===0){Ne("Bitte mindestens einen Platz auswählen.");return}const ui=[];let xt=[new Date(mn)],xn=[new Date(Gt)];if(fn){xt=[],xn=[];let Re=new Date(mn),st=new Date(Gt),Pt=0;const at=oe==="COUNT"?ke:100,mt=oe==="DATE"?new Date(`${ve}T23:59:59`):null;for(;!(oe==="COUNT"&&Pt>=at||oe==="DATE"&&mt&&Re>mt||Pt>365);){xt.push(new Date(Re)),xn.push(new Date(st)),Pt++;const et=ee==="WEEKLY"?7:1;Re.setDate(Re.getDate()+et),st.setDate(st.getDate()+et)}}for(let Re=0;Re<xt.length;Re++){const st=xt[Re],Pt=xn[Re];for(const at of ne){if(_.some(et=>{if(et.courtId!==at)return!1;const An=new Date(et.startTime).getTime(),Sn=new Date(et.endTime).getTime();return st.getTime()<Sn&&Pt.getTime()>An})){const et=st.toLocaleDateString("de-DE");Ne(`Kollision am ${et} auf Platz ${at}. Serie konnte nicht erstellt werden.`);return}ui.push({courtId:at,startTime:st.toISOString(),endTime:Pt.toISOString(),type:R,description:fn?`${N}`:N})}}i(ui),e()},Vt=[];for(let te=T.openingHour;te<T.closingHour;te++)Vt.push(te);const Mn=te=>{le(lt=>lt.includes(te)?lt.filter(rt=>rt!==te):[...lt,te])};return m.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50 backdrop-blur-sm p-4",children:m.jsxs("div",{className:"bg-white rounded-xl shadow-2xl w-full max-w-md overflow-hidden animate-fade-in-up max-h-[90vh] overflow-y-auto",children:[m.jsxs("div",{className:"bg-blue-600 p-4 text-white flex justify-between items-center sticky top-0 z-10",children:[m.jsx("h2",{className:"text-xl font-bold",children:z?Q?"Buchung bearbeiten":"Admin/Mod Buchung":"Platz reservieren"}),m.jsx("button",{onClick:e,className:"text-white hover:text-blue-200",children:m.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),m.jsxs("form",{onSubmit:Zn,className:"p-6 space-y-4",children:[C&&m.jsx("div",{className:"bg-red-50 border-l-4 border-red-500 p-3 text-red-700 text-sm",children:C}),z?m.jsxs(m.Fragment,{children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Plätze auswählen"}),m.jsxs("div",{className:"flex gap-4",children:[ge?m.jsxs("label",{className:`flex items-center space-x-2 cursor-pointer border p-2 rounded hover:bg-gray-50 flex-1 ${ne.includes(1)?"bg-blue-50 border-blue-500":""}`,children:[m.jsx("input",{type:"checkbox",checked:ne.includes(1),onChange:()=>Mn(1),disabled:!X,className:"w-4 h-4 text-blue-600 rounded focus:ring-blue-500"}),m.jsx("span",{className:"text-sm",children:T.courtNames[1]})]}):m.jsxs("div",{className:"flex-1 border p-2 rounded bg-gray-100 opacity-50 text-sm flex items-center justify-center cursor-not-allowed",children:[T.courtNames[1]," (Gesperrt)"]}),Te?m.jsxs("label",{className:`flex items-center space-x-2 cursor-pointer border p-2 rounded hover:bg-gray-50 flex-1 ${ne.includes(2)?"bg-blue-50 border-blue-500":""}`,children:[m.jsx("input",{type:"checkbox",checked:ne.includes(2),onChange:()=>Mn(2),disabled:!X,className:"w-4 h-4 text-blue-600 rounded focus:ring-blue-500"}),m.jsx("span",{className:"text-sm",children:T.courtNames[2]})]}):m.jsxs("div",{className:"flex-1 border p-2 rounded bg-gray-100 opacity-50 text-sm flex items-center justify-center cursor-not-allowed",children:[T.courtNames[2]," (Gesperrt)"]})]})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Datum"}),m.jsx("input",{type:"date",value:be,onChange:Ll,disabled:!X,className:"w-full border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border"})]}),m.jsx("div",{children:!(Q&&Ft)&&m.jsxs(m.Fragment,{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Bis Datum"}),m.jsx("input",{type:"date",value:H,onChange:te=>Ee(te.target.value),className:"w-full border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border",disabled:fn||
3264!X})]})})]}),m.jsxs("div",{className:"flex items-center space-x-2",children:[m.jsx("input",{type:"checkbox",id:"fullDay",checked:Un,onChange:te=>dn(te.target.checked),className:"w-4 h-4 text-blue-600 rounded focus:ring-blue-500"}),m.jsxs("label",{htmlFor:"fullDay",className:"text-sm font-medium text-gray-700 cursor-pointer",children:["Ganztags (",T.openingHour,":00 - ",T.closingHour,":00 Uhr)"]})]}),!Un&&m.jsxs("div",{className:"grid grid-cols-2 gap-4 animate-fade-in-up",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Von Uhrzeit"}),m.jsxs("div",{className:"flex gap-2",children:[m.jsxs("select",{value:parseInt(Se.split(":")[0]),onChange:te=>Vs(parseInt(te.target.value),parseInt(Se.split(":")[1])),className:"w-full border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border",children:[Vt.map(te=>m.jsxs("option",{value:te,children:[te," Uhr"]},te)),m.jsxs("option",{value:T.closingHour,children:[T.closingHour," Uhr"]})]}),m.jsxs("select",{value:parseInt(Se.split(":")[1]),onChange:te=>Vs(parseInt(Se.split(":")[0]),parseInt(te.target.value)),className:"w-24 border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border",children:[m.jsx("option",{value:0,children:"00"}),m.jsx("option",{value:15,children:"15"}),m.jsx("option",{value:30,children:"30"}),m.jsx("option",{value:45,children:"45"})]})]})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Bis Uhrzeit"}),m.jsxs("div",{className:"flex gap-2",children:[m.jsxs("select",{value:parseInt(jt.split(":")[0]),onChange:te=>ks(parseInt(te.target.value),parseInt(jt.split(":")[1])),className:"w-full border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border",children:[Vt.map(te=>m.jsxs("option",{value:te,children:[te," Uhr"]},te)),m.jsxs("option",{value:T.closingHour,children:[T.closingHour," Uhr"]})]}),m.jsxs("select",{value:parseInt(jt.split(":")[1]),onChange:te=>ks(parseInt(jt.split(":")[0]),parseInt(te.target.value)),className:"w-24 border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border",children:[m.jsx("option",{value:0,children:"00"}),m.jsx("option",{value:15,children:"15"}),m.jsx("option",{value:30,children:"30"}),m.jsx("option",{value:45,children:"45"})]})]})]})]}),Q&&(p==null?void 0:p.seriesId)&&m.jsxs("div",{className:"bg-orange-50 p-3 rounded-lg border border-orange-200",children:[m.jsxs("label",{className:"flex items-center space-x-2 cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:Ft,onChange:te=>zi(te.target.checked),disabled:!X,className:"w-4 h-4 text-orange-600 rounded focus:ring-orange-500"}),m.jsx("span",{className:"text-sm font-bold text-orange-800",children:"Serie ab hier bearbeiten"})]}),m.jsx("p",{className:"text-xs text-orange-600 mt-1 ml-6",children:"Änderungen (Zeit, Platz, Anzahl) gelten für diesen und alle künftigen Termine der Serie."})]}),we&&(!Q||Q&&Ft)&&m.jsxs("div",{className:`bg-gray-50 p-3 rounded-lg border border-gray-200 space-y-3 ${Q&&Ft?"block":Q?"hidden":"block"}`,children:[!Q&&m.jsxs("label",{className:"flex items-center space-x-2 cursor-pointer",children:[m.jsx("input",{type:"checkbox",checked:fn,onChange:te=>Pn(te.target.checked),disabled:!X,className:"w-4 h-4 text-blue-600 rounded focus:ring-blue-500"}),m.jsx("span",{className:"text-sm font-semibold text-gray-800",children:"Serientermin erstellen"})]}),(fn||Q&&Ft)&&m.jsxs("div",{className:"space-y-3 pl-6 animate-fade-in",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:"Wiederholung"}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx("button",{type:"button",onClick:()=>se("WEEKLY"),disabled:!X,className:`px-3 py-1 text-xs rounded border ${ee==="WEEKLY"?"bg-blue-100 border-blue-400 text-blue-700":"bg-white border-gray-300"}`,children:"Wöchentlich"}),m.jsx("button",{type:"button",onClick:()=>se("DAILY"),disabled:!X,className:`px-3 py-1 text-xs rounded border ${ee==="DAILY"?"bg-blue-100 border-blue-400 text-blue-700":"bg-white border-gray-300"}`,children:"Täglich"})]})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:Q?"Neue Serien-Länge (ab diesem Termin)":"Ende der Serie"}),m.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[m.jsxs("label",{className:"inline-flex items-center text-xs",children:[m.jsx("input",{type:"radio",name:"endMode",checked:oe==="COUNT",onChange:()=>ue("COUNT"),disabled:!X,className:"mr-1 text-blue-600"}),"Nach Anzahl"]}),m.jsxs("label",{className:"inline-flex items-center text-xs",children:[m.jsx("input",{type:"radio",name:"endMode",checked:oe==="DATE",onChange:()=>ue("DATE"),disabled:!X,className:"mr-1 text-blue-600"}),"Am Datum"]})]}),oe==="COUNT"?m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("input",{type:"number",min:"1",max:"52",value:ke,onChange:te=>wt(parseInt(te.target.value)||1),disabled:!X,className:"w-20 border-gray-300 rounded text-sm p-1 border"}),m.jsx("span",{className:"text-xs text-gray-500",children:"Termine"})]}):m.jsx("input",{type:"date",value:ve,onChange:te=>nt(te.target.value),className:"w-full border-gray-300 rounded text-sm p-1 border"})]})]})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Buchungstyp"}),m.jsxs("select",{value:R,onChange:te=>V(te.target.value),disabled:!X,className:"w-full border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border",children:[He&&m.jsx("option",{value:Ge.GAME,children:"Spiel"}),ze&&m.jsx("option",{value:Ge.TRAINING,children:"Training"}),Ve&&m.jsx("option",{value:Ge.EVENT,children:"Veranstaltung"}),I&&m.jsx("option",{value:Ge.MAINTENANCE,children:"Platzsperre / Wartung"})]})]})]}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Datum"}),m.jsx("div",{className:"text-gray-900 font-semibold",children:c.toLocaleDateString("de-DE",{weekday:"long",day:"numeric",month:"long",year:"numeric"})})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Platz wählen"}),m.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[ge?m.jsx("button",{type:"button",className:`py-2 px-4 roun
3264ded-lg border text-sm font-medium transition-colors ${qe===1?"bg-blue-50 border-blue-500 text-blue-700":"border-gray-200 text-gray-600 hover:bg-gray-50"} ${!X&&qe!==1?"opacity-50 cursor-not-allowed":""}`,disabled:!X,children:T.courtNames[1]}):m.jsxs("button",{type:"button",disabled:!0,className:"py-2 px-4 rounded-lg border border-gray-200 bg-gray-50 text-gray-400 text-sm font-medium cursor-not-allowed",children:[T.courtNames[1]," (Gesperrt)"]}),Te?m.jsx("button",{type:"button",className:`py-2 px-4 rounded-lg border text-sm font-medium transition-colors ${qe===2?"bg-blue-50 border-blue-500 text-blue-700":"border-gray-200 text-gray-600 hover:bg-gray-50"} ${!X&&qe!==2?"opacity-50 cursor-not-allowed":""}`,disabled:!X,children:T.courtNames[2]}):m.jsxs("button",{type:"button",disabled:!0,className:"py-2 px-4 rounded-lg border border-gray-200 bg-gray-50 text-gray-400 text-sm font-medium cursor-not-allowed",children:[T.courtNames[2]," (Gesperrt)"]})]})]}),m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Startzeit"}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx("select",{value:re,onChange:te=>fe(Number(te.target.value)),disabled:!X,className:"w-full border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border",children:Vt.map(te=>m.jsxs("option",{value:te,children:[te," Uhr"]},te))}),m.jsxs("select",{value:Be,onChange:te=>Ke(Number(te.target.value)),disabled:!X,className:"w-24 border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border",children:[m.jsx("option",{value:0,children:"00"}),m.jsx("option",{value:15,children:"15"}),m.jsx("option",{value:30,children:"30"}),m.jsx("option",{value:45,children:"45"})]})]})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Dauer (Std)"}),m.jsxs("select",{value:M,onChange:te=>Y(Number(te.target.value)),disabled:!X,className:"w-full border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border",children:[m.jsx("option",{value:1,children:"1 Stunde"}),T.maxDurationPerDay>=120&&m.jsx("option",{value:2,children:"2 Stunden"})]})]})]}),Number(He)+Number(ze)+Number(Ve)+Number(I)>1&&m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Typ"}),m.jsxs("select",{value:R,onChange:te=>V(te.target.value),disabled:!X,className:"w-full border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border",children:[He&&m.jsx("option",{value:Ge.GAME,children:"Spiel"}),ze&&m.jsx("option",{value:Ge.TRAINING,children:"Training"}),Ve&&m.jsx("option",{value:Ge.EVENT,children:"Veranstaltung"}),I&&m.jsx("option",{value:Ge.MAINTENANCE,children:"Platzsperre / Wartung"})]})]})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Anmerkung (Optional)"}),m.jsx("input",{type:"text",value:N,onChange:te=>j(te.target.value),disabled:!X,placeholder:"z.B. Gegnername, Turnier...",className:"w-full border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border disabled:bg-gray-50"})]}),m.jsxs("div",{className:`flex ${Q&&X?"justify-between":"justify-end gap-3"} mt-6`,children:[Q&&X&&s&&m.jsx("div",{className:"relative",children:Si?m.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-red-50 border border-red-200 rounded-lg animate-fade-in shadow-inner",children:[m.jsx("span",{className:"text-xs font-bold text-red-800",children:"Wirklich löschen?"}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx("button",{type:"button",onClick:Aa,className:"px-3 py-1.5 bg-red-600 text-white text-xs font-bold rounded hover:bg-red-700 transition-colors shadow-sm",children:"Ja, Löschen"}),m.jsx("button",{type:"button",onClick:()=>Jn(!1),className:"px-3 py-1.5 bg-white text-gray-700 text-xs font-bold border border-gray-200 rounded hover:bg-gray-50 transition-colors",children:"Abbrechen"})]})]}):m.jsx("button",{type:"button",onClick:()=>Jn(!0),className:"px-4 py-2 bg-red-100 text-red-700 rounded-lg hover:bg-red-200 transition-colors font-bold",children:"Löschen"})}),m.jsx("div",{className:"flex gap-3 items-end",children:!Si&&m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors",children:"Abbrechen"}),X&&m.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors shadow-sm font-bold",children:Q?"Änderungen speichern":z?"Speichern":"Buchung bestätigen"})]})})]})]})]})})},cl=({value:r,onChange:e,label:i})=>{const s=ye.useRef(null);ye.useEffect(()=>{s.current&&s.current.innerHTML!==r&&document.activeElement!==s.current&&(s.current.innerHTML=r)},[r]);const o=(y,_=void 0)=>{var p;document.execCommand(y,!1,_),s.current&&e(s.current.innerHTML),(p=s.current)==null||p.focus()},c=()=>{s.current&&e(s.current.innerHTML)},f=({cmd:y,arg:_,icon:p,label:T})=>m.jsx("button",{type:"button",onClick:A=>{A.preventDefault(),o(y,_)},className:"p-1.5 text-gray-600 hover:text-blue-600 hover:bg-blue-50 rounded transition-colors text-sm font-medium flex items-center gap-1",title:T,children:p||T});return m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700",children:i}),m.jsxs("div",{className:"border border-gray-300 rounded-lg overflow-hidden bg-white shadow-sm focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500 transition-all",children:[m.jsxs("div",{className:"flex flex-wrap items-center gap-1 p-2 border-b border-gray-100 bg-gray-50",children:[m.jsx(f,{cmd:"bold",label:"B",icon:m.jsx("span",{className:"font-bold font-serif px-1",children:"B"})}),m.jsx(f,{cmd:"italic",label:"I",icon:m.jsx("span",{className:"italic font-serif px-1",children:"I"})}),m.jsx(f,{cmd:"underline",label:"U",icon:m.jsx("span",{className:"underline font-serif px-1",children:"U"})}),m.jsx("div",{className:"w-px h-4 bg-gray-300 mx-1"}),m.jsx(f,{cmd:"formatBlock",arg:"h3",label:"H3",icon:m.jsx("span",{className:"font-bold text-xs",children:"H3"})}),m.jsx(f,{cmd:"formatBlock",arg:"h4",label:"H4",icon:m.jsx("span",{className:"font-bold text-xs",children:"H4"})}),m.jsx(f,{cmd:"formatBlock",arg:"p",label:"P",icon:m.jsx("span",{className:"text-xs",children:"Txt"})}),m.jsx("div",{className:"w-px h-4 bg-gray-300 mx-1"}),m.jsx(f,{cmd:"insertUnorderedList",label:"Liste",icon:m.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"}),m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:4,d:"M1 6h.01M1 12h.01M1 18h.01"})]})}),m.jsx(f,{cmd:"insertOrderedList",label:"Nummerierung",icon:m.jsxs("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7.75 6h14M7.75 12h14M7.75 18h14"}),m.jsx("text",{x:"0",y:"7",fontSize:"8",children:"1"}),m.jsx("text",{x:"0",y:"13",fontSize:"8",children:"2"})]})})]}),m.jsx("div",{ref:s,contentEditable:!0,onInput:c,className:"p-4 min-h-[400px] outline-none prose prose-slate max-w-none text-gray-800 email-preview-area",style:{minHeight:"400px"}})]}),m.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Tipp: Markieren Sie Text, um Formatierungen anzuwenden."})]})},AR=({currentUser:r,bookings:e,users:i=[],onUpdateUserRole:s,onDeleteBooking:o,onOpenBookingModal:c,onEditBooking:f,footerContent:y,onUpdateFooterContent:_,emailSettings:p,onUp
3264dateEmailSettings:T,systemSettings:A,onUpdateSystemSettings:S})=>{const[z,Q]=ye.useState("bookings"),[ie,X]=ye.useState("future"),[ge,Te]=ye.useState(""),[we,He]=ye.useState("all"),[ze,Ve]=ye.useState("all"),[I,w]=ye.useState({...dE,...y||{}}),[N,j]=ye.useState({...fE,...p||{}}),[R,V]=ye.useState(A||ih),[C,Ne]=ye.useState(null),[qe,G]=ye.useState(null),re=new Date,fe=r.role===_e.ADMIN,Ke=[...e].sort((H,Ee)=>new Date(H.startTime).getTime()-new Date(Ee.startTime).getTime()).filter(H=>{var Se;const Ee=new Date(H.endTime);if(ie==="future"&&Ee<re||ie==="past"&&Ee>=re)return!1;if(ge){const Fe=ge.toLowerCase(),jt=H.userName.toLowerCase().includes(Fe),Rt=(Se=H.description)==null?void 0:Se.toLowerCase().includes(Fe);if(!jt&&!Rt)return!1}return!(we!=="all"&&H.courtId!==parseInt(we)||ze!=="all"&&H.type!==ze)}),M={total:e.length,upcoming:e.filter(H=>new Date(H.endTime)>=re).length,maintenance:e.filter(H=>H.type===Ge.MAINTENANCE).length,events:e.filter(H=>H.type===Ge.EVENT).length},Y=()=>{_&&(_(I),G("Webseiten-Inhalte gespeichert!"),setTimeout(()=>G(null),3e3))},ne=()=>{T&&(T(N),G("E-Mail Einstellungen gespeichert!"),setTimeout(()=>G(null),3e3))},le=()=>{S&&(S(R),G("System-Regeln gespeichert!"),setTimeout(()=>G(null),3e3))},be=(H,Ee)=>{const Se=R.bookingPermissions[H],Fe=Se.includes(Ee)?Se.filter(jt=>jt!==Ee):[...Se,Ee];V({...R,bookingPermissions:{...R.bookingPermissions,[H]:Fe}})},he=({category:H,role:Ee})=>m.jsx("input",{type:"checkbox",checked:R.bookingPermissions[H].includes(Ee),onChange:()=>be(H,Ee),className:"w-5 h-5 text-blue-600 rounded focus:ring-blue-500 cursor-pointer"});return m.jsxs("div",{className:"space-y-6 animate-fade-in-up",children:[m.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4 border-b border-gray-200 pb-4",children:[m.jsxs("div",{children:[m.jsx("h2",{className:"text-2xl font-bold text-gray-800",children:fe?"Admin Dashboard":"Moderatoren Bereich"}),m.jsx("p",{className:"text-gray-500",children:fe?"Verwaltung von Buchungen, Inhalten und Benutzern":"Verwaltung von Terminen und Buchungen"})]}),m.jsxs("div",{className:"flex bg-gray-100 p-1 rounded-lg overflow-x-auto max-w-full",children:[m.jsx("button",{onClick:()=>Q("bookings"),className:`px-4 py-2 rounded-md text-sm font-medium transition-all whitespace-nowrap ${z==="bookings"?"bg-white shadow text-blue-700":"text-gray-600 hover:text-gray-900"}`,children:"Buchungen"}),fe&&m.jsxs(m.Fragment,{children:[m.jsx("button",{onClick:()=>Q("content"),className:`px-4 py-2 rounded-md text-sm font-medium transition-all whitespace-nowrap ${z==="content"?"bg-white shadow text-blue-700":"text-gray-600 hover:text-gray-900"}`,children:"Inhalte"}),m.jsx("button",{onClick:()=>Q("email"),className:`px-4 py-2 rounded-md text-sm font-medium transition-all whitespace-nowrap ${z==="email"?"bg-white shadow text-blue-700":"text-gray-600 hover:text-gray-900"}`,children:"E-Mail Vorlagen"}),m.jsx("button",{onClick:()=>Q("settings"),className:`px-4 py-2 rounded-md text-sm font-medium transition-all whitespace-nowrap ${z==="settings"?"bg-white shadow text-blue-700":"text-gray-600 hover:text-gray-900"}`,children:"Einstellungen"}),m.jsx("button",{onClick:()=>Q("users"),className:`px-4 py-2 rounded-md text-sm font-medium transition-all whitespace-nowrap ${z==="users"?"bg-white shadow text-blue-700":"text-gray-600 hover:text-gray-900"}`,children:"Benutzer"})]})]})]}),z==="bookings"&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"flex justify-end mb-4",children:m.jsxs("button",{onClick:()=>c(1),className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg shadow text-sm flex items-center gap-2",children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Buchung erstellen"]})}),m.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[m.jsxs("div",{className:"bg-white p-4 rounded-xl border border-gray-200 shadow-sm",children:[m.jsx("div",{className:"text-gray-500 text-xs font-semibold uppercase",children:"Buchungen Gesamt"}),m.jsx("div",{className:"text-2xl font-bold text-gray-800",children:M.total})]}),m.jsxs("div",{className:"bg-white p-4 rounded-xl border border-gray-200 shadow-sm",children:[m.jsx("div",{className:"text-gray-500 text-xs font-semibold uppercase",children:"Kommende"}),m.jsx("div",{className:"text-2xl font-bold text-blue-600",children:M.upcoming})]}),m.jsxs("div",{className:"bg-white p-4 rounded-xl border border-gray-200 shadow-sm",children:[m.jsx("div",{className:"text-gray-500 text-xs font-semibold uppercase",children:"Wartung / Sperren"}),m.jsx("div",{className:"text-2xl font-bold text-red-600",children:M.maintenance})]}),m.jsxs("div",{className:"bg-white p-4 rounded-xl border border-gray-200 shadow-sm",children:[m.jsx("div",{className:"text-gray-500 text-xs font-semibold uppercase",children:"Veranstaltungen"}),m.jsx("div",{className:"text-2xl font-bold text-purple-600",children:M.events})]})]}),m.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl shadow-sm overflow-hidden",children:[m.jsxs("div",{className:"p-4 border-b border-gray-200 bg-gray-50 flex flex-col md:flex-row gap-4 justify-between items-center",children:[m.jsxs("div",{className:"flex flex-col md:flex-row gap-4 w-full md:w-auto",children:[m.jsxs("div",{className:"relative w-full md:w-64",children:[m.jsx("input",{type:"text",placeholder:"Suchen (Name, Info)...",value:ge,onChange:H=>Te(H.target.value),className:"w-full pl-9 pr-3 py-2 text-sm border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500"}),m.jsx("svg",{className:"w-4 h-4 text-gray-400 absolute left-3 top-2.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),m.jsxs("select",{value:we,onChange:H=>He(H.target.value),className:"py-2 pl-3 pr-8 text-sm border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500 bg-white",children:[m.jsx("option",{value:"all",children:"Alle Plätze"}),m.jsx("option",{value:"1",children:(A==null?void 0:A.courtNames[1])||Xo[1].split("(")[0]}),m.jsx("option",{value:"2",children:(A==null?void 0:A.courtNames[2])||Xo[2].split("(")[0]})]}),m.jsxs("select",{value:ze,onChange:H=>Ve(H.target.value),className:"py-2 pl-3 pr-8 text-sm border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500 bg-white",children:[m.jsx("option",{value:"all",children:"Alle Typen"}),m.jsx("option",{value:Ge.GAME,children:"Spiel"}),m.jsx("option",{value:Ge.TRAINING,children:"Training"}),m.jsx("option",{value:Ge.EVENT,children:"Event"}),m.jsx("option",{value:Ge.MAINTENANCE,children:"Sperre"})]})]}),m.jsx("div",{className:"flex bg-gray-200 p-1 rounded-lg shrink-0",children:["future","all","past"].map(H=>m.jsx("button",{onClick:()=>X(H),className:`px-3 py-1.5 rounded-md text-xs font-medium capitalize transition-all ${ie===H?"bg-white text-blue-700 shadow-sm":"text-gray-600 hover:text-gray-900"}`,children:H==="future"?"Kommende":H==="past"?"Vergangene":"Alle"},H))})]}),m.jsx("div",{className:"overflow-x-auto",children:m.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[m.jsx("thead",{className:"bg-gray-50",children:m.jsxs("tr",{children:[m.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Datum / Zeit"}),m.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Platz"}),m.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Gebucht von"}),m.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Typ"}),m.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Details"}),m.jsx("th",{scope:"col",className:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Aktion"})]})}),m.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:(()=>{const H=[];return Ke.forEach(Ee=>{const Se=`${Ee.startTime}_${Ee.endTime}_${Ee.userId}_${Ee.type}_${Ee.description||""}`,Fe=H.find(jt=>jt.key===Se);Fe?Fe.bookings.push(Ee):H.push({key:Se,bookings:[Ee]})}),H.length===0?m.jsx("tr",{children:m.jsx("td",{colSpan:6,className:"px-6 py-12 text-center text-gray-500",children:m.jsxs("div",{className:"flex flex-col items-center gap-2",children:[m.jsx("svg",{className:"w-8 h-8 text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),m.jsx("span",{children:"Keine Buchungen gefunden, die den Filtern entsprechen."})]})})}):H.map(({key:Ee,bookings:Se})=>{const Fe=Se[0],jt=Se.map(Rt=>(A==null?void 0:A.courtNames[Rt.courtId])||Xo[Rt.courtId]).join(", ");return m.jsxs("tr",{className:"hover:bg-gray-50 transition-colors",children:[m.jsxs("td",{className:"px-6 py-4 whitespace-nowrap",children:[m.jsx("div",{className:"text-sm font-medium text-gray-900",children:new Date(Fe.startTime).toLocaleDateString("de-DE")}),m.jsxs("div",{className:"text-sm text-gray-500",children:[new Date(Fe.startTime).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})," - ",new Date(Fe.endTime).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})]})]}),m.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:m.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800",children:jt})}),m.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:m.jsx("div",{className:"flex items-center",children:m.jsx("div",{className:"text-sm font-medium text-gray-900",children:Fe.userName})})}),m.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:m.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${ji[Fe.type].split(" ")[0]} ${ji[Fe.type].split(" ")[2]}`,children:Ah[Fe.type]||Fe.type})}),m.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 truncate max-w-xs",children:Fe.description||"-"}),m.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium flex justify-end gap-3",children:[f&&m.jsx("button",{onClick:()=>f(Fe),className:"text-blue-600 hover:text-blue-900 hover:underline",children:"Bearbeiten"}),C===Ee?m.jsxs("div",{className:"flex gap-2 animate-fade-in",children:[m.jsx("button",{onClick:()=>{Se.forEach(Rt=>o(Rt.id)),Ne(null)},className:"text-red-700 font-bold hover:underline text-xs bg-red-50 px-2 py-1 rounded border border-red-200",children:"Sicher?"}),m.jsx("button",{onClick:()=>Ne(null),className:"text-gray-500 hover:text-gray-700 text-xs",children:"Abbrechen"})]}):m.jsx("button",{onClick:()=>Ne(Ee),className:"text-red-600 hover:text-red-900 hover:underline",children:Se.length>1?"Gruppe löschen":"Löschen"})]})]},Ee)})})()})]})})]})]}),z==="users"&&fe&&m.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl shadow-sm overflow-hidden animate-fade-in",children:[m.jsxs("div",{className:"p-4 border-b border-gray-200 bg-gray-50",children:[m.jsx("h3",{className:"text-lg font-bold text-gray-800",children:"Benutzerverwaltung"}),m.jsx("p",{className:"text-sm text-gray-500",children:"Weisen Sie Benutzern Rollen zu (Admin, Moderator, User)."})]}),m.jsx("div",{className:"overflow-x-auto",children:m.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[m.jsx("thead",{className:"bg-gray-50",children:m.jsxs("tr",{children:[m.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Benutzer"}),m.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Email"}),m.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Adresse"}),m.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),m.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Aktuelle Rolle"}),m.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Rolle ändern"})]})}),m.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:i.map(H=>{var Se;const Ee=!H.isClubMember&&((Se=H.address)==null?void 0:Se.zip)!=="2402";return m.jsxs("tr",{className:Ee?"bg-red-50":void 0,children:[m.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:m.jsxs("div",{className:"flex items-center",children:[m.jsx("div",{className:"flex-shrink-0 h-10 w-10",children:m.jsx("img",{className:"h-10 w-10 rounded-full",src:H.avatarUrl,alt:""})}),m.jsxs("div",{className:"ml-4",children:[m.jsx("div",{className:"text-sm font-medium text-gray-900",children:H.name}),m.jsxs("div",{className:"text-xs text-gray-500",children:["ID: ",H.id]})]})]})}),m.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:m.jsx("div",{className:"text-sm text-gray-900",children:H.email})}),m.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:m.jsx("div",{className:"text-xs text-gray-900",children:H.address?m.jsxs(m.Fragment,{children:[H.address.street,m.jsx("br",{}),H.address.zip," ",H.address.city]}):m.jsx("span",{className:"text-gray-400 italic",children:"Nicht angegeben"})})}),m.jsxs("td",{className:"px-6 py-4 whitespace-nowrap",children:[m.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${H.isClubMember?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"}`,children:H.isClubMember?"Mitglied":"Gast"}),!H.profileComplete&&m.jsx("div",{className:"text-[10px] text-red-500 mt-1 font-bold",children:"Profil unvollständig"})]}),m.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:m.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full 
3265                          ${H.role===_e.ADMIN?"bg-purple-100 text-purple-800":H.role===_e.MODERATOR?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"}`,children:H.role})}),m.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:m.jsxs("select",{value:H.role,onChange:Fe=>{if(s){if(r.id===H.id&&Fe.target.value!==_e.ADMIN&&!window.confirm("Warnung: Wenn Sie sich selbst die Admin-Rechte entziehen, verlieren Sie den Zugriff auf diesen Bereich. Fortfahren?"))return;s(H.id,Fe.target.value)}},className:"block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-md",children:[m.jsx("option",{value:_e.MEMBER,children:"User"}),m.jsx("option",{value:_e.MODERATOR,children:"Moderator"}),m.jsx("option",{value:_e.ADMIN,children:"Administrator"})]})})]},H.id)})})]})})]}),z==="settings"&&fe&&m.jsxs("div",{className:"bg-white p-6 rounded-xl shadow-sm border border-gray-200 animate-fade-in",children:[m.jsx("h3",{className:"text-lg font-bold text-gray-800 mb
3265-4 border-b pb-2",children:"Allgemeine System-Regeln"}),m.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[m.jsxs("div",{className:"col-span-1 md:col-span-2 grid grid-cols-1 md:grid-cols-2 gap-4",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Name Platz 1"}),m.jsx("input",{type:"text",value:R.courtNames[1],onChange:H=>V({...R,courtNames:{...R.courtNames,1:H.target.value}}),className:"w-full bg-white text-gray-900 border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Name Platz 2"}),m.jsx("input",{type:"text",value:R.courtNames[2],onChange:H=>V({...R,courtNames:{...R.courtNames,2:H.target.value}}),className:"w-full bg-white text-gray-900 border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border"})]})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Öffnung (Uhr)"}),m.jsx("select",{value:R.openingHour,onChange:H=>V({...R,openingHour:Number(H.target.value)}),className:"w-full bg-white text-gray-900 border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border",children:[6,7,8,9,10,11,12].map(H=>m.jsxs("option",{value:H,children:[H,":00"]},H))})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Schließung (Uhr)"}),m.jsx("select",{value:R.closingHour,onChange:H=>V({...R,closingHour:Number(H.target.value)}),className:"w-full bg-white text-gray-900 border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border",children:[18,19,20,21,22,23,24].map(H=>m.jsxs("option",{value:H,children:[H,":00"]},H))})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Buchungshorizont (Tage im Voraus)"}),m.jsx("input",{type:"number",min:"1",max:"365",value:R.maxDaysInAdvance,onChange:H=>V({...R,maxDaysInAdvance:Number(H.target.value)}),className:"w-full bg-white text-gray-900 border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border"}),m.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Wie viele Tage im Voraus dürfen Mitglieder buchen?"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Max. Spieldauer pro Tag (Minuten)"}),m.jsx("input",{type:"number",step:"30",min:"30",value:R.maxDurationPerDay,onChange:H=>V({...R,maxDurationPerDay:Number(H.target.value)}),className:"w-full bg-white text-gray-900 border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border"}),m.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Wie lange darf ein Mitglied pro Tag insgesamt spielen?"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Max. aktive Buchungen pro User"}),m.jsx("input",{type:"number",min:"1",max:"10",value:R.maxActiveBookings,onChange:H=>V({...R,maxActiveBookings:Number(H.target.value)}),className:"w-full bg-white text-gray-900 border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border"}),m.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Wie viele offene (zukünftige) Buchungen darf ein User gleichzeitig haben?"})]}),m.jsxs("div",{className:"col-span-1 md:col-span-2 mt-4",children:[m.jsx("h4",{className:"text-sm font-bold text-gray-800 mb-3 uppercase tracking-wide border-b pb-1",children:"Berechtigungen"}),m.jsx("div",{className:"overflow-x-auto",children:m.jsxs("table",{className:"min-w-full text-sm",children:[m.jsx("thead",{children:m.jsxs("tr",{className:"bg-gray-50",children:[m.jsx("th",{className:"text-left py-2 px-3 font-medium text-gray-600",children:"Funktion"}),m.jsx("th",{className:"text-center py-2 px-3 font-medium text-gray-600",children:"Admin"}),m.jsx("th",{className:"text-center py-2 px-3 font-medium text-gray-600",children:"Moderator"}),m.jsx("th",{className:"text-center py-2 px-3 font-medium text-gray-600",children:"User"})]})}),m.jsxs("tbody",{className:"divide-y divide-gray-100",children:[m.jsxs("tr",{children:[m.jsx("td",{className:"py-3 px-3 font-medium text-gray-800",children:"Buchung Platz 1"}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"court1",role:_e.ADMIN})}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"court1",role:_e.MODERATOR})}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"court1",role:_e.MEMBER})})]}),m.jsxs("tr",{children:[m.jsx("td",{className:"py-3 px-3 font-medium text-gray-800",children:"Buchung Platz 2"}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"court2",role:_e.ADMIN})}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"court2",role:_e.MODERATOR})}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"court2",role:_e.MEMBER})})]}),m.jsxs("tr",{children:[m.jsx("td",{className:"py-3 px-3 font-medium text-gray-800",children:"Serientermine er
3265stellen"}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"recurring",role:_e.ADMIN})}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"recurring",role:_e.MODERATOR})}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"recurring",role:_e.MEMBER})})]}),m.jsxs("tr",{children:[m.jsx("td",{className:"py-3 px-3 font-medium text-gray-800",children:"Typ: Spiel buchen"}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"game",role:_e.ADMIN})}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"game",role:_e.MODERATOR})}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"game",role:_e.MEMBER})})]}),m.jsxs("tr",{children:[m.jsx("td",{className:"py-3 px-3 font-medium text-gray-800",children:"Typ: Training buchen"}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"training",role:_e.ADMIN})}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"training",role:_e.MODERATOR})}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"training",role:_e.MEMBER})})]}),m.jsxs("tr",{children:[m.jsx("td",{className:"py-3 px-3 font-medium text-gray-800",children:"Typ: Event buchen"}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"event",role:_e.ADMIN})}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"event",role:_e.MODERATOR})}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"event",role:_e.MEMBER})})]}),m.jsxs("tr",{children:[m.jsx("td",{className:"py-3 px-3 font-medium text-gray-800",children:"Typ: Sperre/Wartung"}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"maintenance",role:_e.ADMIN})}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"maintenance",role:_e.MODERATOR})}),m.jsx("td",{className:"text-center",children:m.jsx(he,{category:"maintenance",role:_e.MEMBER})})]})]})]})}),m.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Haken setzen, um der jeweiligen Rolle die Berechtigung zu erteilen."})]})]}),m.jsxs("div",{className:"flex justify-end gap-4 mt-8 pt-4 border-t",children:[qe&&m.jsx("span",{className:"text-green-600 font-medium animate-fade-in flex items-center",children:qe}),m.jsxs("button",{onClick:le,className:"bg-green-600 hover:bg-green-700 text-white px-6 py-3 rounded-lg font-bold shadow-md transition-all flex items-center gap-2",children:[m.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Einstellungen speichern"]})]})]}),z==="content"&&fe&&m.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 animate-fade-in",children:[m.jsx("div",{className:"lg:col-span-2 bg-blue-50 border-l-4 border-blue-500 p-4 mb-4",children:m.jsxs("div",{className:"flex",children:[m.jsx("div",{className:"flex-shrink-0",children:m.jsx("svg",{className:"h-5 w-5 text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:m.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})}),m.jsx("div",{className:"ml-3",children:m.jsx("p",{className:"text-sm text-blue-700",children:"Nutzen Sie den Editor unten, um die Inhalte Ihrer Webseite anzupassen. Sie können Texte fett markieren, Überschriften setzen oder Listen erstellen."})})]})}),m.jsxs("div",{className:"lg:col-span-2 bg-white p-6 rounded-xl shadow-sm border border-gray-200",children:[m.jsx("h3",{className:"text-lg font-bold text-gray-800 mb-4 border-b pb-2",children:"Links & Verlinkungen"}),m.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Vereins-Homepage URL"}),m.jsx("input",{type:"url",placeholder:"https://mein-verein.de",value:I.websiteUrl,onChange:H=>w({...I,websiteUrl:H.target.value}),className:"w-full border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border text-sm"})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:'"Mitglied werden" URL'}),m.jsx("input",{type:"url",placeholder:"https://mein-verein.de/antrag.pdf",value:I.membershipUrl,onChange:H=>w({...I,membershipUrl:H.target.value}),className:"w-full border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border text-sm"})]})]})]}),m.jsx("div",{className:"bg-white p-6 rounded-xl shadow-sm border border-gray-200",children:m.jsx(cl,{label:"Impressum",value:I.impressum,onChange:H=>w({...I,impressum:H})})}),m.jsx("div",{className:"bg-white p-6 rounded-xl shadow-sm border border-gray-200",children:m.jsx(cl,{label:"AGB & Nutzungsbedingungen",value:I.agb,onCh
3265ange:H=>w({...I,agb:H})})}),m.jsx("div",{className:"bg-white p-6 rounded-xl shadow-sm border border-gray-200 lg:col-span-2",children:m.jsx(cl,{label:"Platzregeln",value:I.rules,onChange:H=>w({...I,rules:H})})}),m.jsxs("div",{className:"lg:col-span-2 flex justify-end gap-4 items-center sticky bottom-4 bg-white/90 p-4 border rounded-xl shadow-lg backdrop-blur-sm z-30",children:[qe&&m.jsx("span",{className:"text-green-600 font-medium animate-fade-in",children:qe}),m.jsxs("button",{onClick:Y,className:"bg-green-600 hover:bg-green-700 text-white px-6 py-3 rounded-lg font-bold shadow-md transition-all flex items-center gap-2",children:[m.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Änderungen speichern"]})]})]}),z==="email"&&fe&&m.jsxs("div",{className:"grid grid-cols-1 gap-6 animate-fade-in",children:[m.jsx("div",{className:"bg-blue-50 border-l-4 border-blue-500 p-4",children:m.jsxs("div",{className:"flex",children:[m.jsx("div",{className:"flex-shrink-0",children:m.jsx("svg",{className:"h-5 w-5 text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:m.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})}),m.jsxs("div",{className:"ml-3",children:[m.jsx("h3",{className:"text-sm font-bold text-blue-800",children:"E-Mail Konfiguration"}),m.jsx("p",{className:"text-sm text-blue-700 mt-1",children:"Hier definieren Sie die E-Mail Vorlagen für automatisierte Benachrichtigungen."})]})]})}),m.jsxs("div",{className:"bg-white p-6 rounded-xl shadow-sm border border-gray-200",children:[m.jsxs("h3",{className:"text-sm font-bold text-gray-800 mb-2 flex items-center gap-2",children:[m.jsx("svg",{className:"w-4 h-4 text-blue-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Verfügbare Platzhalter (Tags)"]}),m.jsx("p",{className:"text-xs text-gray-600 mb-3",children:"Diese Platzhalter können Sie im Betreff und im Inhalt verwenden. Sie werden automatisch ersetzt:"}),m.jsx("div",{className:"flex flex-wrap gap-2",children:["{{userName}}","{{date}}","{{startTime}}","{{endTime}}","{{courtName}}","{{type}}","{{description}}"].map(H=>m.jsx("code",{className:"px-2 py-1 bg-gray-100 text-blue-700 rounded text-xs font-mono border border-gray-200",children:H},H))})]}),m.jsxs("div",{className:"bg-white p-6 rounded-xl shadow-sm border border-gray-200",children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Optionaler CC-Empfänger (z.B. Vorstand)"}),m.jsx("div",{className:"flex gap-2",children:m.jsx("input",{type:"email",placeholder:"[email protected]",value:N.ccAddress,onChange:H=>j({...N,ccAddress:H.target.value}),className:"w-full md:w-1/2 border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border text-sm"})}),m.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Diese E-Mail Adresse erhält eine Kopie aller Buchungsbestätigungen und Stornos."})]}),m.jsxs("div",{className:"bg-white p-6 rounded-xl shadow-sm border border-gray-200",children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"E-Mail Absenderadresse (From)"}),m.jsx("div",{className:"flex gap-2",children:m.jsx("input",{type:"email",placeholder:"[email protected]",value:N.fromAddress,onChange:H=>j({...N,fromAddress:H.target.value}),className:"w-full md:w-1/2 border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border text-sm"})}),m.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Diese Adresse wird als Absender aller automatischen E-Mails angezeigt."})]}),m.jsxs("div",{className:"bg-white p-6 rounded-xl shadow-sm border border-gray-200",children:[m.jsx("h3",{className:"text-lg font-bold text-gray-800 mb
3265-4 border-b pb-2",children:"Buchungsbestätigung"}),m.jsxs("div",{className:"mb-4",children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"E-Mail Betreff"}),m.jsx("input",{type:"text",placeholder:"Buchungsbestätigung: {{date}}",value:N.bookingSubject,onChange:H=>j({...N,bookingSubject:H.target.value}),className:"w-full border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border text-sm"})]}),m.jsx(cl,{label:"E-Mail Inhalt bei neuer Buchung",value:N.bookingTemplate,onChange:H=>j({...N,bookingTemplate:H})})]}),m.jsxs("div",{className:"bg-white p-6 rounded-xl shadow-sm border border-gray-200",children:[m.jsx("h3",{className:"text-lg font-bold text-gray-800 mb-4 border-b pb-2",children:"Buchungsänderung"}),m.jsxs("div",{className:"mb-4",children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"E-Mail Betreff"}),m.jsx("input",{type:"text",placeholder:"Buchungsänderung: {{date}}",value:N.updateSubject,onChange:H=>j({...N,updateSubject:H.target.value}),className:"w-full border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border text-sm"})]}),m.jsx(cl,{label:"E-Mail Inhalt bei Bearbeitung",value:N.updateTemplate,onChange:H=>j({...N,updateTemplate:H})})]}),m.jsxs("div",{className:"bg-white p-6 rounded-xl shadow-sm border border-gray-200",children:[m.jsx("h3",{className:"text-lg font-bold text-gray-800 mb-4 border-b pb-2",children:"Stornierung"}),m.jsxs("div",{className:"mb-4",children:[m.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"E-Mail Betreff"}),m.jsx("input",{type:"text",placeholder:"Stornierung: {{date}}",value:N.cancellationSubject,onChange:H=>j({...N,cancellationSubject:H.target.value}),className:"w-full border-gray-300 rounded-lg shadow-sm focus:border-blue-500 focus:ring-blue-500 p-2 border text-sm"})]}),m.jsx(cl,{label:"E-Mail Inhalt bei Storno/Löschung",value:N.cancellationTemplate,onChange:H=>j({...N,cancellationTemplate:H})})]}),m.jsxs("div",{className:"flex justify-end gap-4 items-center sticky bottom-4 bg-white/90 p-4 border rounded-xl shadow-lg backdrop-blur-sm z-30",children:[qe&&m.jsx("span",{className:"text-green-600 font-medium animate-fade-in",children:qe}),m.jsxs("button",{onClick:ne,className:"bg-green-600 hover:bg-green-700 text-white px-6 py-3 rounded-lg font-bold shadow-md transition-all flex items-center gap-2",children:[m.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),"Einstellungen speichern"]})]})]})]})},SR=({isOpen:r,onClose:e,title:i,content:s})=>r?m.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black bg-opacity-50 backdrop-blur-sm p-4 animate-fade-in",children:m.jsxs("div",{className:"bg-white rounded-xl shadow-2xl w-full max-w-2xl overflow-hidden flex flex-col max-h-[85vh]",children:[m.jsxs("div",{className:"bg-gray-50 px-6 py-4 border-b border-gray-200 flex justify-between items-center",children:[m.jsx("h3",{className:"text-xl font-bold text-gray-800",children:i}),m.jsx("button",{onClick:e,className:"text-gray-400 hover:text-gray-600 transition-colors p-1 hover:bg-gray-200 rounded-full",children:m.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),m.jsx("div",{className:"p-6 overflow-y-auto text-gray-700 leading-relaxed space-y-4",children:s}),m.jsx("div",{className:"bg-gray-50 px-6 py-4 border-t border-gray-200 flex justify-end",children:m.jsx("button",{onClick:e,className:"px-4 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300 transition-colors font-medium",children:"Schließen"})})]})}):null,mE=({className:r="h-12 w-auto"})=>{const[e,i]=ye.useState(!1);return e?m.jsx("div",{className:`${r} flex items-center justify-center`,children:m.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"w-full h-full text-red-600",children:[m.jsx("circle",{cx:"12",cy:"12",r:"10"}),m.jsx("path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}),m.jsx("path",{d:"M2 12h20"}),m.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z",fill:"
3265currentColor",fillOpacity:"0.1",stroke:"none"}),m.jsx("path",{d:"M12 12c-2.5 0-4.5 2-4.5 4.5"}),m.jsx("path",{d:"M12 12c2.5 0 4.5-2 4.5-4.5"}),m.jsx("path",{d:"M12 12c-2.5 0-4.5-2-4.5-4.5"}),m.jsx("path",{d:"M12 12c2.5 0 4.5 2 4.5 4.5"})]})}):m.jsx("img",{src:"/logo-vchme.png",alt:"VCHME Logo",className:`${r} object-contain`,onError:()=>i(!0)})},wR=({content:r})=>{const[e,i]=ye.useState(null),s=()=>{switch(e){case"impressum":return m.jsx("div",{dangerouslySetInnerHTML:{__html:r.impressum}});case"agb":return m.jsx("div",{dangerouslySetInnerHTML:{__html:r.agb}});case"rules":return m.jsx("div",{dangerouslySetInnerHTML:{__html:r.rules}});default:return null}},o=()=>{switch(e){case"impressum":return"Impressum";case"agb":return"AGB & Datenschutz";case"rules":return"Platzregeln";default:return""}};return m.jsxs(m.Fragment,{children:[m.jsx("footer",{className:"bg-white border-t border-gray-200 mt-auto pt-10 pb-8",children:m.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[m.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-12 mb-10",children:[m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("div",{className:"h-14 w-auto self-start",children:m.jsx(mE,{className:"h-full w-auto"})}),m.jsxs("div",{className:"flex flex-col",children:[m.jsxs("span",{className:"text-xl font-bold text-slate-800 leading-none",children:[m.jsx("span",{className:"text-red-600 font-extrabold",children:"C"}),"arnuntum",m.jsx("span",{className:"text-red-600 font-extrabold",children:"B"}),"each",m.jsx("span",{className:"text-red-600 font-extrabold",children:"A"}),"rena"]}),m.jsx("span",{className:"text-xs text-slate-500 font-medium uppercase tracking-wider mt-1",children:"Platzreservierung"})]})]}),m.jsx("p",{className:"text-sm text-gray-500 leading-relaxed font-medium",children:"Offizielle Platzreservierung des VC Haslau-Maria Ellend. Genieße den Sommer im Sand auf unseren Top-Anlagen."})]}),m.jsxs("div",{children:[m.jsx("h3",{className:"font-bold text-slate-900 mb-6 uppercase tracking-wider text-xs",children:"Informationen"}),m.jsxs("ul",{className:"space-y-3 text-sm font-semibold text-gray-600",children:[m.jsx("li",{children:m.jsx("button",{onClick:()=>i("rules"),className:"hover:text-red-600 transition-colors",children:"Platzregeln & Etikette"})}),m.jsx("li",{children:m.jsx("a",{href:r.websiteUrl||"#",target:"_blank",rel:"noopener noreferrer",className:"hover:text-red-600 transition-colors",children:"Vereins-Homepage"})}),m.jsx("li",{children:m.jsx("a",{href:r.membershipUrl||"#",target:"_blank",rel:"noopener noreferrer",className:"hover:text-red-600 transition-colors",children:"Mitglied werden"})})]})]}),m.jsxs("div",{children:[m.jsx("h3",{className:"font-bold text-slate-900 mb-6 uppercase tracking-wider text-xs",children:"Rechtliches"}),m.jsxs("ul",{className:"space-y-3 text-sm font-semibold text-gray-600",children:[m.jsx("li",{children:m.jsx("button",{onClick:()=>i("impressum"),className:"hover:text-red-600 transition-colors",children:"Impressum"})}),m.jsx("li",{children:m.jsx("button",{onClick:()=>i("agb"),className:"hover:text-red-600 transition-colors",children:"AGB & Datenschutz"})})]})]})]}),m.jsxs("div",{className:"border-t border-gray-100 pt-8 text-center text-sm font-bold text-gray-400",children:["© ",new Date().getFullYear()," VC Haslau-Maria Ellend | Alle Rechte vorbehalten. | ",m.jsx("span",{className:"opacity-75",children:"v1.2.6"})]})]})}),m.jsx(SR,{isOpen:!!e,onClose:()=>i(null),title:o(),content:s()})]})};let km=null;const NR=r=>{km=r},Lr=(r,e="info")=>{console.log(`[EMAIL SYSTEM]: ${r}`),km&&km({id:Math.random().toString(36).substr(2,9),message:r,type:e})},Il=(r,e,i,s)=>{const o=Array.isArray(e)?e:[e],c=o[0],f=new Date(c.startTime),y=f.toLocaleDateString("de-DE"),_=f.toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"}),p=new Date(c.endTime).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"}),A=o.map(Q=>{var X;let ie=((X=s==null?void 0:s.courtNames)==null?void 0:X[String(Q.courtId)])||Xo[Q.courtId]||`Platz ${Q.courtId}`;return(ie.includes("Center Court")||ie.includes("Side Court"))&&(ie=Q.courtId===1?"Straßen-Seite":"Au-Seite"),ie}).join(" & "),S=(c.type||"").toUpperCase();let z=Ah[S]||Ah[c.type]||c.type;return z==="GAME"&&(z="Spiel"),z==="MAINTENANCE"&&(z="Sperre/Wartung"),z==="TRAINING"&&(z="Training"),z==="EVENT"&&(z="Event"),r.replace(/{{userName}}
3265/g,i.name).replace(/{{date}}/g,y).replace(/{{startTime}}/g,_).replace(/{{endTime}}/g,p).replace(/{{courtName}}/g,A).replace(/{{courtId}}/g,o.map(Q=>Q.courtId).join(", ")).replace(/{{type}}/g,z).replace(/{{description}}/g,c.description||"-")},P_=async(r,e,i,s)=>{const o=Il(i.bookingTemplate,e,r,s),c=Array.isArray(e)?e:[e],f=Il(i.bookingSubject||`Buchungsbestätigung: ${new Date(c[0].startTime).toLocaleDateString("de-DE")}`,e,r,s);try{const y=i.ccAddress?i.ccAddress.split(",").map(T=>T.trim()).filter(T=>T!==""):[];console.log(`[EMAIL]: Queuing confirmation email to ${r.email}`);const _={to:r.email,from:i.fromAddress,message:{subject:f,html:o.replace(/\n/g,"<br>")},createdAt:Qh()};y.length>0&&(_.cc=y);const p=await vu(xa(hn,"mail"),_);console.log(`[EMAIL]: Document created with ID: ${p.id}`),Lr(`Bestätigung an ${r.email} wurde erfolgreich eingereiht.`,"success")}catch(y){console.error("Error queuing confirmation email:",y),Lr(`Fehler beim Einreihen der Mail: ${(y==null?void 0:y.message)||"Unbekannter Fehler"}`,"warning")}},IR=async(r,e,i,s)=>{const o=Il(i.cancellationTemplate,e,r,s),c=Array.isArray(e)?e:[e],f=Il(i.cancellationSubject||`Stornierung: ${new Date(c[0].startTime).toLocaleDateString("de-DE")}`,e,r,s);try{const y=i.ccAddress?i.ccAddress.split(",").map(T=>T.trim()).filter(T=>T!==""):[];console.log(`[EMAIL]: Queuing cancellation email to ${r.email}`);const _={to:r.email,from:i.fromAddress,message:{subject:f,html:o.replace(/\n/g,"<br>")},createdAt:Qh()};y.length>0&&(_.cc=y);const p=await vu(xa(hn,"mail"),_);console.log(`[EMAIL]: Document created with ID: ${p.id}`),Lr(`Storno-Bestätigung an ${r.email} wurde eingereiht.`,"warning")}catch(y){console.error("Error queuing cancellation email:",y),Lr(`Fehler beim Einreihen der Storno-Mail: ${(y==null?void 0:y.message)||"Unbekannter Fehler"}`,"warning")}},RR=async(r,e,i,s)=>{const o=Il(i.updateTemplate,e,r,s),c=Array.isArray(e)?e:[e],f=Il(i.updateSubject||`Buchungsänderung: ${new Date(c[0].startTime).toLocaleDateString("de-DE")}`,e,r,s);try{const y=i.ccAddress?i.ccAddress.split(",").map(T=>T.trim()).filter(T=>T!==""):[];console.log(`[EMAIL]: Queuing update email to ${r.email}`);const _={to:r.email,from:i.fromAddress,message:{subject:f,html:o.replace(/\n/g,"<br>")},createdAt:Qh()};y.length>0&&(_.cc=y);const p=await vu(xa(hn,"mail"),_);console.log(`[EMAIL]: Document created with ID: ${p.id}`),Lr(`Änderung an ${r.email} wurde erfolgreich eingereiht.`,"info")}catch(y){console.error("Error queuing update email:",y),Lr(`Fehler beim Einreihen der Änderungs-Mail: ${(y==null?void 0:y.message)||"Unbekannter Fehler"}`,"warning")}},CR=async(r,e,i)=>{if(!e.ccAddress||e.ccAddress.trim()===""){console.log("[EMAIL]: Skip admin notification - no address configured.");return}const s=Array.isArray(r)?r:[r],o=s[0],c=new Date(o.endTime).getTime()-new Date(o.startTime).getTime()>=480*60*1e3;let f="";o.type===Ge.EVENT?f="Veranstaltung":o.type===Ge.MAINTENANCE?f="Wartung/Sperre":c?f="Ganztagesbuchung":f="Spezielle Buchung";const y=`Admin-Alert: ${f} (${new Date(o.startTime).toLocaleDateString("de-DE")})`,_=s.map(T=>{let A=(i==null?void 0:i.courtNames[T.courtId])||Xo[T.courtId]||`Platz ${T.courtId}`;return(A.includes("Center Court")||A.includes("Side Court"))&&(A=T.courtId===1?"Straßen-Seite":"Au-Seite"),A}),p=`
3266    <h3>Admin Benachrichtigung</h3>
3267    <p>Eine spezielle Buchung wurde vorgenommen:</p>
3268    <ul>
3269      <li><strong>Grund:</strong> ${f}</li>
3270      <li><strong>Benutzer:</strong> ${o.userName}</li>
3271      <li><strong>Datum:</strong> ${new Date(o.startTime).toLocaleDateString("de-DE")}</li>
3272      <li><strong>Zeit:</strong> ${new Date(o.startTime).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})} - ${new Date(o.endTime).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})} Uhr</li>
3273      <li><strong>Platz/Plätze:</strong> ${_.join(" & ")}</li>
3274      <li><strong>Beschreibung:</strong> ${o.description||"-"}</li>
3275    </ul>
3276  `;try{console.log(`[EMAIL]: Queuing admin alert mail to ${e.ccAddress}`),await vu(xa(hn,"mail"),{to:e.ccAddress,from:e.fromAddress,message:{subject:y,html:p},createdAt:Qh()}),Lr("Admin-Info an Vorstand wurde ebenfalls per Mail versendet.","warning")}catch(T){console.error("Error queuing admin notification:",T)}},DR=()=>{const[r,e]=ye.useState([]);return ye.useEffect(()=>{NR(i=>{e(s=>[...s,i]),setTimeout(()=>{e(s=>s.filter(o=>o.id!==i.id))},5e3)})},[]),m.jsx("div",{className:"fixed top-20 left-1/2 -translate-x-1/2 z-[60] flex flex-col gap-2 pointer-events-none w-full max-w-sm px-4",children:r.map(i=>m.jsx("div",{className:`
3277            pointer-events-auto transform transition-all duration-300 animate-fade-in-up
3278            w-full bg-white shadow-lg rounded-lg pointer-events-auto flex ring-1 ring-black ring-opacity-5 overflow-hidden
3279            ${i.type==="success"?"border-l-4 border-green-500":i.type==="warning"?"border-l-4 border-orange-500":"border-l-4 border-blue-500"}
3280          `,children:m.jsx("div",{className:"p-4 w-full",children:m.jsxs("div",{className:"flex items-start",children:[m.jsxs("div",{className:"flex-shrink-0",children:[i.type==="success"&&m.jsx("svg",{className:"h-6 w-6 text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),i.type==="warning"&&m.jsx("svg",{className:"h-6 w-6 text-orange-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),i.type==="info"&&m.jsx("svg",{className:"h-6 w-6 text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})]}),m.jsxs("div",{className:"ml-3 flex-1 pt-0.5",children:[m.jsx("p",{className:"text-sm font-semibold text-gray-900",children:i.type==="success"?"Bestätigung gesendet":i.type==="warning"?"Admin Benachrichtigung":"Information"}),m.jsx("p",{className:"mt-1 text-sm text-gray-600 leading-relaxed",children:i.message})]}),m.jsx("div",{className:"ml-4 flex-shrink-0 flex",children:m.jsxs("button",{className:"bg-white rounded-md inline-flex text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",onClick:()=>e(s=>s.filter(o=>o.id!==i.id)),children:[m.jsx("span",{className:"sr-only",children:"Schließen"}),m.jsx("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:m.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L10 10 5.707 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})]})})]})})},i.id))})},MR=({user:r,onComplete:e})=>{var z,Q,ie;const[i,s]=ye.useState(((z=r.address)==null?void 0:z.street)||""),[o,c]=ye.useState(((Q=r.address)==null?void 0:Q.zip)||""),[f,y]=ye.useState(((ie=r.address)==null?void 0:ie.city)||""),[_,p]=ye.useState(r.isClubMember??null),[T,A]=ye.useState(null),S=X=>{if(X.preventDefault(),!i||!o||!f||_===null){A("Bitte fülle alle Felder aus.");return}e({address:{street:i,zip:o,city:f},isClubMember:_,profileComplete:!0})};return m.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100] flex items-center justify-center p-4 animate-fade-in",children:m.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl max-w-md w-full overflow-hidden animate-scale-in",children:[m.jsxs("div",{className:"bg-blue-600 p-6 text-white text-center",children:[m.jsx("div",{className:"w-16 h-16 bg-white/20 rounded-full flex items-center justify-center mx-auto mb-4",children:m.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})}),m.jsx("h2",{className:"text-2xl font-bold",children:"Profil vervollständigen"}),m.jsx("p",{className:"opacity-90 mt-1",children:"Herzlich Willkommen! Bitte ergänze deine Daten."})]}),m.jsxs("form",{onSubmit:S,className:"p-6 space-y-4",children:[T&&m.jsx("div",{className:"bg-red-50 text-red-600 p-3 rounded-lg text-sm font-medium animate-shake",children:T}),m.jsxs("div",{className:"space-y-4",children:[m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-1",children:"Straße & Hausnummer"}),m.jsx("input",{type:"text",value:i,onChange:X=>s(X.target.value),placeholder:"Musterstraße 123",className:"w-full border-gray-300 rounded-lg shadow-sm focus:ring-blue-500 focus:border-blue-500 p-3 border",required:!0})]}),m.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[m.jsxs("div",{className:"col-span-1",children:[m.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-1",children:"PLZ"}),m.jsx("input",{type:"text",value:o,onChange:X=>c(X.target.value),placeholder:"12345",className:"w-full border-gray-300 rounded-lg shadow-sm focus:ring-blue-500 focus:border-blue-500 p-3 border",required:!0})]}),m.jsxs("div",{className:"col-span-2",children:[m.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-1",children:"Ort"}),m.jsx("input",{type:"text",value:f,onChange:X=>y(X.target.value),placeholder:"Musterstadt",className:"w-full border-gray-300 rounded-lg shadow-sm focus:ring-blue-500 focus:border-blue-500 p-3 border",required:!0})]})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:"Bist du Vereinsmitglied?"}),m.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[m.jsx("button",{type:"button",onClick:()=>p(!0),className:`p-3 rounded-lg border-2 font-bold transition-all ${_===!0?"border-blue-600 bg-blue-50 text-blue-700":"border-gray-200 text-gray-500 hover:border-gray-300"}`,children:"Ja"}),m.jsx("button",{type:"button",onClick:()=>p(!1),className:`p-3 rounded-lg border-2 font-bold transition-all ${_===!1?"border-blue-600 bg-blue-50 text-blue-700":"border-gray-200 text-gray-500 hover:border-gray-300"}`,children:"Nein"})]})]})]}),m.jsx("button",{type:"submit",className:"w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 rounded-xl shadow-lg transition-all mt-6 transform active:scale-95",children:"Speichern & Fortfahren"})]})]})})},Zh="bookings",OR=r=>{const e=r.data();return{id:r.id,courtId:e.courtId,startTime:e.startTime.toDate().toISOString(),endTime:e.endTime.toDate().toISOString(),userId:e.userId,userName:e.userName,type:e.type,description:e.description,seriesId:e.seriesId}},jR=r=>{const e=new Date;e.setMonth(e.getMonth()-2);const i=oR(xa(hn,Zh),uR("startTime",">=",dt.fromDate(e)));return $h(i,s=>{const o=s.docs.map(OR);r(o)})},z_=async r=>{const e={};return Object.keys(r).forEach(s=>{const o=r[s];o!==void 0&&(e[s]=o)}),(await vu(xa(hn,Zh),{...e,startTime:dt.fromDate(new Date(r.startTime)),endTime:dt.fromDate(new Date(r.endTime))})).id},VR=async(r,e)=>{const i=Ai(hn,Zh,r),s={};Object.keys(e).forEach(o=>{const c=e[o];c!==void 0&&(s[o]=c)}),e.startTime&&(s.startTime=dt.fromDate(new Date(e.startTime))),e.endTime&&(s.endTime=dt.fromDate(new Date(e.endTime))),await fR(i,s)},B_=async r=>{const e=Ai(hn,Zh,r);await mR(e)},kl="settings",gE="footer",pE="email",yE="system",kR=async r=>
3280{await _a(Ai(hn,kl,gE),r)},LR=r=>$h(Ai(hn,kl,gE),e=>{r(e.exists()?e.data():null)}),UR=async r=>{await _a(Ai(hn,kl,pE),r)},PR=r=>$h(Ai(hn,kl,pE),e=>{r(e.exists()?e.data():null)}),zR=async r=>{await _a(Ai(hn,kl,yE),r)},BR=r=>$h(Ai(hn,kl,yE),e=>{r(e.exists()?e.data():null)});function HR(){const[r,e]=ye.useState(null),[i,s]=ye.useState([]),[o,c]=ye.useState([]),[f,y]=ye.useState(new Date),[_,p]=ye.useState(dE),[T,A]=ye.useState(fE),[S,z]=ye.useState(ih),[Q,ie]=ye.useState(!1),[X,ge]=ye.useState(1),[Te,we]=ye.useState(new Date),[He,ze]=ye.useState(8),[Ve,I]=ye.useState(null),[w,N]=ye.useState(!0),[j,R]=ye.useState("calendar"),[V,C]=ye.useState("week");ye.useEffect(()=>{let ee,se,oe,ue,ve;return(async()=>{ee=vR(ke=>{e(ke),ke&&(ke.role===_e.ADMIN||ke.role===_e.MODERATOR)&&Kc().then(s).catch(console.error)}),se=jR(ke=>{c(ke)}),oe=LR(ke=>{ke&&p(ke)}),ue=PR(ke=>{ke&&A(ke)}),ve=BR(ke=>{ke&&z({...ih,...ke,bookingPermissions:{...ih.bookingPermissions,...ke.bookingPermissions||{}}})}),setTimeout(()=>{},1e3),N(!1)})(),()=>{ee&&ee(),se&&se(),oe&&oe(),ue&&ue(),ve&&ve()}},[]);const Ne=async()=>{N(!0);try{const ee=await _R();e(ee),(ee.role===_e.ADMIN||ee.role===_e.MODERATOR)&&s(await Kc()),R("calendar")}catch(ee){console.error("Login failed",ee)}N(!1)},qe=async()=>{await bR(),e(null),R("calendar")},G=async(ee,se)=>{try{await ER(ee,se),s(await Kc()),r&&r.id===ee&&e({...r,role:se})}catch(oe){console.error("Failed to update user role",oe)}},re=ee=>{if(!r)return;const oe=ee.length>2||ee.length>0&&new Date(ee[0].startTime).getDate()!==new Date(ee[ee.length-1].startTime).getDate()?Math.random().toString(36).substr(2,9):void 0,ue=ee.map(ve=>({...ve,userId:r.id,userName:r.name,seriesId:oe}));if(Promise.all(ue.map(ve=>z_(ve))).then(()=>{}).catch(ve=>console.error("Error creating bookings",ve)),ue.length>0){console.log(`[APP]: Calling confirmation mail for ${r.email}. Count: ${ue.length}`),P_(r,ue,T,S);const ve=ue[0],nt=(new Date(ve.endTime).getTime()-new Date(ve.startTime).getTime())/(1e3*60*60),ke=ve.type===Ge.MAINTENANCE||ve.type===Ge.EVENT;(nt>=8||ke)&&CR(ue,T,S)}},fe=(ee,se)=>{if(!r)return;const oe=[],ue=[],ve=[];ee.forEach(nt=>{if(nt.id){const{id:ke,...wt}=nt;oe.push(VR(ke,wt)),ue.push({...o.find(Ft=>Ft.id===ke),...nt})}else{const ke={...nt,userId:r.id,userName:r.name};oe.push(z_(ke)),ve.push(ke)}}),se.forEach(nt=>{oe.push(B_(nt))}),Promise.all(oe).catch(nt=>console.error("Error in batch update",nt)),ue.length>0&&(console.log(`[APP]: Calling update mail (batch). Count: ${ue.length}`),RR(r,ue,T,S)),ve.length>0&&(console.log(`[APP]: Calling confirmation mail (batch). Count: ${ve.length}`),P_(r,ve,T,S))},Be=ee=>{p(ee),kR(ee).catch(se=>console.error("Error saving footer:",se))},Ke=ee=>{A(ee),UR(ee).catch(se=>console.error("Error saving email settings:",se))},M=ee=>{z(ee),zR(ee).catch(se=>console.error("Error saving system settings:",se))},Y=ee=>{const se=o.find(oe=>oe.id===ee);B_(ee).catch(oe=>console.error("Error deleting booking",oe)),se&&r&&(console.log("[APP]: Calling cancellation mail. CourtNames:",S==null?void 0:S.courtNames),IR(r,se,T,S))},ne=ee=>{const se=new Date(f);V==="week"?se.setDate(se.getDate()+ee*7):se.setDate(se.getDate()+ee),y(se)},le=(ee,se=f,oe=S.openingHour)=>{if(!r){Lr("Bitte loggen Sie sich ein, um einen Platz zu reservieren.","warning");return}ge(ee),we(se),ze(oe),I(null),ie(!0)},be=ee=>{if(!r){Lr("Bitte loggen Sie sich ein, um Details zu sehen.","warning");return}I(ee),we(new Date(ee.startTime)),ge(ee.courtId),ie(!0)},he=ee=>{const se=new Date(ee),oe=se.getDay(),ue=se.getDate()-oe+(oe===0?-6:1);return se.setDate(ue),se},H=(ee,se,oe)=>{const ue=new Date(oe);ue.setHours(ee,0,0,0);const ve=new Date(ue);return ve.setHours(ee+1,0,0,0),o.find(nt=>{if(nt.courtId!==se)return!1;const ke=new Date(nt.startTime),wt=new Date(nt.endTime);return ke<ve&&wt>ue})},Ee=(ee,se,oe)=>{const ue=new Date(ee.startTime);return ue.getDate()<oe.getDate()||ue.getMonth()<oe.getMonth()||ue.getFullYear()<oe.getFullYear()?se===S.openingHour:ue.getHours()===se},Se=(ee,se)=>{const oe=new Date(ee.startTime),ue=new Date(ee.endTime);let ve=oe.getHours();oe<new Date(new Date(se).setHours(0,0,0,0))?ve=S.openingHour:ve=Math.max(ve,S.openingHour);let nt=ue.getHours();const ke=new Date(se);return ke.setHours(23,59,59,999),ue>ke?nt=S.closingHour:(ue.getMinutes()>0&&(nt+=1),nt=Math.min(nt,S.closingHour)),nt-ve},Fe=(ee,se)=>{const oe=new Date(ee);return oe.setHours(se,0,0,0),oe>new Date},jt=async ee=>{if(r)try{await TR(r.id,ee),e({...r,...ee}),s(await Kc())}catch(se){console.error("Failed to update profile",se)}},Rt=ee=>ee.description&&ee.description.trim()!==""?ee.description:Ah[ee.type]||"Gebucht",Un=Array.from({length:S.closingHour-S.openingHour},(ee,se)=>se+S.openingHour),dn=he(f),fn=Array.from({length:7},(ee,se)=>{const oe=new Date(dn);return oe.setDate(oe.getDate()+se),oe});if(w)return m.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:m.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"})});const Pn=r&&(r.role===_e.ADMIN||r.role===_e.MODERATOR);return m.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col font-sans text-slate-800",children:[m.jsx(DR,{}),m.jsx("header",{className:"bg-white shadow-md sticky top-0 z-40",children:m.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-18 flex justify-between items-center py-2",children:[m.jsxs("div",{className:"flex items-center gap-3 cursor-pointer group",onClick:()=>R("calendar"),children:[m.jsx("div",{className:"flex-shrink-0",children:m.jsx(mE,{className:"h-12 w-auto"})}),m.jsxs("div",{className:"flex flex-col justify-center",children:[m.jsxs("h1",{className:"text-lg sm:text-xl font-bold text-slate-800 leading-none tracking-tight",children:[m.jsx("span",{className:"text-red-600 font-extrabold",children:"C"}),"arnuntum",m.jsx("span",{className:"text-red-600 font-extrabold",children:"B"}),"each",m.jsx("span",{className:"text-red-600 font-extrabold",children:"A"}),"rena"]}),m.jsx("span",{className:"text-[10px] sm:text-xs text-slate-500 font-medium tracking-wide uppercase mt-0.5",children:"Platzreservierung"})]})]}),m.jsx("div",{className:"flex items-center gap-4",children:r?m.jsxs("div",{className:"flex items-center gap-3",children:[Pn&&m.jsx("button",{onClick:()=>R(j==="calendar"?"dashboard":"calendar"),className:`px-3 py-1.5 rounded-md text-xs sm:text-sm font-semibold transition-colors ${j==="dashboard"?"bg-blue-100 text-blue-700":"text-gray-600 hover:bg-gray-100 border border-gray-200"}`,children:j==="calendar"?"Dashboard":"Kalender"}),m.jsxs("div",{className:"hidden lg:flex flex-col text-right",children:[m.jsx("span",{className:"text-sm font-bold text-gray-900 leading-tight",children:r.name}),m.jsx("span",{className:"text-[10px] text-gray-500 capitalize",children:r.role===_e.ADMIN?"Vorstand":r.role===_e.MODERATOR?"Moderator":"User"})]}),m.jsx("img",{src:r.avatarUrl,alt:"Avatar",className:"w-9 h-9 rounded-full border-2 border-white shadow-sm"}),m.jsx("button",{onClick:qe,className:"text-xs font-bold text-red-600 hover:text-red-800 px-2 py-1 bg-red-50 rounded transition-colors",children:"Logout"})]}):m.jsx("div",{className:"flex gap-2",children:m.jsxs("button",{onClick:Ne,className:"flex items-center gap-2 bg-white border border-gray-300 hover:bg-gray-50 px-3 py-2 rounded-lg text-xs sm:text-sm font-bold transition-colors shadow-sm",children:[m.jsx("img",{src:"https://www.svgrepo.com/show/475656/google-color.svg",className:"w-4 h-4",alt:"Google"}),m.jsx("span",{children:"Login mit Google"})]})})})]})}),m.jsx("main",{className:"flex-grow max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 w-full",children:j==="dashboard"&&Pn?m.jsx(AR,{currentUser:r,bookings:o,users:i,onUpdateUserRole:G,onDeleteBooking:Y,onOpenBookingModal:ee=>le(ee,f),onEditBooking:be,footerContent:_,onUpdateFooterContent:Be,emailSettings:T,onUpdateEmailSettings:Ke,systemSettings:S,onUpdateSystemSettings:M}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center mb-6 gap-4",children:[m.jsxs("div",{className:"flex items-center gap-6",children:[m.jsxs("div",{className:"flex items-center gap-4 bg-white p-2 rounded-xl shadow-sm border border-gray-100",children:[m.jsx("button",{onClick:()=>ne(-1),className:"p-2 hover:bg-gray-100 rounded-lg text-gray-600 transition-colors",children:m.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),m.jsxs("div",{className:"flex flex-col items-center min-w-[220px]",children:[m.jsx("span",{className:"text-lg font-bold text-gray-800",children:V==="day"?f.toLocaleDateString("de-DE",{weekday:"long"}):`KW ${Math.ceil(((new Date(f).getTime()-new Date(new Date(f).getFullYear(),0,1).getTime())/864e5+1)/7)}`}),m.jsx("span",{className:"text-sm text-gray-500 font-medium",children:V==="day"?f.toLocaleDateString("de-DE",{day:"numeric",month:"long",year:"numeric"}):`${fn[0].toLocaleDateString("de-DE",{day:"numeric",month:"short"})} - ${fn[6].toLocaleDateString("de-DE",{day:"numeric",month:"short",year:"numeric"})}`})]}),m.jsx("button",{onClick:()=>ne(1),className:"p-2 hover:bg-gray-100 rounded-lg text-gray-600 transition-colors",children:m.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),m.jsxs("div",{className:"hidden md:flex flex-col text-xs font-medium text-gray-600 space-y-0.5 text-left",children:[m.jsxs("span",{className:"whitespace-nowrap",children:[m.jsx("strong",{className:"text-gray-800",children:"P1:"}
3280)," ",S.courtNames[1]]}),m.jsxs("span",{className:"whitespace-nowrap",children:[m.jsx("strong",{className:"text-gray-800",children:"P2:"})," ",S.courtNames[2]]})]})]}),m.jsx("div",{className:"flex items-center gap-3",children:m.jsxs("div",{className:"flex bg-gray-200 p-1 rounded-lg",children:[m.jsx("button",{onClick:()=>C("day"),className:`px-5 py-2 rounded-md text-sm font-bold transition-all ${V==="day"?"bg-white text-gray-800 shadow-sm":"text-gray-600 hover:text-gray-800"}`,children:"Tag"}),m.jsx("button",{onClick:()=>C("week"),className:`px-5 py-2 rounded-md text-sm font-bold transition-all ${V==="week"?"bg-white text-gray-800 shadow-sm":"text-gray-600 hover:text-gray-800"}`,children:"Woche"})]})})]}),m.jsxs("div",{className:"flex flex-wrap items-center justify-end mb-4 gap-4 text-xs",children:[m.jsxs("span",{className:"flex items-center gap-1.5 font-bold text-gray-600",children:[m.jsx("span",{className:"w-3 h-3 rounded-full bg-green-100 border border-green-300"}),"Frei bespielbar gemäß Platzregeln"]}),m.jsxs("div",{className:"flex flex-wrap items-center gap-3 border border-gray-200 rounded-lg px-3 py-1.5 bg-white",children:[m.jsx("span",{className:"text-gray-400 font-bold uppercase tracking-wider text-[10px] mr-1",children:"Reserviert für:"}),m.jsxs("span",{className:"flex items-center gap-1.5 font-semibold text-gray-600",children:[m.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-blue-500"})," Spiel"]}),m.jsxs("span",{className:"flex items-center gap-1.5 font-semibold text-gray-600",children:[m.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-sky-500"})," Training"]}),m.jsxs("span",{className:"flex items-center gap-1.5 font-semibold text-gray-600",children:[m.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-purple-500"})," Event"]}),m.jsxs("span",{className:"flex items-center gap-1.5 font-semibold text-gray-600",children:[m.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-red-500"})," Gesperrt"]})]})]}),V==="day"&&m.jsxs("div",{className:"bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden animate-fade-in-up",children:[m.jsxs("div",{className:"grid grid-cols-[80px_1fr_1fr] bg-gray-50 border-b border-gray-200",children:[m.jsx("div",{className:"p-4 border-r border-gray-200 flex items-center justify-center text-gray-400",children:m.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),m.jsx("div",{className:"p-4 text-center border-r border-gray-200 font-bold text-gray-700",children:S.courtNames[1]}),m.jsx("div",{className:"p-4 text-center font-bold text-gray-700",children:S.courtNames[2]})]}),m.jsx("div",{className:"divide-y divide-gray-100",children:Un.map(ee=>{const se=H(ee,1,f),oe=H(ee,2,f),ue=se?Ee(se,ee,f):!1,ve=oe?Ee(oe,ee,f):!1,nt=Fe(f,ee),ke=Fe(f,ee);return m.jsxs("div",{className:"grid grid-cols-[80px_1fr_1fr] group h-16",children:[m.jsxs("div",{className:"p-2 text-right text-sm text-gray-500 font-bold border-r border-gray-100 flex items-center justify-end pr-4",children:[ee,":00"]}),se?ue?m.jsx("div",{className:"relative p-1 border-r border-gray-100 z-10",style:{gridRow:`span ${Se(se,f)}`},children:m.jsxs("div",{className:`h-full w-full rounded-md p-2 text-sm border-l-4 shadow-sm flex flex-col justify-center ${ji[se.type]}`,children:[m.jsx("div",{className:"font-bold truncate",children:se.userName}),m.jsx("div",{className:"text-xs font-medium opacity-75 truncate",children:Rt(se)})]})}):m.jsxs("div",{className:"border-r border-gray-100 relative p-1",children:[m.jsx("div",{className:`h-full w-full rounded-md opacity-50 p-2 text-sm border-l-4 flex items-center justify-center ${ji[se.type]}`,children:m.jsx("span",{className:"text-xs opacity-0",children:"."})}),m.jsx("div",{className:`absolute -top-1 left-1 right-1 h-2 ${ji[se.type]} z-20`})]}):m.jsx("div",{className:`p-1 border-r border-gray-100 transition-colors cursor-pointer relative group/cell ${nt?"bg-green-50 hover:bg-green-100":"hover:bg-gray-50"}`,onClick:()=>le(1,f,ee),children:r&&m.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover/cell:opacity-100 pointer-events-none",children:m.jsx("span",{className:"bg-blue-600 text-white text-xs px-2 py-1 rounded shadow-lg font-bold",children:"+"})})}),oe?ve?m.jsx("div",{className:"relative p-1 z-10",style:{gridRow:`span ${Se(oe,f)}`},children:m.jsxs("div",{className:`h-full w-full rounded-md p-2 text-sm border-l-4 shadow-sm flex flex-col justify-center ${ji[oe.type]}`,children:[m.jsx("div",{className:"font-bold truncate",children:oe.userName}),m.jsx("div",{className:"text-xs font-medium opacity-75 truncate",children:Rt(oe)})]})}):m.jsxs("div",{className:"relative p-1",children:[m.jsx("div",{className:`h-full w-full rounded-md opacity-50 p-2 text-sm border-l-4 flex items-center justify-center ${ji[oe.type]}`,children:m.jsx("span",{className:"text-xs opacity-0",children:"."})}),m.jsx("div",{className:`absolute -top-1 left-1 right-1 h-2 ${ji[oe.type]} z-20`})]}):m.jsx("div",{className:`p-1 transition-colors cursor-pointer relative group/cell ${ke?"bg-green-50 hover:bg-green-100":"hover:bg-gray-50"}`,onClick:()=>le(2,f,ee),children:r&&m.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover/cell:opacity-100 pointer-events-none",children:m.jsx("span",{className:"bg-blue-600 text-white text-xs px-2 py-1 rounded shadow-lg font-bold",children:"+"})})})]},ee)})})]}),V==="week"&&m.jsxs("div",{className:"bg-white rounded-xl shadow-lg border border-gray-200 overflow-hidden animate-fade-in-up overflow-x-auto",children:[m.jsxs("div",{className:"grid grid-cols-[60px_repeat(7,minmax(120px,1fr))] bg-gray-50 border-b border-gray-200",children:[m.jsx("div",{className:"p-2 border-r border-gray-200 flex items-center justify-center text-gray-400",children:m.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider",children:"Zeit"})}),fn.map((ee,se)=>m.jsxs("div",{className:`flex flex-col border-r border-gray-200 ${ee.toDateString()===new Date().toDateString()?"bg-red-50":""}`,children:[m.jsxs("div",{className:"p-1 text-center flex-grow",children:[m.jsx("div",{className:"text-sm font-bold text-gray-700",children:ee.toLocaleDateString("de-DE",{weekday:"short"})}),m.jsx("div",{className:"text-[10px] text-gray-500 font-bold",children:ee.toLocaleDateString("de-DE",{day:"2-digit",month:"2-digit"})})]}),m.jsxs("div",{className:"flex border-t border-gray-200 bg-gray-100/50 text-[10px] font-semibold text-gray-500",children:[m.jsx("div",{className:"w-1/2 text-center py-1 border-r border-gray-200",title:S.courtNames[1],children:"P1"}),m.jsx("div",{className:"w-1/2 text-center py-1",title:S.courtNames[2],children:"P2"})]})]},se))]}),m.jsx("div",{className:"divide-y divide-gray-100",children:Un.map(ee=>m.jsxs("div",{className:"grid grid-cols-[60px_repeat(7,minmax(120px,1fr))] group",children:[m.jsxs("div",{className:"h-12 text-right text-[11px] text-gray-400 font-bold border-r border-gray-100 flex items-center justify-end pr-3",children:[ee,":00"]}),fn.map((se,oe)=>{const ue=H(ee,1,se),ve=H(ee,2,se),nt=ue?Ee(ue,ee,se):!1,ke=ve?Ee(ve,ee,se):!1,wt=se.toDateString()===new Date().toDateString(),Ft=ue&&ve&&ue.userId===ve.userId&&ue.type===ve.type&&ue.startTime===ve.startTime&&ue.endTime===ve.endTime,zi=Fe(se,ee),Si=Fe(se,ee);return m.jsx("div",{className:`border-r border-gray-100 relative h-12 ${wt?"bg-red-50/20":""}`,children:Ft?m.jsx("div",{className:"w-full h-full relative cursor-pointer hover:bg-gray-100 transition-colors group/merged",onClick:()=>be(ue),children:nt&&m.jsxs("div",{className:`absolute inset-0 m-0.5 rounded text-[10px] p-1 shadow-sm overflow-hidden z-10 ${ji[ue.type]} flex flex-col justify-center items-center text-center`,style:{height:`calc(${Se(ue,se)}00% - 4px)`,top:"2px"},children:[m.jsx("div",{className:"font-bold truncate leading-tight",children:ue.userName}),m.jsx("div",{className:"opacity-75 text-[9px] font-medium truncate",children:Rt(ue)})]})}):m.jsxs("div",{className:"flex h-full w-full",children:[m.jsx("div",{className:`w-1/2 h-full border-r border-gray-100 border-dashed relative cursor-pointer transition-colors group/c1 ${!ue&&zi?"bg-green-50 hover:bg-green-100":"hover:bg-gray-100"}`,onClick:()=>
3280ue?be(ue):le(1,se,ee),children:ue?nt?m.jsxs("div",{className:`absolute inset-0 m-0.5 rounded text-[10px] p-0.5 shadow-sm overflow-hidden z-10 ${ji[ue.type]} flex flex-col justify-center items-center text-center`,style:{height:`calc(${Se(ue,se)}00% - 4px)`,top:"2px"},children:[m.jsx("div",{className:"font-bold truncate leading-tight text-[9px] w-full",children:ue.userName.split(" ")[0]}),m.jsx("div",{className:"opacity-75 text-[8px] truncate leading-none mt-0.5 w-full",children:Rt(ue)})]}):null:r&&m.jsx("div",{className:"hidden group-hover/c1:flex h-full w-full items-center justify-center text-gray-300 text-[11px] font-bold",children:"+"})}),m.jsx("div",{className:`w-1/2 h-full relative cursor-pointer transition-colors group/c2 ${!ve&&Si?"bg-green-50 hover:bg-green-100":"hover:bg-gray-100"}`,onClick:()=>ve?be(ve):le(2,se,ee),children:ve?ke?m.jsxs("div",{className:`absolute inset-0 m-0.5 rounded text-[10px] p-0.5 shadow-sm overflow-hidden z-10 ${ji[ve.type]} flex flex-col justify-center items-center text-center`,style:{height:`calc(${Se(ve,se)}00% - 4px)`,top:"2px"},children:[m.jsx("div",{className:"font-bold truncate leading-tight text-[9px] w-full",children:ve.userName.split(" ")[0]}),m.jsx("div",{className:"opacity-75 text-[8px] truncate leading-none mt-0.5 w-full",children:Rt(ve)})]}):null:r&&m.jsx("div",{className:"hidden group-hover/c2:flex h-full w-full items-center justify-center text-gray-300 text-[11px] font-bold",children:"+"})})]})},oe)})]},ee))})]})]})}),r&&m.jsx(xR,{isOpen:Q,onClose:()=>ie(!1),onConfirm:re,onUpdate:fe,user:r,selectedDate:Te,initialCourtId:X,initialStartHour:He,existingBookings:o,bookingToEdit:Ve,systemSettings:S}),m.jsx(wR,{content:_}),r&&!r.profileComplete&&m.jsx(MR,{user:r,onComplete:jt})]})}const vE=document.getElementById("root");if(!vE)throw new Error("Could not find root element to mount to");const qR=a1.createRoot(vE);qR.render(m.jsx(Zx.StrictMode,{children:m.jsx(HR,{})}));

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.