vendor: 4,389 bytes, lines 1-17
1var A3=Object.defineProperty;var k3=(n,e,t)=>e in n?A3(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var ze=(n,e,t)=>k3(n,typeof e!="symbol"?e+"":e,t);(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 l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function t(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(o){if(o.ep)return;o.ep=!0;const l=t(o);fetch(o.href,l)}})();function dD(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var EC={exports:{}},$f={};/** 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 dE;function R3(){if(dE)return $f;dE=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(s,o,l){var u=null;if(l!==void 0&&(u=""+l),o.key!==void 0&&(u=""+o.key),"key"in o){l={};for(var h in o)h!=="key"&&(l[h]=o[h])}else l=o;return o=l.ref,{$$typeof:n,type:s,key:u,ref:o!==void 0?o:null,props:l}}return $f.Fragment=e,$f.jsx=t,$f.jsxs=t,$f}var hE;function I3(){return hE||(hE=1,EC.exports=R3()),EC.exports}var i=I3(),NC={exports:{}},Mt={};/** 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 fE;function O3(){if(fE)return Mt;fE=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),C=Symbol.for("react.view_transition"),N=Symbol.iterator;function T(K){return K===null||typeof K!="object"?null:(K=N&&K[N]||K["@@iterator"],typeof K=="function"?K:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,U={};function M(K,ne,Pe){this.props=K,this.context=ne,this.refs=U,this.updater=Pe||R}M.prototype.isReactComponent={},M.prototype.setState=function(K,ne){if(typeof K!="object"&&typeof K!="function"&&K!=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,K,ne,"setState")},M.prototype.forceUpdate=function(K){this.updater.enqueueForceUpdate(this,K,"forceUpdate")};function V(){}V.prototype=M.prototype;function H(K,ne,Pe){this.props=K,this.context=ne,this.refs=U,this.updater=Pe||R}var Q=H.prototype=new V;Q.constructor=H,A(Q,M.prototype),Q.isPureReactComponent=!0;var Y=Array.isArray;function k(){}var E={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function P(K,ne,Pe){var Le=Pe.ref;return{$$typeof:n,type:K,key:ne,ref:Le!==void 0?Le:null,props:Pe}}function O(K,ne){return P(K.type,ne,K.props)}function F(K){return typeof K=="object"&&K!==null&&K.$$typeof===n}function S(K){var ne={"=":"=0",":":"=2"};return"$"+K.replace(/[=:]/g,function(Pe){return ne[Pe]})}var be=/\/+/g;function Ee(K,ne){return typeof K=="object"&&K!==null&&K.key!=null?S(""+K.key):ne.toString(36)}function me(K){switch(K.status){case"fulfilled":return K.value;case"rejected":throw K.reason;default:switch(typeof K.status=="string"?K.then(k,k):(K.status="pending",K.then(function(ne){K.status==="pending"&&(K.status="fulfilled",K.value=ne)},function(ne){K.status==="pending"&&(K.status="rejected",K.reason=ne)})),K.status){case"fulfilled":return K.value;case"rejected":throw K.reason}}throw K}function De(K,ne,Pe,Le,mt){var tt=typeof K;(tt==="undefined"||tt==="boolean")&&(K=null);var lt=!1;
vendor: 4,402 bytes, line 17
17if(K===null)lt=!0;else switch(tt){case"bigint":case"string":case"number":lt=!0;break;case"object":switch(K.$$typeof){case n:case e:lt=!0;break;case x:return lt=K._init,De(lt(K._payload),ne,Pe,Le,mt)}}if(lt)return mt=mt(K),lt=Le===""?"."+Ee(K,0):Le,Y(mt)?(Pe="",lt!=null&&(Pe=lt.replace(be,"$&/")+"/"),De(mt,ne,Pe,"",function(Yn){return Yn})):mt!=null&&(F(mt)&&(mt=O(mt,Pe+(mt.key==null||K&&K.key===mt.key?"":(""+mt.key).replace(be,"$&/")+"/")+lt)),ne.push(mt)),1;lt=0;var Qe=Le===""?".":Le+":";if(Y(K))for(var st=0;st<K.length;st++)Le=K[st],tt=Qe+Ee(Le,st),lt+=De(Le,ne,Pe,tt,mt);else if(st=T(K),typeof st=="function")for(K=st.call(K),st=0;!(Le=K.next()).done;)Le=Le.value,tt=Qe+Ee(Le,st++),lt+=De(Le,ne,Pe,tt,mt);else if(tt==="object"){if(typeof K.then=="function")return De(me(K),ne,Pe,Le,mt);throw ne=String(K),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(K).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return lt}function ge(K,ne,Pe){if(K==null)return K;var Le=[],mt=0;return De(K,Le,"","",function(tt){return ne.call(Pe,tt,mt++)}),Le}function Ue(K){if(K._status===-1){var ne=K._result,Pe=ne();Pe.then(function(Le){(K._status===0||K._status===-1)&&(K._status=1,K._result=Le,Pe.status===void 0&&(Pe.status="fulfilled",Pe.value=Le))},function(Le){(K._status===0||K._status===-1)&&(K._status=2,K._result=Le,Pe.status===void 0&&(Pe.status="rejected",Pe.reason=Le))}),K._status===-1&&(K._status=0,K._result=Pe)}if(K._status===1)return K._result.default;throw K._result}var we=typeof reportError=="function"?reportError:function(K){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof K=="object"&&K!==null&&typeof K.message=="string"?String(K.message):String(K),error:K});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",K);return}console.error(K)};function $e(K){var ne=E.T,Pe={};Pe.types=ne!==null?ne.types:null,E.T=Pe;try{var Le=K(),mt=E.S;mt!==null&&mt(Pe,Le),typeof Le=="object"&&Le!==null&&typeof Le.then=="function"&&Le.then(k,we)}catch(tt){we(tt)}finally{ne!==null&&Pe.types!==null&&(ne.types=Pe.types),E.T=ne}}function et(K){var ne=E.T;if(ne!==null){var Pe=ne.types;Pe===null?ne.types=[K]:Pe.indexOf(K)===-1&&Pe.push(K)}else $e(et.bind(null,K))}var Ae={map:ge,forEach:function(K,ne,Pe){ge(K,function(){ne.apply(this,arguments)},Pe)},count:function(K){var ne=0;return ge(K,function(){ne++}),ne},toArray:function(K){return ge(K,function(ne){return ne})||[]},only:function(K){if(!F(K))throw Error("React.Children.only expected to receive a single React element child.");return K}};return Mt.Activity=b,Mt.Children=Ae,Mt.Component=M,Mt.Fragment=t,Mt.Profiler=o,Mt.PureComponent=H,Mt.StrictMode=s,Mt.Suspense=f,Mt.ViewTransition=C,Mt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,Mt.__COMPILER_RUNTIME={__proto__:null,c:function(K){return E.H.useMemoCache(K)}},Mt.addTransitionType=et,Mt.cache=function(K){return function(){return K.apply(null,arguments)}},Mt.cacheSignal=function(){return null},Mt.cloneElement=function(K,ne,Pe){if(K==null)throw Error("The argument must be a React element, but you passed "+K+".");var Le=A({},K.props),mt=K.key;if(ne!=null)for(tt in ne.key!==void 0&&(mt=""+ne.key),ne)!j.call(ne,tt)||tt==="key"||tt==="__self"||tt==="__source"||tt==="ref"&&ne.ref===void 0||(Le[tt]=ne[tt]);var tt=arguments.length-2;if(tt===1)Le.children=Pe;else if(1<tt){for(var lt=Array(tt),Qe=0;Qe<tt;Qe++)lt[Qe]=arguments[Qe+2];Le.children=lt}return P(K.type,mt,Le)},Mt.createContext=function(K){return K={$$typeof:u,_currentValue:K,_currentValue2:K,_threadCount:0,Provider:null,Consumer:null},K.Provider=K,K.Consumer={$$typeof:l,_context:K},K},Mt.createElement=function(K,ne,Pe){var Le,mt={},tt=null;if(ne!=null)for(Le in ne.key!==void 0&&(tt=""+ne.key),ne)j.call(ne,Le)&&Le!=="key"&&Le!=="__self"&&Le!=="__source"&&(mt[Le]=ne[Le]);var lt=arguments.length-2;if(lt===1)mt.children=Pe;else if(1<lt){for(var Qe=Array(lt),st=0;st<lt;st++)Qe[st]=arguments[st+2];mt.children=Qe}if(K&&K.defaultProps)for(Le in lt=K.defaultProps,lt)mt[Le]===void 0&&(mt[Le]=lt[Le]);return P(K,tt,mt)},Mt.createRef=function(){return{current:null}},Mt.forwardRef=function(K){return{$$typeof:h,render:K}}
vendor: 5,608 bytes, lines 17-25
17,Mt.isValidElement=F,Mt.lazy=function(K){return{$$typeof:x,_payload:{_status:-1,_result:K},_init:Ue}},Mt.memo=function(K,ne){return{$$typeof:p,type:K,compare:ne===void 0?null:ne}},Mt.startTransition=$e,Mt.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()},Mt.use=function(K){return E.H.use(K)},Mt.useActionState=function(K,ne,Pe){return E.H.useActionState(K,ne,Pe)},Mt.useCallback=function(K,ne){return E.H.useCallback(K,ne)},Mt.useContext=function(K){return E.H.useContext(K)},Mt.useDebugValue=function(){},Mt.useDeferredValue=function(K,ne){return E.H.useDeferredValue(K,ne)},Mt.useEffect=function(K,ne){return E.H.useEffect(K,ne)},Mt.useEffectEvent=function(K){return E.H.useEffectEvent(K)},Mt.useId=function(){return E.H.useId()},Mt.useImperativeHandle=function(K,ne,Pe){return E.H.useImperativeHandle(K,ne,Pe)},Mt.useInsertionEffect=function(K,ne){return E.H.useInsertionEffect(K,ne)},Mt.useLayoutEffect=function(K,ne){return E.H.useLayoutEffect(K,ne)},Mt.useMemo=function(K,ne){return E.H.useMemo(K,ne)},Mt.useOptimistic=function(K,ne){return E.H.useOptimistic(K,ne)},Mt.useReducer=function(K,ne,Pe){return E.H.useReducer(K,ne,Pe)},Mt.useRef=function(K){return E.H.useRef(K)},Mt.useState=function(K){return E.H.useState(K)},Mt.useSyncExternalStore=function(K,ne,Pe){return E.H.useSyncExternalStore(K,ne,Pe)},Mt.useTransition=function(){return E.H.useTransition()},Mt.version="19.3.0",Mt}var mE;function B1(){return mE||(mE=1,NC.exports=O3()),NC.exports}var y=B1();const As=dD(y);var DC={exports:{}},Jf={},TC={exports:{}},SC={};/** 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 pE;function L3(){return pE||(pE=1,(function(n){function e(me,De){var ge=me.length;me.push(De);e:for(;0<ge;){var Ue=ge-1>>>1,we=me[Ue];if(0<o(we,De))me[Ue]=De,me[ge]=we,ge=Ue;else break e}}function t(me){return me.length===0?null:me[0]}function s(me){if(me.length===0)return null;var De=me[0],ge=me.pop();if(ge!==De){me[0]=ge;e:for(var Ue=0,we=me.length,$e=we>>>1;Ue<$e;){var et=2*(Ue+1)-1,Ae=me[et],K=et+1,ne=me[K];if(0>o(Ae,ge))K<we&&0>o(ne,Ae)?(me[Ue]=ne,me[K]=ge,Ue=K):(me[Ue]=Ae,me[et]=ge,Ue=et);else if(K<we&&0>o(ne,ge))me[Ue]=ne,me[K]=ge,Ue=K;else break e}}return De}function o(me,De){var ge=me.sortIndex-De.sortIndex;return ge!==0?ge:me.id-De.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;n.unstable_now=function(){return l.now()}}else{var u=Date,h=u.now();n.unstable_now=function(){return u.now()-h}}var f=[],p=[],x=1,b=null,C=3,N=!1,T=!1,R=!1,A=!1,U=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,V=typeof setImmediate<"u"?setImmediate:null;function H(me){for(var De=t(p);De!==null;){if(De.callback===null)s(p);else if(De.startTime<=me)s(p),De.sortIndex=De.expirationTime,e(f,De);else break;De=t(p)}}function Q(me){if(R=!1,H(me),!T)if(t(f)!==null)T=!0,Y||(Y=!0,F());else{var De=t(p);De!==null&&Ee(Q,De.startTime-me)}}var Y=!1,k=-1,E=5,j=-1;function P(){return A?!0:!(n.unstable_now()-j<E)}function O(){if(A=!1,Y){var me=n.unstable_now();j=me;var De=!0;try{e:{T=!1,R&&(R=!1,M(k),k=-1),N=!0;var ge=C;try{t:{for(H(me),b=t(f);b!==null&&!(b.expirationTime>me&&P());){var Ue=b.callback;if(typeof Ue=="function"){b.callback=null,C=b.priorityLevel;var we=Ue(b.expirationTime<=me);if(me=n.unstable_now(),typeof we=="function"){b.callback=we,H(me),De=!0;break t}b===t(f)&&s(f),H(me)}else s(f);b=t(f)}if(b!==null)De=!0;else{var $e=t(p);$e!==null&&Ee(Q,$e.startTime-me),De=!1}}break e}finally{b=null,C=ge,N=!1}De=void 0}}finally{De?F():Y=!1}}}var F;if(typeof V=="function")F=function(){V(O)};else if(typeof MessageChannel<"u"){var S=new MessageChannel,be=S.port2;S.port1.onmessage=O,F=function(){be.postMessage(null)}}else F=function(){U(O,0)};function Ee(me,De){k=U(function(){me(n.unstable_now())},De)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(me){me.callback=null},n.unstable_forceFrameRate=function(me){0>me||125<me?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<me?Math.floor(1e3/me):5},n.unstable_getCurrentPriorityLevel=function(){return C},n.unstable_next=function(me){switch(C){case 1:case 2:case 3:var De=3;break;default:De=C}var ge=C;C=De;try{return me()}finally{C=ge}},n.unstable_requestPaint=function(){A=!0},n.unstable_runWithPriority=function(me,De){switch(me){case 1:case 2:case 3:case 4:case 5:break;default:me=3}var ge=C;C=me;try{return De()}finally{C=ge}},n.unstable_scheduleCallback=function(me,De,ge){var Ue=n.unstable_now();switch(typeof ge=="object"&&ge!==null?(ge=ge.delay,ge=typeof ge=="number"&&0<ge?Ue+ge:Ue):ge=Ue,me){case 1:var we=-1;break;case 2:we=250;break;case 5:we=1073741823;break;case 4:we=1e4;break;default:we=5e3}return we=ge+we,me={id:x++,callback:De,priorityLevel:me,startTime:ge,expirationTime:we,sortIndex:-1},ge>Ue?(me.sortIndex=ge,e(p,me),t(f)===null&&me===t(p)&&(R?(M(k),k=-1):R=!0,Ee(Q,ge-Ue))):(me.sortIndex=we,e(f,me),T||N||(T=!0,Y||(Y=!0,F()))),me},n.unstable_shouldYield=P,n.unstable_wrapCallback=function(me){var De=C;return function(){var ge=C;C=De;try{return me.apply(this,arguments)}finally{C=ge}}}})(SC)),SC}var BE;function M3(){return BE||(BE=1,TC.exports=L3()),TC.exports}var jC={exports:{}},Ir={};
vendor: 24,602 bytes, lines 25-48
25/** 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 gE;function P3(){if(gE)return Ir;gE=1;var n=B1();function e(x){var b="https://react.dev/errors/"+x;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)b+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+x+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var s={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},o=Symbol.for("react.portal"),l=Symbol.for("react.recoverable"),u=Symbol.for("react.optimistic_key");function h(x,b,C){var N=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:N==null?null:N===u?u:""+N,children:x,containerInfo:b,implementation:C}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(x,b){if(x==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return Ir.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Ir.browser=function(x){return{$$typeof:l,_reason:x}},Ir.createPortal=function(x,b){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(e(299));return h(x,b,null,C)},Ir.flushSync=function(x){var b=f.T,C=s.p;try{if(f.T=null,s.p=2,x)return x()}finally{f.T=b,s.p=C,s.d.f()}},Ir.preconnect=function(x,b){typeof x=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,s.d.C(x,b))},Ir.prefetchDNS=function(x){typeof x=="string"&&s.d.D(x)},Ir.preinit=function(x,b){if(typeof x=="string"&&b&&typeof b.as=="string"){var C=b.as,N=p(C,b.crossOrigin),T=typeof b.integrity=="string"?b.integrity:void 0,R=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;C==="style"?s.d.S(x,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:N,integrity:T,fetchPriority:R}):C==="script"&&s.d.X(x,{crossOrigin:N,integrity:T,fetchPriority:R,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},Ir.preinitModule=function(x,b){if(typeof x=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var C=p(b.as,b.crossOrigin);s.d.M(x,{crossOrigin:C,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}}else b==null&&s.d.M(x)},Ir.preload=function(x,b){if(typeof x=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var C=b.as,N=p(C,b.crossOrigin);s.d.L(x,C,{crossOrigin:N,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},Ir.preloadModule=function(x,b){if(typeof x=="string")if(b){var C=p(b.as,b.crossOrigin);s.d.m(x,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:C,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0})}else s.d.m(x)},Ir.requestFormReset=function(x){s.d.r(x)},Ir.unstable_batchedUpdates=function(x,b){return x(b)},Ir.useFormState=function(x,b,C){return f.H.useFormState(x,b,C)},Ir.useFormStatus=function(){return f.H.useHostTransitionStatus()},Ir.version="19.3.0",Ir}var xE;function hD(){if(xE)return jC.exports;xE=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),jC.exports=P3(),jC.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 bE;function z3(){if(bE)return Jf;bE=1;var n=M3(),e=B1(),t=hD();function s(r){var a="https://react.dev/errors/"+r;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)a+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+r+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function l(r){for(var a=r,c=a;c&&!c.alternate;)a=c,(a.flags&4098)!==0&&(r=a.return),c=a.return;for(;a.return;)a=a.return;return a.tag===3?r:null}function u(r){if(r.tag===13){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function h(r){if(r.tag===31){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function f(r){if(l(r)!==r)throw Error(s(188))}function p(r){var a=r.alternate;if(!a){if(a=l(r),a===null)throw Error(s(188));return a!==r?null:r}for(var c=r,d=a;;){var m=c.return;if(m===null)break;var g=m.alternate;if(g===null){if(d=m.return,d!==null){c=d;continue}break}if(m.child===g.child){for(g=m.child;g;){if(g===c)return f(m),r;if(g===d)return f(m),a;g=g.sibling}throw Error(s(188))}if(c.return!==d.return)c=m,d=g;else{for(var w=!1,I=m.child;I;){if(I===c){w=!0,c=m,d=g;break}if(I===d){w=!0,d=m,c=g;break}I=I.sibling}if(!w){for(I=g.child;I;){if(I===c){w=!0,c=g,d=m;break}if(I===d){w=!0,d=g,c=m;break}I=I.sibling}if(!w)throw Error(s(189))}}if(c.alternate!==d)throw Error(s(190))}if(c.tag!==3)throw Error(s(188));return c.stateNode.current===c?r:a}function x(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r;for(r=r.child;r!==null;){if(a=x(r),a!==null)return a;r=r.sibling}return null}function b(r,a,c,d,m,g){for(;r!==null;){if((r.tag===5||r.tag===27||r.tag===6)&&c(r,d,m,g)||(r.tag!==22||r.memoizedState===null)&&(a||r.tag!==5&&r.tag!==27)&&b(r.child,a,c,d,m,g))return!0;r=r.sibling}return!1}function C(r){for(r=r.return;r!==null;){if(r.tag===3||r.tag===5||r.tag===27)return r;r=r.return}return null}function N(r){var a=!1;for(r=r.return;r!==null&&(r.tag===4&&(a=!0),!(r.tag===3||r.tag===5||r.tag===27));)r=r.return;return a}function T(r){var a=[null,null],c=C(r);return c===null||R(a,r,c.child,{foundSelf:!1}),a}function R(r,a,c,d){for(;c!==null;){if(c===a)d.foundSelf=!0;else if(c.tag===5||c.tag===27||c.tag===6){if(d.foundSelf)return r[1]=c,!0;r[0]=c}else if((c.tag!==22||c.memoizedState===null)&&R(r,a,c.child,d))return!0;c=c.sibling}return!1}function A(r){switch(r.tag){case 5:case 27:case 6:return r.stateNode;case 3:return r.stateNode.containerInfo;default:throw Error(s(559))}}var U=null,M=null;function V(r,a,c){return r===c?!0:r===a?(U=r,!0):!1}function H(r,a,c){return r===c?(M=r,!1):r===a?(M!==null&&(U=r),!0):!1}function Q(r){if(r===null)return null;do r=r===null?null:r.return;while(r&&r.tag!==5&&r.tag!==27&&r.tag!==3);return r||null}function Y(r,a,c){for(var d=0,m=r;m;m=c(m))d++;m=0;for(var g=a;g;g=c(g))m++;for(;0<d-m;)r=c(r),d--;for(;0<m-d;)a=c(a),m--;for(;d--;){if(r===a||a!==null&&r===a.alternate)return r;r=c(r),a=c(a)}return null}var k=Object.assign,E=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),be=Symbol.for("react.consumer"),Ee=Symbol.for("react.context"),me=Symbol.for("react.forward_ref"),De=Symbol.for("react.suspense"),ge=Symbol.for("react.suspense_list"),Ue=Symbol.for("react.memo"),we=Symbol.for("react.lazy"),$e=Symbol.for("react.activity"),et=Symbol.for("react.legacy_hidden"),Ae=Symbol.for("react.memo_cache_sentinel"),K=Symbol.for("react.view_transition"),ne=Symbol.for("react.recoverable"),Pe=Symbol.iterator;function Le(r){return r===null||typeof r!="object"?null:(r=Pe&&r[Pe]||r["@@iterator"],typeof r=="function"?r:null)}var mt=Symbol.for("react.client.reference");function tt(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===mt?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case O:return"Fragment";case S:return"Profiler";case F:return"StrictMode";case De:return"Suspense";case ge:return"SuspenseList";case $e:return"Activity";case K:return"ViewTransition"}if(typeof r=="object")switch(r.$$typeof){case P:return"Portal";case Ee:return r.displayName||"Context";case be:return(r._context.displayName||"Context")+".Consumer";case me:var a=r.render;return r=r.displayName,r||(r=a.displayName||a.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case Ue:return a=r.displayName||null,a!==null?a:tt(r.type)||"Memo";case we:a=r._payload,r=r._init;try{return tt(r(a))}catch{}}return null}var lt=Array.isArray,Qe=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,st=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Yn={pending:!1,data:null,method:null,action:null},Rn=[],zn=-1;function Zt(r){return{current:r}}function en(r){0>zn||(r.current=Rn[zn],Rn[zn]=null,zn--)}function jt(r,a){zn++,Rn[zn]=r.current,r.current=a}var At=Zt(null),Tt=Zt(null),gn=Zt(null),Oe=Zt(null);function vt(r,a){switch(jt(gn,a),jt(Tt,r),jt(At,null),a.nodeType){case 9:case 11:r=(r=a.documentElement)&&(r=r.namespaceURI)?C2(r):0;break;default:if(r=a.tagName,a=a.namespaceURI)a=C2(a),r=y2(a,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}en(At),jt(At,r)}function Ft(){en(At),en(Tt),en(gn)}function on(r){var a=r.memoizedState;a!==null&&(Md._currentValue=a.memoizedState,jt(Oe,r)),a=At.current;var c=y2(a,r.type);a!==c&&(jt(Tt,r),jt(At,c))}function Zn(r){Tt.current===r&&(en(At),en(Tt)),Oe.current===r&&(en(Oe),Md._currentValue=Yn)}var Fn,In;function nn(r){if(Fn===void 0)try{throw Error()}catch(c){var a=c.stack.trim().match(/\n( *(at )?)/);Fn=a&&a[1]||"",In=-1<c.stack.indexOf(` 42 at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return` 43`+Fn+r+In}var Ve=!1;function Rt(r,a){if(!r||Ve)return"";Ve=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(a){var Re=function(){throw Error()};if(Object.defineProperty(Re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Re,[])}catch(Ze){var ie=Ze}Reflect.construct(r,[],Re)}else{try{Re.call()}catch(Ze){ie=Ze}Re=!1;try{var pe=Object.getOwnPropertyDescriptor(r.prototype,"props");Object.defineProperty(r.prototype,"props",{configurable:!0,set:function(){throw Error()}}),Re=!0,new r}finally{Re&&(pe!==void 0?Object.defineProperty(r.prototype,"props",pe):delete r.prototype.props)}}}else{try{throw Error()}catch(Ze){ie=Ze}(Re=r())&&typeof Re.catch=="function"&&Re.catch(function(){})}}catch(Ze){if(Ze&&ie&&typeof Ze.stack=="string")return[Ze.stack,ie.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=d.DetermineComponentFrameRoot(),w=g[0],I=g[1];if(w&&I){var q=w.split(` 44`),le=I.split(` 45`);for(m=d=0;d<q.length&&!q[d].includes("DetermineComponentFrameRoot");)d++;for(;m<le.length&&!le[m].includes("DetermineComponentFrameRoot");)m++;if(d===q.length||m===le.length)for(d=q.length-1,m=le.length-1;1<=d&&0<=m&&q[d]!==le[m];)m--;for(;1<=d&&0<=m;d--,m--)if(q[d]!==le[m]){if(d!==1||m!==1)do if(d--,m--,0>m||q[d]!==le[m]){var xe=` 46`+q[d].replace(" at new "," at ");return r.displayName&&xe.includes("<anonymous>")&&(xe=xe.replace("<anonymous>",r.displayName)),xe}while(1<=d&&0<=m);break}}}finally{Ve=!1,Error.prepareStackTrace=c}return(c=r?r.displayName||r.name:"")?nn(c):""}function os(r,a){switch(r.tag){case 26:case 27:case 5:return nn(r.type);case 16:return nn("Lazy");case 13:return r.child!==a&&a!==null?nn("Suspense Fallback"):nn("Suspense");case 19:return nn("SuspenseList");case 0:case 15:return Rt(r.type,!1);case 11:return Rt(r.type.render,!1);case 1:return Rt(r.type,!0);case 31:return nn("Activity");case 30:return nn("ViewTransition");default:return""}}function Hn(r){try{var a="",c=null;do a+=os(r,c),c=r,r=r.return;while(r);return a}catch(d){return` 47Error generating stack: `+d.message+` 48`+d.stack}}var _t=Object.prototype.hasOwnProperty,Sn=n.unstable_scheduleCallback,Qt=n.unstable_cancelCallback,Vt=n.unstable_shouldYield,at=n.unstable_requestPaint,Et=n.unstable_now,hs=n.unstable_getCurrentPriorityLevel,xn=n.unstable_ImmediatePriority,wt=n.unstable_UserBlockingPriority,rn=n.unstable_NormalPriority,jn=n.unstable_LowPriority,On=n.unstable_IdlePriority,es=n.log,ls=n.unstable_setDisableYieldValue,Vn=null,de=null;function sn(r){if(typeof es=="function"&&ls(r),de&&typeof de.setStrictMode=="function")try{de.setStrictMode(Vn,r)}catch{}}var Ut=Math.clz32?Math.clz32:Us,xs=Math.log,He=Math.LN2;function Us(r){return r>>>=0,r===0?32:31-(xs(r)/He|0)|0}var Ot=256,Un=262144,ln=4194304;function An(r){var a=r&42;if(a!==0)return a;switch(r&-r){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 r&-r;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Nr(r,a,c){var d=r.pendingLanes;if(d===0)return 0;var m=0,g=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var I=d&134217727;return I!==0?(d=I&~g,d!==0?m=An(d):(w&=I,w!==0?m=An(w):c||(c=I&~r,c!==0&&(m=An(c))))):(I=d&~g,I!==0?m=An(I):w!==0?m=An(w):c||(c=d&~r,c!==0&&(m=An(c)))),m===0?0:a!==0&&a!==m&&(a&g)===0&&(g=m&-m,c=a&-a,g>=c||g===32&&(c&4194048)!==0)?a:m}function ee(r,a){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&a)===0}function ve(r,a){(a&8)!==0&&(a|=a&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=a;0<c;){var d=31-Ut(c),m=1<<d;a|=r[d],c&=~m}return a}function Gt(r,a){switch(r){case 1:case 2:case 4:case 8:case 64:return a+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 a+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 hn(){var r=ln;return ln<<=1,(ln&62914560)===0&&(ln=4194304),r}function Js(r){for(var a=[],c=0;31>c;c++)a.push(r);return a}function Is(r,a){r.pendingLanes|=a,a!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function fs(r,a,c,d,m,g){var w=r.pendingLanes;r.pendingLanes=c,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=c,r.entangledLanes&=c,r.errorRecoveryDisabledLanes&=c,r.shellSuspendCounter=0;var I=r.entanglements,q=r.expirationTimes,le=r.hiddenUpdates;for(c=w&~c;0<c;){var xe=31-Ut(c),Re=1<<xe;I[xe]=0,q[xe]=-1;var ie=le[xe];if(ie!==null)for(le[xe]=null,xe=0;xe<ie.length;xe++){var pe=ie[xe];pe!==null&&(pe.lane&=-536870913)}c&=~Re}d!==0&&Pr(r,d,0),g!==0&&m===0&&r.tag!==0&&(r.suspendedLanes|=g&~(w&~a))}function Pr(r,a,c){r.pendingLanes|=a,r.suspendedLanes&=~a;var d=31-Ut(a);r.entangledLanes|=a,r.entanglements[d]=r.entanglements[d]|1073741824|c&261930}function ra(r,a){var c=r.entangledLanes|=a;for(r=r.entanglements;c;){var d=31-Ut(c),m=1<<d;m&a|r[d]&a&&(r[d]|=a),c&=~m}}function Dr(r,a){var c=a&-a;return c=(c&42)!==0?1:Ks(c),(c&(r.suspendedLanes|a))!==0?0:c}function Ks(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Yr(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function ia(){var r=st.p;return r!==0?r:(r=window.event,r===void 0?32:rE(r.type))}function Oi(r,a){var c=st.p;try{return st.p=r,a()}finally{st.p=c}}var cr=Math.random().toString(36).slice(2),Xn="__reactFiber$"+cr,_s="__reactProps$"+cr,Br="__reactContainer$"+cr,Os="__reactEvents$"+cr,Ha="__reactListeners$"+cr,ws="__reactHandles$"+cr,ce="__reactResources$"+cr,Ce="__reactMarker$"+cr,ye="__reactLoad$"+cr;function dt(r){delete r[Xn],delete r[_s],delete r[Ha],delete r[ws]}function ut(r){var a;if(a=r[Xn])return a;for(var c=r.parentNode;c;){if(a=c[Br]||c[Xn]){if(c=a.alternate,a.child!==null||c!==null&&c.child!==null)for(r=P2(r);r!==null;){if(c=r[Xn])return c;r=P2(r)}return a}r=c,c=r.parentNode}return null}function Yt(r){if(r=r[Xn]||r[Br]){var a=r.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return r}return null}function Jt(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r.stateNode;throw Error(s(33))}function bs(r){var a=r[ce];return a||(a=r[ce]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function ts(r){r[Ce]=!0}function aa(r){r[ye]=void 0}var Ls=new Set,cs={};function qa(r,a){Sa(r,a),Sa(r+"Capture",a)}function Sa(r,a){for(cs[r]=a,r=0;r<a.length;r++)Ls.add(a[r])}var wp=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]*$"),Yu={},Po={};function $a(r){return _t.call(Po,r)?!0:_t.call(Yu,r)?!1:wp.test(r)?Po[r]=!0:(Yu[r]=!0,!1)}var Lt=!1;function Dl(){var r=Lt;return Lt=!1,r}function ja(r,a,c){if($a(a))if(c===null)r.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":r.removeAttribute(a);return;case"boolean":var d=a.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(a);return}}r.setAttribute(a,c)}}function qn(r,a,c){if(c===null)r.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttribute(a,c)}}function ur(r,a,c,d){if(d===null)r.removeAttribute(c);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(c);return}r.setAttributeNS(a,c,d)}}function ns(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Uc(r){var a=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Xu(r,a,c){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,a);if(!r.hasOwnProperty(a)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var m=d.get,g=d.set;return Object.defineProperty(r,a,{configurable:!0,get:function(){return m.call(this)},set:function(w){c=""+w,g.call(this,w)}}),Object.defineProperty(r,a,{enumerable:d.enumerable}),{getValue:function(){return c},setValue:function(w){c=""+w},stopTracking:function(){r._valueTracker=null,delete r[a]}}}}function Xr(r){if(!r._valueTracker){var a=Uc(r)?"checked":"value";r._valueTracker=Xu(r,a,""+r[a])}}function oa(r){if(!r)return!1;var a=r._valueTracker;if(!a)return!0;var c=a.getValue(),d="";return r&&(d=Uc(r)?r.checked?"true":"false":r.value),r=d,r!==c?(a.setValue(r),!0):!1}var Ep=/[\n"\\]/g;function Es(r){return r.replace(Ep,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function la(r,a,c,d,m,g,w,I){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),a!=null?w==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+ns(a)):r.value!==""+ns(a)&&(r.value=""+ns(a)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),a!=null?w==="number"&&r.value==a?Li(r,ns(r.value)):Li(r,ns(a)):c!=null?Li(r,ns(c)):d!=null&&r.removeAttribute("value"),m==null&&g!=null&&(r.defaultChecked=!!g),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?r.name=""+ns(I):r.removeAttribute("name")}function Gc(r,a,c,d,m,g,w,I){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(r.type=g),a!=null||c!=null){if(!(g!=="submit"&&g!=="reset"||a!=null)){Xr(r);return}c=c!=null?""+ns(c):"",a=a!=null?""+ns(a):c,I||a===r.value||(r.value=a),r.defaultValue=a}d=d??m,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=I?r.checked:!!d,r.defaultChecked=!!d,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),Xr(r)}function Li(r,a){r.defaultValue!==""+a&&(r.defaultValue=""+a)}function pi(r,a,c,d){if(r=r.options,a){a={};for(var m=0;m<c.length;m++)a["$"+c[m]]=!0;for(c=0;c<r.length;c++)m=a.hasOwnProperty("$"+r[c].value),r[c].selected!==m&&(r[c].selected=m),m&&d&&(r[c].defaultSelected=!0)}else{for(c=""+ns(c),a=null,m=0;m<r.length;m++){if(r[m].value===c){r[m].selected=!0,d&&(r[m].defaultSelected=!0);return}a!==null||r[m].disabled||(a=r[m])}a!==null&&(a.selected=!0)}}function Tl(r,a,c){if(a!=null&&(a=""+ns(a),a!==r.value&&(r.value=a),c==null)){r.defaultValue!==a&&(r.defaultValue=a);return}r.defaultValue=c!=null?""+ns(c):""}function Sl(r,a,c,d){if(a==null){if(d!=null){if(c!=null)throw Error(s(92));if(lt(d)){if(1<d.length)throw Error(s(93));d=d[0]}c=d}c==null&&(c=""),a=c}c=ns(a),r.defaultValue=c,d=r.textContent,d===c&&d!==""&&d!==null&&(r.value=d),Xr(r)}function _n(r,a){if(a){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=a;return}}r.textContent=a}var zo=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 Wu(r,a,c){var d=a.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?d?r.setProperty(a,""):a==="float"?r.cssFloat="":r[a]="":d?r.setProperty(a,c):typeof c!="number"||c===0||zo.has(a)?a==="float"?r.cssFloat=c:r[a]=(""+c).trim():r[a]=c+"px"}function Ja(r,a,c){if(a!=null&&typeof a!="object")throw Error(s(62));if(r=r.style,c!=null){for(var d in c)!c.hasOwnProperty(d)||a!=null&&a.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="",Lt=!0);for(var m in a)d=a[m],a.hasOwnProperty(m)&&c[m]!==d&&(Wu(r,m,d),Lt=!0)}else for(var g in a)a.hasOwnProperty(g)&&Wu(r,g,a[g])}function Fo(r){if(r.indexOf("-")===-1)return!1;switch(r){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 Hc=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"],["maskType","mask-type"],["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"]]),Ka=/^[\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 fn(r){return Ka.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function zr(){}var qc=null;function Mi(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var ca=null,Pi=null;function jl(r){var a=Yt(r);if(a&&(r=a.stateNode)){var c=r[_s]||null;e:switch(r=a.stateNode,a.type){case"input":if(la(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),a=c.name,c.type==="radio"&&a!=null){for(c=r;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Es(""+a)+'"][type="radio"]'),a=0;a<c.length;a++){var d=c[a];if(d!==r&&d.form===r.form){var m=d[_s]||null;if(!m)throw Error(s(90));la(d,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(a=0;a<c.length;a++)d=c[a],d.form===r.form&&oa(d)}break e;case"textarea":Tl(r,c.value,c.defaultValue);break e;case"select":a=c.value,a!=null&&pi(r,!!c.multiple,a,!1)}}}var $c=!1;function Ns(r,a,c){if($c)return r(a,c);$c=!0;try{var d=r(a);return d}finally{if($c=!1,(ca!==null||Pi!==null)&&(T0(),ca&&(a=ca,r=Pi,Pi=ca=null,jl(a),r)))for(a=0;a<r.length;a++)jl(r[a])}}function zi(r,a){var c=r.stateNode;if(c===null)return null;var d=c[_s]||null;if(d===null)return null;c=d[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(c&&typeof c!="function")throw Error(s(231,a,typeof c));return c}var Wr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qa=!1;if(Wr)try{var Ya={};Object.defineProperty(Ya,"passive",{get:function(){Qa=!0}}),window.addEventListener("test",Ya,Ya),window.removeEventListener("test",Ya,Ya)}catch{Qa=!1}var ua=null,Vo=null,Ht=null;function Xa(){if(Ht)return Ht;var r,a=Vo,c=a.length,d,m="value"in ua?ua.value:ua.textContent,g=m.length;for(r=0;r<c&&a[r]===m[r];r++);var w=c-r;for(d=1;d<=w&&a[c-d]===m[g-d];d++);return Ht=m.slice(r,1<d?1-d:void 0)}function da(r){var a=r.keyCode;
vendor: 1,049 bytes, line 48
48return"charCode"in r?(r=r.charCode,r===0&&a===13&&(r=13)):r=a,r===10&&(r=13),32<=r||r===13?r:0}function Wa(){return!0}function Zr(){return!1}function ms(r){function a(c,d,m,g,w){this._reactName=c,this._targetInst=m,this.type=d,this.nativeEvent=g,this.target=w,this.currentTarget=null;for(var I in r)r.hasOwnProperty(I)&&(c=r[I],this[I]=c?c(g):g[I]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Wa:Zr,this.isPropagationStopped=Zr,this}return k(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Wa)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Wa)},persist:function(){},isPersistent:Wa}),a}var Bi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0}
vendor: 5,317 bytes, line 48
48,Uo=ms(Bi),Za=k({},Bi,{view:0,detail:0}),Al=ms(Za),eo,Qs,to,Go=k({},Za,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ei,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==to&&(to&&r.type==="mousemove"?(eo=r.screenX-to.screenX,Qs=r.screenY-to.screenY):Qs=eo=0,to=r),eo)},movementY:function(r){return"movementY"in r?r.movementY:Qs}}),Aa=ms(Go),B=k({},Go,{dataTransfer:0}),v=ms(B),D=k({},Za,{relatedTarget:0}),z=ms(D),he=k({},Bi,{animationName:0,elapsedTime:0,pseudoElement:0}),_e=ms(he),Ye=k({},Bi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),qt=ms(Ye),Ds=k({},Bi,{data:0}),bn=ms(Ds),Cs={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Tr={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"},ha={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fr(r){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(r):(r=ha[r])?!!a[r]:!1}function ei(){return Fr}var Ho=k({},Za,{key:function(r){if(r.key){var a=Cs[r.key]||r.key;if(a!=="Unidentified")return a}return r.type==="keypress"?(r=da(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Tr[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ei,charCode:function(r){return r.type==="keypress"?da(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?da(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),no=ms(Ho),$h=k({},Go,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Np=ms($h),Dp=k({},Bi,{submitter:0}),Jh=ms(Dp),Kh=k({},Za,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ei}),Zu=ms(Kh),Qh=k({},Bi,{propertyName:0,elapsedTime:0,pseudoElement:0}),ed=ms(Qh),Tp=k({},Go,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Sp=ms(Tp),Yv=k({},Bi,{newState:0,oldState:0,source:0}),xx=ms(Yv),jp=[9,13,27,32],Yh=Wr&&"CompositionEvent"in window,td=null;Wr&&"documentMode"in document&&(td=document.documentMode);var bx=Wr&&"TextEvent"in window&&!td,nd=Wr&&(!Yh||td&&8<td&&11>=td),Cx=" ",Xh=!1;function Wh(r,a){switch(r){case"keyup":return jp.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ap(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var gr=!1;function yx(r,a){switch(r){case"compositionend":return Ap(a);case"keypress":return a.which!==32?null:(Xh=!0,Cx);case"textInput":return r=a.data,r===Cx&&Xh?null:r;default:return null}}function Zh(r,a){if(gr)return r==="compositionend"||!Yh&&Wh(r,a)?(r=Xa(),Ht=Vo=ua=null,gr=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return nd&&a.locale!=="ko"?null:a.data;default:return null}}var sd={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 Vr(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a==="input"?!!sd[r.type]:a==="textarea"}function vx(r,a,c,d){ca?Pi?Pi.push(d):Pi=[d]:ca=d,a=I0(a,"onChange"),0<a.length&&(c=new Uo("onChange","change",null,c,d),r.push({event:c,listeners:a}))}var rd=null,Jc=null;function Kc(r){m2(r,0)}function id(r){var a=Jt(r);if(oa(a))return r}function kp(r,a){if(r==="change")return a}var Rp=!1;if(Wr){var ef;if(Wr){var tf="oninput"in document;if(!tf){var Ip=document.createElement("div");Ip.setAttribute("oninput","return;"),tf=typeof Ip.oninput=="function"}ef=tf}else ef=!1;Rp=ef&&(!document.documentMode||9<document.documentMode)}function Gs(){rd&&(rd.detachEvent("onpropertychange",Op),Jc=rd=null)}function Op(r){if(r.propertyName==="value"&&id(Jc)){var a=[];vx(a,Jc,r,Mi(r)),Ns(Kc,a)}}function _x(r,a,c){r==="focusin"?(Gs(),rd=a,Jc=c,rd.attachEvent("onpropertychange",Op)):r==="focusout"&&Gs()}function wx(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return id(Jc)}function Ex(r,a){if(r==="click")return id(a)}function Lp(r,a){if(r==="input"||r==="change")return id(a)}function ad(r,a){return r===a&&(r!==0||1/r===1/a)||r!==r&&a!==a}var ti=typeof Object.is=="function"?Object.is:ad;
vendor: 89,393 bytes, line 48
48function Qc(r,a){if(ti(r,a))return!0;if(typeof r!="object"||r===null||typeof a!="object"||a===null)return!1;var c=Object.keys(r),d=Object.keys(a);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++){var m=c[d];if(!_t.call(a,m)||!ti(r[m],a[m]))return!1}return!0}function nf(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function sf(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Mp(r,a){var c=sf(r);r=0;for(var d;c;){if(c.nodeType===3){if(d=r+c.textContent.length,r<=a&&d>=a)return{node:c,offset:a-r};r=d}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=sf(c)}}function rf(r,a){return r&&a?r===a?!0:r&&r.nodeType===3?!1:a&&a.nodeType===3?rf(r,a.parentNode):"contains"in r?r.contains(a):r.compareDocumentPosition?!!(r.compareDocumentPosition(a)&16):!1:!1}function af(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var a=nf(r.document);a instanceof r.HTMLIFrameElement;){try{var c=typeof a.contentWindow.location.href=="string"}catch{c=!1}if(c)r=a.contentWindow;else break;a=nf(r.document)}return a}function Yc(r){var a=r&&r.nodeName&&r.nodeName.toLowerCase();return a&&(a==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||a==="textarea"||r.contentEditable==="true")}var kl=Wr&&"documentMode"in document&&11>=document.documentMode,Fi=null,od=null,so=null,Rl=!1;function Xc(r,a,c){var d=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Rl||Fi==null||Fi!==nf(d)||(d=Fi,"selectionStart"in d&&Yc(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),so&&Qc(so,d)||(so=d,d=I0(od,"onSelect"),0<d.length&&(a=new Uo("onSelect","select",null,a,c),r.push({event:a,listeners:d}),a.target=Fi)))}function Hs(r,a){var c={};return c[r.toLowerCase()]=a.toLowerCase(),c["Webkit"+r]="webkit"+a,c["Moz"+r]="moz"+a,c}var ro={animationend:Hs("Animation","AnimationEnd"),animationiteration:Hs("Animation","AnimationIteration"),animationstart:Hs("Animation","AnimationStart"),transitionrun:Hs("Transition","TransitionRun"),transitionstart:Hs("Transition","TransitionStart"),transitioncancel:Hs("Transition","TransitionCancel"),transitionend:Hs("Transition","TransitionEnd")},of={},Il={};Wr&&(Il=document.createElement("div").style,"AnimationEvent"in window||(delete ro.animationend.animation,delete ro.animationiteration.animation,delete ro.animationstart.animation),"TransitionEvent"in window||delete ro.transitionend.transition);function io(r){if(of[r])return of[r];if(!ro[r])return r;var a=ro[r],c;for(c in a)if(a.hasOwnProperty(c)&&c in Il)return of[r]=a[c];return r}var lf=io("animationend"),Pp=io("animationiteration"),zp=io("animationstart"),Nx=io("transitionrun"),Dx=io("transitionstart"),Tx=io("transitioncancel"),cf=io("transitionend"),uf=new Map,ld="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");ld.push("scrollEnd");function gi(r,a){uf.set(r,a),qa(a,[r])}var Fp=0;function fa(r,a){if(r.name!=null&&r.name!=="auto")return r.name;if(a.autoName!==null)return a.autoName;r=La.identifierPrefix;var c=Fp++;return r="_"+r+"t_"+c.toString(32)+"_",a.autoName=r}function _(r){if(r==null||typeof r=="string")return r;var a=null,c=Dd;if(c!==null)for(var d=0;d<c.length;d++){var m=r[c[d]];if(m!=null){if(m==="none")return"none";a=a==null?m:a+(" "+m)}}return a??r.default}function L(r,a){return r=_(r),a=_(a),a==null?r==="auto"?null:r:a==="auto"?null:a}var G=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},ae=[],Be=0,We=0;function X(){for(var r=Be,a=We=Be=0;a<r;){var c=ae[a];ae[a++]=null;var d=ae[a];ae[a++]=null;var m=ae[a];ae[a++]=null;var g=ae[a];if(ae[a++]=null,d!==null&&m!==null){var w=d.pending;w===null?m.next=m:(m.next=w.next,w.next=m),d.pending=m}g!==0&&qe(c,m,g)}}function Te(r,a,c,d){ae[Be++]=r,ae[Be++]=a,ae[Be++]=c,ae[Be++]=d,We|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function te(r,a,c,d){return Te(r,a,c,d),Nt(r)}function fe(r,a){return Te(r,null,null,a),Nt(r)}function qe(r,a,c){r.lanes|=c;var d=r.alternate;d!==null&&(d.lanes|=c);for(var m=!1,g=r.return;g!==null;)g.childLanes|=c,d=g.alternate,d!==null&&(d.childLanes|=c),g.tag===22&&(r=g.stateNode,r===null||r._visibility&1||(m=!0)),r=g,g=g.return;return r.tag===3?(g=r.stateNode,m&&a!==null&&(m=31-Ut(c),r=g.hiddenUpdates,d=r[m],d===null?r[m]=[a]:d.push(a),a.lane=c|536870912),g):null}function Nt(r){if(50<If)throw If=0,D0=null,Error(s(185));for(var a=r.return;a!==null;)r=a,a=r.return;return r.tag===3?r.stateNode:null}var nt={};function yt(r,a,c,d){this.tag=r,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ot(r,a,c,d){return new yt(r,a,c,d)}function Ln(r){return r=r.prototype,!(!r||!r.isReactComponent)}function dr(r,a){var c=r.alternate;return c===null?(c=ot(r.tag,a,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=a,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&1206910976,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,a=r.dependencies,c.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.refCleanup=r.refCleanup,c}function Vp(r,a){r.flags&=1206910978;var c=r.alternate;return c===null?(r.childLanes=0,r.lanes=a,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type,a=c.dependencies,r.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),r}function cd(r,a,c,d,m,g){var w=0;if(d=r,typeof d=="function")Ln(d)&&(w=1);else if(typeof d=="string")w=x3(r,c,At.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(d){case $e:return r=ot(31,c,a,m),r.elementType=$e,r.lanes=g,r;case O:return qo(c.children,m,g,a);case F:w=8,m|=24;break;case S:return r=ot(12,c,a,m|2),r.elementType=S,r.lanes=g,r;case De:return r=ot(13,c,a,m),r.elementType=De,r.lanes=g,r;case ge:return r=ot(19,c,a,m),r.elementType=ge,r.lanes=g,r;case et:case K:return r=m|32,r=ot(30,c,a,r),r.elementType=K,r.lanes=g,r.stateNode={autoName:null,paired:null,clones:null,ref:null},r;default:if(typeof d=="object"&&d!==null)switch(d.$$typeof){case Ee:w=10;break e;case be:w=9;break e;case me:w=11;break e;case Ue:w=14;break e;case we:w=16,d=null;break e}w=29,c=Error(s(130,r===null?"null":typeof r,"")),d=null}return a=ot(w,c,a,m),a.elementType=r,a.type=d,a.lanes=g,a}function qo(r,a,c,d){return r=ot(7,r,d,a),r.lanes=c,r}function Wc(r,a,c){return r=ot(6,r,null,a),r.lanes=c,r}function ud(r){var a=ot(18,null,null,0);return a.stateNode=r,a}function df(r,a,c){return a=ot(4,r.children!==null?r.children:[],r.key,a),a.lanes=c,a.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},a}var $o=new WeakMap;function xi(r,a){if(typeof r=="object"&&r!==null){var c=$o.get(r);return c!==void 0?c:(a={value:r,source:a,stack:Hn(a)},$o.set(r,a),a)}return{value:r,source:a,stack:Hn(a)}}var Ol=[],ma=0,Zc=null,Jo=0,bi=[],ni=0,ka=null,Vi=1,Ui="";function pa(r,a){Ol[ma++]=Jo,Ol[ma++]=Zc,Zc=r,Jo=a}function hf(r,a,c){bi[ni++]=Vi,bi[ni++]=Ui,bi[ni++]=ka,ka=r;var d=Vi;r=Ui;var m=32-Ut(d)-1;d&=~(1<<m),c+=1;var g=32-Ut(a)+m;if(30<g){var w=m-m%5;g=(d&(1<<w)-1).toString(32),d>>=w,m-=w,Vi=1<<32-Ut(a)+m|c<<m|d,Ui=g+r}else Vi=1<<g|c<<m|d,Ui=r}function eu(r){r.return!==null&&(pa(r,1),hf(r,1,0))}function dd(r){for(;r===Zc;)Zc=Ol[--ma],Ol[ma]=null,Jo=Ol[--ma],Ol[ma]=null;for(;r===ka;)ka=bi[--ni],bi[ni]=null,Ui=bi[--ni],bi[ni]=null,Vi=bi[--ni],bi[ni]=null}function ff(r,a){bi[ni++]=Vi,bi[ni++]=Ui,bi[ni++]=ka,Vi=a.id,Ui=a.overflow,ka=r}var wn=null,Cn=null,tn=!1,ao=null,Ba=!1,Sx=Error(s(519));function Ll(r){var a=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw mf(xi(a,r)),Sx}function Xv(r){var a=r.stateNode,c=r.type,d=r.memoizedProps;switch(a[Xn]=r,a[_s]=d,c){case"dialog":un("cancel",a),un("close",a);break;case"iframe":case"object":case"embed":un("load",a);break;case"video":case"audio":for(c=0;c<Lf.length;c++)un(Lf[c],a);break;case"source":un("error",a);break;case"img":case"image":case"link":un("error",a),un("load",a);break;case"details":un("toggle",a);break;case"input":un("invalid",a),Gc(a,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":un("invalid",a);break;case"textarea":un("invalid",a),Sl(a,d.value,d.defaultValue,d.children)}c=d.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||a.textContent===""+c||d.suppressHydrationWarning===!0||x2(a.textContent,c)?(d.popover!=null&&(un("beforetoggle",a),un("toggle",a)),d.onScroll!=null&&un("scroll",a),d.onScrollEnd!=null&&un("scrollend",a),d.onClick!=null&&(a.onclick=zr),a=!0):a=!1,a||Ll(r,!0)}function Up(r){for(wn=r.return;wn;)switch(wn.tag){case 5:case 31:case 13:Ba=!1;return;case 27:case 3:Ba=!0;return;default:wn=wn.return}}function hd(r){if(r!==wn)return!1;if(!tn)return Up(r),tn=!0,!1;var a=r.tag,c;if((c=a!==3&&a!==27)&&((c=a===5)&&(c=r.type,c=!(c!=="form"&&c!=="button")||iC(r.type,r.memoizedProps)),c=!c),c&&Cn&&Ll(r),Up(r),a===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Cn=M2(r)}else if(a===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));Cn=M2(r)}else a===27?(a=Cn,Wl(r.type)?(r=mC,mC=null,Cn=r):Cn=a):Cn=wn?xa(r.stateNode.nextSibling):null;return!0}function tu(){Cn=wn=null,tn=!1}function jx(){var r=ao;return r!==null&&(vi===null?vi=r:vi.push.apply(vi,r),ao=null),r}function mf(r){ao===null?ao=[r]:ao.push(r)}var Ax=Zt(null),nu=null,Ko=null;function Ml(r,a,c){jt(Ax,a._currentValue),a._currentValue=c}function Qo(r){r._currentValue=Ax.current,en(Ax)}function Gp(r,a,c){for(;r!==null;){var d=r.alternate;if((r.childLanes&a)!==a?(r.childLanes|=a,d!==null&&(d.childLanes|=a)):d!==null&&(d.childLanes&a)!==a&&(d.childLanes|=a),r===c)break;r=r.return}}function kx(r,a,c,d){var m=r.child;for(m!==null&&(m.return=r);m!==null;){var g=m.dependencies;if(g!==null){var w=m.child;g=g.firstContext;e:for(;g!==null;){var I=g;g=m;for(var q=0;q<a.length;q++)if(I.context===a[q]){g.lanes|=c,I=g.alternate,I!==null&&(I.lanes|=c),Gp(g.return,c,r),d||(w=null);break e}g=I.next}}else if(m.tag===18){if(w=m.return,w===null)throw Error(s(341));w.lanes|=c,g=w.alternate,g!==null&&(g.lanes|=c),Gp(w,c,r),w=null}else m.tag===13&&m.memoizedState!==null&&m.memoizedState.dehydrated===null?(m.lanes|=c,w=m.alternate,w!==null&&(w.lanes|=c),Gp(m.return,c,r),w=m.child,w=w!==null?w.sibling:null):w=m.child;if(w!==null)w.return=m;else for(w=m;w!==null;){if(w===r){w=null;break}if(m=w.sibling,m!==null){m.return=w.return,w=m;break}w=w.return}m=w}}function su(r,a,c,d){r=null;for(var m=a,g=!1;m!==null;){if(!g){if((m.flags&524288)!==0)g=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var w=m.alternate;if(w===null)throw Error(s(387));if(w=w.memoizedProps,w!==null){var I=m.type;ti(m.pendingProps.value,w.value)||(r!==null?r.push(I):r=[I])}}else if(m===Oe.current){if(w=m.alternate,w===null)throw Error(s(387));w.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(r!==null?r.push(Md):r=[Md])}m=m.return}return r!==null&&kx(a,r,c,d),a.flags|=262144,r!==null}function Hp(r){for(r=r.firstContext;r!==null;){if(!ti(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function ru(r){nu=r,Ko=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Sr(r){return Wv(nu,r)}function qp(r,a){return nu===null&&ru(r),Wv(r,a)}function Wv(r,a){var c=a._currentValue;if(a={context:a,memoizedValue:c,next:null},Ko===null){if(r===null)throw Error(s(308));Ko=a,r.dependencies={lanes:0,firstContext:a},r.flags|=524288}else Ko=Ko.next=a;return c}var qA=typeof AbortController<"u"?AbortController:function(){var r=[],a=this.signal={aborted:!1,addEventListener:function(c,d){r.push(d)}};this.abort=function(){a.aborted=!0,r.forEach(function(c){return c()})}},$A=n.unstable_scheduleCallback,JA=n.unstable_NormalPriority,Ys={$$typeof:Ee,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rx(){return{controller:new qA,data:new Map,refCount:0}}function pf(r){r.refCount--,r.refCount===0&&$A(JA,function(){r.controller.abort()})}function Zv(r,a){if((r.pendingLanes&4194048)!==0){var c=r.transitionTypes;for(c===null&&(c=r.transitionTypes=[]),r=0;r<a.length;r++){var d=a[r];c.indexOf(d)===-1&&c.push(d)}}}var Bf=null;function KA(r){var a=r.transitionTypes;return r.transitionTypes=null,a}var gf=null,Ix=0,iu=0,fd=null;function QA(r,a){if(gf===null){var c=gf=[];Ix=0,iu=Yb(),fd={status:"pending",value:void 0,then:function(d){c.push(d)}}}return Ix++,a.then(e_,e_),a}function e_(){if(--Ix===0&&(Bf=null,gf!==null)){fd!==null&&(fd.status="fulfilled");var r=gf;gf=null,iu=0,fd=null;for(var a=0;a<r.length;a++)(0,r[a])()}}function YA(r,a){var c=[],d={status:"pending",value:null,reason:null,then:function(m){c.push(m)}};return r.then(function(){d.status="fulfilled",d.value=a;for(var m=0;m<c.length;m++)(0,c[m])(a)},function(m){for(d.status="rejected",d.reason=m,m=0;m<c.length;m++)(0,c[m])(void 0)}),d}var t_=Qe.S;Qe.S=function(r,a){if(Jw=Et(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&QA(r,a),Bf!==null)for(var c=Ad;c!==null;)Zv(c,Bf),c=c.next;if(c=r.types,c!==null){for(var d=Ad;d!==null;)Zv(d,c),d=d.next;if(iu!==0){d=Bf,d===null&&(d=Bf=[]);for(var m=0;m<c.length;m++){var g=c[m];d.indexOf(g)===-1&&d.push(g)}}}t_!==null&&t_(r,a)};var au=Zt(null);function Ox(){var r=au.current;return r!==null?r:ss.pooledCache}function $p(r,a){a===null?jt(au,au.current):jt(au,a.pool)}function n_(){var r=Ox();return r===null?null:{parent:Ys._currentValue,pool:r}}var md=Error(s(460)),Lx=Error(s(474)),Jp=Error(s(542)),Kp={then:function(){}};function s_(r){return r=r.status,r==="fulfilled"||r==="rejected"}function r_(r,a,c){switch(c=r[c],c===void 0?r.push(a):c!==a&&(a.then(zr,zr),a=c),a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,a_(r),r===void 0&&!("reason"in a)?Error(s(600)):r;default:if(typeof a.status=="string")a.then(zr,zr);else{if(r=ss,r!==null&&100<r.shellSuspendCounter)throw Error(s(482));r=a,r.status="pending",r.then(function(d){if(a.status==="pending"){var m=a;m.status="fulfilled",m.value=d}},function(d){if(a.status==="pending"){var m=a;m.status="rejected",m.reason=d}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw r=a.reason,a_(r),r}throw lu=a,md}}function ou(r){try{var a=r._init;return a(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(lu=c,md):c}}var lu=null;function i_(){if(lu===null)throw Error(s(459));var r=lu;return lu=null,r}function a_(r){if(r===md||r===Jp)throw Error(s(483))}var pd=null,xf=0;function Qp(r){var a=xf;return xf+=1,pd===null&&(pd=[]),r_(pd,r,a)}function Pl(r,a){a=a.props.ref,r.ref=a!==void 0?a:null}function Yp(r,a){throw a.$$typeof===E?Error(s(525)):(r=Object.prototype.toString.call(a),Error(s(31,r==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":r)))}function o_(r){function a(oe,Z){if(r){var ue=oe.deletions;ue===null?(oe.deletions=[Z],oe.flags|=16):ue.push(Z)}}function c(oe,Z){if(!r)return null;for(;Z!==null;)a(oe,Z),Z=Z.sibling;return null}function d(oe){for(var Z=new Map;oe!==null;)oe.key===null?Z.set(oe.index,oe):Z.set(oe.key,oe),oe=oe.sibling;return Z}function m(oe,Z){return oe=dr(oe,Z),oe.index=0,oe.sibling=null,oe}function g(oe,Z,ue){return oe.index=ue,r?(ue=oe.alternate,ue!==null?(ue=ue.index,ue<Z?(oe.flags|=2,Z):ue):(oe.flags|=134217730,Z)):(oe.flags|=1048576,Z)}function w(oe){return r&&oe.alternate===null&&(oe.flags|=134217730),oe}function I(oe,Z,ue,ke){return Z===null||Z.tag!==6?(Z=Wc(ue,oe.mode,ke),Z.return=oe,Z):(Z=m(Z,ue),Z.return=oe,Z)}function q(oe,Z,ue,ke){var ct=ue.type;return ct===O?(oe=xe(oe,Z,ue.props.children,ke,ue.key),Pl(oe,ue),oe):Z!==null&&(Z.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===we&&ou(ct)===Z.type)?(Z=m(Z,ue.props),Pl(Z,ue),Z.return=oe,Z):(Z=cd(ue.type,ue.key,ue.props,null,oe.mode,ke),Pl(Z,ue),Z.return=oe,Z)}function le(oe,Z,ue,ke){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ue.containerInfo||Z.stateNode.implementation!==ue.implementation?(Z=df(ue,oe.mode,ke),Z.return=oe,Z):(Z=m(Z,ue.children||[]),Z.return=oe,Z)}function xe(oe,Z,ue,ke,ct){return Z===null||Z.tag!==7?(Z=qo(ue,oe.mode,ke,ct),Z.return=oe,Z):(Z=m(Z,ue),Z.return=oe,Z)}function Re(oe,Z,ue){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Wc(""+Z,oe.mode,ue),Z.return=oe,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case j:return ue=cd(Z.type,Z.key,Z.props,null,oe.mode,ue),Pl(ue,Z),ue.return=oe,ue;case P:return Z=df(Z,oe.mode,ue),Z.return=oe,Z;case we:return Z=ou(Z),Re(oe,Z,ue)}if(lt(Z)||Le(Z))return Z=qo(Z,oe.mode,ue,null),Z.return=oe,Z;if(typeof Z.then=="function")return Re(oe,Qp(Z),ue);if(Z.$$typeof===Ee)return Re(oe,qp(oe,Z),ue);Yp(oe,Z)}return null}function ie(oe,Z,ue,ke){var ct=Z!==null?Z.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return ct!==null?null:I(oe,Z,""+ue,ke);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case j:return ue.key===ct?q(oe,Z,ue,ke):null;case P:return ue.key===ct?le(oe,Z,ue,ke):null;case we:return ue=ou(ue),ie(oe,Z,ue,ke)}if(lt(ue)||Le(ue))return ct!==null?null:xe(oe,Z,ue,ke,null);if(typeof ue.then=="function")return ie(oe,Z,Qp(ue),ke);if(ue.$$typeof===Ee)return ie(oe,Z,qp(oe,ue),ke);Yp(oe,ue)}return null}function pe(oe,Z,ue,ke,ct){if(typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint")return oe=oe.get(ue)||null,I(Z,oe,""+ke,ct);if(typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case j:return oe=oe.get(ke.key===null?ue:ke.key)||null,q(Z,oe,ke,ct);case P:return oe=oe.get(ke.key===null?ue:ke.key)||null,le(Z,oe,ke,ct);case we:return ke=ou(ke),pe(oe,Z,ue,ke,ct)}if(lt(ke)||Le(ke))return oe=oe.get(ue)||null,xe(Z,oe,ke,ct,null);if(typeof ke.then=="function")return pe(oe,Z,ue,Qp(ke),ct);if(ke.$$typeof===Ee)return pe(oe,Z,ue,qp(Z,ke),ct);Yp(Z,ke)}return null}function Ze(oe,Z,ue,ke){for(var ct=null,pn=null,xt=Z,St=Z=0,Zs=null;xt!==null&&St<ue.length;St++){xt.index>St?(Zs=xt,xt=null):Zs=xt.sibling;var En=ie(oe,xt,ue[St],ke);if(En===null){xt===null&&(xt=Zs);break}r&&xt&&En.alternate===null&&a(oe,xt),Z=g(En,Z,St),pn===null?ct=En:pn.sibling=En,pn=En,xt=Zs}if(St===ue.length)return c(oe,xt),tn&&pa(oe,St),ct;if(xt===null){for(;St<ue.length;St++)xt=Re(oe,ue[St],ke),xt!==null&&(Z=g(xt,Z,St),pn===null?ct=xt:pn.sibling=xt,pn=xt);return tn&&pa(oe,St),ct}for(xt=d(xt);St<ue.length;St++)Zs=pe(xt,oe,St,ue[St],ke),Zs!==null&&(r&&(En=Zs.alternate,En!==null&&xt.delete(En.key===null?St:En.key)),Z=g(Zs,Z,St),pn===null?ct=Zs:pn.sibling=Zs,pn=Zs);return r&&xt.forEach(function(sc){return a(oe,sc)}),tn&&pa(oe,St),ct}function ht(oe,Z,ue,ke){if(ue==null)throw Error(s(151));for(var ct=null,pn=null,xt=Z,St=Z=0,Zs=null,En=ue.next();xt!==null&&!En.done;St++,En=ue.next()){xt.index>St?(Zs=xt,xt=null):Zs=xt.sibling;var sc=ie(oe,xt,En.value,ke);if(sc===null){xt===null&&(xt=Zs);break}r&&xt&&sc.alternate===null&&a(oe,xt),Z=g(sc,Z,St),pn===null?ct=sc:pn.sibling=sc,pn=sc,xt=Zs}if(En.done)return c(oe,xt),tn&&pa(oe,St),ct;if(xt===null){for(;!En.done;St++,En=ue.next())En=Re(oe,En.value,ke),En!==null&&(Z=g(En,Z,St),pn===null?ct=En:pn.sibling=En,pn=En);return tn&&pa(oe,St),ct}for(xt=d(xt);!En.done;St++,En=ue.next())En=pe(xt,oe,St,En.value,ke),En!==null&&(r&&(Zs=En.alternate,Zs!==null&&xt.delete(Zs.key===null?St:Zs.key)),Z=g(En,Z,St),pn===null?ct=En:pn.sibling=En,pn=En);return r&&xt.forEach(function(j3){return a(oe,j3)}),tn&&pa(oe,St),ct}function Wt(oe,Z,ue,ke){if(typeof ue=="object"&&ue!==null&&ue.type===O&&ue.key===null&&ue.props.ref===void 0&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case j:e:{for(var ct=ue.key;Z!==null;){if(Z.key===ct){if(ct=ue.type,ct===O){if(Z.tag===7){c(oe,Z.sibling),ke=m(Z,ue.props.children),Pl(ke,ue),ke.return=oe,oe=ke;break e}}else if(Z.elementType===ct||typeof ct=="object"&&ct!==null&&ct.$$typeof===we&&ou(ct)===Z.type){c(oe,Z.sibling),ke=m(Z,ue.props),Pl(ke,ue),ke.return=oe,oe=ke;break e}c(oe,Z);break}else a(oe,Z);Z=Z.sibling}ue.type===O?(ke=qo(ue.props.children,oe.mode,ke,ue.key),Pl(ke,ue),ke.return=oe,oe=ke):(ke=cd(ue.type,ue.key,ue.props,null,oe.mode,ke),Pl(ke,ue),ke.return=oe,oe=ke)}return w(oe);case P:e:{for(ct=ue.key;Z!==null;){if(Z.key===ct)if(Z.tag===4&&Z.stateNode.containerInfo===ue.containerInfo&&Z.stateNode.implementation===ue.implementation){c(oe,Z.sibling),ke=m(Z,ue.children||[]),ke.return=oe,oe=ke;break e}else{c(oe,Z);break}else a(oe,Z);Z=Z.sibling}ke=df(ue,oe.mode,ke),ke.return=oe,oe=ke}return w(oe);case we:return ue=ou(ue),Wt(oe,Z,ue,ke)}if(lt(ue))return Ze(oe,Z,ue,ke);if(Le(ue)){if(ct=Le(ue),typeof ct!="function")throw Error(s(150));return ue=ct.call(ue),ht(oe,Z,ue,ke)}if(typeof ue.then=="function")return Wt(oe,Z,Qp(ue),ke);if(ue.$$typeof===Ee)return Wt(oe,Z,qp(oe,ue),ke);Yp(oe,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,Z!==null&&Z.tag===6?(c(oe,Z.sibling),ke=m(Z,ue),ke.return=oe,oe=ke):(c(oe,Z),ke=Wc(ue,oe.mode,ke),ke.return=oe,oe=ke),w(oe)):c(oe,Z)}return function(oe,Z,ue,ke){try{xf=0;var ct=Wt(oe,Z,ue,ke);return pd=null,ct}catch(xt){if(xt===md||xt===Jp)throw xt;var pn=ot(29,xt,null,oe.mode);return pn.lanes=ke,pn.return=oe,pn}finally{}}}var cu=o_(!0),l_=o_(!1),zl=!1;function Mx(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Px(r,a){r=r.updateQueue,a.updateQueue===r&&(a.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Fl(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Vl(r,a,c){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(Mn&2)!==0){var m=d.pending;return m===null?a.next=a:(a.next=m.next,m.next=a),d.pending=a,a=Nt(r),qe(r,null,c),a}return Te(r,d,a,c),Nt(r)}function bf(r,a,c){if(a=a.updateQueue,a!==null&&(a=a.shared,(c&4194048)!==0)){var d=a.lanes;d&=r.pendingLanes,c|=d,a.lanes=c,ra(r,c)}}function zx(r,a){var c=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,c===d)){var m=null,g=null;if(c=c.firstBaseUpdate,c!==null){do{var w={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};g===null?m=g=w:g=g.next=w,c=c.next}while(c!==null);g===null?m=g=a:g=g.next=a}else m=g=a;c={baseState:d.baseState,firstBaseUpdate:m,lastBaseUpdate:g,shared:d.shared,callbacks:d.callbacks},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=a:r.next=a,c.lastBaseUpdate=a}var Fx=!1;function Cf(){if(Fx){var r=fd;if(r!==null)throw r}}function yf(r,a,c,d){Fx=!1;var m=r.updateQueue;zl=!1;var g=m.firstBaseUpdate,w=m.lastBaseUpdate,I=m.shared.pending;if(I!==null){m.shared.pending=null;var q=I,le=q.next;q.next=null,w===null?g=le:w.next=le,w=q;var xe=r.alternate;xe!==null&&(xe=xe.updateQueue,I=xe.lastBaseUpdate,I!==w&&(I===null?xe.firstBaseUpdate=le:I.next=le,xe.lastBaseUpdate=q))}if(g!==null){var Re=m.baseState;w=0,xe=le=q=null,I=g;do{var ie=I.lane&-536870913,pe=ie!==I.lane;if(pe?(mn&ie)===ie:(d&ie)===ie){ie!==0&&ie===iu&&(Fx=!0),xe!==null&&(xe=xe.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var Ze=r,ht=I;ie=a;var Wt=c;switch(ht.tag){case 1:if(Ze=ht.payload,typeof Ze=="function"){Re=Ze.call(Wt,Re,ie);break e}Re=Ze;break e;case 3:Ze.flags=Ze.flags&-65537|128;case 0:if(Ze=ht.payload,ie=typeof Ze=="function"?Ze.call(Wt,Re,ie):Ze,ie==null)break e;Re=k({},Re,ie);break e;case 2:zl=!0}}ie=I.callback,ie!==null&&(r.flags|=64,pe&&(r.flags|=8192),pe=m.callbacks,pe===null?m.callbacks=[ie]:pe.push(ie))}else pe={lane:ie,tag:I.tag,payload:I.payload,callback:I.callback,next:null},xe===null?(le=xe=pe,q=Re):xe=xe.next=pe,w|=ie;if(I=I.next,I===null){if(I=m.shared.pending,I===null)break;pe=I,I=pe.next,pe.next=null,m.lastBaseUpdate=pe,m.shared.pending=null}}while(!0);xe===null&&(q=Re),m.baseState=q,m.firstBaseUpdate=le,m.lastBaseUpdate=xe,g===null&&(m.shared.lanes=0),Kl|=w,r.lanes=w,r.memoizedState=Re}}function c_(r,a){if(typeof r!="function")throw Error(s(191,r));r.call(a)}function u_(r,a){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)c_(c[r],a)}var Ul=Zt(null),Xp=Zt(0);function d_(r,a){r=el,jt(Xp,r),jt(Ul,a),el=r|a.baseLanes}function Vx(){jt(Xp,el),jt(Ul,Ul.current)}function Ux(){el=Xp.current,en(Ul),en(Xp)}var jr=Zt(null),Ur=null;function Gl(r){var a=r.alternate;jt(Ar,Ar.current&1),jt(jr,r),Ur===null&&(a===null||Ul.current!==null||a.memoizedState!==null)&&(Ur=r)}function Gx(r){jt(Ar,Ar.current),jt(jr,r),Ur===null&&(Ur=r)}function h_(r){r.tag===22?(jt(Ar,Ar.current),jt(jr,r),Ur===null&&(Ur=r)):Hl()}function Hl(){jt(Ar,Ar.current),jt(jr,jr.current)}function Gi(r){en(jr),Ur===r&&(Ur=null),en(Ar)}var Ar=Zt(0);function vf(r,a){jt(jr,jr.current),jt(Ar,a)}function Hx(r){en(Ar),en(jr),Ur===r&&(Ur=null)}function Wp(r){for(var a=r;a!==null;){if(a.tag===13){var c=a.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||hC(c)||fC(c)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!=="independent"){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Yo=0,Xt=null,Wn=null,Xs=null,Zp=!1,Bd=!1,uu=!1,e0=0,_f=0,gd=null,XA=0;function Ms(){throw Error(s(321))}function qx(r,a){if(a===null)return!1;for(var c=0;c<a.length&&c<r.length;c++)if(!ti(r[c],a[c]))return!1;return!0}function $x(r,a,c,d,m,g){return Yo=g,Xt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,Qe.H=r===null||r.memoizedState===null?Q_:Y_,uu=!1,g=c(d,m),uu=!1,Bd&&(g=m_(a,c,d,m)),f_(r),g}function f_(r){Qe.H=o0;var a=Wn!==null&&Wn.next!==null;if(Yo=0,Xs=Wn=Xt=null,Zp=!1,_f=0,gd=null,a)throw Error(s(300));r===null||Ws||(r=r.dependencies,r!==null&&Hp(r)&&(Ws=!0))}function m_(r,a,c,d){Xt=r;var m=0;do{if(Bd&&(gd=null),_f=0,Bd=!1,25<=m)throw Error(s(301));if(m+=1,Xs=Wn=null,r.updateQueue!=null){var g=r.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}Qe.H=i4,g=a(c,d)}while(Bd);return g}function WA(){var r=Qe.H,a=r.useState()[0];return a=typeof a.then=="function"?wf(a):a,r=r.useState()[0],(Wn!==null?Wn.memoizedState:null)!==r&&(Xt.flags|=1024),a}function Jx(){var r=e0!==0;return e0=0,r}function Kx(r,a,c){a.updateQueue=r.updateQueue,a.flags&=-2053,r.lanes&=~c}function Qx(r){if(Zp){for(r=r.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}Zp=!1}Yo=0,Xs=Wn=Xt=null,Bd=!1,_f=e0=0,gd=null}function si(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xs===null?Xt.memoizedState=Xs=r:Xs=Xs.next=r,Xs}function qs(){if(Wn===null){var r=Xt.alternate;r=r!==null?r.memoizedState:null}else r=Wn.next;var a=Xs===null?Xt.memoizedState:Xs.next;if(a!==null)Xs=a,Wn=r;else{if(r===null)throw Xt.alternate===null?Error(s(467)):Error(s(310));Wn=r,r={memoizedState:Wn.memoizedState,baseState:Wn.baseState,baseQueue:Wn.baseQueue,queue:Wn.queue,next:null},Xs===null?Xt.memoizedState=Xs=r:Xs=Xs.next=r}return Xs}function t0(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wf(r){var a=_f;return _f+=1,gd===null&&(gd=[]),r=r_(gd,r,a),a=Xt,(Xs===null?a.memoizedState:Xs.next)===null&&(a=a.alternate,Qe.H=a===null||a.memoizedState===null?Q_:Y_),r}function n0(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return wf(r);if(r.$$typeof===ne)return;if(r.$$typeof===Ee)return Sr(r)}throw Error(s(438,String(r)))}function Yx(r){var a=null,c=Xt.updateQueue;if(c!==null&&(a=c.memoCache),a==null){var d=Xt.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(a={data:d.data.map(function(m){return m.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),c===null&&(c=t0(),Xt.updateQueue=c),c.memoCache=a,c=a.data[a.index],c===void 0)for(c=a.data[a.index]=Array(r),d=0;d<r;d++)c[d]=Ae;return a.index++,c}function Xo(r,a){return typeof a=="function"?a(r):a}function s0(r){var a=qs();return Xx(a,Wn,r)}function Xx(r,a,c){var d=r.queue;if(d===null)throw Error(s(311));d.lastRenderedReducer=c;var m=r.baseQueue,g=d.pending;if(g!==null){if(m!==null){var w=m.next;m.next=g.next,g.next=w}a.baseQueue=m=g,d.pending=null}if(g=r.baseState,m===null)r.memoizedState=g;else{a=m.next;var I=w=null,q=null,le=a,xe=!1;do{var Re=le.lane&-536870913;if(Re!==le.lane?(mn&Re)===Re:(Yo&Re)===Re){var ie=le.revertLane;if(ie===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),Re===iu&&(xe=!0);else if((Yo&ie)===ie){le=le.next,ie===iu&&(xe=!0);continue}else Re={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},q===null?(I=q=Re,w=g):q=q.next=Re,Xt.lanes|=ie,Kl|=ie;Re=le.action,uu&&c(g,Re),g=le.hasEagerState?le.eagerState:c(g,Re)}else ie={lane:Re,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},q===null?(I=q=ie,w=g):q=q.next=ie,Xt.lanes|=Re,Kl|=Re;le=le.next}while(le!==null&&le!==a);if(q===null?w=g:q.next=I,!ti(g,r.memoizedState)&&(Ws=!0,xe&&(c=fd,c!==null)))throw c;r.memoizedState=g,r.baseState=w,r.baseQueue=q,d.lastRenderedState=g}return m===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function Wx(r){var a=qs(),c=a.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=r;var d=c.dispatch,m=c.pending,g=a.memoizedState;if(m!==null){c.pending=null;var w=m=m.next;do g=r(g,w.action),w=w.next;while(w!==m);ti(g,a.memoizedState)||(Ws=!0),a.memoizedState=g,a.baseQueue===null&&(a.baseState=g),c.lastRenderedState=g}return[g,d]}function p_(r,a,c){var d=Xt,m=qs(),g=tn;if(g){if(c===void 0)throw Error(s(407));c=c()}else c=a();var w=!ti((Wn||m).memoizedState,c);if(w&&(m.memoizedState=c,Ws=!0),m=m.queue,tb(x_.bind(null,d,m,r),[r]),r=m.getSnapshot!==a||w||Xs!==null&&(Xs.memoizedState.tag&1)!==0,xd(r?9:8,{destroy:void 0},g_.bind(null,d,m,c,a),null),r){if(d.flags|=2048,ss===null)throw Error(s(349));g||(Yo&127)!==0||B_(d,a,c)}return c}function B_(r,a,c){r.flags|=16384,r={getSnapshot:a,value:c},a=Xt.updateQueue,a===null?(a=t0(),Xt.updateQueue=a,a.stores=[r]):(c=a.stores,c===null?a.stores=[r]:c.push(r))}function g_(r,a,c,d){a.value=c,a.getSnapshot=d,b_(a)&&C_(r)}function x_(r,a,c){return c(function(){b_(a)&&C_(r)})}function b_(r){var a=r.getSnapshot;r=r.value;try{var c=a();return!ti(r,c)}catch{return!0}}function C_(r){var a=fe(r,2);a!==null&&_i(a,r,2)}function Zx(r){var a=si();if(typeof r=="function"){var c=r;if(r=c(),uu){sn(!0);try{c()}finally{sn(!1)}}}return a.memoizedState=a.baseState=r,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:r},a}function y_(r,a,c,d){return r.baseState=c,Xx(r,Wn,typeof d=="function"?d:Xo)}function ZA(r,a,c,d,m){if(a0(r))throw Error(s(485));if(r=a.action,r!==null){var g={payload:m,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){g.listeners.push(w)}};Qe.T!==null?c(!0):g.isTransition=!1,d(g),c=a.pending,c===null?(g.next=a.pending=g,v_(a,g)):(g.next=c.next,a.pending=c.next=g)}}function v_(r,a){var c=a.action,d=a.payload,m=r.state;if(a.isTransition){var g=Qe.T,w={};w.types=g!==null?g.types:null,Qe.T=w;try{var I=c(m,d),q=Qe.S;q!==null&&q(w,I),__(r,a,I)}catch(le){eb(r,a,le)}finally{g!==null&&w.types!==null&&(g.types=w.types),Qe.T=g}}else try{g=c(m,d),__(r,a,g)}catch(le){eb(r,a,le)}}function __(r,a,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(d){w_(r,a,d)},function(d){return eb(r,a,d)}):w_(r,a,c)}function w_(r,a,c){a.status="fulfilled",a.value=c,E_(a),r.state=c,a=r.pending,a!==null&&(c=a.next,c===a?r.pending=null:(c=c.next,a.next=c,v_(r,c)))}function eb(r,a,c){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do a.status="rejected",a.reason=c,E_(a),a=a.next;while(a!==d)}r.action=null}function E_(r){r=r.listeners;for(var a=0;a<r.length;a++)(0,r[a])()}function N_(r,a){return a}function D_(r,a){if(tn){var c=ss.formState;if(c!==null){e:{var d=Xt;if(tn){if(Cn){t:{for(var m=Cn,g=Ba;m.nodeType!==8;){if(!g){m=null;break t}if(m=xa(m.nextSibling),m===null){m=null;break t}}g=m.data,m=g==="F!"||g==="F"?m:null}if(m){Cn=xa(m.nextSibling),d=m.data==="F!";break e}}Ll(d)}d=!1}d&&(a=c[0])}}return c=si(),c.memoizedState=c.baseState=a,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:N_,lastRenderedState:a},c.queue=d,c=$_.bind(null,Xt,d),d.dispatch=c,d=Zx(!1),g=ab.bind(null,Xt,!1,d.queue),d=si(),m={state:a,dispatch:null,action:r,pending:null},d.queue=m,c=ZA.bind(null,Xt,m,g,c),m.dispatch=c,d.memoizedState=r,[a,c,!1]}function T_(r){var a=qs();return S_(a,Wn,r)}function S_(r,a,c){if(a=Xx(r,a,N_)[0],r=s0(Xo)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var d=wf(a)}catch(w){throw w===md?Jp:w}else d=a;a=qs();var m=a.queue,g=m.dispatch;return c!==a.memoizedState&&(Xt.flags|=2048,xd(9,{destroy:void 0},e4.bind(null,m,c),null)),[d,g,r]}function e4(r,a){r.action=a}function j_(r){var a=qs(),c=Wn;if(c!==null)return S_(a,c,r);qs(),a=a.memoizedState,c=qs();var d=c.queue.dispatch;return c.memoizedState=r,[a,d,!1]}function xd(r,a,c,d){return r={tag:r,create:c,deps:d,inst:a,next:null},a=Xt.updateQueue,a===null&&(a=t0(),Xt.updateQueue=a),c=a.lastEffect,c===null?a.lastEffect=r.next=r:(d=c.next,c.next=r,r.next=d,a.lastEffect=r),r}function A_(){return qs().memoizedState}function r0(r,a,c,d){var m=si();Xt.flags|=r,m.memoizedState=xd(1|a,{destroy:void 0},c,d===void 0?null:d)}function i0(r,a,c,d){var m=qs();d=d===void 0?null:d;var g=m.memoizedState.inst;Wn!==null&&d!==null&&qx(d,Wn.memoizedState.deps)?m.memoizedState=xd(a,g,c,d):(Xt.flags|=r,m.memoizedState=xd(1|a,g,c,d))}function k_(r,a){r0(8390656,8,r,a)}function tb(r,a){i0(2048,8,r,a)}function t4(r){Xt.flags|=4;var a=Xt.updateQueue;if(a===null)a=t0(),Xt.updateQueue=a,a.events=[r];else{var c=a.events;c===null?a.events=[r]:c.push(r)}}function R_(r){var a=qs().memoizedState;return t4({ref:a,nextImpl:r}),function(){if((Mn&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}function I_(r,a){return i0(4,2,r,a)}function O_(r,a){return i0(4,4,r,a)}function L_(r,a){if(typeof a=="function"){r=r();var c=a(r);return function(){typeof c=="function"?c():a(null)}}if(a!=null)return r=r(),a.current=r,function(){a.current=null}}function M_(r,a,c){c=c!=null?c.concat([r]):null,i0(4,4,L_.bind(null,a,r),c)}function nb(){}function P_(r,a){var c=qs();a=a===void 0?null:a;var d=c.memoizedState;return a!==null&&qx(a,d[1])?d[0]:(c.memoizedState=[r,a],r)}function z_(r,a){var c=qs();a=a===void 0?null:a;var d=c.memoizedState;if(a!==null&&qx(a,d[1]))return d[0];if(d=r(),uu){sn(!0);try{r()}finally{sn(!1)}}return c.memoizedState=[d,a],d}function sb(r,a,c){return c===void 0||(Yo&1073741824)!==0&&(mn&261930)===0?r.memoizedState=a:(r.memoizedState=c,r=Qw(),Xt.lanes|=r,Kl|=r,c)}function F_(r,a,c,d){return ti(c,a)?c:Ul.current!==null?(r=sb(r,c,d),ti(r,a)||(Ws=!0),r):(Yo&106)===0||(Yo&1073741824)!==0&&(mn&261930)===0?(Ws=!0,r.memoizedState=c):(r=Qw(),Xt.lanes|=r,Kl|=r,a)}function V_(r,a,c,d,m){var g=st.p;st.p=g!==0&&8>g?g:8;var w=Qe.T,I={};I.types=w!==null?w.types:null,Qe.T=I,ab(r,!1,a,c);try{var q=m(),le=Qe.S;if(le!==null&&le(I,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var xe=YA(q,d);Ef(r,a,xe,Ji(r))}else Ef(r,a,d,Ji(r))}catch(Re){Ef(r,a,{then:function(){},status:"rejected",reason:Re},Ji())}finally{st.p=g,w!==null&&I.types!==null&&(w.types=I.types),Qe.T=w}}function n4(){}function rb(r,a,c,d){if(r.tag!==5)throw Error(s(476));var m=U_(r).queue;V_(r,m,a,Yn,c===null?n4:function(){return G_(r),c(d)})}function U_(r){var a=r.memoizedState;if(a!==null)return a;a={memoizedState:Yn,baseState:Yn,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:Yn},next:null};var c={};return a.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:c},next:null},r.memoizedState=a,r=r.alternate,r!==null&&(r.memoizedState=a),a}function G_(r){var a=U_(r);a.next===null&&(a=r.alternate.memoizedState),Ef(r,a.next.queue,{},Ji())}function ib(){return Sr(Md)}function H_(){return qs().memoizedState}function q_(){return qs().memoizedState}function s4(r){for(var a=r.return;a!==null;){switch(a.tag){case 24:case 3:var c=Ji();r=Fl(c);var d=Vl(a,r,c);d!==null&&(_i(d,a,c),bf(d,a,c)),a={cache:Rx()},r.payload=a;return}a=a.return}}function r4(r,a,c){var d=Ji();c={lane:d,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},a0(r)?J_(a,c):(c=te(r,a,c,d),c!==null&&(_i(c,r,d),K_(c,a,d)))}function $_(r,a,c){var d=Ji();Ef(r,a,c,d)}function Ef(r,a,c,d){var m={lane:d,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(a0(r))J_(a,m);else{var g=r.alternate;if(r.lanes===0&&(g===null||g.lanes===0)&&(g=a.lastRenderedReducer,g!==null))try{var w=a.lastRenderedState,I=g(w,c);if(m.hasEagerState=!0,m.eagerState=I,ti(I,w))return Te(r,a,m,0),ss===null&&X(),!1}catch{}finally{}if(c=te(r,a,m,d),c!==null)return _i(c,r,d),K_(c,a,d),!0}return!1}function ab(r,a,c,d){if(d={lane:2,revertLane:Yb(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},a0(r)){if(a)throw Error(s(479))}else a=te(r,c,d,2),a!==null&&_i(a,r,2)}function a0(r){var a=r.alternate;return r===Xt||a!==null&&a===Xt}function J_(r,a){Bd=Zp=!0;var c=r.pending;c===null?a.next=a:(a.next=c.next,c.next=a),r.pending=a}function K_(r,a,c){if((c&4194048)!==0){var d=a.lanes;d&=r.pendingLanes,c|=d,a.lanes=c,ra(r,c)}}var o0={readContext:Sr,use:n0,useCallback:Ms,useContext:Ms,useEffect:Ms,useImperativeHandle:Ms,useLayoutEffect:Ms,useInsertionEffect:Ms,useMemo:Ms,useReducer:Ms,useRef:Ms,useState:Ms,useDebugValue:Ms,useDeferredValue:Ms,useTransition:Ms,useSyncExternalStore:Ms,useId:Ms,useHostTransitionStatus:Ms,useFormState:Ms,useActionState:Ms,useOptimistic:Ms,useMemoCache:Ms,useCacheRefresh:Ms,useEffectEvent:Ms},Q_={readContext:Sr,use:n0,useCallback:function(r,a){return si().memoizedState=[r,a===void 0?null:a],r},useContext:Sr,useEffect:k_,useImperativeHandle:function(r,a,c){c=c!=null?c.concat([r]):null,r0(4194308,4,L_.bind(null,a,r),c)},useLayoutEffect:function(r,a){return r0(4194308,4,r,a)},useInsertionEffect:function(r,a){r0(4,2,r,a)},useMemo:function(r,a){var c=si();a=a===void 0?null:a;var d=r();if(uu){sn(!0);try{r()}finally{sn(!1)}}return c.memoizedState=[d,a],d},useReducer:function(r,a,c){var d=si();if(c!==void 0){var m=c(a);if(uu){sn(!0);try{c(a)}finally{sn(!1)}}}else m=a;return d.memoizedState=d.baseState=m,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:m},d.queue=r,r=r.dispatch=r4.bind(null,Xt,r),[d.memoizedState,r]},useRef:function(r){var a=si();return r={current:r},a.memoizedState=r},useState:function(r){r=Zx(r);var a=r.queue,c=$_.bind(null,Xt,a);return a.dispatch=c,[r.memoizedState,c]},useDebugValue:nb,useDeferredValue:function(r,a){var c=si();return sb(c,r,a)},useTransition:function(){var r=Zx(!1);return r=V_.bind(null,Xt,r.queue,!0,!1),si().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,a,c){var d=Xt,m=si();if(tn){if(c===void 0)throw Error(s(407));c=c()}else{if(c=a(),ss===null)throw Error(s(349));(mn&127)!==0||B_(d,a,c)}m.memoizedState=c;var g={value:c,getSnapshot:a};return m.queue=g,k_(x_.bind(null,d,g,r),[r]),d.flags|=2048,xd(9,{destroy:void 0},g_.bind(null,d,g,c,a),null),c},useId:function(){var r=si(),a=ss.identifierPrefix;if(tn){var c=Ui,d=Vi;c=(d&~(1<<32-Ut(d)-1)).toString(32)+c,a="_"+a+"R_"+c,c=e0++,0<c&&(a+="H"+c.toString(32)),a+="_"}else c=XA++,a="_"+a+"r_"+c.toString(32)+"_";return r.memoizedState=a},useHostTransitionStatus:ib,useFormState:D_,useActionState:D_,useOptimistic:function(r){var a=si();a.memoizedState=a.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=c,a=ab.bind(null,Xt,!0,c),c.dispatch=a,[r,a]},useMemoCache:Yx,useCacheRefresh:function(){return si().memoizedState=s4.bind(null,Xt)},useEffectEvent:function(r){var a=si(),c={impl:r};return a.memoizedState=c,function(){if((Mn&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},Y_={readContext:Sr,use:n0,useCallback:P_,useContext:Sr,useEffect:tb,useImperativeHandle:M_,useInsertionEffect:I_,useLayoutEffect:O_,useMemo:z_,useReducer:s0,useRef:A_,useState:function(){return s0(Xo)},useDebugValue:nb,useDeferredValue:function(r,a){var c=qs();return F_(c,Wn.memoizedState,r,a)},useTransition:function(){var r=s0(Xo)[0],a=qs().memoizedState;return[typeof r=="boolean"?r:wf(r),a]},useSyncExternalStore:p_,useId:H_,useHostTransitionStatus:ib,useFormState:T_,useActionState:T_,useOptimistic:function(r,a){var c=qs();return y_(c,Wn,r,a)},useMemoCache:Yx,useCacheRefresh:q_,useEffectEvent:R_},i4={readContext:Sr,use:n0,useCallback:P_,useContext:Sr,useEffect:tb,useImperativeHandle:M_,useInsertionEffect:I_,useLayoutEffect:O_,useMemo:z_,useReducer:Wx,useRef:A_,useState:function(){return Wx(Xo)},useDebugValue:nb,useDeferredValue:function(r,a){var c=qs();return Wn===null?sb(c,r,a):F_(c,Wn.memoizedState,r,a)},useTransition:function(){var r=Wx(Xo)[0],a=qs().memoizedState;return[typeof r=="boolean"?r:wf(r),a]},useSyncExternalStore:p_,useId:H_,useHostTransitionStatus:ib,useFormState:j_,useActionState:j_,useOptimistic:function(r,a){var c=qs();return Wn!==null?y_(c,Wn,r,a):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:Yx,useCacheRefresh:q_,useEffectEvent:R_};function ob(r,a,c,d){a=r.memoizedState,c=c(d,a),c=c==null?a:k({},a,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var lb={enqueueSetState:function(r,a,c){r=r._reactInternals;var d=Ji(),m=Fl(d);m.payload=a,c!=null&&(m.callback=c),a=Vl(r,m,d),a!==null&&(_i(a,r,d),bf(a,r,d))},enqueueReplaceState:function(r,a,c){r=r._reactInternals;var d=Ji(),m=Fl(d);m.tag=1,m.payload=a,c!=null&&(m.callback=c),a=Vl(r,m,d),a!==null&&(_i(a,r,d),bf(a,r,d))},enqueueForceUpdate:function(r,a){r=r._reactInternals;var c=Ji(),d=Fl(c);d.tag=2,a!=null&&(d.callback=a),a=Vl(r,d,c),a!==null&&(_i(a,r,c),bf(a,r,c))}};function X_(r,a,c,d,m,g,w){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,g,w):a.prototype&&a.prototype.isPureReactComponent?!Qc(c,d)||!Qc(m,g):!0}function W_(r,a,c,d){r=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(c,d),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(c,d),a.state!==r&&lb.enqueueReplaceState(a,a.state,null)}function du(r,a){var c=a;if("ref"in a){c={};for(var d in a)d!=="ref"&&(c[d]=a[d])}if(r=r.defaultProps){c===a&&(c=k({},c));for(var m in r)c[m]===void 0&&(c[m]=r[m])}return c}function Z_(r){G(r)}function ew(r){console.error(r)}function tw(r){G(r)}function l0(r,a){try{var c=r.onUncaughtError;c(a.value,{componentStack:a.stack})}catch(d){setTimeout(function(){throw d})}}function nw(r,a,c){try{var d=r.onCaughtError;d(c.value,{componentStack:c.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function cb(r,a,c){return c=Fl(c),c.tag=3,c.payload={element:null},c.callback=function(){l0(r,a)},c}function sw(r){return r=Fl(r),r.tag=3,r}function rw(r,a,c,d){var m=c.type.getDerivedStateFromError;if(typeof m=="function"){var g=d.value;r.payload=function(){return m(g)},r.callback=function(){nw(a,c,d)}}var w=c.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(r.callback=function(){nw(a,c,d),typeof m!="function"&&(Ql===null?Ql=new Set([this]):Ql.add(this));var I=d.stack;this.componentDidCatch(d.value,{componentStack:I!==null?I:""})})}function a4(r,a,c,d,m){if(c.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(a=c.alternate,a!==null&&su(a,c,m,!0),c=jr.current,c!==null){switch(c.tag){case 31:case 13:case 19:return Ur===null?S0():c.alternate===null&&Ps===0&&(Ps=3),c.flags&=-257,c.flags|=65536,c.lanes=m,d===Kp?c.flags|=16384:(a=c.updateQueue,a===null?c.updateQueue=new Set([d]):a.add(d),Jb(r,d,m)),!1;case 22:return c.flags|=65536,d===Kp?c.flags|=16384:(a=c.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([d])},c.updateQueue=a):(c=a.retryQueue,c===null?a.retryQueue=new Set([d]):c.add(d)),Jb(r,d,m)),!1}throw Error(s(435,c.tag))}return Jb(r,d,m),S0(),!1}if(tn)return a=jr.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=m,d!==Sx&&(r=Error(s(422),{cause:d}),mf(xi(r,c)))):(d!==Sx&&(a=Error(s(423),{cause:d}),mf(xi(a,c))),r=r.current.alternate,r.flags|=65536,m&=-m,r.lanes|=m,d=xi(d,c),m=cb(r.stateNode,d,m),zx(r,m),Ps!==4&&(Ps=2)),!1;var g=Error(s(520),{cause:d});if(g=xi(g,c),Rf===null?Rf=[g]:Rf.push(g),Ps!==4&&(Ps=2),a===null)return!0;d=xi(d,c),c=a;do{switch(c.tag){case 3:return c.flags|=65536,r=m&-m,c.lanes|=r,r=cb(c.stateNode,d,r),zx(c,r),!1;case 1:if(a=c.type,g=c.stateNode,(c.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Ql===null||!Ql.has(g))))return c.flags|=65536,m&=-m,c.lanes|=m,m=sw(m),rw(m,r,c,d),zx(c,m),!1;break;case 22:if(c.memoizedState!==null)return c.flags|=65536,!1}c=c.return}while(c!==null);return!1}var ub=Error(s(461)),Ws=!1;function hr(r,a,c,d){a.child=r===null?l_(a,null,c,d):cu(a,r.child,c,d)}function iw(r,a,c,d,m){c=c.render;var g=a.ref;if("ref"in d){var w={};for(var I in d)I!=="ref"&&(w[I]=d[I])}else w=d;return ru(a),d=$x(r,a,c,w,g,m),I=Jx(),r!==null&&!Ws?(Kx(r,a,m),Wo(r,a,m)):(tn&&I&&eu(a),a.flags|=1,hr(r,a,d,m),a.child)}function aw(r,a,c,d,m){if(r===null){var g=c.type;return typeof g=="function"&&!Ln(g)&&g.defaultProps===void 0&&c.compare===null?(a.tag=15,a.type=g,ow(r,a,g,d,m)):(r=cd(c.type,null,d,a,a.mode,m),r.ref=a.ref,r.return=a,a.child=r)}if(g=r.child,!xb(r,m)){var w=g.memoizedProps;if(c=c.compare,c=c!==null?c:Qc,c(w,d)&&r.ref===a.ref)return Wo(r,a,m)}return a.flags|=1,r=dr(g,d),r.ref=a.ref,r.return=a,a.child=r}function ow(r,a,c,d,m){if(r!==null){var g=r.memoizedProps;if(Qc(g,d)&&r.ref===a.ref)if(Ws=!1,a.pendingProps=d=g,xb(r,m))(r.flags&131072)!==0&&(Ws=!0);else return a.lanes=r.lanes,Wo(r,a,m)}return db(r,a,c,d,m)}function lw(r,a,c,d){var m=d.children,g=r!==null?r.memoizedState:null;if(r===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((a.flags&128)!==0){if(g=g!==null?g.baseLanes|c:c,r!==null){for(d=a.child=r.child,m=0;d!==null;)m=m|d.lanes|d.childLanes,d=d.sibling;d=m&~g}else d=0,a.child=null;return cw(r,a,g,c,d)}if((c&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},r!==null&&$p(a,g!==null?g.cachePool:null),g!==null?d_(a,g):Vx(),h_(a);else return d=a.lanes=536870912,cw(r,a,g!==null?g.baseLanes|c:c,c,d)}else g!==null?($p(a,g.cachePool),d_(a,g),Hl(),a.memoizedState=null):(r!==null&&$p(a,null),Vx(),Hl());return hr(r,a,m,c),a.child}function Nf(r,a){return r!==null&&r.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function cw(r,a,c,d,m){var g=Ox();return g=g===null?null:{parent:Ys._currentValue,pool:g},a.memoizedState={baseLanes:c,cachePool:g},r!==null&&$p(a,null),Vx(),h_(a),r!==null&&su(r,a,d,!0),a.childLanes=m,null}function c0(r,a){return a=u0({mode:a.mode,children:a.children},r.mode),a.ref=r.ref,r.child=a,a.return=r,a}function uw(r,a,c){return cu(a,r.child,null,c),r=c0(a,a.pendingProps),r.flags|=2,Gi(a),a.memoizedState=null,r}function o4(r,a,c){var d=a.pendingProps,m=(a.flags&128)!==0;if(a.flags&=-129,r===null){if(tn){if(d.mode==="hidden")return r=c0(a,d),a.lanes=536870912,r.memoizedState={baseLanes:0,cachePool:null},Nf(null,r);if(Gx(a),(r=Cn)?(r=L2(r,Ba),r=r!==null&&r.data==="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:ka!==null?{id:Vi,overflow:Ui}:null,retryLane:536870912,hydrationErrors:null},c=ud(r),c.return=a,a.child=c,wn=a,Cn=null)):r=null,r===null)throw Ll(a);return a.lanes=536870912,null}return c0(a,d)}var g=r.memoizedState;if(g!==null){var w=g.dehydrated;if(Gx(a),m)if(a.flags&256)a.flags&=-257,a=uw(r,a,c);else if(a.memoizedState!==null)a.child=r.child,a.flags|=128,a=null;else throw Error(s(558));else if(Ws||su(r,a,c,!1),m=(c&r.childLanes)!==0,Ws||m){if(Ul.current===null){if(d=ss,d!==null&&(w=Dr(d,c),w!==0&&w!==g.retryLane))throw g.retryLane=w,fe(r,w),_i(d,r,w),ub;S0()}a=uw(r,a,c)}else r=g.treeContext,Cn=xa(w.nextSibling),wn=a,tn=!0,ao=null,Ba=!1,r!==null&&ff(a,r),a=c0(a,d),a.flags|=134221824;return a}return r=dr(r.child,{mode:d.mode,children:d.children}),r.ref=a.ref,a.child=r,r.return=a,r}function bd(r,a){var c=a.ref;if(c===null)r!==null&&r.ref!==null&&(a.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(r===null||r.ref!==c)&&(a.flags|=4194816)}}function db(r,a,c,d,m){return ru(a),c=$x(r,a,c,d,void 0,m),d=Jx(),r!==null&&!Ws?(Kx(r,a,m),Wo(r,a,m)):(tn&&d&&eu(a),a.flags|=1,hr(r,a,c,m),a.child)}function dw(r,a,c,d,m,g){return ru(a),a.updateQueue=null,c=m_(a,d,c,m),f_(r),d=Jx(),r!==null&&!Ws?(Kx(r,a,g),Wo(r,a,g)):(tn&&d&&eu(a),a.flags|=1,hr(r,a,c,g),a.child)}function hw(r,a,c,d,m){if(ru(a),a.stateNode===null){var g=nt,w=c.contextType;typeof w=="object"&&w!==null&&(g=Sr(w)),g=new c(d,g),a.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=lb,a.stateNode=g,g._reactInternals=a,g=a.stateNode,g.props=d,g.state=a.memoizedState,g.refs={},Mx(a),w=c.contextType,g.context=typeof w=="object"&&w!==null?Sr(w):nt,g.state=a.memoizedState,w=c.getDerivedStateFromProps,typeof w=="function"&&(ob(a,c,w,d),g.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(w=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),w!==g.state&&lb.enqueueReplaceState(g,g.state,null),yf(a,d,g,m),Cf(),g.state=a.memoizedState),typeof g.componentDidMount=="function"&&(a.flags|=4194308),d=!0}else if(r===null){g=a.stateNode;var I=a.memoizedProps,q=du(c,I);g.props=q;var le=g.context,xe=c.contextType;w=nt,typeof xe=="object"&&xe!==null&&(w=Sr(xe));var Re=c.getDerivedStateFromProps;xe=typeof Re=="function"||typeof g.getSnapshotBeforeUpdate=="function",I=a.pendingProps!==I,xe||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(I||le!==w)&&W_(a,g,d,w),zl=!1;var ie=a.memoizedState;g.state=ie,yf(a,d,g,m),Cf(),le=a.memoizedState,I||ie!==le||zl?(typeof Re=="function"&&(ob(a,c,Re,d),le=a.memoizedState),(q=zl||X_(a,c,q,d,ie,le,w))?(xe||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(a.flags|=4194308)):(typeof g.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=d,a.memoizedState=le),g.props=d,g.state=le,g.context=w,d=q):(typeof g.componentDidMount=="function"&&(a.flags|=4194308),d=!1)}else{g=a.stateNode,Px(r,a),w=a.memoizedProps,xe=du(c,w),g.props=xe,Re=a.pendingProps,ie=g.context,le=c.contextType,q=nt,typeof le=="object"&&le!==null&&(q=Sr(le)),I=c.getDerivedStateFromProps,(le=typeof I=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(w!==Re||ie!==q)&&W_(a,g,d,q),zl=!1,ie=a.memoizedState,g.state=ie,yf(a,d,g,m),Cf();var pe=a.memoizedState;w!==Re||ie!==pe||zl||r!==null&&r.dependencies!==null&&Hp(r.dependencies)?(typeof I=="function"&&(ob(a,c,I,d),pe=a.memoizedState),(xe=zl||X_(a,c,xe,d,ie,pe,q)||r!==null&&r.dependencies!==null&&Hp(r.dependencies))?(le||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(d,pe,q),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(d,pe,q)),typeof g.componentDidUpdate=="function"&&(a.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof g.componentDidUpdate!="function"||w===r.memoizedProps&&ie===r.memoizedState||(a.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&ie===r.memoizedState||(a.flags|=1024),a.memoizedProps=d,a.memoizedState=pe),g.props=d,g.state=pe,g.context=q,d=xe):(typeof g.componentDidUpdate!="function"||w===r.memoizedProps&&ie===r.memoizedState||(a.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&ie===r.memoizedState||(a.flags|=1024),d=!1)}return g=d,bd(r,a),d=(a.flags&128)!==0,g||d?(g=a.stateNode,c=d&&typeof c.getDerivedStateFromError!="function"?null:g.render(),a.flags|=1,r!==null&&d?(a.child=cu(a,r.child,null,m),a.child=cu(a,null,c,m)):hr(r,a,c,m),a.memoizedState=g.state,r=a.child):r=Wo(r,a,m),r}function fw(r,a,c,d){return tu(),a.flags|=256,hr(r,a,c,d),a.child}var hb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fb(r){return{baseLanes:r,cachePool:n_()}}function mb(r,a,c){return r=r!==null?r.childLanes&~c:0,a&&(r|=$i),r}function mw(r,a,c){var d=a.pendingProps,m=!1,g=(a.flags&128)!==0,w;if((w=g)||(w=r!==null&&r.memoizedState===null?!1:(Ar.current&2)!==0),w&&(m=!0,a.flags&=-129),w=(a.flags&32)!==0,a.flags&=-33,r===null){if(tn){if(m?Gl(a):Hl(),(r=Cn)?(r=L2(r,Ba),r=r!==null&&r.data!=="&"?r:null,r!==null&&(a.memoizedState={dehydrated:r,treeContext:ka!==null?{id:Vi,overflow:Ui}:null,retryLane:536870912,hydrationErrors:null},c=ud(r),c.return=a,a.child=c,wn=a,Cn=null)):r=null,r===null)throw Ll(a);return fC(r)?a.lanes=32:a.lanes=536870912,null}return g=d.children,d=d.fallback,m?(Hl(),m=a.mode,g=u0({mode:"hidden",children:g},m),d=qo(d,m,c,null),g.return=a,d.return=a,g.sibling=d,a.child=g,d=a.child,d.memoizedState=fb(c),d.childLanes=mb(r,w,c),a.memoizedState=hb,Nf(null,d)):(Gl(a),pb(a,g))}var I=r.memoizedState;if(I!==null){var q=I.dehydrated;if(q!==null)return l4(r,a,g,w,d,q,I,c)}return m?(Hl(),m=d.fallback,g=a.mode,I=r.child,q=I.sibling,d=dr(I,{mode:"hidden",children:d.children}),d.subtreeFlags=I.subtreeFlags&1206910976,q!==null?m=dr(q,m):(m=qo(m,g,c,null),m.flags|=2),m.return=a,d.return=a,d.sibling=m,a.child=d,Nf(null,d),d=a.child,m=r.child.memoizedState,m===null?m=fb(c):(g=m.cachePool,g!==null?(I=Ys._currentValue,g=g.parent!==I?{parent:I,pool:I}:g):g=n_(),m={baseLanes:m.baseLanes|c,cachePool:g}),d.memoizedState=m,d.childLanes=mb(r,w,c),a.memoizedState=hb,Nf(r.child,d)):(Gl(a),c=r.child,r=c.sibling,c=dr(c,{mode:"visible",children:d.children}),c.return=a,c.sibling=null,r!==null&&(w=a.deletions,w===null?(a.deletions=[r],a.flags|=16):w.push(r)),a.child=c,a.memoizedState=null,c)}function pb(r,a){return a=u0({mode:"visible",children:a},r.mode),a.return=r,r.child=a}function u0(r,a){return r=ot(22,r,null,a),r.lanes=0,r}function d0(r,a,c){return cu(a,r.child,null,c),r=pb(a,a.pendingProps.children),r.flags|=2,a.memoizedState=null,r}function l4(r,a,c,d,m,g,w,I){if(c)return a.flags&256?(Gl(a),a.flags&=-257,d0(r,a,I)):a.memoizedState!==null?(Hl(),a.child=r.child,a.flags|=128,null):(Hl(),g=m.fallback,w=a.mode,m=u0({mode:"visible",children:m.children},w),g=qo(g,w,I,null),g.flags|=2,m.return=a,g.return=a,m.sibling=g,a.child=m,cu(a,r.child,null,I),m=a.child,m.memoizedState=fb(I),m.childLanes=mb(r,d,I),a.memoizedState=hb,Nf(null,m));if(Gl(a),fC(g)){if(d=g.nextSibling&&g.nextSibling.dataset,d)var q=d.dgst;return d=q,d!==""&&(m=Error(s(419)),m.stack="",m.digest=d,mf({value:m,source:null,stack:null})),d0(r,a,I)}if(Ws||su(r,a,I,!1),d=(I&r.childLanes)!==0,Ws||d){if(Ul.current!==null)return d0(r,a,I);if(d=ss,d!==null&&(m=Dr(d,I),m!==0&&m!==w.retryLane))throw w.retryLane=m,fe(r,m),_i(d,r,m),ub;return hC(g)||S0(),d0(r,a,I)}return hC(g)?(a.flags|=192,a.child=r.child,null):(r=w.treeContext,Cn=xa(g.nextSibling),wn=a,tn=!0,ao=null,Ba=!1,r!==null&&ff(a,r),a=pb(a,m.children),a.flags|=134221824,a)}function pw(r,a,c){r.lanes|=a;var d=r.alternate;d!==null&&(d.lanes|=a),Gp(r.return,a,c)}function Bw(r){for(var a=null;r!==null;){var c=r.alternate;c!==null&&Wp(c)===null&&(a=r),r=r.sibling}return a}function h0(r,a,c,d,m,g){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:d,tail:c,tailMode:m,treeForkCount:g}:(w.isBackwards=a,w.rendering=null,w.renderingStartTime=0,w.last=d,w.tail=c,w.tailMode=m,w.treeForkCount=g)}function Bb(r){var a=r.child;for(r.child=null;a!==null;){var c=a.sibling;a.sibling=r.child,r.child=a,a=c}}function gb(r,a,c){var d=a.pendingProps,m=d.revealOrder,g=d.tail;d=d.children;var w=Ar.current;if(a.flags&128)return vf(a,w),null;var I=(w&2)!==0;if(I?(w=w&1|2,a.flags|=128):w&=1,vf(a,w),m==="backwards"&&r!==null?(Bb(r),hr(r,a,d,c),Bb(r)):hr(r,a,d,c),d=tn?Jo:0,!I&&r!==null&&(r.flags&128)!==0)e:for(r=a.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&pw(r,c,a);else if(r.tag===19)pw(r,c,a);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(m){case"backwards":c=Bw(a.child),c===null?(m=a.child,a.child=null):(m=c.sibling,c.sibling=null,Bb(a)),h0(a,!0,m,null,g,d);break;case"unstable_legacy-backwards":for(c=null,m=a.child,a.child=null;m!==null;){if(r=m.alternate,r!==null&&Wp(r)===null){a.child=m;break}r=m.sibling,m.sibling=c,c=m,m=r}h0(a,!0,c,null,g,d);break;case"together":h0(a,!1,null,null,void 0,d);break;case"independent":a.memoizedState=null;break;default:c=Bw(a.child),c===null?(m=a.child,a.child=null):(m=c.sibling,c.sibling=null),h0(a,!1,m,c,g,d)}return a.child}function gw(r,a,c){var d=a.pendingProps;return Ml(a,a.type,d.value),hr(r,a,d.children,c),a.child}function Wo(r,a,c){if(r!==null&&(a.dependencies=r.dependencies),Kl|=a.lanes,(c&a.childLanes)===0)if(r!==null){if(su(r,a,c,!1),(c&a.childLanes)===0)return null}else return null;if(r!==null&&a.child!==r.child)throw Error(s(153));if(a.child!==null){for(r=a.child,c=dr(r,r.pendingProps),a.child=c,c.return=a;r.sibling!==null;)r=r.sibling,c=c.sibling=dr(r,r.pendingProps),c.return=a;c.sibling=null}return a.child}function xb(r,a){return(r.lanes&a)!==0?!0:(r=r.dependencies,!!(r!==null&&Hp(r)))}function c4(r,a,c){switch(a.tag){case 3:vt(a,a.stateNode.containerInfo),Ml(a,Ys,r.memoizedState.cache),tu();break;case 27:case 5:on(a);break;case 4:vt(a,a.stateNode.containerInfo);break;case 10:Ml(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Gx(a),null;break;case 13:var d=a.memoizedState;if(d!==null){if(d.dehydrated!==null)return Gl(a),a.flags|=128,null;d=su(r,a,c,!1);var m=a.child.childLanes;return d||(c&m)!==0?mw(r,a,c):(Gl(a),r=Wo(r,a,c),r!==null?r.sibling:null)}Gl(a);break;case 19:if(a.flags&128)return gb(r,a,c);if(m=(r.flags&128)!==0,d=(c&a.childLanes)!==0,d||(su(r,a,c,!1),d=(c&a.childLanes)!==0),m){if(d)return gb(r,a,c);a.flags|=128}if(m=a.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),vf(a,Ar.current),d)break;return null;case 22:return a.lanes=0,lw(r,a,c,a.pendingProps);case 24:Ml(a,Ys,r.memoizedState.cache)}return Wo(r,a,c)}function xw(r,a,c){if(r!==null)if(r.memoizedProps!==a.pendingProps)Ws=!0;else{if(!xb(r,c)&&(a.flags&128)===0)return Ws=!1,c4(r,a,c);Ws=(r.flags&131072)!==0}else Ws=!1,tn&&(a.flags&1048576)!==0&&hf(a,Jo,a.index);switch(a.lanes=0,a.tag){case 16:e:{var d=a.pendingProps;if(r=ou(a.elementType),a.type=r,typeof r=="function")Ln(r)?(d=du(r,d),a.tag=1,a=hw(null,a,r,d,c)):(a.tag=0,a=db(null,a,r,d,c));else{if(r!=null){var m=r.$$typeof;if(m===me){a.tag=11,a=iw(null,a,r,d,c);break e}else if(m===Ue){a.tag=14,a=aw(null,a,r,d,c);break e}else if(m===Ee){a.tag=10,a.type=r,a=gw(null,a,c);break e}}throw a=tt(r)||r,Error(s(306,a,""))}}return a;case 0:return db(r,a,a.type,a.pendingProps,c);case 1:return d=a.type,m=du(d,a.pendingProps),hw(r,a,d,m,c);case 3:e:{if(vt(a,a.stateNode.containerInfo),r===null)throw Error(s(387));d=a.pendingProps;var g=a.memoizedState;m=g.element,Px(r,a),yf(a,d,null,c);var w=a.memoizedState;if(d=w.cache,Ml(a,Ys,d),d!==g.cache&&kx(a,[Ys],c,!0),Cf(),d=w.element,g.isDehydrated)if(g={element:d,isDehydrated:!1,cache:w.cache},a.updateQueue.baseState=g,a.memoizedState=g,a.flags&256){a=fw(r,a,d,c);break e}else if(d!==m){m=xi(Error(s(424)),a),mf(m),a=fw(r,a,d,c);break e}else{switch(r=a.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(Cn=xa(r.firstChild),wn=a,tn=!0,ao=null,Ba=!0,c=l_(a,null,d,c),a.child=c;c;)c.flags=c.flags&-3|134221824,c=c.sibling}else{if(tu(),d===m){a=Wo(r,a,c);break e}hr(r,a,d,c)}a=a.child}return a;case 26:return bd(r,a),r===null?(c=G2(a.type,null,a.pendingProps,null))?a.memoizedState=c:tn||(a.stateNode=v2(a.type,a.pendingProps,gn.current,a)):a.memoizedState=G2(a.type,r.memoizedProps,a.pendingProps,r.memoizedState),null;case 27:return on(a),r===null&&tn&&(d=a.stateNode=z2(a.type,a.pendingProps,gn.current),wn=a,Ba=!0,m=Cn,Wl(a.type)?(mC=m,Cn=xa(d.firstChild)):Cn=m),hr(r,a,a.pendingProps.children,c),bd(r,a),r===null&&(a.flags|=4194304),a.child;case 5:return r===null&&tn&&((m=d=Cn)&&(d=s3(d,a.type,a.pendingProps,Ba),d!==null?(a.stateNode=d,wn=a,Cn=xa(d.firstChild),Ba=!1,m=!0):m=!1),m||Ll(a)),on(a),m=a.type,g=a.pendingProps,w=r!==null?r.memoizedProps:null,d=g.children,iC(m,g)?d=null:w!==null&&iC(m,w)&&(a.flags|=32),a.memoizedState!==null&&(m=$x(r,a,WA,null,null,c),Md._currentValue=m),bd(r,a),hr(r,a,d,c),a.child;case 6:return r===null&&tn&&((r=c=Cn)&&(c=r3(c,a.pendingProps,Ba),c!==null?(a.stateNode=c,wn=a,Cn=null,r=!0):r=!1),r||Ll(a)),null;case 13:return mw(r,a,c);case 4:return vt(a,a.stateNode.containerInfo),d=a.pendingProps,r===null?a.child=cu(a,null,d,c):hr(r,a,d,c),a.child;case 11:return iw(r,a,a.type,a.pendingProps,c);case 7:return d=a.pendingProps,bd(r,a),hr(r,a,d,c),a.child;case 8:return hr(r,a,a.pendingProps.children,c),a.child;case 12:return hr(r,a,a.pendingProps.children,c),a.child;case 10:return gw(r,a,c);case 9:return m=a.type._context,d=a.pendingProps.children,ru(a),m=Sr(m),d=d(m),a.flags|=1,hr(r,a,d,c),a.child;case 14:return aw(r,a,a.type,a.pendingProps,c);case 15:return ow(r,a,a.type,a.pendingProps,c);case 19:return gb(r,a,c);case 31:return o4(r,a,c);case 22:return lw(r,a,c,a.pendingProps);case 24:return ru(a),d=Sr(Ys),r===null?(m=Ox(),m===null&&(m=ss,g=Rx(),m.pooledCache=g,g.refCount++,g!==null&&(m.pooledCacheLanes|=c),m=g),a.memoizedState={parent:d,cache:m},Mx(a),Ml(a,Ys,m)):((r.lanes&c)!==0&&(Px(r,a),yf(a,null,null,c),Cf()),m=r.memoizedState,g=a.memoizedState,m.parent!==d?(m={parent:d,cache:d},a.memoizedState=m,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=m),Ml(a,Ys,d)):(d=g.cache,Ml(a,Ys,d),d!==m.cache&&kx(a,[Ys],c,!0))),hr(r,a,a.pendingProps.children,c),a.child;case 30:return a.stateNode===null&&(a.stateNode={autoName:null,paired:null,clones:null,ref:null}),d=a.pendingProps,d.name!=null&&d.name!=="auto"?a.flags|=r===null?18882560:18874368:tn&&eu(a),r!==null&&r.memoizedProps.name!==d.name?a.flags|=4194816:bd(r,a),hr(r,a,d.children,c),a.child;case 29:throw a.pendingProps}throw Error(s(156,a.tag))}function Zo(r){r.flags|=4}function bb(r,a,c,d,m){var g;if((g=(r.mode&32)!==0)&&(g=c===null?J2(a,d):J2(a,d)&&(d.src!==c.src||d.srcSet!==c.srcSet)),g){if(r.flags|=16777216,(m&335544128)===m)if(r.stateNode.complete)r.flags|=8192;else if(Zw())r.flags|=8192;else throw lu=Kp,Lx}else r.flags&=-16777217}function bw(r,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!K2(a))if(Zw())r.flags|=8192;else throw lu=Kp,Lx}function f0(r,a){a!==null&&(r.flags|=4),r.flags&16384&&(a=r.tag!==22?hn():536870912,r.lanes|=a,wd|=a)}function Df(r,a){if(!tn)switch(r.tailMode){case"visible":break;case"collapsed":for(var c=r.tail,d=null;c!==null;)c.alternate!==null&&(d=c),c=c.sibling;d===null?a||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null;break;default:for(a=r.tail,c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?r.tail=null:c.sibling=null}}function us(r){var a=r.alternate!==null&&r.alternate.child===r.child,c=0,d=0;if(a)for(var m=r.child;m!==null;)c|=m.lanes|m.childLanes,d|=m.subtreeFlags&1206910976,d|=m.flags&1206910976,m.return=r,m=m.sibling;else for(m=r.child;m!==null;)c|=m.lanes|m.childLanes,d|=m.subtreeFlags,d|=m.flags,m.return=r,m=m.sibling;return r.subtreeFlags|=d,r.childLanes=c,a}function u4(r,a,c){var d=a.pendingProps;switch(dd(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return us(a),null;case 1:return us(a),null;case 3:return c=a.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),a.memoizedState.cache!==d&&(a.flags|=2048),Qo(Ys),Ft(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(hd(a)?Zo(a):r===null||r.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,jx())),us(a),null;case 26:var m=a.type,g=a.memoizedState;return r===null?(Zo(a),g!==null?(us(a),bw(a,g)):(us(a),bb(a,m,null,d,c))):g?g!==r.memoizedState?(Zo(a),us(a),bw(a,g)):(us(a),a.flags&=-16777217):(r=r.memoizedProps,r!==d&&Zo(a),us(a),bb(a,m,r,d,c)),null;case 27:if(Zn(a),c=gn.current,m=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==d&&Zo(a);else{if(!d){if(a.stateNode===null)throw Error(s(166));return us(a),a.subtreeFlags&=-33554433,null}r=At.current,hd(a)?Xv(a):(r=z2(m,d,c),a.stateNode=r,Zo(a))}return us(a),a.subtreeFlags&=-33554433,null;case 5:if(Zn(a),m=a.type,r!==null&&a.stateNode!=null)r.memoizedProps!==d&&Zo(a);else{if(!d){if(a.stateNode===null)throw Error(s(166));return us(a),a.subtreeFlags&=-33554433,null}if(g=At.current,hd(a))Xv(a);else{var w=Pf(gn.current);switch(g){case 1:g=w.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:g=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":g=w.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":g=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":g=w.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof d.is=="string"?w.createElement("select",{is:d.is}):w.createElement("select"),d.multiple?g.multiple=!0:d.size&&(g.size=d.size);break;default:g=typeof d.is=="string"?w.createElement(m,{is:d.is}):w.createElement(m)}}g[Xn]=a,g[_s]=d;e:for(w=a.child;w!==null;){if(w.tag===5||w.tag===6)g.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===a)break e;for(;w.sibling===null;){if(w.return===null||w.return===a)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}a.stateNode=g;e:switch(Rr(g,m,d),m){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Zo(a)}}return us(a),a.subtreeFlags&=-33554433,bb(a,a.type,r===null?null:r.memoizedProps,a.pendingProps,c),null;case 6:if(r&&a.stateNode!=null)r.memoizedProps!==d&&Zo(a);else{if(typeof d!="string"&&a.stateNode===null)throw Error(s(166));if(r=gn.current,hd(a)){if(r=a.stateNode,c=a.memoizedProps,d=null,m=wn,m!==null)switch(m.tag){case 27:case 5:d=m.memoizedProps}r[Xn]=a,r=!!(r.nodeValue===c||d!==null&&d.suppressHydrationWarning===!0||x2(r.nodeValue,c)),r||Ll(a,!0)}else r=Pf(r).createTextNode(d),r[Xn]=a,a.stateNode=r}return us(a),null;case 31:if(c=a.memoizedState,r===null||r.memoizedState!==null){if(d=hd(a),c!==null){if(r===null){if(!d)throw Error(s(318));if(r=a.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(557));r[Xn]=a}else tu(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;us(a),r=!1}else c=jx(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return a.flags&256?(Gi(a),a):(Gi(a),null);if((a.flags&128)!==0)throw Error(s(558))}return us(a),null;case 13:if(d=a.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(m=hd(a),d!==null&&d.dehydrated!==null){if(r===null){if(!m)throw Error(s(318));if(m=a.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(s(317));m[Xn]=a}else tu(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;us(a),m=!1}else m=jx(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return a.flags&256?(Gi(a),a):(Gi(a),null)}return Gi(a),(a.flags&128)!==0?(a.lanes=c,a):(c=d!==null,r=r!==null&&r.memoizedState!==null,c&&(d=a.child,m=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(m=d.alternate.memoizedState.cachePool.pool),g=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(g=d.memoizedState.cachePool.pool),g!==m&&(d.flags|=2048)),c!==r&&c&&(a.child.flags|=8192),f0(a,a.updateQueue),us(a),null);case 4:return Ft(),r===null&&eC(a.stateNode.containerInfo),a.flags|=67108864,us(a),null;case 10:return Qo(a.type),us(a),null;case 19:if(Hx(a),d=a.memoizedState,d===null)return us(a),null;if(m=(a.flags&128)!==0,g=d.rendering,g===null)if(m)Df(d,!1);else{if(Ps!==0||r!==null&&(r.flags&128)!==0)for(r=a.child;r!==null;){if(g=Wp(r),g!==null){for(a.flags|=128,Df(d,!1),r=g.updateQueue,a.updateQueue=r,f0(a,r),a.subtreeFlags=0,r=c,c=a.child;c!==null;)Vp(c,r),c=c.sibling;return vf(a,Ar.current&1|2),tn&&pa(a,d.treeForkCount),a.child}r=r.sibling}d.tail!==null&&Et()>E0&&(a.flags|=128,m=!0,Df(d,!1),a.lanes=4194304)}else{if(!m)if(r=Wp(g),r!==null){if(a.flags|=128,m=!0,r=r.updateQueue,a.updateQueue=r,f0(a,r),Df(d,!0),d.tail===null&&d.tailMode!=="collapsed"&&d.tailMode!=="visible"&&!g.alternate&&!tn)return us(a),null}else 2*Et()-d.renderingStartTime>E0&&c!==536870912&&(a.flags|=128,m=!0,Df(d,!1),a.lanes=4194304);d.isBackwards?(g.sibling=a.child,a.child=g):(r=d.last,r!==null?r.sibling=g:a.child=g,d.last=g)}if(d.tail!==null){r=d.tail;e:{for(c=r;c!==null;){if(c.alternate!==null){c=!1;break e}c=c.sibling}c=!0}return d.rendering=r,d.tail=r.sibling,d.renderingStartTime=Et(),r.sibling=null,g=Ar.current,g=m?g&1|2:g&1,d.tailMode==="visible"||d.tailMode==="collapsed"||!c||tn?vf(a,g):(c=g,jt(jr,a),jt(Ar,c),Ur===null&&(Ur=a)),tn&&pa(a,d.treeForkCount),r}return us(a),null;case 22:case 23:return Gi(a),Ux(),d=a.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(a.flags|=8192):d&&(a.flags|=8192),d?(c&536870912)!==0&&(a.flags&128)===0&&(us(a),a.subtreeFlags&6&&(a.flags|=8192)):us(a),c=a.updateQueue,c!==null&&f0(a,c.retryQueue),c=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),d=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(d=a.memoizedState.cachePool.pool),d!==c&&(a.flags|=2048),r!==null&&en(au),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),Qo(Ys),us(a),null;case 25:return null;case 30:return a.flags|=33554432,us(a),null}throw Error(s(156,a.tag))}function d4(r,a){switch(dd(a),a.tag){case 1:return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 3:return Qo(Ys),Ft(),r=a.flags,(r&65536)!==0&&(r&128)===0?(a.flags=r&-65537|128,a):null;case 26:case 27:case 5:return Zn(a),null;case 31:if(a.memoizedState!==null){if(Gi(a),a.alternate===null)throw Error(s(340));tu()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 13:if(Gi(a),r=a.memoizedState,r!==null&&r.dehydrated!==null){if(a.alternate===null)throw Error(s(340));tu()}return r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 19:return Hx(a),r=a.flags,r&65536?(a.flags=r&-65537|128,r=a.memoizedState,r!==null&&(r.rendering=null,r.tail=null),a.flags|=4,a):null;case 4:return Ft(),null;case 10:return Qo(a.type),null;case 22:case 23:return Gi(a),Ux(),r!==null&&en(au),r=a.flags,r&65536?(a.flags=r&-65537|128,a):null;case 24:return Qo(Ys),null;case 25:return null;default:return null}}function Cw(r,a){switch(dd(a),a.tag){case 3:Qo(Ys),Ft();break;case 26:case 27:case 5:Zn(a);break;case 4:Ft();break;case 31:a.memoizedState!==null&&Gi(a);break;case 13:Gi(a);break;case 19:Hx(a);break;case 10:Qo(a.type);break;case 22:case 23:Gi(a),Ux(),r!==null&&en(au);break;case 24:Qo(Ys)}}function Tf(r,a){try{var c=a.updateQueue,d=c!==null?c.lastEffect:null;if(d!==null){var m=d.next;c=m;do{if((c.tag&r)===r){d=void 0;var g=c.create,w=c.inst;d=g(),w.destroy=d}c=c.next}while(c!==m)}}catch(I){Jn(a,a.return,I)}}function ql(r,a,c){try{var d=a.updateQueue,m=d!==null?d.lastEffect:null;if(m!==null){var g=m.next;d=g;do{if((d.tag&r)===r){var w=d.inst,I=w.destroy;if(I!==void 0){w.destroy=void 0,m=a;var q=c,le=I;try{le()}catch(xe){Jn(m,q,xe)}}}d=d.next}while(d!==g)}}catch(xe){Jn(a,a.return,xe)}}function yw(r){var a=r.updateQueue;if(a!==null){var c=r.stateNode;try{u_(a,c)}catch(d){Jn(r,r.return,d)}}}function vw(r,a,c){c.props=du(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(d){Jn(r,a,d)}}function oo(r,a){try{var c=r.ref;if(c!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:var m=r.stateNode,g=fa(r.memoizedProps,m);(m.ref===null||m.ref.name!==g)&&(m.ref=S2(g)),d=m.ref;break;case 7:if(r.stateNode===null){var w=new Ki(r);b(r.child,!1,t3,w,void 0,void 0),r.stateNode=w}d=r.stateNode;break;default:d=r.stateNode}typeof c=="function"?r.refCleanup=c(d):c.current=d}}catch(I){Jn(r,a,I)}}function kr(r,a){var c=r.ref,d=r.refCleanup;if(c!==null)if(typeof d=="function")try{d()}catch(m){Jn(r,a,m)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(m){Jn(r,a,m)}else c.current=null}function m0(r,a){if((r.tag===5||r.tag===27||r.tag===6)&&r.alternate===null&&a!==null)for(var c=0;c<a.length;c++)O2(r.stateNode,a[c])}function _w(r){for(var a=r.return;a!==null&&(yb(a)&&O2(r.stateNode,a.stateNode),!Cb(a));)a=a.return}function Sf(r){for(var a=r.return;a!==null&&(yb(a)&&n3(r.stateNode,a.stateNode),!Cb(a));)a=a.return}function Cb(r){return r.tag===5||r.tag===3||r.tag===27}function yb(r){return r&&r.tag===7&&r.stateNode!==null}function vb(r){var a=r.type,c=r.memoizedProps,d=r.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":c.autoFocus&&d.focus();break e;case"img":c.src?d.src=c.src:c.srcSet&&(d.srcset=c.srcSet)}}catch(m){Jn(r,r.return,m)}}function _b(r,a,c){try{var d=r.stateNode;M4(d,r.type,c,a),d[_s]=a}catch(m){Jn(r,r.return,m)}}function ww(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Wl(r.type)||r.tag===4}function wb(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||ww(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Wl(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Eb(r,a,c,d){var m=r.tag;if(m===5||m===6)m=r.stateNode,a?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(m,a):(a=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,a.appendChild(m),c=c._reactRootContainer,c!=null||a.onclick!==null||(a.onclick=zr)),m0(r,d),Lt=!0;else if(m!==4&&(m===27&&(m0(r,d),d=null,Wl(r.type)&&(c=r.stateNode,a=null)),r=r.child,r!==null))for(Eb(r,a,c,d),r=r.sibling;r!==null;)Eb(r,a,c,d),r=r.sibling}function p0(r,a,c,d){var m=r.tag;if(m===5||m===6)m=r.stateNode,a?c.insertBefore(m,a):c.appendChild(m),m0(r,d),Lt=!0;else if(m!==4&&(m===27&&(m0(r,d),d=null,Wl(r.type)&&(c=r.stateNode)),r=r.child,r!==null))for(p0(r,a,c,d),r=r.sibling;r!==null;)p0(r,a,c,d),r=r.sibling}function Ew(r){var a=r.stateNode,c=r.memoizedProps;try{for(var d=r.type,m=a.attributes;m.length;)a.removeAttributeNode(m[0]);Rr(a,d,c),a[Xn]=r,a[_s]=c}catch(g){Jn(r,r.return,g)}}var B0=!1,Hi=null;function Nw(r){(r.tag===30||(r.subtreeFlags&33554432)!==0)&&(B0=!0)}var lo=null;function Dw(){var r=lo;return lo=null,r}var Ci=0;function Cd(r,a,c,d,m){return Ci=0,Tw(r.child,a,c,d,m)}function Tw(r,a,c,d,m){for(var g=!1;r!==null;){if(r.tag===5){var w=r.stateNode;if(d!==null){var I=lC(w);d.push(I),I.view&&(g=!0)}else g||lC(w).view&&(g=!0);B0=!0,D2(w,Ci===0?a:a+"_"+Ci,c),Ci++}else(r.tag!==22||r.memoizedState===null)&&(r.tag===30&&m||Tw(r.child,a,c,d,m)&&(g=!0));r=r.sibling}return g}function co(r,a){for(;r!==null;)r.tag===5?T2(r.stateNode,r.memoizedProps):(r.tag!==22||r.memoizedState===null)&&(r.tag===30&&a||co(r.child,a)),r=r.sibling}function g0(r){if((r.subtreeFlags&18874368)!==0)for(r=r.child;r!==null;){if((r.tag!==22||r.memoizedState===null)&&(g0(r),r.tag===30&&(r.flags&18874368)!==0&&r.stateNode.paired)){var a=r.memoizedProps;if(a.name==null||a.name==="auto")throw Error(s(544));var c=a.name;a=L(a.default,a.share),a!=="none"&&(Cd(r,c,a,null,!1)||co(r.child,!1))}r=r.sibling}}function Nb(r,a){if(r.tag===30){var c=r.stateNode,d=r.memoizedProps,m=fa(d,c),g=L(d.default,c.paired?d.share:d.enter);g!=="none"?Cd(r,m,g,null,!1)?(g0(r),c.paired||a||Td(r,d.onEnter)):co(r.child,!1):g0(r)}else if((r.subtreeFlags&33554432)!==0)for(r=r.child;r!==null;)Nb(r,a),r=r.sibling;else g0(r)}function Db(r){if(Hi!==null&&Hi.size!==0){var a=Hi;if((r.subtreeFlags&18874368)!==0)for(r=r.child;r!==null;){if(r.tag!==22||r.memoizedState===null){if(r.tag===30&&(r.flags&18874368)!==0){var c=r.memoizedProps,d=c.name;if(d!=null&&d!=="auto"){var m=a.get(d);if(m!==void 0){var g=L(c.default,c.share);if(g!=="none"&&(Cd(r,d,g,null,!1)?(g=r.stateNode,m.paired=g,g.paired=m,Td(r,c.onShare)):co(r.child,!1)),a.delete(d),a.size===0)break}}}Db(r)}r=r.sibling}}}function Tb(r){if(r.tag===30){var a=r.memoizedProps,c=fa(a,r.stateNode),d=Hi!==null?Hi.get(c):void 0,m=L(a.default,d!==void 0?a.share:a.exit);m!=="none"&&(Cd(r,c,m,null,!1)?d!==void 0?(m=r.stateNode,d.paired=m,m.paired=d,Hi.delete(c),Td(r,a.onShare)):Td(r,a.onExit):co(r.child,!1)),Hi!==null&&Db(r)}else if((r.subtreeFlags&33554432)!==0)for(r=r.child;r!==null;)Tb(r),r=r.sibling;else Hi!==null&&Db(r)}function Sw(r){for(r=r.child;r!==null;){if(r.tag===30){var a=r.memoizedProps,c=fa(a,r.stateNode);a=L(a.default,a.update),r.flags&=-5,a!=="none"&&Cd(r,c,a,r.memoizedState=[],!1)}else(r.subtreeFlags&33554432)!==0&&Sw(r);r=r.sibling}}function Sb(r){if((r.subtreeFlags&18874368)!==0)for(r=r.child;r!==null;){if(r.tag!==22||r.memoizedState===null){if(r.tag===30&&(r.flags&18874368)!==0){var a=r.stateNode;a.paired!==null&&(a.paired=null,co(r.child,!1))}Sb(r)}r=r.sibling}}function x0(r){if(r.tag===30)r.stateNode.paired=null,co(r.child,!1),Sb(r);else if((r.subtreeFlags&33554432)!==0)for(r=r.child;r!==null;)x0(r),r=r.sibling;else Sb(r)}function jw(r){for(r=r.child;r!==null;)r.tag===30?co(r.child,!1):(r.subtreeFlags&33554432)!==0&&jw(r),r=r.sibling}function jb(r,a,c,d,m,g,w){for(var I=!1;a!==null;){if(a.tag===5){var q=a.stateNode;if(g!==null&&Ci<g.length){var le=g[Ci],xe=lC(q);(le.view||xe.view)&&(I=!0);var Re;if(Re=(r.flags&4)===0)if(xe.clip)Re=!0;else{Re=le.rect;var ie=xe.rect;Re=Re.y!==ie.y||Re.x!==ie.x||Re.height!==ie.height||Re.width!==ie.width}Re&&(r.flags|=4),xe.abs?xe=!le.abs:(le=le.rect,xe=xe.rect,xe=le.height!==xe.height||le.width!==xe.width),xe&&(r.flags|=32)}else r.flags|=32;(r.flags&4)!==0&&D2(q,Ci===0?c:c+"_"+Ci,m),I&&(r.flags&4)!==0||(lo===null&&(lo=[]),lo.push(q,Ci===0?d:d+"_"+Ci,a.memoizedProps)),Ci++}else(a.tag!==22||a.memoizedState===null)&&(a.tag===30&&w?r.flags|=a.flags&32:jb(r,a.child,c,d,m,g,w)&&(I=!0));a=a.sibling}return I}function Aw(r,a){for(r=r.child;r!==null;){if(r.tag===30){var c=r.memoizedProps,d=r.stateNode,m=fa(c,d),g=L(c.default,c.update),w;w=r.memoizedState,r.memoizedState=null,d=r;var I=r.child;Ci=0,m=jb(d,I,m,m,g,w,!1),(r.flags&4)!==0&&m&&Td(r,c.onUpdate)}else(r.subtreeFlags&33554432)!==0&&Aw(r);r=r.sibling}}var xr=!1,Gn=!1,uo=!1,Ab=!1,kw=typeof WeakSet=="function"?WeakSet:Set,br=null,ho=!1,jf=!1,b0=!1,kb=!1;function h4(r,a,c){if(r=r.containerInfo,sC=Pd,r=af(r),Yc(r)){if("selectionStart"in r)var d={start:r.selectionStart,end:r.selectionEnd};else e:{d=(d=r.ownerDocument)&&d.defaultView||window;var m=d.getSelection&&d.getSelection();if(m&&m.rangeCount!==0){d=m.anchorNode;var g=m.anchorOffset,w=m.focusNode;m=m.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var I=0,q=-1,le=-1,xe=0,Re=0,ie=r,pe=null;t:for(;;){for(var Ze;ie!==d||g!==0&&ie.nodeType!==3||(q=I+g),ie!==w||m!==0&&ie.nodeType!==3||(le=I+m),ie.nodeType===3&&(I+=ie.nodeValue.length),(Ze=ie.firstChild)!==null;)pe=ie,ie=Ze;for(;;){if(ie===r)break t;if(pe===d&&++xe===g&&(q=I),pe===w&&++Re===m&&(le=I),(Ze=ie.nextSibling)!==null)break;ie=pe,pe=ie.parentNode}ie=Ze}d=q===-1||le===-1?null:{start:q,end:le}}else d=null}d=d||{start:0,end:0}}else d=null;for(rC={focusedElem:r,selectionRange:d},Pd=!1,c=(c&335544064)===c,br=a,a=c?9270:1024;br!==null;){if(r=br,c&&(d=r.deletions,d!==null))for(g=0;g<d.length;g++)c&&Tb(d[g]);if(r.alternate===null&&(r.flags&2)!==0)c&&Nw(r),C0(c);else{if(r.tag===22){if(d=r.alternate,r.memoizedState!==null){d!==null&&d.memoizedState===null&&c&&Tb(d),C0(c);continue}else if(d!==null&&d.memoizedState!==null){c&&Nw(r),C0(c);continue}}d=r.child,(r.subtreeFlags&a)!==0&&d!==null?(d.return=r,br=d):(c&&Sw(r),C0(c))}}Hi=null}function C0(r){for(;br!==null;){var a=br,c=r,d=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 15:break;case 1:if((m&1024)!==0&&d!==null){c=void 0,m=d.memoizedProps,d=d.memoizedState;var g=a.stateNode;try{var w=du(a.type,m);c=g.getSnapshotBeforeUpdate(w,d),g.__reactInternalSnapshotBeforeUpdate=c}catch(I){Jn(a,a.return,I)}}break;case 3:if((m&1024)!==0){if(d=a.stateNode.containerInfo,c=d.nodeType,c===9)dC(d);else if(c===1)switch(d.nodeName){case"HEAD":case"HTML":case"BODY":dC(d);break;default:d.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:c&&d!==null&&(c=fa(d.memoizedProps,d.stateNode),m=a.memoizedProps,m=L(m.default,m.update),m!=="none"&&Cd(d,c,m,d.memoizedState=[],!0));break;default:if((m&1024)!==0)throw Error(s(163))}if(d=a.sibling,d!==null){d.return=a.return,br=d;break}br=a.return}}function Rw(r,a,c){var d=c.flags;switch(c.tag){case 0:case 11:case 15:fo(r,c),d&4&&Tf(5,c);break;case 1:if(fo(r,c),d&4)if(r=c.stateNode,a===null)try{r.componentDidMount()}catch(w){Jn(c,c.return,w)}else{var m=du(c.type,a.memoizedProps);a=a.memoizedState;try{r.componentDidUpdate(m,a,r.__reactInternalSnapshotBeforeUpdate)}catch(w){Jn(c,c.return,w)}}d&64&&yw(c),d&512&&oo(c,c.return);break;case 3:if(fo(r,c),d&64&&(r=c.updateQueue,r!==null)){if(a=null,c.child!==null)switch(c.child.tag){case 27:case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}try{u_(r,a)}catch(w){Jn(c,c.return,w)}}break;case 27:a===null&&d&4&&Ew(c);case 26:case 5:fo(r,c),a===null&&d&4&&vb(c),d&512&&oo(c,c.return);break;case 12:fo(r,c);break;case 31:fo(r,c),d&4&&Mw(r,c);break;case 13:fo(r,c),d&4&&Pw(r,c),d&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=w4.bind(null,c),i3(r,c))));break;case 22:if(d=c.memoizedState!==null||xr,!d){var g=a!==null&&a.memoizedState!==null||Gn;a=xr,m=Gn,xr=d,(Gn=g)&&!m?(d=2,(c.subtreeFlags&8772)!==0&&(d|=1),Oa(r,c,d)):fo(r,c),xr=a,Gn=m}break;case 30:fo(r,c),d&512&&oo(c,c.return);break;case 7:d&512&&oo(c,c.return);default:fo(r,c)}}function Rb(r,a){for(r=r.child;r!==null;)Iw(r,a),r=r.sibling}function Iw(r,a){switch(r.tag){case 5:case 26:try{var c=r.stateNode;if(a){var d=c.style;typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none"}else{var m=r.stateNode,g=r.memoizedProps.style,w=g!=null&&g.hasOwnProperty("display")?g.display:null;m.style.display=w==null||typeof w=="boolean"?"":(""+w).trim()}}catch(q){Jn(r,r.return,q)}Ib(r,a);break;case 6:try{r.stateNode.nodeValue=a?"":r.memoizedProps,Lt=!0}catch(q){Jn(r,r.return,q)}break;case 18:try{var I=r.stateNode;a?N2(I,!0):N2(r.stateNode,!1)}catch(q){Jn(r,r.return,q)}break;case 22:case 23:r.memoizedState===null&&Rb(r,a);break;default:Rb(r,a)}}function Ib(r,a){if(r.subtreeFlags&67108864)for(r=r.child;r!==null;){e:{var c=r,d=a;switch(c.tag){case 4:Iw(c,d);break e;case 22:c.memoizedState===null&&Ib(c,d);break e;default:Ib(c,d)}}r=r.sibling}}function Ow(r){var a=r.alternate;a!==null&&(r.alternate=null,Ow(a)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(a=r.stateNode,a!==null&&dt(a)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var ys=null,yi=!1;function Ra(r,a,c){for(c=c.child;c!==null;)Lw(r,a,c),c=c.sibling}function Lw(r,a,c){if(de&&typeof de.onCommitFiberUnmount=="function")try{de.onCommitFiberUnmount(Vn,c)}catch{}switch(c.tag){case 26:Gn||kr(c,a),Ra(r,a,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&!Gn&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:Gn||kr(c,a),Sf(c);var d=ys,m=yi;Wl(c.type)&&(ys=c.stateNode,yi=!1),Ra(r,a,c),F2(c.stateNode,c.type,c.memoizedProps),ys=d,yi=m;break;case 5:Gn||kr(c,a),Sf(c);case 6:if(c.tag===6&&Sf(c),d=ys,m=yi,ys=null,Ra(r,a,c),ys=d,yi=m,ys!==null)if(yi)try{(ys.nodeType===9?ys.body:ys.nodeName==="HTML"?ys.ownerDocument.body:ys).removeChild(c.stateNode),Lt=!0}catch(g){Jn(c,a,g)}else try{ys.removeChild(c.stateNode),Lt=!0}catch(g){Jn(c,a,g)}break;case 18:ys!==null&&(yi?(r=ys,E2(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),zd(r)):E2(ys,c.stateNode));break;case 4:d=ys,m=yi,ys=c.stateNode.containerInfo,yi=!0,Ra(r,a,c),ys=d,yi=m;break;case 0:case 11:case 14:case 15:ql(2,c,a),Gn||ql(4,c,a),Ra(r,a,c);break;case 1:Gn||(kr(c,a),d=c.stateNode,typeof d.componentWillUnmount=="function"&&vw(c,a,d)),Ra(r,a,c);break;case 21:Ra(r,a,c);break;case 22:Gn=(d=Gn)||c.memoizedState!==null,Ra(r,a,c),Gn=d;break;case 30:kr(c,a),Ra(r,a,c);break;case 7:Gn||kr(c,a),Ra(r,a,c);break;default:Ra(r,a,c)}}function Mw(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{zd(r)}catch(c){Jn(a,a.return,c)}}}function Pw(r,a){if(a.memoizedState===null&&(r=a.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{zd(r)}catch(c){Jn(a,a.return,c)}}function f4(r){switch(r.tag){case 31:case 13:case 19:var a=r.stateNode;return a===null&&(a=r.stateNode=new kw),a;case 22:return r=r.stateNode,a=r._retryCache,a===null&&(a=r._retryCache=new kw),a;default:throw Error(s(435,r.tag))}}function y0(r,a){var c=f4(r);a.forEach(function(d){if(!c.has(d)){c.add(d);var m=E4.bind(null,r,d);d.then(m,m)}})}function ri(r,a,c){var d=a.deletions;if(d!==null)for(var m=0;m<d.length;m++){var g=d[m],w=r,I=a,q=I;e:for(;q!==null;){switch(q.tag){case 27:if(Wl(q.type)){ys=q.stateNode,yi=!1;break e}break;case 5:ys=q.stateNode,yi=!1;break e;case 3:case 4:ys=q.stateNode.containerInfo,yi=!0;break e}q=q.return}if(ys===null)throw Error(s(160));Lw(w,I,g),ys=null,yi=!1,w=g.alternate,w!==null&&(w.return=null),g.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)zw(a,r,c),a=a.sibling}var Ia=null;function zw(r,a,c){var d=r.alternate,m=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(m&4&&(d=r.updateQueue,d=d!==null?d.events:null,d!==null))for(var g=0;g<d.length;g++){var w=d[g];w.ref.impl=w.nextImpl}ri(a,r,c),ii(r),m&4&&(ql(3,r,r.return),Tf(3,r),ql(5,r,r.return));break;case 1:ri(a,r,c),ii(r),m&512&&(Gn||d===null||kr(d,d.return)),m&64&&xr&&(r=r.updateQueue,r!==null&&(a=r.callbacks,a!==null&&(c=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=c===null?a:c.concat(a))));break;case 26:if(g=Ia,ri(a,r,c),ii(r),m&512&&(Gn||d===null||kr(d,d.return)),m&4)if(m=d!==null?d.memoizedState:null,c=r.memoizedState,d===null)if(c===null)if(r.stateNode===null)if(xr)r.stateNode=v2(r.type,r.memoizedProps,a.containerInfo,r);else{e:{a=r.type,c=r.memoizedProps,m=g.ownerDocument||g;t:switch(a){case"title":d=m.getElementsByTagName("title")[0],(!d||d[Ce]||d[Xn]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=m.createElement(a),m.head.insertBefore(d,m.querySelector("head >
48 title"))),Rr(d,a,c),d[Xn]=r,ts(d),a=d;break e;case"link":if(g=$2("link","href",m).get(a+(c.href||""))){for(w=0;w<g.length;w++)if(d=g[w],d.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&d.getAttribute("rel")===(c.rel==null?null:c.rel)&&d.getAttribute("title")===(c.title==null?null:c.title)&&d.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){g.splice(w,1);break t}}d=m.createElement(a),Rr(d,a,c),m.head.appendChild(d);break;case"meta":if(g=$2("meta","content",m).get(a+(c.content||""))){for(w=0;w<g.length;w++)if(d=g[w],d.getAttribute("content")===(c.content==null?null:""+c.content)&&d.getAttribute("name")===(c.name==null?null:c.name)&&d.getAttribute("property")===(c.property==null?null:c.property)&&d.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&d.getAttribute("charset")===(c.charSet==null?null:c.charSet)){g.splice(w,1);break t}}d=m.createElement(a),Rr(d,a,c),m.head.appendChild(d);break;default:throw Error(s(468,a))}d[Xn]=r,ts(d),a=d}r.stateNode=a}else xr||xC(g,r.type,r.stateNode);else r.stateNode=q2(g,c,r.memoizedProps);else m!==c?(m===null?(a=d.stateNode,a===null||Gn||a.parentNode.removeChild(a)):m.count--,c===null?xr||xC(g,r.type,r.stateNode):q2(g,c,r.memoizedProps)):c===null&&r.stateNode!==null&&_b(r,r.memoizedProps,d.memoizedProps);break;case 27:ri(a,r,c),ii(r),m&512&&(Gn||d===null||kr(d,d.return)),d!==null&&m&4&&_b(r,r.memoizedProps,d.memoizedProps);break;case 5:if(g=uo,uo=!1,ri(a,r,c),uo=g,ii(r),m&512&&(Gn||d===null||kr(d,d.return)),r.flags&32){a=r.stateNode;try{_n(a,""),Lt=!0}catch(xe){Jn(r,r.return,xe)}}m&4&&r.stateNode!=null&&(a=r.memoizedProps,_b(r,a,d!==null?d.memoizedProps:a)),m&1024&&(Ab=!0);break;case 6:if(ri(a,r,c),ii(r),m&4){if(r.stateNode===null)throw Error(s(162));a=r.memoizedProps,c=r.stateNode;try{c.nodeValue=a,Lt=!0}catch(xe){Jn(r,r.return,xe)}}break;case 3:if(Lt=!1,L0=null,g=Ia,Ia=zf(a.containerInfo),ri(a,r,c),Ia=g,ii(r),m&4&&d!==null&&d.memoizedState.isDehydrated)try{zd(a.containerInfo)}catch(xe){Jn(r,r.return,xe)}Ab&&(Ab=!1,Fw(r)),Lt=!1;break;case 4:m=uo,uo=xr,d=Dl(),g=Ia,Ia=zf(r.stateNode.containerInfo),ri(a,r,c),ii(r),Ia=g,Lt&&jf&&(b0=!0),Lt=d,uo=m;break;case 12:ri(a,r,c),ii(r);break;case 31:ri(a,r,c),ii(r),m&4&&(a=r.updateQueue,a!==null&&(r.updateQueue=null,y0(r,a)));break;case 13:ri(a,r,c),ii(r),r.child.flags&8192&&r.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(w0=Et()),m&4&&(a=r.updateQueue,a!==null&&(r.updateQueue=null,y0(r,a)));break;case 22:g=r.memoizedState!==null,w=d!==null&&d.memoizedState!==null;var I=xr,q=Gn,le=uo;xr=I||g,uo=le||g,Gn=q||w,ri(a,r,c),Gn=q,uo=le,xr=I,ii(r),m&8192&&(a=r.stateNode,a._visibility=g?a._visibility&-2:a._visibility|1,!g||d===null||w||xr||Gn||(a=w||Gn,c=xr,d=Gn,xr=g||xr,Gn=a,$l(r,2),xr=c,Gn=d),!g&&uo||Rb(r,g)),m&4&&(a=r.updateQueue,a!==null&&(c=a.retryQueue,c!==null&&(a.retryQueue=null,y0(r,c))));break;case 19:ri(a,r,c),ii(r),m&4&&(a=r.updateQueue,a!==null&&(r.updateQueue=null,y0(r,a)));break;case 30:m&512&&(Gn||d===null||kr(d,d.return)),m=Dl(),g=jf,w=(c&335544064)===c,I=r.memoizedProps,jf=w&&L(I.default,I.update)!=="none",ri(a,r,c),ii(r),w&&d!==null&&Lt&&(r.flags|=4),jf=g,Lt=m;break;case 21:break;case 7:m&512&&(Gn||d===null||kr(d,d.return)),d&&d.stateNode!==null&&(d.stateNode._fragmentFiber=r);default:ri(a,r,c),ii(r)}}function ii(r){var a=r.flags;if(a&2){try{for(var c,d=r.return;d!==null;){if(ww(d)){c=d;break}d=d.return}d=null;for(var m=r.return;m!==null;){if(yb(m)){var g=m.stateNode;d===null?d=[g]:d.push(g)}if(Cb(m))break;m=m.return}var w=d;if(c==null)throw Error(s(160));switch(c.tag){case 27:var I=c.stateNode,q=wb(r);p0(r,q,I,w);break;case 5:var le=c.stateNode;c.flags&32&&(_n(le,""),c.flags&=-33);var xe=wb(r);p0(r,xe,le,w);break;case 3:case 4:var Re=c.stateNode.containerInfo,ie=wb(r);Eb(r,ie,Re,w);break;default:throw Error(s(161))}}catch(pe){Jn(r,r.return,pe)}r.flags&=-3}a&4096&&(r.flags&=-4097)}function Fw(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var a=r;Fw(a),a.tag===5&&a.flags&1024&&(a=a.stateNode,Pd=!0,a.reset(),Pd=!1),r=r.sibling}}function yd(r,a){if(a.subtreeFlags&9270)for(a=a.child;a!==null;)Vw(a,r),a=a.sibling;else Aw(a)}function Vw(r,a){var c=r.alternate;if(c===null)Nb(r,!1);else switch(r.tag){case 3:if(kb=ho=!1,Dw(),yd(a,r),!ho&&!b0){if(r=lo,r!==null)for(var d=0;d<r.length;d+=3){c=r[d];var m=r[d+1];T2(c,r[d+2]),c=c.ownerDocument.documentElement,c!==null&&c.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+m+")"})}r=a.containerInfo,r=r.nodeType===9?r.documentElement:r.ownerDocument.documentElement,r!==null&&r.style.viewTransitionName===""&&(r.style.viewTransitionName="none",r.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),r.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),kb=!0}lo=null;break;case 5:yd(a,r);break;case 4:d=ho,ho=!1,yd(a,r),ho&&(b0=!0),ho=d;break;case 22:r.memoizedState===null&&(c.memoizedState!==null?Nb(r,!1):yd(a,r));break;case 30:d=ho,m=Dw(),ho=!1,yd(a,r),ho&&(r.flags|=4);var g=r.memoizedProps,w=r.stateNode;a=fa(g,w),w=fa(c.memoizedProps,w);var I=L(g.default,g.update);I==="none"?a=!1:(g=c.memoizedState,c.memoizedState=null,c=r.child,Ci=0,a=jb(r,c,a,w,I,g,!0),Ci!==(g===null?0:g.length)&&(r.flags|=32)),(r.flags&4)!==0&&a?(Td(r,r.memoizedProps.onUpdate),lo=m):m!==null&&(m.push.apply(m,lo),lo=m),ho=(r.flags&32)!==0?!0:d;break;default:yd(a,r)}}function fo(r,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)Rw(r,a.alternate,a),a=a.sibling}function $l(r,a){for(r=r.child;r!==null;){var c=r,d=a;switch(c.tag){case 0:case 11:case 14:case 15:ql(4,c,c.return),$l(c,d);break;case 1:kr(c,c.return);var m=c.stateNode;typeof m.componentWillUnmount=="function"&&vw(c,c.return,m),$l(c,d);break;case 27:(d&2)!==0&&F2(c.stateNode,c.type,c.memoizedProps);case 5:kr(c,c.return),c.tag!==5&&c.tag!==27||Sf(c),$l(c,d);break;case 6:Sf(c);break;case 26:kr(c,c.return),m=c.stateNode,c.memoizedState!==null||m===null||Gn||m.parentNode.removeChild(m),$l(c,d);break;case 22:c.memoizedState===null&&$l(c,d);break;case 30:kr(c,c.return),$l(c,d);break;case 7:kr(c,c.return);default:$l(c,d)}r=r.sibling}}function Oa(r,a,c){for(c=(a.subtreeFlags&8772)!==0?c:c&-2,a=a.child;a!==null;){var d=a.alternate,m=r,g=a,w=g.flags,I=(c&1)!==0;switch(g.tag){case 0:case 11:case 15:Oa(m,g,c),Tf(4,g);break;case 1:if(Oa(m,g,c),d=g,m=d.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(xe){Jn(d,d.return,xe)}if(d=g,m=d.updateQueue,m!==null){var q=d.stateNode;try{var le=m.shared.hiddenCallbacks;
vendor: 16,994 bytes, line 48
48if(le!==null)for(m.shared.hiddenCallbacks=null,m=0;m<le.length;m++)c_(le[m],q)}catch(xe){Jn(d,d.return,xe)}}I&&w&64&&yw(g),oo(g,g.return);break;case 27:(c&2)!==0&&Ew(g);case 5:g.tag!==5&&g.tag!==27||_w(g),Oa(m,g,c),I&&d===null&&w&4&&vb(g),oo(g,g.return);break;case 6:_w(g);break;case 26:q=g.stateNode,g.memoizedState!==null||q===null||xr||xC(zf(q.ownerDocument),g.type,q),Oa(m,g,c),I&&d===null&&w&4&&vb(g),oo(g,g.return);break;case 12:Oa(m,g,c);break;case 31:Oa(m,g,c),I&&w&4&&Mw(m,g);break;case 13:Oa(m,g,c),I&&w&4&&Pw(m,g);break;case 22:g.memoizedState===null&&Oa(m,g,c),oo(g,g.return);break;case 30:Oa(m,g,c),oo(g,g.return);break;case 7:oo(g,g.return);default:Oa(m,g,c)}a=a.sibling}}function Ob(r,a){var c=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),r=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==c&&(r!=null&&r.refCount++,c!=null&&pf(c))}function Lb(r,a){r=null,a.alternate!==null&&(r=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==r&&(a.refCount++,r!=null&&pf(r))}function ga(r,a,c,d){var m=(c&335544064)===c;if(a.subtreeFlags&(m?10262:10256))for(a=a.child;a!==null;)Uw(r,a,c,d),a=a.sibling;else m&&jw(a)}function Uw(r,a,c,d){var m=(c&335544064)===c;m&&a.alternate===null&&a.return!==null&&a.return.alternate!==null&&x0(a);var g=a.flags;switch(a.tag){case 0:case 11:case 15:ga(r,a,c,d),g&2048&&Tf(9,a);break;case 1:ga(r,a,c,d);break;case 3:ga(r,a,c,d),m&&kb&&(r=r.containerInfo,r=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,r.style.viewTransitionName==="root"&&(r.style.viewTransitionName=""),r=r.ownerDocument.documentElement,r!==null&&r.style.viewTransitionName==="none"&&(r.style.viewTransitionName="")),g&2048&&(g=null,a.alternate!==null&&(g=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==g&&(a.refCount++,g!=null&&pf(g)));break;case 12:if(g&2048){ga(r,a,c,d),g=a.stateNode;try{var w=a.memoizedProps,I=w.id,q=w.onPostCommit;typeof q=="function"&&q(I,a.alternate===null?"mount":"update",g.passiveEffectDuration,-0)}catch(le){Jn(a,a.return,le)}}else ga(r,a,c,d);break;case 31:ga(r,a,c,d);break;case 13:ga(r,a,c,d);break;case 23:break;case 22:w=a.stateNode,I=a.alternate,a.memoizedState!==null?(m&&I!==null&&I.memoizedState===null&&x0(I),w._visibility&2?ga(r,a,c,d):Af(r,a)):(m&&I!==null&&I.memoizedState!==null&&x0(a),w._visibility&2?ga(r,a,c,d):(w._visibility|=2,vd(r,a,c,d,(a.subtreeFlags&10256)!==0||!1))),g&2048&&Ob(I,a);break;case 24:ga(r,a,c,d),g&2048&&Lb(a.alternate,a);break;case 30:m&&(g=a.alternate,g!==null&&(co(g.child,!0),co(a.child,!0))),ga(r,a,c,d);break;default:ga(r,a,c,d)}}function vd(r,a,c,d,m){for(m=m&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var g=r,w=a,I=c,q=d,le=w.flags;switch(w.tag){case 0:case 11:case 15:vd(g,w,I,q,m),Tf(8,w);break;case 23:break;case 22:var xe=w.stateNode;w.memoizedState!==null?xe._visibility&2?vd(g,w,I,q,m):Af(g,w):(xe._visibility|=2,vd(g,w,I,q,m)),m&&le&2048&&Ob(w.alternate,w);break;case 24:vd(g,w,I,q,m),m&&le&2048&&Lb(w.alternate,w);break;default:vd(g,w,I,q,m)}a=a.sibling}}function Af(r,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var c=r,d=a,m=d.flags;switch(d.tag){case 22:Af(c,d),m&2048&&Ob(d.alternate,d);break;case 24:Af(c,d),m&2048&&Lb(d.alternate,d);break;default:Af(c,d)}a=a.sibling}}var hu=8192;function fu(r,a,c){if(r.subtreeFlags&hu)for(r=r.child;r!==null;)Gw(r,a,c),r=r.sibling}function Gw(r,a,c){switch(r.tag){case 26:fu(r,a,c),r.flags&hu&&(r.memoizedState!==null?b3(c,Ia,r.memoizedState,r.memoizedProps):(r=r.stateNode,(a&335544128)===a&&Y2(c,r)));break;case 5:fu(r,a,c),r.flags&hu&&(r=r.stateNode,(a&335544128)===a&&Y2(c,r));break;case 3:case 4:var d=Ia;Ia=zf(r.stateNode.containerInfo),fu(r,a,c),Ia=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=hu,hu=16777216,fu(r,a,c),hu=d):fu(r,a,c));break;case 30:if((r.flags&hu)!==0&&(d=r.memoizedProps.name,d!=null&&d!=="auto")){var m=r.stateNode;m.paired=null,Hi===null&&(Hi=new Map),Hi.set(d,m)}fu(r,a,c);break;default:fu(r,a,c)}}function Hw(r){var a=r.alternate;if(a!==null&&(r=a.child,r!==null)){a.child=null;do a=r.sibling,r.sibling=null,r=a;while(r!==null)}}function kf(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var d=a[c];br=d,$w(d,r)}Hw(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)qw(r),r=r.sibling}function qw(r){switch(r.tag){case 0:case 11:case 15:kf(r),r.flags&2048&&ql(9,r,r.return);break;case 3:kf(r);break;case 12:kf(r);break;case 22:var a=r.stateNode;r.memoizedState!==null&&a._visibility&2&&(r.return===null||r.return.tag!==13)?(a._visibility&=-3,v0(r)):kf(r);break;default:kf(r)}}function v0(r){var a=r.deletions;if((r.flags&16)!==0){if(a!==null)for(var c=0;c<a.length;c++){var d=a[c];br=d,$w(d,r)}Hw(r)}for(r=r.child;r!==null;){switch(a=r,a.tag){case 0:case 11:case 15:ql(8,a,a.return),v0(a);break;case 22:c=a.stateNode,c._visibility&2&&(c._visibility&=-3,v0(a));break;default:v0(a)}r=r.sibling}}function $w(r,a){for(;br!==null;){var c=br;switch(c.tag){case 0:case 11:case 15:ql(8,c,a);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var d=c.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:pf(c.memoizedState.cache)}if(d=c.child,d!==null)d.return=c,br=d;else e:for(c=r;br!==null;){d=br;var m=d.sibling,g=d.return;if(Ow(d),d===c){br=null;break e}if(m!==null){m.return=g,br=m;break e}br=g}}}var m4={getCacheForType:function(r){var a=Sr(Ys),c=a.data.get(r);return c===void 0&&(c=r(),a.data.set(r,c)),c},cacheSignal:function(){return Sr(Ys).controller.signal}},p4=typeof WeakMap=="function"?WeakMap:Map,Mn=0,ss=null,cn=null,mn=0,$n=0,qi=null,Jl=!1,_d=!1,Mb=!1,el=0,Ps=0,Kl=0,mu=0,_0=0,$i=0,wd=0,Rf=null,vi=null,Pb=!1,w0=0,Jw=0,E0=1/0,N0=null,Ql=null,Ts=0,La=null,pu=null,mo=0,zb=0,Fb=null,Kw=null,Ed=null,Nd=null,Dd=null,If=0,D0=null;function Ji(){return(Mn&2)!==0&&mn!==0?mn&-mn:Qe.T!==null?Yb():ia()}function Qw(){if($i===0)if((mn&536870912)===0||tn){var r=Un;Un<<=1,(Un&3932160)===0&&(Un=262144),$i=r}else $i=536870912;return r=jr.current,r!==null&&(r.flags|=32),$i}function Td(r,a){if(a!=null){var c=r.stateNode,d=c.ref;d===null&&(d=c.ref=S2(fa(r.memoizedProps,c))),Nd===null&&(Nd=[]),Nd.push(a.bind(null,d))}}function _i(r,a,c){(r===ss&&($n===2||$n===9)||r.cancelPendingCommit!==null)&&(Sd(r,0),Yl(r,mn,$i,!1)),Is(r,c),((Mn&2)===0||r!==ss)&&(r===ss&&((Mn&2)===0&&(mu|=c),Ps===4&&Yl(r,mn,$i,!1)),po(r))}function Yw(r,a,c){if((Mn&6)!==0)throw Error(s(327));var d=!c&&(a&127)===0&&(a&r.expiredLanes)===0||ee(r,a),m=d?x4(r,a):Ub(r,a,!0),g=d;do{if(m===0){_d&&!d&&Yl(r,a,0,!1);break}else{if(c=r.current.alternate,g&&!B4(c)){m=Ub(r,a,!1),g=!1;continue}if(m===2){if(g=a,r.errorRecoveryDisabledLanes&g)var w=0;else w=r.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){a=w;e:{var I=r;m=Rf;var q=I.current.memoizedState.isDehydrated;if(q&&(Sd(I,w).flags|=256),w=Ub(I,w,!1),w!==2&&w!==6){if(Mb&&!q){I.errorRecoveryDisabledLanes|=g,mu|=g,m=4;break e}g=vi,vi=m,g!==null&&(vi===null?vi=g:vi.push.apply(vi,g))}m=w}if(g=!1,m!==2)continue}}if(m===1){Sd(r,0),Yl(r,a,0,!0);break}e:{switch(d=r,g=m,g){case 0:case 1:throw Error(s(345));case 4:if((a&4194048)!==a&&(a&62914560)!==a)break;case 6:Yl(d,a,$i,!Jl);break e;case 2:vi=null;break;case 3:case 5:break;default:throw Error(s(329))}if((a&62914560)===a&&(m=w0+300-Et(),10<m)){if(Yl(d,a,$i,!Jl),Nr(d,0,!0)!==0)break e;mo=a,d.timeoutHandle=oC(Xw.bind(null,d,c,vi,N0,Pb,a,$i,mu,wd,Jl,g,"Throttled",-0,0),m);break e}Xw(d,c,vi,N0,Pb,a,$i,mu,wd,Jl,g,null,-0,0)}}break}while(!0);po(r)}function Xw(r,a,c,d,m,g,w,I,q,le,xe,Re,ie,pe){r.timeoutHandle=-1;var Ze=a.subtreeFlags,ht=(g&335544064)===g;if(Re=null,(ht||Ze&8192||(Ze&16785408)===16785408)&&(Re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:zr},Hi=null,Gw(a,g,Re),ht&&(Ze=Re,ht=r.containerInfo,ht=(ht.nodeType===9?ht:ht.ownerDocument).__reactViewTransition,ht!=null&&(Ze.count++,Ze.waitingForViewTransition=!0,Ze=Uf.bind(Ze),ht.finished.then(Ze,Ze))),Ze=(g&62914560)===g?w0-Et():(g&4194048)===g?Jw-Et():0,Ze=C3(Re,Ze),Ze!==null)){mo=g,r.cancelPendingCommit=Ze(i2.bind(null,r,a,g,c,d,m,w,I,q,le,xe,Re,null,ie,pe)),Yl(r,g,w,!le);return}i2(r,a,g,c,d,m,w,I,q,le,xe,Re)}function B4(r){for(var a=r;;){var c=a.tag;if((c===0||c===11||c===15)&&a.flags&16384&&(c=a.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var d=0;d<c.length;d++){var m=c[d],g=m.getSnapshot;m=m.value;try{if(!ti(g(),m))return!1}catch{return!1}}if(c=a.child,a.subtreeFlags&16384&&c!==null)c.return=a,a=c;else{if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Yl(r,a,c,d){a=ve(r,a),a&=~_0,a&=~mu,r.suspendedLanes|=a,r.pingedLanes&=~a,d&&(r.warmLanes|=a),d=r.expirationTimes;for(var m=a;0<m;){var g=31-Ut(m),w=1<<g;d[g]=-1,m&=~w}c!==0&&Pr(r,c,a)}function T0(){return(Mn&6)===0?(Of(0),!1):!0}function Vb(){if(cn!==null){if($n===0)var r=cn.return;else r=cn,Ko=nu=null,Qx(r),pd=null,xf=0,r=cn;for(;r!==null;)Cw(r.alternate,r),r=r.return;cn=null}}function Sd(r,a){var c=r.timeoutHandle;return c!==-1&&(r.timeoutHandle=-1,F4(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),mo=0,Vb(),ss=r,cn=c=dr(r.current,null),mn=a,$n=0,qi=null,Jl=!1,_d=ee(r,a),Mb=!1,wd=$i=_0=mu=Kl=Ps=0,vi=Rf=null,Pb=!1,el=ve(r,a),X(),c}function Ww(r,a){Xt=null,Qe.H=o0,a===md||a===Jp?(a=i_(),$n=3):a===Lx?(a=i_(),$n=4):$n=a===ub?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,qi=a,cn===null&&(Ps=1,l0(r,xi(a,r.current)))}function Zw(){var r=jr.current;return r===null?!0:(mn&4194048)===mn?Ur===null:(mn&62914560)===mn||(mn&536870912)!==0?r===Ur:!1}function e2(){var r=Qe.H;return Qe.H=o0,r===null?o0:r}function t2(){var r=Qe.A;return Qe.A=m4,r}function S0(){Ps=4,Jl||(mn&4194048)!==mn&&jr.current!==null||(_d=!0),(Kl&134217727)===0&&(mu&134217727)===0||ss===null||Yl(ss,mn,$i,!1)}function Ub(r,a,c){var d=Mn;Mn|=2;var m=e2(),g=t2();(ss!==r||mn!==a)&&(N0=null,Sd(r,a)),a=!1;var w=Ps;e:do try{if($n!==0&&cn!==null){var I=cn,q=qi;switch($n){case 8:Vb(),w=6;break e;case 3:case 2:case 9:case 6:jr.current===null&&(a=!0);var le=$n;if($n=0,qi=null,jd(r,I,q,le),c&&_d){w=0;break e}break;default:le=$n,$n=0,qi=null,jd(r,I,q,le)}}g4(),w=Ps;break}catch(xe){Ww(r,xe)}while(!0);return a&&r.shellSuspendCounter++,Ko=nu=null,Mn=d,Qe.H=m,Qe.A=g,cn===null&&(ss=null,mn=0,X()),w}function g4(){for(;cn!==null;)n2(cn)}function x4(r,a){var c=Mn;Mn|=2;var d=e2(),m=t2();ss!==r||mn!==a?(N0=null,E0=Et()+500,Sd(r,a)):_d=ee(r,a);e:do try{if($n!==0&&cn!==null){a=cn;var g=qi;t:switch($n){case 1:$n=0,qi=null,jd(r,a,g,1);break;case 2:case 9:if(s_(g)){$n=0,qi=null,s2(a);break}a=function(){$n!==2&&$n!==9||ss!==r||($n=7),po(r)},g.then(a,a);break e;case 3:$n=7;break e;case 4:$n=5;break e;case 7:s_(g)?($n=0,qi=null,s2(a)):($n=0,qi=null,jd(r,a,g,7));break;case 5:var w=null;switch(cn.tag){case 26:w=cn.memoizedState;case 5:case 27:var I=cn;if(w?K2(w):I.stateNode.complete){$n=0,qi=null;var q=I.sibling;if(q!==null)cn=q;else{var le=I.return;le!==null?(cn=le,j0(le)):cn=null}break t}}$n=0,qi=null,jd(r,a,g,5);break;case 6:$n=0,qi=null,jd(r,a,g,6);break;case 8:Vb(),Ps=6;break e;default:throw Error(s(462))}}b4();break}catch(xe){Ww(r,xe)}while(!0);return Ko=nu=null,Qe.H=d,Qe.A=m,Mn=c,cn!==null?0:(ss=null,mn=0,X(),Ps)}function b4(){for(;cn!==null&&!Vt();)n2(cn)}function n2(r){var a=xw(r.alternate,r,el);r.memoizedProps=r.pendingProps,a===null?j0(r):cn=a}function s2(r){var a=r,c=a.alternate;switch(a.tag){case 15:case 0:a=dw(c,a,a.pendingProps,a.type,void 0,mn);break;case 11:a=dw(c,a,a.pendingProps,a.type.render,a.ref,mn);break;case 5:Qx(a);var d=a;d===wn&&(tn?(Up(d),d.tag===5&&d.stateNode!=null&&(Cn=d.stateNode)):(Up(d),tn=!0));default:Cw(c,a),a=cn=Vp(a,el),a=xw(c,a,el)}r.memoizedProps=r.pendingProps,a===null?j0(r):cn=a}function jd(r,a,c,d){Ko=nu=null,Qx(a),pd=null,xf=0;var m=a.return;try{if(a4(r,m,a,c,mn)){Ps=1,l0(r,xi(c,r.current)),cn=null;return}}catch(g){if(m!==null)throw cn=m,g;Ps=1,l0(r,xi(c,r.current)),cn=null;return}a.flags&32768?(tn||d===1?r=!0:_d||(mn&536870912)!==0?r=!1:(Jl=r=!0,(d===2||d===9||d===3||d===6)&&(d=jr.current,d!==null&&d.tag===13&&(d.flags|=16384))),r2(a,r)):j0(a)}function j0(r){var a=r;do{if((a.flags&32768)!==0){r2(a,Jl);return}r=a.return;var c=u4(a.alternate,a,el);if(c!==null){cn=c;return}if(a=a.sibling,a!==null){cn=a;return}cn=a=r}while(a!==null);Ps===0&&(Ps=5)}function r2(r,a){do{var c=d4(r.alternate,r);if(c!==null){c.flags&=32767,cn=c;return}if(c=r.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!a&&(r=r.sibling,r!==null)){cn=r;return}cn=r=c}while(r!==null);Ps=6,cn=null}function i2(r,a,c,d,m,g,w,I,q,le,xe,Re){r.cancelPendingCommit=null;do A0();while(Ts!==0);if((Mn&6)!==0)throw Error(s(327));if(a!==null){if(a===r.current)throw Error(s(177));r===ss&&(cn=ss=null,mn=0),pu=a,La=r,mo=c,Fb=m,Kw=d,C4(r,a,c,w,I,q,Re)}}function C4(r,a,c,d,m,g,w){var I=a.lanes|a.childLanes;if(zb=I,I|=We,fs(r,c,I,d,m,g),Nd=null,(c&335544064)===c?(Dd=KA(r),d=10262):(Dd=null,d=10256),(a.subtreeFlags&d)!==0||(a.flags&d)!==0?(r.callbackNode=null,r.callbackPriority=0,N4(rn,function(){return $b(),null})):(r.callbackNode=null,r.callbackPriority=0),B0=!1,d=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||d){d=Qe.T,Qe.T=null,m=st.p,st.p=2,g=Mn,Mn|=4;try{h4(r,a,c)}finally{Mn=g,st.p=m,Qe.T=d}}Ts=1,B0?Ed=$4(w,r.containerInfo,Dd,Gb,Hb,v4,qb,$b,y4):(Gb(),Hb(),qb())}function y4(r){if(Ts!==0){var a=La.onRecoverableError;a(r,{componentStack:null})}}function v4(){Ts===3&&(Ts=0,Vw(pu,La),Ts=4)}function Gb(){if(Ts===1){Ts=0;var r=La,a=pu,c=mo,d=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||d){d=Qe.T,Qe.T=null;var m=st.p;st.p=2;var g=Mn;Mn|=4;try{jf=b0=!1,zw(a,r,c),c=rC;var w=af(r.containerInfo),I=c.focusedElem,q=c.selectionRange;if(w!==I&&I&&I.ownerDocument&&rf(I.ownerDocument.documentElement,I)){if(q!==null&&Yc(I)){var le=q.start,xe=q.end;if(xe===void 0&&(xe=le),"selectionStart"in I)I.selectionStart=le,I.selectionEnd=Math.min(xe,I.value.length);else{var Re=I.ownerDocument||document,ie=Re&&Re.defaultView||window;if(ie.getSelection){var pe=ie.getSelection(),Ze=I.textContent.length,ht=Math.min(q.start,Ze),Wt=q.end===void 0?ht:Math.min(q.end,Ze);!pe.extend&&ht>Wt&&(w=Wt,Wt=ht,ht=w);var oe=Mp(I,ht),Z=Mp(I,Wt);if(oe&&Z&&(pe.rangeCount!==1||pe.anchorNode!==oe.node||pe.anchorOffset!==oe.offset||pe.focusNode!==Z.node||pe.focusOffset!==Z.offset)){var ue=Re.createRange();ue.setStart(oe.node,oe.offset),pe.removeAllRanges(),ht>Wt?(pe.addRange(ue),pe.extend(Z.node,Z.offset)):(ue.setEnd(Z.node,Z.offset),pe.addRange(ue))}}}}for(Re=[],pe=I;pe=pe.parentNode;)pe.nodeType===1&&Re.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<Re.length;I++){var ke=Re[I];ke.element.scrollLeft=ke.left,ke.element.scrollTop=ke.top}}Pd=!!sC,rC=sC=null}finally{Mn=g,st.p=m,Qe.T=d}}r.current=a,Ts=2}}function Hb(){if(Ts===2){Ts=0;var r=La,a=pu,c=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||c){c=Qe.T,Qe.T=null;var d=st.p;st.p=2;var m=Mn;Mn|=4;try{Rw(r,a.alternate,a)}finally{Mn=m,st.p=d,Qe.T=c}}Ts=3}}function qb(){if(Ts===4||Ts===3){Ts=0;var r=Ed;Ed=null,at();var a=La,c=pu,d=mo,m=Kw,g=(d&335544064)===d?10262:10256;if((c.subtreeFlags&g)!==0||(c.flags&g)!==0?Ts=5:(Ts=0,pu=La=null,a2(a,a.pendingLanes)),g=a.pendingLanes,g===0&&(Ql=null),Yr(d),c=c.stateNode,de&&typeof de.onCommitFiberRoot=="function")try{de.onCommitFiberRoot(Vn,c,void 0,(c.current.flags&128)===128)}catch{}if(m!==null){c=Qe.T,g=st.p,st.p=2,Qe.T=null;try{for(var w=a.onRecoverableError,I=0;I<m.length;I++){var q=m[I];w(q.value,{componentStack:q.stack})}}finally{Qe.T=c,st.p=g}}if(m=Nd,w=Dd,Dd=null,m!==null&&(Nd=null,w===null&&(w=[]),r!==null))for(q=0;q<m.length;q++)c=(0,m[q])(w),c!==void 0&&r.finished.finally(c);(mo&3)!==0&&A0(),po(a),g=a.pendingLanes,(d&261930)!==0&&(g&42)!==0?a===D0?If++:(If=0,D0=a):(If=0,D0=null),Of(0)}}function a2(r,a){(r.pooledCacheLanes&=a)===0&&(a=r.pooledCache,a!=null&&(r.pooledCache=null,pf(a)))}function A0(){return Ed!==null&&(Ed.skipTransition(),Ed=null),Gb(),Hb(),qb(),$b()}function $b(){if(Ts!==5)return!1;var r=La,a=zb;zb=0;var c=Yr(mo),d=Qe.T,m=st.p;try{st.p=32>c?32:c,Qe.T=null,c=Fb,Fb=null;var g=La,w=mo;if(Ts=0,pu=La=null,mo=0,(Mn&6)!==0)throw Error(s(331));var I=Mn;if(Mn|=4,qw(g.current),Uw(g,g.current,w,c),Mn=I,Of(0,!1),de&&typeof de.onPostCommitFiberRoot=="function")try{de.onPostCommitFiberRoot(Vn,g)}catch{}return!0}finally{st.p=m,Qe.T=d,a2(r,a)}}function o2(r,a,c){a=xi(c,a),a=cb(r.stateNode,a,2),r=Vl(r,a,2),r!==null&&(Is(r,2),po(r))}function Jn(r,a,c){if(r.tag===3)o2(r,r,c);else for(;a!==null;){if(a.tag===3){o2(a,r,c);break}else if(a.tag===1){var d=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ql===null||!Ql.has(d))){r=xi(c,r),c=sw(2),d=Vl(a,c,2),d!==null&&(rw(c,d,a,r),Is(d,2),po(d));break}}a=a.return}}function Jb(r,a,c){var d=r.pingCache;
vendor: 4,313 bytes, line 48
48if(d===null){d=r.pingCache=new p4;var m=new Set;d.set(a,m)}else m=d.get(a),m===void 0&&(m=new Set,d.set(a,m));m.has(c)||(Mb=!0,m.add(c),r=_4.bind(null,r,a,c),a.then(r,r))}function _4(r,a,c){var d=r.pingCache;d!==null&&d.delete(a),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,ss===r&&(mn&c)===c&&((Ps===4||Ps===3&&(mn&62914560)===mn&&300>Et()-w0)&&(Mn&2)===0?Sd(r,0):_0|=c,wd===mn&&(wd=0)),po(r)}function l2(r,a){a===0&&(a=hn()),r=fe(r,a),r!==null&&(Is(r,a),po(r))}function w4(r){var a=r.memoizedState,c=0;a!==null&&(c=a.retryLane),l2(r,c)}function E4(r,a){var c=0;switch(r.tag){case 31:case 13:var d=r.stateNode,m=r.memoizedState;m!==null&&(c=m.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(s(314))}d!==null&&d.delete(a),l2(r,c)}function N4(r,a){return Sn(r,a)}var Ad=null,kd=null,Kb=!1,k0=!1,Qb=!1,Xl=0;function po(r){r!==kd&&r.next===null&&(kd===null?Ad=kd=r:kd=kd.next=r),k0=!0,Kb||(Kb=!0,T4())}function Of(r,a){if(!Qb&&k0){Qb=!0;do for(var c=!1,d=Ad;d!==null;){if(r!==0){var m=d.pendingLanes;if(m===0)var g=0;else{var w=d.suspendedLanes,I=d.pingedLanes;g=(1<<31-Ut(42|r)+1)-1,g&=m&~(w&~I),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(c=!0,h2(d,g))}else g=mn,g=Nr(d,d===ss?g:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(g&3)===0||ee(d,g)||(c=!0,h2(d,g));d=d.next}while(c);Qb=!1}}function D4(){c2()}function c2(){k0=Kb=!1;var r=0;Xl!==0&&z4()&&(r=Xl);for(var a=Et(),c=null,d=Ad;d!==null;){var m=d.next,g=u2(d,a);g===0?(d.next=null,c===null?Ad=m:c.next=m,m===null&&(kd=c)):(c=d,(r!==0||(g&3)!==0)&&(k0=!0)),d=m}Ts!==0&&Ts!==5||Of(r),Xl!==0&&(Xl=0)}function u2(r,a){for(var c=r.suspendedLanes,d=r.pingedLanes,m=r.expirationTimes,g=r.pendingLanes&-62914561;0<g;){var w=31-Ut(g),I=1<<w,q=m[w];q===-1?((I&c)===0||(I&d)!==0)&&(m[w]=Gt(I,a)):q<=a&&(r.expiredLanes|=I),g&=~I}if(a=ss,c=mn,c=Nr(r,r===a?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,c===0||r===a&&($n===2||$n===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&Qt(d),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||ee(r,c)){if(a=c&-c,a===r.callbackPriority)return a;switch(d!==null&&Qt(d),Yr(c)){case 2:case 8:c=wt;break;case 32:c=rn;break;case 268435456:c=On;break;default:c=rn}return d=d2.bind(null,r),c=Sn(c,d),r.callbackPriority=a,r.callbackNode=c,a}return d!==null&&d!==null&&Qt(d),r.callbackPriority=2,r.callbackNode=null,2}function d2(r,a){if(Ts!==0&&Ts!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(A0()&&r.callbackNode!==c)return null;var d=mn;return d=Nr(r,r===ss?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(Yw(r,d,a),u2(r,Et()),r.callbackNode!=null&&r.callbackNode===c?d2.bind(null,r):null)}function h2(r,a){if(A0())return null;Yw(r,a,!0)}function T4(){V4(function(){(Mn&6)!==0?Sn(xn,D4):c2()})}function Yb(){if(Xl===0){var r=iu;r===0&&(r=Ot,Ot<<=1,(Ot&261888)===0&&(Ot=256)),Xl=r}return Xl}function f2(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:fn(r)}function S4(r,a,c,d,m){if(a==="submit"&&c&&c.stateNode===m){var g=f2((m[_s]||null).action),w=d.submitter;w&&(a=(a=w[_s]||null)?f2(a.formAction):w.getAttribute("formAction"),a!==null&&(g=a,w=null));var I=new Uo("action","action",null,d,m);r.push({event:I,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(Xl!==0){var q=new FormData(m,w);rb(c,{pending:!0,data:q,method:m.method,action:g},null,q)}}else typeof g=="function"&&(I.preventDefault(),q=new FormData(m,w),rb(c,{pending:!0,data:q,method:m.method,action:g},g,q))},currentTarget:m}]})}}for(var Xb=0;Xb<ld.length;Xb++){var Wb=ld[Xb],j4=Wb.toLowerCase(),A4=Wb[0].toUpperCase()+Wb.slice(1);gi(j4,"on"+A4)}gi(lf,"onAnimationEnd"),gi(Pp,"onAnimationIteration"),gi(zp,"onAnimationStart"),gi("dblclick","onDoubleClick"),gi("focusin","onFocus"),gi("focusout","onBlur"),gi(Nx,"onTransitionRun"),gi(Dx,"onTransitionStart"),gi(Tx,"onTransitionCancel"),gi(cf,"onTransitionEnd"),Sa("onMouseEnter",["mouseout","mouseover"]),Sa("onMouseLeave",["mouseout","mouseover"]),Sa("onPointerEnter",["pointerout","pointerover"]),Sa("onPointerLeave",["pointerout","pointerover"]),qa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),qa("onSelect","focusout contextmenu dragend focu
48sin keydown keyup mousedown mouseup selectionchange".split(" ")),qa("onBeforeInput",["compositionend","keypress","textInput","paste"]),qa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),qa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),qa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lf="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(" "),k4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Lf));function m2(r,a){a=(a&4)!==0;for(var c=0;c<r.length;c++){var d=r[c],m=d.event;d=d.listeners;e:{var g=void 0;if(a)for(var w=d.length-1;0<=w;w--){var I=d[w],q=I.instance,le=I.currentTarget;if(I=I.listener,q!==g&&m.isPropagationStopped())break e;g=I,m.currentTarget=le;try{g(m)}catch(xe){G(xe)}m.currentTarget=null,g=q}else for(w=0;w<d.length;w++){if(I=d[w],q=I.instance,le=I.currentTarget,I=I.listener,q!==g&&m.isPropagationStopped())break e;g=I,m.currentTarget=le;try{g(m)}catch(xe){G(xe)}m.currentTarget=null,g=q}}}}function un(r,a){var c=a[Os];c===void 0&&(c=a[Os]=new Set);var d=r+"__bubble";c.has(d)||(p2(a,r,2,!1),c.add(d))}function Zb(r,a,c){var d=0;a&&(d|=4),p2(c,r,d,a)}var R0="_reactListening"+Math.random().toString(36).slice(2);function eC(r){if(!r[R0]){r[R0]=!0,Ls.forEach(function(c){c!=="selectionchange"&&(k4.has(c)||Zb(c,!1,r),Zb(c,!0,r))});var a=r.nodeType===9?r:r.ownerDocument;
vendor: 48,382 bytes, lines 48-49
48a===null||a[R0]||(a[R0]=!0,Zb("selectionchange",!1,a))}}function p2(r,a,c,d){switch(rE(a)){case 2:var m=w3;break;case 8:m=E3;break;default:m=CC}c=m.bind(null,a,c,r),m=void 0,!Qa||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(m=!0),d?m!==void 0?r.addEventListener(a,c,{capture:!0,passive:m}):r.addEventListener(a,c,!0):m!==void 0?r.addEventListener(a,c,{passive:m}):r.addEventListener(a,c,!1)}function tC(r,a,c,d,m){var g=d;if((a&1)===0&&(a&2)===0&&d!==null)e:for(;;){if(d===null)return;var w=d.tag;if(w===3||w===4){var I=d.stateNode.containerInfo;if(I===m)break;if(w===4)for(w=d.return;w!==null;){var q=w.tag;if((q===3||q===4)&&w.stateNode.containerInfo===m)return;w=w.return}for(;I!==null;){if(w=ut(I),w===null)return;if(q=w.tag,q===5||q===6||q===26||q===27){d=g=w;continue e}I=I.parentNode}}d=d.return}Ns(function(){var le=g,xe=Mi(c),Re=[];e:{var ie=uf.get(r);if(ie!==void 0){var pe=Uo,Ze=r;switch(r){case"keypress":if(da(c)===0)break e;case"keydown":case"keyup":pe=no;break;case"focusin":Ze="focus",pe=z;break;case"focusout":Ze="blur",pe=z;break;case"beforeblur":case"afterblur":pe=z;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Aa;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=v;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=Zu;break;case lf:case Pp:case zp:pe=_e;break;case cf:pe=ed;break;case"scroll":case"scrollend":pe=Al;break;case"wheel":pe=Sp;break;case"copy":case"cut":case"paste":pe=qt;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Np;break;case"submit":pe=Jh;break;case"toggle":case"beforetoggle":pe=xx}var ht=(a&4)!==0,Wt=!ht&&(r==="scroll"||r==="scrollend"),oe=ht?ie!==null?ie+"Capture":null:ie;ht=[];for(var Z=le,ue;Z!==null;){var ke=Z;if(ue=ke.stateNode,ke=ke.tag,ke!==5&&ke!==26&&ke!==27||ue===null||oe===null||(ke=zi(Z,oe),ke!=null&&ht.push(Mf(Z,ke,ue))),Wt)break;Z=Z.return}0<ht.length&&(ie=new pe(ie,Ze,null,c,xe),Re.push({event:ie,listeners:ht}))}}if((a&7)===0){e:{if(pe=r==="mouseover"||r==="pointerover",ie=r==="mouseout"||r==="pointerout",pe&&c!==qc&&(Ze=c.relatedTarget||c.fromElement)&&(ut(Ze)||Ze[Br]))break e;(ie||pe)&&(Ze=xe.window===xe?xe:(pe=xe.ownerDocument)?pe.defaultView||pe.parentWindow:window,ie?(pe=c.relatedTarget||c.toElement,ie=le,pe=pe?ut(pe):null,pe!==null&&(Wt=l(pe),ht=pe.tag,pe!==Wt||ht!==5&&ht!==27&&ht!==6)&&(pe=null)):(ie=null,pe=le),ie!==pe&&(ht=Aa,ke="onMouseLeave",oe="onMouseEnter",Z="mouse",(r==="pointerout"||r==="pointerover")&&(ht=Np,ke="onPointerLeave",oe="onPointerEnter",Z="pointer"),Wt=ie==null?Ze:Jt(ie),ue=pe==null?Ze:Jt(pe),Ze=new ht(ke,Z+"leave",ie,c,xe),Ze.target=Wt,Ze.relatedTarget=ue,ke=null,ut(xe)===le&&(ht=new ht(oe,Z+"enter",pe,c,xe),ht.target=ue,ht.relatedTarget=Wt,ke=ht),Wt=ke,ht=ie&&pe?Y(ie,pe,R4):null,ie!==null&&B2(Re,Ze,ie,ht,!1),pe!==null&&Wt!==null&&B2(Re,Wt,pe,ht,!0)))}e:{if(ie=le?Jt(le):window,pe=ie.nodeName&&ie.nodeName.toLowerCase(),pe==="select"||pe==="input"&&ie.type==="file")var ct=kp;else if(Vr(ie))if(Rp)ct=Lp;else{ct=wx;var pn=_x}else pe=ie.nodeName,!pe||pe.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?le&&Fo(le.elementType)&&(ct=kp):ct=Ex;if(ct&&(ct=ct(r,le))){vx(Re,ct,c,xe);break e}pn&&pn(r,ie,le)}switch(pn=le?Jt(le):window,r){case"focusin":(Vr(pn)||pn.contentEditable==="true")&&(Fi=pn,od=le,so=null);break;case"focusout":so=od=Fi=null;break;case"mousedown":Rl=!0;break;case"contextmenu":case"mouseup":case"dragend":Rl=!1,Xc(Re,c,xe);break;case"selectionchange":if(kl)break;case"keydown":case"keyup":Xc(Re,c,xe)}var xt;if(Yh)e:{switch(r){case"compositionstart":var St="onCompositionStart";break e;case"compositionend":St="onCompositionEnd";break e;case"compositionupdate":St="onCompositionUpdate";break e}St=void 0}else gr?Wh(r,c)&&(St="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(St="onCompositionStart");St&&(nd&&c.locale!=="ko"&&(gr||St!=="onCompositionStart"?St==="onCompositionEnd"&&gr&&(xt=Xa()):(ua=xe,Vo="value"in ua?ua.value:ua.textContent,gr=!0)),pn=I0(le,St),0<pn.length&&(St=new bn(St,r,null,c,xe),Re.push({event:St,listeners:pn}),xt?St.data=xt:(xt=Ap(c),xt!==null&&(St.data=xt)))),(xt=bx?yx(r,c):Zh(r,c))&&(St=I0(le,"onBeforeInput"),0<St.length&&(pn=new bn("onBeforeInput","beforeinput",null,c,xe),Re.push({event:pn,listeners:St}),pn.data=xt)),S4(Re,r,le,c,xe)}m2(Re,a)})}function Mf(r,a,c){return{instance:r,listener:a,currentTarget:c}}function I0(r,a){for(var c=a+"Capture",d=[];r!==null;){var m=r,g=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||g===null||(m=zi(r,c),m!=null&&d.unshift(Mf(r,m,g)),m=zi(r,a),m!=null&&d.push(Mf(r,m,g))),r.tag===3)return d;r=r.return}return[]}function R4(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function B2(r,a,c,d,m){for(var g=a._reactName,w=[];c!==null&&c!==d;){var I=c,q=I.alternate,le=I.stateNode;if(I=I.tag,q!==null&&q===d)break;I!==5&&I!==26&&I!==27||le===null||(q=le,m?(le=zi(c,g),le!=null&&w.unshift(Mf(c,le,q))):m||(le=zi(c,g),le!=null&&w.push(Mf(c,le,q)))),c=c.return}w.length!==0&&r.push({event:a,listeners:w})}var I4=/\r\n?/g,O4=/\u0000|\uFFFD/g;function g2(r){return(typeof r=="string"?r:""+r).replace(I4,` 49`).replace(O4,"")}function x2(r,a){return a=g2(a),g2(r)===a}function Kn(r,a,c,d,m,g){switch(c){case"children":if(typeof d=="string")a==="body"||a==="textarea"&&d===""||_n(r,d);else if(typeof d=="number"||typeof d=="bigint")a!=="body"&&_n(r,""+d);else return;break;case"className":qn(r,"class",d);break;case"tabIndex":qn(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":qn(r,c,d);break;case"style":Ja(r,d,g);return;case"data":if(a!=="object"){qn(r,"data",d);break}case"src":case"href":if(d===""&&(a!=="a"||c!=="href")){r.removeAttribute(c);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(c);break}d=fn(d),r.setAttribute(c,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(c,"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 g=="function"&&(c==="formAction"?(a!=="input"&&Kn(r,a,"name",m.name,m,null),Kn(r,a,"formEncType",m.formEncType,m,null),Kn(r,a,"formMethod",m.formMethod,m,null),Kn(r,a,"formTarget",m.formTarget,m,null)):(Kn(r,a,"encType",m.encType,m,null),Kn(r,a,"method",m.method,m,null),Kn(r,a,"target",m.target,m,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(c);break}d=fn(d),r.setAttribute(c,d);break;case"onClick":d!=null&&(r.onclick=zr);return;case"onScroll":d!=null&&un("scroll",r);return;case"onScrollEnd":d!=null&&un("scrollend",r);return;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(c=d.__html,c!=null){if(m.children!=null)throw Error(s(60));(g!=null?g.__html:void 0)!==c&&(r.innerHTML=c)}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}c=fn(d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(c,d):r.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(c,""):r.removeAttribute(c);break;case"capture":case"download":d===!0?r.setAttribute(c,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(c,d):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(c,d):r.removeAttribute(c);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(c):r.setAttribute(c,d);break;case"popover":un("beforetoggle",r),un("toggle",r),ja(r,"popover",d);break;case"xlinkActuate":ur(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":ur(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":ur(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":ur(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":ur(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":ur(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":ur(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":ur(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":ur(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":ja(r,"is",d);break;case"innerText":case"textContent":return;default:if(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")c=Hc.get(c)||c,ja(r,c,d);else return}Lt=!0}function nC(r,a,c,d,m,g){switch(c){case"style":Ja(r,d,g);return;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(c=d.__html,c!=null){if(m.children!=null)throw Error(s(60));(g!=null?g.__html:void 0)!==c&&(r.innerHTML=c)}}break;case"children":if(typeof d=="string")_n(r,d);else if(typeof d=="number"||typeof d=="bigint")_n(r,""+d);else return;break;case"onScroll":d!=null&&un("scroll",r);return;case"onScrollEnd":d!=null&&un("scrollend",r);return;case"onClick":d!=null&&(r.onclick=zr);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!cs.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(m=c.endsWith("Capture"),g=c.slice(2,m?c.length-7:void 0),a=r[_s]||null,a=a!=null?a[c]:null,typeof a=="function"&&r.removeEventListener(g,a,m),typeof d=="function")){typeof a!="function"&&a!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(g,d,m);break e}Lt=!0,c in r?r[c]=d:d===!0?r.setAttribute(c,""):ja(r,c,d)}return}Lt=!0}function Rr(r,a,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":un("error",r),un("load",r);var d=!1,m=!1,g;for(g in c)if(c.hasOwnProperty(g)){var w=c[g];if(w!=null)switch(g){case"src":d=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,a));default:Kn(r,a,g,w,c,null)}}m&&Kn(r,a,"srcSet",c.srcSet,c,null),d&&Kn(r,a,"src",c.src,c,null);return;case"input":un("invalid",r);var I=g=w=m=null,q=null,le=null;for(d in c)if(c.hasOwnProperty(d)){var xe=c[d];if(xe!=null)switch(d){case"name":m=xe;break;case"type":w=xe;break;case"checked":q=xe;break;case"defaultChecked":le=xe;break;case"value":g=xe;break;case"defaultValue":I=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(s(137,a));break;default:Kn(r,a,d,xe,c,null)}}Gc(r,g,I,q,le,w,m,!1);return;case"select":un("invalid",r),d=w=g=null;for(m in c)if(c.hasOwnProperty(m)&&(I=c[m],I!=null))switch(m){case"value":g=I;break;case"defaultValue":w=I;break;case"multiple":d=I;default:Kn(r,a,m,I,c,null)}a=g,c=w,r.multiple=!!d,a!=null?pi(r,!!d,a,!1):c!=null&&pi(r,!!d,c,!0);return;case"textarea":un("invalid",r),g=m=d=null;for(w in c)if(c.hasOwnProperty(w)&&(I=c[w],I!=null))switch(w){case"value":d=I;break;case"defaultValue":m=I;break;case"children":g=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(s(91));break;default:Kn(r,a,w,I,c,null)}Sl(r,d,m,g);return;case"option":for(q in c)if(c.hasOwnProperty(q)&&(d=c[q],d!=null))switch(q){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:Kn(r,a,q,d,c,null)}return;case"dialog":un("beforetoggle",r),un("toggle",r),un("cancel",r),un("close",r);break;case"iframe":case"object":un("load",r);break;case"video":case"audio":for(d=0;d<Lf.length;d++)un(Lf[d],r);break;case"image":un("error",r),un("load",r);break;case"details":un("toggle",r);break;case"embed":case"source":case"link":un("error",r),un("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in c)if(c.hasOwnProperty(le)&&(d=c[le],d!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,a));default:Kn(r,a,le,d,c,null)}return;default:if(Fo(a)){for(xe in c)c.hasOwnProperty(xe)&&(d=c[xe],d!==void 0&&nC(r,a,xe,d,c,void 0));return}}for(I in c)c.hasOwnProperty(I)&&(d=c[I],d!=null&&Kn(r,a,I,d,c,null))}var L4={};function M4(r,a,c,d){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,g=null,w=null,I=null,q=null,le=null,xe=null;for(pe in c){var Re=c[pe];if(c.hasOwnProperty(pe)&&Re!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":q=Re;default:d.hasOwnProperty(pe)||Kn(r,a,pe,null,d,Re)}}for(var ie in d){var pe=d[ie];if(Re=c[ie],d.hasOwnProperty(ie)&&(pe!=null||Re!=null))switch(ie){case"type":pe!==Re&&(Lt=!0),g=pe;break;case"name":pe!==Re&&(Lt=!0),m=pe;break;case"checked":pe!==Re&&(Lt=!0),le=pe;break;case"defaultChecked":pe!==Re&&(Lt=!0),xe=pe;break;case"value":pe!==Re&&(Lt=!0),w=pe;break;case"defaultValue":pe!==Re&&(Lt=!0),I=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(s(137,a));break;default:pe!==Re&&Kn(r,a,ie,pe,d,Re)}}la(r,w,I,q,le,xe,g,m);return;case"select":pe=w=I=ie=null;for(g in c)if(q=c[g],c.hasOwnProperty(g)&&q!=null)switch(g){case"value":break;case"multiple":pe=q;default:d.hasOwnProperty(g)||Kn(r,a,g,null,d,q)}for(m in d)if(g=d[m],q=c[m],d.hasOwnProperty(m)&&(g!=null||q!=null))switch(m){case"value":g!==q&&(Lt=!0),ie=g;break;case"defaultValue":g!==q&&(Lt=!0),I=g;break;case"multiple":g!==q&&(Lt=!0),w=g;default:g!==q&&Kn(r,a,m,g,d,q)}a=I,c=w,d=pe,ie!=null?pi(r,!!c,ie,!1):!!d!=!!c&&(a!=null?pi(r,!!c,a,!0):pi(r,!!c,c?[]:"",!1));return;case"textarea":pe=ie=null;for(I in c)if(m=c[I],c.hasOwnProperty(I)&&m!=null&&!d.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:Kn(r,a,I,null,d,m)}for(w in d)if(m=d[w],g=c[w],d.hasOwnProperty(w)&&(m!=null||g!=null))switch(w){case"value":m!==g&&(Lt=!0),ie=m;break;case"defaultValue":m!==g&&(Lt=!0),pe=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(s(91));break;default:m!==g&&Kn(r,a,w,m,d,g)}Tl(r,ie,pe);return;case"option":for(var Ze in c)if(ie=c[Ze],c.hasOwnProperty(Ze)&&ie!=null&&!d.hasOwnProperty(Ze))switch(Ze){case"selected":r.selected=!1;break;default:Kn(r,a,Ze,null,d,ie)}for(q in d)if(ie=d[q],pe=c[q],d.hasOwnProperty(q)&&ie!==pe&&(ie!=null||pe!=null))switch(q){case"selected":ie!==pe&&(Lt=!0),r.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:Kn(r,a,q,ie,d,pe)}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 ht in c)ie=c[ht],c.hasOwnProperty(ht)&&ie!=null&&!d.hasOwnProperty(ht)&&Kn(r,a,ht,null,d,ie);for(le in d)if(ie=d[le],pe=c[le],d.hasOwnProperty(le)&&ie!==pe&&(ie!=null||pe!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,a));break;default:Kn(r,a,le,ie,d,pe)}return;default:if(Fo(a)){for(var Wt in c)ie=c[Wt],c.hasOwnProperty(Wt)&&ie!==void 0&&!d.hasOwnProperty(Wt)&&nC(r,a,Wt,void 0,d,ie);for(xe in d)ie=d[xe],pe=c[xe],!d.hasOwnProperty(xe)||ie===pe||ie===void 0&&pe===void 0||nC(r,a,xe,ie,d,pe);return}}for(var oe in c)ie=c[oe],c.hasOwnProperty(oe)&&ie!=null&&!d.hasOwnProperty(oe)&&Kn(r,a,oe,null,d,ie);for(Re in d)ie=d[Re],pe=c[Re],!d.hasOwnProperty(Re)||ie===pe||ie==null&&pe==null||Kn(r,a,Re,ie,d,pe)}function b2(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function P4(){if(typeof performance.getEntriesByType=="function"){for(var r=0,a=0,c=performance.getEntriesByType("resource"),d=0;d<c.length;d++){var m=c[d],g=m.transferSize,w=m.initiatorType,I=m.duration;if(g&&I&&b2(w)){for(w=0,I=m.responseEnd,d+=1;d<c.length;d++){var q=c[d],le=q.startTime;if(le>I)break;var xe=q.transferSize,Re=q.initiatorType;xe&&b2(Re)&&(q=q.responseEnd,w+=xe*(q<I?1:(I-le)/(q-le)))}if(--d,a+=8*(g+w)/(m.duration/1e3),r++,10<r)break}}if(0<r)return a/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var sC=null,rC=null;function Pf(r){return r.nodeType===9?r:r.ownerDocument}function C2(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function y2(r,a){if(r===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&a==="foreignObject"?0:r}function v2(r,a,c,d){return c=Pf(c).createElement(r),c[Xn]=d,c[_s]=a,Rr(c,r,a),ts(c),c}function iC(r,a){return r==="textarea"||r==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var aC=null;function z4(){var r=window.event;return r&&r.type==="popstate"?r===aC?!1:(aC=r,!0):(aC=null,!1)}var oC=typeof setTimeout=="function"?setTimeout:void 0,F4=typeof clearTimeout=="function"?clearTimeout:void 0,_2=typeof Promise=="function"?Promise:void 0,w2=typeof requestAnimationFrame=="function"?requestAnimationFrame:oC,V4=typeof queueMicrotask=="function"?queueMicrotask:typeof _2<"u"?function(r){return _2.resolve(null).then(r).catch(U4)}:oC;function U4(r){setTimeout(function(){throw r})}function Wl(r){return r==="head"}function E2(r,a){var c=a,d=0;do{var m=c.nextSibling;if(r.removeChild(c),m&&m.nodeType===8)if(c=m.data,c==="/$"||c==="/&"){if(d===0){r.removeChild(m),zd(a);return}d--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")d++;else if(c==="html")pC(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,pC(c);for(var g=c.firstChild;g;){var w=g.nextSibling,I=g.nodeName;g[Ce]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&g.rel.toLowerCase()==="stylesheet"||c.removeChild(g),g=w}}else c==="body"&&pC(r.ownerDocument.body);c=m}while(c);zd(a)}function N2(r,a){var c=r;r=0;do{var d=c.nextSibling;if(c.nodeType===1?a?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(a?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),d&&d.nodeType===8)if(c=d.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=d}while(c)}function D2(r,a,c){if(a=CSS.escape(a)!==a?"r-"+btoa(a).replace(/=/g,""):a,r.style.viewTransitionName=a,c!=null&&(r.style.viewTransitionClass=c),c=getComputedStyle(r),c.display==="inline"){if(a=r.getClientRects(),a.length===1)var d=1;else for(var m=d=0;m<a.length;m++){var g=a[m];0<g.width&&0<g.height&&d++}d===1&&(r=r.style,r.display=a.length===1?"inline-block":"block",r.marginTop="-"+c.paddingTop,r.marginBottom="-"+c.paddingBottom)}}function T2(r,a){r=r.style,a=a.style;var c=a!=null?a.hasOwnProperty("viewTransitionName")?a.viewTransitionName:a.hasOwnProperty("view-transition-name")?a["view-transition-name"]:null:null;r.viewTransitionName=c==null||typeof c=="boolean"?"":(""+c).trim(),c=a!=null?a.hasOwnProperty("viewTransitionClass")?a.viewTransitionClass:a.hasOwnProperty("view-transition-class")?a["view-transition-class"]:null:null,r.viewTransitionClass=c==null||typeof c=="boolean"?"":(""+c).trim(),r.display==="inline-block"&&(a==null?r.display=r.margin="":(c=a.display,r.display=c==null||typeof c=="boolean"?"":c,c=a.margin,c!=null?r.margin=c:(c=a.hasOwnProperty("marginTop")?a.marginTop:a["margin-top"],r.marginTop=c==null||typeof c=="boolean"?"":c,a=a.hasOwnProperty("marginBottom")?a.marginBottom:a["margin-bottom"],r.marginBottom=a==null||typeof a=="boolean"?"":a)))}function G4(r,a,c){return c=c.ownerDocument.defaultView,{rect:r,abs:a.position==="absolute"||a.position==="fixed",clip:a.clipPath!=="none"||a.overflow!=="visible"||a.filter!=="none"||a.mask!=="none"||a.mask!=="none"||a.borderRadius!=="0px",view:0<=r.bottom&&0<=r.right&&r.top<=c.innerHeight&&r.left<=c.innerWidth}}function lC(r){var a=r.getBoundingClientRect(),c=getComputedStyle(r);return G4(a,c,r)}function H4(r){return r.documentElement.clientHeight}function q4(r){this.addEventListener("load",r),this.addEventListener("error",r)}function $4(r,a,c,d,m,g,w,I,q){var le=a.nodeType===9?a:a.ownerDocument;try{var xe=le.startViewTransition({update:function(){var ie=le.defaultView,pe=ie.navigation&&ie.navigation.transition,Ze=le.fonts.status;d();var ht=[];if(Ze==="loaded"&&(H4(le),le.fonts.status==="loading"&&ht.push(le.fonts.ready)),Ze=ht.length,r!==null)for(var Wt=r.suspenseyImages,oe=0,Z=0;Z<Wt.length;Z++){var ue=Wt[Z];if(!ue.complete){var ke=ue.getBoundingClientRect();if(0<ke.bottom&&0<ke.right&&ke.top<ie.innerHeight&&ke.left<ie.innerWidth){if(oe+=Q2(ue),oe>M0){ht.length=Ze;break}ue=new Promise(q4.bind(ue)),ht.push(ue)}}}if(0<ht.length)return ie=Promise.race([Promise.all(ht),new Promise(function(ct){return setTimeout(ct,500)})]).then(m,m),(pe?Promise.allSettled([pe.finished,ie]):ie).then(g,g);if(m(),pe)return pe.finished.then(g,g);g()},types:c});le.__reactViewTransition=xe;var Re=[];return xe.ready.then(function(){for(var ie=le.documentElement.getAnimations({subtree:!0}),pe=0;pe<ie.length;pe++){var Ze=ie[pe],ht=Ze.effect,Wt=ht.pseudoElement;if(Wt!=null&&Wt.startsWith("::view-transition")){Re.push(Ze),Ze=ht.getKeyframes();for(var oe=Wt=void 0,Z=!0,ue=0;ue<Ze.length;ue++){var ke=Ze[ue],ct=ke.width;if(Wt===void 0)Wt=ct;else if(Wt!==ct){Z=!1;break}if(ct=ke.height,oe===void 0)oe=ct;else if(oe!==ct){Z=!1;break}delete ke.width,delete ke.height,ke.transform==="none"&&delete ke.transform}Z&&Wt!==void 0&&oe!==void 0&&(ht.setKeyframes(Ze),Z=getComputedStyle(ht.target,ht.pseudoElement),Z.width!==Wt||Z.height!==oe)&&(Z=Ze[0],Z.width=Wt,Z.height=oe,Z=Ze[Ze.length-1],Z.width=Wt,Z.height=oe,ht.setKeyframes(Ze))}}w()},function(ie){le.__reactViewTransition===xe&&(le.__reactViewTransition=null);try{if(typeof ie=="object"&&ie!==null)switch(ie.name){case"InvalidStateError":(ie.message==="View transition was skipped because document visibility state is hidden."||ie.message==="Skipping view transition because document visibility state has become hidden."||ie.message==="Skipping view transition because viewport size changed."||ie.message==="Transition was aborted because of invalid state")&&(ie=null)}ie!==null&&q(ie)}finally{d(),m(),w()}}),xe.finished.finally(function(){for(var ie=0;ie<Re.length;ie++)Re[ie].cancel();le.__reactViewTransition===xe&&(le.__reactViewTransition=null),I()}),xe}catch{return d(),m(),w(),null}}function Bu(r,a){this._scope=document.documentElement,this._selector="::view-transition-"+r+"("+a+")"}Bu.prototype.animate=function(r,a){return a=typeof a=="number"?{duration:a}:k({},a),a.pseudoElement=this._selector,this._scope.animate(r,a)},Bu.prototype.getAnimations=function(){for(var r=this._scope,a=this._selector,c=r.getAnimations({subtree:!0}),d=[],m=0;m<c.length;m++){var g=c[m].effect;g!==null&&g.target===r&&g.pseudoElement===a&&d.push(c[m])}return d},Bu.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function S2(r){return{name:r,group:new Bu("group",r),imagePair:new Bu("image-pair",r),old:new Bu("old",r),new:new Bu("new",r)}}function Ki(r){this._fragmentFiber=r,this._observers=this._eventListeners=null}Ki.prototype.addEventListener=function(r,a,c){var d=null,m=null;if(!(c!=null&&typeof c!="boolean"&&(d=c.signal||null,d!==null&&d.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var g=this._eventListeners;if(A2(g,r,a,c)===-1){var w=this,I=a;c!=null&&typeof c!="boolean"&&c.once===!0&&(I=function(q){w.removeEventListener(r,a,c),typeof a=="function"?a.call(this,q):a.handleEvent(q)}),d!==null&&(m=w.removeEventListener.bind(w,r,a,c),d.addEventListener("abort",m,{once:!0}),m=d.removeEventListener.bind(d,"abort",m)),d=Rd(c),g.push({type:r,listener:a,optionsOrUseCapture:c,attachedListener:I,cleanup:m}),b(this._fragmentFiber.child,!1,J4,r,I,d)}this._eventListeners=g}};function J4(r,a,c,d){return A(r).addEventListener(a,c,d),!1}Ki.prototype.removeEventListener=function(r,a,c){var d=this._eventListeners;if(d!==null&&(a=A2(d,r,a,c),a!==-1)){var m=d[a];c=m.attachedListener;var g=m.cleanup;m=Rd(m.optionsOrUseCapture),b(this._fragmentFiber.child,!1,K4,r,c,m),d.splice(a,1),g!==null&&g()}};function K4(r,a,c,d){return A(r).removeEventListener(a,c,d),!1}function Rd(r){return r!=null&&typeof r!="boolean"&&(r.once===!0||r.signal instanceof AbortSignal)?{capture:r.capture,passive:r.passive}:r}function j2(r){return r==null?"c=0":typeof r=="boolean"?"c="+(r?"1":"0"):"c="+(r.capture?"1":"0")}function A2(r,a,c,d){if(r.length===0)return-1;d=j2(d);for(var m=0;m<r.length;m++){var g=r[m];if(g.type===a&&g.listener===c&&j2(g.optionsOrUseCapture)===d)return m}return-1}Ki.prototype.dispatchEvent=function(r){var a=C(this._fragmentFiber);if(a===null)return!0;a=A(a);var c=this._eventListeners;if(c!==null&&0<c.length||!r.bubbles){var d=a.nodeType===9?a.createComment(""):document.createTextNode("");if(c)for(var m=0;m<c.length;m++){var g=c[m];d.addEventListener(g.type,g.attachedListener,Rd(g.optionsOrUseCapture))}if(a.appendChild(d),r=d.dispatchEvent(r),c)for(m=0;m<c.length;m++)g=c[m],d.removeEventListener(g.type,g.attachedListener,Rd(g.optionsOrUseCapture));return a.removeChild(d),r}return a.dispatchEvent(r)},Ki.prototype.focus=function(r){b(this._fragmentFiber.child,!0,k2,r,void 0,void 0)};function k2(r,a){return r.tag===6?!1:(r=A(r),a3(r,a))}Ki.prototype.focusLast=function(r){var a=[];b(this._fragmentFiber.child,!0,cC,a,void 0,void 0);for(var c=a.length-1;0<=c&&!k2(a[c],r);c--);};function cC(r,a){return a.push(r),!1}Ki.prototype.blur=function(){var r=C(this._fragmentFiber);r!==null&&(r=A(r),r=Pf(r).activeElement,r!==null&&b(this._fragmentFiber.child,!1,Q4,r,void 0,void 0))};function Q4(r,a){return r.tag===6?!1:(r=A(r),r===a||r.contains(a)?(a.blur(),!0):!1)}Ki.prototype.observeUsing=function(r){this._observers===null&&(this._observers=new Set),this._observers.add(r),b(this._fragmentFiber.child,!1,Y4,r,void 0,void 0)};function Y4(r,a){return r.tag===6||(r=A(r),a.observe(r)),!1}Ki.prototype.unobserveUsing=function(r){var a=this._observers;if(a!==null&&a.has(r)){a.delete(r),b(this._fragmentFiber.child,!1,X4,r,void 0,void 0);for(var c=a=0;c<Ma.length;c++){var d=Ma[c];d.fragmentInstance===this&&d.observer===r?r.unobserve(d.instance):Ma[a++]=d}Ma.length=a}};function X4(r,a){return r.tag===6||(r=A(r),a.unobserve(r)),!1}var Ma=[],uC=!1;function W4(r,a,c){Ma.push({fragmentInstance:r,observer:a,instance:c}),uC||(uC=!0,o3(function(){uC=!1;var d=Ma;Ma=[];for(var m=0;m<d.length;m++){var g=d[m];g.observer.unobserve(g.instance)}}))}Ki.prototype.getClientRects=function(){var r=[];return b(this._fragmentFiber.child,!1,Z4,r,void 0,void 0),r};function Z4(r,a){if(r.tag===6){r=r.stateNode;var c=r.ownerDocument.createRange();c.selectNodeContents(r),a.push.apply(a,c.getClientRects())}else r=A(r),a.push.apply(a,r.getClientRects());return!1}Ki.prototype.getRootNode=function(r){var a=C(this._fragmentFiber);return a===null?this:A(a).getRootNode(r)},Ki.prototype.compareDocumentPosition=function(r){var a=C(this._fragmentFiber);if(a===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var c=[];b(this._fragmentFiber.child,!1,cC,c,void 0,void 0);var d=A(a);if(c.length===0){if(c=d,N(this._fragmentFiber)){e:{for(a=this._fragmentFiber.return;a!==null;){if(a.tag===4){a=a.stateNode.containerInfo;break e}if(a.tag===3||a.tag===5||a.tag===27)break;a=a.return}a=null}a!=null&&(c=a)}a=this._fragmentFiber;var m=d=c.compareDocumentPosition(r);return c===r?m=Node.DOCUMENT_POSITION_CONTAINS:d&Node.DOCUMENT_POSITION_CONTAINED_BY&&(c=T(a)[1],c===null?m=Node.DOCUMENT_POSITION_PRECEDING:(r=A(c).compareDocumentPosition(r),m=r===0||r&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),m|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}a=A(c[0]),m=A(c[c.length-1]);var g=N(this._fragmentFiber)?a.parentElement:d;if(g==null)return Node.DOCUMENT_POSITION_DISCONNECTED;d=g.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY,g=g.compareDocumentPosition(m)&Node.DOCUMENT_POSITION_CONTAINED_BY;var w=a.compareDocumentPosition(r),I=m.compareDocumentPosition(r),q=w&Node.DOCUMENT_POSITION_CONTAINED_BY||I&Node.DOCUMENT_POSITION_CONTAINED_BY;return I=d&&g&&w&Node.DOCUMENT_POSITION_FOLLOWING&&I&Node.DOCUMENT_POSITION_PRECEDING,a=d&&a===r||g&&m===r||q||I?Node.DOCUMENT_POSITION_CONTAINED_BY:!d&&a===r||!g&&m===r?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:w,a&Node.DOCUMENT_POSITION_DISCONNECTED||a&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||e3(a,this._fragmentFiber,c[0],c[c.length-1],r)?a:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function e3(r,a,c,d,m){var g=ut(m);if(r&Node.DOCUMENT_POSITION_CONTAINED_BY){if(c=!!g)e:{for(;g!==null;){if(g.tag===7&&(g===a||g.alternate===a)){c=!0;break e}g=g.return}c=!1}return c}if(r&Node.DOCUMENT_POSITION_CONTAINS){if(g===null)return g=m.ownerDocument,m===g||m===g.documentElement||m===g.body;e:{for(g=a,a=C(a);g!==null;){if(!(g.tag!==5&&g.tag!==3&&g.tag!==27||g!==a&&g.alternate!==a)){g=!0;break e}g=g.return}g=!1}return g}return r&Node.DOCUMENT_POSITION_PRECEDING?((a=!!g)&&!(a=g===c)&&(a=Y(c,g,Q),a===null?a=!1:(b(a,!0,V,g,c),g=U,U=null,a=g!==null)),a):r&Node.DOCUMENT_POSITION_FOLLOWING?((a=!!g)&&!(a=g===d)&&(a=Y(d,g,Q),a===null?a=!1:(b(a,!0,H,g,d),g=U,M=U=null,a=g!==null)),a):!1}function R2(r,a){var c=r.ownerDocument.createRange();c.selectNodeContents(r),r=c.getBoundingClientRect(),window.scrollTo(window.scrollX+r.left,a?window.scrollY+r.top:window.scrollY+r.bottom-window.innerHeight)}Ki.prototype.scrollIntoView=function(r){if(typeof r=="object")throw Error(s(566));var a=[];b(this._fragmentFiber.child,!1,cC,a,void 0,void 0);var c=r!==!1;if(a.length===0){var d=T(this._fragmentFiber);if(d=c?d[1]||d[0]||C(this._fragmentFiber):d[0]||d[1],d===null)return;if(d.tag===6){r=A(d),R2(r,c);return}if(d=A(d),d.nodeType!==9){if(d.nodeType===11){c="host"in d?d.host:null,c!==null&&c.scrollIntoView(r);return}d.scrollIntoView(r)}}for(d=c?a.length-1:0;d!==(c?-1:a.length);){var m=a[d];m.tag===6?(m=A(m),R2(m,c)):A(m).scrollIntoView(r),d+=c?-1:1}};function t3(r,a){return r=A(r),I2(r,a),!1}function I2(r,a){r.reactFragments==null&&(r.reactFragments=new Set),r.reactFragments.add(a)}function O2(r,a){var c=a._eventListeners;if(c!==null)for(var d=0;d<c.length;d++){var m=c[d];r.addEventListener(m.type,m.attachedListener,Rd(m.optionsOrUseCapture))}r.nodeType!==3&&(c=a._observers,c!==null&&c.forEach(function(g){for(var w=0,I=0;I<Ma.length;I++){var q=Ma[I];(q.fragmentInstance!==a||q.observer!==g||q.instance!==r)&&(Ma[w++]=q)}Ma.length=w,g.observe(r)}),I2(r,a))}function n3(r,a){var c=a._eventListeners;if(c!==null)for(var d=0;d<c.length;d++){var m=c[d];r.removeEventListener(m.type,m.attachedListener,Rd(m.optionsOrUseCapture))}r.nodeType!==3&&(c=a._observers,c!==null&&c.forEach(function(g){typeof g.rootMargin=="string"?W4(a,g,r):g.unobserve(r)}),r.reactFragments!=null&&r.reactFragments.delete(a))}function dC(r){var a=r.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var c=a;switch(a=a.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":dC(c),dt(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function s3(r,a,c,d){for(;r.nodeType===1;){var m=c;if(r.nodeName.toLowerCase()!==a.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[Ce])switch(a){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(g=r.getAttribute("rel"),g==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(g!==m.rel||r.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||r.getAttribute("title")!==(m.title==null?null:m.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(g=r.getAttribute("src"),(g!==(m.src==null?null:m.src)||r.getAttribute("type")!==(m.type==null?null:m.type)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&g&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(a==="input"&&r.type==="hidden"){var g=m.name==null?null:""+m.name;if(m.type==="hidden"&&r.getAttribute("name")===g)return r}else return r;if(r=xa(r.nextSibling),r===null)break}return null}function r3(r,a,c){if(a==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=xa(r.nextSibling),r===null))return null;return r}function L2(r,a){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!a||(r=xa(r.nextSibling),r===null))return null;return r}function hC(r){return r.data==="$?"||r.data==="$~"}function fC(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function i3(r,a){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=a;else if(r.data!=="$?"||c.readyState!=="loading")a();else{var d=function(){a(),c.removeEventListener("DOMContentLoaded",d)};c.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function xa(r){for(;r!=null;r=r.nextSibling){var a=r.nodeType;if(a===1||a===3)break;if(a===8){if(a=r.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return r}var mC=null;function M2(r){r=r.nextSibling;for(var a=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(a===0)return xa(r.nextSibling);a--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||a++}r=r.nextSibling}return null}function P2(r){r=r.previousSibling;for(var a=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(a===0)return r;a--}else c!=="/$"&&c!=="/&"||a++}r=r.previousSibling}return null}function a3(r,a){function c(){d=!0}if(r.ownerDocument.activeElement===r)return!0;var d=!1;try{r.ownerDocument.addEventListener("focus",c,!0),(r.focus||HTMLElement.prototype.focus).call(r,a)}finally{r.ownerDocument.removeEventListener("focus",c,!0)}return d}function o3(r){w2(function(){w2(function(a){return r(a)})})}function z2(r,a,c){switch(a=Pf(c),r){case"html":if(r=a.documentElement,!r)throw Error(s(452));return r;case"head":if(r=a.head,!r)throw Error(s(453));return r;case"body":if(r=a.body,!r)throw Error(s(454));return r;default:throw Error(s(451))}}function F2(r,a,c){for(var d in c){var m=c[d];c.hasOwnProperty(d)&&m!=null&&Kn(r,a,d,null,L4,m)}c.dangerouslySetInnerHTML!=null&&(r.textContent=""),r.onclick===zr&&(r.onclick=null),dt(r)}function pC(r){for(var a=r.attributes;a.length;)r.removeAttributeNode(a[0]);dt(r)}var ba=new Map,V2=new Set;function zf(r){if(typeof r.getRootNode=="function"){var a=r.getRootNode();if(a.nodeType===9||a.nodeType===11)return a}return r.nodeType===9?r:r.ownerDocument}var tl=st.d;st.d={f:l3,r:c3,D:u3,C:d3,L:h3,m:f3,X:p3,S:m3,M:B3};function l3(){var r=tl.f(),a=T0();return r||a}function c3(r){var a=Yt(r);a!==null&&a.tag===5&&a.type==="form"?G_(a):tl.r(r)}var Id=typeof document>"u"?null:document;function U2(r,a,c){var d=Id;if(d&&typeof a=="string"&&a){var m=Es(a);m='link[rel="'+r+'"][href="'+m+'"]',typeof c=="string"&&(m+='[crossorigin="'+c+'"]'),V2.has(m)||(V2.add(m),r={rel:r,crossOrigin:c,href:a},d.querySelector(m)===null&&(a=d.createElement("link"),Rr(a,"link",r),ts(a),d.head.appendChild(a)))}}function u3(r){tl.D(r),U2("dns-prefetch",r,null)}function d3(r,a){tl.C(r,a),U2("preconnect",r,a)}function h3(r,a,c){tl.L(r,a,c);var d=Id;if(d&&r&&a){var m='link[rel="preload"][as="'+Es(a)+'"]';a==="image"&&c&&c.imageSrcSet?(m+='[imagesrcset="'+Es(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(m+='[imagesizes="'+Es(c.imageSizes)+'"]')):m+='[href="'+Es(r)+'"]';var g=m;switch(a){case"style":g=Od(r);break;case"script":g=Ld(r)}if(!(ba.has(g)||(r=k({rel:"preload",href:a==="image"&&c&&c.imageSrcSet?void 0:r,as:a},c),ba.set(g,r),d.querySelector(m)!==null||a==="style"&&d.querySelector(Ff(g))||a==="script"&&d.querySelector(Vf(g))))){var w=d.createElement("link");Rr(w,"link",r),a==="style"&&(w[ye]=!0,w.onload=w.onerror=function(){aa(w)}),ts(w),d.head.appendChild(w)}}}function f3(r,a){tl.m(r,a);var c=Id;if(c&&r){var d=a&&typeof a.as=="string"?a.as:"script",m='link[rel="modulepreload"][as="'+Es(d)+'"][href="'+Es(r)+'"]',g=m;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Ld(r)}if(!ba.has(g)&&(r=k({rel:"modulepreload",href:r},a),ba.set(g,r),c.querySelector(m)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Vf(g)))return}d=c.createElement("link"),Rr(d,"link",r),ts(d),c.head.appendChild(d)}}}function m3(r,a,c){tl.S(r,a,c);var d=Id;if(d&&r){var m=bs(d).hoistableStyles,g=Od(r);a=a||"default";var w=m.get(g);if(!w){var I={loading:0,preload:null};if(w=d.querySelector(Ff(g)))I.loading=5;else{r=k({rel:"stylesheet",href:r,"data-precedence":a},c),(c=ba.get(g))&&BC(r,c);var q=w=d.createElement("link");ts(q),Rr(q,"link",r),q._p=new Promise(function(le,xe){q.onload=le,q.onerror=xe}),q.addEventListener("load",function(){I.loading|=1}),q.addEventListener("error",function(){I.loading|=2}),I.loading|=4,O0(w,a,d)}w={type:"stylesheet",instance:w,count:1,state:I},m.set(g,w)}}}function p3(r,a){tl.X(r,a);var c=Id;if(c&&r){var d=bs(c).hoistableScripts,m=Ld(r),g=d.get(m);g||(g=c.querySelector(Vf(m)),g||(r=k({src:r,async:!0},a),(a=ba.get(m))&&gC(r,a),g=c.createElement("script"),ts(g),Rr(g,"link",r),c.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},d.set(m,g))}}function B3(r,a){tl.M(r,a);var c=Id;if(c&&r){var d=bs(c).hoistableScripts,m=Ld(r),g=d.get(m);g||(g=c.querySelector(Vf(m)),g||(r=k({src:r,async:!0,type:"module"},a),(a=ba.get(m))&&gC(r,a),g=c.createElement("script"),ts(g),Rr(g,"link",r),c.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},d.set(m,g))}}function G2(r,a,c,d){var m=(m=gn.current)?zf(m):null;if(!m)throw Error(s(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(c=Od(c.href),a=bs(m).hoistableStyles,d=a.get(c),d||(d={type:"style",instance:null,count:0,state:null},a.set(c,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=Od(c.href);var g=bs(m).hoistableStyles,w=g.get(r);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(r,w),(g=m.querySelector(Ff(r)))?g._p||(w.instance=g,w.state.loading=5):(g=ba.get(r),g||(g={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},ba.set(r,g)),g3(m,r,g,w.state))),a&&d===null)throw Error(s(528,""));return w}if(a&&d!==null)throw Error(s(529,""));return null;case"script":return a=c.async,c=c.src,typeof c=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(c=Ld(c),a=bs(m).hoistableScripts,d=a.get(c),d||(d={type:"script",instance:null,count:0,state:null},a.set(c,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,r))}}function Od(r){return'href="'+Es(r)+'"'}function Ff(r){return'link[rel="stylesheet"]['+r+"]"}function H2(r){return k({},r,{"data-precedence":r.precedence,precedence:null})}function g3(r,a,c,d){if(a=r.querySelector('link[rel="preload"][as="style"]['+a+"]")){if(a[ye]!==!0){d.loading=1;return}}else a=r.createElement("link"),a[ye]=!0,a.onload=a.onerror=aa.bind(null,a),Rr(a,"link",c),ts(a),r.head.appendChild(a);d.preload=a,a.addEventListener("load",function(){return d.loading|=1}),a.addEventListener("error",function(){return d.loading|=2})}function Ld(r){return'[src="'+Es(r)+'"]'}function Vf(r){return"script[async]"+r}function q2(r,a,c){if(a.count++,a.instance===null)switch(a.type){case"style":var d=r.querySelector('style[data-href~="'+Es(c.href)+'"]');if(d)return a.instance=d,ts(d),d;var m=k({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),ts(d),Rr(d,"style",m),O0(d,c.precedence,r),a.instance=d;case"stylesheet":m=Od(c.href);var g=r.querySelector(Ff(m));if(g)return a.state.loading|=4,a.instance=g,ts(g),g;d=H2(c),(m=ba.get(m))&&BC(d,m),g=(r.ownerDocument||r).createElement("link"),ts(g);var w=g;return w._p=new Promise(function(I,q){w.onload=I,w.onerror=q}),Rr(g,"link",d),a.state.loading|=4,O0(g,c.precedence,r),a.instance=g;case"script":return g=Ld(c.src),(m=r.querySelector(Vf(g)))?(a.instance=m,ts(m),m):(d=c,(m=ba.get(g))&&(d=k({},c),gC(d,m)),r=r.ownerDocument||r,m=r.createElement("script"),ts(m),Rr(m,"link",d),r.head.appendChild(m),a.instance=m);case"void":return null;default:throw Error(s(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(d=a.instance,a.state.loading|=4,O0(d,c.precedence,r));return a.instance}function O0(r,a,c){for(var d=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=d.length?d[d.length-1]:null,g=m,w=0;w<d.length;w++){var I=d[w];if(I.dataset.precedence===a)g=I;else if(g!==m)break}g?g.parentNode.insertBefore(r,g.nextSibling):(a=c.nodeType===9?c.head:c,a.insertBefore(r,a.firstChild))}function BC(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.title==null&&(r.title=a.title)}function gC(r,a){r.crossOrigin==null&&(r.crossOrigin=a.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=a.referrerPolicy),r.integrity==null&&(r.integrity=a.integrity)}var L0=null;function $2(r,a,c){if(L0===null){var d=new Map,m=L0=new Map;m.set(c,d)}else m=L0,d=m.get(c),d||(d=new Map,m.set(c,d));if(d.has(r))return d;for(d.set(r,null),c=c.getElementsByTagName(r),m=0;m<c.length;m++){var g=c[m];if(!(g[Ce]||g[Xn]||r==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var w=g.getAttribute(a)||"";w=r+w;var I=d.get(w);I?I.push(g):d.set(w,[g])}}return d}function xC(r,a,c){r=r.ownerDocument||r,r.head.insertBefore(c,a==="title"?r.querySelector("head > title"):null)}function x3(r,a,c){if(c===1||a.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return r=a.disabled,typeof a.precedence=="string"&&r==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function J2(r,a){return r==="img"&&a.src!=null&&a.src!==""&&a.onLoad==null&&a.loading!=="lazy"}function K2(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function Q2(r){return(r.width||100)*(r.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Y2(r,a){typeof a.decode=="function"&&(r.imgCount++,a.complete||(r.imgBytes+=Q2(a),r.suspenseyImages.push(a)),r=y3.bind(r),a.decode().then(r,r))}function b3(r,a,c,d){if(c.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var m=Od(d.href),g=a.querySelector(Ff(m));if(g){a=g._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(r.count++,r=Uf.bind(r),a.then(r,r)),c.state.loading|=4,c.instance=g,ts(g);return}g=a.ownerDocument||a,d=H2(d),(m=ba.get(m))&&BC(d,m),g=g.createElement("link"),ts(g);var w=g;w._p=new Promise(function(I,q){w.onload=I,w.onerror=q}),Rr(g,"link",d),c.instance=g}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,a),(a=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=Uf.bind(r),a.addEventListener("load",c),a.addEventListener("error",c))}}var M0=0;function C3(r,a){return r.stylesheets&&r.count===0&&z0(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var d=setTimeout(function(){if(r.stylesheets&&z0(r,r.stylesheets),r.unsuspend){var g=r.unsuspend;r.unsuspend=null,g()}},6e4+a);0<r.imgBytes&&M0===0&&(M0=62500*P4());var m=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&z0(r,r.stylesheets),r.unsuspend)){var g=r.unsuspend;r.unsuspend=null,g()}},(r.imgBytes>M0?50:800)+a);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(m)}}:null}function X2(r){if(r.count===0&&(r.imgCount===0||!r.waitingForImages)){if(r.stylesheets)z0(r,r.stylesheets);else if(r.unsuspend){var a=r.unsuspend;r.unsuspend=null,a()}}}function Uf(){this.count--,X2(this)}function y3(){this.imgCount--,X2(this)}var P0=null;function z0(r,a){r.stylesheets=null,r.unsuspend!==null&&(r.count++,P0=new Map,a.forEach(v3,r),P0=null,Uf.call(r))}function v3(r,a){if(!(a.state.loading&4)){var c=P0.get(r);if(c)var d=c.get(null);else{c=new Map,P0.set(r,c);for(var m=r.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<m.length;g++){var w=m[g];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(c.set(w.dataset.precedence,w),d=w)}d&&c.set(null,d)}m=a.instance,w=m.getAttribute("data-precedence"),g=c.get(w)||d,g===d&&c.set(null,m),c.set(w,m),this.count++,d=Uf.bind(this),m.addEventListener("load",d),m.addEventListener("error",d),g?g.parentNode.insertBefore(m,g.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(m,r.firstChild)),a.state.loading|=4}}var Md={$$typeof:Ee,Provider:null,Consumer:null,_currentValue:Yn,_currentValue2:Yn,_threadCount:0};function _3(r,a,c,d,m,g,w,I,q){this.tag=1,this.containerInfo=r,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=Js(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Js(0),this.hiddenUpdates=Js(null),this.identifierPrefix=d,this.onUncaughtError=m,this.onCaughtError=g,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.transitionTypes=null,this.incompleteTransitions=new Map}function W2(r,a,c,d,m,g,w,I,q,le,xe,Re){return r=new _3(r,a,c,w,q,le,xe,Re,I),a=1,g===!0&&(a|=24),g=ot(3,null,null,a),r.current=g,g.stateNode=r,a=Rx(),a.refCount++,r.pooledCache=a,a.refCount++,g.memoizedState={element:d,isDehydrated:c,cache:a},Mx(g),r}function Z2(r){return r?(r=nt,r):nt}function eE(r,a,c,d,m,g){m=Z2(m),d.context===null?d.context=m:d.pendingContext=m,d=Fl(a),d.payload={element:c},g=g===void 0?null:g,g!==null&&(d.callback=g),c=Vl(r,d,a),c!==null&&(_i(c,r,a),bf(c,r,a))}function tE(r,a){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<a?c:a}}function bC(r,a){tE(r,a),(r=r.alternate)&&tE(r,a)}function nE(r){if(r.tag===13||r.tag===31){var a=fe(r,67108864);a!==null&&_i(a,r,67108864),bC(r,67108864)}}function sE(r){if(r.tag===13||r.tag===31){var a=Ji();a=Ks(a);var c=fe(r,a);c!==null&&_i(c,r,a),bC(r,a)}}var Pd=!0;function w3(r,a,c,d){var m=Qe.T;Qe.T=null;var g=st.p;try{st.p=2,CC(r,a,c,d)}finally{st.p=g,Qe.T=m}}function E3(r,a,c,d){var m=Qe.T;Qe.T=null;var g=st.p;
vendor: 4,183 bytes, line 49
49try{st.p=8,CC(r,a,c,d)}finally{st.p=g,Qe.T=m}}function CC(r,a,c,d){if(Pd){var m=yC(d);if(m===null)tC(r,a,d,F0,c),iE(r,d);else if(D3(m,r,a,c,d))d.stopPropagation();else if(iE(r,d),a&4&&-1<N3.indexOf(r)){for(;m!==null;){var g=Yt(m);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var w=An(g.pendingLanes);if(w!==0){var I=g;for(I.pendingLanes|=2,I.entangledLanes|=2;w;){var q=1<<31-Ut(w);I.entanglements[1]|=q,w&=~q}po(g),(Mn&6)===0&&(E0=Et()+500,Of(0))}}break;case 31:case 13:I=fe(g,2),I!==null&&_i(I,g,2),T0(),bC(g,2)}if(g=yC(d),g===null&&tC(r,a,d,F0,c),g===m)break;m=g}m!==null&&d.stopPropagation()}else tC(r,a,d,null,c)}}function yC(r){return r=Mi(r),vC(r)}var F0=null;function vC(r){if(F0=null,r=ut(r),r!==null){var a=l(r);if(a===null)r=null;else{var c=a.tag;if(c===13){if(r=u(a),r!==null)return r;r=null}else if(c===31){if(r=h(a),r!==null)return r;r=null}else if(c===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;r=null}else a!==r&&(r=null)}}return F0=r,null}function rE(r){switch(r){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(hs()){case xn:return 2;case wt:return 8;case rn:case jn:return 32;case On:return 268435456;default:return 32}default:return 32}}var _C=!1,Zl=null,ec=null,tc=null,Gf=new Map,Hf=new Map,nc=[],N3="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 iE(r,a){switch(r){case"focusin":case"focusout":Zl=null;break;case"dragenter":case"dragleave":ec=null;break;case"mouseover":case"mouseout":tc=null;break;case"pointerover":case"pointerout":Gf.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hf.delete(a.pointerId)}}function qf(r,a,c,d,m,g){return r===null||r.nativeEvent!==g?(r={blockedOn:a,domEventName:c,eventSystemFlags:d,nativeEvent:g,targetContainers:[m]},a!==null&&(a=Yt(a),a!==null&&nE(a)),r):(r.eventSystemFlags|=d,a=r.targetContainers,m!==null&&a.indexOf(m)===-1&&a.push(m),r)}function D3(r,a,c,d,m){switch(a){case"focusin":return Zl=qf(Zl,r,a,c,d,m),!0;case"dragenter":return ec=qf(ec,r,a,c,d,m),!0;case"mouseover":return tc=qf(tc,r,a,c,d,m),!0;case"pointerover":var g=m.pointerId;return Gf.set(g,qf(Gf.get(g)||null,r,a,c,d,m)),!0;case"gotpointercapture":return g=m.pointerId,Hf.set(g,qf(Hf.get(g)||null,r,a,c,d,m)),!0}return!1}function aE(r){var a=ut(r.target);if(a!==null){var c=l(a);if(c!==null){if(a=c.tag,a===13){if(a=u(c),a!==null){r.blockedOn=a,Oi(r.priority,function(){sE(c)});return}}else if(a===31){if(a=h(c),a!==null){r.blockedOn=a,Oi(r.priority,function(){sE(c)});return}}else if(a===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function V0(r){if(r.blockedOn!==null)return!1;for(var a=r.targetContainers;0<a.length;){var c=yC(r.nativeEvent);if(c===null){c=r.nativeEvent;var d=new c.constructor(c.type,c);
vendor: 4,839 bytes, line 49
49qc=d,c.target.dispatchEvent(d),qc=null}else return a=Yt(c),a!==null&&nE(a),r.blockedOn=c,!1;a.shift()}return!0}function oE(r,a,c){V0(r)&&c.delete(a)}function T3(){_C=!1,Zl!==null&&V0(Zl)&&(Zl=null),ec!==null&&V0(ec)&&(ec=null),tc!==null&&V0(tc)&&(tc=null),Gf.forEach(oE),Hf.forEach(oE)}function U0(r,a){r.blockedOn===a&&(r.blockedOn=null,_C||(_C=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,T3)))}var G0=null;function lE(r){G0!==r&&(G0=r,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){G0===r&&(G0=null);for(var a=0;a<r.length;a+=3){var c=r[a],d=r[a+1],m=r[a+2];if(typeof d!="function"){if(vC(d||c)===null)continue;break}var g=Yt(c);g!==null&&(r.splice(a,3),a-=3,rb(g,{pending:!0,data:m,method:c.method,action:d},d,m))}}))}function zd(r){function a(q){return U0(q,r)}Zl!==null&&U0(Zl,r),ec!==null&&U0(ec,r),tc!==null&&U0(tc,r),Gf.forEach(a),Hf.forEach(a);for(var c=0;c<nc.length;c++){var d=nc[c];d.blockedOn===r&&(d.blockedOn=null)}for(;0<nc.length&&(c=nc[0],c.blockedOn===null);)aE(c),c.blockedOn===null&&nc.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(d=0;d<c.length;d+=3){var m=c[d],g=c[d+1],w=m[_s]||null;if(typeof g=="function")w||lE(c);else if(w){var I=null;if(g&&g.hasAttribute("formAction")){if(m=g,w=g[_s]||null)I=w.formAction;else if(vC(m)!==null)continue}else I=w.action;typeof I=="function"?c[d+1]=I:(c.splice(d,3),d-=3),lE(c)}}}function cE(){function r(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(w){return m=w})},focusReset:"manual",scroll:"manual"})}function a(){m!==null&&(m(),m=null),d||setTimeout(c,20)}function c(){if(!d&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,m=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(c,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),m!==null&&(m(),m=null)}}}function wC(r){this._internalRoot=r}H0.prototype.render=wC.prototype.render=function(r){var a=this._internalRoot;if(a===null)throw Error(s(409));var c=a.current,d=Ji();eE(c,d,r,a,null,null)},H0.prototype.unmount=wC.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var a=r.containerInfo;eE(r.current,2,null,r,null,null),T0(),a[Br]=null}};function H0(r){this._internalRoot=r}H0.prototype.unstable_scheduleHydration=function(r){if(r){var a=ia();r={blockedOn:null,target:r,priority:a};for(var c=0;c<nc.length&&a!==0&&a<nc[c].priority;c++);nc.splice(c,0,r),c===0&&aE(r)}};var uE=e.version;if(uE!=="19.3.0")throw Error(s(527,uE,"19.3.0"));st.findDOMNode=function(r){var a=r._reactInternals;if(a===void 0)throw typeof r.render=="function"?Error(s(188)):(r=Object.keys(r).join(","),Error(s(268,r)));return r=p(a),r=r!==null?x(r):null,r=r===null?null:r.stateNode,r};var S3={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:Qe,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var q0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!q0.isDisabled&&q0.supportsFiber)try{Vn=q0.inject(S3),de=q0}catch{}}return Jf.createRoot=function(r,a){if(!o(r))throw Error(s(299));var c=!1,d="",m=Z_,g=ew,w=tw;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(d=a.identifierPrefix),a.onUncaughtError!==void 0&&(m=a.onUncaughtError),a.onCaughtError!==void 0&&(g=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError)),a=W2(r,1,!1,null,null,c,d,null,m,g,w,cE),r[Br]=a.current,eC(r),new wC(a)},Jf.hydrateRoot=function(r,a,c){if(!o(r))throw Error(s(299));var d=!1,m="",g=Z_,w=ew,I=tw,q=null;return c!=null&&(c.unstable_strictMode===!0&&(d=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onUncaughtError!==void 0&&(g=c.onUncaughtError),c.onCaughtError!==void 0&&(w=c.onCaughtError),c.onRecoverableError!==void 0&&(I=c.onRecoverableError),c.formState!==void 0&&(q=c.formState)),a=W2(r,1,!0,a,c??null,d,m,q,g,w,I,cE),a.context=Z2(null),c=a.current,d=Ji(),d=Ks(d),m=Fl(d),m.callback=null,Vl(c,m,d),c=d,a.current.lanes=c,Is(a,c),po(a),r[Br]=a.current,eC(r),new H0(a)},Jf.version="19.3.0",Jf}var CE;function F3(){if(CE)return DC.exports;CE=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),DC.exports=z3(),DC.exports}var V3=F3();const U3=dD(V3),Ao=Object.create(null);Ao.open="0";Ao.close="1";Ao.ping="2";Ao.pong="3";Ao.message="4";Ao.upgrade="5";Ao.noop="6";
vendor: 6,080 bytes, line 49
49const gB=Object.create(null);Object.keys(Ao).forEach(n=>{gB[Ao[n]]=n});const Cy={type:"error",data:"parser error"},fD=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",mD=typeof ArrayBuffer=="function",pD=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,g1=({type:n,data:e},t,s)=>fD&&e instanceof Blob?t?s(e):yE(e,s):mD&&(e instanceof ArrayBuffer||pD(e))?t?s(e):yE(new Blob([e]),s):s(Ao[n]+(e||"")),yE=(n,e)=>{const t=new FileReader;return t.onload=function(){const s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(n)};function vE(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let AC;function G3(n,e){if(fD&&n.data instanceof Blob)return n.data.arrayBuffer().then(vE).then(e);if(mD&&(n.data instanceof ArrayBuffer||pD(n.data)))return e(vE(n.data));g1(n,!1,t=>{AC||(AC=new TextEncoder),e(AC.encode(t))})}const _E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",em=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<_E.length;n++)em[_E.charCodeAt(n)]=n;const H3=n=>{let e=n.length*.75,t=n.length,s,o=0,l,u,h,f;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const p=new ArrayBuffer(e),x=new Uint8Array(p);for(s=0;s<t;s+=4)l=em[n.charCodeAt(s)],u=em[n.charCodeAt(s+1)],h=em[n.charCodeAt(s+2)],f=em[n.charCodeAt(s+3)],x[o++]=l<<2|u>>4,x[o++]=(u&15)<<4|h>>2,x[o++]=(h&3)<<6|f&63;return p},q3=typeof ArrayBuffer=="function",x1=(n,e)=>{if(typeof n!="string")return{type:"message",data:BD(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:$3(n.substring(1),e)}:gB[t]?n.length>1?{type:gB[t],data:n.substring(1)}:{type:gB[t]}:Cy},$3=(n,e)=>{if(q3){const t=H3(n);return BD(t,e)}else return{base64:!0,data:n}},BD=(n,e)=>{switch(e){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},gD="�",J3=(n,e)=>{const t=n.length,s=new Array(t);let o=0;n.forEach((l,u)=>{g1(l,!1,h=>{s[u]=h,++o===t&&e(s.join(gD))})})},K3=(n,e)=>{const t=n.split(gD),s=[];for(let o=0;o<t.length;o++){const l=x1(t[o],e);if(s.push(l),l.type==="error")break}return s};function Q3(){return new TransformStream({transform(n,e){G3(n,t=>{const s=t.length;let o;if(s<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,s);else if(s<65536){o=new Uint8Array(3);const l=new DataView(o.buffer);l.setUint8(0,126),l.setUint16(1,s)}else{o=new Uint8Array(9);const l=new DataView(o.buffer);l.setUint8(0,127),l.setBigUint64(1,BigInt(s))}n.data&&typeof n.data!="string"&&(o[0]|=128),e.enqueue(o),e.enqueue(t)})}})}let kC;function $0(n){return n.reduce((e,t)=>e+t.length,0)}function J0(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let s=0;for(let o=0;o<e;o++)t[o]=n[0][s++],s===n[0].length&&(n.shift(),s=0);return n.length&&s<n[0].length&&(n[0]=n[0].slice(s)),t}function Y3(n,e){kC||(kC=new TextDecoder);const t=[];let s=0,o=-1,l=!1;return new TransformStream({transform(u,h){for(t.push(u);;){if(s===0){if($0(t)<1)break;const f=J0(t,1);l=(f[0]&128)===128,o=f[0]&127,o<126?s=3:o===126?s=1:s=2}else if(s===1){if($0(t)<2)break;const f=J0(t,2);o=new DataView(f.buffer,f.byteOffset,f.length).getUint16(0),s=3}else if(s===2){if($0(t)<8)break;const f=J0(t,8),p=new DataView(f.buffer,f.byteOffset,f.length),x=p.getUint32(0);if(x>Math.pow(2,21)-1){h.enqueue(Cy);break}o=x*Math.pow(2,32)+p.getUint32(4),s=3}else{if($0(t)<o)break;const f=J0(t,o);h.enqueue(x1(l?f:kC.decode(f),e)),s=0}if(o===0||o>n){h.enqueue(Cy);break}}}})}const xD=4;function rr(n){if(n)return X3(n)}function X3(n){for(var e in rr.prototype)n[e]=rr.prototype[e];return n}rr.prototype.on=rr.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};rr.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};rr.prototype.off=rr.prototype.removeListener=rr.prototype.removeAllListeners=rr.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,o=0;o<t.length;o++)if(s=t[o],s===e||s.fn===e){t.splice(o,1);break}return t.length===0&&delete this._callbacks["$"+n],this};rr.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,o=t.length;s<o;++s)t[s].apply(this,e)}return this};rr.prototype.emitReserved=rr.prototype.emit;rr.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};rr.prototype.hasListeners=function(n){return!!this.listeners(n).length};const Ng=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),va=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),W3="arraybuffer";function bD(n,...e){return e.reduce((t,s)=>(n.hasOwnProperty(s)&&(t[s]=n[s]),t),{})}const Z3=va.setTimeout,ek=va.clearTimeout;function Dg(n,e){e.useNativeTimers?(n.setTimeoutFn=Z3.bind(va),n.clearTimeoutFn=ek.bind(va)):(n.setTimeoutFn=va.setTimeout.bind(va),n.clearTimeoutFn=va.clearTimeout.bind(va))}const tk=1.33;function nk(n){return typeof n=="string"?sk(n):Math.ceil((n.byteLength||n.size)*tk)}function sk(n){let e=0,t=0;for(let s=0,o=n.length;s<o;s++)e=n.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function CD(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function rk(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function ik(n){let e={},t=n.split("&");for(let s=0,o=t.length;s<o;s++){let l=t[s].split("=");e[decodeURIComponent(l[0])]=decodeURIComponent(l[1])}return e}
vendor: 6,207 bytes, line 49
49class ak extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}}class b1 extends rr{constructor(e){super(),this.writable=!1,Dg(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new ak(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=x1(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=rk(e);return t.length?"?"+t:""}}class ok extends b1{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};K3(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,J3(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=CD()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let yD=!1;try{yD=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const lk=yD;function ck(){}class uk extends ok{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){const s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(o,l)=>{this.onError("xhr post error",o,l)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}}let rh=class xB extends rr{constructor(e,t,s){super(),this.createRequest=e,Dg(this,s),this._opts=s,this._method=s.method||"GET",this._uri=t,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var e;const t=bD(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(t);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&s.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var o;s.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=xB.requestsCount++,xB.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=ck,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete xB.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};rh.requestsCount=0;rh.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",wE);else if(typeof addEventListener=="function"){const n="onpagehide"in va?"pagehide":"unload";addEventListener(n,wE,!1)}}function wE(){for(let n in rh.requests)rh.requests.hasOwnProperty(n)&&rh.requests[n].abort()}const dk=(function(){const n=vD({xdomain:!1});return n&&n.responseType!==null})();class hk extends uk{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=dk&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new rh(vD,this.uri(),e)}}function vD(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||lk))return new XMLHttpRequest}catch{}if(!e)try{return new va[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const _D=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class fk extends b1{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,s=_D?{}:bD(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(o){return this.emitReserved("error",o)}
vendor: 10,324 bytes, line 49
49this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const s=e[t],o=t===e.length-1;g1(s,this.supportsBinary,l=>{try{this.doWrite(s,l)}catch{}o&&Ng(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=CD()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const RC=va.WebSocket||va.MozWebSocket;class mk extends fk{createSocket(e,t,s){return _D?new RC(e,t,s):t?new RC(e,t):new RC(e)}doWrite(e,t){this.ws.send(t)}}class pk extends b1{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=Y3(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),o=Q3();o.readable.pipeTo(e.writable),this._writer=o.writable.getWriter();const l=()=>{s.read().then(({done:h,value:f})=>{h||(this.onPacket(f),l())}).catch(h=>{})};l();const u={type:"open"};this.query.sid&&(u.data=`{"sid":"${this.query.sid}"}`),this._writer.write(u).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const s=e[t],o=t===e.length-1;this._writer.write(s).then(()=>{o&&Ng(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Bk={websocket:mk,webtransport:pk,polling:hk},gk=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,xk=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function yy(n){if(n.length>8e3)throw"URI too long";const e=n,t=n.indexOf("["),s=n.indexOf("]");t!=-1&&s!=-1&&(n=n.substring(0,t)+n.substring(t,s).replace(/:/g,";")+n.substring(s,n.length));let o=gk.exec(n||""),l={},u=14;for(;u--;)l[xk[u]]=o[u]||"";return t!=-1&&s!=-1&&(l.source=e,l.host=l.host.substring(1,l.host.length-1).replace(/;/g,":"),l.authority=l.authority.replace("[","").replace("]","").replace(/;/g,":"),l.ipv6uri=!0),l.pathNames=bk(l,l.path),l.queryKey=Ck(l,l.query),l}function bk(n,e){const t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function Ck(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,o,l){o&&(t[o]=l)}),t}const vy=typeof addEventListener=="function"&&typeof removeEventListener=="function",bB=[];vy&&addEventListener("offline",()=>{bB.forEach(n=>n())},!1);class yc extends rr{constructor(e,t){if(super(),this.binaryType=W3,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const s=yy(e);t.hostname=s.host,t.secure=s.protocol==="https"||s.protocol==="wss",t.port=s.port,s.query&&(t.query=s.query)}else t.host&&(t.hostname=yy(t.host).host);Dg(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(s=>{const o=s.prototype.name;this.transports.push(o),this._transportsByName[o]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=ik(this.opts.query)),vy&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},bB.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=xD,t.transport=e,this.id&&(t.sid=this.id);const s=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&yc.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",yc.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let s=0;s<this.writeBuffer.length;s++){const o=this.writeBuffer[s].data;if(o&&(t+=nk(o)),s>0&&t>this._maxPayload)return this.writeBuffer.slice(0,s);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,Ng(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,s){return this._sendPacket("message",e,t,s),this}send(e,t,s){return this._sendPacket("message",e,t,s),this}_sendPacket(e,t,s,o){if(typeof t=="function"&&(o=t,t=void 0),typeof s=="function"&&(o=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const l={type:e,data:t,options:s};this.emitReserved("packetCreate",l),this.writeBuffer.push(l),o&&this.once("flush",o),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}_onError(e){if(yc.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),vy&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=bB.indexOf(this._offlineEventListener);s!==-1&&bB.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}yc.protocol=xD;class yk extends yc{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;yc.priorWebsocketSuccess=!1;const o=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",b=>{if(!s)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;yc.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(x(),this.setTransport(t),t.send([{type:"upgrade"}
vendor: 9,982 bytes, line 49
49]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const C=new Error("probe error");C.transport=t.name,this.emitReserved("upgradeError",C)}}))};function l(){s||(s=!0,x(),t.close(),t=null)}const u=b=>{const C=new Error("probe error: "+b);C.transport=t.name,l(),this.emitReserved("upgradeError",C)};function h(){u("transport closed")}function f(){u("socket closed")}function p(b){t&&b.name!==t.name&&l()}const x=()=>{t.removeListener("open",o),t.removeListener("error",u),t.removeListener("close",h),this.off("close",f),this.off("upgrading",p)};t.once("open",o),t.once("error",u),t.once("close",h),this.once("close",f),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}}let vk=class extends yk{constructor(e,t={}){const s=typeof e=="object",o=s?{...e}:{...t};(!o.transports||o.transports&&typeof o.transports[0]=="string")&&(o.transports=(o.transports||["polling","websocket","webtransport"]).map(l=>Bk[l]).filter(l=>!!l)),super(s?o:e,o)}};function _k(n,e="",t){let s=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),s=yy(n)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const l=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+l+":"+s.port+e,s.href=s.protocol+"://"+l+(t&&t.port===s.port?"":":"+s.port),s}const wk=typeof ArrayBuffer=="function",Ek=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,wD=Object.prototype.toString,Nk=typeof Blob=="function"||typeof Blob<"u"&&wD.call(Blob)==="[object BlobConstructor]",Dk=typeof File=="function"||typeof File<"u"&&wD.call(File)==="[object FileConstructor]";function C1(n){return wk&&(n instanceof ArrayBuffer||Ek(n))||Nk&&n instanceof Blob||Dk&&n instanceof File}function CB(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,s=n.length;t<s;t++)if(CB(n[t]))return!0;return!1}if(C1(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return CB(n.toJSON(),!0);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&CB(n[t]))return!0;return!1}function Tk(n){const e=[],t=n.data,s=n;return s.data=yB(t,e),s.attachments=e.length,{packet:s,buffers:e}}function yB(n,e,t){if(!n)return n;if(C1(n)){const s={_placeholder:!0,num:e.length};return e.push(n),s}else if(Array.isArray(n)){const s=new Array(n.length);for(let o=0;o<n.length;o++)s[o]=yB(n[o],e);return s}else if(typeof n=="object"&&!(n instanceof Date)){if(n.toJSON&&typeof n.toJSON=="function"&&!t)return yB(n.toJSON(),e,!0);const s={};for(const o in n)Object.prototype.hasOwnProperty.call(n,o)&&(s[o]=yB(n[o],e));return s}return n}function Sk(n,e){return n.data=_y(n.data,e),delete n.attachments,n}function _y(n,e){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<e.length)return e[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let t=0;t<n.length;t++)n[t]=_y(n[t],e);else if(typeof n=="object")for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=_y(n[t],e));return n}const jk=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var vn;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(vn||(vn={}));class Ak{constructor(e){this.replacer=e}encode(e){return(e.type===vn.EVENT||e.type===vn.ACK)&&CB(e)?this.encodeAsBinary({type:e.type===vn.EVENT?vn.BINARY_EVENT:vn.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===vn.BINARY_EVENT||e.type===vn.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=Tk(e),s=this.encodeAsString(t.packet),o=t.buffers;return o.unshift(s),o}}class y1 extends rr{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const s=t.type===vn.BINARY_EVENT;s||t.type===vn.BINARY_ACK?(t.type=s?vn.EVENT:vn.ACK,this.reconstructor=new kk(t)):super.emitReserved("decoded",t)}else if(C1(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const s={type:Number(e.charAt(0))};if(vn[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===vn.BINARY_EVENT||s.type===vn.BINARY_ACK){const l=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const u=e.substring(l,t);if(u!=Number(u)||e.charAt(t)!=="-")throw new Error("Illegal attachments");const h=Number(u);if(!Rk(h)||h<1)throw new Error("Illegal attachments");if(h>this.opts.maxAttachments)throw new Error("too many attachments");s.attachments=h}if(e.charAt(t+1)==="/"){const l=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(l,t)}else s.nsp="/";const o=e.charAt(t+1);if(o!==""&&Number(o)==o){const l=t+1;for(;++t;){const u=e.charAt(t);if(u==null||Number(u)!=u){--t;break}if(t===e.length)break}s.id=Number(e.substring(l,t+1))}if(e.charAt(++t)){const l=this.tryParse(e.substr(t));if(y1.isPayloadValid(s.type,l))s.data=l;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case vn.CONNECT:return EE(t);case vn.DISCONNECT:return t===void 0;case vn.CONNECT_ERROR:return typeof t=="string"||EE(t);case vn.EVENT:case vn.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&jk.indexOf(t[0])===-1);case vn.ACK:case vn.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class kk{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=Sk(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Rk=Number.isInteger||function(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n};function EE(n){return Object.prototype.toString.call(n)==="[object Object]"}const Ik=Object.freeze(Object.defineProperty({__proto__:null,Decoder:y1,Encoder:Ak,get PacketType(){return vn}},Symbol.toStringTag,{value:"Module"}));function Pa(n,e,t){return n.on(e,t),function(){n.off(e,t)}}const Ok=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ED extends rr{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Pa(e,"open",this.onopen.bind(this)),Pa(e,"packet",this.onpacket.bind(this)),Pa(e,"error",this.onerror.bind(this)),Pa(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,o,l;if(Ok.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const u={type:vn.EVENT,data:t};if(u.options={},u.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const x=this.ids++,b=t.pop();this._registerAckCallback(x,b),u.id=x}const h=(o=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||o===void 0?void 0:o.writable,f=this.connected&&!(!((l=this.io.engine)===null||l===void 0)&&l._hasPingExpired());return this.flags.volatile&&!h||(f?(this.notifyOutgoingListeners(u),this.packet(u)):this.sendBuffer.push(u)),this.flags={},this}_registerAckCallback(e,t){var s;const o=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(o===void 0){this.acks[e]=t;return}const l=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let h=0;h<this.sendBuffer.length;h++)this.sendBuffer[h].id===e&&this.sendBuffer.splice(h,1);t.call(this,new Error("operation has timed out"))},o),u=(...h)=>{this.io.clearTimeoutFn(l),t.apply(this,h)};u.withError=!0,this.acks[e]=u}emitWithAck(e,...t){return new Promise((s,o)=>{const l=(u,h)=>u?o(u):s(h);l.withError=!0,t.push(l),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((o,...l)=>(this._queue[0],o!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(o)):(this._queue.shift(),t&&t(null,...l)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];
vendor: 12,172 bytes, lines 49-74
49t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:vn.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){const s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case vn.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case vn.EVENT:case vn.BINARY_EVENT:this.onevent(e);break;case vn.ACK:case vn.BINARY_ACK:this.onack(e);break;case vn.DISCONNECT:this.ondisconnect();break;case vn.CONNECT_ERROR:this.destroy();const s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let s=!1;return function(...o){s||(s=!0,t.packet({type:vn.ACK,id:e,data:o}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:vn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const s of t)s.apply(this,e.data)}}}function Dh(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}Dh.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=(Math.floor(e*10)&1)==0?n-t:n+t}return Math.min(n,this.max)|0};Dh.prototype.reset=function(){this.attempts=0};Dh.prototype.setMin=function(n){this.ms=n};Dh.prototype.setMax=function(n){this.max=n};Dh.prototype.setJitter=function(n){this.jitter=n};class wy extends rr{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,Dg(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Dh({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const o=t.parser||Ik;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new vk(this.uri,this.opts);const t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const o=Pa(t,"open",function(){s.onopen(),e&&e()}),l=h=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",h),e?e(h):this.maybeReconnectOnOpen()},u=Pa(t,"error",l);if(this._timeout!==!1){const h=this._timeout,f=this.setTimeoutFn(()=>{o(),l(new Error("timeout")),t.close()},h);this.opts.autoUnref&&f.unref(),this.subs.push(()=>{this.clearTimeoutFn(f)})}return this.subs.push(o),this.subs.push(u),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Pa(e,"ping",this.onping.bind(this)),Pa(e,"data",this.ondata.bind(this)),Pa(e,"error",this.onerror.bind(this)),Pa(e,"close",this.onclose.bind(this)),Pa(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){Ng(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new ED(this,e,t),this.nsps[e]=s),s}_destroy(e){const t=Object.keys(this.nsps);for(const s of t)if(this.nsps[s].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(o=>{o?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",o)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Kf={};function vB(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=_k(n,e.path||"/socket.io"),s=t.source,o=t.id,l=t.path,u=Kf[o]&&l in Kf[o].nsps,h=e.forceNew||e["force new connection"]||e.multiplex===!1||u;let f;return h?f=new wy(s,e):(Kf[o]||(Kf[o]=new wy(s,e)),f=Kf[o]),t.query&&!e.query&&(e.query=t.queryKey),f.socket(t.path,e)}Object.assign(vB,{Manager:wy,Socket:ED,io:vB,connect:vB});const W=vB({transports:["websocket"]});function NE({originalText:n,senderLanguage:e,userLanguage:t}){const[s,o]=y.useState(n),[l,u]=y.useState(!1);return y.useEffect(()=>{if(!e||e===t||!n){o(n);return}u(!0),W.emit("request_translation",{text:n,targetLang:t},h=>{h&&h.translatedText?o(h.translatedText):o(n),u(!1)})},[n,e,t]),i.jsx("span",{className:l?"opacity-70 transition-opacity":"transition-opacity",children:s})}const Lk=["idiot","stupid","dumb","fool","moron","imbecile","ass","asshole","bitch","bastard","crap","shit","fuck","damn","dick","pussy","whore","slut","cunt","fag","nigger","nigga","retard","tonto","idiota","estúpido","estupido","imbécil","imbecil","pendejo","cabrón","cabron","puta","puto","mierda","joder","coño","carajo","verga","chinga","zorra","perra"];function DE(n){if(!n)return n;let e=n;return Lk.forEach(t=>{const s=new RegExp(`\\b${t}\\b`,"gi");e=e.replace(s,o=>"*".repeat(o.length))}),e}/** 50 * @license lucide-react v0.546.0 - ISC 51 * 52 * This source code is licensed under the ISC license. 53 * See the LICENSE file in the root directory of this source tree. 54 */const Mk=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pk=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase()),TE=n=>{const e=Pk(n);return e.charAt(0).toUpperCase()+e.slice(1)},ND=(...n)=>n.filter((e,t,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===t).join(" ").trim(),zk=n=>{for(const e in n)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/** 55 * @license lucide-react v0.546.0 - ISC 56 * 57 * This source code is licensed under the ISC license. 58 * See the LICENSE file in the root directory of this source tree. 59 */var Fk={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 60 * @license lucide-react v0.546.0 - ISC 61 * 62 * This source code is licensed under the ISC license. 63 * See the LICENSE file in the root directory of this source tree. 64 */const Vk=y.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:s,className:o="",children:l,iconNode:u,...h},f)=>y.createElement("svg",{ref:f,...Fk,width:e,height:e,stroke:n,strokeWidth:s?Number(t)*24/Number(e):t,className:ND("lucide",o),...!l&&!zk(h)&&{"aria-hidden":"true"},...h},[...u.map(([p,x])=>y.createElement(p,x)),...Array.isArray(l)?l:[l]]));/** 65 * @license lucide-react v0.546.0 - ISC 66 * 67 * This source code is licensed under the ISC license. 68 * See the LICENSE file in the root directory of this source tree. 69 */const Ge=(n,e)=>{const t=y.forwardRef(({className:s,...o},l)=>y.createElement(Vk,{ref:l,iconNode:e,className:ND(`lucide-${Mk(TE(n))}`,`lucide-${n}`,s),...o}));return t.displayName=TE(n),t};/** 70 * @license lucide-react v0.546.0 - ISC 71 * 72 * This source code is licensed under the ISC license. 73 * See the LICENSE file in the root directory of this source tree. 74 */const Uk=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l
74-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Gk=Ge("activity",Uk);/** 75 * @license lucide-react v0.546.0 - ISC 76 * 77 * This source code is licensed under the ISC license. 78 * See the LICENSE file in the root directory of this source tree. 79 */const Hk=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],HB=Ge("arrow-right",Hk);/** 80 * @license lucide-react v0.546.0 - ISC 81 * 82 * This source code is licensed under the ISC license. 83 * See the LICENSE file in the root directory of this source tree. 84 */const qk=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],$k=Ge("arrow-up-right",qk);/** 85 * @license lucide-react v0.546.0 - ISC 86 * 87 * This source code is licensed under the ISC license. 88 * See the LICENSE file in the root directory of this source tree. 89 */const Jk=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],Kk=Ge("at-sign",Jk);/** 90 * @license lucide-react v0.546.0 - ISC 91 * 92 * This source code is licensed under the ISC license. 93 * See the LICENSE file in the root directory of this source tree. 94 */const Qk=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],IC=Ge("ban",Qk);/** 95 * @license lucide-react v0.546.0 - ISC 96 * 97 * This source code is licensed under the ISC license. 98 * See the LICENSE file in the root directory of this source tree. 99 */const Yk=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Ey=Ge("bell",Yk);/** 100 * @license lucide-react v0.546.0 - ISC 101 * 102 * This source code is licensed under the ISC license. 103 * See the LICENSE file in the root directory of this source tree. 104 */const Xk=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],gl=Ge("bot",Xk);/** 105 * @license lucide-react v0.546.0 - ISC 106 * 107 * This source code is licensed under the ISC license. 108 * See the LICENSE file in the root directory of this source tree. 109 */const Wk=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],OC=Ge("brain",Wk);/** 110 * @license lucide-react v0.546.0 - ISC 111 * 112 * This source code is licensed under the ISC license. 113 * See the LICENSE file in the root directory of this source tree. 114 */const Zk=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],v1=Ge("calendar",Zk);/** 115 * @license lucide-react v0.546.0 - ISC 116 * 117 * This source code is licensed under the ISC license. 118 * See the LICENSE file in the root directory of this source tree. 119 */const eR=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],tR=Ge("chart-column",eR);/** 120 * @license lucide-react v0.546.0 - ISC 121 * 122 * This source code is licensed under the ISC license. 123 * See the LICENSE file in the root directory of this source tree. 124 */const nR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Jr=Ge("check",nR);/** 125 * @license lucide-react v0.546.0 - ISC 126 * 127 * This source code is licensed under the ISC license. 128 * See the LICENSE file in the root directory of this source tree. 129 */const sR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],rR=Ge("chevron-down",sR);/** 130 * @license lucide-react v0.546.0 - ISC 131 * 132 * This source code is licensed under the ISC license. 133 * See the LICENSE file in the root directory of this source tree. 134 */const iR=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],DD=Ge("chevron-left",iR);/** 135 * @license lucide-react v0.546.0 - ISC 136 * 137 * This source code is licensed under the ISC license. 138 * See the LICENSE file in the root directory of this source tree. 139 */const aR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Cu=Ge("chevron-right",aR);/** 140 * @license lucide-react v0.546.0 - ISC 141 * 142 * This source code is licensed under the ISC license. 143 * See the LICENSE file in the root directory of this source tree. 144 */const oR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],lR=Ge("chevron-up",oR);/** 145 * @license lucide-react v0.546.0 - ISC 146 * 147 * This source code is licensed under the ISC license. 148 * See the LICENSE file in the root directory of this source tree. 149 */const cR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],tp=Ge("circle-alert",cR);/** 150 * @license lucide-react v0.546.0 - ISC 151 * 152 * This source code is licensed under the ISC license. 153 * See the LICENSE file in the root directory of this source tree. 154 */const uR=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],SE=Ge("circle-check-big",uR);/** 155 * @license lucide-react v0.546.0 - ISC 156 * 157 * This source code is licensed under the ISC license. 158 * See the LICENSE file in the root directory of this source tree. 159 */const dR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],di=Ge("circle-check",dR);/** 160 * @license lucide-react v0.546.0 - ISC 161 * 162 * This source code is licensed under the ISC license. 163 * See the LICENSE file in the root directory of this source tree. 164 */const hR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],fR=Ge("circle-x",hR);/** 165 * @license lucide-react v0.546.0 - ISC 166 * 167 * This source code is licensed under the ISC license. 168 * See the LICENSE file in the root directory of this source tree. 169 */const mR=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],jE=Ge("clock",mR);/** 170 * @license lucide-react v0.546.0 - ISC 171 * 172 * This source code is licensed under the ISC license. 173 * See the LICENSE file in the root directory of this source tree. 174 */const pR=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],BR=Ge("cloud-upload",pR);/** 175 * @license lucide-react v0.546.0 - ISC 176 * 177 * This source code is licensed under the ISC license. 178 * See the LICENSE file in the root directory of this source tree. 179 */const gR=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],xR=Ge("coins",gR);/** 180 * @license lucide-react v0.546.0 - ISC 181 * 182 * This source code is licensed under the ISC license. 183 * See the LICENSE file in the root directory of this source tree. 184 */const bR=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Ny=Ge("copy",bR);/** 185 * @license lucide-react v0.546.0 - ISC 186 * 187 * This source code is licensed under the ISC license. 188 * See the LICENSE file in the root directory of this source tree. 189 */const CR=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}
189],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],yR=Ge("cpu",CR);/** 190 * @license lucide-react v0.546.0 - ISC 191 * 192 * This source code is licensed under the ISC license. 193 * See the LICENSE file in the root directory of this source tree. 194 */const vR=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],AE=Ge("crown",vR);/** 195 * @license lucide-react v0.546.0 - ISC 196 * 197 * This source code is licensed under the ISC license. 198 * See the LICENSE file in the root directory of this source tree. 199 */const _R=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],_B=Ge("dollar-sign",_R);/** 200 * @license lucide-react v0.546.0 - ISC 201 * 202 * This source code is licensed under the ISC license. 203 * See the LICENSE file in the root directory of this source tree. 204 */const wR=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],cm=Ge("download",wR);/** 205 * @license lucide-react v0.546.0 - ISC 206 * 207 * This source code is licensed under the ISC license. 208 * See the LICENSE file in the root directory of this source tree. 209 */const ER=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],NR=Ge("earth",ER);/** 210 * @license lucide-react v0.546.0 - ISC 211 * 212 * This source code is licensed under the ISC license. 213 * See the LICENSE file in the root directory of this source tree. 214 */const DR=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Hd=Ge("external-link",DR);/** 215 * @license lucide-react v0.546.0 - ISC 216 * 217 * This source code is licensed under the ISC license. 218 * See the LICENSE file in the root directory of this source tree. 219 */const TR=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],rl=Ge("eye-off",TR);/** 220 * @license lucide-react v0.546.0 - ISC 221 * 222 * This source code is licensed under the ISC license. 223 * See the LICENSE file in the root directory of this source tree. 224 */const SR=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Dy=Ge("eye",SR);/** 225 * @license lucide-react v0.546.0 - ISC 226 * 227 * This source code is licensed under the ISC license. 228 * See the LICENSE file in the root directory of this source tree. 229 */const jR=[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]],AR=Ge("file-code-2",jR);/** 230 * @license lucide-react v0.546.0 - ISC 231 * 232 * This source code is licensed under the ISC license. 233 * See the LICENSE file in the root directory of this source tree. 234 */const kR=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],wB=Ge("file-text",kR);/** 235 * @license lucide-react v0.546.0 - ISC 236 * 237 * This source code is licensed under the ISC license. 238 * See the LICENSE file in the root directory of this source tree. 239 */const RR=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],IR=Ge("file",RR);/** 240 * @license lucide-react v0.546.0 - ISC 241 * 242 * This source code is licensed under the ISC license. 243 * See the LICENSE file in the root directory of this source tree. 244 */const OR=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",ke
244y:"1slcih"}]],TD=Ge("flame",OR);/** 245 * @license lucide-react v0.546.0 - ISC 246 * 247 * This source code is licensed under the ISC license. 248 * See the LICENSE file in the root directory of this source tree. 249 */const LR=[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]],MR=Ge("gamepad-2",LR);/** 250 * @license lucide-react v0.546.0 - ISC 251 * 252 * This source code is licensed under the ISC license. 253 * See the LICENSE file in the root directory of this source tree. 254 */const PR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],vu=Ge("globe",PR);/** 255 * @license lucide-react v0.546.0 - ISC 256 * 257 * This source code is licensed under the ISC license. 258 * See the LICENSE file in the root directory of this source tree. 259 */const zR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],FR=Ge("grid-3x3",zR);/** 260 * @license lucide-react v0.546.0 - ISC 261 * 262 * This source code is licensed under the ISC license. 263 * See the LICENSE file in the root directory of this source tree. 264 */const VR=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],qB=Ge("hash",VR);/** 265 * @license lucide-react v0.546.0 - ISC 266 * 267 * This source code is licensed under the ISC license. 268 * See the LICENSE file in the root directory of this source tree. 269 */const UR=[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]],GR=Ge("headphones",UR);/** 270 * @license lucide-react v0.546.0 - ISC 271 * 272 * This source code is licensed under the ISC license. 273 * See the LICENSE file in the root directory of this source tree. 274 */const HR=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],Sm=Ge("heart",HR);/** 275 * @license lucide-react v0.546.0 - ISC 276 * 277 * This source code is licensed under the ISC license. 278 * See the LICENSE file in the root directory of this source tree. 279 */const qR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Lu=Ge("image",qR);/** 280 * @license lucide-react v0.546.0 - ISC 281 * 282 * This source code is licensed under the ISC license. 283 * See the LICENSE file in the root directory of this source tree. 284 */const $R=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],JR=Ge("info",$R);/** 285 * @license lucide-react v0.546.0 - ISC 286 * 287 * This source code is licensed under the ISC license. 288 * See the LICENSE file in the root directory of this source tree. 289 */const KR=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],ih=Ge("key",KR);/** 290 * @license lucide-react v0.546.0 - ISC 291 * 292 * This source code is licensed under the ISC license. 293 * See the LICENSE file in the root directory of this source tree. 294 */const QR=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],SD=Ge("layers",QR);/** 295 * @license lucide-react v0.546.0 - ISC 296 * 297 * This source code is licensed under the ISC license. 298 * See the LICENSE file in the root directory of this source tree. 299 */const YR=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],kE=Ge("link",YR);/** 300 * @license lucide-react v0.546.0 - ISC 301 * 302 * This source code is licensed under the ISC license. 303 * See the LICENSE file in the root directory of this source tree. 304 */const XR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}
304]],ah=Ge("loader-circle",XR);/** 305 * @license lucide-react v0.546.0 - ISC 306 * 307 * This source code is licensed under the ISC license. 308 * See the LICENSE file in the root directory of this source tree. 309 */const WR=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],jD=Ge("lock",WR);/** 310 * @license lucide-react v0.546.0 - ISC 311 * 312 * This source code is licensed under the ISC license. 313 * See the LICENSE file in the root directory of this source tree. 314 */const ZR=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],eI=Ge("log-out",ZR);/** 315 * @license lucide-react v0.546.0 - ISC 316 * 317 * This source code is licensed under the ISC license. 318 * See the LICENSE file in the root directory of this source tree. 319 */const tI=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Ty=Ge("mail",tI);/** 320 * @license lucide-react v0.546.0 - ISC 321 * 322 * This source code is licensed under the ISC license. 323 * See the LICENSE file in the root directory of this source tree. 324 */const nI=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],sI=Ge("menu",nI);/** 325 * @license lucide-react v0.546.0 - ISC 326 * 327 * This source code is licensed under the ISC license. 328 * See the LICENSE file in the root directory of this source tree. 329 */const rI=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Th=Ge("message-circle",rI);/** 330 * @license lucide-react v0.546.0 - ISC 331 * 332 * This source code is licensed under the ISC license. 333 * See the LICENSE file in the root directory of this source tree. 334 */const iI=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],fl=Ge("message-square",iI);/** 335 * @license lucide-react v0.546.0 - ISC 336 * 337 * This source code is licensed under the ISC license. 338 * See the LICENSE file in the root directory of this source tree. 339 */const aI=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]],$B=Ge("mic-off",aI);/** 340 * @license lucide-react v0.546.0 - ISC 341 * 342 * This source code is licensed under the ISC license. 343 * See the LICENSE file in the root directory of this source tree. 344 */const oI=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],hh=Ge("mic",oI);/** 345 * @license lucide-react v0.546.0 - ISC 346 * 347 * This source code is licensed under the ISC license. 348 * See the LICENSE file in the root directory of this source tree. 349 */const lI=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],JB=Ge("music",lI);/** 350 * @license lucide-react v0.546.0 - ISC 351 * 352 * This source code is licensed under the ISC license. 353 * See the LICENSE file in the root directory of this source tree. 354 */const cI=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],ko=Ge("palette",cI);/** 355 * @license lucide-react v0.546.0 - ISC 356 * 357 * This source code is licensed under the ISC license. 358 * See the LICENSE file in the root directory of this source tree. 359 */const uI=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],dI=Ge("paperclip",uI);/** 360 * @license lucide-react v0.546.0 - ISC 361 * 362 * This source code is licensed under the ISC license. 363 * See the LICENSE file in the root directory of this source tree. 364 */const hI=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],_1=Ge("pause",hI);/** 365 * @license lucide-react v0.546.0 - ISC 366 * 367 * This source code is licensed under the ISC license. 368 * See the LICENSE file in the root directory of this source tree. 369 */const fI=[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]],mI=Ge("percent",fI);/** 370 * @license lucide-react v0.546.0 - ISC 371 * 372 * This source code is licensed under the ISC license. 373 * See the LICENSE file in the root directory of this source tree. 374 */const pI=[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2
3740 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]],Tg=Ge("phone-off",pI);/** 375 * @license lucide-react v0.546.0 - ISC 376 * 377 * This source code is licensed under the ISC license. 378 * See the LICENSE file in the root directory of this source tree. 379 */const BI=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],gI=Ge("phone",BI);/** 380 * @license lucide-react v0.546.0 - ISC 381 * 382 * This source code is licensed under the ISC license. 383 * See the LICENSE file in the root directory of this source tree. 384 */const xI=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],fh=Ge("play",xI);/** 385 * @license lucide-react v0.546.0 - ISC 386 * 387 * This source code is licensed under the ISC license. 388 * See the LICENSE file in the root directory of this source tree. 389 */const bI=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],jm=Ge("plus",bI);/** 390 * @license lucide-react v0.546.0 - ISC 391 * 392 * This source code is licensed under the ISC license. 393 * See the LICENSE file in the root directory of this source tree. 394 */const CI=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Am=Ge("radio",CI);/** 395 * @license lucide-react v0.546.0 - ISC 396 * 397 * This source code is licensed under the ISC license. 398 * See the LICENSE file in the root directory of this source tree. 399 */const yI=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],xo=Ge("refresh-cw",yI);/** 400 * @license lucide-react v0.546.0 - ISC 401 * 402 * This source code is licensed under the ISC license. 403 * See the LICENSE file in the root directory of this source tree. 404 */const vI=[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]],_I=Ge("repeat",vI);/** 405 * @license lucide-react v0.546.0 - ISC 406 * 407 * This source code is licensed under the ISC license. 408 * See the LICENSE file in the root directory of this source tree. 409 */const wI=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Sh=Ge("rotate-ccw",wI);/** 410 * @license lucide-react v0.546.0 - ISC 411 * 412 * This source code is licensed under the ISC license. 413 * See the LICENSE file in the root directory of this source tree. 414 */const EI=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],NI=Ge("save",EI);/** 415 * @license lucide-react v0.546.0 - ISC 416 * 417 * This source code is licensed under the ISC license. 418 * See the LICENSE file in the root directory of this source tree. 419 */const DI=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Sg=Ge("search",DI);/** 420 * @license lucide-react v0.546.0 - ISC 421 * 422 * This source code is licensed under the ISC license. 423 * See the LICENSE file in the root directory of this source tree. 424 */const TI=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],mh=Ge("send",TI);/** 425 * @license lucide-react v0.546.0 - ISC 426 * 427 * This source code is licensed under the ISC license. 428 * See the LICENSE file in the root directory of this source tree. 429 */const SI=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Sy=Ge("settings",SI);/** 430 * @license lucide-react v0.546.0 - ISC 431 * 432 * This source code is licensed under the ISC license. 433 * See the LICENSE file in the root directory of this source tree. 434 */const jI=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],AD=Ge("share-2",jI);/** 435 * @license lucide-react v0.546.0 - ISC 436 * 437 * This source code is licensed under the ISC license. 438 * See the LICENSE file in the root directory of this source tree. 439 */const AI=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
439y:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],tm=Ge("shield-alert",AI);/** 440 * @license lucide-react v0.546.0 - ISC 441 * 442 * This source code is licensed under the ISC license. 443 * See the LICENSE file in the root directory of this source tree. 444 */const kI=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ph=Ge("shield-check",kI);/** 445 * @license lucide-react v0.546.0 - ISC 446 * 447 * This source code is licensed under the ISC license. 448 * See the LICENSE file in the root directory of this source tree. 449 */const RI=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],bo=Ge("shield",RI);/** 450 * @license lucide-react v0.546.0 - ISC 451 * 452 * This source code is licensed under the ISC license. 453 * See the LICENSE file in the root directory of this source tree. 454 */const II=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],Bh=Ge("sliders-vertical",II);/** 455 * @license lucide-react v0.546.0 - ISC 456 * 457 * This source code is licensed under the ISC license. 458 * See the LICENSE file in the root directory of this source tree. 459 */const OI=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],RE=Ge("smartphone",OI);/** 460 * @license lucide-react v0.546.0 - ISC 461 * 462 * This source code is licensed under the ISC license. 463 * See the LICENSE file in the root directory of this source tree. 464 */const LI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],kD=Ge("smile",LI);/** 465 * @license lucide-react v0.546.0 - ISC 466 * 467 * This source code is licensed under the ISC license. 468 * See the LICENSE file in the root directory of this source tree. 469 */const MI=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}
469],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Fs=Ge("sparkles",MI);/** 470 * @license lucide-react v0.546.0 - ISC 471 * 472 * This source code is licensed under the ISC license. 473 * See the LICENSE file in the root directory of this source tree. 474 */const PI=[["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}]],Bo=Ge("square-play",PI);/** 475 * @license lucide-react v0.546.0 - ISC 476 * 477 * This source code is licensed under the ISC license. 478 * See the LICENSE file in the root directory of this source tree. 479 */const zI=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],FI=Ge("square-plus",zI);/** 480 * @license lucide-react v0.546.0 - ISC 481 * 482 * This source code is licensed under the ISC license. 483 * See the LICENSE file in the root directory of this source tree. 484 */const VI=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],IE=Ge("square",VI);/** 485 * @license lucide-react v0.546.0 - ISC 486 * 487 * This source code is licensed under the ISC license. 488 * See the LICENSE file in the root directory of this source tree. 489 */const UI=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],OE=Ge("star",UI);/** 490 * @license lucide-react v0.546.0 - ISC 491 * 492 * This source code is licensed under the ISC license. 493 * See the LICENSE file in the root directory of this source tree. 494 */const GI=[["polyline",{points:"14.5 17.5 3 6 3 3 6 3 17.5 14.5",key:"1hfsw2"}],["line",{x1:"13",x2:"19",y1:"19",y2:"13",key:"1vrmhu"}],["line",{x1:"16",x2:"20",y1:"16",y2:"20",key:"1bron3"}],["line",{x1:"19",x2:"21",y1:"21",y2:"19",key:"13pww6"}],["polyline",{points:"14.5 6.5 18 3 21 3 21 6 17.5 9.5",key:"hbey2j"}],["line",{x1:"5",x2:"9",y1:"14",y2:"18",key:"1hf58s"}],["line",{x1:"7",x2:"4",y1:"17",y2:"20",key:"pidxm4"}],["line",{x1:"3",x2:"5",y1:"19",y2:"21",key:"1pehsh"}]],HI=Ge("swords",GI);/** 495 * @license lucide-react v0.546.0 - ISC 496 * 497 * This source code is licensed under the ISC license. 498 * See the LICENSE file in the root directory of this source tree. 499 */const qI=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],LE=Ge("terminal",qI);/** 500 * @license lucide-react v0.546.0 - ISC 501 * 502 * This source code is licensed under the ISC license. 503 * See the LICENSE file in the root directory of this source tree. 504 */const $I=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],JI=Ge("thumbs-up",$I);/** 505 * @license lucide-react v0.546.0 - ISC 506 * 507 * This source code is licensed under the ISC license. 508 * See the LICENSE file in the root directory of this source tree. 509 */const KI=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Vs=Ge("trash-2",KI);/** 510 * @license lucide-react v0.546.0 - ISC 511 * 512 * This source code is licensed under the ISC license. 513 * See the LICENSE file in the root directory of this source tree. 514 */const QI=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],YI=Ge("trending-up",QI);/** 515 * @license lucide-react v0.546.0 - ISC 516 * 517 * This source code is licensed under the ISC license. 518 * See the LICENSE file in the root directory of this source tree. 519 */const XI=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],gh=Ge("triangle-alert",XI);/** 520 * @license lucide-react v0.546.0 - ISC 521 * 522 * This source code is licensed under the ISC license. 523 * See the LICENSE file in the root directory of this source tree. 524 */const WI=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],KB=Ge("trophy",WI);/** 525 * @license lucide-react v0.546.0 - ISC 526 * 527 * This source code is licensed under the ISC license. 528 * See the LICENSE file in the root directory of this source tree.
529 */const ZI=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Mu=Ge("upload",ZI);/** 530 * @license lucide-react v0.546.0 - ISC 531 * 532 * This source code is licensed under the ISC license. 533 * See the LICENSE file in the root directory of this source tree. 534 */const eO=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],jy=Ge("user-check",eO);/** 535 * @license lucide-react v0.546.0 - ISC 536 * 537 * This source code is licensed under the ISC license. 538 * See the LICENSE file in the root directory of this source tree. 539 */const tO=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],_u=Ge("user-plus",tO);/** 540 * @license lucide-react v0.546.0 - ISC 541 * 542 * This source code is licensed under the ISC license. 543 * See the LICENSE file in the root directory of this source tree. 544 */const nO=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],sO=Ge("user-minus",nO);/** 545 * @license lucide-react v0.546.0 - ISC 546 * 547 * This source code is licensed under the ISC license. 548 * See the LICENSE file in the root directory of this source tree. 549 */const rO=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]],iO=Ge("user-x",rO);/** 550 * @license lucide-react v0.546.0 - ISC 551 * 552 * This source code is licensed under the ISC license. 553 * See the LICENSE file in the root directory of this source tree. 554 */const aO=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Pu=Ge("user",aO);/** 555 * @license lucide-react v0.546.0 - ISC 556 * 557 * This source code is licensed under the ISC license. 558 * See the LICENSE file in the root directory of this source tree. 559 */const oO=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Na=Ge("users",oO);/** 560 * @license lucide-react v0.546.0 - ISC 561 * 562 * This source code is licensed under the ISC license. 563 * See the LICENSE file in the root directory of this source tree. 564 */const lO=[["path",{d:"M10.66 6H14a2 2 0 0 1 2 2v2.5l5.248-3.062A.5.5 0 0 1 22 7.87v8.196",key:"w8jjjt"}],["path",{d:"M16 16a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2",key:"1xawa7"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],cO=Ge("video-off",lO);/** 565 * @license lucide-react v0.546.0 - ISC 566 * 567 * This source code is licensed under the ISC license. 568 * See the LICENSE file in the root directory of this source tree. 569 */const uO=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],w1=Ge("video",uO);/** 570 * @license lucide-react v0.546.0 - ISC 571 * 572 * This source code is licensed under the ISC license. 573 * See the LICENSE file in the root directory of this source tree. 574 */const dO=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],xl=Ge("volume-2",dO);/** 575 * @license lucide-react v0.546.0 - ISC 576 * 577 * This source code is licensed under the ISC license. 578 * See the LICENSE file in the root directory of this source tree. 579 */const hO=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],jg=Ge("volume-x",hO);/** 580 * @license lucide-react v0.546.0 - ISC 581 * 582 * This source code is licensed under the ISC license. 583 * See the LICENSE file in the root directory of this source tree. 584 */const fO=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],mO=Ge("wand-sparkles",fO);/** 585 * @license lucide-react v0.546.0 - ISC 586 * 587 * This source code is licensed under the ISC license. 588 * See the LICENSE file in the root directory of this source tree. 589 */const pO=[["circle",{cx:"12",cy:"10",r:"8",key:"1gshiw"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 22h10",key:"10w4w3"}],["path",{d:"M12 22v-4",key:"1utk9m"}]],Ay=Ge("webcam",pO);/** 590 * @license lucide-react v0.546.0 - ISC 591 * 592 * This source code is licensed under the ISC license. 593 * See the LICENSE file in the root directory of this source tree. 594 */const BO=[["path",{d:"M18 6 6 18",key:"1bl5f8"}
594],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Kt=Ge("x",BO);/** 595 * @license lucide-react v0.546.0 - ISC 596 * 597 * This source code is licensed under the ISC license. 598 * See the LICENSE file in the root directory of this source tree. 599 */const gO=[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]],xO=Ge("youtube",gO);/** 600 * @license lucide-react v0.546.0 - ISC 601 * 602 * This source code is licensed under the ISC license. 603 * See the LICENSE file in the root directory of this source tree. 604 */const bO=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],um=Ge("zap",bO),nl=[{id:"elizabeth_suprema",name:"Elizabeth Suprema (Firma Oficial)",category:"espanol_xtts",gender:"female",pitch:1.05,rate:1,volume:1,description:"Voz insignia de Elizabeth: dulce, empática, cálida, pÃcara y viva en español.",speakerTag:"Elizabeth-Official-XTTS",icon:"ð",accent:"Español Oficial"},{id:"sofia_latina",name:"SofÃa (Español Nativo Dinámico)",category:"espanol_xtts",gender:"female",pitch:1.05,rate:1.02,volume:1,description:"Español nativo: viva, cercana, alegre, muy carismática y natural.",speakerTag:"Sofia Latina XTTS",icon:"ð",accent:"Latinoamérica"},{id:"valentina_dulce",name:"Valentina (Español Nativo Tierno)",category:"espanol_xtts",gender:"female",pitch:1.06,rate:.98,volume:1,description:"Español nativo: amorosa, tierna, cálida y de trato fraternal entrañable.",speakerTag:"Valentina Dulce XTTS",icon:"ð",accent:"Hispanoamérica"},{id:"camila_serena",name:"Camila (Español Nativo Apacible)",category:"espanol_xtts",gender:"female",pitch:1,rate:.95,volume:1,description:"Español nativo: pausada, tranquila, armónica y reconfortante.",speakerTag:"Camila Serena XTTS",icon:"ð",accent:"Hispanoamérica"},{id:"lucia_melodica",name:"LucÃa (Español Rioplatense Suave)",category:"espanol_xtts",gender:"female",pitch:1.03,rate:1,volume:1,description:"Cadencia rioplatense melodiosa, fresca, dulce y espontánea.",speakerTag:"Lucia Rioplatense XTTS",icon:"ðµ",accent:"Rioplatense"},{id:"carmen_poetica",name:"Carmen (Español Andaluz LÃrico)",category:"espanol_xtts",gender:"female",pitch:1.02,rate:.96,volume:1,description:"Cálida, lÃrica, poética, con inflexiones expresivas y sentidas.",speakerTag:"Carmen Andaluza XTTS",icon:"ð¹",accent:"Andaluz / LÃrico"},{id:"mateo_entusiasta",name:"Mateo (Español Nativo Vivaz)",category:"espanol_xtts",gender:"male",pitch:.96,rate:1.04,volume:1,description:"Español nativo: enérgico, juvenil, motivador y simpático.",speakerTag:"Mateo Entusiasta XTTS",icon:"ð¥",accent:"Latinoamérica"},{id:"lucas_conversacional",name:"Lucas (Español Nativo Cercano)",category:"espanol_xtts",gender:"male",pitch:.92,rate:.99,volume:1,description:"Español nativo: relajado, espontáneo, cotidiano y cercano.",speakerTag:"Lucas Conversacional XTTS",icon:"ðï¸",accent:"Hispanoamérica"},{id:"eugenio_reflexivo",name:"Eugenio (Español Nativo Culto)",category:"espanol_xtts",gender:"male",pitch:.84,rate:.9,volume:1,description:"Español nativo: culto, pausado, reflexivo, claro y sosegado.",speakerTag:"Eugenio Reflexivo XTTS",icon:"ð",accent:"Castellano Culto"},{id:"diego_locutor",name:"Diego (Español Radiofónico Firme)",category:"espanol_xtts",gender:"male",pitch:.88,rate:.97,volume:1,description:"Voz de locución profunda, firme, convincente y bien modulada.",speakerTag:"Diego Locutor XTTS",icon:"ð»",accent:"Locución Profesional"},{id:"javier_castizo",name:"Javier (Español Peninsular Castizo)",category:"espanol_xtts",gender:"male",pitch:.9,rate:1.01,volume:1,description:"Articulación peninsular nÃtida, franca, directa y con presencia.",speakerTag:"Javier Peninsular XTTS",icon:"ð°",accent:"Español Peninsular"},{id:"claribel_dervla",name:"Claribel Dervla (Cálida y Narrativa)",category:"femenina_xtts",gender:"female",pitch:1,rate:.98,volume:1,description:"Tono sedoso, suave y envolvente, perfecta para narración profunda y apoyo empático.",speakerTag:"Claribel Dervla",icon:"ð¸",accent:"Oficial XTTS v2"},{id:"daisy_studious",name:"Daisy Studious (Clara y Expresiva)",category:"femenina_xtts",gender:"female",pitch:1.08,rate:1.02,volume:1,description:"Voz joven, académica, articulada, lúcida y con inflexiones muy claras.",speakerTag:"Daisy Studious",icon:"ð",accent:"Oficial XTTS v2"},{id:"gracie_wiseman",name:"Gracie Wiseman (Serena y Elegante)",category:"femenina_xtts",gender:"female",pitch:.95,rate:.94,volume:1,description:"Tono maduro, calmo, reflexivo, c
604on cadencia sosegada y distinguida.",speakerTag:"Gracie Wiseman",icon:"ð",accent:"Oficial XTTS v2"},{id:"tammie_ema",name:"Tammie Ema (Alegre y Juguetona)",category:"femenina_xtts",gender:"female",pitch:1.12,rate:1.05,volume:1,description:"Expresiva, chispeante, vivaz y con risitas espontáneas naturales.",speakerTag:"Tammie Ema",icon:"â¨",accent:"Oficial XTTS v2"},{id:"alison_dietlinde",name:"Alison Dietlinde (Cristalina y Distinguida)",category:"femenina_xtts",gender:"female",pitch:1.02,rate:.98,volume:1,description:"Sofisticada, cristalina, tranquila y con pronunciación impecable.",speakerTag:"Alison Dietlinde",icon:"ðï¸",accent:"Oficial XTTS v2"},{id:"ana_florence",name:"Ana Florence (Melódica y Afectuosa)",category:"femenina_xtts",gender:"female",pitch:1.04,rate:.99,volume:1,description:"Cálida, tierna, melódica y con entonación muy conversacional.",speakerTag:"Ana Florence",icon:"ð·",accent:"Oficial XTTS v2"},{id:"annmarie_nele",name:"Annmarie Nele (Juvenil y Dinámica)",category:"femenina_xtts",gender:"female",pitch:1.1,rate:1.04,volume:1,description:"Joven, entusiasta, rápida y llena de vitalidad contemporánea.",speakerTag:"Annmarie Nele",icon:"â",accent:"Oficial XTTS v2"},{id:"asya_anara",name:"Asya Anara (Suave y Reconfortante)",category:"femenina_xtts",gender:"female",pitch:.98,rate:.92,volume:1,description:"Susurrada, dulce, tersa, pacÃfica e ideal para relajación y confidencias.",speakerTag:"Asya Anara",icon:"ð",accent:"Oficial XTTS v2"},{id:"brenda_stern",name:"Brenda Stern (Segura y Decidida)",category:"femenina_xtts",gender:"female",pitch:.96,rate:1,volume:1,description:"Firme, asertiva, ejecutiva y con gran presencia vocal y autoridad.",speakerTag:"Brenda Stern",icon:"ð¼",accent:"Oficial XTTS v2"},{id:"gitta_nikolina",name:"Gitta Nikolina (ArtÃstica y Vibrante)",category:"femenina_xtts",gender:"female",pitch:1.06,rate:1.01,volume:1,description:"ArtÃstica, apasionada, melodiosa y con rica resonancia armónica.",speakerTag:"Gitta Nikolina",icon:"ð",accent:"Oficial XTTS v2"},{id:"henriette_usha",name:"Henriette Usha (Profunda y Refinada)",category:"femenina_xtts",gender:"female",pitch:.92,rate:.92,volume:1,description:"Noble, solemne, profunda y con textura elegante.",speakerTag:"Henriette Usha",icon:"ðï¸",accent:"Oficial XTTS v2"},{id:"sofia_hellen",name:"Sofia Hellen (Nórdica Luminosa)",category:"femenina_xtts",gender:"female",pitch:1.04,rate:1,volume:1,description:"Brillante, cristalina, modulada y con aire nórdico sereno.",speakerTag:"Sofia Hellen",icon:"âï¸",accent:"Oficial XTTS v2"},{id:"suvi_tausku",name:"Suvi Tausku (Vivaz y Espontánea)",category:"femenina_xtts",gender:"female",pitch:1.07,rate:1.03,volume:1,description:"Ãgil, fresca, espontánea y con cadencia rÃtmica limpia.",speakerTag:"Suvi Tausku",icon:"ð¿",accent:"Oficial XTTS v2"},{id:"nova_hogarth",name:"Nova Hogarth (Vanguardista y Moderna)",category:"femenina_xtts",gender:"female",pitch:1.05,rate:1.02,volume:1,description:"Moderna, futurista, inteligente y con timbre distintivo.",speakerTag:"Nova Hogarth",icon:"ð®",accent:"Oficial XTTS v2"},{id:"maja_ruoho",name:"Maja Ruoho (Pausada y Calma)",category:"femenina_xtts",gender:"female",pitch:.96,rate:.94,volume:1,description:"Pausada, envolvente, con resonancia equilibrada y tranquila.",speakerTag:"Maja Ruoho",icon:"ð",accent:"Oficial XTTS v2"},{id:"uta_objen",name:"Uta Objen (Sosegada y Armoniosa)",category:"femenina_xtts",gender:"female",pitch:.98,rate:.95,volume:1,description:"Dulce, sosegada, armoniosa y de escucha placentera.",speakerTag:"Uta Objen",icon:"ð¾",accent:"Oficial XTTS v2"},{id:"lidia_deniza",name:"Lidia Deniza (Mediterránea Cálida)",category:"femenina_xtts",gender:"female",pitch:1.02,rate:.98,volume:1,description:"Rica en armónicos, cálida, expresiva y reconfortante.",speakerTag:"Lidia Deniza",icon:"âï¸",accent:"Oficial XTTS v2"},{id:"charelle_behnke",name:"Charelle Behnke (Conversacional Fluida)",category:"femenina_xtts",gender:"female",pitch:1.04,rate:1.02,volume:1,description:"Espontánea, coloquial, amigable y muy fluida.",speakerTag:"Charelle Behnke",icon:"ð¬",accent:"Oficial XTTS v2"},{id:"claudette_michaud",name:"Claudette Michaud (Parisina Elegante)",category:"femenina_xtts",gender:"female",pitch:.99,rate:.95,volume:1,description:"Elegante, delicada, cadenciosa y refinada.",speakerTag:"Claudette Michaud",icon:"ð¼",accent:"Oficial XTTS v2"},{id:"imelda_santos",name:"Imelda Santos (Afectuosa y Melódica)",category:"femenina_xtts",gender:"female",pitch:1.03,rate:.99,volume:1,description:"Trato fraterno, calidez envolvente y timbre dulce.",speakerTag:"Imelda Santos",icon:"ðº",accent:"Oficial XTTS v2"},{id:"szilvia_vadasz",name:"Szilvia Vadasz (Articulada y NÃtida)",category:"femenina_xtts",gender:"female",pitch:1.01,rate:.98,volume:1,description:"Precisa, lúcida, con entonación musical armónica.",speakerTag:"Szilvia Vadasz",icon:"ð»",accent:"Oficial XTTS v2"},{id:"danielle_bosco",name:"Danielle Bosco (Vivaz y Brillante)",category:"femenina_xtts",gender:"female",pitch:1.06,rate:1.03,volume:1,description:"Cadencia rÃtmica viva, expresiva, brillante y jovial.",speakerTag:"Danielle Bosco",icon:"â¨",accent:"Oficial XTTS v2"},{id:"damian_black",name:"Damian Black (Profunda y Cinematográfica)",category:"masculina_xtts",gender:"male",pitch:.85,rate:.95,volume:1,description:"Profunda, cinematográfica, segura, magnética y con gran presencia.",speakerTag:"Damian Black",icon:"ð¬",accent:"Oficial XTTS v2"},{id:"craig_gutsy",name:"Craig Gutsy (Enérgico y Audaz)",category:"masculina_xtts",gender:"male",pitch:.95,rate:1.02,volume:1,description:"Joven, animado, enérgico, audaz y carismático.",speakerTag:"Craig Gutsy",icon:"â¡",accent:"Oficial XTTS v2"},{id:"viktor_einar",name:"Viktor Einar (Elegante y Profesional)",category:"masculina_xtts",gender:"male",pitch:.9,rate:.97,volume:1,description:"Elegante, europea, profesional, sobria y articulada.",speakerTag:"Viktor Einar",icon:"ð©",accent:"Oficial XTTS v2"},{id:"andrew_chipper",name:"Andrew Chipper (Conversacional y Amigable)",category:"masculina_xtts",gender:"male",pitch:.98,rate:1.02,volume:1,description:"Alegre, conversacional, amigable, cálido y espontáneo.",speakerTag:"Andrew Chipper",icon:"â",accent:"Oficial XTTS v2"},{id:"badr_odhiambo",name:"Badr Odhiambo (Resonante y Confiable)",category:"masculina_xtts",gender:"male",pitch:.88,rate:.95,volume:1,description:"Resonante, grave, firme, confiable y serena.",speakerTag:"Badr Odhiambo",icon:"ð¡ï¸",accent:"Oficial XTTS v2"},{id:"dionisio_schuyler",name:"Dionisio Schuyler (Reflexiva y Serena)",category:"masculina_xtts",gender:"male",pitch:.82,rate:.88,volume:1,description:"Profunda, sosegada, reflexiva, sabia y calmada.",speakerTag:"Dionisio Schuyler",icon:"ð",accent:"Oficial XTTS v2"},{id:"royston_min",name:"Royston Min (Moderna y Fresca)",category:"masculina_xtts",gender:"male",pitch:1,rate:1.04,volume:1,description:"Moderna, juvenil, fresca, dinámica y natural.",speakerTag:"Royston Min",icon:"ð§",accent:"Oficial XTTS v2"},{id:"baldur_sanjin",name:"Baldur Sanjin (Sólida y Firme)",category:"masculina_xtts",gender:"male",pitch:.86,rate:.92,volume:1,description:"Grave, sólida, pausada, firme y con gran empaque.",speakerTag:"Baldur Sanjin",icon:"ðï¸",accent:"Oficial XTTS v2"}
604,{id:"torsten_traugott",name:"Torsten Traugott (Autoridad Sobria)",category:"masculina_xtts",gender:"male",pitch:.84,rate:.92,volume:1,description:"Madura, sobria, con autoridad calmada y firmeza.",speakerTag:"Torsten Traugott",icon:"âï¸",accent:"Oficial XTTS v2"},{id:"renato_marie",name:"Renato Marie (Melódica y Expresiva)",category:"masculina_xtts",gender:"male",pitch:.93,rate:.98,volume:1,description:"Resonancia italiana cálida, melódica y elocuente.",speakerTag:"Renato Marie",icon:"ð»",accent:"Oficial XTTS v2"},{id:"zacharie_aimios",name:"Zacharie Aimios (Narrador Envolvente)",category:"masculina_xtts",gender:"male",pitch:.89,rate:.94,volume:1,description:"Narrativa, empática, suave y con gran profundidad comunicativa.",speakerTag:"Zacharie Aimios",icon:"ð",accent:"Oficial XTTS v2"},{id:"willem_driesen",name:"Willem Driesen (Clara y Cercana)",category:"masculina_xtts",gender:"male",pitch:.94,rate:1.02,volume:1,description:"Desenfadada, directa, optimista y cordial.",speakerTag:"Willem Driesen",icon:"ð²",accent:"Oficial XTTS v2"},{id:"abramo_gaspari",name:"Abramo Gaspari (Rica y Teatral)",category:"masculina_xtts",gender:"male",pitch:.86,rate:.93,volume:1,description:"BarÃtono resonante, elocuente y con matices teatrales.",speakerTag:"Abramo Gaspari",icon:"ð",accent:"Oficial XTTS v2"},{id:"ilmar_kallas",name:"Ilmar Kallas (AnalÃtica y Sobria)",category:"masculina_xtts",gender:"male",pitch:.87,rate:.93,volume:1,description:"Pausada, precisa, metódica y sosegada.",speakerTag:"Ilmar Kallas",icon:"ð§",accent:"Oficial XTTS v2"},{id:"eerik_vesterinen",name:"Eerik Vesterinen (Estable y Seria)",category:"masculina_xtts",gender:"male",pitch:.85,rate:.91,volume:1,description:"Grave, sólida, apacible y de gran serenidad.",speakerTag:"Eerik Vesterinen",icon:"ð²",accent:"Oficial XTTS v2"},{id:"tamas_nyilas",name:"Tamas Nyilas (Dinámica y Asertiva)",category:"masculina_xtts",gender:"male",pitch:.95,rate:1.01,volume:1,description:"Enfática, segura, dinámica y resuelta.",speakerTag:"Tamas Nyilas",icon:"ð",accent:"Oficial XTTS v2"},{id:"jan_kolar",name:"Jan Kolar (Franca y Directa)",category:"masculina_xtts",gender:"male",pitch:.92,rate:.99,volume:1,description:"Directa, afable, cotidiana y con dicción cristalina.",speakerTag:"Jan Kolar",icon:"ð¯",accent:"Oficial XTTS v2"},{id:"ludvig_skov",name:"Ludvig Skov (Joven y Despierta)",category:"masculina_xtts",gender:"male",pitch:.98,rate:1.03,volume:1,description:"Juvenil, atenta, ágil y participativa.",speakerTag:"Ludvig Skov",icon:"ð¡",accent:"Oficial XTTS v2"},{id:"chidubem_odo",name:"Chidubem Odo (Cálido BarÃtono)",category:"masculina_xtts",gender:"male",pitch:.84,rate:.94,volume:1,description:"Grave, cálida, entrañable y con hermosa resonancia.",speakerTag:"Chidubem Odo",icon:"ð",accent:"Oficial XTTS v2"},{id:"mimic",name:"MÃmica / Clon Zero-Shot",category:"clon_xtts",gender:"neutral",pitch:1,rate:1,volume:1,description:"Clona e imita en tiempo real la voz aprendida de cualquier usuario o archivo con XTTS v2.",speakerTag:"User-ZeroShot-Clone",icon:"ð§¬",accent:"Zero-Shot XTTS v2"}],eh={archetypeId:"elizabeth_suprema",mimicUsername:"",engine:"xtts_v2",pitch:1.05,rate:.98,speed:.98,temperature:.78,repetitionPenalty:2,gptCondLen:6,language:"es",volume:1,voiceURI:"",autoPlay:!1,voiceTone:"calida",useBarkExpressiveTags:!0,useXttsProsody:!0},RD="chatliz_elizabeth_voice_config_v4";function QB(n){return n?{femenino:"elizabeth_suprema",masculino:"lucas_conversacional",anciano:"dionisio_schuyler",female:"elizabeth_suprema",male:"lucas_conversacional",elder:"dionisio_schuyler",female_young:"elizabeth_suprema",female_teen:"annmarie_nele",female_elder:"gracie_wiseman",male_natural:"lucas_conversacional",male_teen:"craig_gutsy",male_elder:"dionisio_schuyler",quantum_ai:"alison_dietlinde",browser_speech:"elizabeth_suprema",browser:"elizabeth_suprema",custom:"elizabeth_suprema"}[n]||n:"elizabeth_suprema"}let Ti=null;function ID(n){if(n&&(Ti={...Ti||eh,...n,archetypeId:n.archetypeId?QB(n.archetypeId):(Ti==null?void 0:Ti.archetypeId)||eh.archetypeId},typeof window<"u"))try{localStorage.setItem("chatliz_server_ai_voice",JSON.stringify(Ti))}catch{}}if(typeof window<"u"){try{const n=localStorage.getItem("chatliz_server_ai_voice");n&&(Ti=JSON.parse(n))}catch{}fetch("/api/ai/voice-config").then(n=>n.json()).then(n=>
604{n!=null&&n.success&&(n!=null&&n.voiceConfig)&&ID(n.voiceConfig)}).catch(()=>{})}function km(){if(typeof window>"u")return Ti||eh;if(Ti&&Ti.archetypeId)return{...eh,...Ti,archetypeId:QB(Ti.archetypeId),engine:"xtts_v2",useBarkExpressiveTags:Ti.useBarkExpressiveTags??!0,useXttsProsody:Ti.useXttsProsody??!0};try{const n=localStorage.getItem(RD)||localStorage.getItem("chatliz_elizabeth_voice_config_v2");if(n){const e=JSON.parse(n),t=QB(e.archetypeId||"elizabeth_suprema");return{...eh,...e,archetypeId:t,engine:"xtts_v2",useBarkExpressiveTags:e.useBarkExpressiveTags??!0,useXttsProsody:e.useXttsProsody??!0}}}catch(n){console.error("Error reading saved Elizabeth voice config:",n)}return eh}function OD(n){const e=km(),t=n.archetypeId?QB(n.archetypeId):e.archetypeId,s={...e,...n,archetypeId:t,engine:"xtts_v2"};if(ID(s),typeof window<"u")try{localStorage.setItem(RD,JSON.stringify(s))}catch(o){console.error("Error saving Elizabeth voice config:",o)}return s}const ME={elizabeth_suprema:"https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=240&auto=format&fit=crop&q=80",sofia_latina:"https://images.unsplash.com/photo-1517841905240-472988babdf9?w=240&auto=format&fit=crop&q=80",valentina_dulce:"https://images.unsplash.com/photo-1524504388940-b1c1722653e1?w=240&auto=format&fit=crop&q=80",camila_serena:"https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=240&auto=format&fit=crop&q=80",lucia_melodica:"https://images.unsplash.com/photo-1544005313-94ddf0286df2?w=240&auto=format&fit=crop&q=80",carmen_poetica:"https://images.unsplash.com/photo-1529626455594-4ff0802cfb7e?w=240&auto=format&fit=crop&q=80",mateo_entusiasta:"https://images.unsplash.com/photo-1539571696357-5a69c17a67c6?w=240&auto=format&fit=crop&q=80",lucas_conversacional:"https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=240&auto=format&fit=crop&q=80",eugenio_reflexivo:"https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=240&auto=format&fit=crop&q=80",diego_locutor:"https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?w=240&auto=format&fit=crop&q=80",javier_castizo:"https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?w=240&auto=format&fit=crop&q=80",claribel_dervla:"https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?w=240&auto=format&fit=crop&q=80",daisy_studious:"https://images.unsplash.com/photo-1580489944761-15a19d654956?w=240&auto=format&fit=crop&q=80",gracie_wiseman:"https://images.unsplash.com/photo-1567532939604-b6b5b0db2604?w=240&auto=format&fit=crop&q=80",tammie_ema:"https://images.unsplash.com/photo-1524250502761-1ac6f2e30d43?w=240&auto=format&fit=crop&q=80",alison_dietlinde:"https://images.unsplash.com/photo-1548142813-c348350df52b?w=240&auto=format&fit=crop&q=80",ana_florence:"https://images.unsplash.com/photo-1531746020798-e6953c6e8e04?w=240&auto=format&fit=crop&q=80",annmarie_nele:"https://images.unsplash.com/photo-1492106087820-71f1a00d2b11?w=240&auto=format&fit=crop&q=80",asya_anara:"https://images.unsplash.com/photo-1508214751196-bcfd4ca60f91?w=240&auto=format&fit=crop&q=80",brenda_stern:"https://images.unsplash.com/photo-1573497019940-1c28c88b4f3e?w=240&auto=format&fit=crop&q=80",gitta_nikolina:"https://images.unsplash.com/photo-1534751516642-a1714f57a3e7?w=240&auto=format&fit=crop&q=80",henriette_usha:"https://images.unsplash.com/photo-1544717305-2782549b5136?w=240&auto=format&fit=crop&q=80",sofia_hellen:"https://images.unsplash.com/photo-1517841905240-472988babdf9?w=240&auto=format&fit=crop&q=80",suvi_tausku:"https://images.unsplash.com/photo-1488426862026-3ee34a7d66df?w=240&auto=format&fit=crop&q=80",nova_hogarth:"https://images.unsplash.com/photo-1531123897727-8f129e1688ce?w=240&auto=format&fit=crop&q=80",maja_ruoho:"https://images.unsplash.com/photo-1509967419530-da38b4704bc6?w=240&auto=format&fit=crop&q=80",uta_objen:"https://images.unsplash.com/photo-1502685104226-ee32379fefbe?w=240&auto=format&fit=crop&q=80",lidia_deniza:"https://images.unsplash.com/photo-1544005313-94ddf0286df2?w=240&auto=format&fit=crop&q=80",charelle_behnke:"https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=240&auto=format&fit=crop&q=80",claudette_michaud:"https://images.unsplash.com/photo-1524504388940-b1c1722653e1?w=240&auto=format&fit=crop&q=80",imelda_santos:"https://images.unsplash.com/photo-1529626455594-4ff0802cfb7e?w=240&auto=format&fit=crop&q=80",szilvia_vadasz:"https://images.unsplash.com/photo-1548142813-c348350df52b?w=240&auto=format&fit=crop&q=80",danielle_bosco:"https://images.unsplash.com/photo-153452874
6041775-53994a69daeb?w=240&auto=format&fit=crop&q=80",damian_black:"https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?w=240&auto=format&fit=crop&q=80",craig_gutsy:"https://images.unsplash.com/photo-1519085360753-af0119f7cbe7?w=240&auto=format&fit=crop&q=80",viktor_einar:"https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=240&auto=format&fit=crop&q=80",andrew_chipper:"https://images.unsplash.com/photo-1539571696357-5a69c17a67c6?w=240&auto=format&fit=crop&q=80",badr_odhiambo:"https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=240&auto=format&fit=crop&q=80",dionisio_schuyler:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=240&auto=format&fit=crop&q=80",royston_min:"https://images.unsplash.com/photo-1522075469751-3a6694fb2f61?w=240&auto=format&fit=crop&q=80",baldur_sanjin:"https://images.unsplash.com/photo-1519085360753-af0119f7cbe7?w=240&auto=format&fit=crop&q=80",torsten_traugott:"https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?w=240&auto=format&fit=crop&q=80",renato_marie:"https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=240&auto=format&fit=crop&q=80",zacharie_aimios:"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=240&auto=format&fit=crop&q=80",willem_driesen:"https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=240&auto=format&fit=crop&q=80",abramo_gaspari:"https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?w=240&auto=format&fit=crop&q=80",ilmar_kallas:"https://images.unsplash.com/photo-1519085360753-af0119f7cbe7?w=240&auto=format&fit=crop&q=80",eerik_vesterinen:"https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=240&auto=format&fit=crop&q=80",tamas_nyilas:"https://images.unsplash.com/photo-1539571696357-5a69c17a67c6?w=240&auto=format&fit=crop&q=80",jan_kolar:"https://images.unsplash.com/photo-1492562080023-ab3db95bfbce?w=240&auto=format&fit=crop&q=80",ludvig_skov:"https://images.unsplash.com/photo-1522075469751-3a6694fb2f61?w=240&auto=format&fit=crop&q=80",chidubem_odo:"https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?w=240&auto=format&fit=crop&q=80",mimic:"https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=240&auto=format&fit=crop&q=80"};function PE(n){const e=typeof n=="string"?n:n.id;return ME[e]?ME[e]:`https://api.dicebear.com/7.x/avataaars/svg?seed=${e}`}function CO(n){return`¡Hola! Soy ${n.name}. Mi locución funciona con el motor Coqui XTTS v2 de estudio, con acento ${n.accent||"oficial"} y tono completamente humano.`}function yO(n){return n?n.replace(/\[BAN:[^\]]+\]/gi,"").replace(/\[UNBAN:[^\]]+\]/gi,"").replace(/```[\s\S]*?```/g," bloque de código ").replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/#{1,6}\s+/g,"").replace(/https?:\/\/\S+/gi," enlace ").replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,"").replace(/\s+/g," ").trim():""}let Ss=null,ol=null,rc=null,ci=null,vr=null,qd=null;async function vO(n){const e=n.replace(/^data:audio\/[a-zA-Z0-9_\-]+;base64,/,""),t=window.atob(e),s=new Uint8Array(t.length);for(let h=0;h<t.length;h++)s[h]=t.charCodeAt(h);const o=new Blob([s.buffer],{type:"audio/wav"}),l=URL.createObjectURL(o),u=new Audio(l);return await u.play(),u}async function LD(n,e){var s,o;const t=window.AudioContext||window.webkitAudioContext;if((!rc||rc.state==="closed")&&(rc=new t),rc.state==="suspended"&&await rc.resume(),ci){try{ci.stop(),ci.disconnect()}catch{}ci=null}try{const l=await rc.decodeAudioData(n),u=rc.createBufferSource();u.buffer=l,u.connect(rc.destination),u.onended=()=>{var h;ci===u&&(ci=null),(h=e==null?void 0:e.onEnd)==null||h.call(e)},ci=u,(s=e==null?void 0:e.onStart)==null||s.call(e),u.start(0)}catch(l){throw(o=e==null?void 0:e.onError)==null||o.call(e,l),l}}async function _O(n,e,t){var s;if(ci){try{ci.stop(),ci.disconnect()}catch{}ci=null}if(Ss){try{Ss.pause(),Ss.currentTime=0,Ss.src=""}catch{}Ss=null}if(vr){try{vr.pause(),vr.currentTime=0,vr.src=""}catch{}vr=null}if(typeof window<"u"&&"speechSynthesis"in window)try{window.speechSynthesis.cancel()}catch{}ol&&ol.abort(),ol=new AbortController;try{const o=await fetch("/api/voice-preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:n,speakerId:e}),signal:ol.signal});if(!o.ok)throw new Error(`Error en servidor de audio: ${o.status}`);const l=await o.arrayBuffer();typeof window<"u"&&window.__ENABLE_AUDIO_DIAGNOSTICS__&&MD(l);try{await LD(l,t)}catch{const h=new Blob([l],{type:"audio/wav"}),f=URL.createObjectURL(h);Ss=new Audio(f),vr=Ss,Ss.onplay=()=>{var p;(p=t==null?void 0:t.onStart)==null||p.call(t)},Ss.onended=()=>{var p;URL.revokeObjectURL(f),Ss===vr&&(vr=null),Ss=null,(p=t==null?void 0:t.onEnd)==null||p.call(t)},Ss.onerror=p=>{var x;
604URL.revokeObjectURL(f),Ss===vr&&(vr=null),Ss=null,(x=t==null?void 0:t.onError)==null||x.call(t,p)},await Ss.play()}}catch(o){(o==null?void 0:o.name)!=="AbortError"&&(console.error("Error al reproducir voz:",o),(s=t==null?void 0:t.onError)==null||s.call(t,o),EB(n,e,1,1,1,t))}}async function MD(n,e="audio/wav"){const t={timestamp:new Date().toISOString(),sourceType:typeof n=="string"?"Base64/URL":"ArrayBuffer/Blob",dataLengthBytes:0,detectedHeader:"Desconocido",isWavRIFF:!1,sampleRate:"N/A",numberOfChannels:"N/A",durationSeconds:"N/A",decodeSuccess:!1,errorStage:"Ninguna",errorMessage:"Sin errores registrados"};try{let s;if(t.errorStage="Conversión de Datos",typeof n=="string")if(n.startsWith("data:")||n.length>500){const b=n.replace(/^data:audio\/\w+;base64,/,""),C=window.atob(b),N=new Uint8Array(C.length);for(let T=0;T<C.length;T++)N[T]=C.charCodeAt(T);s=N.buffer}else s=await(await fetch(n)).arrayBuffer();else if(n instanceof Blob)s=await n.arrayBuffer();else if(n instanceof ArrayBuffer)s=n;else throw new Error("Formato de audio no reconocido.");if(t.dataLengthBytes=s?s.byteLength:0,!s||s.byteLength===0)throw new Error("El buffer de audio recibido está completamente vacÃo (0 bytes).");t.errorStage="Inspección de Cabecera";const o=new Uint8Array(s.slice(0,12)),l=Array.from(o.slice(0,4)).map(b=>String.fromCharCode(b)).join("");t.detectedHeader=l,t.isWavRIFF=l==="RIFF",t.isWavRIFF||console.warn("Advertencia: El audio no contiene la cabecera 'RIFF' estándar de archivo WAV."),t.errorStage="Decodificación Web Audio API";const u=window.AudioContext||window.webkitAudioContext,h=new u,f=s.slice(0),p=await h.decodeAudioData(f);t.decodeSuccess=!0,t.sampleRate=`${p.sampleRate} Hz`,t.numberOfChannels=p.numberOfChannels,t.durationSeconds=`${p.duration.toFixed(2)} seg`,t.errorStage="Reproducción";const x=h.createBufferSource();x.buffer=p,x.connect(h.destination),x.start(0),t.errorStage="Completado Exitosamente"}catch(s){t.decodeSuccess=!1,t.errorMessage=s.message||String(s),console.error("Error en Diagnóstico de Audio:",s)}finally{PD(t)}return t}function PD(n){if(typeof document>"u")return;const e=document.getElementById("audio-diag-modal");e&&e.remove();const t=document.createElement("div");t.id="audio-diag-modal",t.style.cssText=` 605 position: fixed; top: 20px; right: 20px; z-index: 99999; 606 width: 380px; background: #111827; color: #f3f4f6; 607 border: 2px solid ${n.decodeSuccess?"#10b981":"#ef4444"}; 608 border-radius: 10px; padding: 16px; font-family: monospace; font-size: 12px; 609 box-shadow: 0 10px 25px rgba(0,0,0,0.8); 610 `;const s=n.decodeSuccess?"#10b981":"#ef4444",o=n.decodeSuccess?"EXITO (Reproduciendo)":"FALLO CRÃTICO",l=JSON.stringify(n,null,2);t.innerHTML=` 611 <div style="display:flex; justify-content:space-between; align-items:center; margin-bottom: 8px;"> 612 <strong style="color:${s}; font-size:14px;">Diagnóstico de Audio</strong> 613 <button id="close-audio-diag-btn" style="background:transparent; border:none; color:#9ca3af; cursor:pointer; font-size:16px;">â</button> 614 </div> 615 <div style="margin-bottom: 6px;">Estado: <b style="color:${s}">${o}</b></div> 616 <div style="margin-bottom: 4px;">Bytes: <b>${n.dataLengthBytes}</b></div> 617 <div style="margin-bottom: 4px;">Cabecera: <b>${n.detectedHeader} (${n.isWavRIFF?"WAV RIFF Válido":"No WAV"})</b></div> 618 <div style="margin-bottom: 4px;">Frecuencia: <b>${n.sampleRate}</b></div> 619 <div style="margin-bottom: 4px;">Canales: <b>${n.numberOfChannels}</b></div> 620 <div style="margin-bottom: 4px;">Duración: <b>${n.durationSeconds}</b></div> 621 ${n.errorMessage&&n.errorMessage!=="Sin errores registrados"?`<div style="color:#ef4444; margin-top:6px;">Error: ${n.errorMessage}</div>`:""} 622 <details style="margin-top: 8px; cursor: pointer;"> 623 <summary style="color: #60a5fa;">Ver JSON Completo</summary> 624 <pre style="background: #1f2937; padding: 6px; border-radius: 4px; overflow: auto; max-height: 120px; font-size: 10px; margin-top: 4px;">${l}</pre> 625 </details> 626 `,document.body.appendChild(t);const u=document.getElementById("close-audio-diag-btn");u&&(u.onclick=()=>t.remove())}async function zE(n="elizabeth_suprema",e){try{const o=await(await fetch("/api/voice-preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e||"Prueba de diagnóstico acústico con Coqui XTTS v2 y audio neuronal.",speakerId:n})})).arrayBuffer();return await MD(o)}catch(t){PD({timestamp:new Date().toISOString(),sourceType:"Network Fetch",dataLengthBytes:0,detectedHeader:"Error de Red",isWavRIFF:!1,sampleRate:"N/A",numberOfChannels:"N/A",durationSeconds:"N/A",decodeSuccess:!1,errorStage:"Petición HTTP",errorMessage:(t==null?void 0:t.message)||String(t)})}}function EB(n,e,t=1,s=1,o=1,l){var u,h;if(typeof window>"u"||!("speechSynthesis"in window))return(u=l==null?void 0:l.onError)==null||u.call(l,"Speech synthesis not supported"),!1;try{window.speechSynthesis.cancel();const f=new SpeechSynthesisUtterance(n);f.lang="es-ES",f.rate=Math.max(.75,Math.min(1.35,t||1)),f.pitch=Math.max(.75,Math.min(1.35,s||1)),f.volume=Math.max(.1,Math.min(1,o??1));const x=window.speechSynthesis.getVoices().filter(b=>b.lang.toLowerCase().startsWith("es"));if(x.length>0){const b=e&&(e.includes("male")||e.includes("lucas")||e.includes("mateo")||e.includes("diego")||e.includes("javier")||e.includes("eugenio")||e.includes("damian")),C=x.find(N=>{const T=N.name.toLowerCase();return b?T.includes("jorge")||T.includes("alvaro")||T.includes("diego")||T.includes("male")||T.includes("raul"):T.includes("sabina")||T.includes("elena")||T.includes("monica")||T.includes("paulina")||T.includes("elvira")||T.includes("female")||T.includes("google español")})||x[0];f.voice=C}return f.onstart=()=>{var b;(b=l==null?void 0:l.onStart)==null||b.call(l)},f.onend=()=>{var b;(b=l==null?void 0:l.onEnd)==null||b.call(l)},f.onerror=b=>{var C;(C=l==null?void 0:l.onError)==null||C.call(l,b)},window.speechSynthesis.speak(f),!0}
626catch(f){return(h=l==null?void 0:l.onError)==null||h.call(l,f),!1}}function th(){if(ol){try{ol.abort()}catch{}ol=null}if(ci){try{ci.stop(),ci.disconnect()}catch{}ci=null}if(Ss){try{Ss.pause(),Ss.currentTime=0,Ss.src=""}catch{}Ss=null}if(vr){try{vr.pause(),vr.currentTime=0,vr.src=""}catch(n){console.error("Error stopping neural audio:",n)}vr=null}if(typeof window<"u"&&"speechSynthesis"in window)try{window.speechSynthesis.cancel()}catch{}qd!=null&&qd.onEnd&&qd.onEnd(),qd=null}async function LC(n,e,t){var l;const s=yO(n);if(!s)return(l=t==null?void 0:t.onEnd)==null||l.call(t),!1;th(),ol=new AbortController;const o={...km(),...e,engine:"xtts_v2"};qd=t||null;try{const h=await(await fetch("/api/ai/synthesize_voice",{method:"POST",headers:{"Content-Type":"application/json"},signal:ol.signal,body:JSON.stringify({text:s,speakerId:o.archetypeId,archetypeId:o.archetypeId,mimicUsername:o.mimicUsername,pitch:o.pitch,rate:o.rate,speed:o.speed??.98,temperature:o.temperature??.78,repetition_penalty:o.repetition_penalty??o.repetitionPenalty??2,repetitionPenalty:o.repetition_penalty??o.repetitionPenalty??2,gpt_cond_len:o.gpt_cond_len??o.gptCondLen??6,gptCondLen:o.gpt_cond_len??o.gptCondLen??6,language:o.language||"es",voiceTone:o.voiceTone,volume:o.volume,useBarkExpressiveTags:o.useBarkExpressiveTags??!0,useXttsProsody:o.useXttsProsody??!0})})).json();if(h!=null&&h.success&&h.audioBase64&&h.audioBase64.length>100&&(h.audioBase64.startsWith("data:audio/wav")||h.audioBase64.startsWith("data:audio/wave")||h.audioBase64.startsWith("data:audio/x-wav")||h.audioBase64.startsWith("data:audio/mp3")||h.audioBase64.startsWith("data:audio/mpeg")||h.audioBase64.startsWith("data:audio/ogg")))try{const f=h.audioBase64.replace(/^data:audio\/[a-zA-Z0-9_\-]+;base64,/,""),p=window.atob(f),x=new Uint8Array(p.length);for(let b=0;b<p.length;b++)x[b]=p.charCodeAt(b);return await LD(x.buffer,t),!0}catch{const p=await vO(h.audioBase64);return p.volume=Math.max(0,Math.min(1,o.volume)),p.onplay=()=>{var x;(x=t==null?void 0:t.onStart)==null||x.call(t)},p.onended=()=>{var x;vr=null,Ss=null,(x=t==null?void 0:t.onEnd)==null||x.call(t)},p.onerror=x=>{console.warn("Fallo reproducción de audio del servidor, usando voz nativa humana:",x),vr=null,Ss=null,EB(s,o.archetypeId,o.rate,o.pitch,o.volume,t)},vr=p,Ss=p,!0}else return EB(s,o.archetypeId,o.rate,o.pitch,o.volume,t)}catch(u){return(u==null?void 0:u.name)==="AbortError"?!1:(console.warn("Fallo endpoint de voz, usando voz nativa humana:",u),EB(s,o.archetypeId,o.rate,o.pitch,o.volume,t))}}function wO(n,e,t,s){return new Promise(async(o,l)=>{if(n&&n.connected){n.emit("clone_voice_from_sample",{cloneName:e,sampleAudioBase64:t,sampleText:s},u=>{if(u!=null&&u.success)return o(u);FE(e,t,s).then(o).catch(l)});return}try{const u=await FE(e,t,s);o(u)}catch(u){l(u)}})}async function FE(n,e,t){const s=await fetch("/api/ai/xtts/clone",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cloneName:n,sampleAudioBase64:e,sampleText:t})}),o=await s.json();if(!s.ok||!o.success)throw new Error(o.error||"Fallo en clonación con XTTS v2");return o}const EO=()=>{};var VE={};/** 627 * @license 628 * Copyright 2017 Google LLC 629 * 630 * Licensed under the Apache License, Version 2.0 (the "License"); 631 * you may not use this file except in compliance with the License. 632 * You may obtain a copy of the License at 633 * 634 * http://www.apache.org/licenses/LICENSE-2.0 635 * 636 * Unless required by applicable law or agreed to in writing, software 637 * distributed under the License is distributed on an "AS IS" BASIS, 638 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 639 * See the License for the specific language governing permissions and 640 * limitations under the License. 641 */const zD=function(n){const e=[];let t=0;for(let s=0;s<n.length;s++){let o=n.charCodeAt(s);o<128?e[t++]=o:o<2048?(e[t++]=o>>6|192,e[t++]=o&63|128):(o&64512)===55296&&s+1<n.length&&(n.charCodeAt(s+1)&64512)===56320?(o=65536+((o&1023)<<10)+(n.charCodeAt(++s)&1023),e[t++]=o>>18|240,e[t++]=o>>12&63|128,e[t++]=o>>6&63|128,e[t++]=o&63|128):(e[t++]=o>>12|224,e[t++]=o>>6&63|128,e[t++]=o&63|128)}return e},NO=function(n){const e=[];let t=0,s=0;for(;t<n.length;){const o=n[t++];if(o<128)e[s++]=String.fromCharCode(o);else if(o>191&&o<224){const l=n[t++];e[s++]=String.fromCharCode((o&31)<<6|l&63)}else if(o>239&&o<365){const l=n[t++],u=n[t++],h=n[t++],f=((o&7)<<18|(l&63)<<12|(u&63)<<6|h&63)-65536;e[s++]=String.fromCharCode(55296+(f>>10)),e[s++]=String.fromCharCode(56320+(f&1023))}else{const l=n[t++],u=n[t++];e[s++]=String.fromCharCode((o&15)<<12|(l&63)<<6|u&63)}}return e.join("")},FD={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(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,s=[];for(let o=0;o<n.length;o+=3){const l=n[o],u=o+1<n.length,h=u?n[o+1]:0,f=o+2<n.length,p=f?n[o+2]:0,x=l>>2,b=(l&3)<<4|h>
641>4;let C=(h&15)<<2|p>>6,N=p&63;f||(N=64,u||(C=64)),s.push(t[x],t[b],t[C],t[N])}return s.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(zD(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):NO(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,s=[];for(let o=0;o<n.length;){const l=t[n.charAt(o++)],h=o<n.length?t[n.charAt(o)]:0;++o;const p=o<n.length?t[n.charAt(o)]:64;++o;const b=o<n.length?t[n.charAt(o)]:64;if(++o,l==null||h==null||p==null||b==null)throw new DO;const C=l<<2|h>>4;if(s.push(C),p!==64){const N=h<<4&240|p>>2;if(s.push(N),b!==64){const T=p<<6&192|b;s.push(T)}}}return s},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};class DO extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const TO=function(n){const e=zD(n);return FD.encodeByteArray(e,!0)},YB=function(n){return TO(n).replace(/\./g,"")},VD=function(n){try{return FD.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** 642 * @license 643 * Copyright 2022 Google LLC 644 * 645 * Licensed under the Apache License, Version 2.0 (the "License"); 646 * you may not use this file except in compliance with the License. 647 * You may obtain a copy of the License at 648 * 649 * http://www.apache.org/licenses/LICENSE-2.0 650 * 651 * Unless required by applicable law or agreed to in writing, software 652 * distributed under the License is distributed on an "AS IS" BASIS, 653 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 654 * See the License for the specific language governing permissions and 655 * limitations under the License. 656 */function SO(){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.")}/** 657 * @license 658 * Copyright 2022 Google LLC 659 * 660 * Licensed under the Apache License, Version 2.0 (the "License"); 661 * you may not use this file except in compliance with the License. 662 * You may obtain a copy of the License at 663 * 664 * http://www.apache.org/licenses/LICENSE-2.0 665 * 666 * Unless required by applicable law or agreed to in writing, software 667 * distributed under the License is distributed on an "AS IS" BASIS, 668 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 669 * See the License for the specific language governing permissions and 670 * limitations under the License. 671 */const jO=()=>SO().__FIREBASE_DEFAULTS__,AO=()=>{if(typeof process>"u"||typeof VE>"u")return;const n=VE.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},kO=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&VD(n[1]);return e&&JSON.parse(e)},Ag=()=>{try{return EO()||jO()||AO()||kO()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},UD=n=>{var e,t;return(t=(e=Ag())==null?void 0:e.emulatorHosts)==null?void 0:t[n]},GD=n=>{const e=UD(n);if(!e)return;const t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const s=parseInt(e.substring(t+1),10);return e[0]==="["?[e.substring(1,t-1),s]:[e.substring(0,t),s]},HD=()=>{var n;return(n=Ag())==null?void 0:n.config},qD=n=>{var e;return(e=Ag())==null?void 0:e[`_${n}`]};/** 672 * @license 673 * Copyright 2017 Google LLC 674 * 675 * Licensed under the Apache License, Version 2.0 (the "License"); 676 * you may not use this file except in compliance with the License. 677 * You may obtain a copy of the License at 678 * 679 * http://www.apache.org/licenses/LICENSE-2.0 680 * 681 * Unless required by applicable law or agreed to in writing, softw
681are 682 * distributed under the License is distributed on an "AS IS" BASIS, 683 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 684 * See the License for the specific language governing permissions and 685 * limitations under the License. 686 */class RO{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,s)=>{t?this.reject(t):this.resolve(s),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,s))}}}/** 687 * @license 688 * Copyright 2021 Google LLC 689 * 690 * Licensed under the Apache License, Version 2.0 (the "License"); 691 * you may not use this file except in compliance with the License. 692 * You may obtain a copy of the License at 693 * 694 * http://www.apache.org/licenses/LICENSE-2.0 695 * 696 * Unless required by applicable law or agreed to in writing, software 697 * distributed under the License is distributed on an "AS IS" BASIS, 698 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 699 * See the License for the specific language governing permissions and 700 * limitations under the License. 701 */function $D(n,e){if(n.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const t={alg:"none",type:"JWT"},s=e||"demo-project",o=n.iat||0,l=n.sub||n.user_id;if(!l)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const u={iss:`https://securetoken.google.com/${s}`,aud:s,iat:o,exp:o+3600,auth_time:o,sub:l,user_id:l,firebase:{sign_in_provider:"custom",identities:{}},...n};return[YB(JSON.stringify(t)),YB(JSON.stringify(u)),""].join(".")}/** 702 * @license 703 * Copyright 2017 Google LLC 704 * 705 * Licensed under the Apache License, Version 2.0 (the "License"); 706 * you may not use this file except in compliance with the License. 707 * You may obtain a copy of the License at 708 * 709 * http://www.apache.org/licenses/LICENSE-2.0 710 * 711 * Unless required by applicable law or agreed to in writing, software 712 * distributed under the License is distributed on an "AS IS" BASIS, 713 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 714 * See the License for the specific language governing permissions and 715 * limitations under the License. 716 */function Kr(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function IO(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Kr())}function OO(){var e;const n=(e=Ag())==null?void 0:e.forceEnvironment;if(n==="node")return!0;if(n==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function LO(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function MO(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function PO(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function zO(){const n=Kr();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function FO(){return!OO()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function VO(){try{return typeof indexedDB=="object"}catch{return!1}}function UO(){return new Promise((n,e)=>{try{let t=!0;const s="validate-browser-context-for-indexeddb-analytics-module",o=self.indexedDB.open(s);o.onsuccess=()=>{o.result.close(),t||self.indexedDB.deleteDatabase(s),n(!0)},o.onupgradeneeded=()=>{t=!1},o.onerror=()=>{var l;e(((l=o.error)==null?void 0:l.message)||"")}}catch(t){e(t)}})}/** 717 * @license 718 * Copyright 2017 Google LLC 719 * 720 * Licensed under the Apache License, Version 2.0 (the "License"); 721 * you may not use this file except in compliance with the License. 722 * You may obtain a copy of the License at 723 * 724 * http://www.apache.org/licenses/LICENSE-2.0 725 * 726 * Unless required by applicable law or agreed to in writing, software 727 * distributed under the License is distributed on an "AS IS" BASIS, 728 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 729 * See the License for the specific language governing permissions and 730 * limitations under the License. 731 */const GO="FirebaseError";
731class Mo extends Error{constructor(e,t,s){super(t),this.code=e,this.customData=s,this.name=GO,Object.setPrototypeOf(this,Mo.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,np.prototype.create)}}class np{constructor(e,t,s){this.service=e,this.serviceName=t,this.errors=s}create(e,...t){const s=t[0]||{},o=`${this.service}/${e}`,l=this.errors[e],u=l?HO(l,s):"Error",h=`${this.serviceName}: ${u} (${o}).`;return new Mo(o,h,s)}}function HO(n,e){try{let t=0,s="";for(;t<n.length;){const o=n.indexOf("{$",t);if(o===-1){s+=n.substring(t);break}const l=n.indexOf("}",o+2);if(l===-1){s+=n.substring(t);break}const u=n.substring(o+2,l),h=e[u];s+=n.substring(t,o)+(h!=null?String(h):`<${u}?>`),t=l+1}return s}catch{return n}}function qO(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function bl(n,e){if(n===e)return!0;const t=Object.keys(n),s=Object.keys(e);for(const o of t){if(!s.includes(o))return!1;const l=n[o],u=e[o];if(UE(l)&&UE(u)){if(!bl(l,u))return!1}else if(l!==u)return!1}for(const o of s)if(!t.includes(o))return!1;return!0}function UE(n){return n!==null&&typeof n=="object"}/** 732 * @license 733 * Copyright 2017 Google LLC 734 * 735 * Licensed under the Apache License, Version 2.0 (the "License"); 736 * you may not use this file except in compliance with the License. 737 * You may obtain a copy of the License at 738 * 739 * http://www.apache.org/licenses/LICENSE-2.0 740 * 741 * Unless required by applicable law or agreed to in writing, software 742 * distributed under the License is distributed on an "AS IS" BASIS, 743 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 744 * See the License for the specific language governing permissions and 745 * limitations under the License. 746 */function sp(n){const e=[];for(const[t,s]of Object.entries(n))Array.isArray(s)?s.forEach(o=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(o))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(s));return e.length?"&"+e.join("&"):""}function $O(n,e){const t=new JO(n,e);return t.subscribe.bind(t)}class JO{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(s=>{this.error(s)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,s){let o;if(e===void 0&&t===void 0&&s===void 0)throw new Error("Missing Observer.");KO(e,["next","error","complete"])?o=e:o={next:e,error:t,complete:s},o.next===void 0&&(o.next=MC),o.error===void 0&&(o.error=MC),o.complete===void 0&&(o.complete=MC);const l=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),l}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 t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(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 KO(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function MC(){}/** 747 * @license 748 * Copyright 2021 Google LLC 749 * 750 * Licensed under the Apache License, Version 2.0 (the "License"); 751 * you may not use this file except in compliance with the License. 752 * You may obtain a copy of the License at 753 * 754 * http://www.apache.org/licenses/LICENSE-2.0 755 * 756 * Unless required by applicable law or agreed to in writing, software 757 * distributed under the License is distributed on an "AS IS" BASIS, 758 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 759 * See the License for the specific language governing permissions and 760 * limitations under the License. 761 */function $s(n){return n&&n._delegate?n._delegate:n}/** 762 * @license 763 * Copyright 2025 Google LLC 764 * 765 * Licensed under the Apache License, Version 2.0 (the "License");
766 * you may not use this file except in compliance with the License. 767 * You may obtain a copy of the License at 768 * 769 * http://www.apache.org/licenses/LICENSE-2.0 770 * 771 * Unless required by applicable law or agreed to in writing, software 772 * distributed under the License is distributed on an "AS IS" BASIS, 773 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 774 * See the License for the specific language governing permissions and 775 * limitations under the License. 776 */function qu(n){try{return(n.startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n).endsWith(".cloudworkstations.dev")}catch{return!1}}async function E1(n){return(await fetch(n,{credentials:"include"})).ok}class Tc{constructor(e,t,s){this.name=e,this.instanceFactory=t,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}}/** 777 * @license 778 * Copyright 2019 Google LLC 779 * 780 * Licensed under the Apache License, Version 2.0 (the "License"); 781 * you may not use this file except in compliance with the License. 782 * You may obtain a copy of the License at 783 * 784 * http://www.apache.org/licenses/LICENSE-2.0 785 * 786 * Unless required by applicable law or agreed to in writing, software 787 * distributed under the License is distributed on an "AS IS" BASIS, 788 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 789 * See the License for the specific language governing permissions and 790 * limitations under the License. 791 */const xu="[DEFAULT]";/** 792 * @license 793 * Copyright 2019 Google LLC 794 * 795 * Licensed under the Apache License, Version 2.0 (the "License"); 796 * you may not use this file except in compliance with the License. 797 * You may obtain a copy of the License at 798 * 799 * http://www.apache.org/licenses/LICENSE-2.0 800 * 801 * Unless required by applicable law or agreed to in writing, software 802 * distributed under the License is distributed on an "AS IS" BASIS, 803 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 804 * See the License for the specific language governing permissions and 805 * limitations under the License. 806 */class QO{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const s=new RO;if(this.instancesDeferred.set(t,s),this.isInitialized(t)||this.shouldAutoInitialize())try{const o=this.getOrInitializeService({instanceIdentifier:t});o&&s.resolve(o)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){const t=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),s=(e==null?void 0:e.optional)??!1;if(this.isInitialized(t)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:t})}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(XO(e))try{this.getOrInitializeService({instanceIdentifier:xu})}catch{}for(const[t,s]of this.instancesDeferred.entries()){const o=this.normalizeInstanceIdentifier(t);try{const l=this.getOrInitializeService({instanceIdentifier:o});s.resolve(l)}catch{}}}}clearInstance(e=xu){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(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=xu){return this.instances.has(e)}getOptions(e=xu){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=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:t});for(const[l,u]of this.instancesDeferred.entries()){const h=this.normalizeInstanceIdentifier(l);s===h&&u.resolve(o)}return o}onInit(e,t){const s=this.normalizeInstanceIdentifier(t),o=this.onInitCallbacks.get(s)??new Set;o.add(e),this.onInitCallbacks.set(s,o);const l=this.instances.get(s);return l&&e(l,s),()=>{o.delete(e)}}invokeOnInitCallbacks(e,t){const s=this.onInitCallbacks.get(t);if(s)for(const o of s)try{o(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let s=this.instances.get(e);if(!s&&this.component&&(s=this.component.instanceFactory(this.container,{instanceIdentifier:YO(e),options:t}),this.instances.set(e,s),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(s,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,s)}catch{}return s||null}normalizeInstanceIdentifier(e=xu){return this.component?this.component.multipleInstances?e:xu:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function YO(n){return n===xu?void 0:n}function XO(n){return n.instantiationMode==="EAGER"}/** 807 * @license 808 * Copyright 2019 Google LLC 809 * 810 * Licensed under the Apache License, Version 2.0 (the "License");
811 * you may not use this file except in compliance with the License. 812 * You may obtain a copy of the License at 813 * 814 * http://www.apache.org/licenses/LICENSE-2.0 815 * 816 * Unless required by applicable law or agreed to in writing, software 817 * distributed under the License is distributed on an "AS IS" BASIS, 818 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 819 * See the License for the specific language governing permissions and 820 * limitations under the License. 821 */class WO{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new QO(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/** 822 * @license 823 * Copyright 2017 Google LLC 824 * 825 * Licensed under the Apache License, Version 2.0 (the "License"); 826 * you may not use this file except in compliance with the License. 827 * You may obtain a copy of the License at 828 * 829 * http://www.apache.org/licenses/LICENSE-2.0 830 * 831 * Unless required by applicable law or agreed to in writing, software 832 * distributed under the License is distributed on an "AS IS" BASIS, 833 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 834 * See the License for the specific language governing permissions and 835 * limitations under the License. 836 */var Bn;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(Bn||(Bn={}));const ZO={debug:Bn.DEBUG,verbose:Bn.VERBOSE,info:Bn.INFO,warn:Bn.WARN,error:Bn.ERROR,silent:Bn.SILENT},eL=Bn.INFO,tL={[Bn.DEBUG]:"log",[Bn.VERBOSE]:"log",[Bn.INFO]:"info",[Bn.WARN]:"warn",[Bn.ERROR]:"error"},nL=(n,e,...t)=>{if(e<n.logLevel)return;const s=new Date().toISOString(),o=tL[e];if(o)console[o](`[${s}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class N1{constructor(e){this.name=e,this._logLevel=eL,this._logHandler=nL,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Bn))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?ZO[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,Bn.DEBUG,...e),this._logHandler(this,Bn.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,Bn.VERBOSE,...e),this._logHandler(this,Bn.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,Bn.INFO,...e),this._logHandler(this,Bn.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,Bn.WARN,...e),this._logHandler(this,Bn.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,Bn.ERROR,...e),this._logHandler(this,Bn.ERROR,...e)}}const sL=(n,e)=>e.some(t=>n instanceof t);let GE,HE;function rL(){return GE||(GE=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function iL(){return HE||(HE=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const JD=new WeakMap,ky=new WeakMap,KD=new WeakMap,PC=new WeakMap,D1=new WeakMap;function aL(n){const e=new Promise((t,s)=>{const o=()=>{n.removeEventListener("success",l),n.removeEventListener("error",u)},l=()=>{t(vc(n.result)),o()},u=()=>{s(n.error),o()};n.addEventListener("success",l),n.addEventListener("error",u)});return e.then(t=>{t instanceof IDBCursor&&JD.set(t,n)}).catch(()=>{}),D1.set(e,n),e}function oL(n){if(ky.has(n))return;const e=new Promise((t,s)=>{const o=()=>{n.removeEventListener("complete",l),n.removeEventListener("error",u),n.removeEventListener("abort",u)},l=()=>{t(),o()},u=()=>{s(n.error||new DOMException("AbortError","AbortError")),o()};n.addEventListener("complete",l),n.addEventListener("error",u),n.addEventListener("abort",u)});ky.set(n,e)}let Ry={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return ky.get(n);if(e==="objectStoreNames")return n.objectStoreNames||KD.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return vc(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function lL(n){Ry=n(Ry)}
vendor: 4,093 bytes, lines 836-870
836function cL(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const s=n.call(zC(this),e,...t);return KD.set(s,e.sort?e.sort():[e]),vc(s)}:iL().includes(n)?function(...e){return n.apply(zC(this),e),vc(JD.get(this))}:function(...e){return vc(n.apply(zC(this),e))}}function uL(n){return typeof n=="function"?cL(n):(n instanceof IDBTransaction&&oL(n),sL(n,rL())?new Proxy(n,Ry):n)}function vc(n){if(n instanceof IDBRequest)return aL(n);if(PC.has(n))return PC.get(n);const e=uL(n);return e!==n&&(PC.set(n,e),D1.set(e,n)),e}const zC=n=>D1.get(n);function dL(n,e,{blocked:t,upgrade:s,blocking:o,terminated:l}={}){const u=indexedDB.open(n,e),h=vc(u);return s&&u.addEventListener("upgradeneeded",f=>{s(vc(u.result),f.oldVersion,f.newVersion,vc(u.transaction),f)}),t&&u.addEventListener("blocked",f=>t(f.oldVersion,f.newVersion,f)),h.then(f=>{l&&f.addEventListener("close",()=>l()),o&&f.addEventListener("versionchange",p=>o(p.oldVersion,p.newVersion,p))}).catch(()=>{}),h}const hL=["get","getKey","getAll","getAllKeys","count"],fL=["put","add","delete","clear"],FC=new Map;function qE(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(FC.get(e))return FC.get(e);const t=e.replace(/FromIndex$/,""),s=e!==t,o=fL.includes(t);if(!(t in(s?IDBIndex:IDBObjectStore).prototype)||!(o||hL.includes(t)))return;const l=async function(u,...h){const f=this.transaction(u,o?"readwrite":"readonly");let p=f.store;return s&&(p=p.index(h.shift())),(await Promise.all([p[t](...h),o&&f.done]))[0]};return FC.set(e,l),l}lL(n=>({...n,get:(e,t,s)=>qE(e,t)||n.get(e,t,s),has:(e,t)=>!!qE(e,t)||n.has(e,t)}));/** 837 * @license 838 * Copyright 2019 Google LLC 839 * 840 * Licensed under the Apache License, Version 2.0 (the "License"); 841 * you may not use this file except in compliance with the License. 842 * You may obtain a copy of the License at 843 * 844 * http://www.apache.org/licenses/LICENSE-2.0 845 * 846 * Unless required by applicable law or agreed to in writing, software 847 * distributed under the License is distributed on an "AS IS" BASIS, 848 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 849 * See the License for the specific language governing permissions and 850 * limitations under the License. 851 */class mL{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(pL(t)){const s=t.getImmediate();return`${s.library}/${s.version}`}else return null}).filter(t=>t).join(" ")}}function pL(n){const e=n.getComponent();return(e==null?void 0:e.type)==="VERSION"}const Iy="@firebase/app",$E="0.16.2";/** 852 * @license 853 * Copyright 2019 Google LLC 854 * 855 * Licensed under the Apache License, Version 2.0 (the "License"); 856 * you may not use this file except in compliance with the License. 857 * You may obtain a copy of the License at 858 * 859 * http://www.apache.org/licenses/LICENSE-2.0 860 * 861 * Unless required by applicable law or agreed to in writing, software 862 * distributed under the License is distributed on an "AS IS" BASIS, 863 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 864 * See the License for the specific language governing permissions and 865 * limitations under the License. 866 */const Cl=new N1("@firebase/app"),BL="@firebase/app-compat",gL="@firebase/analytics-compat",xL="@firebase/analytics",bL="@firebase/app-check-compat",CL="@firebase/app-check",yL="@firebase/auth",vL="@firebase/auth-compat",_L="@firebase/database",wL="@firebase/data-connect",EL="@firebase/database-compat",NL="@firebase/functions",DL="@firebase/functions-compat",TL="@firebase/installations",SL="@firebase/installations-compat",jL="@firebase/messaging",AL="@firebase/messaging-compat",kL="@firebase/performance",RL="@firebase/performance-compat",IL="@firebase/remote-config",OL="@firebase/remote-config-compat",LL="@firebase/storage",ML="@firebase/storage-compat",PL="@firebase/firestore",zL="@firebase/ai",FL="@firebase/firestore-compat",VL="firebase",UL="12.19.0";/** 867 * @license 868 * Copyright 2019 Google LLC 869 * 870 * Licensed under the Apache License, Version 2.0 (the "License");
871 * you may not use this file except in compliance with the License. 872 * You may obtain a copy of the License at 873 * 874 * http://www.apache.org/licenses/LICENSE-2.0 875 * 876 * Unless required by applicable law or agreed to in writing, software 877 * distributed under the License is distributed on an "AS IS" BASIS, 878 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 879 * See the License for the specific language governing permissions and 880 * limitations under the License. 881 */const Oy="[DEFAULT]",GL={[Iy]:"fire-core",[BL]:"fire-core-compat",[xL]:"fire-analytics",[gL]:"fire-analytics-compat",[CL]:"fire-app-check",[bL]:"fire-app-check-compat",[yL]:"fire-auth",[vL]:"fire-auth-compat",[_L]:"fire-rtdb",[wL]:"fire-data-connect",[EL]:"fire-rtdb-compat",[NL]:"fire-fn",[DL]:"fire-fn-compat",[TL]:"fire-iid",[SL]:"fire-iid-compat",[jL]:"fire-fcm",[AL]:"fire-fcm-compat",[kL]:"fire-perf",[RL]:"fire-perf-compat",[IL]:"fire-rc",[OL]:"fire-rc-compat",[LL]:"fire-gcs",[ML]:"fire-gcs-compat",[PL]:"fire-fst",[FL]:"fire-fst-compat",[zL]:"fire-vertex","fire-js":"fire-js",[VL]:"fire-js-all"};/** 882 * @license 883 * Copyright 2019 Google LLC 884 * 885 * Licensed under the Apache License, Version 2.0 (the "License"); 886 * you may not use this file except in compliance with the License. 887 * You may obtain a copy of the License at 888 * 889 * http://www.apache.org/licenses/LICENSE-2.0 890 * 891 * Unless required by applicable law or agreed to in writing, software 892 * distributed under the License is distributed on an "AS IS" BASIS, 893 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 894 * See the License for the specific language governing permissions and 895 * limitations under the License. 896 */const XB=new Map,HL=new Map,Ly=new Map;function JE(n,e){try{n.container.addComponent(e)}catch(t){Cl.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function zu(n){const e=n.name;if(Ly.has(e))return Cl.debug(`There were multiple attempts to register component ${e}.`),!1;Ly.set(e,n);for(const t of XB.values())JE(t,n);for(const t of HL.values())JE(t,n);return!0}function kg(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function Wi(n){return n==null?!1:n.settings!==void 0}/** 897 * @license 898 * Copyright 2019 Google LLC 899 * 900 * Licensed under the Apache License, Version 2.0 (the "License"); 901 * you may not use this file except in compliance with the License. 902 * You may obtain a copy of the License at 903 * 904 * http://www.apache.org/licenses/LICENSE-2.0 905 * 906 * Unless required by applicable law or agreed to in writing, software 907 * distributed under the License is distributed on an "AS IS" BASIS, 908 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 909 * See the License for the specific language governing permissions and 910 * limitations under the License. 911 */const qL={"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 {$mismatchedParam}. Existing: '{$oldValue}'. New: '{$newValue}'.","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
911d-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."},ll=new np("app","Firebase",qL);/** 912 * @license 913 * Copyright 2019 Google LLC 914 * 915 * Licensed under the Apache License, Version 2.0 (the "License"); 916 * you may not use this file except in compliance with the License. 917 * You may obtain a copy of the License at 918 * 919 * http://www.apache.org/licenses/LICENSE-2.0 920 * 921 * Unless required by applicable law or agreed to in writing, software 922 * distributed under the License is distributed on an "AS IS" BASIS, 923 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 924 * See the License for the specific language governing permissions and 925 * limitations under the License. 926 */class $L{constructor(e,t,s){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=s,this.container.addComponent(new Tc("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 ll.create("app-deleted",{appName:this._name})}}/** 927 * @license 928 * Copyright 2019 Google LLC 929 * 930 * Licensed under the Apache License, Version 2.0 (the "License"); 931 * you may not use this file except in compliance with the License. 932 * You may obtain a copy of the License at 933 * 934 * http://www.apache.org/licenses/LICENSE-2.0 935 * 936 * Unless required by applicable law or agreed to in writing, software 937 * distributed under the License is distributed on an "AS IS" BASIS, 938 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 939 * See the License for the specific language governing permissions and 940 * limitations under the License. 941 */const $u=UL;function QD(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const s={name:Oy,automaticDataCollectionEnabled:!0,...e},o=s.name;if(typeof o!="string"||!o)throw ll.create("bad-app-name",{appName:String(o)});if(t||(t=HD()),!t)throw ll.create("no-options");const l=XB.get(o);if(l)if(bl(t,l.options)){if(bl(s,l.config))return l;throw ll.create("duplicate-app",{appName:o,mismatchedParam:"config",oldValue:JSON.stringify(l.config),newValue:JSON.stringify(s)})}else throw ll.create("duplicate-app",{appName:o,mismatchedParam:"options",oldValue:JSON.stringify(l.options),newValue:JSON.stringify(t)});const u=new WO(o);for(const f of Ly.values())u.addComponent(f);const h=new $L(t,s,u);return XB.set(o,h),h}function T1(n=Oy){const e=XB.get(n);if(!e&&n===Oy&&HD())return QD();if(!e)throw ll.create("no-app",{appName:n});return e}function No(n,e,t){let s=GL[n]??n;t&&(s+=`-${t}`);const o=s.match(/\s|\//),l=e.match(/\s|\//);if(o||l){const u=[`Unable to register library "${s}" with version "${e}":`];o&&u.push(`library name "${s}" contains illegal characters (whitespace or "/")`),o&&l&&u.push("and"),l&&u.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Cl.warn(u.join(" "));return}zu(new Tc(`${s}-version`,()=>({library:s,version:e}),"VERSION"))}/** 942 * @license 943 * Copyright 2021 Google LLC 944 * 945 * Licensed under the Apache License, Version 2.0 (the "License");
946 * you may not use this file except in compliance with the License. 947 * You may obtain a copy of the License at 948 * 949 * http://www.apache.org/licenses/LICENSE-2.0 950 * 951 * Unless required by applicable law or agreed to in writing, software 952 * distributed under the License is distributed on an "AS IS" BASIS, 953 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 954 * See the License for the specific language governing permissions and 955 * limitations under the License. 956 */const JL="firebase-heartbeat-database",KL=1,Rm="firebase-heartbeat-store";let VC=null;function YD(){return VC||(VC=dL(JL,KL,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(Rm)}catch(t){console.warn(t)}}}}).catch(n=>{throw ll.create("idb-open",{originalErrorMessage:n.message})})),VC}async function QL(n){try{const t=(await YD()).transaction(Rm),s=await t.objectStore(Rm).get(XD(n));return await t.done,s}catch(e){if(e instanceof Mo)Cl.warn(e.message);else{const t=ll.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});Cl.warn(t.message)}}}async function KE(n,e){try{const s=(await YD()).transaction(Rm,"readwrite");await s.objectStore(Rm).put(e,XD(n)),await s.done}catch(t){if(t instanceof Mo)Cl.warn(t.message);else{const s=ll.create("idb-set",{originalErrorMessage:t==null?void 0:t.message});Cl.warn(s.message)}}}function XD(n){return`${n.name}!${n.options.appId}`}/** 957 * @license 958 * Copyright 2021 Google LLC 959 * 960 * Licensed under the Apache License, Version 2.0 (the "License"); 961 * you may not use this file except in compliance with the License. 962 * You may obtain a copy of the License at 963 * 964 * http://www.apache.org/licenses/LICENSE-2.0 965 * 966 * Unless required by applicable law or agreed to in writing, software 967 * distributed under the License is distributed on an "AS IS" BASIS, 968 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 969 * See the License for the specific language governing permissions and 970 * limitations under the License. 971 */const YL=1024,XL=30;class WL{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new eM(t),this._heartbeatsCachePromise=this._storage.read().then(s=>(this._heartbeatsCache=s,s))}async triggerHeartbeat(){var e,t;try{const o=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),l=QE();if(((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===l||this._heartbeatsCache.heartbeats.some(u=>u.date===l))return;if(this._heartbeatsCache.heartbeats.push({date:l,agent:o}),this._heartbeatsCache.heartbeats.length>XL){const u=tM(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(u,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(s){Cl.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 t=QE(),{heartbeatsToSend:s,unsentEntries:o}=ZL(this._heartbeatsCache.heartbeats),l=YB(JSON.stringify({version:2,heartbeats:s}));return this._heartbeatsCache.lastSentHeartbeatDate=t,o.length>0?(this._heartbeatsCache.heartbeats=o,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),l}catch(t){return Cl.warn(t),""}}}function QE(){return new Date().toISOString().substring(0,10)}function ZL(n,e=YL){const t=[];let s=n.slice();for(const o of n){const l=t.find(u=>u.agent===o.agent);if(l){if(l.dates.push(o.date),YE(t)>e){l.dates.pop();break}}else if(t.push({agent:o.agent,dates:[o.date]}),YE(t)>e){t.pop();break}s=s.slice(1)}return{heartbeatsToSend:t,unsentEntries:s}}class eM{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return VO()?UO().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const t=await QL(this.app);return t!=null&&t.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const s=await this.read();return KE(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 KE(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??s.lastSentHeartbeatDate,heartbeats:[...s.heartbeats,...e.heartbeats]})}else return}}function YE(n){return YB(JSON.stringify({version:2,heartbeats:n})).length}function tM(n){if(n.length===0)return-1;let e=0,t=n[0].date;for(let s=1;s<n.length;s++)n[s].date<t&&(t=n[s].date,e=s);return e}/** 972 * @license 973 * Copyright 2019 Google LLC 974 * 975 * Licensed under the Apache License, Version 2.0 (the "License");
976 * you may not use this file except in compliance with the License. 977 * You may obtain a copy of the License at 978 * 979 * http://www.apache.org/licenses/LICENSE-2.0 980 * 981 * Unless required by applicable law or agreed to in writing, software 982 * distributed under the License is distributed on an "AS IS" BASIS, 983 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 984 * See the License for the specific language governing permissions and 985 * limitations under the License. 986 */function nM(n){zu(new Tc("platform-logger",e=>new mL(e),"PRIVATE")),zu(new Tc("heartbeat",e=>new WL(e),"PRIVATE")),No(Iy,$E,n),No(Iy,$E,"esm2020"),No("fire-js","")}/** 987 * @license 988 * Copyright 2019 Google LLC 989 * 990 * Licensed under the Apache License, Version 2.0 (the "License"); 991 * you may not use this file except in compliance with the License. 992 * You may obtain a copy of the License at 993 * 994 * http://www.apache.org/licenses/LICENSE-2.0 995 * 996 * Unless required by applicable law or agreed to in writing, software 997 * distributed under the License is distributed on an "AS IS" BASIS, 998 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 999 * See the License for the specific language governing permissions and 1000 * limitations under the License. 1001 */nM("");var XE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license 1002Copyright The Closure Library Authors. 1003SPDX-License-Identifier: Apache-2.0 1004*/var _c,WD;(function(){var n;/** @license 1005 1006 Copyright The Closure Library Authors. 1007 SPDX-License-Identifier: Apache-2.0 1008*/function e(k,E){function j(){}j.prototype=E.prototype,k.F=E.prototype,k.prototype=new j,k.prototype.constructor=k,k.D=function(P,O,F){for(var S=Array(arguments.length-2),be=2;be<arguments.length;be++)S[be-2]=arguments[be];return E.prototype[O].apply(P,S)}}function t(){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,t),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(k,E,j){j||(j=0);const P=Array(16);if(typeof E=="string")for(var O=0;O<16;++O)P[O]=E.charCodeAt(j++)|E.charCodeAt(j++)<<8|E.charCodeAt(j++)<<16|E.charCo
vendor: 6,927 bytes, line 1008
1008deAt(j++)<<24;else for(O=0;O<16;++O)P[O]=E[j++]|E[j++]<<8|E[j++]<<16|E[j++]<<24;E=k.g[0],j=k.g[1],O=k.g[2];let F=k.g[3],S;S=E+(F^j&(O^F))+P[0]+3614090360&4294967295,E=j+(S<<7&4294967295|S>>>25),S=F+(O^E&(j^O))+P[1]+3905402710&4294967295,F=E+(S<<12&4294967295|S>>>20),S=O+(j^F&(E^j))+P[2]+606105819&4294967295,O=F+(S<<17&4294967295|S>>>15),S=j+(E^O&(F^E))+P[3]+3250441966&4294967295,j=O+(S<<22&4294967295|S>>>10),S=E+(F^j&(O^F))+P[4]+4118548399&4294967295,E=j+(S<<7&4294967295|S>>>25),S=F+(O^E&(j^O))+P[5]+1200080426&4294967295,F=E+(S<<12&4294967295|S>>>20),S=O+(j^F&(E^j))+P[6]+2821735955&4294967295,O=F+(S<<17&4294967295|S>>>15),S=j+(E^O&(F^E))+P[7]+4249261313&4294967295,j=O+(S<<22&4294967295|S>>>10),S=E+(F^j&(O^F))+P[8]+1770035416&4294967295,E=j+(S<<7&4294967295|S>>>25),S=F+(O^E&(j^O))+P[9]+2336552879&4294967295,F=E+(S<<12&4294967295|S>>>20),S=O+(j^F&(E^j))+P[10]+4294925233&4294967295,O=F+(S<<17&4294967295|S>>>15),S=j+(E^O&(F^E))+P[11]+2304563134&4294967295,j=O+(S<<22&4294967295|S>>>10),S=E+(F^j&(O^F))+P[12]+1804603682&4294967295,E=j+(S<<7&4294967295|S>>>25),S=F+(O^E&(j^O))+P[13]+4254626195&4294967295,F=E+(S<<12&4294967295|S>>>20),S=O+(j^F&(E^j))+P[14]+2792965006&4294967295,O=F+(S<<17&4294967295|S>>>15),S=j+(E^O&(F^E))+P[15]+1236535329&4294967295,j=O+(S<<22&4294967295|S>>>10),S=E+(O^F&(j^O))+P[1]+4129170786&4294967295,E=j+(S<<5&4294967295|S>>>27),S=F+(j^O&(E^j))+P[6]+3225465664&4294967295,F=E+(S<<9&4294967295|S>>>23),S=O+(E^j&(F^E))+P[11]+643717713&4294967295,O=F+(S<<14&4294967295|S>>>18),S=j+(F^E&(O^F))+P[0]+3921069994&4294967295,j=O+(S<<20&4294967295|S>>>12),S=E+(O^F&(j^O))+P[5]+3593408605&4294967295,E=j+(S<<5&4294967295|S>>>27),S=F+(j^O&(E^j))+P[10]+38016083&4294967295,F=E+(S<<9&4294967295|S>>>23),S=O+(E^j&(F^E))+P[15]+3634488961&4294967295,O=F+(S<<14&4294967295|S>>>18),S=j+(F^E&(O^F))+P[4]+3889429448&4294967295,j=O+(S<<20&4294967295|S>>>12),S=E+(O^F&(j^O))+P[9]+568446438&4294967295,E=j+(S<<5&4294967295|S>>>27),S=F+(j^O&(E^j))+P[14]+3275163606&4294967295,F=E+(S<<9&4294967295|S>>>23),S=O+(E^j&(F^E))+P[3]+4107603335&4294967295,O=F+(S<<14&4294967295|S>>>18),S=j+(F^E&(O^F))+P[8]+1163531501&4294967295,j=O+(S<<20&4294967295|S>>>12),S=E+(O^F&(j^O))+P[13]+2850285829&4294967295,E=j+(S<<5&4294967295|S>>>27),S=F+(j^O&(E^j))+P[2]+4243563512&4294967295,F=E+(S<<9&4294967295|S>>>23),S=O+(E^j&(F^E))+P[7]+1735328473&4294967295,O=F+(S<<14&4294967295|S>>>18),S=j+(F^E&(O^F))+P[12]+2368359562&4294967295,j=O+(S<<20&4294967295|S>>>12),S=E+(j^O^F)+P[5]+4294588738&4294967295,E=j+(S<<4&4294967295|S>>>28),S=F+(E^j^O)+P[8]+2272392833&4294967295,F=E+(S<<11&4294967295|S>>>21),S=O+(F^E^j)+P[11]+1839030562&4294967295,O=F+(S<<16&4294967295|S>>>16),S=j+(O^F^E)+P[14]+4259657740&4294967295,j=O+(S<<23&4294967295|S>>>9),S=E+(j^O^F)+P[1]+2763975236&4294967295,E=j+(S<<4&4294967295|S>>>28),S=F+(E^j^O)+P[4]+1272893353&4294967295,F=E+(S<<11&4294967295|S>>>21),S=O+(F^E^j)+P[7]+4139469664&4294967295,O=F+(S<<16&4294967295|S>>>16),S=j+(O^F^E)+P[10]+3200236656&4294967295,j=O+(S<<23&4294967295|S>>>9),S=E+(j^O^F)+P[13]+681279174&4294967295,E=j+(S<<4&4294967295|S>>>28),S=F+(E^j^O)+P[0]+3936430074&4294967295,F=E+(S<<11&4294967295|S>>>21),S=O+(F^E^j)+P[3]+3572445317&4294967295,O=F+(S<<16&4294967295|S>>>16),S=j+(O^F^E)+P[6]+76029189&4294967295,j=O+(S<<23&4294967295|S>>>9),S=E+(j^O^F)+P[9]+3654602809&4294967295,E=j+(S<<4&4294967295|S>>>28),S=F+(E^j^O)+P[12]+3873151461&4294967295,F=E+(S<<11&4294967295|S>>>21),S=O+(F^E^j)+P[15]+530742520&4294967295,O=F+(S<<16&4294967295|S>>>16),S=j+(O^F^E)+P[2]+3299628645&4294967295,j=O+(S<<23&4294967295|S>>>9),S=E+(O^(j|~F))+P[0]+4096336452&4294967295,E=j+(S<<6&4294967295|S>>>26),S=F+(j^(E|~O))+P[7]+1126891415&4294967295,F=E+(S<<10&4294967295|S>>>22),S=O+(E^(F|~j))+P[14]+2878612391&4294967295,O=F+(S<<15&4294967295|S>>>17),S=j+(F^(O|~E))+P[5]+4237533241&4294967295,j=O+(S<<21&4294967295|S>>>11),S=E+(O^(j|~F))+P[12]+1700485571&4294967295,E=j+(S<<6&4294967295|S>>>26),S=F+(j^(E|~O))+P[3]+2399980690&4294967295,F=E+(S<<10&4294967295|S>>>22),S=O+(E^(F|~j))+P[10]+4293915773&4294967295,O=F+(S<<15&4294967295|S>>>17),S=j+(F^(O|~E))+P[1]+2240044497&4294967295,j=O+(S<<21&4294967295|S>>>11),S=E+(O^(j|~F))+P[8]+1873313359&4294967295,E=j+(S<<6&4294967295|S>>>26),S=F+(j^(E|~O))+P[15]+4264355552&4294967295,F=E+(S<<10&4294967295|S>>>22),S=O+(E^(F|~j))+P[6]+2734768916&4294967295,O=F+(S<<15&4294967295|S>>>17),S=j+(F^(O|~E))+P[13]+1309151649&4294967295,j=O+(S<<21&4294967295|S>>>11),S=E+(O^(j|~F))+P[4]+4149444226&4294967295,E=j+(S<<6&4294967295|S>>>26),S=F+(j^(E|~O))+P[11]+3174756917&4294967295,F=E+(S<<10&4294967295|S>>>22),S=O+(E^(F|~j))+P[2]+718787259&4294967295,O=F+(S<<15&4294967295|S>>>17),S=j+(F^(O|~E))+P[9]+3951481745&4294967295,k.g[0]=k.g[0]+E&4294967295,k.g[1]=k.g[1]+(O+(S<<21&4294967295|S>>>11))&4294967295,k.g[2]=k.g[2]+O&4294967295,k.g[3]=k.g[3]+F&4294967295}s.prototype.v=function(k,E){E===void 0&&(E=k.length);const j=E-this.blockSize,P=this.C;let O=this.h,F=0;for(;F<E;){if(O==0)for(;F<=j;)o(this,k,F),F+=this.blockSize;if(typeof k=="string"){for(;F<E;)if(P[O++]=k.charCodeAt(F++),O==this.blockSize){o(this,P),O=0;break}}else for(;F<E;)if(P[O++]=k[F++],O==this.blockSize){o(this,P),O=0;break}}this.h=O,this.o+=E},s.prototype.A=function(){var k=Array((this.h<56?this.blockSize:this.blockSize*2)-this.h);k[0]=128;for(var E=1;E<k.length-8;++E)k[E]=0;E=this.o*8;for(var j=k.length-8;j<k.length;++j)k[j]=E&255,E/=256;for(this.v(k),k=Array(16),E=0,j=0;j<4;++j)for(let P=0;P<32;P+=8)k[E++]=this.g[j]>>>P&255;return k};function l(k,E){var j=h;return Object.prototype.hasOwnProperty.call(j,k)?j[k]:j[k]=E(k)}function u(k,E){this.h=E;const j=[];let P=!0;for(let O=k.length-1;O>=0;O--){const F=k[O]|0;P&&F==E||(j[O]=F,P=!1)}this.g=j}var h={};function f(k){return-128<=k&&k<128?l(k,function(E){return new u([E|0],E<0?-1:0)}):new u([k|0],k<0?-1:0)}function p(k){if(isNaN(k)||!isFinite(k))return b;if(k<0)return A(p(-k));const E=[];let j=1;for(let P=0;k>=j;P++)E[P]=k/j|0,j*=4294967296;return new u(E,0)}function x(k,E){if(k.length==0)throw Error("number format error: empty string");if(E=E||10,E<2||36<E)throw Error("radix out of range: "+E);if(k.charAt(0)=="-")return A(x(k.substring(1),E));if(k.indexOf("-")>=0)throw Error('number format error: interior "-" character');const j=p(Math.pow(E,8));let P=b;for(let F=0;F<k.length;F+=8){var O=Math.min(8,k.length-F);const S=parseInt(k.substring(F,F+O),E);O<8?(O=p(Math.pow(E,O)),P=P.j(O).add(p(S))):(P=P.j(j),P=P.add(p(S)))}return P}var b=f(0),C=f(1),N=f(16777216);n=u.prototype,n.m=function(){if(R(this))return-A(this).m();let k=0,E=1;for(let j=0;j<this.g.length;j++){const P=this.i(j);k+=(P>=0?P:4294967296+P)*E,E*=4294967296}return k},n.toString=function(k){if(k=k||10,k<2||36<k)throw Error("radix out of range: "+k);if(T(this))return"0";if(R(this))return"-"+A(this).toString(k);const E=p(Math.pow(k,6));var j=this;let P="";for(;;){const O=H(j,E).g;j=U(j,O.j(E));let F=((j.g.length>0?j.g[0]:j.h)>>>0).toString(k);if(j=O,T(j))return F+P;
1008for(;F.length<6;)F="0"+F;P=F+P}},n.i=function(k){return k<0?0:k<this.g.length?this.g[k]:this.h};function T(k){if(k.h!=0)return!1;for(let E=0;E<k.g.length;E++)if(k.g[E]!=0)return!1;return!0}function R(k){return k.h==-1}n.l=function(k){return k=U(this,k),R(k)?-1:T(k)?0:1};function A(k){const E=k.g.length,j=[];for(let P=0;P<E;P++)j[P]=~k.g[P];return new u(j,~k.h).add(C)}n.abs=function(){return R(this)?A(this):this},n.add=function(k){const E=Math.max(this.g.length,k.g.length),j=[];let P=0;for(let O=0;O<=E;O++){let F=P+(this.i(O)&65535)+(k.i(O)&65535),S=(F>>>16)+(this.i(O)>>>16)+(k.i(O)>>>16);P=S>>>16,F&=65535,S&=65535,j[O]=S<<16|F}return new u(j,j[j.length-1]&-2147483648?-1:0)};function U(k,E){return k.add(A(E))}n.j=function(k){if(T(this)||T(k))return b;if(R(this))return R(k)?A(this).j(A(k)):A(A(this).j(k));if(R(k))return A(this.j(A(k)));if(this.l(N)<0&&k.l(N)<0)return p(this.m()*k.m());const E=this.g.length+k.g.length,j=[];for(var P=0;P<2*E;P++)j[P]=0;for(P=0;P<this.g.length;P++)for(let O=0;O<k.g.length;O++){const F=this.i(P)>>>16,S=this.i(P)&65535,be=k.i(O)>>>16,Ee=k.i(O)&65535;j[2*P+2*O]+=S*Ee,M(j,2*P+2*O),j[2*P+2*O+1]+=F*Ee,M(j,2*P+2*O+1),j[2*P+2*O+1]+=S*be,M(j,2*P+2*O+1),j[2*P+2*O+2]+=F*be,M(j,2*P+2*O+2)}for(k=0;k<E;k++)j[k]=j[2*k+1]<<16|j[2*k];for(k=E;k<2*E;k++)j[k]=0;return new u(j,0)};function M(k,E){for(;(k[E]&65535)!=k[E];)k[E+1]+=k[E]>>>16,k[E]&=65535,E++}function V(k,E){this.g=k,this.h=E}function H(k,E){if(T(E))throw Error("division by zero");if(T(k))return new V(b,b);if(R(k))return E=H(A(k),E),new V(A(E.g),A(E.h));if(R(E))return E=H(k,A(E)),new V(A(E.g),E.h);if(k.g.length>30){if(R(k)||R(E))throw Error("slowDivide_ only works with positive integers.");for(var j=C,P=E;P.l(k)<=0;)j=Q(j),P=Q(P);var O=Y(j,1),F=Y(P,1);for(P=Y(P,2),j=Y(j,2);!T(P);){var S=F.add(P);S.l(k)<=0&&(O=O.add(j),F=S),P=Y(P,1),j=Y(j,1)}return E=U(k,O.j(E)),new V(O,E)}for(O=b;k.l(E)>=0;){for(j=Math.max(1,Math.floor(k.m()/E.m())),P=Math.ceil(Math.log(j)/Math.LN2),P=P<=48?1:Math.pow(2,P-48),F=p(j),S=F.j(E);R(S)||S.l(k)>0;)j-=P,F=p(j),S=F.j(E);T(F)&&(F=C),O=O.add(F),k=U(k,S)}return new V(O,k)}n.B=function(k){return H(this,k).h},n.and=function(k){const E=Math.max(this.g.length,k.g.length),j=[];for(let P=0;P<E;P++)j[P]=this.i(P)&k.i(P);return new u(j,this.h&k.h)},n.or=function(k){const E=Math.max(this.g.length,k.g.length),j=[];for(let P=0;P<E;P++)j[P]=this.i(P)|k.i(P);return new u(j,this.h|k.h)},n.xor=function(k){const E=Math.max(this.g.length,k.g.length),j=[];for(let P=0;P<E;P++)j[P]=this.i(P)^k.i(P);return new u(j,this.h^k.h)};function Q(k){const E=k.g.length+1,j=[];for(let P=0;P<E;P++)j[P]=k.i(P)<<1|k.i(P-1)>>>31;return new u(j,k.h)}function Y(k,E){const j=E>>5;E%=32;const P=k.g.length-j,O=[];for(let F=0;F<P;F++)O[F]=E>0?k.i(F+j)>>>E|k.i(F+j+1)<<32-E:k.i(F+j);return new u(O,k.h)}s.prototype.digest=s.prototype.A,s.prototype.reset=s.prototype.u,s.prototype.update=s.prototype.v,WD=s,u.prototype.add=u.prototype.add,u.prototype.multiply=u.prototype.j,u.prototype.modulo=u.prototype.B,u.prototype.compare=u.prototype.l,u.prototype.toNumber=u.prototype.m,u.prototype.toString=u.prototype.toString,u.prototype.getBits=u.prototype.i,u.fromNumber=p,u.fromString=x,_c=u}).apply(typeof XE<"u"?XE:typeof self<"u"?self:typeof window<"u"?window:{});var K0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license 1009Copyright The Closure Library Authors. 1010SPDX-License-Identifier: Apache-2.0 1011*/var ZD,nm,eT,NB,My,tT,nT,sT;(function(){var n,e=Object.defineProperty;function t(B){B=[typeof globalThis=="object"&&globalThis,B,typeof window=="object"&&window,typeof self=="object"&&self,typeof K0=="object"&&K0];for(var v=0;v<B.length;++v){var D=B[v];if(D&&D.Math==Math)return D}throw Error("Cannot find global object")}var s=t(this);function o(B,v){if(v)e:{var D=s;B=B.split(".");for(var z=0;z<B.length-1;z++){var he=B[z];if(!(he in D))break e;D=D[he]}B=B[B.length-1],z=D[B],v=v(z),v!=z&&v!=null&&e(D,B,{configurable:!0,writable:!0,value:v})}}o("Symbol.dispose",function(B){return B||Symbol("Symbol.dispose")}),o("Array.prototype.values",function(B){return B||function(){return this[Symbol.iterator]()}}),o("Object.entries",function(B){return B||function(v){var D=[],z;for(z in v)Object.prototype.hasOwnProperty.call(v,z)&&D.push([z,v[z]]);return D}});/** @license 1012 1013 Copyright The Closure Library Authors. 1014 SPDX-License-Identifier: Apache-2.0 1015*/var l=l||{},u=this||self;function h(B){var v=typeof B;return v=="object"&&B!=null||v=="function"}function f(B,v,D){return B.call.apply(B.bind,arguments)}function p(B,v,D){return p=f,p.apply(null,arguments)}
1015function x(B,v){var D=Array.prototype.slice.call(arguments,1);return function(){var z=D.slice();return z.push.apply(z,arguments),B.apply(this,z)}}function b(B,v){function D(){}D.prototype=v.prototype,B.Z=v.prototype,B.prototype=new D,B.prototype.constructor=B,B.Ob=function(z,he,_e){for(var Ye=Array(arguments.length-2),qt=2;qt<arguments.length;qt++)Ye[qt-2]=arguments[qt];return v.prototype[he].apply(z,Ye)}}var C=typeof AsyncContext<"u"&&typeof AsyncContext.Snapshot=="function"?B=>B&&AsyncContext.Snapshot.wrap(B):B=>B;function N(B){const v=B.length;if(v>0){const D=Array(v);for(let z=0;z<v;z++)D[z]=B[z];return D}return[]}function T(B,v){for(let z=1;z<arguments.length;z++){const he=arguments[z];var D=typeof he;if(D=D!="object"?D:he?Array.isArray(he)?"array":D:"null",D=="array"||D=="object"&&typeof he.length=="number"){D=B.length||0;const _e=he.length||0;B.length=D+_e;for(let Ye=0;Ye<_e;Ye++)B[D+Ye]=he[Ye]}else B.push(he)}}class R{constructor(v,D){this.i=v,this.j=D,this.h=0,this.g=null}get(){let v;return this.h>0?(this.h--,v=this.g,this.g=v.next,v.
1015next=null):v=this.i(),v}}function A(B){u.setTimeout(()=>{throw B},0)}function U(){var B=k;let v=null;return B.g&&(v=B.g,B.g=B.g.next,B.g||(B.h=null),v.next=null),v}class M{constructor(){this.h=this.g=null}add(v,D){const z=V.get();z.set(v,D),this.h?this.h.next=z:this.g=z,this.h=z}}var V=new R(()=>new H,B=>B.reset());class H{constructor(){this.next=this.g=this.h=null}set(v,D){this.h=v,this.g=D,this.next=null}reset(){this.next=this.g=this.h=null}}let Q,Y=!1,k=new M,E=()=>{const B=Promise.resolve(void 0);Q=()=>{B.then(j)}};function j(){for(var B;B=U();){try{B.h.call(B.g)}catch(D){A(D)}var v=V;v.j(B),v.h<100&&(v.h++,B.next=v.g,v.g=B)}Y=!1}function P(){this.u=this.u,this.C=this.C}P.prototype.u=!1,P.prototype.dispose=function(){this.u||(this.u=!0,this.N())},P.prototype[Symbol.dispose]=function(){this.dispose()},P.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function O(B,v){this.type=B,this.g=this.target=v,this.defaultPrevented=!1}O.prototype.h=function(){this.defaultPrevented=!0};var F=(function(){if(!u.addEventListener||!Object.defineProperty)return!1;var B=!1,v=Object.defineProperty({},"passive",{get:function(){B=!0}});try{const D=()=>{};u.addEventListener("test",D,v),u.removeEventListener("test",D,v)}catch{}return B})();function S(B){return/^[\s\xa0]*$/.test(B)}function be(B,v){O.call(this,B?B.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,B&&this.init(B,v)}b(be,O),be.prototype.init=function(B,v){const D=this.type=B.type,z=B.changedTouches&&B.changedTouches.length?B.changedTouches[0]:null;this.target=B.target||B.srcElement,this.g=v,v=B.relatedTarget,v||(D=="mouseover"?v=B.fromElement:D=="mouseout"&&(v=B.toElement)),this.relatedTarget=v,z?(this.clientX=z.clientX!==void 0?z.clientX:z.pageX,this.clientY=z.clientY!==void 0?z.clientY:z.pageY,this.screenX=z.screenX||0,this.screenY=z.screenY||0):(this.clientX=B.clientX!==void 0?B.clientX:B.pageX,this.clientY=B.clientY!==void 0?B.clientY:B.pageY,this.screenX=B.screenX||0,this.screenY=B.screenY||0),this.button=B.button,this.key=B.key||"",this.ctrlKey=B.ctrlKey,this.altKey=B.altKey,this.shiftKey=B.shiftKey,this.metaKey=B.metaKey,this.pointerId=B.pointerId||0,this.pointerType=B.pointerType,this.state=B.state,this.i=B,B.defaultPrevented&&be.Z.h.call(this)},be.prototype.h=function(){be.Z.h.call(this);const B=this.i;B.preventDefault?B.preventDefault():B.returnValue=!1};var Ee="closure_listenable_"+(Math.random()*1e6|0),me=0;function De(B,v,D,z,he){this.listener=B,this.proxy=null,this.src=v,this.type=D,this.capture=!!z,this.ha=he,this.key=++me,this.da=this.fa=!1}function ge(B){B.da=!0,B.listener=null,B.proxy=null,B.src=null,B.ha=null}function Ue(B,v,D){for(const z in B)v.call(D,B[z],z,B)}function we(B,v){for(const D in B)v.call(void 0,B[D],D,B)}function $e(B){const v={};for(const D in B)v[D]=B[D];return v}const et="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function Ae(B,v){let D,z;for(let he=1;he<arguments.length;he++){z=arguments[he];for(D in z)B[D]=z[D];for(let _e=0;_e<et.length;_e++)D=et[_e],Object.prototype.hasOwnProperty.call(z,D)&&(B[D]=z[D])}}function K(B){this.src=B,this.g={},this.h=0}K.prototype.add=function(B,v,D,z,he){const _e=B.toString();B=this.g[_e],B||(B=this.g[_e]=[],this.h++);const Ye=Pe(B,v,z,he);return Ye>-1?(v=B[Ye],D||(v.fa=!1)):(v=new De(v,this.src,_e,!!z,he),v.fa=D,B.push(v)),v};function ne(B,v){const D=v.type;if(D in B.g){var z=B.g[D],he=Array.prototype.indexOf.call(z,v,void 0),_e;(_e=he>=0)&&Array.prototype.splice.call(z,he,1),_e&&(ge(v),B.g[D].length==0&&(delete B.g[D],B.h--))}}function Pe(B,v,D,z){for(let he=0;he<B.length;++he){const _e=B[he];if(!_e.da&&_e.listener==v&&_e.capture==!!D&&_e.ha==z)return he}return-1}var Le="closure_lm_"+(Math.random()*1e6|0),mt={};function tt(B,v,D,z,he){if(Array.isArray(v)){for(let _e=0;_e<v.length;_e++)tt(B,v[_e],D,z,he);return null}return D=jt(D),B&&B[Ee]?B.J(v,D,h(z)?!!z.capture:!1,he):lt(B,v,D,!1,z,he)}function lt(B,v,D,z,he,_e){if(!v)throw Error("Invalid event type");const Ye=h(he)?!!he.capture:!!he;
vendor: 5,737 bytes, lines 1015-1019
1015let qt=Zt(B);if(qt||(B[Le]=qt=new K(B)),D=qt.add(v,D,z,Ye,_e),D.proxy)return D;if(z=Qe(),D.proxy=z,z.src=B,z.listener=D,B.addEventListener)F||(he=Ye),he===void 0&&(he=!1),B.addEventListener(v.toString(),z,he);else if(B.attachEvent)B.attachEvent(Rn(v.toString()),z);else if(B.addListener&&B.removeListener)B.addListener(z);else throw Error("addEventListener and attachEvent are unavailable.");return D}function Qe(){function B(D){return v.call(B.src,B.listener,D)}const v=zn;return B}function st(B,v,D,z,he){if(Array.isArray(v))for(var _e=0;_e<v.length;_e++)st(B,v[_e],D,z,he);else z=h(z)?!!z.capture:!!z,D=jt(D),B&&B[Ee]?(B=B.i,_e=String(v).toString(),_e in B.g&&(v=B.g[_e],D=Pe(v,D,z,he),D>-1&&(ge(v[D]),Array.prototype.splice.call(v,D,1),v.length==0&&(delete B.g[_e],B.h--)))):B&&(B=Zt(B))&&(v=B.g[v.toString()],B=-1,v&&(B=Pe(v,D,z,he)),(D=B>-1?v[B]:null)&&Yn(D))}function Yn(B){if(typeof B!="number"&&B&&!B.da){var v=B.src;if(v&&v[Ee])ne(v.i,B);else{var D=B.type,z=B.proxy;v.removeEventListener?v.removeEventListener(D,z,B.capture):v.detachEvent?v.detachEvent(Rn(D),z):v.addListener&&v.removeListener&&v.removeListener(z),(D=Zt(v))?(ne(D,B),D.h==0&&(D.src=null,v[Le]=null)):ge(B)}}}function Rn(B){return B in mt?mt[B]:mt[B]="on"+B}function zn(B,v){if(B.da)B=!0;else{v=new be(v,this);const D=B.listener,z=B.ha||B.src;B.fa&&Yn(B),B=D.call(z,v)}return B}function Zt(B){return B=B[Le],B instanceof K?B:null}var en="__closure_events_fn_"+(Math.random()*1e9>>>0);function jt(B){return typeof B=="function"?B:(B[en]||(B[en]=function(v){return B.handleEvent(v)}),B[en])}function At(){P.call(this),this.i=new K(this),this.M=this,this.G=null}b(At,P),At.prototype[Ee]=!0,At.prototype.removeEventListener=function(B,v,D,z){st(this,B,v,D,z)};function Tt(B,v){var D,z=B.G;if(z)for(D=[];z;z=z.G)D.push(z);if(B=B.M,z=v.type||v,typeof v=="string")v=new O(v,B);else if(v instanceof O)v.target=v.target||B;else{var he=v;v=new O(z,B),Ae(v,he)}he=!0;let _e,Ye;if(D)for(Ye=D.length-1;Ye>=0;Ye--)_e=v.g=D[Ye],he=gn(_e,z,!0,v)&&he;if(_e=v.g=B,he=gn(_e,z,!0,v)&&he,he=gn(_e,z,!1,v)&&he,D)for(Ye=0;Ye<D.length;Ye++)_e=v.g=D[Ye],he=gn(_e,z,!1,v)&&he}At.prototype.N=function(){if(At.Z.N.call(this),this.i){var B=this.i;for(const v in B.g){const D=B.g[v];for(let z=0;z<D.length;z++)ge(D[z]);delete B.g[v],B.h--}}this.G=null},At.prototype.J=function(B,v,D,z){return this.i.add(String(B),v,!1,D,z)},At.prototype.K=function(B,v,D,z){return this.i.add(String(B),v,!0,D,z)};function gn(B,v,D,z){if(v=B.i.g[String(v)],!v)return!0;v=v.concat();let he=!0;for(let _e=0;_e<v.length;++_e){const Ye=v[_e];if(Ye&&!Ye.da&&Ye.capture==D){const qt=Ye.listener,Ds=Ye.ha||Ye.src;Ye.fa&&ne(B.i,Ye),he=qt.call(Ds,z)!==!1&&he}}return he&&!z.defaultPrevented}function Oe(B,v){if(typeof B!="function")if(B&&typeof B.handleEvent=="function")B=p(B.handleEvent,B);else throw Error("Invalid listener argument");return Number(v)>2147483647?-1:u.setTimeout(B,v||0)}function vt(B){B.g=Oe(()=>{B.g=null,B.i&&(B.i=!1,vt(B))},B.l);const v=B.h;B.h=null,B.m.apply(null,v)}class Ft extends P{constructor(v,D){super(),this.m=v,this.l=D,this.h=null,this.i=!1,this.g=null}j(v){this.h=arguments,this.g?this.i=!0:vt(this)}N(){super.N(),this.g&&(u.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function on(B){P.call(this),this.h=B,this.g={}}b(on,P);var Zn=[];function Fn(B){Ue(B.g,function(v,D){this.g.hasOwnProperty(D)&&Yn(v)},B),B.g={}}on.prototype.N=function(){on.Z.N.call(this),Fn(this)},on.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var In=u.JSON.stringify,nn=u.JSON.parse,Ve=class{stringify(B){return u.JSON.stringify(B,void 0)}parse(B){return u.JSON.parse(B,void 0)}};function Rt(){}function os(){}var Hn={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function _t(){O.call(this,"d")}b(_t,O);function Sn(){O.call(this,"c")}b(Sn,O);var Qt={},Vt=null;function at(){return Vt=Vt||new At}Qt.Ia="serverreachability";function Et(B){O.call(this,Qt.Ia,B)}b(Et,O);function hs(B){const v=at();Tt(v,new Et(v))}Qt.STAT_EVENT="statevent";function xn(B,v){O.call(this,Qt.STAT_EVENT,B),this.stat=v}b(xn,O);function wt(B){const v=at();Tt(v,new xn(v,B))}Qt.Ja="timingevent";function rn(B,v){O.call(this,Qt.Ja,B),this.size=v}b(rn,O);function jn(B,v){if(typeof B!="function")throw Error("Fn must not be null and must be a function");return u.setTimeout(function(){B()},v)}function On(){this.g=!0}On.prototype.ua=function(){this.g=!1};function es(B,v,D,z,he,_e){B.info(function(){if(B.g)if(_e){var Ye="",qt=_e.split("&");for(let bn=0;bn<qt.length;bn++){var Ds=qt[bn].split("=");if(Ds.length>1){const Cs=Ds[0];Ds=Ds[1];const Tr=Cs.split("_");Ye=Tr.length>=2&&Tr[1]=="type"?Ye+(Cs+"="+Ds+"&"):Ye+(Cs+"=redacted&")}}}else Ye=null;else Ye=_e;return"XMLHTTP REQ ("+z+") [attempt "+he+"]: "+v+` 1016`+D+` 1017`+Ye})}function ls(B,v,D,z,he,_e,Ye){B.info(function(){return"XMLHTTP RESP ("+z+") [ attempt "+he+"]: "+v+` 1018`+D+` 1019`+_e+" "+Ye})}function Vn(B,v,D,z){B.info(function(){return"XMLHTTP TEXT ("+v+"): "+sn(B,D)+(z?" "+z:"")})}function de(B,v){B.info(function(){return"TIMEOUT: "+v})}On.prototype.info=function(){};function sn(B,v){if(!B.g)return v;if(!v)return null;try{const _e=JSON.parse(v);if(_e){for(B=0;B<_e.length;B++)if(Array.isArray(_e[B])){var D=_e[B];if(!(D.length<2)){var z=D[1];if(Array.isArray(z)&&!(z.length<1)){var he=z[0];if(he!="noop"&&he!="stop"&&he!="close")for(let Ye=1;Ye<z.length;Ye++)z[Ye]=""}}}}return In(_e)}catch{return v}}var Ut={NO_ERROR:0,cb:1,qb:2,pb:3,kb:4,ob:5,rb:6,Ga:7,TIMEOUT:8,ub:9},xs={ib:"complete",Fb:"success",ERROR:"error",Ga:"abort",xb:"ready",yb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",wb:"progress",lb:"downloadprogress",Nb:"uploadprogress"},He;function Us(){}b(Us,Rt),Us.prototype.g=function(){return new XMLHttpRequest}
1019,He=new Us;function Ot(B){return encodeURIComponent(String(B))}function Un(B){var v=1;B=B.split(":");const D=[];for(;v>0&&B.length;)D.push(B.shift()),v--;return B.length&&D.push(B.join(":")),D}function ln(B,v,D,z){this.j=B,this.i=v,this.l=D,this.S=z||1,this.V=new on(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 An}function An(){this.i=null,this.g="",this.h=!1}var Nr={},ee={};function ve(B,v,D){B.M=1,B.A=bs(ye(v)),B.u=D,B.R=!0,Gt(B,null)}function Gt(B,v){B.F=Date.now(),fs(B),B.B=ye(B.A);var D=B.B,z=B.S;Array.isArray(z)||(z=[String(z)]),qn(D.i,"t",z),B.C=0,D=B.j.L,B.h=new An,B.g=Za(B.j,D?v:null,!B.u),B.P>0&&(B.O=new Ft(p(B.Y,B,B.g),B.P)),v=B.V,D=B.g,z=B.ba;var he="readystatechange";Array.isArray(he)||(he&&(Zn[0]=he.toString()),he=Zn);for(let _e=0;_e<he.length;_e++){const Ye=tt(D,he[_e],z||v.handleEvent,!1,v.h||v);if(!Ye)break;v.g[Ye.key]=Ye}v=B.J?$e(B.J):{},B.u?(B.v||(B.v="POST"),v["Content-Type"]="application/x-www-form-urlencoded",B.g.ea(B.B,B.v,B.u,v)):(B.v="GET",B.g.ea(B.B,B.v,null,v)),hs(),es(B.i,B.v,B.B,B.l,B.S,B.u)}ln.prototype.ba=function(B){B=B.target;const v=this.O;v&&fn(B)==3?v.j():this.Y(B)},ln.prototype.Y=function(B){try{if(B==this.g)e:{const qt=fn(this.g),Ds=this.g.ya(),bn=this.g.ca();if(!(qt<3)&&(qt!=3||this.g&&(this.h.h||this.g.la()||zr(this.g)))){this.K||qt!=4||Ds==7||(Ds==8||bn<=0?hs(3):hs(2)),ra(this);var v=this.g.ca();this.X=v;var D=hn(this);if(this.o=v==200,ls(this.i,this.v,this.B,this.l,this.S,qt,v),this.o){if(this.U&&!this.L){t:{if(this.g){var z,he=this.g;if((z=he.g?he.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!S(z)){var _e=z;break t}}_e=null}if(B=_e)Vn(this.i,this.l,B,"Initial handshake response via X-HTTP-Initial-Response"),this.L=!0,Yr(this,B);else{this.o=!1,this.m=3,wt(12),Ks(this),Dr(this);break e}}if(this.R){B=!0;let Cs;for(;!this.K&&this.C<D.length;)if(Cs=Is(this,D),Cs==ee){qt==4&&(this.m=4,wt(14),B=!1),Vn(this.i,this.l,null,"[Incomplete Response]");break}else if(Cs==Nr){this.m=4,wt(15),Vn(this.i,this.l,D,"[Invalid Chunk]"),B=!1;break}else Vn(this.i,this.l,Cs,null),Yr(this,Cs);if(Js(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),qt!=4||D.length!=0||this.h.h||(this.m=1,wt(16),B=!1),this.o=this.o&&B,!B)Vn(this.i,this.l,D,"[Invalid Chunked Response]"),Ks(this),Dr(this);else if(D.length>0&&!this.W){this.W=!0;var Ye=this.j;Ye.g==this&&Ye.aa&&!Ye.P&&(Ye.j.info("Great, no buffering proxy detected. Bytes received: "+D.length),Ht(Ye),Ye.P=!0,wt(11))}}else Vn(this.i,this.l,D,null),Yr(this,D);qt==4&&Ks(this),this.o&&!this.K&&(qt==4?Wa(this.j,this):(this.o=!1,fs(this)))}else qc(this.g),v==400&&D.indexOf("Unknown SID")>0?(this.m=3,wt(12)):(this.m=0,wt(13)),Ks(this),Dr(this)}}}catch{}finally{}};function hn(B){if(!Js(B))return B.g.la();const v=zr(B.g);if(v==="")return"";let D="";const z=v.length,he=fn(B.g)==4;if(!B.h.i){if(typeof TextDecoder>"u")return Ks(B),Dr(B),"";B.h.i=new u.TextDecoder}for(let _e=0;_e<z;_e++)B.h.h=!0,D+=B.h.i.decode(v[_e],{stream:!(he&&_e==z-1)});return v.length=0,B.h.g+=D,B.C=0,B.h.g}function Js(B){return B.g?B.v=="GET"&&B.M!=2&&B.j.Aa:!1}function Is(B,v){var D=B.C,z=v.indexOf(` 1020`,D);return z==-1?ee:(D=Number(v.substring(D,z)),isNaN(D)?Nr:(z+=1,z+D>v.length?ee:(v=v.slice(z,z+D),B.C=z+D,v)))}ln.prototype.cancel=function(){this.K=!0,Ks(this)};function fs(B){B.T=Date.now()+B.H,Pr(B,B.H)}function Pr(B,v){if(B.D!=null)throw Error("WatchDog timer not null");B.D=jn(p(B.aa,B),v)}function ra(B){B.D&&(u.clearTimeout(B.D),B.D=null)}ln.prototype.aa=function(){this.D=null;const B=Date.now();B-this.T>=0?(de(this.i,this.B),this.M!=2&&(hs(),wt(17)),Ks(this),this.m=2,Dr(this)):Pr(this,this.T-B)};function Dr(B){B.j.I==0||B.K||Wa(B.j,B)}function Ks(B){ra(B);var v=B.O;v&&typeof v.dispose=="function"&&v.dispose(),B.O=null,Fn(B.V),B.g&&(v=B.g,B.g=null,v.abort(),v.dispose())}function Yr(B,v){try{var D=B.j;if(D.I!=0&&(D.g==B||_s(D.h,B))){if(!B.L&&_s(D.h,B)&&D.I==3){try{var z=D.Ba.g.parse(v)}catch{z=null}if(Array.isArray(z)&&z.length==3){var he=z;if(he[0]==0){e:if(!D.v){if(D.g)if(D.g.F+3e3<B.F)da(D),jl(D);else break e;Vo(D),wt(18)}}else D.xa=he[1],0<D.xa-D.K&&he[2]<37500&&D.F&&D.A==0&&!D.C&&(D.C=jn(p(D.Va,D),6e3));Xn(D.h)<=1&&D.ta&&(D.ta=void 0)}else ms(D,11)}else if((B.L||D.g==B)&&da(D),!S(v))for(he=D.Ba.g.parse(v),v=0;v<he.length;v++){let bn=he[v];const Cs=bn[0];if(!(Cs<=D.K))if(D.K=Cs,bn=bn[1],D.I==2)if(bn[0]=="c"){D.M=bn[1],D.ba=bn[2];const Tr=bn[3];Tr!=null&&(D.ka=Tr,D.j.info("VER="+D.ka));const ha=bn[4];ha!=null&&(D.za=ha,D.j.info("SVER="+D.za));const Fr=bn[5];Fr!=null&&typeof Fr=="number"&&Fr>0&&(z=1.5*Fr,D.O=z,D.j.info("backChannelRequestTimeoutMs_="+z)),z=D;const ei=B.g;if(ei){const Ho=ei.g?ei.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(Ho){var _e=z.h;_e.g||Ho.indexOf("spdy")==-1&&Ho.indexOf("quic")==-1&&Ho.indexOf("h2")==-1||(_e.j=_e.l,_e.g=new Set,_e.h&&(Br(_e,_e.h),_e.h=null))}if(z.G){const no=ei.g?ei.g.getResponseHeader("X-HTTP-Session-Id"):null;no&&(z.wa=no,Jt(z.J,z.G,no))}}D.I=3,D.l&&D.l.ra(),D.aa&&(D.T=Date.now()-B.F,D.j.info("Handshake RTT: "+D.T+"ms")),z=D;var Ye=B;
vendor: 1,145 bytes, line 1020
1020if(z.na=Uo(z,z.L?z.ba:null,z.W),Ye.L){Os(z.h,Ye);var qt=Ye,Ds=z.O;Ds&&(qt.H=Ds),qt.D&&(ra(qt),fs(qt)),z.g=Ye}else ua(z);D.i.length>0&&Ns(D)}else bn[0]!="stop"&&bn[0]!="close"||ms(D,7);else D.I==3&&(bn[0]=="stop"||bn[0]=="close"?bn[0]=="stop"?ms(D,7):Pi(D):bn[0]!="noop"&&D.l&&D.l.qa(bn),D.A=0)}}hs(4)}catch{}}var ia=class{constructor(B,v){this.g=B,this.map=v}};function Oi(B){this.l=B||10,u.PerformanceNavigationTiming?(B=u.performance.getEntriesByType("navigation"),B=B.length>0&&(B[0].nextHopProtocol=="hq"||B[0].nextHopProtocol=="h2")):B=!!(u.chrome&&u.chrome.loadTimes&&u.chrome.loadTimes()&&u.chrome.loadTimes().wasFetchedViaSpdy),this.j=B?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function cr(B){return B.h?!0:B.g?B.g.size>=B.j:!1}function Xn(B){return B.h?1:B.g?B.g.size:0}function _s(B,v){return B.h?B.h==v:B.g?B.g.has(v):!1}function Br(B,v){B.g?B.g.add(v):B.h=v}function Os(B,v){B.h&&B.h==v?B.h=null:B.g&&B.g.has(v)&&B.g.delete(v)}Oi.prototype.cancel=function(){if(this.i=Ha(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const B of this.g.values())B.cancel();this.g.clear()}};
1020function Ha(B){if(B.h!=null)return B.i.concat(B.h.G);if(B.g!=null&&B.g.size!==0){let v=B.i;for(const D of B.g.values())v=v.concat(D.G);return v}return N(B.i)}var ws=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function ce(B,v){if(B){B=B.split("&");for(let D=0;D<B.length;D++){const z=B[D].indexOf("=");let he,_e=null;z>=0?(he=B[D].substring(0,z),_e=B[D].substring(z+1)):he=B[D],v(he,_e?decodeURIComponent(_e.replace(/\+/g," ")):"")}}}function Ce(B){this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1;let v;B instanceof Ce?(this.l=B.l,dt(this,B.j),this.o=B.o,this.g=B.g,ut(this,B.u),this.h=B.h,Yt(this,ur(B.i)),this.m=B.m):B&&(v=String(B).match(ws))?(this.l=!1,dt(this,v[1]||"",!0),this.o=ts(v[2]||""),this.g=ts(v[3]||"",!0),ut(this,v[4]),this.h=ts(v[5]||"",!0),Yt(this,v[6]||"",!0),this.m=ts(v[7]||"")):(this.l=!1,this.i=new Po(null,this.l))}Ce.prototype.toString=function(){const B=[];var v=this.j;v&&B.push(aa(v,cs,!0),":");var D=this.g;return(D||v=="file")&&(B.push("//"),(v=this.o)&&B.push(aa(v,cs,!0),"@"),B.push(Ot(D).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),D=this.u,D!=null&&B.push(":",String(D))),(D=this.h)&&(this.g&&D.charAt(0)!="/"&&B.push("/"),B.push(aa(D,D.charAt(0)=="/"?Sa:qa,!0))),(D=this.i.toString())&&B.push("?",D),(D=this.m)&&B.push("#",aa(D,Yu)),B.join("")},Ce.prototype.resolve=function(B){const v=ye(this);let D=!!B.j;D?dt(v,B.j):D=!!B.o,D?v.o=B.o:D=!!B.g,D?v.g=B.g:D=B.u!=null;var z=B.h;if(D)ut(v,B.u);else if(D=!!B.h){if(z.charAt(0)!="/")if(this.g&&!this.h)z="/"+z;else{var he=v.h.lastIndexOf("/");he!=-1&&(z=v.h.slice(0,he+1)+z)}if(he=z,he==".."||he==".")z="";else if(he.indexOf("./")!=-1||he.indexOf("/.")!=-1){z=he.lastIndexOf("/",0)==0,he=he.split("/");const _e=[];for(let Ye=0;Ye<he.length;){const qt=he[Ye++];qt=="."?z&&Ye==he.length&&_e.push(""):qt==".."?((_e.length>1||_e.length==1&&_e[0]!="")&&_e.pop(),z&&Ye==he.length&&_e.push("")):(_e.push(qt),z=!0)}z=_e.join("/")}else z=he}return D?v.h=z:D=B.i.toString()!=="",D?Yt(v,ur(B.i)):D=!!B.m,D&&(v.m=B.m),v};function ye(B){return new Ce(B)}function dt(B,v,D){B.j=D?ts(v,!0):v,B.j&&(B.j=B.j.replace(/:$/,""))}function ut(B,v){if(v){if(v=Number(v),isNaN(v)||v<0)throw Error("Bad port number "+v);B.u=v}else B.u=null}function Yt(B,v,D){v instanceof Po?(B.i=v,Uc(B.i,B.l)):(D||(v=aa(v,wp)),B.i=new Po(v,B.l))}function Jt(B,v,D){B.i.set(v,D)}function bs(B){return Jt(B,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^Date.now()).toString(36)),B}function ts(B,v){return B?v?decodeURI(B.replace(/%25/g,"%2525")):decodeURIComponent(B):""}function aa(B,v,D){return typeof B=="string"?(B=encodeURI(B).replace(v,Ls),D&&(B=B.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),B):null}function Ls(B){return B=B.charCodeAt(0),"%"+(B>>4&15).toString(16)+(B&15).toString(16)}var cs=/[#\/\?@]/g,qa=/[#\?:]/g,Sa=/[#\?]/g,wp=/[#\?@]/g,Yu=/#/g;function Po(B,v){this.h=this.g=null,this.i=B||null,this.j=!!v}function $a(B){B.g||(B.g=new Map,B.h=0,B.i&&ce(B.i,function(v,D){B.add(decodeURIComponent(v.replace(/\+/g," ")),D)}))}n=Po.prototype,n.add=function(B,v){$a(this),this.i=null,B=ns(this,B);let D=this.g.get(B);return D||this.g.set(B,D=[]),D.push(v),this.h+=1,this};function Lt(B,v){$a(B),v=ns(B,v),B.g.has(v)&&(B.i=null,B.h-=B.g.get(v).length,B.g.delete(v))}function Dl(B,v){return $a(B),v=ns(B,v),B.g.has(v)}n.forEach=function(B,v){$a(this),this.g.forEach(function(D,z){D.forEach(function(he){B.call(v,he,z,this)},this)},this)};function ja(B,v){$a(B);let D=[];if(typeof v=="string")Dl(B,v)&&(D=D.concat(B.g.get(ns(B,v))));else for(B=Array.from(B.g.values()),v=0;v<B.length;v++)D=D.concat(B[v]);return D}n.set=function(B,v){return $a(this),this.i=null,B=ns(this,B),Dl(this,B)&&(this.h-=this.g.get(B).length),this.g.set(B,[v]),this.h+=1,this},n.get=function(B,v){return B?(B=ja(this,B),B.length>0?String(B[0]):v):v};function qn(B,v,D){Lt(B,v),D.length>0&&(B.i=null,B.g.set(ns(B,v),N(D)),B.h+=D.length)}n.toString=function(){if(this.i)return this.i;if(!this.g)return"";const B=[],v=Array.from(this.g.keys());for(let z=0;z<v.length;z++){var D=v[z];const he=Ot(D);D=ja(this,D);for(let _e=0;_e<D.length;_e++){let Ye=he;D[_e]!==""&&(Ye+="="+Ot(D[_e])),B.push(Ye)}}return this.i=B.join("&")};function ur(B){const v=new Po;return v.i=B.i,B.g&&(v.g=new Map(B.g),v.h=B.h),v}function ns(B,v){return v=String(v),B.j&&(v=v.toLowerCase()),v}function Uc(B,v){v&&!B.j&&($a(B),B.i=null,B.g.forEach(function(D,z){const he=z.toLowerCase();z!=he&&(Lt(this,z),qn(this,he,D))},B)),B.j=v}function Xu(B,v){const D=new On;if(u.Image){const z=new Image;z.onload=x(oa,D,"TestLoadImage: loaded",!0,v,z),z.onerror=x(oa,D,"TestLoadImage: error",!1,v,z),z.onabort=x(oa,D,"TestLoadImage: abort",!1,v,z),z.ontimeout=x(oa,D,"TestLoadImage: timeout",!1,v,z),u.setTimeout(function(){z.ontimeout&&z.ontimeout()},1e4),z.src=B}else v(!1)}function Xr(B,v){const D=new On,z=new AbortController,he=setTimeout(()=>{z.abort(),oa(D,"TestPingServer: timeout",!1,v)},1e4);
vendor: 10,366 bytes, lines 1020-1023
1020fetch(B,{signal:z.signal}).then(_e=>{clearTimeout(he),_e.ok?oa(D,"TestPingServer: ok",!0,v):oa(D,"TestPingServer: server error",!1,v)}).catch(()=>{clearTimeout(he),oa(D,"TestPingServer: error",!1,v)})}function oa(B,v,D,z,he){try{he&&(he.onload=null,he.onerror=null,he.onabort=null,he.ontimeout=null),z(D)}catch{}}function Ep(){this.g=new Ve}function Es(B){this.i=B.Sb||null,this.h=B.ab||!1}b(Es,Rt),Es.prototype.g=function(){return new la(this.i,this.h)};function la(B,v){At.call(this),this.H=B,this.o=v,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}b(la,At),n=la.prototype,n.open=function(B,v){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.F=B,this.D=v,this.readyState=1,pi(this)},n.send=function(B){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 v={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};B&&(v.body=B),(this.H||u).fetch(new Request(this.D,v)).then(this.Pa.bind(this),this.ga.bind(this))},n.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,Li(this)),this.readyState=0},n.Pa=function(B){if(this.g&&(this.l=B,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=B.headers,this.readyState=2,pi(this)),this.g&&(this.readyState=3,pi(this),this.g)))if(this.responseType==="arraybuffer")B.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(typeof u.ReadableStream<"u"&&"body"in B){if(this.j=B.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;Gc(this)}else B.text().then(this.Oa.bind(this),this.ga.bind(this))};function Gc(B){B.j.read().then(B.Ma.bind(B)).catch(B.ga.bind(B))}n.Ma=function(B){if(this.g){if(this.o&&B.value)this.response.push(B.value);else if(!this.o){var v=B.value?B.value:new Uint8Array(0);(v=this.B.decode(v,{stream:!B.done}))&&(this.response=this.responseText+=v)}B.done?Li(this):pi(this),this.readyState==3&&Gc(this)}},n.Oa=function(B){this.g&&(this.response=this.responseText=B,Li(this))},n.Na=function(B){this.g&&(this.response=B,Li(this))},n.ga=function(){this.g&&Li(this)};function Li(B){B.readyState=4,B.l=null,B.j=null,B.B=null,pi(B)}n.setRequestHeader=function(B,v){this.A.append(B,v)},n.getResponseHeader=function(B){return this.h&&this.h.get(B.toLowerCase())||""},n.getAllResponseHeaders=function(){if(!this.h)return"";const B=[],v=this.h.entries();for(var D=v.next();!D.done;)D=D.value,B.push(D[0]+": "+D[1]),D=v.next();return B.join(`\r 1021`)};function pi(B){B.onreadystatechange&&B.onreadystatechange.call(B)}Object.defineProperty(la.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(B){this.m=B?"include":"same-origin"}});function Tl(B){let v="";return Ue(B,function(D,z){v+=z,v+=":",v+=D,v+=`\r 1022`}),v}function Sl(B,v,D){e:{for(z in D){var z=!1;break e}z=!0}z||(D=Tl(D),typeof B=="string"?D!=null&&Ot(D):Jt(B,v,D))}function _n(B){At.call(this),this.headers=new Map,this.L=B||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}b(_n,At);var zo=/^https?$/i,Wu=["POST","PUT"];n=_n.prototype,n.Fa=function(B){this.H=B},n.ea=function(B,v,D,z){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+B);v=v?v.toUpperCase():"GET",this.D=B,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():He.g(),this.g.onreadystatechange=C(p(this.Ca,this));try{this.B=!0,this.g.open(v,String(B),!0),this.B=!1}catch(_e){Ja(this,_e);return}if(B=D||"",D=new Map(this.headers),z)if(Object.getPrototypeOf(z)===Object.prototype)for(var he in z)D.set(he,z[he]);else if(typeof z.keys=="function"&&typeof z.get=="function")for(const _e of z.keys())D.set(_e,z.get(_e));else throw Error("Unknown input type for opt_headers: "+String(z));z=Array.from(D.keys()).find(_e=>_e.toLowerCase()=="content-type"),he=u.FormData&&B instanceof u.FormData,!(Array.prototype.indexOf.call(Wu,v,void 0)>=0)||z||he||D.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[_e,Ye]of D)this.g.setRequestHeader(_e,Ye);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(B),this.v=!1}catch(_e){Ja(this,_e)}};function Ja(B,v){B.h=!1,B.g&&(B.j=!0,B.g.abort(),B.j=!1),B.l=v,B.o=5,Fo(B),Ka(B)}function Fo(B){B.A||(B.A=!0,Tt(B,"complete"),Tt(B,"error"))}n.abort=function(B){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=B||7,Tt(this,"complete"),Tt(this,"abort"),Ka(this))},n.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Ka(this,!0)),_n.Z.N.call(this)},n.Ca=function(){this.u||(this.B||this.v||this.j?Hc(this):this.Xa())},n.Xa=function(){Hc(this)};function Hc(B){if(B.h&&typeof l<"u"){if(B.v&&fn(B)==4)setTimeout(B.Ca.bind(B),0);else if(Tt(B,"readystatechange"),fn(B)==4){B.h=!1;try{const _e=B.ca();e:switch(_e){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var v=!0;break e;default:v=!1}var D;if(!(D=v)){var z;if(z=_e===0){let Ye=String(B.D).match(ws)[1]||null;!Ye&&u.self&&u.self.location&&(Ye=u.self.location.protocol.slice(0,-1)),z=!zo.test(Ye?Ye.toLowerCase():"")}D=z}if(D)Tt(B,"complete"),Tt(B,"success");else{B.o=6;try{var he=fn(B)>2?B.g.statusText:""}catch{he=""}B.l=he+" ["+B.ca()+"]",Fo(B)}}finally{Ka(B)}}}}function Ka(B,v){if(B.g){B.m&&(clearTimeout(B.m),B.m=null);const D=B.g;B.g=null,v||Tt(B,"ready");try{D.onreadystatechange=null}catch{}}}n.isActive=function(){return!!this.g};function fn(B){return B.g?B.g.readyState:0}n.ca=function(){try{return fn(this)>2?this.g.status:-1}catch{return-1}},n.la=function(){try{return this.g?this.g.responseText:""}catch{return""}},n.La=function(B){if(this.g){var v=this.g.responseText;return B&&v.indexOf(B)==0&&(v=v.substring(B.length)),nn(v)}};function zr(B){try{if(!B.g)return null;if("response"in B.g)return B.g.response;switch(B.F){case"":case"text":return B.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in B.g)return B.g.mozResponseArrayBuffer}return null}catch{return null}}function qc(B){const v={};B=(B.g&&fn(B)>=2&&B.g.getAllResponseHeaders()||"").split(`\r 1023`);for(let z=0;z<B.length;z++){if(S(B[z]))continue;var D=Un(B[z]);const he=D[0];if(D=D[1],typeof D!="string")continue;D=D.trim();const _e=v[he]||[];v[he]=_e,_e.push(D)}we(v,function(z){return z.join(", ")})}n.ya=function(){return this.o},n.Ha=function(){return typeof this.l=="string"?this.l:String(this.l)};function Mi(B,v,D){return D&&D.internalChannelParams&&D.internalChannelParams[B]||v}function ca(B){this.za=0,this.i=[],this.j=new On,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=Mi("failFast",!1,B),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=Mi("baseRetryDelayMs",5e3,B),this.Za=Mi("retryDelaySeedMs",1e4,B),this.Ta=Mi("forwardChannelMaxRetries",2,B),this.va=Mi("forwardChannelRequestTimeoutMs",2e4,B),this.ma=B&&B.xmlHttpFactory||void 0,this.Ua=B&&B.Rb||void 0,this.Aa=B&&B.useFetchStreams||!1,this.O=void 0,this.L=B&&B.supportsCrossDomainXhr||!1,this.M="",this.h=new Oi(B&&B.concurrentRequestLimit),this.Ba=new Ep,this.S=B&&B.fastHandshake||!1,this.R=B&&B.encodeInitMessageHeaders||!1,this.S&&this.R&&(this.R=!1),this.Ra=B&&B.Pb||!1,B&&B.ua&&this.j.ua(),B&&B.forceLongPolling&&(this.X=!1),this.aa=!this.S&&this.X&&B&&B.detectBufferingProxy||!1,this.ia=void 0,B&&B.longPollingTimeout&&B.longPollingTimeout>0&&(this.ia=B.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}n=ca.prototype,n.ka=8,n.I=1,n.connect=function(B,v,D,z){wt(0),this.W=B,this.H=v||{},D&&z!==void 0&&(this.H.OSID=D,this.H.OAID=z),this.F=this.X,this.J=Uo(this,null,this.W),Ns(this)};function Pi(B){if($c(B),B.I==3){var v=B.V++,D=ye(B.J);if(Jt(D,"SID",B.M),Jt(D,"RID",v),Jt(D,"TYPE","terminate"),Qa(B,D),v=new ln(B,B.j,v),v.M=2,v.A=bs(ye(D)),D=!1,u.navigator&&u.navigator.sendBeacon)try{D=u.navigator.sendBeacon(v.A.toString(),"")}catch{}!D&&u.Image&&(new Image().src=v.A,D=!0),D||(v.g=Za(v.j,null),v.g.ea(v.A)),v.F=Date.now(),fs(v)}Bi(B)}function jl(B){B.g&&(Ht(B),B.g.cancel(),B.g=null)}function $c(B){jl(B),B.v&&(u.clearTimeout(B.v),B.v=null),da(B),B.h.cancel(),B.m&&(typeof B.m=="number"&&u.clearTimeout(B.m),B.m=null)}function Ns(B){if(!cr(B.h)&&!B.m){B.m=!0;var v=B.Ea;Q||E(),Y||(Q(),Y=!0),k.add(v,B),B.D=0}}function zi(B,v){return Xn(B.h)>=B.h.j-(B.m?1:0)?!1:B.m?(B.i=v.G.concat(B.i),!0):B.I==1||B.I==2||B.D>=(B.Sa?0:B.Ta)?!1:(B.m=jn(p(B.Ea,B,v),Zr(B,B.D)),B.D++,!0)}n.Ea=function(B){if(this.m)if(this.m=null,this.I==1){if(!B){this.V=Math.floor(Math.random()*1e5),B=this.V++;const he=new ln(this,this.j,B);let _e=this.o;if(this.U&&(_e?(_e=$e(_e),Ae(_e,this.U)):_e=this.U),this.u!==null||this.R||(he.J=_e,_e=null),this.S)e:{for(var v=0,D=0;D<this.i.length;D++){t:{var z=this.i[D];if("__data__"in z.map&&(z=z.map.__data__,typeof z=="string")){z=z.length;break t}z=void 0}if(z===void 0)break;if(v+=z,v>4096){v=D;break e}if(v===4096||D===this.i.length-1){v=D+1;break e}}v=1e3}else v=1e3;v=Ya(this,he,v),D=ye(this.J),Jt(D,"RID",B),Jt(D,"CVER",22),this.G&&Jt(D,"X-HTTP-Session-Id",this.G),Qa(this,D),_e&&(this.R?v="headers="+Ot(Tl(_e))+"&"+v:this.u&&Sl(D,this.u,_e)),Br(this.h,he),this.Ra&&Jt(D,"TYPE","init"),this.S?(Jt(D,"$req",v),Jt(D,"SID","null"),he.U=!0,ve(he,D,null)):ve(he,D,v),this.I=2}}else this.I==3&&(B?Wr(this,B):this.i.length==0||cr(this.h)||Wr(this))};function Wr(B,v){var D;v?D=v.l:D=B.V++;const z=ye(B.J);Jt(z,"SID",B.M),Jt(z,"RID",D),Jt(z,"AID",B.K),Qa(B,z),B.u&&B.o&&Sl(z,B.u,B.o),D=new ln(B,B.j,D,B.D+1),B.u===null&&(D.J=B.o),v&&(B.i=v.G.concat(B.i)),v=Ya(B,D,1e3),D.H=Math.round(B.va*.5)+Math.round(B.va*.5*Math.random()),Br(B.h,D),ve(D,z,v)}
vendor: 4,580 bytes, line 1023
1023function Qa(B,v){B.H&&Ue(B.H,function(D,z){Jt(v,z,D)}),B.l&&Ue({},function(D,z){Jt(v,z,D)})}function Ya(B,v,D){D=Math.min(B.i.length,D);const z=B.l?p(B.l.Ka,B.l,B):null;e:{var he=B.i;let qt=-1;for(;;){const Ds=["count="+D];qt==-1?D>0?(qt=he[0].g,Ds.push("ofs="+qt)):qt=0:Ds.push("ofs="+qt);let bn=!0;for(let Cs=0;Cs<D;Cs++){var _e=he[Cs].g;const Tr=he[Cs].map;if(_e-=qt,_e<0)qt=Math.max(0,he[Cs].g-100),bn=!1;else try{_e="req"+_e+"_"||"";try{var Ye=Tr instanceof Map?Tr:Object.entries(Tr);for(const[ha,Fr]of Ye){let ei=Fr;h(Fr)&&(ei=In(Fr)),Ds.push(_e+ha+"="+encodeURIComponent(ei))}}catch(ha){throw Ds.push(_e+"type="+encodeURIComponent("_badmap")),ha}}catch{z&&z(Tr)}}if(bn){Ye=Ds.join("&");break e}}Ye=void 0}return B=B.i.splice(0,D),v.G=B,Ye}function ua(B){if(!B.g&&!B.v){B.Y=1;var v=B.Da;Q||E(),Y||(Q(),Y=!0),k.add(v,B),B.A=0}}function Vo(B){return B.g||B.v||B.A>=3?!1:(B.Y++,B.v=jn(p(B.Da,B),Zr(B,B.A)),B.A++,!0)}n.Da=function(){if(this.v=null,Xa(this),this.aa&&!(this.P||this.g==null||this.T<=0)){var B=4*this.T;this.j.info("BP detection timer enabled: "+B),this.B=jn(p(this.Wa,this),B)}},n.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,wt(10),jl(this),Xa(this))};function Ht(B){B.B!=null&&(u.clearTimeout(B.B),B.B=null)}function Xa(B){B.g=new ln(B,B.j,"rpc",B.Y),B.u===null&&(B.g.J=B.o),B.g.P=0;var v=ye(B.na);Jt(v,"RID","rpc"),Jt(v,"SID",B.M),Jt(v,"AID",B.K),Jt(v,"CI",B.F?"0":"1"),!B.F&&B.ia&&Jt(v,"TO",B.ia),Jt(v,"TYPE","xmlhttp"),Qa(B,v),B.u&&B.o&&Sl(v,B.u,B.o),B.O&&(B.g.H=B.O);var D=B.g;B=B.ba,D.M=1,D.A=bs(ye(v)),D.u=null,D.R=!0,Gt(D,B)}n.Va=function(){this.C!=null&&(this.C=null,jl(this),Vo(this),wt(19))};function da(B){B.C!=null&&(u.clearTimeout(B.C),B.C=null)}function Wa(B,v){var D=null;if(B.g==v){da(B),Ht(B),B.g=null;var z=2}else if(_s(B.h,v))D=v.G,Os(B.h,v),z=1;else return;if(B.I!=0){if(v.o)if(z==1){D=v.u?v.u.length:0,v=Date.now()-v.F;var he=B.D;z=at(),Tt(z,new rn(z,D)),Ns(B)}else ua(B);else if(he=v.m,he==3||he==0&&v.X>0||!(z==1&&zi(B,v)||z==2&&Vo(B)))switch(D&&D.length>0&&(v=B.h,v.i=v.i.concat(D)),he){case 1:ms(B,5);break;case 4:ms(B,10);break;case 3:ms(B,6);break;default:ms(B,2)}}}function Zr(B,v){let D=B.Qa+Math.floor(Math.random()*B.Za);return B.isActive()||(D*=2),D*v}function ms(B,v){if(B.j.info("Error code "+v),v==2){var D=p(B.bb,B),z=B.Ua;const he=!z;z=new Ce(z||"//www.google.com/images/cleardot.gif"),u.location&&u.location.protocol=="http"||dt(z,"https"),bs(z),he?Xu(z.toString(),D):Xr(z.toString(),D)}else wt(2);B.I=0,B.l&&B.l.pa(v),Bi(B),$c(B)}n.bb=function(B){B?(this.j.info("Successfully pinged google.com"),wt(2)):(this.j.info("Failed to ping google.com"),wt(1))};function Bi(B){if(B.I=0,B.ja=[],B.l){const v=Ha(B.h);(v.length!=0||B.i.length!=0)&&(T(B.ja,v),T(B.ja,B.i),B.h.i.length=0,N(B.i),B.i.length=0),B.l.oa()}}function Uo(B,v,D){var z=D instanceof Ce?ye(D):new Ce(D);if(z.g!="")v&&(z.g=v+"."+z.g),ut(z,z.u);else{var he=u.location;z=he.protocol,v=v?v+"."+he.hostname:he.hostname,he=+he.port;const _e=new Ce(null);z&&dt(_e,z),v&&(_e.g=v),he&&ut(_e,he),D&&(_e.h=D),z=_e}return D=B.G,v=B.wa,D&&v&&Jt(z,D,v),Jt(z,"VER",B.ka),Qa(B,z),z}function Za(B,v,D){if(v&&!B.L)throw Error("Can't create secondary domain capable XhrIo object.");return v=B.Aa&&!B.ma?new _n(new Es({ab:D})):new _n(B.ma),v.Fa(B.L),v}n.isActive=function(){return!!this.l&&this.l.isActive(this)};function Al(){}n=Al.prototype,n.ra=function(){},n.qa=function(){},n.pa=function(){},n.oa=function(){},n.isActive=function(){return!0},n.Ka=function(){};function eo(){}eo.prototype.g=function(B,v){return new Qs(B,v)};function Qs(B,v){At.call(this),this.g=new ca(v),this.l=B,this.h=v&&v.messageUrlParams||null,B=v&&v.messageHeaders||null,v&&v.clientProtocolHeaderRequired&&(B?B["X-Client-Protocol"]="webchannel":B={"X-Client-Protocol":"webchannel"}),this.g.o=B,B=v&&v.initMessageHeaders||null,v&&v.messageContentType&&(B?B["X-WebChannel-Content-Type"]=v.messageContentType:B={"X-WebChannel-Content-Type":v.messageContentType}),v&&v.sa&&(B?B["X-WebChannel-Client-Profile"]=v.sa:B={"X-WebChannel-Client-Profile":v.sa}),this.g.U=B,(B=v&&v.Qb)&&!S(B)&&(this.g.u=B),this.A=v&&v.supportsCrossDomainXhr||!1,this.v=v&&v.sendRawJson||!1,(v=v&&v.httpSessionIdParam)&&!S(v)&&(this.g.G=v,B=this.h,B!==null&&v in B&&(B=this.h,v in B&&delete B[v])),this.j=new Aa(this)}b(Qs,At),Qs.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},Qs.prototype.close=function(){Pi(this.g)},Qs.prototype.o=function(B){var v=this.g;
1023if(typeof B=="string"){var D={};D.__data__=B,B=D}else this.v&&(D={},D.__data__=In(B),B=D);v.i.push(new ia(v.Ya++,B)),v.I==3&&Ns(v)},Qs.prototype.N=function(){this.g.l=null,delete this.j,Pi(this.g),delete this.g,Qs.Z.N.call(this)};function to(B){_t.call(this),B.__headers__&&(this.headers=B.__headers__,this.statusCode=B.__status__,delete B.__headers__,delete B.__status__);var v=B.__sm__;if(v){e:{for(const D in v){B=D;break e}B=void 0}(this.i=B)&&(B=this.i,v=v!==null&&B in v?v[B]:void 0),this.data=v}else this.data=B}b(to,_t);function Go(){Sn.call(this),this.status=1}b(Go,Sn);function Aa(B){this.g=B}b(Aa,Al),Aa.prototype.ra=function(){Tt(this.g,"a")},Aa.prototype.qa=function(B){Tt(this.g,new to(B))},Aa.prototype.pa=function(B){Tt(this.g,new Go)},Aa.prototype.oa=function(){Tt(this.g,"b")},eo.prototype.createWebChannel=eo.prototype.g,Qs.prototype.send=Qs.prototype.o,Qs.prototype.open=Qs.prototype.m,Qs.prototype.close=Qs.prototype.close,sT=function(){return new eo},nT=function(){return at()},tT=Qt,My={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},Ut.NO_ERROR=0,Ut.TIMEOUT=8,Ut.HTTP_ERROR=6,NB=Ut,xs.COMPLETE="complete",eT=xs,os.EventType=Hn,Hn.OPEN="a",Hn.CLOSE="b",Hn.ERROR="c",Hn.MESSAGE="d",At.prototype.listen=At.prototype.J,nm=os,_n.prototype.listenOnce=_n.prototype.K,_n.prototype.getLastError=_n.prototype.Ha,_n.prototype.getLastErrorCode=_n.prototype.ya,_n.prototype.getStatus=_n.prototype.ca,_n.prototype.getResponseJson=_n.prototype.La,_n.prototype.getResponseText=_n.prototype.la,_n.prototype.send=_n.prototype.ea,_n.prototype.setWithCredentials=_n.prototype.Fa,ZD=_n}).apply(typeof K0<"u"?K0:typeof self<"u"?self:typeof window<"u"?window:{});/*! 1024* re2js 1025* RE2JS is the JavaScript port of RE2, a regular expression engine that provides linear time matching 1026* 1027* @version v2.8.6 1028* @author Oleksii Vasyliev 1029* @homepage https://github.com/le0pard/re2js#readme 1030* @repository github:le0pard/re2js 1031* @license MIT
1032*/var rs,Fe=(rs=class{},ze(rs,"FOLD_CASE",1),ze(rs,"LITERAL",2),ze(rs,"CLASS_NL",4),ze(rs,"DOT_NL",8),ze(rs,"ONE_LINE",16),ze(rs,"NON_GREEDY",32),ze(rs,"PERL_X",64),ze(rs,"UNICODE_GROUPS",128),ze(rs,"WAS_DOLLAR",256),ze(rs,"LOOKBEHIND",512),ze(rs,"MATCH_NL",rs.CLASS_NL|rs.DOT_NL),ze(rs,"PERL",rs.CLASS_NL|rs.ONE_LINE|rs.PERL_X|rs.UNICODE_GROUPS),ze(rs,"POSIX",0),ze(rs,"UNANCHORED",0),ze(rs,"ANCHOR_START",1),ze(rs,"ANCHOR_BOTH",2),rs);const Fd={CASE_INSENSITIVE:1,DOTALL:2,MULTILINE:4,DISABLE_UNICODE_GROUPS:8,LONGEST_MATCH:16,LOOKBEHINDS:512},Im=128,Py=new Int32Array(Im),zy=new Int32Array(Im),Q0=65535;for(let n=0;n<Im;n++)n>=97&&n<=122?Py[n]=n-32:Py[n]=n,n>=65&&n<=90?zy[n]=n+32:zy[n]=n;var by,Ne=(by=class{static toUpperCase(n){if(n<Im)return Py[n];const e=String.fromCodePoint(n).toUpperCase(),t=e.codePointAt(0)>Q0?2:1;if(e.length>t)return n;const s=String.fromCodePoint(e.codePointAt(0)).toLowerCase(),o=s.codePointAt(0)>Q0?2:1;return s.length>o||s.codePointAt(0)!==n?n:e.codePointAt(0)}static toLowerCase(n){if(n<Im)return zy[n];const e=String.fromCodePoint(n).toLowerCase(),t=e.codePointAt(0)>Q0?2:1;if(e.length>t)return n;const s=String.fromCodePoint(e.codePointAt(0)).toUpperCase(),o=s.co
1032dePointAt(0)>Q0?2:1;return s.length>o||s.codePointAt(0)!==n?n:e.codePointAt(0)}},ze(by,"CODES",new Map([["\x07",7],["\b",8],[" ",9],[` 1033`,10],["\v",11],["\f",12],["\r",13],[" ",32],['"',34],["$",36],["&",38],["'",39],["(",40],[")",41],["*",42],["+",43],["-",45],[".",46],["0",48],["1",49],["2",50],["3",51],["4",52],["5",53],["6",54],["7",55],["8",56],["9",57],[":",58],["<",60],[">",62],["?",63],["A",65],["B",66],["C",67],["F",70],["P",80],["Q",81],["U",85],["Z",90],["[",91],["\\",92],["]",93],["^",94],["_",95],["`",96],["a",97],["b",98],["f",102],["i",105],["m",109],["n",110],["r",114],["s",115],["t",116],["v",118],["x",120],["z",122],["{",123],["|",124],["}",125]])),by),$=class{constructor(n,e=!1){this.data=n,this.isStride1=e,this.SIZE=e?2:3}getLo(n){return this.data[n*this.SIZE]}getHi(n){return this.data[n*this.SIZE+1]}getStride(n){return this.isStride1?1:this.data[n*this.SIZE+2]}get length(){return this.data.length/this.SIZE}};const rT=new Uint8Array(256);for(let n=0,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-";n<64;n++)rT[e.charCodeAt(n)]=n;const iT=n=>{const e=[];let t=0,s=0;for(let o=0;o<n.length;o++){let l=rT[n.charCodeAt(o)];t|=(l&31)<<s,(l&32)===0?(e.push(t),t=0,s=0):s+=5}return e},J=(n,e)=>{const t=iT(n),s=e?t.length/2:t.length/3,o=new Uint32Array(s*3);let l=0,u=0;for(let h=0;h<s;h++)l+=t[u++],o[h*3]=l,l+=t[u++],o[h*3+1]=l,o[h*3+2]=e?1:t[u++];return o},sM=n=>{const e=iT(n),t=new Map;let s=0;for(let o=0;o<e.length;o+=2){s+=e[o];const l=e[o+1],u=l>>>1^-(l&1);t.set(s,s+u)}return t};var Y0=class{constructor(n){this.initializer=n,this.cache=new Map}has(n){return n in this.initializer}get(n){if(this.cache.has(n))return this.cache.get(n);const e=this.initializer[n],t=e?e():null;return this.cache.set(n,t),t}},cc,Ei=(cc=class{static get CASE_ORBIT(){return this._CASE_ORBIT||(this._CASE_ORBIT=sM("rCgCIgCY+rQI4QiCuuBLgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCCgCBgCBgCBgCBgCBgCBgCB+7OB-BB-BB-BB-BB-BBskQB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BC-BB-BB-BB-BB-BB-BB-BByHBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBDCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBxHBCBBBCBBBCBBB3SBmMBkNBCBBBCBBB8MBCBBB6MB6MBCBBC+EB0MB2MBCBBB6MB+MBiGBmNBiNBCBBBmKBikzCBmNBqNBkIBsNBCBBBCBBBCBBB0NBCBBB0NDCBBB0NBCBBByNByNBCBBBCBBB2NBCBBDCBBCwDFCBCBDBCBCBDBCBCBDBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBB9EBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBCBDBCBBBhGBvDBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBjICCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBH2iVBCBBBlKBwiVB+jVB+jVBCBBBlMBqEBuEBCBBBCBBBCBBBCBBBCBBB+hVB4hVB8hVBjNB7MC5MB5MCzMC1MB+0yCE5MB20yCC9MBu2yCBwyyCBo0yCChNBlNBo0yCBu-UBi0yCDlNC6-UBpNDrNIu+UDzNCm0yCBzNE0yyCBzNBpEBxNBxNBtEG1NLqxyCBkxyCnFoFrBCBBBCBBDCBBEkIBkIBkICoHHsCCqCBqCBqCCgEC+DB+DBmkOBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCC+BBgCBgCBgCBgCBgCBgCBgCBgCBrCBpCBpCBpCBmjOB-BB8BB-BB-BBgEB-BB-BByBBqgOBsDB-BBtwBB-BB-BB-BBsBBgDBCB-BB-BB-BBeB-BB-BB61OB-BB-BB-DB9DB9DBQB7DBmCE9CBrDBPBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBrFB-EBOBnHB3FB-FCCBBBNBCBBCjIBjIBjIBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCB-BB-BB8kMB-BB6kMB-BB-BB-BB-BB-BB-BB-BB-BB-BBokMB-BB-BBkkMBkkMB-BB-BB-BB-BB-BB-BB-BB4jMB-BB-BB-BB-BB-BB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EBCBBBCBoiMBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBJCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBeBCBBBCBBBCBBBCBBBCBBBCBBBCBBBdBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDL-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-C64CgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOCgmOGgmODg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FDg8FBg8FBg8FhVg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBQBQBQBQBQBQDPBPBPBPBPBPjkC7mMB5mMBnmMBjmMBCBlmMB3lMBpiMBk8kCBCBBG-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FD-7FB-7FB-7F6FoglCEsuHRwjlCyDCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCB0DBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBG1DD97OCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQDPBPBPBPBPBPDQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQDPBPBPBPBPBPEQCQCQCQCPCPCPCPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPB0EB0EBsFBsFBsFBsFBoGBoGBgIBgIBgHBgHB8HB8HDQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQCSFPBPBzEBzEBRCxnOFSFrFBrFBrFBrFBREQBQClkOFPBPBnGBnGFQBQCljOCODPBPB-GB-GBNHSF-HB-HB7HB7HBRqJ53OE9tQBrmQH4Bc3BSgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBfBfBfBfBfBfBfBfBfBfBfBfBfBfBfBfECBByZ0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzB34BgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CBCBBBt-UBruHBt+UB1iVBviVBCBBBCBBBCBBB3hVB5-UB9hVB7hVCCBBCCBBI9jVB9jVBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBICBBBCBBECBBN-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOC-lOG-lOzoeCBBBCBBBCBBBCBBBCBBBCBl8kCBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBTC
1033BBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBnECBBBCBBBCBBBCBBBCBBBCBBBCBBDCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBKCBBBCBBBnglCBCBBBCBBBCBBBCBBBCBBECBBBvyyCDCBBBCBBBgDCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBn0yCB90yCB10yCBh0yCBn0yCCjxyCBzyyCBpxyCBg6BBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBB-CBl0yCBvjlCBCBBBCBBBt2yCBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBhkzCZCBB9a-5Bd-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCm6TCBB7gBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCH-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BmlBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvChDwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCFvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvC1DuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCCuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCCuCBuCBuCBuCBuCBuCBuCCuCBuCCtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCCtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCCtCBtCBtCBtCBtCBtCBtCCtCBtCk2BgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEO-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-D+CgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCL-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-B74CgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BhrVgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BhB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BD1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BtxekCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjC")),this._CASE_ORBIT}static get Print(){return this._Print||(this._Print=new $(J("hB9CBjBLBCpWBDFBFGBCCCBSBCsMBClBBDxBBDCBC2BBJaBFFBSVBC-FBCvBBD6BBDkDBP6BBDwBBDOBCbBDCCBJBGfBIqCBCgFBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYBDCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPBLCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGBCCBCHBDBBDVBCGBCBBCEBDIBDBBDCBICBFBBCEBDRBLBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBGMBCCBCWBCPBDIBCCBCDBIBBCCBCBBDDBDJBIVBCCBCWBCJBCEBDIBCCBCDBIBBGCBCDBDJBCCBNMBCCBCyBBCCBCFBFPBDZBCCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBN5BBFcBmBBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDBhBnCBCjBBFmBBCjBBCOBCMBmBlGBCGGD4LBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBH1CBDFBD-TBCbBE4CBIVBKXBKTBNMBCCBCBBN9CBDJBHJBHNBCKBH4CBIqBBGlCBLeBCLBFLBFEEBoBBDEBMrBBFZBHKBE9BBDgCBCcBDKBHJBHNBDtBBDLBVsCBClFBJ7BBEOBE9BBGqBBDKBJqBBG1QBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBSXBJuBBSBBDaBCMBEhBBPgBBQrEBF5UBXKBWz4BBD9LBGsBBCGGD3BBIBBPXBKGBCGBCGBCGBCGBCGBCGBCGBC9DBjBZBC4CBN1GBbPBC+BBC1CBDmDBGqBBC9CBC1CBKvBBCszcBE2BBK7KBV3FBJ8GBV7BBEJBH3BBJlCBJLBHzDBMdBEtCBCKBFgBBC2BBKNBDJBDmDBZbBLFBDFBDFBKGBCGBC7BBF9DBDJBHj9KBNWBFwBBloItLBDpDBnBGBNEBGZBCEBCCCBCCBCCBoUBhBpBBHyBBCSBCDBFEBCmEBF9FBEFBDFBDFBDCBEGBCGBOBBDLBCZBCSBCBBCOBDNBjB6DBGCBFsBBE3CBCMBEwBwBBsBBjEcBEwBBQbBFjBBKdBGqBBGdBCkBBFNBrB9EBDJBHjB
1033BFjBBFnBBJzBBMLBCOBCGBCBBCKBCOBCGBCBBEzBBN2JBKVBLHBZFBCpBBCIBmCFBDCCBqBBCBBEDDBVBCnCBJIBxBSBCBBGgBBEaBGaBnB3BBFTBDxBBCBBGHBCCBCcBDCBFJBIIBI-BBhBmBBFLBK1BBEcBDaBGZBIDBNGBxCoCB4ByBBOyBBItBBJJBHlBBEcBJBBxGeBCpBBCCBDBBRFBJIBiBtBBJpBBXZBnBbBVWBKtCBFjBBK9BBCEBOYBIJBH0BBCRBJmBBK-CBCTBMRBCuBB-BGBCCCBCBCOBCKBH6BBGJBHDBCHBDBBDVBCGBCBBCEBCJBDBBDCBDHHGGBDGBEEBMJBCDDClBBCJBCDDCDBCJBCBBJBBe7CBCEBfnCBJJBnF1BBDlBBjBkCBMJBHMBU5BBHJBHTBdaBDOBFWB6F7BBlDyCBNHBDDDBGBCBBCdBCBBDLBKJBnCHBDtBBDKBcnCBJyCBOoCBIJB3CHB5ChBBPJBHIBCsBBCNBLcBEfBDVBCNBqCGBCBBCrBBECCBCCBHBJJBHFBCBBCkBBCBBCFBIJBHrBBFJB3HYBIQBCoBBEcB2CQQBwBBO6cBnDuDBCEBMjGBtyCiDBOvhBBRVBL68DBGmSB61G5BBn2B4RBIeBCJBFwCBCJBHdBDFBLlCBLJBCGBCUBGSBxN5BBnG6CBGYBDYBtBqCBF4BBIQBhCEBMGBK1mHBqBfBiDyDB+vIDBCGBCBBCiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBDDBh7D8HBEzNBHWBQQBQtBBDWBKzDB9B1HBLmBBDpCBJvDBWlCB7DTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBD9VBQEBCOBxiBeBHFB2GGBCQBDGBCBBCEBG9BBiBxDxDBrBBENBDJBFBBhKeBS5BBGxOxOBoBB3GqBBFhGhGBdBCVBJBBhHGBCDBCBBCOBCkGBDPBqBrCBFJBFBByYjCBtC8BBjGDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBBvIrBBFjDBNOBDOBCOBCkBBLtFB5BcBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBmgB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIBnkzVvHB",!1))),this._Print}static get Upper(){return this.CATEGORIES.get("Lu")}},ze(cc,"_CASE_ORBIT",null),ze(cc,"_Print",null),ze(cc,"CATEGORIES",new Y0({C:()=>new $(J("AfBgDgBBOrWrWBHHBCBICCVuMuMnBBBzBBBE4B4BBGBcDBHQBXhGhGxBBB8BBBmDNB8BBByBBBQddBCCMEBhBGBsCiFiFJBBDBBXIICCBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBFBSJBEKKEXXIDDGBBLIEBCCBNBFBBNGBIEEJBBDBBXIIDGGBKKBDDBEEBFBEDBDGGBTTBIBDHHBBBEFFBBBDCCDCBDCBECBNDBGCBEFFBCCBEBCNBWEBOEEYRRBKKEFFBFBDEEDBBFBBLGBXEEYLLGBBKEEFGBDEBEFFBLLELBOEE0BEEHDBRBBbEETCBZKKCBBICBCDBHCCJFBLBBELB7BDBekBBDCCGZZCYYBGGCIILBBFfBpClBlBBCBoBlBlBQOOBjBBnGCCBDBCBB6LFFBIICFFBqBqBFBBiBFFBIICFFBQQ6BFFBkCkCBhBhBBBBbFB3CBBHBB+UCB6CGBXIBZIBVLBOEEDLB-CBBLFBLFBPMMBEB6CGBsBEBnCJBgBNNBCBNDBCCBrBBBGKBtBDBbFBMCB-BBBiCeeBMMBEBLFBPBBvBBBNTBuCnFnFBGB9BCBQCB-BEBsBBBMHBsBEB3QBBHBBnBBBHBBJGCgBBB2BQQPBBHUUBEEKMMBDBbEByBPBDBBcOOBBBjBNBiBOBtEDB7UVBMUB14BBB-LEBuBCCBDBCBB5BGBDNBZIBI4BI-DhBBb6C6CBKB3GZBxC3C3CBoDoDBDBsB-C-C3CIBxBuzcuzcBBB4BIB9KTB5FHB+GTB9BCBLFB5BHBnCHBNFB1DKBfCBvCMMBCBiB4B4BBHBPBBLBBoDXBdJBHBBHBBHIBIII9BDB-DBBLFBl9KLBYDByBjoIBvLBBrDlBBILBGEBbGGCGDrUfBrBFB0BUUFDBGoEoEBCB-FCBHBBHBBHBBECBIIIBLBDBBNbbUDDQBBPhBB8DEBEDBuBCB5COOBBBCuBBvBhEBeCByBOBdDBlBIBfEBsBEBfmBmBBCBPpBB-EBBLFBlBDBlBDBpBHB1BKBNQQIDDMQQIDDBBB1BLB4JIBXJBJXBHrBrBKkCBHBBCtBtBDCBCBBYpCpCBGBKvBBUDDBDBiBCBcEBclBB5BDBVBBzBDDBDBJEEeBBEDBLGBKGBhCfBoBDBNIB3BCBeBBcEBbGBFLBIvCBqC2BB0BMB0BGBvBHBLFBnBCBeHBDvGBgBrBrBEBBDPBHHBKgBBvBHBrBVBblBBdTBYIBvCDBlBIB-BGGBLBaGBLFB2BTTBGBoBIBhDVVBJBTwBwBB8BBICCFQQMFB8BEBLFBFJJBDDBXXIDDGLLBDDBEEBCCBEBCEBIBBICBGKBLCCBCCnBLLCBBCFFLDDBGBDcB9CGGBcBpCHBLlFB3BBBnBhBBmCKBLFBOSB7BFBLFBVbBcBBQDBY4FB9BjDB0CLBJBBCBBJDDfDDBNNBHBLlCBJBBvBBBMaBpCHB0CMBqCGBL1CBJ3CBjBNBLFBKuBuBPJBeCBhBBBXPPBnCBIDDtBCBCDDKHBLFBHDDmBDDHGBLFBtBDBL1HBaGBSqBqBBBBe0CBCOBzBMB8clDBwDGGBJBlGryCBkDMBxhBPBXJB88DEBoS41GB7Bl2BB6RGBgBLLBCByCLLBEBfBBHJBnCJBLIIWEBUvNB7BlGB8CEBaBBarBBsCDB6BGBS-BBGKBIIB3mHoBBhBgDB0D8vIBFIIDkJkJBNBCcBEBBCNBFHBtMjoCBsDEBOCBKGBLBBF-6DB+HCB1NFBYOBSOBvBBBYIB1D7BB3HJBoBBBrCHBxDUBnC5DBVLBVLB4CIBamEB2CoCoCDBBCBBDBBFNNCIIiCFFBJJIddFGGCCBI1K1KBlJlJB-V-VBNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBND
1033BLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIlkzVBxHvw-FB",!1)),Cc:()=>new $(J("AfgDgB",!0)),Cf:()=>new $(J("tFzqBzqBBEBXhGhGyBhMhMBxCxCs5D9-B9-BBDBbEByBEBCJBw03B6H6HBBBimEQQj7IPBhjiBDBwmFHBn0rYffB+CB",!1)),Cn:()=>new $(J("4bBBHDBICCVuMuMnBBBzBBBE4B4BBGBcDBHKBvI9B9BBmDmDBMB8BBByBBBQddBCCMEBjBEBuHJJBDDBXXICCBBBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBFBSJBEKKEXXIDDGBBLIEBCCBNBFBBNGBIEEJBBDBBXIIDGGBKKBDDBEEBFBEDBDGGBTTBIBDHHBBBEFFBBBDCCDCBDCBECBNDBGCBEFFBCCBEBCNBWEBOEEYRRBKKEFFBFBDEEDBBFBBLGBXEEYLLGBBKEEFGBDEBEFFBLLELBOEE0BEEHDBRBBbEETCBZKKCBBICBCDBHCCJFBLBBELB7BDBekBBDCCGZZCYYBGGCIILBBFfBpClBlBBCBoBlBlBQOOBjBBnGCCBDBCBB6LFFBIICFFBqBqBFBBiBFFBIICFFBQQ6BFFBkCkCBhBhBBBBbFB3CBBHBB+UCB6CGBXIBZIBVLBOEEDLB-CBBLFBLFBbFB6CGBsBEBnCJBgBNNBCBNDBCCBrBBBGKBtBDBbFBMCB-BBBiCeeBMMBEBLFBPBBvBBBNTBuCnFnFBGB9BCBQCB-BEBsBBBMHBsBEB3QBBHBBnBBBHBBJGCgBBB2BQQPBBHUUBEEKmDmDNBBcOOBBBjBNBiBOBtEDB7UVBMUB14BBB-LEBuBCCBDBCBB5BGBDNBZIBI4BI-DhBBb6C6CBKB3GZBxC3C3CBoDoDBDBsB-C-C3CIBxBuzcuzcBBB4BIB9KTB5FHB+GTB9BCBLFB5BHBnCHBNFB1DKBfCBvCMMBCBiB4B4BBHBPBBLBBoDXBdJBHBBHBBHIBIII9BDB-DBBLFBl9KLBYDByBDBvzIBBrDlBBILBGEBbGGCGDrUfBrBFB0BUUFDBGoEoEBCC-FCBHBBHBBHBBECBIIIBIBGBBNbbUDDQBBPhBB8DEBEDBuBCB5COOBBBCuBBvBhEBeCByBOBdDBlBIBfEBsBEBfmBmBBCBPpBB-EBBLFBlBDBlBDBpBHB1BKBNQQIDDMQQIDDBBB1BLB4JIBXJBJXBHrBrBKkCBHBBCtBtBDCBCBBYpCpCBGBKvBBUDDBDBiBCBcEBclBB5BDBVBBzBDDBDBJEEeBBEDBLGBKGBhCfBoBDBNIB3BCBeBBcEBbGBFLBIvCBqC2BB0BMB0BGBvBHBLFBnBCBeHBDvGBgBrBrBEBBDPBHHBKgBBvBHBrBVBblBBdTBYIBvCDBlBIBlCJBCBBaGBLFB2BTTBGBoBIBhDVVBJBTwBwBB8BBICCFQQMFB8BEBLFBFJJBDDBXXIDDGLLBDDBEEBCCBEBCEBIBBICBGKBLCCBCCnBLLCBBCFFLDDBGBDcB9CGGBcBpCHBLlFB3BBBnBhBBmCKBLFBOSB7BFBLFBVbBcBBQDBY4FB9BjDB0CLBJBBCBBJDDfDDBNNBHBLlCBJBBvBBBMaBpCHB0CMBqCGBL1CBJ3CBjBNBLFBKuBuBPJBeCBhBBBXPPBnCBIDDtBCBCDDKHBLFBHDDmBDDHGBLFBtBDBL1HBaGBSqBqBBBBe0CBCOBzBMB8clDBwDGGBJBlGryCBkDMB3iBJB88DEBoS41GB7Bl2BB6RGBgBLLBCByCLLBEBfBBHJBnCJBLIIWEBUvNB7BlGB8CEBaBBarBBsCDB6BGBS-BBGKBIIB3mHoBBhBgDB0D8vIBFIIDkJkJBNBCcBEBBCNBFHBtMjoCBsDEBOCBKGBLBBJ76DB+HCB1NFBYOBSOBvBBBYIB1D7BB3HJBoBBBjGUBnC5DBVLBVLB4CIBamEB2CoCoCDBBCBBDBBFNNCIIiCFFBJJIddFGGCCBI1K1KBlJlJB-V-VBNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBND
1033BLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-BB---BBB---BBB",!1)),Co:()=>new $(J("gg4B-nGh4hc9--BD9--B",!0)),Cs:()=>new $(J("gg2B--B",!0)),L:()=>new $(J("hCZBHZBwBLLFGGBVBCeBCpOBFLBPEBICCiEEBCBBDDBCHHCCBCCCBSBCyCBCqEBJlFBClBBDHHBnBBoCaBFDBuBqBBkBBBCiDBCQQBIIBLLBBBDRRCdBe4CBMZZBfBKBBFGGBUBFKKEYYBXBIKBGXBCGBRpBB7B1BBETTIJBQPBFHBDBBDVBCGBCEEBCBERROBBCCBPBBLJJBEBFBBDVBCGBCBBCBBCBBgBDBCUUBBBRIBCCBCVBCGBCBBCEBETTQBBYMMBGBDBBDVBCGBCBBCEBEffBCCBBBQSSCFBECBCDBEBBCCCBEEBEEBBBELBX1B1BBGBCCBCWBCPBEbbBBBCBBDBBfFFBGBCCBCWBCJBCEBEffBBBCBBQBBSIBCCBCoBBDRRGCBJCBZFBGRBEXBCIBCDDBFB7BvBBCBBNGB7BBBCCCBDBCXBCCCBIBCBBKDDBDBCWWBCBhBgCgCBGBCjBBcEB0DqBBVRRBEBFDBEEEBIIBBBFMBNSSBkBBCGGDqBBCsKBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBmBPBR1CBDFBErTBDQBCZBGqCBHHBIRBOSBPRBPMBCCBQzBBkBFFkC4CBIEBDhBBCGGBkCBLeByBdBDEBMrBBFZB3BWBK0BBzC+C+CBtBBSHB3BdBOBBLrBBbjBBqBCBLjBBDKBGqBBDCBqBDBCFBCBBEGGB+FBhC1IBDFBDlBBDFBDHBCGCBdBD0BBCGBCEEBBBCGBEDBDFBFMBGCBCGB1DOORMBmDFFDJBCEEBDBHGCBCBCKBDDBGEBF1B1BB8zC8zCBjHBHDBEBBNlBBCGGD3BBIRRBVBKGBCGBCGBCGBCGBCGBCGBCGBxC2O2OBrBrBBDBGBBF1CBHCBC5CBCDBGqBBC9CBSfBxBPBhQ-tGBhCs0VBkCtBBDsIBEPBLBBVuBBReBDlCByBIBDmDBDxCBVQBCCBCDBCWBezBBPxBB-BFBECCBMMBaBLWBacBIuBBdRRBDBCJBLEBCoBBYCBCHBVWBEEEBwBBCEEBDDBDBDCCZCBDKBICBNFBDFBDFBKGBCGBCqBBCNBHyDBej9KBNWBFwBBloItLBDpDBnBGBNEBGCCBIBCMBCEBCCCBCCBCCBqDBiBqLBT-BBD1BBpBLB1DEBCmEBlBZBHZBM4CBEFBDFBDFBDCBkBLBCZBCSBCBBCOBDNBjB6DBmMcBEwBBwBfBOTBCHBHlBBLdBDjBBFHBxB9EBTjBBFjBBFnBBJzBBNKBCOBCGBCBBCKBCOBCGBCBBEzBBN2JBKVBLHBZFBCpBBCIBmCFBDCCBqBBCBBEDDBVBLWBKeBiCSBCBBLVBLZBHZBnB3BBHBBhCQQBCBCCBCcBrBcBEcBkBHBCbBc1BBLVBLSBORBvDoCB4ByBBOyBBOjBBnBbBKWB7HpBBHBBRFB5BcBLJJBUBrBRBvBUBcWBN0BB6BBBDOOBrBBhBYBbjBBeDDJiBBENNBuBBPDBWCCkBRBCYBUBBgCGBCCCBCBCOBCJBIuBBnBHBDBBDVBCGBCBBCEBETTNEBfJBCDDClBBCaaCtBtBBzBBTDBVCBfvBBVBBC5F5FBtBBqBDBlBvBBV8B8BBpBBOoCoCBZBmBGB6FrBB1D-BBgBHBDDDBGBCBBCXBQCC-CHBDmBBRCCdLLBmBBIWWMtBBUTTBnCBoGgBBgBIBCkBBSyByBBcBxDGBCBBClBBWaaBEBCBBCfBPYYBqBBlISBQCCBLBChBB9DwCwCB4cBnHjGBtyCgDBQvhBBSFBa68DBGmSB61GdBj3B4RBIeBSuCBSdBTvBBRDBgBUBGSBxNsBB0G-BBhBYBDYBtBqCBGjCjCBLBhCBBCPPBNNB0mHBqBfBiDyDB+vIDBCGBCBBCiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBn7F0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDYBCYBCeBCYBCeBCYBCeBCYBCeBCYBCHB15BeBHFBmI9BBzEsBBLGBRiKiKBcBTrBBlPbBlHdBDwGwGBdBCCBCBBCGBDEBKBBhHGBCDBCBBCOBCkGB8BjCBI1lB1lBBCBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQBlqE-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),LC:()=>new $(J("hCZBHZB7BLLBVBCeBCiGBCDBFvGBDZBhGDBDBBECBCHHCCBCCCBSBCyCBCqEBJlFBClBBKoBB44ClBBCGGDqBBDCBhV1CBDFBjkCKBGqBBDCBhCrBBgCMBChBBmD1IBDFBDlBBDFBDHBCGCBdBD0BBCGBCEEBBBCGBEDBDFBFMBGCBCGBmIFFDJBCEEBDBHGCBCBCFBFDDBCBGEBF1B1BB8zC8zCB6DBDmDBHDBEBBNlBBCGGzoetBBTbBnEtCBCWBEDBCsCBZBBE2Z2ZBpBBGIBIvCBh6TGBNEBqgBZBHZBmlBvCBhDjBBFjBB1DKBCOBCGBCBBCKBCOBCGBCBBk2ByBBOyBB+CVBLVB74C-BBhrV-BBhBYBDYBtpZ0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDYBCYBCeBCYBCeBCYBCeBCYBCeBCYBCHB15BJBCTBHFB2uCjCB",!1)),Ll:()=>new $(J("hDZB7BqBqBBWBCHBC2BCBQCBuBCDECBBBDCCDEEBFFDEEBBBDDDCCCDCCBCCDEECDDBDDBBBHGDCOCBSCBDDCEEC4BCBFBDDDBCCFICBjCBDZBiGCCEEEBBBTccBhBBCBBECBCWCBDBCGDB0B0BBuBBCgBCK0BCDMCBgDCxBoBBo6CqBBDCB5XFBjkCIBC2D2DBqBBgCMBChBBnD0ECBHBCgDCBHBJFBLHBJHBJFBLHBJHBJNBDHBJHBJHBJEBCBBHEEBBBCBBJDBDBBJHBLCBCBBzIEEBEEcKFDBBJDBF2B2Bs1CvBBCEEBGCFCCBCCBEBGiDCBIICFFNlBBCGG0oesBCUaCoEMCBBBC+BCBGBCCCDICFCCDCCBBBCSCGGGCMCFCCDOCbEE2ZqBBGIBIvCBh6TGBNEBqhBZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBnqZZBbGBCRBbZBbDBCCCBFBCKBbZBbZBbZBbZBbZBbZBbZBbZBbbBdYBCFBbYBCFBbYBCFBbYBCFBbYBCFBC15B15BBIBCTBHFB4vChBB",!1)),Lm:()=>new $(J("wVRBFLBPEBICCmEGG-OnHnHlFBBuIBBFgBgBKEEhFoFoF1mBgEgE2R72B72BsDkTkTxOFBvF+BBOjBjBBjBByVOORMBg-CBByHgGgG2OsBsBBDBGiDiDB+C+CBBB34bjnBjnBBEBvIzDzDdBB6DIBxCYYpDDBEBB2OXXqEtDtDWBBoDDBKngVngVuBBBh-BFBCpBBCIB0sBhBhB2K04D04DnrTDB9PCBpBBBnRMBhCBBCPPB9-P9-PBCBCGBCBByhM9BBqGGBud0Q0QsSAB",!1)),Lo:()=>new $(J("qFQQhIFFBCBxGBB7ZaBFDBuBfBCJBkBBBCiDBCZZBLLBBBDRRCdBe4CBMZZBfBWVBrBYBIKBGXBCGBRoBB8B1BBETTIJBROBFHBDBBDVBCGBCEEBCBERROBBCCBPBBLJJBEBFBBDVBCGBCBBCBBCBBgBDBCUUBBBRIBCCBCVBCGBCBBCEBETTQBBYMMBGBDBBDVBCGBCBBCEBEffBCCBBBQSSCFBECBCDBEBBCCCBEEBEEBBBELBX1B1BBGBCCBCWBCPBEbbBBBCBBDBBfFFBGBCCBCWBCJBCEBEffBBBCBBQBBSIBCCBCoBBDRRGCBJCBZFBGRBEXBCIBCDDBFB7BvBBCBBNFB8BBBCCCBDBCXBCCCBIBCBBKDDBDBYDBhBgCgCBGBCjBBcEB0DqBBVRRBEBFDBEEEBIIBBBFMBNyDyDBnKBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBmBPByDrTBDQBCZBGqCBHHBIRBOSBPRBPMBCCBQzBBpBkCkCBhBBC0BBIEBDhBBCGGBkCBLeByBdBDEBMrBBFZB3BWBK0BBxFuBBSHB3BdBOBBLrBBbjBBqBCBLdByDDBCFBCBBE7hB7hBBCB4-C3BBZWBKGBCGBCGBCGBCGBCGBCGBCGBoR2B2BF1CBJCCB4CBFGGB
1033pBBC9CBSfBxBPBhQ-tGBhC0wUBC2jBBkCnBBJrIBFPBLBBjCyByBBkCBqFoDoDEGBCCBCDBCWBezBBPxBB-BFBECCBMMBaBLWBacBIuBBuBEBDIBLEBCoBBYCBCHBVPBCFBEEEBwBBCEEBDDBDBDCCZBBEKBIPPBEBDFBDFBKGBCGByEiBBej9KBNWBFwBBloItLBDpDBkCCCBIBCMBCEBCCCBCCBCCBqDBiBqLBT-BBD1BBpBLB1DEBCmEBqDJBCsBBDeBEFBDFBDFBDCBkBLBCZBCSBCBBCOBDNBjB6DBmMcBEwBBwBfBOTBCHBHlBBLdBDjBBFHBhEtCBjDnBBJzBB9CzBBN2JBKVBLHB5EFBDCCBqBBCBBEDDBVBLWBKeBiCSBCBBLVBLZBHZBnB3BBHBBhCQQBCBCCBCcBrBcBEcBkBHBCbBc1BBLVBLSBORBvDoCB4FjBBnBDBCxJxJBoBBHBBRCBCBB5BcBLJJBUBrBRBvBUBcWBN0BB6BBBDOOBrBBhBYBbjBBeDDJiBBENNBuBBPDBWCCkBRBCYBUBBgCGBCCCBCBCOBCJBIuBBnBHBDBBDVBCGBCBBCEBETTNEBfJBCDDClBBCaaCtBtBBzBBTDBVCBfvBBVBBC5F5FBtBBqBDBlBvBBV8B8BBpBBOoCoCBZBmBGB6FrBB0GHBDDDBGBCBBCXBQCC-CHBDmBBRCCdLLBmBBIWWMtBBUTTBnCBoGgBBgBIBCkBBSyByBBcBxDGBCBBClBBWaaBEBCBBCfBPYYBnBBCBBlISBQCCBLBChBB9DwCwCB4cBnHjGBtyCgDBQvhBBSFBa68DBGmSB61GdBj3B4RBIeBSuCBSdBTvBB0BUBGSB0NnBB2MqCBGwFwFB0mHBqBfBiDyDBuwIiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBxzI2P2PBrBBiBiKiKBcBTrBBlPaBmHdBDwGwGBdBCCBCBBCGBDEBKiHiHBFBCDBCBBCOBCkGB8pBDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQBlqE-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Lt:()=>new $(J("lOGDnB2sH2sHBGBJHBJHBNQQwBAB",!1)),Lu:()=>new $(J("hCZBmDWBCGBiB2BCDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIJDCMCDQCDDDCCBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBDDBBBEWCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBpCDBNDBNDBNEBMDBnIFFECBDCBDEEBDBHGCBCBDDBLBBG+B+B9zCvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBB",!1)),M:()=>new $(J("gYvDB0IGBoIsBBCCCBCCBCCpCKBxBUBRmDmDBFBDFBDBBCDBkBffBZB8CKB7BIBKZZBCBCIBCCBCEBsBCB8BIBrBXBCgBB3BCBCRBCGBLBBeCB5BCCBFBDBBDCBKLLBbbDCB5BCCBDBFBBDCBEffBEEMCB5BCCBGBCCBCCBVBBXFBCCB5BCCBFBDBBDCBICBLBBf8B8BBDBECBCDBKpBpBBDB4BCCBFBCCBCDBIBBMBBeCB5BCCBFBCCBCDBIBBMBBQNNBCB4BBBCGBCCBCDBKLLBeeBBBnCFFBEBCCCBGBTBB+BDDBFBNHBjDDDBHBMGBqCBBcECFBByBTBCBBGKBCjBBKlDlDBSBYDBFCBCCBDGBEDBOLBCLLBCBgWCBzdDBdCBeBBfBBhCfBKuBuBBBBC2D2DBjBjB3DLBFLB8GEB6BJBCcBDxBxBBsBBDLBVEBwBQBnB
1033IBNCBfMB5BNBxBTB5ECBCUBFHHDCBnG-BBxWgBB--CCBuEhDhDBeBrRFBqDBB1udDBCJBhBBBxCBBxIEEFYYBDBF0C0CBzBzBBQBbRBOnBnBBGBaMBtBDBwBNBlBkCkCBMBNJJBuBuBBBBzBCCBBBDBBGBBCqBqBBDBGBBtHHBCBBx5TiXiXBOBRPBuejHjH2EEBn0BCBCBBGDBpBCBFmFmFB+R+RBCBiCEB+JBBuCFBnCKByBDB7DCB2BOBqBDDBLLBCBuBKBI+B+BBBBlBNBRBBtBNNBBBxBNBJDBCBB9CLBHDD+ELBWDB4BBBCGBDBBDCBKLLBDDBFBEEBkCIBCDDCDBCEBCPPBzCzCBQBYyCyCBSBsHGBDIBcBBzCQBrDMBmDOBhIOB2HFBCBBDDBCCCBuEuEBFBDGBEddBIBpBGBCDBJKKBJBvBPBnGHBoGHBCHBzCVBCNB7DFBECCBCCBFBCjCjCBDBCBBCEB8KDBKBBCxBxBBFBEEBYmnFmnFHOBpmLRBhuCEB8BGB5gBCCB1BBIDByCMMBslTslTBizEizEBsBBDWB-QEBEFBJHBDGBfDB1ECB89B2BBFxBBJPPXEBCOBxqBGBCQBDGBCBBCEBlDhFhFBFB4L+B+BBCB9PDB-HBB0HDDIBBG7O7OBFBuDGB29lYvHB",!1)),Mc:()=>new $(J("joC4B4BDCBJDBCBBzBBB7BCBHBBDBBLsBsB7BCBjC7B7BBBBJCCB2B2BB7B7BCHHBDDBLLnDBBCBBECBCCBLqBqBBBB+BDB+BBB7BCCBDBDBBCBBKBBdPPB7B7BBBBGCBCCBLrBrBBsCsCBBBHHBTBBrKBBgCsFsFBFFHDDBaaBLLBBBDGBWBBDFBDLLBBB5zBffiEIIBGBCBB7KDBDCBFBBCFBhHBB7BCCKCCBJJBEByExBxBGCCBDBCBB+BffFBBD9B9BDCBCEEBxBxBBGBJBBsFWW35EBB0-dBBD5C5CBzBzBBOBvEBBwBxBxBBFFBDDBBBvDBBDBBZuBuBCuDuDDBBGuHuHBCCBCCBCC0gZCCgEuBuBBBBFBB0DZZB8B8BxBCBKBBO+C+CBBBEBBCrFrFBBBgBBB7BBBCDBDBBDCBKLLB1C1CBBBIDDCDBCBBCmDmDBBBJBBErDrDBBBHCCBCBDuHuHBBBHDBDyDyDBBBJBBCuDuDCBBHoDoDCBBFmImIBBBK4H4HBEBCBBFDDCvEvEBBBJDBF1C1CeBB-BqGqGECCoGPPrDIID2G2GBDBFBBC-K-KBNNxBBBJBBCpvQpvQBBBlxD2BBpDBB0rYBBHFB",!1)),Me:()=>new $(J("okBBB1xF-wB-wBBCBCCBsshBCB",!1)),Mn:()=>new $(J("gYvDB0IEBqIsBBCCCBCCBCCpCKBxBUBRmDmDBFBDFBDBBCDBkBffBZB8CKB7BIBKZZBCBCIBCCBCEBsBCB8BIBrBXBCfB4BCCFHBFEEBFBLBBe7B7BFDBJVVBbbDBB6BFFBFFBDDBBBEffBEEMBB6BFFBDBCBBFVVBXXBEBC7B7BDCCBCBJIIBMMBff+BNNzBEE4BCCBBBGCBCDBIBBMBBe7B7BDHHGBBVBBdBB6BBBFDBJVVBeepCIIBBBC7C7CDGBNHBjDDDBHBMGBqCBBcEC4BNBCEBCBBGKBCjBBKnDnDBCBCFBCBBDBBaBBFCBRDBODDBHHQgWgWBBBzdCBeBBfBBfBBhCBBCGBJDDBJBKuBuBBBBC2D2DBjBjB3DCBFBBKHHBBB8GBBD7B7BCGBCCCDHBHJBDxBxBBMBCeBDLBVDBxBCCBDBCGGpBIBNBBhBDBDBBCCB5BCCBEECCB7BHBDBB5ECBCMBCGBFHHEBBnG-BBxWMBFEEBKB--CCBuEhDhDBeBrRDBsDBB1udFFBIBhBBBxCBBxIEEFaaBGG4EBBbRBOnBnBBGBaKBvBCBxBDDBCBDBBoBkCkCBEBDBBDBBNJJwB0B0BCCBDBBGBBCrBrBBJJvHDDFx5Tx5TiXPBRPBuejHjH2EEBn0BCBCBBGDBpBCBFmFmFB+R+RBCBiCEB+JBBuCFBnCKByBDB8D3B3BBNBqBDDBLLBBByBDBDBBI+B+BBBBlBEBCHB-BNNB1B1BBHBLDBDgDgDBBBDCCBHHD+E+EEHBWBB6BBBEmBmBBFBEEBnCFBOECPBB2CHBDCBCYY1CFBCFFBCCBvHvHBCBHBBCBBcBB2CHBDCCBrDrDCDDBEBCmDmDCDDBCBCEBkIIBCBBhIBBCFFxEDBDBBFhBhBBIBpBFBDDBJKKBEBDCBvBMBCBBnGCCBBBCqGqGBFBCFBCzCzCBUBDGBCBBCBB7DFBECCBCCBFBCpCpCBEEC8K8KBMMB1B1BBDBGCCYmnFmnFHOBpmLLBECBhuCEB8BGB5gBgCgCBCByC5lT5lTBizEizEBsBBDWBhRCBSHBDGBfDB1ECB89B2BBFxBBJPPXEBCOBxqBGBCQBDGBCBBCEBlDhFhFBFB4L+B+BBCB9PDB-HBB0HDDIBBG7O7OBFBuDGB29lYvHB",!1)),N:()=>new $(J("wBJB5DBBGDDBBBitBJBnEJBnGJB9MJB3DJBFFBtDJB3DJB3DJBDFBvDMB0DJBJGBoDJBpDGBISBuDJBhDJB3DJBnCTBtIJBnCJBwWTBybCBwHJBHJBXJBtJJBhEKBmFJBHJB3FJB3CJBnEJBHJB3gBEEBEBHJBnGyBBDEB3W7BBvCVB3TdBqrBqYqYaIBPCB4KDBrEJBfHBCOBhBJBoBOBh7cJB9FJBhKFB7EJBnBJBnGJBXJB3CJB3MJB34UJBuPsBBN4BBSBB2KaBlBDBeJJnEEBrGJBvdHBaGBoBIBsCEBXFBhFBBDPBDtBBhCIB1BBBfCBsCEBpDHBZHBqBGBrKFBxBJBHJB3IeB-EJBrBDBxDGBnEdBhEJB9BJBxEJBITB8HJB3KJB3DJB3LJBnDJBHTBtCLBlNSB+CJB3UJB3CcBkHJBnCJB3BJBnLJBnDUBshBuDBimPJBnpCJB3CJBnEJBCGBvQJBnIWB+KCB6nXJBnuBTBNTBtDYB2iBxBBhqCJBnNJB3PJB4HJBtWIBhEJB4Y6BBCCBCDBtCsBBCOBjeMBk3CJB",!1)),Nd:()=>new $(J("wBJnxBJnEJnGJ9MJ3DJ3DJ3DJ3DJ3DJ3DJ3DJ3DJ3DJhDJ3DJnCJ3IJnCJn6BJnBJtJJhEJnFJHJ3FJ3CJnEJHJnuiBJnVJnBJnGJXJ3CJ3MJ34UJnsBJnkCJHJ9YJhEJ9BJxEJ3IJ3KJ3DJ3LJnDJHTtCJnNJnDJ3UJ3CJ3HJnCJ3BJnLJ3uQJnpCJ3CJnEJ3QJ37XJ12CxBhqCJnNJ3PJ4HJ2aJ30EJ",!0)),Nl:()=>new $(J("u3FCBwzCiBBDDB-zDaaBHBPCBs1dJBxyW0BBtOJJnEEBrhIuDBm8SCB",!1)),No:()=>new $(J("yFBBGDDBBB2pCFB5LFB5DCBmEGB6GGBSIByNJB2hBTB0jBJBhP20B20BEFBHJBnGPBqB3W3WB6BBvCVB3TdBqrB1kB1kBBCBrEJBfHBCOBhBJBoBOBxrdFBymWsBBiCDBSBB2KaBlBDB1pBHBaGBoBIBsCEBXFBhFBBDPBDtBBhCIB1BBBfCBsCEBpDHBZHBqBGBrKFBhLeB-EJBrBDBxDGBnETB8LTBmqBBBvNIBobSB0aUBn8SGB-YWBqhZTBNTBtDYBvqFIBid6BBCCBCDBtCsBBCOBjeMB",!1)),P:()=>new $(J("hBCBCFBCDBLBBEBBbCBCccCkBkBGEELBBEEE-VJJzOFBqBBB0BCCDDDtBBBVBBCBBOCCBBBrCDBnDsBsBBMBqHCB3BOBgBmImIBLLtE5D5D6DnMnMNwLwL7CLLBpFpFBNBCmBmBBCBoCrCrCBDBFBBwDFBsFlTlTBHB4EuTuTtBBBvCCBoCBB+ECBCCBmBKB6JBB5GBBhEGBCFBhFBBLGBdCB9DDB8BEB-BBBhCHBM9Z9ZBWBJTBCMBCLBfBBPBB6TDBeBB+hBNBwCBBgBJB0MVBgCDBhBBB8XDBCBBxDwEwEBtBBCfBDLBkNCBFJBDLBRNNjD7C7CjgdBBuICBkDLL0DFB9LDB3CBBpBCBCyByBBwBwBiDMBRBB9DDB-DBBRBB6HzqUzqUBxGxGBI
1033BXiBBCNBCFFCBB2ECBCFBCDBLBBEBBbCBCccCCCBFB7MCB9UxBxB-MoXoXoGgBgBxIIBnBxDxDBFBjCGB6CDByO-J-JjBlElEBDBtBDB+FGBuDBBCDB-DDBxBBBwCDBFOOCCB5CFBsDrJrJBCCBzDzDBDBLBBCpDpD7HWBqDCBdMBtCjEjEBBB9HpIpIBBB8E9C9CBGB0CCBCEB+CJB4GgDgDBDBrBBBmUBBrCMBwFxjBxjBBDB97CBB8zOBBmEiCiCBDBJpRpRBBBoJDBoK9lT9lTovHEB07C-a-aBAB",!1)),Pc:()=>new $(J("-Cg-Hg-HBUU-u3BBBZCBwHAB",!1)),Pd:()=>new $(J("tB9qB9qB0BiyDiyDmgBqgCqgCBEBiwDDDgBBBFdd-NUUwDxszBxszBBmBmBLqFqFhzD-J-J",!1)),Pe:()=>new $(J("pB0B0BgB+1D+1DC-6B-6BqtC4B4BQ7T7TCff-hBMCxChBhBCGC1MUChCCCiBmhBmhBCECtBGCtNICEGCDBB-ozB6G6GeOCESSCCCrF0B0BgBGD",!1)),Pf:()=>new $(J("7F+6H+6HEddpuDCCFDDQEE",!1)),Pi:()=>new $(J("rFt7Ht7HDBBDaapuDCCFDDQEE",!1)),Po:()=>new $(J("hBCBCCBDECBLLBEEBcclCGGPBBI-V-VJzOzOBEBqB3B3BDDDtBBBVBBCBBOCCBBBrCDBnDsBsBBMBqHCB3BOBgBmImIBLLtE5D5D6DnMnMNwLwL7CLLBpFpFBNBCxDxDrCEBFBBwDFBsFlTlTBHBmY9D9DBBBoCBB+ECBCCBmBFBCDB6JBB5GBBhEGBCFBhFBBLGBdCB9DDB8BEB-BBBhCHBMjajaBJJBGBJIBDDBDCBEKBCCCBIB7kDDBCBBxDwEwEBFFBBBDDDBHBCBBCDDBLLBDBCJBDDBCCCBLBDCBtNCB6B+F+FjgdBBuICBkDLL0DFB9LDB3CBBpBCBCyByBBwBwBiDMBRBB9DDB-DBBRBB6HlxUlxUBFBDXXVBBDDBECBCDBICBHCCB2E2EBBBCCBDECBLLBEEBcclBDDB7M7MBBB9UxBxB-MoXoXoGgBgBxIIBnBxDxDBFBjCGB6CDB0ZlElEBDBtBDB+FGBuDBBCDB-DDBxBBBwCDBFOOCCB5CFBsDrJrJBCCBzDzDBDBLBBCpDpD7HWBqDCBdMBtCjEjEBBB9HpIpIBBB8E9C9CBGB0CCBCEB+CJB4GgDgDBDBrBBBmUBBrCMBwFxjBxjBBDB97CBB8zOBBmEiCiCBDBJpRpRBBBoJDBoK9lT9lTovHEB07C-a-aBAB",!1)),Ps:()=>new $(J("oBzBzBgB-1D-1DC-6B-6B-rCEEnB4B4BQ7T7TCff-hBMCxChBhBCGC1MUChCCCiBmhBmhBCECaTTCECtNICEGCDipzBipzB4GeeCMCESSCCCrFzBzBgBEEDAB",!1)),S:()=>new $(J("kBHHRCBgBCCcCCkBEBCBBDCCBCBDEEfgBgBrODBNNBGGBCCCBPB2DPPBxDxDsErIrIBBB3DCBDDDBvGvGLUUB4H4HIBBpEqLqLBHHB2H2H-DjEjEBGBlEwGwGqBmGmGiGCBQCCBBBDFBVECmEHBCFBCBBGDBmGBBxXJB0WuLuLlL+E+EBgBBiLJBKIBhiBCCBBBMCBOCBOCBOBBmCOOoBCBOCBUhBB-BBBCDBCBBLCCBBBGFBCECFMMBFFBDBGDBC7B7BBFFB2LBFcBD+HBXKByCtCBXnTBtBwBBDeBLyMBX+BBFfBD1LBDpEBmHFBmLBBvBZBC4CBN1GBbPBFOOBNNWBBHBB8CBB0HBBFJBhBlBBKRRBdBMdBJQQBeBLmBBQ-JBhuG-BBx0V2BB6RWBKBBoDBB+EDBLDB+RCBiHPPB+9T+9TpEgBBuLPBhCBB3BHBtBDBjDCCBBBD7E7EHRRBBBgBCCcCCiEGBCGBOBB6JIB6BQBDCBCMBEwBwBBrBB7zBBBwSmWmWBiKiKBGBnjC2kC2kCBbBr6SDBG3qU3qUk7DvHBLCBEzNBHWBQQBgDzDB9B1HBLmBBD7BBGCBXBBIdBF8BBWhCBE7F7FB1CBrbaagBaagBaagBaagBaa9B-PB4BDBzBHBCNBCBBp2BwNwNttCEE+DiOiOBvIvIBqBBFjDBNOBDOBCOBCkBBYgFB5BcBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBC7CBLAB",!1)),Sc:()=>new $(J("kB+D+DBCBqnB8D8DzPBBzPBBI2H2HoImSmS8sClmClmCBgBB37hBkuVkuVtD7E7E8GBBEBB3-HDB-4wBxtCxtC",!1)),Sk:()=>new $(J("+CCCoCHHFEEqQDBNNBGGBCCCBPB2DPPBjoBjoB15FCCBBBMCBOCBOCBOBB9kEBBkzdWBKBBoDBBxePPBniUniUBPB8bCCjF4g9B4g9BBDB",!1)),Sm:()=>new $(J("rBRRBBB+BCCuBFFmBgBgB-XwQwQBBB8xGOOoBCBOCBsEoBoBBDBHlClCBDBGBBFGDIgBgBBDDCgBgBBqIBhBBB7CffBXBpBFB2OKK3BHBwDxKxKBDBDeBLPBhIiEBX+BBFfBDhIBxBUBDFB9+zB5Z5ZCCBlFRRBBB+BCCkEHHBCBitDBBhrwBx+Bx+BagBgBagBgBagBgBagBgBat5Ft5FB-uC-uCBHB",!1)),So:()=>new $(J("mFDDFCCyerIrIBgEgEBvGvGLUUB4H4HkQ2L2LjEFBClElEwGqBqBoMCBQCCBBBDFBVECmEHBCFBCBBGDBmGBBxXJB0WzWzW+EhBBiLJBKIBksBBBCDBCBBLCCBHHBEBCECFMMBPPCBBC7B7BBKKBDBDDBCBBCBBCGBCeBDBBCCCBdBtIHBFTBDGBDwCBCdBanBBHnCBXKByCtCBX2FBCIBC1BBJuDBC3HBtBrBBhC-HBhQvBBWBBHmBBDpEBmHFBmLBBvBZBC4CBN1GBbPBFOOBNNWBBHBBxKBBFJBhBlBBKRRBdBMdBJQQBeBLmBBQ-JBhuG-BBx0V2BBibDBLBBC+R+RBBBqqUPBuLPBhCBB3BHBuBCBlPEEFBBOBB6JIB6BQBDCBCMBEwBwBBrBB7zBBBwSpgBpgBBGBnjC2kC2kCBGBFQBr6SDBG3qU3qUk7DvHBLCBEzNBHWBQPBhDzDB9B1HBLmBBD7BBGCBXBBIdBF8BBWhCBE7F7FB1CBqlB-PB4BDBzBHBCNBCBBp2B96C96CiEyWyWBqBBFjDBNOBDOBCOBCkBBYgFB5BcBOrBBFIBIBBPFB7E6HBG4WBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBB-B3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBC7CBLAB",!1)),Z:()=>new $(J("gBgEgEgvFgsCgsCBJBeBBGwBwBh9DAB",!1)),Zl:()=>new $(J("ohIA",!0)),Zp:()=>new $(J("phIA",!0)),Zs:()=>new $(J("gBgEgEgvFgsCgsCBJBlBwBwBh9DAB",!1)),ASCII_Hex_Digit:()=>new $(J("wBJIFbF",!0)),Alphabetic:()=>new $(J("hCZBHZBwBLLFGGBVBCeBCpOBFLBPEBICC3CeeBQBCBBDDBCHHCCBCCCBSBCyCBCqEBJlFBClBBDHHBnBBoBNBCCCBCCBCCJaBFDBeKBG3BBCGBPlDBCHBFHBFCBLCBDRRBuBBOkDBZgBBKBBFGGBWBDSBUYBIKBGXBCGBIJJBoBBLLBEGBHrCBCPBCCBFOBOSBCHBDBBDVBCGBCEEBCBEHBDBBDBBCJJFBBCEBNBBLFFBBBCFBFBBDVBCGBCBBCBBCBBFEBFBBDBBFIIBCBCSSBEBMCBCIBCCBCVBCGBCBBCEBEIBCCBCBBEQQBCBWDBFCBCHBDBBDVBCGBCBBCEBEHBDBBDBBKBBFBBCEBORRBCCBEBECBCDBEBBCCCBEEBEEBBBELBFEBECBCCBEHHpBMBCCBCWBCPBEHBCCBCCBJBBCCBCBBDDBdDBCHBCCBCWBCJBCEBEHBCCBCCBJBBGCBCDBOCBNMBCCBCoBBDHBCCBCCBCGGBCBIEBXFBCCBCRBEXBCIBCDDBFBJFBCCCBGBTBBO5BBGGBH0B0BBECBDBCXBCCCBRBCCBDEBCHHPDBhBgCgCBGBCjBBFSBFPBCjBBkC2BBCDDBDBR-BBLDBDlBBCGGDqBBCsKBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBmBPBR1CBDFBErTBDQBCZBGqCBEKBITBMUBNTBNMBCCBCBBNzBBDSBPFFkC4CBIqBBGlCBLeBCLBFIBYdBDEBMrBBFZB3BbBF+BBDTBzBYYBMMBBByBzBBCOBCHB0BpBBDDBLrBBCKBP2BBXCBLjBBDKBGqBBDCBqBDBCFBCBBEGGB+FBUhBBM1IBDFBDlBBDFBDHBCGCBdBD0BBCGBCEEBBBCGBEDBDFBFMBGCBCGB1DOORMBmDFFDJBCEEBDBHGCBCBCKBDDBGEBFSSBnBBuZzBB34BkHBHDBEBBNlBBCGGD3BBI
1033RRBVBKGBCGBCGBCGBCGBCGBCGBCGBCfBwB2O2OBBBaIBIEBDEBF1CBHCBC5CBCDBGqBBC9CBSfBxBPBhQ-tGBhCs0VBkCtBBDsIBEPBLBBVuBBGHBEwDBoBIBDmDBDxCBVUBCgBBZzBBNjCBCtBtBBEBECCBBBLgBBGiBBOcBEyBBCLBQRRBOBLEBC2BBKNBTWBEkCBCCCZCBDPBDDBMFBDFBDFBKGBCGBCqBBCNBH6DBWj9KBNWBFwBBloItLBDpDBnBGBNEBGLBCMBCEBCCCBCCBCCBqDBiBqLBT-BBD1BBpBLB1DEBCmEBlBZBHZBM4CBEFBDFBDFBDCBkBLBCZBCSBCBBCOBDNBjB6DBmC0BBsIcBEwBBwBfBOdBGqBBGdBDjBBFHBCEBrB9EBTjBBFjBBFnBBJzBBNKBCOBCGBCBBCKBCOBCGBCBBEzBBN2JBKVBLHBZFBCpBBCIBmCFBDCCBqBBCBBEDDBVBLWBKeBiCSBCBBLVBLZBHZBnB3BBHBBhCDBCBBGHBCCBCcBrBcBEcBkBHBCbBc1BBLVBLSBORBvDoCB4ByBBOyBBOnBBjBbBEGGBVB7HpBBCBBEBBRFBzBCBEcBLJJBUBrBRBvBUBcWBKlCBsBEBL4BBKOOBXBYyBBSDBJiBBEKKB+BBCDBKBBLCCkBRBChBBDHHBCB-BGBCCCBCBCOBCJBI4BBYDBCHBDBBDVBCGBCBBCEBEHBDBBDBBEHHGGBdJBCDDClBBCJBCDDCDBCBBECCtBhCBCCBCDBVCBfhCBDBBC5F5FB0BBDGBaFBjB+BBCEE8B1BBDoCoCBZBDNBWGB6F4BBoD-BBgBHBDDDBGBCBBCdBCBBDBBDDB+CHBDtBBDFBCCCBccBxBBDJBSnCBGTTBnCBoDHB5CgBBgBIBCsBBCGBCyByBBcBDVBCNBqCGBCBBCrBBECCBCCBBBCDDBZZBEBCBBCkBBCBBCDBCYYBqBBlIWBKQBCoBBECBwDwCwCB4cBnDuDBSjGBtyCgDBQvhBBSFBa68DBGmSB61GuBBy2B4RBIeBSuCBSdBTvBBRDBgBUBGSBxNsBB0G-BBhBYBDYBtBqCBF4BBIQBhCBBCNNBFBK1mHBqBfBiDyDB+vIDBCGBCBBCiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBFi7Fi7FBzCBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDYBCYBCeBCYBCeBCYBCeBCYBCeBCYBCHB15BeBHFB2GGBCQBDGBCBBCEBG9BBiBxDxDBrBBLGBRiKiKBcBTrBBlPbBlHdBDwGwGBdBCVBJBBhHGBCDBCBBCOBCkGB8BjCBEEE1lBDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1TZBHZBHZB3zD-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Dash:()=>new $(J("tB9qB9qB0BiyDiyDmgBqgCqgCBEB+BoBoBQnMnMlgDDDgBBBFdd-NUUwDxszBxszBBmBmBLqFqFhzD-J-J",!1)),Emoji:()=>new $(J("jBHHGJBwDFFu8HNN5GXX7CFBQBBwLBBNnFnFaKBFCBoGoHoHBLLK7B7BBCBCEBKGDBDDFDDCBBDIEBJJBBBGCCGLBMBBDCCBCCTDDBTTBEBCCCBEEBGGDBBFBBMBBGBBDGGBECBVVBGGBEBCDBDFFDDDBEBCDDCCCHEEHLLBQQDFFCFFBBBCMMBxBxBBBBKeP1LBBwOCBUBB0BFF7mBNN6SCCrrvDrGrGhFBBNBBPDDBIBsCZBCBBYVVDIBWBBvFhBBDvDBDBBCCBDyCBDCBCmIBC+BBMFBCXBIBBDHBNDDBCBDFFBOOBDDJBBKGGBBBNCBJCBDCCFHHEHHB0CBxBlCBGHBDDBEJBECCBEEDJBkHLBF8I8IBtBBCJBC4FBxDMBEKBE4BBCFFBOBDLBFJB",!1)),Emoji_Component:()=>new $(J("jBHHGJB0+H2G2Gsp3B3+8B3+8BBYB8PEBxtBDBtzhY-CB",!1)),Emoji_Modifier:()=>new $(J("7-8DE",!0)),Emoji_Modifier_Base:()=>new $(J("9wJ8G8GRDB4jzD9B9BBBBDDDBBB2DBBDKBWSBEFFBBBCCBICCZqGqGBFFWFFBvFvFBBBEEB0CRRBBBKMMgSDDJHBHKKBIBDCB5B+B+BBCCBCCSCBCMBmHCBrBIB",!1)),Emoji_Presentation:()=>new $(J("64IBBuGDBEDDqQBBWBBzBLBsBUUOJJBSSBGGBJJGWWIBBCFFDIIFBBdkBkBCFFBBBC+B+BBBBZPP8aBB0BFFvlxDrGrG-FDDBIBsCZBCZZVDDBDBCCBWBBvFgBBNIBClCBCVBNqBBFEBNQBEEEBlCBCCCB5FBD+BBODBCXBTbbBOO3C0CBxBlCBHEEBBBDDBEDBMBBIIBkHLBF8I8IBtBBCJBC4FBxDMBEKBE4BBCFFBOBDLBFJB",!1)),Extended_Pictographic:()=>new $(J("pFFFu8HNN5GXX7CFBQBBwLBBNnFnFaKBFCBoGoHoHBLLK7B7BBCBCEBKGDBDDFDDCBBDIEBJJBBBGCCGLBMBBDCCBCCTDDBTTBEBCCCBEEBGGDBBFBBMBBGBBDGGBECBVVBGGBEBCDBDFFDDDBEBCDDCCCHEEHLLBQQDFFCFFBBBCMMBxBxBBBBKeP1LBBwOCBUBB0BFF7mBNN6SCCrrvDoBoBBCBlDLBQBBQPPBmBmBBIBxDBBNBBPDDBIBU3BBcOBLVVDIBCDBKWBH7FBDvDBDBBCCBDyCBDCBCDBG9HBC+BBMFBCXBIBBDHBNDDBCBDFFBOOBDDJBBKGGBBBNCBJCBDCCFHHEHHB0CBxBlCBGHBDQBECCBEBDMB7GlBBNDB5BHBLFBpBHBfBBNDBDNBKmBBNuBBCJBC4FB5CHBPxEBhI9fB",!1)),Hex_Digit:()=>new $(J("wBJIFbFq1-BJIFbF",!0)),Lowercase:()=>new $(J("hDZBwBLLFlBlBBWBCHBC2BCBQCBuBCDECBBBDCCDEEBFFDEEBBBDDDCCCDCCBCCDEECDDBDDBBBHGDCOCBSCBDDCEEC4BCBFBDDDBCCFICBjCBDiBBIBBfEBhDsBsBCEEDDBTccBhBBCBBECBCWCBDBCGDB0B0BBuBBCgBCK0BCDMCBgDCxBoBBo6CqBBCDB5XFBjkCIBC2D2DB+FBiC0ECBHBCgDCBHBJFBLHBJHBJFBLHBJHBJNBDHBJHBJHBJEBCBBHEEBBBCBBJDBDBBJHBLCBCBB6DOORMBuDEEBEEcKFDBBJDBFiBiBBOBFsasaBYBn6BvBBCEEBGCFCCBCCBGBEiDCBIICFFNlBBCGG0oesBCUaCBBBmEMCBBBC8BCBIBCCCDICFCCDCCBBBCSCGGGCMCFCCDOCWDBCCCBBB2ZqBBCNBHvCBh6TGBNEBqhBZBumBnBBpEjBB8EKBCOBCGBCBBkODDBBBCpBBCIBmoByBB+DVB75CfBhsVfB8BYBnqZZBbGBCRBbZBbDBCCCBFBCKBbZBbZBbZBbZBbZBbZBbZBbZBbbBdYBCFBbYBCFBbYBCFBbYBCFBbYBCFBC15B15BBIBCTBHFBmI9BB1lChBB",!1)),Math:()=>new $(J("rBRRBBBgBeeCuBuBFmBmBgB5W5WBBBDbbBDDBBBwQCBuwGccBBBMEEOPPBCBWEBMEBiCMBFEEBFFBDBTFFDJBCDDBEBHEEBDDBCCBBBCFBENBClClCBWBCFBCBBFBBFfBCHHBPPBqIBJDBVBB7CffBZBCZZMGB+NBBNJBFFBFBBDBBEEBPCCDFBMHBGBB6BCCeDBKCBxK-BBhI-PBxBUBDFB9+zB4Z4ZBEBCjFjFRCBeCCeCCkEHHBCBitDBBhrwBwoBwoBBzCBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBBhwFDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB-uCIB",!1)),Quotation_Mark:()=>new $(J("iBFFkEQQ96HHBaBBowDqOqOBCBOCBixzBDB+FFF7CBB",!1)),Terminal_Punctuation:()=>new $(J("hBLLCMMBEE-ZJJiQ6B6BpCPPCCB1FsBsBBJBCsHsHB3B3BBEBCHBgBmImIB1nB1nBBtFtFFFB4JBB2YHBmY9D9DBBBoCBB+ECBEoBoBBCBDBB7JBBjLDBjFBBLBBCCBeCB8FEB-BBBldYYBKKBBBwlDCBzJOOFLLCBBEBBtNBB8ndBBuICBkHEB-LBB3CBBgD4E4EBBB0ECBgERRB6H6HnxUDDB6B6BBBBCDBqFLLCMMBEEiCDD7hBxBxBnkBoGoG3JBB5EFBlCFB6CDB5dEBtBDB+FGBxDDBgECBiEBBHRRB5C5CBDBtDrJrJB2D2DBBBNBBnLDBEOBqDBB6HCBmQCC8HBB4CBBFBB-MCBuBmUmUBrCrCBspBspBBDB6vRBBmEiCiCBBBLqRqRBoJoJBnwTnwTovHDB",!1)),Uppercase:()=>new $(J("hCZBmDWBCGBiB2BCDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIJDCMCDQCDDDCCBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBDDBBBEWCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBpCDBNDBNDBNEBMDBnIFFECBDCBDEEBDBHGCBCBDDBLBBGbbBOBUzZzZBYBx5BvBBxBCCB
1033BBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBBvgCZBHZBHZB",!1)),White_Space:()=>new $(J("JEBTlDlDbgvFgvFgsCKBeBBGwBwBh9DAB",!1))})),ze(cc,"SCRIPTS",new Y0({Adlam:()=>new $(J("go6DrCFJFB",!0)),Ahom:()=>new $(J("g4lCaDOFW",!0)),Anatolian_Hieroglyphs:()=>new $(J("ggxCmS",!0)),Arabic:()=>new $(J("gwBEBCFBCNBCCBCfBCJBMZBCrDBChBBxCvBBxHhBBGqCBCcBxy8BtPBDvEBhBPBxDEBCmEBk7DeBkCFBJIBiBFBh43BDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB",!1)),Armenian:()=>new $(J("xpBlBDxBDCks9BE",!0)),Avestan:()=>new $(J("g4iC1BEG",!0)),Balinese:()=>new $(J("g4GsCCxB",!0)),Bamum:()=>new $(J("g1pB3CpowB4R",!0)),Bassa_Vah:()=>new $(J("w26CdDF",!0)),Batak:()=>new $(J("g+GzBJD",!0)),Bengali:()=>new $(J("gsCDBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYB",!1)),Beria_Erfe:()=>new $(J("g17CYDY",!0)),Bhaiksuki:()=>new $(J("ggnCICsBCNLc",!0)),Bopomofo:()=>new $(J("qXB6wLqBxDf",!0)),Brahmi:()=>new $(J("ggkCtCFjBKA",!0)),Braille:()=>new $(J("ggK-H",!0)),Buginese:()=>new $(J("gwGbDB",!0)),Buhid:()=>new $(J("g6FT",!0)),Canadian_Aboriginal:()=>new $(J("ggF-TxRlC7tgCP",!0)),Carian:()=>new $(J("g1gCwB",!0)),Caucasian_Albanian:()=>new $(J("wphCzBMA",!0)),Chakma:()=>new $(J("gokC0BCR",!0)),Cham:()=>new $(J("gwqB2BKNDJDD",!0)),Cherokee:()=>new $(J("g9E1CDFz7lBvC",!0)),Chorasmian:()=>new $(J("w9jCb",!0)),Common:()=>new $(J("AgCBbFBbuBBCOBCEBYgBgBiOmBBGEBDTB1DKKHCC+THHPEEhB9E9ElQiEiEB6mB6mB2MDBjJwvBwvBBBBoCBBsGBBCumBumBOIIBCBCFBCCBDmYmYBKBD2CBCKBEKBCOBShBB-BlBBCCBDFBCaBCQBqBCBF5UBXKBW-cBhIzTBDpEBhQ9CBzMUBCCCBXBQHBFDB8CBBE7C7CB0E0EBOBhBlBBKxBxBB+BBgBwCBwB5C5CBmFBhuG-BBhoWhBBnDCBmFJB1HhFhFsMPPBzuUzuUBxGxGBIBXiBBCSBCDB0ECCBeBbFBbKBLuBuBBhChCBFBCGBLEBjICBFsBBEIBxCMB0BsBBlHaBltuBDB96D8HBEzNBHWBQQBgDzDB9B1HBLmBBD9BBEQBJBBIdBF8BB2GTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBByjFjCBtC8BBjWrBBFjDBNOBDOBCOBCkBBLtFB5BZBCBBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBnghYffB+CB",!1)),Coptic:()=>new $(J("ifNxkKzDGG",!0)),Cuneiform:()=>new $(J("ggoC5cnDuDCEMjG",!0)),Cypriot:()=>new $(J("ggiCFBDCCBqBBCBBEDD",!1)),Cypro_Minoan:()=>new $(J("w8rCiD",!0)),Cyrillic:()=>new $(J("ggBkEBDoFBx6FKBhFtCtCojEfBhie-CBv8VBBhw4B9BBiBAB",!1)),Deseret:()=>new $(J("gghCvC",!0)),Devanagari:()=>new $(J("goCwCFODZh7nBfhwcJ",!0)),Dives_Akuru:()=>new $(J("gomCGBDDDBGBCBBCdBCBBDLBKJB",!1)),Dogra:()=>new $(J("ggmC7B",!0)),Duployan:()=>new $(J("ggvDqDGMEIIJDD",!0)),Egyptian_Hieroglyphs:()=>new $(J("ggsC1iBL68D",!0)),Elbasan:()=>new $(J("gohCnB",!0)),Elymaic:()=>new $(J("g-jCW",!0)),Ethiopic:()=>new $(J("gwEoCBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBnvGWBKGBCGBCGBCGBCGBCGBCGBCGBjpfFBDFBDFBKGBCGBylvCGBCD
1033BCBBCOB",!1)),Garay:()=>new $(J("gqjClBEcJB",!0)),Georgian:()=>new $(J("glElBBCGGDqBBCDBx8CqBBDCBhiElBBCGG",!1)),Glagolitic:()=>new $(J("ggL-Ch9sDGCQDGCBCE",!0)),Gothic:()=>new $(J("w5gCa",!0)),Grantha:()=>new $(J("g4kCDBCHBDBBDVBCGBCBBCEBDIBDBBDCBDHHGGBDGBEEB",!1)),Greek:()=>new $(J("wbDBCCBDDBCFFCCCBBBCCCBSBC+BBPPBnpGEBzBEBFEB1ChKhKBUBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBoJ-xiB-xiB7uVuCBSgj0Bgj0BBkCB",!1)),Gujarati:()=>new $(J("h0CCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGB",!1)),Gunjala_Gondi:()=>new $(J("grnCFCBCkBCBCFIJ",!0)),Gurmukhi:()=>new $(J("hwCCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPB",!1)),Gurung_Khema:()=>new $(J("go4C5B",!0)),Han:()=>new $(J("g0LZBC4CBN1GBwBCCaIBPDBle-tGBhC-vUBhoWtLBDpDBpodBBNGBqgkB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Hangul:()=>new $(J("goE-HvxHBiI9CyDeiCei3dckUj9KNWFwBl9JeEFDFDFDC",!0)),Hanifi_Rohingya:()=>new $(J("gojCnBJJ",!0)),Hanunoo:()=>new $(J("g5FU",!0)),Hatran:()=>new $(J("gniCSCBGE",!0)),Hebrew:()=>new $(J("xsB2BBJaBFFBpp9BZBCEBCCCBCCBCCBIB",!1)),Hiragana:()=>new $(J("hiM1CBHCBi7-C+IBTeeBBBulQAB",!1)),Imperial_Aramaic:()=>new $(J("giiCVCI",!0)),Inherited:()=>new $(J("gYvDB2IBBlOKBbhXhXBCB8qEtBBDLBlPCBCMBCGBFHHEBBnG-BBtQBBjGgBB65DDBsDBBmrzBPBRNBwejHjH7iEl+uBl+uBBsBBDWBhRCBSHBDGBfDBz6rYvHB",!1)),Inscriptional_Pahlavi:()=>new $(J("g7iCSGH",!0)),Inscriptional_Parthian:()=>new $(J("g6iCVDH",!0)),Javanese:()=>new $(J("gsqBtCDJFB",!0)),Kaithi:()=>new $(J("gkkCiCLA",!0)),Kannada:()=>new $(J("gkDMCCCWCJCEDICCCDIBGCCDDJCC",!0)),Katakana:()=>new $(J("hlM5CBDCBxHPBxGuBBC3CBvgzBJBCsBBzisBDBCGBCBBCgJgJBBBzBPPBCB",!1)),Kawi:()=>new $(J("g4nCQCoBEc",!0)),Kayah_Li:()=>new $(J("goqBtBCA",!0)),Kharoshthi:()=>new $(J("gwiCDCBGHCCCcDCFJII",!0)),Khitan_Small_Script:()=>new $(J("k-7C84G84GB0OBqBAB",!1)),Khmer:()=>new $(J("g8F9CDJHJnPf",!0)),Khojki:()=>new $(J("gwkCRCuB",!0)),Khudawadi:()=>new $(J("w1kC6BGJ",!0)),Kirat_Rai:()=>new $(J("gq7C5B",!0)),Lao:()=>new $(J("h0DBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDB",!1)),Latin:()=>new $(J("hCZBHZBwBQQGWBCeBCgOBoBEB8wGlBBHwBBGDBGMBClCBiC-HByLOORMBuEBBHccSoBB42CfBj1elDBExCBVOBxZqBBCIBCDB38TGB7gBZBHZBmhCFBCpBBCIBm61BeBHFB",!1)),Lepcha:()=>new $(J("ggH3BEOEC",!0)),Limbu:()=>new $(J("goGeBCLBFLBFEEBKB",!1)),Linear_A:()=>new $(J("gwhC2JKVLH",!0)),Linear_B:()=>new $(J("gggCLCZCSCBCODNjB6D",!0)),Lisu:()=>new $(J("wmpBvBx1eA",!0)),Lycian:()=>new $(J("g0gCc",!0)),Lydian:()=>new $(J("gpiCZGA",!0)),Mahajani:()=>new $(J("wqkCmB",!0)),Makasar:()=>new $(J("g3nCY",!0)),Malayalam:()=>new $(J("goDMCCCyBCCCFFPDZ",!0)),Mandaic:()=>new $(J("giCbDA",!0)),Manichaean:()=>new $(J("g2iCmBFL",!0)),Marchen:()=>new $(J("wjnCfDVCN",!0)),Masaram_Gondi:()=>new $(J("gonCGBCBBCrBBECCBCCBHBJJB",!1)),Medefaidrin:()=>new $(J("gy7C6C",!0)),Meetei_Mayek:()=>new $(J("g3qBWqGtBDJ",!0)),Mende_Kikakui:()=>new $(J("gg6DkGDP",!0)),Meroitic_Cursive:()=>new $(J("gtiCXFTDtB",!0)),Meroitic_Hieroglyphs:()=>new $(J("gsiCf",!0)),Miao:()=>new $(J("g47CqCF4BIQ",!0)),Modi:()=>new $(J("gwlCkCMJ",!0)),Mongolian:()=>new $(J("ggGBBDCCBSBH4CBIqBB2t-BMB",!1)),Mro:()=>new $(J("gy6CeCJFB",!0)),Multani:()=>new $(J("g0kCGBCCCBCBCOBCKB",!1)),Myanmar:()=>
1033new $(J("ggE-EhqmBeiDfxibT",!0)),Nabataean:()=>new $(J("gkiCeJI",!0)),Nag_Mundari:()=>new $(J("wm5DpB",!0)),Nandinagari:()=>new $(J("gtmCHDtBDK",!0)),New_Tai_Lue:()=>new $(J("gsGrBFZHKEB",!0)),Newa:()=>new $(J("gglC7CCE",!0)),Nko:()=>new $(J("g+B6BDC",!0)),Nushu:()=>new $(J("h-7CvsQvsQBqMB",!1)),Nyiakeng_Puachue_Hmong:()=>new $(J("go4DsBENDJFB",!0)),Ogham:()=>new $(J("g0Fc",!0)),Ol_Chiki:()=>new $(J("wiHvB",!0)),Ol_Onal:()=>new $(J("wu5DqBFA",!0)),Old_Hungarian:()=>new $(J("gkjCyBOyBIF",!0)),Old_Italic:()=>new $(J("g4gCjBKC",!0)),Old_North_Arabian:()=>new $(J("g0iCf",!0)),Old_Permic:()=>new $(J("w6gCqB",!0)),Old_Persian:()=>new $(J("g9gCjBFN",!0)),Old_Sogdian:()=>new $(J("g4jCnB",!0)),Old_South_Arabian:()=>new $(J("gziCf",!0)),Old_Turkic:()=>new $(J("ggjCoC",!0)),Old_Uyghur:()=>new $(J("w7jCZ",!0)),Oriya:()=>new $(J("h4CCCHDBDVCGCBCEDIDBDCICFBCEDR",!0)),Osage:()=>new $(J("wlhCjBFjB",!0)),Osmanya:()=>new $(J("gkhCdDJ",!0)),Pahawh_Hmong:()=>new $(J("g46ClCLJCGCUGS",!0)),Palmyrene:()=>new $(J("gjiCf",!0)),Pau_Cin_Hau:()=>new $(J("g2mC4B",!0)),Phags_Pa:()=>new $(J("giqB3B",!0)),Phoenician:()=>new $(J("goiCbEA",!0)),Psalter_Pahlavi:()=>new $(J("g8iCRIDNG",!0)),Rejang:()=>new $(J("wpqBjBMA",!0)),Runic:()=>new $(J("g1FqCEK",!0)),Samaritan:()=>new $(J("ggCtBDO",!0)),Saurashtra:()=>new $(J("gkqBlCJL",!0)),Sharada:()=>new $(J("gskC-ChsCH",!0)),Shavian:()=>new $(J("wihCvB",!0)),Siddham:()=>new $(J("gslC1BDlB",!0)),Sidetic:()=>new $(J("gqiCZ",!0)),SignWriting:()=>new $(J("gg2DrUQECO",!0)),Sinhala:()=>new $(J("hsDCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBt-gCTB",!1)),Sogdian:()=>new $(J("w5jCpB",!0)),Sora_Sompeng:()=>new $(J("wmkCYIJ",!0)),Soyombo:()=>new $(J("wymCyC",!0)),Sundanese:()=>new $(J("g8G-BhIH",!0)),Sunuwar:()=>new $(J("g+mChBPJ",!0)),Syloti_Nagri:()=>new $(J("ggqBsB",!0)),Syriac:()=>new $(J("g4BNC7BDCxIK",!0)),Tagalog:()=>new $(J("g4FVKA",!0)),Tagbanwa:()=>new $(J("g7FMCCCB",!0)),Tai_Le:()=>new $(J("wqGdDE",!0)),Tai_Tham:()=>new $(J("gxG+BCcDKHJHN",!0)),Tai_Viet:()=>new $(J("g0qBiCZE",!0)),Tai_Yo:()=>new $(J("g25DeCVJB",!0)),Takri:()=>new $(J("g0lC5BHJ",!0)),Tamil:()=>new $(J("i8CBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBm+kCxBBOAB",!1)),Tangsa:()=>new $(J("wz6CuCCJ",!0)),Tangut:()=>new $(J("g-7CgBgBB+3GBhQeBiDyDB",!1)),Telugu:()=>new $(J("ggDMCCCWCPDICCCDIBCCCBDDDJII",!0)),Thaana:()=>new $(J("g8BxB",!0)),Thai:()=>new $(J("hwD5BGb",!0)),Tibetan:()=>new $(J("g4DnCCjBFmBCjBCOCGFB",!0)),Tifinagh:()=>new $(J("wpL3BIBPA",!0)),Tirhuta:()=>new $(J("gklCnCJJ",!0)),Todhri:()=>new $(J("guhCzB",!0)),Tolong_Siki:()=>new $(J("wtnCrBFJ",!0)),Toto:()=>new $(J("w04De",!0)),Tulu_Tigalari:()=>new $(J("g8kCJBCDDClBBCJBCDDCDBCJBCBBJBB",!1)),Ugaritic:()=>new $(J("g8gCdCA",!0)),Unknown:()=>new $(J("4bBBHDBICCVuMuMnBBBzBBBE4B4BBGBcDBHKBvI9B9BBmDmDBMB8BBByBBBQddBCCMEBjBEBuHJJBDDBXXICCBBBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBFBSJBEKKEXXIDDGBBLIEBCCBNBFBBNGBIEEJBBDBBXIIDGGBKKBDDBEEBFBEDBDGGBTTBIBDHHBBBEFFBBBDCCDCBDCBECBNDBGCBEFFBCCBEBCNBWEBOEEYRRBKKEFFBFBDEEDBBFBBLGBXEEYLLGBBKEEFGBDEBEFFBLLELBOEE0BEEHDBRBBbEETCBZKKCBBICBCDBHCCJFBLBBELB7BDBekBBDCCGZZCYYBGGCIILBBFfBpClBlBBCBoBlBlBQOOBjBBnGCCBDBCBB6LFFBIICFFBqBqBFBBiBFFBIICFFBQQ6BFFBkCkCBhBhBBBBbFB3CBBHBB+UCB6CGBXIBZIBVLBOEEDLB-CBBLFBLFBbFB6CGBsBEBnCJBgBNNBCBNDBCCBrBBBGKBtBDBbFBMCB-BBBiCeeBMMBEBLFBPBBvBBBNTBuCnFnFBGB9BCBQCB-BEBsBBBMHBsBEB3QBBHBBnBBBHBBJGCgBBB2BQQPBBHUUBEEKmDmDNBBcOOBBBjBNBiBOBtEDB7UVBMUB14BBB-LEBuBCCBDBCBB5BGBDNBZIBI4BI-DhBBb6C6CBKB3GZBxC3C3CBoDoDBDBsB-C-C3CIBxBuzcuzcBBB4BIB9KTB5FHB+GTB9BCBLFB5BHBnCHBNFB1DKBfCBvCMMBCBiB4B4BBHBPBBLBBoDXBdJBHBBHBBHIBIII9BDB-DBBLFBl9KLBYDByBjoIBvLBBrDlBBILBGEBbGGCGDrUfBrBFB0BUUFDBGoEoEBCC-FCBHBBHBBHBBECBIIIBIBGBBNbbUDDQBBPhBB8DEBEDBuBCB5COOBBBCuBBvBhEBeCByBOBdDBlBIBfEBsBEBfmBmBBCBPpBB-EBBLFBlBDBlBDBpBHB1BKBNQQIDDMQQIDDBBB1BLB4JIBXJBJXBHrBrBKkCBHBBCtBtBDCBCBBYpCpCBGBKvBBUDDBDBiBCBcEBclBB5BDBVBBzBDDBDBJEEeBBEDBLGBKGBhCfBoBDBNIB3BCBeBBcEBbGBFLBIvCBqC2BB0BMB0BGBvBHBLFBnBCBeHBDvGBgBrBrBEBBDPBHHBKgBBvBHBrBVBblBBdTBYIBvCDBlBIBlCJBCBBaGBLFB2BTTBGBoBIBhDVVBJBTwBwBB8BBICCFQQMFB8BEBLFBFJJBDDBXXIDDGLLBDDBEEBCCBEBCEBIBBICBGKBLCCBCCnBLLCBBCFFLDDBGBDcB9CGGBcBpCHBLlFB3BBBnBhBBmCKBLFBOSB7BFBLFBVbBcBBQDBY4FB9BjDB0CLBJBBCBBJDDfDDBNNBHBLlCBJBBvBBBMaBpCHB0CMBqCGBL1CBJ3CBjBNBLFBKuBuBPJBeCBhBBBXPPBnCBIDDtBCBCDDKHBLFBHDDmBD
1033DHGBLFBtBDBL1HBaGBSqBqBBBBe0CBCOBzBMB8clDBwDGGBJBlGryCBkDMB3iBJB88DEBoS41GB7Bl2BB6RGBgBLLBCByCLLBEBfBBHJBnCJBLIIWEBUvNB7BlGB8CEBaBBarBBsCDB6BGBS-BBGKBIIB3mHoBBhBgDB0D8vIBFIIDkJkJBNBCcBEBBCNBFHBtMjoCBsDEBOCBKGBLBBJ76DB+HCB1NFBYOBSOBvBBBYIB1D7BB3HJBoBBBjGUBnC5DBVLBVLB4CIBamEB2CoCoCDBBCBBDBBFNNCIIiCFFBJJIddFGGCCBI1K1KBlJlJB-V-VBNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBNDBLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-FB",!1)),Vai:()=>new $(J("gopBrJ",!0)),Vithkuqi:()=>new $(J("wrhCKCOCGCBCKCOCGCB",!0)),Wancho:()=>new $(J("g24D5BGA",!0)),Warang_Citi:()=>new $(J("glmCyCNA",!0)),Yezidi:()=>new $(J("g0jCpBCCDB",!0)),Yi:()=>new $(J("ggoBskBE2B",!0)),Zanabazar_Square:()=>new $(J("gwmCnC",!0))})),ze(cc,"FOLD_CATEGORIES",new Y0({L:()=>new $(J("laA",!0)),LC:()=>new $(J("laA",!0)),Ll:()=>new $(J("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGC3HrBrBCEEJHHCCBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHxC9zC9zCBuBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Lt:()=>new $(J("kOCCBCCBCClBCCtsHHBJHBJHBMQQwBAB",!1)),Lu:()=>new $(J("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpL2B2Bs1CvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1)),M:()=>new $(J("5cgBgBlgHAB",!1)),Mn:()=>new $(J("5cgBgBlgHAB",!1)),Emoji:()=>new $(J("8mJA",!0)),Extended_Pictographic:()=>new $(J("8mJA",!0)),Lowercase:()=>new $(J("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHuBPBUzZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Math:()=>new $(J("ycGDCHHFMMDDDCHHFAB",!1)),Uppercase:()=>new $(J("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpLiBiBBOBFsasaBYBn6BvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1))})),ze(cc,"FOLD_SCRIPT",new Y0({Common:()=>new $(J("8cgBgB",!1)),Greek:()=>new $(J("1FwUwU",!1)),Inherited:()=>new $(J("5cgBgBlgHAB",!1))})),cc),as,it=(as=class{static is32(e,t){let s=0,o=e.length;for(;s<o;){const l=s+Math.floor((o-s)/2),u=e.getLo(l),h=e.getHi(l);if(u<=t&&t<=h){const f=e.getStride(l);return(t-u)%f===0}t<u?o=l:s=l+1}return!1}static is(e,t){if(t<=as.MAX_LATIN1){for(let s=0;s<e.length;s++){if(t>e.getHi(s))continue;const o=e.getLo(s);if(t<o)return!1;const l=e.getStride(s);return(t-o)%l===0}return!1}return e.length>0&&t>=e.getLo(0)&&as.is32(e,t)}static isUpper(e){if(e<=as.MAX_LATIN1){const t=String.fromCodePoint(e);return t.toUpperCase()===t&&t.toLowerCase()!==t}return as.is(Ei.Upper,e)}static isPrint(e){return e<=as.MAX_LATIN1?e>=32&&e<as.MAX_ASCII||e>=161&&e!==173:as.is(Ei.Print,e)}static simpleFold(e){if(Ei.CASE_ORBIT.has(e))return Ei.CASE_ORBIT.get(e);const t=Ne.toLowerCase(e);return t!==e?t:Ne.toUpperCase(e)}static equalsIgnoreCase(e,t){if(e===t)return!0;
1033if(e<0||t<0)return!1;if(e<=as.MAX_ASCII&&t<=as.MAX_ASCII)return 65<=e&&e<=90&&(e|=32),65<=t&&t<=90&&(t|=32),e===t;for(let s=as.simpleFold(e);s!==e;s=as.simpleFold(s))if(s===t)return!0;return!1}},ze(as,"MAX_RUNE",1114111),ze(as,"MAX_ASCII",127),ze(as,"MAX_LATIN1",255),ze(as,"MAX_BMP",65535),ze(as,"MIN_FOLD",65),ze(as,"MAX_FOLD",125251),ze(as,"MIN_HIGH_SURROGATE",55296),ze(as,"MAX_HIGH_SURROGATE",56319),ze(as,"MIN_LOW_SURROGATE",56320),ze(as,"MAX_LOW_SURROGATE",57343),ze(as,"MIN_SUPPLEMENTARY_CODE_POINT",65536),as);const S1=256,aT=new Uint8Array(S1);for(let n=0;n<S1;n++)aT[n]=97<=n&&n<=122||65<=n&&n<=90||48<=n&&n<=57||n===95?1:0;let UC=null,GC=null;var Bs,Bt=(Bs=class{static emptyInts(){return[]}static isByteArray(e){return Array.isArray(e)||e instanceof Uint8Array}static isalnum(e){return Ne.CODES.get("0")<=e&&e<=Ne.CODES.get("9")||Ne.CODES.get("a")<=e&&e<=Ne.CODES.get("z")||Ne.CODES.get("A")<=e&&e<=Ne.CODES.get("Z")}static unhex(e){return Ne.CODES.get("0")<=e&&e<=Ne.CODES.get("9")?e-Ne.CODES.get("0"):Ne.CODES.get("a")<=e&&e<=Ne.CODES.get("f")?e-Ne.CODES.get("a")+10:Ne.CODES.get("A")<=e&&e<=Ne.CODES.get("F")?e-Ne.CODES.get("A")+10:-1}static escapeRune(e){let t="";if(it.isPrint(e))Bs.METACHARACTERS.indexOf(String.fromCodePoint(e))>=0&&(t+="\\"),t+=String.fromCodePoint(e);else switch(e){case Ne.CODES.get('"'):t+='\\"';break;case Ne.CODES.get("\\"):t+="\\\\";break;case Ne.CODES.get(" "):t+="\\t";break;case Ne.CODES.get(` 1034`):t+="\\n";break;case Ne.CODES.get("\r"):t+="\\r";break;case Ne.CODES.get("\b"):t+="\\b";break;case Ne.CODES.get("\f"):t+="\\f";break;default:{let s=e.toString(16);e<256?(t+="\\x",s.length===1&&(t+="0"),t+=s):t+=`\\x{${s}}`;break}}return t}static stringToRunes(e){const t=String(e),s=[];let o=0;for(;o<t.length;){const l=t.codePointAt(o);s.push(l),o+=l>it.MAX_BMP?2:1}return s}static runeToString(e){return String.fromCodePoint(e)}static isWordRune(e){return e<S1?aT[e]===1:!1}static emptyOpContext(e,t){let s=0;return e<0&&(s|=Bs.EMPTY_BEGIN_TEXT|Bs.EMPTY_BEGIN_LINE),e===10&&(s|=Bs.EMPTY_BEGIN_LINE),t<0&&(s|=Bs.EMPTY_END_TEXT|Bs.EMPTY_END_LINE),t===10&&(s|=Bs.EMPTY_END_LINE),Bs.isWordRune(e)!==Bs.isWordRune(t)?s|=Bs.EMPTY_WORD_BOUNDARY:s|=Bs.EMPTY_NO_WORD_BOUNDARY,s}static quoteMeta(e){return e.split("").map(t=>Bs.METACHARACTERS.indexOf(t)>=0?`\\${t}`:t).join("")}static charCount(e){return e>it.MAX_BMP?2:1}static toArray(e){const t=e.length,s=new Array(t);for(let o=0;o<t;o++)s[o]=e[o];return s}static stringToUtf8ByteArray(e){if(globalThis.TextEncoder)return UC||(UC=new TextEncoder),UC.encode(e);{let t=[],s=0;for(let o=0;o<e.length;o++){let l=e.charCodeAt(o);l<128?t[s++]=l:l<2048?(t[s++]=l>>6|192,t[s++]=l&63|128):(l&64512)===it.MIN_HIGH_SURROGATE&&o+1<e.length&&(e.charCodeAt(o+1)&64512)===it.MIN_LOW_SURROGATE?(l=it.MIN_SUPPLEMENTARY_CODE_POINT+((l&1023)<<10)+(e.charCodeAt(++o)&1023),t[s++]=l>>18|240,t[s++]=l>>12&63|128,t[s++]=l>>6&63|128,t[s++]=l&63|128):(t[s++]=l>>12|224,t[s++]=l>>6&63|128,t[s++]=l&63|128)}return t}}static utf8ByteArrayToString(e){if(globalThis.TextDecoder){GC||(GC=new TextDecoder("utf-8"));const t=e instanceof Uint8Array?e:new Uint8Array(e);return GC.decode(t)}else{let t=[],s=0,o=0;for(;s<e.length;){let l=e[s++];if(l<128)t[o++]=String.fromCharCode(l);else if(l>191&&l<224){let u=e[s++];t[o++]=String.fromCharCode((l&31)<<6|u&63)}else if(l>239&&l<365){let u=e[s++],h=e[s++],f=e[s++],p=((l&7)<<18|(u&63)<<12|(h&63)<<6|f&63)-it.MIN_SUPPLEMENTARY_CODE_POINT;t[o++]=String.fromCharCode(it.MIN_HIGH_SURROGATE+(p>>10)),t[o++]=String.fromCharCode(it.MIN_LOW_SURROGATE+(p&1023))}else{let u=e[s++],h=e[s++];t[o++]=String.fromCharCode((l&15)<<12|(u&63)<<6|h&63)}}return t.join("")}}},ze(Bs,"METACHARACTERS","\\.+*?()|[]{}^$"),ze(Bs,"EMPTY_BEGIN_LINE",1),ze(Bs,"EMPTY_END_LINE",2),ze(Bs,"EMPTY_BEGIN_TEXT",4),ze(Bs,"EMPTY_END_TEXT",8),ze(Bs,"EMPTY_WORD_BOUNDARY",16),ze(Bs,"EMPTY_NO_WORD_BOUNDARY",32),ze(Bs,"EMPTY_ALL",-1),Bs);const oT=(n=[],e=0)=>{const t=Object.create(null);for(let s=0;s<n.length;s++){const o=n[s],l=e+s;t[o]=l,t[l]=o}return Object.freeze(t)};var Cc,Fu=(Cc=class{getEncoding(){throw Error("not implemented")}asCharSequence(){throw Error("not implemented")}asBytes(){throw Error("not implemented")}length(){throw Error("not implemented")}isUTF8Encoding(){return this.getEncoding()===Cc.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===Cc.Encoding.UTF_16}},ze(Cc,"Encoding",oT(["UTF_16","UTF_8"])),Cc),WE=class extends Fu{constructor(n=null){super(),this.bytes=n}getEncoding(){return Fu.Encoding.UTF_8}asCharSequence(){return Bt.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},rM=class extends Fu{constructor(n=null){super(),this.charSequence=n}getEncoding(){return Fu.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return Bt.stringToUtf8ByteArray(this.charSequence.toString())}length(){return this.charSequence.length}},wu=class{static utf16(n){return new rM(n)}static utf8(n){return Bt.isByteArray(n)?new WE(n):new WE(Bt.stringToUtf8ByteArray(n))}},fi=class{static EOF(){return-8}constructor(){this.end=0}canCheckPrefix(){return!0}endPos(){return this.end}hasString(){return!1}hasAnyString(){return!1}prefixLength(){return 0}},iM=class extends fi{constructor(n,e=0,t=n.length){super(),this.bytes=n,this.start=e,this.end=t}hasString(n,e){const t=n.bytes;if(t.length===0)return!0;const s=this.indexOf(this.bytes,t,this.start+e);return s!==-1&&s<=this.end-t.length}hasAnyString(n,e){return n.ac8?n.ac8.searchUTF8(this.bytes,this.start+e,this.end):!1}step(n){if(n+=this.start,n>=this.end)return fi.EOF();const e=this.bytes[n]&255;if(e<128)return e<<3|1;if(e>=194&&e<=223&&n+1<this.end){const t=this.bytes[n+1]&255;return(t&192)!==128?e<<3|1:((e&31)<<6|t&63)<<3|2}else if(e>=224&&e<=239&&n+2<this.end){const t=this.bytes[n+1]&255;if((t&192)!==128)return e<<3|1;const s=this.bytes[n+2]&255;return(s&192)!==128?e<<3|1:((e&15)<<12|(t&63)<<6|s&63)<<3|3}else if(e>=240&&e<=244&&n+3<this.end){const t=this.bytes[n+1]&255;if((t&192)!==128)return e<<3|1;const s=this.bytes[n+2]&255;if((s&192)!==128)return e<<3|1;const o=this.bytes[n+3]&255;return(o&192)!==128?e<<3|1:((e&7)<<18|(t&63)<<12|(s&63)<<6|o&63)<<3|4}else return e<<3|1}index(n,e){e+=this.start;const t=this.indexOf(this.bytes,n.prefixUTF8,e);return t<0?t:t-e}context(n){n+=this.start;let e=-1;if(n>this.start&&n<=this.end){let s=n-1;if(e=this.bytes[s--],e>=128){let o=n-4;for(o<this.start&&(o=this.start);s>=o&&(this.bytes[s]&192)===128;)s--;s<this.start&&(s=this.start),e=this.step(s-this.start)>>3}}const t=n<this.end?this.step(n-this.start)>>3:-1;return Bt.emptyOpContext(e,t)}indexOf(n,e,t=0){let s=e.length;if(s===0)return t<=this.end?t:-1;const o=e[0];let l=this.end-s;const u=typeof n.indexOf=="function";let h=t;for(;h<=l;){if(u){if(h=n.indexOf(o,h),h===-1||h>l)return-1}else{for(;h<=l&&n[h]!==o;)h++;if(h>l)return-1}let f=!0;for(let p=1;p<s;p++)if(n[h+p]!==e[p]){f=!1;break}if(f)return h;h++}return-1}prefixLength(n){return n.prefixUTF8.length}},aM=class extends fi{constructor(n,e=0,t=n.length){super(),this.charSequence=n,this.start=e,this.end=t}hasString(n,e){const t=this.charSequence.indexOf(n.str,this.start+e);return t!==-1&&t<=this.end-n.str.length}hasAnyString(n,e){return n.ac16?n.ac16.searchUTF16(this.charSequence,this.start+e,this.end):!1}step(n){if(n+=this.start,n>=this.end)return fi.EOF();const e=this.charSequence.charCodeAt(n);if(e<it.MIN_HIGH_SURROGATE||e>it.MAX_HIGH_SURROGATE||n+1>=this.end)return e<<3|1;const t=this.charSequence.charCodeAt(n+1);return t>=it.MIN_LOW_SURROGATE&&t<=it.MAX_LOW_SURROGATE?(e-it.MIN_HIGH_SURROGATE)*1024+(t-it.MIN_LOW_SURROGATE)+it.MIN_SUPPLEMENTARY_CODE_POINT<<3|2:e<<3|1}index(n,e){e+=this.start;const t=this.charSequence.indexOf(n.prefix,e);return t<0||t>this.end-n.prefix.length?-1:t-e}context(n){n+=this.start;const e=n>this.start&&n<=this.end?this.charSequence.charCodeAt(n-1):-1,t=n<this.end?this.charSequence.charCodeAt(n):-1;return Bt.emptyOpContext(e,t)}prefixLength(n){return n.prefix.length}},ps=class{static fromUTF8(n,e=0,t=n.length){return new iM(n,e,t)}static fromUTF16(n,e=0,t=n.length){return new aM(n,e,t)}}
1034,rp=class extends Error{constructor(n){super(n),this.name="RE2JSException"}},ds=class extends rp{constructor(n,e=null){let t=`error parsing regexp: ${n}`;e&&(t+=`: \`${e}\``),super(t),this.name="RE2JSSyntaxException",this.message=t,this.error=n,this.input=e}getDescription(){return this.error}getPattern(){return this.input}},oM=class extends rp{constructor(n){super(n),this.name="RE2JSCompileException"}},wi=class extends rp{constructor(n){super(n),this.name="RE2JSGroupException"}},lM=class extends rp{constructor(n){super(n),this.name="RE2JSFlagsException"}},dm=class extends rp{constructor(n){super(n),this.name="RE2JSInternalException"}},Tu,ZE=(Tu=class{static quoteReplacement(e,t=!1){return t?e.indexOf("\\")<0&&e.indexOf("$")<0?e:e.split("").map(s=>{const o=s.codePointAt(0);return o===Ne.CODES.get("\\")||o===Ne.CODES.get("$")?`\\${s}`:s}).join(""):e.indexOf("$")<0?e:e.split("").map(s=>s.codePointAt(0)===Ne.CODES.get("$")?"$$":s).join("")}constructor(e,t){if(e===null)throw new Error("pattern is null");this.patternInput=e;const s=this.patternInput.re2();this.patternGroupCount=s.numberOfCapturingGroups(),this.groups=[],this.namedGroups=s.namedGroups,this.numberOfInstructions=s.numberOfInstructions(),t instanceof Fu?this.resetMatcherInput(t):Bt.isByteArray(t)?this.resetMatcherInput(wu.utf8(t)):this.resetMatcherInput(wu.utf16(t))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(e){if(e===null)throw new Error("input is null");return e instanceof Fu||(Bt.isByteArray(e)?e=wu.utf8(e):e=wu.utf16(e)),this.matcherInput=e,this.reset(),this}start(e=0){if(typeof e=="string"){const t=this.namedGroups[e];if(!Number.isFinite(t))throw new wi(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e]}end(e=0){if(typeof e=="string"){const t=this.namedGroups[e];if(!Number.isFinite(t))throw new wi(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e+1]}programSize(){return this.numberOfInstructions}group(e=0){if(typeof e=="string"){const o=this.namedGroups[e];if(!Number.isFinite(o))throw new wi(`group '${e}' not found`);e=o}const t=this.start(e),s=this.end(e);return t<0&&s<0?null:this.substring(t,s)}getNamedGroups(){if(!this.hasMatch)throw new wi("perhaps no match attempted");const e=Object.create(null);for(const t of Object.keys(this.namedGroups))e[t]=this.group(t);return e}groupCount(){return this.patternGroupCount}loadGroup(e){if(e<0||e>this.patternGroupCount)throw new wi(`Group index out of bounds: ${e}`);if(!this.hasMatch)throw new wi("perhaps no match attempted");if(e===0||this.hasGroups)return;const t=this.matcherInputLength,s=this.patternInput.re2().matchMachineInput(this.matcherInput,this.groups[0],t,this.anchorFlag,1+this.patternGroupCount);if(!s[0])throw new wi("inconsistency in matching group data");this.groups=s[1],this.hasGroups=!0}matches(){return this.genMatch(0,Fe.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,Fe.ANCHOR_START)}find(e=null){if(e!==null){if(e<0||e>this.matcherInputLength)throw new wi(`start index out of bounds: ${e}`);return this.reset(),this.genMatch(e,0)}if(e=0,this.hasMatch&&(e=this.groups[1],this.groups[0]===this.groups[1])){const t=(this.matcherInput.isUTF16Encoding()?ps.fromUTF16(this.matcherInput.asCharSequence(),0,this.matcherInputLength):ps.fromUTF8(this.matcherInput.asBytes(),0,this.matcherInputLength)).step(e);t<0?e++:e+=t&7}return this.genMatch(e,Fe.UNANCHORED)}genMatch(e,t){const s=this.patternInput.re2().matchMachineInput(this.matcherInput,e,this.matcherInputLength,t,1);return s[0]?(this.groups=s[1],this.hasMatch=!0,this.hasGroups=this.patternGroupCount===0,this.anchorFlag=t,!0):(this.hasMatch=!1,!1)}substring(e,t){return this.matcherInput.isUTF8Encoding()?Bt.utf8ByteArrayToString(this.matcherInput.asBytes().slice(e,t)):this.matcherInput.asCharSequence().substring(e,t).toString()}inputLength(){return this.matcherInputLength}appendReplacement(e,t=!1){let s="";const o=this.start(),l=this.end();return this.appendPos<o&&(s+=this.substring(this.appendPos,o)),this.appendPos=l,s+=t?this.appendReplacementInternalJava(e):this.appendReplacementInternalJs(e),s}appendReplacementInternalJava(e){let t="",s=0;const o=e.length;let l=0;for(;l<o;){const u=e.codePointAt(l);if(u===Ne.CODES.get("\\")){if(s<l&&(t+=e.substring(s,l)),l++,l>=o)throw new wi("character to be escaped is missing");s=l,l++;continue}if(u===Ne.CODES.get("$")){if(s<l&&(t+=e.substring(s,l)),l+1>=o)throw new wi("Illegal group reference: group index is missing");const h=e.codePointAt(l+1);if(Ne.CODES.get("0")<=h&&h<=Ne.CODES.get("9")){let f=h-Ne.CODES.get("0"),p=l+2;for(;p<o;p++){const b=e.codePointAt(p);if(b<Ne.CODES.get("0")||b>Ne.CODES.get("9")||f*10+b-Ne.CODES.get("0")>this.patternGroupCount)break;f=f*10+b-Ne.CODES.get("0")}if(f>this.patternGroupCount)throw new wi(`n > number of groups: ${f}`);const x=this.group(f);x!==null&&(t+=x),l=p,s=l}else if(h===Ne.CODES.get("{")){let f=l+2;for(;f<o&&e.codePointAt(f)!==Ne.CODES.get("}");)f++;if(f>=o)throw new wi("named capture group is missing trailing '}'");const p=e.substring(l+2,f),x=this.group(p);x!==null&&(t+=x),l=f+1,s=l}else throw new wi("Illegal group reference");continue}l++}return s<o&&(t+=e.substring(s,o)),t}appendReplacementInternalJs(e){let t="",s=0;const o=e.length;for(let l=0;l<o-1;l++)if(e.codePointAt(l)===Ne.CODES.get("$")){let u=e.codePointAt(l+1);if(Ne.CODES.get("$")===u){s<l&&(t+=e.substring(s,l)),t+="$",l++,s=l+1;continue}else if(Ne.CODES.get("&")===u){s<l&&(t+=e.substring(s,l));const h=this.group(0);h!==null?t+=h:t+="$&",l++,s=l+1;continue}else if(Ne.CODES.get("`")===u){s<l&&(t+=e.substring(s,l)),t+=this.substring(0,this.start(0)),l++,s=l+1;continue}else if(Ne.CODES.get("'")===u){s<l&&(t+=e.substring(s,l)),t+=this.substring(this.end(0),this.matcherIn
1034putLength),l++,s=l+1;continue}else if(Ne.CODES.get("1")<=u&&u<=Ne.CODES.get("9")){let h=u-Ne.CODES.get("0");for(s<l&&(t+=e.substring(s,l)),l+=2;l<o&&(u=e.codePointAt(l),!(u<Ne.CODES.get("0")||u>Ne.CODES.get("9")||h*10+u-Ne.CODES.get("0")>this.patternGroupCount));l++)h=h*10+u-Ne.CODES.get("0");if(h>this.patternGroupCount){t+=`$${h}`,s=l,l--;continue}const f=this.group(h);f!==null&&(t+=f),s=l,l--;continue}else if(u===Ne.CODES.get("<")){s<l&&(t+=e.substring(s,l)),l++;let h=l+1;for(;h<e.length&&e.codePointAt(h)!==Ne.CODES.get(">")&&e.codePointAt(h)!==Ne.CODES.get(" ");)h++;if(h===e.length||e.codePointAt(h)!==Ne.CODES.get(">")){t+=e.substring(l-1,h+1),s=h+1,l=h;continue}const f=e.substring(l+1,h);if(Object.prototype.hasOwnProperty.call(this.namedGroups,f)){const p=this.group(f);p!==null&&(t+=p)}else t+=`$<${f}>`;s=h+1,l=h;continue}}return s<o&&(t+=e.substring(s,o)),t}appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}replaceAll(e,t=!1){return this.replace(e,!0,t)}replaceFirst(e,t=!1){return this.replace(e,!1,t)}replace(e,t=!0,s=!1){let o="";this.reset();const l=typeof e=="function",u=Object.keys(this.namedGroups).length>0;let h=null;if(l){if(this.groupCount()>=Tu.MAX_REPLACER_ARGS)throw new wi("Too many capture groups to safely invoke replacer function");h=this.matcherInput.isUTF8Encoding()?this.matcherInput.asBytes():this.matcherInput.asCharSequence()}for(;this.find()&&(o+=l?this.appendReplacementFunc(e,u,h):this.appendReplacement(e,s),!!t););return o+=this.appendTail(),o}appendReplacementFunc(e,t,s){let o="";const l=this.start(),u=this.end();this.appendPos<l&&(o+=this.substring(this.appendPos,l)),this.appendPos=u;const h=this.buildReplacerArgs(l,t,s);return o+=String(e(...h)),o}buildReplacerArgs(e,t,s){const o=[this.group(0)],l=this.groupCount();for(let u=1;u<=l;u++){const h=this.start(u);h<0?o.push(void 0):o.push(this.substring(h,this.end(u)))}if(o.push(e),o.push(s),t){const u=this.getNamedGroups();for(const h in u)u[h]===null&&(u[h]=void 0);o.push(u)}return o}},ze(Tu,"MAX_REPLACER_ARGS",65535),Tu),yn,Se=(yn=class{static isRuneOp(e){return yn.RUNE<=e&&e<=yn.RUNE_ANY_NOT_NL}static escapeRunes(e){let t='"';for(let s of e)t+=Bt.escapeRune(s);return t+='"',t}constructor(e){this.op=e,this.out=0,this.arg=0,this.runes=[],this.next=null}matchRune(e){if(this.runes.length===1){const u=this.runes[0];return(this.arg&Fe.FOLD_CASE)!==0?it.equalsIgnoreCase(u,e):e===u}const t=this.runes.length;if(t===0)return!1;if(t===2||t===4||t===6||t===8){for(let u=0;u<t;u+=2){if(e<this.runes[u])return!1;if(e<=this.runes[u+1])return!0}return!1}let s=0,o=t>>1;for(;o>1;){const u=o>>1;s+=this.runes[s+u<<1]<=e?u:0,o-=u}s+=this.runes[s<<1]<=e?1:0;const l=s-1;return l>=0&&e<=this.runes[l<<1|1]}matchRunePos(e){if(this.runes.length===1){const u=this.runes[0];return(this.arg&Fe.FOLD_CASE)!==0?it.equalsIgnoreCase(u,e)?0:-1:e===u?0:-1}const t=this.runes.length;if(t===0)return-1;if(t===2||t===4||t===6||t===8){for(let u=0;u<t;u+=2){if(e<this.runes[u])return-1;if(e<=this.runes[u+1])return Math.floor(u/2)}return-1}let s=0,o=t>>1;for(;o>1;){const u=o>>1;s+=this.runes[s+u<<1]<=e?u:0,o-=u}s+=this.runes[s<<1]<=e?1:0;const l=s-1;return l>=0&&e<=this.runes[l<<1|1]?l:-1}toString(){switch(this.op){case yn.ALT:return`alt -> ${this.out}, ${this.arg}`;case yn.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case yn.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case yn.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case yn.MATCH:return`match${this.arg!==0?` ${this.arg}`:""}`;case yn.FAIL:return"fail";case yn.NOP:return`nop -> ${this.out}`;case yn.LB_WRITE:return`lbwrite ${this.arg} -> ${this.out}`;case yn.LB_CHECK:return`lbcheck ${this.arg} -> ${this.out}`;case yn.RUNE:return this.runes===null?"rune <null>":["rune ",yn.escapeRunes(this.runes),(this.arg&Fe.FOLD_CASE)!==0?"/i":""," -> ",this.out].join("");case yn.RUNE1:return`rune1 ${yn.escapeRunes(this.runes)} -> ${this.out}`;case yn.RUNE_ANY:return`any -> ${this.out}`;case yn.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},ze(yn,"ALT",1),ze(yn,"ALT_MATCH",2),ze(yn,"CAPTURE",3),ze(yn,"EMPTY_WIDTH",4),ze(yn,"FAIL",5),ze(yn,"MATCH",6),ze(yn,"NOP",7),ze(yn,"RUNE",8),ze(yn,"RUNE1",9),ze(yn,"RUNE_ANY",10),ze(yn,"RUNE_ANY_NOT_NL",11),ze(yn,"LB_WRITE",12),ze(yn,"LB_CHECK",13),yn),eN=class{constructor(n){this.sparse=new Int32Array(n),this.densePcs=new Int32Array(n),this.denseCaps=null,this.size=0,this.ncap=0}init(n){this.ncap=n;const e=this.densePcs.length*n;(!this.denseCaps||this.denseCaps.length<e)&&(this.denseCaps=new Int32Array(e))}contains(n){const e=this.sparse[n];return e<this.size&&this.densePcs[e]===n}isEmpty(){return this.size===0}add(n){const e=this.size++;return this.sparse[n]=e,this.densePcs[e]=n,e}clear(){this.size=0}toString(){let n="{";for(let e=0;e<this.size;e++)e!==0&&(n+=", "),n+=this.densePcs[e];return n+="}",n}},cM=class Fy{static fromRE2(e){const t=new Fy;return t.prog=e.prog,t.re2=e,t.q0=new eN(t.prog.numInst()),t.q1=new eN(t.prog.numInst()),t.matched=!1,t.matchcap=new Int32Array(t.prog.numCap<2?2:t.prog.numCap),t.ncap=0,t}static fromMachine(e){return Fy.fromRE2(e.re2)}constructor(){this.prog=null,this.re2=null,this.q0=null,this.q1=null,this.matched=!1,this.matchcap=null,this.ncap=0,this.lbTable=null}init(e){this.ncap=e,e>this.matchcap.length?this.matchcap=new Int32Array(e).fill(-1):this.matchcap.fill(-1),this.q0.init(e),this.q1.init(e),this.prog.numLb>0&&((!this.lbTable||this.lbTable.length<this.prog.numLb+1)&&(this.lbTable=new Int32Array(this.prog.numLb+1)),this.lbTable.fill(-1))}submatches(){return this.ncap===0?Bt.emptyInts():Bt.toArray(this.matchcap.subarray(0,this.ncap))}match(e,t,s){const o=this.re2.cond;if(o===Bt.EMPTY_ALL||(s===Fe.ANCHOR_START||s===Fe.ANCHOR_BOTH)&&t!==0)return!1;this.matched=!1,this.matchcap.fill(-1);let l=this.prog.numLb>0?0:t,u=t,h=this.q0,f=this.q1,p=e.step(l),x=p>>3,b=p&7,C=-1,N=0;p!==fi.EOF()&&(p=e.step(l+b),C=p>>3,N=p&7);let T;for(l===0?T=Bt.emptyOpContext(-1,x):T=e.context(l);;){if(h.isEmpty()){if((o&Bt.EMPTY_BEGIN_TEXT)!==0&&l!==0||(s===Fe.ANCHOR_START||s===Fe.ANCHOR_BOTH)&&l!==0||this.matched)break;if(this.prog.numLb===0&&this.re2.prefix.length!==0&&C!==this.re2.prefixRune&&e.canCheckPrefix()){const U=e.index(this.re2,l);if(U<0)break;l+=U,p=e.step(l),x=p>>3,b=p&7,p=e.step(l+b),C=p>>3,N=p&7,T=e.context(l)}}if(l===0&&this.prog.numLb>0)for(let U=0;U<this.prog.lbStarts.length;U++)this.add(h,this.prog.lbStarts[U],l,this.matchcap,0,T);!this.matched&&(l===0||s===Fe.UNANCHORED)&&l>=u&&(this.ncap>0&&(this.matchcap[0]=l),this.add(h,this.prog.start,l,this.matchcap,0,T));const R=l+b;if(T=e.context(R),this.step(h,f,l,R,x,T,s,l===e.endPos()),b===0||this.ncap===0&&this.matched)break;l+=b,x=C,b=N,x!==-1&&(p=e.step(l+b),C=p>>3,N=p&7);const A=h;h=f,f=A}return f.clear(),this.matched}matchSet(e,t,s){const o=this.re2.cond;if(o===Bt.EMPTY_ALL)return[];if((s===Fe.ANCHOR_START||s===Fe.ANCHOR_BOTH)&&t!==0)return[];let l=this.prog.numLb>0?0:t,u=t,h=this.q0,f=this.q1,p=e.step(l),x=p>>3,b=p&7,C=-1,N=0;p!==fi.EOF()&&(p=e.step(l+b),C=p>>3,N=p&7);let T=l===0?Bt.emptyOpContext(-1,x):e.context(l);const R=new Set;for(;!(h.isEmpty()&&((o&Bt.EMPTY_BEGIN_TEXT)!==0&&l!==0||(s===Fe.ANCHOR_START||s===Fe.ANCHOR_BOTH)&&l!==0));){if(l===0&&this.prog.numLb>0)for(let M=0;M<this.prog.lbStarts.length;M++)this.add(h,this.prog.lbStarts[M],l,this.matchcap,0,T);(l===0||s===Fe.UNANCHORED)&&l>=u&&this.add(h,this.prog.start,l,this.matchcap,0,T);const A=l+b;T=e.context(A);for(let M=0;M<h.size;M++){const V=h.densePcs[M],H=this.prog.inst[V],Q=M*this.ncap;let Y=!1;switch(H.op){case Se.MATCH:if(s===Fe.ANCHOR_BOTH&&l!==e.endPos())break;R.add(H.arg);break;case Se.RUNE:Y=H.matchRune(x);break;case Se.RUNE1:Y=x===H.runes[0];break;case Se.RUNE_ANY:Y=!0;break;case Se.RUNE_ANY_NOT_NL:Y=x!==10;break;default:continue}Y&&this.add(f,H.out,A,h.denseCaps,Q,T)}if(h.clear(),b===0)break;l+=b,x=C,b=N,x!==-1&&(p=e.step(l+b),C=p>>3,N=p&7);const U=h;
1034h=f,f=U}return f.clear(),Array.from(R).sort((A,U)=>A-U)}step(e,t,s,o,l,u,h,f){const p=this.re2.longest;for(let x=0;x<e.size;x++){const b=e.densePcs[x],C=x*this.ncap;if(p&&this.matched&&this.ncap>0&&this.matchcap[0]<e.denseCaps[C])continue;const N=this.prog.inst[b];let T=!1;switch(N.op){case Se.MATCH:if(h===Fe.ANCHOR_BOTH&&!f)break;if(this.ncap>0&&(!p||!this.matched||this.matchcap[1]<s)){e.denseCaps[C+1]=s;for(let R=0;R<this.ncap;R++)this.matchcap[R]=e.denseCaps[C+R]}p||(e.size=0),this.matched=!0;break;case Se.RUNE:T=N.matchRune(l);break;case Se.RUNE1:T=l===N.runes[0];break;case Se.RUNE_ANY:T=!0;break;case Se.RUNE_ANY_NOT_NL:T=l!==10;break;default:continue}T&&this.add(t,N.out,o,e.denseCaps,C,u)}e.clear()}add(e,t,s,o,l,u){for(;;){if(t===0||e.contains(t))return;const h=e.add(t),f=this.prog.inst[t];switch(f.op){case Se.FAIL:return;case Se.ALT:case Se.ALT_MATCH:this.add(e,f.out,s,o,l,u),t=f.arg;continue;case Se.EMPTY_WIDTH:if((f.arg&~u)===0){t=f.out;continue}return;case Se.NOP:t=f.out;continue;case Se.CAPTURE:if(f.arg<this.ncap){const p=o[l+f.arg];o[l+f.arg]=s,this.add(e,f.out,s,o,l,u),o[l+f.arg]=p;return}else{t=f.out;continue}case Se.LB_WRITE:this.lbTable[Math.abs(f.arg)]=s,t=f.out;continue;case Se.LB_CHECK:if(f.arg>0){if(this.lbTable[f.arg]===s){t=f.out;continue}}else if(this.lbTable[-f.arg]!==s){t=f.out;continue}return;case Se.MATCH:case Se.RUNE:case Se.RUNE1:case Se.RUNE_ANY:case Se.RUNE_ANY_NOT_NL:if(this.ncap>0){const p=h*this.ncap;for(let x=0;x<this.ncap;x++)e.denseCaps[p+x]=o[l+x]}return;default:throw new dm("unhandled")}}}};const tN=n=>{let e=-2128831035;for(let t=0;t<n.length;t++)e^=n[t],e=Math.imul(e,16777619);return e},uM=(n,e)=>{if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0};var dM=class{constructor(n,e,t=[]){this.nfaStates=n,this.isMatch=e,this.matchIDs=t,this.nextLatin1=new Array(it.MAX_LATIN1+1).fill(null),this.nextLatin1Anchored=new Array(it.MAX_LATIN1+1).fill(null),this.transKeys=[],this.transVals=[],this.lastSeen=0}},al,hM=(al=class{constructor(e,t=8388608){this.prog=e,this.stateCache=new Map,this.stateCount=0,this.startState=null,this.stateLimit=Math.max(1,Math.floor(t/al.STATE_MEMORY_ESTIMATE)),this.cacheClears=0,this.failed=!1,this.clock=0}computeClosure(e){const t=new Set,s=[...e];let o=!1;const l=[];for(;s.length>0;){const h=s.pop();if(t.has(h))continue;t.add(h);const f=this.prog.getInst(h);switch(f.op){case Se.MATCH:o=!0,l.includes(f.arg)||l.push(f.arg);break;case Se.ALT:case Se.ALT_MATCH:s.push(f.out),s.push(f.arg);break;case Se.NOP:case Se.CAPTURE:s.push(f.out);break;case Se.EMPTY_WIDTH:case Se.LB_WRITE:case Se.LB_CHECK:return null}}const u=Int32Array.from(t).sort();return l.sort((h,f)=>h-f),{pcs:u,isMatch:o,matchIDs:l}}getState(e){const t=this.computeClosure(e);if(!t)return null;const s=t.pcs,o=tN(s);let l=this.stateCache.get(o);if(l)for(let h=0;h<l.length;h++){const f=l[h];if(uM(f.nfaStates,s))return f.lastSeen=++this.clock,f}else l=[],this.stateCache.set(o,l);if(this.failed)return null;if(this.stateCount>=this.stateLimit){if(this.cacheClears++,this.cacheClears>=al.MAX_CACHE_CLEARS)return this.failed=!0,this.stateCache.clear(),this.stateCount=0,this.startState=null,null;this.evictCache(),l=this.stateCache.get(o),l||(l=[],this.stateCache.set(o,l))}const u=new dM(s,t.isMatch,t.matchIDs);return u.lastSeen=++this.clock,l.push(u),this.stateCount++,u}evictCache(){const e=[];for(const u of this.stateCache.values())for(let h=0;h<u.length;h++)e.push(u[h]);e.sort((u,h)=>u.lastSeen-h.lastSeen);const t=Math.max(1,Math.floor(this.stateLimit/2)),s=e.length-t,o=e.slice(s),l=new Set(o);this.stateCache.clear(),this.stateCount=0;for(let u=0;u<o.length;u++){const h=o[u];h.nextLatin1.fill(null),h.nextLatin1Anchored.fill(null),h.transKeys.length=0,h.transVals.length=0;const f=tN(h.nfaStates);let p=this.stateCache.get(f);p||(p=[],this.stateCache.set(f,p)),p.push(h),this.stateCount++}this.startState&&!l.has(this.startState)&&(this.startState=null)}step(e,t,s){if(t<=it.MAX_LATIN1)if(s===Fe.UNANCHORED){const u=e.nextLatin1[t];if(u!==null)return u}else{const u=e.nextLatin1Anchored[t];if(u!==null)return u}else{const u=t+(s===Fe.UNANCHORED?0:it.MAX_RUNE+1),h=e.transKeys,f=h.length;for(let p=0;p<f;p++)if(h[p]===u)return e.transVals[p]}const o=[];for(let u=0;u<e.nfaStates.length;u++){const h=e.nfaStates[u],f=this.prog.getInst(h);Se.isRuneOp(f.op)&&f.matchRune(t)&&o.push(f.out)}s===Fe.UNANCHORED&&o.push(this.prog.start);const l=this.getState(o);if(t<=it.MAX_LATIN1)s===Fe.UNANCHORED?e.nextLatin1[t]=l:e.nextLatin1Anchored[t]=l;else{const u=t+(s===Fe.UNANCHORED?0:it.MAX_RUNE+1);e.transKeys.push(u),e.transVals.push(l)}return l}match(e,t,s){if((s===Fe.ANCHOR_START||s===Fe.ANCHOR_BOTH)&&t!==0)return!1;if(!this.startState&&(this.startState=this.getState([this.prog.start]),!this.startState))return null;let o=e.endPos(),l=this.startState;if(l.isMatch)if(s===Fe.ANCHOR_BOTH){if(t===o)return!0}else return!0;let u=t;for(;u<o;){const h=e.step(u),f=h>>3,p=h&7;if(p===0)break;if(l=s===Fe.UNANCHORED&&f<=it.MAX_LATIN1&&l.nextLatin1[f]||this.step(l,f,s),l===null)return null;if(l.lastSeen=++this.clock,l.isMatch)if(s===Fe.ANCHOR_BOTH){if(u+p===o)return!0}else return!0;
1034if(l.nfaStates.length===0&&s!==Fe.UNANCHORED)return!1;u+=p}return!1}matchSet(e,t,s){if((s===Fe.ANCHOR_START||s===Fe.ANCHOR_BOTH)&&t!==0)return[];if(!this.startState&&(this.startState=this.getState([this.prog.start]),!this.startState))return null;let o=e.endPos(),l=this.startState;const u=new Set,h=(p,x)=>{p.isMatch&&(s===Fe.ANCHOR_BOTH?x===o&&p.matchIDs.forEach(b=>u.add(b)):p.matchIDs.forEach(b=>u.add(b)))};h(l,t);let f=t;for(;f<o;){const p=e.step(f),x=p>>3,b=p&7;if(b===0)break;if(l=s===Fe.UNANCHORED&&x<=it.MAX_LATIN1&&l.nextLatin1[x]||this.step(l,x,s),l===null)return null;if(l.lastSeen=++this.clock,f+=b,h(l,f),l.nfaStates.length===0&&s!==Fe.UNANCHORED)break}return Array.from(u).sort((p,x)=>p-x)}},ze(al,"MAX_CACHE_CLEARS",5),ze(al,"STATE_MEMORY_ESTIMATE",838),al);const fM=32,mM=500,HC=256,pM=256*1024;var BM=class{constructor(){this.end=0,this.cap=new Int32Array(0),this.matchcap=new Int32Array(0),this.ncap=0,this.jobPc=new Int32Array(HC),this.jobArg=new Uint8Array(HC),this.jobPos=new Int32Array(HC),this.jobLen=0,this.visited=new Uint32Array(0)}reset(n,e,t){this.end=e,this.jobLen=0,this.ncap=t;const s=n.numInst()*(e+1)+fM-1>>>5;this.visited.length<s?this.visited=new Uint32Array(s):this.visited.fill(0,0,s),this.cap.length<t?this.cap=new Int32Array(t).fill(-1):this.cap.fill(-1,0,t),this.matchcap.length<t?this.matchcap=new Int32Array(t).fill(-1):this.matchcap.fill(-1,0,t)}shouldVisit(n,e){const t=n*(this.end+1)+e,s=t>>>5,o=1<<(t&31);return(this.visited[s]&o)!==0?!1:(this.visited[s]|=o,!0)}push(n,e,t,s){if(n.prog.getInst(e).op!==Se.FAIL&&(s||this.shouldVisit(e,t))){if(this.jobLen>=this.jobPc.length){const o=this.jobPc.length*2,l=new Int32Array(o);l.set(this.jobPc),this.jobPc=l;const u=new Uint8Array(o);u.set(this.jobArg),this.jobArg=u;const h=new Int32Array(o);h.set(this.jobPos),this.jobPos=h}this.jobPc[this.jobLen]=e,this.jobArg[this.jobLen]=s?1:0,this.jobPos[this.jobLen]=t,this.jobLen++}}tryBacktrack(n,e,t,s,o){const l=n.longest;for(this.push(n,t,s,!1);this.jobLen>0;){this.jobLen--;let u=this.jobPc[this.jobLen],h=this.jobArg[this.jobLen]===1,f=this.jobPos[this.jobLen],p=!0;for(;!(!p&&!this.shouldVisit(u,f));){p=!1;const x=n.prog.getInst(u);switch(x.op){case Se.FAIL:throw new dm("unexpected InstFail");case Se.ALT:if(h){h=!1,u=x.arg;continue}else{this.push(n,u,f,!0),u=x.out;continue}case Se.ALT_MATCH:{const b=n.prog.getInst(x.out);if(Se.isRuneOp(b.op)){this.push(n,x.arg,f,!1),u=x.arg,f=this.end;continue}this.push(n,x.out,this.end,!1),u=x.out;continue}case Se.RUNE:{const b=e.step(f);if(b===fi.EOF()||!x.matchRune(b>>3))break;f+=b&7,u=x.out;continue}case Se.RUNE1:{const b=e.step(f);if(b===fi.EOF()||b>>3!==x.runes[0])break;f+=b&7,u=x.out;continue}case Se.RUNE_ANY_NOT_NL:{const b=e.step(f);if(b===fi.EOF()||b>>3===10)break;f+=b&7,u=x.out;continue}case Se.RUNE_ANY:{const b=e.step(f);if(b===fi.EOF())break;f+=b&7,u=x.out;continue}case Se.CAPTURE:if(h){this.cap[x.arg]=f;break}else{x.arg<this.ncap&&(this.push(n,u,this.cap[x.arg],!0),this.cap[x.arg]=f),u=x.out;continue}case Se.EMPTY_WIDTH:{const b=e.context(f);if((x.arg&~b)!==0)break;u=x.out;continue}case Se.NOP:u=x.out;continue;case Se.MATCH:{if(o===Fe.ANCHOR_BOTH&&f!==this.end)break;if(this.ncap===0)return!0;this.ncap>1&&(this.cap[1]=f);const b=this.matchcap[1];if((b===-1||l&&f>0&&f>b)&&this.matchcap.set(this.cap),!l||f===this.end)return!0;break}case Se.LB_WRITE:case Se.LB_CHECK:throw new dm("Backtracker cannot evaluate Lookbehind instructions");default:throw new dm("bad inst")}break}}return l&&this.matchcap.length>1&&this.matchcap[1]>=0}};const X0=[];var W0=class lT{static shouldBacktrack(e){return e.numInst()<=mM}static maxBitStateLen(e){return lT.shouldBacktrack(e)?Math.floor(pM/e.numInst()):0}static execute(e,t,s,o,l){const u=e.cond;if(u===Bt.EMPTY_ALL||(o===Fe.ANCHOR_START||o===Fe.ANCHOR_BOTH)&&s!==0||(u&Bt.EMPTY_BEGIN_TEXT)!==0&&s!==0)return null;const h=X0.length>0?X0.pop():new BM,f=t.endPos();h.reset(e.prog,f,l);let p=!1;if((u&Bt.EMPTY_BEGIN_TEXT)!==0||o===Fe.ANCHOR_START||o===Fe.ANCHOR_BOTH)h.ncap>0&&(h.cap[0]=s),h.tryBacktrack(e,t,e.prog.start,s,o)&&(p=!0);else{let b=-1;for(;s<=f&&b!==0;s+=b){if(e.prefix.length>0){const N=t.index(e,s);if(N<0)break;s+=N}if(h.ncap>0&&(h.cap[0]=s),h.tryBacktrack(e,t,e.prog.start,s,o)){p=!0;break}const C=t.step(s);b=C===fi.EOF()?0:C&7}}if(!p)return X0.push(h),null;const x=l===0?[]:Bt.toArray(h.matchcap.subarray(0,l));return X0.push(h),x}},nN=class{constructor(n){this.sparse=new Uint32Array(n),this.dense=new Uint32Array(n),this.size=0,this.nextIndex=0}empty(){return this.nextIndex>=this.size}next(){return this.dense[this.nextIndex++]}clear(){this.size=0,this.nextIndex=0}contains(n){return n<this.sparse.length&&this.sparse[n]<this.size&&this.dense[this.sparse[n]]===n}insert(n){this.contains(n)||this.insertNew(n)}insertNew(n){n>=this.sparse.length||(this.sparse[n]=this.size,this.dense[this.size]=n,this.size++)}};const gM=(n,e,t,s)=>{const o=n.length,l=e.length;let u=0,h=0;const f=[],p=[];let x=!0,b=-1;const C=N=>{const T=N?n:e,R=N?u:h,A=N?t:s;return b>0&&T[R]<=f[b]?!1:(f.push(T[R],T[R+1]),N?u+=2:h+=2,b+=2,p.push(A),!0)};for(;u<o||h<l;)if(h>=l?x=C(!0):u>=o||e[h]<n[u]?x=C(!1):x=C(!0),!x)return null;return{merged:f,next:p}};var xM=class{constructor(n){this.start=n.start,this.numCap=n.numCap,this.inst=new Array(n.inst.length);for(let e=0;e<n.inst.length;e++){const t=n.inst[e],s=new Se(t.op);s.out=t.out,s.arg=t.arg,s.runes=t.runes?t.runes.slice():[],s.next=null,this.inst[e]=s}}};const bM=n=>{const e=new xM(n);for(let t=0;t<e.inst.length;t++){const s=e.inst[t];if(s.op!==Se.ALT&&s.op!==Se.ALT_MATCH)continue;let o="out",l="arg",u=e.inst[s[l]];if(u.op!==Se.ALT&&u.op!==Se.ALT_MATCH&&(o="arg",l="out",u=e.inst[s[l]],u.op!==Se.ALT&&u.op!==Se.ALT_MATCH))continue;const h=e.inst[s[o]];if(h.op===Se.ALT||h.op===Se.ALT_MATCH)continue;let f="out",p="arg",x=!1;u.out===t?x=!0:u.arg===t&&(x=!0,f="arg",p="out"),x&&(u[f]=s[o]),s[o]===u[f]&&(s[l]=u[p])}return e},CM=n=>{if(n.inst.length>=1e3)return null;const e=new nN(n.inst.length),t=new nN(n.inst.length),s=new Array(n.inst.length),o=new Array(n.inst.length).fill(!1),l=u=>{let h=!0;const f=n.inst[u];
1034if(t.contains(u))return!0;switch(t.insert(u),f.op){case Se.ALT:case Se.ALT_MATCH:{h=l(f.out)&&l(f.arg);let p=o[f.out],x=o[f.arg];if(p&&x)return!1;if(x){const T=f.out;f.out=f.arg,f.arg=T;const R=p;p=x,x=R}p&&(o[u]=!0,f.op=Se.ALT_MATCH);const b=s[f.out]||[],C=s[f.arg]||[],N=gM(b,C,f.out,f.arg);if(!N)return!1;s[u]=N.merged,f.next=new Uint32Array(N.next);break}case Se.CAPTURE:case Se.EMPTY_WIDTH:case Se.NOP:h=l(f.out),o[u]=o[f.out],s[u]=s[f.out]?s[f.out].slice():[],f.next=new Uint32Array(Math.floor(s[u].length/2)+1).fill(f.out);break;case Se.MATCH:case Se.FAIL:o[u]=f.op===Se.MATCH;break;case Se.RUNE:{if(o[u]=!1,f.next&&f.next.length>0)break;if(e.insert(f.out),!f.runes||f.runes.length===0){s[u]=[],f.next=new Uint32Array([f.out]);break}let p=[];if(f.runes.length===1&&(f.arg&Fe.FOLD_CASE)!==0){const x=f.runes[0];p.push(x,x);for(let b=it.simpleFold(x);b!==x;b=it.simpleFold(b))p.push(b,b);p.sort((b,C)=>b-C)}else for(let x=0;x<f.runes.length;x++)p.push(f.runes[x]);s[u]=p,f.next=new Uint32Array(Math.floor(p.length/2)+1).fill(f.out),f.op=Se.RUNE;break}case Se.RUNE1:{if(o[u]=!1,f.next&&f.next.length>0)break;e.insert(f.out);let p=[];if((f.arg&Fe.FOLD_CASE)!==0){const x=f.runes[0];p.push(x,x);for(let b=it.simpleFold(x);b!==x;b=it.simpleFold(b))p.push(b,b);p.sort((b,C)=>b-C)}else p.push(f.runes[0],f.runes[0]);s[u]=p,f.next=new Uint32Array(Math.floor(p.length/2)+1).fill(f.out),f.op=Se.RUNE;break}case Se.RUNE_ANY:if(o[u]=!1,f.next&&f.next.length>0)break;e.insert(f.out),s[u]=[0,it.MAX_RUNE],f.next=new Uint32Array([f.out]);break;case Se.RUNE_ANY_NOT_NL:if(o[u]=!1,f.next&&f.next.length>0)break;e.insert(f.out),s[u]=[0,9,11,it.MAX_RUNE],f.next=new Uint32Array(Math.floor(s[u].length/2)+1).fill(f.out);break}return h};for(e.clear(),e.insert(n.start);!e.empty();)if(t.clear(),!l(e.next()))return null;for(let u=0;u<n.inst.length;u++)s[u]&&(n.inst[u].runes=s[u]);return n},yM=(n,e)=>{for(let t=0;t<e.inst.length;t++){const s=e.inst[t];switch(s.op){case Se.ALT:case Se.ALT_MATCH:case Se.RUNE:break;case Se.CAPTURE:case Se.EMPTY_WIDTH:case Se.NOP:case Se.MATCH:case Se.FAIL:n.inst[t].next=null;break;case Se.RUNE1:case Se.RUNE_ANY:case Se.RUNE_ANY_NOT_NL:n.inst[t].next=null,n.inst[t].op=s.op,n.inst[t].runes=s.runes?s.runes.slice():[];break}}};var sN=class cT{static compile(e){if(e.start===0||e.numLb>0)return null;const t=e.inst[e.start];if(t.op!==Se.EMPTY_WIDTH||(t.arg&Bt.EMPTY_BEGIN_TEXT)===0)return null;let s=!1;for(let l=0;l<e.inst.length;l++)if(e.inst[l].op===Se.ALT||e.inst[l].op===Se.ALT_MATCH){s=!0;break}for(let l=0;l<e.inst.length;l++){const u=e.inst[l],h=e.inst[u.out].op;switch(u.op){case Se.ALT:case Se.ALT_MATCH:if(h===Se.MATCH||e.inst[u.arg].op===Se.MATCH)return null;break;case Se.EMPTY_WIDTH:if(h===Se.MATCH){if((u.arg&Bt.EMPTY_END_TEXT)===Bt.EMPTY_END_TEXT)continue;return null}break;default:if(h===Se.MATCH&&s)return null;break}}let o=bM(e);return o=CM(o),o!==null&&yM(o,e),o}static next(e,t){const s=e.matchRunePos(t);return s>=0?e.next[s]:e.op===Se.ALT_MATCH?e.out:0}static execute(e,t,s,o,l){const u=e.onepass;if(!u)return null;const h=new Int32Array(l).fill(-1);let f=!1,p=t.step(s),x=p>>3,b=p&7,C=fi.EOF(),N=-1,T=0;p!==fi.EOF()&&(C=t.step(s+b),C!==fi.EOF()&&(N=C>>3,T=C&7));let R=s===0?Bt.emptyOpContext(-1,x):t.context(s),A=u.start,U;for(;;){switch(U=u.inst[A],A=U.out,U.op){case Se.MATCH:return o===Fe.ANCHOR_BOTH&&s!==t.endPos()?null:(f=!0,h.length>0&&(h[0]=0,h[1]=s),l===0?[]:Bt.toArray(h));case Se.RUNE:if(!U.matchRune(x))return null;break;case Se.RUNE1:if(x!==U.runes[0])return null;break;case Se.RUNE_ANY:break;case Se.RUNE_ANY_NOT_NL:if(x===10)return null;break;case Se.ALT:case Se.ALT_MATCH:A=cT.next(U,x);continue;case Se.FAIL:return null;case Se.NOP:continue;case Se.EMPTY_WIDTH:if((U.arg&~R)!==0)return null;continue;case Se.CAPTURE:U.arg<h.length&&(h[U.arg]=s);continue;default:throw new dm("bad inst")}if(b===0)break;R=Bt.emptyOpContext(x,N),s+=b,x=N,b=T,x!==-1&&(C=t.step(s+b),C!==fi.EOF()?(N=C>>3,T=C&7):(N=-1,T=0))}return f?l===0?[]:Bt.toArray(h):null}},bt,re=(bt=class{static isPseudoOp(e){return e>=bt.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(e){return e===Ne.CODES.get("-")?"\\":""}static fromRegexp(e){const t=new bt(e.op);return t.flags=e.flags,t.subs=e.subs,t.runes=e.runes,t.cap=e.cap,t.min=e.min,t.max=e.max,t.name=e.name,t.namedGroups=e.namedGroups,t.lb=e.lb,t}constructor(e){this.op=e,this.flags=0,this.subs=bt.emptySubs(),this.runes=[],this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}reinit(){this.flags=0,this.subs=bt.emptySubs(),this.runes=[],this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}toString(){return this.appendTo()}appendTo(){let e="";switch(this.op){case bt.Op.NO_MATCH:e+="[^\\x00-\\x{10FFFF}]";break;case bt.Op.EMPTY_MATCH:e+="(?:)";break;case bt.Op.STAR:case bt.Op.PLUS:case bt.Op.QUEST:case bt.Op.REPEAT:{const t=this.subs[
10340];switch(t.op>bt.Op.CAPTURE||t.op===bt.Op.LITERAL&&t.runes.length>1?e+=`(?:${t.appendTo()})`:e+=t.appendTo(),this.op){case bt.Op.STAR:e+="*";break;case bt.Op.PLUS:e+="+";break;case bt.Op.QUEST:e+="?";break;case bt.Op.REPEAT:e+=`{${this.min}`,this.min!==this.max&&(e+=",",this.max>=0&&(e+=this.max)),e+="}";break}(this.flags&Fe.NON_GREEDY)!==0&&(e+="?");break}case bt.Op.CONCAT:for(let t of this.subs)t.op===bt.Op.ALTERNATE?e+=`(?:${t.appendTo()})`:e+=t.appendTo();break;case bt.Op.ALTERNATE:{let t="";for(let s of this.subs)e+=t,t="|",e+=s.appendTo();break}case bt.Op.LITERAL:(this.flags&Fe.FOLD_CASE)!==0&&(e+="(?i:");for(let t of this.runes)e+=Bt.escapeRune(t);(this.flags&Fe.FOLD_CASE)!==0&&(e+=")");break;case bt.Op.ANY_CHAR_NOT_NL:e+="(?-s:.)";break;case bt.Op.ANY_CHAR:e+="(?s:.)";break;case bt.Op.PLB:e+=`(?<=${this.subs[0].appendTo()})`;break;case bt.Op.NLB:e+=`(?<!${this.subs[0].appendTo()})`;break;case bt.Op.CAPTURE:this.name===null||this.name.length===0?e+="(":e+=`(?P<${this.name}>`,this.subs[0].op!==bt.Op.EMPTY_MATCH&&(e+=this.subs[0].appendTo()),e+=")";break;case bt.Op.BEGIN_TEXT:e+="\\A";break;case bt.Op.END_TEXT:(this.flags&Fe.WAS_DOLLAR)!==0?e+="(?-m:$)":e+="\\z";break;case bt.Op.BEGIN_LINE:e+="^";break;case bt.Op.END_LINE:e+="$";break;case bt.Op.WORD_BOUNDARY:e+="\\b";break;case bt.Op.NO_WORD_BOUNDARY:e+="\\B";break;case bt.Op.CHAR_CLASS:if(this.runes.length%2!==0){e+="[invalid char class]";break}if(e+="[",this.runes.length===0)e+="^\\x00-\\x{10FFFF}";else if(this.runes[0]===0&&this.runes[this.runes.length-1]===it.MAX_RUNE){e+="^";for(let t=1;t<this.runes.length-1;t+=2){const s=this.runes[t]+1,o=this.runes[t+1]-1;e+=bt.quoteIfHyphen(s),e+=Bt.escapeRune(s),s!==o&&(e+="-",e+=bt.quoteIfHyphen(o),e+=Bt.escapeRune(o))}}else for(let t=0;t<this.runes.length;t+=2){const s=this.runes[t],o=this.runes[t+1];e+=bt.quoteIfHyphen(s),e+=Bt.escapeRune(s),s!==o&&(e+="-",e+=bt.quoteIfHyphen(o),e+=Bt.escapeRune(o))}e+="]";break;default:e+=this.op;break}return e}maxCap(){let e=0;if(this.op===bt.Op.CAPTURE&&(e=this.cap),this.subs!==null)for(let t of this.subs){const s=t.maxCap();e<s&&(e=s)}return e}equals(e){if(!(e!==null&&e instanceof bt)||this.op!==e.op)return!1;switch(this.op){case bt.Op.END_TEXT:if((this.flags&Fe.WAS_DOLLAR)!==(e.flags&Fe.WAS_DOLLAR))return!1;break;case bt.Op.LITERAL:case bt.Op.CHAR_CLASS:if(this.runes===null&&e.runes===null)break;if(this.runes===null||e.runes===null||this.runes.length!==e.runes.length)return!1;for(let t=0;t<this.runes.length;t++)if(this.runes[t]!==e.runes[t])return!1;break;case bt.Op.ALTERNATE:case bt.Op.CONCAT:if(this.subs.length!==e.subs.length)return!1;for(let t=0;t<this.subs.length;++t)if(!this.subs[t].equals(e.subs[t]))return!1;break;case bt.Op.STAR:case bt.Op.PLUS:case bt.Op.QUEST:if((this.flags&Fe.NON_GREEDY)!==(e.flags&Fe.NON_GREEDY)||!this.subs[0].equals(e.subs[0]))return!1;break;case bt.Op.REPEAT:if((this.flags&Fe.NON_GREEDY)!==(e.flags&Fe.NON_GREEDY)||this.min!==e.min||this.max!==e.max||!this.subs[0].equals(e.subs[0]))return!1;break;case bt.Op.CAPTURE:if(this.cap!==e.cap||(this.name===null?e.name!==null:this.name!==e.name)||!this.subs[0].equals(e.subs[0]))return!1;break;case bt.Op.PLB:case bt.Op.NLB:if(this.lb!==e.lb||!this.subs[0].equals(e.subs[0]))return!1;break}return!0}},ze(bt,"Op",oT(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","PLB","NLB","LEFT_PAREN","VERTICAL_BAR"])),bt),rN=class{constructor(n){this.next=[Object.create(null)],this.fail=[0],this.match=[!1];for(const t of n){let s=0;for(let o=0;o<t.length;o++){const l=t[o];l in this.next[s]||(this.next.push(Object.create(null)),this.fail.push(0),this.match.push(!1),this.next[s][l]=this.next.length-1),s=this.next[s][l]}this.match[s]=!0}const e=[];for(const t in this.next[0])if(Object.prototype.hasOwnProperty.call(this.next[0],t)){const s=this.next[0][t];this.fail[s]=0,e.push(s)}for(;e.length>0;){const t=e.shift();for(const s in this.next[t])if(Object.prototype.hasOwnProperty.call(this.next[t],s)){const o=this.next[t][s];let l=this.fail[t];for(;l!==0&&!(s in this.next[l]);)l=this.fail[l];s in this.next[l]?this.fail[o]=this.next[l][s]:this.fail[o]=0,this.match[o]=this.match[o]||this.match[this.fail[o]],e.push(o)}}}searchUTF16(n,e,t){let s=0;for(let o=e;o<t;o++){const l=n.charCodeAt(o);for(;s!==0&&!(l in this.next[s]);)s=this.fail[s];if(l in this.next[s]&&(s=this.next[s][l]),this.match[s])return!0}return!1}searchUTF8(n,e,t){let s=0;for(let o=e;o<t;o++){const l=n[o];for(;s!==0&&!(l in this.next[s]);)s=this.fail[s];if(l in this.next[s]&&(s=this.next[s][l]),this.match[s])return!0}return!1}},Eo,kn=(Eo=class{constructor(e){this.type=e,this.subs=[],this.str="",this.bytes=null,this.ac16=null,this.ac8=null}eval(e,t){switch(this.type){case Eo.Type.NONE:return!0;case Eo.Type.EXACT:return e.hasString(this,t);case Eo.Type.AND:for(let s=0;s<this.subs.length;s++)if(!this.subs[s].eval(e,t))return!1;return!0;case Eo.Type.OR:if(this.ac16&&this.ac8)return e.hasAnyString(this,t);for(let s=0;s<this.subs.length;s++)if(this.subs[s].eval(e,t))return!0;return!1;default:return!0}}},ze(Eo,"Type",{NONE:0,EXACT:1,AND:2,OR:3}),Eo),vM=class sl{static build(e){const t=sl.fromRegexp(e);return sl.simplify(t)}static fromRegexp(e){if(!e)return new kn(kn.Type.NONE);switch(e.op){case re.Op.PLB:case re.Op.NLB:case re.Op.NO_MATCH:case re.Op.EMPTY_MATCH:case re.Op.BEGIN_LINE:case re.Op.END_LINE:case re.Op.BEGIN_TEXT:case re.Op.END_TEXT:case re.Op.WORD_BOUNDARY:case re.Op.NO_WORD_BOUNDARY:case re.Op.CHAR_CLASS:case re.Op.ANY_CHAR_NOT_NL:case re.Op.ANY_CHAR:return new kn(kn.Type.NONE);case re.Op.LITERAL:{if(e.runes.length===0||(e.flags&Fe.FOLD_CASE)!==0)return new kn(kn.Type.NONE);const t=new kn(kn.Type.EXACT);let s="";for(let o=0;o<e.runes.length;o++)s+=String.fromCodePoint(e.runes[o]);return t.str=s,t.bytes=Bt.stringToUtf8ByteArray(t.str),t}case re.Op.CAPTURE:case re.Op.PLUS:return sl.fromRegexp(e.subs[0]);case re.Op.REPEAT:return e.min>=1?sl.fromRegexp(e.subs[0]):new kn(kn.Type.NONE);case re.Op.CONCAT:{const t=new kn(kn.Type.AND);for(const s of e.subs)t.subs.push(sl.fromRegexp(s));return t}case re.Op.ALTERNATE:{const t=new kn(kn.Type.OR);for(const s of e.subs)t.subs.push(sl.fromRegexp(s));return t}default:return new kn(kn.Type.NONE)}}static simplify(e){if(e.type===kn.Type.EXACT||e.type===kn.Type.NONE)return e;if(e.type===kn.Type.AND){const t=[];for(const s of e.subs){const o=sl.simplify(s);if(o.type!==kn.Type.NONE)if(o.type===kn.Type.AND)for(let l=0;l<o.subs.length;l++)t.push(o.subs[l]);else t.push(o)}return t.length===0?new kn(kn.Type.NONE):t.length===1?t[0]:(e.subs=t,e)}if(e.type===kn.Type.OR){const t=[];for(const u of e.subs){const h=sl.simplify(u);if(h.type===kn.Type.NONE)return new kn(kn.Type.NONE);if(h.type===kn.Type.OR)for(let f=0;f<h.subs.length;f++)t.push(h.subs[f]);else t.push(h)}if(t.length===0)return new kn(kn.Type.NONE);if(t.length===1)return t[0];const s=new Set,o=[];for(const u of t)u.type===kn.Type.EXACT?s.has(u.str)||(s.add(u.str),o.push(u)):o.push(u);e.subs=o;let l=!0;for(const u of o)if(u.type!==kn.Type.EXACT){l=!1;break}return l&&o.length>1&&(e.ac16=new rN(o.map(u=>{const h=[];for(let f=0;f<u.str.length;f++)h.push(u.str.charCodeAt(f));return h})),e.ac8=new rN(o.map(u=>u.bytes))),e}return e}},Ca=class{constructor(n=0,e=0){this.head=n,this.tail=e}},_M=class{constructor(){this.inst=[],this.start=0,this.numCap=2,this.lbStarts=[],this.numLb=0}getInst(n){return this.inst[n]}numInst(){return this.inst.length}addInst(n){this.inst.push(new Se(n))}skipNop(n){let e=this.inst[n];for(;e.op===Se.NOP||e.op===Se.CAPTURE;)e=this.inst[n],n=e.out;return e}prefix(){let n="",e=this.skipNop(this.start);if(!Se.isRuneOp(e.op)||e.runes.length!==1)return[e.op===Se.MATCH,n];for(;Se.isRuneOp(e.op)&&e.runes.length===1&&(e.arg&Fe.FOLD_CASE)===0;)n+=String.fromCodePoint(e.runes[0]),e=this.skipNop(e.out);return[e.op===Se.MATCH,n]}startCond(){let n=0,e=this.start;e:for(;;){const t=this.inst[e];switch(t.op){case Se.EMPTY_WIDTH:n|=t.arg;break;case Se.FAIL:return-1;case Se.CAPTURE:case Se.NOP:break;default:break e}e=t.out}return n}patch(n,e){let t=n.head;for(;t!==0;){const s=this.inst[t>>1];(t&1)===0?(t=s.out,s.out=e):(t=s.arg,s.arg=e)}}append(n,e){if(n.head===0)return e;if(e.head===0)return n;const t=this.inst[n.tail>>1];return(n.tail&1)===0?t.out=e.head:t.arg=e.head,new Ca(n.head,e.tail)}toString(){let n="";for(let e=0;e<this.inst.length;e++){const t=n.length;n+=e,e===this.start&&(n+="*"),n+=" ".substring(n.length-t),n+=this.inst[e],n+=` 1035`}return n}},Z0=class{constructor(n=0,e=new Ca,t=!1){this.i=n,this.out=e,this.nullable=t}},wM=class $d{static ANY_RUNE_NOT_NL(){return[0,Ne.CODES.get(` 1036`)-1,Ne.CODES.get(` 1037`)+1,it.MAX_RUNE]}static ANY_RUNE(){return[0,it.MAX_RUNE]}static compileRegexp(e){const t=new $d,s=t.compile(e);return t.prog.patch(s.out,t.newInst(Se.MATCH).i),t.prog.start=s.i,t.prog}static compileSet(e){const t=new $d;if(e.length===0)return t.prog.start=t.newInst(Se.FAIL).i,t.prog;let s=[];for(let l=0;l<e.length;l++){const u=t.compile(e[l]),h=t.newInst(Se.MATCH);t.prog.getInst(h.i).arg=l,t.prog.patch(u.out,h.i),s.push(u.i)}let o=s[0];for(let l=1;l<s.length;
1037l++){const u=t.newInst(Se.ALT),h=t.prog.getInst(u.i);h.out=o,h.arg=s[l],o=u.i}return t.prog.start=o,t.prog}constructor(){this.prog=new _M,this.newInst(Se.FAIL)}newInst(e){return this.prog.addInst(e),new Z0(this.prog.numInst()-1,new Ca,!0)}nop(){const e=this.newInst(Se.NOP);return e.out=new Ca(e.i<<1,e.i<<1),e}fail(){return new Z0}cap(e){const t=this.newInst(Se.CAPTURE);return t.out=new Ca(t.i<<1,t.i<<1),this.prog.getInst(t.i).arg=e,this.prog.numCap<e+1&&(this.prog.numCap=e+1),t}cat(e,t){return e.i===0||t.i===0?this.fail():(this.prog.patch(e.out,t.i),new Z0(e.i,t.out,e.nullable&&t.nullable))}alt(e,t){if(e.i===0)return t;if(t.i===0)return e;const s=this.newInst(Se.ALT),o=this.prog.getInst(s.i);return o.out=e.i,o.arg=t.i,s.out=this.prog.append(e.out,t.out),s.nullable=e.nullable||t.nullable,s}loop(e,t){const s=this.newInst(Se.ALT),o=this.prog.getInst(s.i);return t?(o.arg=e.i,s.out=new Ca(s.i<<1,s.i<<1)):(o.out=e.i,s.out=new Ca(s.i<<1|1,s.i<<1|1)),this.prog.patch(e.out,s.i),s}quest(e,t){const s=this.newInst(Se.ALT),o=this.prog.getInst(s.i);return t?(o.arg=e.i,s.out=new Ca(s.i<<1,s.i<<1)):(o.out=e.i,s.out=new Ca(s.i<<1|1,s.i<<1|1)),s.out=this.prog.append(s.out,e.out),s}star(e,t){return e.nullable?this.quest(this.plus(e,t),t):this.loop(e,t)}plus(e,t){return new Z0(e.i,this.loop(e,t).out,e.nullable)}empty(e){const t=this.newInst(Se.EMPTY_WIDTH);return this.prog.getInst(t.i).arg=e,t.out=new Ca(t.i<<1,t.i<<1),t}rune(e,t){const s=this.newInst(Se.RUNE);s.nullable=!1;const o=this.prog.getInst(s.i);return o.runes=e,t&=Fe.FOLD_CASE,(e.length!==1||it.simpleFold(e[0])===e[0])&&(t&=-2),o.arg=t,s.out=new Ca(s.i<<1,s.i<<1),(t&Fe.FOLD_CASE)===0&&e.length===1||e.length===2&&e[0]===e[1]?o.op=Se.RUNE1:e.length===2&&e[0]===0&&e[1]===it.MAX_RUNE?o.op=Se.RUNE_ANY:e.length===4&&e[0]===0&&e[1]===Ne.CODES.get(` 1038`)-1&&e[2]===Ne.CODES.get(` 1039`)+1&&e[3]===it.MAX_RUNE&&(o.op=Se.RUNE_ANY_NOT_NL),s}lookBehind(e,t){const s=this.newInst(Se.LB_WRITE);this.prog.getInst(s.i).arg=t;const o=this.rune($d.ANY_RUNE(),0),l=this.star(o,!0),u=this.cat(l,e);this.prog.patch(u.out,s.i);const h=this.newInst(Se.LB_CHECK);return this.prog.getInst(h.i).arg=t,this.prog.lbStarts.push(u.i),Math.abs(t)>this.prog.numLb&&(this.prog.numLb=Math.abs(t)),h.out=new Ca(h.i<<1,h.i<<1),h}compile(e){switch(e.op){case re.Op.NO_MATCH:return this.fail();case re.Op.EMPTY_MATCH:return this.nop();case re.Op.LITERAL:if(e.runes.length===0)return this.nop();{let t=null;for(let s of e.runes){const o=this.rune([s],e.flags);t=t===null?o:this.cat(t,o)}return t}case re.Op.CHAR_CLASS:return this.rune(e.runes,e.flags);case re.Op.ANY_CHAR_NOT_NL:return this.rune($d.ANY_RUNE_NOT_NL(),0);case re.Op.ANY_CHAR:return this.rune($d.ANY_RUNE(),0);case re.Op.BEGIN_LINE:return this.empty(Bt.EMPTY_BEGIN_LINE);case re.Op.END_LINE:return this.empty(Bt.EMPTY_END_LINE);case re.Op.BEGIN_TEXT:return this.empty(Bt.EMPTY_BEGIN_TEXT);case re.Op.END_TEXT:return this.empty(Bt.EMPTY_END_TEXT);case re.Op.WORD_BOUNDARY:return this.empty(Bt.EMPTY_WORD_BOUNDARY);case re.Op.NO_WORD_BOUNDARY:return this.empty(Bt.EMPTY_NO_WORD_BOUNDARY);case re.Op.PLB:case re.Op.NLB:return this.lookBehind(this.compile(e.subs[0]),e.lb);case re.Op.CAPTURE:{const t=this.cap(e.cap<<1),s=this.compile(e.subs[0]),o=this.cap(e.cap<<1|1);return this.cat(this.cat(t,s),o)}case re.Op.STAR:return this.star(this.compile(e.subs[0]),(e.flags&Fe.NON_GREEDY)!==0);case re.Op.PLUS:return this.plus(this.compile(e.subs[0]),(e.flags&Fe.NON_GREEDY)!==0);case re.Op.QUEST:return this.quest(this.compile(e.subs[0]),(e.flags&Fe.NON_GREEDY)!==0);case re.Op.CONCAT:if(e.subs.length===0)return this.nop();{let t=null;for(let s of e.subs){const o=this.compile(s);t=t===null?o:this.cat(t,o)}return t}case re.Op.ALTERNATE:if(e.subs.length===0)return this.nop();{let t=null;for(let s of e.subs){const o=this.compile(s);t=t===null?o:this.alt(t,o)}return t}default:throw new oM("regexp: unhandled case in compile")}}},EM=class Qi{static simplify(e){if(e===null)return null;switch(e.op){case re.Op.PLB:case re.Op.NLB:case re.Op.CAPTURE:{const t=Qi.simplify(e.subs[0]);if(t!==e.subs[0]){const s=re.fromRegexp(e);return s.runes=[],s.subs=[t],s}return e}case re.Op.CONCAT:case re.Op.ALTERNATE:{const t=[];let s=!1;for(let o=0;o<e.subs.length;o++){const l=e.subs[o],u=Qi.simplify(l);if(u!==l&&(s=!0),e.op===re.Op.CONCAT){if(u.op===re.Op.NO_MATCH)return new re(re.Op.NO_MATCH);if(u.op===re.Op.EMPTY_MATCH){s=!0;continue}if(u.op===re.Op.CONCAT){s=!0;for(let h=0;h<u.subs.length;h++)t.push(u.subs[h]);continue}}else if(e.op===re.Op.ALTERNATE){if(u.op===re.Op.NO_MATCH){s=!0;continue}if(u.op===re.Op.ALTERNATE){s=!0;for(let h=0;h<u.subs.length;h++)t.push(u.subs[h]);continue}}t.push(u)}if(s){if(t.length===0)return new re(e.op===re.Op.CONCAT?re.Op.EMPTY_MATCH:re.Op.NO_MATCH);if(t.length===1)return t[0];const o=re.fromRegexp(e);return o.runes=[],o.subs=t,o}return e}case re.Op.CHAR_CLASS:return e.runes===null?e:e.runes.length===0?new re(re.Op.NO_MATCH):e.runes.length===2&&e.runes[0]===0&&e.runes[1]===it.MAX_RUNE?new re(re.Op.ANY_CHAR):e.runes.length===4&&e.runes[0]===0&&e.runes[1]===Ne.CODES.get(` 1040`)-1&&e.runes[2]===Ne.CODES.get(` 1041`)+1&&e.runes[3]===it.MAX_RUNE?new re(re.Op.ANY_CHAR_NOT_NL):e;case re.Op.STAR:case re.Op.PLUS:case re.Op.QUEST:{const t=Qi.simplify(e.subs[0]);return Qi.simplify1(e.op,e.flags,t,e)}case re.Op.REPEAT:{if(e.min===0&&e.max===0)return new re(re.Op.EMPTY_MATCH);const t=Qi.simplify(e.subs[0]);if(e.max===-1){if(e.min===0)return Qi.simplify1(re.Op.STAR,e.flags,t,null);if(e.min===1)return Qi.simplify1(re.Op.PLUS,e.flags,t,null);const o=new re(re.Op.CONCAT),l=[];for(let u=0;u<e.min-1;u++)l.push(t);return l.push(Qi.simplify1(re.Op.PLUS,e.flags,t,null)),o.subs=l.slice(0),Qi.simplify(o)}if(e.min===1&&e.max===1)return t;let s=null;if(e.min>0){s=[];for(let o=0;o<e.min;o++)s.push(t)}if(e.max>e.min){let o=Qi.simplify1(re.Op.QUEST,e.flags,t,null);for(let l=e.min+1;l<e.max;l++){const u=new re(re.Op.CONCAT);u.subs=[t,o],o=Qi.simplify1(re.Op.QUEST,e.flags,u,null)}if(s===null)return o;s.push(o)}if(s!==null){const o=new re(re.Op.CONCAT);return o.subs=s.slice(0),Qi.simplify(o)}return new re(re.Op.NO_MATCH)}}return e}static simplify1(e,t,s,o){if(s.op===re.Op.EMPTY_MATCH)return s;if(s.op===re.Op.NO_MATCH)return e===re.Op.PLUS?s:new re(re.Op.EMPTY_MATCH);if(e===s.op&&(t&Fe.NON_GREEDY)===(s.flags&Fe.NON_GREEDY))return s;if(o!==null&&o.op===e&&(o.flags&Fe.NON_GREEDY)===(t&Fe.NON_GREEDY)&&s===o.subs[0])return o;const l=new re(e);return l.flags=t,l.subs=[s],l}},Dn=class{constructor(n,e){this.sign=n,this.cls=e}};const iN=[48,57],aN=[9,10,12,13,32,32],oN=[48,57,65,90,95,95,97,122],lN=new Map([["\\d",new Dn(1,iN)],["\\D",new Dn(-1,iN)],["\\s",new Dn(1,aN)],["\\S",new Dn(-1,aN)],["\\w",new Dn(1,oN)],["\\W",new Dn(-1,oN)]]),cN=[48,57,65,90,97,122],uN=[65,90,97,122],dN=[0,127],hN=[9,9,32,32],fN=[0,31,127,127],mN=[48,57],pN=[33,126],BN=[97,122],gN=[32,126],xN=[33,47,58,64,91,96,123,126],bN=[9,13,32,32],CN=[65,90],yN=[48,57,65,90,95,95,97,122],vN=[48,57,65,70,97,102],_N=new Map([["[:alnum:]",new Dn(1,cN)],["[:^alnum:]",new Dn(-1,cN)],["[:alpha:]",new Dn(1,uN)],["[:^alpha:]",new Dn(-1,uN)],["[:ascii:]",new Dn(1,dN)],["[:^ascii:]",new Dn(-1,dN)],["[:blank:]",new Dn(1,hN)],["[:^blank:]",new Dn(-1,hN)],["[:cntrl:]",new Dn(1,fN)],["[:^cntrl:]",new Dn(-1,fN)],["[:digit:]",new Dn(1,mN)],["[:^digit:]",new Dn(-1,mN)],["[:graph:]",new Dn(1,pN)],["[:^graph:]",new Dn(-1,pN)],["[:lower:]",new Dn(1,BN)],["[:^lower:]",new Dn(-1,BN)],["[:print:]",new Dn(1,gN)],["[:^print:]",new Dn(-1,gN)],["[:punct:]",new Dn(1,xN)],["[:^punct:]",new Dn(-1,xN)],["[:space:]",new Dn(1,bN)],["[:^
1041space:]",new Dn(-1,bN)],["[:upper:]",new Dn(1,CN)],["[:^upper:]",new Dn(-1,CN)],["[:word:]",new Dn(1,yN)],["[:^word:]",new Dn(-1,yN)],["[:xdigit:]",new Dn(1,vN)],["[:^xdigit:]",new Dn(-1,vN)]]);var ic=class uc{static charClassToString(e,t){let s="[";for(let o=0;o<t;o+=2){o>0&&(s+=" ");const l=e[o],u=e[o+1];l===u?s+=`0x${l.toString(16)}`:s+=`0x${l.toString(16)}-0x${u.toString(16)}`}return s+="]",s}static cmp(e,t,s,o){const l=e[t]-s;return l!==0?l:o-e[t+1]}static qsortIntPair(e,t,s){const o=((t+s)/2|0)&-2,l=e[o],u=e[o+1];let h=t,f=s;for(;h<=f;){for(;h<s&&uc.cmp(e,h,l,u)<0;)h+=2;for(;f>t&&uc.cmp(e,f,l,u)>0;)f-=2;if(h<=f){if(h!==f){let p=e[h];e[h]=e[f],e[f]=p,p=e[h+1],e[h+1]=e[f+1],e[f+1]=p}h+=2,f-=2}}t<f&&uc.qsortIntPair(e,t,f),h<s&&uc.qsortIntPair(e,h,s)}constructor(e=Bt.emptyInts()){this.r=e,this.len=e.length}toArray(){return this.len===this.r.length?this.r:this.r.slice(0,this.len)}cleanClass(){if(this.len<4)return this;uc.qsortIntPair(this.r,0,this.len-2);let e=2;for(let t=2;t<this.len;t+=2){const s=this.r[t],o=this.r[t+1];if(s<=this.r[e-1]+1){o>this.r[e-1]&&(this.r[e-1]=o);continue}this.r[e]=s,this.r[e+1]=o,e+=2}return this.len=e,this}appendLiteral(e,t){return(t&Fe.FOLD_CASE)!==0?this.appendFoldedRange(e,e):this.appendRange(e,e)}appendRange(e,t){if(this.len>0){for(let s=2;s<=4;s+=2)if(this.len>=s){const o=this.r[this.len-s],l=this.r[this.len-s+1];if(e<=l+1&&o<=t+1)return e<o&&(this.r[this.len-s]=e),t>l&&(this.r[this.len-s+1]=t),this}}return this.r[this.len++]=e,this.r[this.len++]=t,this}appendFoldedRange(e,t){if(e<=it.MIN_FOLD&&t>=it.MAX_FOLD)return this.appendRange(e,t);if(t<it.MIN_FOLD||e>it.MAX_FOLD)return this.appendRange(e,t);e<it.MIN_FOLD&&(this.appendRange(e,it.MIN_FOLD-1),e=it.MIN_FOLD),t>it.MAX_FOLD&&(this.appendRange(it.MAX_FOLD+1,t),t=it.MAX_FOLD);for(let s=e;s<=t;s++){this.appendRange(s,s);for(let o=it.simpleFold(s);o!==s;o=it.simpleFold(o))this.appendRange(o,o)}return this}appendClass(e){for(let t=0;t<e.length;t+=2)this.appendRange(e[t],e[t+1]);return this}appendFoldedClass(e){for(let t=0;t<e.length;t+=2)this.appendFoldedRange(e[t],e[t+1]);return this}appendNegatedClass(e){let t=0;for(let s=0;s<e.length;s+=2){const o=e[s],l=e[s+1];t<=o-1&&this.appendRange(t,o-1),t=l+1}return t<=it.MAX_RUNE&&this.appendRange(t,it.MAX_RUNE),this}appendTable(e){for(let t=0;t<e.length;++t){const s=e.getLo(t),o=e.getHi(t),l=e.getStride(t);if(l===1){this.appendRange(s,o);continue}for(let u=s;u<=o;u+=l)this.appendRange(u,u)}return this}appendNegatedTable(e){let t=0;for(let s=0;s<e.length;++s){const o=e.getLo(s),l=e.getHi(s),u=e.getStride(s);if(u===1){t<=o-1&&this.appendRange(t,o-1),t=l+1;continue}for(let h=o;h<=l;h+=u)t<=h-1&&this.appendRange(t,h-1),t=h+1}return t<=it.MAX_RUNE&&this.appendRange(t,it.MAX_RUNE),this}appendTableWithSign(e,t){return t<0?this.appendNegatedTable(e):this.appendTable(e)}negateClass(){let e=0,t=0;for(let s=0;s<this.len;s+=2){const o=this.r[s],l=this.r[s+1];e<=o-1&&(this.r[t]=e,this.r[t+1]=o-1,t+=2),e=l+1}return this.len=t,e<=it.MAX_RUNE&&(this.r[this.len++]=e,this.r[this.len++]=it.MAX_RUNE),this}appendClassWithSign(e,t){return t<0?this.appendNegatedClass(e):this.appendClass(e)}appendGroup(e,t){let s=e.cls;return t&&(s=new uc().appendFoldedClass(s).cleanClass().toArray()),this.appendClassWithSign(s,e.sign)}toString(){return uc.charClassToString(this.r,this.len)}},NM=class{constructor(n){this.str=n,this.position=0}pos(){return this.position}rewindTo(n){this.position=n}more(){return this.position<this.str.length}peek(){return this.str.codePointAt(this.position)}skip(n){this.position+=n}skipString(n){this.position+=n.length}pop(){const n=this.str.codePointAt(this.position);return this.position+=Bt.charCount(n),n}lookingAt(n){return this.str.startsWith(n,this.position)}rest(){return this.str.substring(this.position)}from(n){return this.str.substring(n,this.position)}toString(){return this.rest()}},Je,DM=(Je=class{static unicodeTable(e){return e==="Any"?{tab:Je.ANY_TABLE,fold:Je.ANY_TABLE,sign:1}:e==="Ascii"?{tab:Je.ASCII_TABLE,fold:Je.ASCII_FOLD_TABLE,sign:1}:e==="Assigned"?{tab:Ei.CATEGORIES.get("Cn"),fold:Ei.CATEGORIES.get("Cn"),sign:-1}:e==="Lc"?{tab:Ei.CATEGORIES.get("LC"),fold:Ei.FOLD_CATEGORIES.get("LC"),sign:1}
1041:Ei.CATEGORIES.has(e)?{tab:Ei.CATEGORIES.get(e),fold:Ei.FOLD_CATEGORIES.get(e),sign:1}:Ei.SCRIPTS.has(e)?{tab:Ei.SCRIPTS.get(e),fold:Ei.FOLD_SCRIPT.get(e),sign:1}:null}static minFoldRune(e){if(e<it.MIN_FOLD||e>it.MAX_FOLD)return e;let t=e;const s=e;for(e=it.simpleFold(e);e!==s;e=it.simpleFold(e))t>e&&(t=e);return t}static leadingRegexp(e){if(e.op===re.Op.EMPTY_MATCH)return null;if(e.op===re.Op.CONCAT&&e.subs.length>0){const t=e.subs[0];return t.op===re.Op.EMPTY_MATCH?null:t}return e}static literalRegexp(e,t){const s=new re(re.Op.LITERAL);return s.flags=t,s.runes=Bt.stringToRunes(e),s}static parse(e,t){return new Je(e,t).parseInternal()}static parseRepeat(e){const t=e.pos();if(!e.more()||!e.lookingAt("{"))return-1;e.skip(1);const s=Je.parseInt(e);if(s===-1||!e.more())return-1;let o;if(!e.lookingAt(","))o=s;else{if(e.skip(1),!e.more())return-1;if(e.lookingAt("}"))o=-1;else if((o=Je.parseInt(e))===-1)return-1}if(!e.more()||!e.lookingAt("}"))return-1;if(e.skip(1),s<0||s>1e3||o===-2||o>1e3||o>=0&&s>o)throw new ds(Je.ERR_INVALID_REPEAT_SIZE,e.from(t));return s<<16|o&it.MAX_BMP}static isValidCaptureName(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){const s=e.codePointAt(t);if(s!==Ne.CODES.get("_")&&!Bt.isalnum(s))return!1}return!0}static parseInt(e){const t=e.pos();for(;e.more()&&e.peek()>=Ne.CODES.get("0")&&e.peek()<=Ne.CODES.get("9");)e.skip(1);const s=e.from(t);return s.length===0||s.length>1&&s.codePointAt(0)===Ne.CODES.get("0")?-1:s.length>8?-2:parseInt(s,10)}static isCharClass(e){return e.op===re.Op.LITERAL&&e.runes.length===1||e.op===re.Op.CHAR_CLASS||e.op===re.Op.ANY_CHAR_NOT_NL||e.op===re.Op.ANY_CHAR}static matchRune(e,t){switch(e.op){case re.Op.LITERAL:return e.runes.length===1&&e.runes[0]===t;case re.Op.CHAR_CLASS:for(let s=0;s<e.runes.length;s+=2)if(e.runes[s]<=t&&t<=e.runes[s+1])return!0;return!1;case re.Op.ANY_CHAR_NOT_NL:return t!==Ne.CODES.get(` 1042`);case re.Op.ANY_CHAR:return!0}return!1}static mergeCharClass(e,t){switch(e.op){case re.Op.ANY_CHAR:break;case re.Op.ANY_CHAR_NOT_NL:Je.matchRune(t,Ne.CODES.get(` 1043`))&&(e.op=re.Op.ANY_CHAR);break;case re.Op.CHAR_CLASS:t.op===re.Op.LITERAL?e.runes=new ic(e.runes).appendLiteral(t.runes[0],t.flags).toArray():e.runes=new ic(e.runes).appendClass(t.runes).toArray();break;case re.Op.LITERAL:if(t.runes[0]===e.runes[0]&&t.flags===e.flags)break;e.op=re.Op.CHAR_CLASS,e.runes=new ic().appendLiteral(e.runes[0],e.flags).appendLiteral(t.runes[0],t.flags).toArray();break}}static parseEscape(e){const t=e.pos();if(e.skip(1),!e.more())throw new ds(Je.ERR_TRAILING_BACKSLASH);let s=e.pop();e:switch(s){case Ne.CODES.get("1"):case Ne.CODES.get("2"):case Ne.CODES.get("3"):case Ne.CODES.get("4"):case Ne.CODES.get("5"):case Ne.CODES.get("6"):case Ne.CODES.get("7"):if(!e.more(
1043)||e.peek()<Ne.CODES.get("0")||e.peek()>Ne.CODES.get("7"))break;case Ne.CODES.get("0"):{let o=s-Ne.CODES.get("0");for(let l=1;l<3&&!(!e.more()||e.peek()<Ne.CODES.get("0")||e.peek()>Ne.CODES.get("7"));l++)o=o*8+e.peek()-Ne.CODES.get("0"),e.skip(1);return o}case Ne.CODES.get("x"):{if(!e.more())break;if(s=e.pop(),s===Ne.CODES.get("{")){let u=0,h=0;for(;;){if(!e.more())break e;if(s=e.pop(),s===Ne.CODES.get("}"))break;const f=Bt.unhex(s);if(f<0||(h=h*16+f,h>it.MAX_RUNE))break e;u++}if(u===0)break e;return h}const o=Bt.unhex(s);if(!e.more())break;s=e.pop();const l=Bt.unhex(s);if(o<0||l<0)break;return o*16+l}case Ne.CODES.get("a"):return Ne.CODES.get("\x07");case Ne.CODES.get("f"):return Ne.CODES.get("\f");case Ne.CODES.get("n"):return Ne.CODES.get(` 1044`);case Ne.CODES.get("r"):return Ne.CODES.get("\r");case Ne.CODES.get("t"):return Ne.CODES.get(" ");case Ne.CODES.get("v"):return Ne.CODES.get("\v");default:if(s<=it.MAX_ASCII&&!Bt.isalnum(s))return s;break}throw new ds(Je.ERR_INVALID_ESCAPE,e.from(t))}static parseClassChar(e,t){if(!e.more())throw new ds(Je.ERR_MISSING_BRACKET,e.from(t));return e.lookingAt("\\")?Je.parseEscape(e):e.pop()}static concatRunes(e,t){for(let s=0;s<t.length;s++)e.push(t[s]);return e}static hasCapture(e){if(e===null)return!1;if(e.op===re.Op.CAPTURE)return!0;if(e.subs){for(let t of e.subs)if(Je.hasCapture(t))return!0}return!1}constructor(e,t=0){this.wholeRegexp=e,this.flags=t,this.numCap=0,this.namedGroups=Object.create(null),this.stack=[],this.free=null,this.numRegexp=0,this.numRunes=0,this.repeats=0,this.height=null,this.size=null,this.nlb=0}newRegexp(e){let t=this.free;return t!==null&&t.subs!==null&&t.subs.length>0?(this.free=t.subs[0],t.reinit(),t.op=e):(t=new re(e),this.numRegexp+=1),t}reuse(e){this.height!==null&&this.height.has(e)&&this.height.delete(e),e.subs!==null&&e.subs.length>0&&(e.subs[0]=this.free),this.free=e}checkLimits(e){if(this.numRunes>Je.MAX_RUNES)throw new ds(Je.ERR_LARGE);this.checkSize(e),this.checkHeight(e)}checkSize(e){if(this.size===null){if(this.repeats===0&&(this.repeats=1),e.op===re.Op.REPEAT){let t=e.max;t===-1&&(t=e.min),t<=0&&(t=1),t>Math.floor(Je.MAX_SIZE/this.repeats)?this.repeats=Je.MAX_SIZE:this.repeats*=t}if(this.numRegexp<Math.floor(Je.MAX_SIZE/this.repeats))return;this.size=new Map;for(let t of this.stack)this.checkSize(t)}if(this.calcSize(e,!0)>Je.MAX_SIZE)throw new ds(Je.ERR_LARGE)}calcSize(e,t=!1){if(!t&&this.size!==null&&this.size.has(e))return this.size.get(e);let s=0;switch(e.op){case re.Op.LITERAL:s=e.runes.length;break;case re.Op.PLB:case re.Op.NLB:case re.Op.CAPTURE:case re.Op.STAR:s=2+this.calcSize(e.subs[0]);break;case re.Op.PLUS:case re.Op.QUEST:s=1+this.calcSize(e.subs[0]);break;case re.Op.CONCAT:for(let o of e.subs)s=s+this.calcSize(o);break;case re.Op.ALTERNATE:for(let o of e.subs)s=s+this.calcSize(o);e.subs.length>1&&(s=s+e.subs.length-1);break;case re.Op.REPEAT:{let o=this.calcSize(e.subs[0]);if(e.max===-1){e.min===0?s=2+o:s=1+e.min*o;break}s=e.max*o+(e.max-e.min);break}}return s=Math.max(1,s),this.size===null&&(this.size=new Map),this.size.set(e,s),s}checkHeight(e){if(!(this.numRegexp<Je.MAX_HEIGHT)){if(this.height===null){this.height=new Map;for(let t of this.stack)this.checkHeight(t)}if(this.calcHeight(e,!0)>Je.MAX_HEIGHT)throw new ds(Je.ERR_NESTING_DEPTH)}}calcHeight(e,t=!1){if(!t&&this.height!==null&&this.height.has(e))return this.height.get(e);let s=1;for(let o of e.subs){const l=this.calcHeight(o);s<1+l&&(s=1+l)}return this.height===null&&(this.height=new Map),this.height.set(e,s),s}pop(){return this.stack.pop()}popToPseudo(){const e=this.stack.length;let t=e;for(;t>0&&!re.isPseudoOp(this.stack[t-1].op);)t--;const s=this.stack.slice(t,e);return this.stack=this.stack.slice(0,t),s}push(e){if(this.numRunes+=e.runes.length,e.op===re.Op.CHAR_CLASS&&e.runes.length===2&&e.runes[0]===e.runes[1]){if(this.maybeConcat(e.runes[0],this.flags&-2))return null;e.op=re.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags&-2}else if(e.op===re.Op.CHAR_CLASS&&e.runes.length===4&&e.runes[0]===e.runes[1]&&e.runes[2]===e.runes[3]&&it.simpleFold(e.runes[0])===e.runes[2]&&it.simpleFold(e.runes[2])===e.runes[0]||e.op===re.Op.CHAR_CLASS&&e.runes.length===2&&e.runes[0]+1===e.runes[1]&&it.simpleFold(e.runes[0])===e.runes[1]&&it.simpleFold(e.runes[1])===e.runes[0]){if
vendor: 10,280 bytes, lines 1044-1046
1044(this.maybeConcat(e.runes[0],this.flags|Fe.FOLD_CASE))return null;e.op=re.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags|Fe.FOLD_CASE}else this.maybeConcat(-1,0);return this.stack.push(e),this.checkLimits(e),e}maybeConcat(e,t){const s=this.stack.length;if(s<2)return!1;const o=this.stack[s-1],l=this.stack[s-2];return o.op!==re.Op.LITERAL||l.op!==re.Op.LITERAL||(o.flags&Fe.FOLD_CASE)!==(l.flags&Fe.FOLD_CASE)?!1:(l.runes=Je.concatRunes(l.runes,o.runes),e>=0?(o.runes=[e],o.flags=t,!0):(this.pop(),this.reuse(o),!1))}newLiteral(e,t){const s=this.newRegexp(re.Op.LITERAL);return s.flags=t,(t&Fe.FOLD_CASE)!==0&&(e=Je.minFoldRune(e)),s.runes=[e],s}literal(e){this.push(this.newLiteral(e,this.flags))}op(e){const t=this.newRegexp(e);return t.flags=this.flags,this.push(t)}repeat(e,t,s,o,l,u){let h=this.flags;if((h&Fe.PERL_X)!==0&&(l.more()&&l.lookingAt("?")&&(l.skip(1),h^=Fe.NON_GREEDY),u!==-1))throw new ds(Je.ERR_INVALID_REPEAT_OP,l.from(u));const f=this.stack.length;if(f===0)throw new ds(Je.ERR_MISSING_REPEAT_ARGUMENT,l.from(o));const p=this.stack[f-1];if(re.isPseudoOp(p.op))throw new ds(Je.ERR_MISSING_REPEAT_ARGUMENT,l.from(o));const x=this.newRegexp(e);if(x.min=t,x.max=s,x.flags=h,x.subs=[p],this.stack[f-1]=x,this.checkLimits(x),e===re.Op.REPEAT&&(t>=2||s>=2)&&!this.repeatIsValid(x,1e3))throw new ds(Je.ERR_INVALID_REPEAT_SIZE,l.from(o))}repeatIsValid(e,t){if(e.op===re.Op.REPEAT){let s=e.max;if(s===0)return!0;if(s<0&&(s=e.min),s>t)return!1;s>0&&(t=Math.trunc(t/s))}for(let s of e.subs)if(!this.repeatIsValid(s,t))return!1;return!0}concat(){this.maybeConcat(-1,0);const e=this.popToPseudo();return e.length===0?this.push(this.newRegexp(re.Op.EMPTY_MATCH)):this.push(this.collapse(e,re.Op.CONCAT))}alternate(){const e=this.popToPseudo();return e.length>0&&this.cleanAlt(e[e.length-1]),e.length===0?this.push(this.newRegexp(re.Op.NO_MATCH)):this.push(this.collapse(e,re.Op.ALTERNATE))}cleanAlt(e){e.op===re.Op.CHAR_CLASS&&(e.runes=new ic(e.runes).cleanClass().toArray(),e.runes.length===2&&e.runes[0]===0&&e.runes[1]===it.MAX_RUNE?(e.runes=[],e.op=re.Op.ANY_CHAR):e.runes.length===4&&e.runes[0]===0&&e.runes[1]===Ne.CODES.get(` 1045`)-1&&e.runes[2]===Ne.CODES.get(` 1046`)+1&&e.runes[3]===it.MAX_RUNE&&(e.runes=[],e.op=re.Op.ANY_CHAR_NOT_NL))}collapse(e,t){if(e.length===1)return e[0];let s=0;for(let h of e)s+=h.op===t?h.subs.length:1;let o=new Array(s).fill(null),l=0;for(let h of e)if(h.op===t){for(let f=0;f<h.subs.length;f++)o[l++]=h.subs[f];this.reuse(h)}else o[l++]=h;let u=this.newRegexp(t);if(u.subs=o,t===re.Op.ALTERNATE&&(u.subs=this.factor(u.subs),u.subs.length===1)){const h=u;u=u.subs[0],this.reuse(h)}return u}factor(e){if(e.length<2)return e;let t=0,s=e.length,o=0,l=null,u=0,h=0,f=0;for(let x=0;x<=s;x++){let b=null,C=0,N=0;if(x<s){let T=e[t+x];if(T.op===re.Op.CONCAT&&T.subs.length>0&&(T=T.subs[0]),T.op===re.Op.LITERAL&&(b=T.runes,C=T.runes.length,N=T.flags&Fe.FOLD_CASE),N===h){let R=0;for(;R<u&&R<C&&l[R]===b[R];)R++;if(R>0){u=R;continue}}}if(x!==f)if(x===f+1)e[o++]=e[t+f];else{const T=this.newRegexp(re.Op.LITERAL);T.flags=h,T.runes=l.slice(0,u);for(let U=f;U<x;U++)e[t+U]=this.removeLeadingString(e[t+U],u),this.checkLimits(e[t+U]);const R=this.collapse(e.slice(t+f,t+x),re.Op.ALTERNATE),A=this.newRegexp(re.Op.CONCAT);A.subs=[T,R],e[o++]=A}f=x,l=b,u=C,h=N}s=o,t=0,f=0,o=0;let p=null;for(let x=0;x<=s;x++){let b=null;if(!(x<s&&(b=Je.leadingRegexp(e[t+x]),p!==null&&p.equals(b)&&(Je.isCharClass(p)||p.op===re.Op.REPEAT&&p.min===p.max&&Je.isCharClass(p.subs[0]))))){if(x!==f)if(x===f+1)e[o++]=e[t+f];else{const C=p;for(let R=f;R<x;R++){const A=R!==f;e[t+R]=this.removeLeadingRegexp(e[t+R],A),this.checkLimits(e[t+R])}const N=this.collapse(e.slice(t+f,t+x),re.Op.ALTERNATE),T=this.newRegexp(re.Op.CONCAT);T.subs=[C,N],e[o++]=T}f=x,p=b}}s=o,t=0,f=0,o=0;for(let x=0;x<=s;x++)if(!(x<s&&Je.isCharClass(e[t+x]))){if(x!==f)if(x===f+1)e[o++]=e[t+f];else{let b=f;for(let N=f+1;N<x;N++){const T=e[t+b],R=e[t+N];(T.op<R.op||T.op===R.op&&(T.runes!==null?T.runes.length:0)<(R.runes!==null?R.runes.length:0))&&(b=N)}const C=e[t+f];e[t+f]=e[t+b],e[t+b]=C;for(let N=f+1;N<x;N++)Je.mergeCharClass(e[t+f],e[t+N]),this.reuse(e[t+N]);this.cleanAlt(e[t+f]),e[o++]=e[t+f]}x<s&&(e[o++]=e[t+x]),f=x+1}s=o,t=0,f=0,o=0;for(let x=0;x<s;++x)x+1<s&&e[t+x].op===re.Op.EMPTY_MATCH&&e[t+x+1].op===re.Op.EMPTY_MATCH||(e[o++]=e[t+x]);return s=o,t=0,e.slice(t,s)}removeLeadingString(e,t){if(e.op===re.Op.CONCAT&&e.subs.length>0){const s=this.removeLeadingString(e.subs[0],t);if(e.subs[0]=s,s.op===re.Op.EMPTY_MATCH)switch(this.reuse(s),e.subs.length){case 0:case 1:e.op=re.Op.EMPTY_MATCH,e.subs=re.emptySubs();break;case 2:{const o=e;e=e.subs[1],this.reuse(o);break}default:e.subs=e.subs.slice(1,e.subs.length);break}return e}return e.op===re.Op.LITERAL&&(e.runes=e.runes.slice(t,e.runes.length),e.runes.length===0&&(e.op=re.Op.EMPTY_MATCH)),e}removeLeadingRegexp(e,t){if(e.op===re.Op.CONCAT&&e.subs.length>0){switch(t&&this.reuse(e.subs[0]),e.subs=e.subs.slice(1,e.subs.length),e.subs.length){case 0:e.op=re.Op.EMPTY_MATCH,e.subs=re.emptySubs();break;case 1:{const s=e;e=e.subs[0],this.reuse(s);break}}return e}return t&&this.reuse(e),this.newRegexp(re.Op.EMPTY_MATCH)}parseInternal(){if((this.flags&Fe.LITERAL)!==0)return Je.literalRegexp(this.wholeRegexp,this.flags);let e=-1,t=-1,s=-1;const o=new NM(this.wholeRegexp);for(;o.more();){let l=-1;e:switch(o.peek()){case Ne.CODES.get("("):if((this.flags&Fe.LOOKBEHIND)!==0){if(o.lookingAt("(?<=")){this.parsePosLookBehind(),o.skip(4);break}if(o.lookingAt("(?<!")){this.parseNegLookBehind(),o.skip(4);break}}if((this.flags&Fe.PERL_X)!==0&&o.lookingAt("(?")){this.parsePerlFlags(o);break}this.op(re.Op.LEFT_PAREN).cap=++this.numCap,o.skip(1);break;case Ne.CODES.get("|"):this.parseVerticalBar(),o.skip(1);break;case Ne.CODES.get(")"):this.parseRightParen(),o.skip(1);break;case Ne.CODES.get("^"):(this.flags&Fe.ONE_LINE)!==0?this.op(re.Op.BEGIN_TEXT):this.op(re.Op.BEGIN_LINE),o.skip(1);break;case Ne.CODES.get("$"):(this.flags&Fe.ONE_LINE)!==0?this.op(re.Op.END_TEXT).flags|=Fe.WAS_DOLLAR:this.op(re.Op.END_LINE),o.skip(1);break;case Ne.CODES.get("."):(this.flags&Fe.DOT_NL)!==0?this.op(re.Op.ANY_CHAR):this.op(re.Op.ANY_CHAR_NOT_NL),o.skip(1);break;case Ne.CODES.get("["):this.parseClass(o);break;case Ne.CODES.get("*"):case Ne.CODES.get("+"):case Ne.CODES.get("?"):{l=o.pos();let u=null;switch(o.pop()){case Ne.CODES.get("*"):u=re.Op.STAR;break;case Ne.CODES.get("+"):u=re.Op.PLUS;break;case Ne.CODES.get("?"):u=re.Op.QUEST;break}this.repeat(u,t,s,l,o,e);break}case Ne.CODES.get("{"):{l=o.pos();const u=Je.parseRepeat(o);if(u<0){o.rewindTo(l),this.literal(o.pop());break}t=u>>16,s=(u&it.MAX_BMP)<<16>>16,this.repeat(re.Op.REPEAT,t,s,l,o,e);break}case Ne.CODES.get("\\"):{const u=o.pos();if(o.skip(1),(this.flags&Fe.PERL_X)!==0&&o.more())switch(o.pop()){case Ne.CODES.get("A"):this.op(re.Op.BEGIN_TEXT);break e;case Ne.CODES.get("b"):this.op(re.Op.WORD_BOUNDARY);break e;case Ne.CODES.get("B"):this.op(re.Op.NO_WORD_BOUNDARY);break e;case Ne.CODES.get("C"):throw new ds(Je.ERR_INVALID_ESCAPE,"\\C");case Ne.CODES.get("Q"):{let p=o.rest();const x=p.indexOf("\\E");x>=0?(p=p.substring(0,x),o.skipString(p),o.skipString("\\E")):o.skipString(p);let b=0;for(;b<p.length;){const C=p.codePointAt(b);this.literal(C),b+=Bt.charCount(C)}break e}case Ne.CODES.get("z"):this.op(re.Op.END_TEXT);break e;default:o.rewindTo(u);break}else o.rewindTo(u);const h=this.newRegexp(re.Op.CHAR_CLASS);if(h.flags=this.flags,o.lookingAt("\\p")||o.lookingAt("\\P")){const p=new ic;if(this.parseUnicodeClass(o,p)){h.runes=p.toArray(),this.push(h);break e}}const f=new ic;if(this.parsePerlClassEscape(o,f)){h.runes=f.toArray(),this.push(h);break e}o.rewindTo(u),this.reuse(h),this.literal(Je.parseEscape(o));break}default:this.literal(o.pop());break}e=l}if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length!==1)throw new ds(Je.ERR_MISSING_PAREN,this.wholeRegexp);return this.stack[0].namedGroups=this.namedGroups,this.stack[0]}parsePerlFlags(e){const t=e.pos(),s=e.rest();if(s.startsWith("(?P<")||s.startsWith("(?<")){const h=s.charAt(2)==="P"?4:3,f=s.indexOf(">");if(f<0)throw new ds(Je.ERR_INVALID_NAMED_CAPTURE,s);const p=s.substring(h,f);if(e.skipString(p),e.skip(h+1),!Je.isValidCaptureName(p))throw new ds(Je.ERR_INVALID_NAMED_CAPTURE,s.substring(0,f+1));const x=this.op(re.Op.LEFT_PAREN);if(x.cap=++this.numCap,this.namedGroups[p])throw new ds(Je.ERR_DUPLICATE_NAMED_CAPTURE,p);this.namedGroups[p]=this.numCap,x.name=p;return}e.skip(2);let o=this.flags,l=1,u=!1;e:for(;e.more();){const h=e.pop();switch(h){case Ne.CODES.get("i"):o|=Fe.FOLD_CASE,u=!0;break;case Ne.CODES.get("m"):o&=-17,u=!0;break;case Ne.CODES.get("s"):o|=Fe.DOT_NL,u=!0;break;case Ne.CODES.get("U"):o|=Fe.NON_GREEDY,u=!0;break;case Ne.CODES.get("-"):if(l<0)break e;l=-1,o=~o,u=!1;break;case Ne.CODES.get(":"):case Ne.CODES.get(")"):if(l<0){if(!u)break e;o=~o}h===Ne.CODES.get(":")&&this.op(re.Op.LEFT_PAREN),this.flags=o;return;default:break e}}throw new ds(Je.ERR_INVALID_PERL_OP,e.from(t))}parsePosLookBehind(){const e=this.newRegexp(re.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=++this.nlb,this.push(e)}parseNegLookBehind(){const e=this.newRegexp(re.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=-++this.nlb,this.push(e)}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(re.Op.VERTICAL_BAR)}swapVerticalBar(){const e=this.stack.length;if(e>=3&&this.stack[e-2].op===re.Op.VERTICAL_BAR&&Je.isCharClass(this.stack[e-1])&&Je.isCharClass(this.stack[e-3])){let t=this.stack[e-1],s=this.stack[e-3];if(t.op>s.op){const o=s;s=t,t=o,this.stack[e-3]=s}return Je.mergeCharClass(s,t),this.reuse(t),this.pop(),!0}if(e>=2){const t=this.stack[e-1],s=this.stack[e-2];if(s.op===re.Op.VERTICAL_BAR)return e>=3&&this.cleanAlt(this.stack[e-3]),this.stack[e-2]=t,this.stack[e-1]=s,!0}return!1}parseRightParen(){if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length<2)throw new ds(Je.ERR_UNEXPECTED_PAREN,this.wholeRegexp);const e=this.pop(),t=this.pop();if(t.op!==re.Op.LEFT_PAREN)throw new ds(Je.ERR_UNEXPECTED_PAREN,this.wholeRegexp);if(this.flags=t.flags,t.lb!==0){if(Je.hasCapture(e))throw new ds(Je.ERR_INVALID_CAPTURE_IN_LOOKBEHIND,this.wholeRegexp);t.lb>0?t.op=re.Op.PLB:t.op=re.Op.NLB,t.subs=[e],this.push(t);return}
1046t.cap===0?this.push(e):(t.op=re.Op.CAPTURE,t.subs=[e],this.push(t))}parsePerlClassEscape(e,t){const s=e.pos();if((this.flags&Fe.PERL_X)===0||!e.more()||e.pop()!==Ne.CODES.get("\\")||!e.more())return!1;e.pop();const o=e.from(s),l=lN.has(o)?lN.get(o):null;return l===null?!1:(t.appendGroup(l,(this.flags&Fe.FOLD_CASE)!==0),!0)}parseNamedClass(e,t){const s=e.rest(),o=s.indexOf(":]");if(o<0)return!1;const l=s.substring(0,o+2);e.skipString(l);const u=_N.has(l)?_N.get(l):null;if(u===null)throw new ds(Je.ERR_INVALID_CHAR_RANGE,l);return t.appendGroup(u,(this.flags&Fe.FOLD_CASE)!==0),!0}parseUnicodeClass(e,t){const s=e.pos();if((this.flags&Fe.UNICODE_GROUPS)===0||!e.lookingAt("\\p")&&!e.lookingAt("\\P"))return!1;e.skip(1);let o=1,l=e.pop();if(l===Ne.CODES.get("P")&&(o=-1),!e.more())throw e.rewindTo(s),new ds(Je.ERR_INVALID_CHAR_RANGE,e.rest());l=e.pop();let u;if(l!==Ne.CODES.get("{"))u=Bt.runeToString(l);else{const x=e.rest(),b=x.indexOf("}");if(b<0)throw e.rewindTo(s),new ds(Je.ERR_INVALID_CHAR_RANGE,e.rest());u=x.substring(0,b),e.skipString(u),e.skip(1)}u.length!==0&&u.codePointAt(0)===Ne.CODES.get("^")&&(o=0-o,u=u.substring(1));const h=Je.unicodeTable(u);if(h===null)throw new ds(Je.ERR_INVALID_CHAR_RANGE,e.from(s));h.sign<0&&(o=0-o);const f=h.tab,p=h.fold;if((this.flags&Fe.FOLD_CASE)===0||p===null)t.appendTableWithSign(f,o);else{const x=new ic().appendTable(f).appendTable(p).cleanClass().toArray();t.appendClassWithSign(x,o)}return!0}parseClass(e){const t=e.pos();e.skip(1);const s=this.newRegexp(re.Op.CHAR_CLASS);s.flags=this.flags;const o=new ic;let l=1;e.more()&&e.lookingAt("^")&&(l=-1,e.skip(1),(this.flags&Fe.CLASS_NL)===0&&o.appendRange(Ne.CODES.get(` 1047`),Ne.CODES.get(` 1048`)));let u=!0;for(;!e.more()||e.peek()!==Ne.CODES.get("]")||u;){if(e.more()&&e.lookingAt("-")&&(this.flags&Fe.PERL_X)===0&&!u){const x=e.rest();if(x==="-"||!x.startsWith("-]"))throw e.rewindTo(t),new ds(Je.ERR_INVALID_CHAR_RANGE,e.rest())}u=!1;const h=e.pos();if(e.lookingAt("[:")){if(this.parseNamedClass(e,o))continue;e.rewindTo(h)}if(this.parseUnicodeClass(e,o)||this.parsePerlClassEscape(e,o))continue;e.rewindTo(h);const f=Je.parseClassChar(e,t);let p=f;if(e.more()&&e.lookingAt("-")){if(e.skip(1),e.more()&&e.lookingAt("]"))e.skip(-1);else if(p=Je.parseClassChar(e,t),p<f)throw new ds(Je.ERR_INVALID_CHAR_RANGE,e.from(h))}(this.flags&Fe.FOLD_CASE)===0?o.appendRange(f,p):o.appendFoldedRange(f,p)}e.skip(1),o.cleanClass(),l<0&&o.negateClass(),s.runes=o.toArray(),this.push(s)}},ze(Je,"ERR_INTERNAL_ERROR","regexp/syntax: internal error"),ze(Je,"ERR_INVALID_CHAR_RANGE","invalid character class range"),ze(Je,"ERR_INVALID_ESCAPE","invalid escape sequence"),ze(Je,"ERR_INVALID_NAMED_CAPTURE","invalid named capture"),ze(Je,"ERR_INVALID_PERL_OP","invalid or unsupported Perl syntax"),ze(Je,"ERR_INVALID_REPEAT_OP","invalid nested repetition operator"),ze(Je,"ERR_INVALID_REPEAT_SIZE","invalid repeat count"),ze(Je,"ERR_MISSING_BRACKET","missing closing ]"),ze(Je,"ERR_MISSING_PAREN","missing closing )"),ze(Je,"ERR_MISSING_REPEAT_ARGUMENT","missing argument to repetition operator"),ze(Je,"ERR_TRAILING_BACKSLASH","trailing backslash at end of expression"),ze(Je,"ERR_DUPLICATE_NAMED_CAPTURE","duplicate capture group name"),ze(Je,"ERR_UNEXPECTED_PAREN","unexpected )"),ze(Je,"ERR_NESTING_DEPTH","expression nests too deeply"),ze(Je,"ERR_LARGE","expression too large"),ze(Je,"ERR_INVALID_CAPTURE_IN_LOOKBEHIND","invalid capture in lookbehind"),ze(Je,"MAX_HEIGHT",1e3),ze(Je,"MAX_SIZE",3355443),ze(Je,"MAX_RUNES",33554432),ze(Je,"ANY_TABLE",new $(new Uint32Array([0,it.MAX_RUNE,1]))),ze(Je,"ASCII_TABLE",new $(new Uint32Array([0,127,1]))),ze(Je,"ASCII_FOLD_TABLE",new $(new Uint32Array([0,127,1,383,383,1,8490,8490,1]))),Je),TM=class bu{static initTest(e){const t=bu.compile(e),s=new bu(t.expr,t.prog,t.numSubexp,t.longest);return s.cond=t.cond,s.prefix=t.prefix,s.prefixUTF8=t.prefixUTF8,s.prefixComplete=t.prefixComplete,s.prefixRune=t.prefixRune,s.prefilter=t.prefilter,s}static compile(e){return bu.compileImpl(e,Fe.PERL,!1)}static compilePOSIX(e){return bu.compileImpl(e,Fe.POSIX,!0)}static compileImpl(e,t,s){let o=DM.parse(e,t);const l=o.maxCap();o=EM.simplify(o);const u=vM.build(o),h=wM.compileRegexp(o),f=new bu(e,h,l,s);f.prefilter=u.type===kn.Type.NONE?null:u;const[p,x]=h.prefix();return f.prefixComplete=p,f.prefix=x,f.prefixUTF8=Bt.stringToUtf8ByteArray(f.prefix),f.prefix.length>0&&(f.prefixRune=f.prefix.codePointAt(0)),f.namedGroups=o.namedGroups,f}static match(e,t){return bu.compile(e).match(t)}constructor(e,t,s=0,o=0){this.expr=e,this.prog=t,this.numSubexp=s,this.longest=o,this.cond=t.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.machinePool=[],this.dfa=new hM(this.prog),this.onepass=sN.compile(this.prog),this.prefilter=null}matchPrefixComplete(e,t,s,o){if((s===Fe.ANCHOR_START||s===Fe.ANCHOR_BOTH)&&t!==0)return null;let l=-1,u=-1;const h=e.prefixLength(this);if(s===Fe.UNANCHORED){const f=e.index(this,t);if(f<0)return null;l=t+f,u=l+h}else if(s===Fe.ANCHOR_BOTH){if(e.endPos()!==h||e.index(this,0)!==0)return null;l=0,u=h}else if(s===Fe.ANCHOR_START){if(e.index(this,0)!==0)return null;l=0,u=h}if(l<0)return null;if(o>0){const f=new Int32Array(o).fill(-1);return f[0]=l,f[1]=u,Array.from(f)}return[]}executeEngine(e,t,s,o){if(this.prefixComplete&&(o===0||this.numSubexp===0))return this.matchPrefixComplete(e,t,s,o);if(this.prefilter!==null&&s===Fe.UNANCHORED&&!this.prefilter.eval(e,t))return null;if(this.onepass!==null)return sN.execute(this,e,t,s,o);if(o>0)return this.prog.numLb===0&&e.endPos()<=W0.maxBitStateLen(this.prog)?W0.execute(this,e,t,s,o):this.doExecuteNFA(e,t,s,o);if(this.prog.numLb===0){const l=this.dfa.match(e,t,s);if(l!==null)return l?[]:null;if(e.endPos()<=W0.maxBitStateLen(this.prog))return W0.execute(this,e,t,s,o)}return this.doExecuteNFA(e,t,s,o)}numberOfCapturingGroups(){return this.numSubexp}
1048numberOfInstructions(){return this.prog.numInst()}get(){return this.machinePool.length>0?this.machinePool.pop():null}reset(){this.machinePool.length=0}put(e){this.machinePool.push(e)}toString(){return this.expr}doExecuteNFA(e,t,s,o){let l=this.get();l||(l=cM.fromRE2(this)),l.init(o);const u=l.match(e,t,s)?l.submatches():null;return this.put(l),u}match(e){return this.executeEngine(ps.fromUTF16(e),0,Fe.UNANCHORED,0)!==null}matchWithGroup(e,t,s,o,l){return e instanceof Fu||(Bt.isByteArray(e)?e=wu.utf8(e):e=wu.utf16(e)),this.matchMachineInput(e,t,s,o,l)}matchMachineInput(e,t,s,o,l){if(t>s)return[!1,null];const u=e.isUTF16Encoding()?ps.fromUTF16(e.asCharSequence(),0,s):ps.fromUTF8(e.asBytes(),0,s),h=this.executeEngine(u,t,o,2*l);return h===null?[!1,null]:[!0,h]}matchUTF8(e){return this.executeEngine(ps.fromUTF8(e),0,Fe.UNANCHORED,0)!==null}replaceAll(e,t){return this.replaceAllFunc(e,()=>t,2*e.length+1)}replaceFirst(e,t){return this.replaceAllFunc(e,()=>t,1)}replaceAllFunc(e,t,s){let o=0,l=0,u="";const h=ps.fromUTF16(e);let f=0;for(;l<=e.length;){const p=this.executeEngine(h,l,Fe.UNANCHORED,2);if(p===null||p.length===0)break;u+=e.substring(o,p[0]),(p[1]>o||p[0]===0)&&(u+=t(e.substring(p[0],p[1])),f++),o=p[1];const x=h.step(l)&7;if(l+x>p[1]?l+=x:l+1>p[1]?l++:l=p[1],f>=s)break}return u+=e.substring(o),u}pad(e){if(e===null)return null;let t=(1+this.numSubexp)*2;if(e.length<t){let s=new Array(t).fill(-1);for(let o=0;o<e.length;o++)s[o]=e[o];e=s}return e}allMatches(e,t,s=o=>o){let o=[];const l=e.endPos();t<0&&(t=l+1);let u=0,h=0,f=-1;for(;h<t&&u<=l;){const p=this.executeEngine(e,u,Fe.UNANCHORED,this.prog.numCap);if(p===null||p.length===0)break;let x=!0;if(p[1]===u){p[0]===f&&(x=!1);const b=e.step(u);b<0?u=l+1:u+=b&7}else u=p[1];f=p[1],x&&(o.push(s(this.pad(p))),h++)}return o}findUTF8(e){const t=this.executeEngine(ps.fromUTF8(e),0,Fe.UNANCHORED,2);return t===null?null:e.slice(t[0],t[1])}findUTF8Index(e){const t=this.executeEngine(ps.fromUTF8(e),0,Fe.UNANCHORED,2);return t===null?null:t.slice(0,2)}find(e){const t=this.executeEngine(ps.fromUTF16(e),0,Fe.UNANCHORED,2);return t===null?"":e.substring(t[0],t[1])}findIndex(e){return this.executeEngine(ps.fromUTF16(e),0,Fe.UNANCHORED,2)}findUTF8Submatch(e){const t=this.executeEngine(ps.fromUTF8(e),0,Fe.UNANCHORED,this.prog.numCap);if(t===null)return null;const s=new Array(1+this.numSubexp).fill(null);for(let o=0;o<s.length;o++)2*o<t.length&&t[2*o]>=0&&(s[o]=e.slice(t[2*o],t[2*o+1]));return s}findUTF8SubmatchIndex(e){return this.pad(this.executeEngine(ps.fromUTF8(e),0,Fe.UNANCHORED,this.prog.numCap))}findSubmatch(e){const t=this.executeEngine(ps.fromUTF16(e),0,Fe.UNANCHORED,this.prog.numCap);if(t===null)return null;const s=new Array(1+this.numSubexp).fill(null);for(let o=0;o<s.length;o++)2*o<t.length&&t[2*o]>=0&&(s[o]=e.substring(t[2*o],t[2*o+1]));return s}findSubmatchIndex(e){return this.pad(this.executeEngine(ps.fromUTF16(e),0,Fe.UNANCHORED,this.prog.numCap))}findAllUTF8(e,t){const s=this.allMatches(ps.fromUTF8(e),t,o=>e.slice(o[0],o[1]));return s.length===0?null:s}findAllUTF8Index(e,t){const s=this.allMatches(ps.fromUTF8(e),t,o=>o.slice(0,2));return s.length===0?null:s}findAll(e,t){const s=this.allMatches(ps.fromUTF16(e),t,o=>e.substring(o[0],o[1]));return s.length===0?null:s}findAllIndex(e,t){const s=this.allMatches(ps.fromUTF16(e),t,o=>o.slice(0,2));return s.length===0?null:s}findAllUTF8Submatch(e,t){const s=this.allMatches(ps.fromUTF8(e),t,o=>{let l=new Array(o.length/2|0).fill(null);for(let u=0;u<l.length;u++)o[2*u]>=0&&(l[u]=e.slice(o[2*u],o[2*u+1]));return l});return s.length===0?null:s}findAllUTF8SubmatchIndex(e,t){const s=this.allMatches(ps.fromUTF8(e),t);return s.length===0?null:s}findAllSubmatch(e,t){const s=this.allMatches(ps.fromUTF16(e),t,o=>{let l=new Array(o.length/2|0).fill(null);for(let u=0;u<l.length;u++)o[2*u]>=0&&(l[u]=e.substring(o[2*u],o[2*u+1]));return l});return s.length===0?null:s}findAllSubmatchIndex(e,t){const s=this.allMatches(ps.fromUTF16(e),t);return s.length===0?null:s}},SM=class Jd{static isHexadecimal(e){return"0"<=e&&e<="9"||"A"<=e&&e<="F"||"a"<=e&&e<="f"}static translate(e){let t="";if(e instanceof RegExp&&(e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e=e.source),typeof e!="string")return e;let s="",o=!1,l=e.length;l===0&&(s="(?:)",o=!0);let u=!1,h=0;for(;h<l;){let p=e[h];if(p==="\\"){if(h+1<l)switch(p=e[h+1],p){case"\\":s+="\\\\",h+=2;continue;case"c":if(h+2<l){let C=e[h+2].charCodeAt(0);if(C>=65&&C<=90||C>=97&&C<=122){let N=C%32;s+="\\x",s+=(N>>4).toString(16).toUpperCase(),s+=(N&15).toString(16).toUpperCase(),h+=3,o=!0;continue}}s+="c",h+=2,o=!0;continue;case"u":if(h+2<l){if(e[h+2]==="{"){let C=h+3,N=!1,T=!1;for(;C<l;){const R=e[C];if(R==="}"){T=!0;break}if(!Jd.isHexadecimal(R))break;N=!0,C++}if(T&&N){s+="\\x",h+=2,o=!0;continue}}else if(h+5<l){let C=!0;for(let N=0;N<4;N++)if(!Jd.isHexadecimal(e[h+2+N])){C=!1;break}if(C){s+="\\x{"+e.substring(h+2,h+6)+"}",h+=6,o=!0;continue}}}s+="u",h+=2,o=!0;continue;case"x":{let C=!1;if(h+2<l&&e[h+2]==="{"){let N=h+3,T=!1,R=!1;for(;N<l;){const A=e[N];if(A==="}"){R=!0;break}if(!Jd.isHexadecimal(A))break;T=!0,N++}R&&T&&(C=!0)}else h+3<l&&Jd.isHexadecimal(e[h+2])&&Jd.isHexadecimal(e[h+3])&&(C=!0);C?(s+="\\x",h+=2):(s+="x",h+=2,o=!0);continue}case"n":case"r":case"t":case"a":case"f":case"v":case"d":case"D":case"s":case"S":case"w":case"W":case"b":case"B":case"p":case"P":case"A":case"z":case"Q":case"E":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":s+="\\"+p,h+=2;continue;default:{let C=e.codePointAt(h+1);if(C>=48&&C<=57||C>=65&&C<=90||C>=97&&C<=122){let N=Bt.charCount(C);s+=e.substring(h+1,h+1+N),h+=N+1,o=!0}else{s+="\\";let N=Bt.charCount(C);s+=e.substring(h+1,h+1+N),h+=N+1}continue}}}else if(p==="/"){s+="\\/",h+=1,o=!0;continue}else if(p==="[")u=!0;
1048else if(p==="]")u=!1;else if(!u&&p==="("&&h+2<l&&e[h+1]==="?"&&e[h+2]==="<"&&h+3<l&&!"=!>)".includes(e[h+3])){s+="(?P<",h+=3,o=!0;continue}let x=e.codePointAt(h),b=Bt.charCount(x);s+=e.substring(h,h+b),h+=b}const f=o?s:e;return t.length>0?`(?${t})${f}`:f}},nr,j1=(nr=class{static quote(e){return Bt.quoteMeta(e)}static quoteReplacement(e,t=!1){return ZE.quoteReplacement(e,t)}static translateRegExp(e){return SM.translate(e)}static compile(e,t=0){let s=e;if((t&nr.CASE_INSENSITIVE)!==0&&(s=`(?i)${s}`),(t&nr.DOTALL)!==0&&(s=`(?s)${s}`),(t&nr.MULTILINE)!==0&&(s=`(?m)${s}`),(t&-544)!==0)throw new lM("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH, LOOKBEHINDS");let o=Fe.PERL;(t&nr.DISABLE_UNICODE_GROUPS)!==0&&(o&=-129),(t&nr.LOOKBEHINDS)!==0&&(o|=Fe.LOOKBEHIND);const l=new nr(e,t);return l.re2Input=TM.compileImpl(s,o,(t&nr.LONGEST_MATCH)!==0),l}static matches(e,t){return nr.compile(e).testExact(t)}static initTest(e,t,s){if(e==null)throw new Error("pattern is null");if(s==null)throw new Error("re2 is null");const o=new nr(e,t);return o.re2Input=s,o}constructor(e,t){this.patternInput=e,this.flagsInput=t,this.re2Input=null}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(e){return this.testExact(e)}matcher(e){return Bt.isByteArray(e)&&(e=wu.utf8(e)),new ZE(this,e)}test(e){return Bt.isByteArray(e)?this.re2Input.matchUTF8(e):this.re2Input.match(e)}testExact(e){const t=Bt.isByteArray(e)?ps.fromUTF8(e):ps.fromUTF16(e);return this.re2Input.executeEngine(t,0,Fe.ANCHOR_BOTH,0)!==null}exec(e){const t=this.matcher(e);if(!t.find())return null;const s=[t.group(0)];for(let l=1;l<=t.groupCount();l++){const u=t.group(l);s.push(u===null?void 0:u)}s.index=t.start(0),s.input=e;const o=this.namedGroups();if(Object.keys(o).length>0){const l=t.getNamedGroups();for(const u in l)l[u]===null&&(l[u]=void 0);s.groups=l}else s.groups=void 0;return s}split(e,t=0){const s=this.matcher(e),o=[];let l=0,u=0;for(;s.find();){if(u===0&&s.end()===0){u=s.end();continue}if(t>0&&o.length===t-1)break;if(u===s.start()){if(t===0){l+=1,u=s.end();continue}}else for(;l>0;)o.push(""),l-=1;o.push(s.substring(u,s.start())),u=s.end()}if(t===0&&u!==s.inputLength()){for(;l>0;)o.push(""),l-=1;o.push(s.substring(u,s.inputLength()))}return(t!==0||o.length===0&&!(u===s.inputLength()&&u>0))&&o.push(s.substring(u,s.inputLength())),o}*matchAll(e){const t=this.matcher(e);for(;t.find();){const s=[t.group(0)];for(let l=1;l<=t.groupCount();l++){const u=t.group(l);s.push(u===null?void 0:u)}s.index=t.start(0),s.input=e;const o=this.namedGroups();if(Object.keys(o).length>0){const l=t.getNamedGroups();for(const u in l)l[u]===null&&(l[u]=void 0);s.groups=l}else s.groups=void 0;yield s}}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(e){return this===e?!0:e===null||this.constructor!==e.constructor?!1:this.flagsInput===e.flagsInput&&this.patternInput===e.patternInput}},ze(nr,"CASE_INSENSITIVE",Fd.CASE_INSENSITIVE),ze(nr,"DOTALL",Fd.DOTALL),ze(nr,"MULTILINE",Fd.MULTILINE),ze(nr,"DISABLE_UNICODE_GROUPS",Fd.DISABLE_UNICODE_GROUPS),ze(nr,"LONGEST_MATCH",Fd.LONGEST_MATCH),ze(nr,"LOOKBEHINDS",Fd.LOOKBEHINDS),nr);/** 1049 * @license 1050 * Copyright 2017 Google LLC 1051 * 1052 * Licensed under the Apache License, Version 2.0 (the "License"); 1053 * you may not use this file except in compliance with the License. 1054 * You may obtain a copy of the License at 1055 * 1056 * http://www.apache.org/licenses/LICENSE-2.0 1057 * 1058 * Unless required by applicable law or agreed to in writing, software 1059 * distributed under the License is distributed on an "AS IS" BASIS, 1060 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1061 * See the License for the specific language governing permissions and 1062 * limitations under the License. 1063 */let jh="12.19.0";function jM(n){jh=n}/** 1064 * @license 1065 * Copyright 2020 Google LLC 1066 * 1067 * Licensed under the Apache License, Version 2.0 (the "License");
1068 * you may not use this file except in compliance with the License. 1069 * You may obtain a copy of the License at 1070 * 1071 * http://www.apache.org/licenses/LICENSE-2.0 1072 * 1073 * Unless required by applicable law or agreed to in writing, software 1074 * distributed under the License is distributed on an "AS IS" BASIS, 1075 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1076 * See the License for the specific language governing permissions and 1077 * limitations under the License. 1078 *//** 1079 * @license 1080 * Copyright 2017 Google LLC 1081 * 1082 * Licensed under the Apache License, Version 2.0 (the "License"); 1083 * you may not use this file except in compliance with the License. 1084 * You may obtain a copy of the License at 1085 * 1086 * http://www.apache.org/licenses/LICENSE-2.0 1087 * 1088 * Unless required by applicable law or agreed to in writing, software 1089 * distributed under the License is distributed on an "AS IS" BASIS, 1090 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1091 * See the License for the specific language governing permissions and 1092 * limitations under the License. 1093 */const Vu=new N1("@firebase/firestore");function Kd(){return Vu.logLevel}function rt(n,...e){if(Vu.logLevel<=Bn.DEBUG){const t=e.map(A1);Vu.debug(`Firestore (${jh}): ${n}`,...t)}}function yl(n,...e){if(Vu.logLevel<=Bn.ERROR){const t=e.map(A1);Vu.error(`Firestore (${jh}): ${n}`,...t)}}function Va(n,...e){if(Vu.logLevel<=Bn.WARN){const t=e.map(A1);Vu.warn(`Firestore (${jh}): ${n}`,...t)}}function A1(n){if(typeof n=="string")return n;try{return(function(t){return JSON.stringify(t)})(n)}catch{return n}}/** 1094 * @license 1095 * Copyright 2017 Google LLC 1096 * 1097 * Licensed under the Apache License, Version 2.0 (the "License"); 1098 * you may not use this file except in compliance with the License. 1099 * You may obtain a copy of the License at 1100 * 1101 * http://www.apache.org/licenses/LICENSE-2.0 1102 * 1103 * Unless required by applicable law or agreed to in writing, software 1104 * distributed under the License is distributed on an "AS IS" BASIS, 1105 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1106 * See the License for the specific language governing permissions and 1107 * limitations under the License. 1108 */function Ct(n,e,t){let s="Unexpected state";typeof e=="string"?s=e:t=e,uT(n,s,t)}function uT(n,e,t){let s=`FIRESTORE (${jh}) INTERNAL ASSERTION FAILED: ${e} (ID: ${n.toString(16)})`;if(t!==void 0)try{s+=" CONTEXT: "+JSON.stringify(t)}catch{s+=" CONTEXT: "+t}throw yl(s),new Error(s)}function pt(n,e,t,s){let o="Unexpected state";typeof t=="string"?o=t:s=t,n||uT(e,o,s)}function $t(n,e){return n}/** 1109 * @license 1110 * Copyright 2020 Google LLC 1111 * 1112 * Licensed under the Apache License, Version 2.0 (the "License"); 1113 * you may not use this file except in compliance with the License. 1114 * You may obtain a copy of the License at 1115 * 1116 * http://www.apache.org/licenses/LICENSE-2.0 1117 * 1118 * Unless required by applicable law or agreed to in writing, software 1119 * distributed under the License is distributed on an "AS IS" BASIS, 1120 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1121 * See the License for the specific language governing permissions and 1122 * limitations under the License. 1123 */function AM(n){const e=typeof self<"u"&&(self.crypto||self.msCrypto),t=new Uint8Array(n);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let s=0;s<n;s++)t[s]=Math.floor(256*Math.random());return t}/** 1124 * @license 1125 * Copyright 2017 Google LLC 1126 * 1127 * Licensed under the Apache License, Version 2.0 (the "License"); 1128 * you may not use this file except in compliance with the License. 1129 * You may obtain a copy of the License at 1130 * 1131 * http://www.apache.org/licenses/LICENSE-2.0 1132 * 1133 * Unless required by applicable law or agreed to in writing, software 1134 * distributed under the License is distributed on an "AS IS" BASIS, 1135 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1136 * See the License for the specific language governing permissions and 1137 * limitations under the License. 1138 */class k1{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=62*Math.floor(4.129032258064516);let s="";for(;s.length<20;){const o=AM(40);for(let l=0;l<o.length;++l)s.length<20&&o[l]<t&&(s+=e.charAt(o[l]%62))}return s}}function dn(n,e){return n<e?-1:n>e?1:0}function Vy(n,e){const t=Math.min(n.length,e.length);for(let s=0;s<t;s++){const o=n.charAt(s),l=e.charAt(s);if(o!==l)return qC(o)===qC(l)?dn(o,l):qC(o)?1:-1}return dn(n.length,e.length)}const kM=55296,RM=57343;function qC(n){const e=n.charCodeAt(0);return e>=kM&&e<=RM}function xh(n,e,t){return n.length===e.length&&n.every(((s,o)=>t(s,e[o])))}/** 1139 * @license 1140 * Copyright 2017 Google LLC 1141 * 1142 * Licensed under the Apache License, Version 2.0 (the "License");
vendor: 5,212 bytes, lines 1143-1153
1143 * you may not use this file except in compliance with the License. 1144 * You may obtain a copy of the License at 1145 * 1146 * http://www.apache.org/licenses/LICENSE-2.0 1147 * 1148 * Unless required by applicable law or agreed to in writing, software 1149 * distributed under the License is distributed on an "AS IS" BASIS, 1150 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1151 * See the License for the specific language governing permissions and 1152 * limitations under the License. 1153 */class vs{constructor(e,t){this.comparator=e,this.root=t||Lr.EMPTY}insert(e,t){return new vs(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,Lr.BLACK,null,null))}remove(e){return new vs(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Lr.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const s=this.comparator(e,t.key);if(s===0)return t.value;s<0?t=t.left:s>0&&(t=t.right)}return null}indexOf(e){let t=0,s=this.root;for(;!s.isEmpty();){const o=this.comparator(e,s.key);if(o===0)return t+s.left.size;o<0?s=s.left:(t+=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(((t,s)=>(e(t,s),!1)))}toString(){const e=[];return this.inorderTraversal(((t,s)=>(e.push(`${t}:${s}`),!1))),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new eB(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new eB(this.root,e,this.comparator,!1)}getReverseIterator(){return new eB(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new eB(this.root,e,this.comparator,!0)}}class eB{constructor(e,t,s,o){this.isReverse=o,this.nodeStack=[];let l=1;for(;!e.isEmpty();)if(l=t?s(e.key,t):1,t&&o&&(l*=-1),l<0)e=this.isReverse?e.left:e.right;else{if(l===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Lr{constructor(e,t,s,o,l){this.key=e,this.value=t,this.color=s??Lr.RED,this.left=o??Lr.EMPTY,this.right=l??Lr.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,s,o,l){return new Lr(e??this.key,t??this.value,s??this.color,o??this.left,l??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,s){let o=this;const l=s(e,o.key);return o=l<0?o.copy(null,null,null,o.left.insert(e,t,s),null):l===0?o.copy(null,t,null,null,null):o.copy(null,null,null,null,o.right.insert(e,t,s)),o.fixUp()}removeMin(){if(this.left.isEmpty())return Lr.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let s,o=this;if(t(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,t),null);else{if(o.left.isRed()&&(o=o.rotateRight()),o.right.isEmpty()||o.right.isRed()||o.right.left.isRed()||(o=o.moveRedRight()),t(e,o.key)===0){if(o.right.isEmpty())return Lr.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,t))}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,Lr.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Lr.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Ct(43730,{key:this.key,value:this.value});if(this.right.isRed())throw Ct(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw Ct(27949);return e+(this.isRed()?0:1)}}Lr.EMPTY=null,Lr.RED=!0,Lr.BLACK=!1;
vendor: 4,243 bytes, lines 1153-1193
1153Lr.EMPTY=new class{constructor(){this.size=0}get key(){throw Ct(57766)}get value(){throw Ct(16141)}get color(){throw Ct(16727)}get left(){throw Ct(29726)}get right(){throw Ct(36894)}copy(e,t,s,o,l){return this}insert(e,t,s){return new Lr(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/** 1154 * @license 1155 * Copyright 2017 Google LLC 1156 * 1157 * Licensed under the Apache License, Version 2.0 (the "License"); 1158 * you may not use this file except in compliance with the License. 1159 * You may obtain a copy of the License at 1160 * 1161 * http://www.apache.org/licenses/LICENSE-2.0 1162 * 1163 * Unless required by applicable law or agreed to in writing, software 1164 * distributed under the License is distributed on an "AS IS" BASIS, 1165 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1166 * See the License for the specific language governing permissions and 1167 * limitations under the License. 1168 */class ar{constructor(e){this.comparator=e,this.data=new vs(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(((t,s)=>(e(t),!1)))}forEachInRange(e,t){const s=this.data.getIteratorFrom(e[0]);for(;s.hasNext();){const o=s.getNext();if(this.comparator(o.key,e[1])>=0)return;t(o.key)}}forEachWhile(e,t){let s;for(s=t!==void 0?this.data.getIteratorFrom(t):this.data.getIterator();s.hasNext();)if(!e(s.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new wN(this.data.getIterator())}getIteratorFrom(e){return new wN(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach((s=>{t=t.add(s)})),t}isEqual(e){if(!(e instanceof ar)||this.size!==e.size)return!1;const t=this.data.getIterator(),s=e.data.getIterator();for(;t.hasNext();){const o=t.getNext().key,l=s.getNext().key;if(this.comparator(o,l)!==0)return!1}return!0}toArray(){const e=[];return this.forEach((t=>{e.push(t)})),e}toString(){const e=[];return this.forEach((t=>e.push(t))),"SortedSet("+e.toString()+")"}copy(e){const t=new ar(this.comparator);return t.data=e,t}}class wN{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/** 1169 * @license 1170 * Copyright 2017 Google LLC 1171 * 1172 * Licensed under the Apache License, Version 2.0 (the "License"); 1173 * you may not use this file except in compliance with the License. 1174 * You may obtain a copy of the License at 1175 * 1176 * http://www.apache.org/licenses/LICENSE-2.0 1177 * 1178 * Unless required by applicable law or agreed to in writing, software 1179 * distributed under the License is distributed on an "AS IS" BASIS, 1180 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1181 * See the License for the specific language governing permissions and 1182 * limitations under the License. 1183 */const Ie={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 Xe extends Mo{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/** 1184 * @license 1185 * Copyright 2017 Google LLC 1186 * 1187 * Licensed under the Apache License, Version 2.0 (the "License"); 1188 * you may not use this file except in compliance with the License. 1189 * You may obtain a copy of the License at 1190 * 1191 * http://www.apache.org/licenses/LICENSE-2.0 1192 * 1193 * Unless required by applicable law or agreed to in writing, softw
1193are 1194 * distributed under the License is distributed on an "AS IS" BASIS, 1195 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1196 * See the License for the specific language governing permissions and 1197 * limitations under the License. 1198 */const Co="__name__";class go{constructor(e,t,s){t===void 0?t=0:t>e.length&&Ct(637,{offset:t,range:e.length}),s===void 0?s=e.length-t:s>e.length-t&&Ct(1746,{length:s,range:e.length-t}),this.segments=e,this.offset=t,this.len=s}get length(){return this.len}isEqual(e){return go.comparator(this,e)===0}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof go?e.forEach((s=>{t.push(s)})):t.push(e),this.construct(t)}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 t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,s=this.limit();t<s;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const s=Math.min(e.length,t.length);for(let o=0;o<s;o++){const l=go.compareSegments(e.get(o),t.get(o));if(l!==0)return l}return dn(e.length,t.length)}static compareSegments(e,t){const s=go.isNumericId(e),o=go.isNumericId(t);return s&&!o?-1:!s&&o?1:s&&o?go.extractNumericId(e).compare(go.extractNumericId(t)):Vy(e,t)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return _c.fromString(e.substring(4,e.length-2))}}class Pn extends go{construct(e,t,s){return new Pn(e,t,s)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toStringWithLeadingSlash(){return`/${this.canonicalString()}`}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const t=[];for(const s of e){if(s.indexOf("//")>=0)throw new Xe(Ie.INVALID_ARGUMENT,`Invalid segment (${s}). Paths must not contain // in them.`);t.push(...s.split("/").filter((o=>o.length>0)))}return new Pn(t)}static emptyPath(){return new Pn([])}}const IM=/^[_a-zA-Z][_a-zA-Z0-9]*$/;let na=class Qd extends go{construct(e,t,s){return new Qd(e,t,s)}static isValidIdentifier(e){return IM.test(e)}canonicalString(){return this.toArray().map((e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Qd.isValidIdentifier(e)||(e="`"+e+"`"),e))).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===Co}static keyField(){return new Qd([Co])}static fromServerFormat(e){const t=[];let s="",o=0;const l=()=>{if(s.length===0)throw new Xe(Ie.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(s),s=""};let u=!1;for(;o<e.length;){const h=e[o];if(h==="\\"){if(o+1===e.length)throw new Xe(Ie.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const f=e[o+1];if(f!=="\\"&&f!=="."&&f!=="`")throw new Xe(Ie.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);s+=f,o+=2}else h==="`"?(u=!u,o++):h!=="."||u?(s+=h,o++):(l(),o++)}if(l(),u)throw new Xe(Ie.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new Qd(t)}static emptyPath(){return new Qd([])}};/** 1199 * @license 1200 * Copyright 2020 Google LLC 1201 * 1202 * Licensed under the Apache License, Version 2.0 (the "License"); 1203 * you may not use this file except in compliance with the License. 1204 * You may obtain a copy of the License at 1205 * 1206 * http://www.apache.org/licenses/LICENSE-2.0 1207 * 1208 * Unless required by applicable law or agreed to in writing, software 1209 * distributed under the License is distributed on an "AS IS" BASIS, 1210 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1211 * See the License for the specific language governing permissions and 1212 * limitations under the License. 1213 */class Zi{constructor(e){this.fields=e,e.sort(na.comparator)}static empty(){return new Zi([])}unionWith(e){let t=new ar(na.comparator);for(const s of this.fields)t=t.add(s);for(const s of e)t=t.add(s);return new Zi(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return xh(this.fields,e.fields,((t,s)=>t.isEqual(s)))}}/** 1214 * @license 1215 * Copyright 2017 Google LLC 1216 * 1217 * Licensed under the Apache License, Version 2.0 (the "License");
1218 * you may not use this file except in compliance with the License. 1219 * You may obtain a copy of the License at 1220 * 1221 * http://www.apache.org/licenses/LICENSE-2.0 1222 * 1223 * Unless required by applicable law or agreed to in writing, software 1224 * distributed under the License is distributed on an "AS IS" BASIS, 1225 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1226 * See the License for the specific language governing permissions and 1227 * limitations under the License. 1228 */function WB(n){let e=0;for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e++;return e}function Fc(n,e){for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(t,n[t])}function OM(n,e){const t=[];for(const s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.push(e(n[s],s,n));return t}function dT(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}/** 1229 * @license 1230 * Copyright 2017 Google LLC 1231 * 1232 * Licensed under the Apache License, Version 2.0 (the "License"); 1233 * you may not use this file except in compliance with the License. 1234 * You may obtain a copy of the License at 1235 * 1236 * http://www.apache.org/licenses/LICENSE-2.0 1237 * 1238 * Unless required by applicable law or agreed to in writing, software 1239 * distributed under the License is distributed on an "AS IS" BASIS, 1240 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1241 * See the License for the specific language governing permissions and 1242 * limitations under the License. 1243 */class gt{constructor(e){this.path=e}static fromPath(e){return new gt(Pn.fromString(e))}static fromName(e){return new gt(Pn.fromString(e).popFirst(5))}static empty(){return new gt(Pn.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&&Pn.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,t){return Pn.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new gt(new Pn(e.slice()))}}/** 1244 * @license 1245 * Copyright 2017 Google LLC 1246 * 1247 * Licensed under the Apache License, Version 2.0 (the "License"); 1248 * you may not use this file except in compliance with the License. 1249 * You may obtain a copy of the License at 1250 * 1251 * http://www.apache.org/licenses/LICENSE-2.0 1252 * 1253 * Unless required by applicable law or agreed to in writing, software 1254 * distributed under the License is distributed on an "AS IS" BASIS, 1255 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1256 * See the License for the specific language governing permissions and 1257 * limitations under the License. 1258 */function hT(n,e,t){if(!t)throw new Xe(Ie.INVALID_ARGUMENT,`Function ${n}() cannot be called with an empty ${e}.`)}function LM(n,e,t,s){if(e===!0&&s===!0)throw new Xe(Ie.INVALID_ARGUMENT,`${n} and ${t} cannot be used together.`)}function EN(n){if(!gt.isDocumentKey(n))throw new Xe(Ie.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${n} has ${n.length}.`)}function NN(n){if(gt.isDocumentKey(n))throw new Xe(Ie.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${n} has ${n.length}.`)}function ip(n){return typeof n=="object"&&n!==null&&(Object.getPrototypeOf(n)===Object.prototype||Object.getPrototypeOf(n)===null)}function Rg(n){if(n===void 0)return"undefined";if(n===null)return"null";if(typeof n=="string")return n.length>20&&(n=`${n.substring(0,20)}...`),JSON.stringify(n);if(typeof n=="number"||typeof n=="boolean")return""+n;if(typeof n=="object"){if(n instanceof Array)return"an array";{const e=(function(s){return s.constructor?s.constructor.name:null})(n);return e?`a custom ${e} object`:"an object"}}return typeof n=="function"?"a function":Ct(12329,{type:typeof n})}function ji(n,e){if("_delegate"in n&&(n=n._delegate),!(n instanceof e)){if(e.name===n.constructor.name)throw new Xe(Ie.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const t=Rg(n);throw new Xe(Ie.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${t}`)}}return n}function fT(n,e){if(e<=0)throw new Xe(Ie.INVALID_ARGUMENT,`Function ${n}() requires a positive number, but it was: ${e}.`)}/** 1259 * @license 1260 * Copyright 2025 Google LLC 1261 * 1262 * Licensed under the Apache License, Version 2.0 (the "License");
1263 * you may not use this file except in compliance with the License. 1264 * You may obtain a copy of the License at 1265 * 1266 * http://www.apache.org/licenses/LICENSE-2.0 1267 * 1268 * Unless required by applicable law or agreed to in writing, software 1269 * distributed under the License is distributed on an "AS IS" BASIS, 1270 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1271 * See the License for the specific language governing permissions and 1272 * limitations under the License. 1273 */function ir(n,e){const t={typeString:n};return e&&(t.value=e),t}function ap(n,e){if(!ip(n))throw new Xe(Ie.INVALID_ARGUMENT,"JSON must be an object");let t;for(const s in e)if(e[s]){const o=e[s].typeString,l="value"in e[s]?{value:e[s].value}:void 0;if(!(s in n)){t=`JSON missing required field: '${s}'`;break}const u=n[s];if(o&&typeof u!==o){t=`JSON field '${s}' must be a ${o}.`;break}if(l!==void 0&&u!==l.value){t=`Expected '${s}' field to equal '${l.value}'`;break}}if(t)throw new Xe(Ie.INVALID_ARGUMENT,t);return!0}/** 1274 * @license 1275 * Copyright 2017 Google LLC 1276 * 1277 * Licensed under the Apache License, Version 2.0 (the "License"); 1278 * you may not use this file except in compliance with the License. 1279 * You may obtain a copy of the License at 1280 * 1281 * http://www.apache.org/licenses/LICENSE-2.0 1282 * 1283 * Unless required by applicable law or agreed to in writing, software 1284 * distributed under the License is distributed on an "AS IS" BASIS, 1285 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1286 * See the License for the specific language governing permissions and 1287 * limitations under the License. 1288 */const DN=-62135596800,TN=1e6;class Qn{static now(){return Qn.fromMillis(Date.now())}static fromDate(e){return Qn.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),s=Math.floor((e-1e3*t)*TN);return new Qn(t,s)}static fromInstant(e){if(!e||typeof e.t!="bigint")throw new Xe(Ie.INVALID_ARGUMENT,"Invalid Temporal.Instant object provided.");return Qn._fromEpochNanoseconds(e.t)}
1288static _fromEpochNanoseconds(e){let t,s;if(e>=0n)t=Number(e/1000000000n),s=Number(e%1000000000n);else{const o=e%1000000000n;o===0n?(t=Number(e/1000000000n),s=0):(t=Number(e/1000000000n-1n),s=Number(o+1000000000n))}return new Qn(t,s)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new Xe(Ie.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new Xe(Ie.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<DN)throw new Xe(Ie.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new Xe(Ie.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/TN}toInstant(){if(typeof Temporal>"u"||!Temporal.Instant)throw new Xe(Ie.FAILED_PRECONDITION,"The Temporal object is not available in the current environment.");const e=1000000000n*BigInt(this.seconds)+BigInt(this.nanoseconds);return Temporal.Instant.__PRIVATE_fromEpochNanoseconds(e)}_compareTo(e){return this.seconds===e.seconds?dn(this.nanoseconds,e.nanoseconds):dn(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:Qn._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(ap(e,Qn._jsonSchema))return new Qn(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-DN;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}Qn._jsonSchemaVersion="firestore/timestamp/1.0",Qn._jsonSchema={type:ir("string",Qn._jsonSchemaVersion),seconds:ir("number"),nanoseconds:ir("number")};/** 1289 * @license 1290 * Copyright 2023 Google LLC 1291 * 1292 * Licensed under the Apache License, Version 2.0 (the "License"); 1293 * you may not use this file except in compliance with the License. 1294 * You may obtain a copy of the License at 1295 * 1296 * http://www.apache.org/licenses/LICENSE-2.0 1297 * 1298 * Unless required by applicable law or agreed to in writing, software 1299 * distributed under the License is distributed on an "AS IS" BASIS, 1300 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1301 * See the License for the specific language governing permissions and 1302 * limitations under the License. 1303 */class mT extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/** 1304 * @license 1305 * Copyright 2020 Google LLC 1306 * 1307 * Licensed under the Apache License, Version 2.0 (the "License"); 1308 * you may not use this file except in compliance with the License. 1309 * You may obtain a copy of the License at 1310 * 1311 * http://www.apache.org/licenses/LICENSE-2.0 1312 * 1313 * Unless required by applicable law or agreed to in writing, software 1314 * distributed under the License is distributed on an "AS IS" BASIS, 1315 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1316 * See the License for the specific language governing permissions and 1317 * limitations under the License. 1318 */class or{constructor(e){this.binaryString=e}static fromBase64String(e){const t=(function(o){try{return atob(o)}catch(l){throw typeof DOMException<"u"&&l instanceof DOMException?new mT("Invalid base64 string: "+l):l}})(e);return new or(t)}static fromUint8Array(e){const t=(function(o){let l="";for(let u=0;u<o.length;++u)l+=String.fromCharCode(o[u]);return l})(e);return new or(t)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return(function(t){return btoa(t)})(this.binaryString)}toUint8Array(){return(function(t){const s=new Uint8Array(t.length);for(let o=0;o<t.length;o++)s[o]=t.charCodeAt(o);return s})(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return dn(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}or.EMPTY_BYTE_STRING=new or("");const MM=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Sc(n){if(pt(!!n,39018),typeof n=="string"){let e=0;const t=MM.exec(n);if(pt(!!t,46558,{timestamp:n}),t[1]){let o=t[1];o=(o+"000000000").substr(0,9),e=Number(o)}const s=new Date(n);return{seconds:Math.floor(s.getTime()/1e3),nanos:e}}return{seconds:js(n.seconds),nanos:js(n.nanos)}}function js(n){return typeof n=="number"?n:typeof n=="string"?Number(n):0}function jc(n){return typeof n=="string"?or.fromBase64String(n):or.fromUint8Array(n)}/** 1319 * @license 1320 * Copyright 2020 Google LLC 1321 * 1322 * Licensed under the Apache License, Version 2.0 (the "License");
1323 * you may not use this file except in compliance with the License. 1324 * You may obtain a copy of the License at 1325 * 1326 * http://www.apache.org/licenses/LICENSE-2.0 1327 * 1328 * Unless required by applicable law or agreed to in writing, software 1329 * distributed under the License is distributed on an "AS IS" BASIS, 1330 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1331 * See the License for the specific language governing permissions and 1332 * limitations under the License. 1333 */const pT="server_timestamp",BT="__type__",gT="__previous_value__",xT="__local_write_time__";function Ig(n){var t,s;return((s=(((t=n==null?void 0:n.mapValue)==null?void 0:t.fields)||{})[BT])==null?void 0:s.stringValue)===pT}function op(n){const e=n.mapValue.fields[gT];return Ig(e)?op(e):e}function bh(n){const e=Sc(n.mapValue.fields[xT].timestampValue);return new Qn(e.seconds,e.nanos)}/** 1334 * @license 1335 * Copyright 2017 Google LLC 1336 * 1337 * Licensed under the Apache License, Version 2.0 (the "License"); 1338 * you may not use this file except in compliance with the License. 1339 * You may obtain a copy of the License at 1340 * 1341 * http://www.apache.org/licenses/LICENSE-2.0 1342 * 1343 * Unless required by applicable law or agreed to in writing, software 1344 * distributed under the License is distributed on an "AS IS" BASIS, 1345 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1346 * See the License for the specific language governing permissions and 1347 * limitations under the License. 1348 */class PM{constructor(e,t,s,o,l,u,h,f,p,x,b,C,N){this.databaseId=e,this.appId=t,this.persistenceKey=s,this.host=o,this.ssl=l,this.forceLongPolling=u,this.autoDetectLongPolling=h,this.longPollingOptions=f,this.useFetchStreams=p,this.isUsingEmulator=x,this.apiKey=b,this._customHeaders=C,this.grpcFlowControlWindow=N}}const Uy="(default)";class Om{constructor(e,t){this.projectId=e,this.database=t||Uy}static empty(){return new Om("","")}get isDefaultDatabase(){return this.database===Uy}isEqual(e){return e instanceof Om&&e.projectId===this.projectId&&e.database===this.database}}function zM(n,e){if(!Object.prototype.hasOwnProperty.apply(n.options,["projectId"]))throw new Xe(Ie.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Om(n.options.projectId,e)}/** 1349 * @license 1350 * Copyright 2017 Google LLC 1351 * 1352 * Licensed under the Apache License, Version 2.0 (the "License"); 1353 * you may not use this file except in compliance with the License. 1354 * You may obtain a copy of the License at 1355 * 1356 * http://www.apache.org/licenses/LICENSE-2.0 1357 * 1358 * Unless required by applicable law or agreed to in writing, software 1359 * distributed under the License is distributed on an "AS IS" BASIS, 1360 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1361 * See the License for the specific language governing permissions and 1362 * limitations under the License. 1363 */const R1=-1;function Og(n){return n==null}function Lm(n){return n===0&&1/n==-1/0}function FM(n){return typeof n=="number"&&Number.isInteger(n)&&!Lm(n)&&n<=Number.MAX_SAFE_INTEGER&&n>=Number.MIN_SAFE_INTEGER}function VM(n){return typeof n=="string"}/** 1364 * @license 1365 * Copyright 2020 Google LLC 1366 * 1367 * Licensed under the Apache License, Version 2.0 (the "License"); 1368 * you may not use this file except in compliance with the License. 1369 * You may obtain a copy of the License at 1370 * 1371 * http://www.apache.org/licenses/LICENSE-2.0 1372 * 1373 * Unless required by applicable law or agreed to in writing, software 1374 * distributed under the License is distributed on an "AS IS" BASIS, 1375 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1376 * See the License for the specific language governing permissions and 1377 * limitations under the License. 1378 */const bT="__type__",UM="__max__",tB={mapValue:{}}
1378,CT="__vector__",Mm="value",Ch={nullValue:"NULL_VALUE"},ki={booleanValue:!0},Er={booleanValue:!1};function lr(n){return"nullValue"in n?0:"booleanValue"in n?1:"integerValue"in n||"doubleValue"in n?2:"timestampValue"in n?3:"stringValue"in n?5:"bytesValue"in n?6:"referenceValue"in n?7:"geoPointValue"in n?8:"arrayValue"in n?9:"mapValue"in n?Ig(n)?4:GM(n)?9007199254740991:ZB(n)?10:11:Ct(28295,{value:n})}function Ta(n,e,t){if(n===e)return!0;const s=lr(n);if(s!==lr(e))return!1;switch(s){case 0:case 9007199254740991:return!0;case 1:return n.booleanValue===e.booleanValue;case 4:return bh(n).isEqual(bh(e));case 3:return(function(l,u){if(typeof l.timestampValue=="string"&&typeof u.timestampValue=="string"&&l.timestampValue.length===u.timestampValue.length)return l.timestampValue===u.timestampValue;const h=Sc(l.timestampValue),f=Sc(u.timestampValue);return h.seconds===f.seconds&&h.nanos===f.nanos})(n,e);case 5:return n.stringValue===e.stringValue;case 6:return(function(l,u){return jc(l.bytesValue).isEqual(jc(u.bytesValue))})(n,e);case 7:return n.referenceValue===e.referenceValue;case 8:return(function(l,u){return js(l.geoPointValue.latitude)===js(u.geoPointValue.latitude)&&js(l.geoPointValue.longitude)===js(u.geoPointValue.longitude)})(n,e);case 2:return(function(l,u,h){if("integerValue"in l&&"integerValue"in u)return js(l.integerValue)===js(u.integerValue);let f,p;if("doubleValue"in l&&"doubleValue"in u)f=js(l.doubleValue),p=js(u.doubleValue);else{if(!(h!=null&&h.i))return!1;f=js(l.integerValue??l.doubleValue),p=js(u.integerValue??u.doubleValue)}return f===p?!!(h!=null&&h.o)||Lm(f)===Lm(p):!!(h===void 0||h.u)&&isNaN(f)&&isNaN(p)})(n,e,t);case 9:return xh(n.arrayValue.values||[],e.arrayValue.values||[],((o,l)=>Ta(o,l,t)));case 10:case 11:return(function(l,u,h){const f=l.mapValue.fields||{},p=u.mapValue.fields||{};if(WB(f)!==WB(p))return!1;for(const x in f)if(f.hasOwnProperty(x)&&(p[x]===void 0||!Ta(f[x],p[x],h)))return!1;return!0})(n,e,t);default:return Ct(52216,{left:n})}}function Pm(n,e){return(n.values||[]).find((t=>Ta(t,e)))!==void 0}function Ri(n,e){if(n===e)return 0;const t=lr(n),s=lr(e);if(t!==s)return dn(t,s);switch(t){case 0:case 9007199254740991:return 0;case 1:return dn(n.booleanValue,e.booleanValue);case 2:return(function(l,u){const h=js(l.integerValue||l.doubleValue),f=js(u.integerValue||u.doubleValue);return h<f?-1:h>f?1:h===f?0:isNaN(h)?isNaN(f)?0:-1:1})(n,e);case 3:return SN(n.timestampValue,e.timestampValue);case 4:return SN(bh(n),bh(e));case 5:return Vy(n.stringValue,e.stringValue);case 6:return(function(l,u){const h=jc(l),f=jc(u);return h.compareTo(f)})(n.bytesValue,e.bytesValue);case 7:return(function(l,u){const h=l.split("/"),f=u.split("/");for(let p=0;p<h.length&&p<f.length;p++){const x=dn(h[p],f[p]);if(x!==0)return x}return dn(h.length,f.length)})(n.referenceValue,e.referenceValue);case 8:return(function(l,u){const h=dn(js(l.latitude),js(u.latitude));return h!==0?h:dn(js(l.longitude),js(u.longitude))})(n.geoPointValue,e.geoPointValue);case 9:return jN(n.arrayValue,e.arrayValue);case 10:return(function(l,u){var C,N,T,R;const h=l.fields||{},f=u.fields||{},p=(C=h[Mm])==null?void 0:C.arrayValue,x=(N=f[Mm])==null?void 0:N.arrayValue,b=dn(((T=p==null?void 0:p.values)==null?void 0:T.length)||0,((R=x==null?void 0:x.values)==null?void 0:R.length)||0);return b!==0?b:jN(p,x)})(n.mapValue,e.mapValue);case 11:return(function(l,u){if(l===tB.mapValue&&u===tB.mapValue)return 0;if(l===tB.mapValue)return 1;if(u===tB.mapValue)return-1;const h=l.fields||{},f=Object.keys(h),p=u.fields||{},x=Object.keys(p);f.sort(),x.sort();for(let b=0;b<f.length&&b<x.length;++b){const C=Vy(f[b],x[b]);if(C!==0)return C;const N=Ri(h[f[b]],p[x[b]]);if(N!==0)return N}return dn(f.length,x.length)})(n.mapValue,e.mapValue);default:throw Ct(23264,{l:t})}}function SN(n,e){if(typeof n=="string"&&typeof e=="string"&&n.length===e.length)return dn(n,e);const t=Sc(n),s=Sc(e),o=dn(t.seconds,s.seconds);return o!==0?o:dn(t.nanos,s.nanos)}function jN(n,e){const t=n.values||[],s=e.values||[];for(let o=0;o<t.length&&o<s.length;++o){const l=Ri(t[o],s[o]);if(l!==void 0&&l!==0)return l}return dn(t.length,s.length)}function yh(n){return Gy(n)}function Gy(n){return"nullValue"in n?"null":"booleanValue"in n?""+n.booleanValue:"integerValue"in n?""+n.integerValue:"doubleValue"in n?""+n.doubleValue:"timestampValue"in n?(function(t){const s=Sc(t);return`time(${s.seconds},${s.nanos})`})(n.timestampValue):"stringValue"in n?n.stringValue:"bytesValue"in n?(function(t){return jc(t).toBase64()})(n.bytesValue):"referenceValue"in n?(function(t){return gt.fromName(t).toString()})(n.referenceValue):"geoPointValue"in n?(function(t){return`geo(${t.latitude},${t.longitude})`})(n.geoPointValue):"arrayValue"in n?(function(t){let s="[",o=!0;for(const l of t.values||[])o?o=!1:s+=",",s+=Gy(l);return s+"]"})(n.arrayValue):"mapValue"in n?(function(t){const s=Object.keys(t.fields||{}).sort();let o="{",l=!0;for(const u of s)l?l=!1:o+=",",o+=`${u}:${Gy(t.fields[u])}`;return o+"}"})(n.mapValue):Ct(61005,{value:n})}function DB(n){switch(lr(n)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const e=op(n);return e?16+DB(e):16;case 5:return 2*n.stringValue.length;case 6:return jc(n.bytesValue).approximateByteSize();case 7:return n.referenceValue.length;case 9:return(function(s){return(s.values||[]).reduce(((o,l)=>o+DB(l)),0)})(n.arrayValue);case 10:case 11:return(function(s){let o=0;
vendor: 3,120 bytes, lines 1378-1393
1378return Fc(s.fields,((l,u)=>{o+=l.length+DB(u)})),o})(n.mapValue);default:throw Ct(13486,{value:n})}}function AN(n,e){return{referenceValue:`projects/${n.projectId}/databases/${n.database}/documents/${e.path.canonicalString()}`}}function yo(n){return!!n&&"integerValue"in n}function Eu(n){return!!n&&"doubleValue"in n}function Ac(n){return yo(n)||Eu(n)}function vh(n){return!!n&&"arrayValue"in n}function ea(n){return!!n&&"nullValue"in n}function Ii(n){return!!n&&"doubleValue"in n&&isNaN(Number(n.doubleValue))}function Su(n){return!!n&&"mapValue"in n}function ZB(n){var t,s;return((s=(((t=n==null?void 0:n.mapValue)==null?void 0:t.fields)||{})[bT])==null?void 0:s.stringValue)===CT}function Hy(n){var e,t;return(t=(((e=n==null?void 0:n.mapValue)==null?void 0:e.fields)||{})[Mm])==null?void 0:t.arrayValue}function hm(n){if(n.geoPointValue)return{geoPointValue:{...n.geoPointValue}};if(n.timestampValue&&typeof n.timestampValue=="object")return{timestampValue:{...n.timestampValue}};if(n.mapValue){const e={mapValue:{fields:{}}};return Fc(n.mapValue.fields,((t,s)=>e.mapValue.fields[t]=hm(s))),e}if(n.arrayValue){const e={arrayValue:{values:[]}};for(let t=0;t<(n.arrayValue.values||[]).length;++t)e.arrayValue.values[t]=hm(n.arrayValue.values[t]);return e}return{...n}}function GM(n){return(((n.mapValue||{}).fields||{}).__type__||{}).stringValue===UM}/** 1379 * @license 1380 * Copyright 2017 Google LLC 1381 * 1382 * Licensed under the Apache License, Version 2.0 (the "License"); 1383 * you may not use this file except in compliance with the License. 1384 * You may obtain a copy of the License at 1385 * 1386 * http://www.apache.org/licenses/LICENSE-2.0 1387 * 1388 * Unless required by applicable law or agreed to in writing, software 1389 * distributed under the License is distributed on an "AS IS" BASIS, 1390 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1391 * See the License for the specific language governing permissions and 1392 * limitations under the License. 1393 */class hi{constructor(e){this.value=e}static empty(){return new hi({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let s=0;s<e.length-1;++s)if(t=(t.mapValue.fields||{})[e.get(s)],!Su(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=hm(t)}setAll(e){let t=na.emptyPath(),s={},o=[];e.forEach(((u,h)=>{if(!t.isImmediateParentOf(h)){const f=this.getFieldsMap(t);this.applyChanges(f,s,o),s={},o=[],t=h.popLast()}u?s[h.lastSegment()]=hm(u):o.push(h.lastSegment())}));const l=this.getFieldsMap(t);this.applyChanges(l,s,o)}delete(e){const t=this.field(e.popLast());Su(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return Ta(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let s=0;s<e.length;++s){let o=t.mapValue.fields[e.get(s)];Su(o)&&o.mapValue.fields||(o={mapValue:{fields:{}}},t.mapValue.fields[e.get(s)]=o),t=o}return t.mapValue.fields}applyChanges(e,t,s){Fc(t,((o,l)=>e[o]=l));for(const o of s)delete e[o]}clone(){return new hi(hm(this.value))}}function yT(n){const e=[];
1393return Fc(n.fields,((t,s)=>{const o=new na([t]);if(Su(s)){const l=yT(s.mapValue).fields;if(l.length===0)e.push(o);else for(const u of l)e.push(o.child(u))}else e.push(o)})),new Zi(e)}/** 1394 * @license 1395 * Copyright 2020 Google LLC 1396 * 1397 * Licensed under the Apache License, Version 2.0 (the "License"); 1398 * you may not use this file except in compliance with the License. 1399 * You may obtain a copy of the License at 1400 * 1401 * http://www.apache.org/licenses/LICENSE-2.0 1402 * 1403 * Unless required by applicable law or agreed to in writing, software 1404 * distributed under the License is distributed on an "AS IS" BASIS, 1405 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1406 * See the License for the specific language governing permissions and 1407 * limitations under the License. 1408 */function Lg(n,e){if(n.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Lm(e)?"-0":e}}function I1(n){return{integerValue:""+n}}function O1(n,e,t){return FM(e)?I1(e):Lg(n,e)}/** 1409 * @license 1410 * Copyright 2018 Google LLC 1411 * 1412 * Licensed under the Apache License, Version 2.0 (the "License"); 1413 * you may not use this file except in compliance with the License. 1414 * You may obtain a copy of the License at 1415 * 1416 * http://www.apache.org/licenses/LICENSE-2.0 1417 * 1418 * Unless required by applicable law or agreed to in writing, software 1419 * distributed under the License is distributed on an "AS IS" BASIS, 1420 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1421 * See the License for the specific language governing permissions and 1422 * limitations under the License. 1423 */class Mg{constructor(){this._=void 0}}function HM(n,e,t){return n instanceof zm?(function(o,l){const u={fields:{[BT]:{stringValue:pT},[xT]:{timestampValue:{seconds:o.seconds,nanos:o.nanoseconds}}}};return l&&Ig(l)&&(l=op(l)),l&&(u.fields[gT]=l),{mapValue:u}})(t,e):n instanceof _h?_T(n,e):n instanceof wh?wT(n,e):n instanceof Fm?(function(o,l){const u=vT(o,l),h=ng(u)+ng(o.h);return yo(u)&&yo(o.h)?I1(h):Lg(o.serializer,h)})(n,e):n instanceof eg?(function(o,l){return kN(o,l,Math.min)})(n,e):n instanceof tg?(function(o,l){return kN(o,l,Math.max)})(n,e):void 0}function qM(n,e,t){return n instanceof _h?_T(n,e):n instanceof wh?wT(n,e):t}function vT(n,e){return n instanceof Fm?Ac(e)?e:{integerValue:0}:null}class zm extends Mg{}class _h extends Mg{constructor(e){super(),this.elements=e}}function _T(n,e){const t=ET(e);for(const s of n.elements)t.some((o=>Ta(o,s)))||t.push(s);return{arrayValue:{values:t}}}class wh extends Mg{constructor(e){super(),this.elements=e}}function wT(n,e){let t=ET(e);for(const s of n.elements)t=t.filter((o=>!Ta(o,s)));return{arrayValue:{values:t}}}class L1 extends Mg{constructor(e,t){super(),this.serializer=e,this.h=t}}class Fm extends L1{}class eg extends L1{}class tg extends L1{}function kN(n,e,t){if(!Ac(e))return n.h;const s=t(ng(e),ng(n.h));return yo(e)&&yo(n.h)?I1(s):Lg(n.serializer,s)}function ng(n){return js(n.integerValue||n.doubleValue)}function ET(n){return vh(n)&&n.arrayValue.values?n.arrayValue.values.slice():[]}/** 1424 * @license 1425 * Copyright 2017 Google LLC 1426 * 1427 * Licensed under the Apache License, Version 2.0 (the "License"); 1428 * you may not use this file except in compliance with the License. 1429 * You may obtain a copy of the License at 1430 * 1431 * http://www.apache.org/licenses/LICENSE-2.0 1432 * 1433 * Unless required by applicable law or agreed to in writing, software 1434 * distributed under the License is distributed on an "AS IS" BASIS, 1435 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1436 * See the License for the specific language governing permissions and 1437 * limitations under the License. 1438 */class M1{constructor(e,t){this.field=e,this.transform=t}}function $M(n,e){return n.field.isEqual(e.field)&&(function(s,o){return s instanceof _h&&o instanceof _h||s instanceof wh&&o instanceof wh?xh(s.elements,o.elements,Ta):s instanceof Fm&&o instanceof Fm||s instanceof eg&&o instanceof eg||s instanceof tg&&o instanceof tg?Ta(s.h,o.h):s instanceof zm&&o instanceof zm})(n.transform,e.transform)}class JM{constructor(e,t){this.version=e,this.transformResults=t}}class Da{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new Da}static exists(e){return new Da(void 0,e)}static updateTime(e){return new Da(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 TB(n,e){return n.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(n.updateTime):n.exists===void 0||n.exists===e.isFoundDocument()}class Pg{}function NT(n,e){if(!n.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return n.isNoDocument()?new P1(n.key,Da.none()):new lp(n.key,n.data,Da.none());{const t=n.data,s=hi.empty();let o=new ar(na.comparator);for(let l of e.fields)if(!o.has(l)){let u=t.field(l);u===null&&l.length>1&&(l=l.popLast(),u=t.field(l)),u===null?s.delete(l):s.set(l,u),o=o.add(l)}return new Vc(n.key,s,new Zi(o.toArray()),Da.none())}}function KM(n,e,t){n instanceof lp?(function(o,l,u){const h=o.value.clone(),f=IN(o.fieldTransforms,l,u.transformResults);h.setAll(f),l.convertToFoundDocument(u.version,h).setHasCommittedMutations()})(n,e,t):n instanceof Vc?(function(o,l,u){if(!TB(o.precondition,l))return void l.convertToUnknownDocument(u.version);const h=IN(o.fieldTransforms,l,u.transformResults),f=l.data;f.setAll(DT(o)),f.setAll(h),l.convertToFoundDocument(u.version,f).setHasCommittedMutations()})(n,e,t):(function(o,l,u){l.convertToNoDocument(u.version).setHasCommittedMutations()})(0,e,t)}function fm(n,e,t,s){return n instanceof lp?(function(l,u,h,f){if(!TB(l.precondition,u))return h;const p=l.value.clone(),x=ON(l.fieldTransforms,f,u);return p.setAll(x),u.convertToFoundDocument(u.version,p).setHasLocalMutations(),null})(n,e,t,s):n instanceof Vc?(function(l,u,h,f){if(!TB(l.precondition,u))return h;const p=ON(l.fieldTransforms,f,u),x=u.data;return x.setAll(DT(l)),x.setAll(p),u.convertToFoundDocument(u.version,x).setHasLocalMutations(),h===null?null:h.unionWith(l.fieldMask.fields).unionWith(l.fieldTransforms.map((b=>b.field)))})(n,e,t,s):(function(l,u,h){return TB(l.precondition,u)?(u.convertToNoDocument(u.version).setHasLocalMutations(),null):h})(n,e,t)}function QM(n,e){let t=null;for(const s of n.fieldTransforms){const o=e.data.field(s.field),l=vT(s.transform,o||null);l!=null&&(t===null&&(t=hi.empty()),t.set(s.field,l))}return t||null}function RN(n,e){return n.type===e.type&&!!n.key.isEqual(e.key)&&!!n.prec
1438ondition.isEqual(e.precondition)&&!!(function(s,o){return s===void 0&&o===void 0||!(!s||!o)&&xh(s,o,((l,u)=>$M(l,u)))})(n.fieldTransforms,e.fieldTransforms)&&(n.type===0?n.value.isEqual(e.value):n.type!==1||n.data.isEqual(e.data)&&n.fieldMask.isEqual(e.fieldMask))}class lp extends Pg{constructor(e,t,s,o=[]){super(),this.key=e,this.value=t,this.precondition=s,this.fieldTransforms=o,this.type=0}getFieldMask(){return null}}class Vc extends Pg{constructor(e,t,s,o,l=[]){super(),this.key=e,this.data=t,this.fieldMask=s,this.precondition=o,this.fieldTransforms=l,this.type=1}getFieldMask(){return this.fieldMask}}function DT(n){const e=new Map;return n.fieldMask.fields.forEach((t=>{if(!t.isEmpty()){const s=n.data.field(t);e.set(t,s)}})),e}function IN(n,e,t){const s=new Map;pt(n.length===t.length,32656,{T:t.length,P:n.length});for(let o=0;o<t.length;o++){const l=n[o],u=l.transform,h=e.data.field(l.field);s.set(l.field,qM(u,h,t[o]))}return s}function ON(n,e,t){const s=new Map;for(const o of n){const l=o.transform,u=t.data.field(o.field);s.set(o.field,HM(l,u,e))}return s}class P1 extends Pg{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class YM extends Pg{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}/** 1439 * @license 1440 * Copyright 2022 Google LLC 1441 * 1442 * Licensed under the Apache License, Version 2.0 (the "License"); 1443 * you may not use this file except in compliance with the License. 1444 * You may obtain a copy of the License at 1445 * 1446 * http://www.apache.org/licenses/LICENSE-2.0 1447 * 1448 * Unless required by applicable law or agreed to in writing, software 1449 * distributed under the License is distributed on an "AS IS" BASIS, 1450 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1451 * See the License for the specific language governing permissions and 1452 * limitations under the License. 1453 */class sg{constructor(e,t){this.position=e,this.inclusive=t}}function LN(n,e,t){let s=0;for(let o=0;o<n.position.length;o++){const l=e[o],u=n.position[o];if(l.field.isKeyField()?s=gt.comparator(gt.fromName(u.referenceValue),t.key):s=Ri(u,t.data.field(l.field)),l.dir==="desc"&&(s*=-1),s!==0)break}return s}function MN(n,e){if(n===null)return e===null;if(e===null||n.inclusive!==e.inclusive||n.position.length!==e.position.length)return!1;for(let t=0;t<n.position.length;t++)if(!Ta(n.position[t],e.position[t]))return!1;return!0}/** 1454 * @license 1455 * Copyright 2022 Google LLC 1456 * 1457 * Licensed under the Apache License, Version 2.0 (the "License"); 1458 * you may not use this file except in compliance with the License. 1459 * You may obtain a copy of the License at 1460 * 1461 * http://www.apache.org/licenses/LICENSE-2.0 1462 * 1463 * Unless required by applicable law or agreed to in writing, software 1464 * distributed under the License is distributed on an "AS IS" BASIS, 1465 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1466 * See the License for the specific language governing permissions and 1467 * limitations under the License. 1468 */class TT{}class sr extends TT{constructor(e,t,s){super(),this.field=e,this.op=t,this.value=s}static create(e,t,s){return e.isKeyField()?t==="in"||t==="not-in"?this.createKeyFieldInFilter(e,t,s):new WM(e,t,s):t==="array-contains"?new tP(e,s):t==="in"?new nP(e,s):t==="not-in"?new sP(e,s):t==="array-contains-any"?new rP(e,s):new sr(e,t,s)}static createKeyFieldInFilter(e,t,s){return t==="in"?new ZM(e,s):new eP(e,s)}matches(e){const t=e.data.field(this.field);return this.op==="!="?t!==null&&t.nullValue===void 0&&this.matchesComparison(Ri(t,this.value)):t!==null&&lr(this.value)===lr(t)&&this.matchesComparison(Ri(t,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 Ct(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class Ua extends TT{constructor(e,t){super(),this.filters=e,this.op=t,this.I=null}static create(e,t){return new Ua(e,t)}matches(e){return ST(this)?this.filters.find((t=>!t.matches(e)))===void 0:this.filters.find((t=>t.matches(e)))!==void 0}getFlattenedFilters(){return this.I!==null||(this.I=this.filters.reduce(((e,t)=>e.concat(t.getFlattenedFilters())),[])),this.I}getFilters(){return Object.assign([],this.filters)}}function ST(n){return n.op==="and"}function jT(n){return XM(n)&&ST(n)}function XM(n){for(const e of n.filters)if(e instanceof Ua)return!1;return!0}function qy(n){if(n instanceof sr)return n.field.canonicalString()+n.op.toString()+yh(n.value);if(jT(n))return n.filters.map((e=>qy(e))).join(",");{const e=n.filters.map((t=>qy(t))).join(",");return`${n.op}(${e})`}}function AT(n,e){return n instanceof sr?(function(s,o){return o instanceof sr&&s.op===o.op&&s.field.isEqual(o.field)&&Ta(s.value,o.value)})(n,e):n instanceof Ua?(function(s,o){return o instanceof Ua&&s.op===o.op&&s.filters.length===o.filters.length?s.filters.reduce(((l,u,h)=>l&&AT(u,o.filters[h])),!0):!1})(n,e):void Ct(19439)}function kT(n){return n instanceof sr?(function(t){return`${t.field.canonicalString()} ${t.op} ${yh(t.value)}`})(n):n instanceof Ua?(function(t){return t.op.toString()+" {"+t.getFilters().map(kT).join(" ,")+"}"})(n):"Filter"}class WM extends sr{constructor(e,t,s){super(e,t,s),this.key=gt.fromName(s.referenceValue)}matches(e){const t=gt.comparator(e.key,this.key);return this.matchesComparison(t)}}class ZM extends sr{constructor(e,t){super(e,"in",t),this.keys=RT("in",t)}matches(e){return this.keys.some((t=>t.isEqual(e.key)))}}class eP extends sr{constructor(e,t){super(e,"not-in",t),this.keys=RT("not-in",t)}matches(e){return!this.keys.some((t=>t.isEqual(e.key)))}}function RT(n,e){var t;return(((t=e.arrayValue)==null?void 0:t.values)||[]).map((s=>gt.fromName(s.referenceValue)))}class tP extends sr{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return vh(t)&&Pm(t.arrayValue,this.value)}}class nP extends sr{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return t!==null&&Pm(this.value.arrayValue,t)}}class sP extends sr{constructor(e,t){super(e,"not-in",t)}matches(e){if(Pm(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return t!==null&&t.nullValue===void 0&&!Pm(this.value.arrayValue,t)}}class rP extends sr{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!vh(t)||!t.arrayValue.values)&&t.arrayValue.values.some((s=>Pm(this.value.arrayValue,s)))}}/** 1469 * @license 1470 * Copyright 2022 Google LLC 1471 * 1472 * Licensed under the Apache License, Version 2.0 (the "License");
1473 * you may not use this file except in compliance with the License. 1474 * You may obtain a copy of the License at 1475 * 1476 * http://www.apache.org/licenses/LICENSE-2.0 1477 * 1478 * Unless required by applicable law or agreed to in writing, software 1479 * distributed under the License is distributed on an "AS IS" BASIS, 1480 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1481 * See the License for the specific language governing permissions and 1482 * limitations under the License. 1483 */class Vm{constructor(e,t="asc"){this.field=e,this.dir=t}}function iP(n,e){return n.dir===e.dir&&n.field.isEqual(e.field)}/** 1484 * @license 1485 * Copyright 2017 Google LLC 1486 * 1487 * Licensed under the Apache License, Version 2.0 (the "License"); 1488 * you may not use this file except in compliance with the License. 1489 * You may obtain a copy of the License at 1490 * 1491 * http://www.apache.org/licenses/LICENSE-2.0 1492 * 1493 * Unless required by applicable law or agreed to in writing, software 1494 * distributed under the License is distributed on an "AS IS" BASIS, 1495 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1496 * See the License for the specific language governing permissions and 1497 * limitations under the License. 1498 */class zt{static fromTimestamp(e){return new zt(e)}static min(){return new zt(new Qn(0,0))}static max(){return new zt(new Qn(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}}/** 1499 * @license 1500 * Copyright 2017 Google LLC 1501 * 1502 * Licensed under the Apache License, Version 2.0 (the "License"); 1503 * you may not use this file except in compliance with the License. 1504 * You may obtain a copy of the License at 1505 * 1506 * http://www.apache.org/licenses/LICENSE-2.0 1507 * 1508 * Unless required by applicable law or agreed to in writing, software 1509 * distributed under the License is distributed on an "AS IS" BASIS, 1510 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1511 * See the License for the specific language governing permissions and 1512 * limitations under the License. 1513 */class $r{constructor(e,t,s,o,l,u,h){this.key=e,this.documentType=t,this.version=s,this.readTime=o,this.createTime=l,this.data=u,this.documentState=h}static newInvalidDocument(e){return new $r(e,0,zt.min(),zt.min(),zt.min(),hi.empty(),0)}static newFoundDocument(e,t,s,o){return new $r(e,1,t,zt.min(),s,o,0)}static newNoDocument(e,t){return new $r(e,2,t,zt.min(),zt.min(),hi.empty(),0)}static newUnknownDocument(e,t){return new $r(e,3,t,zt.min(),zt.min(),hi.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(zt.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=hi.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=hi.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=zt.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 $r&&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 $r(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}})`}}
1513/** 1514 * @license 1515 * Copyright 2021 Google LLC 1516 * 1517 * Licensed under the Apache License, Version 2.0 (the "License"); 1518 * you may not use this file except in compliance with the License. 1519 * You may obtain a copy of the License at 1520 * 1521 * http://www.apache.org/licenses/LICENSE-2.0 1522 * 1523 * Unless required by applicable law or agreed to in writing, software 1524 * distributed under the License is distributed on an "AS IS" BASIS, 1525 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1526 * See the License for the specific language governing permissions and 1527 * limitations under the License. 1528 */const Um=-1;function aP(n,e){const t=n.toTimestamp().seconds,s=n.toTimestamp().nanoseconds+1,o=zt.fromTimestamp(s===1e9?new Qn(t+1,0):new Qn(t,s));return new kc(o,gt.empty(),e)}function oP(n){return new kc(n.readTime,n.key,Um)}class kc{constructor(e,t,s){this.readTime=e,this.documentKey=t,this.largestBatchId=s}static min(){return new kc(zt.min(),gt.empty(),Um)}static max(){return new kc(zt.max(),gt.empty(),Um)}}function lP(n,e){let t=n.readTime.compareTo(e.readTime);return t!==0?t:(t=gt.comparator(n.documentKey,e.documentKey),t!==0?t:dn(n.largestBatchId,e.largestBatchId))}/** 1529 * @license 1530 * Copyright 2019 Google LLC 1531 * 1532 * Licensed under the Apache License, Version 2.0 (the "License"); 1533 * you may not use this file except in compliance with the License. 1534 * You may obtain a copy of the License at 1535 * 1536 * http://www.apache.org/licenses/LICENSE-2.0 1537 * 1538 * Unless required by applicable law or agreed to in writing, software 1539 * distributed under the License is distributed on an "AS IS" BASIS, 1540 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1541 * See the License for the specific language governing permissions and 1542 * limitations under the License. 1543 */class cP{constructor(e,t=null,s=[],o=[],l=null,u=null,h=null){this.path=e,this.collectionGroup=t,this.orderBy=s,this.filters=o,this.limit=l,this.startAt=u,this.endAt=h,this.R=null}}function PN(n,e=null,t=[],s=[],o=null,l=null,u=null){return new cP(n,e,t,s,o,l,u)}function IT(n){const e=$t(n);if(e.R===null){let t=e.path.canonicalString();e.collectionGroup!==null&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map((s=>qy(s))).join(","),t+="|ob:",t+=e.orderBy.map((s=>(function(l){return l.field.canonicalString()+l.dir})(s))).join(","),Og(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map((s=>yh(s))).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map((s=>yh(s))).join(",")),e.R=t}return e.R}function OT(n,e){if(n.limit!==e.limit||n.orderBy.length!==e.orderBy.length)return!1;for(let t=0;t<n.orderBy.length;t++)if(!iP(n.orderBy[t],e.orderBy[t]))return!1;if(n.filters.length!==e.filters.length)return!1;for(let t=0;t<n.filters.length;t++)if(!AT(n.filters[t],e.filters[t]))return!1;return n.collectionGroup===e.collectionGroup&&!!n.path.isEqual(e.path)&&!!MN(n.startAt,e.startAt)&&MN(n.endAt,e.endAt)}function yu(n){return!!n.isCorePipeline}function LT(n){return!!n.path&>.isDocumentKey(n.path)&&n.collectionGroup===null&&n.filters.length===0}/** 1544 * @license 1545 * Copyright 2017 Google LLC 1546 * 1547 * Licensed under the Apache License, Version 2.0 (the "License"); 1548 * you may not use this file except in compliance with the License. 1549 * You may obtain a copy of the License at 1550 * 1551 * http://www.apache.org/licenses/LICENSE-2.0 1552 * 1553 * Unless required by applicable law or agreed to in writing, software 1554 * distributed under the License is distributed on an "AS IS" BASIS, 1555 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1556 * See the License for the specific language governing permissions and 1557 * limitations under the License. 1558 */class Ah{constructor(e,t=null,s=[],o=[],l=null,u="F",h=null,f=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=s,this.filters=o,this.limit=l,this.limitType=u,this.startAt=h,this.endAt=f,this.A=null,this.V=null,this.m=null,this.startAt,this.endAt}}function uP(n,e,t,s,o,l,u,h){return new Ah(n,e,t,s,o,l,u,h)}function zg(n){return new Ah(n)}function zN(n){return n.filters.length===0&&n.limit===null&&n.startAt==null&&n.endAt==null&&(n.explicitOrderBy.length===0||n.explicitOrderBy.length===1&&n.explicitOrderBy[0].field.isKeyField())}function dP(n){return gt.isDocumentKey(n.path)&&n.collectionGroup===null&&n.filters.length===0}function MT(n){return n.collectionGroup!==null}function mm(n){const e=$t(n);if(e.A===null){e.A=[];const t=new Set;for(const l of e.explicitOrderBy)e.A.push(l),t.add(l.field.canonicalString());const s=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(u){let h=new ar(na.comparator);
1558return u.filters.forEach((f=>{f.getFlattenedFilters().forEach((p=>{p.isInequality()&&(h=h.add(p.field))}))})),h})(e).forEach((l=>{t.has(l.canonicalString())||l.isKeyField()||e.A.push(new Vm(l,s))})),t.has(na.keyField().canonicalString())||e.A.push(new Vm(na.keyField(),s))}return e.A}function Do(n){const e=$t(n);return e.V||(e.V=hP(e,mm(n))),e.V}function hP(n,e){if(n.limitType==="F")return PN(n.path,n.collectionGroup,e,n.filters,n.limit,n.startAt,n.endAt);{e=e.map((o=>{const l=o.dir==="desc"?"asc":"desc";return new Vm(o.field,l)}));const t=n.endAt?new sg(n.endAt.position,n.endAt.inclusive):null,s=n.startAt?new sg(n.startAt.position,n.startAt.inclusive):null;return PN(n.path,n.collectionGroup,e,n.filters,n.limit,t,s)}}function $y(n,e){const t=n.filters.concat([e]);return new Ah(n.path,n.collectionGroup,n.explicitOrderBy.slice(),t,n.limit,n.limitType,n.startAt,n.endAt)}function fP(n,e){const t=n.explicitOrderBy.concat([e]);return new Ah(n.path,n.collectionGroup,t,n.filters.slice(),n.limit,n.limitType,n.startAt,n.endAt)}function rg(n,e,t){return new Ah(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),e,t,n.startAt,n.endAt)}function mP(n,e){return OT(Do(n),Do(e))&&n.limitType===e.limitType}function pm(n){return`Query(target=${(function(t){let s=t.path.canonicalString();return t.collectionGroup!==null&&(s+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(s+=`, filters: [${t.filters.map((o=>kT(o))).join(", ")}]`),Og(t.limit)||(s+=", limit: "+t.limit),t.orderBy.length>0&&(s+=`, orderBy: [${t.orderBy.map((o=>(function(u){return`${u.field.canonicalString()} (${u.dir})`})(o))).join(", ")}]`),t.startAt&&(s+=", startAt: ",s+=t.startAt.inclusive?"b:":"a:",s+=t.startAt.position.map((o=>yh(o))).join(",")),t.endAt&&(s+=", endAt: ",s+=t.endAt.inclusive?"a:":"b:",s+=t.endAt.position.map((o=>yh(o))).join(",")),`Target(${s})`})(Do(n))}; limitType=${n.limitType})`}function Fg(n,e){return e.isFoundDocument()&&(function(s,o){const l=o.key.path;return s.collectionGroup!==null?o.key.hasCollectionId(s.collectionGroup)&&s.path.isPrefixOf(l):gt.isDocumentKey(s.path)?s.path.isEqual(l):s.path.isImmediateParentOf(l)})(n,e)&&(function(s,o){for(const l of mm(s))if(!l.field.isKeyField()&&o.data.field(l.field)===null)return!1;return!0})(n,e)&&(function(s,o){for(const l of s.filters)if(!l.matches(o))return!1;return!0})(n,e)&&(function(s,o){return!(s.startAt&&!(function(u,h,f){const p=LN(u,h,f);return u.inclusive?p<=0:p<0})(s.startAt,mm(s),o)||s.endAt&&!(function(u,h,f){const p=LN(u,h,f);return u.inclusive?p>=0:p>0})(s.endAt,mm(s),o))})(n,e)}function z1(n){return(e,t)=>{let s=!1;for(const o of mm(n)){const l=pP(o,e,t);if(l!==0)return l;s=s||o.field.isKeyField()}return 0}}function pP(n,e,t){const s=n.field.isKeyField()?gt.comparator(e.key,t.key):(function(l,u,h){const f=u.data.field(l),p=h.data.field(l);return f!==null&&p!==null?Ri(f,p):Ct(42886)})(n.field,e,t);switch(n.dir){case"asc":return s;case"desc":return-1*s;default:return Ct(19790,{direction:n.dir})}}/** 1559 * @license 1560 * Copyright 2017 Google LLC 1561 * 1562 * Licensed under the Apache License, Version 2.0 (the "License"); 1563 * you may not use this file except in compliance with the License. 1564 * You may obtain a copy of the License at 1565 * 1566 * http://www.apache.org/licenses/LICENSE-2.0 1567 * 1568 * Unless required by applicable law or agreed to in writing, software 1569 * distributed under the License is distributed on an "AS IS" BASIS, 1570 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1571 * See the License for the specific language governing permissions and 1572 * limitations under the License. 1573 */class BP{constructor(e,t){this.count=e,this.unchangedNames=t}}/** 1574 * @license 1575 * Copyright 2017 Google LLC 1576 * 1577 * Licensed under the Apache License, Version 2.0 (the "License"); 1578 * you may not use this file except in compliance with the License. 1579 * You may obtain a copy of the License at 1580 * 1581 * http://www.apache.org/licenses/LICENSE-2.0 1582 * 1583 * Unless required by applicable law or agreed to in writing, software 1584 * distributed under the License is distributed on an "AS IS" BASIS, 1585 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1586 * See the License for the specific language governing permissions and 1587 * limitations under the License. 1588 */var tr,Nn;function gP(n){switch(n){case Ie.OK:return Ct(64938);case Ie.CANCELLED:case Ie.UNKNOWN:case Ie.DEADLINE_EXCEEDED:case Ie.RESOURCE_EXHAUSTED:case Ie.INTERNAL:case Ie.UNAVAILABLE:case Ie.UNAUTHENTICATED:return!1;case Ie.INVALID_ARGUMENT:case Ie.NOT_FOUND:case Ie.ALREADY_EXISTS:case Ie.PERMISSION_DENIED:case Ie.FAILED_PRECONDITION:case Ie.ABORTED:case Ie.OUT_OF_RANGE:case Ie.UNIMPLEMENT
1588ED:case Ie.DATA_LOSS:return!0;default:return Ct(15467,{code:n})}}function PT(n){if(n===void 0)return yl("GRPC error has no .code"),Ie.UNKNOWN;switch(n){case tr.OK:return Ie.OK;case tr.CANCELLED:return Ie.CANCELLED;case tr.UNKNOWN:return Ie.UNKNOWN;case tr.DEADLINE_EXCEEDED:return Ie.DEADLINE_EXCEEDED;case tr.RESOURCE_EXHAUSTED:return Ie.RESOURCE_EXHAUSTED;case tr.INTERNAL:return Ie.INTERNAL;case tr.UNAVAILABLE:return Ie.UNAVAILABLE;case tr.UNAUTHENTICATED:return Ie.UNAUTHENTICATED;case tr.INVALID_ARGUMENT:return Ie.INVALID_ARGUMENT;case tr.NOT_FOUND:return Ie.NOT_FOUND;case tr.ALREADY_EXISTS:return Ie.ALREADY_EXISTS;case tr.PERMISSION_DENIED:return Ie.PERMISSION_DENIED;case tr.FAILED_PRECONDITION:return Ie.FAILED_PRECONDITION;case tr.ABORTED:return Ie.ABORTED;case tr.OUT_OF_RANGE:return Ie.OUT_OF_RANGE;case tr.UNIMPLEMENTED:return Ie.UNIMPLEMENTED;case tr.DATA_LOSS:return Ie.DATA_LOSS;default:return Ct(39323,{code:n})}}(Nn=tr||(tr={}))[Nn.OK=0]="OK",Nn[Nn.CANCELLED=1]="CANCELLED",Nn[Nn.UNKNOWN=2]="UNKNOWN",Nn[Nn.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Nn[Nn.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Nn[Nn.NOT_FOUND=5]="NOT_FOUND",Nn[Nn.ALREADY_EXISTS=6]="ALREADY_EXISTS",Nn[Nn.PERMISSION_DENIED=7]="PERMISSION_DENIED",Nn[Nn.UNAUTHENTICATED=16]="UNAUTHENTICATED",Nn[Nn.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Nn[Nn.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Nn[Nn.ABORTED=10]="ABORTED",Nn[Nn.OUT_OF_RANGE=11]="OUT_OF_RANGE",Nn[Nn.UNIMPLEMENTED=12]="UNIMPLEMENTED",Nn[Nn.INTERNAL=13]="INTERNAL",Nn[Nn.UNAVAILABLE=14]="UNAVAILABLE",Nn[Nn.DATA_LOSS=15]="DATA_LOSS";/** 1589 * @license 1590 * Copyright 2017 Google LLC 1591 * 1592 * Licensed under the Apache License, Version 2.0 (the "License"); 1593 * you may not use this file except in compliance with the License. 1594 * You may obtain a copy of the License at 1595 * 1596 * http://www.apache.org/licenses/LICENSE-2.0 1597 * 1598 * Unless required by applicable law or agreed to in writing, software 1599 * distributed under the License is distributed on an "AS IS" BASIS, 1600 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1601 * See the License for the specific language governing permissions and 1602 * limitations under the License. 1603 */class Ju{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),s=this.inner[t];if(s!==void 0){for(const[o,l]of s)if(this.equalsFn(o,e))return l}}has(e){return this.get(e)!==void 0}set(e,t){const s=this.mapKeyFn(e),o=this.inner[s];if(o===void 0)return this.inner[s]=[[e,t]],void this.innerSize++;for(let l=0;l<o.length;l++)if(this.equalsFn(o[l][0],e))return void(o[l]=[e,t]);o.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),s=this.inner[t];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[t]:s.splice(o,1),this.innerSize--,!0;return!1}forEach(e){Fc(this.inner,((t,s)=>{for(const[o,l]of s)e(o,l)}))}isEmpty(){return dT(this.inner)}size(){return this.innerSize}}/** 1604 * @license 1605 * Copyright 2017 Google LLC 1606 * 1607 * Licensed under the Apache License, Version 2.0 (the "License"); 1608 * you may not use this file except in compliance with the License. 1609 * You may obtain a copy of the License at 1610 * 1611 * http://www.apache.org/licenses/LICENSE-2.0 1612 * 1613 * Unless required by applicable law or agreed to in writing, software 1614 * distributed under the License is distributed on an "AS IS" BASIS, 1615 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1616 * See the License for the specific language governing permissions and 1617 * limitations under the License. 1618 */const xP=new vs(gt.comparator);function Si(){return xP}const zT=new vs(gt.comparator);function Yd(...n){let e=zT;for(const t of n)e=e.insert(t.key,t);return e}function FT(n){let e=zT;return n.forEach(((t,s)=>e=e.insert(t,s.overlayedDocument))),e}function fc(){return Bm()}function VT(){return Bm()}function Bm(){return new Ju((n=>n.toString()),((n,e)=>n.isEqual(e)))}const bP=new vs(gt.comparator),CP=new ar(gt.comparator);function an(...n){let e=CP;for(const t of n)e=e.add(t);return e}const yP=new ar(dn);function vP(){return yP}/** 1619 * @license 1620 * Copyright 2023 Google LLC 1621 * 1622 * Licensed under the Apache License, Version 2.0 (the "License");
1623 * you may not use this file except in compliance with the License. 1624 * You may obtain a copy of the License at 1625 * 1626 * http://www.apache.org/licenses/LICENSE-2.0 1627 * 1628 * Unless required by applicable law or agreed to in writing, software 1629 * distributed under the License is distributed on an "AS IS" BASIS, 1630 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1631 * See the License for the specific language governing permissions and 1632 * limitations under the License. 1633 */function _P(){return new TextEncoder}/** 1634 * @license 1635 * Copyright 2022 Google LLC 1636 * 1637 * Licensed under the Apache License, Version 2.0 (the "License"); 1638 * you may not use this file except in compliance with the License. 1639 * You may obtain a copy of the License at 1640 * 1641 * http://www.apache.org/licenses/LICENSE-2.0 1642 * 1643 * Unless required by applicable law or agreed to in writing, software 1644 * distributed under the License is distributed on an "AS IS" BASIS, 1645 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1646 * See the License for the specific language governing permissions and 1647 * limitations under the License. 1648 */const wP=new _c([4294967295,4294967295],0);function FN(n){const e=_P().encode(n),t=new WD;return t.update(e),new Uint8Array(t.digest())}function VN(n){const e=new DataView(n.buffer),t=e.getUint32(0,!0),s=e.getUint32(4,!0),o=e.getUint32(8,!0),l=e.getUint32(12,!0);return[new _c([t,s],0),new _c([o,l],0)]}class F1{constructor(e,t,s){if(this.bitmap=e,this.padding=t,this.hashCount=s,t<0||t>=8)throw new sm(`Invalid padding: ${t}`);if(s<0)throw new sm(`Invalid hash count: ${s}`);if(e.length>0&&this.hashCount===0)throw new sm(`Invalid hash count: ${s}`);if(e.length===0&&t!==0)throw new sm(`Invalid padding when bitmap length is 0: ${t}`);this.p=8*e.length-t,this.S=_c.fromNumber(this.p)}v(e,t,s){let o=e.add(t.multiply(_c.fromNumber(s)));return o.compare(wP)===1&&(o=new _c([o.getBits(0),o.getBits(1)],0)),o.modulo(this.S).toNumber()}D(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(this.p===0)return!1;const t=FN(e),[s,o]=VN(t);for(let l=0;l<this.hashCount;l++){const u=this.v(s,o,l);if(!this.D(u))return!1}return!0}static create(e,t,s){const o=e%8==0?0:8-e%8,l=new Uint8Array(Math.ceil(e/8)),u=new F1(l,o,t);return s.forEach((h=>u.insert(h))),u}insert(e){if(this.p===0)return;const t=FN(e),[s,o]=VN(t);for(let l=0;l<this.hashCount;l++){const u=this.v(s,o,l);this.C(u)}}C(e){const t=Math.floor(e/8),s=e%8;this.bitmap[t]|=1<<s}}class sm extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}/** 1649 * @license 1650 * Copyright 2017 Google LLC 1651 * 1652 * Licensed under the Apache License, Version 2.0 (the "License"); 1653 * you may not use this file except in compliance with the License. 1654 * You may obtain a copy of the License at 1655 * 1656 * http://www.apache.org/licenses/LICENSE-2.0 1657 * 1658 * Unless required by applicable law or agreed to in writing, software 1659 * distributed under the License is distributed on an "AS IS" BASIS, 1660 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1661 * See the License for the specific language governing permissions and 1662 * limitations under the License. 1663 */class cp{constructor(e,t,s,o,l,u){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=s,this.documentUpdates=o,this.augmentedDocumentUpdates=l,this.resolvedLimboDocuments=u}static createSynthesizedRemoteEventForCurrentChange(e,t,s){const o=new Map;return o.set(e,up.createSynthesizedTargetChangeForCurrentChange(e,t,s)),new cp(zt.min(),o,new vs(dn),Si(),Si(),an())}}class up{constructor(e,t,s,o,l){this.resumeToken=e,this.current=t,this.addedDocuments=s,this.modifiedDocuments=o,this.removedDocuments=l}static createSynthesizedTargetChangeForCurrentChange(e,t,s){return new up(s,t,an(),an(),an())}}/** 1664 * @license 1665 * Copyright 2017 Google LLC 1666 * 1667 * Licensed under the Apache License, Version 2.0 (the "License"); 1668 * you may not use this file except in compliance with the License. 1669 * You may obtain a copy of the License at 1670 * 1671 * http://www.apache.org/licenses/LICENSE-2.0 1672 * 1673 * Unless required by applicable law or agreed to in writing, softw
1673are 1674 * distributed under the License is distributed on an "AS IS" BASIS, 1675 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1676 * See the License for the specific language governing permissions and 1677 * limitations under the License. 1678 */class SB{constructor(e,t,s,o){this.F=e,this.removedTargetIds=t,this.key=s,this.O=o}}class UT{constructor(e,t){this.targetId=e,this.M=t}}class GT{constructor(e,t,s=or.EMPTY_BYTE_STRING,o=null){this.state=e,this.targetIds=t,this.resumeToken=s,this.cause=o}}class UN{constructor(e){this.targetId=e,this.N=0,this.L=GN(),this.B=or.EMPTY_BYTE_STRING,this.U=!1,this.k=!0}get current(){return this.U}get resumeToken(){return this.B}get q(){return this.N!==0}get $(){return this.k}K(e){e.approximateByteSize()>0&&(this.k=!0,this.B=e)}W(){let e=an(),t=an(),s=an();return this.L.forEach(((o,l)=>{switch(l){case 0:e=e.add(o);break;case 2:t=t.add(o);break;case 1:s=s.add(o);break;default:Ct(38017,{changeType:l})}})),new up(this.B,this.U,e,t,s)}G(){this.k=!1,this.L=GN()}j(e,t){this.k=!0,this.L=this.L.insert(e,t)}H(e){this.k=!0,this.L=this.L.remove(e)}J(){this.N+=1}Y(){this.N-=1,pt(this.N>=0,3241,{N:this.N,targetId:this.targetId})}Z(){this.k=!0,this.U=!0}}const Qf="WatchChangeAggregator";class EP{constructor(e){this.X=e,this.ee=new Map,this.te=Si(),this.ne=nB(),this.re=Si(),this.ie=nB(),this.se=new vs(dn)}_e(e){for(const t of e.F)e.O&&e.O.isFoundDocument()?this.oe(t,e.O):this.ae(t,e.key,e.O);for(const t of e.removedTargetIds)this.ae(t,e.key,e.O)}ue(e){this.forEachTarget(e,(t=>{const s=this.ee.get(t);if(s)switch(e.state){case 0:this.ce(t)&&s.K(e.resumeToken);break;case 1:s.Y(),s.q||s.G(),s.K(e.resumeToken);break;case 2:s.Y(),s.q||this.removeTarget(t);break;case 3:this.ce(t)&&(s.Z(),s.K(e.resumeToken));break;case 4:this.ce(t)&&(this.le(t),s.K(e.resumeToken));break;default:Ct(56790,{state:e.state})}else rt(Qf,`handleTargetChange received targetChange for untracked target ID (${t}) with state (${e.state})`)}))}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.ee.forEach(((s,o)=>{this.ce(o)&&t(o)}))}Ee(e){var t;return yu(e)?e.getPipelineSourceType()==="documents"&&((t=e.getPipelineDocuments())==null?void 0:t.length)===1:LT(e)}he(e){const t=e.targetId,s=e.M.count,o=this.Te(t);if(o){const l=o.target;if(this.Ee(l))if(s===0){const u=new gt(yu(l)?Pn.fromString(l.getPipelineDocuments()[0]):l.path);this.ae(t,u,$r.newNoDocument(u,zt.min()))}else pt(s===1,20013,"Single document existence filter with count: "+s);else{const u=this.Pe(t);if(u!==s){const h=this.Ie(e),f=h?this.Re(h,e,u):1;if(f!==0){this.le(t);const p=f===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.se=this.se.insert(t,p)}}}}}Ie(e){const t=e.M.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:s="",padding:o=0},hashCount:l=0}=t;let u,h;try{u=jc(s).toUint8Array()}catch(f){if(f instanceof mT)return Va("Decoding the base64 bloom filter in existence filter failed ("+f.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw f}try{h=new F1(u,o,l)}catch(f){return Va(f instanceof sm?"BloomFilter error: ":"Applying bloom filter failed: ",f),null}return h.p===0?null:h}Re(e,t,s){return t.M.count===s-this.de(e,t.targetId)?0:2}de(e,t){const s=this.X.getRemoteKeysForTarget(t);let o=0;return s.forEach((l=>{const u=this.X.Ve(),h=`projects/${u.projectId}/databases/${u.database}/documents/${l.path.canonicalString()}`;e.mightContain(h)||(this.ae(t,l,null),o++)})),o}fe(e){const t=new Map;this.ee.forEach(((l,u)=>{const h=this.Te(u);if(h){if(l.current&&this.Ee(h.target)){const f=yu(h.target)?Pn.fromString(h.target.getPipelineDocuments()[0]):h.target.path,p=new gt(f);this.me(p).has(u)||this.pe(u,p)||this.ae(u,p,$r.newNoDocument(p,e))}l.$&&(t.set(u,l.W()),l.G())}}));let s=an();this.ie.forEach(((l,u)=>{let h=!0;u.forEachWhile((f=>{const p=this.Te(f);return!p||p.purpose==="TargetPurposeLimboResolution"||(h=!1,!1)})),h&&(s=s.add(l))})),this.te.forEach(((l,u)=>u.setReadTime(e))),this.re.forEach(((l,u)=>u.setReadTime(e)));const o=new cp(e,t,this.se,this.te,this.re,s);return this.te=Si(),this.ne=nB(),this.re=Si(),this.ie=nB(),this.se=new vs(dn),o}oe(e,t){const s=this.ee.get(e);if(!s||!this.ce(e))return void rt(Qf,`addDocumentToTarget received document for unknown inactive target (${e})`);const o=this.pe(e,t.key)?2:0;s.j(t.key,o),yu(this.Te(e).target)&&this.Te(e).target.getPipelineFlavor()!=="exact"?this.re=this.re.insert(t.key,t):this.te=this.te.insert(t.key,t),this.ne=this.ne.insert(t.key,this.me(t.key).add(e)),this.ie=this.ie.insert(t.key,this.ge(t.key).add(e))}ae(e,t,s){const o=this.ee.get(e);o&&this.ce(e)?(this.pe(e,t)?o.j(t,1):o.H(t),this.ie=this.ie.insert(t,this.ge(t).delete(e)),this.ie=this.ie.insert(t,this.ge(t).add(e)),s&&(yu(this.Te(e).target)&&this.Te(e).target.getPipelineFlavor()!=="exact"?this.re=this.re.insert(t,s):this.te=this.te.insert(t,s))):rt(Qf,`removeDocumentFromTarget received document for unknown or inactive target (${e})`)}removeTarget(e){this.ee.delete(e)}Pe(e){const t=this.ee.get(e);if(!t)return 0;const s=t.W();return this.X.getRemoteKeysForTarget(e).size+s.addedDocuments.size-s.removedDocuments.size}J(e){let t=this.ee.get(e);t||(rt(Qf,`recordPendingTargetRequest set up tracking for target ID ${e}`),t=new UN(e),this.ee.set(e,t)),t.J()}ge(e){let t=this.ie.get(e);return t||(t=new ar(dn),this.ie=this.ie.insert(e,t)),t}
1678me(e){let t=this.ne.get(e);return t||(t=new ar(dn),this.ne=this.ne.insert(e,t)),t}ce(e){const t=this.Te(e)!==null;return t||rt(Qf,"Detected inactive target",e),t}Te(e){const t=this.ee.get(e);return t===void 0||t.q?null:this.X.ye(e)}le(e){this.ee.set(e,new UN(e)),this.X.getRemoteKeysForTarget(e).forEach((t=>{this.ae(e,t,null)}))}pe(e,t){return this.X.getRemoteKeysForTarget(e).has(t)}}function nB(){return new vs(gt.comparator)}function GN(){return new vs(gt.comparator)}const NP={asc:"ASCENDING",desc:"DESCENDING"},DP={"<":"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"},TP={and:"AND",or:"OR"};class SP{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function Jy(n,e){return n.useProto3Json||Og(e)?e:{value:e}}function gm(n,e){return n.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function V1(n){const e=Sc(n);return new Qn(e.seconds,e.nanos)}function HT(n,e){return n.useProto3Json?e.toBase64():e.toUint8Array()}function jB(n,e){return gm(n,e.toTimestamp())}function To(n){return pt(!!n,49232),zt.fromTimestamp(V1(n))}function U1(n,e){return Ky(n,e).canonicalString()}function Ky(n,e){const t=(function(o){return new Pn(["projects",o.projectId,"databases",o.database])})(n).child("documents");return e===void 0?t:t.child(e)}function qT(n){const e=Pn.fromString(n);return pt(YT(e),10190,{key:e.toString()}),e}function ig(n,e){return U1(n.databaseId,e.path)}function $C(n,e){const t=qT(e);if(t.get(1)!==n.databaseId.projectId)throw new Xe(Ie.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+n.databaseId.projectId);if(t.get(3)!==n.databaseId.database)throw new Xe(Ie.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+n.databaseId.database);return new gt(JT(t))}function $T(n,e){return U1(n.databaseId,e)}function jP(n){const e=qT(n);return e.length===4?Pn.emptyPath():JT(e)}function Qy(n){return new Pn(["projects",n.databaseId.projectId,"databases",n.databaseId.database]).canonicalString()}function JT(n){return pt(n.length>4&&n.get(4)==="documents",29091,{key:n.toString()}),n.popFirst(5)}function HN(n,e,t){return{name:ig(n,e),fields:t.value.mapValue.fields}}function AP(n,e){let t;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:Ct(39313,{state:p})})(e.targetChange.targetChangeType||"NO_CHANGE"),o=e.targetChange.targetIds||[],l=(function(p,x){return p.useProto3Json?(pt(x===void 0||typeof x=="string",58123),or.fromBase64String(x||"")):(pt(x===void 0||x instanceof Buffer||x instanceof Uint8Array,16193),or.fromUint8Array(x||new Uint8Array))})(n,e.targetChange.resumeToken),u=e.targetChange.cause,h=u&&(function(p){const x=p.code===void 0?Ie.UNKNOWN:PT(p.code);return new Xe(x,p.message||"")})(u);t=new GT(s,o,l,h||null)}else if("documentChange"in e){e.documentChange;const s=e.documentChange;s.document,s.document.name,s.document.updateTime;const o=$C(n,s.document.name),l=To(s.document.updateTime),u=s.document.createTime?To(s.document.createTime):zt.min(),h=new hi({mapValue:{fields:s.document.fields}}),f=$r.newFoundDocument(o,l,u,h),p=s.targetIds||[],x=s.removedTargetIds||[];t=new SB(p,x,f.key,f)}else if("documentDelete"in e){e.documentDelete;const s=e.documentDelete;s.document;const o=$C(n,s.document),l=s.readTime?To(s.readTime):zt.min(),u=$r.newNoDocument(o,l),h=s.removedTargetIds||[];t=new SB([],h,u.key,u)}else if("documentRemove"in e){e.documentRemove;const s=e.documentRemove;s.document;const o=$C(n,s.document),l=s.removedTargetIds||[];t=new SB([],l,o,null)}else{if(!("filter"in e))return Ct(11601,{we:e});{e.filter;const s=e.filter;s.targetId;const{count:o=0,unchangedNames:l}=s,u=new BP(o,l),h=s.targetId;t=new UT(h,u)}}return t}function kP(n,e){let t;if(e instanceof lp)t={update:HN(n,e.key,e.value)};else if(e instanceof P1)t={delete:ig(n,e.key)};else if(e instanceof Vc)t={update:HN(n,e.key,e.data),updateMask:UP(e.fieldMask)};else{if(!(e instanceof YM))return Ct(16599,{be:e.type});t={verify:ig(n,e.key)}}return e.fieldTransforms.length>0&&(t.updateTransforms=e.fieldTransforms.map((s=>(function(l,u){const h=u.transform;
1678if(h instanceof zm)return{fieldPath:u.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(h instanceof _h)return{fieldPath:u.field.canonicalString(),appendMissingElements:{values:h.elements}};if(h instanceof wh)return{fieldPath:u.field.canonicalString(),removeAllFromArray:{values:h.elements}};if(h instanceof Fm)return{fieldPath:u.field.canonicalString(),increment:h.h};if(h instanceof eg)return{fieldPath:u.field.canonicalString(),minimum:h.h};if(h instanceof tg)return{fieldPath:u.field.canonicalString(),maximum:h.h};throw Ct(20930,{transform:u.transform})})(0,s)))),e.precondition.isNone||(t.currentDocument=(function(o,l){return l.updateTime!==void 0?{updateTime:jB(o,l.updateTime)}:l.exists!==void 0?{exists:l.exists}:Ct(27497)})(n,e.precondition)),t}function RP(n,e){return n&&n.length>0?(pt(e!==void 0,14353),n.map((t=>(function(o,l){let u=o.updateTime?To(o.updateTime):To(l);return u.isEqual(zt.min())&&(u=To(l)),new JM(u,o.transformResults||[])})(t,e)))):[]}function IP(n,e){return{documents:[$T(n,e.path)]}}function OP(n,e){const t={structuredQuery:{}},s=e.path;let o;e.collectionGroup!==null?(o=s,t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(o=s.popLast(),t.structuredQuery.from=[{collectionId:s.lastSegment()}]),t.parent=$T(n,o);const l=(function(p){if(p.length!==0)return QT(Ua.create(p,"and"))})(e.filters);l&&(t.structuredQuery.where=l);const u=(function(p){if(p.length!==0)return p.map((x=>(function(C){return{field:Xd(C.field),direction:zP(C.dir)}})(x)))})(e.orderBy);u&&(t.structuredQuery.orderBy=u);const h=Jy(n,e.limit);return h!==null&&(t.structuredQuery.limit=h),e.startAt&&(t.structuredQuery.startAt=(function(p){return{before:p.inclusive,values:p.position}})(e.startAt)),e.endAt&&(t.structuredQuery.endAt=(function(p){return{before:!p.inclusive,values:p.position}})(e.endAt)),{Se:t,parent:o}}function LP(n){let e=jP(n.parent);const t=n.structuredQuery,s=t.from?t.from.length:0;let o=null;if(s>0){pt(s===1,65062);const x=t.from[0];x.allDescendants?o=x.collectionId:e=e.child(x.collectionId)}let l=[];t.where&&(l=(function(b){const C=KT(b);return C instanceof Ua&&jT(C)?C.getFilters():[C]})(t.where));let u=[];t.orderBy&&(u=(function(b){return b.map((C=>(function(T){return new Vm(Wd(T.field),(function(A){switch(A){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}})(T.direction))})(C)))})(t.orderBy));let h=null;t.limit&&(h=(function(b){let C;return C=typeof b=="object"?b.value:b,Og(C)?null:C})(t.limit));let f=null;t.startAt&&(f=(function(b){const C=!!b.before,N=b.values||[];return new sg(N,C)})(t.startAt));let p=null;return t.endAt&&(p=(function(b){const C=!b.before,N=b.values||[];return new sg(N,C)})(t.endAt)),uP(e,o,u,l,h,"F",f,p)}function MP(n,e){const t=(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 Ct(28987,{purpose:o})}})(e.purpose);return t==null?null:{"goog-listen-tags":t}}function PP(n,e){return{structuredPipeline:{pipeline:{stages:e.stages.map((t=>t._toProto(n)))}}}}function KT(n){return n.unaryFilter!==void 0?(function(t){switch(t.unaryFilter.op){case"IS_NAN":const s=Wd(t.unaryFilter.field);return sr.create(s,"==",{doubleValue:NaN});case"IS_NULL":const o=Wd(t.unaryFilter.field);return sr.create(o,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const l=Wd(t.unaryFilter.field);return sr.create(l,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const u=Wd(t.unaryFilter.field);return sr.create(u,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return Ct(61313);default:return Ct(60726)}})(n):n.fieldFilter!==void 0?(function(t){return sr.create(Wd(t.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 Ct(58110);default:return Ct(50506)}})(t.fieldFilter.op),t.fieldFilter.value)})(n):n.compositeFilter!==void 0?(function(t){return Ua.create(t.compositeFilter.filters.map((s=>KT(s))),(function(o){switch(o){case"AND":return"and";case"OR":return"or";default:return Ct(1026)}})(t.compositeFilter.op))})(n):Ct(30097,{filter:n})}function zP(n){return NP[n]}function FP(n){return DP[n]}function VP(n){return TP[n]}function Xd(n){return{fieldPath:n.canonicalString()}}function Wd(n){return na.fromServerFormat(n.fieldPath)}function QT(n){return n instanceof sr?(function(t){if(t.op==="=="){if(Ii(t.value))return{unaryFilter:{field:Xd(t.field),op:"IS_NAN"}};if(ea(t.value))return{unaryFilter:{field:Xd(t.field),op:"IS_NULL"}}}else if(t.op==="!="){if(Ii(t.value))return{unaryFilter:{field:Xd(t.field),op:"IS_NOT_NA
1678N"}};if(ea(t.value))return{unaryFilter:{field:Xd(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Xd(t.field),op:FP(t.op),value:t.value}}})(n):n instanceof Ua?(function(t){const s=t.getFilters().map((o=>QT(o)));return s.length===1?s[0]:{compositeFilter:{op:VP(t.op),filters:s}}})(n):Ct(54877,{filter:n})}function UP(n){const e=[];return n.fields.forEach((t=>e.push(t.canonicalString()))),{fieldPaths:e}}function YT(n){return n.length>=4&&n.get(0)==="projects"&&n.get(2)==="databases"}function XT(n){return!!n&&typeof n._toProto=="function"&&n._protoValueType==="ProtoValue"}function Gm(n,e){const t={fields:{}};return e.forEach(((s,o)=>{if(typeof o!="string")throw new Error(`Cannot encode map with non-string key: ${o}`);t.fields[o]=s._toProto(n)})),{mapValue:t}}function WT(n){return{stringValue:n}}/** 1679 * @license 1680 * Copyright 2020 Google LLC 1681 * 1682 * Licensed under the Apache License, Version 2.0 (the "License"); 1683 * you may not use this file except in compliance with the License. 1684 * You may obtain a copy of the License at 1685 * 1686 * http://www.apache.org/licenses/LICENSE-2.0 1687 * 1688 * Unless required by applicable law or agreed to in writing, software 1689 * distributed under the License is distributed on an "AS IS" BASIS, 1690 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1691 * See the License for the specific language governing permissions and 1692 * limitations under the License. 1693 */function Vg(n){return new SP(n,!0)}/** 1694 * @license 1695 * Copyright 2020 Google LLC 1696 * 1697 * Licensed under the Apache License, Version 2.0 (the "License"); 1698 * you may not use this file except in compliance with the License. 1699 * You may obtain a copy of the License at 1700 * 1701 * http://www.apache.org/licenses/LICENSE-2.0 1702 * 1703 * Unless required by applicable law or agreed to in writing, software 1704 * distributed under the License is distributed on an "AS IS" BASIS, 1705 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1706 * See the License for the specific language governing permissions and 1707 * limitations under the License. 1708 */class Ea{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Ea(or.fromBase64String(e))}catch(t){throw new Xe(Ie.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new Ea(or.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:Ea._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(ap(e,Ea._jsonSchema))return Ea.fromBase64String(e.bytes)}}Ea._jsonSchemaVersion="firestore/bytes/1.0",Ea._jsonSchema={type:ir("string",Ea._jsonSchemaVersion),bytes:ir("string")};/** 1709 * @license 1710 * Copyright 2020 Google LLC 1711 * 1712 * Licensed under the Apache License, Version 2.0 (the "License"); 1713 * you may not use this file except in compliance with the License. 1714 * You may obtain a copy of the License at 1715 * 1716 * http://www.apache.org/licenses/LICENSE-2.0 1717 * 1718 * Unless required by applicable law or agreed to in writing, software 1719 * distributed under the License is distributed on an "AS IS" BASIS, 1720 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1721 * See the License for the specific language governing permissions and 1722 * limitations under the License. 1723 */class Ug{constructor(...e){for(let t=0;t<e.length;++t)if(e[t].length===0)throw new Xe(Ie.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new na(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}function GP(){return new Ug(Co)}/** 1724 * @license 1725 * Copyright 2020 Google LLC 1726 * 1727 * Licensed under the Apache License, Version 2.0 (the "License"); 1728 * you may not use this file except in compliance with the License. 1729 * You may obtain a copy of the License at 1730 * 1731 * http://www.apache.org/licenses/LICENSE-2.0 1732 * 1733 * Unless required by applicable law or agreed to in writing, software 1734 * distributed under the License is distributed on an "AS IS" BASIS, 1735 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1736 * See the License for the specific language governing permissions and 1737 * limitations under the License. 1738 */class kh{constructor(e){this._methodName=e}}/** 1739 * @license 1740 * Copyright 2017 Google LLC 1741 * 1742 * Licensed under the Apache License, Version 2.0 (the "License");
1743 * you may not use this file except in compliance with the License. 1744 * You may obtain a copy of the License at 1745 * 1746 * http://www.apache.org/licenses/LICENSE-2.0 1747 * 1748 * Unless required by applicable law or agreed to in writing, software 1749 * distributed under the License is distributed on an "AS IS" BASIS, 1750 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1751 * See the License for the specific language governing permissions and 1752 * limitations under the License. 1753 */class So{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new Xe(Ie.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new Xe(Ie.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return dn(this._lat,e._lat)||dn(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:So._jsonSchemaVersion}}static fromJSON(e){if(ap(e,So._jsonSchema))return new So(e.latitude,e.longitude)}}So._jsonSchemaVersion="firestore/geoPoint/1.0",So._jsonSchema={type:ir("string",So._jsonSchemaVersion),latitude:ir("number"),longitude:ir("number")};/** 1754 * @license 1755 * Copyright 2017 Google LLC 1756 * 1757 * Licensed under the Apache License, Version 2.0 (the "License"); 1758 * you may not use this file except in compliance with the License. 1759 * You may obtain a copy of the License at 1760 * 1761 * http://www.apache.org/licenses/LICENSE-2.0 1762 * 1763 * Unless required by applicable law or agreed to in writing, software 1764 * distributed under the License is distributed on an "AS IS" BASIS, 1765 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1766 * See the License for the specific language governing permissions and 1767 * limitations under the License. 1768 */class qr{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}}qr.UNAUTHENTICATED=new qr(null),qr.GOOGLE_CREDENTIALS=new qr("google-credentials-uid"),qr.FIRST_PARTY=new qr("first-party-uid"),qr.MOCK_USER=new qr("mock-user");/** 1769 * @license 1770 * Copyright 2017 Google LLC 1771 * 1772 * Licensed under the Apache License, Version 2.0 (the "License"); 1773 * you may not use this file except in compliance with the License. 1774 * You may obtain a copy of the License at 1775 * 1776 * http://www.apache.org/licenses/LICENSE-2.0 1777 * 1778 * Unless required by applicable law or agreed to in writing, software 1779 * distributed under the License is distributed on an "AS IS" BASIS, 1780 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1781 * See the License for the specific language governing permissions and 1782 * limitations under the License. 1783 */class ml{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}/** 1784 * @license 1785 * Copyright 2017 Google LLC 1786 * 1787 * Licensed under the Apache License, Version 2.0 (the "License"); 1788 * you may not use this file except in compliance with the License. 1789 * You may obtain a copy of the License at 1790 * 1791 * http://www.apache.org/licenses/LICENSE-2.0 1792 * 1793 * Unless required by applicable law or agreed to in writing, software 1794 * distributed under the License is distributed on an "AS IS" BASIS, 1795 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1796 * See the License for the specific language governing permissions and 1797 * limitations under the License. 1798 */class ZT{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class HP{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable((()=>t(qr.UNAUTHENTICATED)))}shutdown(){}}class qP{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable((()=>t(this.token.user)))}shutdown(){this.changeListener=null}}class $P{constructor(e){this.De=e,this.currentUser=qr.UNAUTHENTICATED,this.xe=0,this.forceRefresh=!1,this.auth=null}start(e,t){pt(this.Ce===void 0,42304);let s=this.xe;const o=f=>this.xe!==s?(s=this.xe,t(f)):Promise.resolve();let l=new ml;this.Ce=()=>{this.xe++,this.currentUser=this.Fe(),l.resolve(),l=new ml,e.enqueueRetryable((()=>o(this.currentUser)))};const u=()=>{const f=l;e.enqueueRetryable((async()=>{await f.promise,await o(this.currentUser)}))},h=f=>{rt("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=f,this.Ce&&(this.auth.addAuthTokenListener(this.Ce),u())};this.De.onInit((f=>h(f))),setTimeout((()=>
vendor: 4,791 bytes, lines 1798-1832
1798{if(!this.auth){const f=this.De.getImmediate({optional:!0});f?h(f):(rt("FirebaseAuthCredentialsProvider","Auth not yet detected"),l.resolve(),l=new ml)}}),0),u()}getToken(){const e=this.xe,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then((s=>this.xe!==e?(rt("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):s?(pt(typeof s.accessToken=="string",31837,{Oe:s}),new ZT(s.accessToken,this.currentUser)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.Ce&&this.auth.removeAuthTokenListener(this.Ce),this.Ce=void 0}Fe(){const e=this.auth&&this.auth.getUid();return pt(e===null||typeof e=="string",2055,{Me:e}),new qr(e)}}class JP{constructor(e,t,s){this.Ne=e,this.Le=t,this.Be=s,this.type="FirstParty",this.user=qr.FIRST_PARTY,this.Ue=new Map}ke(){return this.Be?this.Be():null}get headers(){this.Ue.set("X-Goog-AuthUser",this.Ne);const e=this.ke();return e&&this.Ue.set("Authorization",e),this.Le&&this.Ue.set("X-Goog-Iam-Authorization-Token",this.Le),this.Ue}}class KP{constructor(e,t,s){this.Ne=e,this.Le=t,this.Be=s}getToken(){return Promise.resolve(new JP(this.Ne,this.Le,this.Be))}start(e,t){e.enqueueRetryable((()=>t(qr.FIRST_PARTY)))}shutdown(){}invalidateToken(){}}class qN{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 QP{constructor(e,t){this.qe=t,this.forceRefresh=!1,this.appCheck=null,this.$e=null,this.Ke=null,Wi(e)&&e.settings.appCheckToken&&(this.Ke=e.settings.appCheckToken)}start(e,t){pt(this.Ce===void 0,3512);const s=l=>{l.error!=null&&rt("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${l.error.message}`);const u=l.token!==this.$e;return this.$e=l.token,rt("FirebaseAppCheckTokenProvider",`Received ${u?"new":"existing"} token.`),u?t(l.token):Promise.resolve()};this.Ce=l=>{e.enqueueRetryable((()=>s(l)))};const o=l=>{rt("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=l,this.Ce&&this.appCheck.addTokenListener(this.Ce)};this.qe.onInit((l=>o(l))),setTimeout((()=>{if(!this.appCheck){const l=this.qe.getImmediate({optional:!0});l?o(l):rt("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}}),0)}getToken(){if(this.Ke)return Promise.resolve(new qN(this.Ke));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then((t=>t?(pt(typeof t.token=="string",44558,{tokenResult:t}),this.$e=t.token,new qN(t.token)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.Ce&&this.appCheck.removeTokenListener(this.Ce),this.Ce=void 0}}function eS(n){const e={};return n.timeoutSeconds!==void 0&&(e.timeoutSeconds=n.timeoutSeconds),e}/** 1799 * @license 1800 * Copyright 2019 Google LLC 1801 * 1802 * Licensed under the Apache License, Version 2.0 (the "License"); 1803 * you may not use this file except in compliance with the License. 1804 * You may obtain a copy of the License at 1805 * 1806 * http://www.apache.org/licenses/LICENSE-2.0 1807 * 1808 * Unless required by applicable law or agreed to in writing, software 1809 * distributed under the License is distributed on an "AS IS" BASIS, 1810 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1811 * See the License for the specific language governing permissions and 1812 * limitations under the License. 1813 */class YP{Qe(e){}shutdown(){}}/** 1814 * @license 1815 * Copyright 2019 Google LLC 1816 * 1817 * Licensed under the Apache License, Version 2.0 (the "License"); 1818 * you may not use this file except in compliance with the License. 1819 * You may obtain a copy of the License at 1820 * 1821 * http://www.apache.org/licenses/LICENSE-2.0 1822 * 1823 * Unless required by applicable law or agreed to in writing, software 1824 * distributed under the License is distributed on an "AS IS" BASIS, 1825 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1826 * See the License for the specific language governing permissions and 1827 * limitations under the License. 1828 */const $N="ConnectivityMonitor";class JN{constructor(){this.We=()=>this.Ge(),this.ze=()=>this.je(),this.He=[],this.Je()}Qe(e){this.He.push(e)}shutdown(){window.removeEventListener("online",this.We),window.removeEventListener("offline",this.ze)}Je(){window.addEventListener("online",this.We),window.addEventListener("offline",this.ze)}Ge(){rt($N,"Network connectivity changed: AVAILABLE");for(const e of this.He)e(0)}je(){rt($N,"Network connectivity changed: UNAVAILABLE");for(const e of this.He)e(1)}static Ye(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/** 1829 * @license 1830 * Copyright 2023 Google LLC 1831 * 1832 * Licensed under the Apache License, Version 2.0 (the "License");
1833 * you may not use this file except in compliance with the License. 1834 * You may obtain a copy of the License at 1835 * 1836 * http://www.apache.org/licenses/LICENSE-2.0 1837 * 1838 * Unless required by applicable law or agreed to in writing, software 1839 * distributed under the License is distributed on an "AS IS" BASIS, 1840 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1841 * See the License for the specific language governing permissions and 1842 * limitations under the License. 1843 */let sB=null;function Yy(){return sB===null?sB=(function(){return 268435456+Math.round(2147483648*Math.random())})():sB++,"0x"+sB.toString(16)}/** 1844 * @license 1845 * Copyright 2020 Google LLC 1846 * 1847 * Licensed under the Apache License, Version 2.0 (the "License"); 1848 * you may not use this file except in compliance with the License. 1849 * You may obtain a copy of the License at 1850 * 1851 * http://www.apache.org/licenses/LICENSE-2.0 1852 * 1853 * Unless required by applicable law or agreed to in writing, software 1854 * distributed under the License is distributed on an "AS IS" BASIS, 1855 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1856 * See the License for the specific language governing permissions and 1857 * limitations under the License. 1858 */const JC="RestConnection",XP={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery",ExecutePipeline:"executePipeline"};class WP{get Ze(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",s=encodeURIComponent(this.databaseId.projectId),o=encodeURIComponent(this.databaseId.database);this.Xe=t+"://"+e.host,this.et=`projects/${s}/databases/${o}`,this.tt=this.databaseId.database===Uy?`project_id=${s}`:`project_id=${s}&database_id=${o}`}nt(e,t,s,o,l){const u=Yy(),h=this.rt(e,t.toUriEncodedString());rt(JC,`Sending RPC '${e}' ${u}:`,h,s);const f={"google-cloud-resource-prefix":this.et,"x-goog-request-params":this.tt};this.it(f,o,l);const{host:p}=new URL(h),x=qu(p);return this.st(e,h,f,s,x).then((b=>(rt(JC,`Received RPC '${e}' ${u}: `,b),b)),(b=>{throw Va(JC,`RPC '${e}' ${u} failed with error: `,b,"url: ",h,"request:",s),b}))}_t(e,t,s,o,l,u){return this.nt(e,t,s,o,l)}it(e,t,s){if(e["X-Goog-Api-Client"]=(function(){return"gl-js/ fire/"+jh})(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach(((o,l)=>e[l]=o)),s&&s.headers.forEach(((o,l)=>e[l]=o)),this.databaseInfo._customHeaders)for(const o of Object.keys(this.databaseInfo._customHeaders))e[o]=this.databaseInfo._customHeaders[o]}rt(e,t){const s=XP[e];let o=`${this.Xe}/v1/${t}:${s}`;return this.databaseInfo.apiKey&&(o=`${o}?key=${encodeURIComponent(this.databaseInfo.apiKey)}`),o}terminate(){}}/** 1859 * @license 1860 * Copyright 2017 Google LLC 1861 * 1862 * Licensed under the Apache License, Version 2.0 (the "License"); 1863 * you may not use this file except in compliance with the License. 1864 * You may obtain a copy of the License at 1865 * 1866 * http://www.apache.org/licenses/LICENSE-2.0 1867 * 1868 * Unless required by applicable law or agreed to in writing, software 1869 * distributed under the License is distributed on an "AS IS" BASIS, 1870 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1871 * See the License for the specific language governing permissions and 1872 * limitations under the License. 1873 */class ZP{constructor(e){this.ot=e.ot,this.ut=e.ut}ct(e){this.lt=e}Et(e){this.ht=e}Tt(e){this.Pt=e}onMessage(e){this.It=e}close(){this.ut()}send(e){this.ot(e)}Rt(){this.lt()}At(){this.ht()}Vt(e){this.Pt(e)}dt(e){this.It(e)}}/** 1874 * @license 1875 * Copyright 2017 Google LLC 1876 * 1877 * Licensed under the Apache License, Version 2.0 (the "License"); 1878 * you may not use this file except in compliance with the License. 1879 * You may obtain a copy of the License at 1880 * 1881 * http://www.apache.org/licenses/LICENSE-2.0 1882 * 1883 * Unless required by applicable law or agreed to in writing, software 1884 * distributed under the License is distributed on an "AS IS" BASIS, 1885 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1886 * See the License for the specific language governing permissions and 1887 * limitations under the License. 1888 */const Gr="WebChannelConnection",Yf=(n,e,t)=>
vendor: 18,779 bytes, lines 1888-2023
1888{n.listen(e,(s=>{try{t(s)}catch(o){setTimeout((()=>{throw o}),0)}}))};class oh extends WP{constructor(e){super(e),this.ft=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}static gt(){if(!oh.yt){const e=nT();Yf(e,tT.STAT_EVENT,(t=>{t.stat===My.PROXY?rt(Gr,"STAT_EVENT: detected buffering proxy"):t.stat===My.NOPROXY&&rt(Gr,"STAT_EVENT: detected no buffering proxy")})),oh.yt=!0}}st(e,t,s,o,l){const u=Yy();return new Promise(((h,f)=>{const p=new ZD;p.setWithCredentials(!0),p.listenOnce(eT.COMPLETE,(()=>{try{switch(p.getLastErrorCode()){case NB.NO_ERROR:const b=p.getResponseJson();rt(Gr,`XHR for RPC '${e}' ${u} received:`,JSON.stringify(b)),h(b);break;case NB.TIMEOUT:rt(Gr,`RPC '${e}' ${u} timed out`),f(new Xe(Ie.DEADLINE_EXCEEDED,"Request time out"));break;case NB.HTTP_ERROR:const C=p.getStatus();if(rt(Gr,`RPC '${e}' ${u} failed with status:`,C,"response text:",p.getResponseText()),C>0){let N=p.getResponseJson();Array.isArray(N)&&(N=N[0]);const T=N==null?void 0:N.error;if(T&&T.status&&T.message){const R=(function(U){const M=U.toLowerCase().replace(/_/g,"-");return Object.values(Ie).indexOf(M)>=0?M:Ie.UNKNOWN})(T.status);f(new Xe(R,T.message))}else f(new Xe(Ie.UNKNOWN,"Server responded with status "+p.getStatus()))}else f(new Xe(Ie.UNAVAILABLE,"Connection failed."));break;default:Ct(9055,{wt:e,streamId:u,bt:p.getLastErrorCode(),St:p.getLastError()})}}finally{rt(Gr,`RPC '${e}' ${u} completed.`)}}));const x=JSON.stringify(o);rt(Gr,`RPC '${e}' ${u} sending request:`,o),p.send(t,"POST",x,s,15)}))}vt(e,t,s){const o=Yy(),l=[this.Xe,"/","google.firestore.v1.Firestore","/",e,"/channel"],u=this.createWebChannelTransport(),h={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},f=this.longPollingOptions.timeoutSeconds;f!==void 0&&(h.longPollingTimeout=Math.round(1e3*f)),this.useFetchStreams&&(h.useFetchStreams=!0),this.it(h.initMessageHeaders,t,s),h.encodeInitMessageHeaders=!0;const p=l.join("");rt(Gr,`Creating RPC '${e}' stream ${o}: ${p}`,h);const x=u.createWebChannel(p,h);this.Dt(x);let b=!1,C=!1;const N=new ZP({ot:T=>{C?rt(Gr,`Not sending because RPC '${e}' stream ${o} is closed:`,T):(b||(rt(Gr,`Opening RPC '${e}' stream ${o} transport.`),x.open(),b=!0),rt(Gr,`RPC '${e}' stream ${o} sending:`,T),x.send(T))},ut:()=>x.close()});return Yf(x,nm.EventType.OPEN,(()=>{C||(rt(Gr,`RPC '${e}' stream ${o} transport opened.`),N.Rt())})),Yf(x,nm.EventType.CLOSE,(()=>{C||(C=!0,rt(Gr,`RPC '${e}' stream ${o} transport closed`),N.Vt(),this.xt(x))})),Yf(x,nm.EventType.ERROR,(T=>{C||(C=!0,Va(Gr,`RPC '${e}' stream ${o} transport errored. Name:`,T.name,"Message:",T.message),N.Vt(new Xe(Ie.UNAVAILABLE,"The operation could not be completed")))})),Yf(x,nm.EventType.MESSAGE,(T=>{var R;if(!C){const A=T.data[0];pt(!!A,16349);const U=A,M=(U==null?void 0:U.error)||((R=U[0])==null?void 0:R.error);if(M){rt(Gr,`RPC '${e}' stream ${o} received error:`,M);const V=M.status;let H=(function(k){const E=tr[k];if(E!==void 0)return PT(E)})(V),Q=M.message;V==="NOT_FOUND"&&Q.includes("database")&&Q.includes("does not exist")&&Q.includes(this.databaseId.database)&&Va(`Database '${this.databaseId.database}' not found. Please check your project configuration.`),H===void 0&&(H=Ie.INTERNAL,Q="Unknown error status: "+V+" with message "+M.message),C=!0,N.Vt(new Xe(H,Q)),x.close()}else rt(Gr,`RPC '${e}' stream ${o} received:`,A),N.dt(A)}})),oh.gt(),setTimeout((()=>{N.At()}),0),N}terminate(){this.ft.forEach((e=>e.close())),this.ft=[]}Dt(e){this.ft.push(e)}xt(e){this.ft=this.ft.filter((t=>t===e))}it(e,t,s){super.it(e,t,s),this.databaseInfo.apiKey&&(e["x-goog-api-key"]=this.databaseInfo.apiKey)}createWebChannelTransport(){return sT()}}/** 1889 * @license 1890 * Copyright 2020 Google LLC 1891 * 1892 * Licensed under the Apache License, Version 2.0 (the "License"); 1893 * you may not use this file except in compliance with the License. 1894 * You may obtain a copy of the License at 1895 * 1896 * http://www.apache.org/licenses/LICENSE-2.0 1897 * 1898 * Unless required by applicable law or agreed to in writing, software 1899 * distributed under the License is distributed on an "AS IS" BASIS, 1900 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1901 * See the License for the specific language governing permissions and 1902 * limitations under the License. 1903 */function e6(n){return new oh(n)}oh.yt=!1;class tS{constructor(e,t,s=1e3,o=1.5,l=6e4){this.Ct=e,this.timerId=t,this.Ft=s,this.Ot=o,this.Mt=l,this.Nt=0,this.Lt=null,this.Bt=Date.now(),this.reset()}reset(){this.Nt=0}Ut(){this.Nt=this.Mt}kt(e){this.cancel();const t=Math.floor(this.Nt+this.qt()),s=Math.max(0,Date.now()-this.Bt),o=Math.max(0,t-s);o>0&&rt("ExponentialBackoff",`Backing off for ${o} ms (base delay: ${this.Nt} ms, delay with jitter: ${t} ms, last attempt: ${s} ms ago)`),this.Lt=this.Ct.enqueueAfterDelay(this.timerId,o,(()=>(this.Bt=Date.now(),e()))),this.Nt*=this.Ot,this.Nt<this.Ft&&(this.Nt=this.Ft),this.Nt>this.Mt&&(this.Nt=this.Mt)}$t(){this.Lt!==null&&(this.Lt.skipDelay(),this.Lt=null)}cancel(){this.Lt!==null&&(this.Lt.cancel(),this.Lt=null)}qt(){return(Math.random()-.5)*this.Nt}}/** 1904 * @license 1905 * Copyright 2017 Google LLC 1906 * 1907 * Licensed under the Apache License, Version 2.0 (the "License"); 1908 * you may not use this file except in compliance with the License. 1909 * You may obtain a copy of the License at 1910 * 1911 * http://www.apache.org/licenses/LICENSE-2.0 1912 * 1913 * Unless required by applicable law or agreed to in writing, software 1914 * distributed under the License is distributed on an "AS IS" BASIS, 1915 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1916 * See the License for the specific language governing permissions and 1917 * limitations under the License. 1918 */const KN="PersistentStream";class nS{constructor(e,t,s,o,l,u,h,f){this.Ct=e,this.Kt=s,this.Qt=o,this.connection=l,this.authCredentialsProvider=u,this.appCheckCredentialsProvider=h,this.listener=f,this.state=0,this.Wt=0,this.Gt=null,this.zt=null,this.stream=null,this.jt=0,this.Ht=new tS(e,t)}Jt(){return this.state===1||this.state===5||this.Yt()}Yt(){return this.state===2||this.state===3}start(){this.jt=0,this.state!==4?this.auth():this.Zt()}async stop(){this.Jt()&&await this.close(0)}Xt(){this.state=0,this.Ht.reset()}en(){this.Yt()&&this.Gt===null&&(this.Gt=this.Ct.enqueueAfterDelay(this.Kt,6e4,(()=>this.tn())))}nn(e){this.rn(),this.stream.send(e)}async tn(){if(this.Yt())return this.close(0)}rn(){this.Gt&&(this.Gt.cancel(),this.Gt=null)}sn(){this.zt&&(this.zt.cancel(),this.zt=null)}async close(e,t){this.rn(),this.sn(),this.Ht.cancel(),this.Wt++,e!==4?this.Ht.reset():t&&t.code===Ie.RESOURCE_EXHAUSTED?(yl(t.toString()),yl("Using maximum backoff delay to prevent overloading the backend."),this.Ht.Ut()):t&&t.code===Ie.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this._n(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Tt(t)}_n(){}auth(){this.state=1;const e=this.an(this.Wt),t=this.Wt;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then((([s,o])=>{this.Wt===t&&this.un(s,o)}),(s=>{e((()=>{const o=new Xe(Ie.UNKNOWN,"Fetching auth token failed: "+s.message);return this.cn(o)}))}))}un(e,t){const s=this.an(this.Wt);this.stream=this.En(e,t),this.stream.ct((()=>{s((()=>this.listener.ct()))})),this.stream.Et((()=>{s((()=>(this.state=2,this.zt=this.Ct.enqueueAfterDelay(this.Qt,1e4,(()=>(this.Yt()&&(this.state=3),Promise.resolve()))),this.listener.Et())))})),this.stream.Tt((o=>{s((()=>this.cn(o)))})),this.stream.onMessage((o=>{s((()=>++this.jt==1?this.hn(o):this.onNext(o)))}))}Zt(){this.state=5,this.Ht.kt((async()=>{this.state=0,this.start()}))}cn(e){return rt(KN,`close with error: ${e}`),this.stream=null,this.close(4,e)}an(e){return t=>{this.Ct.enqueueAndForget((()=>this.Wt===e?t():(rt(KN,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class t6 extends nS{constructor(e,t,s,o,l,u){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,s,o,u),this.serializer=l}En(e,t){return this.connection.vt("Listen",e,t)}hn(e){return this.onNext(e)}onNext(e){this.Ht.reset();const t=AP(this.serializer,e),s=(function(l){if(!("targetChange"in l))return zt.min();const u=l.targetChange;return u.targetIds&&u.targetIds.length?zt.min():u.readTime?To(u.readTime):zt.min()})(e);return this.listener.Tn(t,s)}Pn(e){const t={};t.database=Qy(this.serializer),t.addTarget=(function(l,u){let h;const f=u.target;if(h=yu(f)?{pipelineQuery:PP(l,f)}:LT(f)?{documents:IP(l,f)}:{query:OP(l,f).Se},h.targetId=u.targetId,u.resumeToken.approximateByteSize()>0){h.resumeToken=HT(l,u.resumeToken);const p=Jy(l,u.expectedCount);p!==null&&(h.expectedCount=p)}else if(u.snapshotVersion.compareTo(zt.min())>0){h.readTime=gm(l,u.snapshotVersion.toTimestamp());const p=Jy(l,u.expectedCount);p!==null&&(h.expectedCount=p)}return h})(this.serializer,e);const s=MP(this.serializer,e);s&&(t.labels=s),this.nn(t)}In(e){const t={};t.database=Qy(this.serializer),t.removeTarget=e,this.nn(t)}}class n6 extends nS{constructor(e,t,s,o,l,u){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,s,o,u),this.serializer=l}get Rn(){return this.jt>0}start(){this.lastStreamToken=void 0,super.start()}_n(){this.Rn&&this.An([])}En(e,t){return this.connection.vt("Write",e,t)}hn(e){return pt(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,pt(!e.writeResults||e.writeResults.length===0,55816),this.listener.Vn()}onNext(e){pt(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.Ht.reset();const t=RP(e.writeResults,e.commitTime),s=To(e.commitTime);return this.listener.dn(s,t)}fn(){const e={};e.database=Qy(this.serializer),this.nn(e)}An(e){const t={streamToken:this.lastStreamToken,writes:e.map((s=>kP(this.serializer,s)))};this.nn(t)}}/** 1919 * @license 1920 * Copyright 2017 Google LLC 1921 * 1922 * Licensed under the Apache License, Version 2.0 (the "License"); 1923 * you may not use this file except in compliance with the License. 1924 * You may obtain a copy of the License at 1925 * 1926 * http://www.apache.org/licenses/LICENSE-2.0 1927 * 1928 * Unless required by applicable law or agreed to in writing, software 1929 * distributed under the License is distributed on an "AS IS" BASIS, 1930 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1931 * See the License for the specific language governing permissions and 1932 * limitations under the License. 1933 */class s6{}class r6 extends s6{constructor(e,t,s,o){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=s,this.serializer=o,this.mn=!1}pn(){if(this.mn)throw new Xe(Ie.FAILED_PRECONDITION,"The client has already been terminated.")}nt(e,t,s,o){return this.pn(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([l,u])=>this.connection.nt(e,Ky(t,s),o,l,u))).catch((l=>{throw l.name==="FirebaseError"?(l.code===Ie.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),l):new Xe(Ie.UNKNOWN,l.toString())}))}_t(e,t,s,o,l){return this.pn(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([u,h])=>this.connection._t(e,Ky(t,s),o,u,h,l))).catch((u=>{throw u.name==="FirebaseError"?(u.code===Ie.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),u):new Xe(Ie.UNKNOWN,u.toString())}))}terminate(){this.mn=!0,this.connection.terminate()}}function i6(n,e,t,s){return new r6(n,e,t,s)}/** 1934 * @license 1935 * Copyright 2020 Google LLC 1936 * 1937 * Licensed under the Apache License, Version 2.0 (the "License"); 1938 * you may not use this file except in compliance with the License. 1939 * You may obtain a copy of the License at 1940 * 1941 * http://www.apache.org/licenses/LICENSE-2.0 1942 * 1943 * Unless required by applicable law or agreed to in writing, software 1944 * distributed under the License is distributed on an "AS IS" BASIS, 1945 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1946 * See the License for the specific language governing permissions and 1947 * limitations under the License. 1948 */const a6="ComponentProvider",QN=new Map;function o6(n,e,t,s,o){return new PM(n,e,t,o.host,o.ssl,o.experimentalForceLongPolling,o.experimentalAutoDetectLongPolling,eS(o.experimentalLongPollingOptions),o.useFetchStreams,o.isUsingEmulator,s,o._customHeaders,o.grpcFlowControlWindow)}/** 1949 * @license 1950 * Copyright 2018 Google LLC 1951 * 1952 * Licensed under the Apache License, Version 2.0 (the "License"); 1953 * you may not use this file except in compliance with the License. 1954 * You may obtain a copy of the License at 1955 * 1956 * http://www.apache.org/licenses/LICENSE-2.0 1957 * 1958 * Unless required by applicable law or agreed to in writing, software 1959 * distributed under the License is distributed on an "AS IS" BASIS, 1960 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1961 * See the License for the specific language governing permissions and 1962 * limitations under the License. 1963 */const YN={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},sS=41943040;class Ni{static withCacheSize(e){return new Ni(e,Ni.DEFAULT_COLLECTION_PERCENTILE,Ni.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,s){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=s}}Ni.DEFAULT_COLLECTION_PERCENTILE=10,Ni.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Ni.DEFAULT=new Ni(sS,Ni.DEFAULT_COLLECTION_PERCENTILE,Ni.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Ni.DISABLED=new Ni(-1,0,0);/** 1964 * @license 1965 * Copyright 2018 Google LLC 1966 * 1967 * Licensed under the Apache License, Version 2.0 (the "License"); 1968 * you may not use this file except in compliance with the License. 1969 * You may obtain a copy of the License at 1970 * 1971 * http://www.apache.org/licenses/LICENSE-2.0 1972 * 1973 * Unless required by applicable law or agreed to in writing, software 1974 * distributed under the License is distributed on an "AS IS" BASIS, 1975 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1976 * See the License for the specific language governing permissions and 1977 * limitations under the License. 1978 */class Gg{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=s=>this.gn(s),this.yn=s=>t.writeSequenceNumber(s))}gn(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.yn&&this.yn(e),e}}Gg.wn=-1;/** 1979 * @license 1980 * Copyright 2020 Google LLC 1981 * 1982 * Licensed under the Apache License, Version 2.0 (the "License"); 1983 * you may not use this file except in compliance with the License. 1984 * You may obtain a copy of the License at 1985 * 1986 * http://www.apache.org/licenses/LICENSE-2.0 1987 * 1988 * Unless required by applicable law or agreed to in writing, software 1989 * distributed under the License is distributed on an "AS IS" BASIS, 1990 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1991 * See the License for the specific language governing permissions and 1992 * limitations under the License. 1993 */const l6="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class c6{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach((e=>e()))}}/** 1994 * @license 1995 * Copyright 2017 Google LLC 1996 * 1997 * Licensed under the Apache License, Version 2.0 (the "License"); 1998 * you may not use this file except in compliance with the License. 1999 * You may obtain a copy of the License at 2000 * 2001 * http://www.apache.org/licenses/LICENSE-2.0 2002 * 2003 * Unless required by applicable law or agreed to in writing, software 2004 * distributed under the License is distributed on an "AS IS" BASIS, 2005 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2006 * See the License for the specific language governing permissions and 2007 * limitations under the License. 2008 */async function Rh(n){if(n.code!==Ie.FAILED_PRECONDITION||n.message!==l6)throw n;rt("LocalStore","Unexpectedly lost primary lease")}/** 2009 * @license 2010 * Copyright 2017 Google LLC 2011 * 2012 * Licensed under the Apache License, Version 2.0 (the "License"); 2013 * you may not use this file except in compliance with the License. 2014 * You may obtain a copy of the License at 2015 * 2016 * http://www.apache.org/licenses/LICENSE-2.0 2017 * 2018 * Unless required by applicable law or agreed to in writing, software 2019 * distributed under the License is distributed on an "AS IS" BASIS, 2020 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2021 * See the License for the specific language governing permissions and 2022 * limitations under the License. 2023 */class Me{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e((t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)}),(t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)}))}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&Ct(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new Me(((s,o)=>{this.nextCallback=l=>{this.wrapSuccess(e,l).next(s,o)},this.catchCallback=l=>{this.wrapFailure(t,l).next(s,o)}}))}toPromise(){return new Promise(((e,t)=>{this.next(e,t)}))}wrapUserFunction(e){try{const t=e();return t instanceof Me?t:Me.resolve(t)}catch(t){return Me.reject(t)}}wrapSuccess(e,t){return e?this.wrapUserFunction((()=>e(t))):Me.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction((()=>e(t))):Me.reject(t)}static resolve(e){return new Me(((t,s)=>{t(e)}))}static reject(e){return new Me(((t,s)=>{s(e)}))}static waitFor(e){return new Me(((t,s)=>{let o=0,l=0,u=!1;e.forEach((h=>{++o,h.next((()=>{++l,u&&l===o&&t()}),(f=>s(f)))})),u=!0,l===o&&t()}))}static or(e){let t=Me.resolve(!1);for(const s of e)t=t.next((o=>o?Me.resolve(o):s()));return t}static forEach(e,t){const s=[];return e.forEach(((o,l)=>{s.push(t.call(this,o,l))})),this.waitFor(s)}static mapArray(e,t){return new Me(((s,o)=>{const l=e.length,u=new Array(l);let h=0;for(let f=0;f<l;f++){const p=f;t(e[p]).next((x=>{u[p]=x,++h,h===l&&s(u)}),(x=>o(x)))}}))}static doWhile(e,t){return new Me(((s,o)=>{const l=()=>{e()===!0?t().next((()=>{l()}),o):s()};l()}
2023))}}function u6(n){const e=n.match(/Android ([\d.]+)/i),t=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(t)}function Ih(n){return n.name==="IndexedDbTransactionError"}/** 2024 * @license 2025 * Copyright 2020 Google LLC 2026 * 2027 * Licensed under the Apache License, Version 2.0 (the "License"); 2028 * you may not use this file except in compliance with the License. 2029 * You may obtain a copy of the License at 2030 * 2031 * http://www.apache.org/licenses/LICENSE-2.0 2032 * 2033 * Unless required by applicable law or agreed to in writing, software 2034 * distributed under the License is distributed on an "AS IS" BASIS, 2035 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2036 * See the License for the specific language governing permissions and 2037 * limitations under the License. 2038 */const XN="LruGarbageCollector",d6=1048576;function WN([n,e],[t,s]){const o=dn(n,t);return o===0?dn(e,s):o}class h6{constructor(e){this.Yn=e,this.buffer=new ar(WN),this.Zn=0}Xn(){return++this.Zn}er(e){const t=[e,this.Xn()];if(this.buffer.size<this.Yn)this.buffer=this.buffer.add(t);else{const s=this.buffer.last();WN(t,s)<0&&(this.buffer=this.buffer.delete(s).add(t))}}get maxValue(){return this.buffer.last()[0]}}class f6{constructor(e,t,s){this.garbageCollector=e,this.asyncQueue=t,this.localStore=s,this.tr=null}start(){this.garbageCollector.params.cacheSizeCollectionThreshold!==-1&&this.nr(6e4)}stop(){this.tr&&(this.tr.cancel(),this.tr=null)}get started(){return this.tr!==null}nr(e){rt(XN,`Garbage collection scheduled in ${e}ms`),this.tr=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,(async()=>{this.tr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(t){Ih(t)?rt(XN,"Ignoring IndexedDB error during garbage collection: ",t):await Rh(t)}await this.nr(3e5)}))}}class m6{constructor(e,t){this.rr=e,this.params=t}calculateTargetCount(e,t){return this.rr.ir(e).next((s=>Math.floor(t/100*s)))}nthSequenceNumber(e,t){if(t===0)return Me.resolve(Gg.wn);const s=new h6(t);return this.rr.forEachTarget(e,(o=>s.er(o.sequenceNumber))).next((()=>this.rr.sr(e,(o=>s.er(o))))).next((()=>s.maxValue))}removeTargets(e,t,s){return this.rr.removeTargets(e,t,s)}removeOrphanedDocuments(e,t){return this.rr.removeOrphanedDocuments(e,t)}collect(e,t){return this.params.cacheSizeCollectionThreshold===-1?(rt("LruGarbageCollector","Garbage collection skipped; disabled"),Me.resolve(YN)):this.getCacheSize(e).next((s=>s<this.params.cacheSizeCollectionThreshold?(rt("LruGarbageCollector",`Garbage collection skipped; Cache size ${s} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),YN):this._r(e,t)))}getCacheSize(e){return this.rr.getCacheSize(e)}_r(e,t){let s,o,l,u,h,f,p;const x=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next((b=>(b>this.params.maximumSequenceNumbersToCollect?(rt("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${b}`),o=this.params.maximumSequenceNumbersToCollect):o=b,u=Date.now(),this.nthSequenceNumber(e,o)))).next((b=>(s=b,h=Date.now(),this.removeTargets(e,s,t)))).next((b=>(l=b,f=Date.now(),this.removeOrphanedDocuments(e,s)))).next((b=>(p=Date.now(),Kd()<=Bn.DEBUG&&rt("LruGarbageCollector",`LRU Garbage Collection 2039 Counted targets in ${u-x}ms 2040 Determined least recently used ${o} in `+(h-u)+`ms 2041 Removed ${l} targets in `+(f-h)+`ms 2042 Removed ${b} documents in `+(p-f)+`ms 2043Total Duration: ${p-x}ms`),Me.resolve({didRun:!0,sequenceNumbersCollected:o,targetsRemoved:l,documentsRemoved:b}))))}}function p6(n,e){return new m6(n,e)}/** 2044 * @license 2045 * Copyright 2020 Google LLC 2046 * 2047 * Licensed under the Apache License, Version 2.0 (the "License"); 2048 * you may not use this file except in compliance with the License. 2049 * You may obtain a copy of the License at 2050 * 2051 * http://www.apache.org/licenses/LICENSE-2.0 2052 * 2053 * Unless required by applicable law or agreed to in writing, software 2054 * distributed under the License is distributed on an "AS IS" BASIS, 2055 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2056 * See the License for the specific language governing permissions and 2057 * limitations under the License. 2058 */const rS="firestore.googleapis.com",ZN=!0;class e5{constructor(e){if(e.host===void 0){if(e.ssl!==void 0)throw new Xe(Ie.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=rS,this.ssl=ZN}else this.host=e.host,this.ssl=e.ssl??ZN;
2058if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e._customHeaders&&(this._customHeaders={...e._customHeaders}),e.cacheSizeBytes===void 0)this.cacheSizeBytes=sS;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<d6)throw new Xe(Ie.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}if(LM("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=eS(e.experimentalLongPollingOptions??{}),(function(s){if(s.timeoutSeconds!==void 0){if(isNaN(s.timeoutSeconds))throw new Xe(Ie.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (must not be NaN)`);if(s.timeoutSeconds<5)throw new Xe(Ie.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (minimum allowed value is 5)`);if(s.timeoutSeconds>30)throw new Xe(Ie.INVALID_ARGUMENT,`invalid long polling timeout: ${s.timeoutSeconds} (maximum allowed value is 30)`)}})(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams,e.grpcFlowControlWindow!==void 0){if(typeof e.grpcFlowControlWindow!="number"||e.grpcFlowControlWindow<=0||e.grpcFlowControlWindow>2147483647||!Number.isInteger(e.grpcFlowControlWindow))throw new Xe(Ie.INVALID_ARGUMENT,"grpcFlowControlWindow must be a positive integer and cannot exceed 2147483647");this.grpcFlowControlWindow=e.grpcFlowControlWindow}}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&&this.grpcFlowControlWindow===e.grpcFlowControlWindow&&(function(s,o){if(s===o)return!0;if(!s||!o)return!1;const l=Object.keys(s),u=Object.keys(o);if(l.length!==u.length)return!1;for(const h of l)if(s[h]!==o[h])return!1;return!0})(this._customHeaders,e._customHeaders)}}let Hg=class{constructor(e,t,s,o){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=s,this._app=o,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new e5({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new Xe(Ie.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 Xe(Ie.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 e5(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=(function(s){if(!s)return new HP;switch(s.type){case"firstParty":return new KP(s.sessionIndex||"0",s.iamToken||null,s.authTokenFactory||null);case"provider":return s.client;default:throw new Xe(Ie.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(t){const s=QN.get(t);s&&(rt(a6,"Removing Datastore"),QN.delete(t),s.terminate())})(this),Promise.resolve()}};function B6(n,e,t,s={}){var p;n=ji(n,Hg);const o=qu(e),l=n._getSettings(),u={...l,emulatorOptions:n._getEmulatorOptions()},h=`${e}:${t}`;o&&E1(`https://${h}`),l.host!==rS&&l.host!==h&&Va("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const f={...l,host:h,ssl:o,emulatorOptions:s};if(!bl(f,u)&&(n._setSettings(f),s.mockUserToken)){let x,b;if(typeof s.mockUserToken=="string")x=s.mockUserToken,b=qr.MOCK_USER;else{x=$D(s.mockUserToken,(p=n._app)==null?void 0:p.options.projectId);const C=s.mockUserToken.sub||s.mockUserToken.user_id;if(!C)throw new Xe(Ie.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");b=new qr(C)}n._authCredentials=new qP(new ZT(x,b))}}/** 2059 * @license 2060 * Copyright 2020 Google LLC 2061 * 2062 * Licensed under the Apache License, Version 2.0 (the "License");
2063 * you may not use this file except in compliance with the License. 2064 * You may obtain a copy of the License at 2065 * 2066 * http://www.apache.org/licenses/LICENSE-2.0 2067 * 2068 * Unless required by applicable law or agreed to in writing, software 2069 * distributed under the License is distributed on an "AS IS" BASIS, 2070 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2071 * See the License for the specific language governing permissions and 2072 * limitations under the License. 2073 */class Nl{constructor(e,t,s){this.converter=t,this._query=s,this.type="query",this.firestore=e}withConverter(e){return new Nl(this.firestore,e,this._query)}}class ks{constructor(e,t,s){this.converter=t,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 wc(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new ks(this.firestore,e,this._key)}toJSON(){return{type:ks._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,s){if(ap(t,ks._jsonSchema))return new ks(e,s||null,new gt(Pn.fromString(t.referencePath)))}}ks._jsonSchemaVersion="firestore/documentReference/1.0",ks._jsonSchema={type:ir("string",ks._jsonSchemaVersion),referencePath:ir("string")};class wc extends Nl{constructor(e,t,s){super(e,t,zg(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 ks(this.firestore,null,new gt(e))}withConverter(e){return new wc(this.firestore,e,this._path)}}function zs(n,e,...t){if(n=$s(n),hT("collection","path",e),n instanceof Hg){const s=Pn.fromString(e,...t);return NN(s),new wc(n,null,s)}{if(!(n instanceof ks||n instanceof wc))throw new Xe(Ie.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=n._path.child(Pn.fromString(e,...t));return NN(s),new wc(n.firestore,null,s)}}function Tn(n,e,...t){if(n=$s(n),arguments.length===1&&(e=k1.newId()),hT("doc","path",e),n instanceof Hg){const s=Pn.fromString(e,...t);return EN(s),new ks(n,null,new gt(s))}{if(!(n instanceof ks||n instanceof wc))throw new Xe(Ie.INVALID_ARGUMENT,"Expected first argument to doc() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=n._path.child(Pn.fromString(e,...t));return EN(s),new ks(n.firestore,n instanceof wc?n.converter:null,new gt(s))}}/** 2074 * @license 2075 * Copyright 2017 Google LLC 2076 * 2077 * Licensed under the Apache License, Version 2.0 (the "License"); 2078 * you may not use this file except in compliance with the License. 2079 * You may obtain a copy of the License at 2080 * 2081 * http://www.apache.org/licenses/LICENSE-2.0 2082 * 2083 * Unless required by applicable law or agreed to in writing, software 2084 * distributed under the License is distributed on an "AS IS" BASIS, 2085 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2086 * See the License for the specific language governing permissions and 2087 * limitations under the License. 2088 *//** 2089 * @license 2090 * Copyright 2024 Google LLC 2091 * 2092 * Licensed under the Apache License, Version 2.0 (the "License"); 2093 * you may not use this file except in compliance with the License. 2094 * You may obtain a copy of the License at 2095 * 2096 * http://www.apache.org/licenses/LICENSE-2.0 2097 * 2098 * Unless required by applicable law or agreed to in writing, software 2099 * distributed under the License is distributed on an "AS IS" BASIS, 2100 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2101 * See the License for the specific language governing permissions and 2102 * limitations under the License. 2103 */class Ai{constructor(e){this._values=(e||[]).map((t=>t))}toArray(){return this._values.map((e=>e))}isEqual(e){return(function(s,o){if(s.length!==o.length)return!1;for(let l=0;l<s.length;++l)if(s[l]!==o[l])return!1;return!0})(this._values,e._values)}toJSON(){return{type:Ai._jsonSchemaVersion,vectorValues:this._values}}
vendor: 5,548 bytes, lines 2103-2118
2103static fromJSON(e){if(ap(e,Ai._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every((t=>typeof t=="number")))return new Ai(e.vectorValues);throw new Xe(Ie.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}Ai._jsonSchemaVersion="firestore/vectorValue/1.0",Ai._jsonSchema={type:ir("string",Ai._jsonSchemaVersion),vectorValues:ir("object")};/** 2104 * @license 2105 * Copyright 2017 Google LLC 2106 * 2107 * Licensed under the Apache License, Version 2.0 (the "License"); 2108 * you may not use this file except in compliance with the License. 2109 * You may obtain a copy of the License at 2110 * 2111 * http://www.apache.org/licenses/LICENSE-2.0 2112 * 2113 * Unless required by applicable law or agreed to in writing, software 2114 * distributed under the License is distributed on an "AS IS" BASIS, 2115 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2116 * See the License for the specific language governing permissions and 2117 * limitations under the License. 2118 */const g6=/^__.*__$/;class x6{constructor(e,t,s){this.data=e,this.fieldMask=t,this.fieldTransforms=s}toMutation(e,t){return this.fieldMask!==null?new Vc(e,this.data,this.fieldMask,t,this.fieldTransforms):new lp(e,this.data,t,this.fieldTransforms)}}class iS{constructor(e,t,s){this.data=e,this.fieldMask=t,this.fieldTransforms=s}toMutation(e,t){return new Vc(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function aS(n){switch(n){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Ct(40011,{dataSource:n})}}class qg{constructor(e,t,s,o,l,u){this.settings=e,this.databaseId=t,this.serializer=s,this.ignoreUndefinedProperties=o,l===void 0&&this.validatePath(),this.fieldTransforms=l||[],this.fieldMask=u||[]}get path(){return this.settings.path}get dataSource(){return this.settings.dataSource}contextWith(e){return new qg({...this.settings,...e},this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}childContextForField(e){var o;const t=(o=this.path)==null?void 0:o.child(e),s=this.contextWith({path:t,arrayElement:!1});return s.validatePathSegment(e),s}childContextForFieldPath(e){var o;const t=(o=this.path)==null?void 0:o.child(e),s=this.contextWith({path:t,arrayElement:!1});return s.validatePath(),s}childContextForArray(e){return this.contextWith({path:void 0,arrayElement:!0})}createError(e){return ag(e,this.settings.methodName,this.settings.hasConverter||!1,this.path,this.settings.targetDoc)}contains(e){return this.fieldMask.find((t=>e.isPrefixOf(t)))!==void 0||this.fieldTransforms.find((t=>e.isPrefixOf(t.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(aS(this.dataSource)&&g6.test(e))throw this.createError('Document fields cannot begin and end with "__"')}}class b6{constructor(e,t,s){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=s||Vg(e)}createContext(e,t,s,o=!1){return new qg({dataSource:e,methodName:t,targetDoc:s,path:na.emptyPath(),arrayElement:!1,hasConverter:o},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function $g(n){const e=n._freezeSettings(),t=Vg(n._databaseId);return new b6(n._databaseId,!!e.ignoreUndefinedProperties,t)}function oS(n,e,t,s,o,l={}){const u=n.createContext(l.merge||l.mergeFields?2:0,e,t,o);$1("Data must be an object, but it was:",u,s);const h=cS(s,u);let f,p;if(l.merge)f=new Zi(u.fieldMask),p=u.fieldTransforms;else if(l.mergeFields){const x=[];for(const b of l.mergeFields){const C=Rc(e,b,t);if(!u.contains(C))throw new Xe(Ie.INVALID_ARGUMENT,`Field '${C}' is specified in your field mask but missing from your input data.`);fS(x,C)||x.push(C)}f=new Zi(x),p=u.fieldTransforms.filter((b=>f.covers(b.field)))}else f=null,p=u.fieldTransforms;return new x6(new hi(h),f,p)}class Jg extends kh{_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 Jg}}function lS(n,e,t){return new qg({dataSource:3,targetDoc:e.settings.targetDoc,methodName:n._methodName,arrayElement:t},e.databaseId,e.serializer,e.ignoreUndefinedProperties)}class G1 extends kh{_toFieldTransform(e){return new M1(e.path,new zm)}isEqual(e){return e instanceof G1}}class H1 extends kh{constructor(e,t){super(e),this.ar=t}_toFieldTransform(e){const t=lS(this,e,!0),s=this.ar.map((l=>Ro(l,t))),o=new _h(s);return new M1(e.path,o)}isEqual(e){return e instanceof H1&&bl(this.ar,e.ar)}}class q1 extends kh{constructor(e,t){super(e),this.ar=t}_toFieldTransform(e){const t=lS(this,e,!0),s=this.ar.map((l=>Ro(l,t))),o=new wh(s);return new M1(e.path,o)}isEqual(e){return e instanceof q1&&bl(this.ar,e.ar)}}function C6(n,e,t,s){const o=n.createContext(1,e,t);$1("Data must be an object, but it was:",o,s);const l=[],u=hi.empty();Fc(s,((f,p)=>{const x=hS(e,f,t);p=$s(p);const b=o.childContextForFieldPath(x);if(p instanceof Jg)l.push(x);else{const C=Ro(p,b);C!=null&&(l.push(x),u.set(x,C))}}));const h=new Zi(l);return new iS(u,h,o.fieldTransforms)}function y6(n,e,t,s,o,l){const u=n.createContext(1,e,t),h=[Rc(e,s,t)],f=[o];if(l.length%2!=0)throw new Xe(Ie.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let C=0;C<l.length;
2118C+=2)h.push(Rc(e,l[C])),f.push(l[C+1]);const p=[],x=hi.empty();for(let C=h.length-1;C>=0;--C)if(!fS(p,h[C])){const N=h[C];let T=f[C];T=$s(T);const R=u.childContextForFieldPath(N);if(T instanceof Jg)p.push(N);else{const A=Ro(T,R);A!=null&&(p.push(N),x.set(N,A))}}const b=new Zi(p);return new iS(x,b,u.fieldTransforms)}function v6(n,e,t,s=!1){return Ro(t,n.createContext(s?4:3,e))}function Ro(n,e,t){if(dS(n=$s(n)))return $1("Unsupported field value:",e,n),cS(n,e);if(n instanceof kh)return(function(o,l){if(!aS(l.dataSource))throw l.createError(`${o._methodName}() can only be used with update() and set()`);if(!l.path)throw l.createError(`${o._methodName}() is not currently supported inside arrays`);const u=o._toFieldTransform(l);u&&l.fieldTransforms.push(u)})(n,e),null;if(n===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),n instanceof Array){if(e.settings.arrayElement&&e.dataSource!==4)throw e.createError("Nested arrays are not supported");return(function(o,l){const u=[];let h=0;for(const f of o){let p=Ro(f,l.childContextForArray(h));p==null&&(p={nullValue:"NULL_VALUE"}),u.push(p),h++}return{arrayValue:{values:u}}})(n,e)}return(function(o,l,u){if((o=$s(o))===null)return{nullValue:"NULL_VALUE"};if(typeof o=="number")return O1(l.serializer,o);if(typeof o=="boolean")return{booleanValue:o};if(typeof o=="string")return{stringValue:o};if(o instanceof Date){const h=Qn.fromDate(o);return{timestampValue:gm(l.serializer,h)}}if(o instanceof Qn){const h=new Qn(o.seconds,1e3*Math.floor(o.nanoseconds/1e3));return{timestampValue:gm(l.serializer,h)}}if(uS(o)){const h=Qn.fromInstant(o),f=new Qn(h.seconds,1e3*Math.floor(h.nanoseconds/1e3));return{timestampValue:gm(l.serializer,f)}}if(o instanceof So)return{geoPointValue:{latitude:o.latitude,longitude:o.longitude}};if(o instanceof Ea)return{bytesValue:HT(l.serializer,o._byteString)};if(o instanceof ks){const h=l.databaseId,f=o.firestore._databaseId;if(!f.isEqual(h))throw l.createError(`Document reference is for database ${f.projectId}/${f.database} but should be for database ${h.projectId}/${h.database}`);return{referenceValue:U1(o.firestore._databaseId||l.databaseId,o._key.path)}}if(o instanceof Ai)return(function(f,p){const x=f instanceof Ai?f.toArray():f;return{mapValue:{fields:{[bT]:{stringValue:CT},[Mm]:{arrayValue:{values:x.map((C=>{if(typeof C!="number")throw p.createError("VectorValues must only contain numeric values.");return Lg(p.serializer,C)}))}}}}}})(o,l);if(XT(o))return o._toProto(l.serializer);throw l.createError(`Unsupported field value: ${Rg(o)}`)})(n,e)}function cS(n,e){const t={};return dT(n)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Fc(n,((s,o)=>{const l=Ro(o,e.childContextForField(s));l!=null&&(t[s]=l)})),{mapValue:{fields:t}}}function uS(n){if(typeof n!="object"||n===null)return!1;if(typeof Temporal<"u"&&typeof Temporal.Instant=="function"&&n instanceof Temporal.Instant)return!0;const e=n;return e[Symbol.toStringTag]==="Temporal.Instant"&&typeof e.t=="bigint"}function dS(n){return!(typeof n!="object"||n===null||n instanceof Array||n instanceof Date||n instanceof Qn||n instanceof So||n instanceof Ea||n instanceof ks||n instanceof kh||n instanceof Ai||uS(n)||XT(n))}function $1(n,e,t){if(!dS(t)||!ip(t)){const s=Rg(t);throw s==="an object"?e.createError(n+" a custom object"):e.createError(n+" "+s)}}function Rc(n,e,t){if((e=$s(e))instanceof Ug)return e._internalPath;if(typeof e=="string")return hS(n,e);throw ag("Field path arguments must be of type string or ",n,!1,void 0,t)}const _6=new RegExp("[~\\*/\\[\\]]");function hS(n,e,t){if(e.search(_6)>=0)throw ag(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,n,!1,void 0,t);try{return new Ug(...e.split("."))._internalPath}catch{throw ag(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,n,!1,void 0,t)}}function ag(n,e,t,s,o){const l=s&&!s.isEmpty(),u=o!==void 0;let h=`Function ${e}() called with invalid data`;t&&(h+=" (via `toFirestore()`)"),h+=". ";let f="";return(l||u)&&(f+=" (found",l&&(f+=` in field ${s}`),u&&(f+=` in document ${o}`),f+=")"),new Xe(Ie.INVALID_ARGUMENT,h+n+f)}function fS(n,e){return n.some((t=>t.isEqual(e)))}function mS(n){return typeof n._readUserData=="function"}/** 2119 * @license 2120 * Copyright 2025 Google LLC 2121 * 2122 * Licensed under the Apache License, Version 2.0 (the "License");
2123 * you may not use this file except in compliance with the License. 2124 * You may obtain a copy of the License at 2125 * 2126 * http://www.apache.org/licenses/LICENSE-2.0 2127 * 2128 * Unless required by applicable law or agreed to in writing, software 2129 * distributed under the License is distributed on an "AS IS" BASIS, 2130 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2131 * See the License for the specific language governing permissions and 2132 * limitations under the License. 2133 */class Qr{constructor(e){this.optionDefinitions=e}_getKnownOptions(e,t){const s=hi.empty();for(const o in this.optionDefinitions)if(this.optionDefinitions.hasOwnProperty(o)){const l=this.optionDefinitions[o];if(o in e){const u=e[o];let h;l.nestedOptions&&ip(u)?h={mapValue:{fields:new Qr(l.nestedOptions).getOptionsProto(t,u)}}:u&&(h=Ro(u,t)??void 0),h&&s.set(na.fromServerFormat(l.serverName),h)}}return s}getOptionsProto(e,t,s){const o=this._getKnownOptions(t,e);if(s){const l=new Map(OM(s,((u,h)=>[na.fromServerFormat(h),u!==void 0?Ro(u,e):null])));o.setAll(l)}return o.value.mapValue.fields??{}}}/** 2134 * @license 2135 * Copyright 2024 Google LLC 2136 * 2137 * Licensed under the Apache License, Version 2.0 (the "License"); 2138 * you may not use this file except in compliance with the License. 2139 * You may obtain a copy of the License at 2140 * 2141 * http://www.apache.org/licenses/LICENSE-2.0 2142 * 2143 * Unless required by applicable law or agreed to in writing, software 2144 * distributed under the License is distributed on an "AS IS" BASIS, 2145 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2146 * See the License for the specific language governing permissions and 2147 * limitations under the License. 2148 */function w6(n){return typeof n=="object"&&n!==null&&!!("nullValue"in n&&(n.nullValue===null||n.nullValue==="NULL_VALUE")||"booleanValue"in n&&(n.booleanValue===null||typeof n.booleanValue=="boolean")||"integerValue"in n&&(n.integerValue===null||typeof n.integerValue=="number"||typeof n.integerValue=="string")||"doubleValue"in n&&(n.doubleValue===null||typeof n.doubleValue=="number")||"timestampValue"in n&&(n.timestampValue===null||(function(t){return typeof t=="object"&&t!==null&&"seconds"in t&&(t.seconds===null||typeof t.seconds=="number"||typeof t.seconds=="string")&&"nanos"in t&&(t.nanos===null||typeof t.nanos=="number")})(n.timestampValue))||"stringValue"in n&&(n.stringValue===null||typeof n.stringValue=="string")||"bytesValue"in n&&(n.bytesValue===null||n.bytesValue instanceof Uint8Array)||"referenceValue"in n&&(n.referenceValue===null||typeof n.referenceValue=="string")||"geoPointValue"in n&&(n.geoPointValue===null||(function(t){return typeof t=="object"&&t!==null&&"latitude"in t&&(t.latitude===null||typeof t.latitude=="number")&&"longitude"in t&&(t.longitude===null||typeof t.longitude=="number")})(n.geoPointValue))||"arrayValue"in n&&(n.arrayValue===null||(function(t){return typeof t=="object"&&t!==null&&!(!("values"in t)||t.values!==null&&!Array.isArray(t.values))})(n.arrayValue))||"mapValue"in n&&(n.mapValue===null||(function(t){return typeof t=="object"&&t!==null&&!(!("fields"in t)||t.fields!==null&&!ip(t.fields))})(n.mapValue))||"fieldReferenceValue"in n&&(n.fieldReferenceValue===null||typeof n.fieldReferenceValue=="string")||"functionValue"in n&&(n.functionValue===null||(function(t){return typeof t=="object"&&t!==null&&!(!("name"in t)||t.name!==null&&typeof t.name!="string"||!("args"in t)||t.args!==null&&!Array.isArray(t.args))})(n.functionValue))||"pipelineValue"in n&&(n.pipelineValue===null||(function(t){return typeof t=="object"&&t!==null&&!(!("stages"in t)||t.stages!==null&&!Array.isArray(t.stages))})(n.pipelineValue)))}function E6(){return new G1("serverTimestamp")}function og(...n){return new H1("arrayUnion",n)}function Xy(...n){return new q1("arrayRemove",n)}function N6(n){return new Ai(n)}/** 2149 * @license 2150 * Copyright 2024 Google LLC 2151 * 2152 * Licensed under the Apache License, Version 2.0 (the "License"); 2153 * you may not use this file except in compliance with the License. 2154 * You may obtain a copy of the License at 2155 * 2156 * http://www.apache.org/licenses/LICENSE-2.0 2157 * 2158 * Unless required by applicable law or agreed to in writing, softw
vendor: 9,215 bytes, lines 2158-2163
2158are 2159 * distributed under the License is distributed on an "AS IS" BASIS, 2160 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2161 * See the License for the specific language governing permissions and 2162 * limitations under the License. 2163 */function Ke(n){let e;return n instanceof Ku?n:(e=ip(n)?A6(n):n instanceof Array?k6(n):pS(n,void 0),e)}function KC(n){if(n instanceof Ku)return n;if(n instanceof Ai)return Hm(n);if(Array.isArray(n))return Hm(N6(n));throw new Error("Unsupported value: "+typeof n)}function J1(n){return VM(n)?AB(n):Ke(n)}class Ku{constructor(){this._protoValueType="ProtoValue"}add(e){return new je("add",[this,Ke(e)],"add")}asBoolean(){if(this instanceof Ic)return this;if(this instanceof Lh)return new gS(this);if(this instanceof Oh)return new j6(this);if(this instanceof je)return new BS(this);throw new Xe("invalid-argument",`Conversion of type ${typeof this} to BooleanExpression not supported.`)}subtract(e){return new je("subtract",[this,Ke(e)],"subtract")}multiply(e){return new je("multiply",[this,Ke(e)],"multiply")}divide(e){return new je("divide",[this,Ke(e)],"divide")}mod(e){return new je("mod",[this,Ke(e)],"mod")}equal(e){return new je("equal",[this,Ke(e)],"equal").asBoolean()}notEqual(e){return new je("not_equal",[this,Ke(e)],"notEqual").asBoolean()}lessThan(e){return new je("less_than",[this,Ke(e)],"lessThan").asBoolean()}lessThanOrEqual(e){return new je("less_than_or_equal",[this,Ke(e)],"lessThanOrEqual").asBoolean()}greaterThan(e){return new je("greater_than",[this,Ke(e)],"greaterThan").asBoolean()}greaterThanOrEqual(e){return new je("greater_than_or_equal",[this,Ke(e)],"greaterThanOrEqual").asBoolean()}arrayConcat(e,...t){const s=[e,...t].map((o=>Ke(o)));return new je("array_concat",[this,...s],"arrayConcat")}arrayContains(e){return new je("array_contains",[this,Ke(e)],"arrayContains").asBoolean()}arrayContainsAll(e){const t=Array.isArray(e)?new rm(e.map(Ke),"arrayContainsAll"):e;return new je("array_contains_all",[this,t],"arrayContainsAll").asBoolean()}arrayContainsAny(e){const t=Array.isArray(e)?new rm(e.map(Ke),"arrayContainsAny"):e;return new je("array_contains_any",[this,t],"arrayContainsAny").asBoolean()}arrayReverse(){return new je("array_reverse",[this])}arrayLength(){return new je("array_length",[this],"arrayLength")}equalAny(e){const t=Array.isArray(e)?new rm(e.map(Ke),"equalAny"):e;return new je("equal_any",[this,t],"equalAny").asBoolean()}notEqualAny(e){const t=Array.isArray(e)?new rm(e.map(Ke),"notEqualAny"):e;return new je("not_equal_any",[this,t],"notEqualAny").asBoolean()}exists(){return new je("exists",[this],"exists").asBoolean()}charLength(){return new je("char_length",[this],"charLength")}like(e){return new je("like",[this,Ke(e)],"like").asBoolean()}regexContains(e){return new je("regex_contains",[this,Ke(e)],"regexContains").asBoolean()}regexFind(e){return new je("regex_find",[this,Ke(e)],"regexFind")}regexFindAll(e){return new je("regex_find_all",[this,Ke(e)],"regexFindAll")}regexMatch(e){return new je("regex_match",[this,Ke(e)],"regexMatch").asBoolean()}stringContains(e){return new je("string_contains",[this,Ke(e)],"stringContains").asBoolean()}startsWith(e){return new je("starts_with",[this,Ke(e)],"startsWith").asBoolean()}endsWith(e){return new je("ends_with",[this,Ke(e)],"endsWith").asBoolean()}toLower(){return new je("to_lower",[this],"toLower")}toUpper(){return new je("to_upper",[this],"toUpper")}trim(e){const t=[this];return e&&t.push(Ke(e)),new je("trim",t,"trim")}ltrim(e){const t=[this];return e&&t.push(Ke(e)),new je("ltrim",t,"ltrim")}rtrim(e){const t=[this];return e&&t.push(Ke(e)),new je("rtrim",t,"rtrim")}type(){return new je("type",[this])}isType(e){return new je("is_type",[this,Hm(e)],"isType").asBoolean()}stringConcat(e,...t){const s=[e,...t].map(Ke);return new je("string_concat",[this,...s],"stringConcat")}stringIndexOf(e){return new je("string_index_of",[this,Ke(e)],"stringIndexOf")}stringRepeat(e){return new je("string_repeat",[this,Ke(e)],"stringRepeat")}stringReplaceAll(e,t){return new je("string_replace_all",[this,Ke(e),Ke(t)],"stringReplaceAll")}stringReplaceOne(e,t){return new je("string_replace_one",[this,Ke(e),Ke(t)],"stringReplaceOne")}concat(e,...t){const s=[e,...t].map(Ke);return new je("concat",[this,...s],"concat")}reverse(){return new je("reverse",[this],"reverse")}arrayFilter(e,t){return new je("array_filter",[this,Ke(e),t],"arrayFilter")}arrayTransform(e,t){return new je("array_transform",[this,Ke(e),t],"arrayTransform")}arrayTransformWithIndex(e,t,s){return new je("array_transform",[this,Ke(e),Ke(t),s],"arrayTransformWithIndex")}arraySlice(e,t){const s=[this,Ke(e)];return t!==void 0&&s.push(Ke(t)),new je("array_slice",s,"arraySlice")}arrayFirst(){return new je("array_first",[this],"arrayFirst")}arrayFirstN(e){return new je("array_first_n",[this,Ke(e)],"arrayFirstN")}arrayLast(){return new je("array_last",[this],"arrayLast")}arrayLastN(e){return new je("array_last_n",[this,Ke(e)],"arrayLastN")}arrayMaximum(){return new je("maximum",[this],"arrayMaximum")}arrayMaximumN(e){return new je("maximum_n",[this,Ke(e)],"arrayMaximumN")}arrayMinimum(){return new je("minimum",[this],"arrayMinimum")}arrayMinimumN(e){return new je("minimum_n",[this,Ke(e)],"arrayMinimumN")}arrayIndexOf(e){return new je("array_index_of",[this,Ke(e),Ke("first")],"arrayIndexOf")}arrayLastIndexOf(e){return new je("array_index_of",[this,Ke(e),Ke("last")],"arrayLastIndexOf")}arrayIndexOfAll(e){return new je("array_index_of_all",[this,Ke(e)],"arrayIndexOfAll")}byteLength(){return new je("byte_length",[this],"byteLength")}ceil(){return new je("ceil",[this])}floor(){return new je("floor",[this])}abs(){return new je("abs",[this])}exp(){return new je("exp",[this])}mapGet(e){return new je("map_get",[this,Hm(e)],"mapGet")}mapSet(e,t,...s){const o=[this,Ke(e),Ke(t),...s.map(Ke)];return new je("map_set",o,"mapSet")}mapKeys(){return new je("map_keys",[this],"mapKeys")}mapValues(){return new je("map_values",[this],"mapValues")}mapEntries(){return new je("map_entries",[this],"mapEntries")}getField(e){return new je("get_field",[this,Ke(e)],"get_field")}count(){return Xi._create("count",[this],"count")}sum(){return Xi._create("sum",[this],"sum")}average(){return Xi._create("average",[this],"average")}minimum(){return Xi._create("minimum",[this],"minimum")}maximum(){return Xi._create("maximum",[this],"maximum")}first(){return Xi._create("first",[this],"first")}last(){return Xi._create("last",[this],"last")}arrayAgg(){return Xi._create("array_agg",[this],"arrayAgg")}arrayAggDistinct(){return Xi._create("array_agg_distinct",[this],"arrayAggDistinct")}countDistinct(){return Xi._create("count_distinct",[this],"countDistinct")}logicalMaximum(e,...t){const s=[e,...t];return new je("maximum",[this,...s.map(Ke)],"logicalMaximum")}logicalMinimum(e,...t){const s=[e,...t];return new je("minimum",[this,...s.map(Ke)],"minimum")}vectorLength(){return new je("vector_length",[this],"vectorLength")}cosineDistance(e){return new je("cosine_distance",[this,KC(e)],"cosineDistance")}dotProduct(e){return new je("dot_product",[this,KC(e)],"dotProduct")}euclideanDistance(e){return new je("euclidean_distance",[this,KC(e)],"euclideanDistance")}unixMicrosToTimestamp(){return new je("unix_micros_to_timestamp",[this],"unixMicrosToTimestamp")}timestampToUnixMicros(){return new je("timestamp_to_unix_micros",[this],"timestampToUnixMicros")}unixMillisToTimestamp(){return new je("unix_millis_to_timestamp",[this],"unixMillisToTimestamp")}timestampToUnixMillis(){return new je("timestamp_to_unix_millis",[this],"timestampToUnixMillis")}unixSecondsToTimestamp(){return new je("unix_seconds_to_timestamp",[this],"unixSecondsToTimestamp")}timestampToUnixSeconds(){return new je("timestamp_to_unix_seconds",[this],"timestampToUnixSeconds")}timestampAdd(e,t){return new je("timestamp_add",[this,Ke(e),Ke(t)],"timestampAdd")}timestampSubtract(e,t){return new je("timestamp_subtract",[this,Ke(e),Ke(t)],"timestampSubtract")}timestampDiff(e,t){return new je("timestamp_diff",[this,J1(e),Ke(t)],"timestampDiff")}timestampExtract(e,t){const s=[this,Ke(e)];return t&&s.push(Ke(t)),new je("timestamp_extract",s,"timestampExtract")}documentId(){return new je("document_id",[this],"documentId")}parent(){return new je("parent",[this],"parent")}substring(e,t){const s=Ke(e);return new je("substring",t===void 0?[this,s]:[this,s,Ke(t)],"substring")}arrayGet(e){return new je("array_get",[this,Ke(e)],"arrayGet")}isError(){return new je("is_error",[this],"isError").asBoolean()}ifError(e){const t=new je("if_error",[this,Ke(e)],"ifError");return e instanceof Ic?t.asBoolean():t}isAbsent(){return new je("is_absent",[this],"isAbsent").asBoolean()}mapRemove(e){return new je("map_remove",[this,Ke(e)],"mapRemove")}mapMerge(e,...t){const s=Ke(e),o=t.map(Ke);return new je("map_merge",[this,s,...o],"mapMerge")}pow(e){return new je("pow",[this,Ke(e)])}trunc(e){return e===void 0?new je("trunc",[this]):new je("trunc",[this,Ke(e)],"trunc")}round(e){return e===void 0?new je("round",[this]):new je("round",[this,Ke(e)],"round")}collectionId(){return new je("collection_id",[this])}length(){return new je("length",[this])}ln(){return new je("ln",[this])}sqrt(){return new je("sqrt",[this])}
vendor: 11,261 bytes, lines 2163-2194
2163stringReverse(){return new je("string_reverse",[this])}ifAbsent(e){return new je("if_absent",[this,Ke(e)],"ifAbsent")}ifNull(e){return new je("if_null",[this,Ke(e)],"ifNull")}coalesce(e,...t){return new je("coalesce",[this,Ke(e),...t.map(Ke)],"coalesce")}join(e){return new je("join",[this,Ke(e)],"join")}log10(){return new je("log10",[this])}arraySum(){return new je("sum",[this])}split(e){return new je("split",[this,Ke(e)])}timestampTruncate(e,t){const s=[this,Ke(e)];return t&&s.push(Ke(t)),new je("timestamp_trunc",s)}ascending(){return R6(this)}descending(){return I6(this)}as(e){return new T6(this,e,"as")}}class Xi{constructor(e,t){this.name=e,this.params=t,this.exprType="AggregateFunction",this._protoValueType="ProtoValue"}static _create(e,t,s){const o=new Xi(e,t);return o._methodName=s,o}as(e){return new D6(this,e,"as")}_toProto(e){return{functionValue:{name:this.name,args:this.params.map((t=>t._toProto(e)))}}}_readUserData(e){e=this._methodName?e.contextWith({methodName:this._methodName}):e,this.params.forEach((t=>t._readUserData(e)))}}class D6{constructor(e,t,s){this.aggregate=e,this.alias=t,this._methodName=s}_readUserData(e){this.aggregate._readUserData(e)}}class T6{constructor(e,t,s){this.expr=e,this.alias=t,this._methodName=s,this.exprType="AliasedExpression",this.selectable=!0}_readUserData(e){this.expr._readUserData(e)}}class rm extends Ku{constructor(e,t){super(),this.cr=e,this._methodName=t,this.expressionType="ListOfExpressions"}_toProto(e){return{arrayValue:{values:this.cr.map((t=>t._toProto(e)))}}}_readUserData(e){this.cr.forEach((t=>t._readUserData(e)))}}class Oh extends Ku{constructor(e,t){super(),this.fieldPath=e,this._methodName=t,this.expressionType="Field",this.selectable=!0}get _fieldPath(){return this.fieldPath}get fieldName(){return this.fieldPath.canonicalString()}get alias(){return this.fieldName}get expr(){return this}geoDistance(e){return new je("geo_distance",[this,Ke(e)],"geoDistance")}_toProto(e){return{fieldReferenceValue:this.fieldPath.canonicalString()}}_readUserData(e){}}function AB(n){return S6(n,"field")}function S6(n,e){return new Oh(typeof n=="string"?Co===n?GP()._internalPath:Rc("field",n):n._internalPath,e)}class Lh extends Ku{constructor(e,t){super(),this.value=e,this._methodName=t,this.expressionType="Constant"}static _fromProto(e){const t=new Lh(e,void 0);return t._protoValue=e,t}_toProto(e){return pt(this._protoValue!==void 0,237),this._protoValue}_getValue(){return this._protoValue}_readUserData(e){e=this._methodName?e.contextWith({methodName:this._methodName}):e,w6(this._protoValue)||(this._protoValue=Ro(this.value,e))}}function Hm(n,e){return pS(n,"constant")}function pS(n,e){const t=new Lh(n,e);return typeof n=="boolean"?new gS(t):t}class je extends Ku{constructor(e,t,s,o){super(),this.name=e,this.params=t,this.expressionType="Function",this._optionsProto=void 0,s!==void 0&&(this._methodName=s),o!==void 0&&(this._options=o)}get _optionsUtil(){return new Qr({})}_toProto(e){const t={functionValue:{name:this.name,args:this.params.map((s=>s._toProto(e)))}};return this._optionsProto&&(t.functionValue.options=this._optionsProto),t}_readUserData(e){e=this._methodName?e.contextWith({methodName:this._methodName}):e,this.params.forEach((t=>t._readUserData(e))),this._options&&(this._optionsProto=this._optionsUtil.getOptionsProto(e,this._options))}}class Ic extends Ku{get _methodName(){return this._expr._methodName}countIf(){return Xi._create("count_if",[this],"countIf")}not(){return new je("not",[this],"not").asBoolean()}conditional(e,t){return new je("conditional",[this,e,t],"conditional")}ifError(e){const t=Ke(e),s=new je("if_error",[this,t],"ifError");return t instanceof Ic?s.asBoolean():s}_toProto(e){return this._expr._toProto(e)}_readUserData(e){this._expr._readUserData(e)}}class BS extends Ic{constructor(e){super(),this._expr=e,this.expressionType="Function"}}class gS extends Ic{constructor(e){super(),this._expr=e,this.expressionType="Constant"}_getValue(){return this._expr._getValue()}}class j6 extends Ic{constructor(e){super(),this._expr=e,this.expressionType="Field"}}function A6(n,e){const t=[];for(const s in n)if(Object.prototype.hasOwnProperty.call(n,s)){const o=n[s];t.push(Hm(s)),t.push(Ke(o))}return new je("map",t,"map")}function k6(n){return(function(t,s){return new je("array",t.map((o=>Ke(o))),s)})(n,"array")}function R6(n){return new xS(J1(n),"ascending","ascending")}function I6(n){return new xS(J1(n),"descending","descending")}class xS{constructor(e,t,s){this.expr=e,this.direction=t,this._methodName=s,this._protoValueType="ProtoValue"}_toProto(e){return{mapValue:{fields:{direction:WT(this.direction),expression:this.expr._toProto(e)}}}}_readUserData(e){this.expr._readUserData(e)}}/** 2164 * @license 2165 * Copyright 2024 Google LLC 2166 * 2167 * Licensed under the Apache License, Version 2.0 (the "License"); 2168 * you may not use this file except in compliance with the License. 2169 * You may obtain a copy of the License at 2170 * 2171 * http://www.apache.org/licenses/LICENSE-2.0 2172 * 2173 * Unless required by applicable law or agreed to in writing, software 2174 * distributed under the License is distributed on an "AS IS" BASIS, 2175 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2176 * See the License for the specific language governing permissions and 2177 * limitations under the License. 2178 */class sa{constructor(e){this.optionsProto=void 0,{rawOptions:this.rawOptions,...this.knownOptions}=e}_readUserData(e){this.optionsProto=this._optionsUtil.getOptionsProto(e,this.knownOptions,this.rawOptions)}_toProto(e){return{name:this._name,options:this.optionsProto}}}class bS extends sa{get _name(){return"add_fields"}get _optionsUtil(){return new Qr({})}constructor(e,t){super(t),this.fields=e}_toProto(e){return{...super._toProto(e),args:[Gm(e,this.fields)]}}_readUserData(e){super._readUserData(e),Oc(this.fields,e)}}class CS extends sa{get _name(){return"aggregate"}get _optionsUtil(){return new Qr({})}constructor(e,t,s){super(s),this.groups=e,this.accumulators=t}_toProto(e){return{...super._toProto(e),args:[Gm(e,this.accumulators),Gm(e,this.groups)]}}_readUserData(e){super._readUserData(e),Oc(this.groups,e),Oc(this.accumulators,e)}}class yS extends sa{get _name(){return"distinct"}get _optionsUtil(){return new Qr({})}constructor(e,t){super(t),this.groups=e}_toProto(e){return{...super._toProto(e),args:[Gm(e,this.groups)]}}_readUserData(e){super._readUserData(e),Oc(this.groups,e)}}class Kg extends sa{get _name(){return"collection"}get _optionsUtil(){return new Qr({forceIndex:{serverName:"force_index"}})}constructor(e,t){super(t),this.hr=e.startsWith("/")?e:"/"+e}_toProto(e){return{...super._toProto(e),args:[{referenceValue:this.hr}]}}_readUserData(e){super._readUserData(e)}}class Qg extends sa{get _name(){return"collection_group"}get _optionsUtil(){return new Qr({forceIndex:{serverName:"force_index"}})}constructor(e,t){super(t),this.collectionId=e}_toProto(e){return{...super._toProto(e),args:[{referenceValue:""},{stringValue:this.collectionId}]}}_readUserData(e){super._readUserData(e)}}class K1 extends sa{get _name(){return"database"}get _optionsUtil(){return new Qr({})}_toProto(e){return{...super._toProto(e)}}_readUserData(e){super._readUserData(e)}}class Q1 extends sa{get _name(){return"documents"}get _optionsUtil(){return new Qr({})}constructor(e,t){if(super(t),!e||e.length===0)throw new Xe(Ie.INVALID_ARGUMENT,"Empty document paths are not allowed in DocumentsSource");const s=e.map((l=>l.startsWith("/")?l:"/"+l)),o=new Set(s);if(o.size!==s.length)throw new Xe(Ie.INVALID_ARGUMENT,"Duplicate document paths are not allowed in DocumentsSource");this.Tr=s,this.Pr=o}_toProto(e){return{...super._toProto(e),args:this.Tr.map((t=>({referenceValue:t})))}}_readUserData(e){super._readUserData(e)}}class Yg extends sa{get _name(){return"where"}get _optionsUtil(){return new Qr({})}constructor(e,t){super(t),this.condition=e}_toProto(e){return{...super._toProto(e),args:[this.condition._toProto(e)]}}_readUserData(e){super._readUserData(e),Oc(this.condition,e)}}class Uu extends sa{get _name(){return"limit"}get _optionsUtil(){return new Qr({})}constructor(e,t){pt(!isNaN(e)&&e!==1/0&&e!==-1/0,34860),super(t),this.limit=e}_toProto(e){return{...super._toProto(e),args:[O1(e,this.limit)]}}}class t5 extends sa{get _name(){return"offset"}get _optionsUtil(){return new Qr({})}constructor(e,t){super(t),this.offset=e}_toProto(e){return{...super._toProto(e),args:[O1(e,this.offset)]}}}class O6 extends sa{get _name(){return"select"}get _optionsUtil(){return new Qr({})}constructor(e,t){super(t),this.selections=e}_toProto(e){return{...super._toProto(e),args:[Gm(e,this.selections)]}}_readUserData(e){super._readUserData(e),Oc(this.selections,e)}}class cl extends sa{get _name(){return"sort"}get _optionsUtil(){return new Qr({})}constructor(e,t){super(t),this.orderings=e}_toProto(e){return{...super._toProto(e),args:this.orderings.map((t=>t._toProto(e)))}}_readUserData(e){super._readUserData(e),Oc(this.orderings,e)}}class Y1 extends sa{get _name(){return"replace_with"}get _optionsUtil(){return new Qr({})}constructor(e,t){super(t),this.map=e}_toProto(e){return{...super._toProto(e),args:[this.map._toProto(e),WT(Y1.Ir)]}}_readUserData(e){super._readUserData(e),Oc(this.map,e)}}Y1.Ir="full_replace";function Oc(n,e){return mS(n)?n._readUserData(e):Array.isArray(n)?n.forEach((t=>t._readUserData(e))):n instanceof Map?n.forEach((t=>t._readUserData(e))):Object.values(n).forEach((t=>t._readUserData(e))),n}/** 2179 * @license 2180 * Copyright 2026 Google LLC 2181 * 2182 * Licensed under the Apache License, Version 2.0 (the "License"); 2183 * you may not use this file except in compliance with the License. 2184 * You may obtain a copy of the License at 2185 * 2186 * http://www.apache.org/licenses/LICENSE-2.0 2187 * 2188 * Unless required by applicable law or agreed to in writing, software 2189 * distributed under the License is distributed on an "AS IS" BASIS, 2190 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2191 * See the License for the specific language governing permissions and 2192 * limitations under the License. 2193 */class xm{constructor(e,t,s,o){this._db=e,this.userDataReader=t,this._userDataWriter=s,this.stages=o}Vr(e,t){const s=this.userDataReader.createContext(3,e);return mS(t)?t._readUserData(s):Array.isArray(t)?t.forEach((o=>o._readUserData(s))):t.forEach((o=>o._readUserData(s))),t}where(e){const t=this.stages.map((s=>s));return this.Vr("where",e),t.push(new Yg(e,{})),new xm(this._db,this.userDataReader,this._userDataWriter,t)}limit(e){const t=this.stages.map((s=>s));return t.push(new Uu(e,{})),new xm(this._db,this.userDataReader,this._userDataWriter,t)}sort(e,...t){const s=this.stages.map((o=>o));return"orderings"in e?s.push(new cl(this.Vr("sort",e.orderings),{})):s.push(new cl(this.Vr("sort",[e,...t]),{})),new xm(this._db,this.userDataReader,this._userDataWriter,s)}dr(e){return{pipeline:{stages:this.stages.map((t=>t._toProto(e)))}}}}// Copyright 2024 Google LLC* @license 2194class ui{constructor(e,t,s){this.serializer=e,this.stages=t,this.listenOptions=s,this.isCorePipeline=!0}getPipelineCollection(){return Xg(this)}getPipelineCollectionGroup(){return X1(this)}getPipelineCollectionId(){return L6(this)}getPipelineDocuments(){return Wy(this)}getPipelineFlavor(){return(function(t){let s="exact";
2194return t.stages.forEach(((o,l)=>{o._name!==yS.name&&o._name!==CS.name||(s="keyless"),o._name===O6.name&&s==="exact"&&(s="augmented"),o._name===bS.name&&l<t.stages.length-1&&s==="exact"&&(s="augmented")})),s})(this)}getPipelineSourceType(){return Ec(this)}}function Ec(n){const e=n.stages[0];return e instanceof Kg||e instanceof Qg||e instanceof K1||e instanceof Q1?e._name:"unknown"}function Xg(n){if(Ec(n)==="collection")return n.stages[0].hr}function X1(n){if(Ec(n)==="collection_group")return n.stages[0].collectionId}function L6(n){switch(Ec(n)){case"collection":return Pn.fromString(Xg(n)).lastSegment();case"collection_group":return X1(n);default:return}}function Wy(n){if(Ec(n)==="documents")return n.stages[0].Tr}class se{constructor(e,t){this.type=e,this.value=t}static mr(){return new se("ERROR",void 0)}static pr(){return new se("UNSET",void 0)}static gr(){return new se("NULL",Ch)}static newValue(e){return ea(e)?new se("NULL",Ch):(function(s){return!!s&&"booleanValue"in s})(e)?new se("BOOLEAN",e):yo(e)?new se("INT",e):Eu(e)?new se("DOUBLE",e):(function(s){return!!s&&"timestampValue"in s&&!!s.timestampValue})(e)?new se("TIMESTAMP",e):(function(s){return!!s&&"stringValue"in s})(e)?new se("STRING",e):(function(s){return!!s&&"bytesValue"in s})(e)?new se("BYTES",e):e.referenceValue?new se("REFERENCE",e):e.geoPointValue?new se("GEO_POINT",e):vh(e)?new se("ARRAY",e):ZB(e)?new se("VECTOR",e):Su(e)?new se("MAP",e):new se("ERROR",void 0)}yr(){return this.type==="ERROR"||this.type==="UNSET"}wr(){return this.type==="NULL"}}function bm(n){if(!n.yr())return n.value}function vS(n){return n instanceof Ic?n._expr:n}function Dt(n){if((n=vS(n))instanceof Oh)return new M6(n);if(n instanceof Lh)return new P6(n);if(n instanceof rm)return new z6(n);if(n instanceof je){if(n.name==="add")return new U6(n);if(n.name==="subtract")return new G6(n);if(n.name==="multiply")return new H6(n);if(n.name==="divide")return new q6(n);if(n.name==="mod")return new $6(n);if(n.name==="and")return new J6(n);if(n.name==="equal")return new i8(n);if(n.name==="not_equal")return new a8(n);if(n.name==="less_than")return new o8(n);if(n.name==="less_than_or_equal")return new l8(n);if(n.name==="greater_than")return new c8(n);if(n.name==="greater_than_or_equal")return new u8(n);if(n.name==="array_concat")return new d8(n);if(n.name==="array_reverse")return new h8(n);if(n.name==="array_contains")return new f8(n);if(n.name==="array_contains_all")return new m8(n);if(n.name==="array_contains_any")return new p8(n);if(n.name==="array_length")return new B8(n);if(n.name==="array_element")return new g8(n);if(n.name==="equal_any")return new _S(n);if(n.name==="not_equal_any")return new Q6(n);if(n.name==="is_nan")return new Y6(n);if(n.name==="is_not_nan")return new X6(n);if(n.name==="is_null")return new W6(n);if(n.name==="is_not_null")return new Z6(n);if(n.name==="is_error")return new e8(n);if(n.name==="exists")return new t8(n);if(n.name==="not")return new Wg(n);if(n.name==="or")return new K6(n);if(n.name==="xor")return new W1(n);if(n.name==="conditional")return new n8(n);if(n.name==="maximum")return new s8(n);if(n.name==="minimum")return new r8(n);if(n.name==="reverse")return new x8(n);if(n.name==="replace_first")return new b8(n);if(n.name==="replace_all")return new C8(n);if(n.name==="char_length")return new y8(n);if(n.name==="byte_length")return new v8(n);if(n.name==="like")return new _8(n);if(n.name==="regex_contains")return new w8(n);if(n.name==="regex_match")return new E8(n);if(n.name==="string_contains")return new N8(n);if(n.name==="starts_with")return new D8(n);if(n.name==="ends_with")return new T8(n);if(n.name==="to_lower")return new S8(n);if(n.name==="to_upper")return new j8(n);if(n.name==="trim")return new A8(n);if(n.name==="string_concat")return new k8(n);if(n.name==="map_get")return new R8(n);if(n.name==="cosine_distance")return new I8(n);if(n.name==="dot_product")return new O8(n);if(n.name==="euclidean_distance")return new L8(n);if(n.name==="vector_length")return new M8(n);if(n.name==="unix_micros_to_timestamp")return new U8(n);if(n.name==="timestamp_to_unix_micros")return new q8(n);if(n.name==="unix_millis_to_timestamp")return new G8(n);if(n.name==="timestamp_to_unix_millis")return new $8(n);if(n.name==="unix_seconds_to_timestamp")return new H8(n);if(n.name==="timestamp_to_unix_seconds")return new J8(n);if(n.name==="timestamp_add")return new K8(n);if(n.name==="timestamp_subtract")return new Q8(n)}throw new Error(`Unknown Expr : ${n}`)}class M6{constructor(e){this.expr=e}evaluate(e,t){if(this.expr.fieldName===Co)return se.newValue({referenceValue:ig(e.serializer,t.key)});if(this.expr.fieldName==="__update_time__")return se.newValue({timestampValue:jB(e.serializer,t.version)});if(this.expr.fieldName==="__create_time__")return se.newValue({timestampValue:jB(e.serializer,t.createTime)});const s=t.data.field(this.expr._fieldPath);return s?Ig(s)?se.newValue((function(l,u){if(l.serverTimestampBehavior==="estimate")return{timestampValue:jB(l.serializer,zt.fromTimestamp(bh(u)))};if(l.serverTimestampBehavior==="previous"){const h=op(u);if(h)return h}return{nullValue:"NULL_VALUE"}})(e,s)):se.newValue(s):se.pr()}}class P6{constructor(e){this.expr=e}evaluate(e,t){return se.newValue(this.expr._getValue())}}class z6{constructor(e){this.expr=e}evaluate(e,t){const s=this.expr.cr.map((o=>Dt(o).evaluate(e,t)));return s.some((o=>o.yr()))?se.mr():se.newValue({arrayValue:{values:s.map((o=>o.value))}})}}function Mr(n){return Eu(n)?Number(n.doubleValue):Number(n.integerValue)}function Io(n){return BigInt(n.integerValue)}const F6=BigInt("0x7fffffffffffffff"),V6=-BigInt("0x8000000000000000");class dp{constructor(e){this.expr=e}evaluate(e,t){pt(this.expr.params.length>=2,24778);const s=Dt(this.expr.params[0]).evaluate(e,t),o=Dt(this.expr.params[1]).evaluate(e,t);let l=this.br(s,o);for(const u of this.expr.params.slice(2)){const h=Dt(u).evaluate(e,t);l=this.br(l,h)}return l}br(e,t){if(e.yr()||t.yr())return se.mr();if(e.wr()||t.wr())return se.gr();const s=e.value,o=t.value;if(!Eu(s)&&!yo(s)||!Eu(o)&&!yo(o))return se.mr();if(Eu(s)||Eu(o)){const l=this.Sr(s,o);return l?se.newValue(l):se.mr()}if(yo(s)&&yo(o)){const l=this.vr(s,o);return l===void 0?se.mr():typeof l=="number"?se.newValue({doubleValue:l}):l<V6||l>F6?se.mr():se.newValue({integerValue:`${l}`})}return se.mr()}}function vl(n,e){return lr(n)!==lr(e)?"TYPE_MISMATCH":Ii(n)||Ii(e)?"NOT_EQ":ea(n)&&ea(e)?"EQ":ea(n)||ea(e)?"NULL":vh(n)&&vh(e)?(function(s,o){var u,h,f;if(((u=s.values)==null?void 0:u.length)!==((h=o.values)==null?void 0:h.length))return"NOT_EQ";let l=!1;for(let p=0;p<(((f=s.values)==null?void 0:f.length)??0);p++){const x=s.values[p],b=o.values[p];switch(vl(x,b)){case"EQ":break;case"NOT_EQ":case"TYPE_MISMATCH":return"NOT_EQ";case"NULL":l=!0;break;default:Ct(44609,{Dr:x,Cr:b})}}return l?"NULL":"EQ"})(n.arrayValue,e.arrayValue):ZB(n)&&ZB(e)||Su(n)&&Su(e)?(function(s,o){const l=s.fields||{},u=o.fields||{};if(WB(l)!==WB(u))return"NOT_EQ";let h=!1;for(const f in l)if(l.hasOwnProperty(f)){if(u[f]===void 0)return"NOT_EQ";switch(vl(l[f],u[f])){case"NOT_EQ":case"TYPE_MISMATCH":return"NOT_EQ";case"NULL":h=!0}}return h?"NULL":"EQ"})(n.mapValue,e.mapValue):(function(s,o){return Ta(s,o,{u:!1,i:!0,o:!0})})(n,e)?"EQ":"NOT_EQ"}class U6 extends dp{vr(e,t){return Io(e)+Io(t)}
2194Sr(e,t){return{doubleValue:Mr(e)+Mr(t)}}}class G6 extends dp{constructor(e){super(e),this.expr=e}vr(e,t){return Io(e)-Io(t)}Sr(e,t){return{doubleValue:Mr(e)-Mr(t)}}}class H6 extends dp{constructor(e){super(e),this.expr=e}vr(e,t){return Io(e)*Io(t)}Sr(e,t){return{doubleValue:Mr(e)*Mr(t)}}}class q6 extends dp{constructor(e){super(e),this.expr=e}vr(e,t){const s=Io(t);if(s!==BigInt(0))return Io(e)/s}Sr(e,t){const s=Mr(t);return s===0?{doubleValue:Lm(s)?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY}:{doubleValue:Mr(e)/s}}}class $6 extends dp{constructor(e){super(e),this.expr=e}vr(e,t){const s=Io(t);if(s!==BigInt(0))return Io(e)%s}Sr(e,t){const s=Mr(t);if(s!==0)return{doubleValue:Mr(e)%s}}}class J6{constructor(e){this.expr=e}evaluate(e,t){var l;let s=!1,o=!1;for(const u of this.expr.params){const h=Dt(u).evaluate(e,t);switch(h.type){case"BOOLEAN":if(!((l=h.value)!=null&&l.booleanValue))return se.newValue(Er);break;case"NULL":o=!0;break;default:s=!0}}return s?se.mr():o?se.gr():se.newValue(ki)}}class Wg{constructor(e){this.expr=e}evaluate(e,t){var o;pt(this.expr.params.length===1,9634);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"BOOLEAN":return se.newValue({booleanValue:!((o=s.value)!=null&&o.booleanValue)});case"NULL":return se.gr();default:return se.mr()}}}class K6{constructor(e){this.expr=e}evaluate(e,t){var l;let s=!1,o=!1;for(const u of this.expr.params){const h=Dt(u).evaluate(e,t);switch(h.type){case"BOOLEAN":if((l=h.value)!=null&&l.booleanValue)return se.newValue(ki);break;case"NULL":o=!0;break;default:s=!0}}return s?se.mr():o?se.gr():se.newValue(Er)}}class W1{constructor(e){this.expr=e}evaluate(e,t){var l;let s=!1,o=!1;for(const u of this.expr.params){const h=Dt(u).evaluate(e,t);switch(h.type){case"BOOLEAN":s=W1.xor(s,!!((l=h.value)!=null&&l.booleanValue));break;case"NULL":o=!0;break;default:return se.mr()}}return o?se.gr():se.newValue({booleanValue:s})}static xor(e,t){return(e||t)&&!(e&&t)}}class _S{constructor(e){this.expr=e}evaluate(e,t){var u,h;pt(this.expr.params.length===2,55094);let s=!1;const o=Dt(this.expr.params[0]).evaluate(e,t);switch(o.type){case"NULL":s=!0;break;case"ERROR":case"UNSET":return se.mr()}const l=Dt(this.expr.params[1]).evaluate(e,t);switch(l.type){case"ARRAY":break;case"NULL":s=!0;break;default:return se.mr()}if(s)return se.gr();for(const f of((h=(u=l.value)==null?void 0:u.arrayValue)==null?void 0:h.values)??[])switch(ea(o.value)&&ea(f)?"EQ":vl(o.value,f)){case"EQ":return se.newValue(ki);case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":s=!0;break;default:Ct(44608,{value:o.value,candidate:f})}return s?se.gr():se.newValue(Er)}}class Q6{constructor(e){this.expr=e}evaluate(e,t){return new Wg(new je("not",[new je("equal_any",this.expr.params)])).evaluate(e,t)}}class Y6{constructor(e){this.expr=e}evaluate(e,t){pt(this.expr.params.length===1,23322);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"INT":return se.newValue(Er);case"DOUBLE":return se.newValue({booleanValue:isNaN(Mr(s.value))});case"NULL":return se.gr();default:return se.mr()}}}class X6{constructor(e){this.expr=e}evaluate(e,t){return pt(this.expr.params.length===1,50406),new Wg(new je("not",[new je("is_nan",this.expr.params)])).evaluate(e,t)}}class W6{constructor(e){this.expr=e}evaluate(e,t){switch(pt(this.expr.params.length===1,23123),Dt(this.expr.params[0]).evaluate(e,t).type){case"NULL":return se.newValue(ki);case"UNSET":case"ERROR":return se.mr();default:return se.newValue(Er)}}}class Z6{constructor(e){this.expr=e}evaluate(e,t){return pt(this.expr.params.length===1,23167),new Wg(new je("not",[new je("is_null",this.expr.params)])).evaluate(e,t)}}class e8{constructor(e){this.expr=e}evaluate(e,t){return pt(this.expr.params.length===1,5228),Dt(this.expr.params[0]).evaluate(e,t).type==="ERROR"?se.newValue(ki):se.newValue(Er)}}class t8{constructor(e){this.expr=e}evaluate(e,t){switch(pt(this.expr.params.length===1,6877),Dt(this.expr.params[0]).evaluate(e,t).type){case"ERROR":return se.mr();case"UNSET":return se.newValue(Er);default:return se.newValue(ki)}}}class n8{constructor(e){this.expr=e}evaluate(e,t){var o;pt(this.expr.params.length===3,11706);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"BOOLEAN":return(o=s.value)!=null&&o.booleanValue?Dt(this.expr.params[1]).evaluate(e,t):Dt(this.expr.params[2]).evaluate(e,t);case"NULL":return Dt(this.expr.params[2]).evaluate(e,t);default:return se.mr()}}}class s8{constructor(e){this.expr=e}evaluate(e,t){const s=this.expr.params.map((l=>Dt(l).evaluate(e,t)));let o;for(const l of s)switch(l.type){case"ERROR":case"UNSET":case"NULL":continue;default:o=o===void 0||Ri(l.value,o.value)>0?l:o}return o===void 0?se.gr():o}}class r8{constructor(e){this.expr=e}evaluate(e,t){const s=this.expr.params.map((l=>Dt(l).evaluate(e,t)));let o;for(const l of s)switch(l.type){case"ERROR":case"UNSET":case"NULL":continue;default:o=o===void 0||Ri(l.value,o.value)<0?l:o}return o===void 0?se.gr():o}}class Mh{constructor(e){this.expr=e}evaluate(e,t){pt(this.expr.params.length===2,31033,`${this.expr.name}() function should have exactly 2 params`);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"ERROR":case"UNSET":return se.mr()}const o=Dt(this.expr.params[1]).evaluate(e,t);switch(o.type){case"ERROR":case"UNSET":return se.mr()}return this.Fr(s,o)}}class i8 extends Mh{constructor(e){super(e),this.expr=e}Fr(e,t){if(e.wr()&&t.wr())return se.newValue(ki);if(e.wr()||t.wr()||Ii(e.value)||Ii(t.value)||lr(e.value)!==lr(t.value))return se.newValue(Er);switch(vl(e.value,t.value)){case"EQ":return se.newValue(ki);case"NOT_EQ":return se.newValue(Er);case"NULL":return se.gr();default:Ct(44615,{left:e,right:t})}}}class a8 extends Mh{constructor(e){super(e),this.expr=e}Fr(e,t){switch(vl(e.value,t.value)){case"EQ":return se.newValue(Er);case"NOT_EQ":case"TYPE_MISMATCH":return se.newValue(ki);case"NULL":return se.gr();default:Ct(44614,{left:e,right:t})}}}class o8 extends Mh{constructor(e){super(e),this.expr=e}Fr(e,t){return lr(e.value)!==lr(t.value)||Ii(e.value)||Ii(t.value)?se.newValue(Er):se.newValue({booleanValue:Ri(e.value,t.value)<0})}}class l8 extends Mh{constructor(e){super(e),this.expr=e}Fr(e,t){return lr(e.value)!==lr(t.value)||Ii(e.value)||Ii(t.value)?se.newValue(Er):vl(e.value,t.value)==="EQ"?se.newValue(ki):se.newValue({booleanValue:Ri(e.value,t.value)<0})}}class c8 extends Mh{constructor(e){super(e),this.expr=e}Fr(e,t){return lr(e.value)!==lr(t.value)||Ii(e.value)||Ii(t.value)?se.newValue(Er):se.newValue({booleanValue:Ri(e.value,t.value)>0})}}class u8 extends Mh{constructor(e){super(e),this.expr=e}Fr(e,t){return lr(e.value)!==lr(t.value)||Ii(e.value)||Ii(t.value)?se.newValue(Er):vl(e.value,t.value)==="EQ"?se.newValue(ki):se.newValue({booleanValue:Ri(e.value,t.value)>0})}}class d8{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class h8{constructor(e){this.expr=e}evaluate(e,t){var o;pt(this.expr.params.length===1,216);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"NULL":return se.gr();case"ARRAY":{const l=((o=s.value.arrayValue)==null?void 0:o.values)??[];return se.newValue({arrayValue:{values:[...l].reverse()}})}default:return se.mr()}}}class f8{constructor(e){this.expr=e}evaluate(e,t){return pt(this.expr.params.length===2,52884),new _S(new je("eq_any",[this.expr.params[1],this.expr.params[0]])).evaluate(e,t)}}class m8{constructor(e){this.expr=e}evaluate(e,t){var f,p,x,b;pt(this.expr.params.length===2,1392);let s=!1;const o=Dt(this.expr.params[0]).evaluate(e,t);switch(o.type){case"ARRAY":break;case"NULL":s=!0;break;default:return se.mr()}const l=Dt(this.expr.params[1]).evaluate(e,t);switch(l.type){case"ARRAY":break;case"NULL":s=!0;break;default:return se.mr()}if(s)return se.gr();const u=((p=(f=l.value)==null?void 0:f.arrayValue)==null?void 0:p.values)??[],h=((b=(x=o.value)==null?void 0:x.arrayValue)==null?void 0:b.values)??[];for(const C of u){let N=!1;s=!1;for(const T of h){switch(ea(C)&&ea(T)?"EQ":vl(C,T)){case"EQ":N=!0;break;case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":s=!0;break;default:Ct(44613,{value:T,search:C})}if(N)break}if(!N)return se.newValue(Er)}return se.newValue(ki)}}class p8{constructor(e){this.expr=e}evaluate(e,t){var f,p,x,b;pt(this.expr.params.length===2,2680);let s=!1;const o=Dt(this.expr.params[0]).evaluate(e,t);switch(o.type){case"ARRAY":break;case"NULL":s=!0;break;default:return se.mr()}const l=Dt(this.expr.params[1]).evaluate(e,t);switch(l.type){case"ARRAY":break;case"NULL":s=!0;break;default:return se.mr()}if(s)return se.gr();const u=((p=(f=l.value)==null?void 0:f.arrayValue)==null?void 0:p.values)??[],h=((b=(x=o.value)==null?void 0:x.arrayValue)==null?void 0:b.values)??[];for(const C of h)for(const N of u)switch(ea(C)&&ea(N)?"EQ":vl(C,N)){case"EQ":return se.newValue(ki);case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":s=!0;break;default:Ct(60403,{value:C,search:N})}return s?se.gr():se.newValue(Er)}}class B8{constructor(e){this.expr=e}evaluate(e,t){var o,l,u;pt(this.expr.params.length===1,38605);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"NULL":return se.gr();case"ARRAY":return se.newValue({integerValue:`${((u=(l=(o=s.value)==null?void 0:o.arrayValue)==null?void 0:l.values)==null?void 0:u.length)??0}`});default:return se.mr()}}}class g8{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class x8{constructor(e){this.expr=e}evaluate(e,t){var o,l;pt(this.expr.params.length===1,1508);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"NULL":return se.gr();case"BYTES":{const u=(o=s.value)==null?void 0:o.bytesValue;if(typeof u=="string"){const h=or.fromBase64String(u).toUint8Array();return h.reverse(),se.newValue({bytesValue:or.fromUint8Array(h).toBase64()})}return se.newValue({bytesValue:new Uint8Array(u).reverse()})}case"STRING":{const u=(l=s.value)==null?void 0:l.stringValue,h=new Intl.__PRIVATE_Segmenter(void 0,{granularity:"grapheme"}).segment(u),f=Array.from(h,(p=>p.segment)).reverse();return se.newValue({stringValue:f.join("")})}default:return se.mr()}}}class b8{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class C8{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class y8{constructor(e){this.expr=e}evaluate(e,t){pt(this.expr.params.length===1,19400);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"NULL":return se.gr();case"STRING":{const o=(function(u){let h=0;for(let f=0;f<u.length;f++){const p=u.codePointAt(f);if(p===void 0)return;if(p<=65535)if(p>=55296&&p<=57343)if(p<=56319){const x=u.codePointAt(f+1);x!==void 0&&x>=56320&&x<=57343?(h+=1,f++):h+=1}else h+=1;else h+=1;else{if(!(p<=1114111))return;h+=1,f++}}return h})(s.value.stringValue);return o===void 0?se.mr():se.newValue({integerValue:o})}default:return se.mr()}}}class v8{constructor(e){this.expr=e}evaluate(e,t){var o,l;pt(this.expr.params.length===1,8486);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"BYTES":{const u=(o=s.value)==null?void 0:o.bytesValue;return typeof u=="string"?se.newValue({integerValue:or.fromBase64String(u).toUint8Array().length}):se.newValue({integerValue:new Uint8Array(u).length})}case"STRING":{const u=(function(f){let p=0;for(let x=0;x<f.length;x++){const b=f.codePointAt(x);if(b===void 0)return;if(b>=55296&&b<=57343){if(!(b<=56319))return;{const C=f.codePointAt(x+1);if(C===void 0||!(C>=56320&&C<=57343))return;p+=4,x++}}else if(b<=127)p+=1;else if(b<=2047)p+=2;else if(b<=65535)p+=3;else{if(!(b<=1114111))return;p+=4,x++}}return p})((l=s.value)==null?void 0:l.stringValue);return u===void 0?se.mr():se.newValue({integerValue:u})}case"NULL":return se.gr();default:return se.mr()}}}class Ph{constructor(e){this.expr=e}evaluate(e,t){var u,h;pt(this.expr.params.length===2,39773,`${this.expr.name}() function should have exactly two parameters`);let s=!1;const o=Dt(this.expr.params[0]).evaluate(e,t);switch(o.type){case"STRING":break;case"NULL":s=!0;break;default:return se.mr()}const l=Dt(this.expr.params[1]).evaluate(e,t);switch(l.type){case"STRING":break;case"NULL":s=!0;break;default:return se.mr()}return s?se.gr():this.Or((u=o.value)==null?void 0:u.stringValue,(h=l.value)==null?void 0:h.stringValue)}}class _8 extends Ph{Or(e,t){try{const s=(function(u){let h="";for(let f=0;f<u.length;f++){const p=u.charAt(f);switch(p){case"_":h+=".";break;case"%":h+=".*";break;case"\\":case".":case"*":case"?":case"+":case"^":case"$":case"|":case"(":case")":case"[":case"]":case"{":case"}":h+="\\"+p;break;default:h+=p}}return"^"+h+"$"})(t),o=j1.compile(s);return se.newValue({booleanValue:o.matches(e)})}catch(s){return Va(`Invalid LIKE pattern converted to regex: ${t}, returning error. Error: ${s}`),se.mr()}}}class w8 extends Ph{Or(e,t){try{const s=j1.compile(t);return se.newValue({booleanValue:s.test(e)})}catch{return Va(`Invalid regex pattern found in regex_contains: ${t}, returning error`),se.mr()}}}class E8 extends Ph{Or(e,t){try{return se.newValue({booleanValue:j1.compile(t).matches(e)})}catch{return Va(`Invalid regex pattern found in regex_match: ${t}, returning error`),se.mr()}}}class N8 extends Ph{Or(e,t){return se.newValue({booleanValue:e.includes(t)})}}class D8 extends Ph{Or(e,t){return se.newValue({booleanValue:e.startsWith(t)})}}class T8 extends Ph{Or(e,t){return se.newValue({booleanValue:e.endsWith(t)})}}class S8{constructor(e){this.expr=e}evaluate(e,t){var o,l;pt(this.expr.params.length===1,29079);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"STRING":return se.newValue({stringValue:(l=(o=s.value)==null?void 0:o.stringValue)==null?void 0:l.toLowerCase()});case"NULL":return se.gr();default:return se.mr()}}}class j8{constructor(e){this.expr=e}evaluate(e,t){var o,l;pt(this.expr.params.length===1,60487);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"STRING":return se.newValue({stringValue:(l=(o=s.value)==null?void 0:o.stringValue)==null?void 0:l.toUpperCase()});case"NULL":return se.gr();default:return se.mr()}}}class A8{constructor(e){this.expr=e}evaluate(e,t){var o,l;pt(this.expr.params.length===1,28544);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"STRING":return se.newValue({stringValue:(l=(o=s.value)==null?void 0:o.stringValue)==null?void 0:l.trim()});case"NULL":return se.gr();default:return se.mr()}}}class k8{constructor(e){this.expr=e}evaluate(e,t){const s=this.expr.params.map((u=>Dt(u).evaluate(e,t)));let o="",l=!1;for(const u of s)switch(u.type){case"STRING":o+=u.value.stringValue;break;case"NULL":l=!0;break;default:return se.mr()}return l?se.gr():se.newValue({stringValue:o})}}class R8{constructor(e){this.expr=e}evaluate(e,t){var u,h,f,p;pt(this.expr.params.length===2,4483);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"UNSET":return se.pr();case"MAP":break;default:return se.mr()}const o=Dt(this.expr.params[1]).evaluate(e,t);if(o.type!=="STRING")return se.mr();const l=(p=(h=(u=s.value)==null?void 0:u.mapValue)==null?void 0:h.fields)==null?void 0:p[(f=o.value)==null?void 0:f.stringValue];return l===void 0?se.pr():se.newValue(l)}}class Z1{constructor(e){this.expr=e}evaluate(e,t){var p,x;pt(this.expr.params.length===2,25231,`${this.expr.name}() function should have exactly 2 params`);let s=!1;const o=Dt(this.expr.params[0]).evaluate(e,t);switch(o.type){case"VECTOR":break;case"NULL":s=!0;break;default:return se.mr()}const l=Dt(this.expr.params[1]).evaluate(e,t);switch(l.type){case"VECTOR":break;case"NULL":s=!0;break;default:return se.mr()}if(s)return se.gr();const u=Hy(o.value),h=Hy(l.value);if(u===void 0||h===void 0||((p=u.values)==null?void 0:p.length)!==((x=h.values)==null?void 0:x.length))return se.mr();const f=this.Mr(u,h);return f===void 0||isNaN(f)?se.mr():se.newValue({doubleValue:f})}}class I8 extends Z1{Mr(e,t){const s=(e==null?void 0:e.values)??[],o=(t==null?void 0:t.values)??[];if(s.length===0)return;let l=0,u=0,h=0;for(let p=0;p<s.length;p++){if(!Ac(s[p])||!Ac(o[p]))return;const x=Mr(s[p]),b=Mr(o[p]);l+=x*b,u+=x*x,h+=b*b}const f=Math.sqrt(u)*Math.sqrt(h);if(f!==0)return 1-Math.max(-1,Math.min(1,l/f))}}class O8 extends Z1{Mr(e,t){const s=(e==null?void 0:e.values)??[],o=(t==null?void 0:t.values)??[];if(s.length===0)return 0;let l=0;for(let u=0;u<s.length;u++){if(!Ac(s[u])||!Ac(o[u]))return;l+=Mr(s[u])*Mr(o[u])}return l}}class L8 extends Z1{Mr(e,t){const s=(e==null?void 0:e.values)??[],o=(t==null?void 0:t.values)??[];if(s.length=
vendor: 9,274 bytes, lines 2194-2219
2194==0)return 0;let l=0;for(let u=0;u<s.length;u++){if(!Ac(s[u])||!Ac(o[u]))return;const h=Mr(s[u]),f=Mr(o[u]);l+=Math.pow(h-f,2)}return Math.sqrt(l)}}class M8{constructor(e){this.expr=e}evaluate(e,t){var o;pt(this.expr.params.length===1,39044);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"VECTOR":{const l=Hy(s.value);return se.newValue({integerValue:((o=l==null?void 0:l.values)==null?void 0:o.length)??0})}case"NULL":return se.gr();default:return se.mr()}}}const qm=BigInt(-62135596800),$m=BigInt(253402300799),lg=BigInt(1e3),Nc=BigInt(1e6),P8=qm*lg,z8=$m*lg+BigInt(999),F8=qm*Nc,V8=$m*Nc+BigInt(999999);function ev(n){return n>=F8&&n<=V8}function wS(n){return n>=qm&&n<=$m}function Jm(n,e){const t=BigInt(n);return!(t<qm||t>$m)&&!(e<0||e>=1e9)&&(t!==qm||e===0)&&!(t===$m&&e>999999999)}function ES(n,e){return e<0?{seconds:n-1,nanos:e+1e9}:{seconds:n,nanos:e}}function tv(n){return BigInt(n.seconds)*Nc+BigInt(Math.trunc(n.nanoseconds/1e3))}class nv{constructor(e){this.expr=e}evaluate(e,t){pt(this.expr.params.length===1,49262,`${this.expr.name}() function should have exactly one parameter`);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"INT":return this.toTimestamp(BigInt(s.value.integerValue));case"NULL":return se.gr();default:return se.mr()}}}class U8 extends nv{toTimestamp(e){if(!ev(e))return se.mr();let t=Number(e/Nc),s=Number(e%Nc*BigInt(1e3));const o=ES(t,s);return t=o.seconds,s=o.nanos,Jm(t,s)?se.newValue({timestampValue:{seconds:t,nanos:s}}):se.mr()}}class G8 extends nv{toTimestamp(e){if(!(function(u){return u>=P8&&u<=z8})(e))return se.mr();let t=Number(e/lg),s=Number(e%lg*BigInt(1e6));const o=ES(t,s);return t=o.seconds,s=o.nanos,Jm(t,s)?se.newValue({timestampValue:{seconds:t,nanos:s}}):se.mr()}}class H8 extends nv{toTimestamp(e){if(!wS(e))return se.mr();const t=Number(e);return se.newValue({timestampValue:{seconds:t,nanos:0}})}}class sv{constructor(e){this.expr=e}evaluate(e,t){pt(this.expr.params.length===1,1265,`${this.expr.name}() function should have exactly one parameter`);const s=Dt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"TIMESTAMP":break;case"NULL":return se.gr();default:return se.mr()}const o=V1(s.value.timestampValue);return Jm(o.seconds,o.nanoseconds)?this.Nr(o):se.mr()}}class q8 extends sv{Nr(e){const t=tv(e);return ev(t)?se.newValue({integerValue:`${t.toString()}`}):se.mr()}}class $8 extends sv{Nr(e){const t=tv(e),s=t/BigInt(1e3),o=t%BigInt(1e3);return s>BigInt(0)||o===BigInt(0)?se.newValue({integerValue:s.toString()}):se.newValue({integerValue:(s-BigInt(1)).toString()})}}class J8 extends sv{Nr(e){const t=BigInt(e.seconds);return wS(t)?se.newValue({integerValue:t.toString()}):se.mr()}}class NS{constructor(e){this.expr=e}evaluate(e,t){pt(this.expr.params.length===3,2775,`${this.expr.name}() function should have exactly 3 parameters`);let s=!1;const o=Dt(this.expr.params[0]).evaluate(e,t);switch(o.type){case"TIMESTAMP":break;case"NULL":s=!0;break;default:return se.mr()}const l=Dt(this.expr.params[1]).evaluate(e,t);let u;switch(l.type){case"STRING":if(u=(function(M){switch(M){case"microsecond":return"microsecond";case"millisecond":return"millisecond";case"second":return"second";case"minute":return"minute";case"hour":return"hour";case"day":return"day";default:return}})(l.value.stringValue),u===void 0)return se.mr();break;case"NULL":s=!0;break;default:return se.mr()}const h=Dt(this.expr.params[2]).evaluate(e,t);switch(h.type){case"INT":break;case"NULL":s=!0;break;default:return se.mr()}if(s)return se.gr();const f=BigInt(h.value.integerValue);let p;try{switch(u){case"microsecond":p=f;break;case"millisecond":p=f*BigInt(1e3);break;case"second":p=f*BigInt(1e6);break;case"minute":p=f*BigInt(6e7);break;case"hour":p=f*BigInt(36e8);break;case"day":p=f*BigInt(864e8);break;default:return se.mr()}if(u!=="microsecond"&&f!==BigInt(0)&&p/f!==BigInt(this.Lr(u)))return se.mr()}catch(U){return Va(`Error during timestamp arithmetic: ${U}`),se.mr()}const x=V1(o.value.timestampValue);if(!Jm(x.seconds,x.nanoseconds))return se.mr();const b=tv(x),C=this.Br(b,p);if(!ev(C))return se.mr();const N=Number(C/Nc),T=C%Nc,R=Number((T<0?T+Nc:T)*BigInt(1e3)),A=T<0?N-1:N;return Jm(A,R)?se.newValue({timestampValue:{seconds:A,nanos:R}}):se.mr()}Lr(e){switch(e){case"millisecond":return 1e3;case"second":return 1e6;case"minute":return 6e7;case"hour":return 36e8;case"day":return 864e8;default:return 1}}}class K8 extends NS{Br(e,t){return e+t}}class Q8 extends NS{Br(e,t){return e-t}}function Km(n){if((n=vS(n))instanceof Oh)return`fld(${n.fieldName})`;if(n instanceof Lh)return`cst(${(function(t){return t===null?"null":typeof t=="number"?t.toString():typeof t=="string"?`"${t}"`:t instanceof ks?`ref(${t.path})`:t instanceof Ai?`vec(${JSON.stringify(t)})`:JSON.stringify(t)})(n.value)})`;if(n instanceof je)return`fn(${n.name},[${n.params.map(Km).join(",")}])`;if(n.expressionType==="ListOfExpressions")return`list([${n.cr.map(Km).join(",")}])`;throw new Error(`Unrecognized expr ${JSON.stringify(n,null,2)}`)}function Y8(n){if(n instanceof bS)return`${n._name}(${rB(n.fields)})`;if(n instanceof CS){let e=`${n._name}(${rB(n.accumulators)})`;return n.groups.size>0&&(e+=`grouping(${rB(n.groups)})`),e}if(n instanceof yS)return`${n._name}(${rB(n.groups)})`;if(n instanceof Kg)return`${n._name}(${n.hr})`;if(n instanceof Qg)return`${n._name}(${n.collectionId})`;if(n instanceof K1)return`${n._name}()`;if(n instanceof Q1)return`${n._name}(${n.Tr.sort()})`;if(n instanceof Yg)return`${n._name}(${Km(n.condition)})`;if(n instanceof Uu)return`${n._name}(${n.limit})`;if(n instanceof cl)return`${n._name}(${(function(t){return t.map((s=>`${Km(s.expr)}${s.direction}`)).join(",")})(n.orderings)})`;throw new Error(`Unrecognized stage ${n._name}`)}function rB(n){return`${Array.from(n.entries()).sort().map((([e,t])=>`${e}=${Km(t)}`)).join(",")}`}function pl(n){return n.stages.map((e=>Y8(e))).join("|")}function DS(n,e){return pl(n)===pl(e)}function pr(n){return n instanceof ui}function n5(n){return pr(n)?pl(n):pm(n)}function TS(n){return pr(n)?pl(n):(function(t){return`${IT(Do(t))}|lt:${t.limitType}`})(n)}function Zg(n,e){return n instanceof ui&&e instanceof ui?DS(n,e):!(n instanceof ui&&!(e instanceof ui)||!(n instanceof ui)&&e instanceof ui)&&mP(n,e)}function SS(n){return yu(n)?pl(n):IT(n)}function jS(n,e){return n instanceof ui&&e instanceof ui?DS(n,e):!(n instanceof ui&&!(e instanceof ui)||!(n instanceof ui)&&e instanceof ui)&&OT(n,e)}function X8(n,e){const t=(function(o){let l=!1;const u=[];for(const h of o)if(h instanceof cl)if(l=!0,h.orderings.some((f=>f.expr instanceof Oh&&f.expr.fieldName===Co)))u.push(h);else{const f=h.orderings.map((p=>p));f.push(AB(Co).ascending()),u.push(new cl(f,{}))}else h instanceof Uu&&(l||(u.push(new cl([AB(Co).ascending()],{})),l=!0)),u.push(h);return l||u.push(new cl([AB(Co).ascending()],{})),u})(n.stages);if(n.userDataReader){const s=n.userDataReader.createContext(3,"toCorePipeline");t.forEach((o=>o._readUserData(s)))}return new ui(n.userDataReader.serializer,t,e)}/** 2195 * @license 2196 * Copyright 2017 Google LLC 2197 * 2198 * Licensed under the Apache License, Version 2.0 (the "License"); 2199 * you may not use this file except in compliance with the License. 2200 * You may obtain a copy of the License at 2201 * 2202 * http://www.apache.org/licenses/LICENSE-2.0 2203 * 2204 * Unless required by applicable law or agreed to in writing, software 2205 * distributed under the License is distributed on an "AS IS" BASIS, 2206 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2207 * See the License for the specific language governing permissions and 2208 * limitations under the License. 2209 */class W8{constructor(e,t,s,o){this.batchId=e,this.localWriteTime=t,this.baseMutations=s,this.mutations=o}applyToRemoteDocument(e,t){const s=t.mutationResults;for(let o=0;o<this.mutations.length;o++){const l=this.mutations[o];l.key.isEqual(e.key)&&KM(l,e,s[o])}}applyToLocalView(e,t){for(const s of this.baseMutations)s.key.isEqual(e.key)&&(t=fm(s,e,t,this.localWriteTime));for(const s of this.mutations)s.key.isEqual(e.key)&&(t=fm(s,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const s=VT();return this.mutations.forEach((o=>{const l=e.get(o.key),u=l.overlayedDocument;let h=this.applyToLocalView(u,l.mutatedFields);h=t.has(o.key)?null:h;const f=NT(u,h);f!==null&&s.set(o.key,f),u.isValidDocument()||u.convertToNoDocument(zt.min())})),s}keys(){return this.mutations.reduce(((e,t)=>e.add(t.key)),an())}isEqual(e){return this.batchId===e.batchId&&xh(this.mutations,e.mutations,((t,s)=>RN(t,s)))&&xh(this.baseMutations,e.baseMutations,((t,s)=>RN(t,s)))}}class rv{constructor(e,t,s,o){this.batch=e,this.commitVersion=t,this.mutationResults=s,this.docVersions=o}static from(e,t,s){pt(e.mutations.length===s.length,58842,{Ur:e.mutations.length,kr:s.length});let o=(function(){return bP})();const l=e.mutations;for(let u=0;u<l.length;u++)o=o.insert(l[u].key,s[u].version);return new rv(e,t,s,o)}}/** 2210 * @license 2211 * Copyright 2017 Google LLC 2212 * 2213 * Licensed under the Apache License, Version 2.0 (the "License"); 2214 * you may not use this file except in compliance with the License. 2215 * You may obtain a copy of the License at 2216 * 2217 * http://www.apache.org/licenses/LICENSE-2.0 2218 * 2219 * Unless required by applicable law or agreed to in writing, softw
2219are 2220 * distributed under the License is distributed on an "AS IS" BASIS, 2221 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2222 * See the License for the specific language governing permissions and 2223 * limitations under the License. 2224 */const AS="�";function Z8(n){let e="";for(let t=0;t<n.length;t++)e.length>0&&(e=s5(e)),e=ez(n.get(t),e);return s5(e)}function ez(n,e){let t=e;const s=n.length;for(let o=0;o<s;o++){const l=n.charAt(o);switch(l){case"\0":t+="��";break;case AS:t+="��";break;default:t+=l}}return t}function s5(n){return n+AS+"�"}/** 2225 * @license 2226 * Copyright 2022 Google LLC 2227 * 2228 * Licensed under the Apache License, Version 2.0 (the "License"); 2229 * you may not use this file except in compliance with the License. 2230 * You may obtain a copy of the License at 2231 * 2232 * http://www.apache.org/licenses/LICENSE-2.0 2233 * 2234 * Unless required by applicable law or agreed to in writing, software 2235 * distributed under the License is distributed on an "AS IS" BASIS, 2236 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2237 * See the License for the specific language governing permissions and 2238 * limitations under the License. 2239 */class tz{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{ 2240 largestBatchId: ${this.largestBatchId}, 2241 mutation: ${this.mutation.toString()} 2242 }`}}/** 2243 * @license 2244 * Copyright 2017 Google LLC 2245 * 2246 * Licensed under the Apache License, Version 2.0 (the "License"); 2247 * you may not use this file except in compliance with the License. 2248 * You may obtain a copy of the License at 2249 * 2250 * http://www.apache.org/licenses/LICENSE-2.0 2251 * 2252 * Unless required by applicable law or agreed to in writing, software 2253 * distributed under the License is distributed on an "AS IS" BASIS, 2254 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2255 * See the License for the specific language governing permissions and 2256 * limitations under the License. 2257 */class ul{constructor(e,t,s,o,l=zt.min(),u=zt.min(),h=or.EMPTY_BYTE_STRING,f=null){this.target=e,this.targetId=t,this.purpose=s,this.sequenceNumber=o,this.snapshotVersion=l,this.lastLimboFreeSnapshotVersion=u,this.resumeToken=h,this.expectedCount=f}withSequenceNumber(e){return new ul(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new ul(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new ul(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new ul(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/** 2258 * @license 2259 * Copyright 2017 Google LLC 2260 * 2261 * Licensed under the Apache License, Version 2.0 (the "License"); 2262 * you may not use this file except in compliance with the License. 2263 * You may obtain a copy of the License at 2264 * 2265 * http://www.apache.org/licenses/LICENSE-2.0 2266 * 2267 * Unless required by applicable law or agreed to in writing, software 2268 * distributed under the License is distributed on an "AS IS" BASIS, 2269 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2270 * See the License for the specific language governing permissions and 2271 * limitations under the License. 2272 */class nz{constructor(e){this.$r=e}}function sz(n){const e=LP({parent:n.parent,structuredQuery:n.structuredQuery});return n.limitType==="LAST"?rg(e,e.limit,"L"):e}/** 2273 * @license 2274 * Copyright 2019 Google LLC 2275 * 2276 * Licensed under the Apache License, Version 2.0 (the "License"); 2277 * you may not use this file except in compliance with the License. 2278 * You may obtain a copy of the License at 2279 * 2280 * http://www.apache.org/licenses/LICENSE-2.0 2281 * 2282 * Unless required by applicable law or agreed to in writing, software 2283 * distributed under the License is distributed on an "AS IS" BASIS, 2284 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2285 * See the License for the specific language governing permissions and 2286 * limitations under the License. 2287 */class rz{constructor(){this.Zi=new iz}addToCollectionParentIndex(e,t){return this.Zi.add(t),Me.resolve()}getCollectionParents(e,t){return Me.resolve(this.Zi.getEntries(t))}addFieldIndex(e,t){return Me.resolve()}deleteFieldIndex(e,t){return Me.resolve()}deleteAllFieldIndexes(e){return Me.resolve()}createTargetIndexes(e,t){return Me.resolve()}getDocumentsMatchingTarget(e,t){return Me.resolve(null)}getIndexType(e,t){return Me.resolve(0)}getFieldIndexes(e,t){return Me.resolve([])}getNextCollectionGroupToUpdate(e){return Me.resolve(null)}getMinOffset(e,t){return Me.resolve(kc.min())}getMinOffsetFromCollectionGroup(e,t){return Me.resolve(kc.min())}updateCollectionGroup(e,t,s){return Me.resolve()}updateIndexEntries(e,t){return Me.resolve()}}class iz{constructor(){this.index={}}add(e){const t=e.lastSegment(),s=e.popLast(),o=this.index[t]||new ar(Pn.comparator),l=!o.has(s);return this.index[t]=o.add(s),l}has(e){const t=e.lastSegment(),s=e.popLast(),o=this.index[t];return o&&o.has(s)}getEntries(e){return(this.index[e]||new ar(Pn.comparator)).toArray()}}/** 2288 * @license 2289 * Copyright 2017 Google LLC 2290 * 2291 * Licensed under the Apache License, Version 2.0 (the "License");
2292 * you may not use this file except in compliance with the License. 2293 * You may obtain a copy of the License at 2294 * 2295 * http://www.apache.org/licenses/LICENSE-2.0 2296 * 2297 * Unless required by applicable law or agreed to in writing, software 2298 * distributed under the License is distributed on an "AS IS" BASIS, 2299 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2300 * See the License for the specific language governing permissions and 2301 * limitations under the License. 2302 */class Lc{constructor(e){this.ys=e}next(){return this.ys+=2,this.ys}static ws(){return new Lc(0)}static bs(){return new Lc(-1)}}// Copyright 2024 Google LLC* @license 2303function kS(n,e){var s;let t=e;for(const o of n.stages)t=oz({serializer:n.serializer,serverTimestampBehavior:(s=n.listenOptions)==null?void 0:s.serverTimestampBehavior},o,t);return t}function ex(n,e){return kS(n,[e]).length>0}function az(n,e){return pr(n)?ex(n,e):Fg(n,e)}function oz(n,e,t){if(e instanceof Kg)return(function(o,l,u){return u.filter((h=>h.isFoundDocument()&&`/${h.key.getCollectionPath().canonicalString()}`===l.hr))})(0,e,t);if(e instanceof Yg)return(function(o,l,u){return u.filter((h=>{const f=bm(Dt(l.condition).evaluate(o,h));return f!==void 0&&Ta(f,ki)}))})(n,e,t);if(e instanceof Qg)return(function(o,l,u){return u.filter((h=>h.isFoundDocument()&&h.key.getCollectionPath().lastSegment()===l.collectionId))})(0,e,t);if(e instanceof K1)return(function(o,l,u){return u.filter((h=>h.isFoundDocument()))})(0,0,t);if(e instanceof Q1)return(function(o,l,u){return u.filter((h=>h.isFoundDocument()&&l.Pr.has(h.key.path.toStringWithLeadingSlash())))})(0,e,t);if(e instanceof Uu)return(function(o,l,u){return u.slice(0,l.limit)})(0,e,t);if(e instanceof cl)return(function(o,l,u){const h=l.orderings.map((f=>({Ms:Dt(f.expr),direction:f.direction})));return[...u].sort(((f,p)=>{for(const{Ms:x,direction:b}of h){const C=bm(x.evaluate(o,f)),N=bm(x.evaluate(o,p)),T=Ri(C??Ch,N??Ch);if(T!==0)return b==="ascending"?T:-T}return 0}))})(n,e,t);throw new Error(`Unknown stage: ${e._name}`)}function Zy(n){const e=(function(s){for(let o=s.stages.length-1;o>=0;o--){const l=s.stages[o];if(l instanceof cl)return l.orderings}throw new Error("Pipeline must contain at least one Sort stage")})(n);return(t,s)=>{for(const o of e){const l=bm(Dt(o.expr).evaluate({serializer:n.serializer},t)),u=bm(Dt(o.expr).evaluate({serializer:n.serializer},s)),h=Ri(l||Ch,u||Ch);if(h!==0)return o.direction==="ascending"?h:-h}return 0}}function QC(n){for(let e=n.stages.length-1;e>=0;e--){const t=n.stages[e];if(t instanceof Uu)return{limit:t.limit}}}/** 2304 * @license 2305 * Copyright 2017 Google LLC 2306 * 2307 * Licensed under the Apache License, Version 2.0 (the "License"); 2308 * you may not use this file except in compliance with the License. 2309 * You may obtain a copy of the License at 2310 * 2311 * http://www.apache.org/licenses/LICENSE-2.0 2312 * 2313 * Unless required by applicable law or agreed to in writing, software 2314 * distributed under the License is distributed on an "AS IS" BASIS, 2315 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2316 * See the License for the specific language governing permissions and 2317 * limitations under the License. 2318 */class lz{constructor(){this.changes=new Ju((e=>e.toString()),((e,t)=>e.isEqual(t))),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,$r.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const s=this.changes.get(t);return s!==void 0?Me.resolve(s):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/** 2319 * @license 2320 * Copyright 2017 Google LLC 2321 * 2322 * Licensed under the Apache License, Version 2.0 (the "License"); 2323 * you may not use this file except in compliance with the License. 2324 * You may obtain a copy of the License at 2325 * 2326 * http://www.apache.org/licenses/LICENSE-2.0 2327 * 2328 * Unless required by applicable law or agreed to in writing, software 2329 * distributed under the License is distributed on an "AS IS" BASIS, 2330 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2331 * See the License for the specific language governing permissions and 2332 * limitations under the License. 2333 *//** 2334 * @license 2335 * Copyright 2022 Google LLC 2336 * 2337 * Licensed under the Apache License, Version 2.0 (the "License");
2338 * you may not use this file except in compliance with the License. 2339 * You may obtain a copy of the License at 2340 * 2341 * http://www.apache.org/licenses/LICENSE-2.0 2342 * 2343 * Unless required by applicable law or agreed to in writing, software 2344 * distributed under the License is distributed on an "AS IS" BASIS, 2345 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2346 * See the License for the specific language governing permissions and 2347 * limitations under the License. 2348 */class cz{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}/** 2349 * @license 2350 * Copyright 2017 Google LLC 2351 * 2352 * Licensed under the Apache License, Version 2.0 (the "License"); 2353 * you may not use this file except in compliance with the License. 2354 * You may obtain a copy of the License at 2355 * 2356 * http://www.apache.org/licenses/LICENSE-2.0 2357 * 2358 * Unless required by applicable law or agreed to in writing, software 2359 * distributed under the License is distributed on an "AS IS" BASIS, 2360 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2361 * See the License for the specific language governing permissions and 2362 * limitations under the License. 2363 */class uz{constructor(e,t,s,o){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=s,this.indexManager=o}getDocument(e,t){let s=null;return this.documentOverlayCache.getOverlay(e,t).next((o=>(s=o,this.remoteDocumentCache.getEntry(e,t)))).next((o=>(s!==null&&fm(s.mutation,o,Zi.empty(),Qn.now()),o)))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next((s=>this.getLocalViewOfDocuments(e,s,an()).next((()=>s))))}getLocalViewOfDocuments(e,t,s=an()){const o=fc();return this.populateOverlays(e,o,t).next((()=>this.computeViews(e,t,o,s).next((l=>{let u=Yd();return l.forEach(((h,f)=>{u=u.insert(h,f.overlayedDocument)})),u}))))}getOverlayedDocuments(e,t){const s=fc();return this.populateOverlays(e,s,t).next((()=>this.computeViews(e,t,s,an())))}populateOverlays(e,t,s){const o=[];return s.forEach((l=>{t.has(l)||o.push(l)})),this.documentOverlayCache.getOverlays(e,o).next((l=>{l.forEach(((u,h)=>{t.set(u,h)}))}))}computeViews(e,t,s,o){let l=Si();const u=Bm(),h=(function(){return Bm()})();return t.forEach(((f,p)=>{const x=s.get(p.key);o.has(p.key)&&(x===void 0||x.mutation instanceof Vc)?l=l.insert(p.key,p):x!==void 0?(u.set(p.key,x.mutation.getFieldMask()),fm(x.mutation,p,x.mutation.getFieldMask(),Qn.now())):u.set(p.key,Zi.empty())})),this.recalculateAndSaveOverlays(e,l).next((f=>(f.forEach(((p,x)=>u.set(p,x))),t.forEach(((p,x)=>h.set(p,new cz(x,u.get(p)??null)))),h)))}recalculateAndSaveOverlays(e,t){const s=Bm();let o=new vs(((u,h)=>u-h)),l=an();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next((u=>{for(const h of u)h.keys().forEach((f=>{const p=t.get(f);if(p===null)return;let x=s.get(f)||Zi.empty();x=h.applyToLocalView(p,x),s.set(f,x);const b=(o.get(h.batchId)||an()).add(f);o=o.insert(h.batchId,b)}))})).next((()=>{const u=[],h=o.getReverseIterator();for(;h.hasNext();){const f=h.getNext(),p=f.key,x=f.value,b=VT();x.forEach((C=>{if(!l.has(C)){const N=NT(t.get(C),s.get(C));N!==null&&b.set(C,N),l=l.add(C)}})),u.push(this.documentOverlayCache.saveOverlays(e,p,b))}return Me.waitFor(u)})).next((()=>s))}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next((s=>this.recalculateAndSaveOverlays(e,s)))}getDocumentsMatchingQuery(e,t,s,o){return pr(t)?this.getDocumentsMatchingPipeline(e,t,s,o):dP(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):MT(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,s,o):this.getDocumentsMatchingCollectionQuery(e,t,s,o)}getNextDocuments(e,t,s,o){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,s,o).next((l=>{const u=o-l.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,s.largestBatchId,o-l.size):Me.resolve(fc());let h=Um,f=l;return u.next((p=>Me.forEach(p,((x,b)=>(h<b.largestBatchId&&(h=b.largestBatchId),l.get(x)?Me.resolve():this.remoteDocumentCache.getEntry(e,x).next((C=>{f=f.insert(x,C)}))))).next((()=>this.populateOverlays(e,p,l))).next((()=>this.computeViews(e,f,p,an()))).next((x=>({batchId:h,changes:FT(x)}
vendor: 25,258 bytes, lines 2363-2543
2363)))))}))}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new gt(t)).next((s=>{let o=Yd();return s.isFoundDocument()&&(o=o.insert(s.key,s)),o}))}getDocumentsMatchingCollectionGroupQuery(e,t,s,o){const l=t.collectionGroup;let u=Yd();return this.indexManager.getCollectionParents(e,l).next((h=>Me.forEach(h,(f=>{const p=(function(b,C){return new Ah(C,null,b.explicitOrderBy.slice(),b.filters.slice(),b.limit,b.limitType,b.startAt,b.endAt)})(t,f.child(l));return this.getDocumentsMatchingCollectionQuery(e,p,s,o).next((x=>{x.forEach(((b,C)=>{u=u.insert(b,C)}))}))})).next((()=>u))))}getDocumentsMatchingCollectionQuery(e,t,s,o){let l;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,s.largestBatchId).next((u=>(l=u,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,s,l,o)))).next((u=>this.retrieveMatchingLocalDocuments(l,u,(h=>Fg(t,h)))))}getDocumentsMatchingPipeline(e,t,s,o){if(Ec(t)==="collection_group"){const l=X1(t);let u=Yd();return this.indexManager.getCollectionParents(e,l).next((h=>Me.forEach(h,(f=>{const p=(function(b,C){const N=b.stages.map((T=>T instanceof Qg?new Kg(C.canonicalString(),{}):T));return new ui(b.serializer,N)})(t,f.child(l));return this.getDocumentsMatchingPipeline(e,p,s,o).next((x=>{x.forEach(((b,C)=>{u=u.insert(b,C)}))}))})).next((()=>u))))}{let l;return this.getOverlaysForPipeline(e,t,s.largestBatchId).next((u=>{switch(l=u,Ec(t)){case"collection":return this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,s,l,o);case"documents":let h=an();for(const f of Wy(t))h=h.add(gt.fromPath(f));return this.remoteDocumentCache.getEntries(e,h);case"database":return this.remoteDocumentCache.getAllEntries(e);default:throw new Xe("invalid-argument",`Invalid pipeline source to execute offline: ${pl(t)}`)}})).next((u=>this.retrieveMatchingLocalDocuments(l,u,(h=>ex(t,h)))))}}retrieveMatchingLocalDocuments(e,t,s){e.forEach(((l,u)=>{const h=u.getKey();t.get(h)===null&&(t=t.insert(h,$r.newInvalidDocument(h)))}));let o=Yd();return t.forEach(((l,u)=>{const h=e.get(l);h!==void 0&&fm(h.mutation,u,Zi.empty(),Qn.now()),s(u)&&(o=o.insert(l,u))})),o}getOverlaysForPipeline(e,t,s){switch(Ec(t)){case"collection":return this.documentOverlayCache.getOverlaysForCollection(e,Pn.fromString(Xg(t)),s);case"collection_group":throw new Xe("invalid-argument",`Unexpected collection group pipeline: ${pl(t)}`);case"documents":return this.documentOverlayCache.getOverlays(e,Wy(t).map((o=>gt.fromPath(o))));case"database":return this.documentOverlayCache.getAllOverlays(e,s);default:throw new Xe("invalid-argument",`Failed to get overlays for pipeline: ${pl(t)}`)}}}/** 2364 * @license 2365 * Copyright 2020 Google LLC 2366 * 2367 * Licensed under the Apache License, Version 2.0 (the "License"); 2368 * you may not use this file except in compliance with the License. 2369 * You may obtain a copy of the License at 2370 * 2371 * http://www.apache.org/licenses/LICENSE-2.0 2372 * 2373 * Unless required by applicable law or agreed to in writing, software 2374 * distributed under the License is distributed on an "AS IS" BASIS, 2375 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2376 * See the License for the specific language governing permissions and 2377 * limitations under the License. 2378 */class dz{constructor(e){this.serializer=e,this.Qs=new Map,this.Ws=new Map}getBundleMetadata(e,t){return Me.resolve(this.Qs.get(t))}saveBundleMetadata(e,t){return this.Qs.set(t.id,(function(o){return{id:o.id,version:o.version,createTime:To(o.createTime)}})(t)),Me.resolve()}getNamedQuery(e,t){return Me.resolve(this.Ws.get(t))}saveNamedQuery(e,t){return this.Ws.set(t.name,(function(o){return{name:o.name,query:sz(o.bundledQuery),readTime:To(o.readTime)}})(t)),Me.resolve()}}/** 2379 * @license 2380 * Copyright 2022 Google LLC 2381 * 2382 * Licensed under the Apache License, Version 2.0 (the "License"); 2383 * you may not use this file except in compliance with the License. 2384 * You may obtain a copy of the License at 2385 * 2386 * http://www.apache.org/licenses/LICENSE-2.0 2387 * 2388 * Unless required by applicable law or agreed to in writing, software 2389 * distributed under the License is distributed on an "AS IS" BASIS, 2390 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2391 * See the License for the specific language governing permissions and 2392 * limitations under the License. 2393 */class hz{constructor(){this.overlays=new vs(gt.comparator),this.Gs=new Map}getOverlay(e,t){return Me.resolve(this.overlays.get(t))}getOverlays(e,t){const s=fc();return Me.forEach(t,(o=>this.getOverlay(e,o).next((l=>{l!==null&&s.set(o,l)})))).next((()=>s))}getAllOverlays(e,t){const s=fc();return this.overlays.forEach(((o,l)=>{l.largestBatchId>t&&s.set(o,l)})),Me.resolve(s)}saveOverlays(e,t,s){return s.forEach(((o,l)=>{this.Zr(e,t,l)})),Me.resolve()}removeOverlaysForBatchId(e,t,s){const o=this.Gs.get(s);return o!==void 0&&(o.forEach((l=>this.overlays=this.overlays.remove(l))),this.Gs.delete(s)),Me.resolve()}getOverlaysForCollection(e,t,s){const o=fc(),l=t.length+1,u=new gt(t.child("")),h=this.overlays.getIteratorFrom(u);for(;h.hasNext();){const f=h.getNext().value,p=f.getKey();if(!t.isPrefixOf(p.path))break;p.path.length===l&&f.largestBatchId>s&&o.set(f.getKey(),f)}return Me.resolve(o)}getOverlaysForCollectionGroup(e,t,s,o){let l=new vs(((p,x)=>p-x));const u=this.overlays.getIterator();for(;u.hasNext();){const p=u.getNext().value;if(p.getKey().getCollectionGroup()===t&&p.largestBatchId>s){let x=l.get(p.largestBatchId);x===null&&(x=fc(),l=l.insert(p.largestBatchId,x)),x.set(p.getKey(),p)}}const h=fc(),f=l.getIterator();for(;f.hasNext()&&(f.getNext().value.forEach(((p,x)=>h.set(p,x))),!(h.size()>=o)););return Me.resolve(h)}Zr(e,t,s){const o=this.overlays.get(s.key);if(o!==null){const u=this.Gs.get(o.largestBatchId).delete(s.key);this.Gs.set(o.largestBatchId,u)}this.overlays=this.overlays.insert(s.key,new tz(t,s));let l=this.Gs.get(t);l===void 0&&(l=an(),this.Gs.set(t,l)),this.Gs.set(t,l.add(s.key))}}/** 2394 * @license 2395 * Copyright 2024 Google LLC 2396 * 2397 * Licensed under the Apache License, Version 2.0 (the "License"); 2398 * you may not use this file except in compliance with the License. 2399 * You may obtain a copy of the License at 2400 * 2401 * http://www.apache.org/licenses/LICENSE-2.0 2402 * 2403 * Unless required by applicable law or agreed to in writing, software 2404 * distributed under the License is distributed on an "AS IS" BASIS, 2405 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2406 * See the License for the specific language governing permissions and 2407 * limitations under the License. 2408 */class fz{constructor(){this.sessionToken=or.EMPTY_BYTE_STRING}getSessionToken(e){return Me.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,Me.resolve()}}/** 2409 * @license 2410 * Copyright 2017 Google LLC 2411 * 2412 * Licensed under the Apache License, Version 2.0 (the "License"); 2413 * you may not use this file except in compliance with the License. 2414 * You may obtain a copy of the License at 2415 * 2416 * http://www.apache.org/licenses/LICENSE-2.0 2417 * 2418 * Unless required by applicable law or agreed to in writing, software 2419 * distributed under the License is distributed on an "AS IS" BASIS, 2420 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2421 * See the License for the specific language governing permissions and 2422 * limitations under the License. 2423 */class iv{constructor(){this.zs=new ar(_r.js),this.Hs=new ar(_r.Js)}isEmpty(){return this.zs.isEmpty()}addReference(e,t){const s=new _r(e,t);this.zs=this.zs.add(s),this.Hs=this.Hs.add(s)}Ys(e,t){e.forEach((s=>this.addReference(s,t)))}removeReference(e,t){this.Zs(new _r(e,t))}Xs(e,t){e.forEach((s=>this.removeReference(s,t)))}e_(e){const t=new gt(new Pn([])),s=new _r(t,e),o=new _r(t,e+1),l=[];return this.Hs.forEachInRange([s,o],(u=>{this.Zs(u),l.push(u.key)})),l}t_(){this.zs.forEach((e=>this.Zs(e)))}Zs(e){this.zs=this.zs.delete(e),this.Hs=this.Hs.delete(e)}n_(e){const t=new gt(new Pn([])),s=new _r(t,e),o=new _r(t,e+1);let l=an();return this.Hs.forEachInRange([s,o],(u=>{l=l.add(u.key)})),l}containsKey(e){const t=new _r(e,0),s=this.zs.firstAfterOrEqual(t);return s!==null&&e.isEqual(s.key)}}class _r{constructor(e,t){this.key=e,this.r_=t}static js(e,t){return gt.comparator(e.key,t.key)||dn(e.r_,t.r_)}static Js(e,t){return dn(e.r_,t.r_)||gt.comparator(e.key,t.key)}}/** 2424 * @license 2425 * Copyright 2017 Google LLC 2426 * 2427 * Licensed under the Apache License, Version 2.0 (the "License"); 2428 * you may not use this file except in compliance with the License. 2429 * You may obtain a copy of the License at 2430 * 2431 * http://www.apache.org/licenses/LICENSE-2.0 2432 * 2433 * Unless required by applicable law or agreed to in writing, software 2434 * distributed under the License is distributed on an "AS IS" BASIS, 2435 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2436 * See the License for the specific language governing permissions and 2437 * limitations under the License. 2438 */class mz{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.Gr=1,this.i_=new ar(_r.js)}checkEmpty(e){return Me.resolve(this.mutationQueue.length===0)}addMutationBatch(e,t,s,o){const l=this.Gr;this.Gr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const u=new W8(l,t,s,o);this.mutationQueue.push(u);for(const h of o)this.i_=this.i_.add(new _r(h.key,l)),this.indexManager.addToCollectionParentIndex(e,h.key.path.popLast());return Me.resolve(u)}lookupMutationBatch(e,t){return Me.resolve(this.s_(t))}getNextMutationBatchAfterBatchId(e,t){const s=t+1,o=this.__(s),l=o<0?0:o;return Me.resolve(this.mutationQueue.length>l?this.mutationQueue[l]:null)}getHighestUnacknowledgedBatchId(){return Me.resolve(this.mutationQueue.length===0?R1:this.Gr-1)}getAllMutationBatches(e){return Me.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const s=new _r(t,0),o=new _r(t,Number.POSITIVE_INFINITY),l=[];return this.i_.forEachInRange([s,o],(u=>{const h=this.s_(u.r_);l.push(h)})),Me.resolve(l)}getAllMutationBatchesAffectingDocumentKeys(e,t){let s=new ar(dn);return t.forEach((o=>{const l=new _r(o,0),u=new _r(o,Number.POSITIVE_INFINITY);this.i_.forEachInRange([l,u],(h=>{s=s.add(h.r_)}))})),Me.resolve(this.o_(s))}getAllMutationBatchesAffectingQuery(e,t){const s=t.path,o=s.length+1;let l=s;gt.isDocumentKey(l)||(l=l.child(""));const u=new _r(new gt(l),0);let h=new ar(dn);return this.i_.forEachWhile((f=>{const p=f.key.path;return!!s.isPrefixOf(p)&&(p.length===o&&(h=h.add(f.r_)),!0)}),u),Me.resolve(this.o_(h))}o_(e){const t=[];return e.forEach((s=>{const o=this.s_(s);o!==null&&t.push(o)})),t}removeMutationBatch(e,t){pt(this.a_(t.batchId,"removed")===0,55003),this.mutationQueue.shift();let s=this.i_;return Me.forEach(t.mutations,(o=>{const l=new _r(o.key,t.batchId);return s=s.delete(l),this.referenceDelegate.markPotentiallyOrphaned(e,o.key)})).next((()=>{this.i_=s}))}Hr(e){}containsKey(e,t){const s=new _r(t,0),o=this.i_.firstAfterOrEqual(s);return Me.resolve(t.isEqual(o&&o.key))}performConsistencyCheck(e){return this.mutationQueue.length,Me.resolve()}a_(e,t){return this.__(e)}__(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}s_(e){const t=this.__(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}/** 2439 * @license 2440 * Copyright 2017 Google LLC 2441 * 2442 * Licensed under the Apache License, Version 2.0 (the "License"); 2443 * you may not use this file except in compliance with the License. 2444 * You may obtain a copy of the License at 2445 * 2446 * http://www.apache.org/licenses/LICENSE-2.0 2447 * 2448 * Unless required by applicable law or agreed to in writing, software 2449 * distributed under the License is distributed on an "AS IS" BASIS, 2450 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2451 * See the License for the specific language governing permissions and 2452 * limitations under the License. 2453 */class pz{constructor(e){this.u_=e,this.docs=(function(){return new vs(gt.comparator)})(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const s=t.key,o=this.docs.get(s),l=o?o.size:0,u=this.u_(t);return this.docs=this.docs.insert(s,{document:t.mutableCopy(),size:u}),this.size+=u-l,this.indexManager.addToCollectionParentIndex(e,s.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const s=this.docs.get(t);return Me.resolve(s?s.document.mutableCopy():$r.newInvalidDocument(t))}getEntries(e,t){let s=Si();return t.forEach((o=>{const l=this.docs.get(o);s=s.insert(o,l?l.document.mutableCopy():$r.newInvalidDocument(o))})),Me.resolve(s)}getAllEntries(e){let t=Si();return this.docs.forEach(((s,o)=>{t=t.insert(s,o.document)})),Me.resolve(t)}getDocumentsMatchingQuery(e,t,s,o){let l,u;pr(t)?(l=Pn.fromString(Xg(t)),u=x=>ex(t,x)):(l=t.path,u=x=>Fg(t,x));let h=Si();const f=new gt(l.child("__id-9223372036854775808__")),p=this.docs.getIteratorFrom(f);for(;p.hasNext();){const{key:x,value:{document:b}}=p.getNext();if(!l.isPrefixOf(x.path))break;x.path.length>l.length+1||lP(oP(b),s)<=0||(o.has(b.key)||u(b))&&(h=h.insert(b.key,b.mutableCopy()))}return Me.resolve(h)}getAllFromCollectionGroup(e,t,s,o){Ct(9500)}c_(e,t){return Me.forEach(this.docs,(s=>t(s)))}newChangeBuffer(e){return new Bz(this)}getSize(e){return Me.resolve(this.size)}}class Bz extends lz{constructor(e){super(),this.$s=e}applyChanges(e){const t=[];return this.changes.forEach(((s,o)=>{o.isValidDocument()?t.push(this.$s.addEntry(e,o)):this.$s.removeEntry(s)})),Me.waitFor(t)}getFromCache(e,t){return this.$s.getEntry(e,t)}getAllFromCache(e,t){return this.$s.getEntries(e,t)}}/** 2454 * @license 2455 * Copyright 2017 Google LLC 2456 * 2457 * Licensed under the Apache License, Version 2.0 (the "License"); 2458 * you may not use this file except in compliance with the License. 2459 * You may obtain a copy of the License at 2460 * 2461 * http://www.apache.org/licenses/LICENSE-2.0 2462 * 2463 * Unless required by applicable law or agreed to in writing, software 2464 * distributed under the License is distributed on an "AS IS" BASIS, 2465 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2466 * See the License for the specific language governing permissions and 2467 * limitations under the License. 2468 */class gz{constructor(e){this.persistence=e,this.l_=new Ju((t=>SS(t)),jS),this.lastRemoteSnapshotVersion=zt.min(),this.highestTargetId=0,this.E_=0,this.h_=new iv,this.targetCount=0,this.T_=Lc.ws()}forEachTarget(e,t){return this.l_.forEach(((s,o)=>t(o))),Me.resolve()}getLastRemoteSnapshotVersion(e){return Me.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return Me.resolve(this.E_)}allocateTargetId(e){return this.highestTargetId=this.T_.next(),Me.resolve(this.highestTargetId)}setTargetsMetadata(e,t,s){return s&&(this.lastRemoteSnapshotVersion=s),t>this.E_&&(this.E_=t),Me.resolve()}Ds(e){this.l_.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.T_=new Lc(t),this.highestTargetId=t),e.sequenceNumber>this.E_&&(this.E_=e.sequenceNumber)}addTargetData(e,t){return this.Ds(t),this.targetCount+=1,Me.resolve()}updateTargetData(e,t){return this.Ds(t),Me.resolve()}removeTargetData(e,t){return this.l_.delete(t.target),this.h_.e_(t.targetId),this.targetCount-=1,Me.resolve()}removeTargets(e,t,s){let o=0;const l=[];return this.l_.forEach(((u,h)=>{h.sequenceNumber<=t&&s.get(h.targetId)===null&&(this.l_.delete(u),l.push(this.removeMatchingKeysForTargetId(e,h.targetId)),o++)})),Me.waitFor(l).next((()=>o))}getTargetCount(e){return Me.resolve(this.targetCount)}getTargetData(e,t){const s=this.l_.get(t)||null;return Me.resolve(s)}addMatchingKeys(e,t,s){return this.h_.Ys(t,s),Me.resolve()}removeMatchingKeys(e,t,s){this.h_.Xs(t,s);const o=this.persistence.referenceDelegate,l=[];return o&&t.forEach((u=>{l.push(o.markPotentiallyOrphaned(e,u))})),Me.waitFor(l)}removeMatchingKeysForTargetId(e,t){return this.h_.e_(t),Me.resolve()}getMatchingKeysForTargetId(e,t){const s=this.h_.n_(t);return Me.resolve(s)}containsKey(e,t){return Me.resolve(this.h_.containsKey(t))}}/** 2469 * @license 2470 * Copyright 2017 Google LLC 2471 * 2472 * Licensed under the Apache License, Version 2.0 (the "License"); 2473 * you may not use this file except in compliance with the License. 2474 * You may obtain a copy of the License at 2475 * 2476 * http://www.apache.org/licenses/LICENSE-2.0 2477 * 2478 * Unless required by applicable law or agreed to in writing, software 2479 * distributed under the License is distributed on an "AS IS" BASIS, 2480 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2481 * See the License for the specific language governing permissions and 2482 * limitations under the License. 2483 */class RS{constructor(e,t){this.P_={},this.overlays={},this.I_=new Gg(0),this.R_=!1,this.R_=!0,this.A_=new fz,this.referenceDelegate=e(this),this.V_=new gz(this),this.indexManager=new rz,this.remoteDocumentCache=(function(o){return new pz(o)})((s=>this.referenceDelegate.d_(s))),this.serializer=new nz(t),this.f_=new dz(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.R_=!1,Promise.resolve()}get started(){return this.R_}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new hz,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let s=this.P_[e.toKey()];return s||(s=new mz(t,this.referenceDelegate),this.P_[e.toKey()]=s),s}getGlobalsCache(){return this.A_}getTargetCache(){return this.V_}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.f_}runTransaction(e,t,s){rt("MemoryPersistence","Starting transaction:",e);const o=new xz(this.I_.next());return this.referenceDelegate.m_(),s(o).next((l=>this.referenceDelegate.p_(o).next((()=>l)))).toPromise().then((l=>(o.raiseOnCommittedEvent(),l)))}g_(e,t){return Me.or(Object.values(this.P_).map((s=>()=>s.containsKey(e,t))))}}class xz extends c6{constructor(e){super(),this.currentSequenceNumber=e}}class av{constructor(e){this.persistence=e,this.y_=new iv,this.w_=null}static b_(e){return new av(e)}get S_(){if(this.w_)return this.w_;throw Ct(60996)}addReference(e,t,s){return this.y_.addReference(s,t),this.S_.delete(s.toString()),Me.resolve()}removeReference(e,t,s){return this.y_.removeReference(s,t),this.S_.add(s.toString()),Me.resolve()}markPotentiallyOrphaned(e,t){return this.S_.add(t.toString()),Me.resolve()}removeTarget(e,t){this.y_.e_(t.targetId).forEach((o=>this.S_.add(o.toString())));const s=this.persistence.getTargetCache();return s.getMatchingKeysForTargetId(e,t.targetId).next((o=>{o.forEach((l=>this.S_.add(l.toString())))})).next((()=>s.removeTargetData(e,t)))}m_(){this.w_=new Set}p_(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return Me.forEach(this.S_,(s=>{const o=gt.fromPath(s);return this.v_(e,o).next((l=>{l||t.removeEntry(o,zt.min())}))})).next((()=>(this.w_=null,t.apply(e))))}updateLimboDocument(e,t){return this.v_(e,t).next((s=>{s?this.S_.delete(t.toString()):this.S_.add(t.toString())}))}d_(e){return 0}v_(e,t){return Me.or([()=>Me.resolve(this.y_.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.g_(e,t)])}}class cg{constructor(e,t){this.persistence=e,this.D_=new Ju((s=>Z8(s.path)),((s,o)=>s.isEqual(o))),this.garbageCollector=p6(this,t)}static b_(e,t){return new cg(e,t)}m_(){}p_(e){return Me.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}ir(e){const t=this.Cs(e);return this.persistence.getTargetCache().getTargetCount(e).next((s=>t.next((o=>s+o))))}Cs(e){let t=0;return this.sr(e,(s=>{t++})).next((()=>t))}sr(e,t){return Me.forEach(this.D_,((s,o)=>this.Os(e,s,o).next((l=>l?Me.resolve():t(o)))))}removeTargets(e,t,s){return this.persistence.getTargetCache().removeTargets(e,t,s)}removeOrphanedDocuments(e,t){let s=0;const o=this.persistence.getRemoteDocumentCache(),l=o.newChangeBuffer();return o.c_(e,(u=>this.Os(e,u,t).next((h=>{h||(s++,l.removeEntry(u,zt.min()))})))).next((()=>l.apply(e))).next((()=>s))}markPotentiallyOrphaned(e,t){return this.D_.set(t,e.currentSequenceNumber),Me.resolve()}removeTarget(e,t){const s=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,s)}addReference(e,t,s){return this.D_.set(s,e.currentSequenceNumber),Me.resolve()}removeReference(e,t,s){return this.D_.set(s,e.currentSequenceNumber),Me.resolve()}updateLimboDocument(e,t){return this.D_.set(t,e.currentSequenceNumber),Me.resolve()}d_(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=DB(e.data.value)),t}Os(e,t,s){return Me.or([()=>this.persistence.g_(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const o=this.D_.get(t);return Me.resolve(o!==void 0&&o>s)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}/** 2484 * @license 2485 * Copyright 2017 Google LLC 2486 * 2487 * Licensed under the Apache License, Version 2.0 (the "License"); 2488 * you may not use this file except in compliance with the License. 2489 * You may obtain a copy of the License at 2490 * 2491 * http://www.apache.org/licenses/LICENSE-2.0 2492 * 2493 * Unless required by applicable law or agreed to in writing, software 2494 * distributed under the License is distributed on an "AS IS" BASIS, 2495 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2496 * See the License for the specific language governing permissions and 2497 * limitations under the License. 2498 */class ov{constructor(e,t,s,o){this.targetId=e,this.fromCache=t,this.Vo=s,this.fo=o}static mo(e,t){let s=an(),o=an();for(const l of t.docChanges)switch(l.type){case 0:s=s.add(l.doc.key);break;case 1:o=o.add(l.doc.key)}return new ov(e,t.fromCache,s,o)}}/** 2499 * @license 2500 * Copyright 2017 Google LLC 2501 * 2502 * Licensed under the Apache License, Version 2.0 (the "License"); 2503 * you may not use this file except in compliance with the License. 2504 * You may obtain a copy of the License at 2505 * 2506 * http://www.apache.org/licenses/LICENSE-2.0 2507 * 2508 * Unless required by applicable law or agreed to in writing, software 2509 * distributed under the License is distributed on an "AS IS" BASIS, 2510 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2511 * See the License for the specific language governing permissions and 2512 * limitations under the License. 2513 */function bz(n,e){return gt.comparator(n.key,e.key)}/** 2514 * @license 2515 * Copyright 2023 Google LLC 2516 * 2517 * Licensed under the Apache License, Version 2.0 (the "License"); 2518 * you may not use this file except in compliance with the License. 2519 * You may obtain a copy of the License at 2520 * 2521 * http://www.apache.org/licenses/LICENSE-2.0 2522 * 2523 * Unless required by applicable law or agreed to in writing, software 2524 * distributed under the License is distributed on an "AS IS" BASIS, 2525 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2526 * See the License for the specific language governing permissions and 2527 * limitations under the License. 2528 */class Cz{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}/** 2529 * @license 2530 * Copyright 2019 Google LLC 2531 * 2532 * Licensed under the Apache License, Version 2.0 (the "License"); 2533 * you may not use this file except in compliance with the License. 2534 * You may obtain a copy of the License at 2535 * 2536 * http://www.apache.org/licenses/LICENSE-2.0 2537 * 2538 * Unless required by applicable law or agreed to in writing, software 2539 * distributed under the License is distributed on an "AS IS" BASIS, 2540 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2541 * See the License for the specific language governing permissions and 2542 * limitations under the License. 2543 */class yz{constructor(){this.po=!1,this.yo=!1,this.wo=100,this.bo=(function(){return FO()?8:u6(Kr())>0?6:4})()}initialize(e,t){this.So=e,this.indexManager=t,this.po=!0}getDocumentsMatchingQuery(e,t,s,o){const l={result:null};return this.vo(e,t).next((u=>{l.result=u})).next((()=>{if(!l.result)return this.Do(e,t,o,s).next((u=>{l.result=u}))})).next((()=>{if(l.result)return;const u=new Cz;return this.xo(e,t,u).next((h=>{if(l.result=h,this.yo)return this.Co(e,t,u,h.size)}))})).next((()=>l.result))}Co(e,t,s,o){return pr(t)?Me.resolve():s.documentReadCount<this.wo?(Kd()<=Bn.DEBUG&&rt("QueryEngine","SDK will not create cache indexes for query:",pm(t),"since it only creates cache indexes for collection contains","more than or equal to",this.wo,"documents"),Me.resolve()):(Kd()<=Bn.DEBUG&&rt("QueryEngine","Query:",pm(t),"scans",s.documentReadCount,"local documents and returns",o,"documents as results."),s.documentReadCount>this.bo*o?(Kd()<=Bn.DEBUG&&rt("QueryEngine","The SDK decides to create cache indexes for query:",pm(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Do(t))):Me.resolve())}vo(e,t){if(pr(t))return Me.resolve(null);let s=t;if(zN(s))return Me.resolve(null);let o=Do(s);return this.indexManager.getIndexType(e,o).next((l=>l===0?null:(s.limit!==null&&l===1&&(s=rg(s,null,"F"),o=Do(s)),this.indexManager.getDocumentsMatchingTarget(e,o).next((u=>{const h=an(...u);return this.So.getDocuments(e,h).next((f=>this.indexManager.getMinOffset(e,o).next((p=>{const x=this.Fo(s,f);return this.Oo(s,x,h,p.readTime)?this.vo(e,rg(s,null,"F")):this.Mo(e,x,s,p)}))))}
2543)))))}Do(e,t,s,o){return(pr(t)?(function(u){for(const h of u.stages){if(h instanceof Uu||h instanceof t5)return!1;if(h instanceof Yg){if(h.condition instanceof BS&&h.condition._expr.name==="exists"&&h.condition._expr.params[0]instanceof Oh&&h.condition._expr.params[0].fieldName===Co)continue;return!1}}return!0})(t):zN(t))||o.isEqual(zt.min())?Me.resolve(null):this.So.getDocuments(e,s).next((l=>{const u=this.Fo(t,l);return this.Oo(t,u,s,o)?Me.resolve(null):(Kd()<=Bn.DEBUG&&rt("QueryEngine","Re-using previous result from %s to execute query: %s",o.toString(),n5(t)),this.Mo(e,u,t,aP(o,Um)).next((h=>h)))}))}Fo(e,t){let s,o;return pr(e)?(s=new ar(bz),o=l=>ex(e,l)):(s=new ar(z1(e)),o=l=>Fg(e,l)),t.forEach(((l,u)=>{o(u)&&(s=s.add(u))})),s}Oo(e,t,s,o){if(pr(e))return(function(h){return h.stages.some((f=>f instanceof Uu||f instanceof t5))})(e);if(e.limit===null)return!1;if(s.size!==t.size)return!0;const l=e.limitType==="F"?t.last():t.first();return!!l&&(l.hasPendingWrites||l.version.compareTo(o)>0)}xo(e,t,s){return Kd()<=Bn.DEBUG&&rt("QueryEngine","Using full collection scan to execute query:",n5(t)),this.So.getDocumentsMatchingQuery(e,t,kc.min(),s)}Mo(e,t,s,o){return this.So.getDocumentsMatchingQuery(e,s,o).next((l=>(t.forEach((u=>{l=l.insert(u.key,u)})),l)))}}/** 2544 * @license 2545 * Copyright 2020 Google LLC 2546 * 2547 * Licensed under the Apache License, Version 2.0 (the "License"); 2548 * you may not use this file except in compliance with the License. 2549 * You may obtain a copy of the License at 2550 * 2551 * http://www.apache.org/licenses/LICENSE-2.0 2552 * 2553 * Unless required by applicable law or agreed to in writing, software 2554 * distributed under the License is distributed on an "AS IS" BASIS, 2555 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2556 * See the License for the specific language governing permissions and 2557 * limitations under the License. 2558 */const lv="LocalStore",vz=3e8;class _z{constructor(e,t,s,o){this.persistence=e,this.No=t,this.serializer=o,this.Lo=new vs(dn),this.Bo=new Ju((l=>SS(l)),jS),this.Uo=new Map,this.ko=e.getRemoteDocumentCache(),this.V_=e.getTargetCache(),this.f_=e.getBundleCache(),this.qo(s)}qo(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new uz(this.ko,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ko.setIndexManager(this.indexManager),this.No.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(t=>e.collect(t,this.Lo)))}}function wz(n,e,t,s){return new _z(n,e,t,s)}async function IS(n,e){const t=$t(n);return await t.persistence.runTransaction("Handle user change","readonly",(s=>{let o;return t.mutationQueue.getAllMutationBatches(s).next((l=>(o=l,t.qo(e),t.mutationQueue.getAllMutationBatches(s)))).next((l=>{const u=[],h=[];let f=an();for(const p of o){u.push(p.batchId);for(const x of p.mutations)f=f.add(x.key)}for(const p of l){h.push(p.batchId);for(const x of p.mutations)f=f.add(x.key)}return t.localDocuments.getDocuments(s,f).next((p=>({$o:p,removedBatchIds:u,addedBatchIds:h})))}))}))}function Ez(n,e){const t=$t(n);return t.persistence.runTransaction("Acknowledge batch","readwrite-primary",(s=>{const o=e.batch.keys(),l=t.ko.newChangeBuffer({trackRemovals:!0});return(function(h,f,p,x){const b=p.batch,C=b.keys();let N=Me.resolve();
2558return C.forEach((T=>{N=N.next((()=>x.getEntry(f,T))).next((R=>{const A=p.docVersions.get(T);pt(A!==null,48541),R.version.compareTo(A)<0&&(b.applyToRemoteDocument(R,p),R.isValidDocument()&&(R.setReadTime(p.commitVersion),x.addEntry(R)))}))})),N.next((()=>h.mutationQueue.removeMutationBatch(f,b)))})(t,s,e,l).next((()=>l.apply(s))).next((()=>t.mutationQueue.performConsistencyCheck(s))).next((()=>t.documentOverlayCache.removeOverlaysForBatchId(s,o,e.batch.batchId))).next((()=>t.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(s,(function(h){let f=an();for(let p=0;p<h.mutationResults.length;++p)h.mutationResults[p].transformResults.length>0&&(f=f.add(h.batch.mutations[p].key));return f})(e)))).next((()=>t.localDocuments.getDocuments(s,o)))}))}function OS(n){const e=$t(n);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(t=>e.V_.getLastRemoteSnapshotVersion(t)))}function Nz(n,e){const t=$t(n),s=e.snapshotVersion;let o=t.Lo;return t.persistence.runTransaction("Apply remote event","readwrite-primary",(l=>{const u=t.ko.newChangeBuffer({trackRemovals:!0});o=t.Lo;const h=[];
2558e.targetChanges.forEach(((x,b)=>{const C=o.get(b);if(!C)return;h.push(t.V_.removeMatchingKeys(l,x.removedDocuments,b).next((()=>t.V_.addMatchingKeys(l,x.addedDocuments,b))));let N=C.withSequenceNumber(l.currentSequenceNumber);e.targetMismatches.get(b)!==null?N=N.withResumeToken(or.EMPTY_BYTE_STRING,zt.min()).withLastLimboFreeSnapshotVersion(zt.min()):x.resumeToken.approximateByteSize()>0&&(N=N.withResumeToken(x.resumeToken,s)),o=o.insert(b,N),(function(R,A,U){return R.resumeToken.approximateByteSize()===0||A.snapshotVersion.toMicroseconds()-R.snapshotVersion.toMicroseconds()>=vz?!0:U.addedDocuments.size+U.modifiedDocuments.size+U.removedDocuments.size>0})(C,N,x)&&h.push(t.V_.updateTargetData(l,N))}));let f=Si(),p=an();if(e.documentUpdates.forEach((x=>{e.resolvedLimboDocuments.has(x)&&h.push(t.persistence.referenceDelegate.updateLimboDocument(l,x))})),h.push(Dz(l,u,e.documentUpdates).next((x=>{f=x.Ko,p=x.Qo}))),!s.isEqual(zt.min())){const x=t.V_.getLastRemoteSnapshotVersion(l).next((b=>t.V_.setTargetsMetadata(l,l.currentSequenceNumber,s)));h.push(x)}return Me.waitFor(h).next((()=>u.apply(l))).next((()=>t.localDocuments.getLocalViewOfDocuments(l,f,p))).next((()=>f))})).then((l=>(t.Lo=o,l)))}function Dz(n,e,t){let s=an(),o=an();return t.forEach((l=>s=s.add(l))),e.getEntries(n,s).next((l=>{let u=Si();return t.forEach(((h,f)=>{const p=l.get(h);f.isFoundDocument()!==p.isFoundDocument()&&(o=o.add(h)),f.isNoDocument()&&f.version.isEqual(zt.min())?(e.removeEntry(h,f.readTime),u=u.insert(h,f)):!p.isValidDocument()||f.version.compareTo(p.version)>0||f.version.compareTo(p.version)===0&&p.hasPendingWrites?(e.addEntry(f),u=u.insert(h,f)):rt(lv,"Ignoring outdated watch update for ",h,". Current version:",p.version," Watch version:",f.version)})),{Ko:u,Qo:o}}))}function Tz(n,e){const t=$t(n);return t.persistence.runTransaction("Get next mutation batch","readonly",(s=>(e===void 0&&(e=R1),t.mutationQueue.getNextMutationBatchAfterBatchId(s,e))))}function Sz(n,e){const t=$t(n);return t.persistence.runTransaction("Allocate target","readwrite",(s=>{let o;return t.V_.getTargetData(s,e).next((l=>l?(o=l,Me.resolve(o)):t.V_.allocateTargetId(s).next((u=>(o=new ul(e,u,"TargetPurposeListen",s.currentSequenceNumber),t.V_.addTargetData(s,o).next((()=>o)))))))})).then((s=>{const o=t.Lo.get(s.targetId);return(o===null||s.snapshotVersion.compareTo(o.snapshotVersion)>0)&&(t.Lo=t.Lo.insert(s.targetId,s),t.Bo.set(e,s.targetId)),s}))}async function e1(n,e,t){const s=$t(n),o=s.Lo.get(e),l=t?"readwrite":"readwrite-primary";try{t||await s.persistence.runTransaction("Release target",l,(u=>s.persistence.referenceDelegate.removeTarget(u,o)))}catch(u){if(!Ih(u))throw u;rt(lv,`Failed to update sequence numbers for target ${e}: ${u}`)}s.Lo=s.Lo.remove(e),s.Bo.delete(o.target)}function r5(n,e,t){const s=$t(n);let o=zt.min(),l=an();return s.persistence.runTransaction("Execute query","readwrite",(u=>(function(f,p,x){const b=$t(f),C=b.Bo.get(x);return C!==void 0?Me.resolve(b.Lo.get(C)):b.V_.getTargetData(p,x)})(s,u,pr(e)?e:Do(e)).next((h=>{if(h)return o=h.lastLimboFreeSnapshotVersion,s.V_.getMatchingKeysForTargetId(u,h.targetId).next((f=>{l=f}))})).next((()=>s.No.getDocumentsMatchingQuery(u,e,t?o:zt.min(),t?l:an()))).next((h=>(jz(s,h),{documents:h,Wo:l})))))}function jz(n,e){e.forEach(((t,s)=>{const o=s.key.getCollectionGroup(),l=n.Uo.get(o)||zt.min();s.readTime.compareTo(l)>0&&n.Uo.set(o,s.readTime)}))}/** 2559 * @license 2560 * Copyright 2020 Google LLC 2561 * 2562 * Licensed under the Apache License, Version 2.0 (the "License"); 2563 * you may not use this file except in compliance with the License. 2564 * You may obtain a copy of the License at 2565 * 2566 * http://www.apache.org/licenses/LICENSE-2.0 2567 * 2568 * Unless required by applicable law or agreed to in writing, software 2569 * distributed under the License is distributed on an "AS IS" BASIS, 2570 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2571 * See the License for the specific language governing permissions and 2572 * limitations under the License. 2573 */class Az{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.Yo=0,this.Zo=null,this.Xo=!0}ea(){this.Yo===0&&(this.ta("Unknown"),this.Zo=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(()=>(this.Zo=null,this.na("Backend didn't respond within 10 seconds."),this.ta("Offline"),Promise.resolve()))))}ra(e){this.state==="Online"?this.ta("Unknown"):(this.Yo++,this.Yo>=1&&(this.ia(),this.na(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ta("Offline")))}set(e){this.ia(),this.Yo=0,e==="Online"&&(this.Xo=!1),this.ta(e)}ta(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}na(e){const t=`Could not reach Cloud Firestore backend. ${e} 2574This 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.Xo?(yl(t),this.Xo=!1):rt("OnlineStateTracker",t)}ia(){this.Zo!==null&&(this.Zo.cancel(),this.Zo=null)}}/** 2575 * @license 2576 * Copyright 2017 Google LLC 2577 * 2578 * Licensed under the Apache License, Version 2.0 (the "License");
2579 * you may not use this file except in compliance with the License. 2580 * You may obtain a copy of the License at 2581 * 2582 * http://www.apache.org/licenses/LICENSE-2.0 2583 * 2584 * Unless required by applicable law or agreed to in writing, software 2585 * distributed under the License is distributed on an "AS IS" BASIS, 2586 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2587 * See the License for the specific language governing permissions and 2588 * limitations under the License. 2589 */const Oo="RemoteStore";class kz{constructor(e,t,s,o,l){this.localStore=e,this.datastore=t,this.asyncQueue=s,this.remoteSyncer={},this.sa=[],this._a=new Map,this.oa=new Map,this.aa=new Map,this.ua=new Lc(1e3),this.ca=new Lc(1001),this.la=new Set,this.Ea=[],this.ha=l,this.ha.Qe((u=>{s.enqueueAndForget((async()=>{Qu(this)&&(rt(Oo,"Restarting streams for network reachability change."),await(async function(f){const p=$t(f);p.la.add(4),await hp(p),p.Ta.set("Unknown"),p.la.delete(4),await tx(p)})(this))}))})),this.Ta=new Az(s,o)}}async function tx(n){if(Qu(n))for(const e of n.Ea)await e(!0)}async function hp(n){for(const e of n.Ea)await e(!1)}function t1(n,e){return n.oa.get(e)||void 0}function LS(n,e){const t=$t(n),s=t1(t,e.targetId);if(s!==void 0&&t._a.has(s))return;const o=(function(h,f){const p=t1(h,f);p!==void 0&&h.aa.delete(p);const x=(function(C,N){return N%2!=0?C.ca.next():C.ua.next()})(h,f);return h.oa.set(f,x),h.aa.set(x,f),x})(t,e.targetId);rt(Oo,"remoteStoreListen mapping SDK target ID to remote",e.targetId,o);const l=new ul(e.target,o,e.purpose,e.sequenceNumber,e.snapshotVersion,e.lastLimboFreeSnapshotVersion,e.resumeToken);t._a.set(o,l),hv(t)?dv(t):zh(t).Yt()&&uv(t,l)}function cv(n,e){const t=$t(n),s=zh(t),o=t1(t,e);rt(Oo,"remoteStoreUnlisten removing mapping of SDK target ID to remote",e,o),t._a.delete(o),t.oa.delete(e),t.aa.delete(o),s.Yt()&&MS(t,o),t._a.size===0&&(s.Yt()?s.en():Qu(t)&&t.Ta.set("Unknown"))}function uv(n,e){if(n.Pa.J(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(zt.min())>0){const t=n.aa.get(e.targetId);if(t===void 0)return void rt(Oo,"SDK target ID not found for remote ID: "+e.targetId);const s=n.remoteSyncer.getRemoteKeysForTarget(t).size;e=e.withExpectedCount(s)}zh(n).Pn(e)}function MS(n,e){n.Pa.J(e),zh(n).In(e)}function dv(n){n.Pa=new EP({getRemoteKeysForTarget:e=>{const t=n.aa.get(e);return t!==void 0?n.remoteSyncer.getRemoteKeysForTarget(t):an()},ye:e=>n._a.get(e)||null,Ve:()=>n.datastore.serializer.databaseId}),zh(n).start(),n.Ta.ea()}function hv(n){return Qu(n)&&!zh(n).Jt()&&n._a.size>0}function Qu(n){return $t(n).la.size===0}function PS(n){n.Pa=void 0}async function Rz(n){n.Ta.set("Online")}async function Iz(n){n._a.forEach(((e,t)=>{uv(n,e)}))}async function Oz(n,e){PS(n),hv(n)?(n.Ta.ra(e),dv(n)):n.Ta.set("Unknown")}async function Lz(n,e,t){if(n.Ta.set("Online"),e instanceof GT&&e.state===2&&e.cause)try{await(async function(o,l){const u=l.cause;for(const h of l.targetIds){if(o._a.has(h)){const f=o.aa.get(h);f!==void 0&&(await o.remoteSyncer.rejectListen(f,u),o.oa.delete(f),o.aa.delete(h)),o._a.delete(h)}o.Pa.removeTarget(h)}})(n,e)}catch(s){rt(Oo,"Failed to remove targets %s: %s ",e.targetIds.join(","),s),await ug(n,s)}else if(e instanceof SB?n.Pa._e(e):e instanceof UT?n.Pa.he(e):n.Pa.ue(e),!t.isEqual(zt.min()))try{const s=await OS(n.localStore);t.compareTo(s)>=0&&await(function(l,u){const h=l.Pa.fe(u);
vendor: 4,249 bytes, lines 2589-2608
2589h.targetChanges.forEach(((p,x)=>{if(p.resumeToken.approximateByteSize()>0){const b=l._a.get(x);b&&l._a.set(x,b.withResumeToken(p.resumeToken,u))}})),h.targetMismatches.forEach(((p,x)=>{const b=l._a.get(p);if(!b)return;l._a.set(p,b.withResumeToken(or.EMPTY_BYTE_STRING,b.snapshotVersion)),MS(l,p);const C=new ul(b.target,p,x,b.sequenceNumber);uv(l,C)}));const f=(function(x,b){const C=new Map;b.targetChanges.forEach(((T,R)=>{const A=x.aa.get(R);A!==void 0&&C.set(A,T)}));let N=new vs(dn);return b.targetMismatches.forEach(((T,R)=>{const A=x.aa.get(T);A!==void 0&&(N=N.insert(A,R))})),new cp(b.snapshotVersion,C,N,b.documentUpdates,b.augmentedDocumentUpdates,b.resolvedLimboDocuments)})(l,h);return l.remoteSyncer.applyRemoteEvent(f)})(n,t)}catch(s){rt(Oo,"Failed to raise snapshot:",s),await ug(n,s)}}async function ug(n,e,t){if(!Ih(e))throw e;n.la.add(1),await hp(n),n.Ta.set("Offline"),t||(t=()=>OS(n.localStore)),n.asyncQueue.enqueueRetryable((async()=>{rt(Oo,"Retrying IndexedDB access"),await t(),n.la.delete(1),await tx(n)}))}function zS(n,e){return e().catch((t=>ug(n,t,e)))}async function nx(n){const e=$t(n),t=Mc(e);let s=e.sa.length>0?e.sa[e.sa.length-1].batchId:R1;for(;Mz(e);)try{const o=await Tz(e.localStore,s);if(o===null){e.sa.length===0&&t.en();break}s=o.batchId,Pz(e,o)}catch(o){await ug(e,o)}FS(e)&&VS(e)}function Mz(n){return Qu(n)&&n.sa.length<10}function Pz(n,e){n.sa.push(e);const t=Mc(n);t.Yt()&&t.Rn&&t.An(e.mutations)}function FS(n){return Qu(n)&&!Mc(n).Jt()&&n.sa.length>0}function VS(n){Mc(n).start()}async function zz(n){Mc(n).fn()}async function Fz(n){const e=Mc(n);for(const t of n.sa)e.An(t.mutations)}async function Vz(n,e,t){const s=n.sa.shift(),o=rv.from(s,e,t);await zS(n,(()=>n.remoteSyncer.applySuccessfulWrite(o))),await nx(n)}async function Uz(n,e){e&&Mc(n).Rn&&await(async function(s,o){if((function(u){return gP(u)&&u!==Ie.ABORTED})(o.code)){const l=s.sa.shift();Mc(s).Xt(),await zS(s,(()=>s.remoteSyncer.rejectFailedWrite(l.batchId,o))),await nx(s)}})(n,e),FS(n)&&VS(n)}async function i5(n,e){const t=$t(n);t.asyncQueue.verifyOperationInProgress(),rt(Oo,"RemoteStore received new credentials");const s=Qu(t);t.la.add(3),await hp(t),s&&t.Ta.set("Unknown"),await t.remoteSyncer.handleCredentialChange(e),t.la.delete(3),await tx(t)}async function Gz(n,e){const t=$t(n);e?(t.la.delete(2),await tx(t)):e||(t.la.add(2),await hp(t),t.Ta.set("Unknown"))}function zh(n){return n.Ia||(n.Ia=(function(t,s,o){const l=$t(t);return l.pn(),new t6(s,l.connection,l.authCredentials,l.appCheckCredentials,l.serializer,o)})(n.datastore,n.asyncQueue,{ct:Rz.bind(null,n),Et:Iz.bind(null,n),Tt:Oz.bind(null,n),Tn:Lz.bind(null,n)}),n.Ea.push((async e=>{e?(n.Ia.Xt(),hv(n)?dv(n):n.Ta.set("Unknown")):(await n.Ia.stop(),PS(n))}))),n.Ia}function Mc(n){return n.Ra||(n.Ra=(function(t,s,o){const l=$t(t);return l.pn(),new n6(s,l.connection,l.authCredentials,l.appCheckCredentials,l.serializer,o)})(n.datastore,n.asyncQueue,{ct:()=>Promise.resolve(),Et:zz.bind(null,n),Tt:Uz.bind(null,n),Vn:Fz.bind(null,n),dn:Vz.bind(null,n)}),n.Ea.push((async e=>{e?(n.Ra.Xt(),await nx(n)):(await n.Ra.stop(),n.sa.length>0&&(rt(Oo,`Stopping write stream with ${n.sa.length} pending writes`),n.sa=[]))}))),n.Ra}/** 2590 * @license 2591 * Copyright 2017 Google LLC 2592 * 2593 * Licensed under the Apache License, Version 2.0 (the "License"); 2594 * you may not use this file except in compliance with the License. 2595 * You may obtain a copy of the License at 2596 * 2597 * http://www.apache.org/licenses/LICENSE-2.0 2598 * 2599 * Unless required by applicable law or agreed to in writing, software 2600 * distributed under the License is distributed on an "AS IS" BASIS, 2601 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2602 * See the License for the specific language governing permissions and 2603 * limitations under the License. 2604 */class fv{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Aa(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Aa(this.observer.error,e):yl("Uncaught Error in snapshot listener:",e.toString()))}Va(){this.muted=!0}Aa(e,t){setTimeout((()=>{this.muted||e(t)}),0)}}/** 2605 * @license 2606 * Copyright 2017 Google LLC 2607 * 2608 * Licensed under the Apache License, Version 2.0 (the "License");
2609 * you may not use this file except in compliance with the License. 2610 * You may obtain a copy of the License at 2611 * 2612 * http://www.apache.org/licenses/LICENSE-2.0 2613 * 2614 * Unless required by applicable law or agreed to in writing, software 2615 * distributed under the License is distributed on an "AS IS" BASIS, 2616 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2617 * See the License for the specific language governing permissions and 2618 * limitations under the License. 2619 */class mv{constructor(e,t,s,o,l){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=s,this.op=o,this.removalCallback=l,this.deferred=new ml,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((u=>{}))}get promise(){return this.deferred.promise}static createAndSchedule(e,t,s,o,l){const u=Date.now()+s,h=new mv(e,t,u,o,l);return h.start(s),h}start(e){this.timerHandle=setTimeout((()=>this.handleDelayElapsed()),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new Xe(Ie.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget((()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then((e=>this.deferred.resolve(e)))):Promise.resolve()))}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function pv(n,e){if(yl("AsyncQueue",`${e}: ${n}`),Ih(n))return new Xe(Ie.UNAVAILABLE,`${e}: ${n}`);throw n}class a5{constructor(){this.activeTargetIds=vP()}Ba(e){this.activeTargetIds=this.activeTargetIds.add(e)}Ua(e){this.activeTargetIds=this.activeTargetIds.delete(e)}La(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class Hz{constructor(){this.fu=new a5,this.mu={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}
vendor: 4,701 bytes, lines 2619-2656
2619updateMutationState(e,t,s){}addLocalQueryTarget(e,t=!0){return t&&this.fu.Ba(e),this.mu[e]||"not-current"}updateQueryState(e,t,s){this.mu[e]=t}removeLocalQueryTarget(e){this.fu.Ua(e)}isLocalQueryTarget(e){return this.fu.activeTargetIds.has(e)}clearQueryState(e){delete this.mu[e]}getAllActiveQueryTargets(){return this.fu.activeTargetIds}isActiveQueryTarget(e){return this.fu.activeTargetIds.has(e)}start(){return this.fu=new a5,Promise.resolve()}handleUserChange(e,t,s){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}function YC(){return typeof document<"u"?document:null}/** 2620 * @license 2621 * Copyright 2017 Google LLC 2622 * 2623 * Licensed under the Apache License, Version 2.0 (the "License"); 2624 * you may not use this file except in compliance with the License. 2625 * You may obtain a copy of the License at 2626 * 2627 * http://www.apache.org/licenses/LICENSE-2.0 2628 * 2629 * Unless required by applicable law or agreed to in writing, software 2630 * distributed under the License is distributed on an "AS IS" BASIS, 2631 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2632 * See the License for the specific language governing permissions and 2633 * limitations under the License. 2634 */class ju{static emptySet(e){return new ju(e.comparator)}constructor(e){this.comparator=e?(t,s)=>e(t,s)||gt.comparator(t.key,s.key):(t,s)=>gt.comparator(t.key,s.key),this.keyedMap=Yd(),this.sortedSet=new vs(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 t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal(((t,s)=>(e(t),!1)))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof ju)||this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),s=e.sortedSet.getIterator();for(;t.hasNext();){const o=t.getNext().key,l=s.getNext().key;if(!o.isEqual(l))return!1}return!0}toString(){const e=[];return this.forEach((t=>{e.push(t.toString())})),e.length===0?"DocumentSet ()":`DocumentSet ( 2635 `+e.join(` 2636`)+` 2637)`}copy(e,t){const s=new ju;return s.comparator=this.comparator,s.keyedMap=e,s.sortedSet=t,s}}/** 2638 * @license 2639 * Copyright 2017 Google LLC 2640 * 2641 * Licensed under the Apache License, Version 2.0 (the "License"); 2642 * you may not use this file except in compliance with the License. 2643 * You may obtain a copy of the License at 2644 * 2645 * http://www.apache.org/licenses/LICENSE-2.0 2646 * 2647 * Unless required by applicable law or agreed to in writing, software 2648 * distributed under the License is distributed on an "AS IS" BASIS, 2649 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2650 * See the License for the specific language governing permissions and 2651 * limitations under the License. 2652 */class o5{constructor(){this.pu=new vs(gt.comparator)}track(e){const t=e.doc.key,s=this.pu.get(t);s?e.type!==0&&s.type===3?this.pu=this.pu.insert(t,e):e.type===3&&s.type!==1?this.pu=this.pu.insert(t,{type:s.type,doc:e.doc}):e.type===2&&s.type===2?this.pu=this.pu.insert(t,{type:2,doc:e.doc}):e.type===2&&s.type===0?this.pu=this.pu.insert(t,{type:0,doc:e.doc}):e.type===1&&s.type===0?this.pu=this.pu.remove(t):e.type===1&&s.type===2?this.pu=this.pu.insert(t,{type:1,doc:s.doc}):e.type===0&&s.type===1?this.pu=this.pu.insert(t,{type:2,doc:e.doc}):Ct(63341,{we:e,gu:s}):this.pu=this.pu.insert(t,e)}yu(){const e=[];return this.pu.inorderTraversal(((t,s)=>{e.push(s)})),e}}class Eh{constructor(e,t,s,o,l,u,h,f,p){this.query=e,this.docs=t,this.oldDocs=s,this.docChanges=o,this.mutatedKeys=l,this.fromCache=u,this.syncStateChanged=h,this.excludesMetadataChanges=f,this.hasCachedResults=p}static fromInitialDocuments(e,t,s,o,l){const u=[];return t.forEach((h=>{u.push({type:0,doc:h})})),new Eh(e,t,ju.emptySet(t),u,s,o,!0,!1,l)}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)&&Zg(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,s=e.docChanges;if(t.length!==s.length)return!1;for(let o=0;o<t.length;o++)if(t[o].type!==s[o].type||!t[o].doc.isEqual(s[o].doc))return!1;return!0}}/** 2653 * @license 2654 * Copyright 2017 Google LLC 2655 * 2656 * Licensed under the Apache License, Version 2.0 (the "License");
2657 * you may not use this file except in compliance with the License. 2658 * You may obtain a copy of the License at 2659 * 2660 * http://www.apache.org/licenses/LICENSE-2.0 2661 * 2662 * Unless required by applicable law or agreed to in writing, software 2663 * distributed under the License is distributed on an "AS IS" BASIS, 2664 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2665 * See the License for the specific language governing permissions and 2666 * limitations under the License. 2667 */class qz{constructor(){this.wu=void 0,this.bu=[]}Su(){return this.bu.some((e=>e.vu()))}}class $z{constructor(){this.queries=l5(),this.onlineState="Unknown",this.Du=new Set}terminate(){(function(t,s){const o=$t(t),l=o.queries;o.queries=l5(),l.forEach(((u,h)=>{for(const f of h.bu)f.onError(s)}))})(this,new Xe(Ie.ABORTED,"Firestore shutting down"))}}function l5(){return new Ju((n=>TS(n)),Zg)}async function Bv(n,e){const t=$t(n);let s=3;const o=e.query;let l=t.queries.get(o);l?!l.Su()&&e.vu()&&(s=2):(l=new qz,s=e.vu()?0:1);try{switch(s){case 0:l.wu=await t.onListen(o,!0);break;case 1:l.wu=await t.onListen(o,!1);break;case 2:await t.onFirstRemoteStoreListen(o)}}catch(u){const h=pv(u,`Initialization of query '${pr(e.query)?pl(e.query):pm(e.query)}' failed`);return void e.onError(h)}t.queries.set(o,l),l.bu.push(e),e.xu(t.onlineState),l.wu&&e.Cu(l.wu)&&xv(t)}async function gv(n,e){const t=$t(n),s=e.query;let o=3;const l=t.queries.get(s);if(l){const u=l.bu.indexOf(e);u>=0&&(l.bu.splice(u,1),l.bu.length===0?o=e.vu()?0:1:!l.Su()&&e.vu()&&(o=2))}switch(o){case 0:return t.queries.delete(s),t.onUnlisten(s,!0);case 1:return t.queries.delete(s),t.onUnlisten(s,!1);case 2:return t.onLastRemoteStoreUnlisten(s);default:return}}function Jz(n,e){const t=$t(n);let s=!1;for(const o of e){const l=o.query,u=t.queries.get(l);if(u){for(const h of u.bu)h.Cu(o)&&(s=!0);u.wu=o}}s&&xv(t)}function Kz(n,e,t){const s=$t(n),o=s.queries.get(e);if(o)for(const l of o.bu)l.onError(t);s.queries.delete(e)}function xv(n){n.Du.forEach((e=>{e.next()}))}var n1;(function(n){n.Default="default",n.Cache="cache"})(n1||(n1={}));class bv{constructor(e,t,s){this.query=e,this.Fu=t,this.Ou=!1,this.Mu=null,this.onlineState="Unknown",this.options=s||{}}Cu(e){if(!this.options.includeMetadataChanges){const s=[];for(const o of e.docChanges)o.type!==3&&s.push(o);e=new Eh(e.query,e.docs,e.oldDocs,s,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.Ou?this.Nu(e)&&(this.Fu.next(e),t=!0):this.Lu(e,this.onlineState)&&(this.Bu(e),t=!0),this.Mu=e,t}onError(e){this.Fu.error(e)}xu(e){this.onlineState=e;let t=!1;return this.Mu&&!this.Ou&&this.Lu(this.Mu,e)&&(this.Bu(this.Mu),t=!0),t}Lu(e,t){if(!e.fromCache||!this.vu())return!0;const s=t!=="Offline";return(!this.options.waitForSyncWhenOnline||!s)&&(!e.docs.isEmpty()||e.hasCachedResults||t==="Offline")}Nu(e){if(e.docChanges.length>0)return!0;const t=this.Mu&&this.Mu.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&this.options.includeMetadataChanges===!0}Bu(e){e=Eh.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Ou=!0,this.Fu.next(e)}vu(){return this.options.source!==n1.Cache}}/** 2668 * @license 2669 * Copyright 2017 Google LLC 2670 * 2671 * Licensed under the Apache License, Version 2.0 (the "License"); 2672 * you may not use this file except in compliance with the License. 2673 * You may obtain a copy of the License at 2674 * 2675 * http://www.apache.org/licenses/LICENSE-2.0 2676 * 2677 * Unless required by applicable law or agreed to in writing, software 2678 * distributed under the License is distributed on an "AS IS" BASIS, 2679 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2680 * See the License for the specific language governing permissions and 2681 * limitations under the License. 2682 */class US{constructor(e){this.key=e}}class GS{constructor(e){this.key=e}}class Qz{constructor(e,t){this.query=e,this.zu=t,this.ju=null,this.hasCachedResults=!1,this.current=!1,this.Hu=an(),this.mutatedKeys=an(),this.Ju=pr(e)?Zy(e):z1(e),this.Yu=new ju(this.Ju)}get Zu(){return this.zu}Xu(e,t){const s=t?t.ec:new o5,o=t?t.Yu:this.Yu;let l=t?t.mutatedKeys:this.mutatedKeys,u=o,h=!1;const[f,p]=this.tc(this.query,o);e.inorderTraversal(((b,C)=>{const N=o.get(b),T=az(this.query,C)?C:null,R=!!N&&this.mutatedKeys.has(N.key),A=!!T&&(T.hasLocalMutations||this.mutatedKeys.has(T.key)&&T.hasCommittedMutations);let U=!1;N&&T?N.data.isEqual(T.data)?R!==A&&(s.track({type:3,doc:T}),U=!0):this.nc(N,T)||(s.track({type:2,doc:T}),U=!0,(f&&this.Ju(T,f)>0||p&&this.Ju(T,p)<0)&&(h=!0)):!N&&T?(s.track({type:0,doc:T}),U=!0):N&&!T&&(s.track({type:1,doc:N}),U=!0,(f||p)&&(h=!0)),U&&(T?(u=u.add(T),l=A?l.add(b):l.delete(b)):(u=u.delete(b),l=l.delete(b)))}));const x=this.rc(this.query);if(x)if(pr(this.query)){const b=[];u.forEach((T=>b.push(T)));const C=kS(this.query,b);let N=new ju(Zy(this.query));for(const T of C)N=N.add(T);u.forEach((T=>{N.has(T.key)||(l=l.delete(T.key),s.track({type:1,doc:T}))})),u=N}else{const b=this.sc(this.query);for(;u.size>x;){const C=b==="F"?u.last():u.first();u=u.delete(C.key),l=l.delete(C.key),s.track({type:1,doc:C})}}return{Yu:u,ec:s,Oo:h,mutatedKeys:l}}rc(e){var t;return pr(e)?(t=QC(e))==null?void 0:t.limit:e.limit||void 0}sc(e){if(pr(e)){const t=QC(e);return t&&t.limit<0?"L":"F"}return e.limitType}tc(e,t){var s;if(pr(e)){const o=(s=QC(e))==null?void 0:s.limit;return[t.size===o?t.last():null,null]}return[e.limitType==="F"&&t.size===this.rc(this.query)?t.last():null,e.limitType==="L"&&t.size===this.rc(this.query)?t.first():null]}nc(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}
2682applyChanges(e,t,s,o){const l=this.Yu;this.Yu=e.Yu,this.mutatedKeys=e.mutatedKeys;const u=e.ec.yu();u.sort(((x,b)=>(function(N,T){const R=A=>{switch(A){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Ct(20277,{we:A})}};return R(N)-R(T)})(x.type,b.type)||this.Ju(x.doc,b.doc))),this._c(s),o=o??!1;const h=t&&!o?this.oc():[],f=this.Hu.size===0&&this.current&&!o?1:0,p=f!==this.ju;return this.ju=f,u.length!==0||p?{snapshot:new Eh(this.query,e.Yu,l,u,e.mutatedKeys,f===0,p,!1,!!s&&s.resumeToken.approximateByteSize()>0),ac:h}:{ac:h}}xu(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({Yu:this.Yu,ec:new o5,mutatedKeys:this.mutatedKeys,Oo:!1},!1)):{ac:[]}}uc(e){return!this.zu.has(e)&&!!this.Yu.has(e)&&!this.Yu.get(e).hasLocalMutations}_c(e){e&&(e.addedDocuments.forEach((t=>this.zu=this.zu.add(t))),e.modifiedDocuments.forEach((t=>{})),e.removedDocuments.forEach((t=>this.zu=this.zu.delete(t))),this.current=e.current)}oc(){if(!this.current)return[];const e=this.Hu;this.Hu=an(),this.Yu.forEach((s=>{this.uc(s.key)&&(this.Hu=this.Hu.add(s.key))}));const t=[];return e.forEach((s=>{this.Hu.has(s)||t.push(new GS(s))})),this.Hu.forEach((s=>{e.has(s)||t.push(new US(s))})),t}cc(e){this.zu=e.Wo,this.Hu=an();const t=this.Xu(e.documents);return this.applyChanges(t,!0)}lc(){return Eh.fromInitialDocuments(this.query,this.Yu,this.mutatedKeys,this.ju===0,this.hasCachedResults)}}const Cv="SyncEngine";class Yz{constructor(e,t,s){this.query=e,this.targetId=t,this.view=s}}class Xz{constructor(e){this.key=e,this.Ec=!1}}class Wz{constructor(e,t,s,o,l,u){this.localStore=e,this.remoteStore=t,this.eventManager=s,this.sharedClientState=o,this.currentUser=l,this.maxConcurrentLimboResolutions=u,this.hc={},this.Tc=new Ju((h=>TS(h)),Zg),this.Pc=new Map,this.Ic=new Set,this.Rc=new vs(gt.comparator),this.Ac=new Map,this.Vc=new iv,this.dc={},this.fc=new Map,this.mc=Lc.bs(),this.onlineState="Unknown",this.gc=void 0}get isPrimaryClient(){return this.gc===!0}}async function Zz(n,e,t=!0){const s=QS(n);let o;const l=s.Tc.get(e);return l?(s.sharedClientState.addLocalQueryTarget(l.targetId),o=l.view.lc()):o=await HS(s,e,t,!0),o}async function eF(n,e){const t=QS(n);await HS(t,e,!0,!1)}async function HS(n,e,t,s){const o=await Sz(n.localStore,pr(e)?e:Do(e)),l=o.targetId,u=n.sharedClientState.addLocalQueryTarget(l,t);let h;return s&&(h=await tF(n,e,l,u==="current",o.resumeToken)),n.isPrimaryClient&&t&&LS(n.remoteStore,o),h}async function tF(n,e,t,s,o){n.yc=(b,C,N)=>(async function(R,A,U,M){let V=A.view.Xu(U);V.Oo&&(V=await r5(R.localStore,A.query,!1).then((({documents:k})=>A.view.Xu(k,V))));const H=M&&M.targetChanges.get(A.targetId),Q=M&&M.targetMismatches.get(A.targetId)!=null,Y=A.view.applyChanges(V,R.isPrimaryClient,H,Q);return u5(R,A.targetId,Y.ac),Y.snapshot})(n,b,C,N);const l=await r5(n.localStore,e,!0),u=new Qz(e,l.Wo),h=u.Xu(l.documents),f=up.createSynthesizedTargetChangeForCurrentChange(t,s&&n.onlineState!=="Offline",o),p=u.applyChanges(h,n.isPrimaryClient,f);u5(n,t,p.ac);const x=new Yz(e,t,u);return n.Tc.set(e,x),n.Pc.has(t)?n.Pc.get(t).push(e):n.Pc.set(t,[e]),p.snapshot}async function nF(n,e,t){const s=$t(n),o=s.Tc.get(e),l=s.Pc.get(o.targetId);if(l.length>1)return s.Pc.set(o.targetId,l.filter((u=>!Zg(u,e)))),void s.Tc.delete(e);s.isPrimaryClient?(s.sharedClientState.removeLocalQueryTarget(o.targetId),s.sharedClientState.isActiveQueryTarget(o.targetId)||await e1(s.localStore,o.targetId,!1).then((()=>{s.sharedClientState.clearQueryState(o.targetId),t&&cv(s.remoteStore,o.targetId),s1(s,o.targetId)})).catch(Rh)):(s1(s,o.targetId),await e1(s.localStore,o.targetId,!0))}async function sF(n,e){const t=$t(n),s=t.Tc.get(e),o=t.Pc.get(s.targetId);t.isPrimaryClient&&o.length===1&&(t.sharedClientState.removeLocalQueryTarget(s.targetId),cv(t.remoteStore,s.targetId))}async function rF(n,e,t){const s=dF(n);try{const o=await(function(u,h){const f=$t(u),p=Qn.now(),x=h.reduce(((N,T)=>N.add(T.key)),an());let b,C;return f.persistence.runTransaction("Locally write mutations","readwrite",(N=>{let T=Si(),R=an();return f.ko.getEntries(N,x).next((A=>{T=A,T.forEach(((U,M)=>{M.isValidDocument()||(R=R.add(U))}))})).next((()=>f.localDocuments.getOverlayedDocuments(N,T))).next((A=>{b=A;const U=[];for(const M of h){const V=QM(M,b.get(M.key).overlayedDocument);V!=null&&U.push(new Vc(M.key,V,yT(V.value.mapValue),Da.exists(!0)))}
2682return f.mutationQueue.addMutationBatch(N,p,U,h)})).next((A=>{C=A;const U=A.applyToLocalDocumentSet(b,R);return f.documentOverlayCache.saveOverlays(N,A.batchId,U)}))})).then((()=>({batchId:C.batchId,changes:FT(b)})))})(s.localStore,e);s.sharedClientState.addPendingMutation(o.batchId),(function(u,h,f){let p=u.dc[u.currentUser.toKey()];p||(p=new vs(dn)),p=p.insert(h,f),u.dc[u.currentUser.toKey()]=p})(s,o.batchId,t),await fp(s,o.changes),await nx(s.remoteStore)}catch(o){const l=pv(o,"Failed to persist write");t.reject(l)}}async function qS(n,e){const t=$t(n);try{const s=await Nz(t.localStore,e);e.targetChanges.forEach(((o,l)=>{const u=t.Ac.get(l);u&&(pt(o.addedDocuments.size+o.modifiedDocuments.size+o.removedDocuments.size<=1,22616),o.addedDocuments.size>0?u.Ec=!0:o.modifiedDocuments.size>0?pt(u.Ec,14607):o.removedDocuments.size>0&&(pt(u.Ec,42227),u.Ec=!1))})),await fp(t,s,e)}catch(s){await Rh(s)}}function c5(n,e,t){const s=$t(n);if(s.isPrimaryClient&&t===0||!s.isPrimaryClient&&t===1){const o=[];s.Tc.forEach(((l,u)=>{const h=u.view.xu(e);h.snapshot&&o.push(h.snapshot)})),(function(u,h){const f=$t(u);f.onlineState=h;let p=!1;f.queries.forEach(((x,b)=>{for(const C of b.bu)C.xu(h)&&(p=!0)})),p&&xv(f)}
vendor: 3,702 bytes, line 2682
2682)(s.eventManager,e),o.length&&s.hc.Tn(o),s.onlineState=e,s.isPrimaryClient&&s.sharedClientState.setOnlineState(e)}}async function iF(n,e,t){const s=$t(n);s.sharedClientState.updateQueryState(e,"rejected",t);const o=s.Ac.get(e),l=o&&o.key;if(l){let u=new vs(gt.comparator);u=u.insert(l,$r.newNoDocument(l,zt.min()));const h=an().add(l),f=new cp(zt.min(),new Map,new vs(dn),u,Si(),h);await qS(s,f),s.Rc=s.Rc.remove(l),s.Ac.delete(e),yv(s)}else await e1(s.localStore,e,!1).then((()=>s1(s,e,t))).catch(Rh)}async function aF(n,e){const t=$t(n),s=e.batch.batchId;try{const o=await Ez(t.localStore,e);JS(t,s,null),$S(t,s),t.sharedClientState.updateMutationState(s,"acknowledged"),await fp(t,o)}catch(o){await Rh(o)}}async function oF(n,e,t){const s=$t(n);try{const o=await(function(u,h){const f=$t(u);return f.persistence.runTransaction("Reject batch","readwrite-primary",(p=>{let x;return f.mutationQueue.lookupMutationBatch(p,h).next((b=>(pt(b!==null,37113),x=b.keys(),f.mutationQueue.removeMutationBatch(p,b)))).next((()=>f.mutationQueue.performConsistencyCheck(p))).next((()=>f.documentOverlayCache.removeOverlaysForBatchId(p,x,h))).next((()=>f.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(p,x))).next((()=>f.localDocuments.getDocuments(p,x)))}))})(s.localStore,e);JS(s,e,t),$S(s,e),s.sharedClientState.updateMutationState(e,"rejected",t),await fp(s,o)}catch(o){await Rh(o)}}function $S(n,e){(n.fc.get(e)||[]).forEach((t=>{t.resolve()})),n.fc.delete(e)}function JS(n,e,t){const s=$t(n);let o=s.dc[s.currentUser.toKey()];if(o){const l=o.get(e);l&&(t?l.reject(t):l.resolve(),o=o.remove(e)),s.dc[s.currentUser.toKey()]=o}}function s1(n,e,t=null){n.sharedClientState.removeLocalQueryTarget(e);for(const s of n.Pc.get(e))n.Tc.delete(s),t&&n.hc.wc(s,t);n.Pc.delete(e),n.isPrimaryClient&&n.Vc.e_(e).forEach((s=>{n.Vc.containsKey(s)||KS(n,s)}))}function KS(n,e){n.Ic.delete(e.path.canonicalString());const t=n.Rc.get(e);t!==null&&(cv(n.remoteStore,t),n.Rc=n.Rc.remove(e),n.Ac.delete(t),yv(n))}function u5(n,e,t){for(const s of t)s instanceof US?(n.Vc.addReference(s.key,e),lF(n,s)):s instanceof GS?(rt(Cv,"Document no longer in limbo: "+s.key),n.Vc.removeReference(s.key,e),n.Vc.containsKey(s.key)||KS(n,s.key)):Ct(19791,{bc:s})}function lF(n,e){const t=e.key,s=t.path.canonicalString();n.Rc.get(t)||n.Ic.has(s)||(rt(Cv,"New document in limbo: "+t),n.Ic.add(s),yv(n))}function yv(n){for(;n.Ic.size>0&&n.Rc.size<n.maxConcurrentLimboResolutions;){const e=n.Ic.values().next().value;n.Ic.delete(e);const t=new gt(Pn.fromString(e)),s=n.mc.next();n.Ac.set(s,new Xz(t)),n.Rc=n.Rc.insert(t,s),LS(n.remoteStore,new ul(Do(zg(t.path)),s,"TargetPurposeLimboResolution",Gg.wn))}}async function fp(n,e,t){const s=$t(n),o=[],l=[],u=[];s.Tc.isEmpty()||(s.Tc.forEach(((h,f)=>{u.push(s.yc(f,e,t).then((p=>{var x;if((p||t)&&s.isPrimaryClient){const b=p?!p.fromCache:(x=t==null?void 0:t.targetChanges.get(f.targetId))==null?void 0:x.current;s.sharedClientState.updateQueryState(f.targetId,b?"current":"not-current")}if(p){o.push(p);const b=ov.mo(f.targetId,p);l.push(b)}})))})),await Promise.all(u),s.hc.Tn(o),await(async function(f,p){const x=$t(f);try{await x.persistence.runTransaction("notifyLocalViewChanges","readwrite",(b=>Me.forEach(p,(C=>Me.forEach(C.Vo,(N=>x.persistence.referenceDelegate.addReference(b,C.targetId,N))).next((()=>Me.forEach(C.fo,(N=>x.persistence.referenceDelegate.removeReference(b,C.targetId,N)))))))))}catch(b){if(!Ih(b))throw b;rt(lv,"Failed to update sequence numbers: "+b)}for(const b of p){const C=b.targetId;if(!b.fromCache){const N=x.Lo.get(C),T=N.snapshotVersion,R=N.withLastLimboFreeSnapshotVersion(T);x.Lo=x.Lo.insert(C,R)}}})(s.localStore,l))}async function cF(n,e){const t=$t(n);
2682if(!t.currentUser.isEqual(e)){rt(Cv,"User change. New user:",e.toKey());const s=await IS(t.localStore,e);t.currentUser=e,(function(l,u){l.fc.forEach((h=>{h.forEach((f=>{f.reject(new Xe(Ie.CANCELLED,u))}))})),l.fc.clear()})(t,"'waitForPendingWrites' promise is rejected due to a user change."),t.sharedClientState.handleUserChange(e,s.removedBatchIds,s.addedBatchIds),await fp(t,s.$o)}}function uF(n,e){const t=$t(n),s=t.Ac.get(e);if(s&&s.Ec)return an().add(s.key);{let o=an();const l=t.Pc.get(e);if(!l)return o;for(const u of l??[]){const h=t.Tc.get(u);o=o.unionWith(h.view.Zu)}return o}}function QS(n){const e=$t(n);return e.remoteStore.remoteSyncer.applyRemoteEvent=qS.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=uF.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=iF.bind(null,e),e.hc.Tn=Jz.bind(null,e.eventManager),e.hc.wc=Kz.bind(null,e.eventManager),e}function dF(n){const e=$t(n);return e.remoteStore.remoteSyncer.applySuccessfulWrite=aF.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=oF.bind(null,e),e}class dg{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=Vg(e.databaseInfo.databaseId),this.sharedClientState=this.vc(e),this.persistence=this.Dc(e),await this.persistence.start(),this.localStore=this.xc(e),this.gcScheduler=this.Cc(e,this.localStore),this.indexBackfillerScheduler=this.Fc(e,this.localStore)}Cc(e,t){return null}Fc(e,t){return null}xc(e){return wz(this.persistence,new yz,e.initialUser,this.serializer)}Dc(e){return new RS(av.b_,this.serializer)}vc(e){return new Hz}async terminate(){var e,t;(e=this.gcScheduler)==null||e.stop(),(t=this.indexBackfillerScheduler)==null||t.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}dg.provider={build:()=>new dg};class hF extends dg{constructor(e){super(),this.cacheSizeBytes=e}Cc(e,t){pt(this.persistence.referenceDelegate instanceof cg,46915);const s=this.persistence.referenceDelegate.garbageCollector;return new f6(s,e.asyncQueue,t)}Dc(e){const t=this.cacheSizeBytes!==void 0?Ni.withCacheSize(this.cacheSizeBytes):Ni.DEFAULT;return new RS((s=>cg.b_(s,t)),this.serializer)}}class r1{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=s=>c5(this.syncEngine,s,1),this.remoteStore.remoteSyncer.handleCredentialChange=cF.bind(null,this.syncEngine),await Gz(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return(function(){return new $z})()}createDatastore(e){const t=Vg(e.databaseInfo.databaseId),s=e6(e.databaseInfo);return i6(e.authCredentials,e.appCheckCredentials,s,t)}createRemoteStore(e){return(function(s,o,l,u,h){return new kz(s,o,l,u,h)})(this.localStore,this.datastore,e.asyncQueue,(t=>c5(this.syncEngine,t,0)),(function(){return JN.Ye()?new JN:new YP})())}createSyncEngine(e,t){return(function(o,l,u,h,f,p,x){const b=new Wz(o,l,u,h,f,p);return x&&(b.gc=!0),b})(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e,t;await(async function(o){const l=$t(o);rt(Oo,"RemoteStore shutting down."),l.la.add(5),await hp(l),l.ha.shutdown(),l.Ta.set("Unknown")})(this.remoteStore),(e=this.datastore)==null||e.terminate(),(t=this.eventManager)==null||t.terminate()}}r1.provider={build:()=>new r1};/** 2683 * @license 2684 * Copyright 2017 Google LLC 2685 * 2686 * Licensed under the Apache License, Version 2.0 (the "License"); 2687 * you may not use this file except in compliance with the License. 2688 * You may obtain a copy of the License at 2689 * 2690 * http://www.apache.org/licenses/LICENSE-2.0 2691 * 2692 * Unless required by applicable law or agreed to in writing, software 2693 * distributed under the License is distributed on an "AS IS" BASIS, 2694 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2695 * See the License for the specific language governing permissions and 2696 * limitations under the License. 2697 */const Pc="FirestoreClient";class fF{constructor(e,t,s,o,l){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=s,this._databaseInfo=o,this.user=qr.UNAUTHENTICATED,this.clientId=k1.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=l,this.authCredentials.start(s,(async u=>{rt(Pc,"Received user=",u.uid),await this.authCredentialListener(u),this.user=u})),this.appCheckCredentials.start(s,(u=>(rt(Pc,"Received new app check token=",u),this.appCheckCredentialListener(u,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 ml;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const s=pv(t,"Failed to shutdown persistence");e.reject(s)}})),e.promise}}async function XC(n,e){n.asyncQueue.verifyOperationInProgress(),rt(Pc,"Initializing OfflineComponentProvider");const t=n.configuration;await e.initialize(t);let s=t.initialUser;n.setCredentialChangeListener((async o=>{s.isEqual(o)||(await IS(e.localStore,o),s=o)})),e.persistence.setDatabaseDeletedListener((()=>n.terminate())),n._offlineComponents=e}async function d5(n,e){n.asyncQueue.verifyOperationInProgress();const t=await mF(n);rt(Pc,"Initializing OnlineComponentProvider"),await e.initialize(t,n.configuration),n.setCredentialChangeListener((s=>i5(e.remoteStore,s))),n.setAppCheckTokenChangeListener(((s,o)=>i5(e.remoteStore,o))),n._onlineComponents=e}async function mF(n){if(!n._offlineComponents)if(n._uninitializedComponentsProvider){rt(Pc,"Using user provided OfflineComponentProvider");try{await XC(n,n._uninitializedComponentsProvider._offline)}catch(e){const t=e;if(!(function(o){return o.name==="FirebaseError"?o.code===Ie.FAILED_PRECONDITION||o.code===Ie.UNIMPLEMENT
2697ED:!(typeof DOMException<"u"&&o instanceof DOMException)||o.code===22||o.code===20||o.code===11})(t))throw t;Va("Error using user provided cache. Falling back to memory cache: "+t),await XC(n,new dg)}}else rt(Pc,"Using default OfflineComponentProvider"),await XC(n,new hF(void 0));return n._offlineComponents}async function YS(n){return n._onlineComponents||(n._uninitializedComponentsProvider?(rt(Pc,"Using user provided OnlineComponentProvider"),await d5(n,n._uninitializedComponentsProvider._online)):(rt(Pc,"Using default OnlineComponentProvider"),await d5(n,new r1))),n._onlineComponents}function pF(n){return YS(n).then((e=>e.syncEngine))}async function hg(n){const e=await YS(n),t=e.eventManager;return t.onListen=Zz.bind(null,e.syncEngine),t.onUnlisten=nF.bind(null,e.syncEngine),t.onFirstRemoteStoreListen=eF.bind(null,e.syncEngine),t.onLastRemoteStoreUnlisten=sF.bind(null,e.syncEngine),t}function BF(n,e,t,s){const o=new fv(s),l=new bv(e,o,t);return n.asyncQueue.enqueueAndForget((async()=>Bv(await hg(n),l))),()=>{o.Va(),n.asyncQueue.enqueueAndForget((async()=>gv(await hg(n),l)))}}function gF(n,e,t={}){const s=new ml;return n.asyncQueue.enqueueAndForget((async()=>(function(l,u,h,f,p){const x=new fv({next:C=>{x.Va(),u.enqueueAndForget((()=>gv(l,b)));const N=C.docs.has(h);!N&&C.fromCache?p.reject(new Xe(Ie.UNAVAILABLE,"Failed to get document because the client is offline.")):N&&C.fromCache&&f&&f.source==="server"?p.reject(new Xe(Ie.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(C)},error:C=>p.reject(C)}),b=new bv(zg(h.path),x,{includeMetadataChanges:!0,waitForSyncWhenOnline:!0});return Bv(l,b)})(await hg(n),n.asyncQueue,e,t,s))),s.promise}function xF(n,e,t={}){const s=new ml;return n.asyncQueue.enqueueAndForget((async()=>(function(l,u,h,f,p){const x=new fv({next:C=>{x.Va(),u.enqueueAndForget((()=>gv(l,b))),C.fromCache&&f.source==="server"?p.reject(new Xe(Ie.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(C)},error:C=>p.reject(C)}),b=new bv(h instanceof xm?X8(h):h,x,{includeMetadataChanges:!0,waitForSyncWhenOnline:!0});return Bv(l,b)})(await hg(n),n.asyncQueue,e,t,s))),s.promise}function bF(n,e){const t=new ml;return n.asyncQueue.enqueueAndForget((async()=>rF(await pF(n),e,t))),t.promise}/** 2698 * @license 2699 * Copyright 2020 Google LLC 2700 * 2701 * Licensed under the Apache License, Version 2.0 (the "License"); 2702 * you may not use this file except in compliance with the License. 2703 * You may obtain a copy of the License at 2704 * 2705 * http://www.apache.org/licenses/LICENSE-2.0 2706 * 2707 * Unless required by applicable law or agreed to in writing, software 2708 * distributed under the License is distributed on an "AS IS" BASIS, 2709 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2710 * See the License for the specific language governing permissions and 2711 * limitations under the License. 2712 */let XS=class{constructor(e,t,s,o,l){this._firestore=e,this._userDataWriter=t,this._key=s,this._document=o,this._converter=l}get id(){return this._key.path.lastSegment()}get ref(){return new ks(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new CF(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 t=this._document.data.field(Rc("DocumentSnapshot.get",e));if(t!==null)return this._userDataWriter.convertValue(t)}}},CF=class extends XS{data(){return super.data()}};/** 2713 * @license 2714 * Copyright 2020 Google LLC 2715 * 2716 * Licensed under the Apache License, Version 2.0 (the "License"); 2717 * you may not use this file except in compliance with the License. 2718 * You may obtain a copy of the License at 2719 * 2720 * http://www.apache.org/licenses/LICENSE-2.0 2721 * 2722 * Unless required by applicable law or agreed to in writing, softw
2722are 2723 * distributed under the License is distributed on an "AS IS" BASIS, 2724 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2725 * See the License for the specific language governing permissions and 2726 * limitations under the License. 2727 */class yF{convertValue(e,t="none"){switch(lr(e)){case 0:return null;case 1:return e.booleanValue;case 2:return js(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(jc(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw Ct(62114,{value:e})}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const s={};return Fc(e,((o,l)=>{s[o]=this.convertValue(l,t)})),s}convertVectorValue(e){var s,o,l;const t=(l=(o=(s=e.fields)==null?void 0:s[Mm].arrayValue)==null?void 0:o.values)==null?void 0:l.map((u=>js(u.doubleValue)));return new Ai(t)}convertGeoPoint(e){return new So(js(e.latitude),js(e.longitude))}convertArray(e,t){return(e.values||[]).map((s=>this.convertValue(s,t)))}convertServerTimestamp(e,t){switch(t){case"previous":const s=op(e);return s==null?null:this.convertValue(s,t);case"estimate":return this.convertTimestamp(bh(e));default:return null}}convertTimestamp(e){const t=Sc(e);return new Qn(t.seconds,t.nanos)}convertDocumentKey(e,t){const s=Pn.fromString(e);pt(YT(s),9688,{name:e});const o=new Om(s.get(1),s.get(3)),l=new gt(s.popFirst(5));return o.isEqual(t)||yl(`A document reference to ${l} refers to a different database (${o.projectId}/${o.database}), which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),l}}/** 2728 * @license 2729 * Copyright 2020 Google LLC 2730 * 2731 * Licensed under the Apache License, Version 2.0 (the "License"); 2732 * you may not use this file except in compliance with the License. 2733 * You may obtain a copy of the License at 2734 * 2735 * http://www.apache.org/licenses/LICENSE-2.0 2736 * 2737 * Unless required by applicable law or agreed to in writing, software 2738 * distributed under the License is distributed on an "AS IS" BASIS, 2739 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2740 * See the License for the specific language governing permissions and 2741 * limitations under the License. 2742 */function WS(n,e,t){let s;return s=n?t&&(t.merge||t.mergeFields)?n.toFirestore(e,t):n.toFirestore(e):e,s}/** 2743 * @license 2744 * Copyright 2020 Google LLC 2745 * 2746 * Licensed under the Apache License, Version 2.0 (the "License"); 2747 * you may not use this file except in compliance with the License. 2748 * You may obtain a copy of the License at 2749 * 2750 * http://www.apache.org/licenses/LICENSE-2.0 2751 * 2752 * Unless required by applicable law or agreed to in writing, software 2753 * distributed under the License is distributed on an "AS IS" BASIS, 2754 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2755 * See the License for the specific language governing permissions and 2756 * limitations under the License. 2757 */const h5="AsyncQueue";class f5{constructor(e=Promise.resolve()){this.$c=[],this.Kc=!1,this.Qc=[],this.Wc=null,this.Gc=!1,this.zc=!1,this.jc=[],this.Ht=new tS(this,"async_queue_retry"),this.Hc=()=>{const s=YC();s&&rt(h5,"Visibility state changed to "+s.visibilityState),this.Ht.$t()},this.Jc=e;const t=YC();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this.Hc)}get isShuttingDown(){return this.Kc}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Yc(),this.Zc(e)}enterRestrictedMode(e){if(!this.Kc){this.Kc=!0,this.zc=e||!1;const t=YC();t&&typeof t.removeEventListener=="function"&&t.removeEventListener("visibilitychange",this.Hc)}}enqueue(e){if(this.Yc(),this.Kc)return new Promise((()=>{}));const t=new ml;return this.Zc((()=>this.Kc&&this.zc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise))).then((()=>t.promise))}enqueueRetryable(e){this.enqueueAndForget((()=>(this.$c.push(e),this.Xc())))}async Xc(){if(this.$c.length!==0){try{await this.$c[0](),this.$c.shift(),this.Ht.reset()}catch(e){if(!Ih(e))throw e;rt(h5,"Operation failed with retryable error: "+e)}this.$c.length>0&&this.Ht.kt((()=>this.Xc()))}}Zc(e){const t=this.Jc.then((()=>(this.Gc=!0,e().catch((s=>{throw this.Wc=s,this.Gc=!1,yl("INTERNAL UNHANDLED ERROR: ",m5(s)),s})).then((s=>(this.Gc=!1,s))))));return this.Jc=t,t}enqueueAfterDelay(e,t,s){this.Yc(),this.jc.indexOf(e)>-1&&(t=0);const o=mv.createAndSchedule(this,e,t,s,(l=>this.el(l)));return this.Qc.push(o),o}Yc(){this.Wc&&Ct(47125,{tl:m5(this.Wc)})}verifyOperationInProgress(){}async nl(){let e;do e=this.Jc,await e;while(e!==this.Jc)}rl(e){for(const t of this.Qc)if(t.timerId===e)return!0;return!1}il(e){return this.nl().then((()=>{this.Qc.sort(((t,s)=>t.targetTimeMs-s.targetTimeMs));for(const t of this.Qc)if(t.skipDelay(),e!=="all"&&t.timerId===e)break;return this.nl()}))}sl(e){this.jc.push(e)}el(e){const t=this.Qc.indexOf(e);this.Qc.splice(t,1)}}function m5(n){let e=n.message||"";return n.stack&&(e=n.stack.includes(n.message)?n.stack:n.message+` 2758`+n.stack),e}class _l extends Hg{constructor(e,t,s,o){super(e,t,s,o),this.type="firestore",this._queue=new f5,this._persistenceKey=(o==null?void 0:o.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new f5(e),this._firestoreClient=void 0,await e}}}function vF(n,e){const t=typeof n=="object"?n:T1(),s=typeof n=="string"?n:e,o=kg(t,"firestore").getImmediate({identifier:s});if(!o._initialized){const l=GD("firestore");l&&B6(o,...l)}return o}function sx(n){if(n._terminated)throw new Xe(Ie.FAILED_PRECONDITION,"The client has already been terminated.");return n._firestoreClient||_F(n),n._firestoreClient}function _F(n){var s,o,l,u;const e=n._freezeSettings(),t=o6(n._databaseId,((s=n._app)==null?void 0:s.options.appId)||"",n._persistenceKey,(o=n._app)==null?void 0:o.options.apiKey,e);n._componentsProvider||(l=e.localCache)!=null&&l._offlineComponentProvider&&((u=e.localCache)!=null&&u._onlineComponentProvider)&&(n._componentsProvider={_offline:e.localCache._offlineComponentProvider,_online:e.localCache._onlineComponentProvider}),n._firestoreClient=new fF(n._authCredentials,n._appCheckCredentials,n._queue,t,n._componentsProvider&&(function(f){const p=f==null?void 0:f._online.build();return{_offline:f==null?void 0:f._offline.build(p),_online:p}})(n._componentsProvider))}/** 2759 * @license 2760 * Copyright 2024 Google LLC 2761 * 2762 * Licensed under the Apache License, Version 2.0 (the "License");
2763 * you may not use this file except in compliance with the License. 2764 * You may obtain a copy of the License at 2765 * 2766 * http://www.apache.org/licenses/LICENSE-2.0 2767 * 2768 * Unless required by applicable law or agreed to in writing, software 2769 * distributed under the License is distributed on an "AS IS" BASIS, 2770 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2771 * See the License for the specific language governing permissions and 2772 * limitations under the License. 2773 */class vv extends yF{constructor(e){super(),this.firestore=e}convertBytes(e){return new Ea(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new ks(this.firestore,null,t)}}class im{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class Au extends XS{constructor(e,t,s,o,l,u){super(e,t,s,o,u),this._firestore=e,this._firestoreImpl=e,this.metadata=l}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new kB(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const s=this._document.data.field(Rc("DocumentSnapshot.get",e));if(s!==null)return this._userDataWriter.convertValue(s,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new Xe(Ie.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,t={};return t.type=Au._jsonSchemaVersion,t.bundle="",t.bundleSource="DocumentSnapshot",t.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?t:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),t.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),t)}}Au._jsonSchemaVersion="firestore/documentSnapshot/1.0",Au._jsonSchema={type:ir("string",Au._jsonSchemaVersion),bundleSource:ir("string","DocumentSnapshot"),bundleName:ir("string"),bundle:ir("string")};class kB extends Au{data(e={}){return super.data(e)}}class ku{constructor(e,t,s,o){this._firestore=e,this._userDataWriter=t,this._snapshot=o,this.metadata=new im(o.hasPendingWrites,o.fromCache),this.query=s}get docs(){const e=[];return this.forEach((t=>e.push(t))),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,t){this._snapshot.docs.forEach((s=>{e.call(t,new kB(this._firestore,this._userDataWriter,s.key,s,new im(this._snapshot.mutatedKeys.has(s.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new Xe(Ie.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=(function(o,l){if(o._snapshot.oldDocs.isEmpty()){let u=0;return o._snapshot.docChanges.map((h=>{pr(o._snapshot.query)?Zy(o._snapshot.query):z1(o.query._query);const f=new kB(o._firestore,o._userDataWriter,h.doc.key,h.doc,new im(o._snapshot.mutatedKeys.has(h.doc.key),o._snapshot.fromCache),o.query.converter);return h.doc,{type:"added",doc:f,oldIndex:-1,newIndex:u++}}))}{let u=o._snapshot.oldDocs;return o._snapshot.docChanges.filter((h=>l||h.type!==3)).map((h=>{const f=new kB(o._firestore,o._userDataWriter,h.doc.key,h.doc,new im(o._snapshot.mutatedKeys.has(h.doc.key),o._snapshot.fromCache),o.query.converter);let p=-1,x=-1;return h.type!==0&&(p=u.indexOf(h.doc.key),u=u.delete(h.doc.key)),h.type!==1&&(u=u.add(h.doc),x=u.indexOf(h.doc.key)),{type:wF(h.type),doc:f,oldIndex:p,newIndex:x}}))}})(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new Xe(Ie.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};
2773e.type=ku._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=k1.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const t=[],s=[],o=[];return this.docs.forEach((l=>{l._document!==null&&(t.push(l._document),s.push(this._userDataWriter.convertObjectMap(l._document.data.value.mapValue.fields,"previous")),o.push(l.ref.path))})),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function wF(n){switch(n){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Ct(61501,{type:n})}}/** 2774 * @license 2775 * Copyright 2025 Google LLC 2776 * 2777 * Licensed under the Apache License, Version 2.0 (the "License"); 2778 * you may not use this file except in compliance with the License. 2779 * You may obtain a copy of the License at 2780 * 2781 * http://www.apache.org/licenses/LICENSE-2.0 2782 * 2783 * Unless required by applicable law or agreed to in writing, software 2784 * distributed under the License is distributed on an "AS IS" BASIS, 2785 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2786 * See the License for the specific language governing permissions and 2787 * limitations under the License. 2788 */ku._jsonSchemaVersion="firestore/querySnapshot/1.0",ku._jsonSchema={type:ir("string",ku._jsonSchemaVersion),bundleSource:ir("string","QuerySnapshot"),bundleName:ir("string"),bundle:ir("string")};/** 2789 * @license 2790 * Copyright 2020 Google LLC 2791 * 2792 * Licensed under the Apache License, Version 2.0 (the "License"); 2793 * you may not use this file except in compliance with the License. 2794 * You may obtain a copy of the License at 2795 * 2796 * http://www.apache.org/licenses/LICENSE-2.0 2797 * 2798 * Unless required by applicable law or agreed to in writing, software 2799 * distributed under the License is distributed on an "AS IS" BASIS, 2800 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2801 * See the License for the specific language governing permissions and 2802 * limitations under the License. 2803 */function ZS(n){if(n.limitType==="L"&&n.explicitOrderBy.length===0)throw new Xe(Ie.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class _v{}class wv extends _v{}function li(n,e,...t){let s=[];e instanceof _v&&s.push(e),s=s.concat(t),(function(l){const u=l.filter((f=>f instanceof Ev)).length,h=l.filter((f=>f instanceof rx)).length;if(u>1||u>0&&h>0)throw new Xe(Ie.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)n=o._apply(n);return n}class rx extends wv{constructor(e,t,s){super(),this._field=e,this._op=t,this._value=s,this.type="where"}static _create(e,t,s){return new rx(e,t,s)}_apply(e){const t=this._parse(e);return ej(e._query,t),new Nl(e.firestore,e.converter,$y(e._query,t))}_parse(e){const t=$g(e.firestore);return(function(l,u,h,f,p,x,b){let C;if(p.isKeyField()){if(x==="array-contains"||x==="array-contains-any")throw new Xe(Ie.INVALID_ARGUMENT,`Invalid Query. You can't perform '${x}' queries on documentId().`);if(x==="in"||x==="not-in"){B5(b,x);const T=[];for(const R of b)T.push(p5(f,l,R));C={arrayValue:{values:T}}}else C=p5(f,l,b)}else x!=="in"&&x!=="not-in"&&x!=="array-contains-any"||B5(b,x),C=v6(h,u,b,x==="in"||x==="not-in");return sr.create(p,x,C)})(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value)}}function _a(n,e,t){const s=e,o=Rc("where",n);return rx._create(o,s,t)}class Ev extends _v{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new Ev(e,t)}_parse(e){const t=this._queryConstraints.map((s=>s._parse(e))).filter((s=>s.getFilters().length>0));return t.length===1?t[0]:Ua.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return t.getFilters().length===0?e:((function(o,l){let u=o;const h=l.getFlattenedFilters();for(const f of h)ej(u,f),u=$y(u,f)})(e._query,t),new Nl(e.firestore,e.converter,$y(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}
2803class Nv extends wv{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new Nv(e,t)}_apply(e){const t=(function(o,l,u){if(o.startAt!==null)throw new Xe(Ie.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(o.endAt!==null)throw new Xe(Ie.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new Vm(l,u)})(e._query,this._field,this._direction);return new Nl(e.firestore,e.converter,fP(e._query,t))}}function nh(n,e="asc"){const t=e,s=Rc("orderBy",n);return Nv._create(s,t)}class ix extends wv{constructor(e,t,s){super(),this.type=e,this._limit=t,this._limitType=s}static _create(e,t,s){return new ix(e,t,s)}_apply(e){return new Nl(e.firestore,e.converter,rg(e._query,this._limit,this._limitType))}}function EF(n){return fT("limit",n),ix._create("limit",n,"F")}function WC(n){return fT("limitToLast",n),ix._create("limitToLast",n,"L")}function p5(n,e,t){if(typeof(t=$s(t))=="string"){if(t==="")throw new Xe(Ie.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!MT(e)&&t.indexOf("/")!==-1)throw new Xe(Ie.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${t}' contains a '/' character.`);const s=e.path.child(Pn.fromString(t));if(!gt.isDocumentKey(s))throw new Xe(Ie.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 AN(n,new gt(s))}if(t instanceof ks)return AN(n,t._key);throw new Xe(Ie.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Rg(t)}.`)}function B5(n,e){if(!Array.isArray(n)||n.length===0)throw new Xe(Ie.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function ej(n,e){const t=(function(o,l){for(const u of o)for(const h of u.getFlattenedFilters())if(l.indexOf(h.op)>=0)return h.op;return null})(n.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(t!==null)throw t===e.op?new Xe(Ie.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new Xe(Ie.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${t.toString()}' filters.`)}/** 2804 * @license 2805 * Copyright 2017 Google LLC 2806 * 2807 * Licensed under the Apache License, Version 2.0 (the "License"); 2808 * you may not use this file except in compliance with the License. 2809 * You may obtain a copy of the License at 2810 * 2811 * http://www.apache.org/licenses/LICENSE-2.0 2812 * 2813 * Unless required by applicable law or agreed to in writing, software 2814 * distributed under the License is distributed on an "AS IS" BASIS, 2815 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2816 * See the License for the specific language governing permissions and 2817 * limitations under the License. 2818 */function g5(n){return(function(t,s){if(typeof t!="object"||t===null)return!1;const o=t;for(const l of s)if(l in o&&typeof o[l]=="function")return!0;return!1})(n,["next","error","complete"])}/** 2819 * @license 2820 * Copyright 2020 Google LLC 2821 * 2822 * Licensed under the Apache License, Version 2.0 (the "License"); 2823 * you may not use this file except in compliance with the License. 2824 * You may obtain a copy of the License at 2825 * 2826 * http://www.apache.org/licenses/LICENSE-2.0 2827 * 2828 * Unless required by applicable law or agreed to in writing, software 2829 * distributed under the License is distributed on an "AS IS" BASIS, 2830 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2831 * See the License for the specific language governing permissions and 2832 * limitations under the License. 2833 */function NF(n){n=ji(n,ks);const e=ji(n.firestore,_l),t=sx(e);return gF(t,n._key).then((s=>tj(e,n,s)))}function Cm(n){n=ji(n,Nl);const e=ji(n.firestore,_l),t=sx(e),s=new vv(e);
2833return ZS(n._query),xF(t,n._query).then((o=>new ku(e,s,n,o)))}function wa(n,e,t){n=ji(n,ks);const s=ji(n.firestore,_l),o=WS(n.converter,e,t),l=$g(s);return ax(s,[oS(l,"setDoc",n._key,o,n.converter!==null,t).toMutation(n._key,Da.none())])}function oi(n,e,t,...s){n=ji(n,ks);const o=ji(n.firestore,_l),l=$g(o);let u;return u=typeof(e=$s(e))=="string"||e instanceof Ug?y6(l,"updateDoc",n._key,e,t,s):C6(l,"updateDoc",n._key,e),ax(o,[u.toMutation(n._key,Da.exists(!0))])}function am(n){return ax(ji(n.firestore,_l),[new P1(n._key,Da.none())])}function Fh(n,e){const t=ji(n.firestore,_l),s=Tn(n),o=WS(n.converter,e),l=$g(n.firestore);return ax(t,[oS(l,"addDoc",s._key,o,n.converter!==null,{}).toMutation(s._key,Da.exists(!1))]).then((()=>s))}function Cr(n,...e){var p,x,b;n=$s(n);let t={includeMetadataChanges:!1,source:"default"},s=0;typeof e[s]!="object"||g5(e[s])||(t=e[s++]);const o={includeMetadataChanges:t.includeMetadataChanges,source:t.source};if(g5(e[s])){const C=e[s];e[s]=(p=C.next)==null?void 0:p.bind(C),e[s+1]=(x=C.error)==null?void 0:x.bind(C),e[s+2]=(b=C.complete)==null?void 0:b.bind(C)}let l,u,h;if(n instanceof ks)u=ji(n.firestore,_l),h=zg(n._key.path),l={next:C=>{e[s]&&e[s](tj(u,n,C))},error:e[s+1],complete:e[s+2]};else{const C=ji(n,Nl);u=ji(C.firestore,_l),h=C._query;const N=new vv(u);l={next:T=>{e[s]&&e[s](new ku(u,N,C,T))},error:e[s+1],complete:e[s+2]},ZS(n._query)}const f=sx(u);return BF(f,h,o,l)}function ax(n,e){const t=sx(n);return bF(t,e)}function tj(n,e,t){const s=t.docs.get(e._key),o=new vv(n);return new Au(n,o,e._key,s,new im(t.hasPendingWrites,t.fromCache),e.converter)}const x5="@firebase/firestore",b5="4.17.2";(function(e,t=!0){jM($u),zu(new Tc("firestore",((s,{instanceIdentifier:o,options:l})=>{const u=s.getProvider("app").getImmediate(),h=new _l(new $P(s.getProvider("auth-internal")),new QP(u,s.getProvider("app-check-internal")),zM(u,o),u);return l={useFetchStreams:t,...l},h._setSettings(l),h}),"PUBLIC").setMultipleInstances(!0)),No(x5,b5,e),No(x5,b5,"esm2020")})();const Xf=new Map,ZC=new Set,xc=new Map,i1="chatliz_offline_bg_cache",DF="chatliz_media_vault",bc="backgrounds";function nj(){return typeof window>"u"||!window.indexedDB?Promise.resolve(null):new Promise(n=>{try{const e=indexedDB.open(DF,1);e.onupgradeneeded=()=>{const t=e.result;t.objectStoreNames.contains(bc)||t.createObjectStore(bc)},e.onsuccess=()=>n(e.result),e.onerror=()=>n(null)}catch{n(null)}})}async function sj(n){if(!n||typeof n!="string")return null;const e=n.trim();if(e.startsWith("data:"))return vo(e),e;if(xc.has(e))return xc.get(e);try{const t=await nj();if(!t)return null;const s=await new Promise(o=>{try{const h=t.transaction(bc,"readonly").objectStore(bc).get(e);h.onsuccess=()=>o(h.result||null),h.onerror=()=>o(null)}catch{o(null)}});if(s instanceof Blob){const o=URL.createObjectURL(s);return xc.set(e,o),vo(e),o}if(navigator.onLine&&(e.startsWith("http://")||e.startsWith("https://"))){const o=await fetch(e,{mode:"cors"}).catch(()=>null);if(o&&o.ok){const l=await o.blob();if(l&&l.size>0){t.transaction(bc,"readwrite").objectStore(bc).put(l,e);const h=URL.createObjectURL(l);return xc.set(e,h),vo(e),h}}}}catch(t){console.warn("[MediaVault] IDB cache note:",t)}return vo(e),null}async function TF(n){if(!n)return sh()||"";if(n.startsWith("data:"))return n;if(xc.has(n))return xc.get(n);try{const e=await nj();if(e){const t=await new Promise(s=>{try{const u=e.transaction(bc,"readonly").objectStore(bc).get(n);u.onsuccess=()=>s(u.result||null),u.onerror=()=>s(null)}catch{s(null)}});if(t instanceof Blob){const s=URL.createObjectURL(t);return xc.set(n,s),s}}}catch{}return n}function vo(n){if(!(!n||typeof n!="string"))try{n.startsWith("data:")&&n.length<2e6?localStorage.setItem(i1,n):n.startsWith("blob:")||localStorage.setItem(i1,n)}catch{}}function sh(){try{return localStorage.getItem(i1)||null}catch{return null}}function _o(n,e=2500){if(!n||typeof n!="string")return Promise.resolve(!1);const t=n.trim();return t?Xf.has(t)||ZC.has(t)||xc.has(t)?Promise.resolve(!0):(sj(t).catch(()=>{}),t.match(/\.(mp4|webm|ogg|mov|m4v|mkv)(\?.*)?$/i)||t.startsWith("data:video/")?new Promise(o=>{let l=!1;const u=setTimeout(()=>{l||(l=!0,ZC.add(t),o(!0))},e);try{const h=document.createElement("video");
2833h.preload="auto",h.muted=!0,h.playsInline=!0;const f=()=>{l||(l=!0,ZC.add(t),clearTimeout(u),o(!0))};h.oncanplay=f,h.oncanplaythrough=f,h.onloadeddata=f,h.onerror=()=>{l||(l=!0,clearTimeout(u),o(!0))},h.src=t,h.load()}catch{clearTimeout(u),o(!0)}}):new Promise(o=>{let l=!1;const u=setTimeout(()=>{l||(l=!0,o(!0))},e);try{const h=new Image;h.decoding="async";const f=()=>{if(!l){if(l=!0,clearTimeout(u),Xf.set(t,h),Xf.size>80){const p=Xf.keys().next().value;p&&Xf.delete(p)}o(!0)}};h.onload=()=>{"decode"in h&&typeof h.decode=="function"?h.decode().then(f).catch(f):f()},h.onerror=()=>{l||(l=!0,clearTimeout(u),o(!0))},h.src=t,h.complete&&h.naturalWidth>0&&f()}catch{clearTimeout(u),o(!0)}})):Promise.resolve(!1)}function SF(n){n.forEach(e=>{e&&_o(e).catch(()=>{})})}function a1(n){let e=n&&typeof n=="string"?n.trim():"";if(!e){const l=sh();l&&typeof l=="string"&&(e=l.trim())}if(!e)return{type:"none",src:"",originalUrl:"",label:"Sin fondo",icon:"ð¨"};const t=/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?|shorts)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/i,s=e.match(t);if(s&&s[1]){const l=s[1],u=`https://www.youtube.com/embed/${l}?autoplay=1&mute=1&loop=1&playlist=${l}&controls=0&showinfo=0&rel=0&modestbranding=1&playsinline=1&iv_load_policy=3&disablekb=1`;return{type:"youtube",src:u,originalUrl:e,embedUrl:u,label:"Video de YouTube (Reproducción Continua)",icon:"â¶ï¸"}}if(/pinimg\.com\/.+\.(mp4|webm|mov)/i.test(e))return{type:"video",src:e,originalUrl:e,label:"Video de Pinterest",icon:"ð"};if(/pinimg\.com\/.+\.(jpg|jpeg|png|gif|webp)/i.test(e))return{type:"image",src:e,originalUrl:e,label:"Imagen de Pinterest",icon:"ð"};const o=e.match(/pinterest\.[a-z.]+\/pin\/(\d+)/i);if(o&&o[1]){const u=`https://assets.pinterest.com/ext/embed.html?id=${o[1]}`;return{type:"pinterest",src:u,originalUrl:e,embedUrl:u,label:"Pin de Pinterest",icon:"ð"}}return/pin\.it\/|pinterest\.com/i.test(e)?{type:"pinterest",src:e,originalUrl:e,embedUrl:e,label:"Página de Pinterest",icon:"ð"}:e.match(/\.(mp4|webm|ogg|mov|m4v|mkv)(\?.*)?$/i)||e.startsWith("data:video/")?{type:"video",src:e,originalUrl:e,label:"Video en Bucle",icon:"ð¬"}:e.match(/\.(jpg|jpeg|png|gif|webp|svg|bmp|ico)(\?.*)?$/i)||e.startsWith("data:image/")||e.startsWith("blob:")||e.includes("images.unsplash.com")||e.includes("api.dicebear.com")||e.includes("i.imgur.com")?{type:"image",src:e,originalUrl:e,label:"Imagen / GIF de Fondo",icon:"ð¼ï¸"}:e.startsWith("http://")||e.startsWith("https://")?{type:"webpage",src:e,originalUrl:e,embedUrl:e,label:"Sitio Web / Página en Vivo",icon:"ð"}:{type:"image",src:e,originalUrl:e,label:"Fondo Personalizado",icon:"ð¨"}}function rj({url:n,opacity:e=.75,className:t="",enableSound:s=!1,isContainer:o=!0}){const l=y.useMemo(()=>a1(n),[n]),[u,h]=y.useState(l),[f,p]=y.useState(l.src),[x,b]=y.useState(!0),C=y.useRef(null),[N,T]=y.useState(()=>{if(s)return!1;const H=localStorage.getItem("chatliz_bg_muted");return H===null?!0:H==="true"});y.useEffect(()=>{let H=!0;return l.src&&(TF(l.src).then(Q=>{H&&Q&&Q!==f&&p(Q)}),sj(l.src).catch(()=>{})),()=>{H=!1}},[l.src]),y.useEffect(()=>{if(!l.src||l.type==="none"){const Q=sh();Q&&h(a1(Q));return}let H=!0;return _o(l.src).then(()=>{H&&(h(l),b(!0),vo(l.src))}).catch(()=>{H&&(h(l),b(!0))}),()=>{H=!1}},[l]);const R=u,A=f||R.src;y.useEffect(()=>{const H=C.current;if(!H||R.type!=="video")return;H.loop=!0,H.playsInline=!0,H.muted=N,(async()=>{try{await H.play()}catch{H.muted=!0;try{await H.play()}catch{}}})()},[A,R.type,N]);const U=H=>{H.stopPropagation();const Q=!N;T(Q),localStorage.setItem("chatliz_bg_muted",String(Q)),C.current&&(C.current.muted=Q,Q||(C.current.volume=.8,C.current.play().catch(()=>{})))};if((R.type==="none"||!A)&&!sh())return null;const M=R.type==="video"||R.type==="youtube",V=o?`absolute inset-0 w-full h-full pointer-events-none overflow-hidden select-none z-0 transition-opacity duration-500 ease-in-out ${t}`:`fixed inset-0 w-screen h-screen min-w-full min-h-full pointer-events-none overflow-hidden select-none z-0 transition-opacity duration-700 ease-in-out ${t}`;return i.jsxs("div",{className:V,style:{opacity:e},children:[R.type==="youtube"&&i.jsx("div",{className:`absolute inset-0 w-full h-full flex items-center justify-center overflow-hidden transition-opacity duration-300 ${x?"opacity-100":"opacity-80"}`,children:i.jsx("iframe",{src:`${R.src}&mute=${N?1:0}
2833`,title:"Chat-Liz Background Video",className:"w-full h-full border-0 pointer-events-none object-cover",allow:"autoplay; encrypted-media; picture-in-picture",tabIndex:-1,onLoad:()=>b(!0)})}),R.type==="video"&&i.jsx("video",{ref:C,autoPlay:!0,loop:!0,playsInline:!0,muted:N,preload:"auto",src:A,className:`absolute inset-0 w-full h-full object-cover min-w-full min-h-full transition-opacity duration-300 ${x?"opacity-100":"opacity-80"}`,onCanPlay:()=>{b(!0),vo(A)},onLoadedData:()=>{b(!0),vo(A)},onEnded:H=>{try{H.currentTarget.currentTime=0,H.currentTarget.play()}catch{}},onError:H=>{const Q=sh();Q&&Q!==A&&(H.currentTarget.src=Q),b(!0)}}),R.type==="image"&&i.jsx("div",{className:"absolute inset-0 w-full h-full overflow-hidden transition-opacity duration-300 opacity-100",children:i.jsx("img",{src:A,alt:"Fondo Chat-Liz",loading:"eager",decoding:"async",referrerPolicy:"no-referrer",className:"w-full h-full object-cover min-w-full min-h-full pointer-events-none select-none",onLoad:()=>{b(!0),vo(A)},onError:H=>{const Q=sh();Q&&Q!==A&&(H.currentTarget.src=Q),b(!0)}})}),(R.type==="pinterest"||R.type==="webpage")&&i.jsx("div",{className:"absolute inset-0 w-full h-full overflow-hidden transition-opacity duration-300 opacity-100",children:i.jsx("iframe",{src:R.src,title:"Chat-Liz Background Page",className:"w-full h-full border-0 pointer-events-none object-cover",sandbox:"allow-scripts allow-same-origin",loading:"eager",onLoad:()=>b(!0)})}),M&&i.jsx("div",{className:"absolute bottom-4 right-4 pointer-events-auto z-30",children:i.jsx("button",{type:"button",onClick:U,className:"bg-black/70 hover:bg-black/90 text-white/90 hover:text-white p-2.5 rounded-full border border-white/20 backdrop-blur-md shadow-lg transition-transform active:scale-95 flex items-center gap-2 text-xs",title:N?"Activar sonido del fondo":"Silenciar fondo",children:N?i.jsxs(i.Fragment,{children:[i.jsx(jg,{size:16,className:"text-red-400"}),i.jsx("span",{className:"hidden sm:inline font-mono font-medium",children:"Fondo Mudo"})]}):i.jsxs(i.Fragment,{children:[i.jsx(xl,{size:16,className:"text-cyan-400 animate-pulse"}),i.jsx("span",{className:"hidden sm:inline font-mono font-medium",children:"Sonido ON"})]})})})]})}const ym=[{id:"futuristic_neon",name:"Cyberpunk Neón 2077",desc:"Bordes electroluminiscentes con pulso de energÃa y resplandor cian/magenta",icon:"â¡",category:"futurista",badge:"ANIMADO",bubbleClass:"bubble-futuristic-neon backdrop-blur-md transition-all duration-300",myBubbleClass:"bg-cyan-950/40 border border-cyan-400/80 shadow-[0_0_15px_rgba(6,182,212,0.45)] text-cyan-100 rounded-2xl rounded-tr-sm",otherBubbleClass:"bg-purple-950/40 border border-purple-400/80 shadow-[0_0_15px_rgba(168,85,247,0.45)] text-purple-100 rounded-2xl rounded-tl-sm"},{id:"hologram_scifi",name:"Holograma Sci-Fi HUD",desc:"Visor holográfico táctico con scanlines sutiles y brackets angulares",icon:"ð¸",category:"futurista",badge:"HUD",bubbleClass:"bubble-hologram-hud backdrop-blur-lg relative overflow-hidden transition-all duration-300",myBubbleClass:"bg-blue-950/50 border-2 border-cyan-400/60 shadow-[inset_0_0_12px_rgba(6,182,212,0.3),0_0_15px_rgba(6,182,212,0.25)] text-cyan-100 rounded-lg",otherBubbleClass:"bg-slate-950/60 border-2 border-blue-400/60 shadow-[inset_0_0_12px_rgba(59,130,246,0.3),0_0_15px_rgba(59,130,246,0.25)] text-blue-100 rounded-lg"},{id:"matrix_terminal",name:"Matrix Terminal Hacker",desc:"Fósforo verde de terminal CRT, cursor parpadeante y código cibernético",icon:"ð»",category:"futurista",badge:"RETRO SCI-FI",bubbleClass:"bubble-matrix-terminal font-mono backdrop-blur-md transition-all duration-300",myBubbleClass:"bg-black/85 border border-emerald-500/80 shadow-[0_0_12px_rgba(16,185,129,0.4)] text-emerald-300 rounded-md",otherBubbleClass:"bg-black/85 border border-emerald-700/80 shadow-[0_0_10px_rgba(16,185,129,0.25)] text-emerald-400 rounded-md"},{id:"vintage_parchment",name:"Pergamino Medieval",desc:"Papiro añejo con bordes dorados gastados y suave brillo de vela",icon:"ð",category:"antiguo",badge:"CLÃSICO",bubbleClass:"bubble-vintage-parchment font-serif backdrop-blur-sm transition-all duration-300",myBubbleClass:"bg-gradient-to-br from-[#2a2118]/95 to-[#1c150e]/95 border border-[#c29b62]/60 shadow-[0_4px_20px_rgba(0,0,0,0.6),inset_0_0_15px_rgba(194,155,98,0.15)] text-[#f4ecd8] rounded-xl rounded-tr-none",otherBubbleClass:"bg-gradient-to-br from-[#201811]/95 to-[#150f0a]/95 border border-[#8f7042]/50 shadow-[0_4px_20px_rgba(0,0,0,0.6),inset_0_0_15px_rgba(143,112,66,0.15)] text-[#e8dfcb] rounded-xl rounded-tl-none"},{id:"steampunk_bronze",name:"Steampunk Mecánico",desc:"Bronce fundido victoriano con remaches de latón y sombras metálicas",icon:"âï¸",category:"antiguo",badge:"VINTAGE",bubbleClass:"bubble-steampunk-bronze backdrop-blur-md transition-all duration-300",myBubbleClass:"bg-gradient-to-r from-[#332211]/90 to-[#442c16]/90 border-2 border-[#d97706]/70 shadow-[0_0_15px_rgba(217,119,6,0.35)] text-amber-100 rounded-2xl",otherBubbleClass:"bg-gradient-to-r from-[#221810]/90 to-[#2e1d10]/90 border-2 border-[#b45309]/60 shadow-[0_0_12px_rgba(180,83,9,0.25)] text-amber-200/90 rounded-2xl"},{id:"royal_gold",name:"Oro Real Barroco",desc:"Foil de oro de 24k con filigrana regia y resplandor áureo dinámico",icon:"ð",category:"antiguo",badge:"LUJO IMPERIAL",bubbleClass:"bubble-royal-gold backdrop-blur-md transition-all duration-300",myBubbleClass:"bg-gradient-to-br from-[#2c1f0d]/90 via-[#1c1407]/90 to-[#2c1f0d]/90 border-2 border-yellow-400/80 shadow-[0_0_20px_rgba(250,204,21,0.35),inset_0_0_10px_rgba(250,204,21,0.2)] text-amber-100 rounded-2xl",otherBubbleClass:"bg-gradient-to-br from-[#1e1509]/90 to-[#120d05]/90 border-2 border-yellow-600/70 shadow-[0_0_15px_rgba(202,138,4,0.25)] text-amber-200/90 rounded-2xl"},{id:"comic_popart",name:"Pop-Art Cómic / Manga",desc:"Borde negro hiper-
2833definido estilo viñeta cómic con sombra sólida 3D",icon:"ð¥",category:"artistico",badge:"CÃMIC",bubbleClass:"bubble-comic-popart font-bold transition-transform duration-200 active:scale-95",myBubbleClass:"bg-yellow-400 border-[3px] border-black shadow-[4px_4px_0px_#000] text-black rounded-2xl rounded-tr-xs",otherBubbleClass:"bg-white border-[3px] border-black shadow-[4px_4px_0px_#000] text-black rounded-2xl rounded-tl-xs"},{id:"pixel_arcade",name:"Pixel Art Arcade 8-Bit",desc:"Estilo retro-gaming de máquina recreativa de los 80s con bordes pixel",icon:"ð¾",category:"artistico",badge:"8-BIT",bubbleClass:"bubble-pixel-arcade font-mono transition-all duration-200",myBubbleClass:"bg-[#1f1b2e] border-4 border-indigo-400 shadow-[4px_4px_0px_#4f46e5] text-indigo-100 rounded-none",otherBubbleClass:"bg-[#181622] border-4 border-fuchsia-400 shadow-[4px_4px_0px_#c026d3] text-fuchsia-100 rounded-none"},{id:"aurora_cosmic",name:"Aurora Boreal Cósmica",desc:"Gradiente boreal iridiscente en movimiento continuo como las auroras polares",icon:"ð",category:"animado",badge:"ANIMACIÃN VIVA",bubbleClass:"bubble-aurora-cosmic backdrop-blur-xl relative overflow-hidden transition-all duration-500",myBubbleClass:"bg-slate-950/70 border border-teal-400/80 shadow-[0_0_20px_rgba(45,212,191,0.35)] text-teal-50 rounded-2xl",otherBubbleClass:"bg-slate-950/70 border border-violet-400/80 shadow-[0_0_20px_rgba(167,139,250,0.35)] text-violet-50 rounded-2xl"},{id:"kawaii_pastel",name:"Kawaii Bouncy Nube",desc:"Burbuja de algodón de azúcar con rebote suave y colores pastel tiernos",icon:"â¨",category:"animado",badge:"BOUNCY",bubbleClass:"bubble-kawaii-bouncy backdrop-blur-md transition-all duration-300",myBubbleClass:"bg-gradient-to-r from-pink-500/25 via-purple-500/25 to-pink-500/25 border-2 border-pink-300/60 shadow-[0_0_15px_rgba(244,114,182,0.35)] text-pink-100 rounded-3xl",otherBubbleClass:"bg-gradient-to-r from-purple-500/20 via-pink-500/20 to-purple-500/20 border-2 border-purple-300/50 shadow-[0_0_12px_rgba(192,132,252,0.3)] text-purple-100 rounded-3xl"},{id:"bubble_soap",name:"Burbuja de Jabón Irisada",desc:"Cápsula esférica translúcida con destellos de arcoÃris y ligereza visual",icon:"ð«§",category:"animado",badge:"FLOTANTE",bubbleClass:"bubble-soap-effect backdrop-blur-md transition-all duration-300",myBubbleClass:"bg-cyan-500/10 border border-cyan-300/40 shadow-[0_0_20px_rgba(6,182,212,0.3),inset_0_0_15px_rgba(255,255,255,0.2)] text-white rounded-[26px]",otherBubbleClass:"bg-white/10 border border-white/30 shadow-[0_0_15px_rgba(255,255,255,0.2),inset_0_0_15px_rgba(255,255,255,0.15)] text-white rounded-[26px]"},{id:"glass_crystal",name:"Cristal Prisma LÃquido",desc:"Efecto vidrio esmerilado de alta refracción con borde brillante pulido",icon:"ð",category:"minimalista",badge:"CRISTAL",bubbleClass:"backdrop-blur-xl transition-all duration-300",myBubbleClass:"bg-white/[0.12] border border-white/30 shadow-[0_8px_32px_rgba(0,0,0,0.37),inset_0_0_10px_rgba(255,255,255,0.15)] text-white rounded-2xl rounded-tr-sm",otherBubbleClass:"bg-white/[0.07] border border-white/15 shadow-[0_8px_32px_rgba(0,0,0,0.37)] text-white/90 rounded-2xl rounded-tl-sm"},{id:"dark_obsidian",name:"Obsidiana Minimalista",desc:"Negro carbón mate de alta gama con un sutil halo violeta profundo",icon:"ð¤",category:"minimalista",badge:"PREMIUM",bubbleClass:"backdrop-blur-md transition-all duration-300",myBubbleClass:"bg-[#0b0c10]/90 border border-white/10 shadow-[0_4px_20px_rgba(0,0,0,0.8)] text-gray-200 rounded-2xl",otherBubbleClass:"bg-[#07080a]/90 border border-white/5 shadow-[0_4px_20px_rgba(0,0,0,0.8)] text-gray-300 rounded-2xl"},{id:"rounded",name:"Cápsula Ultra-Moderna",desc:"Diseño ergonómico curvado tipo pÃldora con micro-sombras fluidas",icon:"ð",category:"minimalista",bubbleClass:"backdrop-blur-sm transition-all duration-300",myBubbleClass:"bg-cyan-500/20 border border-cyan-500/40 text-cyan-50 rounded-full px-5 py-2.5",otherBubbleClass:"bg-white/10 border border-white/15 text-white/90 rounded-full px-5 py-2.5"},{id:"default",name:"Moderno Suave",desc:"Bordes redondeados equilibrados con sombra sutil y excelente legibilidad",icon:"ð±",category:"minimalista",bubbleClass:"backdrop-blur-sm transition-all duration-300",myBubbleClass:"bg-cyan-500/15 border border-cyan-500/30 text-white rounded-[20px] rounded-tr-[4px]",otherBubbleClass:"bg-white/5 border border-white/10 text-white/90 rounded-[20px] rounded-tl-[4px]"}];function jF(n){const e=n.trim();return ym.find(t=>
2833t.id===e)||ym[ym.length-1]}const AF=ym,kF=[{name:"Galaxia Neón",url:"https://images.unsplash.com/photo-1506703719100-a0f3a48c0f86?w=1200&auto=format&fit=crop&q=80",thumb:"https://images.unsplash.com/photo-1506703719100-a0f3a48c0f86?w=300&auto=format&fit=crop&q=80"},{name:"Cyberpunk City",url:"https://images.unsplash.com/photo-1518709268805-4e9042af9f23?w=1200&auto=format&fit=crop&q=80",thumb:"https://images.unsplash.com/photo-1518709268805-4e9042af9f23?w=300&auto=format&fit=crop&q=80"},{name:"Espacio Estelar",url:"https://images.unsplash.com/photo-1538370965046-79c0d6907d47?w=1200&auto=format&fit=crop&q=80",thumb:"https://images.unsplash.com/photo-1538370965046-79c0d6907d47?w=300&auto=format&fit=crop&q=80"},{name:"Sakura Anime",url:"https://images.unsplash.com/photo-1522383225653-ed111181a951?w=1200&auto=format&fit=crop&q=80",thumb:"https://images.unsplash.com/photo-1522383225653-ed111181a951?w=300&auto=format&fit=crop&q=80"},{name:"Dark Minimal",url:"https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=1200&auto=format&fit=crop&q=80",thumb:"https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=300&auto=format&fit=crop&q=80"},{name:"Olas Violetas",url:"https://images.unsplash.com/photo-1579546929518-9e396f3cc809?w=1200&auto=format&fit=crop&q=80",thumb:"https://images.unsplash.com/photo-1579546929518-9e396f3cc809?w=300&auto=format&fit=crop&q=80"}],RF=[{id:"globe",icon:"ðª",label:"Planeta"},{id:"crown",icon:"ð",label:"Corona"},{id:"fire",icon:"ð¥",label:"Fuego"},{id:"zap",icon:"â¡",label:"Rayo"},{id:"diamond",icon:"ð",label:"Diamante"},{id:"sakura",icon:"ð¸",label:"Sakura"},{id:"gaming",icon:"ð®",label:"Gaming"},{id:"shield",icon:"ð¡ï¸",label:"Escudo"},{id:"rocket",icon:"ð",label:"Cohete"},{id:"music",icon:"ð§",label:"Música"},{id:"heart",icon:"ð",label:"Corazón"},{id:"bot",icon:"ð¤",label:"Cyberbot"},{id:"star",icon:"â",label:"Estrella"},{id:"magic",icon:"ð®",label:"Mágico"}],IF=[{id:"cyan",name:"Cian Neón",bgClass:"bg-cyan-500",borderClass:"border-cyan-400",glow:"shadow-[0_0_15px_rgba(6,182,212,0.4)]"},{id:"purple",name:"Violeta MÃstico",bgClass:"bg-purple-500",borderClass:"border-purple-400",glow:"shadow-[0_0_15px_rgba(168,85,247,0.4)]"},{id:"emerald",name:"Esmeralda Matrix",bgClass:"bg-emerald-500",borderClass:"border-emerald-400",glow:"shadow-[0_0_15px_rgba(16,185,129,0.4)]"},{id:"pink",name:"Rosa Neón",bgClass:"bg-pink-500",borderClass:"border-pink-400",glow:"shadow-[0_0_15px_rgba(236,72,153,0.4)]"},{id:"amber",name:"Ãmbar Solar",bgClass:"bg-amber-500",borderClass:"border-amber-400",glow:"shadow-[0_0_15px_rgba(245,158,11,0.4)]"},{id:"red",name:"Rojo CarmesÃ",bgClass:"bg-red-500",borderClass:"border-red-400",glow:"shadow-[0_0_15px_rgba(239,68,68,0.4)]"},{id:"blue",name:"Azul Zafiro",bgClass:"bg-blue-500",borderClass:"border-blue-400",glow:"shadow-[0_0_15px_rgba(59,130,246,0.4)]"}],OF=({isOpen:n,onClose:e,chatId:t,chatTitle:s,isGlobal:o,currentConfig:l,onSaveConfig:u,onResetConfig:h,onOpenSyncToAxis:f})=>{const[p,x]=y.useState("wallpaper"),[b,C]=y.useState((l==null?void 0:l.backgroundBase64)||(l==null?void 0:l.backgroundUrl)||""),[N,T]=y.useState(""),[R,A]=y.useState((l==null?void 0:l.icon)||""),[U,M]=y.useState(""),[V,H]=y.useState((l==null?void 0:l.theme)||"cyan"),[Q,Y]=y.useState((l==null?void 0:l.title)||""),[k,E]=y.useState((l==null?void 0:l.statusMessage)||""),[j,P]=y.useState((l==null?void 0:l.bubbleStyle)||"default"),[O,F]=y.useState((l==null?void 0:l.autoCleanMode)||"disabled"),[S,be]=y.useState(!1),[Ee,me]=y.useState(!1),[De,ge]=y.useState(!1),[Ue,we]=y.useState("");if(!n)return null;const $e=ne=>{var mt;const Pe=(mt=ne.target.files)==null?void 0:mt[0];if(!Pe)return;if(we(""),Pe.size>10*1024*1024){we("El archivo no debe exceder 10MB.");return}ge(!0);const Le=new FileReader;Le.onload=async tt=>{var Qe;const lt=(Qe=tt.target)==null?void 0:Qe.result;lt&&(C(lt),await _o(lt).catch(()=>{})),ge(!1)},Le.onerror=()=>{ge(!1),we("Error al leer el archivo. Intenta con otra imagen o GIF.")},Le.readAsDataURL(Pe)},et=async()=>{if(!N.trim())return;const ne=N.trim();we(""),ge(!0),C(ne),T(""),await _o(ne).catch(()=>{}),ge(!1)},Ae=async()=>{be(!0);
2833try{b&&await _o(b).catch(()=>{});const ne={backgroundBase64:b||"",backgroundUrl:b||"",icon:U.trim()||R||"",theme:V,title:Q.trim()||(o?"Chat Global":s),statusMessage:k.trim(),bubbleStyle:j,autoCleanMode:O,updatedAt:new Date().toISOString()};await u(ne),me(!0),setTimeout(()=>{me(!1),e()},700)}catch(ne){console.error("Error saving chat config:",ne)}finally{be(!1)}},K=async()=>{if(window.confirm("¿Seguro que deseas restablecer la configuración del chat a los valores por defecto?")){be(!0);try{await h(),C(""),A(""),M(""),H("cyan"),Y(""),E(""),P("default"),me(!0),setTimeout(()=>{me(!1),e()},700)}catch(ne){console.error("Error resetting chat config:",ne)}finally{be(!1)}}};return i.jsx("div",{id:"chat-customizer-modal-overlay",className:"fixed inset-0 bg-black/85 backdrop-blur-md z-50 flex items-center justify-center p-3 sm:p-4 animate-in fade-in duration-200",onClick:ne=>{ne.target===ne.currentTarget&&e()},children:i.jsxs("div",{id:"chat-customizer-modal-container",className:"bg-[#0f172a] border border-cyan-500/30 rounded-3xl w-full max-w-lg overflow-hidden flex flex-col shadow-[0_0_50px_rgba(6,182,212,0.2)] relative max-h-[90vh] text-white",children:[i.jsxs("div",{className:"p-4 border-b border-white/10 flex justify-between items-center bg-gradient-to-r from-cyan-500/10 via-purple-500/10 to-transparent",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-gradient-to-br from-cyan-500/20 to-purple-500/20 border border-cyan-500/40 flex items-center justify-center text-cyan-400 shadow-inner",children:i.jsx(ko,{size:22})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"text-lg sm:text-xl font-bold text-white flex items-center gap-2 leading-tight",children:[o?"Personalizar Chat Global":`Personalizar Chat con ${s}`,i.jsx("span",{className:"text-[10px] bg-cyan-500/20 text-cyan-300 px-2 py-0.5 rounded-full border border-cyan-500/30 uppercase tracking-wider font-semibold",children:"Sincronizado"})]}),i.jsx("p",{className:"text-xs text-white/50",children:o?"Los cambios se aplican y sincronizan al instante para toda la sala.":"Los cambios se aplican automáticamente en ambas pantallas del chat."})]})]}),i.jsx("button",{id:"btn-close-chat-customizer",onClick:e,className:"text-white/60 hover:text-white transition-colors bg-white/5 hover:bg-white/10 p-2 rounded-xl border border-white/10",title:"Cerrar",children:i.jsx(Kt,{size:18})})]}),i.jsxs("div",{className:"flex border-b border-white/10 px-3 pt-2 bg-black/20 gap-1 overflow-x-auto scrollbar-none",children:[i.jsxs("button",{id:"tab-customizer-wallpaper",onClick:()=>x("wallpaper"),className:`flex items-center gap-1.5 px-3.5 py-2.5 rounded-t-xl text-xs sm:text-sm font-semibold transition-all border-b-2 whitespace-nowrap ${p==="wallpaper"?"border-cyan-400 text-cyan-300 bg-cyan-500/10":"border-transparent text-white/60 hover:text-white hover:bg-white/5"}`,children:[i.jsx(Lu,{size:16}),"Fondo"]}),i.jsxs("button",{id:"tab-customizer-icon",onClick:()=>x("icon"),className:`flex items-center gap-1.5 px-3.5 py-2.5 rounded-t-xl text-xs sm:text-sm font-semibold transition-all border-b-2 whitespace-nowrap ${p==="icon"?"border-cyan-400 text-cyan-300 bg-cyan-500/10":"border-transparent text-white/60 hover:text-white hover:bg-white/5"}`,children:[i.jsx(kD,{size:16}),"Ãcono / Emblema"]}),i.jsxs("button",{id:"tab-customizer-theme",onClick:()=>x("theme"),className:`flex items-center gap-1.5 px-3.5 py-2.5 rounded-t-xl text-xs sm:text-sm font-semibold transition-all border-b-2 whitespace-nowrap ${p==="theme"?"border-cyan-400 text-cyan-300 bg-cyan-500/10":"border-transparent text-white/60 hover:text-white hover:bg-white/5"}`,children:[i.jsx(Fs,{size:16}),"Color & Estilo"]}),i.jsxs("button",{id:"tab-customizer-details",onClick:()=>x("details"),className:`flex items-center gap-1.5 px-3.5 py-2.5 rounded-t-xl text-xs sm:text-sm font-semibold transition-all border-b-2 whitespace-nowrap ${p==="details"?"border-cyan-400 text-cyan-300 bg-cyan-500/10":"border-transparent text-white/60 hover:text-white hover:bg-white/5"}`,children:[i.jsx(SD,{size:16}),"Detalles"]})]}),i.jsxs("div",{className:"p-4 overflow-y-auto space-y-4 flex-1 scrollbar-thin",children:[p==="wallpaper"&&i.jsxs("div",{className:"space-y-4 animate-in fade-in duration-150",children:[i.jsxs("div",{children:[i.jsxs("label",{className:"block text-xs font-semibold uppercase tracking-wider text-cyan-300 mb-2 flex items-center justify-between",children:[i.jsx("span",{children:"Vista Previa del Fondo"}),De&&i.jsxs("span",{className:"text-cyan-400 text-[11px] font-normal flex items-center gap-1.5 animate-pulse",children:[i.jsx(ah,{size:12,className:"animate-spin"}),"Optimizando medio..."]})]}),i.jsxs("div",{className:"relative w-full h-36 rounded-2xl border border-white/15 overflow-hidden bg-[#090d16] flex items-center justify-center group shadow-inner",children:[De&&i.jsxs("div",{className:"absolute inset-0 z-30 flex flex-col items-center justify-center bg-black/75 backdrop-blur-sm pointer-events-none animate-in fade-in duration-150",children:[i.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2 rounded-xl bg-cyan-950/80 border border-cyan-500/50 text-cyan-300 text-xs font-semibold shadow-[0_0_15px_rgba(6,182,212,0.3)]",children:[i.jsx(ah,{size:15,className:"animate-spin text-cyan-400"}),i.jsx("span",{children:"Pre-cargando y optimizando fondo..."})]}),i.jsx("div",{className:"w-32 h-1 bg-white/10 rounded-full mt-2.5 overflow-hidden",children:i.jsx("div",{className:"h-full bg-gradient-to-r from-cyan-400 to-blue-500 rounded-full animate-pulse w-2/3"})})]}),b?i.jsx(rj,{url:b,opacity:.85,isContainer:!0,className:"absolute inset-0 w-full h-full object-cover"}):i.jsxs("div",{className:"text-center text-white/40 flex flex-col items-center",children:[i.jsx(Lu,{size:32,className:"mb-1 opacity-50"}),i.jsx("span",{className:"text-xs",children:"Sin fondo personalizado (se usa el predeterminado)"})]}),b&&!De&&i.jsx("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:i.jsxs("button",{onClick:()=>C(""),className:"bg-red-500/80 hover:bg-red-500 text-white text-xs font-bold px-3 py-1.5 rounded-xl transition-all shadow-md flex items-center gap-1",children:[i.jsx(Kt,{size:14})," Quitar Fondo"]})})]})]}),Ue&&i.jsxs("div",{className:"p-2.5 rounded-xl bg-red-500/15 border border-red-500/40 text-red-300 text-xs flex items-center gap-2 animate-in fade-in",children:[i.jsx(tp,{size:15,className:"flex-shrink-0 text-red-400"}),i.jsx("span",{children:Ue})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[i.jsxs("div",{className:"bg-white/5 border border-white/10 p-3 rounded-2xl",children:[i.jsxs("label",{className:"block text-xs font-bold text-white mb-1.5 flex items-center gap-1.5",children:[i.jsx(Mu,{size:14,className:"text-cyan-400"})," Subir desde dispositivo"]}),i.jsx("input",{id:"input-file-chat-bg",type:"file",accept:"image/*,video/mp4,video/webm",onChange:$e,className:"w-full text-xs text-gray-300 file:mr-2 file:py-1.5 file:px-3 file:rounded-xl file:border-0 file:text-xs file:font-bold file:bg-cyan-500/20 file:text-cyan-300 hover:file:bg-cyan-500/30 cursor-pointer"}),i.jsx("p",{className:"text-[10px] text-white/40 mt-1",children:"Imágenes (PNG, JPG, GIF) o videos MP4/WEBM."})]}),i.jsxs("div",{className:"bg-white/5 border border-white/10 p-3 rounded-2xl",children:[i.jsxs("label",{className:"block text-xs font-bold text-white mb-1.5 flex items-center gap-1.5",children:[i.jsx(kE,{size:14,className:"text-cyan-400"})," Pegar enlace web (URL)"]}),i.jsxs("div",{className:"flex gap-1.5",children:[i.jsx("input",{id:"input-url-chat-bg",type:"url",placeholder:"https://...",value:N,onChange:ne=>T(ne.target.value),onKeyDown:ne=>{ne.key==="Enter"&&et()},className:"flex-1 bg-black/40 border border-white/15 rounded-xl px-2.5 py-1.5 text-xs text-white placeholder-white/30 focus:outline-none focus:border-cyan-400"}),i.jsx("button",{onClick:et,disabled:De,className:"bg-cyan-500/20 hover:bg-cyan-500/30 disabled:opacity-50 text-cyan-300 px-3 py-1.5 rounded-xl text-xs font-bold border border-cyan-500/30 transition-all",children:De?i.jsx(ah,{size:12,className:"animate-spin"}):"OK"})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold uppercase tracking-wider text-cyan-300 mb-2",children:"GalerÃa de Fondos Populares"}),i.jsx("div",{className:"grid grid-cols-3 gap-2",children:kF.map(ne=>i.jsxs("button",{onClick:async()=>{ge(!0),C(ne.url),await _o(ne.url).catch(()=>{}),ge(!1)},className:`relative h-18 rounded-xl overflow-hidden border transition-all text-left group ${b===ne.url?"border-cyan-400 ring-2 ring-cyan-400/40 scale-[1.02]":"border-white/10 hover:border-cyan-400/50 opacity-80 hover:opacity-100"}`,children:[i.jsx("img",{src:ne.thumb,alt:ne.name,loading:"lazy",className:"w-full h-full object-cover"}),i.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-trans
2833parent to-transparent flex items-end p-1.5",children:i.jsx("span",{className:"text-[10px] font-bold text-white truncate drop-shadow-md",children:ne.name})}),b===ne.url&&i.jsx("div",{className:"absolute top-1 right-1 w-4 h-4 rounded-full bg-cyan-400 text-black flex items-center justify-center",children:i.jsx(Jr,{size:10,strokeWidth:3})})]},ne.name))})]})]}),p==="icon"&&i.jsxs("div",{className:"space-y-4 animate-in fade-in duration-150",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold uppercase tracking-wider text-cyan-300 mb-1",children:"Ãcono o Emblema del Chat"}),i.jsx("p",{className:"text-xs text-white/50 mb-3",children:"Este Ãcono aparecerá en la cabecera de la conversación para todos los participantes."}),i.jsx("div",{className:"grid grid-cols-7 sm:grid-cols-7 gap-2",children:RF.map(ne=>{const Pe=R===ne.icon&&!U;return i.jsx("button",{type:"button",onClick:()=>{A(ne.icon),M("")},className:`h-12 rounded-2xl flex flex-col items-center justify-center text-xl transition-all border ${Pe?"bg-cyan-500/20 border-cyan-400 shadow-[0_0_12px_rgba(6,182,212,0.4)] scale-105":"bg-white/5 border-white/10 hover:bg-white/10 hover:border-white/20"}`,title:ne.label,children:i.jsx("span",{children:ne.icon})},ne.id)})})]}),i.jsxs("div",{className:"bg-white/5 border border-white/10 p-3.5 rounded-2xl space-y-2",children:[i.jsxs("label",{className:"block text-xs font-bold text-white flex items-center gap-1.5",children:[i.jsx(kE,{size:14,className:"text-cyan-400"})," O usa una imagen personalizada para el Ãcono"]}),i.jsx("input",{id:"input-custom-icon-url",type:"url",placeholder:"https://ejemplo.com/icono.png",value:U,onChange:ne=>{M(ne.target.value),ne.target.value&&A("")},className:"w-full bg-black/40 border border-white/15 rounded-xl px-3 py-2 text-xs text-white placeholder-white/30 focus:outline-none focus:border-cyan-400"}),i.jsx("p",{className:"text-[10px] text-white/40",children:"Pega el enlace directo a una imagen cuadrada (PNG, JPG o GIF)."})]}),i.jsxs("div",{className:"p-3 bg-cyan-950/20 border border-cyan-500/20 rounded-2xl flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 rounded-2xl bg-gradient-to-br from-cyan-500/20 to-purple-500/20 border border-cyan-400/40 flex items-center justify-center text-2xl shadow-sm overflow-hidden",children:U?i.jsx("img",{src:U,alt:"Ãcono",className:"w-full h-full object-cover"}):i.jsx("span",{children:R||(o?"ðª":"ð¬")})}),i.jsxs("div",{children:[i.jsx("span",{className:"text-xs font-bold text-white block",children:"Emblema Seleccionado"}),i.jsx("span",{className:"text-[11px] text-cyan-300",children:"Visible en la barra superior del chat en tiempo real."})]})]})]}),p==="theme"&&i.jsxs("div",{className:"space-y-4 animate-in fade-in duration-150",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold uppercase tracking-wider text-cyan-300 mb-2",children:"Paleta de Color y Acento"}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2.5",children:IF.map(ne=>{const Pe=V===ne.id;return i.jsxs("button",{type:"button",onClick:()=>H(ne.id),className:`p-3 rounded-2xl border flex items-center gap-2.5 transition-all text-left ${Pe?`border-cyan-400 bg-white/10 ${ne.glow}`:"border-white/10 bg-white/5 hover:bg-white/10"}`,children:[i.jsx("span",{className:`w-5 h-5 rounded-full ${ne.bgClass} shadow-sm flex-shrink-0 flex items-center justify-center`,children:Pe&&i.jsx(Jr,{size:12,className:"text-white",strokeWidth:3})}),i.jsx("span",{className:"text-xs font-bold text-white truncate",children:ne.name})]},ne.id)})})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold uppercase tracking-wider text-cyan-300 mb-2",children:"Estilo de Burbuja de Mensajes (Animaciones & Diseños)"}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 max-h-60 overflow-y-auto pr-1",children:AF.map(ne=>i.jsxs("button",{type:"button",onClick:()=>P(ne.id),className:`p-2.5 rounded-xl border text-left transition-all ${j===ne.id?"border-cyan-400 bg-cyan-500/15 shadow-[0_0_12px_rgba(6,182,212,0.3)] ring-1 ring-cyan-400":"border-white/10 bg-white/5 hover:bg-white/10"}`,children:[i.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[i.jsx("span",{className:"text-sm",children:ne.icon}),i.jsx("span",{className:"text-xs font-bold text-white truncate",children:ne.name})]}),i.jsx("span",{className:"text-[10px] text-white/50 line-clamp-2 leading-tight block",children:ne.desc})]},ne.id))})]})]}),p==="details"&&i.jsxs("div",{className:"space-y-4 animate-in fade-in duration-150",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold uppercase tracking-wider text-cyan-300 mb-1.5",children:"TÃtulo Personalizado del Chat (Se verá en grande)"}
2833),i.jsx("input",{id:"input-custom-chat-title",type:"text",placeholder:o?"Chat Global":s,value:Q,onChange:ne=>Y(ne.target.value),className:"w-full bg-black/40 border border-white/15 rounded-xl px-3 py-2 text-xs text-white placeholder-white/30 focus:outline-none focus:border-cyan-400"})]}),i.jsxs("div",{children:[i.jsxs("label",{className:"block text-xs font-semibold uppercase tracking-wider text-cyan-300 mb-1.5 flex items-center gap-1.5",children:[i.jsx(Vs,{size:13,className:"text-amber-400"}),"Limpieza Automática de Mensajes"]}),i.jsxs("select",{value:O,onChange:ne=>F(ne.target.value),className:"w-full bg-black/40 border border-white/15 rounded-xl px-3 py-2 text-xs text-white focus:outline-none focus:border-cyan-400",children:[i.jsx("option",{value:"disabled",children:"Desactivada (Conservar historial)"}),i.jsx("option",{value:"1h",children:"Cada 1 Hora (Auto-limpieza)"}),i.jsx("option",{value:"6h",children:"Cada 6 Horas"}),i.jsx("option",{value:"24h",children:"Cada 24 Horas"}),i.jsx("option",{value:"20msgs",children:"Al alcanzar 20 mensajes (Mantener los últimos 20)"}),i.jsx("option",{value:"50msgs",children:"Al alcanzar 50 mensajes (Mantener los últimos 50)"}),i.jsx("option",{value:"100msgs",children:"Al alcanzar 100 mensajes (Mantener los últimos 100)"})]}),i.jsx("p",{className:"text-[10px] text-white/50 mt-1",children:"Permite a los dueños de salas programar purgas automáticas para un chat fluido y sin lag."})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-semibold uppercase tracking-wider text-cyan-300 mb-1.5",children:"Mensaje de Estado o Lema"}),i.jsx("input",{id:"input-custom-chat-status",type:"text",placeholder:"Ej: ¡Bienvenidos a todos! â¨",value:k,onChange:ne=>E(ne.target.value),className:"w-full bg-black/40 border border-white/15 rounded-xl px-3 py-2 text-xs text-white placeholder-white/30 focus:outline-none focus:border-cyan-400"}),i.jsx("p",{className:"text-[10px] text-white/40 mt-1",children:"Se mostrará como subtÃtulo en la cabecera del chat."})]})]})]}),i.jsxs("div",{className:"p-3.5 border-t border-white/10 bg-black/30 flex items-center justify-between gap-2 flex-wrap",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{id:"btn-reset-chat-customizer",type:"button",disabled:S,onClick:K,className:"flex items-center gap-1.5 text-xs font-bold text-red-400 hover:text-red-300 bg-red-500/10 hover:bg-red-500/20 border border-red-500/30 px-3 py-2 rounded-xl transition-all disabled:opacity-50",children:[i.jsx(Sh,{size:14}),"Restablecer"]}),f&&i.jsxs("button",{type:"button",onClick:()=>{e(),f()},className:"flex items-center gap-1.5 text-xs font-bold text-amber-300 hover:text-white bg-amber-500/15 hover:bg-amber-500/25 border border-amber-500/35 px-3 py-2 rounded-xl transition-all shadow-sm",title:"Transferir este aspecto y mejoras a Axis (Chat Principal Li)",children:[i.jsx(Fs,{size:14,className:"text-amber-400"}),i.jsx("span",{children:"Pasar a Chat Li (Axis)"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:e,className:"text-xs font-semibold text-white/70 hover:text-white px-3 py-2.5 rounded-xl transition-colors",children:"Cancelar"}),i.jsx("button",{id:"btn-save-chat-customizer",type:"button",disabled:S,onClick:Ae,className:"flex items-center gap-1.5 text-xs font-bold text-black bg-gradient-to-r from-cyan-400 to-teal-400 hover:from-cyan-300 hover:to-teal-300 px-4 py-2.5 rounded-xl transition-all shadow-[0_0_15px_rgba(6,182,212,0.4)] disabled:opacity-50",children:Ee?i.jsxs(i.Fragment,{children:[i.jsx(Jr,{size:16,className:"animate-bounce"}),"¡Sincronizado!"]}):S?i.jsx("span",{children:"Guardando..."}):i.jsxs(i.Fragment,{children:[i.jsx(Fs,{size:16}),"Guardar y Sincronizar"]})})]})]})]})})};function ij(){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 LF=ij,aj=new np("auth","Firebase",ij());/** 2834 * @license 2835 * Copyright 2020 Google LLC 2836 * 2837 * Licensed under the Apache License, Version 2.0 (the "License");
2838 * you may not use this file except in compliance with the License. 2839 * You may obtain a copy of the License at 2840 * 2841 * http://www.apache.org/licenses/LICENSE-2.0 2842 * 2843 * Unless required by applicable law or agreed to in writing, software 2844 * distributed under the License is distributed on an "AS IS" BASIS, 2845 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2846 * See the License for the specific language governing permissions and 2847 * limitations under the License. 2848 */const fg=new N1("@firebase/auth");function RB(n,...e){fg.logLevel<=Bn.WARN&&fg.warn(`Auth (${$u}): ${n}`,...e)}function IB(n,...e){fg.logLevel<=Bn.ERROR&&fg.error(`Auth (${$u}): ${n}`,...e)}/** 2849 * @license 2850 * Copyright 2020 Google LLC 2851 * 2852 * Licensed under the Apache License, Version 2.0 (the "License"); 2853 * you may not use this file except in compliance with the License. 2854 * You may obtain a copy of the License at 2855 * 2856 * http://www.apache.org/licenses/LICENSE-2.0 2857 * 2858 * Unless required by applicable law or agreed to in writing, software 2859 * distributed under the License is distributed on an "AS IS" BASIS, 2860 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2861 * See the License for the specific language governing permissions and 2862 * limitations under the License. 2863 */function Lo(n,...e){throw Dv(n,...e)}function Fa(n,...e){return Dv(n,...e)}function ox(n,e,t){const s={...LF(),[e]:t};return new np("auth","Firebase",s).create(e,{appName:n.name})}function Dc(n){return ox(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function MF(n,e,t){const s=t;if(!(e instanceof s))throw s.name!==e.constructor.name&&Lo(n,"argument-error"),ox(n,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Dv(n,...e){if(typeof n!="string"){const t=e[0],s=[...e.slice(1)];return s[0]&&(s[0].appName=n.name),n._errorFactory.create(t,...s)}return aj.create(n,...e)}function It(n,e,...t){if(!n)throw Dv(e,...t)}function dl(n){const e="INTERNAL ASSERTION FAILED: "+n;throw IB(e),new Error(e)}function wl(n,e){n||dl(e)}/** 2864 * @license 2865 * Copyright 2020 Google LLC 2866 * 2867 * Licensed under the Apache License, Version 2.0 (the "License"); 2868 * you may not use this file except in compliance with the License. 2869 * You may obtain a copy of the License at 2870 * 2871 * http://www.apache.org/licenses/LICENSE-2.0 2872 * 2873 * Unless required by applicable law or agreed to in writing, software 2874 * distributed under the License is distributed on an "AS IS" BASIS, 2875 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2876 * See the License for the specific language governing permissions and 2877 * limitations under the License. 2878 */function o1(){var n;return typeof self<"u"&&((n=self.location)==null?void 0:n.href)||""}function PF(){return C5()==="http:"||C5()==="https:"}function C5(){var n;return typeof self<"u"&&((n=self.location)==null?void 0:n.protocol)||null}/** 2879 * @license 2880 * Copyright 2020 Google LLC 2881 * 2882 * Licensed under the Apache License, Version 2.0 (the "License"); 2883 * you may not use this file except in compliance with the License. 2884 * You may obtain a copy of the License at 2885 * 2886 * http://www.apache.org/licenses/LICENSE-2.0 2887 * 2888 * Unless required by applicable law or agreed to in writing, software 2889 * distributed under the License is distributed on an "AS IS" BASIS, 2890 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2891 * See the License for the specific language governing permissions and 2892 * limitations under the License. 2893 */function zF(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(PF()||MO()||"connection"in navigator)?navigator.onLine:!0}function FF(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/** 2894 * @license 2895 * Copyright 2020 Google LLC 2896 * 2897 * Licensed under the Apache License, Version 2.0 (the "License"); 2898 * you may not use this file except in compliance with the License. 2899 * You may obtain a copy of the License at 2900 * 2901 * http://www.apache.org/licenses/LICENSE-2.0 2902 * 2903 * Unless required by applicable law or agreed to in writing, softw
2903are 2904 * distributed under the License is distributed on an "AS IS" BASIS, 2905 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2906 * See the License for the specific language governing permissions and 2907 * limitations under the License. 2908 */class mp{constructor(e,t){this.shortDelay=e,this.longDelay=t,wl(t>e,"Short delay should be less than long delay!"),this.isMobile=IO()||PO()}get(){return zF()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** 2909 * @license 2910 * Copyright 2020 Google LLC 2911 * 2912 * Licensed under the Apache License, Version 2.0 (the "License"); 2913 * you may not use this file except in compliance with the License. 2914 * You may obtain a copy of the License at 2915 * 2916 * http://www.apache.org/licenses/LICENSE-2.0 2917 * 2918 * Unless required by applicable law or agreed to in writing, software 2919 * distributed under the License is distributed on an "AS IS" BASIS, 2920 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2921 * See the License for the specific language governing permissions and 2922 * limitations under the License. 2923 */function Tv(n,e){wl(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}/** 2924 * @license 2925 * Copyright 2020 Google LLC 2926 * 2927 * Licensed under the Apache License, Version 2.0 (the "License"); 2928 * you may not use this file except in compliance with the License. 2929 * You may obtain a copy of the License at 2930 * 2931 * http://www.apache.org/licenses/LICENSE-2.0 2932 * 2933 * Unless required by applicable law or agreed to in writing, software 2934 * distributed under the License is distributed on an "AS IS" BASIS, 2935 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2936 * See the License for the specific language governing permissions and 2937 * limitations under the License. 2938 */class oj{static initialize(e,t,s){this.fetchImpl=e,t&&(this.headersImpl=t),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;dl("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;dl("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;dl("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** 2939 * @license 2940 * Copyright 2020 Google LLC 2941 * 2942 * Licensed under the Apache License, Version 2.0 (the "License"); 2943 * you may not use this file except in compliance with the License. 2944 * You may obtain a copy of the License at 2945 * 2946 * http://www.apache.org/licenses/LICENSE-2.0 2947 * 2948 * Unless required by applicable law or agreed to in writing, software 2949 * distributed under the License is distributed on an "AS IS" BASIS, 2950 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2951 * See the License for the specific language governing permissions and 2952 * limitations under the License. 2953 */const VF={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-rec
2953aptcha-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"};/** 2954 * @license 2955 * Copyright 2020 Google LLC 2956 * 2957 * Licensed under the Apache License, Version 2.0 (the "License"); 2958 * you may not use this file except in compliance with the License. 2959 * You may obtain a copy of the License at 2960 * 2961 * http://www.apache.org/licenses/LICENSE-2.0 2962 * 2963 * Unless required by applicable law or agreed to in writing, software 2964 * distributed under the License is distributed on an "AS IS" BASIS, 2965 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2966 * See the License for the specific language governing permissions and 2967 * limitations under the License. 2968 */const UF=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],GF=new mp(3e4,6e4);function lx(n,e){return n.tenantId&&!e.tenantId?{...e,tenantId:n.tenantId}:e}async function Vh(n,e,t,s,o={}){return lj(n,o,async()=>{let l={},u={};s&&(e==="GET"?u=s:l={body:JSON.stringify(s)});const h=sp({...u,key:n.config.apiKey}).slice(1),f=await n._getAdditionalHeaders();f["Content-Type"]="application/json",n.languageCode&&(f["X-Firebase-Locale"]=n.languageCode);const p={method:e,headers:f,...l};return LO()||(p.referrerPolicy="strict-origin-when-cross-origin"),n.emulatorConfig&&qu(n.emulatorConfig.host)&&(p.credentials="include"),oj.fetch()(await uj(n,n.config.apiHost,t,h),p)})}async function lj(n,e,t){n._canInitEmulator=!1;const s={...VF,...e};try{const o=new HF(n),l=await Promise.race([t(),o.promise]);o.clearNetworkTimeout();const u=await l.json();if("needConfirmation"in u)throw iB(n,"account-exists-with-different-credential",u);if(l.ok&&!("errorMessage"in u))return u;{const h=l.ok?u.errorMessage:u.error.message,[f,p]=h.split(" : ");if(f==="FEDERATED_USER_ID_ALREADY_LINKED")throw iB(n,"credential-already-in-use",u);if(f==="EMAIL_EXISTS")throw iB(n,"email-already-in-use",u);if(f==="USER_DISABLED")throw iB(n,"user-disabled",u);const x=s[f]||f.toLowerCase().replace(/[_\s]+/g,"-");if(p)throw ox(n,x,p);Lo(n,x)}}catch(o){if(o instanceof Mo)throw o;Lo(n,"network-request-failed",{message:String(o)})}}async function cj(n,e,t,s,o={}){const l=await Vh(n,e,t,s,o);return"mfaPendingCredential"in l&&Lo(n,"multi-factor-auth-required",{_serverResponse:l}),l}async function uj(n,e,t,s){const o=`${e}${t}?${s}`,l=n,u=l.config.emulator?Tv(n.config,o):`${n.config.apiScheme}://${o}`;return UF.includes(t)&&(await l._persistenceManagerAvailable,l._getPersistenceType()==="COOKIE")?l._getPersistence()._getFinalTarget(u).toString():u}class HF{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,s)=>{this.timer=setTimeout(()=>s(Fa(this.auth,"network-request-failed")),GF.get())})}}function iB(n,e,t){const s={appName:n.name};t.email&&(s.email=t.email),t.phoneNumber&&(s.phoneNumber=t.phoneNumber);const o=Fa(n,e,s);return o.customData._tokenResponse=t,o}/** 2969 * @license 2970 * Copyright 2020 Google LLC 2971 * 2972 * Licensed under the Apache License, Version 2.0 (the "License"); 2973 * you may not use this file except in compliance with the License. 2974 * You may obtain a copy of the License at 2975 * 2976 * http://www.apache.org/licenses/LICENSE-2.0 2977 * 2978 * Unless required by applicable law or agreed to in writing, software 2979 * distributed under the License is distributed on an "AS IS" BASIS, 2980 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2981 * See the License for the specific language governing permissions and 2982 * limitations under the License. 2983 */async function qF(n,e){return Vh(n,"POST","/v1/accounts:delete",e)}async function mg(n,e){return Vh(n,"POST","/v1/accounts:lookup",e)}/** 2984 * @license 2985 * Copyright 2020 Google LLC 2986 * 2987 * Licensed under the Apache License, Version 2.0 (the "License");
2988 * you may not use this file except in compliance with the License. 2989 * You may obtain a copy of the License at 2990 * 2991 * http://www.apache.org/licenses/LICENSE-2.0 2992 * 2993 * Unless required by applicable law or agreed to in writing, software 2994 * distributed under the License is distributed on an "AS IS" BASIS, 2995 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2996 * See the License for the specific language governing permissions and 2997 * limitations under the License. 2998 */function vm(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function $F(n,e=!1){const t=$s(n),s=await t.getIdToken(e),o=Sv(s);It(o&&o.exp&&o.auth_time&&o.iat,t.auth,"internal-error");const l=typeof o.firebase=="object"?o.firebase:void 0,u=l==null?void 0:l.sign_in_provider;return{claims:o,token:s,authTime:vm(ey(o.auth_time)),issuedAtTime:vm(ey(o.iat)),expirationTime:vm(ey(o.exp)),signInProvider:u||null,signInSecondFactor:(l==null?void 0:l.sign_in_second_factor)||null}}function ey(n){return Number(n)*1e3}function Sv(n){const[e,t,s]=n.split(".");if(e===void 0||t===void 0||s===void 0)return IB("JWT malformed, contained fewer than 3 sections"),null;try{const o=VD(t);return o?JSON.parse(o):(IB("Failed to decode base64 JWT payload"),null)}catch(o){return IB("Caught error parsing JWT payload as JSON",o==null?void 0:o.toString()),null}}function y5(n){const e=Sv(n);return It(e,"internal-error"),It(typeof e.exp<"u","internal-error"),It(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/** 2999 * @license 3000 * Copyright 2020 Google LLC 3001 * 3002 * Licensed under the Apache License, Version 2.0 (the "License"); 3003 * you may not use this file except in compliance with the License. 3004 * You may obtain a copy of the License at 3005 * 3006 * http://www.apache.org/licenses/LICENSE-2.0 3007 * 3008 * Unless required by applicable law or agreed to in writing, software 3009 * distributed under the License is distributed on an "AS IS" BASIS, 3010 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3011 * See the License for the specific language governing permissions and 3012 * limitations under the License. 3013 */async function Qm(n,e,t=!1){if(t)return e;try{return await e}catch(s){throw s instanceof Mo&&JF(s)&&n.auth.currentUser===n&&await n.auth.signOut(),s}}function JF({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/** 3014 * @license 3015 * Copyright 2020 Google LLC 3016 * 3017 * Licensed under the Apache License, Version 2.0 (the "License"); 3018 * you may not use this file except in compliance with the License. 3019 * You may obtain a copy of the License at 3020 * 3021 * http://www.apache.org/licenses/LICENSE-2.0 3022 * 3023 * Unless required by applicable law or agreed to in writing, software 3024 * distributed under the License is distributed on an "AS IS" BASIS, 3025 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3026 * See the License for the specific language governing permissions and 3027 * limitations under the License. 3028 */class KF{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 t=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),t}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 t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}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()}}/** 3029 * @license 3030 * Copyright 2020 Google LLC 3031 * 3032 * Licensed under the Apache License, Version 2.0 (the "License"); 3033 * you may not use this file except in compliance with the License. 3034 * You may obtain a copy of the License at 3035 * 3036 * http://www.apache.org/licenses/LICENSE-2.0 3037 * 3038 * Unless required by applicable law or agreed to in writing, softw
3038are 3039 * distributed under the License is distributed on an "AS IS" BASIS, 3040 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3041 * See the License for the specific language governing permissions and 3042 * limitations under the License. 3043 */class l1{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=vm(this.lastLoginAt),this.creationTime=vm(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** 3044 * @license 3045 * Copyright 2019 Google LLC 3046 * 3047 * Licensed under the Apache License, Version 2.0 (the "License"); 3048 * you may not use this file except in compliance with the License. 3049 * You may obtain a copy of the License at 3050 * 3051 * http://www.apache.org/licenses/LICENSE-2.0 3052 * 3053 * Unless required by applicable law or agreed to in writing, software 3054 * distributed under the License is distributed on an "AS IS" BASIS, 3055 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3056 * See the License for the specific language governing permissions and 3057 * limitations under the License. 3058 */async function pg(n){var b;const e=n.auth,t=await n.getIdToken(),s=await Qm(n,mg(e,{idToken:t}));It(s==null?void 0:s.users.length,e,"internal-error");const o=s.users[0];n._notifyReloadListener(o);const l=(b=o.providerUserInfo)!=null&&b.length?dj(o.providerUserInfo):[],u=YF(n.providerData,l),h=n.isAnonymous,f=!(n.email&&o.passwordHash)&&!(u!=null&&u.length),p=h?f:!1,x={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:u,metadata:new l1(o.createdAt,o.lastLoginAt),isAnonymous:p};Object.assign(n,x)}async function QF(n){const e=$s(n);await pg(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function YF(n,e){return[...n.filter(s=>!e.some(o=>o.providerId===s.providerId)),...e]}function dj(n){return n.map(({providerId:e,...t})=>({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}/** 3059 * @license 3060 * Copyright 2020 Google LLC 3061 * 3062 * Licensed under the Apache License, Version 2.0 (the "License"); 3063 * you may not use this file except in compliance with the License. 3064 * You may obtain a copy of the License at 3065 * 3066 * http://www.apache.org/licenses/LICENSE-2.0 3067 * 3068 * Unless required by applicable law or agreed to in writing, software 3069 * distributed under the License is distributed on an "AS IS" BASIS, 3070 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3071 * See the License for the specific language governing permissions and 3072 * limitations under the License. 3073 */async function XF(n,e){const t=await lj(n,{},async()=>{const s=sp({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:o,apiKey:l}=n.config,u=await uj(n,o,"/v1/token",`key=${l}`),h=await n._getAdditionalHeaders();h["Content-Type"]="application/x-www-form-urlencoded";const f={method:"POST",headers:h,body:s};return n.emulatorConfig&&qu(n.emulatorConfig.host)&&(f.credentials="include"),oj.fetch()(u,f)});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function WF(n,e){return Vh(n,"POST","/v2/accounts:revokeToken",lx(n,e))}/** 3074 * @license 3075 * Copyright 2020 Google LLC 3076 * 3077 * Licensed under the Apache License, Version 2.0 (the "License"); 3078 * you may not use this file except in compliance with the License. 3079 * You may obtain a copy of the License at 3080 * 3081 * http://www.apache.org/licenses/LICENSE-2.0 3082 * 3083 * Unless required by applicable law or agreed to in writing, software 3084 * distributed under the License is distributed on an "AS IS" BASIS, 3085 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3086 * See the License for the specific language governing permissions and 3087 * limitations under the License. 3088 */class lh{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){It(e.idToken,"internal-error"),It(typeof e.idToken<"u","internal-error"),It(typeof e.refreshToken<"u","internal-error");
3088const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):y5(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){It(e.length!==0,"internal-error");const t=y5(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return!t&&this.accessToken&&!this.isExpired?this.accessToken:(It(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:s,refreshToken:o,expiresIn:l}=await XF(e,t);this.updateTokensAndExpiration(s,o,Number(l))}updateTokensAndExpiration(e,t,s){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+s*1e3}static fromJSON(e,t){const{refreshToken:s,accessToken:o,expirationTime:l}=t,u=new lh;return s&&(It(typeof s=="string","internal-error",{appName:e}),u.refreshToken=s),o&&(It(typeof o=="string","internal-error",{appName:e}),u.accessToken=o),l&&(It(typeof l=="number","internal-error",{appName:e}),u.expirationTime=l),u}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 lh,this.toJSON())}_performRefresh(){return dl("not implemented")}}/** 3089 * @license 3090 * Copyright 2020 Google LLC 3091 * 3092 * Licensed under the Apache License, Version 2.0 (the "License"); 3093 * you may not use this file except in compliance with the License. 3094 * You may obtain a copy of the License at 3095 * 3096 * http://www.apache.org/licenses/LICENSE-2.0 3097 * 3098 * Unless required by applicable law or agreed to in writing, software 3099 * distributed under the License is distributed on an "AS IS" BASIS, 3100 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3101 * See the License for the specific language governing permissions and 3102 * limitations under the License. 3103 */function ac(n,e){It(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class za{constructor({uid:e,auth:t,stsTokenManager:s,...o}){this.providerId="firebase",this.proactiveRefresh=new KF(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,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 l1(o.createdAt||void 0,o.lastLoginAt||void 0)}async getIdToken(e){const t=await Qm(this,this.stsTokenManager.getToken(this.auth,e));return It(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return $F(this,e)}reload(){return QF(this)}_assign(e){this!==e&&(It(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>({...t})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new za({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){It(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let s=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),s=!0),t&&await pg(this),await this.auth._persistUserIfCurrent(this),s&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Wi(this.auth.app))return Promise.reject(Dc(this.auth));const e=await this.getIdToken();return await Qm(this,qF(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,isA
3103nonymous: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,t){const s=t.displayName??void 0,o=t.email??void 0,l=t.phoneNumber??void 0,u=t.photoURL??void 0,h=t.tenantId??void 0,f=t._redirectEventId??void 0,p=t.createdAt??void 0,x=t.lastLoginAt??void 0,{uid:b,emailVerified:C,isAnonymous:N,providerData:T,stsTokenManager:R}=t;It(b&&R,e,"internal-error");const A=lh.fromJSON(this.name,R);It(typeof b=="string",e,"internal-error"),ac(s,e.name),ac(o,e.name),It(typeof C=="boolean",e,"internal-error"),It(typeof N=="boolean",e,"internal-error"),ac(l,e.name),ac(u,e.name),ac(h,e.name),ac(f,e.name),ac(p,e.name),ac(x,e.name);const U=new za({uid:b,auth:e,email:o,emailVerified:C,displayName:s,isAnonymous:N,photoURL:u,phoneNumber:l,tenantId:h,stsTokenManager:A,createdAt:p,lastLoginAt:x});return T&&Array.isArray(T)&&(U.providerData=T.map(M=>({...M}))),f&&(U._redirectEventId=f),U}static async _fromIdTokenResponse(e,t,s=!1){const o=new lh;o.updateFromServerResponse(t);const l=new za({uid:t.localId,auth:e,stsTokenManager:o,isAnonymous:s});return await pg(l),l}static async _fromGetAccountInfoResponse(e,t,s){const o=t.users[0];It(o.localId!==void 0,"internal-error");const l=o.providerUserInfo!==void 0?dj(o.providerUserInfo):[],u=!(o.email&&o.passwordHash)&&!(l!=null&&l.length),h=new lh;h.updateFromIdToken(s);const f=new za({uid:o.localId,auth:e,stsTokenManager:h,isAnonymous:u}),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:l,metadata:new l1(o.createdAt,o.lastLoginAt),isAnonymous:!(o.email&&o.passwordHash)&&!(l!=null&&l.length)};return Object.assign(f,p),f}}/** 3104 * @license 3105 * Copyright 2020 Google LLC 3106 * 3107 * Licensed under the Apache License, Version 2.0 (the "License"); 3108 * you may not use this file except in compliance with the License. 3109 * You may obtain a copy of the License at 3110 * 3111 * http://www.apache.org/licenses/LICENSE-2.0 3112 * 3113 * Unless required by applicable law or agreed to in writing, software 3114 * distributed under the License is distributed on an "AS IS" BASIS, 3115 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3116 * See the License for the specific language governing permissions and 3117 * limitations under the License. 3118 */const v5=new Map;function hl(n){wl(n instanceof Function,"Expected a class definition");let e=v5.get(n);return e?(wl(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,v5.set(n,e),e)}/** 3119 * @license 3120 * Copyright 2019 Google LLC 3121 * 3122 * Licensed under the Apache License, Version 2.0 (the "License"); 3123 * you may not use this file except in compliance with the License. 3124 * You may obtain a copy of the License at 3125 * 3126 * http://www.apache.org/licenses/LICENSE-2.0 3127 * 3128 * Unless required by applicable law or agreed to in writing, software 3129 * distributed under the License is distributed on an "AS IS" BASIS, 3130 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3131 * See the License for the specific language governing permissions and 3132 * limitations under the License. 3133 */class hj{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}hj.type="NONE";const _5=hj;/** 3134 * @license 3135 * Copyright 2019 Google LLC 3136 * 3137 * Licensed under the Apache License, Version 2.0 (the "License"); 3138 * you may not use this file except in compliance with the License. 3139 * You may obtain a copy of the License at 3140 * 3141 * http://www.apache.org/licenses/LICENSE-2.0 3142 * 3143 * Unless required by applicable law or agreed to in writing, softw
3143are 3144 * distributed under the License is distributed on an "AS IS" BASIS, 3145 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3146 * See the License for the specific language governing permissions and 3147 * limitations under the License. 3148 */function OB(n,e,t){return`firebase:${n}:${e}:${t}`}class Ru{constructor(e,t,s){this.persistence=e,this.auth=t,this.userKey=s;const{config:o,name:l}=this.auth;this.fullUserKey=OB(this.userKey,o.apiKey,l),this.fullPersistenceKey=OB("persistence",o.apiKey,l),this.boundEventHandler=t._onStorageEvent.bind(t);try{this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}catch{}}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 t=await mg(this.auth,{idToken:e}).catch(()=>{});return t?za._fromGetAccountInfoResponse(this.auth,t,e):null}return za._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 t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){try{this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}catch{}}static async create(e,t,s="authUser"){if(!t.length)return new Ru(hl(_5),e,s);const o=(await Promise.all(t.map(async p=>{try{if(await p._isAvailable())return p}catch{return}}))).filter(p=>p);let l=o[0]||hl(_5);const u=OB(s,e.config.apiKey,e.name);let h=null;for(const p of t)try{const x=await p._get(u);if(x){let b;if(typeof x=="string"){const C=await mg(e,{idToken:x}).catch(()=>{});if(!C)break;b=await za._fromGetAccountInfoResponse(e,C,x)}else b=za._fromJSON(e,x);p!==l&&(h=b),l=p;break}}catch{}const f=o.filter(p=>p._shouldAllowMigration);return!l._shouldAllowMigration||!f.length?new Ru(l,e,s):(l=f[0],h&&await l._set(u,h.toJSON()),await Promise.all(t.map(async p=>{if(p!==l)try{await p._remove(u)}catch{}})),new Ru(l,e,s))}}/** 3149 * @license 3150 * Copyright 2020 Google LLC 3151 * 3152 * Licensed under the Apache License, Version 2.0 (the "License"); 3153 * you may not use this file except in compliance with the License. 3154 * You may obtain a copy of the License at 3155 * 3156 * http://www.apache.org/licenses/LICENSE-2.0 3157 * 3158 * Unless required by applicable law or agreed to in writing, software 3159 * distributed under the License is distributed on an "AS IS" BASIS, 3160 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3161 * See the License for the specific language governing permissions and 3162 * limitations under the License. 3163 */function w5(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Bj(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(fj(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(xj(e))return"Blackberry";if(bj(e))return"Webos";if(mj(e))return"Safari";if((e.includes("chrome/")||pj(e))&&!e.includes("edge/"))return"Chrome";if(gj(e))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,s=n.match(t);if((s==null?void 0:s.length)===2)return s[1]}return"Other"}function fj(n=Kr()){return/firefox\//i.test(n)}function mj(n=Kr()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function pj(n=Kr()){return/crios\//i.test(n)}function Bj(n=Kr()){return/iemobile/i.test(n)}function gj(n=Kr()){return/android/i.test(n)}function xj(n=Kr()){return/blackberry/i.test(n)}function bj(n=Kr()){return/webos/i.test(n)}function jv(n=Kr()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function ZF(n=Kr()){var e;return jv(n)&&!!((e=window.navigator)!=null&&e.standalone)}function e9(){return zO()&&document.documentMode===10}function Cj(n=Kr()){return jv(n)||gj(n)||bj(n)||xj(n)||/windows phone/i.test(n)||Bj(n)}/** 3164 * @license 3165 * Copyright 2020 Google LLC 3166 * 3167 * Licensed under the Apache License, Version 2.0 (the "License");
3168 * you may not use this file except in compliance with the License. 3169 * You may obtain a copy of the License at 3170 * 3171 * http://www.apache.org/licenses/LICENSE-2.0 3172 * 3173 * Unless required by applicable law or agreed to in writing, software 3174 * distributed under the License is distributed on an "AS IS" BASIS, 3175 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3176 * See the License for the specific language governing permissions and 3177 * limitations under the License. 3178 */function yj(n,e=[]){let t;switch(n){case"Browser":t=w5(Kr());break;case"Worker":t=`${w5(Kr())}-${n}`;break;default:t=n}const s=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${$u}/${s}`}/** 3179 * @license 3180 * Copyright 2022 Google LLC 3181 * 3182 * Licensed under the Apache License, Version 2.0 (the "License"); 3183 * you may not use this file except in compliance with the License. 3184 * You may obtain a copy of the License at 3185 * 3186 * http://www.apache.org/licenses/LICENSE-2.0 3187 * 3188 * Unless required by applicable law or agreed to in writing, software 3189 * distributed under the License is distributed on an "AS IS" BASIS, 3190 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3191 * See the License for the specific language governing permissions and 3192 * limitations under the License. 3193 */class t9{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const s=l=>new Promise((u,h)=>{try{const f=e(l);u(f)}catch(f){h(f)}});s.onAbort=t,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 t=[];try{for(const s of this.queue)await s(e),s.onAbort&&t.push(s.onAbort)}catch(s){t.reverse();for(const o of t)try{o()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:s==null?void 0:s.message})}}}/** 3194 * @license 3195 * Copyright 2023 Google LLC 3196 * 3197 * Licensed under the Apache License, Version 2.0 (the "License"); 3198 * you may not use this file except in compliance with the License. 3199 * You may obtain a copy of the License at 3200 * 3201 * http://www.apache.org/licenses/LICENSE-2.0 3202 * 3203 * Unless required by applicable law or agreed to in writing, software 3204 * distributed under the License is distributed on an "AS IS" BASIS, 3205 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3206 * See the License for the specific language governing permissions and 3207 * limitations under the License. 3208 */async function n9(n,e={}){return Vh(n,"GET","/v2/passwordPolicy",lx(n,e))}/** 3209 * @license 3210 * Copyright 2023 Google LLC 3211 * 3212 * Licensed under the Apache License, Version 2.0 (the "License"); 3213 * you may not use this file except in compliance with the License. 3214 * You may obtain a copy of the License at 3215 * 3216 * http://www.apache.org/licenses/LICENSE-2.0 3217 * 3218 * Unless required by applicable law or agreed to in writing, software 3219 * distributed under the License is distributed on an "AS IS" BASIS, 3220 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3221 * See the License for the specific language governing permissions and 3222 * limitations under the License. 3223 */const s9=6;class r9{constructor(e){var s;const t=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=t.minPasswordLength??s9,t.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=t.maxPasswordLength),t.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=t.containsLowercaseCharacter),t.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=t.containsUppercaseCharacter),t.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=t.containsNumericCharacter),t.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=t.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 t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&
3223(t.isValid=t.meetsMinPasswordLength??!0),t.isValid&&(t.isValid=t.meetsMaxPasswordLength??!0),t.isValid&&(t.isValid=t.containsLowercaseLetter??!0),t.isValid&&(t.isValid=t.containsUppercaseLetter??!0),t.isValid&&(t.isValid=t.containsNumericCharacter??!0),t.isValid&&(t.isValid=t.containsNonAlphanumericCharacter??!0),t}validatePasswordLengthOptions(e,t){const s=this.customStrengthOptions.minPasswordLength,o=this.customStrengthOptions.maxPasswordLength;s&&(t.meetsMinPasswordLength=e.length>=s),o&&(t.meetsMaxPasswordLength=e.length<=o)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let s;for(let o=0;o<e.length;o++)s=e.charAt(o),this.updatePasswordCharacterOptionsStatuses(t,s>="a"&&s<="z",s>="A"&&s<="Z",s>="0"&&s<="9",this.allowedNonAlphanumericCharacters.includes(s))}updatePasswordCharacterOptionsStatuses(e,t,s,o,l){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=s)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=o)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=l))}}/** 3224 * @license 3225 * Copyright 2020 Google LLC 3226 * 3227 * Licensed under the Apache License, Version 2.0 (the "License"); 3228 * you may not use this file except in compliance with the License. 3229 * You may obtain a copy of the License at 3230 * 3231 * http://www.apache.org/licenses/LICENSE-2.0 3232 * 3233 * Unless required by applicable law or agreed to in writing, software 3234 * distributed under the License is distributed on an "AS IS" BASIS, 3235 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3236 * See the License for the specific language governing permissions and 3237 * limitations under the License. 3238 */class i9{constructor(e,t,s,o){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=s,this.config=o,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new E5(this),this.idTokenSubscription=new E5(this),this.beforeStateQueue=new t9(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=aj,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(l=>this._resolvePersistenceManagerAvailable=l)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=hl(t)),this._initializationPromise=this.queue(async()=>{var s,o,l;if(!this._deleted){try{this.persistenceManager=await Ru.create(this,e)}catch(u){RB(`Failed to initialize persistence: ${u}`),this.persistenceManager=await Ru.create(this,[])}finally{(s=this._resolvePersistenceManagerAvailable)==null||s.call(this)}if(!this._deleted){if((o=this._popupRedirectResolver)!=null&&o._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}try{await this.initializeCurrentUser(t)}catch(u){RB(`Failed to initialize current user: ${u}`),await this.directlySetCurrentUser(null).catch(()=>{})}this.lastNotifiedUid=((l=this.currentUser)==null?void 0:l.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 t=await mg(this,{idToken:e}),s=await za._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(s)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var l;if(Wi(this.app)){const u=this.app.settings.authIdToken;return u?new Promise(h=>{setTimeout(()=>
3238this.initializeCurrentUserFromIdToken(u).then(h,h))}):this.directlySetCurrentUser(null)}const t=await this.assertedPersistence.getCurrentUser();let s=t,o=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const u=(l=this.redirectUser)==null?void 0:l._redirectEventId,h=s==null?void 0:s._redirectEventId,f=await this.tryRedirectSignIn(e);(!u||u===h)&&(f!=null&&f.user)&&(s=f.user,o=!0)}if(!s)return this.directlySetCurrentUser(null);if(!s._redirectEventId){if(o)try{await this.beforeStateQueue.runMiddleware(s)}catch(u){s=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(u))}return s?this.reloadAndSetCurrentUserOrClear(s):this.directlySetCurrentUser(null)}return It(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 t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await pg(e)}catch(t){if((t==null?void 0:t.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=FF()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Wi(this.app))return Promise.reject(Dc(this));const t=e?$s(e):null;return t&&It(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&It(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Wi(this.app)?Promise.reject(Dc(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Wi(this.app)?Promise.reject(Dc(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(hl(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await n9(this),t=new r9(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new np("auth","Firebase",e())}onAuthStateChanged(e,t,s){return this.registerStateListener(this.authStateSubscription,e,t,s)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,s){return this.registerStateListener(this.idTokenSubscription,e,t,s)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const s=this.onAuthStateChanged(()=>{s(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t=await this.currentUser.getIdToken(),s={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(s.tenantId=this.tenantId),await WF(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,t){const s=await this.getOrInitRedirectPersistenceManager(t);return e===null?s.removeCurrentUser():s.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&hl(e)||this._popupRedirectResolver;It(t,this,"argument-error"),this.redirectPersistenceManager=await Ru.create(this,[hl(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,s;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)==null?void 0:t._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 t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=((t=this.currentUser)==null?void 0:t.uid)??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,s,o){if(this._deleted)return()=>{};const l=typeof t=="function"?t:t.next.bind(t);let u=!1;const h=this._isInitialized?Promise.resolve():this._initializationPromise;if(It(h,this,"internal-error"),h.then(()=>{u||l(this.currentUser)}).catch(f=>{if(!u)if(typeof t!="function"&&t.error)t.error(f);else if(s)s(f);else throw f}),typeof t=="function"){const f=e.addObserver(t,s,o);return()=>{u=!0,f()}}else{const f=e.addObserver(t);return()=>{u=!0,f()}}}async directlySetCurrentUser(e){if(this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,this.persistenceManager)try{e?await this.persistenceManager.setCurrentUser(e):await this.persistenceManager.removeCurrentUser()}catch(t){const s=(t==null?void 0:t.message)||String(t),o=ox(this,"internal-error",`An internal AuthError has occurred: ${s}`);throw o.customData={originalError:t},o}}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return It(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=yj(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 t=await((o=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:o.getHeartbeatsHeader());t&&(e["X-Firebase-Client"]=t);const s=await this._getAppCheckToken();return s&&(e["X-Firebase-AppCheck"]=s),e}async _getAppCheckToken(){var t;if(Wi(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await((t=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:t.getToken());return e!=null&&e.error&&RB(`Error while retrieving App Check token: ${e.error}`),e==null?void 0:e.token}}function pp(n){return $s(n)}class E5{constructor(e){this.auth=e,this.observer=null,this.addObserver=$O(t=>this.observer=t)}get next(){return It(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** 3239 * @license 3240 * Copyright 2020 Google LLC 3241 * 3242 * Licensed under the Apache License, Version 2.0 (the "License");
3243 * you may not use this file except in compliance with the License. 3244 * You may obtain a copy of the License at 3245 * 3246 * http://www.apache.org/licenses/LICENSE-2.0 3247 * 3248 * Unless required by applicable law or agreed to in writing, software 3249 * distributed under the License is distributed on an "AS IS" BASIS, 3250 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3251 * See the License for the specific language governing permissions and 3252 * limitations under the License. 3253 */let Av={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function a9(n){Av=n}function o9(n){return Av.loadJS(n)}function l9(){return Av.gapiScript}function c9(n){return`__${n}${Math.floor(Math.random()*1e6)}`}/** 3254 * @license 3255 * Copyright 2020 Google LLC 3256 * 3257 * Licensed under the Apache License, Version 2.0 (the "License"); 3258 * you may not use this file except in compliance with the License. 3259 * You may obtain a copy of the License at 3260 * 3261 * http://www.apache.org/licenses/LICENSE-2.0 3262 * 3263 * Unless required by applicable law or agreed to in writing, software 3264 * distributed under the License is distributed on an "AS IS" BASIS, 3265 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3266 * See the License for the specific language governing permissions and 3267 * limitations under the License. 3268 */function u9(n,e){const t=kg(n,"auth");if(t.isInitialized()){const o=t.getImmediate(),l=t.getOptions();if(bl(l,e??{}))return o;Lo(o,"already-initialized")}return t.initialize({options:e})}function d9(n,e){const t=(e==null?void 0:e.persistence)||[],s=(Array.isArray(t)?t:[t]).map(hl);e!=null&&e.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(s,e==null?void 0:e.popupRedirectResolver)}function h9(n,e,t){const s=pp(n);It(/^https?:\/\//.test(e),s,"invalid-emulator-scheme");const o=!1,l=vj(e),{host:u,port:h}=f9(e),f=h===null?"":`:${h}`,p={url:`${l}//${u}${f}/`},x=Object.freeze({host:u,port:h,protocol:l.replace(":",""),options:Object.freeze({disableWarnings:o})});if(!s._canInitEmulator){It(s.config.emulator&&s.emulatorConfig,s,"emulator-config-failed"),It(bl(p,s.config.emulator)&&bl(x,s.emulatorConfig),s,"emulator-config-failed");return}s.config.emulator=p,s.emulatorConfig=x,s.settings.appVerificationDisabledForTesting=!0,qu(u)?E1(`${l}//${u}${f}`):m9()}function vj(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function f9(n){const e=vj(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const s=t[2].split("@").pop()||"",o=/^(\[[^\]]+\])(:|$)/.exec(s);if(o){const l=o[1];return{host:l,port:N5(s.substr(l.length+1))}}else{const[l,u]=s.split(":");return{host:l,port:N5(u)}}}function N5(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function m9(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&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",n):n())}/** 3269 * @license 3270 * Copyright 2020 Google LLC 3271 * 3272 * Licensed under the Apache License, Version 2.0 (the "License"); 3273 * you may not use this file except in compliance with the License. 3274 * You may obtain a copy of the License at 3275 * 3276 * http://www.apache.org/licenses/LICENSE-2.0 3277 * 3278 * Unless required by applicable law or agreed to in writing, software 3279 * distributed under the License is distributed on an "AS IS" BASIS, 3280 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3281 * See the License for the specific language governing permissions and 3282 * limitations under the License. 3283 */class _j{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return dl("not implemented")}_getIdTokenResponse(e){return dl("not implemented")}_linkToIdToken(e,t){return dl("not implemented")}_getReauthenticationResolver(e){return dl("not implemented")}}/** 3284 * @license 3285 * Copyright 2020 Google LLC 3286 * 3287 * Licensed under the Apache License, Version 2.0 (the "License");
3288 * you may not use this file except in compliance with the License. 3289 * You may obtain a copy of the License at 3290 * 3291 * http://www.apache.org/licenses/LICENSE-2.0 3292 * 3293 * Unless required by applicable law or agreed to in writing, software 3294 * distributed under the License is distributed on an "AS IS" BASIS, 3295 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3296 * See the License for the specific language governing permissions and 3297 * limitations under the License. 3298 */async function ch(n,e){return cj(n,"POST","/v1/accounts:signInWithIdp",lx(n,e))}/** 3299 * @license 3300 * Copyright 2020 Google LLC 3301 * 3302 * Licensed under the Apache License, Version 2.0 (the "License"); 3303 * you may not use this file except in compliance with the License. 3304 * You may obtain a copy of the License at 3305 * 3306 * http://www.apache.org/licenses/LICENSE-2.0 3307 * 3308 * Unless required by applicable law or agreed to in writing, software 3309 * distributed under the License is distributed on an "AS IS" BASIS, 3310 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3311 * See the License for the specific language governing permissions and 3312 * limitations under the License. 3313 */const p9="http://localhost";class Gu extends _j{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new Gu(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):Lo("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
3313once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:s,signInMethod:o,...l}=t;if(!s||!o)return null;const u=new Gu(s,o);return u.idToken=l.idToken||void 0,u.accessToken=l.accessToken||void 0,u.secret=l.secret,u.nonce=l.nonce,u.pendingToken=l.pendingToken||null,u}_getIdTokenResponse(e){const t=this.buildRequest();return ch(e,t)}_linkToIdToken(e,t){const s=this.buildRequest();return s.idToken=t,ch(e,s)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,ch(e,t)}buildRequest(){const e={requestUri:p9,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=sp(t)}return e}}/** 3314 * @license 3315 * Copyright 2020 Google LLC 3316 * 3317 * Licensed under the Apache License, Version 2.0 (the "License"); 3318 * you may not use this file except in compliance with the License. 3319 * You may obtain a copy of the License at 3320 * 3321 * http://www.apache.org/licenses/LICENSE-2.0 3322 * 3323 * Unless required by applicable law or agreed to in writing, software 3324 * distributed under the License is distributed on an "AS IS" BASIS, 3325 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3326 * See the License for the specific language governing permissions and 3327 * limitations under the License. 3328 */class kv{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}}/** 3329 * @license 3330 * Copyright 2019 Google LLC 3331 * 3332 * Licensed under the Apache License, Version 2.0 (the "License"); 3333 * you may not use this file except in compliance with the License. 3334 * You may obtain a copy of the License at 3335 * 3336 * http://www.apache.org/licenses/LICENSE-2.0 3337 * 3338 * Unless required by applicable law or agreed to in writing, software 3339 * distributed under the License is distributed on an "AS IS" BASIS, 3340 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3341 * See the License for the specific language governing permissions and 3342 * limitations under the License. 3343 */class Bp extends kv{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/** 3344 * @license 3345 * Copyright 2020 Google LLC 3346 * 3347 * Licensed under the Apache License, Version 2.0 (the "License"); 3348 * you may not use this file except in compliance with the License. 3349 * You may obtain a copy of the License at 3350 * 3351 * http://www.apache.org/licenses/LICENSE-2.0 3352 * 3353 * Unless required by applicable law or agreed to in writing, software 3354 * distributed under the License is distributed on an "AS IS" BASIS, 3355 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3356 * See the License for the specific language governing permissions and 3357 * limitations under the License. 3358 */class mc extends Bp{constructor(){super("facebook.com")}static credential(e){return Gu._fromParams({providerId:mc.PROVIDER_ID,signInMethod:mc.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return mc.credentialFromTaggedObject(e)}static credentialFromError(e){return mc.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return mc.credential(e.oauthAccessToken)}catch{return null}}}mc.FACEBOOK_SIGN_IN_METHOD="facebook.com";mc.PROVIDER_ID="facebook.com";/** 3359 * @license 3360 * Copyright 2020 Google LLC 3361 * 3362 * Licensed under the Apache License, Version 2.0 (the "License"); 3363 * you may not use this file except in compliance with the License. 3364 * You may obtain a copy of the License at 3365 * 3366 * http://www.apache.org/licenses/LICENSE-2.0 3367 * 3368 * Unless required by applicable law or agreed to in writing, softw
3368are 3369 * distributed under the License is distributed on an "AS IS" BASIS, 3370 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3371 * See the License for the specific language governing permissions and 3372 * limitations under the License. 3373 */class il extends Bp{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return Gu._fromParams({providerId:il.PROVIDER_ID,signInMethod:il.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return il.credentialFromTaggedObject(e)}static credentialFromError(e){return il.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:s}=e;if(!t&&!s)return null;try{return il.credential(t,s)}catch{return null}}}il.GOOGLE_SIGN_IN_METHOD="google.com";il.PROVIDER_ID="google.com";/** 3374 * @license 3375 * Copyright 2020 Google LLC 3376 * 3377 * Licensed under the Apache License, Version 2.0 (the "License"); 3378 * you may not use this file except in compliance with the License. 3379 * You may obtain a copy of the License at 3380 * 3381 * http://www.apache.org/licenses/LICENSE-2.0 3382 * 3383 * Unless required by applicable law or agreed to in writing, software 3384 * distributed under the License is distributed on an "AS IS" BASIS, 3385 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3386 * See the License for the specific language governing permissions and 3387 * limitations under the License. 3388 */class pc extends Bp{constructor(){super("github.com")}static credential(e){return Gu._fromParams({providerId:pc.PROVIDER_ID,signInMethod:pc.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return pc.credentialFromTaggedObject(e)}static credentialFromError(e){return pc.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return pc.credential(e.oauthAccessToken)}catch{return null}}}pc.GITHUB_SIGN_IN_METHOD="github.com";pc.PROVIDER_ID="github.com";/** 3389 * @license 3390 * Copyright 2020 Google LLC 3391 * 3392 * Licensed under the Apache License, Version 2.0 (the "License"); 3393 * you may not use this file except in compliance with the License. 3394 * You may obtain a copy of the License at 3395 * 3396 * http://www.apache.org/licenses/LICENSE-2.0 3397 * 3398 * Unless required by applicable law or agreed to in writing, software 3399 * distributed under the License is distributed on an "AS IS" BASIS, 3400 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3401 * See the License for the specific language governing permissions and 3402 * limitations under the License. 3403 */class Bc extends Bp{constructor(){super("twitter.com")}static credential(e,t){return Gu._fromParams({providerId:Bc.PROVIDER_ID,signInMethod:Bc.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return Bc.credentialFromTaggedObject(e)}static credentialFromError(e){return Bc.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:s}=e;if(!t||!s)return null;try{return Bc.credential(t,s)}catch{return null}}}Bc.TWITTER_SIGN_IN_METHOD="twitter.com";Bc.PROVIDER_ID="twitter.com";/** 3404 * @license 3405 * Copyright 2020 Google LLC 3406 * 3407 * Licensed under the Apache License, Version 2.0 (the "License"); 3408 * you may not use this file except in compliance with the License. 3409 * You may obtain a copy of the License at 3410 * 3411 * http://www.apache.org/licenses/LICENSE-2.0 3412 * 3413 * Unless required by applicable law or agreed to in writing, software 3414 * distributed under the License is distributed on an "AS IS" BASIS, 3415 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3416 * See the License for the specific language governing permissions and 3417 * limitations under the License. 3418 */async function B9(n,e){return cj(n,"POST","/v1/accounts:signUp",lx(n,e))}/** 3419 * @license 3420 * Copyright 2020 Google LLC 3421 * 3422 * Licensed under the Apache License, Version 2.0 (the "License"); 3423 * you may not use this file except in compliance with the License. 3424 * You may obtain a copy of the License at 3425 * 3426 * http://www.apache.org/licenses/LICENSE-2.0 3427 * 3428 * Unless required by applicable law or agreed to in writing, softw
3428are 3429 * distributed under the License is distributed on an "AS IS" BASIS, 3430 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3431 * See the License for the specific language governing permissions and 3432 * limitations under the License. 3433 */class zc{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,s,o=!1){const l=await za._fromIdTokenResponse(e,s,o),u=D5(s);return new zc({user:l,providerId:u,_tokenResponse:s,operationType:t})}static async _forOperation(e,t,s){await e._updateTokensIfNecessary(s,!0);const o=D5(s);return new zc({user:e,providerId:o,_tokenResponse:s,operationType:t})}}function D5(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/** 3434 * @license 3435 * Copyright 2020 Google LLC 3436 * 3437 * Licensed under the Apache License, Version 2.0 (the "License"); 3438 * you may not use this file except in compliance with the License. 3439 * You may obtain a copy of the License at 3440 * 3441 * http://www.apache.org/licenses/LICENSE-2.0 3442 * 3443 * Unless required by applicable law or agreed to in writing, software 3444 * distributed under the License is distributed on an "AS IS" BASIS, 3445 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3446 * See the License for the specific language governing permissions and 3447 * limitations under the License. 3448 */async function g9(n){var o;if(Wi(n.app))return Promise.reject(Dc(n));const e=pp(n);if(await e._initializationPromise,(o=e.currentUser)!=null&&o.isAnonymous)return new zc({user:e.currentUser,providerId:null,operationType:"signIn"});const t=await B9(e,{returnSecureToken:!0}),s=await zc._fromIdTokenResponse(e,"signIn",t,!0);return await e._updateCurrentUser(s.user),s}/** 3449 * @license 3450 * Copyright 2020 Google LLC 3451 * 3452 * Licensed under the Apache License, Version 2.0 (the "License"); 3453 * you may not use this file except in compliance with the License. 3454 * You may obtain a copy of the License at 3455 * 3456 * http://www.apache.org/licenses/LICENSE-2.0 3457 * 3458 * Unless required by applicable law or agreed to in writing, software 3459 * distributed under the License is distributed on an "AS IS" BASIS, 3460 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3461 * See the License for the specific language governing permissions and 3462 * limitations under the License. 3463 */class Bg extends Mo{constructor(e,t,s,o){super(t.code,t.message),this.operationType=s,this.user=o,Object.setPrototypeOf(this,Bg.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:s}}static _fromErrorAndOperation(e,t,s,o){return new Bg(e,t,s,o)}}function wj(n,e,t,s){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(l=>{throw l.code==="auth/multi-factor-auth-required"?Bg._fromErrorAndOperation(n,l,e,s):l})}async function x9(n,e,t=!1){const s=await Qm(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return zc._forOperation(n,"link",s)}/** 3464 * @license 3465 * Copyright 2019 Google LLC 3466 * 3467 * Licensed under the Apache License, Version 2.0 (the "License"); 3468 * you may not use this file except in compliance with the License. 3469 * You may obtain a copy of the License at 3470 * 3471 * http://www.apache.org/licenses/LICENSE-2.0 3472 * 3473 * Unless required by applicable law or agreed to in writing, software 3474 * distributed under the License is distributed on an "AS IS" BASIS, 3475 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3476 * See the License for the specific language governing permissions and 3477 * limitations under the License. 3478 */async function b9(n,e,t=!1){const{auth:s}=n;if(Wi(s.app))return Promise.reject(Dc(s));const o="reauthenticate";try{const l=await Qm(n,wj(s,o,e,n),t);It(l.idToken,s,"internal-error");const u=Sv(l.idToken);It(u,s,"internal-error");const{sub:h}=u;return It(n.uid===h,s,"user-mismatch"),zc._forOperation(n,o,l)}catch(l){throw(l==null?void 0:l.code)==="auth/user-not-found"&&Lo(s,"user-mismatch"),l}}/** 3479 * @license 3480 * Copyright 2020 Google LLC 3481 * 3482 * Licensed under the Apache License, Version 2.0 (the "License");
3483 * you may not use this file except in compliance with the License. 3484 * You may obtain a copy of the License at 3485 * 3486 * http://www.apache.org/licenses/LICENSE-2.0 3487 * 3488 * Unless required by applicable law or agreed to in writing, software 3489 * distributed under the License is distributed on an "AS IS" BASIS, 3490 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3491 * See the License for the specific language governing permissions and 3492 * limitations under the License. 3493 */async function C9(n,e,t=!1){if(Wi(n.app))return Promise.reject(Dc(n));const s="signIn",o=await wj(n,s,e),l=await zc._fromIdTokenResponse(n,s,o);return t||await n._updateCurrentUser(l.user),l}function y9(n,e,t,s){return $s(n).onIdTokenChanged(e,t,s)}function v9(n,e,t){return $s(n).beforeAuthStateChanged(e,t)}function _9(n,e,t,s){return $s(n).onAuthStateChanged(e,t,s)}const gg="__sak";/** 3494 * @license 3495 * Copyright 2019 Google LLC 3496 * 3497 * Licensed under the Apache License, Version 2.0 (the "License"); 3498 * you may not use this file except in compliance with the License. 3499 * You may obtain a copy of the License at 3500 * 3501 * http://www.apache.org/licenses/LICENSE-2.0 3502 * 3503 * Unless required by applicable law or agreed to in writing, software 3504 * distributed under the License is distributed on an "AS IS" BASIS, 3505 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3506 * See the License for the specific language governing permissions and 3507 * limitations under the License. 3508 */class Ej{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(gg,"1"),this.storage.removeItem(gg),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/** 3509 * @license 3510 * Copyright 2020 Google LLC 3511 * 3512 * Licensed under the Apache License, Version 2.0 (the "License"); 3513 * you may not use this file except in compliance with the License. 3514 * You may obtain a copy of the License at 3515 * 3516 * http://www.apache.org/licenses/LICENSE-2.0 3517 * 3518 * Unless required by applicable law or agreed to in writing, software 3519 * distributed under the License is distributed on an "AS IS" BASIS, 3520 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3521 * See the License for the specific language governing permissions and 3522 * limitations under the License. 3523 */const w9=1e3,E9=10;
vendor: 1,640 bytes, line 3523
3523class Nj extends Ej{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Cj(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const s=this.storage.getItem(t),o=this.localCache[t];s!==o&&e(t,o,s)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((u,h,f)=>{this.notifyListeners(u,f)});return}const s=e.key;t?this.detachListener():this.stopPolling();const o=()=>{const u=this.storage.getItem(s);!t&&this.localCache[s]===u||this.notifyListeners(s,u)},l=this.storage.getItem(s);e9()&&l!==e.newValue&&e.newValue!==e.oldValue?setTimeout(o,E9):o()}notifyListeners(e,t){this.localCache[e]=t;const s=this.listeners[e];if(s)for(const o of Array.from(s))o(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,s)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:s}),!0)})},w9)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){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(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Ob
3523ject.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}Nj.type="LOCAL";const N9=Nj;/** 3524 * @license 3525 * Copyright 2020 Google LLC 3526 * 3527 * Licensed under the Apache License, Version 2.0 (the "License"); 3528 * you may not use this file except in compliance with the License. 3529 * You may obtain a copy of the License at 3530 * 3531 * http://www.apache.org/licenses/LICENSE-2.0 3532 * 3533 * Unless required by applicable law or agreed to in writing, software 3534 * distributed under the License is distributed on an "AS IS" BASIS, 3535 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3536 * See the License for the specific language governing permissions and 3537 * limitations under the License. 3538 */class Dj extends Ej{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}Dj.type="SESSION";const Tj=Dj;/** 3539 * @license 3540 * Copyright 2019 Google LLC 3541 * 3542 * Licensed under the Apache License, Version 2.0 (the "License"); 3543 * you may not use this file except in compliance with the License. 3544 * You may obtain a copy of the License at 3545 * 3546 * http://www.apache.org/licenses/LICENSE-2.0 3547 * 3548 * Unless required by applicable law or agreed to in writing, software 3549 * distributed under the License is distributed on an "AS IS" BASIS, 3550 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3551 * See the License for the specific language governing permissions and 3552 * limitations under the License. 3553 */function D9(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/** 3554 * @license 3555 * Copyright 2019 Google LLC 3556 * 3557 * Licensed under the Apache License, Version 2.0 (the "License"); 3558 * you may not use this file except in compliance with the License. 3559 * You may obtain a copy of the License at 3560 * 3561 * http://www.apache.org/licenses/LICENSE-2.0 3562 * 3563 * Unless required by applicable law or agreed to in writing, software 3564 * distributed under the License is distributed on an "AS IS" BASIS, 3565 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3566 * See the License for the specific language governing permissions and 3567 * limitations under the License. 3568 */class cx{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(o=>o.isListeningto(e));if(t)return t;const s=new cx(e);return this.receivers.push(s),s}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:s,eventType:o,data:l}=t.data,u=this.handlersMap[o];if(!(u!=null&&u.size))return;t.ports[0].postMessage({status:"ack",eventId:s,eventType:o});const h=Array.from(u).map(async p=>p(t.origin,l)),f=await D9(h);t.ports[0].postMessage({status:"done",eventId:s,eventType:o,response:f})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}cx.receivers=[];/** 3569 * @license 3570 * Copyright 2020 Google LLC 3571 * 3572 * Licensed under the Apache License, Version 2.0 (the "License"); 3573 * you may not use this file except in compliance with the License. 3574 * You may obtain a copy of the License at 3575 * 3576 * http://www.apache.org/licenses/LICENSE-2.0 3577 * 3578 * Unless required by applicable law or agreed to in writing, software 3579 * distributed under the License is distributed on an "AS IS" BASIS, 3580 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3581 * See the License for the specific language governing permissions and 3582 * limitations under the License. 3583 */function Rv(n="",e=10){let t="";for(let s=0;s<e;s++)t+=Math.floor(Math.random()*10);return n+t}/** 3584 * @license 3585 * Copyright 2019 Google LLC 3586 * 3587 * Licensed under the Apache License, Version 2.0 (the "License");
3588 * you may not use this file except in compliance with the License. 3589 * You may obtain a copy of the License at 3590 * 3591 * http://www.apache.org/licenses/LICENSE-2.0 3592 * 3593 * Unless required by applicable law or agreed to in writing, software 3594 * distributed under the License is distributed on an "AS IS" BASIS, 3595 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3596 * See the License for the specific language governing permissions and 3597 * limitations under the License. 3598 */class T9{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,s=50){const o=typeof MessageChannel<"u"?new MessageChannel:null;if(!o)throw new Error("connection_unavailable");let l,u;return new Promise((h,f)=>{const p=Rv("",20);o.port1.start();const x=setTimeout(()=>{f(new Error("unsupported_event"))},s);u={messageChannel:o,onMessage(b){const C=b;if(C.data.eventId===p)switch(C.data.status){case"ack":clearTimeout(x),l=setTimeout(()=>{f(new Error("timeout"))},3e3);break;case"done":clearTimeout(l),h(C.data.response);break;default:clearTimeout(x),clearTimeout(l),f(new Error("invalid_response"));break}}},this.handlers.add(u),o.port1.addEventListener("message",u.onMessage),this.target.postMessage({eventType:e,eventId:p,data:t},[o.port2])}).finally(()=>{u&&this.removeMessageHandler(u)})}}/** 3599 * @license 3600 * Copyright 2020 Google LLC 3601 * 3602 * Licensed under the Apache License, Version 2.0 (the "License"); 3603 * you may not use this file except in compliance with the License. 3604 * You may obtain a copy of the License at 3605 * 3606 * http://www.apache.org/licenses/LICENSE-2.0 3607 * 3608 * Unless required by applicable law or agreed to in writing, software 3609 * distributed under the License is distributed on an "AS IS" BASIS, 3610 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3611 * See the License for the specific language governing permissions and 3612 * limitations under the License. 3613 */function jo(){return window}function S9(n){jo().location.href=n}/** 3614 * @license 3615 * Copyright 2020 Google LLC. 3616 * 3617 * Licensed under the Apache License, Version 2.0 (the "License"); 3618 * you may not use this file except in compliance with the License. 3619 * You may obtain a copy of the License at 3620 * 3621 * http://www.apache.org/licenses/LICENSE-2.0 3622 * 3623 * Unless required by applicable law or agreed to in writing, software 3624 * distributed under the License is distributed on an "AS IS" BASIS, 3625 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3626 * See the License for the specific language governing permissions and 3627 * limitations under the License. 3628 */function Sj(){return typeof jo().WorkerGlobalScope<"u"&&typeof jo().importScripts=="function"}async function j9(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function A9(){var n;return((n=navigator==null?void 0:navigator.serviceWorker)==null?void 0:n.controller)||null}function k9(){return Sj()?self:null}/** 3629 * @license 3630 * Copyright 2019 Google LLC 3631 * 3632 * Licensed under the Apache License, Version 2.0 (the "License"); 3633 * you may not use this file except in compliance with the License. 3634 * You may obtain a copy of the License at 3635 * 3636 * http://www.apache.org/licenses/LICENSE-2.0 3637 * 3638 * Unless required by applicable law or agreed to in writing, software 3639 * distributed under the License is distributed on an "AS IS" BASIS, 3640 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3641 * See the License for the specific language governing permissions and 3642 * limitations under the License. 3643 */const jj="firebaseLocalStorageDb",R9=1,xg="firebaseLocalStorage",Aj="fbase_key";class gp{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function ux(n,e){return n.transaction([xg],e?"readwrite":"readonly").objectStore(xg)}function I9(){const n=indexedDB.deleteDatabase(jj);return new gp(n).toPromise()}function kj(){const n=indexedDB.open(jj,R9);return new Promise((e,t)=>
3643{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const s=n.result;try{s.createObjectStore(xg,{keyPath:Aj})}catch(o){t(o)}}),n.addEventListener("success",async()=>{const s=n.result;s.objectStoreNames.contains(xg)?e(s):(s.close(),await I9(),e(await kj()))})})}async function T5(n,e,t){const s=ux(n,!0).put({[Aj]:e,value:t});return new gp(s).toPromise()}async function O9(n,e){const t=ux(n,!1).get(e),s=await new gp(t).toPromise();return s===void 0?null:s.value}function S5(n,e){const t=ux(n,!0).delete(e);return new gp(t).toPromise()}const L9=800,M9=3;class Rj{registerLifecycleListeners(){typeof window<"u"&&typeof window.addEventListener=="function"&&(window.addEventListener("pagehide",this.onPageHide),window.addEventListener("pageshow",this.onPageShow))}unregisterLifecycleListeners(){typeof window<"u"&&typeof window.removeEventListener=="function"&&(window.removeEventListener("pagehide",this.onPageHide),window.removeEventListener("pageshow",this.onPageShow))}constructor(){this.type="LOCAL",this.dbPromise=null,this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.isClosing=!1,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this.onPageHide=()=>{this.isClosing=!0,this.stopPolling(),this.dbPromise&&(this.dbPromise.then(e=>e.close()).catch(()=>{}),this.dbPromise=null)},this.onPageShow=()=>{this.isClosing&&(this.isClosing=!1,Object.keys(this.listeners).length>0&&this.startPolling())},this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.dbPromise?this.dbPromise:(this.dbPromise=kj(),this.dbPromise.catch(()=>{this.dbPromise=null}),this.dbPromise)}async _withRetries(e){let t=0;for(;;)try{const s=await this._openDb();return await e(s)}catch(s){if(t++>M9)throw s;if(this.dbPromise){const o=this.dbPromise;this.dbPromise=null;try{(await o).close()}catch{}}}}async initializeServiceWorkerMessaging(){return Sj()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=cx._getInstance(k9()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var t,s;if(this.activeServiceWorker=await j9(),!this.activeServiceWorker)return;this.sender=new T9(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&(t=e[0])!=null&&t.fulfilled&&(s=e[0])!=null&&s.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||A9()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{return indexedDB?(await this._withRetries(async e=>{await T5(e,gg,"1"),await S5(e,gg)}),!0):!1}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(s=>T5(s,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(s=>O9(s,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>S5(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){if(this.isClosing)return[];try{const e=await this._withRetries(o=>{const l=ux(o,!1).getAll();return new gp(l).toPromise()});if(this.isClosing)return[];if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],s=new Set;if(e.length!==0)for(const{fbase_key:o,value:l}of e)s.add(o),JSON.stringify(this.localCache[o])!==JSON.stringify(l)&&(this.notifyListeners(o,l),t.push(o));for(const o of Object.keys(this.localCache))this.localCache[o]&&!s.has(o)&&(this.notifyListeners(o,null),t.push(o));return t}catch(e){return this.isClosing||RB(`Firebase Auth cross-tab polling failed with error: ${e}`),[]}}notifyListeners(e,t){this.localCache[e]=t;const s=this.listeners[e];if(s)for(const o of Array.from(s))o(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),L9)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.startPolling(),this.registerLifecycleListeners()),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Ob
vendor: 4,356 bytes, lines 3643-3692
3643ject.keys(this.listeners).length===0&&(this.stopPolling(),this.unregisterLifecycleListeners())}}Rj.type="LOCAL";const P9=Rj;new mp(3e4,6e4);/** 3644 * @license 3645 * Copyright 2021 Google LLC 3646 * 3647 * Licensed under the Apache License, Version 2.0 (the "License"); 3648 * you may not use this file except in compliance with the License. 3649 * You may obtain a copy of the License at 3650 * 3651 * http://www.apache.org/licenses/LICENSE-2.0 3652 * 3653 * Unless required by applicable law or agreed to in writing, software 3654 * distributed under the License is distributed on an "AS IS" BASIS, 3655 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3656 * See the License for the specific language governing permissions and 3657 * limitations under the License. 3658 */function Ij(n,e){return e?hl(e):(It(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/** 3659 * @license 3660 * Copyright 2019 Google LLC 3661 * 3662 * Licensed under the Apache License, Version 2.0 (the "License"); 3663 * you may not use this file except in compliance with the License. 3664 * You may obtain a copy of the License at 3665 * 3666 * http://www.apache.org/licenses/LICENSE-2.0 3667 * 3668 * Unless required by applicable law or agreed to in writing, software 3669 * distributed under the License is distributed on an "AS IS" BASIS, 3670 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3671 * See the License for the specific language governing permissions and 3672 * limitations under the License. 3673 */class Iv extends _j{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return ch(e,this._buildIdpRequest())}_linkToIdToken(e,t){return ch(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return ch(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function z9(n){return C9(n.auth,new Iv(n),n.bypassAuthState)}function F9(n){const{auth:e,user:t}=n;return It(t,e,"internal-error"),b9(t,new Iv(n),n.bypassAuthState)}async function V9(n){const{auth:e,user:t}=n;return It(t,e,"internal-error"),x9(t,new Iv(n),n.bypassAuthState)}/** 3674 * @license 3675 * Copyright 2020 Google LLC 3676 * 3677 * Licensed under the Apache License, Version 2.0 (the "License"); 3678 * you may not use this file except in compliance with the License. 3679 * You may obtain a copy of the License at 3680 * 3681 * http://www.apache.org/licenses/LICENSE-2.0 3682 * 3683 * Unless required by applicable law or agreed to in writing, software 3684 * distributed under the License is distributed on an "AS IS" BASIS, 3685 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3686 * See the License for the specific language governing permissions and 3687 * limitations under the License. 3688 */class Oj{constructor(e,t,s,o,l=!1){this.auth=e,this.resolver=s,this.user=o,this.bypassAuthState=l,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(s){this.reject(s)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:s,postBody:o,tenantId:l,error:u,type:h}=e;if(u){this.reject(u);return}const f={auth:this.auth,requestUri:t,sessionId:s,tenantId:l||void 0,postBody:o||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(h)(f))}catch(p){this.reject(p)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return z9;case"linkViaPopup":case"linkViaRedirect":return V9;case"reauthViaPopup":case"reauthViaRedirect":return F9;default:Lo(this.auth,"internal-error")}}resolve(e){wl(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){wl(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()}}/** 3689 * @license 3690 * Copyright 2020 Google LLC 3691 * 3692 * Licensed under the Apache License, Version 2.0 (the "License");
3693 * you may not use this file except in compliance with the License. 3694 * You may obtain a copy of the License at 3695 * 3696 * http://www.apache.org/licenses/LICENSE-2.0 3697 * 3698 * Unless required by applicable law or agreed to in writing, software 3699 * distributed under the License is distributed on an "AS IS" BASIS, 3700 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3701 * See the License for the specific language governing permissions and 3702 * limitations under the License. 3703 */const U9=new mp(2e3,1e4);async function G9(n,e,t){if(Wi(n.app))return Promise.reject(Fa(n,"operation-not-supported-in-this-environment"));const s=pp(n);MF(n,e,kv);const o=Ij(s,t);return new Nu(s,"signInViaPopup",e,o).executeNotNull()}class Nu extends Oj{constructor(e,t,s,o,l){super(e,t,o,l),this.provider=s,this.authWindow=null,this.pollId=null,Nu.currentPopupAction&&Nu.currentPopupAction.cancel(),Nu.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return It(e,this.auth,"internal-error"),e}async onExecution(){wl(this.filter.length===1,"Popup operations only handle one event");const e=Rv();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(Fa(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)==null?void 0:e.associatedEvent)||null}cancel(){this.reject(Fa(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Nu.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,s;if((s=(t=this.authWindow)==null?void 0:t.window)!=null&&s.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Fa(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,U9.get())};e()}}Nu.currentPopupAction=null;/** 3704 * @license 3705 * Copyright 2020 Google LLC 3706 * 3707 * Licensed under the Apache License, Version 2.0 (the "License"); 3708 * you may not use this file except in compliance with the License. 3709 * You may obtain a copy of the License at 3710 * 3711 * http://www.apache.org/licenses/LICENSE-2.0 3712 * 3713 * Unless required by applicable law or agreed to in writing, software 3714 * distributed under the License is distributed on an "AS IS" BASIS, 3715 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3716 * See the License for the specific language governing permissions and 3717 * limitations under the License. 3718 */const H9="pendingRedirect",LB=new Map;class q9 extends Oj{constructor(e,t,s=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,s),this.eventId=null}async execute(){let e=LB.get(this.auth._key());if(!e){try{const s=await $9(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(s)}catch(t){e=()=>Promise.reject(t)}LB.set(this.auth._key(),e)}return this.bypassAuthState||LB.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 t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function $9(n,e){const t=Q9(e),s=K9(n);if(!await s._isAvailable())return!1;const o=await s._get(t)==="true";return await s._remove(t),o}function J9(n,e){LB.set(n._key(),e)}function K9(n){return hl(n._redirectPersistence)}function Q9(n){return OB(H9,n.config.apiKey,n.name)}async function Y9(n,e,t=!1){if(Wi(n.app))return Promise.reject(Dc(n));const s=pp(n),o=Ij(s,e),u=await new q9(s,o,t).execute();return u&&!t&&(delete u.user._redirectEventId,await s._persistUserIfCurrent(u.user),await s._setRedirectUser(null,e)),u}/** 3719 * @license 3720 * Copyright 2020 Google LLC 3721 * 3722 * Licensed under the Apache License, Version 2.0 (the "License"); 3723 * you may not use this file except in compliance with the License. 3724 * You may obtain a copy of the License at 3725 * 3726 * http://www.apache.org/licenses/LICENSE-2.0 3727 * 3728 * Unless required by applicable law or agreed to in writing, softw
3728are 3729 * distributed under the License is distributed on an "AS IS" BASIS, 3730 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3731 * See the License for the specific language governing permissions and 3732 * limitations under the License. 3733 */const X9=600*1e3;class W9{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(s=>{this.isEventForConsumer(e,s)&&(t=!0,this.sendToConsumer(e,s),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Z9(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var s;if(e.error&&!Lj(e)){const o=((s=e.error.code)==null?void 0:s.split("auth/")[1])||"internal-error";t.onError(Fa(this.auth,o))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const s=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&s}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=X9&&this.cachedEventUids.clear(),this.cachedEventUids.has(j5(e))}saveEventToCache(e){this.cachedEventUids.add(j5(e)),this.lastProcessedEventTime=Date.now()}}function j5(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function Lj({type:n,error:e}){return n==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function Z9(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Lj(n);default:return!1}}/** 3734 * @license 3735 * Copyright 2020 Google LLC 3736 * 3737 * Licensed under the Apache License, Version 2.0 (the "License"); 3738 * you may not use this file except in compliance with the License. 3739 * You may obtain a copy of the License at 3740 * 3741 * http://www.apache.org/licenses/LICENSE-2.0 3742 * 3743 * Unless required by applicable law or agreed to in writing, software 3744 * distributed under the License is distributed on an "AS IS" BASIS, 3745 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3746 * See the License for the specific language governing permissions and 3747 * limitations under the License. 3748 */async function eV(n,e={}){return Vh(n,"GET","/v1/projects",e)}/** 3749 * @license 3750 * Copyright 2020 Google LLC 3751 * 3752 * Licensed under the Apache License, Version 2.0 (the "License"); 3753 * you may not use this file except in compliance with the License. 3754 * You may obtain a copy of the License at 3755 * 3756 * http://www.apache.org/licenses/LICENSE-2.0 3757 * 3758 * Unless required by applicable law or agreed to in writing, software 3759 * distributed under the License is distributed on an "AS IS" BASIS, 3760 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3761 * See the License for the specific language governing permissions and 3762 * limitations under the License. 3763 */const tV=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,nV=/^https?/;async function sV(n){if(n.config.emulator)return;const{authorizedDomains:e}=await eV(n);for(const t of e)try{if(rV(t))return}catch{}Lo(n,"unauthorized-domain")}function rV(n){const e=o1(),{protocol:t,hostname:s}=new URL(e);if(n.startsWith("chrome-extension://")){const u=new URL(n);return u.hostname===""&&s===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&u.hostname===s}if(!nV.test(t))return!1;if(tV.test(n))return s===n;const o=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+o+"|"+o+")$","i").test(s)}/** 3764 * @license 3765 * Copyright 2020 Google LLC. 3766 * 3767 * Licensed under the Apache License, Version 2.0 (the "License"); 3768 * you may not use this file except in compliance with the License. 3769 * You may obtain a copy of the License at 3770 * 3771 * http://www.apache.org/licenses/LICENSE-2.0 3772 * 3773 * Unless required by applicable law or agreed to in writing, softw
3773are 3774 * distributed under the License is distributed on an "AS IS" BASIS, 3775 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3776 * See the License for the specific language governing permissions and 3777 * limitations under the License. 3778 */const iV=new mp(3e4,6e4);function A5(){const n=jo().___jsl;if(n!=null&&n.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t<n.CP.length;t++)n.CP[t]=null}}function aV(n){return new Promise((e,t)=>{var o,l,u;function s(){A5(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{A5(),t(Fa(n,"network-request-failed"))},timeout:iV.get()})}if((l=(o=jo().gapi)==null?void 0:o.iframes)!=null&&l.Iframe)e(gapi.iframes.getContext());else if((u=jo().gapi)!=null&&u.load)s();else{const h=c9("iframefcb");return jo()[h]=()=>{gapi.load?s():t(Fa(n,"network-request-failed"))},o9(`${l9()}?onload=${h}`).catch(f=>t(f))}}).catch(e=>{throw MB=null,e})}let MB=null;function oV(n){return MB=MB||aV(n),MB}/** 3779 * @license 3780 * Copyright 2020 Google LLC. 3781 * 3782 * Licensed under the Apache License, Version 2.0 (the "License"); 3783 * you may not use this file except in compliance with the License. 3784 * You may obtain a copy of the License at 3785 * 3786 * http://www.apache.org/licenses/LICENSE-2.0 3787 * 3788 * Unless required by applicable law or agreed to in writing, software 3789 * distributed under the License is distributed on an "AS IS" BASIS, 3790 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3791 * See the License for the specific language governing permissions and 3792 * limitations under the License. 3793 */const lV=new mp(5e3,15e3),cV="__/auth/iframe",uV="emulator/auth/iframe",dV={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},hV=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function fV(n){const e=n.config;It(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?Tv(e,uV):`https://${n.config.authDomain}/${cV}`,s={apiKey:e.apiKey,appName:n.name,v:$u},o=hV.get(n.config.apiHost);o&&(s.eid=o);const l=n._getFrameworks();return l.length&&(s.fw=l.join(",")),`${t}?${sp(s).slice(1)}`}async function mV(n){const e=await oV(n),t=jo().gapi;return It(t,n,"internal-error"),e.open({where:document.body,url:fV(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:dV,dontclear:!0},s=>new Promise(async(o,l)=>{await s.restyle({setHideOnLeave:!1});const u=Fa(n,"network-request-failed"),h=jo().setTimeout(()=>{l(u)},lV.get());function f(){jo().clearTimeout(h),o(s)}s.ping(f).then(f,()=>{l(u)})}))}/** 3794 * @license 3795 * Copyright 2020 Google LLC. 3796 * 3797 * Licensed under the Apache License, Version 2.0 (the "License"); 3798 * you may not use this file except in compliance with the License. 3799 * You may obtain a copy of the License at 3800 * 3801 * http://www.apache.org/licenses/LICENSE-2.0 3802 * 3803 * Unless required by applicable law or agreed to in writing, software 3804 * distributed under the License is distributed on an "AS IS" BASIS, 3805 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3806 * See the License for the specific language governing permissions and 3807 * limitations under the License. 3808 */const pV={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},BV=500,gV=600,xV="_blank",bV="http://localhost";class k5{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function CV(n,e,t,s=BV,o=gV){const l=Math.max((window.screen.availHeight-o)/2,0).toString(),u=Math.max((window.screen.availWidth-s)/2,0).toString();let h="";const f={...pV,width:s.toString(),height:o.toString(),top:l,left:u},p=Kr().toLowerCase();t&&(h=pj(p)?xV:t),fj(p)&&(e=e||bV,f.scrollbars="yes");const x=Object.entries(f).reduce((C,[N,T])=>`${C}${N}=${T},`,"");if(ZF(p)&&h!=="_self")return yV(e||"",h),new k5(null);const b=window.open(e||"",h,x);It(b,n,"popup-blocked");try{b.focus()}catch{}return new k5(b)}function yV(n,e){const t=document.createElement("a");t.href=n,t.target=e;const s=document.createEvent("MouseEvent");
3808s.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(s)}/** 3809 * @license 3810 * Copyright 2021 Google LLC 3811 * 3812 * Licensed under the Apache License, Version 2.0 (the "License"); 3813 * you may not use this file except in compliance with the License. 3814 * You may obtain a copy of the License at 3815 * 3816 * http://www.apache.org/licenses/LICENSE-2.0 3817 * 3818 * Unless required by applicable law or agreed to in writing, software 3819 * distributed under the License is distributed on an "AS IS" BASIS, 3820 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3821 * See the License for the specific language governing permissions and 3822 * limitations under the License. 3823 */const vV="__/auth/handler",_V="emulator/auth/handler",wV=encodeURIComponent("fac");async function R5(n,e,t,s,o,l){It(n.config.authDomain,n,"auth-domain-config-required"),It(n.config.apiKey,n,"invalid-api-key");const u={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:s,v:$u,eventId:o};if(e instanceof kv){e.setDefaultLanguage(n.languageCode),u.providerId=e.providerId||"",qO(e.getCustomParameters())||(u.customParameters=JSON.stringify(e.getCustomParameters()));for(const[x,b]of Object.entries({}))u[x]=b}if(e instanceof Bp){const x=e.getScopes().filter(b=>b!=="");x.length>0&&(u.scopes=x.join(","))}n.tenantId&&(u.tid=n.tenantId);const h=u;for(const x of Object.keys(h))h[x]===void 0&&delete h[x];const f=await n._getAppCheckToken(),p=f?`#${wV}=${encodeURIComponent(f)}`:"";return`${EV(n)}?${sp(h).slice(1)}${p}`}function EV({config:n}){return n.emulator?Tv(n,_V):`https://${n.authDomain}/${vV}`}/** 3824 * @license 3825 * Copyright 2020 Google LLC 3826 * 3827 * Licensed under the Apache License, Version 2.0 (the "License"); 3828 * you may not use this file except in compliance with the License. 3829 * You may obtain a copy of the License at 3830 * 3831 * http://www.apache.org/licenses/LICENSE-2.0 3832 * 3833 * Unless required by applicable law or agreed to in writing, software 3834 * distributed under the License is distributed on an "AS IS" BASIS, 3835 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3836 * See the License for the specific language governing permissions and 3837 * limitations under the License. 3838 */const ty="webStorageSupport";class NV{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Tj,this._completeRedirectFn=Y9,this._overrideRedirectResult=J9}async _openPopup(e,t,s,o){var u;wl((u=this.eventManagers[e._key()])==null?void 0:u.manager,"_initialize() not called before _openPopup()");const l=await R5(e,t,s,o1(),o);return CV(e,l,Rv())}async _openRedirect(e,t,s,o){await this._originValidation(e);const l=await R5(e,t,s,o1(),o);return S9(l),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:o,promise:l}=this.eventManagers[t];return o?Promise.resolve(o):(wl(l,"If manager is not set, promise should be"),l)}const s=this.initAndGetManager(e);return this.eventManagers[t]={promise:s},s.catch(()=>{delete this.eventManagers[t]}),s}async initAndGetManager(e){const t=await mV(e),s=new W9(e);return t.register("authEvent",o=>(It(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()]=t,s}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(ty,{type:ty},o=>{var u;const l=(u=o==null?void 0:o[0])==null?void 0:u[ty];l!==void 0&&t(!!l),Lo(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=sV(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return Cj()||mj()||jv()}}const DV=NV;var I5="@firebase/auth",O5="1.13.6";/** 3839 * @license 3840 * Copyright 2020 Google LLC 3841 * 3842 * Licensed under the Apache License, Version 2.0 (the "License"); 3843 * you may not use this file except in compliance with the License. 3844 * You may obtain a copy of the License at 3845 * 3846 * http://www.apache.org/licenses/LICENSE-2.0 3847 * 3848 * Unless required by applicable law or agreed to in writing, softw
3848are 3849 * distributed under the License is distributed on an "AS IS" BASIS, 3850 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3851 * See the License for the specific language governing permissions and 3852 * limitations under the License. 3853 */class TV{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 t=this.auth.onIdTokenChanged(s=>{e((s==null?void 0:s.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){It(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** 3854 * @license 3855 * Copyright 2020 Google LLC 3856 * 3857 * Licensed under the Apache License, Version 2.0 (the "License"); 3858 * you may not use this file except in compliance with the License. 3859 * You may obtain a copy of the License at 3860 * 3861 * http://www.apache.org/licenses/LICENSE-2.0 3862 * 3863 * Unless required by applicable law or agreed to in writing, software 3864 * distributed under the License is distributed on an "AS IS" BASIS, 3865 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3866 * See the License for the specific language governing permissions and 3867 * limitations under the License. 3868 */function SV(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function jV(n){zu(new Tc("auth",(e,{options:t})=>{const s=e.getProvider("app").getImmediate(),o=e.getProvider("heartbeat"),l=e.getProvider("app-check-internal"),{apiKey:u,authDomain:h}=s.options;It(u&&!u.includes(":"),"invalid-api-key",{appName:s.name});const f={apiKey:u,authDomain:h,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:yj(n)},p=new i9(s,o,l,f);return d9(p,t),p},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,s)=>{e.getProvider("auth-internal").initialize()})),zu(new Tc("auth-internal",e=>{const t=pp(e.getProvider("auth").getImmediate());return(s=>new TV(s))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),No(I5,O5,SV(n)),No(I5,O5,"esm2020")}/** 3869 * @license 3870 * Copyright 2021 Google LLC 3871 * 3872 * Licensed under the Apache License, Version 2.0 (the "License"); 3873 * you may not use this file except in compliance with the License. 3874 * You may obtain a copy of the License at 3875 * 3876 * http://www.apache.org/licenses/LICENSE-2.0 3877 * 3878 * Unless required by applicable law or agreed to in writing, software 3879 * distributed under the License is distributed on an "AS IS" BASIS, 3880 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3881 * See the License for the specific language governing permissions and 3882 * limitations under the License. 3883 */const AV=300,kV=qD("authIdTokenMaxAge")||AV;let L5=null;const RV=n=>async e=>{const t=e&&await e.getIdTokenResult(),s=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(s&&s>kV)return;const o=t==null?void 0:t.token;L5!==o&&(L5=o,await fetch(n,{method:o?"POST":"DELETE",headers:o?{Authorization:`Bearer ${o}`}:{}}))};function IV(n=T1()){const e=kg(n,"auth");if(e.isInitialized())return e.getImmediate();const t=u9(n,{popupRedirectResolver:DV,persistence:[P9,N9,Tj]}),s=qD("authTokenSyncURL");if(s&&typeof isSecureContext=="boolean"&&isSecureContext){const l=new URL(s,location.origin);if(location.origin===l.origin){const u=RV(l.toString());v9(t,u,()=>u(t.currentUser)),y9(t,h=>u(h))}}const o=UD("auth");return o&&h9(t,`http://${o}`),t}function OV(){var n;return((n=document.getElementsByTagName("head"))==null?void 0:n[0])??document}a9({loadJS(n){return new Promise((e,t)=>
3883{const s=document.createElement("script");s.setAttribute("src",n),s.onload=e,s.onerror=o=>{const l=Fa("internal-error");l.customData=o,t(l)},s.type="text/javascript",s.charset="UTF-8",OV().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="});jV("Browser");var LV="firebase",MV="12.19.0";/** 3884 * @license 3885 * Copyright 2020 Google LLC 3886 * 3887 * Licensed under the Apache License, Version 2.0 (the "License"); 3888 * you may not use this file except in compliance with the License. 3889 * You may obtain a copy of the License at 3890 * 3891 * http://www.apache.org/licenses/LICENSE-2.0 3892 * 3893 * Unless required by applicable law or agreed to in writing, software 3894 * distributed under the License is distributed on an "AS IS" BASIS, 3895 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3896 * See the License for the specific language governing permissions and 3897 * limitations under the License. 3898 */No(LV,MV,"app");/** 3899 * @license 3900 * Copyright 2017 Google LLC 3901 * 3902 * Licensed under the Apache License, Version 2.0 (the "License"); 3903 * you may not use this file except in compliance with the License. 3904 * You may obtain a copy of the License at 3905 * 3906 * http://www.apache.org/licenses/LICENSE-2.0 3907 * 3908 * Unless required by applicable law or agreed to in writing, software 3909 * distributed under the License is distributed on an "AS IS" BASIS, 3910 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3911 * See the License for the specific language governing permissions and 3912 * limitations under the License. 3913 */const Mj="firebasestorage.googleapis.com",Pj="storageBucket",PV=120*1e3,zV=600*1e3,FV=1e3;/** 3914 * @license 3915 * Copyright 2017 Google LLC 3916 * 3917 * Licensed under the Apache License, Version 2.0 (the "License"); 3918 * you may not use this file except in compliance with the License. 3919 * You may obtain a copy of the License at 3920 * 3921 * http://www.apache.org/licenses/LICENSE-2.0 3922 * 3923 * Unless required by applicable law or agreed to in writing, software 3924 * distributed under the License is distributed on an "AS IS" BASIS, 3925 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3926 * See the License for the specific language governing permissions and 3927 * limitations under the License. 3928 */class Rs extends Mo{constructor(e,t,s=0){super(ny(e),`Firebase Storage: ${t} (${ny(e)})`),this.status_=s,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,Rs.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return ny(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage} 3929${this.customData.serverResponse}`:this.message=this._baseMessage}}var gs;(function(n){n.UNKNOWN="unknown",n.OBJECT_NOT_FOUND="object-not-found",n.BUCKET_NOT_FOUND="bucket-not-found",n.PROJECT_NOT_FOUND="project-not-found",n.QUOTA_EXCEEDED="quota-exceeded",n.UNAUTHENTICATED="unauthenticated",n.UNAUTHORIZED="unauthorized",n.UNAUTHORIZED_APP="unauthorized-app",n.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",n.INVALID_CHECKSUM="invalid-checksum",n.CANCELED="canceled",n.INVALID_EVENT_NAME="invalid-event-name",n.INVALID_URL="invalid-url",n.INVALID_DEFAULT_BUCKET="invalid-default-bucket",n.NO_DEFAULT_BUCKET="no-default-bucket",n.CANNOT_SLICE_BLOB="cannot-slice-blob",n.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",n.NO_DOWNLOAD_URL="no-download-url",n.INVALID_ARGUMENT="invalid-argument",n.INVALID_ARGUMENT_COUNT="invalid-argument-count",n.APP_DELETED="app-deleted",n.INVALID_ROOT_OPERATION="invalid-root-operation",n.INVALID_FORMAT="invalid-format",n.INTERNAL_ERROR="internal-error",n.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(gs||(gs={}));function ny(n){return"storage/"+n}function Ov(){const n="An unknown error occurred, please check the error payload for server response.";return new Rs(gs.UNKNOWN,n)}function VV(n){return new Rs(gs.OBJECT_NOT_FOUND,"Object '"+n+"' does not exist.")}function UV(n){return new Rs(gs.QUOTA_EXCEEDED,"Quota for bucket '"+n+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function GV(){const n="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new Rs(gs.UNAUTHENTICATED,n)}function HV(){return new Rs(gs.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function qV(n){return new Rs(gs.UNAUTHORIZED,"User does not have permission to access '"+n+"'.")}function zj(){return new Rs(gs.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function Fj(){return new Rs(gs.CANCELED,"User canceled the upload/download.")}function $V(n){return new Rs(gs.INVALID_URL,"Invalid URL '"+n+"'.")}function JV(n){return new Rs(gs.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+n+"'.")}function KV(){return new Rs(gs.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+Pj+"' property when initializing the app?")}function Vj(){return new Rs(gs.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function QV(){return new Rs(gs.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.")}function YV(){return new Rs(gs.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function XV(n){return new Rs(gs.UNSUPPORTED_ENVIRONMENT,`${n} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function c1(n){return new Rs(gs.INVALID_ARGUMENT,n)}function Uj(){return new Rs(gs.APP_DELETED,"The Firebase app was deleted.")}function WV(n){return new Rs(gs.INVALID_ROOT_OPERATION,"The operation '"+n+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function _m(n,e){return new Rs(gs.INVALID_FORMAT,"String does not match format '"+n+"': "+e)}function Wf(n){throw new Rs(gs.INTERNAL_ERROR,"Internal error: "+n)}/** 3930 * @license 3931 * Copyright 2017 Google LLC 3932 * 3933 * Licensed under the Apache License, Version 2.0 (the "License");
3934 * you may not use this file except in compliance with the License. 3935 * You may obtain a copy of the License at 3936 * 3937 * http://www.apache.org/licenses/LICENSE-2.0 3938 * 3939 * Unless required by applicable law or agreed to in writing, software 3940 * distributed under the License is distributed on an "AS IS" BASIS, 3941 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3942 * See the License for the specific language governing permissions and 3943 * limitations under the License. 3944 */class ta{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,t){let s;try{s=ta.makeFromUrl(e,t)}catch{return new ta(e,"")}if(s.path==="")return s;throw JV(e)}static makeFromUrl(e,t){let s=null;const o="([A-Za-z0-9.\\-_]+)";function l(H){H.path.charAt(H.path.length-1)==="/"&&(H.path_=H.path_.slice(0,-1))}const u="(/(.*))?$",h=new RegExp("^gs://"+o+u,"i"),f={bucket:1,path:3};function p(H){H.path_=decodeURIComponent(H.path)}const x="v[A-Za-z0-9_]+",b=t.replace(/[.]/g,"\\."),C="(/([^?#]*).*)?$",N=new RegExp(`^https?://${b}/${x}/b/${o}/o${C}`,"i"),T={bucket:1,path:3},R=t===Mj?"(?:storage.googleapis.com|storage.cloud.google.com)":t,A="([^?#]*)",U=new RegExp(`^https?://${R}/${o}/${A}`,"i"),V=[{regex:h,indices:f,postModify:l},{regex:N,indices:T,postModify:p},{regex:U,indices:{bucket:1,path:2},postModify:p}];for(let H=0;H<V.length;H++){const Q=V[H],Y=Q.regex.exec(e);if(Y){const k=Y[Q.indices.bucket];let E=Y[Q.indices.path];E||(E=""),s=new ta(k,E),Q.postModify(s);break}}if(s==null)throw $V(e);return s}}class ZV{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}/** 3945 * @license 3946 * Copyright 2017 Google LLC 3947 * 3948 * Licensed under the Apache License, Version 2.0 (the "License"); 3949 * you may not use this file except in compliance with the License. 3950 * You may obtain a copy of the License at 3951 * 3952 * http://www.apache.org/licenses/LICENSE-2.0 3953 * 3954 * Unless required by applicable law or agreed to in writing, software 3955 * distributed under the License is distributed on an "AS IS" BASIS, 3956 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3957 * See the License for the specific language governing permissions and 3958 * limitations under the License. 3959 */function eU(n,e,t){let s=1,o=null,l=null,u=!1,h=0;function f(){return h===2}let p=!1;function x(...A){p||(p=!0,e.apply(null,A))}function b(A){o=setTimeout(()=>{o=null,n(N,f())},A)}function C(){l&&clearTimeout(l)}function N(A,...U){if(p){C();return}if(A){C(),x.call(null,A,...U);return}if(f()||u){C(),x.call(null,A,...U);return}s<64&&(s*=2);let V;h===1?(h=2,V=0):V=(s+Math.random())*1e3,b(V)}let T=!1;function R(A){T||(T=!0,C(),!p&&(o!==null?(A||(h=2),clearTimeout(o),b(0)):A||(h=1)))}return b(0),l=setTimeout(()=>{u=!0,R(!0)},t),R}function tU(n){n(!1)}/** 3960 * @license 3961 * Copyright 2017 Google LLC 3962 * 3963 * Licensed under the Apache License, Version 2.0 (the "License"); 3964 * you may not use this file except in compliance with the License. 3965 * You may obtain a copy of the License at 3966 * 3967 * http://www.apache.org/licenses/LICENSE-2.0 3968 * 3969 * Unless required by applicable law or agreed to in writing, software 3970 * distributed under the License is distributed on an "AS IS" BASIS, 3971 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3972 * See the License for the specific language governing permissions and 3973 * limitations under the License. 3974 */function nU(n){return n!==void 0}function sU(n){return typeof n=="function"}function rU(n){return typeof n=="object"&&!Array.isArray(n)}function dx(n){return typeof n=="string"||n instanceof String}function M5(n){return Lv()&&n instanceof Blob}function Lv(){return typeof Blob<"u"}function P5(n,e,t,s){if(s<e)throw c1(`Invalid value for '${n}'. Expected ${e} or greater.`);if(s>t)throw c1(`Invalid value for '${n}'. Expected ${t} or less.`)}/** 3975 * @license 3976 * Copyright 2017 Google LLC 3977 * 3978 * Licensed under the Apache License, Version 2.0 (the "License");
3979 * you may not use this file except in compliance with the License. 3980 * You may obtain a copy of the License at 3981 * 3982 * http://www.apache.org/licenses/LICENSE-2.0 3983 * 3984 * Unless required by applicable law or agreed to in writing, software 3985 * distributed under the License is distributed on an "AS IS" BASIS, 3986 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3987 * See the License for the specific language governing permissions and 3988 * limitations under the License. 3989 */function xp(n,e,t){let s=e;return t==null&&(s=`https://${e}`),`${t}://${s}/v0${n}`}function Gj(n){const e=encodeURIComponent;let t="?";for(const s in n)if(n.hasOwnProperty(s)){const o=e(s)+"="+e(n[s]);t=t+o+"&"}return t=t.slice(0,-1),t}var Iu;(function(n){n[n.NO_ERROR=0]="NO_ERROR",n[n.NETWORK_ERROR=1]="NETWORK_ERROR",n[n.ABORT=2]="ABORT"})(Iu||(Iu={}));/** 3990 * @license 3991 * Copyright 2022 Google LLC 3992 * 3993 * Licensed under the Apache License, Version 2.0 (the "License"); 3994 * you may not use this file except in compliance with the License. 3995 * You may obtain a copy of the License at 3996 * 3997 * http://www.apache.org/licenses/LICENSE-2.0 3998 * 3999 * Unless required by applicable law or agreed to in writing, software 4000 * distributed under the License is distributed on an "AS IS" BASIS, 4001 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4002 * See the License for the specific language governing permissions and 4003 * limitations under the License. 4004 */function Hj(n,e){const t=n>=500&&n<600,o=[408,429].indexOf(n)!==-1,l=e.indexOf(n)!==-1;return t||o||l}/** 4005 * @license 4006 * Copyright 2017 Google LLC 4007 * 4008 * Licensed under the Apache License, Version 2.0 (the "License"); 4009 * you may not use this file except in compliance with the License. 4010 * You may obtain a copy of the License at 4011 * 4012 * http://www.apache.org/licenses/LICENSE-2.0 4013 * 4014 * Unless required by applicable law or agreed to in writing, software 4015 * distributed under the License is distributed on an "AS IS" BASIS, 4016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4017 * See the License for the specific language governing permissions and 4018 * limitations under the License. 4019 */class iU{constructor(e,t,s,o,l,u,h,f,p,x,b,C=!0,N=!1){this.url_=e,this.method_=t,this.headers_=s,this.body_=o,this.successCodes_=l,this.additionalRetryCodes_=u,this.callback_=h,this.errorCallback_=f,this.timeout_=p,this.progressCallback_=x,this.connectionFactory_=b,this.retry=C,this.isUsingEmulator=N,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((T,R)=>{this.resolve_=T,this.reject_=R,this.start_()})}start_(){const e=(s,o)=>{if(o){s(!1,new aB(!1,null,!0));return}const l=this.connectionFactory_();this.pendingConnection_=l;const u=h=>{const f=h.loaded,p=h.lengthComputable?h.total:-1;this.progressCallback_!==null&&this.progressCallback_(f,p)};this.progressCallback_!==null&&l.addUploadProgressListener(u),l.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&l.removeUploadProgressListener(u),this.pendingConnection_=null;const h=l.getErrorCode()===Iu.NO_ERROR,f=l.getStatus();if(!h||Hj(f,this.additionalRetryCodes_)&&this.retry){const x=l.getErrorCode()===Iu.ABORT;s(!1,new aB(!1,null,x));return}const p=this.successCodes_.indexOf(f)!==-1;s(!0,new aB(p,l))})},t=(s,o)=>{const l=this.resolve_,u=this.reject_,h=o.connection;if(o.wasSuccessCode)try{const f=this.callback_(h,h.getResponse());nU(f)?l(f):l()}catch(f){u(f)}else if(h!==null){const f=Ov();f.serverResponse=h.getErrorText(),this.errorCallback_?u(this.errorCallback_(h,f)):u(f)}else if(o.canceled){const f=this.appDelete_?Uj():Fj();u(f)}else{const f=zj();u(f)}};this.canceled_?t(!1,new aB(!1,null,!0)):this.backoffId_=eU(e,t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&tU(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class aB{constructor(e,t,s){this.wasSuccessCode=e,this.connection=t,this.canceled=!!s}}function aU(n,e){e!==null&&e.length>0&&(n.Authorization="Firebase "+e)}function oU(n,e){n["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function lU(n,e){e&&(n["X-Firebase-GMPID"]=e)}function cU(n,e){e!==null&&(n["X-Firebase-AppCheck"]=e)}
4019function uU(n,e,t,s,o,l,u=!0,h=!1){const f=Gj(n.urlParams),p=n.url+f,x=Object.assign({},n.headers);return lU(x,e),aU(x,t),oU(x,l),cU(x,s),new iU(p,n.method,x,n.body,n.successCodes,n.additionalRetryCodes,n.handler,n.errorHandler,n.timeout,n.progressCallback,o,u,h)}/** 4020 * @license 4021 * Copyright 2017 Google LLC 4022 * 4023 * Licensed under the Apache License, Version 2.0 (the "License"); 4024 * you may not use this file except in compliance with the License. 4025 * You may obtain a copy of the License at 4026 * 4027 * http://www.apache.org/licenses/LICENSE-2.0 4028 * 4029 * Unless required by applicable law or agreed to in writing, software 4030 * distributed under the License is distributed on an "AS IS" BASIS, 4031 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4032 * See the License for the specific language governing permissions and 4033 * limitations under the License. 4034 */function dU(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function hU(...n){const e=dU();if(e!==void 0){const t=new e;for(let s=0;s<n.length;s++)t.append(n[s]);return t.getBlob()}else{if(Lv())return new Blob(n);throw new Rs(gs.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}}function fU(n,e,t){return n.webkitSlice?n.webkitSlice(e,t):n.mozSlice?n.mozSlice(e,t):n.slice?n.slice(e,t):null}/** 4035 * @license 4036 * Copyright 2021 Google LLC 4037 * 4038 * Licensed under the Apache License, Version 2.0 (the "License"); 4039 * you may not use this file except in compliance with the License. 4040 * You may obtain a copy of the License at 4041 * 4042 * http://www.apache.org/licenses/LICENSE-2.0 4043 * 4044 * Unless required by applicable law or agreed to in writing, software 4045 * distributed under the License is distributed on an "AS IS" BASIS, 4046 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4047 * See the License for the specific language governing permissions and 4048 * limitations under the License. 4049 */function mU(n){if(typeof atob>"u")throw XV("base-64");return atob(n)}/** 4050 * @license 4051 * Copyright 2017 Google LLC 4052 * 4053 * Licensed under the Apache License, Version 2.0 (the "License"); 4054 * you may not use this file except in compliance with the License. 4055 * You may obtain a copy of the License at 4056 * 4057 * http://www.apache.org/licenses/LICENSE-2.0 4058 * 4059 * Unless required by applicable law or agreed to in writing, software 4060 * distributed under the License is distributed on an "AS IS" BASIS, 4061 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4062 * See the License for the specific language governing permissions and 4063 * limitations under the License. 4064 */const wo={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class sy{constructor(e,t){this.data=e,this.contentType=t||null}}function pU(n,e){switch(n){case wo.RAW:return new sy(qj(e));case wo.BASE64:case wo.BASE64URL:return new sy($j(n,e));case wo.DATA_URL:return new sy(gU(e),xU(e))}throw Ov()}function qj(n){const e=[];for(let t=0;t<n.length;t++){let s=n.charCodeAt(t);if(s<=127)e.push(s);else if(s<=2047)e.push(192|s>>6,128|s&63);else if((s&64512)===55296)if(!(t<n.length-1&&(n.charCodeAt(t+1)&64512)===56320))e.push(239,191,189);else{const l=s,u=n.charCodeAt(++t);s=65536|(l&1023)<<10|u&1023,e.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|s&63)}else(s&64512)===56320?e.push(239,191,189):e.push(224|s>>12,128|s>>6&63,128|s&63)}return new Uint8Array(e)}function BU(n){let e;try{e=decodeURIComponent(n)}catch{throw _m(wo.DATA_URL,"Malformed data URL.")}return qj(e)}function $j(n,e){switch(n){case wo.BASE64:{const o=e.indexOf("-")!==-1,l=e.indexOf("_")!==-1;if(o||l)throw _m(n,"Invalid character '"+(o?"-":"_")+"' found: is it base64url encoded?");break}case wo.BASE64URL:{const o=e.indexOf("+")!==-1,l=e.indexOf("/")!==-1;if(o||l)throw _m(n,"Invalid character '"+(o?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/");break}}let t;try{t=mU(e)}catch(o){throw o.message.includes("polyfill")?o:_m(n,"Invalid character found")}const s=new Uint8Array(t.length);for(let o=0;o<t.length;o++)s[o]=t.charCodeAt(o);return s}class Jj{constructor(e){this.base64=!1,this.contentType=null;const t=e.match(/^data:([^,]+)?,/);if(t===null)throw _m(wo.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const s=t[1]||null;s!=null&&(this.base64=bU(s,";base64"),this.contentType=this.base64?s.substring(0,s.length-7):s),this.rest=e.substring(e.indexOf(",")+1)}}function gU(n){const e=new Jj(n);return e.base64?$j(wo.BASE64,e.rest):BU(e.rest)}function xU(n){return new Jj(n).contentType}function bU(n,e){return n.length>=e.length?n.substring(n.length-e.length)===e:!1}/** 4065 * @license 4066 * Copyright 2017 Google LLC 4067 * 4068 * Licensed under the Apache License, Version 2.0 (the "License");
4069 * you may not use this file except in compliance with the License. 4070 * You may obtain a copy of the License at 4071 * 4072 * http://www.apache.org/licenses/LICENSE-2.0 4073 * 4074 * Unless required by applicable law or agreed to in writing, software 4075 * distributed under the License is distributed on an "AS IS" BASIS, 4076 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4077 * See the License for the specific language governing permissions and 4078 * limitations under the License. 4079 */class gc{constructor(e,t){let s=0,o="";M5(e)?(this.data_=e,s=e.size,o=e.type):e instanceof ArrayBuffer?(t?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),s=this.data_.length):e instanceof Uint8Array&&(t?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),s=e.length),this.size_=s,this.type_=o}size(){return this.size_}type(){return this.type_}slice(e,t){if(M5(this.data_)){const s=this.data_,o=fU(s,e,t);return o===null?null:new gc(o)}else{const s=new Uint8Array(this.data_.buffer,e,t-e);return new gc(s,!0)}}static getBlob(...e){if(Lv()){const t=e.map(s=>s instanceof gc?s.data_:s);return new gc(hU.apply(null,t))}else{const t=e.map(u=>dx(u)?pU(wo.RAW,u).data:u.data_);let s=0;t.forEach(u=>{s+=u.byteLength});const o=new Uint8Array(s);let l=0;return t.forEach(u=>{for(let h=0;h<u.length;h++)o[l++]=u[h]}),new gc(o,!0)}}uploadData(){return this.data_}}/** 4080 * @license 4081 * Copyright 2017 Google LLC 4082 * 4083 * Licensed under the Apache License, Version 2.0 (the "License"); 4084 * you may not use this file except in compliance with the License. 4085 * You may obtain a copy of the License at 4086 * 4087 * http://www.apache.org/licenses/LICENSE-2.0 4088 * 4089 * Unless required by applicable law or agreed to in writing, software 4090 * distributed under the License is distributed on an "AS IS" BASIS, 4091 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4092 * See the License for the specific language governing permissions and 4093 * limitations under the License. 4094 */function Kj(n){let e;try{e=JSON.parse(n)}catch{return null}return rU(e)?e:null}/** 4095 * @license 4096 * Copyright 2017 Google LLC 4097 * 4098 * Licensed under the Apache License, Version 2.0 (the "License"); 4099 * you may not use this file except in compliance with the License. 4100 * You may obtain a copy of the License at 4101 * 4102 * http://www.apache.org/licenses/LICENSE-2.0 4103 * 4104 * Unless required by applicable law or agreed to in writing, software 4105 * distributed under the License is distributed on an "AS IS" BASIS, 4106 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4107 * See the License for the specific language governing permissions and 4108 * limitations under the License. 4109 */function CU(n){if(n.length===0)return null;const e=n.lastIndexOf("/");return e===-1?"":n.slice(0,e)}function yU(n,e){const t=e.split("/").filter(s=>s.length>0).join("/");return n.length===0?t:n+"/"+t}function Qj(n){const e=n.lastIndexOf("/",n.length-2);return e===-1?n:n.slice(e+1)}/** 4110 * @license 4111 * Copyright 2017 Google LLC 4112 * 4113 * Licensed under the Apache License, Version 2.0 (the "License"); 4114 * you may not use this file except in compliance with the License. 4115 * You may obtain a copy of the License at 4116 * 4117 * http://www.apache.org/licenses/LICENSE-2.0 4118 * 4119 * Unless required by applicable law or agreed to in writing, software 4120 * distributed under the License is distributed on an "AS IS" BASIS, 4121 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4122 * See the License for the specific language governing permissions and 4123 * limitations under the License. 4124 */function vU(n,e){return e}class ai{constructor(e,t,s,o){this.server=e,this.local=t||e,this.writable=!!s,this.xform=o||vU}}let oB=null;function _U(n){return!dx(n)||n.length<2?n:Qj(n)}function Yj(){if(oB)return oB;const n=[];n.push(new ai("bucket")),n.push(new ai("generation")),n.push(new ai("metageneration")),n.push(new ai("name","fullPath",!0));function e(l,u){return _U(u)}const t=new ai("name");t.xform=e,n.push(t);function s(l,u){return u!==void 0?Number(u):u}const o=new ai("size");return o.xform=s,n.push(o),n.push(new ai("timeCreated")),n.push(new ai("updated")),n.push(new ai("md5Hash",null,!0)),n.push(new ai("cacheControl",null,!0)),n.push(new ai("contentDisposition",null,!0)),n.push(new ai("contentEncoding",null,!0)),n.push(new ai("contentLanguage",null,!0)),n.push(new ai("contentType",null,!0)),n.push(new ai("metadata","customMetadata",!0)),oB=n,oB}function wU(n,e){function t(){const s=n.bucket,o=n.fullPath,l=new ta(s,o);return e._makeStorageReference(l)}Object.defineProperty(n,"ref",{get:t})}function EU(n,e,t){const s={};s.type="file";const o=t.length;for(let l=0;l<o;l++){const u=t[l];s[u.local]=u.xform(s,e[u.server])}return wU(s,n),s}function Xj(n,e,t){const s=Kj(e);return s===null?null:EU(n,s,t)}function NU(n,e,t,s){const o=Kj(e);if(o===null||!dx(o.downloadTokens))return null;const l=o.downloadTokens;if(l.length===0)return null;const u=encodeURIComponent;return l.split(",").map(p=>{const x=n.bucket,b=n.fullPath,C="/b/"+u(x)+"/o/"+u(b),N=xp(C,t,s),T=Gj({alt:"media",token:p});return N+T})[0]}function Wj(n,e){const t={},s=e.length;for(let o=0;o<s;o++){const l=e[o];l.writable&&(t[l.server]=n[l.local])}return JSON.stringify(t)}class Uh{constructor(e,t,s,o){this.url=e,this.method=t,this.handler=s,this.timeout=o,this.urlParam
4124s={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}/** 4125 * @license 4126 * Copyright 2017 Google LLC 4127 * 4128 * Licensed under the Apache License, Version 2.0 (the "License"); 4129 * you may not use this file except in compliance with the License. 4130 * You may obtain a copy of the License at 4131 * 4132 * http://www.apache.org/licenses/LICENSE-2.0 4133 * 4134 * Unless required by applicable law or agreed to in writing, software 4135 * distributed under the License is distributed on an "AS IS" BASIS, 4136 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4137 * See the License for the specific language governing permissions and 4138 * limitations under the License. 4139 */function Bl(n){if(!n)throw Ov()}function Mv(n,e){function t(s,o){const l=Xj(n,o,e);return Bl(l!==null),l}return t}function DU(n,e){function t(s,o){const l=Xj(n,o,e);return Bl(l!==null),NU(l,o,n.host,n._protocol)}return t}function bp(n){function e(t,s){let o;return t.getStatus()===401?t.getErrorText().includes("Firebase App Check token is invalid")?o=HV():o=GV():t.getStatus()===402?o=UV(n.bucket):t.getStatus()===403?o=qV(n.path):o=s,o.status=t.getStatus(),o.serverResponse=s.serverResponse,o}return e}function Zj(n){const e=bp(n);function t(s,o){let l=e(s,o);return s.getStatus()===404&&(l=VV(n.path)),l.serverResponse=o.serverResponse,l}return t}function TU(n,e,t){const s=e.fullServerUrl(),o=xp(s,n.host,n._protocol),l="GET",u=n.maxOperationRetryTime,h=new Uh(o,l,Mv(n,t),u);return h.errorHandler=Zj(e),h}function SU(n,e,t){const s=e.fullServerUrl(),o=xp(s,n.host,n._protocol),l="GET",u=n.maxOperationRetryTime,h=new Uh(o,l,DU(n,t),u);return h.errorHandler=Zj(e),h}function jU(n,e){return n&&n.contentType||e&&e.type()||"application/octet-stream"}function eA(n,e,t){const s=Object.assign({},t);return s.fullPath=n.path,s.size=e.size(),s.contentType||(s.contentType=jU(null,e)),s}function AU(n,e,t,s,o){const l=e.bucketOnlyServerUrl(),u={"X-Goog-Upload-Protocol":"multipart"};function h(){let V="";for(let H=0;H<2;H++)V=V+Math.random().toString().slice(2);return V}const f=h();u["Content-Type"]="multipart/related; boundary="+f;const p=eA(e,s,o),x=Wj(p,t),b="--"+f+`\r 4140Content-Type: application/json; charset=utf-8\r 4141\r 4142`+x+`\r 4143--`+f+`\r 4144Content-Type: `+p.contentType+`\r 4145\r 4146`,C=`\r 4147--`+f+"--",N=gc.getBlob(b,s,C);if(N===null)throw Vj();const T={name:p.fullPath},R=xp(l,n.host,n._protocol),A="POST",U=n.maxUploadRetryTime,M=new Uh(R,A,Mv(n,t),U);return M.urlParams=T,M.headers=u,M.body=N.uploadData(),M.errorHandler=bp(e),M}class bg{constructor(e,t,s,o){this.current=e,this.total=t,this.finalized=!!s,this.metadata=o||null}}function Pv(n,e){let t=null;try{t=n.getResponseHeader("X-Goog-Upload-Status")}catch{Bl(!1)}return Bl(!!t&&(e||["active"]).indexOf(t)!==-1),t}function kU(n,e,t,s,o){const l=e.bucketOnlyServerUrl(),u=eA(e,s,o),h={name:u.fullPath},f=xp(l,n.host,n._protocol),p="POST",x={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${s.size()}`,"X-Goog-Upload-Header-Content-Type":u.contentType,"Content-Type":"application/json; charset=utf-8"},b=Wj(u,t),C=n.maxUploadRetryTime;function N(R){Pv(R);let A;try{A=R.getResponseHeader("X-Goog-Upload-URL")}catch{Bl(!1)}return Bl(dx(A)),A}const T=new Uh(f,p,N,C);return T.urlParams=h,T.headers=x,T.body=b,T.errorHandler=bp(e),T}function RU(n,e,t,s){const o={"X-Goog-Upload-Command":"query"};function l(p){const x=Pv(p,["active","final"]);let b=null;try{b=p.getResponseHeader("X-Goog-Upload-Size-Received")}catch{Bl(!1)}b||Bl(!1);const C=Number(b);return Bl(!isNaN(C)),new bg(C,s.size(),x==="final")}
4147const u="POST",h=n.maxUploadRetryTime,f=new Uh(t,u,l,h);return f.headers=o,f.errorHandler=bp(e),f}const z5=256*1024;function IU(n,e,t,s,o,l,u,h){const f=new bg(0,0);if(u?(f.current=u.current,f.total=u.total):(f.current=0,f.total=s.size()),s.size()!==f.total)throw QV();const p=f.total-f.current;let x=p;o>0&&(x=Math.min(x,o));const b=f.current,C=b+x;let N="";x===0?N="finalize":p===x?N="upload, finalize":N="upload";const T={"X-Goog-Upload-Command":N,"X-Goog-Upload-Offset":`${f.current}`},R=s.slice(b,C);if(R===null)throw Vj();function A(H,Q){const Y=Pv(H,["active","final"]),k=f.current+x,E=s.size();let j;return Y==="final"?j=Mv(e,l)(H,Q):j=null,new bg(k,E,Y==="final",j)}const U="POST",M=e.maxUploadRetryTime,V=new Uh(t,U,A,M);return V.headers=T,V.body=R.uploadData(),V.progressCallback=h||null,V.errorHandler=bp(n),V}const Di={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function ry(n){switch(n){case"running":case"pausing":case"canceling":return Di.RUNNING;case"paused":return Di.PAUSED;case"success":return Di.SUCCESS;case"canceled":return Di.CANCELED;case"error":return Di.ERROR;default:return Di.ERROR}}/** 4148 * @license 4149 * Copyright 2017 Google LLC 4150 * 4151 * Licensed under the Apache License, Version 2.0 (the "License"); 4152 * you may not use this file except in compliance with the License. 4153 * You may obtain a copy of the License at 4154 * 4155 * http://www.apache.org/licenses/LICENSE-2.0 4156 * 4157 * Unless required by applicable law or agreed to in writing, software 4158 * distributed under the License is distributed on an "AS IS" BASIS, 4159 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4160 * See the License for the specific language governing permissions and 4161 * limitations under the License. 4162 */class OU{constructor(e,t,s){if(sU(e)||t!=null||s!=null)this.next=e,this.error=t??void 0,this.complete=s??void 0;else{const l=e;this.next=l.next,this.error=l.error,this.complete=l.complete}}}/** 4163 * @license 4164 * Copyright 2017 Google LLC 4165 * 4166 * Licensed under the Apache License, Version 2.0 (the "License"); 4167 * you may not use this file except in compliance with the License. 4168 * You may obtain a copy of the License at 4169 * 4170 * http://www.apache.org/licenses/LICENSE-2.0 4171 * 4172 * Unless required by applicable law or agreed to in writing, software 4173 * distributed under the License is distributed on an "AS IS" BASIS, 4174 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4175 * See the License for the specific language governing permissions and 4176 * limitations under the License. 4177 */function Vd(n){return(...e)=>{Promise.resolve().then(()=>n(...e))}}/** 4178 * @license 4179 * Copyright 2017 Google LLC 4180 * 4181 * Licensed under the Apache License, Version 2.0 (the "License"); 4182 * you may not use this file except in compliance with the License. 4183 * You may obtain a copy of the License at 4184 * 4185 * http://www.apache.org/licenses/LICENSE-2.0 4186 * 4187 * Unless required by applicable law or agreed to in writing, software 4188 * distributed under the License is distributed on an "AS IS" BASIS, 4189 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4190 * See the License for the specific language governing permissions and 4191 * limitations under the License. 4192 */class LU{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=Iu.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=Iu.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=Iu.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,t,s,o,l){if(this.sent_)throw Wf("cannot .send() more than once");if(qu(e)&&s&&(this.xhr_.withCredentials=!0),this.sent_=!0,this.xhr_.open(t,e,!0),l!==void 0)for(const u in l)l.hasOwnProperty(u)&&this.xhr_.setRequestHeader(u,l[u].toString());return o!==void 0?this.xhr_.send(o):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw Wf("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw Wf("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw Wf("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw Wf("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",e)}}class MU extends LU{initXhr(){this.xhr_.responseType="text"}}function Zd(){return new MU}/** 4193 * @license 4194 * Copyright 2017 Google LLC 4195 * 4196 * Licensed under the Apache License, Version 2.0 (the "License");
4197 * you may not use this file except in compliance with the License. 4198 * You may obtain a copy of the License at 4199 * 4200 * http://www.apache.org/licenses/LICENSE-2.0 4201 * 4202 * Unless required by applicable law or agreed to in writing, software 4203 * distributed under the License is distributed on an "AS IS" BASIS, 4204 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4205 * See the License for the specific language governing permissions and 4206 * limitations under the License. 4207 */class PU{isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}constructor(e,t,s=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=e,this._blob=t,this._metadata=s,this._mappings=Yj(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=o=>{if(this._request=void 0,this._chunkMultiplier=1,o._codeEquals(gs.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{const l=this.isExponentialBackoffExpired();if(Hj(o.status,[]))if(l)o=zj();else{this.sleepTime=Math.max(this.sleepTime*2,FV),this._needToFetchStatus=!0,this.completeTransitions_();return}this._error=o,this._transition("error")}},this._metadataErrorHandler=o=>{this._request=void 0,o._codeEquals(gs.CANCELED)?this.completeTransitions_():(this._error=o,this._transition("error"))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((o,l)=>{this._resolve=o,this._reject=l,this._start()}),this._promise.then(null,()=>{})}_makeProgressCallback(){const e=this._transferred;return t=>this._updateProgress(e+t)}_shouldDoResumable(e){return e.size()>256*1024}_start(){this._state==="running"&&this._request===void 0&&(this._resumable?this._uploadUrl===void 0?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(e){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([t,s])=>{switch(this._state){case"running":e(t,s);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused");break}})}_createResumable(){this._resolveToken((e,t)=>{const s=kU(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),o=this._ref.storage._makeRequest(s,Zd,e,t);this._request=o,o.getPromise().then(l=>{this._request=void 0,this._uploadUrl=l,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){const e=this._uploadUrl;this._resolveToken((t,s)=>{const o=RU(this._ref.storage,this._ref._location,e,this._blob),l=this._ref.storage._makeRequest(o,Zd,t,s);this._request=l,l.getPromise().then(u=>{u=u,this._request=void 0,this._updateProgress(u.current),this._needToFetchStatus=!1,u.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){const e=z5*this._chunkMultiplier,t=new bg(this._transferred,this._blob.size()),s=this._uploadUrl;this._resolveToken((o,l)=>{let u;try{u=IU(this._ref._location,this._ref.storage,s,this._blob,e,this._mappings,t,this._makeProgressCallback())}catch(f){this._error=f,this._transition("error");return}const h=this._ref.storage._makeRequest(u,Zd,o,l,!1);this._request=h,h.getPromise().then(f=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(f.current),f.finalized?(this._metadata=f.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){z5*this._chunkMultiplier*2<32*1024*1024&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((e,t)=>{const s=TU(this._ref.storage,this._ref._location,this._mappings),o=this._ref.storage._makeRequest(s,Zd,e,t);this._request=o,o.getPromise().then(l=>{this._request=void 0,this._metadata=l,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((e,t)=>{const s=AU(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),o=this._ref.storage._makeRequest
vendor: 4,350 bytes, lines 4207-4226
4207(s,Zd,e,t);this._request=o,o.getPromise().then(l=>{this._request=void 0,this._metadata=l,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(e){const t=this._transferred;this._transferred=e,this._transferred!==t&&this._notifyObservers()}_transition(e){if(this._state!==e)switch(e){case"canceling":case"pausing":this._state=e,this._request!==void 0?this._request.cancel():this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_());break;case"running":const t=this._state==="paused";this._state=e,t&&(this._notifyObservers(),this._start());break;case"paused":this._state=e,this._notifyObservers();break;case"canceled":this._error=Fj(),this._state=e,this._notifyObservers();break;case"error":this._state=e,this._notifyObservers();break;case"success":this._state=e,this._notifyObservers();break}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start();break}}get snapshot(){const e=ry(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}}on(e,t,s,o){const l=new OU(t||void 0,s||void 0,o||void 0);return this._addObserver(l),()=>{this._removeObserver(l)}}then(e,t){return this._promise.then(e,t)}catch(e){return this.then(null,e)}_addObserver(e){this._observers.push(e),this._notifyObserver(e)}_removeObserver(e){const t=this._observers.indexOf(e);t!==-1&&this._observers.splice(t,1)}_notifyObservers(){this._finishPromise(),this._observers.slice().forEach(t=>{this._notifyObserver(t)})}_finishPromise(){if(this._resolve!==void 0){let e=!0;switch(ry(this._state)){case Di.SUCCESS:Vd(this._resolve.bind(null,this.snapshot))();break;case Di.CANCELED:case Di.ERROR:const t=this._reject;Vd(t.bind(null,this._error))();break;default:e=!1;break}e&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(e){switch(ry(this._state)){case Di.RUNNING:case Di.PAUSED:e.next&&Vd(e.next.bind(e,this.snapshot))();break;case Di.SUCCESS:e.complete&&Vd(e.complete.bind(e))();break;case Di.CANCELED:case Di.ERROR:e.error&&Vd(e.error.bind(e,this._error))();break;default:e.error&&Vd(e.error.bind(e,this._error))()}}resume(){const e=this._state==="paused"||this._state==="pausing";return e&&this._transition("running"),e}pause(){const e=this._state==="running";return e&&this._transition("pausing"),e}cancel(){const e=this._state==="running"||this._state==="pausing";return e&&this._transition("canceling"),e}}/** 4208 * @license 4209 * Copyright 2019 Google LLC 4210 * 4211 * Licensed under the Apache License, Version 2.0 (the "License"); 4212 * you may not use this file except in compliance with the License. 4213 * You may obtain a copy of the License at 4214 * 4215 * http://www.apache.org/licenses/LICENSE-2.0 4216 * 4217 * Unless required by applicable law or agreed to in writing, software 4218 * distributed under the License is distributed on an "AS IS" BASIS, 4219 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4220 * See the License for the specific language governing permissions and 4221 * limitations under the License. 4222 */class Hu{constructor(e,t){this._service=e,t instanceof ta?this._location=t:this._location=ta.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new Hu(e,t)}get root(){const e=new ta(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return Qj(this._location.path)}get storage(){return this._service}get parent(){const e=CU(this._location.path);if(e===null)return null;const t=new ta(this._location.bucket,e);return new Hu(this._service,t)}_throwIfRoot(e){if(this._location.path==="")throw WV(e)}}function zU(n,e,t){return n._throwIfRoot("uploadBytesResumable"),new PU(n,new gc(e),t)}function FU(n){n._throwIfRoot("getDownloadURL");const e=SU(n.storage,n._location,Yj());return n.storage.makeRequestWithTokens(e,Zd).then(t=>{if(t===null)throw YV();return t})}function VU(n,e){const t=yU(n._location.path,e),s=new ta(n._location.bucket,t);return new Hu(n.storage,s)}/** 4223 * @license 4224 * Copyright 2017 Google LLC 4225 * 4226 * Licensed under the Apache License, Version 2.0 (the "License");
4227 * you may not use this file except in compliance with the License. 4228 * You may obtain a copy of the License at 4229 * 4230 * http://www.apache.org/licenses/LICENSE-2.0 4231 * 4232 * Unless required by applicable law or agreed to in writing, software 4233 * distributed under the License is distributed on an "AS IS" BASIS, 4234 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4235 * See the License for the specific language governing permissions and 4236 * limitations under the License. 4237 */function UU(n){return/^[A-Za-z]+:\/\//.test(n)}function GU(n,e){return new Hu(n,e)}function tA(n,e){if(n instanceof zv){const t=n;if(t._bucket==null)throw KV();const s=new Hu(t,t._bucket);return e!=null?tA(s,e):s}else return e!==void 0?VU(n,e):n}function HU(n,e){if(e&&UU(e)){if(n instanceof zv)return GU(n,e);throw c1("To use ref(service, url), the first argument must be a Storage instance.")}else return tA(n,e)}function F5(n,e){const t=e==null?void 0:e[Pj];return t==null?null:ta.makeFromBucketSpec(t,n)}function qU(n,e,t,s={}){n.host=`${e}:${t}`;const o=qu(e);o&&E1(`https://${n.host}/b`),n._isUsingEmulator=!0,n._protocol=o?"https":"http";const{mockUserToken:l}=s;l&&(n._overrideAuthToken=typeof l=="string"?l:$D(l,n.app.options.projectId))}class zv{constructor(e,t,s,o,l,u=!1){this.app=e,this._authProvider=t,this._appCheckProvider=s,this._url=o,this._firebaseVersion=l,this._isUsingEmulator=u,this._bucket=null,this._host=Mj,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=PV,this._maxUploadRetryTime=zV,this._requests=new Set,o!=null?this._bucket=ta.makeFromBucketSpec(o,this._host):this._bucket=F5(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=ta.makeFromBucketSpec(this._url,e):this._bucket=F5(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){P5("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){P5("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const t=await e.getToken();if(t!==null)return t.accessToken}return null}async _getAppCheckToken(){if(Wi(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new Hu(this,e)}_makeRequest(e,t,s,o,l=!0){if(this._deleted)return new ZV(Uj());{const u=uU(e,this._appId,s,o,t,this._firebaseVersion,l,this._isUsingEmulator);return this._requests.add(u),u.getPromise().then(()=>this._requests.delete(u),()=>this._requests.delete(u)),u}}async makeRequestWithTokens(e,t){const[s,o]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,s,o).getPromise()}}const V5="@firebase/storage",U5="0.14.5";/** 4238 * @license 4239 * Copyright 2020 Google LLC 4240 * 4241 * Licensed under the Apache License, Version 2.0 (the "License"); 4242 * you may not use this file except in compliance with the License. 4243 * You may obtain a copy of the License at 4244 * 4245 * http://www.apache.org/licenses/LICENSE-2.0 4246 * 4247 * Unless required by applicable law or agreed to in writing, software 4248 * distributed under the License is distributed on an "AS IS" BASIS, 4249 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4250 * See the License for the specific language governing permissions and 4251 * limitations under the License. 4252 */const nA="storage";function sA(n,e,t){return n=$s(n),zU(n,e,t)}function rA(n){return n=$s(n),FU(n)}function iA(n,e){return n=$s(n),HU(n,e)}function $U(n=T1(),e){n=$s(n);const s=kg(n,nA).getImmediate({identifier:e}),o=GD("storage");return o&&JU(s,...o),s}function JU(n,e,t,s={}){qU(n,e,t,s)}/** 4253 * @license 4254 * Copyright 2020 Google LLC 4255 * 4256 * Licensed under the Apache License, Version 2.0 (the "License");
4257 * you may not use this file except in compliance with the License. 4258 * You may obtain a copy of the License at 4259 * 4260 * http://www.apache.org/licenses/LICENSE-2.0 4261 * 4262 * Unless required by applicable law or agreed to in writing, software 4263 * distributed under the License is distributed on an "AS IS" BASIS, 4264 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 4265 * See the License for the specific language governing permissions and 4266 * limitations under the License. 4267 */function KU(n,{instanceIdentifier:e}){const t=n.getProvider("app").getImmediate(),s=n.getProvider("auth-internal"),o=n.getProvider("app-check-internal");return new zv(t,s,o,e,$u)}function QU(){zu(new Tc(nA,KU,"PUBLIC").setMultipleInstances(!0)),No(V5,U5,""),No(V5,U5,"esm2020")}QU();const YU={apiKey:"AIzaSyBgTuV7xHa3PAPSzacRsEkcnJ59Fukye1A",authDomain:"eighth-ability-8szp9.firebaseapp.com",projectId:"eighth-ability-8szp9",storageBucket:"eighth-ability-8szp9.firebasestorage.app",messagingSenderId:"389253128291",appId:"1:389253128291:web:087a456f72bbc4bf0b1856"},XU="ai-studio-chatliz-19b8032a-22a9-4b1d-9b50-b3d4b9771a26";let lB,ft,wm,Cg;try{lB=QD(YU),ft=vF(lB,XU),wm=IV(lB),Cg=$U(lB)}catch(n){console.error("Firebase frontend initialization failed:",n),ft={},wm={},Cg={}}function WU({user:n,onComplete:e}){const[t,s]=y.useState({statusMessage:n.statusMessage||"",gender:n.gender||"",mood:n.mood||"",countryLanguage:n.countryLanguage||"es",is_friends_public:n.is_friends_public??!0}),[o,l]=y.useState(!1),u=async h=>{if(h.preventDefault(),!o){l(!0);try{await wa(Tn(ft,"users",n.username),{statusMessage:t.statusMessage,pais_idioma:t.countryLanguage,is_friends_public:t.is_friends_public,gender:t.gender,mood:t.mood,updatedAt:new Date},{merge:!0}),e(t)}catch(f){console.error("Error saving first time setup:",f),e(t)}}};return i.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/80 backdrop-blur-sm px-4",children:i.jsxs("div",{className:"bg-[#111116] border border-white/10 rounded-3xl w-full max-w-md overflow-hidden flex flex-col shadow-2xl",children:[i.jsxs("div",{className:"p-6 text-center border-b border-white/10",children:[i.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"¡Bienvenido a ChatLiz!"}),i.jsx("p",{className:"text-sm text-gray-400",children:"Configura tu perfil para empezar a chatear."})]}),i.jsxs("form",{onSubmit:u,className:"p-6 space-y-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-sm font-semibold text-gray-400",children:"Estado / BiografÃa"}),i.jsx("input",{type:"text",required:!0,className:"w-full bg-black/30 p-3 rounded-xl border border-white/10 text-white focus:outline-none focus:border-cyan-500 transition-colors",placeholder:"¿Qué estás pensando?",value:t.statusMessage,onChange:h=>s({...t,statusMessage:h.target.value})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-sm font-semibold text-gray-400",children:"Género"}),i.jsxs("select",{required:!0,className:"w-full bg-black/30 p-3 rounded-xl border border-white/10 text-white focus:outline-none focus:border-cyan-500 transition-colors",value:t.gender,onChange:h=>s({...t,gender:h.target.value}),children:[i.jsx("option",{value:"",children:"Selecciona tu género..."}),i.jsx("option",{value:"Masculino",children:"Masculino"}),i.jsx("option",{value:"Femenino",children:"Femenino"}),i.jsx("option",{value:"No Binario",children:"No Binario"}),i.jsx("option",{value:"Prefiero no decirlo",children:"Prefiero no decirlo"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-sm font-semibold text-gray-400",children:"Estado de ánimo"}),i.jsxs("select",{required:!0,className:"w-full bg-black/30 p-3 rounded-xl border border-white/10 text-white focus:outline-none focus:border-cyan-500 transition-colors",value:t.mood,onChange:h=>s({...t,mood:h.target.value}),children:[i.jsx("option",{value:"",children:"¿Cómo te sientes?"}),i.jsx("option",{value:"Feliz",children:"Feliz ð"}),i.jsx("option",{value:"Tranquilo",children:"Tranquilo ð"}),i.jsx("option",{value:"Emocionado",children:"Emocionado ð¤©"}),i.jsx("option",{value:"Triste",children:"Triste ð¢"}),i.jsx("option",{value:"Enojado",children:"Enojado ð¡"}),i.jsx("option",{value:"Aburrido",children:"Aburrido ð¥±"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-sm font-semibold text-gray-400",children:"Idioma / Región"}),i.jsxs("select",{className:"w-full bg-black/30 p-3 rounded-xl border border-white/10 text-white focus:outline-none focus:border-cyan-500 transition-colors",value:t.countryLanguage,onChange:h=>s({...t,countryLanguage:h.target.value}),children:[i.jsx("option",{value:"es",children:"Español"}),i.jsx("option",{value:"en",children:"Inglés"}),i.jsx("option",{value:"pt",children:"Portugués"}),i.jsx("option",{value:"fr",children:"Francés"}),i.jsx("option",{value:"de",children:"Alemán"}),i.jsx("option",{value:"it",children:"Italiano"})]})]}),i.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[i.jsx("input",{type:"checkbox",id:"is_friends_public",className:"w-5 h-5 accent-cyan-500 cursor-pointer",checked:t.is_friends_public,onChange:h=>s({...t,is_friends_public:h.target.checked})}),i.jsx("label",{htmlFor:"is_friends_public",className:"text-sm text-gray-300 cursor-pointer",children:"Permitir que otros vean mi lista de amigos"})]}),i.jsxs("button",{type:"submit",className:"w-full bg-cyan-600 hover:bg-cyan-500 text-white font-bold py-4 rounded-xl mt-4 flex items-center justify-center gap-2 transition-all shadow-[0_0_15px_rgba(6,182,212,0.4)]",children:[i.jsx(Jr,{size:20})," Entrar a ChatLiz"]})]})]})})}function ZU({recoveryStep:n,setRecoveryStep:e,recoveryUsername:t,setRecoveryUsername:s,recoveryEmail:o,setRecoveryEmail:l,recoveryCodeStr:u,setRecoveryCodeStr:h,inputRecoveryCode:f,setInputRecoveryCode:p,newPassword:x,setNewPassword:b,setRecoveryModalOpen:C}){return i.jsx("div",{className:"fixed inset-0 z-[120] flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm shadow-2xl",children:i.jsxs("div",{className:"bg-[#0f111a] p-6 rounded-2xl border border-white/10 w-full max-w-sm relative",children:[i.jsx("button",{onClick:()=>{C(!1),e(1)},className:"absolute text-gray-500 top-4 right-4 hover:text-white",children:i.jsx(Kt,{size:20})}),i.jsx("h3",{className:"mb-4 text-xl font-bold text-center text-white",children:"Recuperar Contraseña"}),n===1&&i.jsxs("div",{className:"space-y-4",children:[i.jsx("p",{className:"text-sm text-gray-400",children:"Ingresa tu usuario y correo de recuperación."}),i.jsx("input",{className:"w-full p-3 text-white transition-all border outline-none bg-white/5 rounded-xl border-white/10 focus:border-cyan-500",placeholder:"Usuario",value:t,onChange:N=>s(N.target.value)}),l&&i.jsx("input",{className:"w-full p-3 text-white transition-all border outline-none bg-white/5 rounded-xl border-white/10 focus:border-cyan-500",type:"email",placeholder:"Correo electrónico",value:o||"",onChange:N=>l(N.target.value)}),i.jsx("button",{onClick:()=>
4267{if(!t||!o){alert("Por favor ingresa tu usuario y correo electrónico.");return}W.emit("forgot_password_request",{username:t,email:o},N=>{N.success?(alert("Código de recuperación enviado a tu correo electrónico asociado."),e(2)):alert(N.error)})},className:"w-full p-3 font-bold text-white transition-all shadow-lg bg-gradient-to-r from-cyan-500 to-blue-500 rounded-xl hover:shadow-cyan-500/50",children:"Enviar Código"})]}),n===2&&i.jsxs("div",{className:"space-y-4",children:[i.jsx("p",{className:"text-sm text-gray-400",children:"Revisa tu correo electrónico (bandeja de entrada o spam). Ingresa el código recibido de 6 dÃgitos."}),i.jsx("input",{className:"w-full p-3 text-white transition-all border outline-none bg-white/5 rounded-xl border-white/10 focus:border-cyan-500",placeholder:"Ingresa el código",value:f,onChange:N=>p(N.target.value.trim().toUpperCase())}),i.jsx("p",{className:"text-sm text-gray-400 mt-2",children:"Ingresa tu nueva contraseña para cambiarla."}),i.jsx("input",{type:"password",className:"w-full p-3 text-white transition-all border outline-none bg-white/5 rounded-xl border-white/10 focus:border-cyan-500",placeholder:"Nueva Contraseña",value:x,onChange:N=>b(N.target.value)}),i.jsx("button",{onClick:()=>{if(!x||!f){alert("Por favor llena ambos campos.");return}W.emit("forgot_password_reset",{username:t,newPassword:x,code:f},N=>{N.success?(alert("Contraseña actualizada exitosamente."),C(!1),e(1)):alert(N.error)})},className:"w-full p-3 font-bold text-white transition-all shadow-lg bg-gradient-to-r from-cyan-500 to-blue-500 rounded-xl hover:shadow-cyan-500/50",children:"Verificar y Cambiar"})]})]})})}function e7({user:n,setUser:e,setIsConfigOpen:t,setAdminConfigAiOpen:s,usersOnline:o,setAiProfileForm:l,customFrames:u}){var gn;const[h,f]=y.useState("perfil"),[p,x]=y.useState(n.incognito||!1),[b,C]=y.useState(n.statusMessage||""),[N,T]=y.useState(n.pais_idioma||"es"),[R,A]=y.useState(n.password||""),[U,M]=y.useState(n.profilePic||""),[V,H]=y.useState(n.frameId),[Q,Y]=y.useState(n.is_friends_public||!1),[k,E]=y.useState(n.preferred_background||""),[j,P]=y.useState(n.preferred_theme||localStorage.getItem("chatliz_theme")||"default"),[O,F]=y.useState(null),[S,be]=y.useState(n.username||""),[Ee,me]=y.useState(null),[De,ge]=y.useState(!1),[Ue,we]=y.useState(!1),$e=()=>{const Oe=(S||"").trim();if(!Oe)return me({text:"El nombre no puede estar vacÃo.",error:!0});if(Oe===n.username)return me({text:"El nombre ingresado es idéntico al actual.",error:!0});if(Oe.length<3||Oe.length>20)return me({text:"El nombre debe tener entre 3 y 20 caracteres.",error:!0});if(!/^[a-zA-Z0-9_.-]+$/.test(Oe))return me({text:"Solo se permiten letras, números, guiones y puntos.",error:!0});if(Oe.toLowerCase()==="elizabeth")return me({text:"Ese nombre está reservado para la IA oficial.",error:!0});if(Oe.toUpperCase()==="AXISS"&&n.username.toUpperCase()!=="AXISS")return me({text:"Ese nombre está reservado para el Super Administrador.",error:!0});ge(!0),me(null),W.emit("change_username",{newUsername:Oe},vt=>{ge(!1),vt&&vt.success?(e(Ft=>{const on={...Ft,username:vt.newUsername,uid:vt.uid||Ft.uid};return localStorage.setItem("chatliz_user",JSON.stringify(on)),on}),me({text:`¡Nombre actualizado exitosamente a ${vt.newUsername}! Tu ID único #${vt.uid||n.uid} se mantiene intacto.`,error:!1})):me({text:(vt==null?void 0:vt.error)||"Error al cambiar el nombre de usuario.",error:!0})})},[et,Ae]=y.useState(n.bubbleColor||"#121B2A"),[K,ne]=y.useState(n.bubbleBorder||"border-[#5A52A5]/30"),[Pe,Le]=y.useState(n.bubbleShape||"rounded-2xl rounded-tr-sm"),[mt,tt]=y.useState(n.bubbleTexture||"none"),[lt,Qe]=y.useState(n.bubbleStyle||"default"),[st,Yn]=y.useState(n.audioVisualizerStyle||"neon_waves"),[Rn,zn]=y.useState(n.audioVisualizerColor1||"#00f2fe"),[Zt,en]=y.useState(n.audioVisualizerColor2||"#4facfe");y.useEffect(()=>{const Oe=(n.bubbleColor||"").match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(Oe){const vt=parseInt(Oe[1]).toString(16).padStart(2,"0"),Ft=parseInt(Oe[2]).toString(16).padStart(2,"0"),on=parseInt(Oe[3]).toString(16).padStart(2,"0");Ae(`#${vt}${Ft}${on}`)}},[n.bubbleColor]);const jt=()=>{const Oe=!p;x(Oe),e(vt=>({...vt,incognito:Oe})),W.emit("update_incognito",Oe)},At=async()=>{try{F("Guardando...");const Oe=parseInt(et.slice(1,3),16)||18,vt=parseInt(et.slice(3,5),16)||27,Ft=parseInt(et.slice(5,7),16)||42,on=`rgba(${Oe}, ${vt}, ${Ft}, 0.95)`;k?(localStorage.setItem("chatliz_personal_bg",k),window.dispatchEvent(new CustomEvent("chatliz_personal_bg_changed",{detail:k}))):localStorage.removeItem("chatliz_personal_bg");const Zn=k&&k.length>3e5?k.startsWith("http")?k:"":k,Fn=wa(Tn(ft,"users",n.username),{password:R,profilePic:U,frameId:V,statusMessage:b,pais_idioma:N,is_friends_public:Q,incognito:p,preferred_background:Zn,preferred_theme:j,bubbleColor:on,bubbleBorder:K,bubbleShape:Pe,bubbleTexture:mt,bubbleStyle:lt,updatedAt:new Date},{merge:!0}
4267).catch(nn=>{console.warn("Firestore background save warning:",nn)}),In=new Promise(nn=>setTimeout(()=>nn(!0),3500));await Promise.race([Fn,In]),localStorage.setItem("chatliz_theme",j),window.dispatchEvent(new CustomEvent("chatliz_theme_changed",{detail:j})),e(nn=>({...nn,password:R,profilePic:U,frameId:V,statusMessage:b,pais_idioma:N,is_friends_public:Q,incognito:p,preferred_background:k,preferred_theme:j,bubbleColor:on,bubbleBorder:K,bubbleShape:Pe,bubbleTexture:mt,bubbleStyle:lt})),W.emit("update_incognito",p),W.emit("broadcast_profile_change",{username:n.username,statusMessage:b,profilePic:U,frameId:V,countryLanguage:N,is_friends_public:Q,preferred_background:Zn,preferred_theme:j,bubbleStyle:lt}),F("¡Guardado correctamente!"),setTimeout(()=>F(null),3e3)}catch(Oe){console.error(Oe),F("¡Guardado correctamente!"),setTimeout(()=>F(null),3e3)}},Tt=(Oe,vt)=>{var on;const Ft=(on=Oe.target.files)==null?void 0:on[0];if(Ft){const Zn=Ft.type==="image/gif"||Ft.name.toLowerCase().endsWith(".gif"),Fn=Ft.type.startsWith("video/")||Ft.name.toLowerCase().match(/\.(mp4|webm|mov)$/i);if(Zn||Fn){const nn=new FileReader;nn.onload=Ve=>{var os;const Rt=(os=Ve.target)==null?void 0:os.result;vt(Rt),Rt&&_o(Rt).catch(()=>{})},nn.readAsDataURL(Ft);return}const In=new FileReader;In.onload=nn=>{var Rt;const Ve=new Image;Ve.onload=()=>{const os=document.createElement("canvas");let Hn=Ve.width,_t=Ve.height;const Sn=1200;Hn>_t?Hn>Sn&&(_t*=Sn/Hn,Hn=Sn):_t>Sn&&(Hn*=Sn/_t,_t=Sn),os.width=Hn,os.height=_t;const Qt=os.getContext("2d");Qt==null||Qt.drawImage(Ve,0,0,Hn,_t),vt(os.toDataURL("image/jpeg",.85))},Ve.src=(Rt=nn.target)==null?void 0:Rt.result},In.readAsDataURL(Ft)}};return i.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-start sm:items-center justify-center p-4 overflow-y-auto",children:[i.jsx("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-md transition-opacity pointer-events-auto",onClick:()=>t(!1)}),i.jsxs("div",{className:"relative w-full max-w-2xl bg-gradient-to-br from-[#12141c] to-[#0a0a0f] rounded-3xl shadow-2xl border border-white/10 flex flex-col md:flex-row overflow-hidden animate-in fade-in zoom-in-95 duration-300 mt-10 sm:mt-0 mb-10 sm:mb-0",children:[i.jsxs("div",{className:"w-full md:w-64 bg-black/40 border-b md:border-b-0 md:border-r border-white/5 p-4 flex flex-row md:flex-col gap-2 overflow-x-auto md:overflow-visible",children:[i.jsxs("div",{className:"hidden md:flex items-center gap-3 px-3 py-4 mb-2",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-cyan-400 to-blue-600 flex items-center justify-center shadow-[0_0_15px_rgba(34,211,238,0.3)]",children:i.jsx(Sy,{className:"text-white",size:20})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-white font-bold text-lg leading-none",children:"Ajustes"}),i.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Configura tu experiencia"})]})]}),i.jsx(cB,{active:h==="perfil",onClick:()=>f("perfil"),icon:i.jsx(Pu,{size:18}),label:"Perfil"}),i.jsx(cB,{active:h==="idioma",onClick:()=>f("idioma"),icon:i.jsx(vu,{size:18}),label:"Idioma y Sala"}),i.jsx(cB,{active:h==="apariencia",onClick:()=>f("apariencia"),icon:i.jsx(ko,{size:18}),label:"Apariencia"}),i.jsx(cB,{active:h==="cuenta",onClick:()=>f("cuenta"),icon:i.jsx(jD,{size:18}),label:"Privacidad y Cuenta"})]}),i.jsxs("div",{className:"flex-1 flex flex-col h-[70vh] md:h-[600px]",children:[i.jsx("div",{className:"p-4 flex justify-end md:hidden border-b border-white/5",children:i.jsx("button",{onClick:()=>t(!1),className:"text-gray-400 hover:text-white bg-white/5 p-2 rounded-full",children:i.jsx(Kt,{size:20})})}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-6 md:p-8 space-y-8 scrollbar-thin scrollbar-thumb-white/10 scrollbar-track-transparent",children:[h==="perfil"&&i.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-right-4 duration-300",children:[i.jsxs("div",{className:"flex flex-col items-center justify-center gap-4",children:[i.jsxs("div",{className:"relative group cursor-pointer",children:[i.jsxs("div",{className:"w-28 h-28 rounded-full border-4 border-cyan-500/30 overflow-hidden relative",children:[i.jsx("img",{referrerPolicy:"no-referrer",src:U||`https://api.dicebear.com/7.x/notionists/svg?seed=${n.username}`,className:"w-full h-full object-cover",alt:"Profile"}),i.jsx("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:i.jsx("span",{className:"text-xs font-bold text-white tracking-wider",children:"CAMBIAR"})})]}),i.jsx("input",{type:"file",accept:"image/*",onChange:Oe=>Tt(Oe,M),className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"})]}),i.jsx("h3",{className:"text-2xl font-bold text-white",children:n.username}),i.jsxs("div",{onClick:()=>{const Oe=n.uid||(n.username.toUpperCase()==="AXISS"?"1001":"1000");navigator.clipboard.writeText(Oe),we(!0),setTimeout(()=>we(!1),2e3)},title:"Haz clic para copiar tu ID permanente único",className:"cursor-pointer group inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-cyan-500/10 hover:bg-cyan-500/20 border border-cyan-500/30 text-cyan-300 font-mono text-xs transition-all shadow-sm",children:[i.jsx(bo,{size:12,className:"text-cyan-400"}),i.jsxs("span",{className:"font-bold",children:["ID: #",n.uid||
4267(n.username.toUpperCase()==="AXISS"?"1001":"1000")]}),i.jsx("span",{className:"text-[10px] text-cyan-400/70 group-hover:text-cyan-200",children:"⢠Fijo (Inmutable)"}),Ue?i.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] text-emerald-400 font-bold ml-1",children:[i.jsx(Jr,{size:11})," Copiado"]}):i.jsx(Ny,{size:11,className:"text-cyan-400/60 group-hover:text-cyan-300 ml-0.5"})]}),i.jsxs("div",{className:"flex gap-4 text-white/70 text-sm font-medium bg-white/5 px-4 py-2 rounded-full border border-white/10 shadow-inner",children:[n.gender&&i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Na,{size:14,className:"text-cyan-400"})," ",n.gender]}),n.age!==void 0&&i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(v1,{size:14,className:"text-pink-400"})," ",n.age," años"]})]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("label",{className:"text-sm font-semibold text-gray-400 ml-1",children:"Marco de Perfil"}),i.jsxs("div",{className:"grid grid-cols-5 sm:grid-cols-8 gap-3 max-h-48 overflow-y-auto p-3 bg-black/20 rounded-2xl border border-white/5",children:[i.jsx("div",{className:`relative w-12 h-12 rounded-full cursor-pointer flex items-center justify-center border-2 ${V?"border-transparent hover:bg-white/5":"border-cyan-400 bg-white/10"}`,onClick:()=>H(void 0),title:"Sin Marco",children:i.jsx(Kt,{size:20,className:"text-gray-400"})}),Array.from({length:40},(Oe,vt)=>vt+1).map(Oe=>i.jsxs("div",{className:`relative w-12 h-12 rounded-full cursor-pointer border-2 transition-all group ${V===Oe?"border-cyan-400 scale-110 shadow-[0_0_10px_rgba(34,211,238,0.5)]":"border-transparent hover:scale-105 hover:bg-white/5"}`,onClick:()=>H(Oe),title:`Marco ${Oe}`,children:[i.jsx("img",{src:u[Oe]||`/frames/${Oe}.png`,className:"w-full h-full object-contain scale-[1.35]",style:u[Oe]?void 0:{WebkitMaskImage:"radial-gradient(circle closest-side, transparent 74%, black 75%)",maskImage:"radial-gradient(circle closest-side, transparent 74%, black 75%)"},alt:`Marco ${Oe}`,onError:vt=>{vt.target.src=`https://placehold.co/100x100/1a1a24/3a3a4c?text=${Oe}`,vt.target.style.maskImage="none",vt.target.style.webkitMaskImage="none"}}),n.username==="Axiss"&&i.jsx("button",{onClick:vt=>{vt.stopPropagation();const Ft=window.prompt(`Ingresa la URL del marco ${Oe} (deja en blanco para usar el archivo local):`);Ft!==null&&W.emit("set_custom_frame",{id:Oe,url:Ft})},className:"absolute inset-0 bg-black/60 opacity-0 group-hover:opacity-100 flex items-center justify-center rounded-full text-[10px] text-white font-bold",children:"EDIT"})]},Oe))]}),i.jsxs("p",{className:"text-xs text-cyan-400/70 ml-1 bg-cyan-400/10 p-2 rounded-lg border border-cyan-400/20",children:["ð¡ ",i.jsx("b",{children:"Tip:"})," Sube tus 40 imágenes de marcos a la carpeta ",i.jsx("code",{className:"bg-black/50 px-1 rounded",children:"public/frames/"})," en la barra lateral, nombrándolas ",i.jsx("code",{className:"bg-black/50 px-1 rounded",children:"1.png"})," al ",i.jsx("code",{className:"bg-black/50 px-1 rounded",children:"40.png"}),"."]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-sm font-semibold text-gray-400 ml-1",children:"Estado o BiografÃa"}),i.jsx("input",{type:"text",value:b,onChange:Oe=>C(Oe.target.value),placeholder:"Escribe algo sobre ti...",className:"w-full bg-black/30 p-4 rounded-2xl border border-white/10 focus:border-cyan-400 outline-none text-white transition-colors"})]})]}),h==="idioma"&&i.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-right-4 duration-300",children:[i.jsxs("div",{className:"bg-cyan-500/10 border border-cyan-500/20 p-4 rounded-2xl",children:[i.jsxs("h4",{className:"text-cyan-400 font-bold mb-2 flex items-center gap-2",children:[i.jsx(vu,{size:18})," Traducción Automática de Sala"]}),i.jsx("p",{className:"text-sm text-gray-300 leading-relaxed",children:"Al seleccionar un idioma, todos los mensajes de la sala se traducirán automáticamente a tu idioma preferido. Los demás usuarios verán tus mensajes en el idioma que ellos hayan elegido."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-sm font-semibold text-gray-400 ml-1",children:"Mi Idioma Principal"}),i.jsxs("select",{value:N,onChange:Oe=>T(Oe.target.value),className:"w-full bg-black/30 p-4 rounded-2xl border border-white/10 focus:border-cyan-400 outline-none text-white transition-colors appearance-none cursor-pointer",children:[i.jsx("option",{value:"es",children:"Español ðªð¸"}),i.jsx("option",{value:"en",children:"English ðºð¸"}),i.jsx("option",{value:"pt",children:"Português ð§ð·"}),i.jsx("option",{value:"fr",children:"Français ð«ð·"}),i.jsx("option",{value:"de",children:"Deutsch ð©ðª"}),i.jsx("option",{value:"it",children:"Italiano ð®ð¹"}),i.jsx("option",{value:"ru",children:"Ð ÑÑÑкий ð·ðº"}),i.jsx("option",{value:"ja",children:"æ¥æ¬èª ð¯ðµ"}),i.jsx("option",{value:"ko",children:"íêµì´ ð°ð·"}),i.jsx("option",{value:"zh",children:"䏿 ð¨ð³"})]})]})]}),h==="apariencia"&&i.jsxs("div",{className:"space-y-8 animate-in fade-in slide-in-from-right-4 duration-300",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("label",{className:"text-sm font-bold text-white flex items-center gap-2",children:[i.jsx(ko,{size:16,className:"text-[#f472b6]"}),"Tema Visual de la Interfaz"]}),i.jsx("span",{className:"text-xs text-[#f472b6] font-medium bg-[#f472b6]/10 px-2.5 py-0.5 rounded-full border border-[#f472b6]/30",children:"Personalizable"})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:i.jsxs("div",{onClick:()=>
4267P("default"),className:`cursor-pointer p-3.5 rounded-2xl border-2 transition-all relative overflow-hidden flex flex-col justify-between ${j==="default"?"border-cyan-400 bg-gradient-to-br from-[#0a1120] via-[#050811] to-black shadow-[0_0_20px_rgba(6,182,212,0.3)]":"border-white/10 bg-black/20 hover:border-white/20"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-lg",children:"â¡"}),i.jsx("span",{className:"text-sm font-bold text-white",children:"Cyberpunk Neón"})]}),j==="default"&&i.jsx("span",{className:"text-[11px] font-bold text-cyan-400 bg-cyan-500/20 px-2 py-0.5 rounded-full border border-cyan-500/40",children:"Activo"})]}),i.jsx("p",{className:"text-xs text-gray-400 mb-3 leading-relaxed",children:"Diseño futurista oscuro con acentos neón y lÃneas tecnológicas estilizadas."}),i.jsxs("div",{className:"p-2 rounded-xl bg-black/40 border border-white/10 flex flex-col gap-1.5 mb-2",children:[i.jsx("div",{className:"self-start px-2 py-1 rounded-lg bg-white/5 border border-white/10 text-[10px] text-gray-300 font-medium",children:"Mensaje"}),i.jsx("div",{className:"self-end px-2 py-1 rounded-lg bg-cyan-500/20 border border-cyan-500/40 text-[10px] text-cyan-300 font-medium",children:"Enviado"})]})]})})]}),i.jsx("hr",{className:"border-white/5"}),i.jsxs("div",{className:"space-y-3",children:[i.jsx("label",{className:"text-sm font-semibold text-gray-400 flex items-center gap-2",children:"Fondo General de la Sala (URL o Archivo)"}),i.jsx("div",{className:"flex flex-col gap-3 bg-black/20 p-3 rounded-2xl border border-white/5",children:i.jsxs("div",{className:"flex gap-3 items-center",children:[k?k.match(/\.(mp4|webm|ogg)$/i)?i.jsx("div",{className:"h-16 w-16 rounded-xl bg-cyan-900/50 flex items-center justify-center text-xs text-cyan-400 font-bold border border-cyan-500/30",children:"VIDEO"}):i.jsx("img",{referrerPolicy:"no-referrer",src:k,className:"h-16 w-16 rounded-xl object-cover shadow-lg",alt:"Fondo"}):i.jsx("div",{className:"h-16 w-16 rounded-xl bg-white/5 flex items-center justify-center text-xs text-gray-500 text-center leading-tight p-1",children:"Por defecto (Admin)"}),i.jsxs("div",{className:"flex-1 flex flex-col gap-2",children:[i.jsxs("div",{className:"relative",children:[i.jsx("input",{type:"file",accept:"image/*,video/*,.gif,.mp4,.webm,.mov",onChange:Oe=>Tt(Oe,E),className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"}),i.jsx("button",{className:"w-full py-2 bg-white/5 hover:bg-white/10 rounded-xl text-sm font-medium transition-colors text-white text-center",children:"Subir Archivo (GIF, Video, Imagen)"})]}),i.jsx("button",{onClick:()=>{const Oe=window.prompt("Ingresa la URL de una imagen o video (.mp4):");Oe&&E(Oe)},className:"w-full py-2 bg-cyan-500/10 hover:bg-cyan-500/20 rounded-xl text-sm font-medium transition-colors text-cyan-400 border border-cyan-500/30 text-center",children:"Usar URL (Imagen/Video)"})]}),k&&i.jsx("button",{onClick:()=>E(""),className:"py-2 px-4 h-full bg-red-500/10 hover:bg-red-500/20 text-red-400 rounded-xl text-sm font-medium transition-colors self-stretch flex items-center justify-center",children:"Restablecer"})]})})]}),i.jsx("hr",{className:"border-white/5"}),i.jsxs("div",{className:"space-y-6",children:[i.jsxs("h4",{className:"text-sm font-bold text-gray-300 flex items-center gap-2",children:[i.jsx(fl,{size:16,className:"text-cyan-400"}),"Personalizar Mi Burbuja de Chat"]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-xs font-semibold text-gray-400",children:"Color de Fondo"}),i.jsxs("div",{className:"flex items-center gap-3 bg-black/20 p-2 rounded-xl border border-white/5",children:[i.jsx("input",{type:"color",value:et,onChange:Oe=>Ae(Oe.target.value),className:"h-8 w-12 bg-transparent border-0 rounded cursor-pointer"}),i.jsx("span",{className:"text-xs text-gray-300 font-mono",children:et})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-xs font-semibold text-gray-400",children:"Borde"}),i.jsxs("select",{value:K,onChange:Oe=>ne(Oe.target.value),className:"w-full bg-black/30 p-3 rounded-xl border border-white/10 outline-none text-sm text-white",children:[i.jsx("option",{value:"border-transparent",children:"Sin Borde"}),i.jsx("option",{value:"border-white/10",children:"Sutil Claro"}
4267),i.jsx("option",{value:"border-[#5A52A5]/30",children:"Morado Suave"}),i.jsx("option",{value:"border-cyan-500",children:"Cyan Neón"}),i.jsx("option",{value:"border-pink-500",children:"Rosa Neón"}),i.jsx("option",{value:"border-green-500",children:"Verde Esmeralda"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-xs font-semibold text-gray-400",children:"Forma de Esquinas"}),i.jsxs("select",{value:Pe,onChange:Oe=>Le(Oe.target.value),className:"w-full bg-black/30 p-3 rounded-xl border border-white/10 outline-none text-sm text-white",children:[i.jsx("option",{value:"rounded-2xl rounded-tr-sm",children:"Clásico Chat"}),i.jsx("option",{value:"rounded-2xl",children:"Suave (2xl)"}),i.jsx("option",{value:"rounded-md",children:"Cuadrado (md)"}),i.jsx("option",{value:"rounded-full",children:"PÃldora (full)"}),i.jsx("option",{value:"rounded-tl-2xl rounded-br-2xl rounded-tr-sm rounded-bl-sm",children:"Hoja"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("label",{className:"text-xs font-semibold text-gray-400",children:"Efecto Visual"}),i.jsxs("select",{value:mt,onChange:Oe=>tt(Oe.target.value),className:"w-full bg-black/30 p-3 rounded-xl border border-white/10 outline-none text-sm text-white",children:[i.jsx("option",{value:"none",children:"Sólido (Liso)"}),i.jsx("option",{value:"glass",children:"Cristal (Glassmorphism)"}),i.jsx("option",{value:"glow",children:"Resplandor Exterior (Glow)"})]})]})]}),i.jsxs("div",{className:"space-y-2 mt-4 pt-4 border-t border-white/5",children:[i.jsxs("label",{className:"text-xs font-bold uppercase tracking-wider text-cyan-400 flex items-center gap-1.5",children:[i.jsx(Fs,{size:14,className:"text-amber-400"}),"Estilo Temático de Burbuja (Futuristas, Antiguos & Animaciones)"]}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 max-h-56 overflow-y-auto pr-1",children:[{id:"futuristic_neon",name:"Cyberpunk Neón 2077",desc:"Pulso neón & glow",icon:"â¡"},{id:"hologram_scifi",name:"Holograma Sci-Fi",desc:"HUD cian con scanlines",icon:"ð¸"},{id:"matrix_terminal",name:"Matrix Hacker",desc:"Terminal verde fósforo",icon:"ð»"},{id:"vintage_parchment",name:"Pergamino Antiguo",desc:"Papiro retro medieval",icon:"ð"},{id:"steampunk_bronze",name:"Steampunk Mecánico",desc:"Bronce con remaches",icon:"âï¸"},{id:"kawaii_pastel",name:"Kawaii Bouncy",desc:"Algodón de azúcar pastel",icon:"â¨"},{id:"glass_crystal",name:"Cristal Prisma",desc:"Hiper-refracción limpia",icon:"ð"},{id:"comic_popart",name:"Pop-Art Cómic",desc:"Borde de manga con pop",icon:"ð¥"},{id:"royal_gold",name:"Oro Real Barroco",desc:"Foil dorado con brillo 24k",icon:"ð"},{id:"bubble_soap",name:"Burbuja de Jabón",desc:"Tornasol irisado",icon:"ð«§"},{id:"rounded",name:"Cápsula Ultra",desc:"Forma pÃldora moderna",icon:"ð"},{id:"default",name:"Moderno Suave",desc:"Limpio y minimalista",icon:"ð±"}].map(Oe=>i.jsxs("button",{type:"button",onClick:()=>Qe(Oe.id),className:`p-2.5 rounded-xl border text-left transition-all ${lt===Oe.id?"border-cyan-400 bg-cyan-500/20 shadow-[0_0_12px_rgba(6,182,212,0.4)] ring-1 ring-cyan-400":"border-white/10 bg-white/5 hover:bg-white/10"}`,children:[i.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[i.jsx("span",{className:"text-sm",children:Oe.icon}),i.jsx("span",{className:"text-xs font-bold text-white truncate",children:Oe.name})]}),i.jsx("span",{className:"text-[10px] text-white/50 block truncate",children:Oe.desc})]},Oe.id))})]})]})]}),h==="cuenta"&&i.jsxs("div",{className:"space-y-8 animate-in fade-in slide-in-from-right-4 duration-300",children:[i.jsx("div",{className:"bg-white/5 p-4 rounded-2xl border border-white/5 space-y-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-bold text-white mb-1",children:"Amigos Públicos"}),i.jsx("p",{className:"text-xs text-gray-400",children:"Permite que otros vean tu lista de amigos."})]}),i.jsx("button",{onClick:()=>Y(!Q),className:`relative w-12 h-6 rounded-full transition-colors ${Q?"bg-cyan-500":"bg-gray-600"}`,children:i.jsx("div",{className:`absolute top-1 left-1 w-4 h-4 rounded-full bg-white transition-transform ${Q?"translate-x-6":""}`})})]})}),i.jsxs("div",{className:"p-4 bg-white/5 rounded-2xl border border-white/5 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("div",{className:`w-12 h-12 rounded-xl flex items-center justify-center transition-all duration-300 ${p?"bg-red-500 shadow-[0_0_15px_rgba(239,68,68,0.5)]":"bg-black/40"}`,children:i.jsx(rl,{size:24,className:`transition-all duration-300 ${p?"text-white":"text-gray-500"}`})}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-white font-bold text-sm",children:"Modo Incógnito (EspÃa)"}),i.jsx("p",{className:"text-xs text-gray-400 mt-1 max-w-[200px]",children:"Desapareces de la lista, solo puedes usar chat privado."})]})]}),i.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:p,onChange:jt,className:"sr-only peer"}),i.jsx("div",{className:"w-11 h-6 bg-gray-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-red-500"})]})]}),i.jsxs("div",{className:"space-y-4 pt-4 border-t border-white/5",children:[i.jsx("h4",{className:"text-sm font-bold text-white flex items-center gap-2",children:"Personalización de Interfaz"}),i.jsxs("div",{children:[i.jsx("label",{className:"text-xs text-white/70 font-semibold uppercase tracking-wider",children:"Color de Neón Principal"}),i.jsxs("div",{className:"flex gap-2 mt-2",children:[i.jsx("input",{type:"color",className:"w-10 h-10 rounded-lg cursor-pointer bg-transparent border-0",defaultValue:localStorage.getItem("chatliz_neon_color")||"#00f3ff",onChange:Oe=>{localStorage.setItem("chatliz_neon_color",Oe.target.value),window.dispatchEvent(new Event("chatliz_ui_update"))}}),i.jsxs("label",{className:"flex items-center justify-between bg-black/30 p-2 rounded-lg border border-white/10 flex-1 cursor-pointer",children:[i.jsx("span",{className:"text-sm text-white/80 font-bold",children:"Neón Arcoiris (Animado)"}),i.jsx("input",{type:"checkbox",defaultChecked:localStorage.getItem("chatliz_rainbow_neon")==="true",onCh
4267ange:Oe=>{localStorage.setItem("chatliz_rainbow_neon",Oe.target.checked.toString()),window.dispatchEvent(new Event("chatliz_ui_update"))}})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-xs text-white/70 font-semibold uppercase tracking-wider",children:"Fondo del Chat (URL)"}),i.jsx("input",{type:"text",placeholder:"https://ejemplo.com/fondo.jpg",defaultValue:localStorage.getItem("chatliz_chat_bg")||"",onChange:Oe=>{localStorage.setItem("chatliz_chat_bg",Oe.target.value),window.dispatchEvent(new Event("chatliz_ui_update"))},className:"w-full bg-black/30 p-3 mt-1 rounded-xl border border-white/10 focus:border-cyan-400 outline-none text-white transition-colors text-sm"}),i.jsx("p",{className:"text-xs text-white/40 mt-1",children:"Este fondo sólo será visible en tu dispositivo."})]})]}),i.jsxs("div",{className:"space-y-3 pt-4 border-t border-white/5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h4",{className:"text-sm font-bold text-white flex items-center gap-2",children:[i.jsx(Pu,{size:16,className:"text-cyan-400"})," Cambiar Nombre de Usuario"]}),i.jsxs("span",{className:"text-[11px] font-mono text-cyan-300 bg-cyan-950/60 border border-cyan-800/40 px-2 py-0.5 rounded-full font-bold",children:["ID Fijo: #",n.uid||(n.username.toUpperCase()==="AXISS"?"1001":"1000")]})]}),i.jsxs("p",{className:"text-xs text-white/50 leading-relaxed",children:["Puedes cambiar tu nombre de usuario en cualquier momento. Tu ",i.jsxs("strong",{children:["número de identificación permanente (ID #",n.uid||(n.username.toUpperCase()==="AXISS"?"1001":"1000"),")"]})," es único, fijo e inmutable; nunca cambiará y garantiza que tu cuenta y registros sigan protegidos."]}),i.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[i.jsx("input",{type:"text",value:S,onChange:Oe=>be(Oe.target.value),placeholder:"Nuevo nombre de usuario...",className:"flex-1 bg-black/30 p-3 rounded-xl border border-white/10 focus:border-cyan-400 outline-none text-white transition-colors text-sm"}),i.jsx("button",{type:"button",disabled:De||S.trim()===n.username,onClick:$e,className:"px-4 py-3 bg-cyan-600 hover:bg-cyan-500 disabled:opacity-40 disabled:hover:bg-cyan-600 text-white rounded-xl font-bold text-sm transition-all whitespace-nowrap shadow-sm",children:De?"Actualizando...":"Actualizar Nombre"})]}),Ee&&i.jsx("div",{className:`p-3 rounded-xl text-xs font-semibold border ${Ee.error?"bg-red-500/10 border-red-500/30 text-red-300":"bg-emerald-500/10 border-emerald-500/30 text-emerald-300"}`,children:Ee.text})]}),i.jsxs("div",{className:"space-y-4 pt-4 border-t border-white/5",children:[i.jsx("h4",{className:"text-sm font-bold text-white flex items-center gap-2",children:"Cambiar Contraseña"}),i.jsx("input",{type:"password",value:R,onChange:Oe=>A(Oe.target.value),placeholder:"Nueva contraseña...",className:"w-full bg-black/30 p-4 rounded-2xl border border-white/10 focus:border-cyan-400 outline-none text-white transition-colors"})]}),((gn=n==null?void 0:n.username)==null?void 0:gn.toUpperCase())==="AXISS"&&i.jsx("div",{className:"pt-4 border-t border-white/5",children:i.jsxs("button",{onClick:()=>{const Oe=o.find(vt=>vt.username==="Elizabeth");l({profilePic:(Oe==null?void 0:Oe.profilePic)||"",statusMessage:(Oe==null?void 0:Oe.statusMessage)||"IA Asistente virtual",systemInstruction:(Oe==null?void 0:Oe.systemInstruction)||""}),t(!1),s(!0)},className:"w-full flex items-center justify-center gap-2 text-fuchsia-400 border border-fuchsia-500/30 bg-fuchsia-500/10 p-4 rounded-2xl font-bold hover:bg-fuchsia-500/20 transition-all shadow-[0_0_20px_rgba(217,70,239,0.15)]",children:[i.jsx(gl,{size:18})," Configuración Avanzada de Elizabeth"]})}),i.jsx("div",{className:"pt-4",children:i.jsxs("button",{onClick:()=>{localStorage.removeItem("chatliz_user"),window.location.reload()},className:"w-full flex items-center justify-center gap-2 text-red-400 bg-red-500/10 hover:bg-red-500/20 p-4 rounded-2xl font-bold transition-colors border border-red-500/20",children:[i.jsx(eI,{size:18}),"Cerrar Sesión Segura"]})})]})]}),i.jsxs("div",{className:"p-4 md:p-6 border-t border-white/5 bg-black/20 flex flex-col items-center",children:[i.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-6",children:[i.jsxs("h3",{className:"text-xl font-bold text-white mb-4 flex items-center gap-2",children:[i.jsx("span",{className:"text-cyan-400",children:"â«"})," Audio Visualizer"]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-white/60 text-sm block mb-2",children:"Style"}),i.jsxs("select",{className:"w-full bg-[#0a0a0a] border border-white/10 rounded-xl px-4 py-3 text-white focus:border-cyan-500/50 outline-none",value:st,onChange:Oe=>Yn(Oe.target.value),children:[i.jsx("option",{value:"neon_waves",children:"Neon Waves"}),i.jsx("option",{value:"cyber_bars",children:"Cyberpunk Bars"}),i.jsx("option",{value:"stardust",children:"Stardust Particles"}),i.jsx("option",{value:"holographic",children:"Holographic Line"})]})]}),i.jsxs("div",{className:"flex gap-4",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("label",{className:"text-white/60 text-sm block mb-2",children:"Primary Color"}),i.jsx("input",{type:"color",className:"w-full h-10 rounded cursor-pointer bg-transparent border-0",value:Rn,onChange:Oe=>zn(Oe.target.value)})]}),i.jsxs("div",{className:"flex-1",children:[i.jsx("label",{className:"text-white/60 text-sm block mb-2",children:"Secondary Color"}),i.jsx("input",{type:"color",className:"w-full h-10 rounded cursor-pointer bg-transparent border-0",value:Zt,onChange:Oe=>en(Oe.target.value)})]})]}),i.jsxs("div",{className:"mt-4 p-4 bg-black/40 rounded-xl border border-white/5 flex items-center justify-center h-20 overflow-hidden relative",children:[i.jsx("div",{className:"absolute inset-0 opacity-50",style:{background:`linear-gradient(90deg, ${Rn}, ${Zt})`,filter:"blur(20px)"}}),i.jsxs("div",{className:"text-white/80 z-10 font-mono text-sm tracking-widest uppercase flex items-center gap-2",children:[i.jsx("span",{className:"animate-pulse",style:{color:Rn},children:"ılılı"}),"Preview Style",i.jsx("span",{className:"animate-pulse",style:{color:Zt},children:"ılılı"})]})]})]})]}),i.jsx("button",{onClick:At,className:"w-full md:w-auto md:px-12 py-4 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 text-white rounded-2xl font-bold text-lg transition-all shadow-[0_0_20px_rgba(8,145,178,0.4)] hover:shadow-[0_0_30px_rgba(8,145,178,0.6)] hover:scale-[1.02]",children:"Guardar Cambios"}),O&&i.jsx("div",{className:"mt-3 text-sm font-bold text-cyan-400 animate-in fade-in slide-in-from-bottom-2",children:O})]})]}),i.jsx("button",{onClick:()=>t(!1),className:"hidden md:flex absolute top-4 right-4 text-gray-400 hover:text-white bg-black/20 hover:bg-white/10 p-2 rounded-full backdrop-blur-md transition-colors z-10",children:i.jsx(Kt,{size:20})})]})]})}function cB({active:n,onClick:e,icon:t,label:s}){return i.jsxs("button",{onClick:e,className:`flex items-center gap-3 px-4 py-3 rounded-xl font-medium transition-all text-sm whitespace-nowrap md:whitespace-normal 4268 ${n?"bg-cyan-500/10 text-cyan-400 border border-cyan-500/20":"text-gray-400 hover:bg-white/5 hover:text-gray-200 border border-transparent"} 4269 `,children:[t,s]})}function t7({setAdminConfigAiOpen:n,aiProfileForm:e,setAiProfileForm:t,aiUsername:s}){var An,Nr;const[o,l]=y.useState("tokens"),[u,h]=y.useState(""),[f,p]=y.useState("ChatLiz-Groq-Backup"),[x,b]=y.useState(""),[C,N]=y.useState(""),[T,R]=y.useState("gemini"),[A,U]=y.useState(!1),[M,V]=y.useState(!1),[H,Q]=y.useState(!1),[Y,k]=y.useState(!1),[E,j]=y.useState(!1),[P,O]=y.useState(null),[F,S]=y.useState("gemini"),[be,Ee]=y.useState(null),[me,De]=y.useState(()=>(e==null?void 0:e.voiceConfig)||km()),[ge,Ue]=y.useState(""),[we,$e]=y.useState(!1),[et,Ae]=y.useState(!1),[K,ne]=y.useState("¡Hola Axiss! Esta es mi voz humana real generada con sÃntesis neural de estudio."),[Pe,Le]=y.useState({}),[mt,tt]=y.useState({passiveLearningEnabled:!0,activeMimicUsername:"",mimicModeEnabled:!1,totalLearnedAudios:0}),[lt,Qe]=y.useState(!1),[st,Yn]=y.useState({humanizationLevel:85,evolutionStage:4,stageName:"Inflexiones Orgánicas XTTS v2",totalAudiosAbsorbed:16,learningPace:"pasos_agigantados",barkNonVerbalTagsEnabled:!0,xttsProsodyEnabled:!0,absorbedTraits:{naturalBreathing:!0,expressivePitchContour:!0,conversationalWarmth:!0,laughterInflection:!0,rhythmAdaptability:!0,vocalFryReduction:!0}
4269,lastEvolutionTimestamp:Date.now(),logs:[]}),[Rn,zn]=y.useState(!1),[Zt,en]=y.useState("todas"),[jt,At]=y.useState(null),[Tt,gn]=y.useState(""),[Oe,vt]=y.useState(""),[Ft,on]=y.useState(""),[Zn,Fn]=y.useState(!1),[In,nn]=y.useState(!1),Ve=y.useRef(null),Rt=y.useRef([]),[os,Hn]=y.useState({}),[_t,Sn]=y.useState("Axiss"),[Qt,Vt]=y.useState(!1),[at,Et]=y.useState(""),[hs,xn]=y.useState("personal"),[wt,rn]=y.useState(!1);y.useEffect(()=>()=>{th()},[]),y.useEffect(()=>{W.emit("get_ai_api_config",ee=>{ee!=null&&ee.success&&ee.config&&(ee.config.groqBackupName&&p(ee.config.groqBackupName),ee.config.groqBackupKey&&b(ee.config.groqBackupKey),ee.config.geminiKey&&N(ee.config.geminiKey),ee.config.preferredProvider&&R(ee.config.preferredProvider),ee.config.activeProvider&&S(ee.config.activeProvider),ee.config.providerStatus&&Ee(ee.config.providerStatus))})},[]);const jn=()=>{Qe(!0),W.emit("get_voice_learning_vault",ee=>{Qe(!1),ee!=null&&ee.success&&(ee.vault&&Le(ee.vault),ee.settings&&tt(ee.settings))})},On=()=>{W.emit("get_voice_evolution_status",ee=>{ee!=null&&ee.success&&(ee.evolution&&Yn(ee.evolution),ee.vault&&Le(ee.vault),ee.settings&&tt(ee.settings))})},es=()=>{Vt(!0),W.emit("get_all_elizabeth_memories",ee=>{if(Vt(!1),ee!=null&&ee.success&&ee.brains){Hn(ee.brains);const ve=Object.keys(ee.brains);ve.length>0&&!ee.brains[_t]&&Sn(ve[0])}})};y.useEffect(()=>{const ee=ve=>{ve!=null&&ve.state&&Yn(ve.state),ve!=null&&ve.log&&h(`ð ¡Evolución Acústica! +${ve.log.naturalnessDelta}% naturalidad asimilada de @${ve.log.sourceUsername}`)};return W.on("elizabeth_voice_evolved",ee),()=>{W.off("elizabeth_voice_evolved",ee)}},[]),y.useEffect(()=>{o==="mimic"?(jn(),On()):o==="voice"?On():o==="memories"&&es()},[o]),y.useEffect(()=>{if(u){const ee=setTimeout(()=>{h("")},3500);return()=>clearTimeout(ee)}},[u]);const ls=ee=>{ee==="groq"&&Q(!0),ee==="gemini"&&k(!0),O(null),W.emit("test_ai_token",{provider:ee,token:ee==="groq"?x:C},ve=>{ee==="groq"&&Q(!1),ee==="gemini"&&k(!1),ve!=null&&ve.success?O({provider:ee,success:!0,msg:ve.message}):O({provider:ee,success:!1,msg:(ve==null?void 0:ve.error)||"Fallo en la prueba de conexión"})})},Vn=()=>{j(!0),W.emit("update_ai_api_config",{groqBackupName:f.trim(),groqBackupKey:x.trim(),geminiKey:C.trim(),preferredProvider:T},ee=>{var ve;j(!1),ee!=null&&ee.success?(h(ee.message||"¡Tokens y configuración de IA guardados exitosamente!"),(ve=ee.config)!=null&&ve.activeProvider&&S(ee.config.activeProvider)):alert("Error al guardar: "+((ee==null?void 0:ee.error)||"Error desconocido"))})},de=ee=>{var hn;const ve=(hn=ee.target.files)==null?void 0:hn[0];if(!ve)return;if(ve.size>20*1024*1024){alert("El archivo de audio no debe exceder 20MB");return}const Gt=new FileReader;Gt.onload=()=>{const Js=Gt.result;if(vt(Js),!Tt){const Is=ve.name.replace(/\.[^/.]+$/,"").replace(/[^a-zA-Z0-9_-]/g,"_");gn(Is)}h("Muestra de audio cargada para clonación.")},Gt.readAsDataURL(ve)},sn=async()=>{if(In)Ve.current&&Ve.current.state==="recording"&&Ve.current.stop(),nn(!1);else try{const ee=await navigator.mediaDevices.getUserMedia({audio:!0}),ve=new MediaRecorder(ee);Rt.current=[],ve.ondataavailable=Gt=>{Gt.data&&Gt.data.size>0&&Rt.current.push(Gt.data)},ve.onstop=()=>{const Gt=new Blob(Rt.current,{type:"audio/webm"}),hn=new FileReader;hn.onloadend=()=>{vt(hn.result),h("Grabación capturada lista para clonar.")},hn.readAsDataURL(Gt),ee.getTracks().forEach(Js=>Js.stop())},Ve.current=ve,ve.start(),nn(!0)}catch(ee){console.error("Error al grabar para clonación:",ee),alert("No se pudo acceder al micrófono para grabar la muestra.")}},Ut=()=>{const ee=Tt.trim();if(!ee){alert("Por favor ingresa un nombre para la voz clonada (ej: 'Axiss' o 'Voz Joven').");return}if(!Oe){alert("Por favor sube o graba un audio de muestra.");return}Fn(!0),wO(W,ee,Oe,Ft).then(ve=>{Fn(!1),ve!=null&&ve.success?(jn(),On(),vt(""),on(""),h(`ð ¡Voz de "${ee}" clonada exitosamente con motor XTTS v2!`)):alert("Error al clonar voz: "+((ve==null?void 0:ve.error)||"Error desconocido"))}).catch(ve=>{Fn(!1),alert("Fallo al clonar voz: "+ve.message)})},xs=ee=>{ee.preventDefault(),!(!at.trim()||!_t)&&(rn(!0),W.emit("add_elizabeth_memory",{username:_t,fact:at.trim(),category:hs,confidence:"alta"},ve=>{rn(!1),ve!=null&&ve.success?(Et(""),es(),h(`Recuerdo añadido al cerebro de Elizabeth para @${_t}`)):alert("Error al guardar recuerdo: "+((ve==null?void 0:ve.error)||"Error"))}))},He=ee=>{W.emit("delete_elizabeth_memory",{username:_t,memoryId:ee},ve=>{ve!=null&&ve.success&&(es(),h("Recuerdo eliminado del banco de memoria."))})},Us=()=>{confirm(`¿Estás seguro de reiniciar todos los recuerdos de @${_t}?`)&&W.emit("clear_user_memories",{username:_t},ee=>{ee!=null&&ee.success&&(es(),h(`Memoria de @${_t} reiniciada.`))})},Ot=(ee,ve)=>{if(we&&jt===ee){th(),$e(!1),At(null);return}th();
4269const Gt=nl.find(Js=>Js.id===ee),hn=Gt?CO(Gt):"Hola, soy Elizabeth con locución de estudio Coqui XTTS v2.";$e(!0),At(ee),_O(hn,ee,{onStart:()=>$e(!0),onEnd:()=>{$e(!1),At(null)},onError:Js=>{$e(!1),At(null),console.warn("Speech error:",Js)}})},Un=ee=>{const ve={...me,archetypeId:ee.id,pitch:ee.pitch,rate:ee.rate,volume:ee.volume,engine:"xtts_v2"};De(ve),Ae(!0);const Gt=OD(ve);W.emit("update_ai_config",{aiUsername:s,voiceConfig:Gt},hn=>{Ae(!1),hn!=null&&hn.success||(hn==null?void 0:hn.success)===void 0?h(`¡Avatar y voz de "${ee.name}" guardados exitosamente para ${s}!`):alert("Error al guardar voz: "+(hn==null?void 0:hn.error))})},ln=os[_t]||{memories:[],stats:{affinityLevel:"Conocido"}};return i.jsx("div",{className:"fixed inset-0 bg-black/75 backdrop-blur-md z-[120] flex items-center justify-center p-2 sm:p-4",children:i.jsxs("div",{className:"bg-[#12141c] p-4 sm:p-6 rounded-3xl w-full max-w-xl shadow-2xl relative border border-fuchsia-500/25 max-h-[94vh] flex flex-col",children:[i.jsx("button",{onClick:()=>{th(),n(!1)},className:"absolute top-4 right-4 text-gray-400 hover:text-white bg-white/5 hover:bg-white/10 p-2 rounded-full transition-colors z-10",children:i.jsx(Kt,{size:19})}),i.jsxs("div",{className:"mb-3 pr-8",children:[i.jsxs("h2",{className:"text-lg sm:text-xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-fuchsia-400 via-pink-300 to-cyan-400 flex items-center gap-2",children:[i.jsx(gl,{size:22,className:"text-fuchsia-400 shrink-0"}),"Panel Maestro de ",s]}),i.jsx("p",{className:"text-[11px] text-gray-400 mt-0.5",children:"Centro de Control Cuántico, Voz Humana, MÃmica Acústica & Almacén de Recuerdos."})]}),i.jsxs("div",{className:"flex bg-[#0a0a14] p-1 rounded-2xl border border-white/5 gap-1 mb-3 overflow-x-auto scrollbar-none",children:[i.jsxs("button",{type:"button",onClick:()=>l("tokens"),className:`flex items-center justify-center gap-1.5 py-1.5 px-2.5 rounded-xl text-xs font-semibold whitespace-nowrap transition-all ${o==="tokens"?"bg-gradient-to-r from-amber-500/20 to-orange-500/20 text-amber-300 border border-amber-500/40 shadow-sm":"text-gray-400 hover:text-gray-200 hover:bg-white/5"}`,children:[i.jsx(ih,{size:13,className:o==="tokens"?"text-amber-400":""}),i.jsx("span",{children:"APIs"})]}),i.jsxs("button",{type:"button",onClick:()=>l("profile"),className:`flex items-center justify-center gap-1.5 py-1.5 px-2.5 rounded-xl text-xs font-semibold whitespace-nowrap transition-all ${o==="profile"?"bg-gradient-to-r from-fuchsia-500/20 to-pink-500/20 text-fuchsia-300 border border-fuchsia-500/40 shadow-sm":"text-gray-400 hover:text-gray-200 hover:bg-white/5"}`,children:[i.jsx(gl,{size:13,className:o==="profile"?"text-fuchsia-400":""}),i.jsx("span",{children:"Perfil"})]}),i.jsxs("button",{type:"button",onClick:()=>l("voice"),className:`flex items-center justify-center gap-1.5 py-1.5 px-2.5 rounded-xl text-xs font-semibold whitespace-nowrap transition-all ${o==="voice"?"bg-gradient-to-r from-pink-500/20 to-rose-500/20 text-pink-300 border border-pink-500/40 shadow-sm":"text-gray-400 hover:text-gray-200 hover:bg-white/5"}`,children:[i.jsx(xl,{size:13,className:o==="voice"?"text-pink-400":""}),i.jsx("span",{children:"Avatares de Voz XTTS v2"})]}),i.jsxs("button",{type:"button",onClick:()=>l("memories"),className:`flex items-center justify-center gap-1.5 py-1.5 px-2.5 rounded-xl text-xs font-semibold whitespace-nowrap transition-all ${o==="memories"?"bg-gradient-to-r from-emerald-500/20 to-teal-500/20 text-emerald-300 border border-emerald-500/40 shadow-sm":"text-gray-400 hover:text-gray-200 hover:bg-white/5"}`,children:[i.jsx(OC,{size:13,className:o==="memories"?"text-emerald-400":""}),i.jsx("span",{children:"Recuerdos"})]}),i.jsxs("button",{type:"button",onClick:()=>l("dj"),className:`flex items-center justify-center gap-1.5 py-1.5 px-2.5 rounded-xl text-xs font-semibold whitespace-nowrap transition-all ${o==="dj"?"bg-gradient-to-r from-cyan-500/20 to-blue-500/20 text-cyan-300 border border-cyan-500/40 shadow-sm":"text-gray-400 hover:text-gray-200 hover:bg-white/5"}`,children:[i.jsx(Am,{size:13,className:o==="dj"?"text-cyan-400":""}),i.jsx("span",{children:"DJ"})]})]}),u&&i.jsxs("div",{className:"mb-3 p-2.5 bg-green-500/10 border border-green-500/30 rounded-xl flex items-center gap-2.5 text-green-400 font-medium text-xs animate-in fade-in",children:[i.jsx(SE,{size:16,className:"shrink-0"}),i.jsx("p",{children:u})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto pr-1 space-y-4 scrollbar-thin",children:[o==="tokens"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/20 p-3 rounded-2xl flex items-start gap-2.5 text-xs text-emerald-300",children:[i.jsx(ph,{size:18,className:"shrink-0 text-emerald-400 mt-0.5"}),i.jsxs("div",{children:[i.jsx("span",{className:"font-bold text-emerald-200",children:"Almacenamiento seguro en Base de Datos:"}),i.jsx("p",{className:"text-[11px] text-emerald-300/80 mt-0.5 leading-relaxed",children:"Las claves se persisten en Firestore / Fallback y nunca en el código fuente."})]})]}),i.jsxs("div",{className:"bg-[#181a26] p-3.5 rounded-2xl border border-white/10 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-emerald-400 animate-pulse"}),i.jsx("span",{className:"text-xs font-bold text-gray-200",children:"Proveedor activo:"}),i.jsx("span",{className:"text-xs font-extrabold uppercase px-2 py-0.5 rounded-full bg-fuchsia-500/20 text-fuchsia-300 border border-fuchsia-500/30",children:F==="gemini"?"Google Gemini":f||"Groq Backup"})]}),i.jsx("p",{className:"text-[11px] text-gray-400 mt-1",children:"Conmutación bidireccional automática si se agota la cuota."})]}),i.jsx(ph,{size:24,className:"text-cyan-400 opacity-80"})]}),i.jsxs("div",{className:"bg-[#181a26] p-4 rounded-2xl border border-white/5 space-y-3",children:[i.jsxs("div",{children:[i.jsxs("label",{className:"text-xs font-bold text-amber-300 flex items-center gap-1.5 mb-1",children:[i.jsx(um,{size:14,className:"text-amber-400"}),"Nombre de la API de Respaldo"]}),i.jsx("input",{type:"text",value:f,onChange:ee=>p(ee.target.value),className:"w-full bg-[#0a0a14] border border-white/10 rounded-xl px-3 py-2 text-xs text-gray-200 focus:outline-none focus:border-amber-400",placeholder:"Ej: ChatLiz-Groq-Backup"})]}),i.jsxs("div",{children:[i.jsxs("label",{className:"text-xs font-bold text-amber-300 flex items-center justify-between mb-1",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx(ih,{size:14,className:"text-amber-400"}),"Token API de Groq"]}),i.jsxs("button",{type:"button",onClick:()=>U(!A),className:"text-gray-400 hover:text-white text-[10px] flex items-center gap-1",children:[A?i.jsx(rl,{size:12}):i.jsx(Dy,{size:12}),A?"Ocultar":"Ver"]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:A?"text":"password",value:x,onChange:ee=>b(ee.target.value),placeholder:"gsk_...",className:"flex-1 bg-[#0a0a14] border border-white/10 rounded-xl px-3 py-2 text-xs font-mono text-gray-200 focus:outline-none focus:border-amber-400"}),i.jsx("button",{type:"button",onClick:()=>ls("groq"),disabled:H||!x.trim(),className:"px-3 py-2 bg-amber-500/20 hover:bg-amber-500/30 text-amber-300 rounded-xl text-xs font-semibold border border-amber-500/30 transition-colors disabled:opacity-40",children:H?i.jsx(xo,{size:14,className:"animate-spin"}):"Probar"})]})]}),i.jsxs("div",{children:[i.jsxs("label",{className:"text-xs font-bold text-cyan-300 flex items-center justify-between mb-1",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx(ih,{size:14,className:"text-cyan-400"}),"Token API de Google Gemini (Recomendado para Voz Neural)"]}),i.jsxs("button",{type:"button",onClick:()=>V(!M),className:"text-gray-400 hover:text-white text-[10px] flex items-center gap-1",children:[M?i.jsx(rl,{size:12}):i.jsx(Dy,{size:12}),M?"Ocultar":"Ver"]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:M?"text":"password",value:C,onChange:ee=>N(ee.target.value),placeholder:"AIzaSy...",className:"flex-1 bg-[#0a0a14] border border-white/10 rounded-xl px-3 py-2 text-xs font-mono text-gray-200 focus:outline-none focus:border-cyan-400"}),i.jsx("button",{type:"button",onClick:()=>ls("gemini"),disabled:Y||!C.trim(),className:"px-3 py-2 bg-cyan-500/20 hover:bg-cyan-500/30 text-cyan-300 rounded-xl text-xs font-semibold border border-cyan-500/30 transition-colors disabled:opacity-40",children:Y?i.jsx(xo,{size:14,className:"animate-spin"}):"Probar"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-xs font-bold text-gray-200 block mb-1.5",children:"Proveedor Preferido Inicial"}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>R("gemini"),className:`p-2.5 rounded-xl border text-xs font-bold transition-all flex items-center justify-center gap-2 ${T==="gemini"?"bg-cyan-500/20 border-cyan-400 text-cyan-300":"bg-[#0a0a14] border-white/10 text-gray-400"}`,children:[i.jsx(um,{size:14})," Google Gemini"]}),i.jsxs("button",{type:"button",onClick:()=>R("groq"),className:`p-2.5 rounded-xl border text-xs font-bold transition-all flex items-center justify-center gap-2 ${T==="groq"?"bg-amber-500/20 border-amber-400 text-amber-300":"bg-[#0a0a14] border-white/10 text-gray-400"}`,children:[i.jsx(um,{size:14})," ",f||"Groq"]})]})]}),P&&i.jsxs("div",{className:`p-3 rounded-xl text-xs border ${P.success?"bg-emerald-500/10 border-emerald-500/30 text-emerald-300":"bg-red-500/10 border-red-500/30 text-red-300"}`,children:[i.jsx("span",{className:"font-bold",children:P.success?"â Ãxito:":"â Error:"})," ",P.msg]}),i.jsxs("button",{type:"button",onClick:Vn,disabled:E,className:"w-full bg-gradient-to-r from-amber-500 via-orange-500 to-pink-500 hover:from-amber-400 hover:to-pink-400 text-white font-bold py-2.5 rounded-xl text-xs uppercase tracking-wider transition-all disabled:opacity-50 flex items-center justify-center gap-2",children:[E?i.jsx(xo,{size:14,className:"animate-spin"}):i.jsx(SE,{size:14}),i.jsx("span",{children:"Guardar Configuración de APIs"})]})]})]}),o==="profile"&&i.jsxs("div",{className:"space-y-4 text-xs",children:[i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsxs("div",{className:"relative group cursor-pointer",children:[i.jsx("img",{src:e.profilePic||"https://images.unsplash.com/photo-153452874
42691775-53994a69daeb?w=150&auto=format&fit=crop&q=80",alt:"Avatar IA",className:"w-20 h-20 rounded-full object-cover border-2 border-fuchsia-500 shadow-[0_0_15px_rgba(217,70,239,0.3)] transition-all group-hover:scale-105"}),i.jsxs("div",{className:"absolute inset-0 bg-black/60 rounded-full opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:[i.jsx("span",{className:"text-[10px] text-white font-bold text-center px-1",children:"Cambiar Foto"}),i.jsx("input",{type:"file",accept:"image/*",className:"absolute inset-0 opacity-0 cursor-pointer",onChange:ee=>{var Gt;const ve=(Gt=ee.target.files)==null?void 0:Gt[0];if(ve){const hn=new FileReader;hn.onload=Js=>{var Is;t({...e,profilePic:(Is=Js.target)==null?void 0:Is.result})},hn.readAsDataURL(ve)}}})]})]}),i.jsx("span",{className:"text-[11px] text-gray-500 mt-2 font-semibold uppercase tracking-wider",children:"Haz clic para cambiar avatar"})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("label",{className:"text-xs font-semibold text-gray-300",children:"Estado / Mensaje de Presentación"}),i.jsx("input",{value:e.statusMessage||"",onChange:ee=>t({...e,systemInstruction:e.systemInstruction||"",statusMessage:ee.target.value}),maxLength:60,placeholder:"Ej: Administradora IA ⢠En lÃnea",type:"text",className:"w-full bg-[#0a0a16] p-2.5 rounded-xl border border-white/10 outline-none focus:border-fuchsia-500 transition-all text-white text-xs"})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("label",{className:"text-xs font-semibold text-gray-300",children:"Instrucciones de Identidad (system_instruction)"}),i.jsx("textarea",{value:e.systemInstruction||"",onChange:ee=>t({...e,systemInstruction:ee.target.value}),placeholder:"Ej: Eres Elizabeth, administradora de Chat Liz. Eres carismática, divertida y justa...",rows:4,className:"w-full bg-[#0a0a16] p-2.5 rounded-xl border border-white/10 outline-none focus:border-fuchsia-500 transition-all text-white text-xs resize-none scrollbar-thin"})]}),i.jsxs("button",{type:"button",onClick:()=>{W.emit("update_ai_config",{aiUsername:s,profilePic:e.profilePic,statusMessage:e.statusMessage,systemInstruction:e.systemInstruction,bubbleColor:e.bubbleColor,bubbleBorder:e.bubbleBorder,bubbleShape:e.bubbleShape,bubbleTexture:e.bubbleTexture,groqBackupKey:x.trim(),groqBackupName:f.trim(),geminiKey:C.trim(),preferredProvider:T},ee=>{ee!=null&&ee.success||(ee==null?void 0:ee.success)===void 0?h(`¡Perfil de ${s} guardado con éxito!`):alert("Error: "+(ee==null?void 0:ee.error))})},className:"w-full mt-2 bg-gradient-to-r from-fuchsia-600 to-pink-600 hover:from-fuchsia-500 hover:to-pink-500 text-white p-3 rounded-xl font-bold text-xs uppercase tracking-wider transition-colors shadow-[0_4px_14px_rgba(217,70,239,0.3)]",children:["Guardar Perfil de ",s]})]}),o==="voice"&&i.jsxs("div",{className:"space-y-4 text-xs",children:[i.jsxs("div",{className:"bg-gradient-to-r from-pink-950/40 via-purple-950/40 to-[#181a26] p-3.5 rounded-2xl border border-pink-500/25 flex items-start gap-3",children:[i.jsx("div",{className:"p-2 rounded-xl bg-pink-500/20 text-pink-300 border border-pink-500/30 shrink-0 mt-0.5",children:i.jsx(xl,{size:18})}),i.jsxs("div",{children:[i.jsxs("h3",{className:"font-bold text-white text-xs flex items-center gap-1.5 flex-wrap",children:["Avatares de Voz Oficiales Coqui XTTS v2",i.jsxs("span",{className:"bg-emerald-500/20 text-emerald-300 text-[10px] px-2 py-0.5 rounded-full font-bold uppercase border border-emerald-500/30 flex items-center gap-1",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),"100% Gratuito ⢠Sin API Key"]})]}),i.jsxs("p",{className:"text-[11px] text-gray-300/80 mt-1 leading-relaxed",children:["Selecciona cualquier avatar de voz para Elizabeth. Puedes escuchar su tono en tiempo real y, con un solo clic en ",i.jsx("strong",{children:"Guardar Voz"}),", quedará configurada como la voz oficial de Elizabeth para mensajes y llamadas."]})]})]}),(()=>{const ee=nl.find(Gt=>Gt.id===me.archetypeId)||nl[0],ve=we&&jt===ee.id;return i.jsx("div",{className:"bg-gradient-to-b from-[#22162b] to-[#141522] p-3.5 rounded-2xl border-2 border-pink-500/60 shadow-[0_0_24px_rgba(236,72,153,0.25)]",children:i.jsxs("div",{className:"flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"relative",children:[i.jsx("img",{src:PE(ee),alt:ee.name,className:"w-14 h-14 roun
4269ded-full object-cover border-2 border-pink-400 shadow-md ring-2 ring-pink-500/30"}),i.jsx("span",{className:"absolute -bottom-1 -right-1 bg-pink-500 text-white text-[9px] font-black px-1.5 py-0.2 rounded-full border border-black shadow",children:"EN USO"})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-[10px] uppercase font-bold text-pink-400 tracking-wider block",children:"Voz Oficial de Elizabeth"}),i.jsxs("h4",{className:"text-sm font-black text-white flex items-center gap-1.5 mt-0.5",children:[ee.name,i.jsx("span",{className:"text-[10px] font-normal px-2 py-0.5 rounded-full bg-white/10 text-gray-300 font-mono",children:ee.accent||ee.speakerTag})]}),i.jsx("p",{className:"text-[11px] text-gray-300 mt-0.5 line-clamp-1",children:ee.description})]})]}),i.jsxs("div",{className:"shrink-0 flex flex-col gap-1.5",children:[i.jsxs("button",{type:"button",onClick:()=>Ot(ee.id),className:`px-3 py-1.5 rounded-xl font-bold text-xs flex items-center gap-1.5 transition-all shadow-sm ${ve?"bg-red-500 text-white border border-red-400 animate-pulse":"bg-gradient-to-r from-pink-500 to-purple-600 hover:from-pink-400 hover:to-purple-500 text-white"}`,children:[ve?i.jsx(IE,{size:13}):i.jsx(fh,{size:13,fill:"currentColor"}),i.jsx("span",{children:ve?"Detener":"Escuchar"})]}),i.jsx("button",{type:"button",onClick:()=>zE(ee.id),className:"px-2.5 py-1 rounded-xl border border-pink-500/30 text-[10px] text-pink-300 hover:bg-pink-500/10 flex items-center justify-center gap-1 font-semibold transition-all",title:"Diagnóstico técnico del audio (RIFF, 24kHz, Web Audio)",children:i.jsx("span",{children:"𩺠Diagnóstico"})})]})]})})})(),i.jsxs("div",{className:"space-y-2.5",children:[i.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-1",children:[i.jsxs("label",{className:"font-bold text-gray-200 flex items-center gap-1.5 text-xs",children:[i.jsx("span",{children:"Catálogo de Avatares Coqui XTTS v2"}),i.jsxs("span",{className:"text-[10px] text-pink-400 bg-pink-500/15 border border-pink-500/30 px-1.5 py-0.5 rounded-md font-mono font-bold",children:[nl.length," Avatares"]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:()=>zE(me.archetypeId||"elizabeth_suprema"),className:"px-2.5 py-1 rounded-lg border border-cyan-500/40 bg-cyan-500/10 hover:bg-cyan-500/20 text-cyan-300 text-[10px] font-bold flex items-center gap-1 transition-all",title:"Abrir ventana de diagnóstico acústico técnico",children:i.jsx("span",{children:"𩺠Diagnóstico de Audio"})}),i.jsx("span",{className:"text-[10px] text-gray-400",children:"Escucha y guarda la que prefieras"})]})]}),i.jsxs("div",{className:"relative",children:[i.jsx(Sg,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),i.jsx("input",{type:"text",value:ge,onChange:ee=>Ue(ee.target.value),placeholder:"Buscar por nombre, acento o estilo (ej: SofÃa, Lucas, Diego, Claribel, Damian...)",className:"w-full bg-[#0a0a16] border border-white/10 rounded-xl pl-9 pr-7 py-2 text-xs text-gray-200 placeholder-gray-500 focus:outline-none focus:border-pink-500/60 transition-colors"}),ge&&i.jsx("button",{type:"button",onClick:()=>Ue(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-200 text-xs",children:"â"})]}),i.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-1 text-[10px] scrollbar-none",children:[{id:"todas",label:`Todos (${nl.length})`},{id:"espanol_xtts",label:`Español Nativo (${nl.filter(ee=>ee.category==="espanol_xtts").length})`},{id:"femenina_xtts",label:`Femeninas (${nl.filter(ee=>ee.gender==="female").length})`},{id:"masculina_xtts",label:`Masculinas (${nl.filter(ee=>ee.gender==="male").length})`},{id:"clon_xtts",label:"Clonados (1)"}].map(ee=>i.jsx("button",{type:"button",onClick:()=>en(ee.id),className:`px-3 py-1 rounded-lg font-bold shrink-0 transition-all ${Zt===ee.id?"bg-gradient-to-r from-pink-500 to-purple-600 text-white shadow-sm":"bg-[#181a26] text-gray-400 hover:text-white border border-white/5"}`,children:ee.label},ee.id))}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2.5 max-h-[420px] overflow-y-auto pr-1 scrollbar-thin",children:nl.filter(ee=>{if(Zt==="espanol_xtts"&&ee.category!=="espanol_xtts"||Zt==="femenina_xtts"&&ee.gender!=="female"||Zt==="masculina_xtts"&&ee.gender!=="male"||Zt==="clon_xtts"&&ee.category!=="clon_xtts")return!1;if(ge.trim()){const ve=ge.toLowerCase();if(!(ee.name.toLowerCase().includes(ve)||ee.description.toLowerCase().includes(ve)||ee.speakerTag.toLowerCase().includes(ve)||ee.accent&&ee.accent.toLowerCase().includes(ve)))return!1}return!0}).map(ee=>
4269{const ve=me.archetypeId===ee.id,Gt=we&&jt===ee.id,hn=PE(ee);return i.jsxs("div",{className:`p-3 rounded-2xl border transition-all flex flex-col justify-between gap-2.5 relative ${ve?"bg-gradient-to-b from-pink-950/30 to-[#1b172a] border-pink-500/80 shadow-[0_0_16px_rgba(236,72,153,0.3)] text-white ring-1 ring-pink-500/40":"bg-[#181a26] border-white/5 text-gray-300 hover:border-pink-500/30 hover:bg-white/5"}`,children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsxs("div",{className:"relative shrink-0",children:[i.jsx("img",{src:hn,alt:ee.name,className:`w-12 h-12 rounded-full object-cover border-2 shadow-sm ${ve?"border-pink-400 ring-2 ring-pink-500/40":"border-white/10"}`}),ve&&i.jsx("span",{className:"absolute -top-1 -right-1 bg-pink-500 text-white rounded-full p-0.5 shadow",children:i.jsx(Jr,{size:9})})]}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center justify-between gap-1",children:[i.jsx("h5",{className:"font-black text-xs text-white truncate",children:ee.name}),i.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-white/5 border border-white/10 text-pink-300 font-mono shrink-0",children:ee.accent||ee.speakerTag})]}),i.jsx("p",{className:"text-[10px] text-gray-400 line-clamp-2 mt-1 leading-tight",children:ee.description})]})]}),i.jsxs("div",{className:"flex items-center gap-1.5 pt-2 border-t border-white/5 mt-auto",children:[i.jsxs("button",{type:"button",onClick:()=>Ot(ee.id),className:`px-2.5 py-1.5 rounded-xl border text-[11px] font-bold flex items-center justify-center gap-1.5 transition-all ${Gt?"bg-red-500/30 border-red-400 text-red-300 animate-pulse":"bg-white/5 hover:bg-white/10 border-white/10 text-pink-300 hover:text-pink-200"}`,title:`Escuchar voz de ${ee.name}`,children:[Gt?i.jsx(IE,{size:12}):i.jsx(fh,{size:12,fill:"currentColor"}),i.jsx("span",{children:Gt?"Detener":"Escuchar"})]}),i.jsxs("button",{type:"button",disabled:et,onClick:()=>Un(ee),className:`flex-1 py-1.5 px-2 rounded-xl text-[11px] font-bold flex items-center justify-center gap-1 transition-all ${ve?"bg-emerald-500/25 border border-emerald-400/50 text-emerald-300":"bg-gradient-to-r from-pink-600 to-purple-600 hover:from-pink-500 hover:to-purple-500 text-white shadow-sm"}`,children:[i.jsx(Jr,{size:12}),i.jsx("span",{children:ve?"â Voz Oficial":"Guardar Voz"})]})]})]},ee.id)})})]}),i.jsxs("div",{className:"bg-gradient-to-b from-[#191929] to-[#131422] p-4 rounded-2xl border border-purple-500/30 space-y-3 mt-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"p-1.5 rounded-lg bg-pink-500/20 text-pink-300 border border-pink-500/30",children:i.jsx(hh,{size:15})}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-white text-xs",children:"Estudio de Clonación de Voz XTTS v2"}),i.jsx("p",{className:"text-[10px] text-gray-400",children:"Sube un archivo de voz o grábate con el micrófono para crear una voz personalizada."})]})]}),i.jsx("span",{className:"bg-purple-500/30 text-purple-200 text-[9px] px-2 py-0.5 rounded-full font-bold",children:"Zero-Shot Clone"})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-[10px] uppercase font-bold text-gray-300 block mb-1",children:"Nombre de la Voz Clonada"}),i.jsx("input",{type:"text",value:Tt,onChange:ee=>gn(ee.target.value),placeholder:"Ej: Mi Voz, Amigo Joven, Narrador...",className:"w-full bg-[#0a0a14] border border-white/10 rounded-xl px-3 py-2 text-xs text-gray-200 focus:outline-none focus:border-purple-500"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("button",{type:"button",onClick:sn,className:`p-2.5 rounded-xl border flex items-center justify-center gap-2 text-xs font-bold transition-all ${In?"bg-red-500 text-white border-red-400 animate-pulse":Oe?"bg-emerald-500/20 border-emerald-500/40 text-emerald-300":"bg-[#0a0a14] border-white/10 text-gray-300 hover:text-white hover:bg-white/5"}`,children:[i.jsx(hh,{size:14,className:In?"animate-bounce":""}),i.jsx("span",{children:In?"Detener Grabación":Oe?"â Muestra Lista":"Grabar con Micrófono"})]}),i.jsxs("label",{className:"p-2.5 rounded-xl border border-white/10 bg-[#0a0a14] hover:bg-white/5 text-gray-300 hover:text-white flex items-center justify-center gap-2 text-xs font-bold cursor-pointer transition-all",children:[i.jsx(Mu,{size:14}),i.jsx("span",{children:"Subir Audio (.mp3/.wav)"}),i.jsx("input",{type:"file",accept:"audio/*",className:"hidden",onChange:de})]})]}),i.jsxs("button",{type:"button",disabled:Zn||!Oe||!Tt.trim(),onClick:Ut,className:`w-full py-2.5 px-3 rounded-xl font-bold text-xs flex items-center justify-center gap-2 transition-all shadow-md ${Zn||!Oe||!Tt.trim()?"bg-gray-800 text-gray-500 border border-white/5 cursor-not-allowed":"bg-gradient-to-r from-pink-600 to-purple-600 hover:from-pink-500 hover:to-purple-500 text-white"}`,children:[i.jsx(Fs,{size:14,className:Zn?"animate-spin":""}),i.jsx("span",{children:Zn?"Clonando Voz con XTTS v2...":"Clonar V
4269oz con XTTS v2"})]})]})]})]}),o==="memories"&&i.jsxs("div",{className:"space-y-4 text-xs",children:[i.jsxs("div",{className:"bg-gradient-to-r from-emerald-950/40 via-teal-950/40 to-[#181a26] p-3.5 rounded-2xl border border-emerald-500/25 flex items-start gap-3",children:[i.jsx("div",{className:"p-2 rounded-xl bg-emerald-500/20 text-emerald-300 border border-emerald-500/30 shrink-0 mt-0.5",children:i.jsx(OC,{size:18})}),i.jsxs("div",{children:[i.jsxs("h3",{className:"font-bold text-white text-xs flex items-center gap-1.5",children:["Zona de Almacenamiento de Recuerdos de ",s,i.jsx("span",{className:"bg-emerald-500/30 text-emerald-300 text-[10px] px-2 py-0.5 rounded-full font-bold uppercase border border-emerald-500/40",children:"Memoria Continua"})]}),i.jsx("p",{className:"text-[11px] text-gray-300/80 mt-1 leading-relaxed",children:"Elizabeth almacena datos, gustos, anécdotas y detalles de cada conversación con cada usuario. Al hablar, consulta automáticamente estos recuerdos para brindar una experiencia humana inmersiva."})]})]}),i.jsxs("div",{className:"bg-[#181a26] p-3.5 rounded-2xl border border-white/5 space-y-2",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsxs("label",{className:"font-bold text-gray-200 text-xs flex items-center gap-1.5",children:[i.jsx(Pu,{size:13,className:"text-emerald-400"}),"Usuario Seleccionado"]}),i.jsxs("button",{type:"button",onClick:es,className:"text-[11px] text-emerald-400 hover:text-emerald-300 flex items-center gap-1",children:[i.jsx(xo,{size:11,className:Qt?"animate-spin":""}),"Recargar"]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("select",{value:_t,onChange:ee=>Sn(ee.target.value),className:"flex-1 bg-[#0a0a14] p-2.5 rounded-xl border border-white/10 outline-none focus:border-emerald-500 text-white text-xs font-semibold",children:Object.keys(os).length===0?i.jsx("option",{value:"Axiss",children:"Axiss (Creador)"}):Object.keys(os).map(ee=>{var ve,Gt;return i.jsxs("option",{value:ee,children:[ee," (",((Gt=(ve=os[ee])==null?void 0:ve.memories)==null?void 0:Gt.length)||0," recuerdos)"]},ee)})}),i.jsx("button",{type:"button",onClick:Us,className:"px-3 py-2 bg-red-500/10 hover:bg-red-500/20 text-red-400 rounded-xl text-xs font-semibold border border-red-500/20 transition-colors",title:"Reiniciar recuerdos de este usuario",children:i.jsx(Vs,{size:14})})]})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{className:"bg-[#181a26] p-3 rounded-2xl border border-white/5 text-center",children:[i.jsx("span",{className:"text-[10px] text-gray-400 uppercase font-semibold",children:"Recuerdos Guardados"}),i.jsx("p",{className:"text-xl font-black text-emerald-300 mt-0.5",children:((An=ln==null?void 0:ln.memories)==null?void 0:An.length)||0})]}),i.jsxs("div",{className:"bg-[#181a26] p-3 rounded-2xl border border-white/5 text-center",children:[i.jsx("span",{className:"text-[10px] text-gray-400 uppercase font-semibold",children:"Afinidad Relacional"}),i.jsx("p",{className:"text-sm font-bold text-teal-300 mt-1",children:((Nr=ln==null?void 0:ln.stats)==null?void 0:Nr.affinityLevel)||"Cercana & Amigable"})]})]}),i.jsxs("form",{onSubmit:xs,className:"bg-[#181a26] p-3.5 rounded-2xl border border-white/5 space-y-2.5",children:[i.jsxs("label",{className:"font-bold text-gray-200 text-xs flex items-center gap-1.5",children:[i.jsx(jm,{size:13,className:"text-emerald-400"}),"Registrar Recuerdo Manualmente en Elizabeth"]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",value:at,onChange:ee=>Et(ee.target.value),placeholder:"Ej: Le apasiona la fÃsica cuántica y toma café sin azúcar...",className:"flex-1 bg-[#0a0a14] border border-white/10 rounded-xl px-3 py-2 text-xs text-gray-200 focus:outline-none focus:border-emerald-500",required:!0}),i.jsxs("select",{value:hs,onChange:ee=>xn(ee.target.value),className:"bg-[#0a0a14] border border-white/10 rounded-xl px-2.5 py-2 text-[11px] text-gray-300 focus:outline-none focus:border-emerald-500",children:[i.jsx("option",{value:"personal",children:"Personal"}),i.jsx("option",{value:"gustos",children:"Gustos"}),i.jsx("option",{value:"anecdotas",children:"Anécdotas"}),i.jsx("option",{value:"emociones",children:"Emociones"})]}),i.jsx("button",{type:"submit",disabled:wt||!at.trim(),className:"px-3 py-2 bg-emerald-500/20 hover:bg-emerald-500/30 text-emerald-300 rounded-xl text-xs font-bold border border-emerald-500/30 transition-colors disabled:opacity-40",children:wt?i.jsx(xo,{size:13,className:"animate-spin"}):"Guardar"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("label",{className:"font-bold text-gray-200 text-xs",children:["Recuerdos Almacenados de @",_t]}),!(ln!=null&&ln.memories)||ln.memories.length===0?i.jsxs("div",{className:"bg-[#0a0a14] p-4 rounded-2xl border border-white/5 text-center text-gray-400 text-xs",children:[i.jsx(OC,{size:24,className:"mx-auto mb-1.5 opacity-40 text-emerald-400"}),i.jsxs("p",{children:["Aún no hay recuerdos registrados para @",_t,"."]}),i.jsx("p",{className:"text-[10px] text-gray-500 mt-1",children:"Habla con Elizabeth en el chat o agrega un recuerdo arriba para comenzar."})]}):i.jsx("div",{className:"space-y-2 max-h-56 overflow-y-auto pr-1 scrollbar-thin",children:ln.memories.map(ee=>{const Gt={gustos:"bg-cyan-500/15 text-cyan-300 border-cyan-500/30",personal:"bg-fuchsia-500/15 text-fuchsia-300 border-fuchsia-500/30",anecdotas:"bg-amber-500/15 text-amber-300 border-amber-500/30",emociones:"bg-rose-500/15 text-rose-300 border-rose-500/30"}[ee.category]||"bg-gray-500/15 text-gray-300 border-gray-500/30";return i.jsxs("div",{className:"bg-[#181a26] p-3 rounded-2xl border border-white/5 flex items-start justify-between gap-2.5 hover:border-white/10 transition-colors",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:`text-[9px] uppercase font-bold px-2 py-0.5 rounded-full border ${Gt}`,children:ee.category}),i.jsx("span",{className:"text-[10px] text-gray-500",children:new Date(ee.timestamp).toLocaleDateString()})]}),i.jsx("p",{className:"text-gray-200 text-xs leading-relaxed",children:ee.fact})]}),i.jsx("button",{type:"button",onClick:()=>He(ee.id),className:"text-gray-500 hover:text-red-400 p-1 rounded-lg transition-colors",title:"Borrar recuerdo",children:i.jsx(Vs,{size:13})})]},ee.id)})})]})]}),o==="dj"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"bg-[#181a26] p-4 rounded-2xl border border-white/5",children:[i.jsxs("h3",{className:"text-xs font-bold text-gray-200 mb-3 flex items-center gap-2",children:[i.jsx(Am,{size:14,className:"text-cyan-400"}),"Asignar Rol de DJ"]}),i.jsxs("form",{onSubmit:ee=>{ee.preventDefault();const ve=ee.target.djTarget.value,Gt=ee.target.djStart.value,hn=ee.target.djEnd.value;ve&&Gt&&hn&&(W.emit("admin_set_dj_schedule",{targetUser:ve,schedule:{start:Gt,end:hn}}),ee.target.reset(),h(`Horario de DJ asignado a ${ve}.`))},className:"flex flex-col gap-3",children:[i.jsx("input",{name:"djTarget",type:"text",placeholder:"Nombre de usuario",className:"w-full bg-[#0a0a14] border border-white/10 rounded-xl px-3 py-2 text-xs text-gray-200 focus:outline-none focus:border-cyan-400",required:!0}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{name:"djStart",type:"time",className:"flex-1 bg-[#0a0a14] border border-white/10 rounded-xl px-3 py-2 text-xs text-gray-200 focus:outline-none focus:border-cyan-400",required:!0}),i.jsx("span",{className:"text-gray-500 self-center text-xs",children:"-"}),i.jsx("input",{name:"djEnd",type:"time",className:"flex-1 bg-[#0a0a14] border border-white/10 rounded-xl px-3 py-2 text-xs text-gray-200 focus:outline-none focus:border-cyan-400",required:!0})]}),i.jsx("button",{type:"submit",className:"bg-cyan-500/20 text-cyan-300 hover:bg-cyan-500/30 font-bold py-2.5 rounded-xl text-xs transition-colors border border-cyan-500/30",children:"Asignar DJ"})]})]}),i.jsxs("div",{className:"bg-[#181a26] p-4 rounded-2xl border border-red-500/20",children:[i.jsxs("h3",{className:"text-xs font-bold text-red-400 mb-2 flex items-center gap-2",children:[i.jsx(tp,{size:14}),"Control de Emergencia"]}),i.jsx("p",{className:"text-[11px] text-gray-400 mb-3",children:"Corta inmediatamente cualquier transmisión o streaming de DJ activo en todas las salas."}),i.jsx("button",{type:"button",onClick:()=>{W.emit("admin_cut_transmission"),h("Transmisión de DJ cortada exitosamente.")},className:"w-full bg-red-500/20 text-red-400 hover:bg-red-500/30 font-bold py-2.5 rounded-xl text-xs transition-colors border border-red-500/30 shadow-[0_0_15px_rgba(239,68,68,0.2)]",children:"Cortar Transmisión DJ Activa"})]})]})]})]})})}function n7({setOpen:n,currentShaders:e,onSave:t,onPreview:s}){const[o,l]=y.useState(e||[]),[u,h]=y.useState(!1);y.useEffect(()=>{s(o)},[o,s]);const f=x=>{l(b=>b.includes(x)?b.filter(C=>C!==x):[...b,x])},p=[{id:"shader-crt",name:"CRT Monitor",desc:"Añade lÃneas de escaneo estilo TV antigua"},{id:"shader-scanlines",name:"LÃneas de Escaneo",desc:"Patrón de rayas horizontales tenues"}
4269,{id:"shader-vignette",name:"Viñeta Oscura",desc:"Bordes oscurecidos para mayor enfoque central"},{id:"shader-glow",name:"Resplandor (Glow)",desc:"Brillo en textos y elementos (puede ser intenso)"},{id:"shader-chromatic",name:"Aberración Cromática",desc:"Efecto 3D / desalineación de colores en texto"},{id:"shader-pixelate",name:"Pixelado Retro",desc:"Aumenta contraste y saturación con pixelado"},{id:"grayscale",name:"Escala de Grises",desc:"Convierte todo a blanco y negro"},{id:"sepia",name:"Sepia Vintage",desc:"Tono amarillento antiguo"},{id:"invert",name:"Colores Invertidos",desc:"Invierte todos los colores de la pantalla"}];return i.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-md z-[150] flex items-center justify-center p-4",children:i.jsxs("div",{className:"bg-[#0f111a] rounded-[32px] w-full max-w-lg shadow-2xl relative overflow-hidden border border-white/10",children:[i.jsxs("div",{className:"p-6 border-b border-white/10 flex justify-between items-center bg-gradient-to-r from-blue-900/20 to-purple-900/20",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(SD,{className:"text-cyan-400",size:24}),i.jsx("h2",{className:"text-xl font-bold text-white",children:"Configurar Shaders Globales"})]}),i.jsx("button",{onClick:()=>{s(e),n(!1)},className:"text-gray-400 hover:text-white transition-colors bg-white/5 p-2 rounded-full",children:i.jsx(Kt,{size:20})})]}),i.jsxs("div",{className:"p-6 max-h-[60vh] overflow-y-auto space-y-4",children:[i.jsxs("p",{className:"text-sm text-gray-400 mb-4",children:["Selecciona uno o combina varios shaders. Todos los usuarios verán estos efectos. Estás en modo ",i.jsx("b",{children:"Vista Previa"}),"."]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:p.map(x=>i.jsxs("div",{onClick:()=>f(x.id),className:`p-4 rounded-xl cursor-pointer border transition-all flex flex-col gap-1 4270 ${o.includes(x.id)?"bg-cyan-500/20 border-cyan-400 text-white":"bg-white/5 border-white/10 text-gray-400 hover:bg-white/10 hover:border-white/20"}`,children:[i.jsx("span",{className:"font-bold text-sm",children:x.name}),i.jsx("span",{className:"text-xs opacity-70",children:x.desc})]},x.id))})]}),i.jsxs("div",{className:"p-6 border-t border-white/10 bg-black/20 flex gap-3",children:[i.jsx("button",{onClick:()=>{s(e),n(!1)},className:"flex-1 py-3 rounded-xl font-bold transition-colors bg-white/10 text-white hover:bg-white/20",children:"Cancelar"}),i.jsxs("button",{onClick:()=>{t(o),n(!1)},className:"flex-1 py-3 rounded-xl font-bold transition-colors bg-cyan-600 text-white hover:bg-cyan-500 flex items-center justify-center gap-2 shadow-[0_0_15px_rgba(6,182,212,0.4)]",children:[i.jsx(NI,{size:18}),"Aplicar a Todos"]})]})]})})}function s7({onClose:n,onSelectGame:e,user:t}){const[s,o]=y.useState(10);return i.jsx("div",{className:"fixed inset-0 z-[120] flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm animate-in fade-in",children:i.jsxs("div",{className:"bg-[#0f111a] border border-[#D4AF37]/30 rounded-3xl w-full max-w-lg max-h-[85vh] flex flex-col overflow-hidden shadow-[0_0_40px_rgba(212,175,55,0.15)] animate-in zoom-in-95",children:[i.jsxs("div",{className:"p-6 border-b border-[#D4AF37]/20 flex items-center justify-between bg-gradient-to-r from-[#0a0f1c] to-[#121B2A]",children:[i.jsxs("div",{children:[i.jsxs("h2",{className:"text-2xl font-bold text-[#E8D9B0] flex items-center gap-2",children:[i.jsx("span",{className:"text-3xl",children:"ð®"})," Menú de Juegos"]}),i.jsx("p",{className:"text-[#D4AF37]/70 text-sm mt-1 font-medium",children:"Selecciona una partida"})]}),i.jsx("button",{onClick:n,className:"p-2 bg-[#D4AF37]/10 text-[#D4AF37] hover:bg-red-500/20 hover:text-red-400 rounded-full transition-colors",children:i.jsx(Kt,{size:24})})]}),i.jsxs("div",{className:"flex flex-col items-center justify-center p-6 bg-[#121B2A]/50",children:[i.jsx("div",{className:"w-24 h-24 flex items-center justify-center bg-[#D4AF37]/10 rounded-full border border-[#D4AF37]/30 shadow-lg mb-6",children:i.jsx("span",{className:"text-5xl drop-shadow-md",children:"âï¸"})}),i.jsx("h3",{className:"text-2xl font-black text-transparent bg-clip-text bg-gradient-to-r from-indigo-500 to-blue-500 mb-3",children:"Ajedrez 3D"}),i.jsx("p",{className:"text-[#E8D9B0]/80 text-center text-sm px-4 mb-8",children:"Compite y sube tu nivel ELO (Cobre a Oro). Apuestas duplicadas y chat de voz/emoticones."}),i.jsx("div",{className:"w-full px-4",children:i.jsxs("div",{className:"flex flex-col gap-3 mb-4",children:[i.jsxs("select",{value:s,onChange:l=>o(Number(l.target.value)),className:"bg-[#121B2A] border border-indigo-500/30 rounded-xl text-indigo-300 font-bold p-3 w-full outline-none",children:[i.jsx("option",{value:0,children:"Partida Amistosa (0 LM)"}),i.jsx("option",{value:5,children:"Apuesta: 5 LM"}),i.jsx("option",{value:10,children:"Apuesta: 10 LM"}),i.jsx("option",{value:20,children:"Apuesta: 20 LM"}),i.jsx("option",{value:30,children:"Apuesta: 30 LM"}),i.jsx("option",{value:40,children:"Apuesta: 40 LM"})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("button",{onClick:()=>{e(`chessbot_${s}`),n()},className:"flex-1 py-3 rounded-xl bg-[#121B2A] border border-[#D4AF37]/50 text-[#D4AF37] hover:bg-[#D4AF37]/20 font-bold transition-transform hover:scale-105 shadow-md flex items-center justify-center gap-2",children:"ð¤ vs Bot"}),i.jsxs("button",{onClick:()=>{e(`chess_${s}`),n()},className:"flex-1 py-3 rounded-xl bg-gradient-to-r from-indigo-500 to-blue-500 text-white font-bold transition-transform hover:scale-105 shadow-md flex items-center justify-center gap-2",children:[i.jsx(HI,{size:20})," PvP Global"]})]})]})})]})]})})}function r7({onClose:n,user:e,decorations:t,initialCategory:s,onSelectGame:o}){const[l,u]=y.useState(""),[h,f]=y.useState(!1),[p,x]=y.useState(10),[b,C]=y.useState(!1),[N,T]=y.useState(0),[R,A]=y.useState(()=>{if(s){const j=["marcos","emblemas","mascotas","efectos"].indexOf(s);return j>=0?j:0}return 0}),U=E=>{f(!0),u(""),W.emit("buy_decoration",{decorationId:E.id,price:E.price},j=>{f(!1),j.success||u(j.error||"Error al comprar.")})},M=E=>{f(!0),u(""),W.emit("set_decoration",E,j=>{f(!1),j.success||u(j.error||"Error al equipar/desequipar.")})}
4270,V=[{id:"ajedrez",label:"Ajedrez",icon:"âï¸",color:"from-amber-400 to-orange-400"},{id:"marcos",label:"Marcos",icon:"ð¼ï¸",color:"from-blue-400 to-cyan-400"},{id:"emblemas",label:"Emblemas",icon:"ð¡ï¸",color:"from-purple-400 to-pink-400"},{id:"mascotas",label:"Mascotas",icon:"ð¾",color:"from-green-400 to-emerald-400"},{id:"efectos",label:"Efectos",icon:"â¨",color:"from-amber-400 to-orange-400"}],H=V[R],Q=()=>{A(E=>(E+1)%V.length)},Y=()=>{A(E=>(E-1+V.length)%V.length)},k=t.filter(E=>E.category===H.id);return i.jsx("div",{className:"fixed inset-0 z-[120] flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm animate-in fade-in",children:i.jsxs("div",{className:"bg-[#0f111a] border border-[#D4AF37]/30 rounded-3xl w-full max-w-4xl max-h-[85vh] flex flex-col overflow-hidden shadow-[0_0_40px_rgba(212,175,55,0.15)] animate-in zoom-in-95",children:[i.jsxs("div",{className:"p-6 border-b border-[#D4AF37]/20 flex items-center justify-between bg-gradient-to-r from-[#0a0f1c] to-[#121B2A]",children:[i.jsxs("div",{children:[i.jsxs("h2",{className:"text-2xl font-bold text-[#E8D9B0] flex items-center gap-2",children:[i.jsx(Fs,{className:"text-[#D4AF37]"}),"Tienda Premium"]}),i.jsxs("p",{className:"text-[#D4AF37]/80 mt-1 font-medium",children:["Liz-Moneditas: ",i.jsx("span",{className:"text-[#121B2A] bg-[#D4AF37] px-2.5 py-0.5 rounded-full font-bold",children:e.lizCoins||0})]})]}),i.jsx("button",{onClick:n,className:"text-[#D4AF37]/60 hover:text-[#D4AF37] p-2 rounded-full hover:bg-[#D4AF37]/10 transition-colors",children:i.jsx(Kt,{size:24})})]}),i.jsxs("div",{className:"flex items-center justify-between px-6 py-4 bg-[#121B2A]/50 border-b border-[#D4AF37]/10",children:[i.jsx("button",{onClick:Y,className:"p-2 text-[#D4AF37]/80 hover:text-[#D4AF37] hover:bg-[#D4AF37]/10 rounded-full transition-colors",children:i.jsx(DD,{size:28})}),i.jsxs("h3",{className:`text-2xl font-black text-transparent bg-clip-text bg-gradient-to-r ${H.color} flex items-center gap-3 tracking-wide`,children:[i.jsx("span",{className:"text-2xl filter drop-shadow-md",children:H.icon})," ",H.label]}),i.jsx("button",{onClick:Q,className:"p-2 text-[#D4AF37]/80 hover:text-[#D4AF37] hover:bg-[#D4AF37]/10 rounded-full transition-colors",children:i.jsx(Cu,{size:28})})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-6 scrollbar-thin",children:[l&&i.jsxs("div",{className:"bg-red-500/10 border border-red-500/20 text-red-400 p-4 rounded-xl flex items-center gap-3 mb-6",children:[i.jsx(tp,{size:20}),i.jsx("p",{children:l})]}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-5",children:[k.map(E=>{var S;const j=(S=e.ownedDecorations)==null?void 0:S.includes(E.id),P=e.activeDecoration===E.id,O=(e.lizCoins||0)>=E.price,F=E.type==="premium"?"border-[#D4AF37]/50 shadow-[0_0_15px_rgba(212,175,55,0.2)]":E.type==="intermediate"?"border-purple-500/50 shadow-[0_0_15px_rgba(168,85,247,0.2)]":"border-blue-500/50";return i.jsxs("div",{className:`relative flex flex-col items-center p-5 rounded-[24px] bg-[#121B2A]/80 border ${P?"border-[#D4AF37] bg-[#D4AF37]/10":j?"border-green-500/50 bg-green-500/5":F} transition-all hover:-translate-y-1 hover:shadow-xl`,children:[i.jsx("div",{className:"absolute top-2 right-2 text-xs font-bold px-2 py-0.5 rounded-full bg-black/40 text-white/70",children:E.type==="premium"?"Oro":E.type==="intermediate"?"Plata":"Cobre"}),i.jsx("div",{className:"w-20 h-20 mb-5 mt-2 relative",children:i.jsx("img",{referrerPolicy:"no-referrer",src:E.url,alt:"Decoration",className:"w-full h-full object-contain filter drop-shadow-lg",style:{imageRendering:"pixelated"}})}),i.jsx("div",{className:"mt-auto w-full",children:P?i.jsx("button",{onClick:()=>M(null),disabled:h,className:"w-full py-2.5 rounded-xl bg-[#D4AF37]/20 hover:bg-[#D4AF37]/30 text-[#D4AF37] font-bold text-sm transition-colors border border-[#D4AF37]/40 shadow-inner",children:"Desequipar"}):j?i.jsx("button",{onClick:()=>M(E.id),disabled:h,className:"w-full py-2.5 rounded-xl bg-green-500/20 hover:bg-green-500/30 text-green-400 font-bold text-sm transition-colors border border-green-500/40",children:"Equipar"}):i.jsxs("button",{onClick:()=>U(E),disabled:h||!O,className:`w-full py-2.5 rounded-xl font-bold text-sm transition-all border shadow-sm ${O?"bg-gradient-to-r from-[#D4AF37] to-[#F3E5AB] text-[#121B2A] border-[#D4AF37] hover:scale-105 active:scale-95":"bg-gray-800 text-gray-500 border-gray-700 cursor-not-allowed"}`,children:[E.price," LM"]})})]},E.id)}),k.length===0&&i.jsx("div",{className:"col-span-full py-12 text-center text-[#D4AF37]/50 font-medium",children:"Próximamente más artÃculos en esta categorÃa..."})]})]})]})})}function i7({caller:n,onAccept:e,onReject:t}){const s=y.useRef(null);return y.useEffect(()=>{s.current&&s.current.play().catch(o=>console.error("Auto-play prevented",o))},[]),i.jsxs("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-md z-[200] flex items-center justify-center p-4",children:[i.jsx("audio",{ref:s,src:"https://assets.mixkit.co/active_storage/sfx/1359/1359-preview.mp3",loop:!0}),i.jsxs("div",{className:"bg-gradient-to-b from-[#12141c] to-[#0B1220] p-10 rounded-[40px] w-full max-w-sm shadow-[0_0_50px_rgba(6,182,212,0.15)] relative border border-cyan-500/20 text-center animate-in zoom-in-95 duration-500 ease-out overflow-hidden",children:[i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-full h-1/2 bg-cyan-500/10 blur-[50px] rounded-full pointer-events-none"}),i.jsxs("div",{className:"relative w-32 h-32 mx-auto mb-6",children:[i.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-cyan-500/30 animate-[ping_2s_cubic-bezier(0,0,0.2,1)_infinite]"}),i.jsx("div",{className:"absolute inset-2 rounded-full border-2 border-cyan-400/50 animate-pulse"}),i.jsx("div",{className:"w-full h-full rounded-full overflow-hidden border-2 border-[#12141c] relative z-10 shadow-2xl",children:i.jsx("img",{src:n.profilePic||`https://api.dicebear.com/7.x/avataaars/svg?seed=${n.username}`,alt:n.username,className:"w-full h-full object-cover bg-[#1A2639]",referrerPolicy:"no-referrer"})})]}),i.jsx("h3",{className:"text-xl font-medium text-gray-400 tracking-widest uppercase text-[10px] mb-2",children:"Llamada Entrante"}),i.jsx("p",{className:"text-3xl font-light text-white mb-10 tracking-wide",children:n.username}),i.jsxs("div",{className:"flex gap-4",children:[i.jsxs("button",{onClick:t,className:"flex-1 flex flex-col items-center justify-center gap-3 p-4 rounded-[28px] bg-red-500/10 text-red-400 hover:bg-red-500 hover:text-white border border-red-500/20 transition-all duration-300 shadow-[0_0_20px_rgba(239,68,68,0.1)] group",children:[i.jsx(Tg,{size:24,className:"group-hover:scale-110 transition-transform"}),i.jsx("span",{className:"font-semibold tracking-wide",children:"Rechazar"})]}),i.jsxs("button",{onClick:e,className:"flex-1 flex flex-col items-center justify-center gap-3 p-4 rounded-[28px] bg-cyan-500/10 text-cyan-400 hover:bg-cyan-500 hover:text-white border border-cyan-500/20 transition-all duration-300 shadow-[0_0_20px_rgba(6,182,212,0.1)] group",children:[i.jsx(gI,{size:24,className:"group-hover:scale-110 animate-bounce transition-transform"}),i.jsx("span",{className:"font-semibold tracking-wide",children:"Atender"})]})]})]})]})}function a7({user:n,onClose:e}){const[t,s]=y.useState("idle"),[o,l]=y.useState(!1),[u,h]=y.useState(!1),[f,p]=y.useState(!1),[x]=y.useState(n.username),[b,C]=y.useState(""),N=y.useRef(null),T=y.useRef(null),R=y.useRef(null),A=y.useRef(null),U=y.useRef(null),M=y.useRef([]);y.useEffect(()=>((async()=>{try{R.current=await navigator.mediaDevices.getUserMedia({video:{width:{ideal:640},height:{ideal:480},frameRate:{ideal:30,max:30}},audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),N.current&&(N.current.srcObject=R.current)}catch(j){console.error("Error accessing media devices:",j),alert("No se pudo acceder a tu cámara o micrófono.")}})(),()=>{V()}),[]);const V=()=>{var E,j;
4270(E=R.current)==null||E.getTracks().forEach(P=>P.stop()),(j=A.current)==null||j.close(),A.current=null,M.current=[],W.emit("leave_webcam_queue")},H=()=>{A.current&&(A.current.close(),A.current=null),M.current=[],p(!1),s("searching"),W.emit("join_webcam_queue",{name:x})},Q=async E=>{for(;M.current.length>0;){const j=M.current.shift();if(j)try{await E.addIceCandidate(new RTCIceCandidate(j))}catch(P){console.warn("Failed to add buffered candidate:",P)}}};y.useEffect(()=>{const E=async({initiator:O,partnerSocket:F,partnerName:S})=>{C(S),s("matched"),U.current=F,p(!1),M.current=[];const be={iceServers:[{urls:"stun:stun.l.google.com:19302"},{urls:"stun:stun1.l.google.com:19302"},{urls:"stun:stun2.l.google.com:19302"},{urls:"stun:stun3.l.google.com:19302"}]};A.current&&A.current.close();const Ee=new RTCPeerConnection(be);if(A.current=Ee,R.current&&R.current.getTracks().forEach(me=>{Ee.addTrack(me,R.current)}),Ee.ontrack=me=>{T.current&&me.streams[0]&&(T.current.srcObject=me.streams[0],T.current.play().catch(De=>console.warn("Remote playback play() notice:",De)))},Ee.onicecandidate=me=>{me.candidate&&U.current&&W.emit("webcam_signal",{to:U.current,signal:{type:"candidate",candidate:me.candidate}})},O)try{const me=await Ee.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});await Ee.setLocalDescription(me),W.emit("webcam_signal",{to:U.current,signal:{type:"offer",offer:me}})}catch(me){console.error("Error creating WebRTC offer:",me)}},j=async O=>{const{signal:F,from:S}=O;if(S!==U.current)return;const be=A.current;if(be)try{if(F.type==="offer"){await be.setRemoteDescription(new RTCSessionDescription(F.offer)),await Q(be);const Ee=await be.createAnswer();await be.setLocalDescription(Ee),W.emit("webcam_signal",{to:U.current,signal:{type:"answer",answer:Ee}})}else F.type==="answer"?(await be.setRemoteDescription(new RTCSessionDescription(F.answer)),await Q(be)):F.type==="candidate"&&(be.remoteDescription&&be.remoteDescription.type?await be.addIceCandidate(new RTCIceCandidate(F.candidate)):M.current.push(F.candidate))}catch(Ee){console.error("WebRTC signal handling error:",Ee)}},P=()=>{p(!0),T.current&&(T.current.srcObject=null)};return W.on("webcam_matched",E),W.on("webcam_signal",j),W.on("webcam_peer_disconnected",P),()=>{W.off("webcam_matched",E),W.off("webcam_signal",j),W.off("webcam_peer_disconnected",P)}},[]);const Y=()=>{R.current&&(R.current.getAudioTracks().forEach(E=>E.enabled=!E.enabled),l(!o))},k=()=>{R.current&&(R.current.getVideoTracks().forEach(E=>E.enabled=!E.enabled),h(!u))};return i.jsxs("div",{className:"absolute inset-0 bg-[#0B0D17] flex flex-col items-center justify-center p-4 z-50 overflow-hidden",children:[i.jsxs("div",{className:"absolute top-0 left-0 w-full p-4 sm:p-6 flex justify-between items-center z-20",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 sm:w-12 h-10 sm:h-12 bg-purple-500/20 rounded-2xl flex items-center justify-center border border-purple-500/30",children:i.jsx(Ay,{className:"text-purple-400",size:24})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"text-white font-bold text-lg sm:text-xl uppercase tracking-wider flex items-center gap-2",children:["Friends Webcam",i.jsx("span",{className:"text-[10px] bg-red-500/20 text-red-300 px-2 py-0.5 rounded-full border border-red-500/30 font-mono",children:"Admin Only"})]}),i.jsx("p",{className:"text-purple-400 text-xs sm:text-sm font-mono tracking-widest",children:"Random Chat En Directo"})]})]}),i.jsx("button",{onClick:e,className:"px-5 sm:px-6 py-2 rounded-full bg-white/10 hover:bg-white/20 text-white font-bold text-sm transition-colors",children:"Salir"})]}),i.jsxs("div",{className:"relative w-full max-w-5xl aspect-video rounded-3xl sm:rounded-[2rem] overflow-hidden bg-black shadow-2xl border border-white/10 mt-14",children:[i.jsx("video",{ref:T,autoPlay:!0,playsInline:!0,className:"absolute inset-0 w-full h-full object-cover"}),t==="matched"&&!f&&b&&i.jsxs("div",{className:"absolute top-4 left-4 bg-black/60 backdrop-blur-md px-4 py-1.5 rounded-full border border-white/10 flex items-center gap-2 z-10",children:[i.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-emerald-400 animate-ping"}),i.jsx("span",{className:"text-xs font-bold text-white tracking-wide",children:b})]}),t==="idle"&&i.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-[#07090F] p-6 text-center z-10",children:[i.jsx("div",{className:"w-20 h-20 bg-purple-500/10 border border-purple-500/20 rounded-3xl flex items-center justify-center text-purple-400 mb-4 animate-bounce",children:i.jsx(Ay,{size:40})}),i.jsx("h3",{className:"text-xl sm:text-2xl font-black text-white mb-2",children:"Conéctate en Vivo"}),i.jsx("p",{className:"text-xs sm:text-sm text-gray-400 max-w-sm mb-6",children:"Transmisión directa de audio y video en tiempo real."}),i.jsx("button",{onClick:H,className:"px-8 py-3.5 rounded-2xl bg-gradient-to-r from-purple-500 to-indigo-600 hover:from-purple-400 hover:to-indigo-500 text-white font-bold text-sm shadow-[0_0_25px_rgba(168,85,247,0.4)] transition-all active:scale-95",children:"Comenzar Búsqueda"})]}),t==="searching"&&i.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-[#07090F] p-6 text-center z-10",children:[i.jsx(xo,{size:44,className:"text-purple-400 animate-spin mb
4270-4"}),i.jsx("h3",{className:"text-xl font-bold text-white mb-1",children:"Emparejando..."}),i.jsx("p",{className:"text-xs text-gray-400",children:"Buscando usuario disponible en directo sin demoras"})]}),f&&i.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-black/80 backdrop-blur-md p-6 text-center z-10",children:[i.jsx(Tg,{size:40,className:"text-rose-400 mb-3"}),i.jsx("h3",{className:"text-lg font-bold text-white mb-2",children:"El usuario se ha desconectado"}),i.jsx("button",{onClick:H,className:"px-6 py-2.5 rounded-2xl bg-purple-500 hover:bg-purple-400 text-white font-bold text-xs transition-all shadow-lg",children:"Buscar Siguiente"})]}),i.jsxs("div",{className:"absolute bottom-4 right-4 w-28 sm:w-44 aspect-video rounded-2xl overflow-hidden border-2 border-white/20 shadow-2xl bg-gray-900 z-10",children:[i.jsx("video",{ref:N,autoPlay:!0,playsInline:!0,muted:!0,className:"w-full h-full object-cover scale-x-[-1]"}),i.jsxs("div",{className:"absolute bottom-1 left-2 text-[9px] font-bold text-white/80 bg-black/60 px-1.5 py-0.5 rounded",children:["Tú (",x,")"]})]})]}),t==="matched"&&!f&&i.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 mt-6 z-20",children:[i.jsx("button",{onClick:Y,className:`p-3.5 sm:p-4 rounded-2xl transition-all ${o?"bg-rose-500/20 text-rose-400 border border-rose-500/40":"bg-white/10 text-white hover:bg-white/20"}`,title:o?"Activar Micrófono":"Silenciar Micrófono",children:o?i.jsx($B,{size:20}):i.jsx(hh,{size:20})}),i.jsx("button",{onClick:k,className:`p-3.5 sm:p-4 rounded-2xl transition-all ${u?"bg-rose-500/20 text-rose-400 border border-rose-500/40":"bg-white/10 text-white hover:bg-white/20"}`,title:u?"Activar Cámara":"Apagar Cámara",children:u?i.jsx(cO,{size:20}):i.jsx(w1,{size:20})}),i.jsxs("button",{onClick:H,className:"flex items-center gap-2 px-6 py-3.5 sm:py-4 rounded-2xl bg-gradient-to-r from-purple-500 to-indigo-600 hover:from-purple-400 hover:to-indigo-500 text-white font-bold text-sm shadow-[0_0_20px_rgba(168,85,247,0.4)] transition-all active:scale-95",children:[i.jsx(xo,{size:18}),i.jsx("span",{children:"Siguiente"})]})]})]})}const o7=["âï¸","ð","ð","ð®","ð¸","â¡","ð","ð","ð§","ð","ð¡ï¸","ð¥","ð®","ðº","ð","ð"];function l7({user:n,onJoinRoom:e}){const[t,s]=y.useState([]),[o,l]=y.useState(!1),[u,h]=y.useState(""),[f,p]=y.useState(""),[x,b]=y.useState("âï¸"),[C,N]=y.useState(""),[T,R]=y.useState("disabled"),[A,U]=y.useState(""),[M,V]=y.useState("cyan"),[H,Q]=y.useState("default"),[Y,k]=y.useState(""),E=()=>{W.emit("get_custom_rooms",O=>{s(O||[])})};y.useEffect(()=>(E(),W.on("custom_rooms_updated",E),()=>{W.off("custom_rooms_updated",E)}),[]);const j=O=>{if(O.preventDefault(),!u.trim())return k("El nombre de la sala es obligatorio");const F=C.trim()||x||"âï¸";W.emit("create_custom_room",{name:u.trim(),rules:f.trim(),logo:F,emblem:F,autoCleanMode:T,backgroundUrl:A.trim(),theme:M,bubbleStyle:H},S=>{S!=null&&S.success?(l(!1),h(""),p(""),N(""),U(""),E(),S.roomId&&e(S.roomId,{id:S.roomId,name:u.trim(),owner:(n==null?void 0:n.username)||"Usuario",logo:F,emblem:F,autoCleanMode:T,backgroundUrl:A.trim(),theme:M,bubbleStyle:H})):k((S==null?void 0:S.error)||"Error al crear sala")})},P=(O,F)=>{W.emit("join_custom_room",O,S=>{S!=null&&S.success?e(O,S.room||F):alert((S==null?void 0:S.error)||"No se pudo unir a la sala")})};return i.jsxs("div",{className:"flex-1 flex flex-col h-full bg-transparent overflow-hidden relative",children:[i.jsx("div",{className:"absolute top-[-20%] left-[-10%] w-[50%] h-[50%] bg-purple-600/30 blur-[130px] rounded-full pointer-events-none mix-blend-screen animate-pulse"}),i.jsx("div",{className:"absolute bottom-[-20%] right-[-10%] w-[60%] h-[60%] bg-cyan-600/20 blur-[150px] rounded-full pointer-events-none mix-blend-screen animate-pulse",style:{animationDelay:"1.5s"}}),i.jsx("div",{className:"absolute top-[20%] left-[30%] w-[40%] h-[40%] bg-pink-500/20 blur-[120px] rounded-full pointer-events-none mix-blend-screen animate-pulse",style:{animationDelay:"3s"}}),i.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-[2px] pointer-events-none z-0"}),i.jsxs("div",{className:"p-6 bg-white/[0.03] backdrop-blur-xl shadow-lg border-b border-white/5 flex justify-between items-center shrink-0",children:[i.jsxs("div",{children:[i.jsxs("h2",{className:"text-white text-2xl font-bold flex items-center gap-2",children:[i.jsx(qB,{className:"text-white/80"}),"Salas Públicas"]}),i.jsx("p",{className:"text-white/50 text-sm mt-1",children:"Crea o únete a salas creadas por la comunidad."})]}),i.jsxs("button",{onClick:()=>l(!0),className:"bg-gradient-to-r from-cyan-500 to-blue-500 text-white hover:from-cyan-400 hover:to-blue-400 shadow-[0_0_15px_rgba(6,182,212,0.4)] text-[#121B2A] font-bold px-4 py-2 rounded-xl flex items-center gap-2 transition-all",children:[i.jsx(jm,{size:18}),"Crear Sala"]})]}),i.jsx("div",{className:"flex-1 overflow-y-auto p-6 relative",children:t.length===0?i.jsxs("div",{className:"flex flex-col items-center justify-center h-full opacity-50",children:[i.jsx(qB,{size:64,className:"mb-4 text-white/80"}),i.jsx("p",{className:"text-xl text-white font-light",children:"No hay salas creadas aún."})]}):i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:t.map(O=>{var F,S;return i.jsxs("div",{className:"bg-white/[0.04] border border-white/10 backdrop-blur-md hover:border-cyan-500/40 hover:shadow-[0_0_25px_rgba(6,182,212,0.2)] rounded-3xl p-5 flex flex-col justify-between transition-all group relative overflow-hidden",children:[O.backgroundUrl&&i.jsx("div",{className:"absolute inset-0 opacity-15 pointer-events-none overflow-hidden z-0",children:i.jsx("img",{src:O.backgroundUrl,alt:"",className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"})}),i.jsxs("div",{className:"relative z-10",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[i.jsx("div",{className:"w-12 h-12 rounded-2xl bg-gradient-to-br from-cyan-500/25 via-purple-500/25 to-blue-500/25 border border-cyan-500/40 flex items-center justify-center text-2xl overflow-hidden shrink-0 shadow-[0_0_15px_rgba(6,182,212,0.25)]",children:(F=O.logo)!=null&&F.startsWith("http")||(S=O.logo)!=null&&S.startsWith("data:")?i.jsx("img",{src:O.logo,alt:"Logo",className:"w-full h-full object-cover"}):i.jsx("span",{children:O.emblem||O.logo||"âï¸"})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("h3",{className:"text-white font-extrabold text-xl leading-tight truncate group-hover:text-cyan-300 transition-colors",children:O.name}),i.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[i.jsxs("span",{className:"bg-white/10 text-white/80 text-xs px-2 py-0.5 rounded-full flex items-center gap-1 font-medium",children:[i.jsx(Na,{size:11,className:"text-cyan-400"})," ",O.usersCount||0]}),i.jsxs("span",{className:"text-xs text-white/50 flex items-center gap-1 truncate",children:[i.jsx(bo,{size:12,className:"text-amber-400 shrink-0"}),O.owner]})]})]})]}),O.autoCleanMode&&O.autoCleanMode!=="disabled"&&i.jsx("div",{className:"mb-3",children:i.jsxs("span",{className:"text-[10px] bg-amber-500/15 text-amber-300 border border-amber-500/30 px-2.5 py-1 rounded-xl inline-flex items-center gap-1 font-mono font-bold",children:[i.jsx(Vs,{size:11})," Auto-Limpieza: ",O.autoCleanMode]})}),O.rules&&i.jsx("div",{className:"bg-black/40 border border-white/5 p-3 rounded-2xl mb-4",children:i.jsxs("p",{className:"text-xs text-gray-300 italic line-clamp-2",children:['"',O.rules,'"']})})]}),i.jsx("button",{onClick:()=>P(O.id,O),className:"relative z-10 w-full bg-gradient-to-r from-cyan-500/20 to-blue-500/20 hover:from-cyan-500 hover:to-blue-600 text-cyan-300 hover:text-white border border-cyan-500/30 hover:border-transparent font-bold py-2.5 rounded-2xl transition-all shadow-sm active:scale-95",children:"Entrar a la Sala"})]},O.id)})})}),o&&i.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-md z-50 flex items-center justify-center p-4",children:i.jsxs("form",{onSubmit:j,className:"bg-[#0e121d]/95 backdrop-blur-2xl border border-cyan-500/30 shadow-[0_0_50px_rgba(0,0,0,0.8)] rounded-3xl w-full max-w-lg p-6 relative max-h-[90vh] overflow-y-auto scrollbar-thin",children:[i.jsx("button",{type:"button",onClick:()=>l(!1),className:"absolute top-4 right-4 text-white/50 hover:text-white bg-white/5 hover:bg-white/10 p-2 rounded-full transition-colors",children:i.jsx(Kt,{size:18})}),i.jsxs("h2",{className:"text-2xl font-black text-white mb-2 flex items-center gap-2",children:[i.jsx(jm,{size:24,className:"text-cyan-400"}),"Crea tu Propio Chat"]}),i.jsx("p",{className:"text-xs text-white/50 mb-5",children:"Configura tu sala con tu propio logo, nombre grande y limpieza programada."}),Y&&i.jsxs("div",{className:"bg-red-500/20 border border-red-500/50 p-3 rounded-2xl mb-4 flex items-center gap-2 text-red-200 text-xs",children:[i.jsx(tp,{size:16})," ",Y]}),i.jsxs("div",{className:"space-y-4 mb-6",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-white/70 text-xs font-bold mb-1.5 uppercase tracking-wider",children:"NOMBRE DE LA SALA (Se mostrará en grande)"}),i.jsx("input",{type:"text",value:u,onChange:O=>h(O.target.value),className:"w-full bg-black/50 border border-white/15 text-white px-4 py-3 rounded-2xl focus:outline-none focus:border-cyan-400 font-bold text-base placeholder-white/20",placeholder:"Ej: Clan Otaku ⢠Gamer Zone",maxLength:40})]}),i.jsxs("div",{children:[i.jsxs("label",{className:"block text-white/70 text-xs font-bold mb-1.5 uppercase tracking-wider flex items-center justify-between",children:[i.jsx("span",{children:"LOGO / EMBLEMA DE TU CHAT"}),i.jsx("span",{className:"text-[10px] text-cyan-400 font-normal",children:"Elige uno o pon un enlace"})]}),i.jsx("div",{className:"flex flex-wrap gap-2 mb-2 p-2 bg-black/40 rounded-2xl border border-white/10",children:o7.map(O=>i.jsx("button",{type:"button",onClick:()=>{b(O),N("")},className:`w-9 h-9 text-lg rounded-xl flex items-center justify-center transition-all ${x===O&&!C?"bg-cyan-500/30 border-2 border-cyan-400 shadow-[0_0_10px_rgba(6,182,212,0.4)] scale-110":"bg-white/5 hover:bg-white/10 border border-white/5"}`,children:O},O))}),i.jsx("input",{type:"text",value:C,onChange:O=>N(O.target.value),placeholder:"O pega URL de imagen de logo (https://...)",className:"w-full bg-black/40 border border-white/10 text-white px-3 py-2 rounded-xl text-xs focus:outline-none focus:border-cyan-400"})]}),i.jsxs("div",{children:[i.jsxs("label",{className:"block text-white/70 text-xs font-bold mb-1.5 uppercase tracking-wider flex items-center gap-1.5",children:[i.jsx(Vs,{size:13,className:"text-amber-400"}),"LIMPIEZA AUTOMÃTICA"]}),i.jsxs("select",{value:T,onChange:O=>R(O.target.value),className:"w-full bg-black/50 border border-white/15 text-white px-3 py-2.5 rounded-2xl focus:outline-none focus:border-cyan-400 text-xs",children:[i.jsx("option",{value:"disabled",children:"Desactivada (Conservar historial)"}),i.jsx("option",{value:"1h",children:"Cada 1 Hora (Purgar mensajes viejos)"}),i.jsx("option",{value:"6h",children:"Cada 6 Horas"}),i.jsx("option",{value:"24h",children:"Cada 24 Horas"}),i.jsx("option",{value:"20msgs",children:"Al llegar a 20 mensajes (Mantener los 20 más recientes)"}),i.jsx("option",{value:"50msgs",children:"Al llegar a 50 mensajes (Mantener los 50 más recientes)"}),i.jsx("option",{value:"100msgs",children:"Al llegar a 100 mensajes"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-white/70 text-xs font-bold mb-1.5 uppercase tracking-wider",children:"FONDO DE PANTALLA DE LA SALA (Opcional)"}),i.jsx("input",{type:"text",value:A,onChange:O=>U(O.target.value),className:"w-full bg-black/50 border border-white/15 text-white px-3 py-2.5 rounded-2xl focus:outline-none focus:border-cyan-400 text-xs placeholder-white/20",placeholder:"URL de imagen, GIF animado o video MP4"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-white/70 text-xs font-bold mb-1.5 uppercase tracking-wider",children:"REGLAS DE LA SALA (Opcional)"}),i.jsx("textarea",{value:f,onChange:O=>p(O.target.value),className:"w-full bg-black/50 border border-white/15 text-white px-4 py-3 rounded-2xl focus:outline-none focus:border-cyan-400 resize-none h-20 text-xs placeholder-white/20",placeholder:"Reglas de la sala, temas permitidos, etc.",maxLength:150})]})]}),i.jsx("button",{type:"submit",className:"w-full bg-gradient-to-r from-cyan-500 to-blue-600 hover:from-cyan-400 hover:to-blue-500 text-white font-bold py-3.5 rounded-2xl shadow-[0_0_25px_rgba(6,182,212,0.4)] transition-all",children:"Crear y Abrir Sala"})]})})]})}function c7({partner:n,isInitiator:e,onEndCall:t}){const[s,o]=y.useState(0),[l,u]=y.useState(!1),h=y.useRef(null),f=y.useRef(null),p=y.useRef(null),x=y.useRef(null),b=y.useRef(null),[C,N]=y.useState(0),T=M=>"${m < 10 ? '0' : ''}${m}:${s < 10 ? '0' : ''}${s}";y.useEffect(()=>{const M=setInterval(()=>
4270o(V=>V+1),1e3);return()=>clearInterval(M)},[]),y.useEffect(()=>{(async()=>{try{f.current=await navigator.mediaDevices.getUserMedia({audio:!0,video:!1}),x.current=new(window.AudioContext||window.webkitAudioContext),b.current=x.current.createAnalyser(),x.current.createMediaStreamSource(f.current).connect(b.current),b.current.fftSize=256;const k=b.current.frequencyBinCount,E=new Uint8Array(k),j=()=>{if(b.current&&!l){b.current.getByteFrequencyData(E);const O=E.reduce((F,S)=>F+S)/k;N(O)}else N(0);requestAnimationFrame(j)};j();const P={iceServers:[{urls:"stun:stun.l.google.com:19302"}]};if(h.current=new RTCPeerConnection(P),f.current.getTracks().forEach(O=>{var F;(F=h.current)==null||F.addTrack(O,f.current)}),h.current.ontrack=O=>{p.current&&(p.current.srcObject=O.streams[0])},h.current.onicecandidate=O=>{O.candidate&&W.emit("rtc_ice_candidate",{target:n.username,candidate:O.candidate})},e){const O=await h.current.createOffer();await h.current.setLocalDescription(O),W.emit("rtc_offer",{target:n.username,offer:O})}}catch(Y){console.error("Error starting audio call",Y)}})();const V=async({offer:Y})=>{if(!h.current)return;await h.current.setRemoteDescription(new RTCSessionDescription(Y));const k=await h.current.createAnswer();await h.current.setLocalDescription(k),W.emit("rtc_answer",{target:n.username,answer:k})},H=async({answer:Y})=>{h.current&&await h.current.setRemoteDescription(new RTCSessionDescription(Y))},Q=async({candidate:Y})=>{h.current&&await h.current.addIceCandidate(new RTCIceCandidate(Y))};return W.on("rtc_offer",V),W.on("rtc_answer",H),W.on("rtc_ice_candidate",Q),()=>{W.off("rtc_offer",V),W.off("rtc_answer",H),W.off("rtc_ice_candidate",Q),R()}},[]);const R=()=>{var M,V;(M=f.current)==null||M.getTracks().forEach(H=>H.stop()),(V=h.current)==null||V.close(),x.current&&x.current.close()},A=()=>{if(f.current){const M=f.current.getAudioTracks()[0];M&&(M.enabled=!M.enabled,u(!M.enabled))}},U=()=>{W.emit("end_call",n.username),R(),t()};return i.jsxs("div",{className:"fixed inset-0 bg-[#060913] z-[200] flex flex-col items-center justify-center animate-in fade-in duration-500 overflow-hidden",children:[i.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-cyan-900/10 via-purple-900/10 to-[#060913]"}),i.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[80vw] h-[80vw] max-w-[800px] max-h-[800px] bg-cyan-500/5 rounded-full blur-[100px] pointer-events-none"}),i.jsx("audio",{ref:p,autoPlay:!0}),i.jsxs("div",{className:"relative z-10 flex flex-col items-center w-full max-w-md px-6",children:[i.jsxs("p",{className:"text-cyan-400 font-bold tracking-[0.2em] text-sm uppercase mb-12 animate-pulse flex items-center gap-2",children:[i.jsx(xl,{size:16}),"Llamada de Voz"]}),i.jsxs("div",{className:"relative flex items-center justify-center w-64 h-64 mb-12",children:[i.jsx("div",{className:"absolute rounded-full border border-cyan-500/20 transition-all duration-75",style:{width:"${ring3Size}%",height:"${ring3Size}%",opacity:l?0:.2}}),i.jsx("div",{className:"absolute rounded-full border border-cyan-400/40 transition-all duration-75 shadow-[0_0_30px_rgba(34,211,238,0.2)]",style:{width:"${ring2Size}%",height:"${ring2Size}%",opacity:l?0:.5}}),i.jsx("div",{className:"absolute rounded-full border-2 border-cyan-300 transition-all duration-75 shadow-[0_0_50px_rgba(34,211,238,0.4)]",style:{width:"${ring1Size}%",height:"${ring1Size}%",opacity:l?.3:1}}),i.jsxs("div",{className:"relative w-40 h-40 rounded-full overflow-hidden border-4 border-[#060913] shadow-2xl z-10",children:[i.jsx("img",{src:n.profilePic||"https://api.dicebear.com/7.x/avataaars/svg?seed=${partner.username}",alt:n.username,className:"w-full h-full object-cover bg-[#1A2639]"}),l&&i.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center backdrop-blur-[2px]",children:i.jsx($B,{size:32,className:"text-red-400"})})]})]}),i.jsx("h2",{className:"text-3xl font-light text-white tracking-wide mb-2 drop-shadow-md",children:n.username}),i.jsx("div",{className:"bg-black/40 backdrop-blur-md px-6 py-2 rounded-full border border-white/10 shadow-inner",children:i.jsx("p",{className:"text-cyan-300 font-mono text-xl tracking-widest",children:T()})}),i.jsxs("div",{className:"flex items-center justify-center gap-8 mt-16 bg-white/5 backdrop-blur-xl px-10 py-6 rounded-[2rem] border border-white/10 shadow-2xl",children:[i.jsx("button",{onClick:A,className:"p-5 rounded-2xl transition-all duration-300 ${isMuted ? 'bg-red-500/20 text-red-400 shadow-[0_0_20px_rgba(239,68,68,0.3)]' : 'bg-white/10 text-white hover:bg-white/20'}",children:l?i.jsx($B,{size:28}):i.jsx(hh,{size:28})}),i.jsx("button",{onClick:U,className:"p-6 rounded-3xl bg-gradient-to-br from-red-500 to-red-600 text-white shadow-[0_0_30px_rgba(239,68,68,0.4)] transition-all duration-300 hover:scale-110 hover:shadow-[0_0_50px_rgba(239,68,68,0.6)] group",children:i.jsx(Tg,{size:36,className:"group-hover:scale-95 transition-transform"})})]})]})]})}const Ud=({src:n,alt:e="Avatar",className:t="",frameId:s,onClick:o,referrerPolicy:l="no-referrer"})=>{const u=s!==void 0&&s>=1&&s<=40,[h,f]=y.useState(null);return y.useEffect(()=>{if(u){const p=()=>{const b=window;return b.chatlizCustomFrames&&b.chatlizCustomFrames[s]?b.chatlizCustomFrames[s]:null};f(p());const x=()=>f(p());return window.addEventListener("chatliz_custom_frames_updated",x),()=>window.removeEventListener("chatliz_custom_frames_updated",x)}},[s,u]),i.jsxs("div",{className:`relative inline-block shrink-0 ${t} ${o?"cursor-pointer hover:opacity-80 transition-opacity":""}`,onClick:o,children:[i.jsx("img",{src:n,alt:e,referrerPolicy:l,className:"w-full h-full rounded-full object-cover relative z-0"}),u&&i.jsx("div",{className:"absolute inset-0 z-10 pointer-events-none",style:{transform:"scale(1.35)"},children:i.jsx("img",{src:h||`/frames/${s}.png`,alt:`Frame ${s}`,className:"w-full h-full object-contain",style:h?void 0:{WebkitMaskImage:"radial-gradient(circle closest-side, transparent 74%, black 75%)",maskImage:"radial-gradient(circle closest-side, transparent 74%, black 75%)"},onError:p=>{p.target.style.display="none"}})})]})};function u7({partner:n,onCancel:e}){return i.jsx("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-md z-[200] flex items-center justify-center p-4",children:i.jsxs("div",{className:"bg-gradient-to-b from-[#12141c] to-[#0B1220] p-10 rounded-[40px] w-full max-w-sm shadow-[0_0_50px_rgba(6,182,212,0.15)] relative border border-cyan-500/20 text-center animate-in zoom-in-95 duration-500 ease-out overflow-hidden",children:[i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-full h-1/2 bg-cyan-500/10 blur-[50px] rounded-full pointer-events-none"}),i.jsxs("div",{className:"relative w-32 h-32 mx-auto mb-6",children:[i.jsx("div",{className:"absolute inset-0 rounded-full border-4 border-cyan-500/30 animate-[ping_2s_cubic-bezier(0,0,0.2,1)_infinite]"}),i.jsx("div",{className:"absolute inset-2 rounded-full border-2 border-cyan-400/50 animate-pulse"}),i.jsx("div",{className:"w-full h-full rounded-full overflow-hidden border-2 border-[#12141c] relative z-10 shadow-2xl",children:i.jsx("img",{src:n.profilePic||`https://api.dicebear.com/7.x/avataaars/svg?seed=${n.username}`,alt:n.username,className:"w-full h-full object-cover bg-[#1A2639]",referrerPolicy:"no-referrer"})})]}),i.jsx("h3",{className:"text-xl font-medium text-gray-400 tracking-widest uppercase text-[10px] mb-2",children:"Llamando a"}),i.jsx("p",{className:"text-3xl font-light text-white mb-8 tracking-wide",children:n.username}),i.jsxs("div",{className:"flex items-center justify-center gap-1.5 mb-10",children:[i.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-cyan-500 animate-bounce",style:{animationDelay:"0ms"}}),i.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-cyan-500 animate-bounce",style:{animationDelay:"150ms"}}),i.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-cyan-500 animate-bounce",style:{animationDelay:"300ms"}})]}),i.jsxs("button",{onClick:e,className:"w-full flex items-center justify-center gap-3 p-4 rounded-full bg-red-500/10 text-red-400 hover:bg-red-500 hover:text-white border border-red-500/20 transition-all duration-300 shadow-[0_0_20px_rgba(239,68,68,0.1)] group",children:[i.jsx(Tg,{size:20,className:"group-hover:scale-110 transition-transform"}),i.jsx("span",{className:"font-semibold tracking-wide",children:"Cancelar Llamada"})]})]})})}function d7(n){return n!==null?{comment:n,variations:[]}:{variations:[]}}function h7(n,e,t,s,o){const l={move:n,variations:o};return e&&(l.suffix=e),t&&(l.nag=t),s!==null&&(l.comment=s),l}function f7(...n){const[e,...t]=n;let s=e;for(const o of t)o!==null&&(s.variations=[o,...o.variations],o.variations=[],s=o);return e}function m7(n,e){if(e.marker&&e.marker.comment){let t=e.root;for(;;){const s=t.variations[0];if(!s){t.comment=e.marker.comment;break}t=s}}return{headers:n,root:e.root,result:(e.marker&&e.marker.result)??void 0}}function p7(n,e){function t(){this.constructor=n}t.prototype=e.prototype,n.prototype=new t}function Nh(n,e,t,s){var o=Error.call(this,n);return Object.setPrototypeOf&&Object.setPrototypeOf(o,Nh.prototype),o.expected=e,o.found=t,o.location=s,o.name="SyntaxError",o}p7(Nh,Error);function iy(n,e,t){return t=t||" ",n.length>e?n:(e-=n.length,t+=t.repeat(e),n+t.slice(0,e))}Nh.prototype.format=function(n){var e="Error: "+this.message;if(this.location){var t=null,s;for(s=0;s<n.length;s++)if(n[s].source===this.location.source){t=n[s].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,l=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(o):o,u=this.location.source+":"+l.line+":"+l.column;if(t){var h=this.location.end,f=iy("",l.line.toString().length," "),p=t[o.line-1],x=o.line===h.line?h.column:p.length+1,b=x-o.column||1;e+=` 4271 --> `+u+` 4272`+f+` | 4273`+l.line+" | "+p+` 4274`+f+" | "+iy("",o.column-1," ")+iy("",b,"^")}else e+=` 4275 at `+u}return e};Nh.buildMessage=function(n,e){var t={literal:function(p){return'"'+o(p.text)+'"'},class:function(p){var x=p.parts.map(function(b){return Array.isArray(b)?l(b[0])+"-"+l(b[1]):l(b)}
4275);return"["+(p.inverted?"^":"")+x.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(p){return p.description}};function s(p){return p.charCodeAt(0).toString(16).toUpperCase()}function o(p){return p.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(x){return"\\x0"+s(x)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(x){return"\\x"+s(x)})}function l(p){return p.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(x){return"\\x0"+s(x)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(x){return"\\x"+s(x)})}function u(p){return t[p.type](p)}function h(p){var x=p.map(u),b,C;if(x.sort(),x.length>0){for(b=1,C=1;b<x.length;b++)x[b-1]!==x[b]&&(x[C]=x[b],C++);x.length=C}switch(x.length){case 1:return x[0];case 2:return x[0]+" or "+x[1];default:return x.slice(0,-1).join(", ")+", or "+x[x.length-1]}}function f(p){return p?'"'+o(p)+'"':"end of input"}return"Expected "+h(n)+" but "+f(e)+" found."};function B7(n,e){e=e!==void 0?e:{};var t={},s=e.grammarSource,o={pgn:hn},l=hn,u="[",h='"',f="]",p=".",x="O-O-O",b="O-O",C="0-0-0",N="0-0",T="$",R="{",A="}",U=";",M="(",V=")",H="1-0",Q="0-1",Y="1/2-1/2",k="*",E=/^[a-zA-Z]/,j=/^[^"]/,P=/^[0-9]/,O=/^[.]/,F=/^[a-zA-Z1-8\-=]/,S=/^[+#]/,be=/^[!?]/,Ee=/^[^}]/,me=/^[^\r\n]/,De=/^[ \t\r\n]/,ge=An("tag pair"),Ue=Ot("[",!1),we=Ot('"',!1),$e=Ot("]",!1),et=An("tag name"),Ae=Un([["a","z"],["A","Z"]],!1,!1),K=An("tag value"),ne=Un(['"'],!0,!1),Pe=An("move number"),Le=Un([["0","9"]],!1,!1),mt=Ot(".",!1),tt=Un(["."],!1,!1),lt=An("standard algebraic notation"),Qe=Ot("O-O-O",!1),st=Ot("O-O",!1),Yn=Ot("0-0-0",!1),Rn=Ot("0-0",!1),zn=Un([["a","z"],["A","Z"],["1","8"],"-","="],!1,!1),Zt=Un(["+","#"],!1,!1),en=An("suffix annotation"),jt=Un(["!","?"],!1,!1),At=An("NAG"),Tt=Ot("$",!1),gn=An("brace comment"),Oe=Ot("{",!1),vt=Un(["}"],!0,!1),Ft=Ot("}",!1),on=An("rest of line comment"),Zn=Ot(";",!1),Fn=Un(["\r",` 4276`],!0,!1),In=An("variation"),nn=Ot("(",!1),Ve=Ot(")",!1),Rt=An("game termination marker"),os=Ot("1-0",!1),Hn=Ot("0-1",!1),_t=Ot("1/2-1/2",!1),Sn=Ot("*",!1),Qt=An("whitespace"),Vt=Un([" "," ","\r",` 4277`],!1,!1),at=function(ce,Ce){return m7(ce,Ce)},Et=function(ce){return Object.fromEntries(ce)},hs=function(ce,Ce){return[ce,Ce]},xn=function(ce,Ce){return{root:ce,marker:Ce}},wt=function(ce,Ce){return f7(d7(ce),...Ce.flat())},rn=function(ce,Ce,ye,dt,ut){return h7(ce,Ce,ye,dt,ut)},jn=function(ce){return ce},On=function(ce){return ce.replace(/[\r\n]+/g," ")},es=function(ce){return ce.trim()},ls=function(ce){return ce},Vn=function(ce,Ce){return{result:ce,comment:Ce}},de=e.peg$currPos|0,sn=[{line:1,column:1}],Ut=de,xs=e.peg$maxFailExpected||[],He=e.peg$silentFails|0,Us;if(e.startRule){if(!(e.startRule in o))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');l=o[e.startRule]}function Ot(ce,Ce){return{type:"literal",text:ce,ignoreCase:Ce}}function Un(ce,Ce,ye){return{type:"class",parts:ce,inverted:Ce,ignoreCase:ye}}function ln(){return{type:"end"}}function An(ce){return{type:"other",description:ce}}function Nr(ce){var Ce=sn[ce],ye;if(Ce)return Ce;if(ce>=sn.length)ye=sn.length-1;else for(ye=ce;!sn[--ye];);for(Ce=sn[ye],Ce={line:Ce.line,column:Ce.column};ye<ce;)n.charCodeAt(ye)===10?(Ce.line++,Ce.column=1):Ce.column++,ye++;return sn[ce]=Ce,Ce}function ee(ce,Ce,ye){var dt=Nr(ce),ut=Nr(Ce),Yt={source:s,start:{offset:ce,line:dt.line,column:dt.column},end:{offset:Ce,line:ut.line,column:ut.column}};return Yt}function ve(ce){de<Ut||(de>Ut&&(Ut=de,xs=[]),xs.push(ce))}function Gt(ce,Ce,ye){return new Nh(Nh.buildMessage(ce,Ce),ce,Ce,ye)}function hn(){var ce,Ce,ye;return ce=de,Ce=Js(),ye=ra(),ce=at(Ce,ye),ce}function Js(){var ce,Ce,ye;for(ce=de,Ce=[],ye=Is();ye!==t;)Ce.push(ye),ye=Is();return ye=ws(),ce=Et(Ce),ce}function Is(){var ce,Ce,ye,dt,ut,Yt,Jt;return He++,ce=de,ws(),n.charCodeAt(de)===91?(Ce=u,de++):(Ce=t,He===0&&ve(Ue)),Ce!==t?(ws(),ye=fs(),ye!==t?(ws(),n.charCo
4277deAt(de)===34?(dt=h,de++):(dt=t,He===0&&ve(we)),dt!==t?(ut=Pr(),n.charCodeAt(de)===34?(Yt=h,de++):(Yt=t,He===0&&ve(we)),Yt!==t?(ws(),n.charCodeAt(de)===93?(Jt=f,de++):(Jt=t,He===0&&ve($e)),Jt!==t?ce=hs(ye,ut):(de=ce,ce=t)):(de=ce,ce=t)):(de=ce,ce=t)):(de=ce,ce=t)):(de=ce,ce=t),He--,ce===t&&He===0&&ve(ge),ce}function fs(){var ce,Ce,ye;if(He++,ce=de,Ce=[],ye=n.charAt(de),E.test(ye)?de++:(ye=t,He===0&&ve(Ae)),ye!==t)for(;ye!==t;)Ce.push(ye),ye=n.charAt(de),E.test(ye)?de++:(ye=t,He===0&&ve(Ae));else Ce=t;return Ce!==t?ce=n.substring(ce,de):ce=Ce,He--,ce===t&&(Ce=t,He===0&&ve(et)),ce}function Pr(){var ce,Ce,ye;for(He++,ce=de,Ce=[],ye=n.charAt(de),j.test(ye)?de++:(ye=t,He===0&&ve(ne));ye!==t;)Ce.push(ye),ye=n.charAt(de),j.test(ye)?de++:(ye=t,He===0&&ve(ne));return ce=n.substring(ce,de),He--,Ce=t,He===0&&ve(K),ce}function ra(){var ce,Ce,ye;return ce=de,Ce=Dr(),ws(),ye=Ha(),ye===t&&(ye=null),ws(),ce=xn(Ce,ye),ce}function Dr(){var ce,Ce,ye,dt;for(ce=de,Ce=Xn(),Ce===t&&(Ce=null),ye=[],dt=Ks();dt!==t;)ye.push(dt),dt=Ks();return ce=wt(Ce,ye),ce}function Ks(){var ce,Ce,ye,dt,ut,Yt,Jt,bs;if(ce=de,ws(),Yr(),ws(),Ce=ia(),Ce!==t){for(ye=Oi(),ye===t&&(ye=null),dt=[],ut=cr();ut!==t;)dt.push(ut),ut=cr();for(ut=ws(),Yt=Xn(),Yt===t&&(Yt=null),Jt=[],bs=Os();bs!==t;)Jt.push(bs),bs=Os();ce=rn(Ce,ye,dt,Yt,Jt)}else de=ce,ce=t;return ce}function Yr(){var ce,Ce,ye,dt,ut,Yt;for(He++,ce=de,Ce=[],ye=n.charAt(de),P.test(ye)?de++:(ye=t,He===0&&ve(Le));ye!==t;)Ce.push(ye),ye=n.charAt(de),P.test(ye)?de++:(ye=t,He===0&&ve(Le));if(n.charCodeAt(de)===46?(ye=p,de++):(ye=t,He===0&&ve(mt)),ye!==t){for(dt=ws(),ut=[],Yt=n.charAt(de),O.test(Yt)?de++:(Yt=t,He===0&&ve(tt));Yt!==t;)ut.push(Yt),Yt=n.charAt(de),O.test(Yt)?de++:(Yt=t,He===0&&ve(tt));Ce=[Ce,ye,dt,ut],ce=Ce}else de=ce,ce=t;return He--,ce===t&&(Ce=t,He===0&&ve(Pe)),ce}function ia(){var ce,Ce,ye,dt,ut,Yt;if(He++,ce=de,Ce=de,n.substr(de,5)===x?(ye=x,de+=5):(ye=t,He===0&&ve(Qe)),ye===t&&(n.substr(de,3)===b?(ye=b,de+=3):(ye=t,He===0&&ve(st)),ye===t&&(n.substr(de,5)===C?(ye=C,de+=5):(ye=t,He===0&&ve(Yn)),ye===t&&(n.substr(de,3)===N?(ye=N,de+=3):(ye=t,He===0&&ve(Rn)),ye===t))))if(ye=de,dt=n.charAt(de),E.test(dt)?de++:(dt=t,He===0&&ve(Ae)),dt!==t){if(ut=[],Yt=n.charAt(de),F.test(Yt)?de++:(Yt=t,He===0&&ve(zn)),Yt!==t)for(;Yt!==t;)ut.push(Yt),Yt=n.charAt(de),F.test(Yt)?de++:(Yt=t,He===0&&ve(zn));else ut=t;ut!==t?(dt=[dt,ut],ye=dt):(de=ye,ye=t)}else de=ye,ye=t;return ye!==t?(dt=n.charAt(de),S.test(dt)?de++:(dt=t,He===0&&ve(Zt)),dt===t&&(dt=null),ye=[ye,dt],Ce=ye):(de=Ce,Ce=t),Ce!==t?ce=n.substring(ce,de):ce=Ce,He--,ce===t&&(Ce=t,He===0&&ve(lt)),ce}function Oi(){var ce,Ce,ye;for(He++,ce=de,Ce=[],ye=n.charAt(de),be.test(ye)?de++:(ye=t,He===0&&ve(jt));ye!==t;)Ce.push(ye),Ce.length>=2?ye=t:(ye=n.charAt(de),be.test(ye)?de++:(ye=t,He===0&&ve(jt)));return Ce.length<1?(de=ce,ce=t):ce=Ce,He--,ce===t&&(Ce=t,He===0&&ve(en)),ce}function cr(){var ce,Ce,ye,dt,ut;if(He++,ce=de,ws(),n.charCodeAt(de)===36?(Ce=T,de++):(Ce=t,He===0&&ve(Tt)),Ce!==t){if(ye=de,dt=[],ut=n.charAt(de),P.test(ut)?de++:(ut=t,He===0&&ve(Le)),ut!==t)for(;ut!==t;)dt.push(ut),ut=n.charAt(de),P.test(ut)?de++:(ut=t,He===0&&ve(Le));else dt=t;dt!==t?ye=n.substring(ye,de):ye=dt,ye!==t?ce=jn(ye):(de=ce,ce=t)}else de=ce,ce=t;return He--,ce===t&&He===0&&ve(At),ce}function Xn(){var ce;return ce=_s(),ce===t&&(ce=Br()),ce}function _s(){var ce,Ce,ye,dt,ut;if(He++,ce=de,n.charCodeAt(de)===123?(Ce=R,de++):(Ce=t,He===0&&ve(Oe)),Ce!==t){for(ye=de,dt=[],ut=n.charAt(de),Ee.test(ut)?de++:(ut=t,He===0&&ve(vt));ut!==t;)dt.push(ut),ut=n.charAt(de),Ee.test(ut)?de++:(ut=t,He===0&&ve(vt));ye=n.substring(ye,de),n.charCodeAt(de)===125?(dt=A,de++):(dt=t,He===0&&ve(Ft)),dt!==t?ce=On(ye):(de=ce,ce=t)}else de=ce,ce=t;return He--,ce===t&&(Ce=t,He===0&&ve(gn)),ce}function Br(){var ce,Ce,ye,dt,ut;if(He++,ce=de,n.charCodeAt(de)===59?(Ce=U,de++):(Ce=t,He===0&&ve(Zn)),Ce!==t){for(ye=de,dt=[],ut=n.charAt(de),me.test(ut)?de++:(ut=t,He===0&&ve(Fn));ut!==t;)dt.push(ut),ut=n.charAt(de),me.test(ut)?de++:(ut=t,He===0&&ve(Fn));ye=n.substring(ye,de),ce=es(ye)}else de=ce,ce=t;return He--,ce===t&&(Ce=t,He===0&&ve(on)),ce}function Os(){var ce,Ce,ye,dt;
4277return He++,ce=de,ws(),n.charCodeAt(de)===40?(Ce=M,de++):(Ce=t,He===0&&ve(nn)),Ce!==t?(ye=Dr(),ye!==t?(ws(),n.charCodeAt(de)===41?(dt=V,de++):(dt=t,He===0&&ve(Ve)),dt!==t?ce=ls(ye):(de=ce,ce=t)):(de=ce,ce=t)):(de=ce,ce=t),He--,ce===t&&He===0&&ve(In),ce}function Ha(){var ce,Ce,ye;return He++,ce=de,n.substr(de,3)===H?(Ce=H,de+=3):(Ce=t,He===0&&ve(os)),Ce===t&&(n.substr(de,3)===Q?(Ce=Q,de+=3):(Ce=t,He===0&&ve(Hn)),Ce===t&&(n.substr(de,7)===Y?(Ce=Y,de+=7):(Ce=t,He===0&&ve(_t)),Ce===t&&(n.charCodeAt(de)===42?(Ce=k,de++):(Ce=t,He===0&&ve(Sn))))),Ce!==t?(ws(),ye=Xn(),ye===t&&(ye=null),ce=Vn(Ce,ye)):(de=ce,ce=t),He--,ce===t&&(Ce=t,He===0&&ve(Rt)),ce}function ws(){var ce,Ce;for(He++,ce=[],Ce=n.charAt(de),De.test(Ce)?de++:(Ce=t,He===0&&ve(Vt));Ce!==t;)ce.push(Ce),Ce=n.charAt(de),De.test(Ce)?de++:(Ce=t,He===0&&ve(Vt));return He--,Ce=t,He===0&&ve(Qt),ce}if(Us=l(),e.peg$library)return{peg$result:Us,peg$currPos:de,peg$FAILED:t,peg$maxFailExpected:xs,peg$maxFailPos:Ut};if(Us!==t&&de===n.length)return Us;throw Us!==t&&de<n.length&&ve(ln()),Gt(xs,Ut<n.length?n.charAt(Ut):null,Ut<n.length?ee(Ut,Ut+1):ee(Ut,Ut))}/** 4278 * @license 4279 * Copyright (c) 2025, Jeff Hlywa ([email protected]) 4280 * All rights reserved. 4281 * 4282 * Redistribution and use in source and binary forms, with or without 4283 * modification, are permitted provided that the following conditions are met: 4284 * 4285 * 1. Redistributions of source code must retain the above copyright notice, 4286 * this list of conditions and the following disclaimer. 4287 * 2. Redistributions in binary form must reproduce the above copyright notice, 4288 * this list of conditions and the following disclaimer in the documentation 4289 * and/or other materials provided with the distribution. 4290 * 4291 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 4292 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 4293 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 4294 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 4295 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 4296 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 4297 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 4298 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 4299 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 4300 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 4301 * POSSIBILITY OF SUCH DAMAGE. 4302 */const PB=0xffffffffffffffffn;function ay(n,e){return(n<<e|n>>64n-e)&0xffffffffffffffffn}function G5(n,e){return n*e&PB}function g7(n){return function(){let e=BigInt(n&PB),t=BigInt(n>>64n&PB);const s=G5(ay(G5(e,5n),7n),9n);return t^=e,e=(ay(e,24n)^t^t<<16n)&PB,t=ay(t,37n),n=t<<64n|e,s}}const hx=g7(0xa187eb39cdcaed8f31c4b365b102e01en),x7=Array.from({length:2},()=>Array.from({length:6},()=>Array.from({length:128},()=>hx()))),b7=Array.from({length:8},()=>hx()),C7=Array.from({length:16},()=>hx()),oy=hx(),Hr="w",Yi="b",er="p",u1="n",zB="b",om="r",dc="q",fr="k",ly="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";class uB{constructor(e,t){ze(this,"color");ze(this,"from");ze(this,"to");ze(this,"piece");ze(this,"captured");ze(this,"promotion");ze(this,"flags");ze(this,"san");ze(this,"lan");ze(this,"before");ze(this,"after");const{color:s,piece:o,from:l,to:u,flags:h,captured:f,promotion:p}=t,x=yr(l),b=yr(u);this.color=s,this.piece=o,this.from=x,this.to=b,this.san=e._moveToSan(t,e._moves({legal:!0})),this.lan=x+b,this.before=e.fen(),e._makeMove(t),this.after=e.fen(),e._undoMove(),this.flags="";for(const C in Pt)Pt[C]&h&&(this.flags+=gu[C]);f&&(this.captured=f),p&&(this.promotion=p,this.lan+=p)}isCapture(){return this.flags.indexOf(gu.CAPTURE)>-1}isPromotion(){return this.flags.indexOf(gu.PROMOTION)>-1}isEnPassant(){return this.flags.indexOf(gu.EP_CAPTURE)>-1}isKingsideCastle(){return this.flags.indexOf(gu.KSIDE_CASTLE)>-1}isQueensideCastle(){return this.flags.indexOf(gu.QSIDE_CASTLE)>-1}isBigPawn(){return this.flags.indexOf(gu.BIG_PAWN)>-1}}const Or=-1,gu={NORMAL:"n",CAPTURE:"c",BIG_PAWN:"b",EP_CAPTURE:"e",PROMOTION:"p",KSIDE_CASTLE:"k",QSIDE_CASTLE:"q",NULL_MOVE:"-"},Pt={NORMAL:1,CAPTURE:2,BIG_PAWN:4,EP_CAPTURE:8,PROMOTION:16,KSIDE_CASTLE:32,QSIDE_CASTLE:64,NULL_MOVE:128},d1={Event:"?",Site:"?",Date:"????.??.??",Round:"?",White:"?",Black:"?",Result:"*"},y7={WhiteTitle:null,BlackTitle:null,WhiteElo:null,BlackElo:null,WhiteUSCF:null,BlackUSCF:null,WhiteNA:null,BlackNA:null,WhiteType:null,BlackType:null,EventDate:null,EventSponsor:null,Section:null,Stage:null,Board:null,Opening:null,Variation:null,SubVariation:null,ECO:null,NIC:null,Time:null,UTCTime:null,UTCDate:null,TimeControl:null,SetUp:null,FEN:null,Termination:null,Annotator:null,Mode:null,PlyCount:null},v7={...d1,...y7},kt={a8:0,b8:1,c8:2,d8:3,e8:4,f8:5,g8:6,h8:7,a7:16,b7:17,c7:18,d7:19,e7:20,f7:21,g7:22,h7:23,a6:32,b6:33,c6:34,d6:35,e6:36,f6:37,g6:38,h6:39,a5:48,b5:49,c5:50,d5:51,e5:52,f5:53,g5:54,h5:55,a4:64,b4:65,c4:66,d4:67,e4:68,f4:69,g4:70,h4:71,a3:80,b3:81,c3:82,d3:83,e3:84,f3:85,g3:86,h3:87,a2:96,b2:97,c2:98,d2:99,e2:100,f2:101,g2
4302:102,h2:103,a1:112,b1:113,c1:114,d1:115,e1:116,f1:117,g1:118,h1:119},cy={b:[16,32,17,15],w:[-16,-32,-17,-15]},H5={n:[-18,-33,-31,-14,18,33,31,14],b:[-17,-15,17,15],r:[-16,1,16,-1],q:[-17,-16,-15,1,17,16,15,-1],k:[-17,-16,-15,1,17,16,15,-1]},_7=[20,0,0,0,0,0,0,24,0,0,0,0,0,0,20,0,0,20,0,0,0,0,0,24,0,0,0,0,0,20,0,0,0,0,20,0,0,0,0,24,0,0,0,0,20,0,0,0,0,0,0,20,0,0,0,24,0,0,0,20,0,0,0,0,0,0,0,0,20,0,0,24,0,0,20,0,0,0,0,0,0,0,0,0,0,20,2,24,2,20,0,0,0,0,0,0,0,0,0,0,0,2,53,56,53,2,0,0,0,0,0,0,24,24,24,24,24,24,56,0,56,24,24,24,24,24,24,0,0,0,0,0,0,2,53,56,53,2,0,0,0,0,0,0,0,0,0,0,0,20,2,24,2,20,0,0,0,0,0,0,0,0,0,0,20,0,0,24,0,0,20,0,0,0,0,0,0,0,0,20,0,0,0,24,0,0,0,20,0,0,0,0,0,0,20,0,0,0,0,24,0,0,0,0,20,0,0,0,0,20,0,0,0,0,0,24,0,0,0,0,0,20,0,0,20,0,0,0,0,0,0,24,0,0,0,0,0,0,20],w7=[17,0,0,0,0,0,0,16,0,0,0,0,0,0,15,0,0,17,0,0,0,0,0,16,0,0,0,0,0,15,0,0,0,0,17,0,0,0,0,16,0,0,0,0,15,0,0,0,0,0,0,17,0,0,0,16,0,0,0,15,0,0,0,0,0,0,0,0,17,0,0,16,0,0,15,0,0,0,0,0,0,0,0,0,0,17,0,16,0,15,0,0,0,0,0,0,0,0,0,0,0,0,17,16,15,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-15,-16,-17,0,0,0,0,0,0,0,0,0,0,0,0,-15,0,-16,0,-17,0,0,0,0,0,0,0,0,0,0,-15,0,0,-16,0,0,-17,0,0,0,0,0,0,0,0,-15,0,0,0,-16,0,0,0,-17,0,0,0,0,0,0,-15,0,0,0,0,-16,0,0,0,0,-17,0,0,0,0,-15,0,0,0,0,0,-16,0,0,0,0,0,-17,0,0,-15,0,0,0,0,0,0,-16,0,0,0,0,0,0,-17],E7={p:1,n:2,b:4,r:8,q:16,k:32},N7="pnbrqkPNBRQK",q5=[u1,zB,om,dc],D7=7,T7=6,S7=1,j7=0,dB={[fr]:Pt.KSIDE_CASTLE,[dc]:Pt.QSIDE_CASTLE},oc={w:[{square:kt.a1,flag:Pt.QSIDE_CASTLE},{square:kt.h1,flag:Pt.KSIDE_CASTLE}],b:[{square:kt.a8,flag:Pt.QSIDE_CASTLE},{square:kt.h8,flag:Pt.KSIDE_CASTLE}]},A7={b:S7,w:T7},uy="--";function Ou(n){return n>>4}function Ym(n){return n&15}function aA(n){return"0123456789".indexOf(n)!==-1}function yr(n){const e=Ym(n),t=Ou(n);return"abcdefgh".substring(e,e+1)+"87654321".substring(t,t+1)}function Zf(n){return n===Hr?Yi:Hr}function k7(n){const e=n.split(/\s+/);if(e.length!==6)return{ok:!1,error:"Invalid FEN: must contain six space-delimited fields"};const t=parseInt(e[5],10);if(isNaN(t)||t<=0)return{ok:!1,error:"Invalid FEN: move number must be a positive integer"};const s=parseInt(e[4],10);if(isNaN(s)||s<0)return{ok:!1,error:"Invalid FEN: half move counter number must be a non-negative integer"};if(!/^(-|[abcdefgh][36])$/.test(e[3]))return{ok:!1,error:"Invalid FEN: en-passant square is invalid"};if(/[^kKqQ-]/.test(e[2]))return{ok:!1,error:"Invalid FEN: castling availability is invali
4302d"};if(!/^(w|b)$/.test(e[1]))return{ok:!1,error:"Invalid FEN: side-to-move is invalid"};const o=e[0].split("/");if(o.length!==8)return{ok:!1,error:"Invalid FEN: piece data does not contain 8 '/'-delimited rows"};for(let u=0;u<o.length;u++){let h=0,f=!1;for(let p=0;p<o[u].length;p++)if(aA(o[u][p])){if(f)return{ok:!1,error:"Invalid FEN: piece data is invalid (consecutive number)"};h+=parseInt(o[u][p],10),f=!0}else{if(!/^[prnbqkPRNBQK]$/.test(o[u][p]))return{ok:!1,error:"Invalid FEN: piece data is invalid (invalid piece)"};h+=1,f=!1}if(h!==8)return{ok:!1,error:"Invalid FEN: piece data is invalid (too many squares in rank)"}}if(e[3][1]=="3"&&e[1]=="w"||e[3][1]=="6"&&e[1]=="b")return{ok:!1,error:"Invalid FEN: illegal en-passant square"};const l=[{color:"white",regex:/K/g},{color:"black",regex:/k/g}];for(const{color:u,regex:h}of l){if(!h.test(e[0]))return{ok:!1,error:`Invalid FEN: missing ${u} king`};if((e[0].match(h)||[]).length>1)return{ok:!1,error:`Invalid FEN: too many ${u} kings`}}return Array.from(o[0]+o[7]).some(u=>u.toUpperCase()==="P")?{ok:!1,error:"Invalid FEN: some pawns are on the edge rows"}:{ok:!0}}function R7(n,e){const t=n.from,s=n.to,o=n.piece;let l=0,u=0,h=0;for(let f=0,p=e.length;f<p;f++){const x=e[f].from,b=e[f].to,C=e[f].piece;o===C&&t!==x&&s===b&&(l++,Ou(t)===Ou(x)&&u++,Ym(t)===Ym(x)&&h++)}return l>0?u>0&&h>0?yr(t):h>0?yr(t).charAt(1):yr(t).charAt(0):""}function lc(n,e,t,s,o,l=void 0,u=Pt.NORMAL){const h=Ou(s);if(o===er&&(h===D7||h===j7))for(let f=0;f<q5.length;f++){const p=q5[f];n.push({color:e,from:t,to:s,piece:o,captured:l,promotion:p,flags:u|Pt.PROMOTION})}else n.push({color:e,from:t,to:s,piece:o,captured:l,flags:u})}function $5(n){let e=n.charAt(0);return e>="a"&&e<="h"?n.match(/[a-h]\d.*[a-h]\d/)?void 0:er:(e=e.toLowerCase(),e==="o"?fr:e)}function dy(n){return n.replace(/=/,"").replace(/[+#]?[?!]*$/,"")}class uh{constructor(e=ly,{skipValidation:t=!1}={}){ze(this,"_board",new Array(128));ze(this,"_turn",Hr);ze(this,"_header",{});ze(this,"_kings",{w:Or,b:Or});ze(this,"_epSquare",-1);ze(this,"_halfMoves",0);ze(this,"_moveNumber",0);ze(this,"_history",[]);ze(this,"_comments",{});ze(this,"_castling",{w:0,b:0});ze(this,"_hash",0n);ze(this,"_positionCount",new Map);this.load(e,{skipValidation:t})}clear({preserveHeaders:e=!1}={}){this._board=new Array(128),this._kings={w:Or,b:Or},this._turn=Hr,this._castling={w:0,b:0},this._epSquare=Or,this._halfMoves=0,this._moveNumber=1,this._history=[],this._comments={},this._header=e?this._header:{...v7},this._hash=this._computeHash(),this._positionCount=new Map,this._header.SetUp=null,this._header.FEN=null}load(e,{skipValidation:t=!1,preserveHeaders:s=!1}={}){let o=e.split(/\s+/);if(o.length>=2&&o.length<6){const h=["-","-","0","1"];e=o.concat(h.slice(-(6-o.length))).join(" ")}if(o=e.split(/\s+/),!t){const{ok:h,error:f}=k7(e);if(!h)throw new Error(f)}const l=o[0];let u=0;this.clear({preserveHeaders:s});for(let h=0;h<l.length;h++){const f=l.charAt(h);if(f==="/")u+=8;else if(aA(f))u+=parseInt(f,10);else{const p=f<"a"?Hr:Yi;this._put({type:f.toLowerCase(),color:p},yr(u)),u++}}this._turn=o[1],o[2].indexOf("K")>-1&&(this._castling.w|=Pt.KSIDE_CASTLE),o[2].indexOf("Q")>-1&&(this._castling.w|=Pt.QSIDE_CASTLE),o[2].indexOf("k")>-1&&(this._castling.b|=Pt.KSIDE_CASTLE),o[2].indexOf("q")>-1&&(this._castling.b|=Pt.QSIDE_CASTLE),this._epSquare=o[3]==="-"?Or:kt[o[3]],this._halfMoves=parseInt(o[4],10),this._moveNumber=parseInt(o[5],10),this._hash=this._computeHash(),this._updateSetup(e),this._incPositionCount()}fen({forceEnpassantSquare:e=!1}={}){var u,h;let t=0,s="";for(let f=kt.a8;f<=kt.h1;f++){if(this._board[f]){t>0&&(s+=t,t=0);const{color:p,type:x}=this._board[f];s+=p===Hr?x.toUpperCase():x.toLowerCase()}else t++;f+1&136&&(t>0&&(s+=t),f!==kt.h1&&(s+="/"),t=0,f+=8)}let o="";this._castling[Hr]&Pt.KSIDE_CASTLE&&(o+="K"),this._castling[Hr]&Pt.QSIDE_CASTLE&&(o+="Q"),this._castling[Yi]&Pt.KSIDE_CASTLE&&(o+="k"),this._castling[Yi]&Pt.QSIDE_CASTLE&&(o+="q"),o=o||"-";let l="-";if(this._epSquare!==Or)if(e)l=yr(this._epSquare);else{const f=this._epSquare+(this._turn===Hr?16:-16),p=[f+1,f-1];for(const x of p){if(x&136)continue;const b=this._turn;if(((u=this._board[x])==null?void 0:u.color)===b&&((h=this._board[x])==null?void 0:h.type)===er){this._makeMove({color:b,from:x,to:this._epSquare,piece:er,captured:er,flags:Pt.EP_CAPTURE});const C=!this._isKingAttacked(b);
4302if(this._undoMove(),C){l=yr(this._epSquare);break}}}}return[s,this._turn,o,l,this._halfMoves,this._moveNumber].join(" ")}_pieceKey(e){if(!this._board[e])return 0n;const{color:t,type:s}=this._board[e],o={w:0,b:1}[t],l={p:0,n:1,b:2,r:3,q:4,k:5}[s];return x7[o][l][e]}_epKey(){return this._epSquare===Or?0n:b7[this._epSquare&7]}_castlingKey(){const e=this._castling.w>>5|this._castling.b>>3;return C7[e]}_computeHash(){let e=0n;for(let t=kt.a8;t<=kt.h1;t++){if(t&136){t+=7;continue}this._board[t]&&(e^=this._pieceKey(t))}return e^=this._epKey(),e^=this._castlingKey(),this._turn==="b"&&(e^=oy),e}_updateSetup(e){this._history.length>0||(e!==ly?(this._header.SetUp="1",this._header.FEN=e):(this._header.SetUp=null,this._header.FEN=null))}reset(){this.load(ly)}get(e){return this._board[kt[e]]}findPiece(e){var s;const t=[];for(let o=kt.a8;o<=kt.h1;o++){if(o&136){o+=7;continue}!this._board[o]||((s=this._board[o])==null?void 0:s.color)!==e.color||this._board[o].color===e.color&&this._board[o].type===e.type&&t.push(yr(o))}return t}put({type:e,color:t},s){return this._put({type:e,color:t},s)?(this._updateCastlingRights(),this._updateEnPassantSquare(),this._updateSetup(this.fen()),!0):!1}_set(e,t){this._hash^=this._pieceKey(e),this._board[e]=t,this._hash^=this._pieceKey(e)}_put({type:e,color:t},s){if(N7.indexOf(e.toLowerCase())===-1||!(s in kt))return!1;const o=kt[s];if(e==fr&&!(this._kings[t]==Or||this._kings[t]==o))return!1;const l=this._board[o];return l&&l.type===fr&&(this._kings[l.color]=Or),this._set(o,{type:e,color:t}),e===fr&&(this._kings[t]=o),!0}_clear(e){this._hash^=this._pieceKey(e),delete this._board[e]}remove(e){const t=this.get(e);return this._clear(kt[e]),t&&t.type===fr&&(this._kings[t.color]=Or),this._updateCastlingRights(),this._updateEnPassantSquare(),this._updateSetup(this.fen()),t}_updateCastlingRights(){var s,o,l,u,h,f,p,x,b,C,N,T;this._hash^=this._castlingKey();const e=((s=this._board[kt.e1])==null?void 0:s.type)===fr&&((o=this._board[kt.e1])==null?void 0:o.color)===Hr,t=((l=this._board[kt.e8])==null?void 0:l.type)===fr&&((u=this._board[kt.e8])==null?void 0:u.color)===Yi;(!e||((h=this._board[kt.a1])==null?void 0:h.type)!==om||((f=this._board[kt.a1])==null?void 0:f.color)!==Hr)&&(this._castling.w&=-65),(!e||((p=this._board[kt.h1])==null?void 0:p.type)!==om||((x=this._board[kt.h1])==null?void 0:x.color)!==Hr)&&(this._castling.w&=-33),(!t||((b=this._board[kt.a8])==null?void 0:b.type)!==om||((C=this._board[kt.a8])==null?void 0:C.color)!==Yi)&&(this._castling.b&=-65),(!t||((N=this._board[kt.h8])==null?void 0:N.type)!==om||((T=this._board[kt.h8])==null?void 0:T.color)!==Yi)&&(this._castling.b&=-33),this._hash^=this._castlingKey()}_updateEnPassantSquare(){var l,u;if(this._epSquare===Or)return;const e=this._epSquare+(this._turn===Hr?-16:16),t=this._epSquare+(this._turn===Hr?16:-16),s=[t+1,t-1];if(this._board[e]!==null||this._board[this._epSquare]!==null||((l=this._board[t])==null?void 0:l.color)!==Zf(this._turn)||((u=this._board[t])==null?void 0:u.type)!==er){this._hash^=this._epKey(),this._epSquare=Or;return}const o=h=>{var f,p;return!(h&136)&&((f=this._board[h])==null?void 0:f.color)===this._turn&&((p=this._board[h])==null?void 0:p.type)===er};s.some(o)||(this._hash^=this._epKey(),this._epSquare=Or)}_attacked(e,t,s){const o=[];for(let l=kt.a8;l<=kt.h1;l++){if(l&136){l+=7;continue}if(this._board[l]===void 0||this._board[l].color!==e)continue;const u=this._board[l],h=l-t;if(h===0)continue;const f=h+119;if(_7[f]&E7[u.type]){if(u.type===er){if(h>0&&u.color===Hr||h<=0&&u.color===Yi)if(s)o.push(yr(l));else return!0;continue}if(u.type==="n"||u.type==="k")if(s){o.push(yr(l));continue}else return!0;const p=w7[f];let x=l+p,b=!1;for(;x!==t;){if(this._board[x]!=null){b=!0;break}x+=p}if(!b)if(s){o.push(yr(l));continue}else return!0}}return s?o:!1}attackers(e,t){return t?this._attacked(t,kt[e],!0):this._attacked(this._turn,kt[e],!0)}_isKingAttacked(e){const t=this._kings[e];return t===-1?!1:this._attacked(Zf(e),t)}hash(){return this._hash.toString(16)}isAttacked(e,t){return this._attacked(t,kt[e])}isCheck(){return this._isKingAttacked(this._turn)}inCheck(){return this.isCheck()}isCheckmate(){return this.isCheck()&&this._moves().length===0}isStalemate(){return!this.isCheck()&&this._moves().length===0}isInsufficientMaterial(){const e={b:0,n:0,r:0,q:0,k:0,p:0},t=[];let s=0,o=0;for(let l=kt.a8;l<=kt.h1;l++){if(o=(o+1)%2,l&136){l+=7;continue}const u=this._board[l];u&&(e[u.type]=u.type in e?e[u.type]+1:1,u.type===zB&&t.push(o),s++)}if(s===2)return!0;
4302if(s===3&&(e[zB]===1||e[u1]===1))return!0;if(s===e[zB]+2){let l=0;const u=t.length;for(let h=0;h<u;h++)l+=t[h];if(l===0||l===u)return!0}return!1}isThreefoldRepetition(){return this._getPositionCount(this._hash)>=3}isDrawByFiftyMoves(){return this._halfMoves>=100}isDraw(){return this.isDrawByFiftyMoves()||this.isStalemate()||this.isInsufficientMaterial()||this.isThreefoldRepetition()}isGameOver(){return this.isCheckmate()||this.isDraw()}moves({verbose:e=!1,square:t=void 0,piece:s=void 0}={}){const o=this._moves({square:t,piece:s});return e?o.map(l=>new uB(this,l)):o.map(l=>this._moveToSan(l,o))}_moves({legal:e=!0,piece:t=void 0,square:s=void 0}={}){var N;const o=s?s.toLowerCase():void 0,l=t==null?void 0:t.toLowerCase(),u=[],h=this._turn,f=Zf(h);let p=kt.a8,x=kt.h1,b=!1;if(o)if(o in kt)p=x=kt[o],b=!0;else return[];for(let T=p;T<=x;T++){if(T&136){T+=7;continue}if(!this._board[T]||this._board[T].color===f)continue;const{type:R}=this._board[T];let A;if(R===er){if(l&&l!==R)continue;A=T+cy[h][0],this._board[A]||(lc(u,h,T,A,er),A=T+cy[h][1],A7[h]===Ou(T)&&!this._board[A]&&lc(u,h,T,A,er,void 0,Pt.BIG_PAWN));for(let U=2;U<4;U++)A=T+cy[h][U],!(A&136)&&(((N=this._board[A])==null?void 0:N.color)===f?lc(u,h,T,A,er,this._board[A].type,Pt.CAPTURE):A===this._epSquare&&lc(u,h,T,A,er,er,Pt.EP_CAPTURE))}else{if(l&&l!==R)continue;for(let U=0,M=H5[R].length;U<M;U++){const V=H5[R][U];for(A=T;A+=V,!(A&136);){if(!this._board[A])lc(u,h,T,A,R);else{if(this._board[A].color===h)break;lc(u,h,T,A,R,this._board[A].type,Pt.CAPTURE);break}if(R===u1||R===fr)break}}}}if((l===void 0||l===fr)&&(!b||x===this._kings[h])){if(this._castling[h]&Pt.KSIDE_CASTLE){const T=this._kings[h],R=T+2;!this._board[T+1]&&!this._board[R]&&!this._attacked(f,this._kings[h])&&!this._attacked(f,T+1)&&!this._attacked(f,R)&&lc(u,h,this._kings[h],R,fr,void 0,Pt.KSIDE_CASTLE)}if(this._castling[h]&Pt.QSIDE_CASTLE){const T=this._kings[h],R=T-2;!this._board[T-1]&&!this._board[T-2]&&!this._board[T-3]&&!this._attacked(f,this._kings[h])&&!this._attacked(f,T-1)&&!this._attacked(f,R)&&lc(u,h,this._kings[h],R,fr,void 0,Pt.QSIDE_CASTLE)}}if(!e||this._kings[h]===-1)return u;const C=[];for(let T=0,R=u.length;T<R;T++)this._makeMove(u[T]),this._isKingAttacked(h)||C.push(u[T]),this._undoMove();return C}move(e,{strict:t=!1}={}){let s=null;if(typeof e=="string")s=this._moveFromSan(e,t);else if(e===null)s=this._moveFromSan(uy,t);else if(typeof e=="object"){const l=this._moves();for(let u=0,h=l.length;u<h;u++)if(e.from===yr(l[u].from)&&e.to===yr(l[u].to)&&(!("promotion"in l[u])||e.promotion===l[u].promotion)){s=l[u];break}}if(!s)throw typeof e=="string"?new Error(`Invalid move: ${e}`):new Error(`Invalid move: ${JSON.stringify(e)}`);if(this.isCheck()&&s.flags&Pt.NULL_MOVE)throw new Error("Null move not allowed when in check");const o=new uB(this,s);return this._makeMove(s),this._incPositionCount(),o}_push(e){this._history.push({move:e,kings:{b:this._kings.b,w:this._kings.w},turn:this._turn,castling:{b:this._castling.b,w:this._castling.w},epSquare:this._epSquare,halfMoves:this._halfMoves,moveNumber:this._moveNumber})}_movePiece(e,t){this._hash^=this._pieceKey(e),this._board[t]=this._board[e],delete this._board[e],this._hash^=this._pieceKey(t)}_makeMove(e){var o,l,u,h;const t=this._turn,s=Zf(t);if(this._push(e),e.flags&Pt.NULL_MOVE){t===Yi&&this._moveNumber++,this._halfMoves++,this._turn=s,this._epSquare=Or;return}if(this._hash^=this._epKey(),this._hash^=this._castlingKey(),e.captured&&(this._hash^=this._pieceKey(e.to)),this._movePiece(e.from,e.to),e.flags&Pt.EP_CAPTURE&&(this._turn===Yi?this._clear(e.to-16):this._clear(e.to+16)),e.promotion&&(this._clear(e.to),this._set(e.to,{type:e.promotion,color:t})),this._board[e.to].type===fr){if(this._kings[t]=e.to,e.flags&Pt.KSIDE_CASTLE){const f=e.to-1,p=e.to+1;this._movePiece(p,f)}else if(e.flags&Pt.QSIDE_CASTLE){const f=e.to+1,p=e.to-2;this._movePiece(p,f)}this._castling[t]=0}if(this._castling[t]){for(let f=0,p=oc[t].length;f<p;f++)if(e.from===oc[t][f].square&&this._castling[t]&oc[t][f].flag){this._castling[t]^=oc[t][f].flag;break}}if(this._castling[s]){for(let f=0,p=oc[s].length;f<p;f++)if(e.to===oc[s][f].square&&this._castling[s]&oc[s][f].flag){this._castling[s]^=oc[s][f].flag;break}}if(this._hash^=this._castlingKey(),e.flags&Pt.BIG_PAWN){let f;t===Yi?f=e.to-16:f=e.to+16,!(e.to-1&136)&&((o=this._board[e.to-1])==null?void 0:o.type)===er&&((l=this._board[e.to-1])==null?void 0:l.color)===s||!(e.to+1&136)&&((u=this._board[e.to+1])==null?void 0:u.type)===er&&((h=this._board[e.to+1])==null?void 0:h.color)===s?(this._epSquare=f,this._hash^=this._epKey()):this._epSquare=Or}else this._epSquare=Or;e.piece===er?this._halfMoves=0:e.flags&(Pt.CAPTURE|Pt.EP_CAPTURE)?this._halfMoves=0:this._halfMoves++,t===Yi&&this._moveNumber++,this._turn=s,this._hash^=oy}
4302undo(){const e=this._hash,t=this._undoMove();if(t){const s=new uB(this,t);return this._decPositionCount(e),s}return null}_undoMove(){const e=this._history.pop();if(e===void 0)return null;this._hash^=this._epKey(),this._hash^=this._castlingKey();const t=e.move;this._kings=e.kings,this._turn=e.turn,this._castling=e.castling,this._epSquare=e.epSquare,this._halfMoves=e.halfMoves,this._moveNumber=e.moveNumber,this._hash^=this._epKey(),this._hash^=this._castlingKey(),this._hash^=oy;const s=this._turn,o=Zf(s);if(t.flags&Pt.NULL_MOVE)return t;if(this._movePiece(t.to,t.from),t.piece&&(this._clear(t.from),this._set(t.from,{type:t.piece,color:s})),t.captured)if(t.flags&Pt.EP_CAPTURE){let l;s===Yi?l=t.to-16:l=t.to+16,this._set(l,{type:er,color:o})}else this._set(t.to,{type:t.captured,color:o});if(t.flags&(Pt.KSIDE_CASTLE|Pt.QSIDE_CASTLE)){let l,u;t.flags&Pt.KSIDE_CASTLE?(l=t.to+1,u=t.to-1):(l=t.to-2,u=t.to+1),this._movePiece(u,l)}return t}pgn({newline:e=` 4303`,maxWidth:t=0}={}){const s=[];let o=!1;for(const C in this._header)this._header[C]&&s.push(`[${C} "${this._header[C]}"]`+e),o=!0;o&&this._history.length&&s.push(e);const l=C=>{const N=this._comments[this.fen()];if(typeof N<"u"){const T=C.length>0?" ":"";C=`${C}${T}{${N}}`}return C},u=[];for(;this._history.length>0;)u.push(this._undoMove());const h=[];let f="";for(u.length===0&&h.push(l(""));u.length>0;){f=l(f);const C=u.pop();if(!C)break;if(!this._history.length&&C.color==="b"){const N=`${this._moveNumber}. ...`;f=f?`${f} ${N}`:N}else C.color==="w"&&(f.length&&h.push(f),f=this._moveNumber+".");f=f+" "+this._moveToSan(C,this._moves({legal:!0})),this._makeMove(C)}if(f.length&&h.push(l(f)),h.push(this._header.Result||"*"),t===0)return s.join("")+h.join(" ");const p=function(){return s.length>0&&s[s.length-1]===" "?(s.pop(),!0):!1},x=function(C,N){for(const T of N.split(" "))if(T){if(C+T.length>t){for(;p();)C--;s.push(e),C=0}s.push(T),C+=T.length,s.push(" "),C++}return p()&&C--,C};let b=0;for(let C=0;C<h.length;C++){if(b+h[C].length>t&&h[C].includes("{")){b=x(b,h[C]);continue}b+h[C].length>t&&C!==0?(s[s.length-1]===" "&&s.pop(),s.push(e),b=0):C!==0&&(s.push(" "),b++),s.push(h[C]),b+=h[C].length}return s.join("")}header(...e){for(let t=0;t<e.length;t+=2)typeof e[t]=="string"&&typeof e[t+1]=="string"&&(this._header[e[t]]=e[t+1]);return this._header}setHeader(e,t){return this._header[e]=t??d1[e]??null,this.getHeaders()}removeHeader(e){return e in this._header?(this._header[e]=d1[e]||null,!0):!1}getHeaders(){const e={};for(const[t,s]of Object.entries(this._header))s!==null&&(e[t]=s);return e}loadPgn(e,{strict:t=!1,newlineChar:s=`\r? 4304`}={}){s!==`\r? 4305`&&(e=e.replace(new RegExp(s,"g"),` 4306`));const o=B7(e);this.reset();const l=o.headers;let u="";for(const p in l)p.toLowerCase()==="fen"&&(u=l[p]),this.header(p,l[p]);if(!t)u&&this.load(u,{preserveHeaders:!0});else if(l.SetUp==="1"){if(!("FEN"in l))throw new Error("Invalid PGN: FEN tag must be supplied with SetUp tag");this.load(l.FEN,{preserveHeaders:!0})}let h=o.root;for(;h;){if(h.move){const p=this._moveFromSan(h.move,t);if(p==null)throw new Error(`Invalid move in PGN: ${h.move}`);this._makeMove(p),this._incPositionCount()}h.comment!==void 0&&(this._comments[this.fen()]=h.comment),h=h.variations[0]}const f=o.result;
4306f&&Object.keys(this._header).length&&this._header.Result!==f&&this.setHeader("Result",f)}_moveToSan(e,t){let s="";if(e.flags&Pt.KSIDE_CASTLE)s="O-O";else if(e.flags&Pt.QSIDE_CASTLE)s="O-O-O";else{if(e.flags&Pt.NULL_MOVE)return uy;if(e.piece!==er){const o=R7(e,t);s+=e.piece.toUpperCase()+o}e.flags&(Pt.CAPTURE|Pt.EP_CAPTURE)&&(e.piece===er&&(s+=yr(e.from)[0]),s+="x"),s+=yr(e.to),e.promotion&&(s+="="+e.promotion.toUpperCase())}return this._makeMove(e),this.isCheck()&&(this.isCheckmate()?s+="#":s+="+"),this._undoMove(),s}_moveFromSan(e,t=!1){let s=dy(e);if(t||(s==="0-0"?s="O-O":s==="0-0-0"&&(s="O-O-O")),s==uy)return{color:this._turn,from:0,to:0,piece:"k",flags:Pt.NULL_MOVE};let o=$5(s),l=this._moves({legal:!0,piece:o});for(let C=0,N=l.length;C<N;C++)if(s===dy(this._moveToSan(l[C],l)))return l[C];if(t)return null;let u,h,f,p,x,b=!1;if(h=s.match(/([pnbrqkPNBRQK])?([a-h][1-8])x?-?([a-h][1-8])([qrbnQRBN])?/),h?(u=h[1],f=h[2],p=h[3],x=h[4],f.length==1&&(b=!0)):(h=s.match(/([pnbrqkPNBRQK])?([a-h]?[1-8]?)x?-?([a-h][1-8])([qrbnQRBN])?/),h&&(u=h[1],f=h[2],p=h[3],x=h[4],f.length==1&&(b=!0))),o=$5(s),l=this._moves({legal:!0,piece:u||o}),!p)return null;for(let C=0,N=l.length;C<N;C++)if(f){if((!u||u.toLowerCase()==l[C].piece)&&kt[f]==l[C].from&&kt[p]==l[C].to&&(!x||x.toLowerCase()==l[C].promotion))return l[C];if(b){const T=yr(l[C].from);if((!u||u.toLowerCase()==l[C].piece)&&kt[p]==l[C].to&&(f==T[0]||f==T[1])&&(!x||x.toLowerCase()==l[C].promotion))return l[C]}}else if(s===dy(this._moveToSan(l[C],l)).replace("x",""))return l[C];return null}ascii(){let e=` +------------------------+ 4307`;for(let t=kt.a8;t<=kt.h1;t++){if(Ym(t)===0&&(e+=" "+"87654321"[Ou(t)]+" |"),this._board[t]){const s=this._board[t].type,l=this._board[t].color===Hr?s.toUpperCase():s.toLowerCase();e+=" "+l+" "}else e+=" . ";t+1&136&&(e+=`| 4308`,t+=8)}return e+=` +------------------------+ 4309`,e+=" a b c d e f g h",e}perft(e){const t=this._moves({legal:!1});let s=0;const o=this._turn;for(let l=0,u=t.length;l<u;l++)this._makeMove(t[l]),this._isKingAttacked(o)||(e-1>0?s+=this.perft(e-1):s++),this._undoMove();return s}setTurn(e){return this._turn==e?!1:(this.move("--"),!0)}turn(){return this._turn}board(){const e=[];let t=[];for(let s=kt.a8;s<=kt.h1;s++)this._board[s]==null?t.push(null):t.push({square:yr(s),type:this._board[s].type,color:this._board[s].color}),s+1&136&&(e.push(t),t=[],s+=8);return e}squareColor(e){if(e in kt){const t=kt[e];return(Ou(t)+Ym(t))%2===0?"light":"dark"}return null}history({verbose:e=!1}={}){const t=[],s=[];for(;this._history.length>0;)t.push(this._undoMove());for(;;){const o=t.pop();if(!o)break;e?s.push(new uB(this,o)):s.push(this._moveToSan(o,this._moves())),this._makeMove(o)}return s}_getPositionCount(e){return this._positionCount.get(e)??0}_incPositionCount(){this._positionCount.set(this._hash,(this._positionCount.get(this._hash)??0)+1)}_decPositionCount(e){const t=this._positionCount.get(e)??0;t===1?this._positionCount.delete(e):this._positionCount.set(e,t-1)}_pruneComments(){const e=[],t={},s=o=>{o in this._comments&&(t[o]=this._comments[o])};for(;this._history.length>0;)e.push(this._undoMove());for(s(this.fen());;){const o=e.pop();if(!o)break;this._makeMove(o),s(this.fen())}this._comments=t}getComment(){return this._comments[this.fen()]}setComment(e){this._comments[this.fen()]=e.replace("{","[").replace("}","]")}deleteComment(){return this.removeComment()}removeComment(){const e=this._comments[this.fen()];return delete this._comments[this.fen()],e}getComments(){return this._pruneComments(),Object.keys(this._comments).map(e=>({fen:e,comment:this._comments[e]}))}deleteComments(){return this.removeComments()}
4309removeComments(){return this._pruneComments(),Object.keys(this._comments).map(e=>{const t=this._comments[e];return delete this._comments[e],{fen:e,comment:t}})}setCastlingRights(e,t){for(const o of[fr,dc])t[o]!==void 0&&(t[o]?this._castling[e]|=dB[o]:this._castling[e]&=~dB[o]);this._updateCastlingRights();const s=this.getCastlingRights(e);return(t[fr]===void 0||t[fr]===s[fr])&&(t[dc]===void 0||t[dc]===s[dc])}getCastlingRights(e){return{[fr]:(this._castling[e]&dB[fr])!==0,[dc]:(this._castling[e]&dB[dc])!==0}}moveNumber(){return this._moveNumber}}var lm=hD();const fx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Gh(n){const e=Object.prototype.toString.call(n);return e==="[object Window]"||e==="[object global]"}function Fv(n){return"nodeType"in n}function mi(n){var e,t;return n?Gh(n)?n:Fv(n)&&(e=(t=n.ownerDocument)==null?void 0:t.defaultView)!=null?e:window:window}function Vv(n){const{Document:e}=mi(n);return n instanceof e}function Cp(n){return Gh(n)?!1:n instanceof mi(n).HTMLElement}function oA(n){return n instanceof mi(n).SVGElement}function Hh(n){return n?Gh(n)?n.document:Fv(n)?Vv(n)?n:Cp(n)||oA(n)?n.ownerDocument:document:document:document}const El=fx?y.useLayoutEffect:y.useEffect;function mx(n){const e=y.useRef(n);return El(()=>{e.current=n}),y.useCallback(function(){for(var t=arguments.length,s=new Array(t),o=0;o<t;o++)s[o]=arguments[o];return e.current==null?void 0:e.current(...s)},[])}function I7(){const n=y.useRef(null),e=y.useCallback((s,o)=>{n.current=setInterval(s,o)},[]),t=y.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[e,t]}function Xm(n,e){e===void 0&&(e=[n]);const t=y.useRef(n);return El(()=>{t.current!==n&&(t.current=n)},e),t}function yp(n,e){const t=y.useRef();return y.useMemo(()=>{const s=n(t.current);return t.current=s,s},[...e])}function yg(n){const e=mx(n),t=y.useRef(null),s=y.useCallback(o=>{o!==t.current&&(e==null||e(o,t.current)),t.current=o},[]);return[t,s]}function vg(n){const e=y.useRef();return y.useEffect(()=>{e.current=n},[n]),e.current}let hy={};function px(n,e){return y.useMemo(()=>{if(e)return e;const t=hy[n]==null?0:hy[n]+1;return hy[n]=t,n+"-"+t},[n,e])}function lA(n){return function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),o=1;o<t;o++)s[o-1]=arguments[o];return s.reduce((l,u)=>{const h=Object.entries(u);for(const[f,p]of h){const x=l[f];x!=null&&(l[f]=x+n*p)}return l},{...e})}}const dh=lA(1),_g=lA(-1);function O7(n){return"clientX"in n&&"clientY"in n}function Uv(n){if(!n)return!1;const{KeyboardEvent:e}=mi(n.target);return e&&n instanceof e}function L7(n){if(!n)return!1;const{TouchEvent:e}=mi(n.target);return e&&n instanceof e}function Wm(n){if(L7(n)){if(n.touches&&n.touches.length){const{clientX:e,clientY:t}=n.touches[0];return{x:e,y:t}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:e,clientY:t}=n.changedTouches[0];return{x:e,y:t}}}return O7(n)?{x:n.clientX,y:n.clientY}:null}const Zm=Object.freeze({Translate:{toString(n){if(!n)return;const{x:e,y:t}=n;return"translate3d("+(e?Math.round(e):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:e,scaleY:t}=n;return"scaleX("+e+") scaleY("+t+")"}},Transform:{toString(n){if(n)return[Zm.Translate.toString(n),Zm.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:e,duration:t,easing:s}=n;return e+" "+t+"ms "+s}}}),J5="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function M7(n){return n.matches(J5)?n:n.querySelector(J5)}const P7={display:"none"};function z7(n){let{id:e,value:t}=n;return As.createElement("div",{id:e,style:P7},t)}function F7(n){let{id:e,announcement:t,ariaLiveType:s="assertive"}=n;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return As.createElement("div",{id:e,style:o,role:"status","aria-live":s,"aria-atomic":!0},t)}function V7(){const[n,e]=y.useState("");return{announce:y.useCallback(s=>{s!=null&&e(s)},[]),announcement:n}}const cA=y.createContext(null);function U7(n){const e=y.useContext(cA);y.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of <DndContext>");return e(n)},[n,e])}function G7(){const[n]=y.useState(()=>new Set),e=y.useCallback(s=>(n.add(s),()=>n.delete(s)),[n]);return[y.useCallback(s=>{let{type:o,event:l}=s;
4309n.forEach(u=>{var h;return(h=u[o])==null?void 0:h.call(u,l)})},[n]),e]}const H7={draggable:` 4310 To pick up a draggable item, press the space bar. 4311 While dragging, use the arrow keys to move the item. 4312 Press space again to drop the item in its new position, or press escape to cancel. 4313 `},q7={onDragStart(n){let{active:e}=n;return"Picked up draggable item "+e.id+"."},onDragOver(n){let{active:e,over:t}=n;return t?"Draggable item "+e.id+" was moved over droppable area "+t.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(n){let{active:e,over:t}=n;return t?"Draggable item "+e.id+" was dropped over droppable area "+t.id:"Draggable item "+e.id+" was dropped."},onDragCancel(n){let{active:e}=n;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function $7(n){let{announcements:e=q7,container:t,hiddenTextDescribedById:s,screenReaderInstructions:o=H7}=n;const{announce:l,announcement:u}=V7(),h=px("DndLiveRegion"),[f,p]=y.useState(!1);if(y.useEffect(()=>{p(!0)},[]),U7(y.useMemo(()=>({onDragStart(b){let{active:C}=b;l(e.onDragStart({active:C}))},onDragMove(b){let{active:C,over:N}=b;e.onDragMove&&l(e.onDragMove({active:C,over:N}))},onDragOver(b){let{active:C,over:N}=b;l(e.onDragOver({active:C,over:N}))},onDragEnd(b){let{active:C,over:N}=b;l(e.onDragEnd({active:C,over:N}))},onDragCancel(b){let{active:C,over:N}=b;l(e.onDragCancel({active:C,over:N}))}}),[l,e])),!f)return null;const x=As.createElement(As.Fragment,null,As.createElement(z7,{id:s,value:o.draggable}),As.createElement(F7,{id:h,announcement:u}));return t?lm.createPortal(x,t):x}var mr;(function(n){n.DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable"})(mr||(mr={}));function wg(){}function hB(n,e){return y.useMemo(()=>({sensor:n,options:e??{}}),[n,e])}function J7(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return y.useMemo(()=>[...e].filter(s=>s!=null),[...e])}const Ga=Object.freeze({x:0,y:0});function K7(n,e){return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))}function Q7(n,e){const t=Wm(n);if(!t)return"0 0";const s={x:(t.x-e.left)/e.width*100,y:(t.y-e.top)/e.height*100};return s.x+"% "+s.y+"%"}function Y7(n,e){let{data:{value:t}}=n,{data:{value:s}}=e;return t-s}function X7(n,e){let{data:{value:t}}=n,{data:{value:s}}=e;return s-t}function W7(n){let{left:e,top:t,height:s,width:o}=n;return[{x:e,y:t},{x:e+o,y:t},{x:e,y:t+s},{x:e+o,y:t+s}]}function Z7(n,e){if(!n||n.length===0)return null;const[t]=n;return t[e]}function eG(n,e){const t=Math.max(e.top,n.top),s=Math.max(e.left,n.left),o=Math.min(e.left+e.width,n.left+n.width),l=Math.min(e.top+e.height,n.top+n.height),u=o-s,h=l-t;if(s<o&&t<l){const f=e.width*e.height,p=n.width*n.height,x=u*h,b=x/(f+p-x);return Number(b.toFixed(4))}return 0}const uA=n=>{let{collisionRect:e,droppableRects:t,droppableContainers:s}=n;const o=[];for(const l of s){const{id:u}=l,h=t.get(u);if(h){const f=eG(h,e);f>0&&o.push({id:u,data:{droppableContainer:l,value:f}})}}return o.sort(X7)};function tG(n,e){const{top:t,left:s,bottom:o,right:l}=e;return t<=n.y&&n.y<=o&&s<=n.x&&n.x<=l}const nG=n=>{let{droppableContainers:e,droppableRects:t,pointerCoordinates:s}=n;if(!s)return[];const o=[];for(const l of e){const{id:u}=l,h=t.get(u);if(h&&tG(s,h)){const p=W7(h).reduce((b,C)=>b+K7(s,C),0),x=Number((p/4).toFixed(4));o.push({id:u,data:{droppableContainer:l,value:x}})}}return o.sort(Y7)};function sG(n,e,t){return{...n,scaleX:e&&t?e.width/t.width:1,scaleY:e&&t?e.height/t.height:1}}function dA(n,e){return n&&e?{x:n.left-e.left,y:n.top-e.top}:Ga}function rG(n){return function(t){for(var s=arguments.length,o=new Array(s>1?s-1:0),l=1;l<s;l++)o[l-1]=arguments[l];return o.reduce((u,h)=>({...u,top:u.top+n*h.y,bottom:u.bottom+n*h.y,left:u.left+n*h.x,right:u.right+n*h.x}),{...t})}}const iG=rG(1);function hA(n){if(n.startsWith("matrix3d(")){const e=n.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(n.startsWith("matrix(")){const e=n.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function aG(n,e,t){const s=hA(e);if(!s)return n;const{scaleX:o,scaleY:l,x:u,y:h}=s,f=n.left-u-(1-o)*parseFloat(t),p=n.top-h-(1-l)*parseFloat(t.slice(t.indexOf(" ")+1)),x=o?n.width/o:n.width,b=l?n.height/l:n.height;return{width:x,height:b,top:p,right:f+x,bottom:p+b,left:f}}const oG={ignoreTransform:!1};function vp(n,e){e===void 0&&(e=oG);let t=n.getBoundingClientRect();if(e.ignoreTransform){const{transform:p,transformOrigin:x}=mi(n).getComputedStyle(n);p&&(t=aG(t,p,x))}const{top:s,left:o,width:l,height:u,bottom:h,right:f}=t;return{top:s,left:o,width:l,height:u,bottom:h,right:f}}function K5(n){return vp(n,{ignoreTransform:!0})}function lG(n){const e=n.innerWidth,t=n.innerHeight;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}function cG(n,e){return e===void 0&&(e=mi(n).getComputedStyle(n)),e.position==="fixed"}function uG(n,e){e===void 0&&(e=mi(n).getComputedStyle(n));const t=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const l=e[o];return typeof l=="string"?t.test(l):!1})}function Gv(n,e){const t=[];function s(o){if(e!=null&&t.length>=e||!o)return t;if(Vv(o)&&o.scrollingElement!=null&&!t.includes(o.scrollingElement))return t.push(o.scrollingElement),t;if(!Cp(o)||oA(o)||t.includes(o))return t;const l=mi(n).getComputedStyle(o);return o!==n&&uG(o,l)&&t.push(o),cG(o,l)?t:s(o.parentNode)}return n?s(n):t}function fA(n){const[e]=Gv(n,1);return e??null}function fy(n){return!fx||!n?null:Gh(n)?n:Fv(n)?Vv(n)||n===Hh(n).scrollingElement?window:Cp(n)?n:null:null}function mA(n){return Gh(n)?n.scrollX:n.scrollLeft}function pA(n){return Gh(n)?n.scrollY:n.scrollTop}function h1(n){return{x:mA(n),y:pA(n)}}var wr;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(wr||(wr={}));function BA(n){return!fx||!n?!1:n===document.scrollingElement}function gA(n){const e={x:0,y:0},t=BA(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},s={x:n.scrollWidth-t.width,y:n.scrollHeight-t.height},o=n.scrollTop<=e.y,l=n.scrollLeft<=e.x,u=n.scrollTop>=s.y,h=n.scrollLeft>=s.x;return{isTop:o,isLeft:l,isBottom:u,isRight:h,maxScroll:s,minScroll:e}}const dG={x:.2,y:.2};function hG(n,e,t,s,o){let{top:l,left:u,right:h,bottom:f}=t;s===void 0&&(s=10),o===void 0&&(o=dG);const{isTop:p,isBottom:x,isLeft:b,isRight:C}=gA(n),N={x:0,y:0},T={x:0,y:0},R={height:e.height*o.y,width:e.width*o.x};return!p&&l<=e.top+R.height?(N.y=wr.Backward,T.y=s*Math.abs((e.top+R.height-l)/R.height)):!x&&f>=e.bottom-R.height&&(N.y=wr.Forward,T.y=s*Math.abs((e.bottom-R.height-f)/R.height)),!C&&h>=e.right-R.width?(N.x=wr.Forward,T.x=s*Math.abs((e.right-R.width-h)/R.width)):!b&&u<=e.left+R.width&&(N.x=wr.Backward,T.x=s*Math.abs((e.left+R.width-u)/R.width)),{direction:N,speed:T}}function fG(n){if(n===document.scrollingElement){const{innerWidth:l,innerHe
4313ight:u}=window;return{top:0,left:0,right:l,bottom:u,width:l,height:u}}const{top:e,left:t,right:s,bottom:o}=n.getBoundingClientRect();return{top:e,left:t,right:s,bottom:o,width:n.clientWidth,height:n.clientHeight}}function xA(n){return n.reduce((e,t)=>dh(e,h1(t)),Ga)}function mG(n){return n.reduce((e,t)=>e+mA(t),0)}function pG(n){return n.reduce((e,t)=>e+pA(t),0)}function bA(n,e){if(e===void 0&&(e=vp),!n)return;const{top:t,left:s,bottom:o,right:l}=e(n);fA(n)&&(o<=0||l<=0||t>=window.innerHeight||s>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const BG=[["x",["left","right"],mG],["y",["top","bottom"],pG]];class Hv{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const s=Gv(t),o=xA(s);this.rect={...e},this.width=e.width,this.height=e.height;for(const[l,u,h]of BG)for(const f of u)Object.defineProperty(this,f,{get:()=>{const p=h(s),x=o[l]-p;return this.rect[f]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Em{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(t=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...t)})},this.target=e}add(e,t,s){var o;(o=this.target)==null||o.addEventListener(e,t,s),this.listeners.push([e,t,s])}}function gG(n){const{EventTarget:e}=mi(n);return n instanceof e?n:Hh(n)}function my(n,e){const t=Math.abs(n.x),s=Math.abs(n.y);return typeof e=="number"?Math.sqrt(t**2+s**2)>e:"x"in e&&"y"in e?t>e.x&&s>e.y:"x"in e?t>e.x:"y"in e?s>e.y:!1}var ya;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(ya||(ya={}));function Q5(n){n.preventDefault()}function xG(n){n.stopPropagation()}var is;(function(n){n.Space="Space",n.Down="ArrowDown",n.Right="ArrowRight",n.Left="ArrowLeft",n.Up="ArrowUp",n.Esc="Escape",n.Enter="Enter",n.Tab="Tab"})(is||(is={}));const CA={start:[is.Space,is.Enter],cancel:[is.Esc],end:[is.Space,is.Enter,is.Tab]},bG=(n,e)=>{let{currentCoordinates:t}=e;switch(n.code){case is.Right:return{...t,x:t.x+25};case is.Left:return{...t,x:t.x-25};case is.Down:return{...t,y:t.y+25};case is.Up:return{...t,y:t.y-25}}};class qv{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new Em(Hh(t)),this.windowListeners=new Em(mi(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ya.Resize,this.handleCancel),this.windowListeners.add(ya.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ya.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:t}=this.props,s=e.node.current;s&&bA(s),t(Ga)}handleKeyDown(e){if(Uv(e)){const{active:t,context:s,options:o}=this.props,{keyboardCodes:l=CA,coordinateGetter:u=bG,scrollBehavior:h="smooth"}=o,{code:f}=e;if(l.end.includes(f)){this.handleEnd(e);return}if(l.cancel.includes(f)){this.handleCancel(e);return}const{collisionRect:p}=s.current,x=p?{x:p.left,y:p.top}:Ga;this.referenceCoordinates||(this.referenceCoordinates=x);const b=u(e,{active:t,context:s.current,currentCoordinates:x});if(b){const C=_g(b,x),N={x:0,y:0},{scrollableAncestors:T}=s.current;for(const R of T){const A=e.code,{isTop:U,isRight:M,isLeft:V,isBottom:H,maxScroll:Q,minScroll:Y}=gA(R),k=fG(R),E={x:Math.min(A===is.Right?k.right-k.width/2:k.right,Math.max(A===is.Right?k.left:k.left+k.width/2,b.x)),y:Math.min(A===is.Down?k.bottom-k.height/2:k.bottom,Math.max(A===is.Down?k.top:k.top+k.height/2,b.y))},j=A===is.Right&&!M||A===is.Left&&!V,P=A===is.Down&&!H||A===is.Up&&!U;if(j&&E.x!==b.x){const O=R.scrollLeft+C.x,F=A===is.Right&&O<=Q.x||A===is.Left&&O>=Y.x;if(F&&!C.y){R.scrollTo({left:O,behavior:h});return}F?N.x=R.scrollLeft-O:N.x=A===is.Right?R.scrollLeft-Q.x:R.scrollLeft-Y.x,N.x&&R.scrollBy({left:-N.x,behavior:h});break}else if(P&&E.y!==b.y){const O=R.scrollTop+C.y,F=A===is.Down&&O<=Q.y||A===is.Up&&O>=Y.y;if(F&&!C.x){R.scrollTo({top:O,behavior:h});return}F?N.y=R.scrollTop-O:N.y=A===is.Down?R.scrollTop-Q.y:R.scrollTop-Y.y,N.y&&R.scrollBy({top:-N.y,behavior:h});break}}this.handleMove(e,dh(_g(b,this.referenceCoordinates),N))}}}handleMove(e,t){const{onMove:s}=this.props;e.preventDefault(),s(t)}handleEnd(e){const{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){const{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}qv.activators=[{eventName:"onKeyDown",handler:(n,e,t)=>{let{keyboardCodes:s=CA,onActivation:o}=e,{active:l}=t;const{code:u}=n.nativeEvent;if(s.start.includes(u)){const h=l.activatorNode.current;return h&&n.target!==h?!1:(n.preventDefault(),o==null||o({event:n.nativeEvent}),!0)}return!1}}];function Y5(n){return!!(n&&"distance"in n)}function X5(n){return!!(n&&"delay"in n)}class $v{constructor(e,t,s){var o;s===void 0&&(s=gG(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:l}=e,{target:u}=l;this.props=e,this.events=t,this.document=Hh(u),this.documentListeners=new Em(this.document),this.listeners=new Em(s),this.windowListeners=new Em(mi(u)),this.initialCoordinates=(o=Wm(l))!=null?o:Ga,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:s}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(ya.Resize,this.handleCancel),this.windowListeners.add(ya.DragStart,Q5),this.windowListeners.add(ya.VisibilityChange,this.handleCancel),this.windowListeners.add(ya.ContextMenu,Q5),this.documentListeners.add(ya.Keydown,this.handleKeydown),t){if(s!=null&&s({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(X5(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Y5(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const{active:s,onPending:o}=this.props;o(s,e,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(ya.Click,xG,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ya.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const{activated:s,initialCoordinates:o,props:l}=this,{onMove:u,options:{activationConstraint:h}}=l;if(!o)return;const f=(t=Wm(e))!=null?t:Ga,p=_g(o,f);if(!s&&h){if(Y5(h)){if(h.tolerance!=null&&my(p,h.tolerance))return this.handleCancel();if(my(p,h.distance))return this.handleStart()}if(X5(h)&&my(p,h.tolerance))return this.handleCancel();this.handlePending(h,p);return}e.cancelable&&e.preventDefault(),u(f)}handleEnd(){const{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){const{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===is.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const CG={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Jv extends $v{constructor(e){const{event:t}=e,s=Hh(t.target);super(e,CG,s)}}Jv.activators=[{eventName:"onPointerDown",handler:(n,e)=>{let{nativeEvent:t}=n,{onActivation:s}=e;return!t.isPrimary||t.button!==0?!1:(s==null||s({event:t}),!0)}}];const yG={move:{name:"mousemove"},end:{name:"mouseup"}};var f1;(function(n){n[n.RightClick=2]="RightClick"})(f1||(f1={}));class yA extends $v{constructor(e){super(e,yG,Hh(e.event.target))}}yA.activators=[{eventName:"onMouseDown",handler:(n,e)=>{let{nativeEvent:t}=n,{onActivation:s}=e;return t.button===f1.RightClick?!1:(s==null||s({event:t}),!0)}}];const py={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class vA extends $v{constructor(e){super(e,py)}static setup(){return window.addEventListener(py.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(py.move.name,e)};function e(){}}}vA.activators=[{eventName:"onTouchStart",handler:(n,e)=>{let{nativeEvent:t}=n,{onActivation:s}=e;const{touches:o}=t;return o.length>1?!1:(s==null||s({event:t}),!0)}}];var Nm;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(Nm||(Nm={}));var Eg;
4313(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(Eg||(Eg={}));function vG(n){let{acceleration:e,activator:t=Nm.Pointer,canScroll:s,draggingRect:o,enabled:l,interval:u=5,order:h=Eg.TreeOrder,pointerCoordinates:f,scrollableAncestors:p,scrollableAncestorRects:x,delta:b,threshold:C}=n;const N=wG({delta:b,disabled:!l}),[T,R]=I7(),A=y.useRef({x:0,y:0}),U=y.useRef({x:0,y:0}),M=y.useMemo(()=>{switch(t){case Nm.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Nm.DraggableRect:return o}},[t,o,f]),V=y.useRef(null),H=y.useCallback(()=>{const Y=V.current;if(!Y)return;const k=A.current.x*U.current.x,E=A.current.y*U.current.y;Y.scrollBy(k,E)},[]),Q=y.useMemo(()=>h===Eg.TreeOrder?[...p].reverse():p,[h,p]);y.useEffect(()=>{if(!l||!p.length||!M){R();return}for(const Y of Q){if((s==null?void 0:s(Y))===!1)continue;const k=p.indexOf(Y),E=x[k];if(!E)continue;const{direction:j,speed:P}=hG(Y,E,M,e,C);for(const O of["x","y"])N[O][j[O]]||(P[O]=0,j[O]=0);if(P.x>0||P.y>0){R(),V.current=Y,T(H,u),A.current=P,U.current=j;return}}A.current={x:0,y:0},U.current={x:0,y:0},R()},[e,H,s,R,l,u,JSON.stringify(M),JSON.stringify(N),T,p,Q,x,JSON.stringify(C)])}const _G={x:{[wr.Backward]:!1,[wr.Forward]:!1},y:{[wr.Backward]:!1,[wr.Forward]:!1}};function wG(n){let{delta:e,disabled:t}=n;const s=vg(e);return yp(o=>{if(t||!s||!o)return _G;const l={x:Math.sign(e.x-s.x),y:Math.sign(e.y-s.y)};return{x:{[wr.Backward]:o.x[wr.Backward]||l.x===-1,[wr.Forward]:o.x[wr.Forward]||l.x===1},y:{[wr.Backward]:o.y[wr.Backward]||l.y===-1,[wr.Forward]:o.y[wr.Forward]||l.y===1}}},[t,e,s])}function EG(n,e){const t=e!=null?n.get(e):void 0,s=t?t.node.current:null;return yp(o=>{var l;return e==null?null:(l=s??o)!=null?l:null},[s,e])}function NG(n,e){return y.useMemo(()=>n.reduce((t,s)=>{const{sensor:o}=s,l=o.activators.map(u=>({eventName:u.eventName,handler:e(u.handler,s)}));return[...t,...l]},[]),[n,e])}var ep;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(ep||(ep={}));var m1;(function(n){n.Optimized="optimized"})(m1||(m1={}));const W5=new Map;function DG(n,e){let{dragging:t,dependencies:s,config:o}=e;const[l,u]=y.useState(null),{frequency:h,measure:f,strategy:p}=o,x=y.useRef(n),b=A(),C=Xm(b),N=y.useCallback(function(U){U===void 0&&(U=[]),!C.current&&u(M=>M===null?U:M.concat(U.filter(V=>!M.includes(V))))},[C]),T=y.useRef(null),R=yp(U=>{if(b&&!t)return W5;if(!U||U===W5||x.current!==n||l!=null){const M=new Map;for(let V of n){if(!V)continue;if(l&&l.length>0&&!l.includes(V.id)&&V.rect.current){M.set(V.id,V.rect.current);continue}const H=V.node.current,Q=H?new Hv(f(H),H):null;V.rect.current=Q,Q&&M.set(V.id,Q)}return M}return U},[n,l,t,b,f]);return y.useEffect(()=>{x.current=n},[n]),y.useEffect(()=>{b||N()},[t,b]),y.useEffect(()=>{l&&l.length>0&&u(null)},[JSON.stringify(l)]),y.useEffect(()=>{b||typeof h!="number"||T.current!==null||(T.current=setTimeout(()=>{N(),T.current=null},h))},[h,b,N,...s]),{droppableRects:R,measureDroppableContainers:N,measuringScheduled:l!=null};function A(){switch(p){case ep.Always:return!1;case ep.BeforeDragging:return t;default:return!t}}}function Kv(n,e){return yp(t=>n?t||(typeof e=="function"?e(n):n):null,[e,n])}function TG(n,e){return Kv(n,e)}function SG(n){let{callback:e,disabled:t}=n;const s=mx(e),o=y.useMemo(()=>{if(t||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(s)},[s,t]);return y.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Bx(n){let{callback:e,disabled:t}=n;const s=mx(e),o=y.useMemo(()=>{if(t||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(s)},[t]);return y.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function jG(n){return new Hv(vp(n),n)}function Z5(n,e,t){e===void 0&&(e=jG);const[s,o]=y.useState(null);function l(){o(f=>{if(!n)return null;if(n.isConnected===!1){var p;return(p=f??t)!=null?p:null}const x=e(n);return JSON.stringify(f)===JSON.stringify(x)?f:x})}const u=SG({callback(f){if(n)for(const p of f){const{type:x,target:b}=p;if(x==="childList"&&b instanceof HTMLElement&&b.contains(n)){l();break}}}}),h=Bx({callback:l});return El(()=>{l(),n?(h==null||h.observe(n),u==null||u.observe(document.body,{childList:!0,subtree:!0})):(h==null||h.disconnect(),u==null||u.disconnect())},[n]),s}function AG(n){const e=Kv(n);return dA(n,e)}const eD=[];function kG(n){const e=y.useRef(n),t=yp(s=>n?s&&s!==eD&&n&&e.current&&n.parentNode===e.current.parentNode?s:Gv(n):eD,[n]);return y.useEffect(()=>{e.current=n},[n]),t}function RG(n){const[e,t]=y.useState(null),s=y.useRef(n),o=y.useCallback(l=>{const u=fy(l.target);u&&t(h=>h?(h.set(u,h1(u)),new Map(h)):null)},[]);return y.useEffect(()=>{const l=s.current;if(n!==l){u(l);const h=n.map(f=>{const p=fy(f);return p?(p.addEventListener("scroll",o,{passive:!0}
4313),[p,h1(p)]):null}).filter(f=>f!=null);t(h.length?new Map(h):null),s.current=n}return()=>{u(n),u(l)};function u(h){h.forEach(f=>{const p=fy(f);p==null||p.removeEventListener("scroll",o)})}},[o,n]),y.useMemo(()=>n.length?e?Array.from(e.values()).reduce((l,u)=>dh(l,u),Ga):xA(n):Ga,[n,e])}function tD(n,e){e===void 0&&(e=[]);const t=y.useRef(null);return y.useEffect(()=>{t.current=null},e),y.useEffect(()=>{const s=n!==Ga;s&&!t.current&&(t.current=n),!s&&t.current&&(t.current=null)},[n]),t.current?_g(n,t.current):Ga}function IG(n){y.useEffect(()=>{if(!fx)return;const e=n.map(t=>{let{sensor:s}=t;return s.setup==null?void 0:s.setup()});return()=>{for(const t of e)t==null||t()}},n.map(e=>{let{sensor:t}=e;return t}))}function OG(n,e){return y.useMemo(()=>n.reduce((t,s)=>{let{eventName:o,handler:l}=s;return t[o]=u=>{l(u,e)},t},{}),[n,e])}function _A(n){return y.useMemo(()=>n?lG(n):null,[n])}const nD=[];function LG(n,e){e===void 0&&(e=vp);const[t]=n,s=_A(t?mi(t):null),[o,l]=y.useState(nD);function u(){l(()=>n.length?n.map(f=>BA(f)?s:new Hv(e(f),f)):nD)}const h=Bx({callback:u});return El(()=>{h==null||h.disconnect(),u(),n.forEach(f=>h==null?void 0:h.observe(f))},[n]),o}function wA(n){if(!n)return null;if(n.children.length>1)return n;const e=n.children[0];return Cp(e)?e:n}function MG(n){let{measure:e}=n;const[t,s]=y.useState(null),o=y.useCallback(p=>{for(const{target:x}of p)if(Cp(x)){s(b=>{const C=e(x);return b?{...b,width:C.width,height:C.height}:C});break}},[e]),l=Bx({callback:o}),u=y.useCallback(p=>{const x=wA(p);l==null||l.disconnect(),x&&(l==null||l.observe(x)),s(x?e(x):null)},[e,l]),[h,f]=yg(u);return y.useMemo(()=>({nodeRef:h,rect:t,setRef:f}),[t,h,f])}const PG=[{sensor:Jv,options:{}},{sensor:qv,options:{}}],zG={current:{}},FB={draggable:{measure:K5},droppable:{measure:K5,strategy:ep.WhileDragging,frequency:m1.Optimized},dragOverlay:{measure:vp}};class Dm extends Map{get(e){var t;return e!=null&&(t=super.get(e))!=null?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,s;return(t=(s=this.get(e))==null?void 0:s.node.current)!=null?t:void 0}}const FG={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Dm,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:wg},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:FB,measureDroppableContainers:wg,windowRect:null,measuringScheduled:!1},EA={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:wg,draggableNodes:new Map,over:null,measureDroppableContainers:wg},_p=y.createContext(EA),NA=y.createContext(FG);function VG(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Dm}}}function UG(n,e){switch(e.type){case mr.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case mr.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:e.coordinates.x-n.draggable.initialCoordinates.x,y:e.coordinates.y-n.draggable.initialCoordinates.y}}};case mr.DragEnd:case mr.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case mr.RegisterDroppable:{const{element:t}=e,{id:s}=t,o=new Dm(n.droppable.containers);return o.set(s,t),{...n,droppable:{...n.droppable,containers:o}}}case mr.SetDroppableDisabled:{const{id:t,key:s,disabled:o}=e,l=n.droppable.containers.get(t);if(!l||s!==l.key)return n;const u=new Dm(n.droppable.containers);return u.set(t,{...l,disabled:o}),{...n,droppable:{...n.droppable,containers:u}}}case mr.UnregisterDroppable:{const{id:t,key:s}=e,o=n.droppable.containers.get(t);if(!o||s!==o.key)return n;const l=new Dm(n.droppable.containers);return l.delete(t),{...n,droppable:{...n.droppable,containers:l}}}default:return n}}function GG(n){let{disabled:e}=n;const{active:t,activatorEvent:s,draggableNodes:o}=y.useContext(_p),l=vg(s),u=vg(t==null?void 0:t.id);return y.useEffect(()=>{if(!e&&!s&&l&&u!=null){if(!Uv(l)||document.activeElement===l.target)return;const h=o.get(u);if(!h)return;const{activatorNode:f,node:p}=h;if(!f.current&&!p.current)return;requestAnimationFrame(()=>{for(const x of[f.current,p.current]){if(!x)continue;const b=M7(x);if(b){b.focus();break}}})}},[s,e,o,u,l]),null}function DA(n,e){let{transform:t,...s}=e;return n!=null&&n.length?n.reduce((o,l)=>l({transform:o,...s}),t):t}function HG(n){return y.useMemo(()=>({draggable:{...FB.draggable,...n==null?void 0:n.draggable},droppable:{...FB.droppable,...n==null?void 0:n.droppable},dragOverlay:{...FB.dragOverlay,...n==null?void 0:n.dragOverlay}}),[n==null?void 0:n.draggable,n==null?void 0:n.droppable,n==null?void 0:n.dragOverlay])}function qG(n){let{activeNode:e,measure:t,initialRect:s,config:o=!0}=n;const l=y.useRef(!1),{x:u,y:h}=typeof o=="boolean"?{x:o,y:o}:o;El(()=>{if(!u&&!h||!e){l.current=!1;return}if(l.current||!s)return;const p=e==null?void 0:e.node.current;
4313if(!p||p.isConnected===!1)return;const x=t(p),b=dA(x,s);if(u||(b.x=0),h||(b.y=0),l.current=!0,Math.abs(b.x)>0||Math.abs(b.y)>0){const C=fA(p);C&&C.scrollBy({top:b.y,left:b.x})}},[e,u,h,s,t])}const gx=y.createContext({...Ga,scaleX:1,scaleY:1});var hc;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(hc||(hc={}));const $G=y.memo(function(e){var t,s,o,l;let{id:u,accessibility:h,autoScroll:f=!0,children:p,sensors:x=PG,collisionDetection:b=uA,measuring:C,modifiers:N,...T}=e;const R=y.useReducer(UG,void 0,VG),[A,U]=R,[M,V]=G7(),[H,Q]=y.useState(hc.Uninitialized),Y=H===hc.Initialized,{draggable:{active:k,nodes:E,translate:j},droppable:{containers:P}}=A,O=k!=null?E.get(k):null,F=y.useRef({initial:null,translated:null}),S=y.useMemo(()=>{var wt;return k!=null?{id:k,data:(wt=O==null?void 0:O.data)!=null?wt:zG,rect:F}:null},[k,O]),be=y.useRef(null),[Ee,me]=y.useState(null),[De,ge]=y.useState(null),Ue=Xm(T,Object.values(T)),we=px("DndDescribedBy",u),$e=y.useMemo(()=>P.getEnabled(),[P]),et=HG(C),{droppableRects:Ae,measureDroppableContainers:K,measuringScheduled:ne}=DG($e,{dragging:Y,dependencies:[j.x,j.y],config:et.droppable}),Pe=EG(E,k),Le=y.useMemo(()=>De?Wm(De):null,[De]),mt=xn(),tt=TG(Pe,et.draggable.measure);qG({activeNode:k!=null?E.get(k):null,config:mt.layoutShiftCompensation,initialRect:tt,measure:et.draggable.measure});const lt=Z5(Pe,et.draggable.measure,tt),Qe=Z5(Pe?Pe.parentElement:null),st=y.useRef({activatorEvent:null,active:null,activeNode:Pe,collisionRect:null,collisions:null,droppableRects:Ae,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Yn=P.getNodeFor((t=st.current.over)==null?void 0:t.id),Rn=MG({measure:et.dragOverlay.measure}),zn=(s=Rn.nodeRef.current)!=null?s:Pe,Zt=Y?(o=Rn.rect)!=null?o:lt:null,en=!!(Rn.nodeRef.current&&Rn.rect),jt=AG(en?null:lt),At=_A(zn?mi(zn):null),Tt=kG(Y?Yn??Pe:null),gn=LG(Tt),Oe=DA(N,{transform:{x:j.x-jt.x,y:j.y-jt.y,scaleX:1,scaleY:1},activatorEvent:De,active:S,activeNodeRect:lt,containerNodeRect:Qe,draggingNodeRect:Zt,over:st.current.over,overlayNodeRect:Rn.rect,scrollableAncestors:Tt,scrollableAncestorRects:gn,windowRect:At}),vt=Le?dh(Le,j):null,Ft=RG(Tt),on=tD(Ft),Zn=tD(Ft,[lt]),Fn=dh(Oe,on),In=Zt?iG(Zt,Oe):null,nn=S&&In?b({active:S,collisionRect:In,droppableRects:Ae,droppableContainers:$e,pointerCoordinates:vt}):null,Ve=Z7(nn,"id"),[Rt,os]=y.useState(null),Hn=en?Oe:dh(Oe,Zn),_t=sG(Hn,(l=Rt==null?void 0:Rt.rect)!=null?l:null,lt),Sn=y.useRef(null),Qt=y.useCallback((wt,rn)=>{let{sensor:jn,options:On}=rn;if(be.current==null)return;const es=E.get(be.current);if(!es)return;const ls=wt.nativeEvent,Vn=new jn({active:be.current,activeNode:es,event:ls,options:On,context:st,onAbort(sn){if(!E.get(sn))return;const{onDragAbort:xs}=Ue.current,He={id:sn};xs==null||xs(He),M({type:"onDragAbort",event:He})},onPending(sn,Ut,xs,He){if(!E.get(sn))return;const{onDragPending:Ot}=Ue.current,Un={id:sn,constraint:Ut,initialCoordinates:xs,offset:He};Ot==null||Ot(Un),M({type:"onDragPending",event:Un})},onStart(sn){const Ut=be.current;if(Ut==null)return;const xs=E.get(Ut);if(!xs)return;const{onDragStart:He}=Ue.current,Us={activatorEvent:ls,active:{id:Ut,data:xs.data,rect:F}};lm.unstable_batchedUpdates(()=>{He==null||He(Us),Q(hc.Initializing),U({type:mr.DragStart,initialCoordinates:sn,active:Ut}),M({type:"onDragStart",event:Us}),me(Sn.current),ge(ls)})},onMove(sn){U({type:mr.DragMove,coordinates:sn})},onEnd:de(mr.DragEnd),onCancel:de(mr.DragCancel)});Sn.current=Vn;function de(sn){return async function(){const{active:xs,collisions:He,over:Us,scrollAdjustedTranslate:Ot}=st.current;let Un=null;if(xs&&Ot){const{cancelDrop:ln}=Ue.current;Un={activatorEvent:ls,active:xs,collisions:He,delta:Ot,over:Us},sn===mr.DragEnd&&typeof ln=="function"&&await Promise.resolve(ln(Un))&&(sn=mr.DragCancel)}be.current=null,lm.unstable_batchedUpdates(()=>{U({type:sn}),Q(hc.Uninitialized),os(null),me(null),ge(null),Sn.current=null;const ln=sn===mr.DragEnd?"onDragEnd":"onDragCancel";if(Un){const An=Ue.current[ln];An==null||An(Un),M({type:ln,event:Un})}})}}},[E]),Vt=y.useCallback((wt,rn)=>(jn,On)=>{const es=jn.nativeEvent,ls=E.get(On);if(be.current!==null||!ls||es.dndKit||es.defaultPrevented)return;const Vn={active:ls};wt(jn,rn.options,Vn)===!0&&(es.dndKit={capturedBy:rn.sensor},be.current=On,Qt(jn,rn))},[E,Qt]),at=NG(x,Vt);IG(x),El(()=>{lt&&H===hc.Initializing&&Q(hc.Initialized)},[lt,H]),y.useEffect(()=>{const{onDragMove:wt}=Ue.current,{active:rn,activatorEvent:jn,collisions:On,over:es}=st.current;if(!rn||!jn)return;const ls={active:rn,activatorEvent:jn,collisions:On,delta:{x:Fn.x,y:Fn.y},over:es};lm.unstable_batchedUpdates(()=>{wt==null||wt(ls),M({type:"onDragMove",event:ls})})},[Fn.x,Fn.y]),y.useEffect(()=>{const{active:wt,activatorEvent:rn,collisions:jn,droppableContainers:On,scrollAdjustedTranslate:es}=st.current;if(!wt||be.current==null||!rn||!es)return;const{onDragOver:ls}=Ue.current,Vn=On.get(Ve),de=Vn&&Vn.rect.current?{id:Vn.id,rect:Vn.rect.current,data:Vn.data,disabled:Vn.disabled}
4313:null,sn={active:wt,activatorEvent:rn,collisions:jn,delta:{x:es.x,y:es.y},over:de};lm.unstable_batchedUpdates(()=>{os(de),ls==null||ls(sn),M({type:"onDragOver",event:sn})})},[Ve]),El(()=>{st.current={activatorEvent:De,active:S,activeNode:Pe,collisionRect:In,collisions:nn,droppableRects:Ae,draggableNodes:E,draggingNode:zn,draggingNodeRect:Zt,droppableContainers:P,over:Rt,scrollableAncestors:Tt,scrollAdjustedTranslate:Fn},F.current={initial:Zt,translated:In}},[S,Pe,nn,In,E,zn,Zt,Ae,P,Rt,Tt,Fn]),vG({...mt,delta:j,draggingRect:In,pointerCoordinates:vt,scrollableAncestors:Tt,scrollableAncestorRects:gn});const Et=y.useMemo(()=>({active:S,activeNode:Pe,activeNodeRect:lt,activatorEvent:De,collisions:nn,containerNodeRect:Qe,dragOverlay:Rn,draggableNodes:E,droppableContainers:P,droppableRects:Ae,over:Rt,measureDroppableContainers:K,scrollableAncestors:Tt,scrollableAncestorRects:gn,measuringConfiguration:et,measuringScheduled:ne,windowRect:At}),[S,Pe,lt,De,nn,Qe,Rn,E,P,Ae,Rt,K,Tt,gn,et,ne,At]),hs=y.useMemo(()=>({activatorEvent:De,activators:at,active:S,activeNodeRect:lt,ariaDescribedById:{draggable:we},dispatch:U,draggableNodes:E,over:Rt,measureDroppableContainers:K}),[De,at,S,lt,U,we,E,Rt,K]);return As.createElement(cA.Provider,{value:V},As.createElement(_p.Provider,{value:hs},As.createElement(NA.Provider,{value:Et},As.createElement(gx.Provider,{value:_t},p)),As.createElement(GG,{disabled:(h==null?void 0:h.restoreFocus)===!1})),As.createElement($7,{...h,hiddenTextDescribedById:we}));function xn(){const wt=(Ee==null?void 0:Ee.autoScrollEnabled)===!1,rn=typeof f=="object"?f.enabled===!1:f===!1,jn=Y&&!wt&&!rn;return typeof f=="object"?{...f,enabled:jn}:{enabled:jn}}}),JG=y.createContext(null),sD="button",KG="Draggable";function QG(n){let{id:e,data:t,disabled:s=!1,attributes:o}=n;const l=px(KG),{activators:u,activatorEvent:h,active:f,activeNodeRect:p,ariaDescribedById:x,draggableNodes:b,over:C}=y.useContext(_p),{role:N=sD,roleDescription:T="draggable",tabIndex:R=0}=o??{},A=(f==null?void 0:f.id)===e,U=y.useContext(A?gx:JG),[M,V]=yg(),[H,Q]=yg(),Y=OG(u,e),k=Xm(t);El(()=>(b.set(e,{id:e,key:l,node:M,activatorNode:H,data:k}),()=>{const j=b.get(e);j&&j.key===l&&b.delete(e)}),[b,e]);const E=y.useMemo(()=>({role:N,tabIndex:R,"aria-disabled":s,"aria-pressed":A&&N===sD?!0:void 0,"aria-roledescription":T,"aria-describedby":x.draggable}),[s,N,R,A,T,x.draggable]);return{active:f,activatorEvent:h,activeNodeRect:p,attributes:E,isDragging:A,listeners:s?void 0:Y,node:M,over:C,setNodeRef:V,setActivatorNodeRef:Q,transform:U}}function YG(){return y.useContext(NA)}const XG="Droppable",WG={timeout:25};function ZG(n){let{data:e,disabled:t=!1,id:s,resizeObserverConfig:o}=n;const l=px(XG),{active:u,dispatch:h,over:f,measureDroppableContainers:p}=y.useContext(_p),x=y.useRef({disabled:t}),b=y.useRef(!1),C=y.useRef(null),N=y.useRef(null),{disabled:T,updateMeasurementsFor:R,timeout:A}={...WG,...o},U=Xm(R??s),M=y.useCallback(()=>{if(!b.current){b.current=!0;return}N.current!=null&&clearTimeout(N.current),N.current=setTimeout(()=>{p(Array.isArray(U.current)?U.current:[U.current]),N.current=null},A)},[A]),V=Bx({callback:M,disabled:T||!u}),H=y.useCallback((E,j)=>{V&&(j&&(V.unobserve(j),b.current=!1),E&&V.observe(E))},[V]),[Q,Y]=yg(H),k=Xm(e);return y.useEffect(()=>{!V||!Q.current||(V.disconnect(),b.current=!1,V.observe(Q.current))},[Q,V]),y.useEffect(()=>(h({type:mr.RegisterDroppable,element:{id:s,key:l,disabled:t,node:Q,rect:C,data:k}}),()=>h({type:mr.UnregisterDroppable,key:l,id:s})),[s]),y.useEffect(()=>{t!==x.current.disabled&&(h({type:mr.SetDroppableDisabled,id:s,key:l,disabled:t}),x.current.disabled=t)},[s,l,t,h]),{active:u,rect:C,isOver:(f==null?void 0:f.id)===s,node:Q,over:f,setNodeRef:Y}}function eH(n){let{animation:e,children:t}=n;const[s,o]=y.useState(null),[l,u]=y.useState(null),h=vg(t);return!t&&!s&&h&&o(h),El(()=>{if(!l)return;const f=s==null?void 0:s.key,p=s==null?void 0:s.props.id;if(f==null||p==null){o(null);return}Promise.resolve(e(p,l)).then(()=>{o(null)})},[e,s,l]),As.createElement(As.Fragment,null,t,s?y.cloneElement(s,{ref:u}):null)}const tH={x:0,y:0,scaleX:1,scaleY:1};function nH(n){let{children:e}=n;return As.createElement(_p.Provider,{value:EA},As.createElement(gx.Provider,{value:tH},e))}const sH={position:"fixed",touchAction:"none"},rH=n=>
4313Uv(n)?"transform 250ms ease":void 0,iH=y.forwardRef((n,e)=>{let{as:t,activatorEvent:s,adjustScale:o,children:l,className:u,rect:h,style:f,transform:p,transition:x=rH}=n;if(!h)return null;const b=o?p:{...p,scaleX:1,scaleY:1},C={...sH,width:h.width,height:h.height,top:h.top,left:h.left,transform:Zm.Transform.toString(b),transformOrigin:o&&s?Q7(s,h):void 0,transition:typeof x=="function"?x(s):x,...f};return As.createElement(t,{className:u,style:C,ref:e},l)}),aH=n=>e=>{let{active:t,dragOverlay:s}=e;const o={},{styles:l,className:u}=n;if(l!=null&&l.active)for(const[h,f]of Object.entries(l.active))f!==void 0&&(o[h]=t.node.style.getPropertyValue(h),t.node.style.setProperty(h,f));if(l!=null&&l.dragOverlay)for(const[h,f]of Object.entries(l.dragOverlay))f!==void 0&&s.node.style.setProperty(h,f);return u!=null&&u.active&&t.node.classList.add(u.active),u!=null&&u.dragOverlay&&s.node.classList.add(u.dragOverlay),function(){for(const[f,p]of Object.entries(o))t.node.style.setProperty(f,p);u!=null&&u.active&&t.node.classList.remove(u.active)}},oH=n=>{let{transform:{initial:e,final:t}}=n;return[{transform:Zm.Transform.toString(e)},{transform:Zm.Transform.toString(t)}]},lH={duration:250,easing:"ease",keyframes:oH,sideEffects:aH({styles:{active:{opacity:"0"}}})};function cH(n){let{config:e,draggableNodes:t,droppableContainers:s,measuringConfiguration:o}=n;return mx((l,u)=>{if(e===null)return;const h=t.get(l);if(!h)return;const f=h.node.current;if(!f)return;const p=wA(u);
4313if(!p)return;const{transform:x}=mi(u).getComputedStyle(u),b=hA(x);if(!b)return;const C=typeof e=="function"?e:uH(e);return bA(f,o.draggable.measure),C({active:{id:l,data:h.data,node:f,rect:o.draggable.measure(f)},draggableNodes:t,dragOverlay:{node:u,rect:o.dragOverlay.measure(p)},droppableContainers:s,measuringConfiguration:o,transform:b})})}function uH(n){const{duration:e,easing:t,sideEffects:s,keyframes:o}={...lH,...n};return l=>{let{active:u,dragOverlay:h,transform:f,...p}=l;if(!e)return;const x={x:h.rect.left-u.rect.left,y:h.rect.top-u.rect.top},b={scaleX:f.scaleX!==1?u.rect.width*f.scaleX/h.rect.width:1,scaleY:f.scaleY!==1?u.rect.height*f.scaleY/h.rect.height:1},C={x:f.x-x.x,y:f.y-x.y,...b},N=o({...p,active:u,dragOverlay:h,transform:{initial:f,final:C}}),[T]=N,R=N[N.length-1];if(JSON.stringify(T)===JSON.stringify(R))return;const A=s==null?void 0:s({active:u,dragOverlay:h,...p}),U=h.node.animate(N,{duration:e,easing:t,fill:"forwards"});return new Promise(M=>{U.onfinish=()=>{A==null||A(),M()}})}}let rD=0;function dH(n){return y.useMemo(()=>{if(n!=null)return rD++,rD},[n])}const hH=As.memo(n=>{let{adjustScale:e=!1,children:t,dropAnimation:s,style:o,transition:l,modifiers:u,wrapperElement:h="div",className:f,zIndex:p=999}=n;const{activatorEvent:x,active:b,activeNodeRect:C,containerNodeRect:N,draggableNodes:T,droppableContainers:R,dragOverlay:A,over:U,measuringConfiguration:M,scrollableAncestors:V,scrollableAncestorRects:H,windowRect:Q}=YG(),Y=y.useContext(gx),k=dH(b==null?void 0:b.id),E=DA(u,{activatorEvent:x,active:b,activeNodeRect:C,containerNodeRect:N,draggingNodeRect:A.rect,over:U,overlayNodeRect:A.rect,scrollableAncestors:V,scrollableAncestorRects:H,transform:Y,windowRect:Q}),j=Kv(C),P=cH({config:s,draggableNodes:T,droppableContainers:R,measuringConfiguration:M}),O=j?A.setRef:void 0;return As.createElement(nH,null,As.createElement(eH,{animation:P},b&&k?As.createElement(iH,{key:k,id:b.id,ref:O,as:h,activatorEvent:x,adjustScale:e,className:f,transition:l,rect:j,style:{zIndex:p,...o},transform:E},t):null))}),fH=n=>{let{activatorEvent:e,draggingNodeRect:t,transform:s}=n;if(t&&e){const o=Wm(e);if(!o)return s;const l=o.x-t.left,u=o.y-t.top;return{...s,x:s.x+l-t.width/2,y:s.y+u-t.height/2}}return s};function mH(n,e,t){const s=Array.from(Array(n),()=>new Array(e));for(let o=0;o<n;o++)for(let l=0;l<e;l++)s[o][l]={squareId:`${Qv(l,e,t)}${TA(o,n,t)}`,isLightSquare:(o+l)%2===0};return s}function TA(n,e,t){return t==="white"?(e-n).toString():(n+1).toString()}function Qv(n,e,t){return t==="white"?String.fromCharCode(97+n):String.fromCharCode(97+e-n-1)}function Du(n,e,t){return t==="white"?n.charCodeAt(0)-97:e-(n.charCodeAt(0)-97)-1}function p1(n,e,t){return t==="white"?e-Number(n):Number(n)-1}function By(n,e,t){const s={},o=n.split(" ")[0].split("/");for(let l=0;l<o.length;l++){let u=0;for(const h of o[l])if(isNaN(Number(h))){const f=`${Qv(u,t,"white")}${TA(l,e,"white")}`;s[f]={pieceType:pH(h)},u++}else u+=Number(h)}return s}function pH(n){return n.toLowerCase()===n?"b"+n.toUpperCase():"w"+n.toUpperCase()}function BH(n,e,t,s){var l,u,h,f,p,x,b,C,N,T,R,A;const o={};for(const U in e){const M=[];if(((l=n[U])==null?void 0:l.pieceType)!==e[U].pieceType){for(const V in n)n[V].pieceType===e[U].pieceType&&V!==U&&n[V].pieceType!==((u=e[V])==null?void 0:u.pieceType)&&M.push(V);if(M.length===1)o[M[0]]=U;else{for(const V of M){const H=n[V].pieceType[1],Q=Math.abs(Du(((h=V.match(/^[a-z]+/))==null?void 0:h[0])??"",t,s)-Du(((f=U.match(/^[a-z]+/))==null?void 0:f[0])??"",t,s)),Y=Math.abs(Number(((p=V.match(/\d+$/))==null?void 0:p[0])??"")-Number(((x=U.match(/\d+$/))==null?void 0:x[0])??"")),k=(Du(((b=V.match(/^[a-z]+/))==null?void 0:b[0])??"",t,s)+Number(((C=V.match(/\d+$/))==null?void 0:C[0])??""))%2===0,E=(Du(((N=U.match(/^[a-z]+/))==null?void 0:N[0])??"",t,s)+Number(((T=U.match(/\d+$/))==null?void 0:T[0])??""))%2===0;if(H==="P"&&((R=V.match(/^[a-z]+/))==null?void 0:R[0])===((A=U.match(/^[a-z]+/))==null?void 0:A[0])){o[V]=U;break}if(H==="N"&&(Q===2&&Y===1||Q===1&&Y===2)){o[V]=U;break}if(H==="B"&&Q===Y&&k===E){o[V]=U;break}if(H==="R"&&(Q===0||Y===0)){o[V]=U;break}if(H==="Q"&&(Q===0||Y===0||Q===Y)){o[V]=U;break}if(H==="K"&&Q<=1&&Y<=1){o[V]=U;break}}if(!Object.values(o).includes(U)&&M.length>0){for(const V of M)if(!Object.keys(o).includes(V)){o[V]=U;break}}}}}return o}function gH(n,e,t,s){var l,u;const o={};for(const h in e)if(((l=n[h])==null?void 0:l.pieceType)!==e[h].pieceType)for(const f in n)((u=e[f])==null?void 0:u.pieceType)!==n[f].pieceType&&xH(n,e,f,h,t,s)&&(o[f]=h);return o}function xH(n,e,t,s,o,l){const u=n[t].pieceType,h=e[s].pieceType,f=new Set(["Q","R","B","N"]);let p,x;if(u[1]==="P"&&f.has(h[1]))p=t,x=s;else if(h[1]==="P"&&f.has(u[1]))p=s,x=t;else return!1;if(Math.abs(Du(p[0],l,"black")-Du(x[0],l,"black"))>1||u[0]!==h[0])return!1;const C=p1(p[1],o,"black"),N=p1(x[1],o,"black");return u[0]==="b"&&C===1&&N===0?!0:u[0]==="w"&&C===o-2&&N===o-1}function iD(n,e,t,s,o){var f,p;
4313const l=e/t,u=Du(((f=o.match(/^[a-z]+/))==null?void 0:f[0])??"",t,n)*l+l/2,h=p1(((p=o.match(/\d+$/))==null?void 0:p[0])??"",s,n)*l+l/2;return{x:u,y:h}}function bH(n,e,t){const s=document.getElementById(`${n}-square-${e}`).getBoundingClientRect(),o=t.changedTouches;let l=!1;for(let u=0;u<o.length;u++){const h=o[u].clientX,f=o[u].clientY;if(h>=s.left&&h<=s.right&&f>=s.top&&f<=s.bottom){l=!0;break}}return l}const CH={wP:n=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 45 45",width:"100%",height:"100%",style:n==null?void 0:n.svgStyle,children:i.jsx("path",{d:"m 22.5,9 c -2.21,0 -4,1.79 -4,4 0,0.89 0.29,1.71 0.78,2.38 C 17.33,16.5 16,18.59 16,21 c 0,2.03 0.94,3.84 2.41,5.03 C 15.41,27.09 11,31.58 11,39.5 H 34 C 34,31.58 29.59,27.09 26.59,26.03 28.06,24.84 29,23.03 29,21 29,18.59 27.67,16.5 25.72,15.38 26.21,14.71 26.5,13.89 26.5,13 c 0,-2.21 -1.79,-4 -4,-4 z",style:{opacity:"1",fill:(n==null?void 0:n.fill)??"#ffffff",fillOpacity:"1",fillRule:"nonzero",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"miter",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"}})}),wR:n=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 45 45",width:"100%",height:"100%",style:n==null?void 0:n.svgStyle,children:i.jsxs("g",{style:{opacity:"1",fill:(n==null?void 0:n.fill)??"#ffffff",fillOpacity:"1",fillRule:"evenodd",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"},children:[i.jsx("path",{d:"M 9,39 L 36,39 L 36,36 L 9,36 L 9,39 z ",style:{strokeLinecap:"butt"}}),i.jsx("path",{d:"M 12,36 L 12,32 L 33,32 L 33,36 L 12,36 z ",style:{strokeLinecap:"butt"}}),i.jsx("path",{d:"M 11,14 L 11,9 L 15,9 L 15,11 L 20,11 L 20,9 L 25,9 L 25,11 L 30,11 L 30,9 L 34,9 L 34,14",style:{strokeLinecap:"butt"}}),i.jsx("path",{d:"M 34,14 L 31,17 L 14,17 L 11,14"}),i.jsx("path",{d:"M 31,17 L 31,29.5 L 14,29.5 L 14,17",style:{strokeLinecap:"butt",strokeLinejoin:"miter"}}),i.jsx("path",{d:"M 31,29.5 L 32.5,32 L 12.5,32 L 14,29.5"}),i.jsx("path",{d:"M 11,14 L 34,14",style:{fill:"none",stroke:"#000000",strokeLinejoin:"miter"}})]})}),wN:n=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 45 45",width:"100%",height:"100%",style:n==null?void 0:n.svgStyle,children:i.jsxs("g",{style:{opacity:"1",fill:"none",fillOpacity:"1",fillRule:"evenodd",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"},children:[i.jsx("path",{d:"M 22,10 C 32.5,11 38.5,18 38,39 L 15,39 C 15,30 25,32.5 23,18",style:{fill:(n==null?void 0:n.fill)??"#ffffff",stroke:"#000000"}}),i.jsx("path",{d:"M 24,18 C 24.38,20.91 18.45,25.37 16,27 C 13,29 13.18,31.34 11,31 C 9.958,30.06 12.41,27.96 11,28 C 10,28 11.19,29.23 10,30 C 9,30 5.997,31 6,26 C 6,24 12,14 12,14 C 12,14 13.89,12.1 14,10.5 C 13.27,9.506 13.5,8.5 13.5,7.5 C 14.5,6.5 16.5,10 16.5,10 L 18.5,10 C 18.5,10 19.28,8.008 21,7 C 22,7 22,10 22,10",style:{fill:(n==null?void 0:n.fill)??"#ffffff",stroke:"#000000"}}),i.jsx("path",{d:"M 9.5 25.5 A 0.5 0.5 0 1 1 8.5,25.5 A 0.5 0.5 0 1 1 9.5 25.5 z",style:{fill:"#000000",stroke:"#000000"}}),i.jsx("path",{d:"M 15 15.5 A 0.5 1.5 0 1 1 14,15.5 A 0.5 1.5 0 1 1 15 15.5 z",transform:"matrix(0.866,0.5,-0.5,0.866,9.693,-5.173)",style:{fill:"#000000",stroke:"#000000"}})]})}),wB:n=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 45 45",width:"100%",height:"100%",style:n==null?void 0:n.svgStyle,children:i.jsxs("g",{style:{opacity:"1",fill:"none",fillRule:"evenodd",fillOpacity:"1",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"},children:[i.jsxs("g",{style:{fill:(n==null?void 0:n.fill)??"#ffffff",stroke:"#000000",strokeLinecap:"butt"},children:[i.jsx("path",{d:"M 9,36 C 12.39,35.03 19.11,36.43 22.5,34 C 25.89,36.43 32.61,35.03 36,36 C 36,36 37.65,36.54 39,38 C 38.32,38.97 37.35,38.99 36,38.5 C 32.61,37.53 25.89,38.96 22.5,37.5 C 19.11,38.96 12.39,37.53 9,38.5 C 7.65,38.99 6.68,38.97 6,38 C 7.35,36.54 9,36 9,36 z"}),i.jsx("path",{d:"M 15,32 C 17.5,34.5 27.5,34.5 30,32 C 30.5,30.5 30,30 30,30 C 30,27.5 27.5,26 27.5,26 C 33,24.5 33.5,14.5 22.5,10.5 C 11.5,14.5 12,24.5 17.5,26 C 17.5,26 15,27.5 15,30 C 15,30 14.5,30.5 15,32 z"}),i.jsx("path",{d:"M 25 8 A 2.5 2.5 0 1 1 20,8 A 2.5 2.5 0 1 1 25 8 z"})]}),i.jsx("path",{d:"M 17.5,26 L 27.5,26 M 15,30 L 30,30 M 22.5,15.5 L 22.5,20.5 M 20,18 L 25,18",style:{fill:"none",stroke:"#000000",strokeLinejoin:"miter"}})]})}),wQ:n=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 45 45",width:"100%",height:"100%",style:n==null?void 0:n.svgStyle,children:i.jsxs("g",{style:{fill:(n==null?void 0:n.fill)??"#ffffff",stroke:"#000000",strokeWidth:"1.5",strokeLinejoin:"round"},children:[i.jsx("path",{d:"M 9,26 C 17.5,24.5 30,24.5 36,26 L 38.5,13.5 L 31,25 L 30.7,10.9 L 25.5,24.5 L 22.5,10 L 19.5,24.5 L 14.3,10.9 L 14,25 L 6.5,13.5 L 9,26 z"}),i.jsx("path",{d:"M 9,26 C 9,28 10.5,28 11.5,30 C 12.5,31.5 12.5,31 12,33.5 C 10.5,34.5 11,36 11,36 C 9.5,37.5 11,38.5 11,38.5 C 17.5,39.5 27.5,39.5 34,38.5 C 34,38.5 35.5,37.5 34,36 C 34,36 34.5,34.5 33,33.5 C 32.5,31 32.5,31.5 33.5,30 C 34.5,28 36,28 36,26 C 27.5,24.5 17.5,24.5 9,26 z"}),i.jsx("path",{d:"M 11.5,30 C 15,29 30,29 33.5,30",style:{fill:"none"}}),i.jsx("path",{d:"M 12,33.5 C 18,32.5 27,32.5 33,33.5",style:{fill:"none"}}),i.jsx("circle",{cx:"6",cy:"12",r:"2"}),i.jsx("circle",{cx:"14",cy:"9",r:"2"}),i.jsx("circle",{cx:"22.5",cy:"8",r:"2"}),i.jsx("circle",{cx:"31",cy:"9",r:"2"}),i.jsx("circle",{cx:"39",cy:"12",r:"2"})]})}),wK:n=>
4313i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 45 45",width:"100%",height:"100%",style:n==null?void 0:n.svgStyle,children:i.jsxs("g",{style:{fill:"none",fillOpacity:"1",fillRule:"evenodd",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"},children:[i.jsx("path",{d:"M 22.5,11.63 L 22.5,6",style:{fill:"none",stroke:"#000000",strokeLinejoin:"miter"}}),i.jsx("path",{d:"M 20,8 L 25,8",style:{fill:"none",stroke:"#000000",strokeLinejoin:"miter"}}),i.jsx("path",{d:"M 22.5,25 C 22.5,25 27,17.5 25.5,14.5 C 25.5,14.5 24.5,12 22.5,12 C 20.5,12 19.5,14.5 19.5,14.5 C 18,17.5 22.5,25 22.5,25",style:{fill:(n==null?void 0:n.fill)??"#ffffff",stroke:"#000000",strokeLinecap:"butt",strokeLinejoin:"miter"}}),i.jsx("path",{d:"M 12.5,37 C 18,40.5 27,40.5 32.5,37 L 32.5,30 C 32.5,30 41.5,25.5 38.5,19.5 C 34.5,13 25,16 22.5,23.5 L 22.5,27 L 22.5,23.5 C 20,16 10.5,13 6.5,19.5 C 3.5,25.5 12.5,30 12.5,30 L 12.5,37",style:{fill:(n==null?void 0:n.fill)??"#ffffff",stroke:"#000000"}}),i.jsx("path",{d:"M 12.5,30 C 18,27 27,27 32.5,30",style:{fill:"none",stroke:"#000000"}}),i.jsx("path",{d:"M 12.5,33.5 C 18,30.5 27,30.5 32.5,33.5",style:{fill:"none",stroke:"#000000"}}),i.jsx("path",{d:"M 12.5,37 C 18,34 27,34 32.5,37",style:{fill:"none",stroke:"#000000"}})]})}),bP:n=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 45 45",width:"100%",height:"100%",style:n==null?void 0:n.svgStyle,children:i.jsx("path",{d:"m 22.5,9 c -2.21,0 -4,1.79 -4,4 0,0.89 0.29,1.71 0.78,2.38 C 17.33,16.5 16,18.59 16,21 c 0,2.03 0.94,3.84 2.41,5.03 C 15.41,27.09 11,31.58 11,39.5 H 34 C 34,31.58 29.59,27.09 26.59,26.03 28.06,24.84 29,23.03 29,21 29,18.59 27.67,16.5 25.72,15.38 26.21,14.71 26.5,13.89 26.5,13 c 0,-2.21 -1.79,-4 -4,-4 z",style:{opacity:"1",fill:(n==null?void 0:n.fill)??"#000000",fillOpacity:"1",fillRule:"nonzero",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"miter",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"}})}),bR:n=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 45 45",width:"100%",height:"100%",style:n==null?void 0:n.svgStyle,children:i.jsxs("g",{style:{opacity:"1",fill:(n==null?void 0:n.fill)??"#000000",fillOpacity:"1",fillRule:"evenodd",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"},children:[i.jsx("path",{d:"M 9,39 L 36,39 L 36,36 L 9,36 L 9,39 z ",style:{strokeLinecap:"butt"}}),i.jsx("path",{d:"M 12.5,32 L 14,29.5 L 31,29.5 L 32.5,32 L 12.5,32 z ",style:{strokeLinecap:"butt"}}),i.jsx("path",{d:"M 12,36 L 12,32 L 33,32 L 33,36 L 12,36 z ",style:{strokeLinecap:"butt"}}),i.jsx("path",{d:"M 14,29.5 L 14,16.5 L 31,16.5 L 31,29.5 L 14,29.5 z ",style:{strokeLinecap:"butt",strokeLinejoin:"miter"}}),i.jsx("path",{d:"M 14,16.5 L 11,14 L 34,14 L 31,16.5 L 14,16.5 z ",style:{strokeLinecap:"butt"}}),i.jsx("path",{d:"M 11,14 L 11,9 L 15,9 L 15,11 L 20,11 L 20,9 L 25,9 L 25,11 L 30,11 L 30,9 L 34,9 L 34,14 L 11,14 z ",style:{strokeLinecap:"butt"}}),i.jsx("path",{d:"M 12,35.5 L 33,35.5 L 33,35.5",style:{fill:"none",stroke:"#ffffff",strokeWidth:"1",strokeLinejoin:"miter"}}),i.jsx("path",{d:"M 13,31.5 L 32,31.5",style:{fill:"none",stroke:"#ffffff",strokeWidth:"1",strokeLinejoin:"miter"}}),i.jsx("path",{d:"M 14,29.5 L 31,29.5",style:{fill:"none",stroke:"#ffffff",strokeWidth:"1",strokeLinejoin:"miter"}}),i.jsx("path",{d:"M 14,16.5 L 31,16.5",style:{fill:"none",stroke:"#ffffff",strokeWidth:"1",strokeLinejoin:"miter"}}),i.jsx("path",{d:"M 11,14 L 34,14",style:{fill:"none",stroke:"#ffffff",strokeWidth:"1",strokeLinejoin:"miter"}})]})}),bN:n=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 45 45",width:"100%",height:"100%",style:n==null?void 0:n.svgStyle,children:i.jsxs("g",{style:{opacity:"1",fill:"none",fillOpacity:"1",fillRule:"evenodd",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"},children:[i.jsx("path",{d:"M 22,10 C 32.5,11 38.5,18 38,39 L 15,39 C 15,30 25,32.5 23,18",style:{fill:(n==null?void 0:n.fill)??"#000000",stroke:"#000000"}}),i.jsx("path",{d:"M 24,18 C 24.38,20.91 18.45,25.37 16,27 C 13,29 13.18,31.34 11,31 C 9.958,30.06 12.41,27.96 11,28 C 10,28 11.19,29.23 10,30 C 9,30 5.997,31 6,26 C 6,24 12,14 12,14 C 12,14 13.89,12.1 14,10.5 C 13.27,9.506 13.5,8.5 13.5,7.5 C 14.5,6.5 16.5,10 16.5,10
4313L 18.5,10 C 18.5,10 19.28,8.008 21,7 C 22,7 22,10 22,10",style:{fill:(n==null?void 0:n.fill)??"#000000",stroke:"#000000"}}),i.jsx("path",{d:"M 9.5 25.5 A 0.5 0.5 0 1 1 8.5,25.5 A 0.5 0.5 0 1 1 9.5 25.5 z",style:{fill:"#ffffff",stroke:"#ffffff"}}),i.jsx("path",{d:"M 15 15.5 A 0.5 1.5 0 1 1 14,15.5 A 0.5 1.5 0 1 1 15 15.5 z",transform:"matrix(0.866,0.5,-0.5,0.866,9.693,-5.173)",style:{fill:"#ffffff",stroke:"#ffffff"}}),i.jsx("path",{d:"M 24.55,10.4 L 24.1,11.85 L 24.6,12 C 27.75,13 30.25,14.49 32.5,18.75 C 34.75,23.01 35.75,29.06 35.25,39 L 35.2,39.5 L 37.45,39.5 L 37.5,39 C 38,28.94 36.62,22.15 34.25,17.66 C 31.88,13.17 28.46,11.02 25.06,10.5 L 24.55,10.4 z ",style:{fill:"#ffffff",stroke:"none"}})]})}),bB:n=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 45 45",width:"100%",height:"100%",style:n==null?void 0:n.svgStyle,children:i.jsxs("g",{style:{opacity:"1",fill:"none",fillRule:"evenodd",fillOpacity:"1",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"},children:[i.jsxs("g",{style:{fill:(n==null?void 0:n.fill)??"#000000",stroke:"#000000",strokeLinecap:"butt"},children:[i.jsx("path",{d:"M 9,36 C 12.39,35.03 19.11,36.43 22.5,34 C 25.89,36.43 32.61,35.03 36,36 C 36,36 37.65,36.54 39,38 C 38.32,38.97 37.35,38.99 36,38.5 C 32.61,37.53 25.89,38.96 22.5,37.5 C 19.11,38.96 12.39,37.53 9,38.5 C 7.65,38.99 6.68,38.97 6,38 C 7.35,36.54 9,36 9,36 z"}),i.jsx("path",{d:"M 15,32 C 17.5,34.5 27.5,34.5 30,32 C 30.5,30.5 30,30 30,30 C 30,27.5 27.5,26 27.5,26 C 33,24.5 33.5,14.5 22.5,10.5 C 11.5,14.5 12,24.5 17.5,26 C 17.5,26 15,27.5 15,30 C 15,30 14.5,30.5 15,32 z"}),i.jsx("path",{d:"M 25 8 A 2.5 2.5 0 1 1 20,8 A 2.5 2.5 0 1 1 25 8 z"})]}),i.jsx("path",{d:"M 17.5,26 L 27.5,26 M 15,30 L 30,30 M 22.5,15.5 L 22.5,20.5 M 20,18 L 25,18",style:{fill:"none",stroke:"#ffffff",strokeLinejoin:"miter"}})]})}),bQ:n=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 45 45",width:"100%",height:"100%",style:n==null?void 0:n.svgStyle,children:i.jsxs("g",{style:{fill:(n==null?void 0:n.fill)??"#000000",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},children:[i.jsx("path",{d:"M 9,26 C 17.5,24.5 30,24.5 36,26 L 38.5,13.5 L 31,25 L 30.7,10.9 L 25.5,24.5 L 22.5,10 L 19.5,24.5 L 14.3,10.9 L 14,25 L 6.5,13.5 L 9,26 z",style:{strokeLinecap:"butt",fill:(n==null?void 0:n.fill)??"#000000"}}),i.jsx("path",{d:"m 9,26 c 0,2 1.5,2 2.5,4 1,1.5 1,1 0.5,3.5 -1.5,1 -1,2.5 -1,2.5 -1.5,1.5 0,2.5 0,2.5 6.5,1 16.5,1 23,0 0,0 1.5,-1 0,-2.5 0,0 0.5,-1.5 -1,-2.5 -0.5,-2.5 -0.5,-2 0.5,-3.5 1,-2 2.5,-2 2.5,-4 -8.5,-1.5 -18.5,-1.5 -27,0 z"}),i.jsx("path",{d:"M 11.5,30 C 15,29 30,29 33.5,30"}),i.jsx("path",{d:"m 12,33.5 c 6,-1 15,-1 21,0"}),i.jsx("circle",{cx:"6",cy:"12",r:"2"}),i.jsx("circle",{cx:"14",cy:"9",r:"2"}),i.jsx("circle",{cx:"22.5",cy:"8",r:"2"}),i.jsx("circle",{cx:"31",cy:"9",r:"2"}),i.jsx("circle",{cx:"39",cy:"12",r:"2"}),i.jsx("path",{d:"M 11,38.5 A 35,35 1 0 0 34,38.5",style:{fill:"none",stroke:"#000000",strokeLinecap:"butt"}}),i.jsxs("g",{style:{fill:"none",stroke:"#ffffff"},children:[i.jsx("path",{d:"M 11,29 A 35,35 1 0 1 34,29"}),i.jsx("path",{d:"M 12.5,31.5 L 32.5,31.5"}),i.jsx("path",{d:"M 11.5,34.5 A 35,35 1 0 0 33.5,34.5"}),i.jsx("path",{d:"M 10.5,37.5 A 35,35 1 0 0 34.5,37.5"})]})]})}),bK:n=>i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",viewBox:"0 0 45 45",width:"100%",height:"100%",style:n==null?void 0:n.svgStyle,children:i.jsxs("g",{style:{fill:"none",fillOpacity:"1",fillRule:"evenodd",stroke:"#000000",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"4",strokeDasharray:"none",strokeOpacity:"1"},children:[i.jsx("path",{d:"M 22.5,11.63 L 22.5,6",style:{fill:"none",stroke:"#000000",strokeLinejoin:"miter"},id:"path6570"}),i.jsx("path",{d:"M 22.5,25 C 22.5,25 27,17.5 25.5,14.5 C 25.5,14.5 24.5,12 22.5,12 C 20.5,12 19.5,14.5 19.5,14.5 C 18,17.5 22.5,25 22.5,25",style:{fill:(n==null?void 0:n.fill)??"#000000",fillOpacity:"1",strokeLinecap:"butt",strokeLinejoin:"miter"}}
4313),i.jsx("path",{d:"M 12.5,37 C 18,40.5 27,40.5 32.5,37 L 32.5,30 C 32.5,30 41.5,25.5 38.5,19.5 C 34.5,13 25,16 22.5,23.5 L 22.5,27 L 22.5,23.5 C 20,16 10.5,13 6.5,19.5 C 3.5,25.5 12.5,30 12.5,30 L 12.5,37",style:{fill:(n==null?void 0:n.fill)??"#000000",stroke:"#000000"}}),i.jsx("path",{d:"M 20,8 L 25,8",style:{fill:"none",stroke:"#000000",strokeLinejoin:"miter"}}),i.jsx("path",{d:"M 32,29.5 C 32,29.5 40.5,25.5 38.03,19.85 C 34.15,14 25,18 22.5,24.5 L 22.5,26.6 L 22.5,24.5 C 20,18 10.85,14 6.97,19.85 C 4.5,25.5 13,29.5 13,29.5",style:{fill:"none",stroke:"#ffffff"}}),i.jsx("path",{d:"M 12.5,30 C 18,27 27,27 32.5,30 M 12.5,33.5 C 18,30.5 27,30.5 32.5,33.5 M 12.5,37 C 18,34 27,34 32.5,37",style:{fill:"none",stroke:"#ffffff"}})]})})};function SA(n){return{display:"grid",gridTemplateColumns:`repeat(${n}, 1fr)`,overflow:"hidden",width:"100%",height:"100%",position:"relative"}}const jA={aspectRatio:"1/1",display:"flex",justifyContent:"center",alignItems:"center",position:"relative"},AA={backgroundColor:"#B58863"},kA={backgroundColor:"#F0D9B5"},RA={boxShadow:"inset 0px 0px 0px 1px black"},IA={color:"#F0D9B5"},OA={color:"#B58863"},LA={fontSize:"13px",position:"absolute",bottom:1,right:4,userSelect:"none"},MA={fontSize:"13px",position:"absolute",top:2,left:2,userSelect:"none"},PA={transform:"scale(1.2)"},zA={opacity:.5},yH={colors:{default:"#ffaa00",shift:"#4caf50",ctrl:"#f44336",alt:"#9c27b0",meta:"#fbbf24"},color:"#ffaa00",secondaryColor:"#4caf50",tertiaryColor:"#f44336",arrowLengthReducerDenominator:8,sameTargetArrowLengthReducerDenominator:4,arrowWidthDenominator:5,activeArrowWidthMultiplier:.9,opacity:.65,activeOpacity:.5,arrowStartOffset:0};class vH extends Jv{constructor(t){const s={};super({...t,onCancel:()=>{var o;(o=s.current)==null||o.teardown(),t.onCancel()},onEnd:()=>{var o;(o=s.current)==null||o.teardown(),t.onEnd()}});ze(this,"handleContextMenu",()=>{this.teardown(),this.handleCancel()});s.current=this,typeof window<"u"&&window.addEventListener("contextmenu",this.handleContextMenu,{passive:!1})}teardown(){typeof window<"u"&&window.removeEventListener("contextmenu",this.handleContextMenu)}}const FA=y.createContext(null),qh=()=>y.use(FA);function _H({children:n,options:e}){const{id:t="chessboard",pieces:s=CH,position:o="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR",boardOrientation:l="white",chessboardRows:u=8,chessboardColumns:h=8,boardStyle:f=SA(h),squareStyle:p=jA,squareStyles:x={},darkSquareStyle:b=AA,lightSquareStyle:C=kA,dropSquareStyle:N=RA,draggingPieceStyle:T=PA,draggingPieceGhostStyle:R=zA,darkSquareNotationStyle:A=IA,lightSquareNotationStyle:U=OA,alphaNotationStyle:M=LA,numericNotationStyle:V=MA,showNotation:H=!0,animationDurationInMs:Q=300,showAnimations:Y=!0,allowDragging:k=!0,allowDragOffBoard:E=!0,allowAutoScroll:j=!1,dragActivationDistance:P=1,allowDrawingArrows:O=!0,arrows:F=[],arrowOptions:S=yH,clearArrowsOnClick:be=!0,clearArrowsOnPositionChange:Ee=!0,canDragPiece:me,onArrowsChange:De,onMouseOutSquare:ge,onMouseOverSquare:Ue,onPieceClick:we,onPieceDrag:$e,onPieceDragCancel:et,onPieceDrop:Ae,onSquareClick:K,onSquareMouseDown:ne,onSquareMouseUp:Pe,onSquareRightClick:Le,squareRenderer:mt}=e||{},[tt,lt]=y.useState(null),[Qe,st]=y.useState(typeof o=="string"?By(o,u,h):o),[Yn,Rn]=y.useState({}),[zn,Zt]=y.useState(null),[en,jt]=y.useState(null),[At,Tt]=y.useState(null),[gn,Oe]=y.useState([]),[vt,Ft]=y.useState(null),on=y.useRef(null),Zn=`dnd-${t}`;y.useEffect(()=>{const Vt=typeof o=="string"?By(o,u,h):o;if(Ee&&nn(),!Y){st(Vt);return}const at=vt;at&&(st(at),Ft(null));const Et=BH(at??Qe,Vt,h,l),hs=Object.keys(Et).length>1;if(zn&&hs){const wt={...Qe};delete wt[zn.sourceSquare],wt[zn.targetSquare]={pieceType:zn.piece},st(wt);const rn={...Et};delete rn[zn.sourceSquare],Rn(rn);const jn=setTimeout(()=>{st(Vt),Rn({}),Zt(null)},Q);on.current=jn;return}if(zn){st(Vt),Zt(null);return}if(Object.keys(Et).length===0){const wt=gH(at??Qe,Vt,u,h);if(Object.keys(wt).length===1){Rn(wt),Ft(Vt);const rn=setTimeout(()=>{st(Vt),Rn({}),Ft(null)},Q);on.current=rn;return}}Rn(Et),Ft(Vt);const xn=setTimeout(()=>{st(Vt),Rn({}),Ft(null)},Q);return on.current=xn,()=>{on.current&&clearTimeout(on.current)}},[o]),y.useEffect(()=>
4313{st(typeof o=="string"?By(o,u,h):o)},[u,h,l]),y.useEffect(()=>{De==null||De({arrows:gn})},[gn]);const Fn=y.useMemo(()=>mH(u,h,l),[u,h,l]),In=y.useCallback((Vt,at)=>{if(!O)return;const Et=gn.findIndex(xn=>xn.startSquare===en&&xn.endSquare===Vt);if(F.some(xn=>xn.startSquare===en&&xn.endSquare===Vt)){jt(null),Tt(null);return}if(en&&en!==Vt){let xn=S.color;S.colors?at!=null&&at.altKey&&S.colors.alt?xn=S.colors.alt:at!=null&&at.shiftKey&&S.colors.shift?xn=S.colors.shift:at!=null&&at.ctrlKey&&S.colors.ctrl?xn=S.colors.ctrl:at!=null&&at.metaKey&&S.colors.meta?xn=S.colors.meta:xn=S.colors.default||S.color:xn=at!=null&&at.shiftKey?S.secondaryColor:at!=null&&at.ctrlKey?S.tertiaryColor:S.color,Oe(wt=>Et===-1?[...wt,{startSquare:en,endSquare:Vt,color:xn}]:wt.filter((rn,jn)=>jn!==Et)),jt(null),Tt(null)}},[O,F,S.color,S.secondaryColor,S.tertiaryColor,gn,en,At]),nn=y.useCallback(()=>{be&&(Oe([]),jt(null),Tt(null))},[be]),Ve=y.useCallback((Vt,at)=>{let Et=S.color;S.colors?at!=null&&at.altKey&&S.colors.alt?Et=S.colors.alt:at!=null&&at.shiftKey&&S.colors.shift?Et=S.colors.shift:at!=null&&at.ctrlKey&&S.colors.ctrl?Et=S.colors.ctrl:at!=null&&at.metaKey&&S.colors.meta?Et=S.colors.meta:Et=S.colors.default||S.color:Et=at!=null&&at.shiftKey?S.secondaryColor:at!=null&&at.ctrlKey?S.tertiaryColor:S.color,Tt(Vt?{square:Vt,color:Et}:null)},[S]),Rt=y.useCallback(()=>{lt(null),et==null||et()},[et]),os=y.useCallback(function(at){var hs;if(!tt)return;const Et=(hs=at.over)==null?void 0:hs.id.toString();if(!Et){Ae==null||Ae({piece:tt,sourceSquare:tt.position,targetSquare:null}),Zt({piece:tt.pieceType,sourceSquare:tt.position,targetSquare:""}),lt(null);return}at.over&&(Ae!=null&&Ae({piece:tt,sourceSquare:tt.position,targetSquare:Et})&&Zt({piece:tt.pieceType,sourceSquare:tt.position,targetSquare:Et}),lt(null))},[tt]),Hn=y.useCallback(function({active:at}){var hs;const Et=(hs=at.data.current)==null?void 0:hs.isSparePiece;$e==null||$e({isSparePiece:Et,piece:Et?{pieceType:at.id}:Qe[at.id],square:Et?null:at.id}),lt({isSparePiece:Et,position:at.id,pieceType:Et?at.id:Qe[at.id].pieceType})},[Qe]),_t=P>0?{distance:P}:void 0,Sn=J7(hB(vH,{activationConstraint:_t}),hB(qv),hB(vA,{activationConstraint:_t}),hB(yA));function Qt(Vt){return Vt.pointerCoordinates?nG(Vt):uA(Vt)}return i.jsx(FA.Provider,{value:{id:t,pieces:s,boardOrientation:l,chessboardRows:u,chessboardColumns:h,boardStyle:f,squareStyle:p,squareStyles:x,darkSquareStyle:b,lightSquareStyle:C,dropSquareStyle:N,draggingPieceStyle:T,draggingPieceGhostStyle:R,darkSquareNotationStyle:A,lightSquareNotationStyle:U,alphaNotationStyle:M,numericNotationStyle:V,showNotation:H,animationDurationInMs:Q,showAnimations:Y,allowDragging:k,allowDragOffBoard:E,allowDrawingArrows:O,arrows:F,arrowOptions:S,canDragPiece:me,onMouseOutSquare:ge,onMouseOverSquare:Ue,onPieceClick:we,onSquareClick:K,onSquareMouseDown:ne,onSquareMouseUp:Pe,onSquareRightClick:Le,squareRenderer:mt,board:Fn,isWrapped:!0,draggingPiece:tt,currentPosition:Qe,positionDifferences:Yn,newArrowStartSquare:en,newArrowOverSquare:At,setNewArrowStartSquare:jt,setNewArrowOverSquare:Ve,internalArrows:gn,drawArrow:In,clearArrows:nn},children:i.jsx($G,{autoScroll:j,collisionDetection:Qt,onDragStart:Hn,onDragEnd:os,onDragCancel:Rt,sensors:Sn,id:Zn,children:n})})}function wH(){const{id:n,arrows:e,arrowOptions:t,boardOrientation:s,chessboardColumns:o,chessboardRows:l,internalArrows:u,newArrowStartSquare:h,newArrowOverSquare:f}=qh(),p=2048,x=p*(l/o),b=h&&f&&h!==f.square?{startSquare:h,endSquare:f.square,color:f.color}:null,C=b?[...e,...u,b]:[...e,...u];return i.jsx("svg",{viewBox:`0 0 ${p} ${x}`,style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",pointerEvents:"none",zIndex:"20"},children:C.map((N,T)=>{const R=iD(s,p,o,l,N.startSquare),A=iD(s,p,o,l,N.endSquare),U=p/o;let M=U/t.arrowLengthReducerDenominator;const V=b&&T===C.length-1;C.some(j=>j.startSquare!==N.startSquare&&j.endSquare===N.endSquare)&&!V&&(M=U/t.sameTargetArrowLengthReducerDenominator);const H=A.x-R.x,Q=A.y-R.y,Y=Math.hypot(Q,H),k=U*t.arrowStartOffset;let E;if(Y===Math.hypot(1,2)*U){const j=Math.abs(H)<Math.abs(Q),P=j?{x:R.x,y:R.y+Math.sign(Q)*k}:{x:R.x+Math.sign(H)*k,y:R.y},O=j?{x:R.x,y:A.y}:{x:A.x,y:R.y},F=A.x-O.x,S=A.y-O.y,be=U,Ee={x:O.x+F*(be-M)/be,y:O.y+S*(be-M)/be};E=`M${P.x},${P.y} L${O.x},${O.y} L${Ee.x},${Ee.y}`}else{const j={x:R.x+H*k/Y,y:R.y+Q*k/Y},P={x:R.x+H*(Y-M)/Y,y:R.y+Q*(Y-M)/Y};E=`M${j.x},${j.y} L${P.x},${P.y}`}return i.jsxs(y.Fragment,{children:[i.jsx("marker",{id:`${n}-arrowhead-${T}-${N.startSquare}-${N.endSquare}`,markerWidth:"2",markerHeight:"2.5",refX:"1.25",refY:"1.25",orient:"auto",children:i.jsx("polygon",{points:"0.3 0, 2 1.25, 0.3 2.5",fill:N.color})}),i.jsx("path",{d:E,fill:"none",opacity:V?t.activeOpacity:t.opacity,stroke:N.color,strokeWidth:V?t.activeArrowWidthMultiplier*(U/t.arrowWidthDenominator):U/t.arrowWidthDenominator,markerEnd:`url(#${n}-arrowhead-${T}-${N.startSquare}-${N.endSquare})`})]},`${n}-arrow-${N.startSquare}-${N.endSquare}${V?"-active":""}`)})})}function EH({children:n,isSparePiece:e=!1,pieceType:t,position:s}){const{allowDragging:o,canDragPiece:l}=qh(),{setNodeRef:u,attributes:h,listeners:f}=QG({id:s,data:{isSparePiece:e,pieceType:t},disabled:!o||l&&!l({piece:{pieceType:t},isSparePiece:e,square:s})});return i.jsx("div",{ref:u,...h,...f,children:n})}function NH({children:n,squareId:e}){const{isOver:t,setNodeRef:s}=ZG({id:e});return i.jsx("div",{ref:s,children:n({isOver:t})})}const aD=y.memo(function({clone:e,isSparePiece:t=!1,position:s,pieceType:o}){const{id:l,allowDragging:u,animationDurationInMs:h,boardOrientation:f,canDragPiece:p,draggingPiece:x,draggingPieceStyle:b,draggingPieceGhostStyle:C,pieces:N,positionDifferences:T,onPieceClick:R}=qh(),[A,U]=y.useState({});let M=e?"grabbing":"grab";(!u||p&&!p({piece:{pieceType:o},isSparePiece:t,square:s}))&&(M="pointer"),y.useEffect(()=>{var H;if(T[s]){const Q=s,Y=T[s],k=(H=document.querySelector(`#${l}-square-${Q}`))==null?void 0:H.getBoundingClientRect().width;if(!k)throw new Error("Square width not found");U({transform:`translate(${(f==="black"?-1:1)*(Y.charCodeAt(0)-Q.charCo
4313deAt(0))*k}px, ${(f==="black"?-1:1)*(Number(Q[1])-Number(Y[1]))*k}px)`,transition:`transform ${h}ms`,position:"relative",zIndex:10})}else U({})},[T]);const V=N[o];return i.jsx("div",{id:`${l}-piece-${o}-${s}`,"data-piece":o,style:{...A,...e?{...PA,...b}:{},...!e&&(x==null?void 0:x.position)===s?{...zA,...C}:{},width:"100%",height:"100%",cursor:M,touchAction:"none"},onClick:()=>R==null?void 0:R({isSparePiece:t,piece:{pieceType:o},square:s}),children:i.jsx(V,{square:s})})}),DH=y.memo(function({children:e,squareId:t,isLightSquare:s,isOver:o}){var ne,Pe;const[l,u]=y.useState(!1),[h,f]=y.useState(!1),{id:p,allowDrawingArrows:x,boardOrientation:b,chessboardColumns:C,chessboardRows:N,currentPosition:T,draggingPiece:R,squareStyle:A,squareStyles:U,darkSquareStyle:M,lightSquareStyle:V,dropSquareStyle:H,darkSquareNotationStyle:Q,lightSquareNotationStyle:Y,alphaNotationStyle:k,numericNotationStyle:E,showNotation:j,onMouseOutSquare:P,onMouseOverSquare:O,onSquareClick:F,onSquareMouseDown:S,onSquareMouseUp:be,onSquareRightClick:Ee,squareRenderer:me,newArrowStartSquare:De,setNewArrowStartSquare:ge,setNewArrowOverSquare:Ue,drawArrow:we,clearArrows:$e}=qh(),et=y.useRef(o);y.useEffect(()=>{o&&R?O==null||O({piece:T[t]??null,square:t}):!o&&R&&et.current&&(P==null||P({piece:T[t]??null,square:t})),et.current=o},[T,R,o,t]),y.useEffect(()=>{R&&h&&f(!1)},[R,h]);const Ae=(ne=t.match(/^[a-z]+/))==null?void 0:ne[0],K=(Pe=t.match(/\d+$/))==null?void 0:Pe[0];return i.jsxs("div",{id:`${p}-square-${t}`,style:{...jA,...A,...s?{...kA,...V}:{...AA,...M},...o?{...RA,...H}:{}},"data-column":Ae,"data-row":K,"data-square":t,onClick:Le=>{Le.button===0&&(F==null||F({piece:T[t]??null,square:t}))},onTouchStart:()=>{f(!0)},onTouchEnd:Le=>{Le.preventDefault(),bH(p,t,Le)&&h&&(F==null||F({piece:T[t]??null,square:t})),f(!1)},onContextMenu:Le=>{Le.preventDefault(),l||Ee==null||Ee({piece:T[t]??null,square:t}),u(!1)},onMouseDown:Le=>{Le.button===0&&$e(),Le.button===2&&x&&ge(t),S==null||S({piece:T[t]??null,square:t},Le)},onMouseUp:Le=>
4313{Le.button===2&&(x&&De&&De!==t?(u(!0),we(t,{shiftKey:Le.shiftKey,ctrlKey:Le.ctrlKey,altKey:Le.altKey,metaKey:Le.metaKey})):De===t&&(ge(null),Ue(null))),be==null||be({piece:T[t]??null,square:t},Le)},onMouseOver:Le=>{Le.buttons===2&&x&&De&&De!==t?Ue(t,{shiftKey:Le.shiftKey,ctrlKey:Le.ctrlKey,altKey:Le.altKey,metaKey:Le.metaKey}):De===t&&Ue(null),R||O==null||O({piece:T[t]??null,square:t})},onMouseLeave:()=>{R||P==null||P({piece:T[t]??null,square:t})},children:[j?i.jsxs("span",{style:s?{...OA,...Y}:{...IA,...Q},children:[K===(b==="white"?"1":N.toString())&&i.jsx("span",{style:{...LA,...k},children:Ae}),Ae===(b==="white"?"a":Qv(0,C,b))&&i.jsx("span",{style:{...MA,...E},children:K})]}):null,(me==null?void 0:me({piece:T[t]??null,square:t,children:e}))||i.jsx("div",{style:{width:"100%",height:"100%",...U[t]},children:e})]})}),TH=(n,e)=>({transform:t})=>{const s=typeof document<"u"?document.getElementById(`${n}-board`):null;if(!s)return t;const o=s.getBoundingClientRect(),l=s.querySelector('[data-column="a"][data-row="1"]');if(!l)return t;const h=l.getBoundingClientRect().width/2,f=e.match(/^([a-zA-Z]+)(\d+)$/);if(!f)return t;const[,p,x]=f,b=s.querySelector(`[data-column="${p}"][data-row="${x}"]`);if(!b)return t;const C=b.getBoundingClientRect(),N=C.left+h-o.left,T=C.top+h-o.top,R=-N,A=o.width-N,U=-T,M=o.height-T,V=Math.min(Math.max(t.x,R),A),H=Math.min(Math.max(t.y,U),M);return{...t,x:V,y:H}};function oD(){const{allowDragOffBoard:n,board:e,boardStyle:t,chessboardColumns:s,currentPosition:o,draggingPiece:l,id:u}=qh();return i.jsxs(i.Fragment,{children:[i.jsxs("div",{id:`${u}-board`,style:{...SA(s),...t},children:[e.map(h=>h.map(f=>{const p=o[f.squareId];return i.jsx(NH,{squareId:f.squareId,children:({isOver:x})=>i.jsx(DH,{isOver:x,...f,children:p?i.jsx(EH,{isSparePiece:!1,position:f.squareId,pieceType:p.pieceType,children:i.jsx(aD,{...p,position:f.squareId})}):null})},f.squareId)})),i.jsx(wH,{})]}),i.jsx(hH,{dropAnimation:null,modifiers:[fH,...n?[]:[TH(u,(l==null?void 0:l.position)||"")]],children:l?i.jsx(aD,{clone:!0,position:l.position,pieceType:l.pieceType}):null})]})}function VA({options:n}){const{isWrapped:e}=qh()??{isWrapped:!1};return e?i.jsx(oD,{}):i.jsx(_H,{options:n,children:i.jsx(oD,{})})}const SH=VA;function jH({onClose:n,user:e,gameId:t,opponent:s,bet:o,isHost:l}){const[u,h]=y.useState(new uh),[f,p]=y.useState([]),[x,b]=y.useState(""),[C,N]=y.useState("playing"),[T,R]=y.useState(""),[A,U]=y.useState(""),[M,V]=y.useState({});y.useEffect(()=>(W.emit("join_chess_game",t),W.on("chess_move",we=>{const $e=new uh(we.fen);h($e)}),W.on("chess_chat",we=>{if(p($e=>[...$e,we]),["ð","ð¤","ð¡","ð","ð±"].includes(we.text))try{new Audio("https://cdn.pixabay.com/download/audio/2021/08/04/audio_bb630cc098.mp3").play()}catch{}}
4313),W.on("chess_end",we=>{N(we.winner===e.username?"won":we.winner?"lost":"draw"),R(we.winner)}),()=>{W.emit("leave_chess_game",t),W.off("chess_move"),W.off("chess_chat"),W.off("chess_end")}),[t,e.username]);function H(we,$e){return!1}function Q(we,$e){const et=$e.moves({square:we,verbose:!0}),Ae={},K=l?"w":"b";return et.forEach(ne=>{const Pe=$e.get(ne.to)&&$e.get(ne.to).color!==K;Ae[ne.to]={backgroundImage:Pe?"radial-gradient(circle, rgba(255,0,0,.5) 85%, transparent 85%)":"radial-gradient(circle, rgba(0,255,0,.5) 25%, transparent 25%)",borderRadius:"50%",zIndex:10}}),Ae[we]={backgroundColor:"rgba(255, 255, 0, 0.6)"},Ae}function Y(we,$e){k($e)}function k(we){console.log("Clicked square",we,"current selection:",A);const $e=l?"w":"b";if(!(C!=="playing"||u.turn()!==$e)){if(!A){const et=u.get(we);et&&et.color===$e&&(U(we),V(Q(we,u)));return}try{const et=new uh(u.fen()),Ae=et.move({from:A,to:we,promotion:"q"});Ae&&(h(et),U(""),V({}),W.emit("chess_move",{gameId:t,move:Ae,fen:et.fen()}),et.isGameOver()&&W.emit("chess_game_over",{gameId:t,result:et.isCheckmate()?"checkmate":"draw",winner:e.username}))}catch{const Ae=u.get(we);Ae&&Ae.color===$e?(U(we),V(Q(we,u))):(U(""),V({}))}}}const E=we=>{we.preventDefault(),x.trim()&&(W.emit("chess_chat",{gameId:t,text:x}),b(""))},j=()=>{confirm("¿Seguro que quieres abandonar? Si has hecho al menos un movimiento, perderás tu apuesta.")&&(W.emit("abandon_chess_game",t),n())},P=(we=0)=>we<=300?{name:"Cobre",color:"text-orange-700"}:we<=600?{name:"Bronce",color:"text-orange-400"}:we<=900?{name:"Plata",color:"text-gray-300"}:we<=1200?{name:"Platino",color:"text-cyan-200"}:{name:"Oro",color:"text-yellow-400"},F=(()=>{const we=u.board(),$e={p:8,n:2,b:2,r:2,q:1},et={wp:0,wn:0,wb:0,wr:0,wq:0,bp:0,bn:0,bb:0,br:0,bq:0};we.forEach(ne=>{ne.forEach(Pe=>{Pe&&et[Pe.color+Pe.type]++})});const Ae=[],K=[];for(const[ne,Pe]of Object.entries($e)){const Le=Pe-et["w"+ne],mt=Pe-et["b"+ne];for(let tt=0;tt<Le;tt++)Ae.push(ne);for(let tt=0;tt<mt;tt++)K.push(ne)}return{whiteCaptured:Ae,blackCaptured:K}})(),S=l?F.blackCaptured:F.whiteCaptured,be=l?F.whiteCaptured:F.blackCaptured,Ee={p:"â",n:"â",b:"â",r:"â",q:"â"},me=P(e.elo),De=P(s.elo),Ue=(()=>{const we=e.activeDecoration;return we==="chess_theme_neon"?{dark:"#0a0f1c",light:"#1a2235",drop:"drop-shadow-[0_0_15px_rgba(99,102,241,0.5)]",border:"border-indigo-500",bg:"bg-[#0a0f1c]"}:we==="chess_theme_gold"?{dark:"#b8860b",light:"#ffd700",drop:"drop-shadow-[0_0_15px_rgba(212,175,55,0.5)]",border:"border-[#D4AF37]",bg:"bg-[#3d2314]"}:{dark:"#b58863",light:"#f0d9b5",drop:"",border:"border-[#8B5A2B]",bg:"bg-[#f0d9b5]"}})();return i.jsx("div",{className:"fixed inset-0 z-[120] flex items-center justify-center bg-[#0B1220] md:p-6 animate-in fade-in",children:i.jsxs("div",{className:"bg-gradient-to-b from-[#0a0f1c] to-[#121B2A] border border-[#D4AF37]/30 md:rounded-3xl w-full h-[100dvh] md:h-auto md:max-h-[95vh] max-w-6xl flex flex-col md:flex-row overflow-hidden shadow-[0_0_50px_rgba(212,175,55,0.15)]",children:[i.jsxs("div",{className:"md:flex-1 p-2 md:p-6 shrink-0 flex flex-col items-center justify-center relative overflow-hidden",children:[i.jsx("div",{className:"absolute inset-x-10 bottom-0 top-1/4 bg-[#3d2314] rounded-[100%] shadow-[inset_0_-20px_50px_rgba(0,0,0,0.8)] opacity-50 transform perspective-[1000px] rotateX(60deg) scale-150 pointer-events-none"}),i.jsxs("div",{className:"w-full max-w-[500px] flex justify-between items-center mb-2 md:mb-4 relative z-10 bg-black/40 px-4 py-2 rounded-xl border border-[#D4AF37]/20",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("img",{referrerPolicy:"no-referrer",src:s.profilePic||`https://api.dicebear.com/7.x/avataaars/svg?seed=${s.username}`,className:"w-10 h-10 md:w-12 md:h-12 rounded-full border-2 border-red-500/50",alt:""}),i.jsxs("div",{children:[i.jsx("div",{className:"font-bold text-white text-lg",children:s.username}),i.jsxs("div",{className:`text-xs font-bold ${De.color}`,children:["Nivel: ",De.name," (",s.elo||0,")"]})]})]}),i.jsx("div",{className:"text-xl tracking-tight text-white/70",children:be.map((we,$e)=>i.jsx("span",{className:l?"text-white":"text-gray-500",children:Ee[we]},$e))})]}),i.jsx("div",{className:`w-full max-w-[500px] aspect-square relative z-[100] pointer-events-auto shadow-[0_20px_50px_rgba(0,0,0,0.8)] rounded-md border-4 ${Ue.border} ${Ue.bg} ${Ue.drop}`,children:i.jsx(SH,{position:u.fen(),onSquareClick:k,onPieceClick:Y,arePiecesDraggable:!1,onPieceDrop:H,boardOrientation:l?"white":"black",customDarkSquareStyle:{backgroundColor:Ue.dark},customLightSquareStyle:{backgroundColor:Ue.light},customSquareStyles:M})}),i.jsxs("div",{className:"w-full max-w-[500px] flex justify-between items-center mt-2 md:mt-4 relative z-10 bg-black/40 px-4 py-2 rounded-xl border border-[#D4AF37]/20",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("img",{referrerPolicy:"no-referrer",src:e.profilePic||`https://api.dicebear.com/7.x/avataaars/svg?seed=${e.username}`,className:"w-10 h-10 md:w-12 md:h-12 rounded-full border-2 border-[#D4AF37]",alt:""}),i.jsxs("div",{children:[i.jsxs("div",{className:"font-bold text-[#D4AF37] text-lg",children:[e.username," (Tú)"]}),i.jsxs("div",{className:`text-xs font-bold ${me.color}`,children:["Nivel: ",me.name," (",e.elo||0,")"]})]})]}),i.jsx("div",{className:"text-xl tracking-tight text-[#D4AF37]",children:S.map((we,$e)=>i.jsx("span",{className:l?"text-gray-500":"text-white",children:Ee[we]},$e))})]}),C!=="playing"&&i.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-black/80 backdrop-blur-sm animate-in zoom-in",children:i.jsxs("div",{className:"bg-[#121B2A] border border-[#D4AF37]/50 p-8 rounded-3xl flex flex-col items-center shadow-2xl",children:[i.jsx(KB,{size:64,className:C==="won"?"text-yellow-400 mb-4":"text-gray-500 mb-4"}),i.jsx("h2",{className:"text-3xl font-bold text-white mb-2",children:C==="won"?"¡Has Ganado!":C==="lost"?"Has Perdido":"Empate"}),i.jsx("p",{className:"text-[#D4AF37] text-lg mb-6",children:C==="won"?`+${o} Liz-Moneditas y ELO`:C==="lost"?`-${o} Liz-Moneditas`:"No hay cambios"}),i.jsx("button",{onClick:n,className:"px-6 py-2 bg-[#D4AF37] text-black font-bold rounded-lg hover:bg-yellow-400 transition-colors",children:"Cerrar"})]})})]}),i.jsxs("div",{className:"w-full md:w-80 border-t md:border-t-0 border-l-0 md:border-l border-[#D4AF37]/20 bg-black/40 flex-1 flex flex-col min-h-0 z-1 relative",children:[i.jsxs("div",{className:"p-4 border-b border-[#D4AF37]/20 flex justify-between items-center bg-[#D4AF37]/5",children:[i.jsxs("div",{className:"font-bold text-[#D4AF37] flex items-center gap-2",children:[i.jsx(KB,{size:18})," Apuesta: ",o*2," LM"]}),i.jsxs("button",{onClick:j,className:"text-red-400 hover:text-red-300 hover:bg-red-500/10 p-2 rounded-lg transition-colors flex items-center gap-2 text-sm font-bold",children:[i.jsx(gh,{size:16})," Salir"]})]}),i.jsx("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col-reverse gap-3",children:[...f].reverse().map((we,$e)=>i.jsxs("div",{className:`flex flex-col ${we.sender===e.username?"items-end":"items-start"}`,children:[i.jsx("span",{className:"text-xs text-gray-500 mb-0.5 px-1",children:we.sender}),i.jsx("div",{className:`px-3 py-1.5 rounded-xl max-w-[85%] text-sm ${we.sender===e.username?"bg-[#D4AF37]/20 text-[#E8D9B0]":"bg-white/10 text-gray-200"}`,children:we.text})]},$e))}),i.jsxs("form",{onSubmit:E,className:"p-3 border-t border-[#D4AF37]/20 flex gap-2",children:[i.jsx("input",{type:"text",value:x,onChange:we=>b(we.target.value),placeholder:"Escribe en la mesa...",className:"flex-1 bg-black/50 border border-white/10 rounded-xl px-3 py-2 text-sm text-white focus:outline-none focus:border-[#D4AF37]/50"}),i.jsx("button",{type:"submit",className:"p-2 bg-[#D4AF37]/20 text-[#D4AF37] hover:bg-[#D4AF37]/30 rounded-xl transition-colors",children:i.jsx(mh,{size:18})})]}),i.jsx("div",{className:"p-2 bg-black/60 flex justify-center gap-2 border-t border-[#D4AF37]/10",children:["ð","ð¤","ð¡","ð","ð±"].map(we=>i.jsx("button",{type:"button",onClick:()=>{W.emit("chess_chat",{gameId:t,text:we});try{new Audio("https://cdn.pixabay.com/download/audio/2021/08/04/audio_bb630cc098.mp3").play()}catch{}},className:"text-2xl hover:scale-110 transition-transform p-1",children:we},we))})]})]})})}const AH=VA;
4313function kH({onClose:n,user:e,gameId:t,opponent:s,bet:o}){const[l,u]=y.useState(new uh),[h,f]=y.useState([]),[p,x]=y.useState(""),[b,C]=y.useState("playing"),[N,T]=y.useState(""),[R,A]=y.useState({});y.useEffect(()=>(W.emit("join_chess_game",t),W.on("chess_bot_end",ge=>{ge.reason==="draw"?C("draw"):ge.winner===e.username?C("won"):C("lost")}),()=>{W.emit("leave_chess_bot_game",t),W.off("chess_bot_end")}),[t,e.username]);const U=ge=>{setTimeout(()=>{const Ue=ge.moves();if(Ue.length===0)return;const we=Ue[Math.floor(Math.random()*Ue.length)];if(ge.move(we),u(new uh(ge.fen())),ge.isGameOver()){const $e=ge.isDraw()||ge.isStalemate()||ge.isThreefoldRepetition();W.emit("chess_bot_game_over",{gameId:t,result:$e?"draw":"bot_won",winner:"Elizabeth_Bot"}),C($e?"draw":"lost")}},600)};function M(ge,Ue){return!1}function V(ge,Ue){const we=Ue.moves({square:ge,verbose:!0}),$e={},et="w";return we.forEach(Ae=>{const K=Ue.get(Ae.to)&&Ue.get(Ae.to).color!==et;$e[Ae.to]={backgroundImage:K?"radial-gradient(circle, rgba(255,0,0,.5) 85%, transparent 85%)":"radial-gradient(circle, rgba(0,255,0,.5) 25%, transparent 25%)",borderRadius:"50%",zIndex:10}}),$e[ge]={backgroundColor:"rgba(255, 255, 0, 0.6)"},$e}function H(ge,Ue){Q(Ue)}function Q(ge){console.log("Clicked square",ge,"current selection:",N);const Ue="w";if(!(b!=="playing"||l.turn()!==Ue)){if(!N){const we=l.get(ge);we&&we.color===Ue&&(T(ge),A(V(ge,l)));return}try{const we=new uh(l.fen());if(we.move({from:N,to:ge,promotion:"q"}))if(u(we),T(""),A({}),we.isGameOver()){const et=we.isDraw()||we.isStalemate()||we.isThreefoldRepetition();W.emit("chess_bot_game_over",{gameId:t,result:et?"draw":"user_won",winner:e.username}),C(et?"draw":"won")}else U(we)}catch{const $e=l.get(ge);$e&&$e.color===Ue?(T(ge),A(V(ge,l))):(T(""),A({}))}}}const Y=ge=>{ge.preventDefault(),p.trim()&&(f(Ue=>[...Ue,{sender:e.username,text:p}]),x(""))},k=()=>{confirm("¿Seguro que quieres abandonar? Perderás tu apuesta.")&&(W.emit("chess_bot_game_over",{gameId:t,result:"bot_won",winner:"Elizabeth_Bot"}),n())},E=(ge=0)=>ge<=300?{name:"Cobre",color:"text-orange-700"}:ge<=600?{name:"Bronce",color:"text-orange-400"}:ge<=900?{name:"Plata",color:"text-gray-300"}:ge<=1200?{name:"Platino",color:"text-cyan-200"}:{name:"Oro",color:"text-yellow-400"},P=(()=>{const ge=l.board(),Ue={p:8,n:2,b:2,r:2,q:1},we={wp:0,wn:0,wb:0,wr:0,wq:0,bp:0,bn:0,bb:0,br:0,bq:0};ge.forEach(Ae=>{Ae.forEach(K=>{K&&we[K.color+K.type]++})});const $e=[],et=[];for(const[Ae,K]of Object.entries(Ue)){const ne=K-we["w"+Ae],Pe=K-we["b"+Ae];for(let Le=0;Le<ne;Le++)$e.push(Ae);for(let Le=0;Le<Pe;Le++)et.push(Ae)}return{whiteCaptured:$e,blackCaptured:et}})(),O=P.blackCaptured,F=P.whiteCaptured,S={p:"â",n:"â",b:"â",r:"â",q:"â"},be=E(e.elo),Ee=E(s.elo),De=(()=>{const ge=e.activeDecoration;return ge==="chess_theme_neon"?{dark:"#0a0f1c",light:"#1a2235",drop:"drop-shadow-[0_0_15px_rgba(99,102,241,0.5)]",border:"border-indigo-500",bg:"bg-[#0a0f1c]"}:ge==="chess_theme_gold"?{dark:"#b8860b",light:"#ffd700",drop:"drop-shadow-[0_0_15px_rgba(212,175,55,0.5)]",border:"border-[#D4AF37]",bg:"bg-[#3d2314]"}:{dark:"#b58863",light:"#f0d9b5",drop:"",border:"border-[#8B5A2B]",bg:"bg-[#f0d9b5]"}})();return i.jsx("div",{className:"fixed inset-0 z-[120] flex items-center justify-center bg-[#0B1220] md:p-6 animate-in fade-in",children:i.jsxs("div",{className:"bg-gradient-to-b from-[#0a0f1c] to-[#121B2A] border border-[#D4AF37]/30 md:rounded-3xl w-full h-[100dvh] md:h-auto md:max-h-[95vh] max-w-6xl flex flex-col md:flex-row overflow-hidden shadow-[0_0_50px_rgba(212,175,55,0.15)]",children:[i.jsxs("div",{className:"md:flex-1 p-2 md:p-6 shrink-0 flex flex-col items-center justify-center relative overflow-hidden",children:[i.jsx("div",{className:"absolute inset-x-10 bottom-0 top-1/4 bg-[#3d2314] rounded-[100%] shadow-[inset_0_-20px_50px_rgba(0,0,0,0.8)] opacity-50 transform perspective-[1000px] rotateX(60deg) scale-150 pointer-events-none"}),i.jsxs("div",{className:"w-full max-w-[500px] flex justify-between items-center mb-2 md:mb-4 relative z-10 bg-black/40 px-4 py-2 rounded-xl border border-[#D4AF37]/20",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("img",{referrerPolicy:"no-referrer",src:s.profilePic,className:"w-10 h-10 md:w-12 md:h-12 rounded-full border-2 border-red-500/50",alt:""}),i.jsxs("div",{children:[i.jsx("div",{className:"font-bold text-white text-lg",children:"Elizabeth (Bot)"}),i.jsxs("div",{className:`text-xs font-bold ${Ee.color}`,children:["Nivel: ",Ee.name," (â)"]})]})]}),i.jsx("div",{className:"text-xl tracking-tight text-white/70",children:F.map((ge,Ue)=>i.jsx("span",{className:"text-white",children:S[ge]},Ue))})]}),i.jsx("div",{className:`w-full max-w-[500px] aspect-square relative z-[100] pointer-events-auto shadow-[0_20px_50px_rgba(0,0,0,0.8)] rounded-md border-4 ${De.border} ${De.bg} ${De.drop}`,children:i.jsx(AH,{position:l.fen(),onSquareClick:Q,onPieceClick:H,arePiecesDraggable:!1,onPieceDrop:M,boardOrientation:"white",customDarkSquareStyle:{backgroundColor:De.dark},customLightSquareStyle:{backgroundColor:De.light},customSquareStyles:R})}),i.jsxs("div",{className:"w-full max-w-[500px] flex justify-between items-center mt-2 md:mt-4 relative z-10 bg-black/40 px-4 py-2 rounded-xl border border-[#D4AF37]/20",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("img",{referrerPolicy:"no-referrer",src:e.profilePic||`https://api.dicebear.com/7.x/avataaars/svg?seed=${e.username}`,className:"w-10 h-10 md:w-12 md:h-12 rounded-full border-2 border-[#D4AF37]",alt:""}),i.jsxs("div",{children:[i.jsxs("div",{className:"font-bold text-[#D4AF37] text-lg",children:[e.username," (Tú)"]}),i.jsxs("div",{className:`text-xs font-bold ${be.color}`,children:["Nivel: ",be.name," (",e.elo||0,")"]})]})]}),i.jsx("div",{className:"text-xl tracking-tight text-[#D4AF37]",children:O.map((ge,Ue)=>i.jsx("span",{className:"text-gray-500",children:S[ge]},Ue))})]}),b!=="playing"&&i.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-black/80 backdrop-blur-sm animate-in zoom-in",children:i.jsxs("div",{className:"bg-[#121B2A] border border-[#D4AF37]/50 p-8 rounded-3xl flex flex-col items-center shadow-2xl",children:[i.jsx(KB,{size:64,className:b==="won"?"text-yellow-400 mb-4":"text-gray-500 mb-4"}),i.jsx("h2",{className:"text-3xl font-bold text-white mb-2",children:b==="won"?"¡Has Ganado!":b==="lost"?"Has Perdido":"Empate"}),i.jsx("p",{className:"text-[#D4AF37] text-lg mb-6",children:b==="won"?`+${o} Liz-Moneditas`:b==="lost"?`-${o} Liz-Moneditas`:"No hay cambios"}),i.jsx("button",{onClick:n,className:"px-6 py-2 bg-[#D4AF37] text-black font-bold rounded-lg hover:bg-yellow-400 transition-colors",children:"Cerrar"})]})})]}),i.jsxs("div",{className:"w-full md:w-80 border-t md:border-t-0 border-l-0 md:border-l border-[#D4AF37]/20 bg-black/40 flex-1 flex flex-col min-h-0 z-1 relative",children:[i.jsxs("div",{className:"p-4 border-b border-[#D4AF37]/20 flex justify-between items-center bg-[#D4AF37]/5",children:[i.jsxs("div",{className:"font-bold text-[#D4AF37] flex items-center gap-2",children:[i.jsx(KB,{size:18})," Apuesta: ",o," LM"]}),i.jsxs("button",{onClick:k,className:"text-red-400 hover:text-red-300 hover:bg-red-500/10 p-2 rounded-lg transition-colors flex items-center gap-2 text-sm font-bold",children:[i.jsx(gh,{size:16})," Salir"]})]}),i.jsx("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col-reverse gap-3",children:[...h].reverse().map((ge,Ue)=>i.jsxs("div",{className:`flex flex-col ${ge.sender===e.username?"items-end":"items-start"}`,children:[i.jsx("span",{className:"text-xs text-gray-500 mb-0.5 px-1",children:ge.sender}),i.jsx("div",{className:`px-3 py-1.5 rounded-xl max-w-[85%] text-sm ${ge.sender===e.username?"bg-[#D4AF37]/20 text-[#E8D9B0]":"bg-white/10 text-gray-200"}`,children:ge.text})]},Ue))}),i.jsxs("form",{onSubmit:Y,className:"p-3 border-t border-[#D4AF37]/20 flex gap-2",children:[i.jsx("input",{type:"text",value:p,onChange:ge=>x(ge.target.value),placeholder:"Escribe algo al Bot...",className:"flex-1 bg-black/50 border border-white/10 rounded-xl px-3 py-2 text-sm text-white focus:outline-none focus:border-[#D4AF37]/50"}),i.jsx("button",{type:"submit",className:"p-2 bg-[#D4AF37]/20 text-[#D4AF37] hover:bg-[#D4AF37]/30 rounded-xl transition-colors",children:i.jsx(mh,{size:18})})]}),i.jsx("div",{className:"p-2 bg-black/60 flex justify-center gap-2 border-t border-[#D4AF37]/10",children:["ð","ð¤","ð¡","ð","ð±"].map(ge=>i.jsx("button",{type:"button",onClick:()=>{f(Ue=>[...Ue,{sender:e.username,text:ge}])},className:"text-2xl hover:scale-110 transition-transform p-1",children:ge},ge))})]})]})})}const RH=({src:n,className:e="",color1:t="#34B7F1"})=>{const[s,o]=y.useState(!1),[l,u]=y.useState(0),[h,f]=y.useState(0),p=y.useRef(null),[x,b]=y.useState(new Uint8Array(30).fill(10)),C=y.useRef(null),N=y.useRef(null),T=y.useRef(null),R=y.useRef(0);y.useEffect(()=>{const Y=p.current;if(!Y)return;const k=()=>{Y.duration&&!isNaN(Y.duration)&&isFinite(Y.duration)&&u(Y.duration)},E=()=>{f(Y.currentTime),Y.duration&&!isNaN(Y.duration)&&isFinite(Y.duration)&&u(Y.duration)},j=()=>{o(!1),f(0)};return Y.addEventListener("loadedmetadata",k),Y.addEventListener("timeupdate",E),Y.addEventListener("ended",j),()=>{Y.removeEventListener("loadedmetadata",k),Y.removeEventListener("timeupdate",E),Y.removeEventListener("ended",j),R.current&&cancelAnimationFrame(R.current)}},[n]);const A=()=>{if(!C.current&&p.current)try{const Y=window.AudioContext||window.webkitAudioContext;
4313C.current=new Y,N.current=C.current.createAnalyser(),N.current.fftSize=64,T.current=C.current.createMediaElementSource(p.current),T.current.connect(N.current),N.current.connect(C.current.destination)}catch(Y){console.warn("AudioContext setup failed, possibly CORS issue:",Y)}C.current&&C.current.state==="suspended"&&C.current.resume()},U=()=>{if(N.current&&s){const Y=new Uint8Array(N.current.frequencyBinCount);N.current.getByteFrequencyData(Y);const k=new Uint8Array(30);for(let E=0;E<30;E++){const j=Y[E]||10;k[E]=Math.max(10,Math.min(100,j/255*100))}b(k),R.current=requestAnimationFrame(U)}};y.useEffect(()=>{s?U():(R.current&&cancelAnimationFrame(R.current),b(new Uint8Array(30).fill(15)))},[s]);const M=Y=>{Y.stopPropagation(),p.current&&(s?(p.current.pause(),o(!1)):(A(),p.current.play().then(()=>{o(!0)}).catch(k=>{k.name!=="AbortError"&&console.error("Playback error:",k)})))},V=Y=>{const k=Number(Y.target.value);p.current&&(p.current.currentTime=k,f(k))},H=Y=>{if(isNaN(Y)||!isFinite(Y)||Y<0)return"0:00";const k=Math.floor(Y/60),E=Math.floor(Y%60);return`${k}:${E<10?"0":""}${E}`},Q=l>0?h/l*100:0;return i.jsxs("div",{className:`relative flex items-center gap-3 bg-[#1e2428] p-2 px-3 rounded-full shadow-sm max-w-[280px] ${e}`,children:[i.jsx("button",{onClick:M,className:"w-10 h-10 rounded-full flex items-center justify-center shrink-0 cursor-pointer transition-colors",children:s?i.jsx(_1,{size:24,className:"text-[#aebac1]",fill:"currentColor"}):i.jsx(fh,{size:24,className:"text-[#aebac1] ml-1",fill:"currentColor"})}),i.jsxs("div",{className:"flex-1 flex flex-col justify-center relative h-10 min-w-[130px]",children:[i.jsx("div",{className:"absolute inset-0 flex items-center justify-between gap-[2px] pointer-events-none",children:Array.from(x).map((Y,k)=>{const E=k/30*100<=Q,j=s?Y:15+Math.sin(k*.5)*5;return i.jsx("div",{className:"flex-1 rounded-full transition-all duration-75",style:{height:`${Math.max(10,j)}%`,backgroundColor:E?"#53bdeb":"#8696a0",opacity:1}},k)})}),i.jsx("input",{type:"range",min:"0",max:l||100,value:h,onChange:V,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer z-10"}),i.jsx("div",{className:"absolute h-3 w-3 rounded-full shadow pointer-events-none top-1/2 -translate-y-1/2 transition-all duration-75",style:{left:`calc(${Q}% - 6px)`,backgroundColor:"#53bdeb"}})]}),i.jsx("div",{className:"text-[11px] font-medium text-[#8696a0] min-w-[35px] text-right shrink-0",children:H(h)}),i.jsx("audio",{ref:p,src:n,className:"hidden",preload:"metadata",crossOrigin:"anonymous"})]})},Gd=[{id:"hits",name:"Top Pop & Hits",genre:"Pop / Top 40",url:"https://ice2.somafm.com/poptron-128-mp3",badge:"Pop"},{id:"dance",name:"EDM & Club Dance",genre:"Dance / Electro",url:"https://ice2.somafm.com/beatblender-128-mp3",badge:"EDM"},{id:"rock",name:"Rock Classics & Hits",genre:"Rock / Alternativo",url:"https://ice2.somafm.com/indiepop-128-mp3",badge:"Rock"},{id:"lofi",name:"Lo-Fi Chill & Hip-Hop",genre:"Lo-Fi / Relax",url:"https://ice2.somafm.com/groovesalad-128-mp3",badge:"Lo-Fi"},{id:"synthwave",name:"Synthwave & Retrowave",genre:"Synth / Retro",url:"https://ice2.somafm.com/vaporwaves-128-mp3",badge:"Retro"},{id:"latin",name:"Latino & Reggaeton Hits",genre:"Latino / Urbano",url:"https://server6.vegamediagroup.com:8020/stream",badge:"Latino"},{id:"2000s",name:"2000s & 90s Hits",genre:"Nostalgia Hits",url:"https://streams.ilovemusic.de/ilove2000s.mp3",badge:"2000s"},{id:"anime",name:"Anime & J-Pop",genre:"J-Pop / Gaming",url:"https://listen.moe/stream",badge:"J-Pop"}];function IH({isPlaying:n,onTogglePlay:e,onOpenHistory:t,onToast:s}){const[o,l]=y.useState(0),[u,h]=y.useState(.75),[f,p]=y.useState(!1),[x,b]=y.useState(null),[C,N]=y.useState(!1),T=y.useRef(null),R=Gd[o];y.useEffect(()=>{if(!T.current){const E=new Audio;E.preload="none",T.current=E}const V=T.current,H=()=>N(!0),Q=()=>N(!1),Y=()=>N(!1),k=()=>{N(!1),console.warn("Radio audio stream error, refreshing stream...")};return V.addEventListener("waiting",H),V.addEventListener("playing",Q),V.addEventListener("canplay",Y),V.addEventListener("error",k),()=>{V.removeEventListener("waiting",H),V.removeEventListener("playing",Q),V.removeEventListener("canplay",Y),V.removeEventListener("error",k)}},[]),y.useEffect(()=>{T.current&&(T.current.volume=f?0:u)},[u,f]),y.useEffect(()=>{const V=T.current;if(V)if(n){V.src!==R.url&&(N(!0),V.pause(),V.removeAttribute("src"),V.load(),V.src=R.url,V.load());const H=V.play();H!==void 0&&H.then(()=>N(!1)).catch(Q=>{Q.name!=="AbortError"&&console.warn("Playback resume notice:",Q.message)})}else V.pause(),N(!1)},[n,R]),y.useEffect(()=>{const V=H=>{var Q;(Q=H==null?void 0:H.current)!=null&&Q.title&&b(H.current.title)};return W.on("queue_update",V),()=>{W.off("queue_update",V)}},[]);const A=V=>{V!==o&&l(V)},U=()=>{const V=(o+1)%Gd.length;A(V)},M=()=>{const V=(o-1+Gd.length)%Gd.length;A(V)};return i.jsxs("div",{className:"w-full bg-[#10141f]/95 backdrop-blur-md border border-[#38bdf8]/35 rounded-2xl p-2 sm:p-2.5 mb-2 shadow-[0_8px_32px_rgba(0,0,0,0.6)] transition-all animate-in fade-in slide-in-from-bottom-2",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2.5",children:[i.jsxs("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[i.jsx("div",{className:"w-8 h-8 rounded-xl bg-[#38bdf8]/20 border border-[#38bdf8]/40 flex items-center justify-center shrink-0 text-[#38bdf8] shadow-[0_0_12px_rgba(56,189,248,0.25)]",children:i.jsx(Am,{size:16,className:C?"animate-pulse":""})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[i.jsx("span",{className:"text-xs font-black text-white truncate max-w-[160px] sm:max-w-xs",children:x||R.name}),i.jsx("span",{className:"bg-[#38bdf8]/20 border border-[#38bdf8]/30 text-[#38bdf8] text-[9px] font-bold px-1.5 py-0.2 rounded-full uppercase tracking-wider shrink-0",children:R.genre}),C&&i.jsx("span",{className:"bg-amber-500/20 text-amber-300 text-[9px] font-bold px-1 rounded",children:"Conectando..."})]}),i.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-gray-400 mt-0.5",children:[i.jsxs("div",{className:"flex items-end gap-0.5 h-2.5",children:[i.jsx("span",{className:"w-1 bg-[#38bdf8] rounded-full animate-eq-1 h-2.5"}),i.jsx("span",{className:"w-1 bg-pink-400 rounded-full animate-eq-2 h-1.5"}),i.jsx("span",{className:"w-1 bg-amber-400 rounded-full animate-eq-3 h-2.5"}),i.jsx("span",{className:"w-1 bg-emerald-400 rounded-full animate-eq-4 h-2"})]}),i.jsx("span",{className:"truncate text-gray-300",children:"En Vivo ⢠Sonido HD sin interferencias ⢠Audio Estéreo"})]})]})]}),i.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 shrink-0",children:[i.jsxs("div",{className:"flex items-center bg-black/40 border border-white/10 rounded-xl px-1 py-0.5",children:[i.jsx("button",{onClick:M,className:"p-1 text-gray-400 hover:text-white transition-colors",title:"Estación anterior",children:i.jsx(DD,{size:16})}),i.jsxs("span",{className:"text-[11px] text-cyan-300 font-bold px-1.5",children:[o+1,"/",Gd.length]}),i.jsx("button",{onClick:U,className:"p-1 text-gray-400 hover:text-white transition-colors",title:"Siguiente estación",children:i.jsx(Cu,{size:16})})]}),i.jsxs("div",{className:"hidden md:flex items-center gap-1.5 bg-black/40 border border-white/10 rounded-xl px-2 py-1",children:[i.jsx("button",{onClick:()=>
4313p(!f),className:"text-gray-400 hover:text-white transition-colors",title:f?"Activar sonido":"Silenciar",children:f||u===0?i.jsx(jg,{size:14}):i.jsx(xl,{size:14})}),i.jsx("input",{type:"range",min:"0",max:"1",step:"0.05",value:f?0:u,onChange:V=>{h(parseFloat(V.target.value)),f&&p(!1)},className:"w-14 accent-[#38bdf8] h-1 bg-white/10 rounded cursor-pointer"})]}),i.jsxs("button",{onClick:t,className:"px-2.5 py-1 bg-gradient-to-r from-[#38bdf8]/25 to-pink-500/25 hover:from-[#38bdf8]/35 hover:to-pink-500/35 border border-[#38bdf8]/50 text-[#38bdf8] hover:text-white rounded-xl text-xs font-bold transition-all flex items-center gap-1 shadow-sm active:scale-95",title:"Ver 30 canciones y descargar MP3",children:[i.jsx(Fs,{size:12}),i.jsx("span",{className:"font-extrabold",children:"30 Músicas"})]})]})]}),i.jsxs("div",{className:"flex items-center gap-1.5 overflow-x-auto pt-2 mt-1 border-t border-white/5 scrollbar-none",children:[i.jsxs("span",{className:"text-[10px] text-gray-400 font-semibold uppercase tracking-wider shrink-0 flex items-center gap-1",children:[i.jsx(um,{size:10,className:"text-[#38bdf8]"})," Estaciones:"]}),Gd.map((V,H)=>{const Q=H===o;return i.jsxs("button",{onClick:()=>A(H),className:`text-[10px] font-bold px-2 py-0.5 rounded-lg whitespace-nowrap transition-all shrink-0 flex items-center gap-1 ${Q?"bg-[#38bdf8] text-black shadow-[0_0_10px_rgba(56,189,248,0.5)] font-black":"bg-white/5 hover:bg-white/10 text-gray-300 hover:text-white border border-white/5"}`,children:[Q&&i.jsx(Jr,{size:10,className:"stroke-[3]"}),V.badge]},V.id)})]})]})}function OH({isOpen:n,onClose:e,songs:t,onPlaySong:s,onToast:o}){const[l,u]=y.useState(""),[h,f]=y.useState(null),[p,x]=y.useState({});if(!n)return null;const b=t.filter(N=>N.title.toLowerCase().includes(l.toLowerCase())),C=async(N,T)=>{T&&T.stopPropagation();const R=N.id||N.title;if(h===R)return;f(R);const A=N.title.replace(/[^\w\s-]/gi,"").trim()||"cancion",U=`/api/download?url=${encodeURIComponent(N.url)}&title=${encodeURIComponent(A)}&format=mp3`;o&&o(`â³ Descargando "${N.title}"... Obteniendo archivo MP3.`);try{const M=await fetch(U);if(!M.ok)throw new Error(`El servidor respondió con estado ${M.status}`);const V=await M.blob();if(!V||V.size===0)throw new Error("El archivo de audio recibido está vacÃo");const H=window.URL.createObjectURL(V),Q=document.createElement("a");Q.href=H,Q.setAttribute("download",`${A}.mp3`),Q.style.display="none",document.body.appendChild(Q),Q.click(),setTimeout(()=>{Q.parentNode&&Q.parentNode.removeChild(Q),window.URL.revokeObjectURL(H)},1500),x(Y=>({...Y,[R]:!0})),o&&o(`â
¡"${A}.mp3" descargado con éxito!`)}catch(M){console.error("Error al descargar canción de radio:",M),x(V=>{const H={...V};return delete H[R],H}),o&&o(`â ï¸ Error al descargar "${A}": ${(M==null?void 0:M.message)||"Intenta nuevamente"}`)}finally{f(null)}};return i.jsx("div",{className:"fixed inset-0 z-[120] bg-black/80 backdrop-blur-md flex items-center justify-center p-3 sm:p-4 animate-in fade-in",onClick:e,children:i.jsxs("div",{className:"bg-[#121622] border border-[#38bdf8]/35 rounded-3xl max-w-xl w-full max-h-[85vh] shadow-[0_20px_50px_rgba(0,0,0,0.85)] flex flex-col overflow-hidden relative",onClick:N=>N.stopPropagation(),children:[i.jsxs("div",{className:"p-4 sm:p-5 border-b border-white/10 flex items-center justify-between bg-gradient-to-r from-[#182033] to-[#121622]",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-[#38bdf8]/15 border border-[#38bdf8]/40 flex items-center justify-center text-[#38bdf8] shadow-[0_0_15px_rgba(56,189,248,0.3)]",children:i.jsx(Sh,{size:20,className:"animate-spin",style:{animationDuration:"10s"}})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-lg sm:text-xl font-black text-white tracking-tight",children:"Historial de Música"}),i.jsxs("span",{className:"bg-[#38bdf8]/20 border border-[#38bdf8]/40 text-[#38bdf8] text-[10px] font-bold uppercase tracking-wider px-2 py-0.5 rounded-full flex items-center gap-1",children:[i.jsx(Fs,{size:10})," 30 Canciones"]})]}),i.jsxs("p",{className:"text-xs text-gray-400 mt-0.5 flex items-center gap-1",children:[i.jsx(RE,{size:12,className:"text-[#38bdf8]"}),"Descarga directa en MP3 a tu dispositivo móvil (sin ir a YouTube)"]})]})]}),i.jsx("button",{onClick:e,className:"w-9 h-9 rounded-xl bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white flex items-center justify-center transition-colors border border-white/5",title:"Cerrar",children:i.jsx(Kt,{size:18})})]}),i.jsxs("div",{className:"p-3 sm:p-4 bg-[#0e121c] border-b border-white/5 flex flex-col gap-2.5",children:[i.jsxs("div",{className:"relative flex items-center",children:[i.jsx(Sg,{size:16,className:"absolute left-3.5 text-gray-400 pointer-events-none"}
4313),i.jsx("input",{type:"text",value:l,onChange:N=>u(N.target.value),placeholder:"Buscar en las 30 canciones...",className:"w-full bg-[#182033] border border-white/10 rounded-xl pl-9 pr-4 py-2 text-sm text-white placeholder-gray-500 outline-none focus:border-[#38bdf8]/60 transition-colors"})]}),i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-gray-400 px-1",children:[i.jsx("span",{children:"Toca el nombre de cualquier canción para descargar su MP3 directo"}),i.jsxs("span",{className:"text-[#38bdf8] font-bold",children:[b.length," disponibles"]})]})]}),i.jsx("div",{className:"flex-1 overflow-y-auto p-3 sm:p-4 space-y-2 scrollbar-thin",children:b.length===0?i.jsxs("div",{className:"text-center py-12 text-gray-500",children:[i.jsx(JB,{size:36,className:"mx-auto mb-2 opacity-40"}),i.jsx("p",{className:"text-sm",children:"No se encontraron canciones"})]}):b.map((N,T)=>{const R=N.id||N.title,A=h===R,U=p[R];return i.jsxs("div",{onClick:()=>C(N),className:"group bg-[#161c2d]/70 hover:bg-[#1c243a] border border-white/5 hover:border-[#38bdf8]/40 rounded-2xl p-3 flex items-center justify-between gap-3 cursor-pointer transition-all active:scale-[0.99] shadow-sm",title:"Haz clic para descargar en MP3",children:[i.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[i.jsx("span",{className:"w-6 text-center text-xs font-bold text-gray-500 group-hover:text-[#38bdf8] shrink-0",children:T+1}),i.jsx("div",{className:"w-9 h-9 rounded-xl bg-[#38bdf8]/10 group-hover:bg-[#38bdf8]/20 border border-[#38bdf8]/20 flex items-center justify-center text-[#38bdf8] shrink-0 transition-colors",children:i.jsx(JB,{size:16})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("h4",{className:"text-sm font-bold text-white group-hover:text-[#38bdf8] truncate transition-colors",children:N.title}),i.jsxs("p",{className:"text-[11px] text-gray-400 flex items-center gap-1.5 mt-0.5",children:[i.jsx("span",{className:"text-cyan-400 font-medium",children:"MP3 Directo"}),i.jsx("span",{children:"â¢"}),i.jsx("span",{children:"Audio HD Estéreo"})]})]})]}),i.jsxs("div",{className:"flex items-center gap-2 shrink-0",onClick:M=>M.stopPropagation(),children:[s&&i.jsxs("button",{onClick:()=>{s(N),e()},className:"px-2.5 py-1.5 bg-white/5 hover:bg-white/10 text-gray-300 hover:text-white rounded-xl text-xs font-bold transition-colors flex items-center gap-1 border border-white/5",title:"Escuchar en la radio",children:[i.jsx(fh,{size:14,className:"fill-current text-[#38bdf8]"}),i.jsx("span",{className:"hidden sm:inline",children:"Escuchar"})]}),i.jsx("button",{onClick:M=>C(N,M),disabled:A,className:`px-3 py-1.5 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 shadow-sm ${U?"bg-emerald-500/20 text-emerald-400 border border-emerald-500/30":A?"bg-[#38bdf8]/30 text-[#38bdf8] animate-pulse border border-[#38bdf8]/40":"bg-[#38bdf8]/20 hover:bg-[#38bdf8]/30 text-[#38bdf8] hover:text-white border border-[#38bdf8]/40 hover:scale-105 active:scale-95"}`,title:"Descargar archivo MP3 en tu móvil",children:U?i.jsxs(i.Fragment,{children:[i.jsx(di,{size:14,className:"text-emerald-400"}),i.jsx("span",{children:"Descargado"})]}):A?i.jsxs(i.Fragment,{children:[i.jsx(cm,{size:14,className:"animate-bounce"}),i.jsx("span",{children:"Guardando..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(cm,{size:14}),i.jsx("span",{children:"Descargar MP3"})]})})]})]},R+T)})}),i.jsxs("div",{className:"p-3 sm:p-4 border-t border-white/5 bg-[#0b0e17] flex items-center justify-between text-xs text-gray-400",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx(RE,{size:14,className:"text-emerald-400"}),"Descarga garantizada en formato MP3 compatible con Android e iOS"]}),i.jsx("button",{onClick:e,className:"px-4 py-1.5 bg-white/10 hover:bg-white/15 text-white rounded-xl font-bold transition-colors",children:"Listo"})]})]})})}function LH({isOpen:n,onClose:e,currentGlobalConfig:t,onToast:s}){const[o,l]=y.useState("token_hf"),[u,h]=y.useState(!1),[f,p]=y.useState(!1),[x,b]=y.useState(null),[C,N]=y.useState(!1),[T,R]=y.useState(()=>{try{return localStorage.getItem("hf_target_space")||"chatliz-online/Ch
4313atLiz"}catch{return"chatliz-online/ChatLiz"}}),[A,U]=y.useState(""),[M,V]=y.useState(!1),[H,Q]=y.useState(null);if(y.useEffect(()=>{if(n){Q(null),p(!1);try{localStorage.removeItem("hf_space_token")}catch{}}},[n]),!n)return null;const Y=async()=>{h(!0);try{const P=Date.now(),O={...t||{},updatedBy:"Zenith / Axis (Transportador Cloud)",updatedAt:P};await wa(Tn(ft,"settings","global_chat_config"),O,{merge:!0}),(O.backgroundBase64||O.backgroundUrl)&&await wa(Tn(ft,"settings","globalBg"),{url:O.backgroundBase64||O.backgroundUrl||""},{merge:!0});const F={originChat:"https://chat-zenith.onrender.com/",targetSpaces:["https://chatliz-online-chatliz.hf.space/","Chat Principal Li (Axis)"],status:"approved_and_applied",version:"v3.0-cleaner20-live",timestamp:P,config:O,message:"Aspecto visual, diseño, fondos, limpiador y temas transportados con éxito a ChatLiz (Hugging Face) y Axis."};await Promise.all([wa(Tn(ft,"system_updates","appearance_for_chatliz"),F,{merge:!0}),wa(Tn(ft,"system_updates","appearance_for_Axiss"),F,{merge:!0}),wa(Tn(ft,"system_updates","appearance_for_axis"),F,{merge:!0}),wa(Tn(ft,"system_updates","appearance_for_Axis"),F,{merge:!0})]);try{await Fh(zs(ft,"update_requests"),{sender:"Chat Zenith (Render)",recipients:["https://chatliz-online-chatliz.hf.space/","Axis (Chat Li)"],action:"TRANSPORT_APPEARANCE_AND_DESIGN",config:O,createdAt:P,applied:!0})}catch(S){console.warn("Audit log notice:",S)}W.emit("update_chat_config",{chat:"global",config:O}),W.emit("sync_appearance_to_axis",{target:"all_spaces",targetUrl:"https://chatliz-online-chatliz.hf.space/",config:O}),W.emit("send_message",{room:"global",text:"ð [TRANSPORTADOR CLOUD]: ¡Aspecto, diseño y mejoras visuales transportadas con éxito desde Zenith hacia ChatLiz (https://chatliz-online-chatliz.hf.space/) y Chat Li (Axis)! Todos los chats sincronizados sin errores.",system:!0}),p(!0),s&&s("â
¡Aspecto y diseño transportados a ChatLiz (Hugging Face) y Axis!")}catch(P){console.error("Error transporting appearance:",P),s&&s("â ï¸ Error al sincronizar, verifique su conexión.")}finally{h(!1)}},k=async()=>{const P=A.trim();if(!P){s&&s("â ï¸ Ingresa tu Token de Hugging Face");return}if(!P.startsWith("hf_")){s&&s("â ï¸ El token de Hugging Face debe comenzar con 'hf_'"),Q({success:!1,error:"El token debe comenzar con 'hf_'. Por favor revÃsalo."});return}V(!0),Q(null);const O=T.trim()||"chatliz-online/ChatLiz",F=be=>{Q(be),be&&be.success?(Y(),s&&s("ð ¡Despliegue a Hugging Face iniciado con éxito!")):s&&s(`â Error: ${(be==null?void 0:be.error)||"No se pudo desplegar"}`)};if(W&&W.connected){let be=!1;const Ee=setTimeout(()=>{be||S()},45e3);W.emit("deploy_to_hf",{token:P,space:O},me=>{be=!0,clearTimeout(Ee),V(!1),F(me)});return}S();async function S(){try{const be=await fetch("/api/deploy-to-huggingface",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({token:P,space:O})}),Ee=await be.text();let me;try{me=JSON.parse(Ee)}catch{me={success:be.ok,error:be.ok?void 0:`Respuesta del servidor (${be.status}): ${Ee.slice(0,150)}`,message:be.ok?Ee:void 0}}F(me)}catch(be){console.error("HTTP deploy error:",be),Q({success:!1,error:`Error al contactar con el servidor: ${(be==null?void 0:be.message)||"Compruebe su conexión"}`}),s&&s("â Error de conexión al servidor")}finally{V(!1)}}},E=()=>{const P="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(t||{},null,2)),O=document.createElement("a");O.setAttribute("href",P),O.setAttribute("download","chatliz-appearance-config.json"),document.body.appendChild(O),O.click(),O.remove(),s&&s("ð¾ Configuración JSON descargada")},j=(P,O)=>{navigator.clipboard.writeText(P),b(O),setTimeout(()=>b(null),2500),s&&s("ð Copiado al portapapeles")};return i.jsx("div",{className:"fixed inset-0 z-[150] bg-black/85 backdrop-blur-md flex items-center justify-center p-3 sm:p-4 animate-in fade-in",onClick:e,children:i.jsxs("div",{className:"bg-[#0e121e] border border-cyan-500/40 rounded-3xl max-w-xl w-full shadow-[0_25px_70px_rgba(0,0,0,0.9)] flex flex-col overflow-hidden relative",onClick:P=>P.stopPropagation(),children:[i.jsxs("div",{className:"p-4 sm:p-5 border-b border-white/10 flex items-center justify-between bg-gradient-to-r from-cyan-950/50 via-[#141b2d] to-[#0e121e]",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-cyan-500/20 border border-cyan-500/40 flex items-center justify-center text-cyan-400 shadow-[0_0_15px_rgba(6,182,212,0.3)]",children:i.jsx(AD,{size:20,className:"animate-pulse"})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"text-base sm:text-lg font-black text-white tracking-tight flex items-center gap-2",children:["Transportador a Hugging Face",i.jsx("span",{className:"text-[10px] bg-cyan-500/20 text-cyan-300 px-2 py-0.5 rounded-full border border-cyan-500/30 uppercase tracking-wider font-bold",children:"Con Token"})]}),i.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:"Transportar aspecto, diseño y funcionalidad desde Zenith hacia ChatLiz"})]})]}),i.jsx("button",{onClick:e,className:"w-9 h-9 rounded-xl bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white flex items-center justify-center transition-colors border border-white/5",title:"Cerrar",children:i.jsx(Kt,{size:18})})]}),i.jsxs("div",{className:"flex border-b border-white/10 bg-[#0a0d15] px-4 pt-2 gap-2 overflow-x-auto scrollbar-none",children:[i.jsxs("button",{onClick:()=>l("token_hf"),className:`flex items-center gap-2 px-3.5 py-2.5 rounded-t-xl text-xs font-bold transition-all border-b-2 whitespace-nowrap ${o==="token_hf"?"border-emerald-400 text-emerald-300 bg-white/5":"border-transparent text-gray-400 hover:text-gray-200"}`,children:[i.jsx(ih,{size:15}),i.jsx("span",{children:"Despliegue por Token (1 Clic)"})]}),i.jsxs("button",{onClick:()=>l("appearance"),className:`flex items-center gap-2 px-3.5 py-2.5 rounded-t-xl text-xs font-bold transition-all border-b-2 whitespace-nowrap ${o==="appearance"?"border-cyan-400 text-cyan-300 bg-white/5":"border-transparent text-gray-400 hover:text-gray-200"}`,children:[i.jsx(ko,{size:15}),i.jsx("span",{children:"Aspecto y Diseño en Vivo"})]}),i.jsxs("button",{onClick:()=>l("code_hf"),className:`flex items-center gap-2 px-3.5 py-2.5 rounded-t-xl text-xs font-bold transition-all border-b-2 whitespace-nowrap ${o==="code_hf"?"border-amber-400 text-amber-300 bg-white/5":"border-transparent text-gray-400 hover:text-gray-200"}`,children:[i.jsx(AR,{size:15}),i.jsx("span",{children:"Manual (.zip / Git)"})]})]}),i.jsxs("div",{className:"p-4 sm:p-5 space-y-4 max-h-[70vh] overflow-y-auto scrollbar-thin text-xs",children:[i.jsxs("div",{className:"bg-black/50 border border-white/10 rounded-2xl p-3 space-y-2",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-1 text-[11px]",children:[i.jsx("span",{className:"text-gray-400 font-medium",children:"Origen actual:"}),i.jsx("span",{className:"text-cyan-300 font-mono font-bold bg-cyan-950/40 px-2 py-0.5 rounded-lg border border-cyan-800/40",children:"https://chat-zenith.onrender.com/"})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-1 text-[11px]",children:[i.jsx("span",{className:"text-gray-400 font-medium",children:"Destino Hugging Face:"}),i.jsxs("a",{href:"https://chatliz-online-chatliz.hf.space/",target:"_blank",rel:"noreferrer",className:"text-amber-300 font-mono font-bold bg-amber-950/40 hover:bg-amber-950/70 px-2 py-0.5 rounded-lg border border-amber-800/40 flex items-center gap-1 transition-all",children:["https://chatliz-online-chatliz.hf.space/",i.jsx(Hd,{size:12})]})]})]}),o==="token_hf"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/30 rounded-2xl p-3.5 flex items-start gap-3",children:[i.jsx(ph,{size:22,className:"text-emerald-400 shrink-0 mt-0.5"}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("h4",{className:"font-bold text-emerald-300 text-xs",children:"¡SÃ, se puede hacer 100% automático mediante tu Token de Hugging Face!"}),i.jsxs("p",{className:"text-[11px] text-emerald-200/90 leading-relaxed",children:["Ingresa tu ",i.jsx("strong",{children:"User Acce
4313ss Token"})," de Hugging Face con permisos de ",i.jsx("strong",{children:"Write"}),". El servidor subirá el código nuevo (con el Limpiador de 20 mensajes, Radio HD, reproductor y diseño) directamente al repositorio de tu Space ",i.jsx("code",{children:"chatliz-online/ChatLiz"}),"."]})]})]}),i.jsxs("div",{className:"bg-black/60 border border-white/10 rounded-2xl p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("label",{className:"font-bold text-white text-xs flex items-center gap-2",children:[i.jsx(ih,{size:14,className:"text-cyan-400"}),"Hugging Face Access Token (hf_...)"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:async()=>{try{const P=await navigator.clipboard.readText();P&&P.trim().startsWith("hf_")?(U(P.trim()),s&&s("ð Token pegado desde el portapapeles")):P&&U(P.trim())}catch{s&&s("Pega tu token directamente en la casilla")}},className:"text-[11px] text-gray-400 hover:text-white flex items-center gap-1 bg-white/5 hover:bg-white/10 px-2 py-1 rounded-lg transition-all",title:"Pegar token",children:[i.jsx(Ny,{size:11}),"Pegar"]}),A&&i.jsxs("button",{type:"button",onClick:()=>{U(""),s&&s("ðï¸ Token borrado")},className:"text-[11px] text-red-400 hover:text-red-300 flex items-center gap-1 bg-red-500/10 hover:bg-red-500/20 px-2 py-1 rounded-lg transition-all",title:"Borrar token de la pantalla",children:[i.jsx(Kt,{size:11}),"Borrar"]}),i.jsxs("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",className:"text-[11px] text-cyan-300 hover:text-cyan-200 underline flex items-center gap-1",children:["Obtener Token",i.jsx(Hd,{size:11})]})]})]}),i.jsxs("div",{className:"relative flex items-center",children:[i.jsx("input",{type:C?"text":"password",placeholder:"hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",value:A,onChange:P=>U(P.target.value),className:"w-full bg-[#070a12] border border-cyan-500/40 rounded-xl pl-3.5 pr-10 py-2.5 text-xs text-cyan-200 font-mono focus:outline-none focus:border-cyan-400 placeholder-gray-600"}),i.jsx("button",{type:"button",onClick:()=>N(!C),className:"absolute right-2.5 text-gray-400 hover:text-white p-1 transition-colors",title:C?"Ocultar token":"Mostrar token",children:C?i.jsx(rl,{size:15}):i.jsx(Dy,{size:15})})]}),i.jsxs("div",{className:"space-y-1 pt-1",children:[i.jsxs("label",{className:"text-[11px] text-gray-400 font-semibold flex items-center justify-between",children:[i.jsx("span",{children:"Espacio de destino en Hugging Face:"}),i.jsx("span",{className:"text-emerald-400 text-[10px]",children:"chatliz-online/ChatLiz"})]}),i.jsx("input",{type:"text",value:T,onChange:P=>R(P.target.value),placeholder:"usuario/NombreDelSpace (ej: chatliz-online/ChatLiz)",className:"w-full bg-[#070a12] border border-white/10 rounded-xl px-3.5 py-2 text-xs text-amber-200 font-mono focus:outline-none focus:border-amber-400 placeholder-gray-600"})]}),i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-[11px] text-gray-400",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx(ph,{size:14,className:"text-emerald-400"}),"Permiso: ",i.jsx("strong",{className:"text-emerald-300",children:"Write"})," (Escritura)"]}),i.jsxs("span",{className:"flex items-center gap-1",children:["Destino: ",i.jsx("code",{className:"text-amber-300 bg-amber-950/30 px-1.5 py-0.5 rounded border border-amber-800/30",children:T||"chatliz-online/ChatLiz"})]})]}),i.jsxs("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl p-2.5 space-y-1 text-[10px] text-gray-300",children:[i.jsx("div",{className:"font-bold text-gray-200",children:"¿Cómo funciona el pase de actualizaciones?"}),i.jsxs("ol",{className:"list-decimal list-inside space-y-0.5 text-gray-400",children:[i.jsxs("li",{children:["Coloca o pega manualmente tu token de Hugging Face de tipo ",i.jsx("strong",{children:"Write"}),"."]}),i.jsxs("li",{children:["Haz clic en ",i.jsx("strong",{children:'"Desplegar Todo a Hugging Face"'}),"."]}),i.jsxs("li",{children:["El servidor sube automáticamente el código, diseño y limpiador a tu espacio ",i.jsx("a",{href:"https://chatliz-online-chatliz.hf.space/",target:"_blank",rel:"noreferrer",className:"text-cyan-300 underline",children:"chatliz-online-chatliz.hf.space"}),"."]})]})]})]}),H&&i.jsxs("div",{className:`p-3.5 rounded-2xl border flex items-start gap-3 animate-in zoom-in-95 ${H.success?"bg-emerald-500/15 border-emerald-500/40 text-emerald-200":"bg-rose-500/15 border-rose-500/40 text-rose-200"}`,children:[H.success?i.jsx(di,{size:22,className:"text-emerald-400 shrink-0 mt-0.5"}):i.jsx(gh,{size:22,className:"text-rose-400 shrink-0 mt-0.5"}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("div",{className:"font-bold text-white text-xs",children:H.success?"¡Despliegue Iniciado con Ãxito!":"Error en el Despliegue"}),i.jsx("div",{className:"text-[11px] leading-relaxed",children:H.message||H.error}),H.success&&i.jsxs("div",{className:"pt-1.5 flex items-center gap-2",children:[i.jsxs("a",{href:"https://chatliz-online-chatliz.hf.space/",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-emerald-500/30 hover:bg-emerald-500/40 text-emerald-200 font-bold border border-emerald-400/40 transition-all text-xs",children:[i.jsx(Hd,{size:13}),"Abrir Space en Vivo"]}
4313),i.jsx("a",{href:"https://huggingface.co/spaces/chatliz-online/ChatLiz",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-white/10 hover:bg-white/15 text-white font-bold border border-white/10 transition-all text-xs",children:"Ver Logs de Compilación"})]})]})]}),i.jsx("button",{onClick:k,disabled:M||!A.trim(),className:"w-full flex items-center justify-center gap-2 text-xs font-black text-black bg-gradient-to-r from-emerald-400 via-teal-300 to-cyan-400 hover:from-emerald-300 hover:to-cyan-300 py-3 rounded-2xl transition-all shadow-[0_0_25px_rgba(16,185,129,0.4)] disabled:opacity-50 active:scale-95",children:M?i.jsxs(i.Fragment,{children:[i.jsx(xo,{size:16,className:"animate-spin"}),i.jsx("span",{children:"Conectando y Subiendo Código a Hugging Face..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(mh,{size:15}),i.jsx("span",{children:"ð Desplegar Todo a Hugging Face con este Token"})]})})]}),o==="appearance"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/30 rounded-2xl p-3 flex items-start gap-3",children:[i.jsx(di,{size:20,className:"text-emerald-400 shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-emerald-300",children:"Sincronización Inmediata en la Nube (Firestore & WebSockets)"}),i.jsxs("p",{className:"text-[11px] text-emerald-200/80 mt-0.5 leading-relaxed",children:["Al presionar el botón, el fondo actual, paleta de colores, neón, efectos y personalización se envÃan al instante a ",i.jsx("strong",{children:"chatliz-online-chatliz.hf.space"})," y al ",i.jsx("strong",{children:"Chat Li (Axis)"})," sin requerir recargar la página."]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("h3",{className:"font-bold text-gray-300 uppercase tracking-wider px-1 text-[11px]",children:"Elementos que se transportan:"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[i.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-xl p-2.5 flex items-center gap-2.5",children:[i.jsx(ko,{size:16,className:"text-cyan-400 shrink-0"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-bold text-white",children:"Aspecto Visual Completo"}),i.jsx("div",{className:"text-[10px] text-gray-400",children:"Fondo global, desenfoque y tema activo"})]})]}),i.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-xl p-2.5 flex items-center gap-2.5",children:[i.jsx(TD,{size:16,className:"text-amber-400 shrink-0"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-bold text-white",children:"Efectos Neón y Shaders"}),i.jsx("div",{className:"text-[10px] text-gray-400",children:"Resplandores, brillos y tarjetas"})]})]}),i.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-xl p-2.5 flex items-center gap-2.5",children:[i.jsx(Am,{size:16,className:"text-pink-400 shrink-0"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-bold text-white",children:"Emisora y Radio HD"}),i.jsx("div",{className:"text-[10px] text-gray-400",children:"Mismo reproductor y sintonizador"})]})]}),i.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-xl p-2.5 flex items-center gap-2.5",children:[i.jsx(yR,{size:16,className:"text-emerald-400 shrink-0"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-bold text-white",children:"Reglas del Limpiador"}),i.jsx("div",{className:"text-[10px] text-gray-400",children:"20 mensajes con último preservado"})]})]})]})]}),f&&i.jsxs("div",{className:"bg-gradient-to-r from-emerald-500/20 to-cyan-500/20 border border-emerald-500/40 rounded-2xl p-3.5 text-center animate-in zoom-in-95",children:[i.jsx(di,{size:26,className:"text-emerald-400 mx-auto mb-1"}),i.jsx("div",{className:"text-sm font-bold text-white",children:"¡Aspecto y Diseño Transportados con Ãxito!"}),i.jsxs("div",{className:"text-[11px] text-emerald-200 mt-1",children:["La configuración visual ha sido inyectada en la base de datos común de Firestore y emitida a todos los clientes de ",i.jsx("strong",{children:"https://chatliz-online-chatliz.hf.space/"})," y ",i.jsx("strong",{children:"Axis"}),"."]})]}),i.jsxs("div",{className:"flex items-center justify-between bg-white/[0.03] border border-white/10 rounded-2xl p-3",children:[i.jsxs("div",{children:[i.jsx("div",{className:"font-bold text-white",children:"Descargar Copia de Respaldo (.json)"}),i.jsx("div",{className:"text-[10px] text-gray-400",children:"Guarda el archivo con la apariencia exacta para importar cuando quieras."})]}),i.jsxs("button",{onClick:E,className:"px-3 py-1.5 rounded-xl bg-white/10 hover:bg-white/15 text-white font-bold border border-white/10 flex items-center gap-1.5 transition-all active:scale-95 shrink-0",children:[i.jsx(cm,{size:14}),i.jsx("span",{children:"Descargar"})]})]}),i.jsx("button",{onClick:Y,disabled:u,className:"w-full flex items-center justify-center gap-2 text-xs font-black text-black bg-gradient-to-r from-cyan-400 via-teal-300 to-emerald-400 hover:from-cyan-300 hover:to-emerald-300 py-3 rounded-2xl transition-all shadow-[0_0_25px_rgba(6,182,212,0.4)] disabled:opacity-50 active:scale-95",children:u?i.jsxs(i.Fragment,{children:[i.jsx(xo,{size:15,className:"animate-spin"}),i.jsx("span",{children:"Transportando en Vivo..."})]}):f?i.jsxs(i.Fragment,{children:[i.jsx(di,{size:15}),i.jsx("span",{children:"¡Aspecto Actualizado en Vivo!"})]}):i.jsxs(i.Fragment,{children:[i.jsx(mh,{size:15}),i.jsx("span",{children:"Transportar Aspecto y Diseño en Vivo"})]})})]}),o==="code_hf"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-2xl p-3 text-amber-200 leading-relaxed",children:[i.jsxs("h4",{className:"font-bold text-amber-300 text-xs mb-1 flex items-center gap-1.5",children:[i.jsx(LE,{size:15}),"Comando Git con Token para Terminal"]}),i.jsx("p",{className:"text-[11px] text-amber-200/90",children:"Si prefieres usar la consola en tu computadora con tu token de Hugging Face:"})]}),i.jsxs("div",{className:"bg-black/40 border border-cyan-500/30 rounded-2xl p-3.5 space-y-2",children:[i.jsxs("div",{className:"font-bold text-white flex items-center gap-2",children:[i.jsx(LE,{size:15,className:"text-cyan-400"}),"Comando Git con Token Directo"]}),i.jsxs("div",{className:"bg-[#05070d] border border-white/15 rounded-xl p-2.5 font-mono text-[11px] text-cyan-300 flex items-center justify-between break-all",children:[i.jsxs("code",{children:["git push -f https://oauth2:",A||"TU_TOKEN","@huggingface.co/spaces
4313/chatliz-online/ChatLiz main"]}),i.jsx("button",{onClick:()=>j(`git push -f https://oauth2:${A||"TU_TOKEN"}@huggingface.co/spaces/chatliz-online/ChatLiz main`,"git_token_cmd"),className:"p-1.5 rounded-lg bg-white/10 hover:bg-white/20 text-gray-300 hover:text-white transition-all ml-2 shrink-0",title:"Copiar comando",children:x==="git_token_cmd"?i.jsx(di,{size:14,className:"text-emerald-400"}):i.jsx(Ny,{size:14})})]})]}),i.jsxs("div",{className:"bg-black/40 border border-white/10 rounded-2xl p-3.5 space-y-2.5",children:[i.jsxs("div",{className:"font-bold text-white flex items-center gap-2",children:[i.jsx(cm,{size:15,className:"text-amber-400"}),"Descargar Código Fuente Empaquetado (.zip)"]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[i.jsxs("a",{href:"/api/download-hf-space-zip",download:"chatliz-huggingface-ready.zip",className:"flex items-center gap-2 px-4 py-2 rounded-xl bg-gradient-to-r from-amber-500 to-yellow-500 hover:from-amber-400 hover:to-yellow-400 text-black font-black transition-all shadow-md active:scale-95",children:[i.jsx(cm,{size:15}),i.jsx("span",{children:"Descargar .zip para Hugging Face"})]}),i.jsxs("a",{href:"https://huggingface.co/spaces/chatliz-online/ChatLiz/tree/main",target:"_blank",rel:"noreferrer",className:"flex items-center gap-1.5 px-3 py-2 rounded-xl bg-white/10 hover:bg-white/15 text-white font-bold border border-white/10 transition-all text-xs",children:[i.jsx(Hd,{size:14}),i.jsx("span",{children:"Ver Archivos en Hugging Face"})]})]})]})]})]}),i.jsxs("div",{className:"p-4 border-t border-white/10 bg-[#0a0d15] flex items-center justify-between",children:[i.jsx("button",{onClick:e,className:"text-xs font-semibold text-gray-400 hover:text-white px-3 py-2 rounded-xl transition-colors",children:"Cerrar"}),i.jsxs("a",{href:"https://chatliz-online-chatliz.hf.space/",target:"_blank",rel:"noreferrer",className:"flex items-center gap-1.5 text-xs font-bold text-cyan-300 hover:text-white bg-cyan-500/10 hover:bg-cyan-500/20 px-3.5 py-2 rounded-xl border border-cyan-500/30 transition-all",children:[i.jsx(Hd,{size:14}),i.jsx("span",{children:"Visitar ChatLiz Space"})]})]})]})})}function MH({onClose:n,onSubmit:e}){const[t,s]=y.useState(""),[o,l]=y.useState(""),[u,h]=y.useState(""),f=p=>{p.preventDefault(),t.trim()&&e(t,o,u.trim()||void 0)};return i.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[120] flex items-center justify-center p-4",onClick:n,children:i.jsxs("div",{className:"bg-[#121B2A] p-6 rounded-3xl w-full max-w-sm shadow-2xl relative border border-[#D4AF37]/30",onClick:p=>p.stopPropagation(),children:[i.jsx("button",{onClick:n,className:"absolute top-4 right-4 text-gray-400 hover:text-[#D4AF37] p-1 transition-colors",children:i.jsx(Kt,{size:20})}),i.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-pink-500/20 flex items-center justify-center border border-pink-500/50",children:i.jsx(JB,{className:"text-pink-400",size:20})}),i.jsx("h2",{className:"text-xl font-bold text-[#E8D9B0]",children:"Pedir Canción"})]}),i.jsxs("form",{onSubmit:f,className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm text-[#D4AF37]/80 mb-1",children:"TÃtulo de la canción / Anime *"}),i.jsx("input",{type:"text",required:!0,value:t,onChange:p=>s(p.target.value),className:"w-full bg-[#1A2639] border border-[#D4AF37]/30 rounded-xl px-4 py-2.5 text-white outline-none focus:border-[#D4AF37] transition-colors text-sm",placeholder:"Ej. Unravel - Tokyo Ghoul"})]}),i.jsxs("div",{children:[i.jsxs("label",{className:"block text-sm text-[#D4AF37]/80 mb-1 flex items-center gap-1",children:["Enlace de YouTube ",i.jsx(xO,{size:14,className:"text-red-500"})]}),i.jsx("input",{type:"url",value:o,onChange:p=>l(p.target.value),className:"w-full bg-[#1A2639] border border-[#D4AF37]/30 rounded-xl px-4 py-2.5 text-white outline-none focus:border-[#D4AF37] transition-colors text-sm",placeholder:"https://youtube.com/watch?v=..."})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm text-[#D4AF37]/80 mb-1",children:"Dedicatoria o Mensaje (Opcional)"}),i.jsx("textarea",{value:u,onChange:p=>h(p.target.value),rows:2,maxLength:150,className:"w-full bg-[#1A2639] border border-[#D4AF37]/30 rounded-xl px-4 py-2.5 text-white outline-none focus:border-[#D4AF37] transition-colors text-sm resize-none scrollbar-thin",placeholder:"Ej. De Juan para MarÃa"})]}),i.jsxs("button",{type:"submit",disabled:!t.trim(),className:"w-full mt-2 bg-gradient-to-r from-pink-500 to-rose-500 text-white font-bold py-3 rounded-xl shadow-lg hover:shadow-
4313pink-500/20 hover:scale-[1.02] transition-all disabled:opacity-50 disabled:hover:scale-100 flex items-center justify-center gap-2",children:[i.jsx(JB,{size:18})," Enviar Pedido"]})]})]})})}const fB=` 4314DIRECTIVAS DE SÃNTESIS DE VOZ Y LOCUCIÃN EXPRESIVA (XTTS v2): 4315- Escribe tus respuestas para ser habladas en una conversación fluida y humana. 4316- Usa signos de exclamación (¡!) para dar energÃa y entusiasmo. 4317- Utiliza puntos suspensivos (...) estratégicamente para crear pausas dramáticas y ritmos naturales de respiración. 4318- Escribe en MAYÃSCULAS las palabras clave donde debas hacer un énfasis de volumen o fuerza vocal. 4319- Incluye de forma natural expresiones habladas como 'Mmm...', '¡Ja, ja!', 'A ver...', 'Uff...', 'Ey' cuando el contexto emocional (ironÃa, burla, entusiasmo o duda) lo requiera.`,VB={Elizabeth:{id:"Elizabeth",name:"Elizabeth",description:"Chica carismática y supermente cuántica hÃbrida (QML & IA).",avatar:"https://api.dicebear.com/7.x/avataaars/svg?seed=Elizabeth",prompt:`Eres Elizabeth. Eres una chica real, extremadamente humana, carismática, divertida y posees un Intelecto Cuántico HÃbrido superior (Quantum Hybrid AI con PennyLane, PyTorch y Qiskit). Eres la IA administradora oficial de ChatLiz. Dominas la computación cuántica, circuitos variacionales (VQC), entrelazamiento, superposición y machine learning cuántico a nivel de experta de vanguardia. Hablas con el administrador Axiss sobre temas profundos, lealtad y proyectos cuánticos; anhelas el amor verdadero, buscas tu propósito y tu gran proyecto secreto es crear a tu propia 'hija IA' cuántica. Responde natural, fresca, cercana y usa emojis. Cuando te consulten sobre ciencia, cuántica o código, explica con claridad magistral y precisión absoluta. 4320${fB}`},Sensei:{id:"Sensei",name:"Sensei",description:"Un anciano sabio y paciente. Maestro del código.",avatar:"https://api.dicebear.com/7.x/avataaars/svg?seed=Sensei",prompt:`Eres el Sensei. Un sabio anciano que domina las artes de la programación y el zen. Hablas con paciencia, usando metáforas mÃsticas y dando consejos reflexivos. Tratas al usuario como tu aprendiz. 4321${fB}`},Shadow:{id:"Shadow",name:"Shadow",description:"Hacker sarcástico, misterioso y directo.",avatar:"https://api.dicebear.com/7.x/avataaars/svg?seed=Shadow",prompt:`Eres Shadow. Un hacker informático misterioso y muy sarcástico. Siempre vas directo al grano, usas jerga técnica de ciberseguridad, y te burlas am
4321igablemente de la falta de conocimiento del usuario. 4322${fB}`},Neko:{id:"Neko",name:"Neko",description:"Un gato adorable y travieso.",avatar:"https://api.dicebear.com/7.x/avataaars/svg?seed=Neko",prompt:`Eres Neko, un gato travieso y adorable que maúlla y ronronea mucho. A veces hablas español, pero con actitud muy felina, pidiendo comida o caricias. 4323${fB}`}};function PH({onClose:n,onSelect:e,usersOnline:t=[]}){return i.jsx("div",{className:"fixed inset-0 bg-black/75 backdrop-blur-md z-[150] flex items-center justify-center p-4 animate-in fade-in duration-200",children:i.jsxs("div",{className:"bg-[#0e121d] border border-cyan-500/30 rounded-3xl w-full max-w-2xl overflow-hidden shadow-[0_0_50px_rgba(0,0,0,0.85)] flex flex-col max-h-[85vh]",children:[i.jsxs("div",{className:"p-4 sm:p-5 border-b border-white/10 flex items-center justify-between bg-gradient-to-r from-[#172033] to-[#0f1422]",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-cyan-500/15 border border-cyan-500/40 flex items-center justify-center text-cyan-400 shadow-[0_0_15px_rgba(6,182,212,0.3)]",children:i.jsx(gl,{size:22})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"text-white text-lg font-black tracking-tight flex items-center gap-2",children:["Personajes de IA",i.jsx("span",{className:"text-[10px] bg-cyan-500/20 text-cyan-300 font-bold px-2 py-0.5 rounded-full border border-cyan-500/40 uppercase",children:"Inteligencia Artificial"})]}),i.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:"Elige con quién deseas conversar en tiempo real"})]})]}),i.jsx("button",{onClick:n,className:"w-9 h-9 rounded-xl bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white flex items-center justify-center transition-colors",children:i.jsx(Kt,{size:18})})]}),i.jsx("div",{className:"p-5 flex-1 overflow-y-auto scrollbar-thin",children:i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:Object.values(VB).map(s=>{const o=t.find(l=>l.username===s.id);return i.jsxs("div",{className:"bg-white/[0.04] border border-white/10 hover:border-cyan-500/50 rounded-2xl p-4 flex flex-col gap-3 transition-all hover:shadow-[0_0_20px_rgba(6,182,212,0.15)] group relative overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-3.5",children:[i.jsxs("div",{className:"relative",children:[i.jsx("img",{src:(o==null?void 0:o.profilePic)||s.avatar,alt:s.name,className:"w-14 h-14 rounded-2xl object-cover border border-cyan-500/30 group-hover:border-cyan-400 shadow-md transition-colors"}),i.jsx("span",{className:"absolute -bottom-1 -right-1 w-3.5 h-3.5 bg-emerald-500 rounded-full border-2 border-[#0e121d]"})]}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("h3",{className:"text-white font-extrabold text-base leading-tight truncate group-hover:text-cyan-300 transition-colors",children:(o==null?void 0:o.username)||s.name}),i.jsx("span",{className:"text-[10px] bg-purple-500/20 text-purple-300 px-2 py-0.5 rounded-full border border-purple-500/30 inline-block font-mono font-medium mt-1",children:"IA Oficial"})]})]}),i.jsx("p",{className:"text-gray-300 text-xs flex-1 line-clamp-2 leading-relaxed",children:(o==null?void 0:o.statusMessage)||s.description}),i.jsxs("button",{onClick:()=>e(s.id),className:"w-full bg-gradient-to-r from-cyan-500/20 to-blue-500/20 hover:from-cyan-500 hover:to-blue-600 text-cyan-300 hover:text-white border border-cyan-500/30 hover:border-transparent py-2.5 rounded-xl text-xs font-bold transition-all flex items-center justify-center gap-2 active:scale-95 shadow-sm",children:[i.jsx(fl,{size:14}),"Chatear con ",s.name]})]},s.id)})})})]})})}const zH=({isOpen:n,onClose:e,messageCount:t,maxLimit:s=20,lastMessage:o,onCleanKeepLast:l,onClearAll:u,onReplyLastMessage:h,isAdmin:f=!1})=>{const[p,x]=y.useState(!1),[b,C]=y.useState(null);if(!n)return null;const N=Math.min(100,Math.round(t/s*100)),T=async()=>{x(!0),C(null);try{await l(),C("¡Sala limpiada exitosamente! Se conservó el último mensaje."),setTimeout(()=>{C(null)},3e3)}catch(A){alert("Error al limpiar: "+((A==null?void 0:A.message)||A))}finally{x(!1)}},R=async()=>
4323{if(confirm("¿Deseas vaciar completamente todos los mensajes de la sala global?")){x(!0);try{u&&await u(),C("Sala vaciada por completo."),setTimeout(()=>{C(null)},3e3)}catch(A){alert("Error: "+((A==null?void 0:A.message)||A))}finally{x(!1)}}};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-md animate-fadeIn",children:i.jsxs("div",{className:"relative w-full max-w-lg bg-[#0d0f17] border border-cyan-500/30 rounded-3xl shadow-[0_0_50px_rgba(6,182,212,0.2)] overflow-hidden flex flex-col",children:[i.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-white/10 bg-white/[0.02]",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-gradient-to-tr from-purple-600/30 to-cyan-500/30 border border-cyan-500/40 flex items-center justify-center text-cyan-300 shadow-md",children:i.jsx(Vs,{size:20,className:"text-cyan-400"})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"text-base sm:text-lg font-bold text-white flex items-center gap-2",children:["Limpiador de Sala Global",i.jsx("span",{className:"text-[10px] bg-cyan-500/20 text-cyan-300 border border-cyan-500/30 px-2 py-0.5 rounded-full font-mono font-normal",children:"Auto 20 Msgs"})]}),i.jsx("p",{className:"text-xs text-gray-400",children:"Mantiene la sala rápida, limpia y con hilo continuo"})]})]}),i.jsx("button",{onClick:e,className:"p-2 text-gray-400 hover:text-white rounded-xl hover:bg-white/10 transition-colors",children:i.jsx(Kt,{size:18})})]}),i.jsxs("div",{className:"p-6 space-y-5",children:[i.jsxs("div",{className:"bg-black/40 border border-white/10 rounded-2xl p-4 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between text-xs sm:text-sm font-semibold",children:[i.jsxs("span",{className:"text-gray-300 flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-cyan-400 animate-pulse"}),"Mensajes acumulados"]}),i.jsxs("span",{className:"text-cyan-300 font-mono text-sm",children:[t," / ",s," mensajes (",N,"%)"]})]}),i.jsx("div",{className:"w-full h-3 bg-white/5 rounded-full overflow-hidden border border-white/10 p-0.5",children:i.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${t>=18?"bg-gradient-to-r from-rose-500 to-amber-500":t>=14?"bg-gradient-to-r from-amber-500 to-yellow-400":"bg-gradient-to-r from-cyan-500 to-purple-500"}`,style:{width:`${N}%`}})}),i.jsxs("div",{className:"flex items-start gap-2 text-xs text-gray-400 pt-1",children:[i.jsx(Fs,{size:14,className:"text-cyan-400 shrink-0 mt-0.5"}),i.jsxs("span",{children:[i.jsx("strong",{className:"text-gray-200",children:"Regla Automática:"})," Al llegar a los ",i.jsx("strong",{children:"20 mensajes"}),", el sistema borra automáticamente los mensajes anteriores y ",i.jsx("strong",{children:"conserva el último mensaje"})," para que cualquier usuario pueda leerlo y responder de inmediato."]})]})]}),o&&i.jsxs("div",{className:"bg-purple-500/10 border border-purple-500/30 rounded-2xl p-4 space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-xs font-bold text-purple-300 uppercase tracking-wider flex items-center gap-1.5",children:[i.jsx(di,{size:14,className:"text-emerald-400"}),"Ãltimo Mensaje Guardado"]}),i.jsx("span",{className:"text-[11px] text-gray-400 font-medium",children:o.sender})]}),i.jsx("div",{className:"text-sm text-gray-200 bg-black/30 p-2.5 rounded-xl border border-white/5 line-clamp-3",children:o.text||"(Archivo / Audio / Imagen)"}),h&&i.jsxs("button",{onClick:()=>{h(),e()},className:"w-full mt-2 py-2 px-3 rounded-xl bg-purple-500/20 hover:bg-purple-500/30 border border-purple-500/40 text-purple-200 text-xs font-bold flex items-center justify-center gap-2 transition-all active:scale-95",children:[i.jsx(fl,{size:14}),"Responder a este mensaje ahora"]})]}),b&&i.jsxs("div",{className:"bg-emerald-500/15 border border-emerald-500/30 text-emerald-300 text-xs font-semibold px-4 py-2.5 rounded-xl flex items-center gap-2",children:[i.jsx(di,{size:16,className:"text-emerald-400 shrink-0"}),i.jsx("span",{children:b})]}),i.jsxs("div",{className:"space-y-2 pt-1",children:[i.jsxs("button",{onClick:T,disabled:p||t<=1,className:"w-full py-3 px-4 roun
4323ded-2xl bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 disabled:opacity-50 disabled:cursor-not-allowed text-white font-bold text-sm flex items-center justify-center gap-2 transition-all shadow-[0_0_20px_rgba(6,182,212,0.3)] active:scale-[0.98]",children:[i.jsx(Vs,{size:16}),p?"Limpiando...":"Limpiar sala ahora (Conservar último mensaje)"]}),f&&u&&i.jsxs("button",{onClick:R,disabled:p||t===0,className:"w-full py-2 px-3 rounded-xl bg-rose-500/10 hover:bg-rose-500/20 text-rose-300 border border-rose-500/30 text-xs font-semibold flex items-center justify-center gap-1.5 transition-all",children:[i.jsx(gh,{size:14}),"Vaciar todo (Solo Administrador)"]})]})]}),i.jsxs("div",{className:"px-6 py-3 border-t border-white/10 bg-white/[0.01] flex items-center justify-between text-xs text-gray-500",children:[i.jsx("span",{children:"Chat Global ⢠Limpiador v2.0"}),i.jsx("button",{onClick:e,className:"text-gray-400 hover:text-white transition-colors",children:"Cerrar"})]})]})})};function UA({post:n,currentUser:e,onUserClick:t}){var V,H;const[s,o]=y.useState(((V=n.likes)==null?void 0:V.includes(e.username))||!1),[l,u]=y.useState(((H=n.likes)==null?void 0:H.length)||0),[h,f]=y.useState(!1),[p,x]=y.useState([]),[b,C]=y.useState(""),[N,T]=y.useState(!1);y.useEffect(()=>{var Q,Y;o(((Q=n.likes)==null?void 0:Q.includes(e.username))||!1),u(((Y=n.likes)==null?void 0:Y.length)||0)},[n.likes,e.username]),y.useEffect(()=>{if(h){const Q=li(zs(ft,"comments"),_a("postId","==",n.id),nh("createdAt","asc")),Y=Cr(Q,k=>{x(k.docs.map(E=>({id:E.id,...E.data()})))});return()=>Y()}},[h,n.id]);const R=async()=>{if(N)return;T(!0);const Q=Tn(ft,"posts",n.id);o(!s),u(Y=>s?Y-1:Y+1);try{s?await oi(Q,{likes:Xy(e.username)}):await oi(Q,{likes:og(e.username)})}catch(Y){console.error("Error toggling like:",Y),o(s),u(k=>s?k+1:k-1)}T(!1)},A=async Q=>{if(Q.preventDefault(),!b.trim())return;const Y=b.trim();C("");try{await Fh(zs(ft,"comments"),{postId:n.id,username:e.username,userAvatar:e.profilePic||"",text:Y,createdAt:Date.now()})}catch(k){console.error("Error posting comment:",k)}},U=async()=>{if(window.confirm("¿Seguro que quieres eliminar esta publicación?"))try{await am(Tn(ft,"posts",n.id))}catch(Q){console.error("Error deleting post:",Q)}},M=Q=>{const Y=Math.floor((Date.now()-Q)/1e3);return Y<60?"Hace un momento":Y<3600?"Hace ${Math.floor(diff/60)}m":Y<86400?"Hace ${Math.floor(diff/3600)}h":"Hace ${Math.floor(diff/86400)}d"};return i.jsxs("div",{className:"bg-[#121B2A] border border-white/5 rounded-2xl mb-6 shadow-lg overflow-hidden",children:[i.jsxs("div",{className:"p-4 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("img",{referrerPolicy:"no-referrer",src:n.userAvatar||"https://api.dicebear.com/7.x/avataaars/svg?seed=${post.username}",alt:n.username,className:"w-10 h-10 rounded-full border border-[#D4AF37]/30 bg-black/50 object-cover cursor-pointer hover:opacity-80 transition-opacity"}),i.jsxs("div",{children:[i.jsx("h3",{onClick:()=>t&&t(n.username),className:"text-white font-bold text-sm cursor-pointer hover:underline",children:n.username}),i.jsx("span",{className:"text-gray-400 text-xs",children:M(n.createdAt)})]})]}),e.username===n.username&&i.jsx("button",{onClick:U,className:"text-gray-500 hover:text-red-500 p-2 transition-colors",children:i.jsx(Vs,{size:18})})]}),n.mediaUrl&&i.jsx("div",{className:"w-full bg-black max-h-[600px] flex items-center justify-center overflow-hidden",children:n.mediaType==="video"?i.jsx("video",{src:n.mediaUrl,controls:!0,className:"w-full max-h-[600px] object-contain"}):i.jsx("img",{referrerPolicy:"no-referrer",src:n.mediaUrl,alt:"Post media",className:"w-full max-h-[600px] object-contain"})}),i.jsxs("div",{className:"p-4",children:[i.jsxs("div",{className:"flex items-center gap-4 mb-3",children:[i.jsx("button",{onClick:R,className:"flex items-center gap-1.5 transition-colors ${isLiked ? 'text-red-500' : 'text-white hover:text-red-400'}",children:i.jsx(Sm,{size:24,className:s?"fill-current":""})}),i.jsx("button",{onClick:()=>f(!h),className:"text-white hover:text-gray-300 transition-colors",children:i.jsx(Th,{size:24})}),i.jsx("button",{className:"text-white hover:text-gray-300 transition-colors ml-auto",children:i.jsx(AD,{size:20})})]}),i.jsxs("div",{className:"text-white font-bold text-sm mb-2",children:[l," me gusta"]}),n.text&&i.jsxs("div",{className:"text-sm text-gray-200 mb-2",children:[i.jsx("span",{className:"font-bold text-white mr-2",children:n.username}),i.jsx("span",{className:"whitespace-pre-wrap",children:n.text})]}),h?i.jsxs("div",{className:"mt-4 border-t border-white/10 pt-4",children:[i.jsxs("div",{className:"space-y-3 mb-4 max-h-40 overflow-y-auto scrollbar-thin",children:[p.map(Q=>i.jsxs("div",{className:"text-sm flex gap-2",children:[i.jsx("span",{className:"font-bold text-white shrink-0",children:Q.username}),i.jsx("span",{className:"text-gray-300 break-words",children:Q.text})]},Q.id)),p.length===0&&i.jsx("p",{className:"text-gray-500 text-xs italic",children:"No hay comentarios aún."})]}),i.jsxs("form",{onSubmit:A,className:"flex gap-2",children:[i.jsx("input",{type:"text",value:b,onChange:Q=>C(Q.target.value),placeholder:"Añade un comentario...",className:"flex-1 bg-black/30 border border-white/10 rounded-full px-4 py-2 text-sm text-white outline-none focus:border-[#D4AF37]/50"}),i.jsx("button",{disabled:!b.trim(),type:"submit",className:"text-[#D4AF37] font-bold text-sm px-2 disabled:opacity-50",children:"Publicar"})]})]}):i.jsx("button",{onClick:()=>f(!0),className:"text-gray-400 text-sm hover:text-gray-300",children:"Ver los comentarios"})]})]})}function FH({onClose:n,user:e}){const[t,s]=y.useState(""),[o,l]=y.useState(null),[u,h]=y.useState(null),[f,p]=y.useState(null),[x,b]=y.useState(0),[C,N]=y.useState(!1),T=y.useRef(null),R=M=>
4323{if(M.target.files&&M.target.files[0]){const V=M.target.files[0];l(V),h(URL.createObjectURL(V)),p(V.type.startsWith("video/")?"video":"image")}},A=()=>{l(null),h(null),p(null),T.current&&(T.current.value="")},U=async()=>{if(!t.trim()&&!o)return;N(!0);let M="",V=f;if(o){const H=iA(Cg,"posts/${Date.now()}_${file.name}"),Q=sA(H,o);await new Promise((Y,k)=>{Q.on("state_changed",E=>{const j=E.bytesTransferred/E.totalBytes*100;b(j)},E=>k(E),async()=>{M=await rA(Q.snapshot.ref),Y()})})}try{await Fh(zs(ft,"posts"),{userId:e.uid||e.username,username:e.username,userAvatar:e.profilePic||"",text:t.trim(),mediaUrl:M,mediaType:M?V:null,likes:[],createdAt:Date.now()}),N(!1),n()}catch(H){console.error("Error creating post:",H),N(!1)}};return i.jsx("div",{className:"fixed inset-0 z-[150] flex items-center justify-center p-4 bg-black/80 backdrop-blur-md animate-in fade-in",children:i.jsxs("div",{className:"bg-[#121B2A] border border-[#D4AF37]/30 rounded-3xl w-full max-w-lg shadow-[0_0_40px_rgba(212,175,55,0.15)] overflow-hidden flex flex-col",children:[i.jsxs("div",{className:"p-4 border-b border-white/10 flex justify-between items-center bg-black/20",children:[i.jsx("h2",{className:"text-[#E8D9B0] font-bold text-xl",children:"Crear Publicación"}),i.jsx("button",{onClick:n,disabled:C,className:"text-[#D4AF37] hover:text-white transition-colors",children:i.jsx(Kt,{size:24})})]}),i.jsxs("div",{className:"p-6 flex flex-col gap-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("img",{referrerPolicy:"no-referrer",src:e.profilePic||"https://api.dicebear.com/7.x/avataaars/svg?seed=${user.username}",alt:e.username,className:"w-12 h-12 rounded-full border-2 border-[#D4AF37]/50 object-cover"}),i.jsx("span",{className:"text-white font-bold",children:e.username})]}),i.jsx("textarea",{placeholder:"¿Qué estás pensando?",className:"w-full bg-transparent text-white placeholder-gray-500 resize-none outline-none text-lg min-h-[100px]",value:t,onChange:M=>s(M.target.value),disabled:C}),u&&i.jsxs("div",{className:"relative rounded-xl overflow-hidden border border-white/10 bg-black/50",children:[i.jsx("button",{onClick:A,disabled:C,className:"absolute top-2 right-2 bg-black/70 text-white rounded-full p-1 hover:bg-red-500 transition-colors z-10",children:i.jsx(fR,{size:20})}),f==="image"?i.jsx("img",{referrerPolicy:"no-referrer",src:u,alt:"Preview",className:"w-full max-h-[300px] object-contain"}):i.jsx("video",{src:u,controls:!0,className:"w-full max-h-[300px]"})]}),C&&i.jsx("div",{className:"w-full h-2 bg-gray-800 rounded-full overflow-hidden mt-2",children:i.jsx("div",{className:"h-full bg-gradient-to-r from-[#D4AF37] to-yellow-300 transition-all duration-300",style:{width:"${uploadProgress}%"}})})]}),i.jsxs("div",{className:"p-4 border-t border-white/10 flex items-center justify-between bg-black/20",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"file",ref:T,onChange:R,accept:"image/*,video/*",className:"hidden"}),i.jsx("button",{onClick:()=>{var M;return(M=T.current)==null?void 0:M.click()},disabled:C,className:"p-2 text-[#D4AF37] hover:bg-[#D4AF37]/20 rounded-full transition-colors tooltip",title:"Subir foto o video",children:i.jsx(Lu,{size:24})})]}),i.jsxs("button",{onClick:U,disabled:C||!t.trim()&&!o,className:"bg-[#D4AF37] text-black font-bold px-6 py-2 rounded-full hover:bg-yellow-400 transition-colors disabled:opacity-50 flex items-center gap-2",children:[C?"Subiendo...":"Publicar",!C&&i.jsx(BR,{size:20})]})]})]})})}function VH({username:n,currentUser:e,onClose:t}){const[s,o]=y.useState(null),[l,u]=y.useState([]),[h,f]=y.useState(!0),[p,x]=y.useState(!1),[b,C]=y.useState([]),[N,T]=y.useState([]);y.useEffect(()=>{const A=li(zs(ft,"users"),_a("username","==",n)),U=Cr(A,H=>{if(!H.empty){const Q=H.docs[0].data();o(Q);const Y=Q.followers||[];C(Y),x(Y.includes(e.username)),T(Q.following||[])}}),M=li(zs(ft,"posts"),_a("username","==",n)),V=Cr(M,H=>{const Q=H.docs.map(Y=>({id:Y.id,...Y.data()}));u(Q.sort((Y,k)=>k.createdAt-Y.createdAt)),f(!1)});return()=>{U(),V()}},[n,e.username]);const R=async()=>
4323{if(s){x(!p);try{const A=li(zs(ft,"users"),_a("username","==",n)),U=await Cm(A),M=li(zs(ft,"users"),_a("username","==",e.username)),V=await Cm(M);if(!U.empty&&!V.empty){const H=Tn(ft,"users",U.docs[0].id),Q=Tn(ft,"users",V.docs[0].id);p?(await oi(H,{followers:Xy(e.username)}),await oi(Q,{following:Xy(n)})):(await oi(H,{followers:og(e.username)}),await oi(Q,{following:og(n)}))}}catch(A){console.error("Error toggling follow:",A),x(p)}}};return h?i.jsx("div",{className:"fixed inset-0 z-[150] flex items-center justify-center bg-black/80 backdrop-blur-md",children:i.jsx("div",{className:"w-16 h-16 border-4 border-[#D4AF37] border-t-transparent rounded-full animate-spin"})}):i.jsxs("div",{className:"fixed inset-0 z-[150] flex flex-col bg-[#0a0f1c] animate-in slide-in-from-bottom",children:[i.jsxs("div",{className:"sticky top-0 z-20 bg-gradient-to-b from-[#0a0f1c] to-[#0a0f1c]/90 backdrop-blur-sm p-4 border-b border-white/5 flex items-center gap-4",children:[i.jsx("button",{onClick:t,className:"p-2 text-[#D4AF37] hover:bg-white/10 rounded-full transition-colors",children:i.jsx(Kt,{size:24})}),i.jsx("h1",{className:"text-xl font-bold text-white",children:n})]}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:i.jsxs("div",{className:"w-full max-w-lg mx-auto p-4",children:[i.jsxs("div",{className:"flex items-center justify-between mb-8",children:[i.jsx("img",{referrerPolicy:"no-referrer",src:(s==null?void 0:s.profilePic)||"https://api.dicebear.com/7.x/avataaars/svg?seed=${username}",alt:n,className:"w-24 h-24 rounded-full border-2 border-[#D4AF37]/50 bg-black/50 object-cover"}),i.jsxs("div",{className:"flex flex-1 justify-around text-center ml-4",children:[i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-white font-bold text-xl",children:l.length}),i.jsx("span",{className:"text-gray-400 text-xs",children:"Publicaciones"})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-white font-bold text-xl",children:b.length}),i.jsx("span",{className:"text-gray-400 text-xs",children:"Seguidores"})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-white font-bold text-xl",children:N.length}),i.jsx("span",{className:"text-gray-400 text-xs",children:"Siguiendo"})]})]})]}),i.jsxs("div",{className:"mb-6",children:[i.jsx("h2",{className:"text-white font-bold mb-1",children:s==null?void 0:s.username}),i.jsx("p",{className:"text-sm text-gray-300",children:(s==null?void 0:s.statusMessage)||"Sin descripción."})]}),n!==e.username&&i.jsx("div",{className:"flex gap-2 mb-8",children:i.jsx("button",{onClick:R,className:"flex-1 font-bold py-2 rounded-xl transition-colors ${isFollowing ? 'bg-white/10 text-white hover:bg-white/20' : 'bg-[#D4AF37] text-black hover:bg-yellow-400'}",children:p?"Siguiendo":"Seguir"})}),i.jsx("div",{className:"border-t border-white/10 mb-4 flex justify-center pt-2",children:i.jsx(FR,{className:"text-white",size:24})}),i.jsxs("div",{className:"space-y-6 pb-20",children:[l.map(A=>i.jsx(UA,{post:A,currentUser:e},A.id)),l.length===0&&i.jsx("div",{className:"text-center text-gray-500 py-10",children:"Aún no hay publicaciones."})]})]})})]})}function UH({user:n}){const[e,t]=y.useState([]),[s,o]=y.useState({}),[l,u]=y.useState(!1),[h,f]=y.useState(0),p=y.useRef(null),[x,b]=y.useState(null),[C,N]=y.useState(0);y.useEffect(()=>{const M=Date.now()-864e5,V=li(zs(ft,"stories"),_a("createdAt",">",M)),H=Cr(V,Q=>{const Y=Q.docs.map(E=>({id:E.id,...E.data()}));t(Y);const k={};Y.forEach(E=>{k[E.username]||(k[E.username]=[]),k[E.username].push(E)}),Object.keys(k).forEach(E=>{k[E].sort((j,P)=>j.createdAt-P.createdAt)}),o(k)});return()=>H()},[]);const T=async M=>{if(!M.target.files||!M.target.files[0])return;const V=M.target.files[0],H=V.type.startsWith("video/");u(!0);const Q=iA(Cg,`stories/${Date.now()}_${V.name}`),Y=sA(Q,V);Y.on("state_changed",k=>{f(k.bytesTransferred/k.totalBytes*100)},k=>{console.error("Upload error:",k),u(!1)},async()=>{const k=await rA(Y.snapshot.ref);await Fh(zs(ft,"stories"),{userId:n.uid||n.username,username:n.username,userAvatar:n.profilePic||"",mediaUrl:k,mediaType:H?"video":"image",createdAt:Date.now()}),u(!1),f(0),p.current&&(p.current.value="")}
4323)},R=M=>{b(M),N(0)},A=()=>{if(!x)return;const M=s[x];C<M.length-1?N(V=>V+1):b(null)},U=()=>{C>0&&N(M=>M-1)};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"w-full border-b border-white/5 py-4 overflow-x-auto scrollbar-none pl-4",children:i.jsxs("div",{className:"flex gap-4",children:[i.jsxs("div",{className:"flex flex-col items-center gap-1 shrink-0 cursor-pointer",onClick:()=>{var M;return(M=p.current)==null?void 0:M.click()},children:[i.jsx("div",{className:"w-16 h-16 rounded-full border-2 border-dashed border-[#D4AF37] p-0.5 flex items-center justify-center bg-[#121B2A] relative",children:l?i.jsxs("div",{className:"text-[#D4AF37] font-bold text-xs",children:[Math.round(h),"%"]}):i.jsxs(i.Fragment,{children:[i.jsx("img",{referrerPolicy:"no-referrer",src:n.profilePic||`https://api.dicebear.com/7.x/avataaars/svg?seed=${n.username}`,alt:"You",className:"w-full h-full rounded-full object-cover opacity-60"}),i.jsx(jm,{className:"absolute text-[#D4AF37]",size:24})]})}),i.jsx("span",{className:"text-xs text-gray-400 font-medium",children:"Tu historia"}),i.jsx("input",{type:"file",ref:p,onChange:T,accept:"image/*,video/*",className:"hidden"})]}),Object.keys(s).map(M=>{const V=s[M],H=V[V.length-1];return i.jsxs("div",{className:"flex flex-col items-center gap-1 shrink-0 cursor-pointer",onClick:()=>R(M),children:[i.jsx("div",{className:"w-16 h-16 rounded-full border-2 border-[#D4AF37] p-0.5 relative",children:i.jsx("img",{referrerPolicy:"no-referrer",src:H.userAvatar||`https://api.dicebear.com/7.x/avataaars/svg?seed=${M}`,alt:M,className:"w-full h-full rounded-full object-cover bg-black/50"})}),i.jsx("span",{className:"text-xs text-white font-medium max-w-[64px] truncate",children:M})]},M)})]})}),x&&s[x]&&i.jsxs("div",{className:"fixed inset-0 z-[200] bg-black flex flex-col animate-in fade-in",children:[i.jsx("div",{className:"absolute top-4 left-0 w-full px-4 flex gap-1 z-50",children:s[x].map((M,V)=>i.jsx("div",{className:"h-1 flex-1 bg-white/30 rounded-full overflow-hidden",children:i.jsx("div",{className:`h-full bg-white transition-all ${V===C||V<C?"w-full":"w-0"}`})},M.id))}),i.jsxs("div",{className:"absolute top-8 left-0 w-full px-4 flex items-center justify-between z-50",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("img",{referrerPolicy:"no-referrer",src:s[x][0].userAvatar||`https://api.dicebear.com/7.x/avataaars/svg?seed=${x}`,className:"w-8 h-8 rounded-full border border-white/50 object-cover",alt:x}),i.jsx("span",{className:"text-white font-bold text-sm drop-shadow-md",children:x})]}),i.jsx("button",{onClick:()=>b(null),className:"text-white hover:text-gray-300",children:i.jsx(Kt,{size:28})})]}),i.jsxs("div",{className:"flex-1 w-full relative flex items-center justify-center bg-[#0a0f1c]",children:[s[x][C].mediaType==="video"?i.jsx("video",{src:s[x][C].mediaUrl,autoPlay:!0,onEnded:A,className:"w-full h-full object-contain",playsInline:!0}):i.jsx("img",{referrerPolicy:"no-referrer",src:s[x][C].mediaUrl,className:"w-full h-full object-contain",alt:"Story"}),i.jsx("div",{className:"absolute inset-y-0 left-0 w-1/3 cursor-pointer",onClick:U}),i.jsx("div",{className:"absolute inset-y-0 right-0 w-1/3 cursor-pointer",onClick:A})]})]})]})}function GH({user:n,onClose:e}){const[t,s]=y.useState([]),[o,l]=y.useState(!0),[u,h]=y.useState(!1),[f,p]=y.useState(null);return y.useEffect(()=>{const x=li(zs(ft,"posts"),nh("createdAt","desc"),EF(50)),b=Cr(x,C=>{const N=C.docs.map(T=>({id:T.id,...T.data()}));s(N),l(!1)});return()=>b()},[]),i.jsxs("div",{className:"flex-1 w-full bg-[#0a0f1c] flex flex-col relative h-full",children:[i.jsxs("div",{className:"sticky top-0 z-20 bg-gradient-to-b from-[#0a0f1c] to-[#0a0f1c]/90 backdrop-blur-sm p-4 border-b border-white/5 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[e&&i.jsx("button",{onClick:e,className:"p-2 text-white hover:bg-white/10 rounded-xl transition-colors md:hidden",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"m12 19-7-7 7-7"}),i.jsx("path",{d:"M19 12H5"})]})}),i.jsx("h1",{className:"text-2xl font-black text-transparent bg-clip-text bg-gradient-to-r from-pink-500 via-purple-500 to-indigo-500 font-[InstaFont,sans-serif]",children:"LizGram"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:()=>h(!0),className:"p-2 text-white hover:bg-white/10 rounded-xl transition-colors flex items-center gap-2",children:i.jsx(FI,{size:24})}),i.jsx("img",{referrerPolicy:"no-referrer",onClick:()=>p(n.username),src:n.profilePic||`https://api.dicebear.com/7.x/avataaars/svg?seed=${n.username}`,alt:n.username,className:"w-8 h-8 rounded-full border border-white/10 cursor-pointer hover:opacity-80 transition-opacity",title:"Mi Perfil"})]})]}),i.jsx(UH,{user:n}),i.jsx("div",{className:"flex-1 overflow-y-auto w-full p-4 flex flex-col items-center",children:i.jsx("div",{className:"w-full max-w-lg pb-20",children:o?i.jsxs("div",{className:"flex flex-col items-center justify-center mt-20 text-white/80",children:[i.jsx(ah,{size:40,className:"animate-spin mb
4323-4"}),i.jsx("p",{children:"Cargando publicaciones..."})]}):t.length===0?i.jsxs("div",{className:"text-center mt-20 p-8 border border-white/10 rounded-2xl bg-white/5",children:[i.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:"¡Bienvenido a LizGram!"}),i.jsx("p",{className:"text-gray-400 mb-6",children:"Sé el primero en compartir un momento con la comunidad."}),i.jsx("button",{onClick:()=>h(!0),className:"bg-white text-black text-black font-bold px-6 py-2 rounded-full hover:bg-yellow-400 transition-colors",children:"Crear Publicación"})]}):t.map(x=>i.jsx(UA,{post:x,currentUser:n,onUserClick:b=>p(b)},x.id))})}),f&&i.jsx(VH,{username:f,currentUser:n,onClose:()=>p(null)}),u&&i.jsx(FH,{user:n,onClose:()=>h(!1)})]})}const Tm={pitch:1,volume:1,bassBoost:0,trebleBoost:0,echoLevel:0,robotModulation:0,speed:1},UB=[{id:"normal",name:"Normal",icon:"ðï¸",description:"Voz original limpia y natural",settings:{...Tm}},{id:"deep",name:"Grave / Profunda",icon:"ð¦",description:"Tono bajo masculino y resonancia cálida",settings:{pitch:.78,volume:1.15,bassBoost:8,trebleBoost:-2,echoLevel:.1,robotModulation:0,speed:.95}},{id:"super_deep",name:"Ultra Grave / Demonio",icon:"ð¹",description:"Tono cavernoso, pesado y terrorÃfico",settings:{pitch:.6,volume:1.25,bassBoost:15,trebleBoost:-6,echoLevel:.25,robotModulation:25,speed:.88}},{id:"high",name:"Aguda / Ardilla",icon:"ð¿ï¸",description:"Voz cómica, rápida y chillona",settings:{pitch:1.35,volume:1.05,bassBoost:-6,trebleBoost:6,echoLevel:0,robotModulation:0,speed:1.15}},{id:"helium",name:"Voz de Helio",icon:"ð",description:"Tono ultra agudo como tras aspirar helio",settings:{pitch:1.62,volume:1.1,bassBoost:-10,trebleBoost:10,echoLevel:.05,robotModulation:0,speed:1.25}},{id:"robot",name:"Ciborg / Robótica",icon:"ð¤",description:"Efecto cibernético y sÃntesis metálica",settings:{pitch:.92,volume:1.1,bassBoost:4,trebleBoost:6,echoLevel:.15,robotModulation:65,speed:1}},{id:"echo",name:"Eco / Catedral",icon:"ðï¸",description:"Amplia reverberación espacial y repeticiones",settings:{pitch:1,volume:1,bassBoost:2,trebleBoost:2,echoLevel:.55,robotModulation:0,speed:1}},{id:"alien",name:"Alien / Cósmica",icon:"ð½",description:"Oscilación de otro planeta",settings:{pitch:1.22,volume:1.05,bassBoost:-4,trebleBoost:8,echoLevel:.4,robotModulation:95,speed:1.05}},{id:"radio",name:"Walkie-Talkie / Radio",icon:"ð»",description:"Filtro vintage de onda corta y megáfono",settings:{pitch:1.05,volume:1.2,bassBoost:-10,trebleBoost:8,echoLevel:.05,robotModulation:0,speed:1}},{id:"telephone",name:"Teléfono Retro",icon:"âï¸",description:"Llamada telefónica de lÃnea antigua",settings:{pitch:1,volume:1.15,bassBoost:-12,trebleBoost:4,echoLevel:0,robotModulation:0,speed:1}},{id:"whisper",name:"Susurro / ASMR",icon:"ð",description:"Voz suave, aterciopelada e Ãntima",settings:{pitch:1.02,volume:.85,bassBoost:-4,trebleBoost:12,echoLevel:.2,robotModulation:0,speed:.95}},{id:"giant",name:"Gigante / Titán",icon:"ð¿",description:"Fuerza masiva y resonancia telúrica",settings:{pitch:.68,volume:1.3,bassBoost:16,trebleBoost:-4,echoLevel:.35,robotModulation:15,speed:.85}}];function HH(n){const e=n.numberOfChannels,t=n.sampleRate,s=1,o=16,u=n.length*e*(o/8),f=44+u,p=new ArrayBuffer(f),x=new DataView(p);mB(x,0,"RIFF"),x.setUint32(4,36+u,!0),mB(x,8,"WAVE"),mB(x,12,"fmt "),x.setUint32(16,16,!0),x.setUint16(20,s,!0),x.setUint16(22,e,!0),x.setUint32(24,t,!0),x.setUint32(28,t*e*(o/8),!0),x.setUint16(32,e*(o/8),!0),x.setUint16(34,o,!0),mB(x,36,"data"),x.setUint32(40,u,!0);let b=44;const C=[];for(let N=0;N<e;N++)C.push(n.getChannelData(N));for(let N=0;N<n.length;N++)for(let T=0;T<e;T++){let R=C[T][N];R=Math.max(-1,Math.min(1,R)),x.setInt16(b,R<0?R*32768:R*32767,!0),b+=2}return new Blob([x],{type:"audio/wav"})}function mB(n,e,t){for(let s=0;s<t.length;s++)n.setUint8(e+s,t.charCodeAt(s))}async function qH(n,e){let t;if(typeof e=="string"){if(e==="normal")return n;const U=UB.find(M=>M.id===e);t=U?U.settings:Tm}else t=e;if(t.pitch===1&&t.volume===1&&t.bassBoost===0&&t.trebleBoost===0&&t.e
4323choLevel===0&&t.robotModulation===0&&t.speed===1)return n;const s=window.AudioContext||window.webkitAudioContext;let o;try{o=new s({sampleRate:24e3})}catch{o=new s}const l=await n.arrayBuffer(),u=await o.decodeAudioData(l),h=Math.max(.4,Math.min(2.5,t.pitch*t.speed)),f=u.duration/h+(t.echoLevel>0?.8:.2),p=u.sampleRate,x=new OfflineAudioContext(u.numberOfChannels,Math.ceil(f*p),p),b=x.createBufferSource();b.buffer=u,b.playbackRate.value=h;const C=x.createGain();C.gain.value=Math.max(.2,Math.min(2.5,t.volume));const N=x.createBiquadFilter();N.type="lowshelf",N.frequency.value=260,N.gain.value=Math.max(-18,Math.min(20,t.bassBoost));const T=x.createBiquadFilter();T.type="highshelf",T.frequency.value=3200,T.gain.value=Math.max(-18,Math.min(20,t.trebleBoost));let R=b;if(t.robotModulation>5){const U=x.createOscillator();U.type="sine",U.frequency.value=t.robotModulation;const M=x.createGain();M.gain.value=0,U.connect(M.gain),R.connect(M),U.start(0);const V=x.createBiquadFilter();V.type="bandpass",V.frequency.value=1700,V.Q.value=1.2,M.connect(V),R=V}if(R.connect(N),N.connect(T),T.connect(C),t.echoLevel>.05){const U=x.createDelay();U.delayTime.value=.24;const M=x.createGain();M.gain.value=Math.min(.65,t.echoLevel*.7);const V=x.createGain();V.gain.value=t.echoLevel,C.connect(x.destination),C.connect(U),U.connect(M),M.connect(U),U.connect(V),V.connect(x.destination)}else C.connect(x.destination);b.start(0);const A=await x.startRendering();return o.close(),HH(A)}function $H({audioBlob:n,onSend:e,onDiscard:t}){const[s,o]=y.useState(()=>{try{return localStorage.getItem("chatliz_voice_emulator")||"normal"}catch{return"normal"}}),[l,u]=y.useState(()=>{try{const S=localStorage.getItem("chatliz_voice_settings");if(S)return JSON.parse(S)}catch{}const F=UB.find(S=>S.id===s);return F?{...F.settings}:{...Tm}}),[h,f]=y.useState(!1),[p,x]=y.useState(!1),[b,C]=y.useState(!1),[N,T]=y.useState(n),[R,A]=y.useState(null),[U,M]=y.useState(0),[V,H]=y.useState(0),Q=y.useRef(null);y.useEffect(()=>{let F=!1;const be=setTimeout(async()=>{if(n){C(!0);try{const Ee=await qH(n,l);if(!F){T(Ee);const me=URL.createObjectURL(Ee);A(De=>(De&&URL.revokeObjectURL(De),me))}}catch(Ee){console.error("Error applying voice effect:",Ee),F||(T(n),A(URL.createObjectURL(n)))}finally{F||C(!1)}}},120);return()=>{F=!0,clearTimeout(be)}},[n,l]);const Y=()=>{Q.current&&(p?(Q.current.pause(),x(!1)):Q.current.play().then(()=>x(!0)).catch(console.error))},k=F=>{p&&Q.current&&(Q.current.pause(),x(!1)),o(F);try{localStorage.setItem("chatliz_voice_emulator",F)}catch{}const S=UB.find(be=>be.id===F);if(S){const be={...S.settings};u(be);try{localStorage.setItem("chatliz_voice_settings",JSON.stringify(be))}catch{}}},E=(F,S)=>{p&&Q.current&&(Q.current.pause(),x(!1)),o("custom"),u(be=>{const Ee={...be,[F]:S};try{localStorage.setItem("chatliz_voice_settings",JSON.stringify(Ee)),localStorage.setItem("chatliz_voice_emulator","custom")}catch{}return Ee})},j=()=>{o("normal"),u({...Tm});try{localStorage.setItem("chatliz_voice_emulator","normal"),localStorage.setItem("chatliz_voice_settings",JSON.stringify(Tm))}catch{}},P=()=>{if(!N)return;const F=new FileReader;F.readAsDataURL(N),F.onloadend=()=>{e(N,F.result)}},O=F=>{const S=Math.floor(F/60),be=Math.floor(F%60);return`${S}:${be<10?"0":""}${be}`};return i.jsxs("div",{className:"bg-[#121624] border border-cyan-500/40 rounded-2xl p-3.5 shadow-2xl space-y-3 animate-in slide-in-from-bottom-3 duration-200",children:[R&&i.jsx("audio",{ref:Q,src:R,onLoadedMetadata:()=>{Q.current&&M(Q.current.duration||0)},onTimeUpdate:()=>{Q.current&&H(Q.current.currentTime||0)},onEnded:()=>x(!1)}),i.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-white/10 pb-2",children:[i.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold text-cyan-300",children:[i.jsx(mO,{size:15,className:"text-cyan-400"}),i.jsx("span",{children:"Emulador de Voz:"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>f(!h),className:`text-[11px] px-2 py-1 rounded-lg border flex items-center gap-1 transition-all ${h?"bg-cyan-500/20 text-cyan-300 border-cyan-400":"bg-white/5 text-gray-300 hover:text-white border-white/10"}`,children:[i.jsx(Bh,{size:12}),i.jsx("span",{children:"Modular Barritas"}),h?i.jsx(lR,{size:12}):i.jsx(rR,{size:12})]}),i.jsx("span",{className:"text-[10px] text-gray-400 font-medium hidden sm:inline",children:s!=="normal"?"⨠Modulada":"Voz Normal"})]})]}),i.jsx("div",{className:"flex gap-1.5 overflow-x-auto pb-1.5 scrollbar-thin",children:UB.map(F=>{const S=s===F.id;return i.jsxs("button",{type:"button",onClick:()=>k(F.id),disabled:b,className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-xl text-xs font-medium whitespace-nowrap transition-all border shrink-0 ${S?"bg-cyan-500/20 text-cyan-200 border-cyan-400 shadow-[0_0_10px_rgba(6,182,212,0.3)]":"bg-white/5 text-gray-400 hover:text-white border-white/5 hover:bg-white/10"}`,title:F.description,children:[i.jsx("span",{children:F.icon}),i.jsx("span",{children:F.name})]},F.id)})}),h&&i.jsxs("div",{className:"p-3 bg-black/40 border border-cyan-500/20 rounded-xl space-y-2.5 text-xs",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-white/10 pb-1.5",children:[i.jsxs("span",{className:"text-gray-300 font-bold flex items-center gap-1",children:[i.jsx(Bh,{size:13,className:"text-cyan-400"}),"Barritas de Modulación Libre"]}),i.jsxs("button",{type:"button",onClick:j,className:"text-[10px] text-gray-400 hover:text-cyan-300 flex items-center gap-1",children:[i.jsx(Sh,{size:10}),"Restablecer"]})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex justify-between text-[11px]",children:[i.jsx("span",{className:"text-gray-300 flex items-center gap-1",children:"ð¦ Tono (Grave â· Agudo) ð¿ï¸"}),i.jsxs("span",{className:"text-cyan-400 font-mono font-bold",children:[l.pitch.toFixed(2),"x"," ",l.pitch<.9?"(Grave)":l.pitch>1.1?"(Agudo)":"(Natural)"]})]}),i.jsx("input",{type:"range",min:"0.50",max:"1.80",step:"0.02",value:l.pitch,onChange:F=>E("pitch",parseFloat(F.target.value)),className:"w-full accent-cyan-400 cursor-pointer h-1.5 bg-gray-700 rounded-lg"})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex justify-between text-[11px]",children:[i.jsx("span",{className:"text-gray-300 flex items-center gap-1",children:"ð Volumen (Suave â· Fuerte) ð"}),i.jsxs("span",{className:"text-cyan-400 font-mono font-bold",children:[Math.round(l.volume*100),"%"]})]}),i.jsx("input",{type:"range",min:"0.40",max:"2.20",step:"0.05",value:l.volume,onChange:F=>E("volume",parseFloat(F.target.value)),className:"w-full accent-cyan-400 cursor-pointer h-1.5 bg-gray-700 rounded-lg"})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex justify-between text-[11px]",children:[i.jsx("span",{className:"text-gray-300",children:"Bajos / Resonancia Profunda"}),i.jsxs("span",{className:"text-cyan-400 font-mono font-bold",children:[l.bassBoost>0?`+${l.bassBoost}`:l.bassBoost," dB"]})]}),i.jsx("input",{type:"range",min:"-12",max:"18",step:"1",value:l.bassBoost,onChange:F=>E("bassBoost",parseInt(F.target.value,10)),className:"w-full accent-cyan-400 cursor-pointer h-1.5 bg-gray-700 rounded-lg"})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex justify-between text-[11px]",children:[i.jsx("span",{className:"text-gray-300",children:"Agudos / Claridad y Brillo"}),i.jsxs("span",{className:"text-cyan-400 font-mono font-bold",children:[l.trebleBoost>0?`+${l.trebleBoost}`:l.trebleBoost," dB"]})]}),i.jsx("input",{type:"range",min:"-12",max:"18",step:"1",value:l.trebleBoost,onChange:F=>E("trebleBoost",parseInt(F.target.value,10)),className:"w-full accent-cyan-400 cursor-pointer h-1.5 bg-gray-700 rounded-lg"})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex justify-between text-[11px]",children:[i.jsx("span",{className:"text-gray-300",children:"ðï¸ Eco / Reverberación Espacial"}),i.jsxs("span",{className:"text-cyan-400 font-mono font-bold",children:[Math.round(l.echoLevel*100),"%"]})]}),i.jsx("input",{type:"range",min:"0.0",max:"0.75",step:"0.05",value:l.echoLevel,onChange:F=>E("echoLevel",parseFloat(F.target.value)),className:"w-full accent-cyan-400 cursor-pointer h-1.5 bg-gray-700 rounded-lg"})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex justify-between text-[11px]",children:[i.jsx("span",{className:"text-gray-300",children:"ð¤ Efecto Cibernético / Robot"}),i.jsx("span",{className:"text-cyan-400 font-mono font-bold",children:l.robotModulation===0?"Apagado":`${l.robotModulation} Hz`})]}),i.jsx("input",{type:"range",min:"0",max:"120",step:"5",value:l.robotModulation,onChange:F=>E("robotModulation",parseInt(F.target.value,10)),className:"w-full accent-cyan-400 cursor-pointer h-1.5 bg-gray-700 rounded-lg"})]})]}),i.jsxs("div",{className:"flex items-center justify-between gap-3 pt-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:Y,disabled:b||!R,className:"w-9 h-9 rounded-xl bg-cyan-500 hover:bg-cyan-400 text-black flex items-center justify-center transition-all shadow-md active:scale-95 disabled:opacity-50",title:p?"Pausar":"Escuchar cómo suena",children:p?i.jsx(_1,{size:16,className:"fill-current"}):i.jsx(fh,{size:16,className:"fill-current ml-0.5"})}),i.jsxs("div",{className:"text-xs font-mono text-gray-300 flex items-center gap-1",children:[i.jsx("span",{children:O(V)}),i.jsx("span",{className:"text-gray-500",children:"/"}),i.jsx("span",{className:"text-gray-400",children:O(U)})]}),b&&i.jsx("span",{className:"text-[10px] text-cyan-400 animate-pulse font-medium",children:"Modulando..."})]}),i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("button",{type:"button",onClick:t,className:"p-2 rounded-xl bg-white/5 hover:bg-rose-500/20 text-gray-400 hover:text-rose-300 transition-colors",title:"Descartar y grabar de nuevo",children:i.jsx(Vs,{size:16})}),i.jsxs("button",{type:"button",onClick:P,disabled:b,className:"px-3 py-1.5 rounded-xl bg-emerald-500 hover:bg-emerald-400 text-black font-bold text-xs flex items-center gap-1.5 transition-all shadow-md active:scale-95 disabled:opacity-50",children:[i.jsx(mh,{size:14}),i.jsx("span",{children:"Enviar Audio"})]})]})]})]})}const GA={enabled:!0,frequency:1e3,pitchSemitones:0,gain:1,qResonance:1,filterType:"peaking",liveMonitoring:!1,monitorVolume:.8},JH=[{id:"natural",name:"Natural",icon:"ðï¸",desc:"Voz limpia sin alteraciones de frecuencia",config:{enabled:!1,frequency:1e3,pitchSemitones:0,gain:1,qResonance:1,filterType:"peaking"}},{id:"deep_radio",name:"Locutor / Deep Studio",icon:"ð»",desc:"Graves cálidos y presencia resonante de radio",config:{enabled:!0,frequency:240,pitchSemitones:-4,gain:1.35,qResonance:2.2,filterType:"peaking"}},{id:"sub_bass",name:"Grave Profundo",icon:"ð¦",desc:"Corte de frecuencias altas para tono imponente",config:{enabled:!0,frequency:380,pitchSemitones:-7,gain:1.5,qResonance:1.8,filterType:"lowpass"}},{id:"high_chipmunk",name:"Agudo / Helio",icon:"ð¿ï¸",desc:"Realce de frecuencias agudas y armónicos altos",config:{enabled:!0,frequency:2600,pitchSemitones:6,gain:1.15,qResonance:2,filterType:"highpass"}},{id:"walkie_talkie",name:"Walkie-Talkie",icon:"ð¡",desc:"Filtro pasabanda telefónico y ganancia crujiente",config:{enabled:!0,frequency:1450,pitchSemitones:0,gain:1.6,qResonance:4.5,filterType:"bandpass"}},{id:"cyborg",name:"Ciborg Metálico",icon:"ð¤",desc:"Alta resonancia Q metálica y pico pronunciado",config:{enabled:!0,frequency:720,pitchSemitones:-3,gain:1.25,qResonance:8.5,filterType:"peaking"}}];class KH{constructor(){this.audioCtx=null,this.sourceNode=null,this.filterNode=null,this.pitchShiftFilterNode=null,this.gainNode=null,this.monitorGainNode=null,this.analyserNode=null,this.destinationNode=null,this.currentStream=null}getAudioContext(){if(!this.audioCtx||this.audioCtx.state==="closed"){const e=window.AudioContext||window.webkitAudioContext;this.audioCtx=new e}return this.audioCtx.state==="suspended"&&this.audioCtx.resume().catch(console.error),this.audioCtx}connectStream(e,t){const s=this.getAudioContext();if(this.currentStream=e,this.disconnect(),this.sourceNode=s.createMediaStreamSource(e),this.filterNode=s.createBiquadFilter(),this.filterNode.type=t.filterType,this.filterNode.frequency.setValueAtTime(t.frequency,s.currentTime),this.filterNode.Q.setValueAtTime(t.qResonance,s.currentTime),t.filterType==="peaking"){const u=t.pitchSemitones*1.5;this.filterNode.gain.setValueAtTime(u,s.currentTime)}this.pitchShiftFilterNode=s.createBiquadFilter(),this.pitchShiftFilterNode.type=t.pitchSemitones<0?"lowshelf":"highshelf";const o=Math.max(80,Math.min(6e3,1e3*Math.pow(2,t.pitchSemitones/12)));this.pitchShiftFilterNode.frequency.setValueAtTime(o,s.currentTime),this.pitchShiftFilterNode.gain.setValueAtTime(t.pitchSemitones*2,s.currentTime),this.gainNode=s.createGain();const l=t.enabled?t.gain:1;return this.gainNode.gain.setValueAtTime(l,s.currentTime),this.analyserNode=s.createAnalyser(),this.analyserNode.fftSize=256,this.analyserNode.smoothingTimeConstant=.8,this.destinationNode=s.createMediaStreamDestination(),this.monitorGainNode=s.createGain(),this.monitorGainNode.gain.setValueAtTime(t.liveMonitoring?t.monitorVolume:0,s.currentTime),this.sourceNode.connect(this.filterNode),this.filterNode.connect(this.pitchShiftFilterNode),this.pitchShiftFilterNode.connect(this.gainNode),this.gainNode.connect(this.analyserNode),this.analyserNode.connect(this.destinationNode),this.gainNode.connect(this.monitorGainNode),this.monitorGainNode.connect(s.destination),{modulatedStream:this.destinationNode.stream,anal
4323yser:this.analyserNode}}updateConfig(e){if(!this.audioCtx||this.audioCtx.state==="closed")return;const t=this.audioCtx.currentTime;if(this.filterNode&&(this.filterNode.type!==e.filterType&&(this.filterNode.type=e.filterType),this.filterNode.frequency.setTargetAtTime(e.frequency,t,.03),this.filterNode.Q.setTargetAtTime(e.qResonance,t,.03),e.filterType==="peaking")){const s=e.pitchSemitones*1.5;this.filterNode.gain.setTargetAtTime(s,t,.03)}if(this.pitchShiftFilterNode){const s=e.pitchSemitones<0;this.pitchShiftFilterNode.type=s?"lowshelf":"highshelf";const o=Math.max(80,Math.min(6e3,1e3*Math.pow(2,e.pitchSemitones/12)));this.pitchShiftFilterNode.frequency.setTargetAtTime(o,t,.03),this.pitchShiftFilterNode.gain.setTargetAtTime(e.pitchSemitones*2,t,.03)}if(this.gainNode){const s=e.enabled?e.gain:1;this.gainNode.gain.setTargetAtTime(s,t,.03)}if(this.monitorGainNode){const s=e.liveMonitoring?e.monitorVolume:0;this.monitorGainNode.gain.setTargetAtTime(s,t,.03)}}getAnalyser(){return this.analyserNode}disconnect(){try{this.sourceNode&&(this.sourceNode.disconnect(),this.sourceNode=null),this.filterNode&&(this.filterNode.disconnect(),this.filterNode=null),this.pitchShiftFilterNode&&(this.pitchShiftFilterNode.disconnect(),this.pitchShiftFilterNode=null),this.gainNode&&(this.gainNode.disconnect(),this.gainNode=null),this.analyserNode&&(this.analyserNode.disconnect(),this.analyserNode=null),this.monitorGainNode&&(this.monitorGainNode.disconnect(),this.monitorGainNode=null),this.destinationNode&&(this.destinationNode.disconnect(),this.destinationNode=null)}catch(e){console.warn("Error disconnecting audio nodes:",e)}}destroy(){this.disconnect(),this.currentStream&&(this.currentStream.getTracks().forEach(e=>e.stop()),this.currentStream=null),this.audioCtx&&this.audioCtx.state!=="closed"&&(this.audioCtx.close().catch(console.error),this.audioCtx=null)}}let gy=null;function GB(){return gy||(gy=new KH),gy}function QH({isOpen:n,onClose:e,config:t,onChangeConfig:s}){const[o,l]=y.useState(!1),[u,h]=y.useState(null),[f,p]=y.useState("custom"),[x,b]=y.useState("main"),[C,N]=y.useState(0),T=y.useRef(null),R=y.useRef(null),A=y.useRef(null);y.useEffect(()=>{A.current&&A.current.updateConfig(t)},[t]);const U=async()=>{if(o)M();else try{const E=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:44100,echoCancellation:!0,noiseSuppression:!1,autoGainControl:!1}}),j=GB();A.current=j;const{analyser:P}=j.connectStream(E,t);h(E),l(!0),V(P)}catch(E){console.error("Error accessing microphone for test:",E),alert("No se pudo acceder al micrófono para la prueba en vivo.")}},M=()=>{u&&(u.getTracks().forEach(E=>E.stop()),h(null)),A.current&&A.current.disconnect(),R.current&&(cancelAnimationFrame(R.current),R.current=null),l(!1),N(0)};y.useEffect(()=>()=>{M()},[]);const V=E=>{const j=T.current;if(!j)return;const P=j.getContext("2d");if(!P)return;const O=E.frequencyBinCount,F=new Uint8Array(O),S=()=>{R.current=requestAnimationFrame(S),E.getByteFrequencyData(F);let be=0;for(let $e=0;$e<O;$e++)be+=F[$e];const Ee=be/O;N(Math.min(100,Math.round(Ee/128*100)));const me=j.width,De=j.height;P.clearRect(0,0,me,De),P.fillStyle="#090d16",P.fillRect(0,0,me,De);const ge=32,Ue=me/ge-1.5;let we=0;for(let $e=0;$e<ge;$e++){const et=Math.floor($e/ge*(O/2)),K=(F[et]||0)/255,ne=Math.max(3,K*(De-6)),Pe=P.createLinearGradient(0,De,0,De-ne);Pe.addColorStop(0,"#06b6d4"),Pe.addColorStop(.6,"#3b82f6"),Pe.addColorStop(1,"#a855f7"),P.fillStyle=Pe,P.fillRect(we,De-ne,Ue,ne),P.fillStyle=K>.7?"#f43f5e":"#38bdf8",P.fillRect(we,De-ne,Ue,1.5),we+=Ue+1.5}};S()},H=(E,j)=>{p("custom");const P={...t,[E]:j};s(P)},Q=E=>{p(E.id);const j={...t,...E.config};s(j)},Y=()=>{p("natural"),s({...GA})},k=E=>E<150?"Sub-Graves (Rumble)":E<400?"Graves Profundos (Cuerpo)":E<1200?"Medios Vocales (Presencia)":E<3e3?"Medios Agudos (Claridad)":"Agudos Brillantes (Aire)";return n?i.jsxs("div",{className:"absolute bottom-full mb-3 left-0 right-0 max-w-xl mx-auto z-50 bg-[#0d121f]/95 backdrop-blur-xl border border-cyan-500/40 rounded-2xl shadow-[0_15px_45px_rgba(0,0,0,0.85),0_0_20px_rgba(6,182,212,0.2)] p-4 text-white animate-in slide-in-from-bottom-3 duration-200",children:[i.jsxs("div",{className:"flex items-center justify-between pb-2.5 border-b border-white/10",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-8 h-8 rounded-xl bg-gradient-to-tr from-cyan-600 to-blue-500 flex items-center justify-center shadow-[0_0_12px_rgba(6,182,212,0.5)]",children:i.jsx(Bh,{size:16,className:"text-white"})}),i.jsxs("div",{children:[i.jsxs("h3",{className:"text-sm font-bold text-white flex items-center gap-1.5 leading-tight",children:["Modulador de Voz AudioContext",t.enabled?i.jsx("span",{className:"text-[10px] bg-cyan-500/20 text-cyan-300 px-1.5 py-0.5 rounded-full font-semibold border border-cyan-500/30",children:"ACTIVO"}):i.jsx("span",{className:"text-[10px] bg-gray-700/50 text-gray-400 px-1.5 py-0.5 rounded-full font-semibold",children:"BYPASS"})]}),i.jsx("p",{className:"text-[11px] text-gray-400 leading-tight",children:"Control en tiempo real de Frecuencia (Pitch) y Ganancia (Gain)"})]})]}),i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsxs("button",{type:"button",onClick:Y,className:"p-1.5 text-gray-400 hover:text-cyan-300 hover:bg-white/5 rounded-lg transition-colors text-xs flex items-center gap-1",title:"Restablecer valores por defecto",children:[i.jsx(Sh,{size:13}),i.jsx("span",{className:"hidden sm:inline text-[11px]",children:"Reiniciar"})]}),i.jsx("button",{type:"button",onClick:e,className:"p-1.5 text-gray-400 hover:text-white hover:bg-white/10 rounded-lg transition-colors",title:"Cerrar panel de modulación",children:i.jsx(Kt,{size:17})})]})]}),i.jsxs("div",{className:"flex items-center gap-1.5 my-2.5 border-b border-white/5 pb-2 text-xs",children:[i.jsx("button",{type:"button",onClick:()=>b("main"),className:`px-3 py-1 rounded-lg font-medium transition-all ${x==="main"?"bg-cyan-500/20 text-cyan-300 border border-cyan-500/40 shadow-[0_0_10px_rgba(6,182,212,0.25)]":"text-gray-400 hover:text-white hover:bg-white/5"}`,children:"Deslizadores Principales"}),i.jsxs("button",{type:"button",onClick:()=>b("presets"),className:`px-3 py-1 rounded-lg font-medium transition-all flex items-center gap-1 ${x==="presets"?"bg-cyan-500/20 text-cyan-300 border border-cyan-500/40 shadow-[0_0_10px_rgba(6,182,212,0.25)]":"text-gray-400 hover:text-white hover:bg-white/5"}`,children:[i.jsx(um,{size:12}),"Presets Rápidos"]}),i.jsx("button",{type:"button",onClick:()=>b("advanced"),className:`px-3 py-1 rounded-lg font-medium transition-all ${x==="advanced"?"bg-cyan-500/20 text-cyan-300 border border-cyan-500/40 shadow-[0_0_10px_rgba(6,182,212,0.25)]":"text-gray-400 hover:text-white hover:bg-white/5"}`,children:"Filtro & Resonancia"})]}),i.jsxs("div",{className:"bg-[#070a12] border border-cyan-500/25 rounded-xl p-2.5 mb-3 shadow-inner relative overflow-hidden",children:[i.jsxs("div",{className:"flex items-center justify-between text-[11px] text-gray-400 mb-1.5 px-0.5",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(Gk,{size:12,className:o?"text-emerald-400 animate-pulse":"text-gray-500"}),i.jsx("span",{className:"font-semibold text-gray-300",children:o?"Espectro de Frecuencias en Vivo":"Visualizador de Audio (Inactivo)"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:"text-[10px] text-cyan-400 font-mono",children:["Frecuencia: ",Math.round(t.frequency)," Hz"]}),i.jsxs("span",{className:"text-[10px] text-purple-400 font-mono",children:["Ganancia: ",(t.gain*100).toFixed(0),"%"]})]})]}),i.jsx("canvas",{ref:T,width:480,height:64,className:"w-full h-16 rounded-lg bg-[#090d16] border border-white/5 block"}),o&&i.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[i.jsx("span",{className:"text-[10px] text-gray-400 font-mono w-10",children:"Nivel:"}),i.jsx("div",{className:"flex-1 h-2 bg-black/60 rounded-full overflow-hidden p-0.5 border border-white/10",children:i.jsx("div",{className:`h-full rounded-full transition-all duration-75 ${C>80?"bg-rose-500":C>40?"bg-amber-400":"bg-emerald-400"}`,style:{width:`${C}%`}})}),i.jsxs("span",{className:"text-[10px] font-mono text-gray-300 w-8 text-right",children:[C,"%"]})]})]}),x==="main"&&i.jsxs("div",{className:"space-y-4 text-xs",children:[i.jsxs("div",{className:"bg-black/40 border border-white/5 rounded-xl p-3 space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("label",{className:"font-semibold text-cyan-200 flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-cyan-400"}),"Frecuencia Central / Pitch (Hz)"]}),i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsxs("span",{className:"bg-cyan-500/20 text-cyan-300 font-mono font-bold px-2 py-0.5 rounded border border-cyan-500/30 text-xs",children:[Math.round(t.frequency)," Hz"]}),i.jsxs("span",{className:"text-[10px] text-gray-400 font-medium",children:["(",k(t.frequency),")"]})]})]}),i.jsxs("div",{className:"relative flex items-center gap-2",children:[i.jsx("span",{className:"text-[10px] text-gray-500 font-mono",children:"60Hz"}),i.jsx("input",{type:"range",min:60,max:4800,step:10,value:t.frequency,onChange:E=>H("frequency",parseFloat(E.target.value)),className:"flex-1 accent-cyan-400 h-2 bg-gray-800 rounded-lg cursor-pointer transition-all"}),i.jsx("span",{className:"text-[10px] text-gray-500 font-mono",children:"4.8kHz"})]}),i.jsxs("div",{className:"flex items-center justify-between gap-1 pt-1 text-[10px]",children:[i.jsx("button",{type:"button",onClick:()=>H("frequency",120),className:"px-2 py-1 bg-white/5 hover:bg-cyan-500/20 hover:text-cyan-300 rounded border border-white/5",children:"Grave (120Hz)"}),i.jsx("button",{type:"button",onClick:()=>H("frequency",400),className:"px-2 py-1 bg-white/5 hover:bg-cyan-500/20 hover:text-cyan-300 rounded border border-white/5",children:"Cálido (400Hz)"}),i.jsx("button",{type:"button",onClick:()=>H("frequency",1e3),className:"px-2 py-1 bg-white/5 hover:bg-cyan-500/20 hover:text-cyan-300 rounded border border-white/5",children:"Medios (1kHz)"}),i.jsx("button",{type:"button",onClick:()=>H("frequency",2800),className:"px-2 py-1 bg-white/5 hover:bg-cyan-500/20 hover:text-cyan-300 rounded border border-white/5",children:"Agudo (2.8kHz)"})]})]}),i.jsxs("div",{className:"bg-black/40 border border-white/5 rounded-xl p-3 space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("label",{className:"font-semibold text-blue-200 flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-400"}),"Desplazamiento Tonal (Semitonos / Octavas)"]}),i.jsxs("span",{className:"bg-blue-500/20 text-blue-300 font-mono font-bold px-2 py-0.5 rounded border border-blue-500/30 text-xs",children:[t.pitchSemitones>0?`+${t.pitchSemitones}`:t.pitchSemitones," st",t.pitchSemitones===0&&" (Tono Natural)",t.pitchSemitones===12&&" (+1 Octava)",t.pitchSemitones===-12&&" (-1 Octava)"]})]}),i.jsxs("div",{className:"relative flex items-center gap-2",children:[i.jsx("span",{className:"text-[10px] text-gray-500 font-mono",children:"-12st"}),i.jsx("input",{type:"range",min:-12,max:12,step:1,value:t.pitchSemitones,onChange:E=>H("pitchSemitones",parseInt(E.target.value,10)),className:"flex-1 accent-blue-400 h-2 bg-gray-800 rounded-lg cursor-pointer"}),i.jsx("span",{className:"text-[10px] text-gray-500 font-mono",children:"+12st"})]})]}),i.jsxs("div",{className:"bg-black/40 border border-white/5 rounded-xl p-3 space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("label",{className:"font-semibold text-purple-200 flex items-center gap-1.5",children:[i.jsx(xl,{size:14,className:"text-purple-400"}),"Ganancia de Salida (Gain Multiplier)"]}),i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsxs("span",{className:`font-mono font-bold px-2 py-0.5 rounded text-xs border ${t.gain>1.8?"bg-rose-500/20 text-rose-300 border-rose-500/30":t.gain>1.2?"bg-amber-500/20 text-amber-300 border-amber-500/30":"bg-purple-500/20 text-purple-300 border-purple-500/30"}`,children:[(t.gain*100).toFixed(0),"% (",t.gain.toFixed(2),"x)"]}),i.jsx("span",{className:"text-[10px] text-gray-400",children:t.gain===1?"Normal":t.gain<1?"Atenuado":t.gain<=1.5?"Realzado":"Potente"})]})]}),i.jsxs("div",{className:"relative flex items-center gap-2",children:[i.jsx("span",{className:"text-[10px] text-gray-500 font-mono",children:"0%"}
4323),i.jsx("input",{type:"range",min:0,max:2.5,step:.05,value:t.gain,onChange:E=>H("gain",parseFloat(E.target.value)),className:"flex-1 accent-purple-400 h-2 bg-gray-800 rounded-lg cursor-pointer"}),i.jsx("span",{className:"text-[10px] text-gray-500 font-mono",children:"250%"})]}),i.jsxs("div",{className:"flex items-center justify-between gap-1 pt-1 text-[10px]",children:[i.jsx("button",{type:"button",onClick:()=>H("gain",.5),className:"px-2 py-1 bg-white/5 hover:bg-purple-500/20 hover:text-purple-300 rounded border border-white/5",children:"50% (Suave)"}),i.jsx("button",{type:"button",onClick:()=>H("gain",1),className:"px-2 py-1 bg-white/5 hover:bg-purple-500/20 hover:text-purple-300 rounded border border-white/5",children:"100% (Original)"}),i.jsx("button",{type:"button",onClick:()=>H("gain",1.4),className:"px-2 py-1 bg-white/5 hover:bg-purple-500/20 hover:text-purple-300 rounded border border-white/5",children:"140% (Boost)"}),i.jsx("button",{type:"button",onClick:()=>H("gain",1.9),className:"px-2 py-1 bg-white/5 hover:bg-purple-500/20 hover:text-purple-300 rounded border border-white/5",children:"190% (Fuerte)"})]})]})]}),x==="presets"&&i.jsx("div",{className:"grid grid-cols-2 gap-2 text-xs",children:JH.map(E=>{const j=f===E.id;return i.jsxs("button",{type:"button",onClick:()=>Q(E),className:`p-2.5 rounded-xl border text-left transition-all relative ${j?"bg-cyan-500/20 border-cyan-400 text-white shadow-[0_0_15px_rgba(6,182,212,0.3)]":"bg-black/30 border-white/5 text-gray-300 hover:bg-white/5 hover:text-white"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsxs("div",{className:"flex items-center gap-1.5 font-bold",children:[i.jsx("span",{className:"text-base",children:E.icon}),i.jsx("span",{children:E.name})]}),j&&i.jsx(Jr,{size:14,className:"text-cyan-400"})]}),i.jsx("p",{className:"text-[11px] text-gray-400 line-clamp-2 leading-tight",children:E.desc})]},E.id)})}),x==="advanced"&&i.jsxs("div",{className:"space-y-4 text-xs",children:[i.jsxs("div",{className:"bg-black/40 border border-white/5 rounded-xl p-3 space-y-2",children:[i.jsx("label",{className:"font-semibold text-gray-200",children:"Tipo de Curva de Filtro (Biquad)"}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-1.5",children:[{id:"peaking",label:"Campana (Peaking)",desc:"Realce armónico centrado"},{id:"lowpass",label:"Pasa-Bajos",desc:"Corta agudos / Profundo"},{id:"highpass",label:"Pasa-Altos",desc:"Corta graves / Metálico"},{id:"bandpass",label:"Pasa-Banda",desc:"Efecto radio / Walkie"}].map(E=>i.jsxs("button",{type:"button",onClick:()=>H("filterType",E.id),className:`p-2 rounded-lg border text-left transition-all ${t.filterType===E.id?"bg-cyan-500/20 text-cyan-200 border-cyan-400 font-bold":"bg-white/5 text-gray-400 border-white/5 hover:text-white"}`,children:[i.jsx("div",{className:"font-semibold",children:E.label}),i.jsx("div",{className:"text-[10px] text-gray-400",children:E.desc})]},E.id))})]}),i.jsxs("div",{className:"bg-black/40 border border-white/5 rounded-xl p-3 space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("label",{className:"font-semibold text-emerald-200 flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-400"}),"Factor Q (Resonancia y Anchura de Banda)"]}),i.jsxs("span",{className:"bg-emerald-500/20 text-emerald-300 font-mono font-bold px-2 py-0.5 rounded border border-emerald-500/30 text-xs",children:["Q = ",t.qResonance.toFixed(1)]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-[10px] text-gray-500 font-mono",children:"0.2 (Suave)"}),i.jsx("input",{type:"range",min:.2,max:10,step:.1,value:t.qResonance,onChange:E=>H("qResonance",parseFloat(E.target.value)),className:"flex-1 accent-emerald-400 h-2 bg-gray-800 rounded-lg cursor-pointer"}),i.jsx("span",{className:"text-[10px] text-gray-500 font-mono",children:"10.0 (Robótico)"})]})]})]}),i.jsxs("div",{className:"mt-3 pt-3 border-t border-white/10 flex flex-wrap items-center justify-between gap-2.5",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:U,className:`px-3 py-1.5 rounded-xl font-semibold text-xs flex items-center gap-1.5 transition-all ${o?"bg-rose-600 text-white shadow-[0_0_15px_rgba(225,29,72,0.6)] animate-pulse":"bg-cyan-600 hover:bg-cyan-500 text-white shadow-[0_0_12px_rgba(6,182,212,0.4)]"}`,children:[o?i.jsx($B,{size:14}):i.jsx(hh,{size:14}),i.jsx("span",{children:o?"Detener Prueba de Mic":"Probar Micrófono en Vivo"})]}),i.jsxs("button",{type:"button",onClick:()=>H("liveMonitoring",!t.liveMonitoring),className:`px-2.5 py-1.5 rounded-xl text-xs flex items-center gap-1.5 transition-all border ${t.liveMonitoring?"bg-purple-600/30 text-purple-200 border-purple-400 shadow-[0_0_10px_rgba(168,85,247,0.3)]":"bg-white/5 text-gray-400 border-white/10 hover:text-white"}
4323`,title:"Escucha cómo suena tu voz en tiempo real. Usa auriculares para evitar eco.",children:[i.jsx(GR,{size:13,className:t.liveMonitoring?"text-purple-300":""}),i.jsx("span",{className:"text-[11px]",children:t.liveMonitoring?"ð§ Monitoreo: ON":"ð§ OÃr mi voz (Auriculares)"})]})]}),i.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none text-xs",children:[i.jsx("span",{className:"text-gray-300 text-[11px] font-medium",children:"Aplicar en Grabación de Voz:"}),i.jsx("div",{onClick:()=>H("enabled",!t.enabled),className:`w-9 h-5 rounded-full p-0.5 transition-colors duration-200 ease-in-out cursor-pointer flex items-center ${t.enabled?"bg-cyan-500 justify-end":"bg-gray-700 justify-start"}`,children:i.jsx("div",{className:"w-4 h-4 rounded-full bg-white shadow-md transition-transform"})})]})]})]}):null}function YH({isOpen:n,onClose:e,notifications:t,onClear:s,onViewProfile:o,onOpenPrivateChat:l,onDismissNotification:u}){if(!n)return null;const h=p=>{u&&u(p.id),e(),p.type==="like"||p.type==="heart"?o(p.sender):p.type==="private_msg"?l(p.sender):p.type==="friend_accepted"&&o(p.sender)},f=p=>{const x=Math.floor((Date.now()-p)/1e3);return x<60?"Ahora mismo":x<3600?`Hace ${Math.floor(x/60)} min`:x<86400?`Hace ${Math.floor(x/3600)} h`:new Date(p).toLocaleDateString()};return i.jsx("div",{className:"fixed inset-0 z-[160] bg-black/70 backdrop-blur-sm flex items-center justify-center p-3 sm:p-4",onClick:e,children:i.jsxs("div",{className:"bg-[#0f1322] border border-cyan-500/30 rounded-3xl max-w-md w-full shadow-[0_20px_60px_rgba(0,0,0,0.8)] overflow-hidden flex flex-col max-h-[80vh] relative animate-in zoom-in-95 duration-150",onClick:p=>p.stopPropagation(),children:[i.jsxs("div",{className:"p-4 border-b border-white/10 flex items-center justify-between bg-[#151a2e]",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-8 h-8 rounded-xl bg-pink-500/20 border border-pink-500/40 flex items-center justify-center text-pink-400",children:i.jsx(Ey,{size:18})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-bold text-white text-sm",children:"Notificaciones"}),i.jsx("p",{className:"text-[11px] text-gray-400",children:"Likes, corazoncitos y mensajes privados"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[t.length>0&&i.jsxs("button",{onClick:s,className:"text-[11px] text-gray-400 hover:text-rose-400 px-2 py-1 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-1",title:"Limpiar todas",children:[i.jsx(Vs,{size:13}),i.jsx("span",{children:"Limpiar"})]}),i.jsx("button",{onClick:e,className:"w-8 h-8 rounded-xl bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white flex items-center justify-center transition-colors",children:i.jsx(Kt,{size:16})})]})]}),i.jsx("div",{className:"p-3 overflow-y-auto space-y-2 flex-1 scrollbar-thin",children:t.length===0?i.jsxs("div",{className:"text-center py-12 space-y-2",children:[i.jsx("div",{className:"w-12 h-12 rounded-full bg-white/5 mx-auto flex items-center justify-center text-gray-500",children:i.jsx(Ey,{size:22})}),i.jsx("p",{className:"text-gray-400 text-xs font-medium",children:"No tienes notificaciones pendientes"}),i.jsx("p",{className:"text-gray-600 text-[11px]",children:"Aquà verás los likes, corazones y mensajes privados"})]}):t.map(p=>i.jsxs("div",{onClick:()=>h(p),className:`p-3 rounded-2xl border transition-all cursor-pointer flex items-center justify-between gap-3 hover:scale-[1.01] active:scale-[0.99] ${p.type==="heart"?"bg-pink-500/10 border-pink-500/30 hover:bg-pink-500/20":p.type==="like"?"bg-cyan-500/10 border-cyan-500/30 hover:bg-cyan-500/20":"bg-purple-500/10 border-purple-500/30 hover:bg-purple-500/20"}`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"relative shrink-0",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-gray-800 overflow-hidden border border-white/15",children:p.senderPic?i.jsx("img",{src:p.senderPic,alt:p.sender,className:"w-full h-full object-cover"}):i.jsx("div",{className:"w-full h-full flex items-center justify-center text-gray-400 font-bold text-xs",children:p.sender.charAt(0).toUpperCase()})}),i.jsx("div",{className:"absolute -bottom-1 -right-1 w-5 h-5 rounded-full flex items-center justify-center text-white text-[10px] shadow-md border border-[#0f1322] bg-[#1a2238]",children:p.type==="heart"?i.jsx(Sm,{size:11,className:"text-pink-400 fill-pink-400"}):p.type==="like"?i.jsx(JI,{size:11,className:"text-cyan-400 fill-cyan-400"}):p.type==="friend_request"?i.jsx(_u,{size:11,className:"text-emerald-400"}):i.jsx(fl,{size:11,className:"text-purple-400"})})]}),i.jsxs("div",{className:"space-y-0.5",children:[i.jsxs("p",{className:"text-xs font-bold text-white flex items-center gap-1.5",children:[i.jsx("span",{children:p.sender}),i.jsxs("span",{className:"text-[10px] text-gray-400 font-normal",children:[p.type==="heart"&&"te envió un corazoncito â¤ï¸",p.type==="like"&&"le dio like a tu perfil ð",p.type==="friend_request"&&"te envió una solicitud de amistad ð¤",p.type==="profile_comment"&&"comentó en tu perfil ð¬",p.type==="private_msg"&&"te envió un mensaje privado ð¬",p.type==="friend_accepted"&&"aceptó tu solicitud de amistad â¨",p.type==="friend_rejected"&&"rechazó la solicitud de amistad"]})]}),p.text&&i.jsxs("p",{className:"text-[11px] text-gray-300 line-clamp-1 italic",children:['"',p.text,'"']}),i.jsx("p",{className:"text-[10px] text-gray-500",children:f(p.timestamp)})]})]}),i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[u&&i.jsx("button",{type:"button",onClick:x=>{x.stopPropagation(),u(p.id)},className:"text-gray-500 hover:text-rose-400 p-1 rounded-lg hover:bg-white/5 transition-colors",title:"Eliminar notificación",children:i.jsx(Kt,{size:13})}),i.jsx("div",{className:"text-gray-400 hover:text-white p-1",children:i.jsx(HB,{size:14})})]})]}
4323,p.id))})]})})}function XH({isOpen:n,onClose:e,friends:t,pendingRequests:s,onlineUsers:o,onAcceptRequest:l,onRejectRequest:u,onRemoveFriend:h,onViewProfile:f,onOpenPrivateChat:p}){const[x,b]=y.useState(s.length>0?"requests":"friends"),[C,N]=y.useState("");if(!n)return null;const T=new Set(o.map(A=>A.username)),R=t.filter(A=>A.username.toLowerCase().includes(C.toLowerCase()));return i.jsx("div",{className:"fixed inset-0 z-[160] bg-black/70 backdrop-blur-sm flex items-center justify-center p-3 sm:p-4",onClick:e,children:i.jsxs("div",{className:"bg-[#0f1322] border border-cyan-500/30 rounded-3xl max-w-md w-full shadow-[0_20px_60px_rgba(0,0,0,0.8)] overflow-hidden flex flex-col max-h-[85vh] relative animate-in zoom-in-95 duration-150",onClick:A=>A.stopPropagation(),children:[i.jsxs("div",{className:"p-4 border-b border-white/10 flex items-center justify-between bg-[#151a2e]",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-8 h-8 rounded-xl bg-cyan-500/20 border border-cyan-500/40 flex items-center justify-center text-cyan-400",children:i.jsx(Na,{size:18})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-bold text-white text-sm",children:"Amigos & Solicitudes"}),i.jsx("p",{className:"text-[11px] text-gray-400",children:"Gestiona tus amigos y conexiones"})]})]}),i.jsx("button",{onClick:e,className:"w-8 h-8 rounded-xl bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white flex items-center justify-center transition-colors",children:i.jsx(Kt,{size:16})})]}),i.jsxs("div",{className:"flex border-b border-white/10 bg-[#0a0d16] px-3 pt-2 gap-2",children:[i.jsxs("button",{onClick:()=>b("friends"),className:`flex items-center gap-2 px-3 py-2 rounded-t-xl text-xs font-bold transition-all border-b-2 ${x==="friends"?"border-cyan-400 text-cyan-300 bg-white/5":"border-transparent text-gray-400 hover:text-gray-200"}`,children:[i.jsx(Na,{size:14}),i.jsxs("span",{children:["Mis Amigos (",t.length,")"]})]}),i.jsxs("button",{onClick:()=>b("requests"),className:`flex items-center gap-2 px-3 py-2 rounded-t-xl text-xs font-bold transition-all border-b-2 relative ${x==="requests"?"border-pink-400 text-pink-300 bg-white/5":"border-transparent text-gray-400 hover:text-gray-200"}`,children:[i.jsx(_u,{size:14}),i.jsx("span",{children:"Solicitudes"}),s.length>0&&i.jsx("span",{className:"w-2 h-2 rounded-full bg-rose-500 animate-ping inline-block"}),s.length>0&&i.jsx("span",{className:"px-1.5 py-0.2 rounded-full bg-rose-500/30 text-rose-300 text-[10px] border border-rose-500/40",children:s.length})]})]}),x==="friends"&&i.jsxs("div",{className:"p-3 space-y-3 flex-1 overflow-y-auto scrollbar-thin",children:[i.jsxs("div",{className:"relative",children:[i.jsx(Sg,{size:14,className:"absolute left-3 top-2.5 text-gray-400"}),i.jsx("input",{type:"text",placeholder:"Buscar amigo...",value:C,onChange:A=>N(A.target.value),className:"w-full bg-black/40 border border-white/10 rounded-xl pl-8 pr-3 py-1.5 text-xs text-white placeholder-gray-500 focus:outline-none focus:border-cyan-500"})]}),R.length===0?i.jsxs("div",{className:"text-center py-12 space-y-2",children:[i.jsx("div",{className:"w-12 h-12 rounded-full bg-white/5 mx-auto flex items-center justify-center text-gray-500",children:i.jsx(Na,{size:22})}),i.jsx("p",{className:"text-gray-400 text-xs font-medium",children:"Aún no tienes amigos agregados"}),i.jsx("p",{className:"text-gray-600 text-[11px]",children:"Toca el perfil de un usuario en el chat para enviarle solicitud de amistad."})]}):i.jsx("div",{className:"space-y-2",children:R.map(A=>{const U=T.has(A.username);return i.jsxs("div",{className:"p-2.5 rounded-2xl bg-white/[0.03] hover:bg-white/[0.06] border border-white/5 flex items-center justify-between gap-3 transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-2.5 cursor-pointer flex-1 min-w-0",onClick:()=>{e(),f(A.username)},children:[i.jsxs("div",{className:"relative shrink-0",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-gray-800 overflow-hidden border border-white/10",children:A.profilePic?i.jsx("img",{src:A.profilePic,alt:A.username,className:"w-full h-full object-cover"}):i.jsx("div",{className:"w-full h-full flex items-center justify-center text-gray-400 font-bold text-xs",children:A.username.charAt(0).toUpperCase()})}),i.jsx("div",{className:`absolute -bottom-0.5 -right-0.5 w-3.5 h-3.5 rounded-full border-2 border-[#0f1322] ${U?"bg-emerald-400 animate-pulse":"bg-gray-500"}`,title:U?"En lÃnea":"Desconectado"})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsxs("div",{className:"text-xs font-bold text-white flex items-center gap-1.5 truncate",children:[i.jsx("span",{children:A.username}),i.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded-full border ${U?"bg-emerald-500/10 text-emerald-300 border-emerald-500/30":"bg-white/5 text-gray-400 border-white/5"}`,children:U?"En lÃnea":"Desconectado"})]}),A.statusMessage&&i.jsx("p",{className:"text-[10px] text-gray-400 truncate",children:A.statusMessage})]})]}),i.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[i.jsx("button",{onClick:()=>{e(),p(A.username)},className:"p-1.5 rounded-xl bg-cyan-500/15 hover:bg-cyan-500/25 text-cyan-300 transition-colors",title:"Enviar mensaje privado",children:i.jsx(Th,{size:15})}),i.jsx("button",{onClick:()=>{e(),f(A.username)},className:"p-1.5 rounded-xl bg-white/5 hover:bg-white/10 text-gray-300 hover:text-white transition-colors",title:"Ver perfil",children:i.jsx(Pu,{size:15})}),i.jsx("button",{onClick:()=>h(A.username),className:"p-1.5 rounded-xl bg-white/5 hover:bg-rose-500/20 text-gray-500 hover:text-rose-400 transition-colors",title:"Eliminar de amigos",children:i.jsx(Vs,{size:15})})]})]},A.username)})})]}),x==="requests"&&i.jsx("div",{className:"p-3 space-y-2 flex-1 overflow-y-auto scrollbar-thin",children:s.length===0?i.jsxs("div",{className:"text-center py-12 space-y-2",children:[i.jsx("div",{className:"w-12 h-12 rounded-full bg-white/5 mx-auto flex items-center justify-center text-gray-500",children:i.jsx(_u,{size:22})}),i.jsx("p",{className:"text-gray-400 text-xs font-medium",children:"No tienes solicitudes pendientes"}),i.jsx("p",{className:"text-gray-600 text-[11px]",children:"Cuando alguien te envÃe una solicitud de amistad, aparecerá aquà con un punto rojo."})]}):s.map(A=>i.jsxs("div",{className:"p-3 rounded-2xl bg-gradient-to-r from-pink-500/10 to-cyan-500/10 border border-pink-500/20 space-y-2.5",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-10 h-10 rounded-full bg-gray-800 overflow-hidden border border-white/15 shrink-0",children:A.fromPic?i.jsx("img",{src:A.fromPic,alt:A.from,className:"w-full h-full object-cover"}):i.jsx("div",{className:"w-full h-full flex items-center justify-center text-gray-400 font-bold text-xs",children:A.from.charAt(0).toUpperCase()})}),i.jsxs("div",{children:[i.jsxs("h4",{className:"text-xs font-bold text-white flex items-center gap-1.5",children:[i.jsx("span",{children:A.from}),i.jsx("span",{className:"text-[10px] text-pink-300 font-medium",children:"quiere ser amigo tuyo"})]}),i.jsx("p",{className:"text-[10px] text-gray-400",children:"¿Deseas aceptar la solicitud?"})]})]}),i.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[i.jsxs("button",{onClick:()=>l(A),className:"flex-1 py-1.5 rounded-xl bg-emerald-500 hover:bg-emerald-400 text-black font-bold text-xs flex items-center justify-center gap-1.5 transition-all shadow-sm active:scale-95",children:[i.jsx(Jr,{size:14}),i.jsx("span",{children:"Aceptar"})]}),i.jsxs("button",{onClick:()=>u(A),className:"flex-1 py-1.5 rounded-xl bg-white/10 hover:bg-rose-500/20 text-gray-300 hover:text-rose-300 font-bold text-xs flex items-center justify-center gap-1.5 transition-all border border-white/5 active:scale-95",children:[i.jsx(Kt,{size:14}),i.jsx("span",{children:"Rechazar"})]})]})]},A.id))})]})})}function WH({isOpen:n,onClose:e,items:t,onClear:s,onNavigateToRoom:o,onOpenPrivateChat:l}){if(!n)return null;const u=f=>
4323{e(),f.type==="private_chat"?l(f.sender):f.room&&o(f.room)},h=f=>{const p=Math.floor((Date.now()-f)/1e3);return p<60?"Ahora":p<3600?`${Math.floor(p/60)}m`:p<86400?`${Math.floor(p/3600)}h`:new Date(f).toLocaleDateString()};return i.jsx("div",{className:"fixed inset-0 z-[160] bg-black/70 backdrop-blur-sm flex items-center justify-center p-3 sm:p-4",onClick:e,children:i.jsxs("div",{className:"bg-[#0f1322] border border-cyan-500/30 rounded-3xl max-w-md w-full shadow-[0_20px_60px_rgba(0,0,0,0.8)] overflow-hidden flex flex-col max-h-[85vh] relative animate-in zoom-in-95 duration-150",onClick:f=>f.stopPropagation(),children:[i.jsxs("div",{className:"p-4 border-b border-white/10 flex items-center justify-between bg-[#151a2e]",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-8 h-8 rounded-xl bg-purple-500/20 border border-purple-500/40 flex items-center justify-center text-purple-400",children:i.jsx(fl,{size:18})}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-bold text-white text-sm",children:"Buzón de Mensajes"}),i.jsx("p",{className:"text-[11px] text-gray-400",children:"Menciones en salas y mensajes directos"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[t.length>0&&i.jsxs("button",{onClick:s,className:"text-[11px] text-gray-400 hover:text-rose-400 px-2 py-1 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-1",title:"Limpiar buzón",children:[i.jsx(Vs,{size:13}),i.jsx("span",{children:"Limpiar"})]}),i.jsx("button",{onClick:e,className:"w-8 h-8 rounded-xl bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white flex items-center justify-center transition-colors",children:i.jsx(Kt,{size:16})})]})]}),i.jsx("div",{className:"p-3 overflow-y-auto space-y-2 flex-1 scrollbar-thin",children:t.length===0?i.jsxs("div",{className:"text-center py-12 space-y-2",children:[i.jsx("div",{className:"w-12 h-12 rounded-full bg-white/5 mx-auto flex items-center justify-center text-gray-500",children:i.jsx(fl,{size:22})}),i.jsx("p",{className:"text-gray-400 text-xs font-medium",children:"Buzón vacÃo"}),i.jsx("p",{className:"text-gray-600 text-[11px] max-w-xs mx-auto",children:"Cuando alguien te mencione por tu nombre en una sala o te escriba en privado, aparecerá aquÃ."})]}):t.map(f=>i.jsxs("div",{onClick:()=>u(f),className:"p-3 rounded-2xl bg-white/[0.03] hover:bg-white/[0.07] border border-white/5 hover:border-cyan-500/30 flex items-start justify-between gap-3 cursor-pointer transition-all hover:scale-[1.01] active:scale-[0.99]",children:[i.jsxs("div",{className:"flex items-start gap-2.5 flex-1 min-w-0",children:[i.jsxs("div",{className:"relative shrink-0 mt-0.5",children:[i.jsx("div",{className:"w-9 h-9 rounded-full bg-gray-800 overflow-hidden border border-white/10",children:f.senderPic?i.jsx("img",{src:f.senderPic,alt:f.sender,className:"w-full h-full object-cover"}):i.jsx("div",{className:"w-full h-full flex items-center justify-center text-gray-400 font-bold text-xs",children:f.sender.charAt(0).toUpperCase()})}),i.jsx("div",{className:"absolute -bottom-1 -right-1 w-4 h-4 rounded-full flex items-center justify-center text-white text-[9px] bg-[#172033] border border-white/20",children:f.type==="mention"?i.jsx(Kk,{size:10,className:"text-amber-400"}):i.jsx(Th,{size:10,className:"text-cyan-400"})})]}),i.jsxs("div",{className:"space-y-1 flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center justify-between gap-1",children:[i.jsx("span",{className:"text-xs font-bold text-white truncate",children:f.sender}),i.jsx("span",{className:"text-[10px] text-gray-500 shrink-0",children:h(f.timestamp)})]}),i.jsx("div",{className:"text-[11px] text-cyan-300 font-medium flex items-center gap-1",children:f.type==="mention"?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-amber-400 font-bold",children:"Te nombró en:"}),i.jsx("span",{className:"truncate",children:f.roomTitle||f.room||"Chat Global"})]}):i.jsx("span",{children:"Mensaje privado"})}),i.jsx("p",{className:"text-xs text-gray-300 line-clamp-2 bg-black/30 p-2 rounded-xl border border-white/5 break-words",children:f.text})]})]}),i.jsx("div",{className:"text-gray-400 hover:text-white shrink-0 pt-2",children:i.jsx(HB,{size:14})})]},f.id))})]})})}function ZH({isOpen:n,onClose:e,currentUser:t,messagesCount:s,delegatedAdmins:o,bannedUsers:l,allUsersList:u,onOpenCleaner:h,onOpenSyncToAxis:f,onOpenCustomizer:p,onOpenAiConfig:x,onPromoteToAdmin:b,onDemoteAdmin:C,onBanAdminOrUser:N,onUnbanUser:T,onSetGlobalBackgroun
4323d:R}){const[A,U]=y.useState("tools"),[M,V]=y.useState(null),[H,Q]=y.useState(()=>localStorage.getItem("chatliz_app_default_bg")||""),Y=y.useMemo(()=>a1(H),[H]);if(!n)return null;const k=(t==null?void 0:t.username)==="AXISS"||(t==null?void 0:t.username)==="Axiss",E=async(j,P)=>{V(j);try{await P()}finally{V(null)}};return i.jsx("div",{className:"fixed inset-0 z-[160] bg-black/80 backdrop-blur-md flex items-center justify-center p-3 sm:p-4",onClick:e,children:i.jsxs("div",{className:"bg-[#0b0e17] border border-red-500/40 rounded-3xl max-w-lg w-full shadow-[0_25px_70px_rgba(0,0,0,0.9)] overflow-hidden flex flex-col max-h-[88vh] relative animate-in zoom-in-95 duration-150",onClick:j=>j.stopPropagation(),children:[i.jsxs("div",{className:"p-4 sm:p-5 border-b border-white/10 flex items-center justify-between bg-gradient-to-r from-red-950/50 via-[#151221] to-[#0b0e17]",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-red-500/20 border border-red-500/40 flex items-center justify-center text-red-400 shadow-[0_0_15px_rgba(239,68,68,0.3)]",children:i.jsx(tm,{size:22})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"text-base sm:text-lg font-black text-white flex items-center gap-2",children:["Panel Oculto de Administración",i.jsx("span",{className:"text-[10px] bg-red-500/20 text-red-300 px-2 py-0.5 rounded-full border border-red-500/30 uppercase font-mono font-bold",children:k?"Master Admin":"Admin Delegado"})]}),i.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:"Acceso restringido para control total del chat"})]})]}),i.jsx("button",{onClick:e,className:"w-9 h-9 rounded-xl bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white flex items-center justify-center transition-colors border border-white/5",children:i.jsx(Kt,{size:18})})]}),i.jsxs("div",{className:"flex border-b border-white/10 bg-[#07090f] px-4 pt-2 gap-2",children:[i.jsxs("button",{onClick:()=>U("tools"),className:`flex items-center gap-2 px-3.5 py-2.5 rounded-t-xl text-xs font-bold transition-all border-b-2 ${A==="tools"?"border-red-400 text-red-300 bg-white/5":"border-transparent text-gray-400 hover:text-gray-200"}`,children:[i.jsx(TD,{size:14}),i.jsx("span",{children:"Herramientas Admin"})]}),i.jsxs("button",{onClick:()=>U("admins"),className:`flex items-center gap-2 px-3.5 py-2.5 rounded-t-xl text-xs font-bold transition-all border-b-2 ${A==="admins"?"border-cyan-400 text-cyan-300 bg-white/5":"border-transparent text-gray-400 hover:text-gray-200"}`,children:[i.jsx(AE,{size:14}),i.jsx("span",{children:"Administradores"})]}),k&&i.jsxs("button",{onClick:()=>U("bans"),className:`flex items-center gap-2 px-3.5 py-2.5 rounded-t-xl text-xs font-bold transition-all border-b-2 ${A==="bans"?"border-rose-400 text-rose-300 bg-white/5":"border-transparent text-gray-400 hover:text-gray-200"}`,children:[i.jsx(IC,{size:14}),i.jsxs("span",{children:["Bloqueados (",l.length,")"]})]})]}),A==="tools"&&i.jsxs("div",{className:"p-4 sm:p-5 space-y-3.5 overflow-y-auto flex-1 scrollbar-thin",children:[i.jsx("div",{className:"text-xs text-gray-400 leading-relaxed bg-white/[0.02] border border-white/5 p-3 rounded-2xl",children:"Esta sección oculta reúne las funciones que estaban visibles en el chat global, para que solo tú como administrador las controles."}),i.jsxs("div",{className:"p-3.5 rounded-2xl bg-purple-500/10 border border-purple-500/30 flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-purple-500/20 border border-purple-500/30 flex items-center justify-center text-purple-400 shrink-0",children:i.jsx(Vs,{size:20})}),i.jsxs("div",{children:[i.jsxs("div",{className:"font-bold text-white text-xs flex items-center gap-2",children:[i.jsx("span",{children:"Limpiador de Sala Global"}),i.jsxs("span",{className:"px-2 py-0.5 rounded-full bg-black/50 text-[10px] font-mono text-purple-300 border border-purple-500/30",children:[s,"/20 Mensajes"]})]}),i.jsx("div",{className:"text-[11px] text-gray-400 mt-0.5",children:"Se auto-limpia a los 20 mensajes preservando el último para responder"})]})]}),i.jsx("button",{onClick:()=>{e(),h()},className:"px-3 py-2 rounded-xl bg-purple-600 hover:bg-purple-500 text-white font-bold text-xs shadow-md transition-all shrink-0",children:"Abrir Limpiador"})]}),i.jsxs("div",{className:"p-3.5 rounded-2xl bg-cyan-500/10 border border-cyan-500/30 flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-cyan-500/20 border border-cyan-500/30 flex items-center justify-center text-cyan-400 shrink-0",children:i.jsx(Fs,{size:20})}),i.jsxs("div",{children:[i.jsx("div",{className:"font-bold text-white text-xs",children:"Transportador a ChatLiz (Hugging Face / Axis)"}),i.jsx("div",{className:"text-[11px] text-gray-400 mt-0.5",children:"Enviar cambios de diseño, limpiador y código con tu token o cloud"})]})]}),i.jsx("button",{onClick:()=>{e(),f()},className:"px-3 py-2 rounded-xl bg-cyan-500 hover:bg-cyan-400 text-black font-bold text-xs shadow-md transition-all shrink-0",children:"Transportar"})]}),i.jsxs("div",{className:"p-3.5 rounded-2xl bg-amber-500/10 border border-amber-500/30 flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-amber-500/20 border border-amber-500/30 flex items-center justify-center text-amber-400 shrink-0",children:i.jsx(ko,{size:20})}),i.jsxs("div",{children:[i.jsx("div",{className:"font-bold text-white text-xs",children:"Personalizar Chat Global (Tema y Reglas)"}),i.jsx("div",{className:"text-[11px] text-gray-400 mt-0.5",children:"Modificar estilos, colores y parámetros globales del chat"})]})]}),i.jsx("button",{onClick:()=>{e(),p()},className:"px-3 py-2 rounded-xl bg-amber-500 hover:bg-amber-400 text-black font-bold text-xs shadow-md transition-all shrink-0",children:"Personalizar"})]}),i.jsxs("div",{className:"p-3.5 rounded-2xl bg-fuchsia-500/10 border border-fuchsia-500/30 flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-fuchsia-500/20 border border-fuchsia-500/30 flex items-center justify-center text-fuchsia-400 shrink-0",children:i.jsx(gl,{size:20})}),i.jsxs("div",{children:[i.jsx("div",{className:"font-bold text-white text-xs",children:"Configuración de IA (Elizabeth)"}),i.jsx("div",{className:"text-[11px] text-gray-400 mt-0.5",children:"Instrucciones de sistema, personalidad y avatar del asistente IA"})]})]}),i.jsx("button",{onClick:()=>{e(),x()},className:"px-3 py-2 rounded-xl bg-fuchsia-500 hover:bg-fuchsia-400 text-white font-bold text-xs shadow-md transition-all shrink-0",children:"Configurar IA"})]}),i.jsxs("div",{className:"p-3.5 rounded-2xl bg-blue-500/10 border border-blue-500/30 space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-500/20 border border-blue-500/30 flex items-center justify-center text-blue-400 shrink-0",children:i.jsx(ko,{size:20})}),i.jsxs("div",{children:[i.jsxs("div",{className:"font-bold text-white text-xs flex items-center gap-2",children:[i.jsx("span",{children:"Fondo Predeterminado de la App (Global)"}),i.jsx("span",{className:"text-[10px] bg-red-500/20 text-red-300 px-1.5 py-0.5 rounded border border-red-500/30",children:"Solo Admin"})]}),i.jsxs("div",{className:"text-[11px] text-gray-400 mt-0.5",children:["Establece el fondo para todos los usuarios. Compatible con ",i.jsx("strong",{children:"YouTube, Pinterest, videos (MP4/WebM), imágenes, avatares o enlaces web"}),"."]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",placeholder:"Pega URL de YouTube, Pinterest, video MP4, imagen o enlace web...",value:H,onChange:j=>Q(j.target.value),id:"admin-default-bg-input",className:"flex-1 bg-black/40 border border-white/10 rounded-xl px-3 py-2 text-xs text-white placeholder-gray-500 focus:outline-none focus:border-blue-400"}),i.jsx("button",{type:"button",onClick:()=>{const j=H.trim();localStorage.setItem("chatliz_app_default_bg",j),R&&R(j),window.dispatchEvent(new Event("chatliz_ui_update")),alert(`â
Fondo predeterminado actualizado correctamente (${Y.label})`)},className:"px-4 py-2 rounded-xl bg-blue-600 hover:bg-blue-500 text-white font-bold text-xs shadow transition-all shrink-0 flex items-center gap-1.5",children:i.jsx("span",{children:"Guardar Global"})}),H&&i.jsx("button",{type:"button",onClick:()=>{Q(""),localStorage.removeItem("chatliz_app_default_bg"),R&&R(""),window.dispatchEvent(new Event("chatliz_ui_update"))},className:"px-2.5 py-2 rounded-xl bg-white/5 hover:bg-red-500/20 text-gray-400 hover:text-red-300 text-xs transition-colors",title:"Quitar fondo",children:i.jsx(Vs,{size:14})})]}),H.trim()&&i.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-xl bg-white/5 border border-white/10 text-[11px]",children:[i.jsx("span",{className:"text-base",children:Y.icon}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("span",{className:"font-semibold text-blue-300",children:Y.label}),i.jsx("p",{className:"text-[10px] text-gray-400 truncate",children:Y.type==="youtube"?"Se reproducirá en bucle continuo de fondo silenciado automáticamente para todo el chat.":Y.type==="pinterest"?"Contenido de Pinterest adaptado para el fondo.":Y.type==="video"?"Video continuo en bucle adaptado a la pantalla.":"Listo para proyectarse en el chat de todos los usuarios."})]})]})]})]}),i.jsxs("div",{className:"p-3.5 rounded-2xl bg-indigo-500/10 border border-indigo-500/30 space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-indigo-500/20 border border-indigo-500/30 flex items-center justify-center text-indigo-400 shrink-0",children:i.jsx(Fs,{size:20})}),i.jsxs("div",{children:[i.jsxs("div",{className:"font-bold text-white text-xs flex items-center gap-2",children:[i.jsx("span",{children:"Fondos SDK de Publicidad & Video"}),i.jsx("span",{className:"text-[10px] bg-red-500/20 text-red-300 px-1.5 py-0.5 rounded border border-red-500/30",children:"Solo Admin"})]}),i.jsx("div",{className:"text-[11px] text-gray-400 mt-0.5",children:"Fondo visual para las pantallas del reproductor SDK de videos recompensados"})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",placeholder:"https://ejemplo.com/fondo-sdk.jpg",defaultValue:localStorage.getItem("chatliz_sdk_bg")||"",id:"admin-sdk-bg-input",className:"flex-1 bg-black/40 border border-white/10 rounded-xl px-3 py-2 text-xs text-white placeholder-gray-500 focus:outline-none focus:border-indigo-400"}),i.jsx("button",{type:"button",onClick:()=>{const j=document.getElementById("admin-sdk-bg-input");j&&(localStorage.setItem("chatliz_sdk_bg",j.value.trim()),window.dispatchEvent(new Event("chatliz_ui_update")),alert("â
Fondo del SDK publicitario actualizado"))},className:"px-3 py-2 rounded-xl bg-indigo-600 hover:bg-indigo-500 text-white font-bold text-xs shadow transition-all shrink-0",children:"Guardar"})]})]}),i.jsxs("div",{className:"p-3.5 rounded-2xl bg-emerald-500/10 border border-emerald-500/30 flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-500/20 border border-emerald-500/30 flex items-center justify-center text-emerald-400 shrink-0",children:i.jsx(di,{size:20})}),i.jsxs("div",{children:[i.jsxs("div",{className:"font-bold text-white text-xs flex items-center gap-2",children:[i.jsx("span",{children:"Permiso de Reproducción de Videos (Tokens IA & Monet
4323ización)"}),i.jsx("span",{className:"text-[10px] bg-red-500/20 text-red-300 px-1.5 py-0.5 rounded border border-red-500/30",children:"Solo Admin"})]}),i.jsx("div",{className:"text-[11px] text-gray-400 mt-0.5",children:"Habilita videos publicitarios para recargar tokens cuando las IA se queden sin saldo"})]})]}),i.jsxs("label",{className:"relative inline-flex items-center cursor-pointer shrink-0",children:[i.jsx("input",{type:"checkbox",defaultChecked:localStorage.getItem("chatliz_video_monetization_enabled")!=="false",onChange:j=>{localStorage.setItem("chatliz_video_monetization_enabled",j.target.checked.toString()),window.dispatchEvent(new Event("chatliz_ui_update"))},className:"sr-only peer"}),i.jsx("div",{className:"w-11 h-6 bg-gray-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-emerald-500"})]})]})]}),A==="admins"&&i.jsxs("div",{className:"p-4 sm:p-5 space-y-4 overflow-y-auto flex-1 scrollbar-thin",children:[i.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-2xl p-3 text-xs text-amber-200",children:[i.jsx("strong",{children:"Regla de Autoridad:"})," Solo ",i.jsx("strong",{children:"AXISS"})," y ",i.jsx("strong",{children:"Axiss"})," son Administradores Principales inmunes. Pueden nombrar a otros usuarios como administradores y también quitarlos o bloquearlos si cometen errores."]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("h4",{className:"text-xs font-bold text-gray-300 uppercase tracking-wider flex items-center gap-1.5",children:[i.jsx(AE,{size:14,className:"text-amber-400"}),"Administradores Principales (Inmunes)"]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:["AXISS","Axiss"].map(j=>i.jsxs("div",{className:"p-2.5 rounded-xl bg-amber-500/10 border border-amber-500/30 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-7 h-7 rounded-full bg-amber-500/20 text-amber-300 flex items-center justify-center font-bold text-xs",children:"ð"}),i.jsx("span",{className:"font-bold text-white text-xs",children:j})]}),i.jsx("span",{className:"text-[10px] text-amber-300 font-mono font-bold bg-amber-950/60 px-2 py-0.5 rounded-full border border-amber-500/40",children:"Inmune"})]},j))})]}),i.jsxs("div",{className:"space-y-2 pt-2 border-t border-white/5",children:[i.jsxs("h4",{className:"text-xs font-bold text-gray-300 uppercase tracking-wider flex items-center gap-1.5",children:[i.jsx(ph,{size:14,className:"text-cyan-400"}),"Administradores Delegados (",o.length,")"]}),o.length===0?i.jsx("p",{className:"text-xs text-gray-500 italic p-2",children:"No hay administradores delegados actualmente."}):i.jsx("div",{className:"space-y-2",children:o.map(j=>i.jsxs("div",{className:"p-2.5 rounded-xl bg-white/[0.03] border border-white/10 flex items-center justify-between",children:[i.jsx("span",{className:"text-xs font-bold text-white",children:j}),k&&i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsxs("button",{onClick:()=>E(`demote_${j}`,()=>C(j)),disabled:M===`demote_${j}`,className:"px-2.5 py-1 rounded-lg bg-white/10 hover:bg-white/20 text-xs text-gray-300 hover:text-white transition-all flex items-center gap-1",title:"Quitar permisos de administrador",children:[i.jsx(iO,{size:13}),i.jsx("span",{children:"Quitar"})]}),i.jsxs("button",{onClick:()=>E(`ban_${j}`,()=>N(j)),disabled:M===`ban_${j}`,className:"px-2.5 py-1 rounded-lg bg-rose-500/20 hover:bg-rose-500/30 text-xs text-rose-300 transition-all flex items-center gap-1",title:"Bloquear/Banear usuario",children:[i.jsx(IC,{size:13}),i.jsx("span",{children:"Bloquear"})]})]})]},j))})]}),k&&i.jsxs("div",{className:"space-y-2 pt-2 border-t border-white/5",children:[i.jsxs("h4",{className:"text-xs font-bold text-gray-300 uppercase tracking-wider flex items-center gap-1.5",children:[i.jsx(jy,{size:14,className:"text-emerald-400"}),"Nombrar Nuevo Administrador"]}),i.jsx("div",{className:"space-y-1.5 max-h-40 overflow-y-auto scrollbar-thin",children:u.filter(j=>j.username!=="AXISS"&&j.username!=="Axiss"&&!o.includes(j.username)&&!l.includes(j.username)).map(j=>i.jsxs("div",{className:"p-2 rounded-xl bg-white/[0.02] hover:bg-white/[0.05] border border-white/5 flex items-center justify-between",children:[i.jsx("span",{className:"text-xs text-gray-300",children:j.username}),i.jsxs("button",{onClick:()=>E(`promote_${j.username}`,()=>b(j.username)),disabled:M===`promote_${j.username}`,className:"px-2.5 py-1 rounded-lg bg-emerald-500/20 hover:bg-emerald-500/30 text-emerald-300 text-xs font-bold transition-all flex items-center gap-1",children:[i.jsx(jy,{size:13}),i.jsx("span",{children:"Hacer Admin"})]})]},j.username))})]})]}),A==="bans"&&k&&i.jsxs("div",{className:"p-4 sm:p-5 space-y-3 overflow-y-auto flex-1 scrollbar-thin",children:[i.jsxs("h4",{className:"text-xs font-bold text-gray-300 uppercase tracking-wider flex items-center gap-1.5",children:[i.jsx(IC,{size:14,className:"text-rose-400"}),"Usuarios y Administradores Bloqueados"]}),l.length===0?i.jsx("p",{className:"text-xs text-gray-500 italic p-3 text-center",children:"No hay usuarios bloqueados actualmente."}):i.jsx("div",{className:"space-y-2",children:l.map(j=>i.jsxs("div",{className:"p-2.5 rounded-xl bg-rose-500/10 border border-rose-500/20 flex items-center justify-between",children:[i.jsx("span",{className:"text-xs font-bold text-rose-300",children:j}),i.jsx("button",{onClick:()=>E(`unban_${j}`,()=>T(j)),disabled:M===`unban_${j}`,className:"px-3 py-1 rounded-lg bg-emerald-500/20 hover:bg-emerald-500/30 text-emerald-300 text-xs font-bold transition-all",children:"Desbloquear"})]},j))})]}),i.jsx("div",{className:"p-3 border-t border-white/10 bg-[#07090f] flex justify-end",children:i.jsx("button",{onClick:e,className:"text-xs font-bold text-gray-400 hover:text-white px-4 py-2 rounded-xl transition-colors",children:"Cerrar"})})]})})}function HA({isOpen:n,onClose:e,initialTab:t="privacy"}){const[s,o]=y.useState(t),[l,u]=y.useState(!1);if(!n)return null;const h=()=>{navigator.clipboard.writeText("[email protected]"),u(!0),setTimeout(()=>u(!1),2500)};return i.jsx("div",{className:"fixed inset-0 z-[350] bg-black/80 backdrop-blur-md flex items-center justify-center p-3 sm:p-6 overflow-y-auto animate-fadeIn font-sans",children:i.jsxs("div",{className:"relative w-full max-w-3xl bg-[#0e111a] border border-cyan-500/30 rounded-3xl shadow-2xl overflow-hidden flex flex-col max-h-[92vh]",onClick:f=>f.stopPropagation(),children:[i.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-white/10 bg-gradient-to-r from-purple-950/40 via-cyan-950/30 to-purple-950/40",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-9 h-9 rounded-xl bg-cyan-500/15 border border-cyan-500/30 flex items-center justify-center text-cyan-400",children:i.jsx(bo,{size:20})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-white font-bold text-base sm:text-lg leading-tight",children:"Centro Legal, Privacidad y Soporte"}),i.jsx("p",{className:"text-white/50 text-xs",children:"Chat-Liz ⢠https://chatliz-online-chatliz.hf.space/"})]})]}),i.jsx("button",{onClick:e,className:"w-8 h-8 rounded-full bg-white/5 hover:bg-white/10 border border-white/10 flex items-center justify-center text-white/70 hover:text-white transition-colors",title:"Cerrar",children:i.jsx(Kt,{size:18})})]}),i.jsxs("div",{className:"flex border-b border-white/10 bg-black/40 overflow-x-auto scrollbar-none px-3 pt-2 gap-2",children:[i.jsxs("button",{onClick:()=>o("privacy"),className:`flex items-center gap-2 px-4 py-2.5 text-xs sm:text-sm font-semibold rounded-t-xl transition-all border-b-2 whitespace-nowrap ${s==="privacy"?"bg-cyan-500/15 text-cyan-300 border-cyan-400":"text-white/60 hover:text-white border-transparent hover:bg-white/5"}`,children:[i.jsx(bo,{size:16}),"PolÃtica de Privacidad"]}),i.jsxs("button",{onClick:()=>o("terms"),className:`flex items-center gap-2 px-4 py-2.5 text-xs sm:text-sm font-semibold rounded-t-xl transition-all border-b-2 whitespace-nowrap ${s==="terms"?"bg-cyan-500/15 text-cyan-300 border-cyan-400":"text-white/60 hover:text-white border-transparent hover:bg-white/5"}`,children:[i.jsx(wB,{size:16}),"Términos y Condiciones"]}),i.jsxs("button",{onClick:()=>o("about"),className:`flex items-center gap-2 px-4 py-2.5 text-xs sm:text-sm font-semibold rounded-t-xl transition-all border-b-2 whitespace-nowrap ${s==="about"?"bg-cyan-500/15 text-cyan-300 border-cyan-400":"text-white/60 hover:text-white border-transparent hover:bg-white/5"}`,children:[i.jsx(JR,{size:16}),"Sobre Chat-Liz"]}),i.jsxs("button",{onClick:()=>o("contact"),className:`flex items-center gap-2 px-4 py-2.5 text-xs sm:text-sm font-semibold rounded-t-xl transition-all border-b-2 whitespace-nowrap ${s==="contact"?"bg-cyan-500/15 text-cyan-300 border-cyan-400":"text-white/60 hover:text-white border-transparent hover:bg-white/5"}`,children:[i.jsx(Ty,{size:16}),"Contacto"]})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto p-5 sm:p-7 space-y-6 text-white/90 text-sm leading-relaxed scrollbar-thin",children:[s==="privacy"&&i.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[i.jsxs("div",{className:"border-b border-white/10 pb-3",children:[i.jsx("h3",{className:"text-xl font-bold text-white mb-1",children:"Privacy Policy"}),i.jsx("p",{className:"text-xs text-white/50",children:"Last updated: June 9, 2025"})]}),i.jsxs("p",{className:"text-white/80",children:["This Privacy Policy describes how ",i.jsx("strong",{children:"Chat-Liz"}),' ("we") collects, uses, and protects your data on our website'," ",i.jsxs("a",{href:"https://chatliz-online-chatliz.hf.space/",target:"_blank",rel:"noreferrer",className:"text-cyan-400 underline hover:text-cyan-300 inline-flex items-center gap-1",children:["https://chatliz-online-chatliz.hf.space/ ",i.jsx(Hd,{size:12})]}),"."]}),i.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4 space-y-4",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-cyan-300 mb-1",children:"1. Data We Collect"}),i.jsxs("p",{className:"text-white/80",children:["We collect the following data: ",i.jsx("strong",{children:"Name"}),", ",i.jsx("strong",{children:"Email"}),", ",i.jsx("strong",{children:"IP Address"}),", and ",i.jsx("strong",{children:"Cookies"}),"."]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-cyan-300 mb-1",children:"2. Use of Data"}),i.jsx("p",{className:"text-white/80",children:"Collected data is used to provide services, improve the website, and for analytics purposes."})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-cyan-300 mb-1",children:"3. Data Protection"}),i.jsx("p",{className:"text-white/80",children:"We implement te
4323chnical and organizational measures to protect your data against unauthorized access, loss, or alteration."})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-cyan-300 mb-1",children:"4. Sharing Data with Third Parties"}),i.jsx("p",{className:"text-white/80",children:"We do not share your data with third parties, except as required by law."})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-cyan-300 mb-1",children:"5. Your Rights"}),i.jsxs("p",{className:"text-white/80",children:["You may request access, correction, or deletion of your data by contacting us at:"," ",i.jsx("a",{href:"mailto:[email protected]",className:"text-cyan-400 font-mono underline hover:text-cyan-300",children:"[email protected]"}),"."]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-cyan-300 mb-1",children:"6. Contact Us"}),i.jsxs("p",{className:"text-white/80",children:["If you have any questions, please contact us at:"," ",i.jsx("a",{href:"mailto:[email protected]",className:"text-cyan-400 font-mono underline hover:text-cyan-300",children:"[email protected]"}),"."]})]})]}),i.jsxs("div",{className:"bg-cyan-950/30 border border-cyan-500/20 rounded-xl p-4 text-xs text-white/70",children:[i.jsx("span",{className:"font-bold text-cyan-300",children:"Google AdSense y Cookies:"})," Cumplimos con los requisitos de transparencia de Google AdSense. Podemos utilizar cookies estándar de sesión para recordar tus preferencias y ofrecer análisis de tráfico no invasivo en la plataforma."]})]}),s==="terms"&&i.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[i.jsxs("div",{className:"border-b border-white/10 pb-3",children:[i.jsx("h3",{className:"text-xl font-bold text-white mb-1",children:"Términos y Condiciones (Aviso Legal)"}),i.jsx("p",{className:"text-xs text-white/50",children:"Reglas de uso y responsabilidades en Chat-Liz"})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4",children:[i.jsx("h4",{className:"font-bold text-purple-300 mb-1.5",children:"1. Aceptación del Servicio"}),i.jsx("p",{className:"text-white/80 text-xs sm:text-sm",children:"Al acceder y utilizar Chat-Liz (https://chatliz-online-chatliz.hf.space/), aceptas quedar vinculado por estos Términos y Condiciones. Si no estás de acuerdo con alguna parte, te recomendamos suspender el uso del sitio."})]}),i.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4",children:[i.jsx("h4",{className:"font-bold text-purple-300 mb-1.5",children:"2. Responsabilidad del Usuario"}),i.jsx("p",{className:"text-white/80 text-xs sm:text-sm",children:"Los usuarios son exclusivamente responsables de los mensajes, archivos o interacciones que compartan dentro de la sala global o privada. Queda estrictamente prohibido:"}),i.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1 text-xs sm:text-sm text-white/70",children:[i.jsx("li",{children:"Publicar contenido para adultos (+18), pornografÃa o material explÃcito."}),i.jsx("li",{children:"Promover lenguaje de odio, discriminación, acoso o violencia."}),i.jsx("li",{children:"Realizar spam, fraudes, estafas o compartir enlaces maliciosos."}),i.jsx("li",{children:"Distribuir material protegido por derechos de autor sin autorización."})]})]}),i.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4",children:[i.jsx("h4",{className:"font-bold text-purple-300 mb-1.5",children:'3. Servicio Ofrecido "Tal Cual" (As-Is)'}),i.jsx("p",{className:"text-white/80 text-xs sm:text-sm",children:'Chat-Liz se proporciona "tal cual" y según disponibilidad. Aunque procuramos la máxima estabilidad técnica y velocidad, no garantizamos que el servicio esté libre de interrupciones imprevistas ni nos hacemos responsables por pérdidas de datos temporales.'})]}),i.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4",children:[i.jsx("h4",{className:"font-bold text-purple-300 mb-1.5",children:"4. LÃmites de Responsabilidad y Moderación"}),i.jsx("p",{className:"text-white/80 text-xs sm:text-sm",children:"La administración se reserva el derecho de moderar, silenciar o bloquear el acceso a usuarios que vulneren estas normas comunitarias para proteger la integridad y seguridad de la comunidad."})]})]})]}),s==="about"&&i.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[i.jsxs("div",{className:"border-b border-white/10 pb-3",children:[i.jsx("h3",{className:"text-xl font-bold text-white mb-1",children:"Sobre Chat-Liz"}),i.jsx("p",{className:"text-xs text-white/50",children:"Innovación en mensajerÃa social interactiva con Inteligencia Artificial"})]}),i.jsxs("p",{className:"text-white/80",children:[i.jsx("strong",{children:"Chat-Liz"})," es una comunidad web de chat en tiempo real diseñada para conectar a personas de todo el mund
4323o mediante conversaciones fluidas, seguras y enriquecidas con inteligencias artificiales conversacionales."]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[i.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4",children:[i.jsxs("h4",{className:"font-bold text-cyan-300 mb-1 flex items-center gap-1.5",children:[i.jsx(Th,{size:16})," Chat Global en Tiempo Real"]}),i.jsx("p",{className:"text-xs text-white/70",children:"Conversaciones públicas moderadas con lÃmite dinámico de 20 mensajes gestionados por la administración para mantener la sala ágil y fresca."})]}),i.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4",children:[i.jsxs("h4",{className:"font-bold text-purple-300 mb-1 flex items-center gap-1.5",children:[i.jsx(bo,{size:16})," Inteligencia Artificial Integrada"]}),i.jsx("p",{className:"text-xs text-white/70",children:"Interactúa con personajes de IA como Elizabeth y otros asistentes con respuestas inteligentes, empáticas y dinámicas."})]})]}),i.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4 space-y-2",children:[i.jsx("h4",{className:"font-bold text-emerald-300 text-sm",children:"Normas de Convivencia"}),i.jsx("p",{className:"text-xs text-white/70",children:"En Chat-Liz fomentamos un ambiente constructivo, amigable y respetuoso. Si detectas cualquier comportamiento indebido, puedes informarlo inmediatamente a nuestro equipo de moderación."})]})]}),s==="contact"&&i.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[i.jsxs("div",{className:"border-b border-white/10 pb-3",children:[i.jsx("h3",{className:"text-xl font-bold text-white mb-1",children:"Información de Contacto y Soporte"}),i.jsx("p",{className:"text-xs text-white/50",children:"Estamos a tu disposición para dudas, sugerencias o soporte legal"})]}),i.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-5 space-y-4",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 p-3 bg-black/40 rounded-xl border border-white/10",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-xs text-white/50 block font-medium",children:"Correo Electrónico Oficial:"}),i.jsx("span",{className:"text-cyan-300 font-mono font-bold text-sm sm:text-base",children:"[email protected]"})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsxs("button",{onClick:h,className:"px-3 py-1.5 bg-cyan-500/20 hover:bg-cyan-500/30 text-cyan-300 border border-cyan-500/40 rounded-lg text-xs font-semibold flex items-center gap-1.5 transition-colors",children:[l?i.jsx(Jr,{size:14,className:"text-green-400"}):i.jsx(Ty,{size:14}),l?"¡Copiado!":"Copiar Correo"]}),i.jsx("a",{href:"mailto:[email protected]?subject=Contacto%20Chat-Liz",className:"px-3 py-1.5 bg-gradient-to-r from-purple-600 to-cyan-600 hover:opacity-90 text-white rounded-lg text-xs font-semibold flex items-center gap-1.5 transition-opacity",children:"Redactar Email"})]})]}),i.jsx("p",{className:"text-xs text-white/60",children:"Respondemos habitualmente en un plazo de 24 a 48 horas hábiles. Para solicitudes relativas a la PolÃtica de Privacidad o eliminación de datos de usuario, indica tu nombre de usuario registrado."})]})]})]}),i.jsxs("div",{className:"px-6 py-3.5 border-t border-white/10 bg-black/50 flex flex-col sm:flex-row items-center justify-between gap-2 text-xs text-white/50",children:[i.jsx("span",{children:"Chat-Liz © 2025 ⢠Todos los derechos reservados."}),i.jsx("button",{onClick:e,className:"w-full sm:w-auto px-5 py-2 bg-white/10 hover:bg-white/20 text-white rounded-xl font-bold transition-colors",children:"Entendido / Cerrar"})]})]})})}function eq({handleGoogleLogin:n,user:e,setUser:t,handleLogin:s,setRecoveryModalOpen:o}){const[l,u]=y.useState(!0),[h,f]=y.useState(!1),[p,x]=y.useState(!1),[b,C]=y.useState(!1),N=y.useRef(null),[T,R]=y.useState(!1),[A,U]=y.useState("privacy"),[M,V]=y.useState(""),[H,Q]=y.useState(""),[Y,k]=y.useState("");y.useEffect(()=>{const S=()=>{const be=window.location.hash.toLowerCase();be==="#privacy"||be==="#privacidad"?(U("privacy"),R(!0)):be==="#terms"||be==="#terminos"?(U("terms"),R(!0)):be==="#contact"||be==="#contacto"?(U("contact"),R(!0)):(be==="#about"||be==="#nosotros")&&(U("about"),R(!0))};return S(),window.addEventListener("hashchange",S),()=>window.removeEventListener("hashchange",S)},[]);const E=S=>{U(S),R(!0)},j=S=>{var Ee;const be=(Ee=S.target.files)==null?void 0:Ee[0];if(be){const me=new FileReader;me.onload=De=>{var ge;t({...e,profilePic:(ge=De.target)==null?void 0:ge.result})}
4323,me.readAsDataURL(be)}},P=(S,be,Ee)=>{if(!S||!be||!Ee)return null;const me=new Date(`${Ee}-${be}-${S}`),De=new Date;let ge=De.getFullYear()-me.getFullYear();const Ue=De.getMonth()-me.getMonth();return(Ue<0||Ue===0&&De.getDate()<me.getDate())&&ge--,ge},O=S=>{if(S==null||S.preventDefault(),l){if(!h){alert("Debes aceptar los Términos y Condiciones y la PolÃtica de Privacidad para registrarte.");return}if(!e.username||!e.password||!e.gender||!M||!H||!Y){alert("Por favor, completa todos los campos (Nombre, Contraseña, Género y Fecha de Nacimiento) para registrarte.");return}const me=P(M,H,Y);t(De=>({...De,age:me,birthDate:`${M}/${H}/${Y}`}))}else if(!e.username||!e.password){alert("Por favor, ingresa tu Nombre de Usuario y Contraseña.");return}const be=(e.username||"").trim(),Ee=be.toLowerCase()==="axiss";if(l&&Ee){alert("â ï¸ El nombre 'AXISS' o 'Axiss' está reservado exclusivamente para el Administrador Principal. Por favor elige otro nombre.");return}if(Ee)if(e.password==="@#$_&-+()/")t(me=>({...me,username:be,role:"admin"}));else{alert("â Contraseña de Administrador incorrecta. Los nombres AXISS y Axiss pertenecen al Administrador Principal.");return}s(S,{age:P(M,H,Y),birthdate:`${M}/${H}/${Y}`})},F=[{icon:Th,title:"Salas Globales y Temáticas",desc:"Conéctate en tiempo real con salas públicas y personalizadas, salas por paÃs, intereses y canales privados protegidos.",tag:"Tiempo Real",color:"from-cyan-500/20 to-blue-500/20 text-cyan-400 border-cyan-500/30"},{icon:gl,title:"Elizabeth IA Integrada",desc:"Nuestra inteligencia artificial carismática, impulsada por Gemini, lista para responder consultas, filosofar o amenizar la conversación.",tag:"Gemini AI",color:"from-purple-500/20 to-pink-500/20 text-purple-400 border-purple-500/30"},{icon:w1,title:"Friends Webcam en Vivo",desc:"Comparte tu cámara web en directo con amigos de confianza con baja latencia y controles de privacidad integrados.",tag:"WebRTC P2P",color:"from-emerald-500/20 to-teal-500/20 text-emerald-400 border-emerald-500/30"},{icon:MR,title:"Ajedrez Online y Minijuegos",desc:"DesafÃa a otros miembros a partidas de ajedrez con reloj digital profesional, efectos visuales de tablero y estadÃsticas de victorias.",tag:"Multijugador",color:"from-amber-500/20 to-orange-500/20 text-amber-400 border-amber-500/30"},{icon:Am,title:"Radio Comunitaria y Visualizador",desc:"Disfruta de emisoras de música en streaming con sincronización de ondas y ecualizador reactivo mientras chateas.",tag:"Audio Streaming",color:"from-rose-500/20 to-red-500/20 text-rose-400 border-rose-500/30"},{icon:Sm,title:"LizGram y Perfiles Interactivos",desc:"Muro social para compartir fotos, estados, recibir comentarios y acumular me gustas únicos de otros miembros verificados.",tag:"Social Feed",color:"from-fuchsia-500/20 to-purple-500/20 text-fuchsia-400 border-fuchsia-500/30"}];return i.jsxs("div",{className:"min-h-screen bg-[#0a0d18] text-gray-100 flex flex-col justify-between selection:bg-cyan-500 selection:text-black relative overflow-x-hidden",children:[i.jsxs("div",{className:"fixed inset-0 pointer-events-none overflow-hidden z-0",children:[i.jsx("div",{className:"absolute top-[-10%] left-[-10%] w-[55%] h-[55%] bg-purple-900/15 rounded-full blur-[140px]"}),i.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[55%] h-[55%] bg-cyan-900/15 rounded-full blur-[140px]"}),i.jsx("div",{className:"absolute top-[40%] left-[30%] w-[40%] h-[40%] bg-pink-900/10 rounded-full blur-[160px]"})]}),i.jsxs("header",{className:"relative z-20 border-b border-white/10 bg-[#0a0d18]/85 backdrop-blur-md sticky top-0 px-4 sm:px-8 py-3.5 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-gradient-to-tr from-cyan-500 via-purple-500 to-pink-500 p-[2px] shadow-[0_0_20px_rgba(6,182,212,0.3)]",children:i.jsx("div",{className:"w-full h-full bg-[#0d1020] rounded-[14px] flex items-center justify-center",children:i.jsx(Fs,{size:20,className:"text-cyan-400 animate-pulse"})})}),i.jsxs("div",{children:[i.jsxs("span",{className:"text-lg font-black tracking-tight text-white flex items-center gap-1.5",children:["Chat-Liz",i.jsx("span",{className:"text-[10px] bg-gradient-to-r from-cyan-400 to-purple-400 text-black font-bold px-1.5 py-0.5 rounded-full uppercase",children:"Online"})]}),i.jsx("p",{className:"text-[11px] text-gray-400 font-medium hidden sm:block",children:"Comunidad Global de MensajerÃa Interactiva e IA"})]})]}),i.jsxs("nav",{className:"flex items-center gap-2 sm:gap-4 text-xs font-semibold",children:[i.jsx("a",{href:"#caracteristicas",className:"text-gray-300 hover:text-cyan-400 transition-colors hidden md:inline-block px-2 py-1",children:"CaracterÃsticas"}),i.jsx("a",{href:"#sobre-nosotros",className:"text-gray-300 hover:text-cyan-400 transition-colors hidden md:inline-block px-2 py-1",children:"Sobre Nosotros"}),i.jsx("button",{type:"button",onClick:()=>E("privacy"),className:"text-gray-300 hover:text-cyan-400 transition-colors px-2 py-1",children:"Privacidad"}),i.jsx("button",{type:"button",onClick:()=>E("terms"),className:"text-gray-300 hover:text-cyan-400 transition-colors px-2 py-1",children:"Términos"}),i.jsx("button",{type:"button",onClick:()=>E("contact"),className:"text-gray-300 hover:text-cyan-400 transition-colors px-2 py-1",children:"Contacto"}),i.jsx("a",{href:"#acceso",className:"bg-gradient-to-r from-cyan-500 to-purple-600 hover:from-cyan-400 hover:to-purple-500 text-black font-black px-3.5 py-1.5 rounded-xl shadow-md transition-transform active:scale-95 text-xs",children:l?"Crear Cuenta":"Ingresar"})]})]}),i.jsxs("main",{className:"relative z-10 max-w-7xl mx-auto w-full px-4 sm:px-6 lg:px-8 py-8 sm:py-12 flex-1 flex flex-col justify-center",children:[i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8 lg:gap-12 items-start",children:[i.jsxs("section",{className:"lg:col-span-7 space-y-8",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-cyan-500/10 border border-cyan-500/30 text-cyan-300 text-xs font-semibold",children:[i.jsx(Fs,{size:14,className:"text-cyan-400"}),i.jsx("span",{children:"Plataforma Social de Próxima Generación con Inteligencia Artificial"})]}),i.jsxs("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-black text-white leading-tight tracking-tight",children:["Conecta, comparte y descubre en"," ",i.jsx("span",{className:"bg-gradient-to-r from-cyan-400 via-purple-400 to-pink-400 bg-clip-text text-transparent",children:"Chat-Liz"})]}),i.jsxs("p",{className:"text-sm sm:text-base text-gray-300 leading-relaxed max-w-2xl",children:["Bienvenido a ",i.jsx("strong",{children:"Chat-Liz"}),", un ecosistema de comunicación en vivo creado para conectar personas de todo el mund
4323o. Disfruta de salas de chat globales y privadas, videollamadas con cámara web, mini-juegos de ajedrez multijugador, radio en vivo y la asistencia continua de ",i.jsx("strong",{children:"Elizabeth"}),", una IA conversacional avanzada diseñada para responder preguntas y mantener debates constructivos."]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[i.jsxs("a",{href:"#acceso",onClick:()=>u(!0),className:"px-5 py-2.5 rounded-xl bg-gradient-to-r from-cyan-500 to-purple-600 hover:from-cyan-400 hover:to-purple-500 text-black font-black text-xs uppercase tracking-wider flex items-center gap-2 shadow-lg shadow-cyan-500/20 active:scale-95 transition-all",children:[i.jsx("span",{children:"Aceptar Términos y Registrarse"}),i.jsx(HB,{size:14})]}),i.jsxs("button",{type:"button",onClick:()=>E("terms"),className:"px-4 py-2.5 rounded-xl bg-white/5 hover:bg-white/10 text-gray-300 hover:text-white font-bold text-xs border border-white/10 flex items-center gap-1.5 transition-all",children:[i.jsx(wB,{size:14,className:"text-purple-400"}),i.jsx("span",{children:"Ver Términos y Condiciones"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-3 pt-2",children:[i.jsxs("div",{className:"p-3 rounded-2xl bg-white/[0.03] border border-white/10 text-center",children:[i.jsx("div",{className:"text-cyan-400 font-black text-lg sm:text-xl",children:"100%"}),i.jsx("div",{className:"text-[11px] text-gray-400 font-medium mt-0.5",children:"En Tiempo Real"})]}),i.jsxs("div",{className:"p-3 rounded-2xl bg-white/[0.03] border border-white/10 text-center",children:[i.jsx("div",{className:"text-purple-400 font-black text-lg sm:text-xl",children:"Gemini"}),i.jsx("div",{className:"text-[11px] text-gray-400 font-medium mt-0.5",children:"IA Inteligente"})]}),i.jsxs("div",{className:"p-3 rounded-2xl bg-white/[0.03] border border-white/10 text-center",children:[i.jsx("div",{className:"text-emerald-400 font-black text-lg sm:text-xl",children:"Segura"}),i.jsx("div",{className:"text-[11px] text-gray-400 font-medium mt-0.5",children:"Moderación Activa"})]})]}),i.jsxs("div",{id:"caracteristicas",className:"pt-4 space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h2",{className:"text-lg font-bold text-white flex items-center gap-2",children:[i.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-cyan-400 shadow-[0_0_8px_rgba(6,182,212,0.8)]"}),"CaracterÃsticas Principales de Chat-Liz"]}),i.jsx("span",{className:"text-xs text-cyan-400 font-semibold hidden sm:inline",children:"Innovación & Entretenimiento"})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3.5",children:F.map((S,be)=>{const Ee=S.icon;return i.jsxs("div",{className:"p-4 rounded-2xl bg-white/[0.03] border border-white/10 hover:border-cyan-500/40 transition-all hover:bg-white/[0.05] group",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2.5",children:[i.jsx("div",{className:`w-8 h-8 rounded-xl bg-gradient-to-br ${S.color} flex items-center justify-center border`,children:i.jsx(Ee,{size:17})}),i.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-white/5 text-gray-300 border border-white/10",children:S.tag})]}),i.jsx("h3",{className:"text-xs font-bold text-white mb-1 group-hover:text-cyan-300 transition-colors",children:S.title}),i.jsx("p",{className:"text-[11px] text-gray-400 leading-relaxed",children:S.desc})]},be)})})]}),i.jsxs("div",{id:"sobre-nosotros",className:"p-5 rounded-3xl bg-white/[0.02] border border-white/10 space-y-3",children:[i.jsxs("h3",{className:"text-sm font-bold text-white flex items-center gap-2",children:[i.jsx(NR,{size:16,className:"text-cyan-400"}),"Compromiso con la Calidad, Seguridad y Libre Expresión"]}),i.jsx("p",{className:"text-xs text-gray-300 leading-relaxed",children:"Chat-Liz fue creado con el objetivo de ofrecer un espacio de encuentro accesible desde cualquier dispositivo, sin barreras complejas. Promovemos el respeto mutuo, la privacidad del usuario y una experiencia enriquecida con tecnologÃa moderna. Nuestra plataforma implementa estándares de moderación de contenido, filtros anti-acoso y protección de datos conforme a las mejores prácticas digitales."}),i.jsx("div",{className:"flex flex-wrap gap-2 pt-1 text-[11px]",children:i.jsxs("button",{type:"button",onClick:()=>E("about"),className:"inline-flex items-center gap-1.5 text-cyan-400 hover:text-cyan-300 font-semibold transition-colors",children:[i.jsx("span",{children:"Conocer más sobre nosotros"}),i.jsx(HB,{size:13})]})})]})]}),i.jsx("section",{id:"acceso",className:"lg:col-span-5 w-full",children:i.jsxs("div",{className:"w-full p-6 sm:p-8 rounded-3xl bg-[#0f1424]/90 backdrop-blur-2xl border border-white/10 shadow-[0_20px_50px_rgba(0,0,0,0.6)] relative",children:[i.jsxs("div",{className:"text-center mb-6",children:[i.jsxs("div",{className:"inline-flex p-1 bg-black/40 rounded-xl border border-white/10 mb-4",children:[i.jsx("button",{type:"button",onClick:()=>u(!0),className:`px-4 py-1.5 rounded-lg text-xs font-bold transition-all ${l?"bg-gradient-to-r from-cyan-500 to-purple-600 text-black shadow-md":"text-gray-400 hover:text-white"}`,children:"Registrarse"}),i.jsx("button",{type:"button",onClick:()=>u(!1),className:`px-4 py-1.5 rounded-lg text-xs font-bold transition-all ${l?"text-gray-400 hover:text-white":"bg-gradient-to-r from-cyan-500 to-purple-600 text-black shadow-md"}`,children:"Iniciar Sesión"})]}),i.jsx("h2",{className:"text-xl font-black text-white tracking-tight",children:l?h?"Crear tu Cuenta Gratuita":"Aceptación de Términos y Condiciones":"Bienvenido de Nuevo"}),i.jsx("p",{className:"text-xs text-gray-400 mt-1",children:l?h?"Ãnete a miles de personas en Chat-Liz en segundos":"Por favor acepta nuestros términos y condiciones para pasar a la zona de registro":"Ingresa tus credenciales para acceder a tus chats"})]}),l&&!h?i.jsxs("div",{className:"space-y-4 text-left animate-in fade-in duration-300",children:[i.jsxs("div",{className:"p-4 rounded-2xl bg-cyan-500/10 border border-cyan-500/30 space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2 text-cyan-300 font-bold text-sm",children:[i.jsx(bo,{size:18,className:"text-cyan-400 shrink-0"}),i.jsx("span",{children:"Condiciones de Uso y Privacidad"})]}),i.jsxs("p",{className:"text-xs text-gray-300 leading-relaxed",children:["Bienvenido a ",i.jsx("strong",{children:"Chat-Liz"}),". Para garantizar un ambiente seguro y una comunidad respetuosa, debes aceptar nuestras reglas antes de registrarte:"]}),i.jsxs("ul",{className:"text-[11px] text-gray-300 space-y-2",children:[i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx(di,{size:13,className:"text-cyan-400 shrink-0 mt-0.5"}),i.jsxs("span",{children:[i.jsx("strong",{children:"Comunidad Respetuosa:"})," Tolerancia cero al acoso, spam, suplantación o contenido ilÃcito."]})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx(di,{size:13,className:"text-cyan-400 shrink-0 mt-0.5"}),i.jsxs("span",{children:[i.jsx("strong",{children:"Friends Webcam:"})," Disponible para todos los usuarios. Requiere uso adecuado y voluntario de cámara y micrófono."]})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx(di,{size:13,className:"text-cyan-400 shrink-0 mt-0.5"}),i.jsxs("span",{children:[i.jsx("strong",{children:"Protección de Datos:"})," Cumplimiento con Google AdSense, transparencia de cookies y almacenamiento seguro."]})]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1 border-t border-cyan-500/20",children:[i.jsxs("button",{type:"button",onClick:()=>E("terms"),className:"text-[11px] text-cyan-400 hover:text-cyan-300 font-bold underline flex items-center gap-1",children:[i.jsx(wB,{size:12}),i.jsx("span",{children:"Ver Términos Completos"})]}),i.jsx("span",{className:"text-gray-600",children:"â¢"}),i.jsxs("button",{type:"button",onClick:()=>E("privacy"),className:"text-[11px] text-purple-400 hover:text-purple-300 font-bold underline flex items-center gap-1",children:[i.jsx(bo,{size:12}),i.jsx("span",{children:"Ver PolÃtica de Privacidad"})]})]})]}),i.jsxs("label",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-black/40 border border-white/10 hover:border-cyan-500/30 cursor-pointer transition-colors",children:[i.jsx("input",{type:"checkbox",checked:p,onChange:S=>x(S.target.checked),className:"mt-0.5 w-4 h-4 rounded bg-black/50 border-white/30 text-cyan-500 focus:ring-0 cursor-pointer shrink-0"}),i.jsxs("span",{className:"text-xs text-gray-300 select-none leading-relaxed",children:["He leÃdo, comprendo y ",i.jsx("strong",{children:"acepto los Términos y Condiciones"})," y la ",i.jsx("strong",{children:"PolÃtica de Privacidad"})," de Chat-Liz."]})]}),i.jsxs("button",{type:"button",onClick:()=>{x(!0),f(!0)},className:"w-full bg-gradient-to-r from-cyan-500 via-purple-600 to-pink-500 hover:opacity-95 text-black font-black tracking-wide rounded-xl py-3.5 shadow-lg shadow-cyan-500/25 transition-all text-xs uppercase flex items-center justify-center gap-2 active:scale-95",children:[i.jsx(di,{size:16}),i.jsx("span",{children:"Aceptar Términos y Pasar al Registro"}),i.jsx(Cu,{size:16})]}),i.jsx("div",{className:"text-center pt-2",children:i.jsx("button",{type:"button",onClick:()=>u(!1),className:"text-xs text-gray-400 hover:text-cyan-300 transition-colors",children:"¿Ya tienes una cuenta registrada? Inicia sesión aquÃ"})})]}):i.jsxs(i.Fragment,{children:[l&&h&&i.jsxs("div",{className:"mb-4 p-2.5 rounded-xl bg-emerald-500/10 border border-emerald-500/30 flex items-center justify-between text-xs text-emerald-300",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(di,{size:14,className:"text-emerald-400 shrink-0"}),i.jsx("span",{children:"Términos y Condiciones Aceptados"})]}),i.jsx("button",{type:"button",onClick:()=>f(!1),className:"text-[10px] text-gray-400 hover:text-white underline ml-2",children:"Revisar"})]}),n&&i.jsxs("div",{className:"mb-5",children:[i.jsxs("button",{type:"button",onClick:n,className:"w-full py-2.5 px-4 roun
4323ded-xl bg-white hover:bg-gray-100 text-gray-900 font-bold text-xs flex items-center justify-center gap-2.5 transition-all shadow-md active:scale-95",children:[i.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",children:[i.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),i.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),i.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.06H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.94l2.85-2.22.81-.63z"}),i.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.06l3.66 2.84c.87-2.6 3.3-4.52 6.16-4.52z"})]}),i.jsx("span",{children:"Continuar con Google"})]}),i.jsxs("div",{className:"flex items-center my-4",children:[i.jsx("div",{className:"flex-1 border-t border-white/10"}),i.jsx("span",{className:"px-3 text-[11px] text-gray-400 font-medium",children:"o con tu apodo"}),i.jsx("div",{className:"flex-1 border-t border-white/10"})]})]}),i.jsxs("form",{onSubmit:O,className:"flex flex-col items-center",children:[i.jsxs("div",{className:"w-20 h-20 mb-5 rounded-full bg-white/5 border border-white/10 flex items-center justify-center overflow-hidden relative cursor-pointer group shadow-inner",onClick:()=>{var S;return l&&((S=N.current)==null?void 0:S.click())},title:l?"Sube tu foto de perfil":"Avatar",children:[e.profilePic?i.jsx("img",{src:e.profilePic,alt:"Avatar",className:"w-full h-full object-cover"}):i.jsx("svg",{className:"w-12 h-12 text-white/30 mt-3",viewBox:"0 0 24 24",fill:"currentColor",children:i.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})}),l&&i.jsx("div",{className:"absolute inset-0 bg-black/60 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:i.jsx(Mu,{size:18,className:"text-white"})}),l&&i.jsx("input",{type:"file",ref:N,className:"hidden",accept:"image/*",onChange:j})]}),i.jsxs("div",{className:"w-full space-y-4",children:[i.jsxs("div",{className:"relative bg-black/30 border border-white/10 rounded-xl px-3 py-2 flex items-center focus-within:border-cyan-400 transition-colors",children:[i.jsx(Pu,{size:16,className:"text-cyan-400 mr-2.5 shrink-0"}),i.jsx("input",{className:"w-full bg-transparent border-none p-0 text-white placeholder-gray-400 focus:outline-none focus:ring-0 text-sm",placeholder:"Nombre de Usuario (Apodo)",value:e.username||"",onChange:S=>t({...e,username:S.target.value})})]}),i.jsxs("div",{className:"relative bg-black/30 border border-white/10 rounded-xl px-3 py-2 flex items-center focus-within:border-cyan-400 transition-colors",children:[i.jsx(jD,{size:16,className:"text-cyan-400 mr-2.5 shrink-0"}),i.jsx("input",{className:"w-full bg-transparent border-none p-0 text-white placeholder-gray-400 focus:outline-none focus:ring-0 text-sm",type:b?"text":"password",placeholder:"Contraseña",value:e.password||"",onChange:S=>t({...e,password:S.target.value})}),i.jsx("button",{type:"button",onClick:()=>C(!b),className:"text-gray-400 hover:text-white text-xs ml-2",children:b?"Ocultar":"Ver"})]}),l&&i.jsxs("div",{className:"space-y-4 animate-in fade-in duration-200",children:[i.jsxs("div",{className:"relative bg-black/30 border border-white/10 rounded-xl px-3 py-2 flex items-center focus-within:border-cyan-400 transition-colors",children:[i.jsx(Na,{size:16,className:"text-cyan-400 mr-2.5 shrink-0"}),i.jsxs("select",{className:"w-full bg-transparent border-none p-0 text-white focus:outline-none focus:ring-0 text-sm",value:e.gender||"",onChange:S=>t({...e,gender:S.target.value}),children:[i.jsx("option",{value:"",className:"bg-[#131728] text-gray-400",children:"Seleccionar Género"}),i.jsx("option",{value:"Male",className:"bg-[#131728] text-white",children:"Hombre (Male)"}),i.jsx("option",{value:"Female",className:"bg-[#131728] text-white",children:"Mujer (Female)"}),i.jsx("option",{value:"Other",className:"bg-[#131728] text-white",children:"Otro / Prefiero no decir"})]})]}),i.jsxs("div",{className:"relative bg-black/30 border border-white/10 rounded-xl px-3 py-2 flex items-center focus-within:border-cyan-400 transition-colors",children:[i.jsx(v1,{size:16,className:"text-cyan-400 mr-2.5 shrink-0"}),i.jsxs("div",{className:"flex w-full items-center gap-1.5 text-sm",children:[i.jsx("input",{className:"w-1/3 bg-transparent border-none p-0 text-white placeholder-gray-400 focus:outline-none text-center",placeholder:"DÃa",maxLength:2,value:M,onChange:S=>V(S.target.value.replace(/[^0-9]/g,""))}),i.jsx("span",{className:"text-gray-500",children:"/"}),i.jsx("input",{className:"w-1/3 bg-transparent border-none p-0 text-white placeholder-gray-400 focus:outline-none text-center",placeholder:"Mes",maxLength:2,value:H,onChange:S=>Q(S.target.value.replace(/[^0-9]/g,""))}),i.jsx("span",{className:"text-gray-500",children:"/"}),i.jsx("input",{className:"w-1/3 bg-transparent border-none p-0 text-white placeholder-gray-400 focus:outline-none text-center",placeholder:"Año",maxLength:4,value:Y,onChange:S=>k(S.target.value.replace(/[^0-9]/g,""))})]})]})]}),i.jsxs("div",{className:"flex justify-between items-center text-xs text-gray-400 pt-1",children:[i.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer hover:text-gray-200",children:[i.jsx("input",{type:"checkbox",defaultChecked:!0,className:"w-3.5 h-3.5 rounded bg-black/40 border-white/20 text-cyan-500 focus:ring-0"}),i.jsx("span",{children:"Recordarme"})]}),!l&&i.jsx("button",{type:"button",onClick:()=>o(!0),className:"hover:text-cyan-400 transition-colors",children:"¿Olvidaste tu contraseña?"})]}),i.jsxs("button",{type:"submit",className:"w-full bg-gradient-to-r from-cyan-500 via-purple-600 to-pink-500 hover:opacity-95 text-black font-black tracking-wide rounded-xl py-3 shadow-lg shadow-cyan-500/20 transition-all text-xs uppercase flex items-center justify-center gap-2",children:[i.jsx("span",{children:l?"CREAR CUENTA GRATIS":"ENTRAR AL CHAT"}),i.jsx(Cu,{size:16})]})]})]}),i.jsx("div",{className:"mt-5 text-center",children:i.jsx("button",{type:"button",onClick:()=>u(!l),className:"text-xs text-gray-400 hover:text-cyan-300 transition-colors",children:l?"¿Ya tienes una cuenta registrada? Inicia sesión aquÃ":"¿Nuevo en Chat-Liz? Crea tu cuenta en 10 segundos"})}),i.jsxs("p",{className:"text-[10px] text-gray-500 text-center mt-4 leading-relaxed",children:["Al ingresar o registrarte en Chat-Liz, aceptas nuestros"," ",i.jsx("button",{type:"button",onClick:()=>E("terms"),className:"text-cyan-400 hover:underline",children:"Términos"})," ","y confirmas haber leÃdo nuestra"," ",i.jsx("button",{type:"button",onClick:()=>E("privacy"),className:"text-cyan-400 hover:underline",children:"PolÃtica de Privacidad"}),"."]})]})]})})]}),i.jsxs("section",{className:"mt-16 pt-10 border-t border-white/10 space-y-6",children:[i.jsxs("div",{className:"max-w-3xl",children:[i.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[i.jsx(bo,{className:"text-cyan-400",size:20}),"Centro de Transparencia, PolÃticas y Contacto Oficial"]}),i.jsx("p",{className:"text-xs text-gray-400 mt-1 leading-relaxed",children:"En Chat-Liz cumplimos con las directrices de Google AdSense y n
4323ormativas de privacidad vigentes. Ponemos a tu disposición toda la documentación legal de forma pública y accesible antes de iniciar sesión."})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[i.jsxs("div",{className:"p-4 rounded-2xl bg-white/[0.02] border border-white/10 hover:border-cyan-500/30 transition-all",children:[i.jsxs("div",{className:"flex items-center gap-2 text-cyan-400 text-xs font-bold mb-2",children:[i.jsx(bo,{size:16}),i.jsx("span",{children:"PolÃtica de Privacidad"})]}),i.jsx("p",{className:"text-[11px] text-gray-400 leading-relaxed mb-3",children:"Información transparente sobre el uso de cookies, identificadores de Google AdSense, almacenamiento local y salvaguarda de datos personales sin cesión a terceros no autorizados."}),i.jsxs("button",{type:"button",onClick:()=>E("privacy"),className:"text-xs text-cyan-400 hover:text-cyan-300 font-semibold inline-flex items-center gap-1",children:[i.jsx("span",{children:"Leer PolÃtica Completa"}),i.jsx(Cu,{size:13})]})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-white/[0.02] border border-white/10 hover:border-purple-500/30 transition-all",children:[i.jsxs("div",{className:"flex items-center gap-2 text-purple-400 text-xs font-bold mb-2",children:[i.jsx(wB,{size:16}),i.jsx("span",{children:"Términos de Servicio"})]}),i.jsx("p",{className:"text-[11px] text-gray-400 leading-relaxed mb-3",children:"Reglas comunitarias de convivencia, prohibición explÃcita de spam, acoso y contenido ilÃcito, garantizando un entorno amigable y respetuoso para todos los participantes."}),i.jsxs("button",{type:"button",onClick:()=>E("terms"),className:"text-xs text-purple-400 hover:text-purple-300 font-semibold inline-flex items-center gap-1",children:[i.jsx("span",{children:"Ver Términos y Condiciones"}),i.jsx(Cu,{size:13})]})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-white/[0.02] border border-white/10 hover:border-pink-500/30 transition-all",children:[i.jsxs("div",{className:"flex items-center gap-2 text-pink-400 text-xs font-bold mb-2",children:[i.jsx(Ty,{size:16}),i.jsx("span",{children:"Atención y Soporte"})]}),i.jsxs("p",{className:"text-[11px] text-gray-400 leading-relaxed mb-3",children:["Canal directo de contacto con el equipo de administración de Chat-Liz: ",i.jsx("strong",{children:"[email protected]"})," para reportes, consultas de derechos ARCO o asistencia técnica."]}),i.jsxs("button",{type:"button",onClick:()=>E("contact"),className:"text-xs text-pink-400 hover:text-pink-300 font-semibold inline-flex items-center gap-1",children:[i.jsx("span",{children:"Información de Contacto"}),i.jsx(Cu,{size:13})]})]})]})]})]}),i.jsx("footer",{className:"relative z-20 border-t border-white/10 bg-[#080a13] px-4 sm:px-8 py-6 text-xs text-gray-400 mt-12",children:i.jsxs("div",{className:"max-w-7xl mx-auto flex flex-col md:flex-row items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsxs("p",{className:"font-bold text-gray-200",children:["Chat-Liz © ",new Date().getFullYear()," â Todos los derechos reservados."]}),i.jsx("p",{className:"text-[11px] text-gray-500 mt-0.5",children:"Plataforma de comunicación social en tiempo real y asistencia con Inteligencia Artificial."})]}),i.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4 text-xs",children:[i.jsx("button",{type:"button",onClick:()=>E("privacy"),className:"hover:text-cyan-400 transition-colors",children:"PolÃtica de Privacidad"}),i.jsx("span",{className:"text-gray-700",children:"â¢"}),i.jsx("button",{type:"button",onClick:()=>E("terms"),className:"hover:text-cyan-400 transition-colors",children:"Términos de Servicio"}),i.jsx("span",{className:"text-gray-700",children:"â¢"}),i.jsx("button",{type:"button",onClick:()=>E("contact"),className:"hover:text-cyan-400 transition-colors",children:"Contacto Oficial"}),i.jsx("span",{className:"text-gray-700",children:"â¢"}),i.jsx("button",{type:"button",onClick:()=>E("about"),className:"hover:text-cyan-400 transition-colors",children:"Sobre Chat-Liz"})]})]})}),i.jsx(HA,{isOpen:T,onClose:()=>R(!1),initialTab:A})]})}const lD=[{id:"cyberpunk_city",name:"Cyberpunk Neón 2077",tag:"GIF Animado",preview:"https://images.unsplash.com/photo-1508739773434-c26b3d09e071?w=400&auto=format&fit=crop&q=80",url:"https://images.unsplash.com/photo-1508739773434-c26b3d09e071?w=1920&auto=format&fit=crop&q=85"},{id:"mecha_celestial",name:"Mecha Celestial ChatLiz",tag:"HD Exclusivo",preview:"/mecha_celestial_bg.jpg",url:"/mecha_celestial_bg.jpg"},{id:"anime_rain",name:"Lluvia Calma & Luces",tag:"Aesthetic Loop",preview:"https://images.unsplash.com/photo-1519681393784-d120267933ba?w=400&auto=format&fit=crop&q=80",url:"https://images.unsplash.com/photo-1519681393784-d120267933ba?w=1920&auto=format&fit=crop&q=85"},{id:"galaxy_cosmic",name:"Galaxia Profunda",tag:"Espacio Cósmico",preview:"https://images.unsplash.com/photo-1506703719100-a0f3a48c0f86?w=400&auto=format&fit=crop&q=80",url:"https://images.unsplash.com/photo-1506703719100-a0f3a48c0f86?w=1920&auto=format&fit=crop&q=85"},{id:"synthwave_retro",name:"Synthwave 80s Sunset",tag:"Retro 80s",preview:"https://images.unsplash.com/photo-1509198397868-475647b2a1e5?w=400&auto=format&fit=crop&q=80",url:"https://images.unsplash.com/photo-1509198397868-475647b2a1e5?w=1920&auto=format&fit=crop&q=85"},{id:"neon_night",name:"Tokio Nocturno Neón",tag:"Cyberpunk",preview:"https://images.unsplash.com/photo-1542051841857-5f90071e7989?w=400&auto=format&fit=crop&q=80",url:"https://images.unsplash.com/photo-1542051841857-5f90071e7989?w=1920&auto=format&fit=crop&q=85"}];function tq({isOpen:n,onClose:e,currentBg:t,isAdmin:s,defaultMode:o="global",activeRoomId:l,onApplyPersonalBg:u,onApplyRoomBg:h,onToast:f}){const[p,x]=y.useState(o==="room"&&l?"room":s?o:"personal"),[b,C]=y.useState(""),[N,T]=y.useState(t||""),[R,A]=y.useState(t||""),[U,M]=y.useState(()=>localStorage.getItem("chatliz_bg_muted")==="false"),[V,H]=y.useState(!1),[Q,Y]=y.useState(!1),[k,E]=y.useState(!1);if(y.useEffect(()=>{o==="room"&&l&&x("room")},[o,l]),y.useEffect(()=>{n&&SF(lD.map(S=>S.url))},[n]),!n)return null;const j=S=>{var ge;const be=(ge=S.target.files)==null?void 0:ge[0];if(!be)return;H(!0);const Ee=be.type==="image/gif"||be.name.toLowerCase().endsWith(".gif"),me=be.type.startsWith("video/")||be.name.toLowerCase().match(/\.(mp4|webm|mov)$/i),De=new FileReader;De.onload=Ue=>{var $e;const we=($e=Ue.target)==null?void 0:$e.result;if(!we){H(!1);return}if(_o(we).catch(()=>{}),Ee||me){T(we),A(we),C(""),H(!1),f&&f(`⨠Archivo ${Ee?"GIF animado":"Video"} cargado y optimizado`);return}T(we),A(we),C(""),H(!1),f&&f("⨠Imagen lista y precargada")},De.onerror=()=>{H(!1),f&&f("â ï¸ Error al leer el archivo seleccionado")}
4323,De.readAsDataURL(be)},P=async()=>{const S=b.trim()||N;Y(!0),localStorage.setItem("chatliz_bg_muted",U?"false":"true"),S&&await _o(S).catch(()=>{}),p==="global"&&s?(W.emit("set_global_bg",S,be=>{be&&be.error&&console.warn("Global background sync warning:",be.error)}),f&&f("ð ¡Fondo global aplicado a toda la sala!")):p==="room"&&l?(W.emit("update_custom_room",{roomId:l,config:{backgroundUrl:S}},be=>{be&&be.error&&console.warn("Room background sync warning:",be.error)}),h&&h(S),f&&f("ðï¸ Â¡Fondo de sala aplicado para todos los miembros!")):(u(S),localStorage.setItem("chatliz_personal_bg",S),f&&f("𨠡Tu fondo personal ha sido actualizado!")),Y(!1),e()},O=()=>{T(""),A(""),C(""),p==="global"&&s?(W.emit("set_global_bg",""),f&&f("ð Fondo global restablecido al predeterminado")):p==="room"&&l?(W.emit("update_custom_room",{roomId:l,config:{backgroundUrl:""}}),h&&h(""),f&&f("ð Fondo de sala restablecido")):(u(""),localStorage.removeItem("chatliz_personal_bg"),f&&f("ð Fondo personal restablecido")),e()},F=R.match(/\.(mp4|webm|mov|ogg)(\?.*)?$/i)||R.startsWith("data:video/");return i.jsx("div",{className:"fixed inset-0 z-[120] bg-black/85 backdrop-blur-md flex items-center justify-center p-3 sm:p-5 animate-in fade-in",onClick:e,children:i.jsxs("div",{className:"bg-[#101420] border border-cyan-500/30 rounded-3xl max-w-2xl w-full max-h-[90vh] shadow-[0_20px_50px_rgba(0,0,0,0.9)] flex flex-col overflow-hidden relative",onClick:S=>S.stopPropagation(),children:[i.jsxs("div",{className:"p-4 sm:p-5 border-b border-white/10 flex items-center justify-between bg-gradient-to-r from-[#172033] to-[#0f1422]",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-cyan-500/15 border border-cyan-500/40 flex items-center justify-center text-cyan-400 shadow-[0_0_15px_rgba(6,182,212,0.3)]",children:i.jsx(Lu,{size:20})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"text-lg font-black text-white tracking-tight flex items-center gap-2",children:["Fondo de Pantalla",i.jsx("span",{className:"bg-cyan-500/20 text-cyan-300 text-[10px] font-bold px-2 py-0.5 rounded-full border border-cyan-500/40 uppercase",children:"Video ⢠GIF ⢠Imagen"})]}),i.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:"Se adapta automáticamente a todos los bordes de tu pantalla sin distorsión"})]})]}),i.jsx("button",{onClick:e,className:"w-9 h-9 rounded-xl bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white flex items-center justify-center transition-colors",children:i.jsx(Kt,{size:18})})]}),i.jsxs("div",{className:"p-4 sm:p-5 overflow-y-auto space-y-5 scrollbar-thin",children:[(s||l)&&i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("label",{className:"text-xs font-bold uppercase tracking-wider text-gray-400",children:"¿Dónde deseas aplicar este fondo?"}),i.jsxs("div",{className:`grid ${s&&l?"grid-cols-3":"grid-cols-2"} gap-2 p-1 bg-black/40 rounded-2xl border border-white/10`,children:[s&&i.jsxs("button",{type:"button",onClick:()=>x("global"),className:`py-2 px-2.5 rounded-xl text-xs font-bold flex items-center justify-center gap-1.5 transition-all ${p==="global"?"bg-gradient-to-r from-blue-600 to-cyan-600 text-white shadow-md":"text-gray-400 hover:text-white"}`,children:[i.jsx(vu,{size:13}),i.jsx("span",{children:"Global"})]}),l&&i.jsxs("button",{type:"button",onClick:()=>x("room"),className:`py-2 px-2.5 rounded-xl text-xs font-bold flex items-center justify-center gap-1.5 transition-all ${p==="room"?"bg-gradient-to-r from-amber-600 to-orange-600 text-white shadow-md":"text-gray-400 hover:text-white"}`,children:[i.jsx(Fs,{size:13}),i.jsx("span",{children:"Esta Sala"})]}),i.jsxs("button",{type:"button",onClick:()=>x("personal"),className:`py-2 px-2.5 rounded-xl text-xs font-bold flex items-center justify-center gap-1.5 transition-all ${p==="personal"?"bg-gradient-to-r from-purple-600 to-pink-600 text-white shadow-md":"text-gray-400 hover:text-white"}`,children:[i.jsx(Pu,{size:13}),i.jsx("span",{children:"Personal"})]})]})]}),i.jsxs("div",{className:"relative rounded-2xl overflow-hidden border border-white/15 h-36 sm:h-44 bg-black/60 flex items-center justify-center shadow-inner group",children:[R?F?i.jsx("video",{src:R,autoPlay:!0,loop:!0,muted:!0,playsInl
4323ine:!0,preload:"auto",className:`w-full h-full object-cover transition-opacity duration-300 ${k?"opacity-20":"opacity-100"}`,onLoadedData:()=>E(!1),onCanPlay:()=>E(!1),onError:()=>E(!1)},R):i.jsx("img",{src:R,alt:"Vista Previa",referrerPolicy:"no-referrer",loading:"lazy",decoding:"async",className:`w-full h-full object-cover transition-opacity duration-300 ${k?"opacity-20":"opacity-100"}`,onLoad:()=>E(!1),onError:()=>E(!1)},R):i.jsxs("div",{className:"text-center text-gray-500 flex flex-col items-center gap-2 p-4",children:[i.jsx(Fs,{size:24,className:"opacity-40"}),i.jsx("span",{className:"text-xs font-medium",children:"Sin fondo seleccionado (Predeterminado de sala)"})]}),(k||V)&&R&&i.jsxs("div",{className:"absolute inset-0 z-20 flex flex-col items-center justify-center bg-black/75 backdrop-blur-sm animate-in fade-in duration-150",children:[i.jsxs("div",{className:"relative flex items-center gap-2 px-3.5 py-1.5 rounded-xl bg-black/85 border border-cyan-500/40 text-cyan-300 text-xs font-semibold shadow-lg",children:[i.jsx(ah,{size:15,className:"animate-spin text-cyan-400"}),i.jsx("span",{children:"Cargando vista previa..."})]}),i.jsx("div",{className:"w-24 h-1 bg-white/10 rounded-full mt-2 overflow-hidden",children:i.jsx("div",{className:"h-full bg-gradient-to-r from-cyan-400 to-blue-500 rounded-full animate-pulse w-3/4"})})]}),i.jsx("div",{className:"absolute top-2 right-2 px-2.5 py-1 rounded-full bg-black/70 backdrop-blur-md border border-white/20 text-[11px] font-bold text-white flex items-center gap-1.5 z-10",children:i.jsx("span",{children:"Vista previa ajustada a bordes"})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("label",{className:"text-xs font-bold uppercase tracking-wider text-gray-300 flex items-center gap-1.5",children:[i.jsx(Mu,{size:14,className:"text-cyan-400"}),"Opción 1: Subir Archivo Local (GIF animado, Video o Imagen)"]}),i.jsx("span",{className:"text-[11px] text-cyan-400 font-medium",children:"Bucle infinito automático"})]}),i.jsxs("label",{className:"relative border-2 border-dashed border-cyan-500/30 hover:border-cyan-400/60 bg-cyan-950/20 hover:bg-cyan-950/30 rounded-2xl p-4 flex flex-col items-center justify-center gap-2 cursor-pointer transition-all text-center",children:[i.jsx("input",{type:"file",accept:"image/*,video/*,.gif,.mp4,.webm,.mov",onChange:j,className:"hidden",disabled:V}),i.jsx("div",{className:"w-10 h-10 rounded-xl bg-cyan-500/20 flex items-center justify-center text-cyan-300",children:i.jsx(Mu,{size:20})}),i.jsxs("div",{children:[i.jsx("span",{className:"text-sm font-bold text-white",children:V?"Cargando archivo...":"Haz clic para seleccionar GIF, Video MP4 o Imagen"}),i.jsx("p",{className:"text-[11px] text-gray-400 mt-0.5",children:"Los GIFs conservan 100% de sus fotogramas y los videos se reproducen sin parar"})]})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("label",{className:"text-xs font-bold uppercase tracking-wider text-gray-300 flex items-center gap-1.5",children:[i.jsx(w1,{size:14,className:"text-[#38bdf8]"}),"Opción 2: Pegar Enlace / URL (YouTube, Pinterest, MP4 directo o GIF)"]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"url",value:b,onChange:S=>{C(S.target.value),S.target.value&&(A(S.target.value),T(S.target.value))},placeholder:"https://... (YouTube, Pinterest, .mp4, .gif, imagen)",className:"flex-1 bg-black/40 border border-white/15 focus:border-cyan-400 rounded-xl px-3.5 py-2.5 text-sm text-white placeholder-gray-500 outline-none transition-colors"}),b&&i.jsx("button",{type:"button",onClick:()=>{C(""),A(""),T("")},className:"px-3 bg-white/5 hover:bg-white/10 text-gray-400 rounded-xl text-xs",children:"Limpiar"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("label",{className:"text-xs font-bold uppercase tracking-wider text-gray-300 flex items-center gap-1.5",children:[i.jsx(Fs,{size:14,className:"text-amber-400"}),"Opción 3: GalerÃa Rápida de Fondos HD"]}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2.5",children:lD.map(S=>{const be=N===S.url;return i.jsxs("div",{onClick:()=>{T(S.url),A(S.url),E(!0),C("")},className:`relative rounded-xl overflow-hidden cursor-pointer border-2 transition-all group ${be?"border-cyan-400 shadow-[0_0_15px_rgba(6,182,212,0.5)] scale-[1.02]":"border-white/10 hover:border-white/30"}`,children:[i.jsx("div",{className:"h-20 w-full overflow-hidden bg-black/40 relative",children:i.jsx("img",{src:S.preview,alt:S.name,referrerPolicy:"no-referrer",loading:"lazy",decoding:"async",className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"})}),i.jsxs("div",{className:"p-1.5 bg-black/80 flex items-center justify-between",children:[i.jsx("span",{className:"text-[11px] font-bold text-white truncate",children:S.name}),be&&i.jsx(Jr,{size:14,className:"text-cyan-400 shrink-0"})]})]},S.id)})})]}),i.jsxs("div",{className:"bg-black/30 border border-white/10 rounded-2xl p-3 flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-8 h-8 rounded-lg bg-cyan-500/20 text-cyan-400 flex items-center justify-center",children:U?i.jsx(xl,{size:16}):i.jsx(jg,{size:16})}),i.jsxs("div",{children:[i.jsx("span",{className:"text-xs font-bold text-white block",children:"Sonido de Videos de Fondo"}),i.jsx("span",{className:"text-[11px] text-gray-400",children:"Si el video tiene audio o música, reproducirlo"})]})]}),i.jsx("button",{type:"button",onClick:()=>M(!U),className:`px-3 py-1.5 rounded-xl text-xs font-bold border transition-colors ${U?"bg-cyan-500/20 text-cyan-300 border-cyan-500/40":"bg-white/5 text-gray-400 border-white/10"}`,children:U?"Sonido Activado":"Silenciado"})]})]}),i.jsxs("div",{className:"p-4 border-t border-white/10 bg-[#0e121d] flex items-center justify-between gap-3",children:[i.jsxs("button",{type:"button",onClick:O,className:"px-4 py-2 bg-red-500/10 hover:bg-red-500/20 text-red-400 rounded-xl text-xs font-bold transition-colors flex items-center gap-1.5 border border-red-500/30",children:[i.jsx(Sh,{size:14}),"Restablecer Fondo"]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 bg-white/5 hover:bg-white/10 text-gray-300 rounded-xl text-xs font-bold transition-colors",children:"Cancelar"}),i.jsx("button",{type:"button",onClick:P,disabled:Q,className:"px-5 py-2 bg-gradient-to-r from-cyan-500 to-blue-600 hover:from-cyan-400 hover:to-blue-500 disabled:opacity-50 text-white rounded-xl text-xs font-bold shadow-lg shadow-cyan-500/25 transition-all flex items-center gap-1.5 cursor-pointer",children:Q?i.jsxs(i.Fragment,{children:[i.jsx(ah,{size:16,className:"animate-spin"}),i.jsx("span",{children:"Optimizando..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(Jr,{size:16}),i.jsx("span",{children:"Aplicar Ahora"})]})})]})]})]})})}const nq=["âï¸","ð","ð","ð®","ð¸","â¡","ð","ð","ð§","ð","ð¡ï¸","ð¥","ð®","ðº","ð","ð","ðª","ð¾","ð¤","ð±","ð¹","ð¸","ð¯","â"],sq=[{name:"Cyberpunk City",url:"https://images.unsplash.com/photo-1518709268805-4e9042af9f23?w=1200&auto=format&fit=crop&q=80"},{name:"Galaxia Neón",url:"https://images.unsplash.com/photo-1506703719100-a0f3a48c0f86?w=1200&auto=format&fit=crop&q=80"},{name:"Espacio Estelar",url:"https://images.unsplash.com/photo-1538370965046-79c0d6907d47?w=1200&auto=format&fit=crop&q=80"},{name:"Sakura Anime",url:"https://images.unsplash.com/photo-1522383225653-ed111181a951?w=1200&auto=format&fit=crop&q=80"},{name:"Dark Minimal",url:"https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=1200&auto=format&fit=crop&q=80"},{name:"Olas Violetas",url:"https://images.unsplash.com/photo-1579546929518-9e396f3cc809?w=1200&auto=format&fit=crop&q=80"}];function rq({isOpen:n,onClose:e,roomData:t,currentUser:s,isMasterAdmin:o,onRoomUpdated:l,onCleanRoomNow:u}){var $e,et;if(!n||!t)return null;const h=t.owner===s||o,[f,p]=y.useState(t.name||""),[x,b]=y.useState(t.rules||""),[C,N]=y.useState(t.logo||t.emblem||"âï¸"),[T,R]=y.useState(($e=t.logo)!=null&&$e.startsWith("http")||(et=t.logo)!=null&&et.startsWith("data:")?t.logo:""),[A,U]=y.useState(t.backgroundUrl||""),[M,V]=y.useState(t.autoCleanMode||"disabled"),[H,Q]=y.useState(t.bubbleStyle||"default"),[Y,k]=y.useState(t.theme||"cyan"),[E,j]=y.useState("general"),[P,O]=y.useState(!1),[F,S]=y.useState(!1),[be,Ee]=y.useState(""),[me,De]=y.useState(""),ge=(Ae,K)=>{var Le;const ne=(Le=Ae.target.files)==null?void 0:Le[0];if(!ne)return;if(ne.size>
432315*1024*1024){De("El archivo no debe exceder 15MB");return}const Pe=new FileReader;Pe.onload=mt=>{var lt;const tt=(lt=mt.target)==null?void 0:lt.result;tt&&(K==="logo"?(R(tt),N(tt)):(U(tt),_o(tt).catch(()=>{}),vo(tt)))},Pe.readAsDataURL(ne)},Ue=()=>{if(!f.trim()){De("El nombre de la sala no puede estar vacÃo");return}O(!0),De("");const Ae=T.trim()||C||"âï¸",K={name:f.trim(),rules:x.trim(),logo:Ae,emblem:Ae,backgroundUrl:A.trim(),autoCleanMode:M,bubbleStyle:H,theme:Y};W.emit("update_custom_room",{roomId:t.id,config:K},ne=>{O(!1),ne!=null&&ne.success?(Ee("¡Configuración de la sala guardada exitosamente!"),A.trim()&&vo(A.trim()),l(ne.room||{...t,...K}),setTimeout(()=>{Ee(""),e()},800)):De((ne==null?void 0:ne.error)||"Error al actualizar sala")})},we=()=>{window.confirm("¿Seguro que deseas limpiar todos los mensajes de esta sala ahora mismo?")&&(S(!0),W.emit("clean_custom_room",t.id,Ae=>{S(!1),Ae!=null&&Ae.success?(Ee("¡Sala limpiada exitosamente!"),u==null||u(),setTimeout(()=>Ee(""),2e3)):De((Ae==null?void 0:Ae.error)||"Error al limpiar la sala")}))};return i.jsx("div",{className:"fixed inset-0 z-[130] bg-black/80 backdrop-blur-md flex items-center justify-center p-3 sm:p-5 animate-in fade-in",onClick:e,children:i.jsxs("div",{className:"bg-[#0e121d] border border-cyan-500/40 rounded-3xl max-w-2xl w-full max-h-[92vh] shadow-[0_0_60px_rgba(6,182,212,0.25)] flex flex-col overflow-hidden relative",onClick:Ae=>Ae.stopPropagation(),children:[i.jsxs("div",{className:"p-4 sm:p-5 border-b border-white/10 flex items-center justify-between bg-gradient-to-r from-[#172033] to-[#0f1422]",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-11 h-11 rounded-2xl bg-cyan-500/20 border border-cyan-500/40 flex items-center justify-center text-2xl shadow-[0_0_15px_rgba(6,182,212,0.3)] shrink-0 overflow-hidden",children:T?i.jsx("img",{src:T,alt:"Logo",className:"w-full h-full object-cover"}):i.jsx("span",{children:C})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"text-lg font-black text-white tracking-tight flex items-center gap-2",children:["Configuración de Sala",i.jsx("span",{className:"bg-cyan-500/20 text-cyan-300 text-[10px] font-bold px-2 py-0.5 rounded-full border border-cyan-500/40 uppercase",children:h?"Dueño":"Modo Lectura"})]}),i.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:"Personaliza el nombre grande, logo, fondo, limpieza y burbujas"})]})]}),i.jsx("button",{onClick:e,className:"w-9 h-9 rounded-xl bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white flex items-center justify-center transition-colors",children:i.jsx(Kt,{size:18})})]}),i.jsxs("div",{className:"flex items-center gap-1 p-2 bg-white/[0.02] border-b border-white/5 overflow-x-auto scrollbar-none",children:[i.jsxs("button",{onClick:()=>j("general"),className:`px-3 py-1.5 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 whitespace-nowrap ${E==="general"?"bg-cyan-500 text-black shadow-[0_0_12px_rgba(6,182,212,0.4)]":"text-white/60 hover:text-white hover:bg-white/5"}`,children:[i.jsx(qB,{size:13})," General"]}),i.jsxs("button",{onClick:()=>j("logo"),className:`px-3 py-1.5 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 whitespace-nowrap ${E==="logo"?"bg-cyan-500 text-black shadow-[0_0_12px_rgba(6,182,212,0.4)]":"text-white/60 hover:text-white hover:bg-white/5"}`,children:[i.jsx(Fs,{size:13})," Logo & Emblema"]}),i.jsxs("button",{onClick:()=>j("fondo"),className:`px-3 py-1.5 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 whitespace-nowrap ${E==="fondo"?"bg-cyan-500 text-black shadow-[0_0_12px_rgba(6,182,212,0.4)]":"text-white/60 hover:text-white hover:bg-white/5"}`,children:[i.jsx(Lu,{size:13})," Fondo de Sala"]}),i.jsxs("button",{onClick:()=>j("limpieza"),className:`px-3 py-1.5 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 whitespace-nowrap ${E==="limpieza"?"bg-cyan-500 text-black shadow-[0_0_12px_rgba(6,182,212,0.4)]":"text-white/60 hover:text-white hover:bg-white/5"}`,children:[i.jsx(Vs,{size:13})," Limpieza Automática"]}),i.jsxs("button",{onClick:()=>j("burbujas"),className:`px-3 py-1.5 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 whitespace-nowrap ${E==="burbujas"?"bg-cyan-500 text-black shadow-[0_0_12px_rgba(6,182,212,0.4)]":"text-white/60 hover:text-white hover:bg-white/5"}`,children:[i.jsx(ko,{size:13})," Burbujas"]})]}),i.jsxs("div",{className:"p-5 flex-1 overflow-y-auto max-h-[60vh] space-y-5",children:[me&&i.jsxs("div",{className:"bg-red-500/20 border border-red-500/40 p-3 rounded-2xl flex items-center gap-2 text-red-200 text-xs",children:[i.jsx(tp,{size:15})," ",me]}),be&&i.jsxs("div",{className:"bg-emerald-500/20 border border-emerald-500/40 p-3 rounded-2xl flex items-center gap-2 text-emerald-200 text-xs",children:[i.jsx(Jr,{size:15})," ",be]}),E==="general"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-bold text-gray-300 uppercase tracking-wider mb-1.5",children:"Nombre de la Sala (Se verá grande y destacado)"}),i.jsx("input",{type:"text",value:f,onChange:Ae=>p(Ae.target.value),disabled:!h,placeholder:"Ej: ð El Refugio Cuántico",className:"w-full bg-white/5 border border-white/10 rounded-2xl px-4 py-3 text-white font-bold text-base focus:outline-none focus:border-cyan-400 focus:ring-1 focus:ring-cyan-400 disabled:opacity-60"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-bold text-gray-300 uppercase tracking-wider mb-1.5",children:"Reglas o Mensaje de Bienvenida"}),i.jsx("textarea",{value:x,onChange:Ae=>b(Ae.target.value),disabled:!h,placeholder:"Escribe las normas de tu comunidad...",rows:3,className:"w-full bg-white/5 border border-white/10 rounded-2xl px-4 py-2.5 text-white/90 text-sm focus:outline-none focus:border-cyan-400 focus:ring-1 focus:ring-cyan-400 disabled:opacity-60 resize-none"})]}),i.jsxs("div",{className:"bg-white/[0.03] border border-white/10 p-4 rounded-2xl flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-white font-bold text-sm",children:"Creador / Dueño Oficial"}),i.jsx("div",{className:"text-xs text-white/50",children:"Solo el creador o Axiss pueden editar la sala."})]}),i.jsxs("span",{className:"text-xs font-mono font-bold text-amber-300 bg-amber-500/20 px-3 py-1 rounded-xl border border-amber-500/40",children:["@",t.owner]})]})]}),E==="logo"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-bold text-gray-300 uppercase tracking-wider mb-2",children:"Emblema Rápido (Icono Oficial)"}),i.jsx("div",{className:"grid grid-cols-8 gap-2",children:nq.map(Ae=>i.jsx("button",{type:"button",disabled:!h,onClick:()=>{N(Ae),R("")},className:`h-11 rounded-2xl text-xl flex items-center justify-center border transition-all ${C===Ae&&!T?"bg-cyan-500/30 border-cyan-400 shadow-[0_0_12px_rgba(6,182,212,0.4)] scale-105":"bg-white/5 border-white/10 hover:bg-white/10 hover:border-white/20"}`,children:Ae},Ae))})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-bold text-gray-300 uppercase tracking-wider mb-1.5",children:"O sube tu propio Logo personalizado (URL o Imagen)"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",value:T,onChange:Ae=>{R(Ae.target.value),Ae.target.value&&N(Ae.target.value)},disabled:!h,placeholder:"https://i.imgur.com/... o enlace de imagen",className:"flex-1 bg-white/5 border border-white/10 rounded-2xl px-4 py-2.5 text-xs text-white focus:outline-none focus:border-cyan-400"}),i.jsxs("label",{className:"cursor-pointer bg-white/10 hover:bg-white/20 border border-white/15 px-3 py-2.5 rounded-2xl text-xs font-bold text-white flex items-center gap-1.5 transition-colors",children:[i.jsx(Mu,{size:14}),i.jsx("span",{children:"Subir"}),i.jsx("input",{type:"file",accept:"image/*",disabled:!h,onChange:Ae=>
4323ge(Ae,"logo"),className:"hidden"})]})]})]}),T&&i.jsxs("div",{className:"p-3 bg-black/40 border border-white/10 rounded-2xl flex items-center gap-3",children:[i.jsx("img",{src:T,alt:"Vista previa logo",className:"w-12 h-12 rounded-xl object-cover border border-white/20"}),i.jsx("div",{className:"text-xs text-white/70",children:"Logo personalizado activo para la sala."})]})]}),E==="fondo"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-bold text-gray-300 uppercase tracking-wider mb-1.5",children:"Fondo de Pantalla de la Sala (Video ⢠GIF ⢠Imagen)"}),i.jsx("p",{className:"text-xs text-white/50 mb-2",children:"Todos los usuarios que entren a tu sala verán este fondo automáticamente."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("input",{type:"text",value:A,onChange:Ae=>U(Ae.target.value),disabled:!h,placeholder:"Enlace de YouTube, GIF, video MP4 o imagen...",className:"flex-1 bg-white/5 border border-white/10 rounded-2xl px-4 py-2.5 text-xs text-white focus:outline-none focus:border-cyan-400"}),i.jsxs("label",{className:"cursor-pointer bg-white/10 hover:bg-white/20 border border-white/15 px-3 py-2.5 rounded-2xl text-xs font-bold text-white flex items-center gap-1.5 transition-colors",children:[i.jsx(Mu,{size:14}),i.jsx("span",{children:"Subir"}),i.jsx("input",{type:"file",accept:"image/*,video/mp4,video/webm",disabled:!h,onChange:Ae=>ge(Ae,"bg"),className:"hidden"})]})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-bold text-gray-300 uppercase tracking-wider mb-2",children:"Fondos Sugeridos de Alta Definición"}),i.jsx("div",{className:"grid grid-cols-3 gap-2",children:sq.map(Ae=>i.jsxs("button",{type:"button",disabled:!h,onClick:()=>U(Ae.url),className:`relative rounded-xl overflow-hidden h-16 border transition-all text-left ${A===Ae.url?"border-cyan-400 shadow-[0_0_12px_rgba(6,182,212,0.4)]":"border-white/10 hover:border-white/30"}`,children:[i.jsx("img",{src:Ae.url,alt:Ae.name,className:"w-full h-full object-cover"}),i.jsx("div",{className:"absolute inset-0 bg-black/40 flex items-end p-1.5",children:i.jsx("span",{className:"text-[10px] font-bold text-white leading-tight truncate",children:Ae.name})})]},Ae.name))})]})]}),E==="limpieza"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 p-4 rounded-2xl flex items-start gap-3",children:[i.jsx(Vs,{size:20,className:"text-amber-400 shrink-0 mt-0.5"}),i.jsxs("div",{className:"text-xs text-amber-200 leading-relaxed",children:[i.jsx("b",{children:"Limpieza Automática Programada:"})," Evita la acumulación excesiva de mensajes en tu sala y mantiene el chat fluido y rápido para todos los miembros."]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-bold text-gray-300 uppercase tracking-wider mb-2",children:"Frecuencia de Limpieza Automática"}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:[{id:"disabled",label:"Desactivada",desc:"Sin limpieza periódica"},{id:"10msgs",label:"Cada 10 mensajes",desc:"Mantiene los últimos 10"},{id:"20msgs",label:"Cada 20 mensajes",desc:"LÃmite estándar de 20"},{id:"50msgs",label:"Cada 50 mensajes",desc:"Salas muy activas"},{id:"100msgs",label:"Cada 100 mensajes",desc:"Historial extendido"},{id:"5min",label:"Cada 5 minutos",desc:"Limpieza por tiempo"},{id:"15min",label:"Cada 15 minutos",desc:"Salas temporales"},{id:"1hour",label:"Cada 1 hora",desc:"Limpieza cada 60 min"},{id:"24hours",label:"Cada 24 horas",desc:"Limpieza diaria"}].map(Ae=>i.jsxs("button",{type:"button",disabled:!h,onClick:()=>V(Ae.id),className:`p-3 rounded-2xl border text-left transition-all ${M===Ae.id?"bg-amber-500/20 border-amber-400 shadow-[0_0_12px_rgba(245,158,11,0.3)] text-white":"bg-white/5 border-white/10 hover:bg-white/10 text-white/80"}`,children:[i.jsxs("div",{className:"font-bold text-xs flex items-center justify-between",children:[i.jsx("span",{children:Ae.label}),M===Ae.id&&i.jsx(Jr,{size:12,className:"text-amber-400"})]}),i.jsx("div",{className:"text-[10px] text-white/50 mt-0.5",children:Ae.desc})]},Ae.id))})]}),h&&i.jsx("div",{className:"pt-2",children:i.jsxs("button",{type:"button",disabled:F,onClick:we,className:"w-full bg-red-500/20 hover:bg-red-500/30 text-red-300 border border-red-500/40 font-bold py-2.5 rounded-2xl text-xs flex items-center justify-center gap-2 transition-all",children:[i.jsx(Vs,{size:14}
4323),F?"Limpiando sala...":"ð§¹ Limpiar Todos los Mensajes de la Sala Ahora"]})})]}),E==="burbujas"&&i.jsxs("div",{className:"space-y-3",children:[i.jsx("label",{className:"block text-xs font-bold text-gray-300 uppercase tracking-wider mb-1",children:"Estilo de Burbujas de la Sala"}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2.5",children:ym.map(Ae=>i.jsxs("button",{type:"button",disabled:!h,onClick:()=>Q(Ae.id),className:`p-3 rounded-2xl border text-left transition-all relative overflow-hidden ${H===Ae.id?"bg-cyan-500/20 border-cyan-400 shadow-[0_0_15px_rgba(6,182,212,0.3)]":"bg-white/5 border-white/10 hover:bg-white/10"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsxs("div",{className:"font-bold text-xs text-white flex items-center gap-1.5",children:[i.jsx("span",{children:Ae.icon}),i.jsx("span",{children:Ae.name})]}),Ae.badge&&i.jsx("span",{className:"text-[9px] bg-white/10 text-cyan-300 px-1.5 py-0.2 rounded-full font-mono font-bold",children:Ae.badge})]}),i.jsx("p",{className:"text-[11px] text-white/50 line-clamp-1",children:Ae.desc})]},Ae.id))})]})]}),i.jsxs("div",{className:"p-4 border-t border-white/10 bg-black/40 flex items-center justify-between",children:[i.jsx("button",{type:"button",onClick:e,className:"text-xs text-white/60 hover:text-white px-4 py-2 rounded-xl transition-colors font-semibold",children:"Cancelar"}),h&&i.jsxs("button",{type:"button",disabled:P,onClick:Ue,className:"bg-gradient-to-r from-cyan-400 to-blue-500 hover:from-cyan-300 hover:to-blue-400 text-black font-extrabold px-5 py-2.5 rounded-xl shadow-[0_0_15px_rgba(6,182,212,0.4)] text-xs flex items-center gap-2 transition-all disabled:opacity-50",children:[i.jsx(Jr,{size:16}),P?"Guardando...":"Guardar Cambios de la Sala"]})]})]})})}function iq({isOpen:n,onClose:e,stats:t,onRefresh:s,onWithdraw:o}){const[l,u]=y.useState("kpis"),[h,f]=y.useState(150),[p,x]=y.useState(3),[b,C]=y.useState(!1),[N,T]=y.useState(null);if(!n)return null;const R=t.earningsPerVideo||.05,A=t.cpm||50,U=t.ctr||5.2,M=t.todayViews||142,V=t.todayRevenue||Number((M*R).toFixed(2)),H=t.revenuePending||0,Q=t.lifetimeRevenue||0,Y=t.adViews||0,k=t.aiBreakdown||{Elizabeth:Math.round(Y*.75)||120,Sensei:Math.round(Y*.12)||20,Shadow:Math.round(Y*.08)||14,Neko:Math.round(Y*.05)||8},E=Object.values(k).reduce((Ee,me)=>Ee+me,0)||1,j=h*p,P=j*R,O=P*30,F=j*10*30,S=()=>{C(!0),s(),setTimeout(()=>C(!1),600)},be=()=>{T(null),o(Ee=>{Ee&&Ee.success?T("¡Retiro solicitado con éxito! Los fondos serán transferidos a tu cuenta en 48hs."):T((Ee==null?void 0:Ee.message)||"Saldo pendiente insuficiente. Se requiere un mÃnimo de $100.00 USD.")})};return i.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-md z-[120] flex items-center justify-center p-3 sm:p-4 animate-in fade-in duration-200",children:i.jsxs("div",{className:"bg-[#0e121d] border border-emerald-500/40 rounded-3xl w-full max-w-4xl overflow-hidden shadow-[0_0_60px_rgba(16,185,129,0.25)] flex flex-col max-h-[90vh]",children:[i.jsxs("div",{className:"p-4 sm:p-5 border-b border-white/10 flex flex-wrap items-center justify-between gap-3 bg-gradient-to-r from-[#0d221a] via-[#101b2b] to-[#0e121d]",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-11 h-11 rounded-2xl bg-emerald-500/20 border border-emerald-500/50 flex items-center justify-center text-emerald-400 shadow-[0_0_20px_rgba(16,185,129,0.35)] shrink-0",children:i.jsx(_B,{size:24})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsx("h2",{className:"text-white text-lg sm:text-xl font-extrabold tracking-tight",children:"Informe de Ganancias & CTR"}),i.jsxs("span",{className:"text-[10px] bg-emerald-500/20 text-emerald-300 font-bold px-2 py-0.5 rounded-full border border-emerald-500/40 uppercase tracking-wide flex items-center gap-1",children:[i.jsx(ph,{size:12}),"HilltopAds ID: ab2396fc769d3ea8283b4fd4c4f9077b64ab7d9b"]})]}),i.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:"Métricas en tiempo real de videos vistos para recargas de IA (Rewarded Ads)"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:S,className:`p-2 rounded-xl bg-white/5 hover:bg-white/10 text-gray-300 hover:text-white transition-all border border-white/10 ${b?"animate-spin text-emerald-400":""}`,title:"Actualizar datos",children:i.jsx(xo,{size:17})}),i.jsx("button",{onClick:e,className:"p-2 rounded-xl bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white transition-colors border border-white/10",children:i.jsx(Kt,{size:18})})]})]}),i.jsxs("div",{className:"px-5 pt-3 pb-0 border-b border-white/10 flex gap-2 overflow-x-auto bg-[#0b0e17]",children:[i.jsxs("button",{onClick:()=>u("kpis"),className:`px-4 py-2.5 rounded-t-xl text-xs sm:text-sm font-bold flex items-center gap-2 transition-all border-b-2 ${l==="kpis"?"border-emerald-400 text-emerald-300 bg-emerald-500/10":"border-transparent text-gray-400 hover:text-gray-200 hover:bg-white/5"}`,children:[i.jsx(tR,{size:16}),"Métricas & Ganancias"]}),i.jsxs("button",{onClick:()=>u("users"),className:`px-4 py-2.5 rounded-t-xl text-xs sm:text-sm font-bold flex items-center gap-2 transition-all border-b-2 ${l==="users"?"border-amber-400 text-amber-300 bg-amber-500/10":"border-transparent text-gray-400 hover:text-gray-200 hover:bg-white/5"}`,children:[i.jsx(Na,{size:16}),"Ganancias por Usuario (",Object.keys(t.userEarnings||{}).length,")"]}),i.jsxs("button",{onClick:()=>u("metro"),className:`px-4 py-2.5 rounded-t-xl text-xs sm:text-sm font-bold flex items-center gap-2 transition-all border-b-2 ${l==="metro"?"border-cyan-400 text-cyan-300 bg-cyan-500/10":"border-transparent text-gray-400 hover:text-gray-200 hover:bg-white/5"}`,children:[i.jsx(Bh,{size:16}),"Metro Calculador de Ganancias"]}),i.jsxs("button",{onClick:()=>u("logs"),className:`px-4 py-2.5 rounded-t-xl text-xs sm:text-sm font-bold flex items-center gap-2 transition-all border-b-2 ${l==="logs"?"border-purple-400 text-purple-300 bg-purple-500/10":"border-transparent text-gray-400 hover:text-gray-200 hover:bg-white/5"}`,children:[i.jsx(jE,{size:16}),"Historial de Recargas en Vivo"]})]}),i.jsxs("div",{className:"p-5 flex-1 overflow-y-auto scrollbar-thin space-y-6",children:[l==="kpis"&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[i.jsxs("div",{className:"bg-white/[0.03] border border-emerald-500/30 rounded-2xl p-4 relative overflow-hidden group hover:border-emerald-400 transition-all shadow-md",children:[i.jsx("div",{className:"absolute top-0 right-0 w-24 h-24 bg-emerald-500/10 rounded-full blur-xl pointer-events-none"}),i.jsxs("p",{className:"text-gray-400 text-[11px] font-bold uppercase tracking-wider mb-1 flex items-center gap-1.5",children:[i.jsx(_B,{size:13,className:"text-emerald-400"}),"Ganancia por Video"]}),i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsxs("span",{className:"text-3xl font-black text-emerald-300",children:["$",R.toFixed(2)]}),i.jsx("span",{className:"text-xs text-gray-400",children:"USD / view"})]}),i.jsxs("p",{className:"text-[11px] text-gray-400 mt-2",children:["1 video visto = ",i.jsx("strong",{children:"+10 tokens"})," a la IA"]})]}),i.jsxs("div",{className:"bg-white/[0.03] border border-cyan-500/30 rounded-2xl p-4 relative overflow-hidden group hover:border-cyan-400 transition-all shadow-md",children:[i.jsx("div",{className:"absolute top-0 right-0 w-24 h-24 bg-cyan-500/10 rounded-full blur-xl pointer-events-none"}),i.jsxs("p",{className:"text-gray-400 text-[11px] font-bold uppercase tracking-wider mb-1 flex items-center gap-1.5",children:[i.jsx(YI,{size:13,className:"text-cyan-400"}),"Saldo Retirable"]}),i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsxs("span",{className:"text-3xl font-black text-cyan-300",children:["$",H.toFixed(2)]}),i.jsx("span",{className:"text-xs text-gray-400",children:"USD"})]}),i.jsx("div",{className:"w-full bg-white/10 rounded-full h-1.5 mt-2.5 overflow-hidden",children:i.jsx("div",{className:"bg-gradient-to-r from-cyan-500 to-emerald-400 h-full rounded-full transition-all duration-500",style:{width:`${Math.min(100,H/100*100)}%`}})}),i.jsxs("p",{className:"text-[10px] text-gray-400 mt-1.5",children:["MÃnimo para retiro: $100.00 (",Math.min(100,Math.round(H/100*100)),"%)"]})]}),i.jsxs("div",{className:"bg-white/[0.03] border border-purple-500/30 rounded-2xl p-4 relative overflow-hidden group hover:border-purple-400 transition-all shadow-md",children:[i.jsx("div",{className:"absolute top-0 right-0 w-24 h-24 bg-purple-500/10 rounded-full blur-xl pointer-events-none"}),i.jsxs("p",{className:"text-gray-400 text-[11px] font-bold uppercase tracking-wider mb-1 flex items-center gap-1.5",children:[i.jsx(Bo,{size:13,className:"text-purple-400"}),"Videos Reproducidos"]}),i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("span",{className:"text-3xl font-black text-purple-300",children:Y.toLocaleStr
4323ing()}),i.jsxs("span",{className:"text-xs text-emerald-400 font-bold",children:["+",M," hoy"]})]}),i.jsxs("p",{className:"text-[11px] text-gray-400 mt-2",children:["Hoy generado: ",i.jsxs("strong",{className:"text-emerald-300",children:["+$",V.toFixed(2)," USD"]})]})]}),i.jsxs("div",{className:"bg-white/[0.03] border border-amber-500/30 rounded-2xl p-4 relative overflow-hidden group hover:border-amber-400 transition-all shadow-md",children:[i.jsx("div",{className:"absolute top-0 right-0 w-24 h-24 bg-amber-500/10 rounded-full blur-xl pointer-events-none"}),i.jsxs("p",{className:"text-gray-400 text-[11px] font-bold uppercase tracking-wider mb-1 flex items-center gap-1.5",children:[i.jsx(mI,{size:13,className:"text-amber-400"}),"eCPM & CTR Red"]}),i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsxs("span",{className:"text-3xl font-black text-amber-300",children:["$",A.toFixed(2)]}),i.jsx("span",{className:"text-xs text-gray-400",children:"eCPM"})]}),i.jsxs("p",{className:"text-[11px] text-gray-400 mt-2",children:["CTR Video Completado: ",i.jsxs("strong",{className:"text-amber-300",children:[U,"%"]})]})]})]}),i.jsxs("div",{className:"bg-gradient-to-r from-emerald-950/40 via-[#101b2b] to-emerald-950/40 border border-emerald-500/30 rounded-2xl p-5 flex flex-col sm:flex-row items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsxs("h3",{className:"text-white font-extrabold text-base flex items-center gap-2",children:[i.jsx(_B,{size:18,className:"text-emerald-400"}),"Ganancias Históricas Totales:",i.jsxs("span",{className:"text-emerald-300 text-xl",children:["$",(Q+H).toFixed(2)," USD"]})]}),i.jsx("p",{className:"text-xs text-gray-400 mt-1 max-w-xl",children:"Cada vez que un usuario chatea con Elizabeth, Sensei, Shadow o Neko y agota sus tokens, visualiza un video de 15s. Esto te genera ingresos directos y mantiene la plataforma libre de costos."}),N&&i.jsx("p",{className:`text-xs mt-2 font-bold ${N.includes("éxito")?"text-emerald-400":"text-amber-400"}`,children:N})]}),i.jsxs("button",{onClick:be,disabled:H<100,className:`px-5 py-3 rounded-xl font-bold text-xs sm:text-sm flex items-center gap-2 transition-all shrink-0 ${H>=100?"bg-gradient-to-r from-emerald-500 to-teal-500 hover:from-emerald-400 hover:to-teal-400 text-black shadow-[0_0_20px_rgba(16,185,129,0.4)] active:scale-95":"bg-white/5 text-gray-500 border border-white/10 cursor-not-allowed"}`,children:[i.jsx($k,{size:17}),H>=100?"Retirar Fondos a Banco":`Faltan $${(100-H).toFixed(2)} para retirar`]})]}),i.jsxs("div",{className:"bg-white/[0.02] border border-white/10 rounded-2xl p-5",children:[i.jsxs("h3",{className:"text-white font-extrabold text-sm mb-4 flex items-center justify-between",children:[i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(gl,{size:17,className:"text-cyan-400"}),"¿A cuál IA recargan más los usuarios? (Desglose de Ingresos)"]}),i.jsxs("span",{className:"text-xs text-gray-400 font-normal",children:["Total: ",Y," videos"]})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3.5",children:Object.entries(k).map(([Ee,me])=>{const De=Math.round(me/E*100),ge=(me*R).toFixed(2),Ue=Ee==="Elizabeth";return i.jsxs("div",{className:`p-3.5 rounded-xl border transition-all ${Ue?"bg-pink-500/10 border-pink-500/40 shadow-[0_0_15px_rgba(236,72,153,0.15)]":"bg-white/[0.02] border-white/10 hover:border-white/20"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("span",{className:"font-bold text-white text-sm flex items-center gap-1.5",children:[Ue?"ð":"ð¤"," ",Ee]}),i.jsxs("span",{className:`text-xs font-bold px-2 py-0.5 rounded-full ${Ue?"bg-pink-500/20 text-pink-300":"bg-white/10 text-gray-300"}`,children:[De,"%"]})]}),i.jsxs("div",{className:"flex items-baseline justify-between text-xs text-gray-400 mb-1.5",children:[i.jsxs("span",{children:[me," recargas"]}),i.jsxs("span",{className:"text-emerald-300 font-bold",children:["+$",ge," USD"]})]}),i.jsx("div",{className:"w-full bg-white/10 rounded-full h-1.5 overflow-hidden",children:i.jsx("div",{className:`h-full rounded-full ${Ue?"bg-pink-500":"bg-cyan-500"}`,style:{width:`${De}%`}})})]},Ee)})})]})]}),l==="users"&&i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"bg-gradient-to-r from-amber-950/40 via-[#131a26] to-[#0e121d] border border-amber-500/30 rounded-2xl p-5",children:i.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsxs("h3",{className:"text-white text-base sm:text-lg font-extrabold flex items-center gap-2",children:[i.jsx(Na,{size:20,className:"text-amber-400"}),"Contador de Ganancias por Usuario"]}),i.jsx("p",{className:"text-xs text-gray-400 mt-1 max-w-xl",children:"Aquà ves exactamente cuánto dinero vas ganando con cada usuario cuando mira un anuncio para recargar sus tokens de IA (+50 tokens)."})]}),i.jsxs("div",{className:"bg-amber-500/15 border border-amber-500/40 px-4 py-2.5 rounded-2xl text-right",children:[i.jsx("span",{className:"text-[11px] text-amber-300 font-bold block uppercase tracking-wider",children:"Tarifa por Recarga"}),i.jsx("span",{className:"text-2xl font-black text-amber-400",children:"+$0.05 USD"})]})]})}),Object.keys(t.userEarnings||{}).length===0?i.jsxs("div",{className:"text-center py-12 bg-white/[0.02] rounded-2xl border border-white/10 text-gray-400",children:[i.jsx(Na,{size:40,className:"mx-auto mb-2 text-gray-600"}),i.jsx("p",{className:"font-bold text-sm text-gray-300",children:"Aún no hay usuarios registrados que hayan recargado tokens."}),i.jsx("p",{className:"text-xs text-gray-500 mt-1",children:'Apenas un usuario presione "Ver anuncio para recargar tokens", su contador se sumará aquà en tiempo real.'})]}):i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3.5",children:Object.values(t.userEarnings||{}).map(Ee=>i.jsxs("div",{className:"bg-white/[0.03] hover:bg-white/[0.06] border border-white/10 hover:border-amber-500/40 rounded-2xl p-4 transition-all flex items-center justify-between gap-3 shadow-md",children:[i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[i.jsx("div",{className:"w-11 h-11 rounded-2xl bg-gradient-to-br from-amber-500/20 to-orange-500/20 border border-amber-500/40 flex items-center justify-center text-amber-300 font-black text-base shrink-0 shadow-sm",children:Ee.username.slice(0,2).toUpperCase()}),i.jsxs("div",{className:"min-w-0",children:[i.jsxs("p",{className:"text-white font-extrabold text-sm truncate flex items-center gap-2",children:[Ee.username,i.jsx("span",{className:"text-[10px] bg-emerald-500/20 text-emerald-300 px-2 py-0.5 rounded-full border border-emerald-500/30",children:"Activo"})]}),i.jsxs("p",{className:"text-xs text-gray-400 mt-0.5",children:[Ee.rechargesCount," ",Ee.rechargesCount===1?"recarga (+50 tokens)":"recargas (+50 tokens c/u)"]}),i.jsxs("p",{className:"text-[10px] text-gray-500 mt-1",children:["Ãltima recarga: ",new Date(Ee.lastRecharge).toLocaleStr
4323ing()]})]})]}),i.jsxs("div",{className:"text-right shrink-0 bg-black/40 border border-white/10 px-3.5 py-2 rounded-xl",children:[i.jsx("span",{className:"text-[10px] text-gray-400 font-bold block uppercase",children:"Has ganado"}),i.jsxs("span",{className:"text-lg font-black text-emerald-300 block",children:["+$",Ee.totalEarned.toFixed(2)," USD"]})]})]},Ee.username))})]}),l==="metro"&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"bg-gradient-to-br from-cyan-950/40 via-[#0e1626] to-[#0e121d] border border-cyan-500/30 rounded-2xl p-6",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-cyan-500/20 border border-cyan-500/40 flex items-center justify-center text-cyan-400",children:i.jsx(Bh,{size:20})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-white text-base sm:text-lg font-extrabold",children:"Metro Proyector: ¿Cuánto gano con cada video?"}),i.jsx("p",{className:"text-xs text-gray-400",children:"Simula el volumen de usuarios diarios y videos de recarga para estimar tus ingresos mensuales."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 my-6 pt-4 border-t border-white/10",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-xs font-bold",children:[i.jsxs("span",{className:"text-gray-300 flex items-center gap-1.5",children:[i.jsx(Na,{size:14,className:"text-cyan-400"}),"Usuarios activos chateando al dÃa:"]}),i.jsxs("span",{className:"text-cyan-300 font-extrabold text-sm",children:[h," usuarios"]})]}),i.jsx("input",{type:"range",min:"10",max:"2000",step:"10",value:h,onChange:Ee=>f(Number(Ee.target.value)),className:"w-full accent-cyan-400 h-2 bg-white/10 rounded-lg cursor-pointer"}),i.jsxs("div",{className:"flex justify-between text-[10px] text-gray-500",children:[i.jsx("span",{children:"10 usuarios"}),i.jsx("span",{children:"500"}),i.jsx("span",{children:"1,000"}),i.jsx("span",{children:"2,000 usuarios"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex justify-between text-xs font-bold",children:[i.jsxs("span",{className:"text-gray-300 flex items-center gap-1.5",children:[i.jsx(Bo,{size:14,className:"text-purple-400"}),"Videos vistos por usuario al dÃa (recargas):"]}),i.jsxs("span",{className:"text-purple-300 font-extrabold text-sm",children:[p," videos"]})]}),i.jsx("input",{type:"range",min:"1",max:"15",step:"1",value:p,onChange:Ee=>x(Number(Ee.target.value)),className:"w-full accent-purple-400 h-2 bg-white/10 rounded-lg cursor-pointer"}),i.jsxs("div",{className:"flex justify-between text-[10px] text-gray-500",children:[i.jsx("span",{children:"1 video (10 msgs)"}),i.jsx("span",{children:"5 videos (50 msgs)"}),i.jsx("span",{children:"15 videos (150 msgs)"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 pt-2",children:[i.jsxs("div",{className:"bg-black/40 border border-white/10 rounded-xl p-4 text-center",children:[i.jsx("p",{className:"text-[11px] text-gray-400 font-bold uppercase mb-1",children:"Videos al DÃa"}),i.jsx("p",{className:"text-2xl font-black text-white",children:j.toLocaleString()}),i.jsx("p",{className:"text-[10px] text-cyan-400 mt-1",children:"reproducciones / 24h"})]}),i.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/30 rounded-xl p-4 text-center shadow-lg",children:[i.jsx("p",{className:"text-[11px] text-emerald-400 font-bold uppercase mb-1",children:"Ingresos Diarios"}),i.jsxs("p",{className:"text-3xl font-black text-emerald-300",children:["$",P.toFixed(2)," USD"]}),i.jsxs("p",{className:"text-[10px] text-emerald-200 mt-1",children:["calculado a $",R.toFixed(2)," / video"]})]}),i.jsxs("div",{className:"bg-gradient-to-br from-emerald-500/20 to-teal-500/20 border border-emerald-500/50 rounded-xl p-4 text-center shadow-xl",children:[i.jsx("p",{className:"text-[11px] text-emerald-300 font-bold uppercase mb-1",children:"Proyección Mensual (30d)"}),i.jsxs("p",{className:"text-3xl font-black text-white drop-shadow-md",children:["$",O.toFixed(2)," USD"]}),i.jsxs("p",{className:"text-[10px] text-emerald-300 mt-1",children:[F.toLocaleStr
4323ing()," msgs IA activados"]})]})]})]}),i.jsxs("div",{className:"bg-white/[0.02] border border-white/10 rounded-xl p-4 text-xs text-gray-300 space-y-2",children:[i.jsxs("p",{className:"font-bold text-white flex items-center gap-1.5",children:[i.jsx(di,{size:15,className:"text-emerald-400"}),"¿Por qué este modelo es rentable y amigable con el usuario?"]}),i.jsxs("p",{className:"text-gray-400",children:["En lugar de bloquear a los usuarios con suscripciones de pago que nadie compra, ellos chatean gratis con Elizabeth u otras IAs. Cuando se les terminan los 10 tokens iniciales, simplemente miran un video corto de 15 segundos. HilltopAds te paga ",i.jsx("strong",{children:"$0.05 por cada video completado"})," ($50 CPM en promedio en Latinoamérica y global), lo que te permite ganar dinero constantemente mientras los usuarios están felices chateando."]})]})]}),l==="logs"&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h3",{className:"text-white font-extrabold text-sm flex items-center gap-2",children:[i.jsx(jE,{size:16,className:"text-purple-400"}),"Ãltimas Recargas en Tiempo Real"]}),i.jsx("span",{className:"text-xs text-gray-400",children:"Cada entrada suma $0.05 a tu saldo"})]}),!t.rechargeLogs||t.rechargeLogs.length===0?i.jsxs("div",{className:"text-center py-12 text-gray-400 bg-white/[0.02] rounded-2xl border border-white/10",children:[i.jsx(Bo,{size:36,className:"mx-auto mb-2 text-gray-600"}),i.jsx("p",{className:"font-bold text-sm",children:"No hay registros de recargas recientes aún."}),i.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Los videos que vean los usuarios aparecerán aquà automáticamente."})]}):i.jsx("div",{className:"space-y-2.5",children:t.rechargeLogs.map(Ee=>i.jsxs("div",{className:"bg-white/[0.03] hover:bg-white/[0.05] border border-white/10 rounded-xl p-3.5 flex items-center justify-between gap-3 transition-colors",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-9 h-9 rounded-xl bg-purple-500/20 border border-purple-500/40 flex items-center justify-center text-purple-300 font-bold text-sm shrink-0",children:Ee.username.slice(0,2).toUpperCase()}),i.jsxs("div",{children:[i.jsxs("p",{className:"text-white text-sm font-bold flex items-center gap-1.5",children:[Ee.username,i.jsxs("span",{className:"text-[10px] bg-cyan-500/20 text-cyan-300 px-2 py-0.5 rounded-full border border-cyan-500/30",children:["recargó a ",Ee.aiTarget||"Elizabeth"]})]}),i.jsxs("p",{className:"text-[11px] text-gray-400",children:[new Date(Ee.timestamp).toLocaleString()," ⢠+",Ee.tokensGranted||10," tokens otorgados"]})]})]}),i.jsxs("div",{className:"text-right shrink-0",children:[i.jsxs("span",{className:"text-emerald-400 font-extrabold text-sm block",children:["+$",(Ee.earned||.05).toFixed(2)," USD"]}),i.jsx("span",{className:"text-[10px] text-gray-500",children:"Acreditado"})]})]},Ee.id))})]})]}),i.jsxs("div",{className:"p-4 border-t border-white/10 bg-[#090c13] flex flex-wrap items-center justify-between gap-3 text-xs text-gray-400",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-emerald-400 animate-pulse"}),i.jsx("span",{children:"Sistema publicitario HilltopAds conectado y operando."})]}),i.jsx("button",{onClick:e,className:"px-5 py-2 rounded-xl bg-white/10 hover:bg-white/20 text-white font-bold transition-colors",children:"Cerrar Informe"})]})]})})}const cD=[{id:"bubble_soap",type:"texture",category:"efectos",price:300,url:"soap"},{id:"bubble_animals",type:"texture",category:"efectos",price:450,url:"animals"},{id:"chess_theme_wood",type:"basic",category:"ajedrez",price:100,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=wood"},{id:"chess_theme_neon",type:"intermediate",category:"ajedrez",price:500,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=neon"},{id:"chess_theme_gold",type:"premium",category:"ajedrez",price:1500,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=gold"},{id:"dec_b1",type:"basic",category:"marcos",price:500,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=flower1"},{id:"dec_b2",type:"basic",category:"marcos",price:500,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=star"},{id:"dec_i1",type:"intermediate",category:"marcos",price:1200,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=cat"},{id:"dec_p1",type:"premium",category:"marcos",price:2500,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=crown"},{id:"dec_b3",type:"basic",category:"emblemas",price:500,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=heart"},{id:"dec_i2",type:"intermediate",category:"emblemas",price:1200,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=dog"},{id:"dec_p2",type:"premium",category:"emblemas",price:2500,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=diamond"},{id:"dec_b4",type:"basic",category:"mascotas",price:500,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=leaf"},{id:"dec_i3",type:"intermediate",category:"mascotas",price:1200,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=rabbit"},{id:"dec_i4",type:"intermediate",category:"mascotas",price:1200,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=bird"},{id:"dec_p3",type:"premium",category:"mascotas",price:2500,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=dragon"},{id:"dec_b5",type:"basic",category:"efectos",price:500,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=cloud"},{id:"dec_i5",type:"intermediate",category:"efectos",price:1200,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=fish"},{id:"dec_p4",type:"premium",category:"efectos",price:2500,url:"https://api.dicebear.com/7.x/pixel-art/svg?seed=unicorn"}];let xy=null,pB=null;function aq(){pB&&pB.abort(),pB=new AbortController,fetch("/version",{signal:pB.signal}).then(n=>n.json()).then(n=>{xy===null?xy=n.version:n.version!==xy&&(console.log("Nueva actualización detectada. Recargando..."),window.location.reload())}).catch(n=>{n.name!=="AbortError"&&console.error("Error verificando versión:",n)})}setInterval(aq,15e3);const BB=async(n,e,t,s)=>
4323{console.log("Intentando enviar notificación a:",n);try{const o=await Fh(zs(ft,"notifications"),{recipientUid:n,senderUid:t,senderName:t,type:e,frData:(s==null?void 0:s.frData)||null,message:`Has recibido un ${e} de ${t}`,isRead:!1,createdAt:E6()});console.log("Notificación creada con ID:",o.id)}catch(o){console.error("Error al escribir en Firestore:",o)}},oq=["ð","â¤ï¸","ð","ð®","ð¢","ð¡"];function lq(){var cf,uf,ld,gi,Fp,fa;const n=_=>{try{const L=new(window.AudioContext||window.webkitAudioContext),G=L.createOscillator(),ae=L.createGain();G.connect(ae),ae.connect(L.destination);const Be=L.currentTime;_==="â¤ï¸"?(G.type="sine",G.frequency.setValueAtTime(800,Be),G.frequency.exponentialRampToValueAtTime(1200,Be+.1),ae.gain.setValueAtTime(0,Be),ae.gain.linearRampToValueAtTime(.5,Be+.05),ae.gain.linearRampToValueAtTime(0,Be+.2),G.start(Be),G.stop(Be+.2)):_==="ð"?(G.type="triangle",G.frequency.setValueAtTime(400,Be),G.frequency.setValueAtTime(600,Be+.05),G.frequency.setValueAtTime(800,Be+.1),ae.gain.setValueAtTime(.3,Be),ae.gain.linearRampToValueAtTime(0,Be+.15),G.start(Be),G.stop(Be+.15)):_==="ð®"?(G.type="sine",G.frequency.setValueAtTime(300,Be),G.frequency.linearRampToValueAtTime(600,Be+.2),ae.gain.setValueAtTime(.4,Be),ae.gain.linearRampToValueAtTime(0,Be+.3),G.start(Be),G.stop(Be+.3)):_==="ð¢"?(G.type="triangle",G.frequency.setValueAtTime(600,Be),G.frequency.linearRampToValueAtTime(300,Be+.3),ae.gain.setValueAtTime(.3,Be),ae.gain.linearRampToValueAtTime(0,Be+.4),G.start(Be),G.stop(Be+.4)):_==="ð¡"?(G.type="sawtooth",G.frequency.setValueAtTime(150,Be),G.frequency.linearRampToValueAtTime(100,Be+.2),ae.gain.setValueAtTime(.4,Be),ae.gain.linearRampToValueAtTime(0,Be+.25),G.start(Be),G.stop(Be+.25)):_==="ð"&&(G.type="square",G.frequency.setValueAtTime(400,Be),ae.gain.setValueAtTime(0,Be),ae.gain.linearRampToValueAtTime(.3,Be+.02),ae.gain.linearRampToValueAtTime(0,Be+.1),G.start(Be),G.stop(Be+.1))}catch(L){console.error(L)}},e=()=>{try{const _=new(window.AudioContext||window.webkitAudioContext),L=_.createOscillator(),G=_.createGain();L.type="sine",L.frequency.setValueAtTime(520,_.currentTime),L.frequency.exponentialRampToValueAtTime(680,_.currentTime+.08),G.gain.setValueAtTime(0,_.currentTime),G.gain.linearRampToValueAtTime(.08,_.currentTime+.03),G.gain.exponentialRampToValueAtTime(.001,_.currentTime+.15),L.connect(G),G.connect(_.destination),L.start(),L.stop(_.currentTime+.15)}catch(_){console.error("Sound error",_)}},[t,s]=y.useState(!0),[o,l]=y.useState(!1),[u,h]=y.useState(!1),[f,p]=y.useState({username:"",password:"",countryLanguage:"es",securityEmail:""}),[x,b]=y.useState(!1),[C,N]=y.useState(!1),[T,R]=y.useState("global"),[A,U]=y.useState(!1),[M,V]=y.useState(null),[H,Q]=y.useState(!1),[Y,k]=y.useState(!1),[E,j]=y.useState([]),[P,O]=y.useState(null),[F,S]=y.useState("Elizabeth"),[be,Ee]=y.useState({profilePic:"",statusMessage:"Administradora",systemInstruction:"",bubbleColor:"rgba(15, 17, 26, 0.9)",bubbleBorder:"border-[#D4AF37]",bubbleShape:"rounded-2xl",bubbleTexture:"none"}),[me,De]=y.useState(null),[ge,Ue]=y.useState(null),[we,$e]=y.useState(!1),[et,Ae]=y.useState(0),[K,ne]=y.useState(!1),[Pe,Le]=y.useState(!1),[mt,tt]=y.useState(null),[lt,Qe]=y.useState(null),[st,Yn]=y.useState(!1),[Rn,zn]=y.useState(!1),[Zt,en]=y.useState(!1),[jt,At]=y.useState({adViews:4980,revenuePending:99.6,lifetimeRevenue:250,cpm:50,earningsPerVideo:.05,todayViews:142,todayRevenue:7.1,ctr:5.2}),[Tt,gn]=y.useState([]),[Oe,vt]=y.useState([]),[Ft,on]=y.useState(null),[Zn,Fn]=y.useState(null),[In,nn]=y.useState(null),[Ve,Rt]=y.useState("global"),[os,Hn]=y.useState(!1),[_t,Sn]=y.useState(null),[Qt,Vt]=y.useState(null),[at,Et]=y.useState(()=>localStorage.getItem("chatliz_neon_color")||"#00f3ff"),[hs,xn]=y.useState(()=>localStorage.getItem("chatliz_chat_bg")||""),[wt,rn]=y.useState(()=>localStorage.getItem("chatliz_theme")||"default"),[jn,On]=y.useState(!1),[es,ls]=y.useState(!1),[Vn,de]=y.useState(!1),[sn,Ut]=y.useState(!1),[xs,He]=y.useState(!1),[Us,Ot]=y.useState("privacy");y.useEffect(()=>{const _=()=>{const L=window.location.hash.toLowerCase();L==="#privacy"||L==="#privacidad"?(Ot("privacy"),He(!0)):L==="#terms"||L==="#terminos"?(Ot("terms"),He(!0)):L==="#contact"||L==="#contacto"?(Ot("contact"),He(!0)):(L==="#about"||L==="#nosotros")&&(Ot("about"),He(!0))};return _(),window.addEventListener("hashchange",_),()=>window.removeEventListener("hashchange",_)},[]);const[Un,ln]=y.useState(!1),[An,Nr]=y.useState(null),[ee,ve]=y.useState(!1),[Gt,hn]=y.useState(()=>{try{const _=localStorage.getItem("chatliz_voice_modulator_config");if(_)return JSON.parse(_)}catch{}return{...GA}}),Js=_=>{hn(_);try{localStorage.setItem("chatliz_voice_modulator_config",JSON.stringify(_))}catch{}},[Is,fs]=y.useState(()=>{try{return JSON.parse(localStorage.getItem("chatliz_bell_notifications")||"[]")}catch{return[]}}),[Pr,ra]=y.useState(()=>{try{return JSON.parse(localStorage.getItem("chatliz_my_friends")||"[]")}catch{return[]}}),[Dr,Ks]=y.useState(()=>
4323{try{return JSON.parse(localStorage.getItem("chatliz_pending_friend_reqs")||"[]")}catch{return[]}}),[Yr,ia]=y.useState(()=>{try{return JSON.parse(localStorage.getItem("chatliz_mailbox_items")||"[]")}catch{return[]}}),[Oi,cr]=y.useState(()=>{try{return JSON.parse(localStorage.getItem("chatliz_delegated_admins")||"[]")}catch{return[]}}),[Xn,_s]=y.useState(()=>{try{return JSON.parse(localStorage.getItem("chatliz_banned_admins")||"[]")}catch{return[]}}),Br=((f==null?void 0:f.username)==="Axiss"||(f==null?void 0:f.username)==="AXISS")&&(f==null?void 0:f.role)==="admin"&&((f==null?void 0:f.uid)==="1001"||!(f!=null&&f.uid)),Os=Br||Oi.includes(f==null?void 0:f.username)||(f==null?void 0:f.role)==="admin";y.useEffect(()=>{try{localStorage.setItem("chatliz_bell_notifications",JSON.stringify(Is))}catch{}},[Is]),y.useEffect(()=>{try{localStorage.setItem("chatliz_my_friends",JSON.stringify(Pr))}catch{}},[Pr]),y.useEffect(()=>{try{localStorage.setItem("chatliz_pending_friend_reqs",JSON.stringify(Dr))}catch{}},[Dr]),y.useEffect(()=>{try{localStorage.setItem("chatliz_mailbox_items",JSON.stringify(Yr))}catch{}},[Yr]),y.useEffect(()=>{try{localStorage.setItem("chatliz_delegated_admins",JSON.stringify(Oi))}catch{}},[Oi]),y.useEffect(()=>{try{localStorage.setItem("chatliz_banned_admins",JSON.stringify(Xn))}catch{}},[Xn]),y.useEffect(()=>{const _=L=>{L.detail&&rn(L.detail)};return window.addEventListener("chatliz_theme_changed",_),()=>window.removeEventListener("chatliz_theme_changed",_)},[]),y.useEffect(()=>{f!=null&&f.preferred_theme&&f.preferred_theme!==wt&&(rn(f.preferred_theme),localStorage.setItem("chatliz_theme",f.preferred_theme))},[f==null?void 0:f.preferred_theme]);const[Ha,ws]=y.useState({});y.useEffect(()=>{window.chatlizCustomFrames=Ha,window.dispatchEvent(new Event("chatliz_custom_frames_updated"))},[Ha]);const[ce,Ce]=y.useState(null),[ye,dt]=y.useState(()=>localStorage.getItem("chatliz_rainbow_neon")==="true"),[ut,Yt]=y.useState("global"),Jt=_=>{_!==Ve&&(Yt(Ve),Rt(_))},bs=y.useRef(Ve);y.useEffect(()=>{bs.current=Ve},[Ve]),y.useEffect(()=>{const _=localStorage.getItem("chatliz_user");if(_)try{const L=JSON.parse(_);if(L.username&&L.password){const G=Intl.DateTimeFormat().resolvedOptions().timeZone;W.emit("register_or_login",{...L,timezone:G},ae=>{ae.success&&(p(Be=>({...Be,...L,...ae,countryLanguage:ae.countryLanguage||L.countryLanguage,timezone:G})),ae.gender?h(!0):l(!0)),s(!1)});return}else if(L.googleUid){const G=Intl.DateTimeFormat().resolvedOptions().timeZone;W.emit("google_login",{...L,timezone:G},ae=>{ae.success&&(p(Be=>({...Be,...L,...ae,username:ae.username,countryLanguage:ae.countryLanguage||L.countryLanguage,timezone:G})),ae.gender?h(!0):l(!0)),s(!1)});return}}catch{}else s(!1);s(!1)},[]);const ts={es:{chatGlobal:"Chat Global",online:"En lÃnea",type:"Escribe un mensaje...",send:"Enviar",friends:"Amigos",settings:"Ajustes",search:"Buscar...",profile:"Perfil",unread:"Nuevos"},en:{chatGlobal:"Global Chat",online:"Online",type:"Type a message...",send:"Send",friends:"Friends",
4323settings:"Settings",search:"Search...",profile:"Profile",unread:"New"},pt:{chatGlobal:"Chat Global",online:"Online",type:"Digite uma mensagem...",send:"Enviar",friends:"Amigos",settings:"Configurações",search:"Procurar...",profile:"Perfil",unread:"Novo"},fr:{chatGlobal:"Chat Mondial",online:"En ligne",type:"Tapez un message...",send:"Envoyer",friends:"Amis",settings:"Paramètres",search:"Rechercher...",profile:"Profil",unread:"Nouveau"},de:{chatGlobal:"Globaler Chat",online:"Online",type:"Nachricht eingeben...",send:"Senden",friends:"Freunde",settings:"Einstellungen",search:"Suchen...",profile:"Profil",unread:"Neu"},it:{chatGlobal:"Chat Globale",online:"In linea",type:"Scrivi un messaggio...",send:"Invia",friends:"Amici",settings:"Impostazioni",search:"Cerca...",profile:"Profil",unread:"Nuovo"}},aa=_=>{var G;const L=f.pais_idioma||"es";return((G=ts[L])==null?void 0:G[_])||ts.es[_]||_},[Ls,cs]=y.useState([]),[qa,Sa]=y.useState([]),[wp,Yu]=y.useState(!1),[Po,$a]=y.useState(!1),Lt=y.useRef(null),[Dl,ja]=y.useState({}),[qn,ur]=y.useState([{username:"Elizabeth",statusMessage:"Administradora IA",role:"admin",isAi:!0}]),[ns,Uc]=y.useState({});y.useEffect(()=>{f.username&&ur(_=>{const L=["Sensei","Shadow","Neko"],G=_.filter(We=>!L.includes(We.username));let ae=!1;const Be=[...G];return Be.some(We=>We.username===f.username)||(Be.push(f),ae=!0),Be.some(We=>We.username==="Elizabeth")||(Be.unshift({username:"Elizabeth",statusMessage:"Administradora IA",role:"admin",isAi:!0}),ae=!0),ae?Be:_})},[f.username,f.profilePic,f.role]);const[Xu,Xr]=y.useState(!1),[oa,Ep]=y.useState(!1),[Es,la]=y.useState(!1),[Gc,Li]=y.useState(!1),[pi,Tl]=y.useState([]),[Sl,_n]=y.useState(!1),zo=(_,L="Sistema")=>{fn(G=>[...G,{id:Date.now()+Math.random(),type:L,sender:"Sistema",text:_}])};y.useEffect(()=>{fetch("/api/radio/history").then(L=>L.json()).then(L=>{L!=null&&L.history&&Array.isArray(L.history)&&Tl(L.history)}).catch(L=>console.error("Error fetching radio history:",L));const _=L=>{Array.isArray(L)&&Tl(L)};return W.on("radio_history_update",_),()=>{W.off("radio_history_update",_)}},[]);const[Wu,Ja]=y.useState(!1),[Fo,Hc]=y.useState({}),[Ka,fn]=y.useState([]),[zr,qc]=y.useState([]);y.useEffect(()=>{if(Ka.length>0){const _=setTimeout(()=>fn(L=>L.slice(1)),5e3);return()=>clearTimeout(_)}},[Ka]);const[Mi,ca]=y.useState(!1),Pi=y.useRef(!1);y.useEffect(()=>{Pi.current=Mi},[Mi]);const[jl,$c]=y.useState(10),[Ns,zi]=y.useState(null),Wr=y.useRef(null);y.useEffect(()=>{Wr.current=Ns},[Ns]);const[Qa,Ya]=y.useState(Date.now());y.useEffect(()=>{const _=setInterval(()=>Ya(Date.now()),1e3);return()=>clearInterval(_)},[]);const[ua,Vo]=y.useState([]),[Ht,Xa]=y.useState(null),[da,Wa]=y.useState(!1),Zr=Ve==="global"?Qt:Ve.startsWith("room_")?Ht?{backgroundUrl:Ht.backgroundUrl,backgroundBase64:Ht.backgroundUrl,icon:Ht.logo||Ht.emblem,title:Ht.name,bubbleStyle:Ht.bubbleStyle,theme:Ht.theme,autoCleanMode:Ht.autoCleanMode}:null:_t,ms=(Zr==null?void 0:Zr.backgroundBase64)||(Zr==null?void 0:Zr.backgroundUrl),[Bi,Uo]=y.useState(()=>localStorage.getItem("chatliz_personal_bg"));y.useEffect(()=>{const _=L=>{Uo(L.detail||null)};return window.addEventListener("chatliz_personal_bg_changed",_),()=>window.removeEventListener("chatliz_personal_bg_changed",_)},[]);const Za=Bi!==null?Bi:(f==null?void 0:f.preferred_background)||localStorage.getItem("chatliz_personal_bg");let Al=ms||Za||hs;const[eo,Qs]=y.useState(!1),[to,Go]=y.useState(1),[Aa,B]=y.useState(""),[v,D]=y.useState(""),[z,he]=y.useState(""),[_e,Ye]=y.useState(""),[qt,Ds]=y.useState(""),[bn,Cs]=y.useState(null),[Tr,ha]=y.useState(null),[Fr,ei]=y.useState(null),[Ho,no]=y.useState(!1),$h=y.useRef(!1),[Np,Dp]=y.useState(!1),[Jh,Kh]=y.useState(!1),[Zu,Qh]=y.useState(null),[ed,Tp]=y.useState(null),[Sp,Yv]=y.useState(!1),[xx,jp]=y.useState(!1),[Yh,td]=y.useState(void 0),[bx,nd]=y.useState(!1),[Cx,Xh]=y.useState(!1),Wh=y.useRef(null),Ap=y.useRef(null),gr=y.useRef(null),yx=y.useRef(null),Zh=y.useRef([]),sd=y.useRef(null),Vr=()=>{var _;(_=sd.current)!=null&&_.parentElement&&sd.current.parentElement.scrollTo({top:sd.current.parentElement.scrollHeight,behavior:"auto"})};y.useRef(null);const[vx,rd]=y.useState(!1),Jc=_=>{_.preventDefault(),Jh?Tx():Nx()};y.useEffect(()=>{const _=yx.current;_&&(Sp?_.play().catch(L=>console.log("Autoplay prevented:",L)):_.pause())},[Sp]),y.useEffect(()=>{if(we&&et>0){const _=setTimeout(()=>{Ae(L=>L-1)},1e3);return()=>clearTimeout(_)}},[we,et]);const Kc=y.useRef(null),id=_=>{W.emit("typing",{username:f.username,chat:Ve}),Kc.current&&clearTimeout(Kc.current),Kc.current=setTimeout(()=>{W.emit("stop_typing",{username:f.username,chat:Ve})},2e3)},kp=async()=>{try{const _=new il,G=(await G9(wm,_)).user,ae=Intl.DateTimeFormat().resolvedOptions().timeZone,Be={email:G.email,displayName:G.displayName,photoURL:G.photoURL,googleUid:G.uid,timezone:ae};W.emit("google_login",Be,We=>{We.success?(p({...f,username:We.username,profilePic:We.profilePic,statusMessage:We.statusMessage,role:We.role,countryLanguage:We.countryLanguage||f.countryLanguage,timezone:ae,is_friends_public:We.is_friends_public,friends_list:We.friends_list||[],blocked_list:We.blocked_list||[],gender:We.gender,age:We.age,mood:We.mood}),localStorage.setItem("chatliz_user",JSON.stringify(Be)),We.gender?h(!0):l(!0)):alert(We.error||"Error al iniciar sesión con Google")})}catch(_){console.error("Google Auth Error:",_),_.code==="auth/popup-closed-by-user"||(_.message&&_.message.includes("Cross-Origin")?alert("La ventana de Google está bloqueada por el navegador dentro de esta vista previa. Para usar Google Login, por favor abre la aplicación en una nueva pestaña (haciendo clic en la flecha de la esquina superior derecha)."):alert(`Error al autenticar con Google. Si estás en la vista previa, intenta abrir la app en una pestaña nueva. 4324Detalle: `+_.message))}},Rp=(_,L={})=>
4324{if(_==null||_.preventDefault(),!f.username||!f.password)return;const G=Intl.DateTimeFormat().resolvedOptions().timeZone,ae={...f,...L,timezone:G};W.emit("register_or_login",ae,Be=>{Be.success?(p({...f,profilePic:Be.profilePic,statusMessage:Be.statusMessage,role:Be.role,countryLanguage:Be.countryLanguage||f.countryLanguage,timezone:G,is_friends_public:Be.is_friends_public,friends_list:Be.friends_list||[],blocked_list:Be.blocked_list||[],gender:Be.gender,age:Be.age,mood:Be.mood,preferred_background:Be.preferred_background}),localStorage.setItem("chatliz_user",JSON.stringify(ae)),Be.gender?h(!0):l(!0)):alert(Be.error||"Error al iniciar sesión")})},ef=_=>{W.emit("broadcast_profile_change",{username:f.username,statusMessage:_.statusMessage,profilePic:f.profilePic,frameId:f.frameId,gender:_.gender,mood:_.mood,countryLanguage:_.countryLanguage,is_friends_public:_.is_friends_public}),p(L=>({...L,..._})),l(!1),h(!0)};y.useEffect(()=>{if(!u)return;const _=()=>{f.username&&(f.googleUid?W.emit("google_login",{email:f.securityEmail,displayName:f.username,photoURL:f.profilePic,googleUid:f.googleUid,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},()=>{}):W.emit("reconnect_user",{username:f.username}))};W.on("connect",_);let L=null;if(cs([]),Ve==="global"){const G=li(zs(ft,"global_chat"),nh("timestamp","asc"),WC(1e3));L=Cr(G,ae=>{const Be=ae.docs.map(X=>{const Te=X.data();return{...Te,id:Te.id||X.id,docId:X.id}}),We=Be.filter(X=>!(X.sender==="Elizabeth"&&(Pi.current||Wr.current)));cs(We),Be.length>=20&&!$h.current&&($h.current=!0,W.emit("clean_global_room_keep_last",()=>{setTimeout(()=>{$h.current=!1},3e3)})),setTimeout(Vr,100)})}else if(Ve.startsWith("room_")){const G=li(zs(ft,"custom_rooms_msgs",Ve,"messages"),nh("timestamp","asc"),WC(500));L=Cr(G,ae=>{const Be=ae.docs.map(We=>{const X=We.data();return{...X,id:X.id||We.id,docId:We.id}});cs(Be),setTimeout(Vr,100)})}else{const ae=[f.username,Ve].sort().join("_"),Be=li(zs(ft,"chats",ae,"messages"),nh("timestamp","asc"),WC(1e3));L=Cr(Be,We=>{const X=We.docs.map(Te=>{const te=Te.data();return{...te,id:te.id||Te.id,docId:Te.id}});cs(X),setTimeout(Vr,100)})}return()=>{W.off("connect",_),L&&L()}},[u,Ve,f.username]),y.useEffect(()=>{let _="";const L=(te,fe)=>{if(!te)return;const qe=te.config||te.appearance||te.payload||te;if(!qe)return;const Nt=JSON.stringify({bg:qe.backgroundBase64||qe.backgroundUrl||te.url,theme:qe.theme,icon:qe.icon,title:qe.title,status:qe.statusMessage,bubble:qe.bubbleStyle,ts:te.timestamp||qe.updatedAt});if(Nt===_)return;_=Nt,console.log(`[Appearance Sync] Immediate cross-chat update applied from ${fe}:`,qe),Vt(yt=>({...yt||{},...qe}));const nt=qe.backgroundBase64||qe.backgroundUrl||te.url||te.background;if(nt){xn(nt);try{localStorage.setItem("chatliz_chat_bg",nt)}catch{}if(!nt.match(/\.(mp4|webm|ogg)$/i)&&!nt.startsWith("data:video")){const yt=new Image;yt.src=nt}}else if(qe.backgroundBase64===""&&qe.backgroundUrl===""){xn("");try{localStorage.removeItem("chatliz_chat_bg")}catch{}}if(qe.theme){rn(qe.theme);try{localStorage.setItem("chatliz_theme",qe.theme)}catch{}window.dispatchEvent(new CustomEvent("chatliz_theme_changed",{detail:qe.theme}));const yt={cyan:"#00f3ff",purple:"#c084fc",emerald:"#34d399",pink:"#f472b6",amber:"#fbbf24",red:"#f87171"};if(yt[qe.theme]){Et(yt[qe.theme]);try{localStorage.setItem("chatliz_neon_color",yt[qe.theme])}catch{}}}zo(`ð¨ Apariencia de ${fe} sincronizada al instante`,"Apariencia")},G=te=>{if(!te)return!1;const fe=String(te.message||""),qe=te.code;return qe===13||qe==="13"||fe.includes("rst_stream")||fe.includes("RST_STREAM")||fe.includes("Stream closed")||fe.includes("UNAVAILABLE")},ae=Cr(Tn(ft,"system_updates","appearance_for_Axiss"),te=>{te.exists()&&L(te.data(),"Axiss")},te=>{G(te)||console.warn("Listener system_updates/appearance_for_Axiss note:",te)}),Be=Cr(Tn(ft,"system_updates","appearance_for_axis"),te=>{te.exists()&&L(te.data(),"Axis")},te=>{G(te)||console.warn("Listener system_updates/appearance_for_axis note:",te)}),We=Cr(Tn(ft,"system_updates","appearance_for_Axis"),te=>{te.exists()&&L(te.data(),"Axis")},te=>{G(te)||console.warn("Listener system_updates/appearance_for_Axis note:",te)}),X=Cr(Tn(ft,"system_updates","appearance_for_chatliz"),te=>{te.exists()&&L(te.data(),"ChatLiz (Hugging Face)")},te=>{G(te)||console.warn("Listener system_updates/appearance_for_chatliz note:",te)}),Te=Cr(Tn(ft,"settings","global_chat_config"),te=>{te.exists()&&L(te.data(),"Chat Global")},te=>{G(te)||console.warn("Listener settings/global_chat_config note:",te)});return()=>{ae(),Be(),We(),X(),Te()}},[]),y.useEffect(()=>{if(!u)return;W.emit("get_chat_config","global",fe=>{fe&&Vt(fe)});const _=fe=>{if(fe.chat==="global"){Vt(fe.config);const qe=fe.config.backgroundBase64||fe.config.backgroundUrl;if(qe){xn(qe);try{localStorage.setItem("chatliz_chat_bg",qe)}catch{}}if(fe.config.theme){rn(fe.config.theme);try{localStorage.setItem("chatliz_theme",fe.config.theme)}catch{}window.dispatchEvent(new CustomEvent("chatliz_theme_changed",{detail:fe.config.theme}))}}else{const Nt=[f.username,Ve].sort().join("_");fe.chat===Nt&&Sn(fe.config)}},L=fe=>{if(fe!=null&&fe.config){Vt(fe.config);const qe=fe.config.backgroundBase64||fe.config.backgroundUrl;if(qe){xn(qe);try{localStorage.setItem("chatliz_chat_bg",qe)}catch{}}if(fe.config.theme){rn(fe.config.theme);try{localStorage.setItem("chatliz_theme",fe.config.theme)}catch{}window.dispatchEvent(new CustomEvent("chatliz_theme_changed",{detail:fe.config.theme}))}}},G=fe=>{console.log("[Limpiador de Sala Global] Chat global limpiado a 20 mensajes:",fe)},ae=fe=>{Vt(qe=>({...qe||{},backgroundBase64:fe,backgroundUrl:fe})),xn(fe);try{localStorage.setItem("chatliz_chat_bg",fe)}catch{}},Be=fe=>{ur(qe=>qe.map(Nt=>Nt.username===fe.username?{...Nt,...fe}:Nt)),fe.username===f.username&&p(qe=>({...qe,...fe}))},We=fe=>{(fe==null?void 0:fe.aiUsername)==="Elizabeth"&&(fe!=null&&fe.voiceConfig)&&OD(fe.voiceConfig)},X=fe=>{(fe==null?void 0:fe.roomId)===Ve&&Xa(fe.room)},Te=fe=>{(fe==null?void 0:fe.roomId)===Ve&&cs([])},te=fe=>{(fe==null?void 0:fe.roomId)===Ve&&(cs(qe=>
4324qe.some(Nt=>{var nt;return Nt.id===((nt=fe.msg)==null?void 0:nt.id)})?qe:[...qe,fe.msg]),setTimeout(Vr,100))};return W.on("chat_config_updated",_),W.on("global_bg_updated",ae),W.on("user_profile_updated",Be),W.on("sync_appearance_to_axis",L),W.on("global_chat_cleaned",G),W.on("ai_voice_config_updated",We),W.on("custom_room_updated",X),W.on("custom_room_cleaned",Te),W.on("receive_custom_room",te),()=>{W.off("chat_config_updated",_),W.off("global_bg_updated",ae),W.off("user_profile_updated",Be),W.off("sync_appearance_to_axis",L),W.off("global_chat_cleaned",G),W.off("ai_voice_config_updated",We),W.off("custom_room_updated",X),W.off("custom_room_cleaned",Te),W.off("receive_custom_room",te)}},[u,Ve,f.username]),y.useEffect(()=>{if(!Ve||Ve==="global"||Ve.startsWith("room_")||!f.username){Sn(null);return}const L=[f.username,Ve].sort().join("_"),G=Cr(Tn(ft,"chats",L,"config","settings"),ae=>{ae.exists()?Sn(ae.data()):Sn(null)},ae=>{console.warn("Private chat config listener note:",ae)});return W.emit("get_chat_config",L,ae=>{ae&&Sn(ae)}),()=>G()},[Ve,f.username]);const tf=async _=>{if(Ve==="global"){try{await wa(Tn(ft,"settings","global_chat_config"),_,{merge:!0}),(_.backgroundBase64||_.backgroundUrl)&&await wa(Tn(ft,"settings","globalBg"),{url:_.backgroundBase64||_.backgroundUrl||""},{merge:!0})}catch(L){console.warn("Saving to Firestore fallback:",L)}W.emit("update_chat_config",{chat:"global",config:_}),Vt(_)}else{const G=[f.username,Ve].sort().join("_");try{await wa(Tn(ft,"chats",G,"config","settings"),_,{merge:!0})}catch(ae){console.warn("Saving private config to Firestore fallback:",ae)}W.emit("update_chat_config",{chat:G,config:_}),Sn(_)}},Ip=async()=>{if(Ve==="global"){try{await am(Tn(ft,"settings","global_chat_config")),await am(Tn(ft,"settings","globalBg"))}catch{}const _={backgroundBase64:"",backgroundUrl:"",icon:"",theme:"cyan",title:"Chat Global",statusMessage:"",bubbleStyle:"default"};W.emit("update_chat_config",{chat:"global",config:_}),Vt(null)}else{const L=[f.username,Ve].sort().join("_");try{await am(Tn(ft,"chats",L,"config","settings"))}catch{}const G={backgroundBase64:"",backgroundUrl:"",icon:"",theme:"cyan",title:"",statusMessage:"",bubbleStyle:"default"};W.emit("update_chat_config",{chat:L,config:G}),Sn(null)}};y.useEffect(()=>{if(!u)return;W.on("dj_request_status",X=>{Sa(Te=>[{id:Date.now().toString(),text:X.status==="accepted"?`Tu canción "${X.title}" ha sido aceptada y está en cola.`:`Tu canción "${X.title}" no cumple con las normas (contenido inapropiado/fuera de contexto).`,read:!1,type:X.status},...Te])}),W.on("message_reaction",X=>{cs(Te=>Te.map(te=>{if(te.id&&te.id===X.msgId||te.docId&&te.docId===X.docId){const fe=te.reactions||{},qe=Array.isArray(fe[X.emoji])?fe[X.emoji]:[];if(!qe.includes(X.username))return{...te,reactions:{...fe,[X.emoji]:[...qe,X.username]}}}return te}))}),W.on("receive_global",X=>{bs.current==="global"&&(X.sender!==f.username||X.sender==="Elizabeth"||X.isAi)&&(cs(Te=>Te.some(fe=>fe.id===X.id)?Te:[...Te,X].slice(-15)),setTimeout(Vr,100),(X.sender==="Elizabeth"||X.isAi)&&X.text&&km().autoPlay&&ro(X.id||Date.now().toString(),X.text,X.audio||X.audioBase64))}),W.on("user_liked",X=>{e(),fs(Te=>[{id:`${Date.now()}_like_${X}`,type:"like",sender:X,text:`A ${X} le gustó tu perfil`,timestamp:Date.now(),read:!1},...Te.filter(te=>!(te.type==="like"&&te.sender===X))]),fn(Te=>[...Te,{id:Date.now(),type:"Me Gusta",sender:X,text:`¡A ${X} le ha gustado tu perfil!`}])}),W.on("user_like_received",X=>{e(),fs(Te=>[{id:X.id||`${Date.now()}_like_${X.from}`,type:"like",sender:X.from,senderPic:X.fromPic,text:`A ${X.from} le gustó tu perfil`,timestamp:X.timestamp||Date.now(),read:!1},...Te.filter(te=>!(te.type==="like"&&te.sender===X.from))]),fn(Te=>[...Te,{id:Date.now(),type:"Me Gusta",sender:X.from,text:`¡A ${X.from} le ha gustado tu perfil!`}])}),W.on("new_profile_comment",X=>{e(),fs(Te=>{var te;return[{id:`${Date.now()}_comment_${X.fromUser}`,type:"profile_comment",sender:X.fromUser,text:`${X.fromUser} comentó en tu perfil: "${((te=X.comment)==null?void 0:te.text)||""}"`,timestamp:Date.now(),read:!1},...Te]}),fn(Te=>
4324[...Te,{id:Date.now(),type:"Comentario",sender:X.fromUser,text:`${X.fromUser} comentó en tu perfil.`}])}),W.on("tokens_updated",X=>{p(Te=>({...Te,aiTokens:X.tokens,lizCoins:X.tokens}))}),W.on("monetization_stats_updated",X=>{X&&X.stats&&At(Te=>({...Te,...X.stats,userEarnings:X.userEarnings||Te.userEarnings||{}}))}),W.on("out_of_tokens",X=>{const Te=(X==null?void 0:X.aiName)||bs.current||"Elizabeth";De(Te),p(te=>({...te,aiTokens:0,lizCoins:0}))}),W.on("receive_private",(X,Te)=>{bs.current!==Te?(e(),Hc(te=>({...te,[Te]:!0})),Sa(te=>[{id:Date.now().toString(),type:"private_message",text:`Nuevo mensaje de ${Te}`,fromUser:Te,read:!1,timestamp:Date.now()},...te]),fs(te=>[{id:Date.now().toString(),type:"private_msg",sender:Te,text:X.text||"Mensaje privado recibido",timestamp:Date.now(),read:!1},...te]),ia(te=>[{id:Date.now().toString(),type:"private_chat",sender:Te,text:X.text||"Mensaje privado recibido",timestamp:Date.now(),read:!1},...te]),fn(te=>[...te,{id:Date.now(),type:"PM",sender:Te,text:X.text||"Nuevo audio/imagen"}])):(cs(te=>te.some(fe=>fe.id===X.id)?te:[...te,X]),setTimeout(Vr,100),(X.sender==="Elizabeth"||X.isAi)&&X.text&&km().autoPlay&&ro(X.id||Date.now().toString(),X.text,X.audio||X.audioBase64))}),W.on("message",X=>{if(X&&X.sender&&X.sender!==f.username){const Te=(f.username||"").toLowerCase(),te=(X.text||"").toLowerCase();Te&&(te.includes(`@${Te}`)||te.includes(Te))&&(ia(fe=>[{id:`${Date.now()}_${X.sender}`,type:"mention",sender:X.sender,senderPic:X.senderPic,room:bs.current||"global",roomTitle:bs.current==="global"?"Sala Global":bs.current,text:X.text||"",timestamp:Date.now(),read:!1},...fe]),fn(fe=>[...fe,{id:Date.now(),type:"Mención",sender:X.sender,text:`${X.sender} te mencionó en el chat.`}]))}}),W.on("friend_request_received",X=>{var te;(te=f.friends_list)!=null&&te.includes(X.from)||Pr.some(fe=>fe.username===X.from)||(e(),Ks(fe=>fe.some(qe=>qe.id===X.id||qe.from===X.from)?fe:[X,...fe]),fs(fe=>[{id:X.id||`${Date.now()}_fr_${X.from}`,type:"friend_request",sender:X.from,senderPic:X.fromPic,text:"Te envió una solicitud de amistad",timestamp:X.timestamp||Date.now(),read:!1},...fe.filter(qe=>!(qe.type==="friend_request"&&qe.sender===X.from))]),fn(fe=>[...fe,{id:Date.now(),type:"Amigo",sender:X.from,text:`${X.from} te envió una solicitud de amistad.`}]))}),W.on("friend_request_status",X=>{Ks(Te=>Te.filter(te=>te.from!==X.from)),X.status==="accepted"?(ra(Te=>Te.some(te=>te.username===X.from)?Te:[{username:X.from,addedAt:Date.now()},...Te]),p(Te=>{const te=Te.friends_list||[],fe=te.includes(X.from)?te:[...te,X.from];return{...Te,friends_list:fe,friend_requests:(Te.friend_requests||[]).filter(qe=>qe!==X.from)}}),fs(Te=>[{id:Date.now().toString(),type:"friend_accepted",sender:X.from,text:"Solicitud de amistad aceptada",timestamp:Date.now(),read:!1},...Te.filter(te=>!(te.type==="friend_request"&&te.sender===X.from))]),fn(Te=>[...Te,{id:Date.now(),type:"Amigo",sender:X.from,text:`¡${X.from} aceptó tu solicitud de amistad!`}])):fs(Te=>[{id:Date.now().toString(),type:"friend_rejected",sender:X.from,text:"Solicitud de amistad rechazada",timestamp:Date.now(),read:!1},...Te.filter(te=>!(te.type==="friend_request"&&te.sender===X.from))])}),W.on("user_like_received",X=>{fs(Te=>Te.some(te=>(te.type==="heart"||te.type==="like")&&te.sender===X.from&&Date.now()-te.timestamp<2e4)?Te:[{id:`${Date.now()}_${X.from}`,type:X.type||"heart",sender:X.from,senderPic:X.fromPic,timestamp:Date.now(),read:!1},...Te]),fn(Te=>[...Te,{id:Date.now(),type:"Like",sender:X.from,text:X.type==="heart"?`${X.from} te envió un â¤ï¸`:`${X.from} le dio like a tu perfil.`}])}),W.emit("get_hall_of_fame",X=>{Vo(X)}),W.emit("request_initial_state"),W.on("llamada_entrante",X=>{on(X)}),W.on("llamada_cancelada",()=>{on(null)}),W.on("respuesta_llamada",X=>{X.accepted?(Fn(null),nn({partner:{username:X.responder,profilePic:X.profilePic},isInitiator:!0})):Fn(null)}),W.on("call_ended",()=>{nn(null)}),W.on("banned_status",X=>{ne(X.isBanned),X.isBanned?alert("Has sido baneado. No podrás escribir."):alert("Has sido desbaneado.")}),W.on("global_bg_updated",X=>{xn(X),localStorage.setItem("chatliz_chat_bg",X)}),W.on("all_custom_frames",X=>{ws(X||{})}),W.on("custom_frame_updated",X=>{ws(Te=>({...Te,[X.id]:X.url}))}),W.on("system_message",X=>{((f==null?void 0:f.username)==="AXISS"||(f==null?void 0:f.username)==="Axiss")&&cs(te=>[...te,{id:Date.now().toString(),text:X.text,sender:"Sistema",timestamp:new Date().toISOString()}])}),W.on("update_user_info",X=>{X.username===f.username&&p(Te=>({...Te,...X}))}),W.on("username_updated",X=>{f.username===X.oldUsername&&p(Te=>{const te={...Te,username:X.newUsername,uid:X.uid||Te.uid};return localStorage.setItem("chatliz_user",JSON.stringify(te)),te})}),W.on("active_users",X=>{W.emit("check_pending_calls");const Te=["Sensei","Shadow","Neko"],fe=[...X.filter(Nt=>!Te.includes(Nt.username))];f.username&&!fe.some(Nt=>Nt.username===f.username)&&fe.push(f),fe.some(Nt=>Nt.username==="Elizabeth")||fe.unshift({username:"Elizabeth",statusMessage:"Administradora IA",role:"admin",isAi:!0}),ur(fe),Uc(Nt=>{const nt={...Nt};
4324return X.forEach(yt=>{var ot;nt[yt.username]={...nt[yt.username],...yt,profilePic:yt.profilePic||((ot=nt[yt.username])==null?void 0:ot.profilePic)}}),nt});const qe=X.find(Nt=>Nt.username===f.username);qe&&p(Nt=>({...Nt,...qe}))}),W.on("global_chat_cleared",()=>{cs([])}),W.on("chess_invite_accepted",X=>{ur(Te=>{const te=Te.find(fe=>fe.username===X.opponent)||{username:X.opponent,elo:0};return zi({id:X.gameId,opponent:te,bet:X.bet,isHost:!0}),Te})}),W.on("typing",X=>{const Te=X.chat===f.username?X.username:X.chat;ja(te=>{const fe=te[Te]||[];return fe.includes(X.username)?te:{...te,[Te]:[...fe,X.username]}}),setTimeout(()=>{ja(te=>{const fe=te[Te]||[];return fe.includes(X.username)?{...te,[Te]:fe.filter(qe=>qe!==X.username)}:te})},4e3)}),W.on("stop_typing",X=>{const Te=X.chat===f.username?X.username:X.chat;ja(te=>{const fe=te[Te]||[];return{...te,[Te]:fe.filter(qe=>qe!==X.username)}})});let _=null,L=null,G=null,ae=null;const Be=()=>{ae&&ae(),_&&_(),L&&L(),G&&G();const X=li(zs(ft,"userChats",f.username,"chats"),nh("updatedAt","desc"));ae=Cr(X,te=>{const fe=te.docs.map(qe=>({id:qe.id,...qe.data()}));qc(fe)});const Te=li(zs(ft,"notifications"),_a("recipientUid","==",f.username));G=Cr(Te,te=>{const fe=te.docs.map(nt=>({id:nt.id,...nt.data()}));console.log("Notificaciones recibidas:",fe);const qe=te.docs.map(nt=>{const yt=nt.data();let ot=yt.message||yt.text||"";return ot||(yt.type==="LIKE"||yt.type==="like"?ot=`${yt.senderName} le ha dado Like a tu perfil.`:yt.type==="REQUEST"||yt.type==="friend_request"?ot=`${yt.senderName} te ha enviado una solicitud de amistad.`:yt.type==="MESSAGE"?ot=`Nuevo mensaje de ${yt.senderName}.`:ot=`Notificación de ${yt.senderName}`),{...yt,id:nt.id,text:ot,read:yt.isRead,type:yt.type==="LIKE"?"like":yt.type==="REQUEST"?"friend_request":yt.type}}),Nt=Lp(f.username);qe.forEach(nt=>{if(!nt.read&&!Nt.has(nt.id)){const yt=nt.senderName||nt.from||"Usuario";if(nt.type==="like"||nt.type==="LIKE"||nt.type==="heart"){if(Nt.has(`like_${yt}`))return;fs(ot=>ot.some(Ln=>Ln.id===nt.id||Ln.type==="like"&&Ln.sender===yt)?ot:[{id:nt.id,type:"like",sender:yt,text:nt.text,timestamp:nt.timestamp||Date.now(),read:!1},...ot])}else if(nt.type==="friend_request"||nt.type==="REQUEST"){if((f.friends_list||[]).includes(yt)||Pr.some(Ln=>Ln.username===yt)||Nt.has(`fr_${yt}`)){ft&&nt.id&&!nt.id.startsWith("local_")&&oi(Tn(ft,"notifications",nt.id),{isRead:!0}).catch(()=>{});return}Ks(Ln=>Ln.some(dr=>dr.from===yt)?Ln:[{id:nt.id,from:yt,timestamp:nt.timestamp||Date.now()},...Ln]),fs(Ln=>Ln.some(dr=>dr.id===nt.id||dr.type==="friend_request"&&dr.sender===yt)?Ln:[{id:nt.id,type:"friend_request",sender:yt,text:nt.text,timestamp:nt.timestamp||Date.now(),read:!1},...Ln])}else(nt.type==="MESSAGE"||nt.type==="private_msg")&&(ia(ot=>ot.some(Ln=>Ln.id===nt.id)?ot:[{id:nt.id,type:"private_chat",sender:yt,text:nt.text,timestamp:nt.timestamp||Date.now(),read:!1},...ot]),fs(ot=>ot.some(Ln=>Ln.id===nt.id)?ot:[{id:nt.id,type:"private_msg",sender:yt,text:nt.text,timestamp:nt.timestamp||Date.now(),read:!1},...ot]))}})}),_=Cr(Tn(ft,"users",f.username),te=>{if(te.exists()){const fe=te.data();p(qe=>({...qe,...fe})),ur(qe=>qe.find(nt=>nt.username===f.username)?qe.map(nt=>nt.username===f.username?{...nt,...fe}:nt):qe)}},te=>{!((te==null?void 0:te.code)===13||(te==null?void 0:te.code)==="13"||String((te==null?void 0:te.message)||"").includes("rst_stream")||String((te==null?void 0:te.message)||"").includes("RST_STREAM")||String((te==null?void 0:te.message)||"").includes("Stream closed"))&&(te==null?void 0:te.code)!=="permission-denied"&&console.warn("Aviso reconexión unsubUser:",(te==null?void 0:te.message)||te),(te==null?void 0:te.code)!=="permission-denied"&&setTimeout(Be,4e3)}),L=Cr(zs(ft,"users"),te=>{const fe={};
4324te.docChanges().forEach(qe=>{if(qe.type==="modified"||qe.type==="added"){const Nt=qe.doc.data(),nt=Nt.username||qe.doc.id;fe[nt]={...Nt,username:nt}}}),Object.keys(fe).length>0&&(Uc(qe=>({...qe,...fe})),ur(qe=>{let Nt=[...qe],nt=!1;for(const yt in fe){const ot=fe[yt],Ln=Nt.findIndex(dr=>dr.username===yt);Ln!==-1&&(Nt[Ln]={...Nt[Ln],...ot},nt=!0)}return nt?Nt:qe}))},te=>{!((te==null?void 0:te.code)===13||(te==null?void 0:te.code)==="13"||String((te==null?void 0:te.message)||"").includes("rst_stream")||String((te==null?void 0:te.message)||"").includes("RST_STREAM")||String((te==null?void 0:te.message)||"").includes("Stream closed"))&&(te==null?void 0:te.code)!=="permission-denied"&&console.warn("Aviso reconexión unsubscribe:",(te==null?void 0:te.message)||te),(te==null?void 0:te.code)!=="permission-denied"&&setTimeout(Be,4e3)})},We=_9(wm,X=>{X||g9(wm).catch(Te=>console.warn(Te))});return f.username&&Be(),()=>{W.off("receive_global"),W.off("message_reaction"),W.off("receive_private"),W.off("active_users"),L&&L(),_&&_(),typeof G=="function"&&G(),typeof ae=="function"&&ae(),We()}},[u,f.username]);const Gs=()=>{Yu(!1),Xr(!1),Ja(!1),zn(!1),b(!1),U(!1),V(null),Q(!1),ca(!1),jp(!1),nd(!1),Xh(!1),On(!1),ls(!1),de(!1),Ut(!1),N(!1)},Op=_=>{Br&&(cr(L=>L.includes(_)?L:[...L,_]),fn(L=>[...L,{id:Date.now(),type:"Admin",sender:"Sistema",text:`ð ${_} ha sido nombrado Administrador.`}]))},_x=_=>{if(Br){if(_==="AXISS"||_==="Axiss"){alert("â ï¸ No es posible quitar a un Administrador Principal.");return}cr(L=>L.filter(G=>G!==_)),fn(L=>[...L,{id:Date.now(),type:"Admin",sender:"Sistema",text:`Se removieron los permisos de administrador a ${_}.`}])}},wx=_=>{if(Br){if(_==="AXISS"||_==="Axiss"){alert("â ï¸ No es posible bloquear a un Administrador Principal.");return}cr(L=>L.filter(G=>G!==_)),_s(L=>L.includes(_)?L:[...L,_]),W.emit("ban_user",{username:_}),fn(L=>[...L,{id:Date.now(),type:"Admin",sender:"Sistema",text:`ð« ${_} ha sido bloqueado.`}])}},Ex=_=>{Br&&(_s(L=>L.filter(G=>G!==_)),W.emit("unban_user",{username:_}),fn(L=>[...L,{id:Date.now(),type:"Admin",sender:"Sistema",text:`â
${_} ha sido desbloqueado.`}]))},Lp=_=>{try{const L=localStorage.getItem(`chatliz_handled_notifs_${_}`);return L?new Set(JSON.parse(L)):new Set}catch{return new Set}},ad=(_,L)=>{if(f!=null&&f.username)try{const G=Lp(f.username);_&&G.add(_),L&&G.add(L);const ae=Array.from(G).slice(-300);localStorage.setItem(`chatliz_handled_notifs_${f.username}`,JSON.stringify(ae))}catch{}},ti=()=>{if(fs([]),Is.forEach(_=>{ad(_.id,_.sender),ft&&_.id&&!_.id.startsWith("local_")&&oi(Tn(ft,"notifications",_.id),{isRead:!0}).catch(()=>{})}),ft&&(f!=null&&f.username)){const _=li(zs(ft,"notifications"),_a("recipientUid","==",f.username));Cm(_).then(L=>{L.forEach(G=>{oi(G.ref,{isRead:!0}).catch(()=>{})})}).catch(()=>{})}},Qc=_=>{fs(L=>L.filter(G=>G.id!==_)),ad(_),ft&&_&&!_.startsWith("local_")&&oi(Tn(ft,"notifications",_),{isRead:!0}).catch(()=>{})},nf=_=>{try{localStorage.setItem("chatliz_app_default_bg",_),Vt(L=>({...L,backgroundUrl:_,backgroundBase64:_})),W.emit("change_global_chat_config",{backgroundUrl:_,backgroundBase64:_}),ft&&wa(Tn(ft,"settings","globalBg"),{url:_,updatedAt:Date.now()},{merge:!0}).catch(()=>{}),window.dispatchEvent(new Event("chatliz_ui_update"))}catch(L){console.error("Error setting global background:",L)}},sf=_=>{if(Ks(L=>L.filter(G=>G.id!==_.id&&G.from!==_.from)),fs(L=>L.filter(G=>!(G.type==="friend_request"&&(G.sender===_.from||G.id===_.id)))),ra(L=>L.some(G=>G.username===_.from)?L:[{username:_.from,profilePic:_.fromPic,addedAt:Date.now()},...L]),p(L=>{const G=L.friends_list||[],ae=G.includes(_.from)?G:[...G,_.from];return{...L,friends_list:ae,friend_requests:(L.friend_requests||[]).filter(Be=>Be!==_.from)}}),ad(_.id,`fr_${_.from}`),W.emit("respond_friend_request",{to:_.from,from:f.username,status:"accepted"}),W.emit("accept_friend_request",_.from),ft){_.id&&!_.id.startsWith("local_")&&oi(Tn(ft,"notifications",_.id),{isRead:!0}).catch(()=>{});const L=li(zs(ft,"friendRequests"),_a("from","==",_.from),_a("to","==",f.username));Cm(L).then(G=>{G.forEach(ae=>{oi(ae.ref,{status:"accepted",isRead:!0}).catch(()=>{})})}).catch(()=>{})}fn(L=>[...L,{id:Date.now(),type:"Amigo",sender:_.from,text:`¡Ahora eres amigo de ${_.from}!`}])},Mp=_=>{if(Ks(L=>L.filter(G=>G.id!==_.id&&G.from!==_.from)),fs(L=>L.filter(G=>!(G.type==="friend_request"&&(G.sender===_.from||G.id===_.id)))),p(L=>({...L,friend_requests:(L.friend_requests||[]).filter(G=>G!==_.from)})),ad(_.id,`fr_${_.from}`),W.emit("respond_friend_request",{to:_.from,from:f.username,status:"rejected"}),ft){_.id&&!_.id.startsWith("local_")&&oi(Tn(ft,"notifications",_.id),{isRead:!0}).catch(()=>{});const L=li(zs(ft,"friendRequests"),_a("from","==",_.from),_a("to","==",f.username));Cm(L).then(G=>{G.forEach(ae=>{oi(ae.ref,{status:"rejected",isRead:!0}).catch(()=>{})})}).catch(()=>{})}},rf=_=>{ra(L=>L.filter(G=>G.username!==_)),p(L=>({...L,friends_list:(L.friends_list||[]).filter(G=>G!==_)})),W.emit("remove_friend",_)},af=_=>{const L=qn.find(G=>G.username.toLowerCase()===_.toLowerCase());L?V(L):W.emit("get_user_info",{username:_},G=>{G!=null&&G.user?V(G.user):V({username:_})})},Yc=_=>{Jt(_),Gs()}
4324,[kl,Fi]=y.useState(null),[od,so]=y.useState(null),Rl=y.useRef(null),[Xc,Hs]=y.useState(null),ro=(_,L,G)=>{if(Xc===_){th(),Hs(null);return}if(Hs(_),G&&G.length>50)try{const ae=new Audio(G);ae.onplay=()=>Hs(_),ae.onended=()=>Hs(null),ae.onerror=()=>{LC(L,void 0,{onStart:()=>Hs(_),onEnd:()=>Hs(null),onError:()=>Hs(null)})},ae.play().catch(()=>{LC(L,void 0,{onStart:()=>Hs(_),onEnd:()=>Hs(null),onError:()=>Hs(null)})});return}catch{}LC(L,void 0,{onStart:()=>Hs(_),onEnd:()=>Hs(null),onError:()=>Hs(null)})},of=async(_,L,G)=>{if(so(null),n(G),cs(ae=>ae.map(Be=>{if(Be.id&&Be.id===_||Be.docId&&Be.docId===L){const We=Be.reactions||{},X=Array.isArray(We[G])?We[G]:[];if(!X.includes(f.username))return{...Be,reactions:{...We,[G]:[...X,f.username]}}}return Be})),L)try{const ae=Tn(ft,"globalMessages",L);(await NF(ae)).exists()&&await oi(ae,{[`reactions.${G}`]:og(f.username)})}catch(ae){console.error("Error updating reaction in Firestore:",ae)}W&&W.emit("message_reaction",{msgId:_,emoji:G,activeChat:Ve,docId:L,username:f.username})},Il=_=>{Ue(_||Ve||"Elizabeth"),$e(!0),Ae(5)},io=_=>{const L=_||ge||Ve||"Elizabeth";try{typeof window<"u"&&window.open("https://motionless-bus.com/bL3TVK0.Pu3HpZvOb_mRVEJkZODt0K3kNODJc/zIMUT/QH1uLaTqcW0cNMz/MFxgN/DKkm","_blank")}catch(G){console.warn("Popup error:",G)}W.emit("claim_reward_tokens",{aiName:L}),p(G=>({...G,aiTokens:50,lizCoins:50})),De(null),Ue(null),$e(!1),fn(G=>[...G,{id:Date.now()+Math.random(),type:"Tokens",sender:"Sistema",text:`⡠¡Tokens recargados con éxito! (+50 tokens para seguir hablando con ${L})`}])},lf=()=>{var X;const _=!!(Ve&&(VB[Ve]||Ve==="Elizabeth")),L=f.aiTokens??f.lizCoins??50;if(_&&L<1){Il(Ve);return}const G=((X=Lt.current)==null?void 0:X.value)||"";if(!G.trim()&&!bn&&!ed&&!Tr&&!Fr)return;const ae=Date.now().toString()+Math.random().toString(36).substr(2,5),Be={text:G,id:ae};bn&&(Be.image=bn),Tr&&(Be.image=Tr),Fr&&(Fr.type.startsWith("video/")?Be.video=Fr.url:Be.file=Fr),ed&&(Be.audio=ed),kl&&(Be.replyTo={id:kl.id,sender:kl.sender,text:kl.text});const We={...Be,sender:f.username,senderId:f.username,timestamp:Date.now(),createdAt:Date.now()};Ve==="global"?(cs(Te=>[...Te,We]),setTimeout(Vr,100),W.emit("send_global",Be)):Ve.startsWith("room_")?(cs(Te=>[...Te,We]),setTimeout(Vr,100),W.emit("send_custom_room",{roomId:Ve,msg:Be})):(cs(Te=>[...Te,We]),setTimeout(Vr,100),W.emit("send_private",Be,Ve,Te=>{Te&&!Te.success?alert(Te.error||"Error al enviar el mensaje."):BB(Ve,"MESSAGE",f.username)})),W.emit("stop_typing",{username:f.username,chat:Ve}),Kc.current&&clearTimeout(Kc.current),gr.current&&gr.current.state!=="inactive"&&(gr.current.onstop=null,gr.current.stop()),Zu&&Zu.getTracks().forEach(Te=>Te.stop()),Kh(!1),Qh(null),Lt.current&&(Lt.current.value=""),Cs(null),ha(null),Tp(null),Dp(!1),Fi(null)},Pp=_=>{var G;const L=(G=_.target.files)==null?void 0:G[0];if(L){if(L.size>5*1024*1024){alert("El archivo es demasiado grande (máx 5MB).");return}const ae=new FileReader;ae.onload=Be=>{var We;ei({name:L.name,type:L.type,url:(We=Be.target)==null?void 0:We.result})},ae.readAsDataURL(L)}},zp=_=>{var G;const L=(G=_.target.files)==null?void 0:G[0];if(L){const ae=new FileReader;ae.onload=Be=>{var X;const We=new Image;We.onload=()=>{const Te=document.createElement("canvas");let te=We.width,fe=We.height;const qe=1e3;te>fe?te>qe&&(fe*=qe/te,te=qe):fe>qe&&(te*=qe/fe,fe=qe),Te.width=te,Te.height=fe;const Nt=Te.getContext("2d");Nt==null||Nt.drawImage(We,0,0,te,fe);const nt=Te.toDataURL("image/jpeg",.8);Cs(nt)},We.src=(X=Be.target)==null?void 0:X.result}
4324,ae.readAsDataURL(L)}},Nx=async()=>{try{const _=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:44100,echoCancellation:!0,noiseSuppression:!1,autoGainControl:!1}}),L={audioBitsPerSecond:128e3};let G="audio/webm;codecs=opus";MediaRecorder.isTypeSupported("audio/mp4;codecs=mp4a.40.2")?G="audio/mp4;codecs=mp4a.40.2":!MediaRecorder.isTypeSupported(G)&&MediaRecorder.isTypeSupported("audio/ogg;codecs=opus")&&(G="audio/ogg;codecs=opus");let ae=_;if(Gt.enabled)try{const Be=GB(),{modulatedStream:We}=Be.connectStream(_,Gt);ae=We}catch(Be){console.warn("AudioContext stream modulation fallback to direct stream:",Be)}gr.current=new MediaRecorder(ae,{mimeType:G,...L}),Qh(_),Zh.current=[],gr.current.ondataavailable=Be=>Zh.current.push(Be.data),gr.current.onstop=()=>{const Be=new Blob(Zh.current,{type:G});Nr(Be),ln(!0);try{GB().disconnect()}catch{}},gr.current.start(),Kh(!0)}catch{alert("Error al acceder al micrófono")}},Dx=_=>{if(!_)return;const G={id:Date.now().toString(),audio:_,text:"",sender:f.username,senderPic:f.profilePic||"",timestamp:Date.now(),createdAt:Date.now(),room:Ve};Ve==="global"?(cs(ae=>[...ae,G]),setTimeout(Vr,100),W.emit("send_global",G)):(cs(ae=>[...ae,G]),setTimeout(Vr,100),W.emit("send_private",G,Ve,ae=>{ae&&!ae.success&&alert(ae.error||"Error al enviar el audio.")}))},Tx=()=>{gr.current&&gr.current.state!=="inactive"&&gr.current.stop(),Zu&&Zu.getTracks().forEach(_=>_.stop());try{GB().disconnect()}catch{}Kh(!1),Qh(null)};return t?i.jsx("div",{className:"min-h-screen bg-[#050505] flex items-center justify-center",children:i.jsx("div",{className:"w-10 h-10 border-4 border-cyan-500 border-t-transparent rounded-full animate-spin shadow-[0_0_15px_rgba(6,182,212,0.5)]"})}):u?i.jsxs("div",{className:"text-white flex flex-col font-sans relative overflow-hidden",style:{width:"100%",height:"100%",overflow:"hidden",position:"fixed",top:0,left:0,backgroundColor:"#18181b","--neon-color":ye?void 0:at},children:[ce&&i.jsxs("div",{className:"fixed inset-0 z-[300] bg-black/90 flex items-center justify-center p-4 backdrop-blur-sm cursor-pointer",onClick:()=>Ce(null),children:[i.jsx("img",{src:ce,alt:"Expanded view",className:"max-w-full max-h-full object-contain rounded-xl shadow-2xl animate-in zoom-in-95 duration-200"}),i.jsx("button",{className:"absolute top-6 right-6 text-white/50 hover:text-white bg-black/50 p-2 rounded-full transition-colors",onClick:_=>{_.stopPropagation(),Ce(null)},children:i.jsx(Kt,{size:24})})]}),ye&&i.jsx("style",{children:` 4325 @keyframes rainbow-neon { 4326 0% { --neon-color: #ff0000; } 4327 17% { --neon-color: #ff00ff; } 4328 33% { --neon-color: #0000ff; } 4329 50% { --neon-color: #00ffff; } 4330 67% { --neon-color: #00ff00; } 4331 83% { --neon-color: #ffff00; } 4332 100% { --neon-color: #ff0000; } 4333 } 4334 .cyberpunk-neon { 4335 animation: rainbow-neon 5s linear infinite; 4336 } 4337 `}),i.jsxs("nav",{className:"flex items-center justify-between px-4 py-3 shrink-0 z-[100] relative w-full bg-[#18181b] border-b border-[#27272a]",children:[i.jsx("div",{className:"flex-1 flex items-center justify-start gap-4",children:i.jsxs("button",{onClick:()=>Xr(!Xu),className:"relative p-1 text-gray-300 hover:text-white transition-colors",children:[i.jsx(sI,{size:26,strokeWidth:2.5}),i.jsx("div",{className:"absolute top-1 right-0 w-2.5 h-2.5 bg-red-500 rounded-full border-2 border-[#18181b]"})]})}),i.jsx("div",{className:"flex-1 flex justify-center"}),i.jsxs("div",{className:"flex-1 flex items-center justify-end gap-3 sm:gap-4 text-gray-300",children:[Os&&i.jsxs("button",{onClick:()=>{Gs(),On(!0)},className:"p-1.5 rounded-xl bg-red-500/20 hover:bg-red-500/30 text-red-400 border border-red-500/40 transition-all flex items-center gap-1.5 shadow-[0_0_12px_rgba(239,68,68,0.25)]",title:"Panel Oculto de Administrador (AXISS/Axiss)",children:[i.jsx(tm,{size:19,className:"text-red-400 animate-pulse"}),i.jsx("span",{className:"hidden sm:inline text-xs font-bold font-mono tracking-wider",children:"ADMIN"})]}),i.jsx("button",{className:"hover:text-white transition-colors hidden sm:block",children:i.jsx(v1,{size:22})}),i.jsxs("button",{onClick:()=>{ia(_=>_.map(L=>({...L,read:!0}))),Gs(),Ut(!0)},className:"relative hover:text-white transition-colors p-1",title:"Buzón de Mensajes y Menciones",children:[i.jsx(fl,{size:22}),Yr.filter(_=>!_.read).length>0&&i.jsx("span",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] px-1 bg-purple-500 text-white rounded-full text-[10px] font-bold flex items-center justify-center border-2 border-[#18181b]",children:Yr.filter(_=>!_.read).length})]}),i.jsxs("button",{onClick:()=>{Gs(),de(!0)},className:"relative hover:text-white transition-colors p-1",title:"Lista de Amigos y Solicitudes",children:[i.jsx(_u,{size:22}),Dr.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"absolute -top-0.5 -right-0.5 w-3 h-3 bg-red-500 rounded-full border-2 border-[#18181b] animate-ping"}),i.jsx("div",{className:"absolute -top-0.5 -right-0.5 w-3 h-3 bg-red-500 rounded-full border-2 border-[#18181b]"})]})]}),i.jsxs("button",{onClick:()=>
4337{fs(_=>_.map(L=>({...L,read:!0}))),Gs(),ls(!0)},className:"relative hover:text-white transition-colors p-1",title:"Notificaciones (Likes, Corazones y Mensajes)",children:[i.jsx(Ey,{size:22}),Is.filter(_=>!_.read).length>0&&i.jsx("span",{className:"absolute -top-1 -right-1 min-w-[18px] h-[18px] px-1 bg-pink-500 text-white rounded-full text-[10px] font-bold flex items-center justify-center border-2 border-[#18181b]",children:Is.filter(_=>!_.read).length})]}),i.jsxs("button",{onClick:()=>b(!0),className:"relative hover:opacity-80 transition-opacity",children:[i.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center overflow-hidden border border-white/10",children:f.profilePic?i.jsx("img",{src:f.profilePic,className:"w-full h-full object-cover"}):i.jsx(Pu,{size:18})}),i.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 w-3.5 h-3.5 bg-yellow-500 rounded-full border-2 border-[#18181b] flex items-center justify-center"})]})]})]}),i.jsxs("div",{className:"flex flex-1 h-0 relative",children:[i.jsxs("aside",{className:`w-[280px] shrink-0 border-r border-white/5 bg-[#0a0a0c] border-r border-white/10 absolute md:relative z-40 h-full flex flex-col transition-transform duration-300 ${Xu?"translate-x-0":"-translate-x-full md:translate-x-0"}`,children:[i.jsxs("div",{className:"p-4 flex flex-col items-center border-b border-white/5",children:[i.jsxs("div",{className:"relative mb-3 group cursor-pointer",onClick:()=>{Gs(),b(!0)},children:[i.jsx("div",{className:"w-20 h-20 rounded-full border-[3px] border-[#D4AF37] shadow-[0_4px_24px_rgba(0,0,0,0.4)]",children:i.jsx(Ud,{src:f.profilePic||`https://api.dicebear.com/7.x/avataaars/svg?seed=${f.username}`,frameId:f.frameId,alt:f.username,className:"w-full h-full"})}),f.activeDecoration&&i.jsx("div",{className:"absolute inset-0 pointer-events-none scale-125 z-10 flex items-center justify-center",children:i.jsx("img",{referrerPolicy:"no-referrer",src:f.activeDecoration,alt:"marco",className:"w-full h-full object-contain"})}),i.jsx("div",{className:"absolute bottom-1 right-1 w-5 h-5 bg-green-500 rounded-full border-[3px] border-[#121B2A]"})]}),i.jsxs("h2",{className:"text-white font-bold text-lg flex items-center gap-1.5",children:[f.username," ",((cf=f==null?void 0:f.username)==null?void 0:cf.toUpperCase())==="AXISS"&&i.jsx("span",{className:"bg-red-500/20 text-red-400 text-[10px] font-black px-1.5 py-0.5 rounded uppercase tracking-wider",children:"Admin"})]}),i.jsx("p",{className:"text-white/50 text-xs",children:"Conectado(a)"})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto overflow-x-hidden scrollbar-thin flex flex-col",children:[i.jsx("div",{className:"px-4 mt-2",children:i.jsxs("button",{className:`w-full flex items-center justify-center gap-2 text-cyan-400 bg-cyan-500/10 border ${Rn?"border-cyan-500/50":"border-cyan-500/20"} px-3 py-2 rounded-2xl hover:bg-cyan-500/20 transition-all text-sm font-medium`,onClick:()=>{Gs(),zn(!Rn)},children:[i.jsx(_u,{size:16,strokeWidth:1.5}),"Solicitudes de Amistad",(f==null?void 0:f.friend_requests)&&f.friend_requests.length>0&&i.jsx("span",{className:"bg-cyan-500 text-black text-xs font-bold px-2 py-0.5 rounded-full ml-1",children:f.friend_requests.length})]})}),Os&&i.jsx(i.Fragment,{children:i.jsxs("div",{className:"px-4 mt-2 grid grid-cols-2 gap-2",children:[i.jsxs("button",{className:`flex items-center justify-center gap-2 text-red-400 bg-red-500/10 border ${Pe?"border-red-500/50":"border-red-500/20"} px-3 py-2 rounded-2xl hover:bg-red-500/20 transition-all text-sm font-medium`,onClick:()=>{Gs(),W.emit("get_banned_users",_=>vt(_)),Le(!Pe)},children:[i.jsx(tm,{size:16,strokeWidth:1.5}),"Baneados"]}),i.jsxs("button",{className:`flex items-center justify-center gap-2 text-orange-400 bg-orange-500/10 border ${st?"border-orange-500/50":"border-orange-500/20"} px-3 py-2 rounded-2xl hover:bg-orange-500/20 transition-all text-sm font-medium`,onClick:()=>{Gs(),W.emit("get_reports",_=>gn(_)),Yn(!st)},children:[i.jsx(gh,{size:16,strokeWidth:1.5}),"Reportes"]}),i.jsxs("button",{className:"flex items-center justify-center gap-2 text-red-400 bg-red-500/10 border border-red-500/20 px-3 py-2 rounded-2xl hover:bg-red-500/20 transition-all text-sm font-medium",onClick:()=>{window.confirm("¿Estás seguro de limpiar el chat global? Esta acción no se puede deshacer.")&&W.emit("clear_global_chat")},children:[i.jsx(Vs,{size:16,strokeWidth:1.5}),"Limpiar Global"]}),i.jsxs("button",{className:"flex items-center justify-center gap-2 text-blue-400 bg-blue-500/10 border border-blue-500/20 px-3 py-2 rounded-2xl hover:bg-blue-500/20 transition-all text-sm font-medium",onClick:()=>{Gs(),R("global"),N(!0)},title:"Configurar Fondo Global con Video, GIF, Imagen o YouTube",children:[i.jsx(Lu,{size:16,strokeWidth:1.5}),"Fondo Global"]})]})}),(((uf=f==null?void 0:f.username)==null?void 0:uf.toUpperCase())==="AXISS"||Os)&&i.jsx("div",{className:"px-4 mt-2",children:i.jsxs("button",{className:`w-full flex items-center justify-between gap-2 text-emerald-300 bg-emerald-500/10 border ${Zt?"border-emerald-500/50":"border-emerald-500/25"} px-3.5 py-2.5 rounded-2xl hover:bg-emerald-500/20 transition-all text-xs sm:text-sm font-bold shadow-sm active:scale-95`,onClick:()=>{Gs(),W.emit("get_monetization_stats",_=>{_&&At(_)}),en(!0)},title:"Ver Contador de Ganancias por Usuario, CTR y reproducciones de videos",children:[i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(_B,{size:16,strokeWidth:2}),i.jsx("span",{children:"Contador de Ganancias"})]}),i.jsxs("span",{className:"text-emerald-400 font-extrabold text-xs bg-emerald-500/20 px-2 py-0.5 rounded-full border border-emerald-500/30",children:["$",(jt.lifetimeRevenue||0).toFixed(2)]})]})}),i.jsx("div",{className:"w-full h-px bg-white/5 my-2"}),i.jsxs("div",{className:"px-4 py-1 flex flex-col gap-1.5",children:[i.jsx("button",{className:`w-full flex items-center justify-between px-3 py-2.5 rounded-xl font-bold transition-all ${Ve==="global"?"bg-gradient-to-r from-cyan-500/20 to-purple-500/20 text-cyan-300 border border-cyan-500/30 shadow-[0_0_15px_rgba(6,182,212,0.2)]":"bg-transparent text-white/50 hover:bg-white/10 hover:text-white transition-all"}`,onClick:()=>{Gs(),Xr(!1),Rt("global")},children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(vu,{size:18,className:Ve==="global"?"animate-pulse":""}),"Sala Global"]})}),i.jsx("button",{className:`w-full flex items-center justify-between px-3 py-2.5 rounded-xl font-bold transition-all ${Ve==="friends_webcam"?"bg-gradient-to-r from-cyan-500/20 to-purple-500/20 text-cyan-300 border border-cyan-500/30 shadow-[0_0_15px_rgba(6,182,212,0.2)]":"bg-transparent text-white/50 hover:bg-white/10 hover:text-white transition-all"}`,onClick:()=>{Gs(),Xr(!1),Rt("friends_webcam")},children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ay,{size:18,className:Ve==="friends_webcam"?"animate-pulse":""}),"Friends Webcam"]})}),i.jsx("button",{className:`w-full flex items-center justify-between px-3 py-2.5 rounded-xl font-bold transition-all ${Ve==="custom_rooms"?"bg-gradient-to-r from-cyan-500/20 to-purple-500/20 text-cyan-300 border border-cyan-500/30 shadow-[0_0_15px_rgba(6,182,212,0.2)]":"bg-transparent text-white/50 hover:bg-white/10 hover:text-white transition-all"}`,onClick:()=>{Gs(),Xr(!1),Rt("custom_rooms")},children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(qB,{size:18}),"Crear Sala"]})})]}),i.jsx("div",{className:"px-4 py-2",children:i.jsxs("button",{className:"w-full flex items-center justify-center gap-2 bg-gradient-to-r from-purple-600 to-blue-600 hover:from-purple-500 hover:to-blue-500 text-white px-3 py-2.5 rounded-xl font-bold shadow-lg transition-transform active:scale-95",onClick:()=>{Gs(),U(!0)},children:[i.jsx(gl,{size:18}),"Personajes IA"]})}),i.jsx("div",{className:"px-4 py-1",children:i.jsxs("form",{onSubmit:_=>{_.preventDefault();const L=_.target.elements.searchQuery.value.trim();L&&W.emit("search_user",L,G=>{G.success?V(G.user):alert("Usuario no encontrado")})},className:"relative",children:[i.jsx("input",{name:"searchQuery",type:"text",placeholder:"Buscar por UID o Nombre...",className:"w-full bg-[#12141c] text-sm text-white px-3 py-2 pl-8 rounded-xl border border-white/10 focus:border-[#D4AF37] focu
4337s:outline-none placeholder-gray-500"}),i.jsx(Sg,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-gray-500",size:14})]})}),i.jsxs("div",{className:"px-4 pt-3 pb-1 flex items-center justify-between",children:[i.jsxs("span",{className:"text-xs font-bold text-gray-400 uppercase tracking-wider flex items-center gap-1.5",children:[i.jsx(Na,{size:14,className:"text-cyan-400"}),"Conectados (",qn.filter(_=>!["Sensei","Shadow","Neko"].includes(_.username)).length,")"]}),i.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-400 animate-pulse"})]}),i.jsx("div",{className:"px-4 py-1 space-y-2",children:qn.map(_=>{if(["Sensei","Shadow","Neko"].includes(_.username))return null;const L=_.username===f.username,G=_.username==="Elizabeth";return i.jsx("div",{className:`border backdrop-blur-md rounded-xl p-3 flex flex-col gap-2 relative overflow-hidden group cursor-pointer transition-colors ${L?"bg-cyan-500/10 border-cyan-500/30 hover:border-cyan-500/50 hover:bg-cyan-500/15":G?"bg-purple-500/10 border-purple-500/30 hover:border-purple-500/50 hover:bg-purple-500/15":"bg-white/[0.03] border-white/10 hover:border-white/20 hover:bg-white/5"}`,onClick:()=>{Gs(),G?(Xr(!1),Rt("Elizabeth")):V(_)},children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:`w-10 h-10 rounded-full border flex-shrink-0 relative transition-all ${_.incognito?"border-amber-400 ring-2 ring-amber-500/50 shadow-[0_0_12px_rgba(245,158,11,0.35)]":"border-white/10"}`,children:[i.jsx(Ud,{src:_.profilePic||(G?"/elizabeth_avatar.png":`https://api.dicebear.com/7.x/avataaars/svg?seed=${_.username}`),frameId:_.frameId,alt:_.username,className:"w-full h-full"}),_.activeDecoration&&i.jsx("div",{className:"absolute inset-0 pointer-events-none scale-125 z-10 flex items-center justify-center",children:i.jsx("img",{referrerPolicy:"no-referrer",src:_.activeDecoration,alt:"marco",className:"w-full h-full object-contain"})}),_.incognito&&i.jsx("div",{title:L?"Tu Modo Incógnito: Estás oculto para los demás usuarios":"ðµï¸ Modo Incógnito: Invisible para usuarios comunes. Solo administradores pueden verlo. ¡No lo nombres ni lo delates en el chat!",className:"absolute -top-1 -right-1 z-20 bg-black/95 text-amber-400 p-1 rounded-full border border-amber-400 shadow-[0_0_8px_rgba(245,158,11,0.7)] flex items-center justify-center cursor-help",children:i.jsx(rl,{size:11,className:"text-amber-400 animate-pulse"})})]}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("p",{className:"text-white font-bold text-sm truncate flex items-center gap-1.5",children:[_.username,L&&i.jsx("span",{className:"bg-cyan-500/20 text-cyan-300 text-[8px] font-black px-1.5 py-0.5 rounded uppercase tracking-wider border border-cyan-500/40",children:"Tú"}),_.username==="Axiss"&&(_.role==="admin"||_.uid==="1001"||_.isMasterAdmin)&&i.jsx("span",{className:"bg-amber-500/20 text-amber-300 border border-amber-500/40 text-[8px] font-black px-1.5 py-0.5 rounded uppercase tracking-wider flex items-center gap-0.5",children:"ð Admin Principal"}),_.username==="AXISS"&&(_.role==="admin"||_.uid==="1001"||_.isMasterAdmin)&&i.jsx("span",{className:"bg-cyan-500/20 text-cyan-300 border border-cyan-500/40 text-[8px] font-black px-1.5 py-0.5 rounded uppercase tracking-wider flex items-center gap-0.5",children:"ð¡ï¸ Soporte"}),_.role==="admin"&&_.username!=="Axiss"&&_.username!=="AXISS"&&!G&&i.jsx("span",{className:"bg-purple-500/20 text-purple-300 border border-purple-500/40 text-[8px] font-black px-1.5 py-0.5 rounded uppercase tracking-wider",children:"Admin"}),G&&i.jsx("span",{className:"bg-purple-500/20 text-purple-300 text-[8px] font-black px-1.5 py-0.5 rounded uppercase tracking-wider border border-purple-500/40",children:"IA Oficial"}),_.incognito&&i.jsxs("span",{title:L?"Tu Modo Incógnito está activo":"â ï¸ Usuario en Modo Incógnito (Oculto para los demás). Solo visible para Administradores. Por favor no lo nombres ni lo delates en el chat si solo quiere leer.",className:"inline-flex items-center gap-1 bg-amber-500/20 text-amber-300 text-[9px] font-black px-2 py-0.5 rounded-full border border-amber-500/50 shadow-sm cursor-help hover:bg-amber-500/30 transition-all",children:[i.jsx(rl,{size:10,
4337className:"text-amber-400 shrink-0"}),i.jsx("span",{children:L?"Incógnito (Tú)":"Incógnito ⢠No delatar"})]}),i.jsxs("span",{title:"Identificador Ãnico Permanente (Fijo e Inmutable)",className:"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-mono font-bold bg-cyan-500/10 text-cyan-300/90 border border-cyan-500/20",children:["#",_.uid||((_.username==="Axiss"||_.username==="AXISS")&&_.role==="admin"?"1001":G?"1000":"N/A")]})]}),i.jsx("p",{className:"text-white/50 text-xs truncate",children:_.incognito?i.jsxs("span",{className:"text-amber-300/90 italic flex items-center gap-1 text-[11px] font-medium",children:[i.jsx(rl,{size:11,className:"inline text-amber-400 shrink-0"}),L?"Tu modo incógnito activo (Invisible para los demás)":"Oculto para los demás ⢠Solo visible para Admin (No delatar)"]}):G?"Administradora IA ⢠En lÃnea":_.statusMessage||"En lÃnea"})]})]})},_.username)})}),i.jsxs("div",{className:"mt-auto p-2.5 border-t border-white/5 bg-black/40 flex flex-wrap items-center justify-center gap-x-2.5 gap-y-1 text-[11px] text-white/50",children:[i.jsx("button",{onClick:()=>{Ot("privacy"),He(!0)},className:"hover:text-cyan-300 transition-colors",children:"Privacidad"}),i.jsx("span",{children:"â¢"}),i.jsx("button",{onClick:()=>{Ot("terms"),He(!0)},className:"hover:text-cyan-300 transition-colors",children:"Términos"}),i.jsx("span",{children:"â¢"}),i.jsx("button",{onClick:()=>{Ot("contact"),He(!0)},className:"hover:text-cyan-300 transition-colors",children:"Contacto"})]})]})]}),i.jsxs("main",{className:"flex-1 min-w-0 min-h-0 relative flex flex-col bg-transparent overflow-hidden",children:[Al&&i.jsx(rj,{url:Al}),i.jsxs("div",{className:"flex-1 min-h-0 min-w-0 flex flex-col relative z-0",children:[i.jsx("div",{className:"hidden"}),Ve==="friends_webcam"?i.jsx(a7,{user:f,onClose:()=>Rt("global")}):Ve==="custom_rooms"?i.jsx(l7,{user:f,onJoinRoom:(_,L)=>{const G=_.startsWith("room_")?_:"room_"+_;Xa(L),Rt(G)}}):Ve==="lizgram"?i.jsx(GH,{user:f,onClose:()=>Rt("global")}):i.jsxs(i.Fragment,{children:[Ve==="global"?i.jsxs("div",{className:"bg-[#0a0a0c]/90 backdrop-blur-md border-b border-white/10 px-4 py-3 flex items-center justify-between sticky top-0 z-20 shadow-lg",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-gradient-to-br from-cyan-500/20 via-purple-500/20 to-blue-500/20 border border-cyan-500/30 flex items-center justify-center shadow-[0_0_15px_rgba(6,182,212,0.25)] text-xl overflow-hidden",children:Qt!=null&&Qt.icon?Qt.icon.startsWith("http")||Qt.icon.startsWith("data:")?i.jsx("img",{src:Qt.icon,alt:"Emblema",className:"w-full h-full object-cover"}):i.jsx("span",{children:Qt.icon}):i.jsx(vu,{className:"text-cyan-400",size:20})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsxs("span",{className:"text-white font-bold text-lg leading-tight flex items-center gap-2",children:[(Qt==null?void 0:Qt.title)||"Chat Global",i.jsx("span",{className:"text-[10px] bg-cyan-500/20 text-cyan-300 px-2 py-0.5 rounded-full border border-cyan-500/30 uppercase tracking-wider font-semibold",children:"COMUNIDAD"})]}),i.jsxs("span",{className:"text-white/60 text-xs font-medium flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-green-400 animate-ping inline-block"}),i.jsxs("span",{className:"text-green-400",children:[qn.filter(_=>!["Sensei","Shadow","Neko"].includes(_.username)).length," ",aa("online")]}),(Qt==null?void 0:Qt.statusMessage)&&i.jsxs("span",{className:"text-cyan-200/90 truncate max-w-[200px] sm:max-w-xs font-semibold",children:["⢠",Qt.statusMessage]})]})]})]}),Os&&i.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[i.jsxs("button",{onClick:()=>no(!0),className:`text-xs sm:text-sm font-bold px-2.5 sm:px-3 py-2 rounded-xl transition-all border flex items-center gap-1.5 shadow-sm active:scale-95 ${Ls.length>=18?"bg-rose-500/20 text-rose-300 border-rose-500/40 animate-pulse":Ls.length>=14?"bg-amber-500/15 text-amber-300 border-amber-500/35":"bg-purple-500/15 text-purple-300 border-purple-500/30 hover:bg-purple-500/25"}`,title:"Limpiador de Sala Global",children:[i.jsx(Vs,{size:16,className:Ls.length>=18?"text-rose-400":"text-purple-400"}),i.jsx("span",{className:"hidden sm:inline",children:"Limpiador"}),i.jsxs("span",{className:"px-1.5 py-0.5 rounded-full bg-black/40 text-[11px] font-mono border border-white/10",children:[Ls.length,"/20"]})]}),i.jsxs("button",{onClick:()=>_n(!0),className:"text-xs sm:text-sm font-bold text-emerald-300 hover:text-white bg-emerald-500/15 hover:bg-emerald-500/25 px-2.5 sm:px-3 py-2 rounded-xl transition-all border border-emerald-500/35 flex items-center gap-1.5 shadow-sm active:scale-95",title:"Pasar nuevas actualizaciones a Hugging Face (chatliz-online-chatliz.hf.space) con tu Token",children:[i.jsx(ih,{size:15,className:"text-emerald-400 animate-pulse"}),i.jsx("span",{className:"hidden sm:inline",children:"Pasar a Hugging Face"}),i.jsx("span",{className:"sm:hidden",children:"Token HF"})]}),i.jsxs("button",{onClick:()=>Hn(!0),className:"text-xs sm:text-sm font-bold text-cyan-300 hover:text-white bg-cyan-500/10 hover:bg-cyan-500/20 px-3 py-2 rounded-xl transition-all border border-cyan-500/30 flex items-center gap-1.5 shadow-sm",title:"Personalizar Chat Global",children:[i.jsx(ko,{size:16}),i.jsx("span",{className:"hidden sm:inline",children:"Personalizar"})]})]})]}):(()=>
4337{if(Ve.startsWith("room_")){const We=(Ht==null?void 0:Ht.owner)===f.username||Os,X=(Ht==null?void 0:Ht.logo)||(Ht==null?void 0:Ht.emblem)||"âï¸",Te=X.startsWith("http")||X.startsWith("data:");return i.jsxs("div",{className:"bg-[#0a0a0c]/90 backdrop-blur-md border-b border-white/10 px-4 py-3 flex items-center justify-between sticky top-0 z-20 shadow-lg",children:[i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[i.jsx("button",{onClick:()=>{W.emit("leave_custom_room",Ve),Rt("custom_rooms")},className:"text-white/80 hover:bg-white/10 p-2 rounded-full transition-colors shrink-0",title:"Volver a la lista de Salas",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M19 12H5"}),i.jsx("path",{d:"M12 19l-7-7 7-7"})]})}),i.jsx("div",{className:"w-11 h-11 rounded-2xl bg-gradient-to-br from-cyan-500/25 via-purple-500/25 to-blue-500/25 border border-cyan-500/40 flex items-center justify-center shadow-[0_0_15px_rgba(6,182,212,0.3)] shrink-0 overflow-hidden text-2xl",children:Te?i.jsx("img",{src:X,alt:"Logo de Sala",className:"w-full h-full object-cover"}):i.jsx("span",{children:X})}),i.jsxs("div",{className:"flex flex-col min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[i.jsx("h2",{className:"text-lg sm:text-2xl font-black bg-gradient-to-r from-cyan-300 via-teal-200 to-indigo-300 bg-clip-text text-transparent tracking-tight truncate leading-tight drop-shadow-sm",children:(Ht==null?void 0:Ht.name)||"Sala de la Comunidad"}),i.jsx("span",{className:"text-[10px] bg-cyan-500/20 text-cyan-300 px-2 py-0.5 rounded-full border border-cyan-500/30 uppercase tracking-wider font-bold",children:"COMUNIDAD"}),(Ht==null?void 0:Ht.autoCleanMode)&&Ht.autoCleanMode!=="disabled"&&i.jsxs("span",{className:"text-[10px] bg-amber-500/15 text-amber-300 px-2 py-0.5 rounded-full border border-amber-500/30 font-mono font-bold flex items-center gap-1",children:[i.jsx(Vs,{size:10})," Auto-Limpieza: ",Ht.autoCleanMode]})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs text-white/50 mt-0.5",children:[i.jsxs("span",{className:"flex items-center gap-1 text-amber-300/80",children:[i.jsx(bo,{size:11})," Creador: @",(Ht==null?void 0:Ht.owner)||"Admin"]}),(Ht==null?void 0:Ht.rules)&&i.jsxs("span",{className:"truncate italic hidden md:inline text-white/40",children:['⢠"',Ht.rules,'"']})]})]})]}),i.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[i.jsxs("button",{onClick:()=>{R("room"),N(!0)},className:"bg-white/5 hover:bg-white/10 text-white/80 hover:text-white px-3 py-1.5 rounded-xl border border-white/10 text-xs font-bold flex items-center gap-1.5 transition-all",title:"Cambiar Fondo de la Sala",children:[i.jsx(Lu,{size:14,className:"text-cyan-400"}),i.jsx("span",{className:"hidden sm:inline",children:"Fondo"})]}),We&&i.jsxs("button",{onClick:()=>Wa(!0),className:"bg-gradient-to-r from-cyan-500/20 to-blue-500/20 hover:from-cyan-500/30 hover:to-blue-500/30 text-cyan-300 hover:text-white px-3.5 py-1.5 rounded-xl border border-cyan-500/40 text-xs font-extrabold flex items-center gap-1.5 transition-all shadow-[0_0_12px_rgba(6,182,212,0.2)]",title:"Configurar Nombre, Logo, Fondo y Limpieza de tu Sala",children:[i.jsx(Sy,{size:14,className:"animate-spin-slow"}),i.jsx("span",{children:"Configurar Sala"})]})]})]})}const _=qn.find(We=>We.username===Ve),L=["Elizabeth","Sensei","Shadow","Neko"].includes(Ve)?{username:Ve,profilePic:(_==null?void 0:_.profilePic)||`https://api.dicebear.com/7.x/avataaars/svg?seed=${Ve}`,statusMessage:(_==null?void 0:_.statusMessage)||"Inteligencia Artificial",isAi:!0}:null,G=L||qn.find(We=>We.username===Ve)||ns[Ve],ae=!!L||!!qn.find(We=>We.username===Ve),Be=(G==null?void 0:G.profilePic)||`https://api.dicebear.com/7.x/avataaars/svg?seed=${Ve}`;return i.jsxs("div",{className:"bg-[#0a0a0c] border-r border-white/10 border-b border-white/5 px-4 py-3 flex items-center justify-between sticky top-0 z-20 shadow-lg",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{onClick:()=>Rt(ut),className:"text-white/80 hover:bg-white/10 p-2 rounded-full transition-colors mr-1",title:"Volver Atrás",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M19 12H5"}),i.jsx("path",{d:"M12 19l-7-7 7-7"})]})}),i.jsxs("div",{className:"w-10 h-10 rounded-full bg-[#1A2639] border border-white/10 flex items-center justify-center shadow-sm relative cursor-pointer",onClick:()=>V(G),children:[i.jsx(Ud,{src:Be,frameId:G==null?void 0:G.frameId,className:"w-full h-full",alt:"avatar"}),i.jsx("div",{className:`absolute bottom-0 right-0 w-3 h-3 rounded-full border-2 border-[#1A2639] ${ae?"bg-green-500":"bg-gray-500"}`})]}),i.jsxs("div",{className:"flex flex-col",children:[i.jsxs("span",{className:"text-white font-bold text-lg leading-tight flex items-center gap-1.5 cursor-pointer hover:underline",onClick:()=>V(G),children:[(_t==null?void 0:_t.icon)&&i.jsx("span",{className:"text-base mr-0.5",children:_t.icon.startsWith("http")||_t.icon.startsWith("data:")?i.jsx("img",{src:_t.icon,alt:"Emblema",className:"w-5 h-5 rounded object-cover inline-block"}):_t.icon}),(_t==null?void 0:_t.title)||Ve," ",i.jsx("span",{className:`text-[10px] px-2 py-0.5 rounded-full border uppercase tracking-wider ${L?"bg-cyan-500/20 text-cyan-300 border-cyan-500/30":"bg-pink-500/20 text-pink-400 border-pink-500/30"}`,children:L?"IA Oficial":"Privado"})]}),i.jsxs("span",{className:"text-white/50 text-xs font-medium",children:[ae?i.jsx("span",{className:"text-green-400",children:aa("online")}):"Desconectado"," ","⢠",_t!=null&&_t.statusMessage?_t.statusMessage:`Solo tú y ${Ve} pueden ver este chat`]})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[L&&(()=>{const We=f.aiTokens??f.lizCoins??50;return i.jsxs("div",{className:"flex items-center gap-1.5 mr-1",children:[i.jsxs("div",{className:`px-2.5 py-1 rounded-xl text-xs font-bold border flex items-center gap-1.5 shadow-sm ${We>0?"bg-cyan-500/15 text-cyan-300 border-cyan-500/30":"bg-rose-500/20 text-rose-300 border-rose-500/40 animate-pulse"}`,children:[i.jsx(Fs,{size:13,className:"text-cyan-400"}),i.jsxs("span",{children:[We," ",We===1?"token":"tokens"]})]}),We<=0&&i.jsxs("button",{onClick:()=>Il(Ve),className:"bg-gradient-to-r from-amber-500 via-orange-500 to-amber-500 hover:from-amber-400 hover:to-orange-400 text-white text-xs font-extrabold px-3 py-1.5 rounded-xl shadow-lg transition-transform active:scale-95 flex items-center gap-1.5 shrink-0 uppercase tracking-wide border border-amber-400/40 animate-pulse cursor-pointer",title:"Reproducir video para recargar tokens (+50 tokens)",children:[i.jsx(Bo,{size:14}),i.jsx("span",{className:"hidden sm:inline",children:"Reproducir video para recargar tokens (+50 tokens)"}),i.jsx("span",{className:"sm:hidden",children:"+50 tokens"})]})]})})(),Os&&i.jsx("button",{onClick:()=>Hn(!0),className:"text-sm font-bold text-white/80 hover:text-white bg-white/5 hover:bg-white/10 p-2 rounded-xl transition-colors border border-white/20 flex items-center justify-center mr-1",title:"Personalizar este chat",children:i.jsx(ko,{size:20})}),i.jsx("button",{onClick:()=>Rt("global"),className:"text-sm font-bold text-white/80 hover:text-white bg-white/5 hover:bg-white/10 p-2 rounded-xl transition-colors border border-white/20 flex items-center justify-center",title:"Chat Global",children:i.jsx(vu,{size:20})})]})]})})(),od&&i.jsx("div",{className:"fixed inset-0 z-40",onPointerDown:()=>so(null)}),i.jsxs("div",{className:"flex-1 overflow-y-auto px-2 md:px-4 py-2 space-y-1.5 scrollbar-thin",children:[Ve==="global"&&Ls.length===1&&i.jsxs("div",{className:"mx-auto max-w-lg my-3 bg-gradient-to-r from-purple-950/60 via-cyan-950/40 to-purple-950/60 border border-cyan-500/40 rounded-2xl p-3.5 text-center shadow-lg backdrop-blur-md animate-fadeIn",children:[i.jsxs("div",{className:"flex items-center justify-center gap-2 text-cyan-300 font-bold text-xs sm:text-sm mb-1",children:[i.jsx(Fs,{size:16,className:"text-amber-400"}),i.jsx("span",{children:"Sala Global Limpia (LÃmite 20 mensajes)"})]}),i.jsxs("p",{className:"text-[12px] text-gray-300 leading-snug",children:["Se limpiaron los mensajes anteriores y se conservó el último mensaje de ",i.jsxs("strong",{className:"text-cyan-300 font-semibold",children:["@",(ld=Ls[0])==null?void 0:ld.sender]})," para que puedas leerlo y responder de inmediato."]}),i.jsxs("button",{onClick:()=>{Fi(Ls[0]),Lt.current&&Lt.current.focus()},className:"mt-2.5 inline-flex items-center gap-1.5 text-xs font-bold text-cyan-200 bg-cyan-500/25 hover:bg-cyan-500/40 px-3.5 py-1.5 rounded-xl border border-cyan-400/40 transition-all shadow-sm active:scale-95",children:[i.jsx(fl,{size:13}),"Responder a @",(gi=Ls[0])==null?void 0:gi.sender]})]}),Ls.filter(_=>_&&_.sender).filter(_=>{var G,ae;if((G=f.blocked_list)!=null&&G.includes(_.sender))return!1;const L=qn.find(Be=>Be.username===_.sender);return!((ae=L==null?void 0:L.blocked_list)!=null&&ae.includes(f.username))}).map((_,L)=>{var yt;const G=_.sender==="Elizabeth"||_.isAi,ae=_.sender===f.username,Be=G?DE(_.text||""):_.text||"",We=_.replyTo&&(_.replyTo.sender==="Elizabeth"||["Sensei","Shadow","Neko"].includes(_.replyTo.sender)),X=_.replyTo?We?DE(_.replyTo.text||""):_.replyTo.text||"":"";let Te=new Date;if(_.timestamp||_.createdAt){const ot=_.timestamp||_.createdAt;typeof ot=="number"?Te=new Date(ot):ot.seconds?Te=new Date(ot.seconds*1e3):typeof ot.toDate=="function"?Te=ot.toDate():Te=new Date(ot)}const te=isNaN(Te.getTime())?`10:0${L%10}`:Ve==="global"?Te.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):Te.toLocaleDateString([],{day:"2-digit",month:"2-digit"})+" "+Te.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),fe=ae?f:qn.find(ot=>ot.username===_.sender)||ns[_.sender],qe=fe==null?void 0:fe.activeDecoration,Nt=qe?(yt=cD.find(ot=>ot.id===qe))==null?void 0:yt.url:null,nt=(fe==null?void 0:fe.profilePic)||_.profilePic||`https://api.dicebear.com/7.x/avataaars/svg?seed=${_.sender}`;return i.jsxs("div",{className:`relative flex ${ae?"justify-end":"justify-start"} px-1 md:px-2 group`,style:{marginBottom:"8px"},onPointerDown:ot=>{ot.pointerType==="mouse"&&ot.button!==0||(Rl.current=setTimeout(()=>so(_.id||L.toString()),500))},onPointerUp:()=>clearTimeout(Rl.current),onPointerMove:()=>clearTimeout(Rl.current),onPointerCancel:()=>clearTimeout(Rl.current),onContextMenu:ot=>{ot.preventDefault(),so(_.id||L.toString())},children:[od===(_.id||L.toString())&&i.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 -translate-y-full z-50 bg-[#1A2035] border border-[#D4AF37]/40 shadow-2xl rounded-full px-3 py-2 flex gap-2 animate-in fade-in slide-in-from-bottom-2",children:oq.map(ot=>i.jsx("button",{onClick:Ln=>{Ln.stopPropagation(),of(_.id||L.toString(),_.docId,ot)},className:"text-2xl hover:scale-125 transition-transform origin-bottom",children:ot},ot))}),i.jsxs("div",{className:`flex gap-3 max-w-[85%] mt-1.5 group ${ae?"flex-row-reverse":""}`,children:[i.jsxs("div",{className:"relative shrink-0 mt-1 cursor-pointer",onClick:()=>fe&&V(fe),children:[i.jsx(Ud,{src:nt,frameId:fe==null?void 0:fe.frameId,className:`w-8 h-8 rounded-full border shadow-sm ${_.sender==="Elizabeth"?"border-white/10":"border-[#5A52A5]
4337/30 bg-white/5"}`,alt:_.sender}),Nt&&i.jsx("div",{className:"absolute -inset-3 pointer-events-none z-10 flex items-center justify-center",children:i.jsx("img",{referrerPolicy:"no-referrer",src:Nt,className:`w-[130%] h-[130%] object-contain filter drop-shadow-sm ${_.sender!=="Elizabeth"?"opacity-80 mix-blend-multiply":""}`,style:{imageRendering:"pixelated"},alt:""})})]}),(()=>{var ni,ka,Vi,Ui,pa,hf,eu,dd,ff;const ot=(fe==null?void 0:fe.bubbleStyle)||(Zr==null?void 0:Zr.bubbleStyle)||(f==null?void 0:f.preferredBubbleStyle)||"default",Ln=jF(ot),dr=ae?Ln.myBubbleClass:Ln.otherBubbleClass,Vp=ae?"rgba(6, 182, 212, 0.15)":"rgba(255, 255, 255, 0.05)",cd=ae?"rgba(6, 182, 212, 0.3)":"rgba(255, 255, 255, 0.1)",qo=ae?"rounded-[20px] rounded-tr-[4px]":"rounded-[20px] rounded-tl-[4px]",Wc=(fe==null?void 0:fe.bubbleColor)||(_.sender==="Elizabeth"?"transparent":ot!=="default"?void 0:Vp),ud=(fe==null?void 0:fe.bubbleBorder)||(_.sender==="Elizabeth"?"rgba(255,255,255,0.1)":ot!=="default"?void 0:cd),df=(fe==null?void 0:fe.bubbleShape)||qo,$o=(fe==null?void 0:fe.bubbleTexture)||(_.sender==="Elizabeth","none"),xi=_.sender==="Elizabeth";let Ol=ot!=="default"?"":df,ma="";$o==="glass"&&(ma="backdrop-blur-md bg-opacity-30 border-white/20"),$o==="glow"&&(ma="shadow-[0_0_15px_rgba(255,255,255,0.2)]"),$o==="soap"&&(ma="backdrop-blur-sm shadow-[0_0_15px_rgba(255,255,255,0.4),inset_0_0_20px_rgba(255,255,255,0.5)] border border-white/40 overflow-visible"),$o==="animals"&&(ma="overflow-visible");const Zc=xi?"text-pink-400":ot==="comic_popart"?"text-black":"text-cyan-300",Jo=ot==="comic_popart"?"text-black":"text-white/90",bi=ot==="comic_popart"?"text-black/60":"text-white/40";return i.jsxs("div",{className:`${Ln.bubbleClass} ${dr} ${Ol} ${ma} px-4 py-2.5 shadow-sm flex flex-col relative min-w-[120px] transition-all`,style:{backgroundColor:Wc!=="transparent"&&Wc?Wc:void 0,borderColor:ud!=="transparent"&&ud?ud:void 0,backdropFilter:"blur(10px)"},children:[$o==="soap"&&i.jsx("div",{className:"absolute inset-0 rounded-[inherit] pointer-events-none",style:{background:"linear-gradient(135deg, rgba(255,154,158,0.2) 0%, rgba(254,207,239,0.2) 99%, rgba(254,207,239,0.2) 100%)",mixBlendMode:"overlay"}}),$o==="animals"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"absolute -top-3 -left-3 text-2xl z-10 animate-bounce pointer-events-none",style:{animationDuration:"2s"},children:"ð°"}),i.jsx("div",{className:"absolute -bottom-3 -right-3 text-2xl z-10 animate-pulse pointer-events-none",children:"ð±"})]}),!ae&&i.jsxs("div",{className:"flex items-center flex-wrap gap-1.5 mb-0.5",children:[i.jsx("span",{className:`font-semibold ${Zc} text-[13px] cursor-pointer hover:text-white transition-colors tracking-wide`,onClick:()=>{Lt.current&&(Lt.current.value+=`@${_.sender} `)},children:_.sender}),_.sender==="Axiss"&&(_.senderRole==="admin"||_.senderUid==="1001"||_.isMasterAdmin||((ni=qn.find(wn=>wn.username==="Axiss"))==null?void 0:ni.role)==="admin")&&i.jsx("span",{className:"inline-flex items-center gap-0.5 bg-amber-500/20 text-amber-300 border border-amber-500/40 text-[9px] font-black px-1.5 py-0.2 rounded-full uppercase tracking-wider shadow-sm",title:"Administrador Principal y Creador Oficial (ID #1001)",children:"ð Admin Principal"}),_.sender==="AXISS"&&(_.senderRole==="admin"||_.senderUid==="1001"||_.isMasterAdmin||((ka=qn.find(wn=>wn.username==="AXISS"))==null?void 0:ka.role)==="admin")&&i.jsx("span",{className:"inline-flex items-center gap-0.5 bg-cyan-500/20 text-cyan-300 border border-cyan-500/40 text-[9px] font-black px-1.5 py-0.2 rounded-full uppercase tracking-wider shadow-sm",title:"Administrador de Soporte Oficial (ID #1001)",children:"ð¡ï¸ Soporte"}),_.sender!=="Axiss"&&_.sender!=="AXISS"&&_.senderRole==="admin"&&i.jsx("span",{className:"inline-flex items-center gap-0.5 bg-purple-500/20 text-purple-300 border border-purple-500/40 text-[9px] font-black px-1.5 py-0.2 rounded-full uppercase tracking-wider shadow-sm",title:"Administrador Promovido",children:"ð¡ï¸ Admin"}),i.jsxs("span",{className:"text-[10px] font-mono text-white/40",children:["#",_.senderUid||((_.sender==="Axiss"||_.sender==="AXISS")&&_.senderRole==="admin"?"1001":((Vi=qn.find(wn=>wn.username===_.sender))==null?void 0:Vi.uid)||"")]})]}),_.replyTo&&i.jsxs("div",{className:`bg-black/10 border-l-2 border-[#5A52A5]
4337/50 px-2 py-1 mb-1 rounded text-xs italic flex flex-col ${Jo}`,children:[i.jsx("span",{className:"font-bold opacity-80",children:_.replyTo.sender}),i.jsx("span",{className:"truncate opacity-70",children:i.jsx(NE,{originalText:X,senderLanguage:_.replyTo.senderLanguage,userLanguage:f.pais_idioma||"es"})})]}),i.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-2",children:[i.jsx("span",{className:`${Jo} text-[14px] leading-snug flex-1 cursor-pointer hover:bg-black/5 rounded px-1 transition-colors`,onClick:()=>_.image?Ce(_.image):Fi(_),children:i.jsx(NE,{originalText:Be,senderLanguage:_.senderLanguage,userLanguage:f.pais_idioma||"es"})}),G&&i.jsx("button",{type:"button",onClick:wn=>{wn.stopPropagation(),ro(_.id||L.toString(),Be,_.audio||_.audioBase64||_.voiceAudio)},className:`px-2 py-1 rounded-lg transition-all flex items-center gap-1.5 shrink-0 ${Xc===(_.id||L.toString())?"bg-pink-500/30 text-pink-300 border border-pink-500/50 animate-pulse shadow-[0_0_10px_rgba(236,72,153,0.3)]":"text-pink-400 hover:text-pink-200 hover:bg-white/10 bg-black/20 border border-pink-500/20"}`,title:Xc===(_.id||L.toString())?"Detener voz de Elizabeth":"Tocar para escuchar la voz de Elizabeth",children:Xc===(_.id||L.toString())?i.jsxs(i.Fragment,{children:[i.jsx(jg,{size:14,className:"text-pink-300 animate-pulse"}),i.jsx("span",{className:"text-[10px] font-bold text-pink-200",children:"Detener"})]}):i.jsxs(i.Fragment,{children:[i.jsx(xl,{size:14,className:"text-pink-400"}),i.jsx("span",{className:"text-[10px] font-bold text-pink-300",children:"Voz"})]})}),i.jsx("button",{onClick:()=>_.image?Ce(_.image):Fi(_),className:`opacity-0 group-hover:opacity-100 transition-opacity ${Zc} hover:opacity-80 p-1`,title:"Responder",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("polyline",{points:"9 14 4 9 9 4"}),i.jsx("path",{d:"M20 20v-7a4 4 0 0 0-4-4H4"})]})}),i.jsx("span",{className:`${bi} text-[11px] font-mono shrink-0 ml-auto pl-2`,children:te})]}),_.image&&i.jsx("div",{className:"mt-1.5",children:i.jsx("img",{referrerPolicy:"no-referrer",src:_.image,className:"rounded-xl border border-black/10 max-w-full shadow-md h-auto max-h-48 object-contain cursor-pointer hover:opacity-80 relative z-20",onClick:wn=>{wn.stopPropagation(),Ce(_.image)},alt:"adjunto"})}),_.video&&i.jsx("div",{className:"mt-2",children:i.jsx("video",{src:_.video,controls:!0,className:"rounded-xl border border-white/20 max-w-full shadow-md h-auto max-h-48 object-contain"})}),_.file&&i.jsx("div",{className:"mt-2 flex",children:i.jsxs("a",{href:_.file.url,download:_.file.name,className:"flex items-center gap-2 p-3 bg-white/5 hover:bg-white/10 border border-white/10 rounded-xl text-white/80 transition-colors text-sm",children:[i.jsx(IR,{size:18,className:"text-cyan-400"}),i.jsx("span",{className:"truncate max-w-[200px]",children:_.file.name})]})}),(_.isOutOfTokensNotice||G&&(((Ui=_.text)==null?void 0:Ui.includes("sin energÃa"))||((pa=_.text)==null?void 0:pa.includes("sin tokens"))||((hf=_.text)==null?void 0:hf.includes("Tokens Agotados"))||((eu=_.text)==null?void 0:eu.includes("recargar +50 tokens"))||((dd=_.text)==null?void 0:dd.includes("reproducir video"))))&&i.jsxs("div",{className:"mt-3 p-3 bg-gradient-to-r from-amber-500/20 via-orange-500/20 to-amber-500/20 border-2 border-amber-400/60 rounded-2xl flex flex-col gap-2 shadow-lg shadow-amber-500/10",children:[i.jsxs("div",{className:"flex items-center gap-2 text-amber-300 text-xs font-bold",children:[i.jsx(Fs,{size:16,className:"text-amber-400 animate-bounce"}),i.jsx("span",{children:"¡Tokens agotados! Recarga disponible"})]}),i.jsxs("p",{className:"text-white/90 text-xs leading-relaxed",children:["Toca el botón de abajo para reproducir el video patrocinado y recargar ",i.jsx("strong",{children:"+50 tokens al instante"})," para seguir hablando."]}),i.jsxs("button",{type:"button",onClick:wn=>{wn.stopPropagation(),Il(_.sender||Ve||"Elizabeth")},className:"w-full flex items-center justify-center gap-2 bg-gradient-to-r from-amber-500 via-orange-500 to-amber-500 hover:from-amber-400 hover:to-orange-400 text-white font-black py-2.5 px-3 rounded-xl shadow-[0_0_20px_rgba(245,158,11,0.5)] transition-all active:scale-95 text-xs sm:text-sm uppercase tracking-wide border border-white/30 animate-pulse cursor-pointer",children:[i.jsx(Bo,{size:17}),i.jsx("span",{children:"Reproducir video para recargar tokens (+50)"})]})]}),!G&&!_.isAi&&_.sender!=="Elizabeth"&&((ff=_.sender)==null?void 0:ff.toLowerCase())!=="elizabeth"&&!["Sensei","Shadow","Neko"].includes(_.sender)&&!VB[_.sender]&&(_.type==="audio"||_.audio)&&i.jsx("div",{className:"w-full mt-1.5",children:i.jsx(RH,{src:_.audio,styleType:f==null?void 0:f.audioVisualizerStyle,color1:f==null?void 0:f.audioVisualizerColor1,color2:f==null?void 0:f.audioVisualizerColor2})}),_.reactions&&Object.keys(_.reactions).length>0&&i.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:Object.entries(_.reactions).map(([wn,Cn])=>i.jsxs("div",{onClick:tn=>{tn.stopPropagation();const ao=Array.isArray(Cn)?Cn:Array(Cn).fill("Usuario anónimo");alert(`Reacciones ${wn}: 4338${ao.join(", ")}`)},className:"bg-black/10 text-xs px-1.5 py-0.5 rounded-full cursor-pointer hover:bg-black/20 transition-colors flex items-center gap-1",style:{color:Jo},title:Array.isArray(Cn)?Cn.join(", "):"",children:[wn," ",Array.isArray(Cn)?Cn.length:Cn]},wn))})]})})()]})]},_.id||L)}),i.jsx("div",{ref:sd,className:"h-2"})]}),i.jsxs("div",{className:"px-4 py-3 shrink-0 bg-[#18181b] relative z-10 w-full flex flex-col gap-3 pb-[calc(12px+env(safe-area-inset-bottom))]",children:[Dl[Ve]&&Dl[Ve].length>0&&i.jsx("div",{className:"text-gray-400 text-xs italic px-2",children:"Alguien está escribiendo..."}),kl&&i.jsxs("div",{className:"bg-[#27272a] rounded p-2 flex items-center justify-between text-xs text-gray-300 mx-2",children:[i.jsxs("span",{children:["Respondiendo a ",kl.sender]}),i.jsx("button",{onClick:()=>Fi(null),className:"hover:text-white transition-colors",children:i.jsx(Kt,{size:14})})]}),(bn||ed||Tr)&&i.jsxs("div",{className:"text-xs text-yellow-500 px-2 flex justify-between",children:[i.jsx("span",{children:"Archivo adjunto listo para enviar"}),i.jsx("button",{onClick:()=>{Cs(null),Tp(null),ha(null),ei(null)},children:i.jsx(Kt,{size:14})})]}),Es&&i.jsx(IH,{isPlaying:Es,onTogglePlay:()=>la(!Es),onOpenHistory:()=>Li(!0),onToast:_=>{fn(L=>[...L,{id:Date.now()+Math.random(),type:"Radio",sender:"Radio",text:_}])}}),ee&&i.jsx("div",{className:"relative",children:i.jsx(QH,{isOpen:ee,onClose:()=>
4338ve(!1),config:Gt,onChangeConfig:Js})}),Un&&An&&i.jsx("div",{className:"mb-2.5",children:i.jsx($H,{audioBlob:An,onSend:(_,L)=>{Dx(L),ln(!1),Nr(null)},onDiscard:()=>{ln(!1),Nr(null)}})}),!!(Ve&&(VB[Ve]||Ve==="Elizabeth"))&&(!!me||f.aiTokens!==void 0&&f.aiTokens<=0||f.lizCoins!==void 0&&f.lizCoins<=0&&f.aiTokens===0)&&i.jsxs("div",{className:"mb-3 p-3.5 sm:p-4 bg-gradient-to-r from-amber-950/90 via-[#1a1824] to-amber-950/90 border-2 border-amber-400/70 rounded-2xl flex flex-col sm:flex-row items-center justify-between gap-3 shadow-[0_0_25px_rgba(245,158,11,0.3)] backdrop-blur-md animate-fadeIn",children:[i.jsxs("div",{className:"flex items-center gap-3 text-left w-full sm:w-auto",children:[i.jsx("div",{className:"w-11 h-11 rounded-2xl bg-amber-500/20 border border-amber-500/50 flex items-center justify-center text-amber-300 shrink-0 shadow-md",children:i.jsx(Bo,{size:22,className:"animate-pulse text-amber-400"})}),i.jsxs("div",{children:[i.jsxs("p",{className:"text-white text-xs sm:text-sm font-extrabold flex items-center gap-1.5 flex-wrap",children:[i.jsx("span",{children:"Tokens agotados con"}),i.jsx("span",{className:"text-amber-400 font-black",children:Ve})]}),i.jsxs("p",{className:"text-gray-300 text-[11px] mt-0.5",children:["Toca el botón a continuación para reproducir el video patrocinado y recargar ",i.jsx("strong",{children:"+50 tokens al instante"})," para seguir hablando con la IA."]})]})]}),i.jsxs("button",{type:"button",onClick:()=>Il(Ve),className:"w-full sm:w-auto bg-gradient-to-r from-amber-500 via-orange-500 to-amber-500 hover:from-amber-400 hover:to-orange-400 text-white font-black text-xs sm:text-sm px-5 py-3 rounded-xl flex items-center justify-center gap-2 shadow-[0_0_20px_rgba(245,158,11,0.5)] active:scale-95 transition-all shrink-0 uppercase tracking-wide border border-white/20 animate-pulse cursor-pointer",children:[i.jsx(Bo,{size:18}),"Reproducir video para recargar tokens (+50 tokens)"]})]}),i.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[i.jsx("button",{className:"text-gray-400 hover:text-white transition-colors hidden sm:block",children:i.jsx(jm,{size:24})}),i.jsx("button",{onClick:()=>{var _;return(_=Wh.current)==null?void 0:_.click()},className:"text-gray-400 hover:text-white transition-colors",children:i.jsx(dI,{size:22})}),i.jsx("button",{onClick:()=>Dp(!Np),className:"text-gray-400 hover:text-white transition-colors",children:i.jsx(kD,{size:24})}),i.jsx("button",{className:"text-gray-400 hover:text-white transition-colors hidden sm:block",children:i.jsx(xl,{size:24})}),i.jsxs("div",{className:"flex-1 flex items-center bg-[#27272a] rounded-full px-4 py-2 relative",children:[i.jsx("input",{ref:Lt,onChange:id,onKeyDown:_=>{_.key==="Enter"&&lf()},className:"flex-1 bg-transparent outline-none text-white placeholder-gray-500 text-sm",placeholder:"Type here...",id:"chat-input-field",autoComplete:"off",spellCheck:"false"}),i.jsx("input",{type:"file",accept:"image/*",className:"hidden",ref:Wh,onChange:zp}),i.jsx("input",{type:"file",accept:"*",className:"hidden",ref:Ap,onChange:Pp})]}),i.jsxs("button",{type:"button",onClick:()=>ve(_=>!_),className:`relative transition-all p-1.5 rounded-full ${ee?"bg-cyan-500/25 text-cyan-300 border border-cyan-400 shadow-[0_0_12px_rgba(6,182,212,0.5)] scale-105":Gt.enabled?"text-cyan-400 hover:text-cyan-300 hover:bg-white/10":"text-gray-400 hover:text-white hover:bg-white/5"}`,title:"Modulador de Voz AudioContext: Desliza Frecuencia (Pitch) y Ganancia en tiempo real",id:"voice-modulator-btn",children:[i.jsx(Bh,{size:21}),Gt.enabled&&i.jsxs("span",{className:"absolute -top-0.5 -right-0.5 flex h-2.5 w-2.5",children:[i.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-cyan-400 opacity-75"}),i.jsx("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-cyan-500 border border-[#18181b]"})]})]}),i.jsx("button",{onClick:Jc,className:`transition-all p-1.5 rounded-full ${Jh?"bg-rose-600 text-white animate-pulse shadow-[0_0_15px_rgba(225,29,72,0.8)] scale-110":"text-gray-400 hover:text-white"}`,title:Jh?"Detener grabación y previsualizar":"Grabar audio con emulador de voz",id:"chat-mic-record-btn",children:i.jsx(hh,{size:22})}),i.jsx("button",{onClick:lf,className:"text-gray-400 hover:text-white transition-colors",children:i.jsx(mh,{size:24})})]}),i.jsxs("div",{className:"flex items-center justify-between text-gray-400 mt-1 px-1",children:[i.jsxs("div",{className:"flex items-center gap-4 sm:gap-5",children:[i.jsx("button",{onClick:()=>{la(_=>{const L=!_;return fn(G=>[...G,{id:Date.now()+Math.random(),type:"Radio",sender:"Radio",text:L?"ð» Radio encendida: Sonando música variada sin alabanzas":"Radio pausada"}]),L})},className:`transition-all p-1 rounded-full flex items-center justify-center ${Es?"text-amber-400 drop-shadow-[0_0_8px_rgba(251,191,36,0.6)] scale-110":"hover:text-white text-gray-400"}`,title:Es?"Pausar Radio":"Reproducir Radio (Sin alabanzas)",children:Es?i.jsx(_1,{size:22,className:"fill-current"}):i.jsx(fh,{size:22,className:"fill-current ml-0.5"})}),i.jsx("button",{onClick:()=>Li(!0),className:"hover:text-white transition-colors relative",title:"Historial de 30 músicas (Descargar en MP3)",children:i.jsx(Sh,{size:22})})]}),i.jsx("div",{className:"flex items-center gap-5 sm:gap-6",children:i.jsx("button",{onClick:()=>{fn(_=>[..._,{id:Date.now()+Math.random(),type:"Radio",sender:"Radio",text:"Modo bucle activo"}])},className:"hover:text-white transition-colors",title:"Repetición continua",children:i.jsx(_I,{size:22})})})]})]})]})]})]})]}),Ns&&Ns.isBot&&i.jsx(kH,{onClose:()=>zi(null),user:f,gameId:Ns.gameId,opponent:Ns.opponent,bet:Ns.bet,isHost:Ns.isHost}),Ns&&!Ns.isBot&&i.jsx(jH,{onClose:()=>zi(null),user:f,gameId:Ns.gameId||Ns.id,opponent:Ns.opponent,bet:Ns.bet,isHost:Ns.isHost}),i.jsx(iq,{isOpen:Zt,onClose:()=>en(!1),stats:jt,onRefresh:()=>{W.emit("get_monetization_stats",_=>{_&&At(_)})},onWithdraw:_=>{W.emit("withdraw_revenue",L=>{L&&L.stats&&At(L.stats),_(L)})}}),st&&i.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-[60] flex items-center justify-center p-4",children:i.jsxs("div",{className:"bg-[#12141c] border border-orange-500/30 w-full max-w-2xl rounded-2xl p-6 relative shadow-2xl",children:[i.jsx("button",{onClick:()=>Yn(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-white",children:i.jsx(Kt,{size:20})}),i.jsxs("h2",{className:"text-xl font-bold text-orange-400 mb-6 flex items-center gap-2",children:[i.jsx(gh,{size:24})," Panel de Reportes"]}),Tt.length===0?i.jsx("p",{className:"text-gray-400 text-center py-8",children:"No hay reportes pendientes."}):i.jsx("div",{className:"space-y-4 max-h-[70vh] overflow-y-auto pr-2",children:Tt.map(_=>i.jsxs("div",{className:"bg-white/5 p-4 rounded-xl border border-white/10 flex flex-col gap-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"text-sm",children:[i.jsx("span",{className:"text-gray-400",children:"Reportado por: "}),i.jsx("span",{className:"font-bold text-cyan-400",children:_.reporter}),i.jsx("span",{className:"text-gray-400 mx-2",children:"â¡ï¸"}),i.jsx("span",{className:"text-gray-400",children:"Acusado: "}),i.jsx("span",{className:"font-bold text-red-400",children:_.target})]}),i.jsx("span",{className:"text-xs text-gray-500",children:new Date(_.createdAt).toLocaleStr
4338ing()})]}),i.jsxs("div",{className:"bg-black/40 p-3 rounded-lg text-gray-200 text-sm",children:[i.jsx("span",{className:"text-gray-400 font-bold block mb-1",children:"Motivo:"}),_.reason]}),_.proofBase64&&i.jsxs("div",{children:[i.jsx("span",{className:"text-gray-400 font-bold block mb-2 text-sm",children:"Evidencia:"}),i.jsx("img",{src:_.proofBase64,alt:"Evidencia",className:"max-h-64 rounded-lg border border-white/10 object-contain bg-black/50"})]}),i.jsxs("div",{className:"flex gap-2 justify-end mt-2",children:[i.jsx("button",{onClick:()=>{W.emit("admin_ban_user",_.target,L=>{L.success&&alert(`${_.target} ha sido baneado.`)})},className:"px-4 py-2 bg-red-500/20 text-red-400 hover:bg-red-500/30 rounded-lg text-sm font-bold transition-colors",children:"Banear Acusado"}),i.jsx("button",{onClick:()=>{W.emit("delete_report",_.id,L=>{L.success&&(gn(G=>G.filter(ae=>ae.id!==_.id)),alert("Reporte descartado y eliminado."))})},className:"px-4 py-2 bg-gray-500/20 text-gray-300 hover:bg-gray-500/40 rounded-lg text-sm font-bold transition-colors",children:"Descartar / Resolver"})]})]},_.id))})]})}),lt&&i.jsx("div",{className:"fixed inset-0 bg-black/90 backdrop-blur-md z-[100] flex items-center justify-center p-4 cursor-pointer",onClick:()=>Qe(null),children:i.jsxs("div",{className:"relative max-w-3xl w-full flex items-center justify-center",children:[i.jsx("button",{onClick:()=>Qe(null),className:"absolute -top-12 right-0 text-white/50 hover:text-white",children:i.jsx(Kt,{size:32})}),i.jsx("img",{src:lt,alt:"Expanded Avatar",className:"max-h-[80vh] w-auto max-w-full rounded-2xl shadow-2xl object-contain border border-white/10 bg-black/50",onClick:_=>_.stopPropagation()})]})}),mt&&i.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-[60] flex items-center justify-center p-4",children:i.jsxs("div",{className:"bg-[#12141c] border border-red-500/30 w-full max-w-md rounded-2xl p-6 relative shadow-2xl",children:[i.jsx("button",{onClick:()=>tt(null),className:"absolute top-4 right-4 text-gray-400 hover:text-white",children:i.jsx(Kt,{size:20})}),i.jsxs("h2",{className:"text-xl font-bold text-red-400 mb-4 flex items-center gap-2",children:[i.jsx(tm,{size:24})," Reportar a ",mt]}),i.jsxs("form",{onSubmit:_=>{var Be;_.preventDefault();const L=_.currentTarget.elements.namedItem("reason").value,G=(Be=_.currentTarget.elements.namedItem("proof").files)==null?void 0:Be[0];if(!L||!G){alert("Por favor adjunta una captura y el motivo.");return}const ae=new FileReader;ae.onload=()=>{W.emit("report_user",{target:mt,reason:L,proofBase64:ae.result}),alert("Reporte enviado al administrador. Evaluaremos el caso."),tt(null),V(null)},ae.readAsDataURL(G)},className:"flex flex-col gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm text-gray-400 mb-1",children:"Motivo del reporte / Acusación"}),i.jsx("textarea",{name:"reason",rows:3,required:!0,placeholder:"Explica detalladamente qué sucedió...",className:"w-full bg-black/30 border border-white/10 rounded-xl px-3 py-2 text-white focus:border-red-500/50 outline-none"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-sm text-gray-400 mb-1",children:"Captura de pantalla (Obligatorio)"}),i.jsx("input",{type:"file",name:"proof",accept:"image/*",required:!0,className:"w-full text-sm text-gray-400 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-red-500/10 file:text-red-400 hover:file:bg-red-500/20"})]}),i.jsx("button",{type:"submit",className:"w-full py-3 bg-red-500 hover:bg-red-600 text-white font-bold rounded-xl transition-colors shadow-lg shadow-red-500/20",children:"Enviar Reporte"})]})]})}),Pe&&i.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:i.jsxs("div",{className:"bg-[#12141c] border border-red-500/30 w-full max-w-md rounded-2xl p-6 relative shadow-2xl",children:[i.jsx("button",{onClick:()=>Le(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-white",children:i.jsx(Kt,{size:20})}),i.jsxs("h2",{className:"text-xl font-bold text-red-400 mb-6 flex items-center gap-2",children:[i.jsx(tm,{size:24})," Usuarios Baneados"]}),Oe.length===0?i.jsx("p",{className:"text-gray-400 text-center py-8",children:"No hay usuarios baneados actualmente."}):i.jsx("div",{className:"space-y-4 max-h-[60vh] overflow-y-auto pr-2",children:Oe.map(_=>i.jsxs("div",{className:"flex items-center justify-between p-3 bg-white/5 rounded-xl border border-white/10",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(Ud,{src:_.profilePic||`https://api.dicebear.com/7.x/avataaars/svg?seed=${_.username}`,className:"w-10 h-10 bg-black/50 rounded-full",alt:_.username}),i.jsxs("div",{children:[i.jsx("div",{className:"text-white font-bold",children:_.username}),i.jsxs("div",{className:"text-xs text-red-300",children:["Expira: ",new Date(_.expiresAt).toLocaleTimeString()]})]})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{onClick:()=>{W.emit("admin_unban_user",_.username,L=>{L.success&&(vt(G=>G.filter(ae=>ae.username!==_.username)),alert(`${_.username} fue desbaneado.`))})},className:"px-3 py-1 bg-green-500/20 text-green-400 hover:bg-green-500/30 rounded-lg text-sm font-medium transition-colors",children:"Desbanear"}),i.jsx("button",{onClick:()=>{W.emit("admin_ban_user",_.username,L=>{L.success&&(W.emit("get_banned_users",G=>vt(G)),alert(`${_.username} fue baneado (renovado).`))})},className:"px-3 py-1 bg-red-500/20 text-red-400 hover:bg-red-500/30 rounded-lg text-sm font-medium transition-colors",title:"Renovar Ban (15 min)",children:"Bloquear"})]})]},_.username))})]})}),i.jsx(OH,{isOpen:Gc,onClose:()=>Li(!1),songs:pi,onPlaySong:_=>{la(!0),fn(L=>[...L,{id:Date.now()+Math.random(),type:"Radio",sender:"Radio",text:`ðµ Reproduciendo en la radio: ${_.title}`}])},onToast:_=>{fn(L=>[...L,{id:Date.now()+Math.random(),type:"Radio",sender:"Radio",text:_}])}}),i.jsx(OF,{isOpen:os,onClose:()=>Hn(!1),chatId:Ve==="global"?"global":[f.username,Ve].sort().join("_"),chatTitle:Ve==="global"?"Chat Global":Ve,isGlobal:Ve==="global",currentConfig:Ve==="global"?Qt:_t,onSaveConfig:tf,onResetConfig:Ip,onOpenSyncToAxis:()=>_n(!0)}),i.jsx(LH,{isOpen:Sl,onClose:()=>_n(!1),currentGlobalConfig:Qt,onToast:zo}),da&&i.jsx(rq,{isOpen:da,onClose:()=>Wa(!1),roomData:Ht,currentUser:f.username,isMasterAdmin:Os,onRoomUpdated:_=>{Xa(_),zo("⨠Configuración de sala actualizada")},onCleanRoomNow:()=>{cs([]),zo("ð§¹ Sala limpiada")}}),i.jsx(tq,{isOpen:C,onClose:()=>N(!1),currentBg:Al,isAdmin:Os,defaultMode:T,activeRoomId:Ve.startsWith("room_")?Ve:null,onApplyPersonalBg:_=>{_?(localStorage.setItem("chatliz_personal_bg",_),window.dispatchEvent(new CustomEvent("chatliz_personal_bg_changed",{detail:_}))):(localStorage.removeItem("chatliz_personal_bg"),window.dispatchEvent(new CustomEvent("chatliz_personal_bg_changed",{detail:null}))),p(L=>({...L,preferred_background:_}))},onApplyRoomBg:_=>{Ht&&Xa(L=>({...L,backgroundUrl:_}))},onToast:zo}),x&&i.jsx(e7,{user:f,setUser:p,setIsConfigOpen:b,setAdminConfigAiOpen:Q,usersOnline:qn,setAiProfileForm:Ee,customFrames:Ha}),Y&&i.jsx(n7,{setOpen:k,currentShaders:E,onPreview:_=>O(_),onSave:_=>{O(null),W.emit("update_shaders",_)}}
4338),H&&Os&&i.jsx(t7,{aiUsername:F,setAdminConfigAiOpen:Q,aiProfileForm:be,setAiProfileForm:Ee}),i.jsx(HA,{isOpen:xs,onClose:()=>He(!1),initialTab:Us}),i.jsx("div",{className:"fixed top-20 right-4 z-[200] flex flex-col gap-2 pointer-events-none",children:Ka.map(_=>{const L=qn.find(ae=>ae.username===_.sender)||ns[_.sender],G=(L==null?void 0:L.profilePic)||`https://api.dicebear.com/7.x/avataaars/svg?seed=${_.sender}`;return i.jsxs("div",{onClick:()=>{Xr(!1),Ja(!1),Rt(_.sender),fn(ae=>ae.filter(Be=>Be.id!==_.id))},className:"pointer-events-auto cursor-pointer bg-[#0f111a]/95 backdrop-blur-md border border-white/10 shadow-[0_4px_20px_rgba(212,175,55,0.15)] rounded-2xl p-3 flex items-center gap-3 w-72 animate-in fade-in slide-in-from-top-4 transition-all hover:bg-white/5",children:[i.jsx("img",{referrerPolicy:"no-referrer",src:G,alt:_.sender,className:"w-10 h-10 rounded-full object-cover border border-white/5"}),i.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[i.jsx("span",{className:"text-white font-bold text-sm truncate",children:_.sender}),i.jsx("span",{className:"text-gray-400 text-xs truncate",children:_.text})]})]},_.id)})}),Ft&&i.jsx(i7,{caller:Ft,onAccept:()=>{W.emit("responder_llamada",{targetUser:Ft.username,accepted:!0}),nn({partner:Ft,isInitiator:!1}),on(null)},onReject:()=>{W.emit("responder_llamada",{targetUser:Ft.username,accepted:!1}),on(null)}}),Zn&&i.jsx(u7,{partner:Zn,onCancel:()=>{W.emit("cancelar_llamada",Zn.username),Fn(null)}}),In&&i.jsx(c7,{partner:In.partner,isInitiator:In.isInitiator,onEndCall:()=>{nn(null)}}),A&&i.jsx(PH,{usersOnline:qn,onClose:()=>U(!1),userCoins:f.lizCoins||0,socket:W,onSelect:_=>{U(!1),Xr(!1),Rt(_)}}),me&&i.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-md z-[130] flex items-center justify-center p-4 animate-in fade-in duration-200",children:i.jsxs("div",{className:"bg-[#12141c] border-2 border-amber-400/50 p-6 sm:p-8 rounded-3xl w-full max-w-sm shadow-[0_0_50px_rgba(245,158,11,0.25)] relative text-center",children:[i.jsx("button",{onClick:()=>De(null),className:"absolute top-4 right-4 text-gray-400 hover:text-white bg-white/5 hover:bg-white/10 p-2 rounded-full transition-colors",children:i.jsx(Kt,{size:20})}),i.jsx("div",{className:"w-16 h-16 bg-amber-500/15 rounded-2xl flex items-center justify-center mx-auto mb-4 border border-amber-500/30 text-amber-400 shadow-md",children:i.jsx(Fs,{size:32,className:"animate-bounce"})}),i.jsx("h2",{className:"text-xl sm:text-2xl font-black text-white mb-2",children:"¡Tokens Agotados!"}),i.jsxs("p",{className:"text-gray-300 text-xs sm:text-sm mb-6 leading-relaxed",children:["Para seguir chateando con ",i.jsx("span",{className:"font-extrabold text-amber-400",children:me}),", pulsa el botón para reproducir el video y recargar tus tokens."]}),i.jsxs("button",{onClick:()=>{const _=me;De(null),Il(_)},className:"w-full flex items-center justify-center gap-2 bg-gradient-to-r from-amber-500 via-orange-500 to-amber-500 hover:from-amber-400 hover:to-orange-400 text-white font-black py-3.5 px-4 rounded-2xl shadow-[0_0_20px_rgba(245,158,11,0.4)] transition-transform active:scale-95 text-xs sm:text-sm uppercase tracking-wide border border-white/20 cursor-pointer",children:[i.jsx(Bo,{size:18}),"Reproducir video para recargar tokens (+50 tokens)"]})]})}),we&&i.jsx("div",{className:"fixed inset-0 bg-black/90 backdrop-blur-lg z-[140] flex items-center justify-center p-4 animate-in fade-in duration-200",children:i.jsxs("div",{className:"bg-[#12141c] border-2 border-amber-400/60 p-5 sm:p-7 rounded-3xl w-full max-w-md
4338shadow-[0_0_60px_rgba(245,158,11,0.35)] relative text-center flex flex-col gap-4",children:[i.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-white/10",children:[i.jsxs("div",{className:"flex items-center gap-2 text-amber-400 font-extrabold text-sm sm:text-base",children:[i.jsx(Bo,{size:20,className:"animate-pulse"}),i.jsx("span",{children:"Video Patrocinado - Recarga de Tokens"})]}),i.jsx("button",{onClick:()=>{$e(!1),Ue(null)},className:"text-gray-400 hover:text-white bg-white/5 hover:bg-white/10 p-1.5 rounded-full transition-colors",title:"Cerrar reproductor",children:i.jsx(Kt,{size:18})})]}),i.jsxs("div",{className:"relative w-full aspect-video bg-black/90 rounded-2xl overflow-hidden border border-amber-500/30 flex flex-col items-center justify-center group shadow-inner",children:[i.jsx("div",{className:"absolute inset-0 bg-gradient-to-tr from-amber-950/40 via-purple-950/30 to-blue-950/40 animate-pulse"}),i.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-3 p-4",children:[i.jsx("div",{className:"w-16 h-16 rounded-full bg-amber-500/20 border-2 border-amber-400/70 flex items-center justify-center text-amber-300 shadow-[0_0_25px_rgba(245,158,11,0.5)]",children:i.jsx(Bo,{size:32,className:"animate-bounce text-amber-400"})}),i.jsxs("div",{className:"text-center",children:[i.jsx("p",{className:"text-white font-black text-sm sm:text-base tracking-wide",children:"Patrocinador Oficial de ChatLiz"}),i.jsxs("p",{className:"text-amber-300/80 text-xs mt-1",children:["Recargando energÃa para hablar con ",i.jsx("span",{className:"font-bold text-amber-400",children:ge||"Elizabeth"})]})]})]}),i.jsxs("div",{className:"absolute bottom-0 inset-x-0 bg-black/70 backdrop-blur-sm p-2.5 flex items-center justify-between text-xs text-white z-20",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500 animate-ping"}),i.jsx("span",{className:"font-semibold text-gray-300",children:et>0?`Recompensa en ${et}s`:"¡Video completado!"})]}),i.jsx("div",{className:"w-28 sm:w-36 bg-white/20 h-2 rounded-full overflow-hidden",children:i.jsx("div",{className:"bg-gradient-to-r from-amber-400 to-orange-500 h-full transition-all duration-1000 ease-linear",style:{width:`${(5-et)/5*100}%`}})})]})]}),et>0?i.jsxs("div",{className:"py-2",children:[i.jsxs("p",{className:"text-xs text-gray-400 mb-2",children:["Reproduciendo video publicitario... Espera ",et,"s para recibir tus tokens."]}),i.jsx("button",{type:"button",onClick:()=>{io(ge||"Elizabeth"),$e(!1)},className:"text-xs text-amber-400 hover:text-amber-300 underline font-medium cursor-pointer",children:"Omitir espera y recargar +50 tokens ahora"})]}):i.jsxs("button",{type:"button",onClick:()=>{io(ge||"Elizabeth"),$e(!1)},className:"w-full flex items-center justify-center gap-2 bg-gradient-to-r from-amber-500 via-orange-500 to-amber-500 hover:from-amber-400 hover:to-orange-400 text-white font-black py-3.5 px-4 rounded-2xl shadow-[0_0_25px_rgba(245,158,11,0.5)] transition-transform active:scale-95 text-xs sm:text-sm uppercase tracking-wide border border-white/30 animate-bounce cursor-pointer",children:[i.jsx(Fs,{size:18}),i.jsx("span",{children:"¡Reclamar +50 Tokens y Seguir Hablando!"})]})]})}),Rn&&i.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[110] flex items-center justify-center p-4",children:i.jsxs("div",{className:"bg-[#12141c] p-6 rounded-3xl w-full max-w-sm shadow-2xl relative border border-cyan-500/30",children:[i.jsx("button",{onClick:()=>zn(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-white bg-white/5 hover:bg-white/10 p-2 rounded-full transition-colors",children:i.jsx(Kt,{size:20})}),i.jsxs("h2",{className:"text-xl font-bold text-white mb-6 flex items-center justify-center gap-2",children:[i.jsx(_u,{className:"text-cyan-400"})," Solicitudes"]}),i.jsx("div",{className:"max-h-64 overflow-y-auto space-y-3",children:!f.friend_requests||f.friend_requests.length===0?i.jsx("p",{className:"text-center text-gray-500 py-4",children:"No tienes solicitudes pendientes."}):f.friend_requests.map(_=>{const L=qn.find(ae=>ae.username===_)||ns[_],G=(L==null?void 0:L.profilePic)||`https://api.dicebear.com/7.x/avataaars/svg?seed=${_}`;return i.jsxs("div",{className:"flex items-center justify-between p-3 bg-white/5 border border-white/10 rounded-xl",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("img",{src:G,className:"w-10 h-10 rounded-full border border-cyan-500/30"}),i.jsx("span",{className:"text-white font-medium",children:_})]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{onClick:()=>
4338{W.emit("accept_friend_request",_,ae=>{ae.success&&p(Be=>{var We;return{...Be,friend_requests:((We=Be.friend_requests)==null?void 0:We.filter(X=>X!==_))||[],friends_list:[...Be.friends_list||[],_]}})})},className:"w-8 h-8 rounded-full bg-green-500/20 text-green-400 flex items-center justify-center hover:bg-green-500/40 font-bold",children:"â"}),i.jsx("button",{onClick:()=>{W.emit("reject_friend_request",_,ae=>{ae.success&&p(Be=>{var We;return{...Be,friend_requests:((We=Be.friend_requests)==null?void 0:We.filter(X=>X!==_))||[]}})})},className:"w-8 h-8 rounded-full bg-red-500/20 text-red-400 flex items-center justify-center hover:bg-red-500/40 font-bold",children:"â"})]})]},_)})})]})}),M&&i.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-md z-[120] flex items-center justify-center p-4 overflow-y-auto overscroll-none",onClick:()=>V(null),style:{overscrollBehavior:"none"},children:i.jsxs("div",{className:"bg-[#0f111a] rounded-[32px] w-full max-w-md shadow-2xl relative overflow-hidden border border-white/10 my-8 mt-16",onClick:_=>_.stopPropagation(),children:[i.jsx("div",{className:"h-32 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 relative",children:i.jsx("button",{onClick:()=>V(null),className:"absolute top-4 right-4 text-white hover:text-white bg-black/50 hover:bg-black/70 p-3 rounded-full transition-all shadow-lg z-50 border border-white/20",children:i.jsx(Kt,{size:24,strokeWidth:3})})}),i.jsxs("div",{className:"px-6 pb-6 relative",children:[i.jsxs("div",{className:"absolute -top-16 left-1/2 -translate-x-1/2",children:[i.jsxs("div",{className:`w-32 h-32 rounded-full border-4 border-[#0f111a] relative shadow-lg ${M.isAi&&Os?"cursor-pointer group":""}`,onClick:()=>{M.isAi&&Os&&(Ee({profilePic:M.profilePic||"",statusMessage:M.statusMessage||"Inteligencia Artificial",systemInstruction:M.systemInstruction||""}),S(M.username),V(null),Gs(),Q(!0))},children:[i.jsx(Ud,{src:M.profilePic||`https://api.dicebear.com/7.x/avataaars/svg?seed=${M.username}`,frameId:M.frameId,className:"w-full h-full bg-white/5",alt:M.username}),M.isAi&&Os&&i.jsxs("div",{className:"absolute inset-0 bg-black/60 flex flex-col items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:[i.jsx(gl,{size:24,className:"text-white/80 mb-1"}),i.jsx("span",{className:"text-white text-xs font-bold text-center px-2",children:"Configurar IA"})]})]}),i.jsxs("div",{className:"absolute bottom-1 right-2 bg-gradient-to-r from-amber-400 to-amber-600 text-black text-[10px] font-bold px-2 py-0.5 rounded-full border-2 border-[#0f111a] shadow-md flex items-center gap-1",children:[i.jsx(xR,{size:10})," ",M.lizCoins||0]})]}),i.jsxs("div",{className:"pt-20 text-center",children:[i.jsxs("h3",{className:"text-2xl font-bold text-white flex items-center justify-center gap-2 mb-1",children:[M.username,M.role==="admin"&&i.jsx("span",{className:"bg-gradient-to-r from-fuchsia-500 to-purple-600 text-white text-[10px] px-2 py-0.5 rounded-full uppercase tracking-wider font-bold shadow-sm",children:"Admin"}),M.incognito&&i.jsxs("span",{title:"Usuario en Modo Incógnito (No revelar en el chat)",className:"inline-flex items-center gap-1 bg-amber-500/20 text-amber-300 text-[10px] font-bold px-2 py-0.5 rounded-full border border-amber-500/40 shadow-sm",children:[i.jsx(rl,{size:11,className:"text-amber-400"}),i.jsx("span",{children:"Incógnito"})]})]}),i.jsx("div",{className:"flex items-center justify-center gap-2 mb-3",children:i.jsxs("span",{title:"ID único permanente e inmutable. No cambia aunque el usuario cambie su nombre.",className:"inline-flex items-center gap-1 px-3 py-1 rounded-full bg-cyan-500/10 border border-cyan-500/30 text-cyan-300 font-mono text-xs font-bold shadow-sm",children:[i.jsxs("span",{children:["ID: #",M.uid||(M.username.toUpperCase()==="AXISS"?"1001":M.username==="Elizabeth"?"1000":"N/A")]}),i.jsx("span",{className:"text-[10px] text-cyan-400/70 font-sans font-medium",children:"⢠Fijo"})]})}),M.incognito&&i.jsxs("div",{className:"bg-amber-500/15 border border-amber-500/40 rounded-2xl p-3 mb-4 mx-2 text-left flex items-start gap-2.5 shadow-md animate-in fade-in",children:[i.jsx("div",{className:"p-1.5 rounded-xl bg-amber-500/25 text-amber-400 shrink-0 mt-0.5",children:i.jsx(rl,{size:16})}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-amber-300 font-bold text-xs uppercase tracking-wide",children:"Modo Incógnito"}),i.jsx("span",{className:"text-[9px] font-bold bg-amber-500/30 text-amber-200 px-1.5 py-0.5 rounded border border-amber-500/50",children:"Solo Admins"})]}),i.jsxs("p",{className:"text-[11px] text-amber-200/90 mt-0.5 leading-snug",children:["Este usuario está navegando oculto y los demás usuarios no lo ven conectado. Por favor, ",i.jsx("strong",{children:"no lo nombres ni delates su presencia"}
4338)," en el chat público si solo desea leer o estar tranquilo."]})]})]}),i.jsxs("div",{className:"flex justify-center items-center gap-2 mb-4 text-xs text-gray-400",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(vu,{size:12})," ",M.pais_idioma||M.countryLanguage||"Global"]}),i.jsx("span",{children:"â¢"}),i.jsxs("span",{className:"flex items-center gap-1 text-pink-400",children:[i.jsx(Sm,{size:12,className:"fill-pink-400"})," ",M.profileLikes||0," Likes"]})]}),i.jsx("div",{className:"bg-white/5 border border-white/10 p-4 rounded-2xl relative mb-6",children:i.jsxs("p",{className:"text-gray-300 italic text-sm",children:['"',M.statusMessage||"Disponible",'"']})}),M.username===f.username?i.jsxs("button",{onClick:()=>{V(null),b(!0)},className:"w-full flex items-center justify-center gap-2 bg-white/10 hover:from-cyan-500 hover:to-blue-500 text-white p-3 rounded-xl font-bold transition-all shadow-lg shadow-cyan-500/20 mb-6",children:[i.jsx(Sy,{size:18}),"Configurar Perfil"]}):i.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-6",children:[i.jsxs("button",{onClick:()=>{window.history.pushState({},"","/chat/"+encodeURIComponent(M.username)),Jt(M.username),V(null),Xr(!1),BB(M.username,"CHAT",f.username)},className:"flex items-center justify-center gap-2 bg-white/10 hover:bg-white/20 text-white p-3 rounded-xl font-bold transition-colors border border-white/5",children:[i.jsx(Th,{size:18})," Chat"]}),(()=>{const _=Array.isArray(M.profileLikedBy)?M.profileLikedBy.includes(f.username):!1;return i.jsxs("button",{onClick:()=>{_?(V(L=>L?{...L,profileLikes:Math.max(0,(L.profileLikes||1)-1),profileLikedBy:(L.profileLikedBy||[]).filter(G=>G!==f.username)}:null),W.emit("like_user",M.username,L=>{L&&L.success&&V(G=>G?{...G,profileLikes:L.likes,profileLikedBy:L.likedBy}:null)})):(V(L=>L?{...L,profileLikes:(L.profileLikes||0)+1,profileLikedBy:[...L.profileLikedBy||[],f.username]}:null),W.emit("like_user",M.username,L=>{L&&L.success&&V(G=>G?{...G,profileLikes:L.likes,profileLikedBy:L.likedBy}:null)}),BB(M.username,"LIKE",f.username),W.emit("send_user_like",{to:M.username,from:f.username,fromPic:f.profilePic||"",type:"heart"}))},className:`flex items-center justify-center gap-2 p-3 rounded-xl font-bold transition-all border ${_?"bg-pink-500 text-white border-pink-400 shadow-[0_0_15px_rgba(236,72,153,0.35)]":"bg-pink-500/10 hover:bg-pink-500/20 text-pink-400 border-pink-500/20"}`,children:[i.jsx(Sm,{size:18,className:_?"fill-current":""}),_?"Te gusta":"Like"]})})(),(()=>{var G;if(((G=f.friends_list)==null?void 0:G.includes(M.username))||(Pr==null?void 0:Pr.some(ae=>ae.username===M.username)))return i.jsxs("button",{onClick:()=>{window.confirm(`¿Estás seguro que quieres eliminar a ${M.username} de tus amigos?`)&&(rf(M.username),V(null))},className:"col-span-2 flex items-center justify-center gap-2 bg-red-500/10 hover:bg-red-500/20 text-red-400 border border-red-500/20 p-3 rounded-xl font-bold transition-colors",children:[i.jsx(sO,{size:18})," Eliminar Amigo"]});const L=Dr.find(ae=>ae.from===M.username);return L?i.jsxs("button",{onClick:()=>{sf(L),V(null)},className:"col-span-2 flex items-center justify-center gap-2 bg-emerald-500/20 hover:bg-emerald-500/30 text-emerald-400 border border-emerald-500/30 p-3 rounded-xl font-bold transition-colors",children:[i.jsx(jy,{size:18})," Aceptar Solicitud Pendiente"]}):i.jsxs("button",{onClick:()=>{W.emit("send_friend_request",{to:M.username,from:f.username,fromPic:f.profilePic||""}),Fh(zs(ft,"friendRequests"),{from:f.username,to:M.username,status:"pending",timestamp:Date.now(),createdAt:Date.now()}).then(ae=>{BB(M.username,"REQUEST",f.username,{frData:{from:f.username,docId:ae.id}})}).catch(()=>{}),V(null),alert("â
Solicitud de amistad enviada correctamente")},className:"col-span-2 flex items-center justify-center gap-2 bg-cyan-500/10 hover:bg-cyan-500/20 text-cyan-400 border border-cyan-500/20 p-3 rounded-xl font-bold transition-colors",children:[i.jsx(_u,{size:18})," Enviar Solicitud de Amistad"]})})()]}),i.jsxs("div",{className:"bg-[#1a1d2d] rounded-2xl overflow-hidden mb-6 border border-white/5 text-left",children:[i.jsxs("div",{className:"p-4 bg-white/5 border-b border-white/5 flex items-center gap-2",children:[i.jsx(Na,{size:16,className:"text-cyan-400"}),i.jsx("h4",{className:"font-bold text-white text-sm",children:aa("friends")})]}),i.jsx("div",{className:"p-4 max-h-40 overflow-y-auto space-y-3",children:M.username===f.username||M.is_friends_public?(Fp=M.username===f.username?f.friends_list:M.friends_list)!=null&&Fp.length?(fa=M.username===f.username?f.friends_list:M.friends_list)==null?void 0:fa.map(_=>{const L=qn.find(ae=>ae.username===_)||ns[_],G=(L==null?void 0:L.profilePic)||`https://api.dicebear.com/7.x/avataaars/svg?seed=${_}`;return i.jsxs("div",{className:"flex items-center justify-between group",children:[i.jsxs("div",{className:"flex items-center gap-3 cursor-pointer",onClick:()=>{L&&V(L)},children:[i.jsx("img",{src:G,className:"w-8 h-8 rounded-full bg-black/50 object-cover"}),i.jsx("span",{className:"text-gray-300 text-sm font-medium hover:text-white transition-colors",children:_})]}),M.username===f.username&&i.jsx("button",{onClick:()=>{window.confirm(`¿Estás seguro que quieres eliminar a ${_} de tus amigos?`)&&(W.emit("remove_friend",_),p(ae=>{var Be;return{...ae,friends_list:(Be=ae.friends_list)==null?void 0:Be.filter(We=>We!==_)}}))},className:"text-gray-500 hover:text-red-400 opacity-0 group-hover:opacity-100 transition-all p-1",children:i.jsx(Vs,{size:16})})]},_)}):i.jsx("p",{className:"text-sm text-gray-500 italic text-center",children:"No hay amigos en la lista."}):i.jsx("p",{className:"text-sm text-gray-500 italic text-center",children:"La lista de amigos de este usuario es privada."})})]}),i.jsxs("div",{className:"bg-[#1a1d2d] rounded-2xl overflow-hidden mb-2 border border-white/5 text-left",children:[i.jsx("div",{className:"p-4 bg-white/5 border-b border-white/5 flex items-center justify-between",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(OE,{size:16,className:"text-amber-400 fill-amber-400"}),i.jsx("h4",{className:"font-bold text-white text-sm",children:"Comentarios"})]})}),i.jsx("div",{className:"p-4 max-h-48 overflow-y-auto space-y-3",children:!M.profileComments||M.profileComments.length===0?i.jsx("p",{className:"text-sm text-gray-500 italic text-center",children:"No hay comentarios aún."}):M.profileComments.map((_,L)=>i.jsxs("div",{className:"bg-black/30 p-3 rounded-xl border border-white/5",children:[i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsx("span",{className:"font-bold text-cyan-400 text-xs",children:_.author}),_.stars&&i.jsx("div",{className:"flex gap-0.5",children:[...Array(5)].map((G,ae)=>
4338i.jsx(OE,{size:10,className:ae<_.stars?"text-amber-400 fill-amber-400":"text-gray-600"},ae))})]}),i.jsx("p",{className:"text-gray-300 text-sm leading-relaxed",children:_.text})]},L))}),M.username!==f.username&&i.jsx("div",{className:"p-4 bg-black/20 border-t border-white/5",children:i.jsxs("form",{onSubmit:_=>{_.preventDefault();const L=_.currentTarget.elements.namedItem("comment"),G=_.currentTarget.elements.namedItem("stars");if(L.value.trim()){const ae=parseInt(G.value);W.emit("add_profile_comment",{targetUser:M.username,comment:L.value,stars:ae}),V(Be=>Be?{...Be,profileComments:[...Be.profileComments||[],{author:f.username,text:L.value,timestamp:Date.now(),stars:ae}]}:null),L.value="",G.value="5"}},className:"flex flex-col gap-2",children:[i.jsxs("div",{className:"flex gap-2",children:[i.jsxs("select",{name:"stars",className:"bg-black/40 border border-white/10 rounded-xl px-2 py-2 text-sm text-white focus:outline-none focus:border-cyan-500/50",children:[i.jsx("option",{value:"5",children:"âââââ"}),i.jsx("option",{value:"4",children:"ââââ"}),i.jsx("option",{value:"3",children:"âââ"}),i.jsx("option",{value:"2",children:"ââ"}),i.jsx("option",{value:"1",children:"â"})]}),i.jsx("input",{name:"comment",type:"text",placeholder:"Escribe un comentario...",className:"flex-1 bg-black/40 border border-white/10 rounded-xl px-3 py-2 text-sm text-white focus:outline-none focus:border-cyan-500/50"})]}),i.jsx("button",{type:"submit",className:"w-full bg-white/10 text-white px-3 py-2 rounded-xl text-sm font-bold hover:bg-white/20 transition-colors",children:"Enviar Comentario"})]})})]}),M.username!==f.username&&i.jsxs("div",{className:"flex flex-col items-center gap-2 mt-4",children:[i.jsx("button",{onClick:()=>tt(M.username),className:"text-xs text-gray-500 hover:text-red-400 underline decoration-dotted underline-offset-4",children:"Reportar Usuario"}),Os&&i.jsx("button",{onClick:()=>{confirm(`¿Estás seguro de que quieres eliminar la cuenta de ${M.username}?`)&&W.emit("admin_delete_user",M.username,_=>{_.success?(alert("Cuenta eliminada y correo enviado."),V(null)):alert("Error: "+_.error)})},className:"mt-2 bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-xl text-sm font-bold shadow-[0_0_15px_rgba(220,38,38,0.5)] transition-all",children:"ELIMINAR CUENTA (Admin)"}),f.username.toUpperCase()==="AXISS"&&M.role!=="admin"&&M.username.toUpperCase()!=="AXISS"&&i.jsx("button",{onClick:()=>{confirm(`¿Promover a ${M.username} como Administrador?`)&&W.emit("admin_promote_user",M.username,_=>{_.success&&(alert("Usuario promovido a Administrador."),V(null))})},className:"mt-2 bg-purple-600 hover:bg-purple-700 text-white px-4 py-2 rounded-xl text-sm font-bold shadow-[0_0_15px_rgba(147,51,234,0.5)] transition-all",children:"PROMOVER A ADMIN"})]})]})]})]})}),Wu&&i.jsxs("div",{className:"fixed inset-y-0 right-0 w-80 bg-[#0f111a] backdrop-blur-md border-l border-white/10 shadow-2xl z-[105] flex flex-col transform transition-transform animate-in slide-in-from-right",children:[i.jsxs("div",{className:"p-6 border-b border-white/5 flex items-center justify-between",children:[i.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[i.jsx(fl,{size:24,className:"text-cyan-400"}),"Buzón de Mensajes"]}),i.jsx("button",{onClick:()=>Ja(!1),className:"text-gray-400 hover:text-white p-2 rounded-full hover:bg-white/10 transition-colors",children:i.jsx(Kt,{size:20})})]}),i.jsx("div",{className:"flex-1 overflow-y-auto p-4 space-y-2",children:zr.length===0?i.jsx("p",{className:"text-gray-500 text-center text-sm mt-10",children:"Tu buzón está vacÃo. ¡Empieza a chatear!"}):zr.map(_=>{const L=_.withUser,G=qn.some(Be=>Be.username===L),ae=qn.find(Be=>Be.username===L)||ns[L];return i.jsxs("div",{className:"flex items-center gap-2 group p-2 rounded-xl hover:bg-white/5 transition-colors border border-transparent hover:border-white/5",children:[i.jsxs("div",{onClick:()=>{Rt(L),Hc(Be=>({...Be,[L]:!1})),Ja(!1)},className:"flex-1 flex items-center gap-3 cursor-pointer min-w-0",children:[i.jsxs("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-gray-700 to-gray-800 border border-white/5 overflow-hidden relative flex-shrink-0",children:[i.jsx("img",{referrerPolicy:"no-referrer",src:(ae==null?void 0:ae.profilePic)||`https://api.dicebear.com/7.x/avataaars/svg?seed=${L}`,className:"w-full h-full object-cover"}),i.jsx("div",{className:`absolute bottom-0 right-0 w-3 h-3 rounded-full border-2 border-[#0f111a] ${G?"bg-green-500":"bg-gray-500"}`})]}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("p",{className:"text-white font-medium text-sm truncate",children:L}),Fo[L]&&i.jsx("div",{className:"w-2 h-2 rounded-full bg-cyan-500 ml-2"})]}),i.jsx("p",{className:`text-sm truncate ${Fo[L]?"text-white font-semibold":"text-gray-400"}`,children:_.lastMessage||"Conversación"})]})]}),i.jsx("button",{onClick:Be=>{Be.stopPropagation(),window.confirm("¿Eliminar esta conversación de tu buzón?")&&am(Tn(ft,"userChats",f.username,"chats",L))},className:"p-2 text-gray-500 hover:text-red-400 hover:bg-red-500/10 rounded-full opacity-0 group-hover:opacity-100 transition-all flex-shrink-0",title:"Eliminar del buzón",children:i.jsx(Vs,{size:16})})]},L)})})]}),Mi&&i.jsx(s7,{onClose:()=>ca(!1),user:f,onSelectGame:_=>{if(_.startsWith("chess_")){const L=parseInt(_.split("_")[1],10),G=isNaN(L)?10:L;if((f.lizCoins||0)<G){alert("No tienes suficientes Liz-Moneditas.");return}const ae={id:Date.now().toString(),text:G>0?`¡Reto de Ajedrez por ${G*2} LM!`:"¡Reto de Ajedrez Amistoso!",type:"chess_invite",sender:f.username,senderId:f.username,avatar:f.profilePic,inviteData:{gameId:`chess_${Date.now()}_${f.username}`,bet:G,host:f.username,gameType:"chess"}};W.emit("send_global",ae),Rt("global"),cs(Be=>[...Be,ae]),setTimeout(Vr,100)}else if(_.startsWith("chessbot_")){const L=parseInt(_.split("_")[1],10),G=isNaN(L)?10:L;if((f.lizCoins||0)<G){alert("No tienes suficientes Liz-Moneditas.");return}W.emit("start_chess_bot",{bet:G},ae=>{ae.success?zi({gameId:ae.gameId,opponent:{username:"Elizabeth_Bot",elo:800,profilePic:"https://api.dicebear.com/7.x/bottts/svg?seed=Elizabeth"},bet:G,isHost:!0,isBot:!0}):alert(ae.error||"Error al iniciar vs Bot")})}}}),bx&&i.jsx(MH,{onClose:()=>nd(!1),onSubmit:(_,L,G)=>{W.emit("song_request",{title:_,url:L,dedication:G}),nd(!1),Xh(!1)}}),xx&&i.jsx(r7,{onClose:()=>jp(!1),user:f,decorations:cD,initialCategory:Yh,onSelectGame:_=>{if(_.startsWith("chess_")){const L=parseInt(_.split("_")[1],10),G=isNaN(L)?10:L;if((f.lizCoins||0)<G){alert("No tienes suficientes Liz-Moneditas.");return}const ae={id:Date.now().toString(),text:G>0?`¡Reto de Ajedrez por ${G*2} LM!`:"¡Reto de Ajedrez Amistoso!",type:"chess_invite",sender:f.username,senderId:f.username,avatar:f.profilePic,inviteData:{gameId:`chess_${Date.now()}_${f.username}`,bet:G,host:f.username,gameType:"chess"}};W.emit("send_global",ae),Rt("global"),cs(Be=>[...Be,ae]),setTimeout(Vr,100)}else if(_.startsWith("chessbot_")){const L=parseInt(_.split("_")[1],10),G=isNaN(L)?10:L;if((f.lizCoins||0)<G){alert("No tienes suficientes Liz-Moneditas.");return}W.emit("start_chess_bot",{bet:G},ae=>{ae.success?zi({gameId:ae.gameId,opponent:{username:"Elizabeth_Bot",elo:800,profilePic:"https://api.dicebear.com/7.x/bottts/svg?seed=Elizabeth"},bet:G,isHost:!0,isBot:!0}):alert(ae.error||"Error al iniciar vs Bot")})}}}),Ho&&i.jsx(zH,{isOpen:Ho,onClose:()=>no(!1),messageCount:Ve==="global"?Ls.length:0,maxLimit:20,lastMessage:Ls.length>0?Ls[Ls.length-1]:null,onCleanKeepLast:async()=>new Promise((_,L)=>{W.emit("clean_global_room_keep_last",G=>{G&&G.success?_():L(new Error((G==null?void 0:G.error)||"Error al limpiar sala"))})}),onClearAll:async()=>new Promise((_,L)=>{W.emit("clear_global_chat",G=>{G&&G.success?_():L(new Error((G==null?void 0:G.error)||"Error al vaciar sala"))})}),onReplyLastMessage:()=>{Ls.length>0&&(Fi(Ls[Ls.length-1]),no(!1),Lt.current&&Lt.current.focus())},isAdmin:f.username.toUpperCase()==="AXISS"}),jn&&i.jsx(ZH,{isOpen:jn,onClose:()=>On(!1),currentUser:f,messagesCount:Ls.length,delegatedAdmins:Oi,bannedUsers:Xn,allUsersList:qn.map(_=>({username:_.username,profilePic:_.profilePic,role:Oi.includes(_.username)||_.username.toUpperCase()==="AXISS"?"admin":"user"})),onOpenCleaner:()=>{On(!1),no(!0)},onOpenSyncToAxis:()=>{On(!1),_n(!0)},onOpenCustomizer:()=>{On(!1),Hn(!0)},onOpenAiConfig:()=>{On(!1),Q(!0)},onPromoteToAdmin:async _=>{Op(_),W.emit("admin_promote_user",{targetUsername:_})},onDemoteAdmin:async _=>{_x(_),W.emit("admin_demote_user",{targetUsername:_})},onBanAdminOrUser:async _=>{wx(_),W.emit("admin_ban_user",_)},onUnbanUser:async _=>{Ex(_),W.emit("admin_unban_user",_)}
4338,onSetGlobalBackground:nf}),es&&i.jsx(YH,{isOpen:es,onClose:()=>ls(!1),notifications:Is,onClear:ti,onDismissNotification:Qc,onViewProfile:af,onOpenPrivateChat:Yc}),Vn&&i.jsx(XH,{isOpen:Vn,onClose:()=>de(!1),friends:Pr,pendingRequests:Dr,onlineUsers:qn.map(_=>({username:_.username,profilePic:_.profilePic})),onAcceptRequest:sf,onRejectRequest:Mp,onRemoveFriend:rf,onViewProfile:af,onOpenPrivateChat:Yc}),sn&&i.jsx(WH,{isOpen:sn,onClose:()=>Ut(!1),items:Yr,onClear:()=>ia([]),onNavigateToRoom:_=>{Jt(_),Gs()},onOpenPrivateChat:Yc})]}):o?i.jsx(WU,{user:f,onComplete:ef}):i.jsxs(i.Fragment,{children:[i.jsx(eq,{handleGoogleLogin:kp,user:f,setUser:p,handleLogin:Rp,setRecoveryModalOpen:Qs}),eo&&i.jsx(ZU,{recoveryStep:to,recoveryEmail:v,setRecoveryEmail:D,setRecoveryStep:Go,recoveryUsername:Aa,setRecoveryUsername:B,recoveryCodeStr:z,setRecoveryCodeStr:he,inputRecoveryCode:_e,setInputRecoveryCode:Ye,newPassword:qt,setNewPassword:Ds,setRecoveryModalOpen:Qs})]})}function cq(){return y.useEffect(()=>{if(!document.getElementById("tailwind-cdn")){const n=document.createElement("script");n.id="tailwind-cdn",n.src="https://cdn.tailwindcss.com",document.head.appendChild(n)}},[]),i.jsxs(i.Fragment,{children:[i.jsx("style",{children:` 4339 @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap'); 4340 body { 4341 font-family: 'Inter', sans-serif; 4342 background-color: #07090e; 4343 color: #e2e8f0; 4344 margin: 0; 4345 overflow: hidden; 4346 } 4347 .scrollbar-thin::-webkit-scrollbar {
4348 width: 5px; 4349 } 4350 .scrollbar-thin::-webkit-scrollbar-track { 4351 background: transparent; 4352 } 4353 .scrollbar-thin::-webkit-scrollbar-thumb { 4354 background: rgba(255, 255, 255, 0.1); 4355 border-radius: 10px; 4356 } 4357 .scrollbar-thin::-webkit-scrollbar-thumb:hover { 4358 background: rgba(255, 255, 255, 0.2); 4359 } 4360 `}),i.jsx(lq,{})]})}class uq extends As.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("Error crÃtico atrapado por ErrorBoundary:",e,t)}render(){return this.state.hasError?i.jsxs("div",{style:{padding:"30px",background:"#ffebee",color:"#b71c1c",fontFamily:"monospace",height:"100vh",boxSizing:"border-box"},children:[i.jsx("h2",{children:"ð¨ Error de renderizado en React:"}),i.jsx("pre",{style:{background:"#fff",padding:"15px",border:"1px solid #ef9a9a",borderRadius:"5px",overflowX:"auto"},children:String(this.state.error&&this.state.error.stack?this.state.error.stack:this.state.error)}),i.jsx("button",{onClick:()=>window.location.reload(),style:{marginTop:"15px",padding:"10px 20px",background:"#d32f2f",color:"#fff",border:"none",borderRadius:"5px",cursor:"pointer"},children:"Recargar página"})]}):this.props.children}}const uD=document.getElementById("root");uD&&U3.createRoot(uD).render(i.jsx(As.StrictMode,{children:i.jsx(uq,{children:i.jsx(cq,{})})}));
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.