var z7=Object.defineProperty;var $7=(e,t,r)=>t in e?z7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Dy=(e,t,r)=>$7(e,typeof t!="symbol"?t+"":t,r);function V7(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const s in a)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(a,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>a[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();function Sl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Uy={exports:{}},W0={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var R_;function G7(){if(R_)return W0;R_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,s,i){var l=null;if(i!==void 0&&(l=""+i),s.key!==void 0&&(l=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:a,key:l,ref:s!==void 0?s:null,props:i}}return W0.Fragment=t,W0.jsx=r,W0.jsxs=r,W0}var O_;function K7(){return O_||(O_=1,Uy.exports=G7()),Uy.exports}var n=K7(),My={exports:{}},Bt={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var P_;function q7(){if(P_)return Bt;P_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),h=Symbol.iterator;function m(M){return M===null||typeof M!="object"?null:(M=h&&M[h]||M["@@iterator"],typeof M=="function"?M:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,y={};function j(M,O,q){this.props=M,this.context=O,this.refs=y,this.updater=q||b}j.prototype.isReactComponent={},j.prototype.setState=function(M,O){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,O,"setState")},j.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function _(){}_.prototype=j.prototype;function N(M,O,q){this.props=M,this.context=O,this.refs=y,this.updater=q||b}var E=N.prototype=new _;E.constructor=N,v(E,j.prototype),E.isPureReactComponent=!0;var T=Array.isArray;function B(){}var F={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function U(M,O,q){var z=q.ref;return{$$typeof:e,type:M,key:O,ref:z!==void 0?z:null,props:q}}function D(M,O){return U(M.type,O,M.props)}function L(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function P(M){var O={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(q){return O[q]})}var G=/\/+/g;function Q(M,O){return typeof M=="object"&&M!==null&&M.key!=null?P(""+M.key):O.toString(36)}function H(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(B,B):(M.status="pending",M.then(function(O){M.status==="pending"&&(M.status="fulfilled",M.value=O)},function(O){M.status==="pending"&&(M.status="rejected",M.reason=O)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function X(M,O,q,z,J){var re=typeof M;(re==="undefined"||re==="boolean")&&(M=null);var le=!1;if(M===null)le=!0;else switch(re){case"bigint":case"string":case"number":le=!0;break;case"object":switch(M.$$typeof){case e:case t:le=!0;break;case f:return le=M._init,X(le(M._payload),O,q,z,J)}}if(le)return J=J(M),le=z===""?"."+Q(M,0):z,T(J)?(q="",le!=null&&(q=le.replace(G,"$&/")+"/"),X(J,O,q,"",function(ie){return ie})):J!=null&&(L(J)&&(J=D(J,q+(J.key==null||M&&M.key===J.key?"":(""+J.key).replace(G,"$&/")+"/")+le)),O.push(J)),1;le=0;var ne=z===""?".":z+":";if(T(M))for(var ae=0;ae<M.length;ae++)z=M[ae],re=ne+Q(z,ae),le+=X(z,O,q,re,J);else if(ae=m(M),typeof ae=="function")for(M=ae.call(M),ae=0;!(z=M.next()).done;)z=z.value,re=ne+Q(z,ae++),le+=X(z,O,q,re,J);else if(re==="object"){if(typeof M.then=="function")return X(H(M),O,q,z,J);throw O=String(M),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return le}function K(M,O,q){if(M==null)return M;var z=[],J=0;return X(M,z,"","",function(re){return O.call(q,re,J++)}),z}function ee(M){if(M._status===-1){var O=M._result;O=O(),O.then(function(q){(M._status===0||M._status===-1)&&(M._status=1,M._result=q)},function(q){(M._status===0||M._status===-1)&&(M._status=2,M._result=q)}),M._status===-1&&(M._status=0,M._result=O)}if(M._status===1)return M._result.default;throw M._result}var W=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},Y={map:K,forEach:function(M,O,q){K(M,function(){O.apply(this,arguments)},q)},count:function(M){var O=0;return K(M,function(){O++}),O},toArray:function(M){return K(M,function(O){return O})||[]},only:function(M){if(!L(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return Bt.Activity=p,Bt.Children=Y,Bt.Component=j,Bt.Fragment=r,Bt.Profiler=s,Bt.PureComponent=N,Bt.StrictMode=a,Bt.Suspense=d,Bt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,Bt.__COMPILER_RUNTIME={__proto__:null,c:function(M){return F.H.useMemoCache(M)}},Bt.cache=function(M){return function(){return M.apply(null,arguments)}},Bt.cacheSignal=function(){return null},Bt.cloneElement=function(M,O,q){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var z=v({},M.props),J=M.key;if(O!=null)for(re in O.key!==void 0&&(J=""+O.key),O)!R.call(O,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&O.ref===void 0||(z[re]=O[re]);var re=arguments.length-2;if(re===1)z.children=q;else if(1<re){for(var le=Array(re),ne=0;ne<re;ne++)le[ne]=arguments[ne+2];z.children=le}return U(M.type,J,z)},Bt.createContext=function(M){return M={$$typeof:l,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:i,_context:M},M},Bt.createElement=function(M,O,q){var z,J={},re=null;if(O!=null)for(z in O.key!==void 0&&(re=""+O.key),O)R.call(O,z)&&z!=="key"&&z!=="__self"&&z!=="__source"&&(J[z]=O[z]);var le=arguments.length-2;if(le===1)J.children=q;else if(1<le){for(var ne=Array(le),ae=0;ae<le;ae++)ne[ae]=arguments[ae+2];J.children=ne}if(M&&M.defaultProps)for(z in le=M.defaultProps,le)J[z]===void 0&&(J[z]=le[z]);return U(M,re,J)},Bt.createRef=function(){return{current:null}},Bt.forwardRef=function(M){return{$$typeof:o,render:M}},Bt.isValidElement=L,Bt.lazy=function(M){return{$$typeof:f,_payload:{_status:-1,_result:M},_init:ee}},Bt.memo=function(M,O){return{$$typeof:u,type:M,compare:O===void 0?null:O}},Bt.startTransition=function(M){var O=F.T,q={};F.T=q;try{var z=M(),J=F.S;J!==null&&J(q,z),typeof z=="object"&&z!==null&&typeof z.then=="function"&&z.then(B,W)}catch(re){W(re)}finally{O!==null&&q.types!==null&&(O.types=q.types),F.T=O}},Bt.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},Bt.use=function(M){return F.H.use(M)},Bt.useActionState=function(M,O,q){return F.H.useActionState(M,O,q)},Bt.useCallback=function(M,O){return F.H.useCallback(M,O)},Bt.useContext=function(M){return F.H.useContext(M)},Bt.useDebugValue=function(){},Bt.useDeferredValue=function(M,O){return F.H.useDeferredValue(M,O)},Bt.useEffect=function(M,O){return F.H.useEffect(M,O)},Bt.useEffectEvent=function(M){return F.H.useEffectEvent(M)},Bt.useId=function(){return F.H.useId()},Bt.useImperativeHandle=function(M,O,q){return F.H.useImperativeHandle(M,O,q)},Bt.useInsertionEffect=function(M,O){return F.H.useInsertionEffect(M,O)},Bt.useLayoutEffect=function(M,O){return F.H.useLayoutEffect(M,O)},Bt.useMemo=function(M,O){return F.H.useMemo(M,O)},Bt.useOptimistic=function(M,O){return F.H.useOptimistic(M,O)},Bt.useReducer=function(M,O,q){return F.H.useReducer(M,O,q)},Bt.useRef=function(M){return F.H.useRef(M)},Bt.useState=function(M){return F.H.useState(M)},Bt.useSyncExternalStore=function(M,O,q){return F.H.useSyncExternalStore(M,O,q)},Bt.useTransition=function(){return F.H.useTransition()},Bt.version="19.2.4",Bt}var L_;function OA(){return L_||(L_=1,My.exports=q7()),My.exports}var k=OA();const Ip=Sl(k),W7=V7({__proto__:null,default:Ip},[k]);var Ry={exports:{}},Y0={},Oy={exports:{}},Py={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Q_;function Y7(){return Q_||(Q_=1,(function(e){function t(X,K){var ee=X.length;X.push(K);e:for(;0<ee;){var W=ee-1>>>1,Y=X[W];if(0<s(Y,K))X[W]=K,X[ee]=Y,ee=W;else break e}}function r(X){return X.length===0?null:X[0]}function a(X){if(X.length===0)return null;var K=X[0],ee=X.pop();if(ee!==K){X[0]=ee;e:for(var W=0,Y=X.length,M=Y>>>1;W<M;){var O=2*(W+1)-1,q=X[O],z=O+1,J=X[z];if(0>s(q,ee))z<Y&&0>s(J,q)?(X[W]=J,X[z]=ee,W=z):(X[W]=q,X[O]=ee,W=O);else if(z<Y&&0>s(J,ee))X[W]=J,X[z]=ee,W=z;else break e}}return K}function s(X,K){var ee=X.sortIndex-K.sortIndex;return ee!==0?ee:X.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,o=l.now();e.unstable_now=function(){return l.now()-o}}var d=[],u=[],f=1,p=null,h=3,m=!1,b=!1,v=!1,y=!1,j=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function E(X){for(var K=r(u);K!==null;){if(K.callback===null)a(u);else if(K.startTime<=X)a(u),K.sortIndex=K.expirationTime,t(d,K);else break;K=r(u)}}function T(X){if(v=!1,E(X),!b)if(r(d)!==null)b=!0,B||(B=!0,P());else{var K=r(u);K!==null&&H(T,K.startTime-X)}}var B=!1,F=-1,R=5,U=-1;function D(){return y?!0:!(e.unstable_now()-U<R)}function L(){if(y=!1,B){var X=e.unstable_now();U=X;var K=!0;try{e:{b=!1,v&&(v=!1,_(F),F=-1),m=!0;var ee=h;try{t:{for(E(X),p=r(d);p!==null&&!(p.expirationTime>X&&D());){var W=p.callback;if(typeof W=="function"){p.callback=null,h=p.priorityLevel;var Y=W(p.expirationTime<=X);if(X=e.unstable_now(),typeof Y=="function"){p.callback=Y,E(X),K=!0;break t}p===r(d)&&a(d),E(X)}else a(d);p=r(d)}if(p!==null)K=!0;else{var M=r(u);M!==null&&H(T,M.startTime-X),K=!1}}break e}finally{p=null,h=ee,m=!1}K=void 0}}finally{K?P():B=!1}}}var P;if(typeof N=="function")P=function(){N(L)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,Q=G.port2;G.port1.onmessage=L,P=function(){Q.postMessage(null)}}else P=function(){j(L,0)};function H(X,K){F=j(function(){X(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(X){X.callback=null},e.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<X?Math.floor(1e3/X):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(X){switch(h){case 1:case 2:case 3:var K=3;break;default:K=h}var ee=h;h=K;try{return X()}finally{h=ee}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(X,K){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var ee=h;h=X;try{return K()}finally{h=ee}},e.unstable_scheduleCallback=function(X,K,ee){var W=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?W+ee:W):ee=W,X){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=ee+Y,X={id:f++,callback:K,priorityLevel:X,startTime:ee,expirationTime:Y,sortIndex:-1},ee>W?(X.sortIndex=ee,t(u,X),r(d)===null&&X===r(u)&&(v?(_(F),F=-1):v=!0,H(T,ee-W))):(X.sortIndex=Y,t(d,X),b||m||(b=!0,B||(B=!0,P()))),X},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(X){var K=h;return function(){var ee=h;h=K;try{return X.apply(this,arguments)}finally{h=ee}}}})(Py)),Py}var H_;function X7(){return H_||(H_=1,Oy.exports=Y7()),Oy.exports}var Ly={exports:{}},Bn={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var z_;function J7(){if(z_)return Bn;z_=1;var e=OA();function t(d){var u="https://react.dev/errors/"+d;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)u+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+d+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},s=Symbol.for("react.portal");function i(d,u,f){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:d,containerInfo:u,implementation:f}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(d,u){if(d==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Bn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Bn.createPortal=function(d,u){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(t(299));return i(d,u,null,f)},Bn.flushSync=function(d){var u=l.T,f=a.p;try{if(l.T=null,a.p=2,d)return d()}finally{l.T=u,a.p=f,a.d.f()}},Bn.preconnect=function(d,u){typeof d=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,a.d.C(d,u))},Bn.prefetchDNS=function(d){typeof d=="string"&&a.d.D(d)},Bn.preinit=function(d,u){if(typeof d=="string"&&u&&typeof u.as=="string"){var f=u.as,p=o(f,u.crossOrigin),h=typeof u.integrity=="string"?u.integrity:void 0,m=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;f==="style"?a.d.S(d,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:p,integrity:h,fetchPriority:m}):f==="script"&&a.d.X(d,{crossOrigin:p,integrity:h,fetchPriority:m,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Bn.preinitModule=function(d,u){if(typeof d=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var f=o(u.as,u.crossOrigin);a.d.M(d,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&a.d.M(d)},Bn.preload=function(d,u){if(typeof d=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var f=u.as,p=o(f,u.crossOrigin);a.d.L(d,f,{crossOrigin:p,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Bn.preloadModule=function(d,u){if(typeof d=="string")if(u){var f=o(u.as,u.crossOrigin);a.d.m(d,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else a.d.m(d)},Bn.requestFormReset=function(d){a.d.r(d)},Bn.unstable_batchedUpdates=function(d,u){return d(u)},Bn.useFormState=function(d,u,f){return l.H.useFormState(d,u,f)},Bn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Bn.version="19.2.4",Bn}var $_;function NM(){if($_)return Ly.exports;$_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ly.exports=J7(),Ly.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var V_;function Z7(){if(V_)return Y0;V_=1;var e=X7(),t=OA(),r=NM();function a(c){var A="https://react.dev/errors/"+c;if(1<arguments.length){A+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)A+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+c+"; visit "+A+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function i(c){var A=c,x=c;if(c.alternate)for(;A.return;)A=A.return;else{c=A;do A=c,(A.flags&4098)!==0&&(x=A.return),c=A.return;while(c)}return A.tag===3?x:null}function l(c){if(c.tag===13){var A=c.memoizedState;if(A===null&&(c=c.alternate,c!==null&&(A=c.memoizedState)),A!==null)return A.dehydrated}return null}function o(c){if(c.tag===31){var A=c.memoizedState;if(A===null&&(c=c.alternate,c!==null&&(A=c.memoizedState)),A!==null)return A.dehydrated}return null}function d(c){if(i(c)!==c)throw Error(a(188))}function u(c){var A=c.alternate;if(!A){if(A=i(c),A===null)throw Error(a(188));return A!==c?null:c}for(var x=c,g=A;;){var S=x.return;if(S===null)break;var I=S.alternate;if(I===null){if(g=S.return,g!==null){x=g;continue}break}if(S.child===I.child){for(I=S.child;I;){if(I===x)return d(S),c;if(I===g)return d(S),A;I=I.sibling}throw Error(a(188))}if(x.return!==g.return)x=S,g=I;else{for(var V=!1,se=S.child;se;){if(se===x){V=!0,x=S,g=I;break}if(se===g){V=!0,g=S,x=I;break}se=se.sibling}if(!V){for(se=I.child;se;){if(se===x){V=!0,x=I,g=S;break}if(se===g){V=!0,g=I,x=S;break}se=se.sibling}if(!V)throw Error(a(189))}}if(x.alternate!==g)throw Error(a(190))}if(x.tag!==3)throw Error(a(188));return x.stateNode.current===x?c:A}function f(c){var A=c.tag;if(A===5||A===26||A===27||A===6)return c;for(c=c.child;c!==null;){if(A=f(c),A!==null)return A;c=c.sibling}return null}var p=Object.assign,h=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),N=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),L=Symbol.iterator;function P(c){return c===null||typeof c!="object"?null:(c=L&&c[L]||c["@@iterator"],typeof c=="function"?c:null)}var G=Symbol.for("react.client.reference");function Q(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===G?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case v:return"Fragment";case j:return"Profiler";case y:return"StrictMode";case T:return"Suspense";case B:return"SuspenseList";case U:return"Activity"}if(typeof c=="object")switch(c.$$typeof){case b:return"Portal";case N:return c.displayName||"Context";case _:return(c._context.displayName||"Context")+".Consumer";case E:var A=c.render;return c=c.displayName,c||(c=A.displayName||A.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case F:return A=c.displayName||null,A!==null?A:Q(c.type)||"Memo";case R:A=c._payload,c=c._init;try{return Q(c(A))}catch{}}return null}var H=Array.isArray,X=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},W=[],Y=-1;function M(c){return{current:c}}function O(c){0>Y||(c.current=W[Y],W[Y]=null,Y--)}function q(c,A){Y++,W[Y]=c.current,c.current=A}var z=M(null),J=M(null),re=M(null),le=M(null);function ne(c,A){switch(q(re,A),q(J,c),q(z,null),A.nodeType){case 9:case 11:c=(c=A.documentElement)&&(c=c.namespaceURI)?i_(c):0;break;default:if(c=A.tagName,A=A.namespaceURI)A=i_(A),c=l_(A,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}O(z),q(z,c)}function ae(){O(z),O(J),O(re)}function ie(c){c.memoizedState!==null&&q(le,c);var A=z.current,x=l_(A,c.type);A!==x&&(q(J,c),q(z,x))}function me(c){J.current===c&&(O(z),O(J)),le.current===c&&(O(le),V0._currentValue=ee)}var Z,Me;function pe(c){if(Z===void 0)try{throw Error()}catch(x){var A=x.stack.trim().match(/\n( *(at )?)/);Z=A&&A[1]||"",Me=-1<x.stack.indexOf(`
    at`)?" (<anonymous>)":-1<x.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Z+c+Me}var he=!1;function ye(c,A){if(!c||he)return"";he=!0;var x=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(A){var Qe=function(){throw Error()};if(Object.defineProperty(Qe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Qe,[])}catch(Fe){var _e=Fe}Reflect.construct(c,[],Qe)}else{try{Qe.call()}catch(Fe){_e=Fe}c.call(Qe.prototype)}}else{try{throw Error()}catch(Fe){_e=Fe}(Qe=c())&&typeof Qe.catch=="function"&&Qe.catch(function(){})}}catch(Fe){if(Fe&&_e&&typeof Fe.stack=="string")return[Fe.stack,_e.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var I=g.DetermineComponentFrameRoot(),V=I[0],se=I[1];if(V&&se){var xe=V.split(`
`),Ee=se.split(`
`);for(S=g=0;g<xe.length&&!xe[g].includes("DetermineComponentFrameRoot");)g++;for(;S<Ee.length&&!Ee[S].includes("DetermineComponentFrameRoot");)S++;if(g===xe.length||S===Ee.length)for(g=xe.length-1,S=Ee.length-1;1<=g&&0<=S&&xe[g]!==Ee[S];)S--;for(;1<=g&&0<=S;g--,S--)if(xe[g]!==Ee[S]){if(g!==1||S!==1)do if(g--,S--,0>S||xe[g]!==Ee[S]){var Pe=`
`+xe[g].replace(" at new "," at ");return c.displayName&&Pe.includes("<anonymous>")&&(Pe=Pe.replace("<anonymous>",c.displayName)),Pe}while(1<=g&&0<=S);break}}}finally{he=!1,Error.prepareStackTrace=x}return(x=c?c.displayName||c.name:"")?pe(x):""}function fe(c,A){switch(c.tag){case 26:case 27:case 5:return pe(c.type);case 16:return pe("Lazy");case 13:return c.child!==A&&A!==null?pe("Suspense Fallback"):pe("Suspense");case 19:return pe("SuspenseList");case 0:case 15:return ye(c.type,!1);case 11:return ye(c.type.render,!1);case 1:return ye(c.type,!0);case 31:return pe("Activity");default:return""}}function Ue(c){try{var A="",x=null;do A+=fe(c,x),x=c,c=c.return;while(c);return A}catch(g){return`
Error generating stack: `+g.message+`
`+g.stack}}var qe=Object.prototype.hasOwnProperty,at=e.unstable_scheduleCallback,nt=e.unstable_cancelCallback,Ct=e.unstable_shouldYield,kt=e.unstable_requestPaint,ft=e.unstable_now,_r=e.unstable_getCurrentPriorityLevel,Ar=e.unstable_ImmediatePriority,pa=e.unstable_UserBlockingPriority,Ut=e.unstable_NormalPriority,Tr=e.unstable_LowPriority,it=e.unstable_IdlePriority,Rt=e.log,Et=e.unstable_setDisableYieldValue,jt=null,Kt=null;function fr(c){if(typeof Rt=="function"&&Et(c),Kt&&typeof Kt.setStrictMode=="function")try{Kt.setStrictMode(jt,c)}catch{}}var Cr=Math.clz32?Math.clz32:Cs,cn=Math.log,$n=Math.LN2;function Cs(c){return c>>>=0,c===0?32:31-(cn(c)/$n|0)|0}var ks=256,Bi=262144,ta=4194304;function dn(c){var A=c&42;if(A!==0)return A;switch(c&-c){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 c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function el(c,A,x){var g=c.pendingLanes;if(g===0)return 0;var S=0,I=c.suspendedLanes,V=c.pingedLanes;c=c.warmLanes;var se=g&134217727;return se!==0?(g=se&~I,g!==0?S=dn(g):(V&=se,V!==0?S=dn(V):x||(x=se&~c,x!==0&&(S=dn(x))))):(se=g&~I,se!==0?S=dn(se):V!==0?S=dn(V):x||(x=g&~c,x!==0&&(S=dn(x)))),S===0?0:A!==0&&A!==S&&(A&I)===0&&(I=S&-S,x=A&-A,I>=x||I===32&&(x&4194048)!==0)?A:S}function _i(c,A){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&A)===0}function Wc(c,A){switch(c){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 Lo(){var c=ta;return ta<<=1,(ta&62914560)===0&&(ta=4194304),c}function Ul(c){for(var A=[],x=0;31>x;x++)A.push(c);return A}function Ve(c,A){c.pendingLanes|=A,A!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function It(c,A,x,g,S,I){var V=c.pendingLanes;c.pendingLanes=x,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=x,c.entangledLanes&=x,c.errorRecoveryDisabledLanes&=x,c.shellSuspendCounter=0;var se=c.entanglements,xe=c.expirationTimes,Ee=c.hiddenUpdates;for(x=V&~x;0<x;){var Pe=31-Cr(x),Qe=1<<Pe;se[Pe]=0,xe[Pe]=-1;var _e=Ee[Pe];if(_e!==null)for(Ee[Pe]=null,Pe=0;Pe<_e.length;Pe++){var Fe=_e[Pe];Fe!==null&&(Fe.lane&=-536870913)}x&=~Qe}g!==0&&ra(c,g,0),I!==0&&S===0&&c.tag!==0&&(c.suspendedLanes|=I&~(V&~A))}function ra(c,A,x){c.pendingLanes|=A,c.suspendedLanes&=~A;var g=31-Cr(A);c.entangledLanes|=A,c.entanglements[g]=c.entanglements[g]|1073741824|x&261930}function Ma(c,A){var x=c.entangledLanes|=A;for(c=c.entanglements;x;){var g=31-Cr(x),S=1<<g;S&A|c[g]&A&&(c[g]|=A),x&=~S}}function be(c,A){var x=A&-A;return x=(x&42)!==0?1:Ye(x),(x&(c.suspendedLanes|A))!==0?0:x}function Ye(c){switch(c){case 2:c=1;break;case 8:c=4;break;case 32:c=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:c=128;break;case 268435456:c=134217728;break;default:c=0}return c}function tt(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function te(){var c=K.p;return c!==0?c:(c=window.event,c===void 0?32:__(c.type))}function de(c,A){var x=K.p;try{return K.p=c,A()}finally{K.p=x}}var oe=Math.random().toString(36).slice(2),ce="__reactFiber$"+oe,ue="__reactProps$"+oe,Ae="__reactContainer$"+oe,Ce="__reactEvents$"+oe,Re="__reactListeners$"+oe,ke="__reactHandles$"+oe,Se="__reactResources$"+oe,Be="__reactMarker$"+oe;function ze(c){delete c[ce],delete c[ue],delete c[Ce],delete c[Re],delete c[ke]}function Ke(c){var A=c[ce];if(A)return A;for(var x=c.parentNode;x;){if(A=x[Ae]||x[ce]){if(x=A.alternate,A.child!==null||x!==null&&x.child!==null)for(c=p_(c);c!==null;){if(x=c[ce])return x;c=p_(c)}return A}c=x,x=c.parentNode}return null}function Ze(c){if(c=c[ce]||c[Ae]){var A=c.tag;if(A===5||A===6||A===13||A===31||A===26||A===27||A===3)return c}return null}function $e(c){var A=c.tag;if(A===5||A===26||A===27||A===6)return c.stateNode;throw Error(a(33))}function Je(c){var A=c[Se];return A||(A=c[Se]={hoistableStyles:new Map,hoistableScripts:new Map}),A}function dt(c){c[Be]=!0}var kr=new Set,jr={};function Qr(c,A){qs(c,A),qs(c+"Capture",A)}function qs(c,A){for(jr[c]=A,c=0;c<A.length;c++)kr.add(A[c])}var Yc=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]*$"),Qo={},tl={};function l0(c){return qe.call(tl,c)?!0:qe.call(Qo,c)?!1:Yc.test(c)?tl[c]=!0:(Qo[c]=!0,!1)}function ns(c,A,x){if(l0(A))if(x===null)c.removeAttribute(A);else{switch(typeof x){case"undefined":case"function":case"symbol":c.removeAttribute(A);return;case"boolean":var g=A.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){c.removeAttribute(A);return}}c.setAttribute(A,""+x)}}function cx(c,A,x){if(x===null)c.removeAttribute(A);else{switch(typeof x){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(A);return}c.setAttribute(A,""+x)}}function Ml(c,A,x,g){if(g===null)c.removeAttribute(x);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(x);return}c.setAttributeNS(A,x,""+g)}}function Ws(c){switch(typeof c){case"bigint":case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function JE(c){var A=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(A==="checkbox"||A==="radio")}function Mz(c,A,x){var g=Object.getOwnPropertyDescriptor(c.constructor.prototype,A);if(!c.hasOwnProperty(A)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var S=g.get,I=g.set;return Object.defineProperty(c,A,{configurable:!0,get:function(){return S.call(this)},set:function(V){x=""+V,I.call(this,V)}}),Object.defineProperty(c,A,{enumerable:g.enumerable}),{getValue:function(){return x},setValue:function(V){x=""+V},stopTracking:function(){c._valueTracker=null,delete c[A]}}}}function Ev(c){if(!c._valueTracker){var A=JE(c)?"checked":"value";c._valueTracker=Mz(c,A,""+c[A])}}function ZE(c){if(!c)return!1;var A=c._valueTracker;if(!A)return!0;var x=A.getValue(),g="";return c&&(g=JE(c)?c.checked?"true":"false":c.value),c=g,c!==x?(A.setValue(c),!0):!1}function dx(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var Rz=/[\n"\\]/g;function Ys(c){return c.replace(Rz,function(A){return"\\"+A.charCodeAt(0).toString(16)+" "})}function Sv(c,A,x,g,S,I,V,se){c.name="",V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?c.type=V:c.removeAttribute("type"),A!=null?V==="number"?(A===0&&c.value===""||c.value!=A)&&(c.value=""+Ws(A)):c.value!==""+Ws(A)&&(c.value=""+Ws(A)):V!=="submit"&&V!=="reset"||c.removeAttribute("value"),A!=null?Bv(c,V,Ws(A)):x!=null?Bv(c,V,Ws(x)):g!=null&&c.removeAttribute("value"),S==null&&I!=null&&(c.defaultChecked=!!I),S!=null&&(c.checked=S&&typeof S!="function"&&typeof S!="symbol"),se!=null&&typeof se!="function"&&typeof se!="symbol"&&typeof se!="boolean"?c.name=""+Ws(se):c.removeAttribute("name")}function eS(c,A,x,g,S,I,V,se){if(I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(c.type=I),A!=null||x!=null){if(!(I!=="submit"&&I!=="reset"||A!=null)){Ev(c);return}x=x!=null?""+Ws(x):"",A=A!=null?""+Ws(A):x,se||A===c.value||(c.value=A),c.defaultValue=A}g=g??S,g=typeof g!="function"&&typeof g!="symbol"&&!!g,c.checked=se?c.checked:!!g,c.defaultChecked=!!g,V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"&&(c.name=V),Ev(c)}function Bv(c,A,x){A==="number"&&dx(c.ownerDocument)===c||c.defaultValue===""+x||(c.defaultValue=""+x)}function uu(c,A,x,g){if(c=c.options,A){A={};for(var S=0;S<x.length;S++)A["$"+x[S]]=!0;for(x=0;x<c.length;x++)S=A.hasOwnProperty("$"+c[x].value),c[x].selected!==S&&(c[x].selected=S),S&&g&&(c[x].defaultSelected=!0)}else{for(x=""+Ws(x),A=null,S=0;S<c.length;S++){if(c[S].value===x){c[S].selected=!0,g&&(c[S].defaultSelected=!0);return}A!==null||c[S].disabled||(A=c[S])}A!==null&&(A.selected=!0)}}function tS(c,A,x){if(A!=null&&(A=""+Ws(A),A!==c.value&&(c.value=A),x==null)){c.defaultValue!==A&&(c.defaultValue=A);return}c.defaultValue=x!=null?""+Ws(x):""}function rS(c,A,x,g){if(A==null){if(g!=null){if(x!=null)throw Error(a(92));if(H(g)){if(1<g.length)throw Error(a(93));g=g[0]}x=g}x==null&&(x=""),A=x}x=Ws(A),c.defaultValue=x,g=c.textContent,g===x&&g!==""&&g!==null&&(c.value=g),Ev(c)}function Au(c,A){if(A){var x=c.firstChild;if(x&&x===c.lastChild&&x.nodeType===3){x.nodeValue=A;return}}c.textContent=A}var Oz=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 aS(c,A,x){var g=A.indexOf("--")===0;x==null||typeof x=="boolean"||x===""?g?c.setProperty(A,""):A==="float"?c.cssFloat="":c[A]="":g?c.setProperty(A,x):typeof x!="number"||x===0||Oz.has(A)?A==="float"?c.cssFloat=x:c[A]=(""+x).trim():c[A]=x+"px"}function nS(c,A,x){if(A!=null&&typeof A!="object")throw Error(a(62));if(c=c.style,x!=null){for(var g in x)!x.hasOwnProperty(g)||A!=null&&A.hasOwnProperty(g)||(g.indexOf("--")===0?c.setProperty(g,""):g==="float"?c.cssFloat="":c[g]="");for(var S in A)g=A[S],A.hasOwnProperty(S)&&x[S]!==g&&aS(c,S,g)}else for(var I in A)A.hasOwnProperty(I)&&aS(c,I,A[I])}function _v(c){if(c.indexOf("-")===-1)return!1;switch(c){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 Pz=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"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Lz=/^[\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 ux(c){return Lz.test(""+c)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":c}function Rl(){}var Tv=null;function Iv(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var fu=null,pu=null;function sS(c){var A=Ze(c);if(A&&(c=A.stateNode)){var x=c[ue]||null;e:switch(c=A.stateNode,A.type){case"input":if(Sv(c,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name),A=x.name,x.type==="radio"&&A!=null){for(x=c;x.parentNode;)x=x.parentNode;for(x=x.querySelectorAll('input[name="'+Ys(""+A)+'"][type="radio"]'),A=0;A<x.length;A++){var g=x[A];if(g!==c&&g.form===c.form){var S=g[ue]||null;if(!S)throw Error(a(90));Sv(g,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(A=0;A<x.length;A++)g=x[A],g.form===c.form&&ZE(g)}break e;case"textarea":tS(c,x.value,x.defaultValue);break e;case"select":A=x.value,A!=null&&uu(c,!!x.multiple,A,!1)}}}var Fv=!1;function iS(c,A,x){if(Fv)return c(A,x);Fv=!0;try{var g=c(A);return g}finally{if(Fv=!1,(fu!==null||pu!==null)&&(Jx(),fu&&(A=fu,c=pu,pu=fu=null,sS(A),c)))for(A=0;A<c.length;A++)sS(c[A])}}function o0(c,A){var x=c.stateNode;if(x===null)return null;var g=x[ue]||null;if(g===null)return null;x=g[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":(g=!g.disabled)||(c=c.type,g=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!g;break e;default:c=!1}if(c)return null;if(x&&typeof x!="function")throw Error(a(231,A,typeof x));return x}var Ol=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Dv=!1;if(Ol)try{var c0={};Object.defineProperty(c0,"passive",{get:function(){Dv=!0}}),window.addEventListener("test",c0,c0),window.removeEventListener("test",c0,c0)}catch{Dv=!1}var Ho=null,Uv=null,Ax=null;function lS(){if(Ax)return Ax;var c,A=Uv,x=A.length,g,S="value"in Ho?Ho.value:Ho.textContent,I=S.length;for(c=0;c<x&&A[c]===S[c];c++);var V=x-c;for(g=1;g<=V&&A[x-g]===S[I-g];g++);return Ax=S.slice(c,1<g?1-g:void 0)}function fx(c){var A=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&A===13&&(c=13)):c=A,c===10&&(c=13),32<=c||c===13?c:0}function px(){return!0}function oS(){return!1}function ss(c){function A(x,g,S,I,V){this._reactName=x,this._targetInst=S,this.type=g,this.nativeEvent=I,this.target=V,this.currentTarget=null;for(var se in c)c.hasOwnProperty(se)&&(x=c[se],this[se]=x?x(I):I[se]);return this.isDefaultPrevented=(I.defaultPrevented!=null?I.defaultPrevented:I.returnValue===!1)?px:oS,this.isPropagationStopped=oS,this}return p(A.prototype,{preventDefault:function(){this.defaultPrevented=!0;var x=this.nativeEvent;x&&(x.preventDefault?x.preventDefault():typeof x.returnValue!="unknown"&&(x.returnValue=!1),this.isDefaultPrevented=px)},stopPropagation:function(){var x=this.nativeEvent;x&&(x.stopPropagation?x.stopPropagation():typeof x.cancelBubble!="unknown"&&(x.cancelBubble=!0),this.isPropagationStopped=px)},persist:function(){},isPersistent:px}),A}var Xc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xx=ss(Xc),d0=p({},Xc,{view:0,detail:0}),Qz=ss(d0),Mv,Rv,u0,hx=p({},d0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pv,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==u0&&(u0&&c.type==="mousemove"?(Mv=c.screenX-u0.screenX,Rv=c.screenY-u0.screenY):Rv=Mv=0,u0=c),Mv)},movementY:function(c){return"movementY"in c?c.movementY:Rv}}),cS=ss(hx),Hz=p({},hx,{dataTransfer:0}),zz=ss(Hz),$z=p({},d0,{relatedTarget:0}),Ov=ss($z),Vz=p({},Xc,{animationName:0,elapsedTime:0,pseudoElement:0}),Gz=ss(Vz),Kz=p({},Xc,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),qz=ss(Kz),Wz=p({},Xc,{data:0}),dS=ss(Wz),Yz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xz={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"},Jz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zz(c){var A=this.nativeEvent;return A.getModifierState?A.getModifierState(c):(c=Jz[c])?!!A[c]:!1}function Pv(){return Zz}var e$=p({},d0,{key:function(c){if(c.key){var A=Yz[c.key]||c.key;if(A!=="Unidentified")return A}return c.type==="keypress"?(c=fx(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?Xz[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pv,charCode:function(c){return c.type==="keypress"?fx(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?fx(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),t$=ss(e$),r$=p({},hx,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),uS=ss(r$),a$=p({},d0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pv}),n$=ss(a$),s$=p({},Xc,{propertyName:0,elapsedTime:0,pseudoElement:0}),i$=ss(s$),l$=p({},hx,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),o$=ss(l$),c$=p({},Xc,{newState:0,oldState:0}),d$=ss(c$),u$=[9,13,27,32],Lv=Ol&&"CompositionEvent"in window,A0=null;Ol&&"documentMode"in document&&(A0=document.documentMode);var A$=Ol&&"TextEvent"in window&&!A0,AS=Ol&&(!Lv||A0&&8<A0&&11>=A0),fS=" ",pS=!1;function xS(c,A){switch(c){case"keyup":return u$.indexOf(A.keyCode)!==-1;case"keydown":return A.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hS(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var xu=!1;function f$(c,A){switch(c){case"compositionend":return hS(A);case"keypress":return A.which!==32?null:(pS=!0,fS);case"textInput":return c=A.data,c===fS&&pS?null:c;default:return null}}function p$(c,A){if(xu)return c==="compositionend"||!Lv&&xS(c,A)?(c=lS(),Ax=Uv=Ho=null,xu=!1,c):null;switch(c){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 AS&&A.locale!=="ko"?null:A.data;default:return null}}var x$={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 mS(c){var A=c&&c.nodeName&&c.nodeName.toLowerCase();return A==="input"?!!x$[c.type]:A==="textarea"}function gS(c,A,x,g){fu?pu?pu.push(g):pu=[g]:fu=g,A=sh(A,"onChange"),0<A.length&&(x=new xx("onChange","change",null,x,g),c.push({event:x,listeners:A}))}var f0=null,p0=null;function h$(c){e_(c,0)}function mx(c){var A=$e(c);if(ZE(A))return c}function bS(c,A){if(c==="change")return A}var vS=!1;if(Ol){var Qv;if(Ol){var Hv="oninput"in document;if(!Hv){var yS=document.createElement("div");yS.setAttribute("oninput","return;"),Hv=typeof yS.oninput=="function"}Qv=Hv}else Qv=!1;vS=Qv&&(!document.documentMode||9<document.documentMode)}function wS(){f0&&(f0.detachEvent("onpropertychange",NS),p0=f0=null)}function NS(c){if(c.propertyName==="value"&&mx(p0)){var A=[];gS(A,p0,c,Iv(c)),iS(h$,A)}}function m$(c,A,x){c==="focusin"?(wS(),f0=A,p0=x,f0.attachEvent("onpropertychange",NS)):c==="focusout"&&wS()}function g$(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return mx(p0)}function b$(c,A){if(c==="click")return mx(A)}function v$(c,A){if(c==="input"||c==="change")return mx(A)}function y$(c,A){return c===A&&(c!==0||1/c===1/A)||c!==c&&A!==A}var js=typeof Object.is=="function"?Object.is:y$;function x0(c,A){if(js(c,A))return!0;if(typeof c!="object"||c===null||typeof A!="object"||A===null)return!1;var x=Object.keys(c),g=Object.keys(A);if(x.length!==g.length)return!1;for(g=0;g<x.length;g++){var S=x[g];if(!qe.call(A,S)||!js(c[S],A[S]))return!1}return!0}function CS(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function kS(c,A){var x=CS(c);c=0;for(var g;x;){if(x.nodeType===3){if(g=c+x.textContent.length,c<=A&&g>=A)return{node:x,offset:A-c};c=g}e:{for(;x;){if(x.nextSibling){x=x.nextSibling;break e}x=x.parentNode}x=void 0}x=CS(x)}}function jS(c,A){return c&&A?c===A?!0:c&&c.nodeType===3?!1:A&&A.nodeType===3?jS(c,A.parentNode):"contains"in c?c.contains(A):c.compareDocumentPosition?!!(c.compareDocumentPosition(A)&16):!1:!1}function ES(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var A=dx(c.document);A instanceof c.HTMLIFrameElement;){try{var x=typeof A.contentWindow.location.href=="string"}catch{x=!1}if(x)c=A.contentWindow;else break;A=dx(c.document)}return A}function zv(c){var A=c&&c.nodeName&&c.nodeName.toLowerCase();return A&&(A==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||A==="textarea"||c.contentEditable==="true")}var w$=Ol&&"documentMode"in document&&11>=document.documentMode,hu=null,$v=null,h0=null,Vv=!1;function SS(c,A,x){var g=x.window===x?x.document:x.nodeType===9?x:x.ownerDocument;Vv||hu==null||hu!==dx(g)||(g=hu,"selectionStart"in g&&zv(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),h0&&x0(h0,g)||(h0=g,g=sh($v,"onSelect"),0<g.length&&(A=new xx("onSelect","select",null,A,x),c.push({event:A,listeners:g}),A.target=hu)))}function Jc(c,A){var x={};return x[c.toLowerCase()]=A.toLowerCase(),x["Webkit"+c]="webkit"+A,x["Moz"+c]="moz"+A,x}var mu={animationend:Jc("Animation","AnimationEnd"),animationiteration:Jc("Animation","AnimationIteration"),animationstart:Jc("Animation","AnimationStart"),transitionrun:Jc("Transition","TransitionRun"),transitionstart:Jc("Transition","TransitionStart"),transitioncancel:Jc("Transition","TransitionCancel"),transitionend:Jc("Transition","TransitionEnd")},Gv={},BS={};Ol&&(BS=document.createElement("div").style,"AnimationEvent"in window||(delete mu.animationend.animation,delete mu.animationiteration.animation,delete mu.animationstart.animation),"TransitionEvent"in window||delete mu.transitionend.transition);function Zc(c){if(Gv[c])return Gv[c];if(!mu[c])return c;var A=mu[c],x;for(x in A)if(A.hasOwnProperty(x)&&x in BS)return Gv[c]=A[x];return c}var _S=Zc("animationend"),TS=Zc("animationiteration"),IS=Zc("animationstart"),N$=Zc("transitionrun"),C$=Zc("transitionstart"),k$=Zc("transitioncancel"),FS=Zc("transitionend"),DS=new Map,Kv="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Kv.push("scrollEnd");function Ti(c,A){DS.set(c,A),Qr(A,[c])}var gx=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var A=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(A))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",c);return}console.error(c)},Xs=[],gu=0,qv=0;function bx(){for(var c=gu,A=qv=gu=0;A<c;){var x=Xs[A];Xs[A++]=null;var g=Xs[A];Xs[A++]=null;var S=Xs[A];Xs[A++]=null;var I=Xs[A];if(Xs[A++]=null,g!==null&&S!==null){var V=g.pending;V===null?S.next=S:(S.next=V.next,V.next=S),g.pending=S}I!==0&&US(x,S,I)}}function vx(c,A,x,g){Xs[gu++]=c,Xs[gu++]=A,Xs[gu++]=x,Xs[gu++]=g,qv|=g,c.lanes|=g,c=c.alternate,c!==null&&(c.lanes|=g)}function Wv(c,A,x,g){return vx(c,A,x,g),yx(c)}function ed(c,A){return vx(c,null,null,A),yx(c)}function US(c,A,x){c.lanes|=x;var g=c.alternate;g!==null&&(g.lanes|=x);for(var S=!1,I=c.return;I!==null;)I.childLanes|=x,g=I.alternate,g!==null&&(g.childLanes|=x),I.tag===22&&(c=I.stateNode,c===null||c._visibility&1||(S=!0)),c=I,I=I.return;return c.tag===3?(I=c.stateNode,S&&A!==null&&(S=31-Cr(x),c=I.hiddenUpdates,g=c[S],g===null?c[S]=[A]:g.push(A),A.lane=x|536870912),I):null}function yx(c){if(50<O0)throw O0=0,ny=null,Error(a(185));for(var A=c.return;A!==null;)c=A,A=c.return;return c.tag===3?c.stateNode:null}var bu={};function j$(c,A,x,g){this.tag=c,this.key=x,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=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Es(c,A,x,g){return new j$(c,A,x,g)}function Yv(c){return c=c.prototype,!(!c||!c.isReactComponent)}function Pl(c,A){var x=c.alternate;return x===null?(x=Es(c.tag,A,c.key,c.mode),x.elementType=c.elementType,x.type=c.type,x.stateNode=c.stateNode,x.alternate=c,c.alternate=x):(x.pendingProps=A,x.type=c.type,x.flags=0,x.subtreeFlags=0,x.deletions=null),x.flags=c.flags&65011712,x.childLanes=c.childLanes,x.lanes=c.lanes,x.child=c.child,x.memoizedProps=c.memoizedProps,x.memoizedState=c.memoizedState,x.updateQueue=c.updateQueue,A=c.dependencies,x.dependencies=A===null?null:{lanes:A.lanes,firstContext:A.firstContext},x.sibling=c.sibling,x.index=c.index,x.ref=c.ref,x.refCleanup=c.refCleanup,x}function MS(c,A){c.flags&=65011714;var x=c.alternate;return x===null?(c.childLanes=0,c.lanes=A,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=x.childLanes,c.lanes=x.lanes,c.child=x.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=x.memoizedProps,c.memoizedState=x.memoizedState,c.updateQueue=x.updateQueue,c.type=x.type,A=x.dependencies,c.dependencies=A===null?null:{lanes:A.lanes,firstContext:A.firstContext}),c}function wx(c,A,x,g,S,I){var V=0;if(g=c,typeof c=="function")Yv(c)&&(V=1);else if(typeof c=="string")V=T7(c,x,z.current)?26:c==="html"||c==="head"||c==="body"?27:5;else e:switch(c){case U:return c=Es(31,x,A,S),c.elementType=U,c.lanes=I,c;case v:return td(x.children,S,I,A);case y:V=8,S|=24;break;case j:return c=Es(12,x,A,S|2),c.elementType=j,c.lanes=I,c;case T:return c=Es(13,x,A,S),c.elementType=T,c.lanes=I,c;case B:return c=Es(19,x,A,S),c.elementType=B,c.lanes=I,c;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case N:V=10;break e;case _:V=9;break e;case E:V=11;break e;case F:V=14;break e;case R:V=16,g=null;break e}V=29,x=Error(a(130,c===null?"null":typeof c,"")),g=null}return A=Es(V,x,A,S),A.elementType=c,A.type=g,A.lanes=I,A}function td(c,A,x,g){return c=Es(7,c,g,A),c.lanes=x,c}function Xv(c,A,x){return c=Es(6,c,null,A),c.lanes=x,c}function RS(c){var A=Es(18,null,null,0);return A.stateNode=c,A}function Jv(c,A,x){return A=Es(4,c.children!==null?c.children:[],c.key,A),A.lanes=x,A.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},A}var OS=new WeakMap;function Js(c,A){if(typeof c=="object"&&c!==null){var x=OS.get(c);return x!==void 0?x:(A={value:c,source:A,stack:Ue(A)},OS.set(c,A),A)}return{value:c,source:A,stack:Ue(A)}}var vu=[],yu=0,Nx=null,m0=0,Zs=[],ei=0,zo=null,rl=1,al="";function Ll(c,A){vu[yu++]=m0,vu[yu++]=Nx,Nx=c,m0=A}function PS(c,A,x){Zs[ei++]=rl,Zs[ei++]=al,Zs[ei++]=zo,zo=c;var g=rl;c=al;var S=32-Cr(g)-1;g&=~(1<<S),x+=1;var I=32-Cr(A)+S;if(30<I){var V=S-S%5;I=(g&(1<<V)-1).toString(32),g>>=V,S-=V,rl=1<<32-Cr(A)+S|x<<S|g,al=I+c}else rl=1<<I|x<<S|g,al=c}function Zv(c){c.return!==null&&(Ll(c,1),PS(c,1,0))}function e1(c){for(;c===Nx;)Nx=vu[--yu],vu[yu]=null,m0=vu[--yu],vu[yu]=null;for(;c===zo;)zo=Zs[--ei],Zs[ei]=null,al=Zs[--ei],Zs[ei]=null,rl=Zs[--ei],Zs[ei]=null}function LS(c,A){Zs[ei++]=rl,Zs[ei++]=al,Zs[ei++]=zo,rl=A.id,al=A.overflow,zo=c}var un=null,Ir=null,qt=!1,$o=null,ti=!1,t1=Error(a(519));function Vo(c){var A=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw g0(Js(A,c)),t1}function QS(c){var A=c.stateNode,x=c.type,g=c.memoizedProps;switch(A[ce]=c,A[ue]=g,x){case"dialog":Lt("cancel",A),Lt("close",A);break;case"iframe":case"object":case"embed":Lt("load",A);break;case"video":case"audio":for(x=0;x<L0.length;x++)Lt(L0[x],A);break;case"source":Lt("error",A);break;case"img":case"image":case"link":Lt("error",A),Lt("load",A);break;case"details":Lt("toggle",A);break;case"input":Lt("invalid",A),eS(A,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Lt("invalid",A);break;case"textarea":Lt("invalid",A),rS(A,g.value,g.defaultValue,g.children)}x=g.children,typeof x!="string"&&typeof x!="number"&&typeof x!="bigint"||A.textContent===""+x||g.suppressHydrationWarning===!0||n_(A.textContent,x)?(g.popover!=null&&(Lt("beforetoggle",A),Lt("toggle",A)),g.onScroll!=null&&Lt("scroll",A),g.onScrollEnd!=null&&Lt("scrollend",A),g.onClick!=null&&(A.onclick=Rl),A=!0):A=!1,A||Vo(c,!0)}function HS(c){for(un=c.return;un;)switch(un.tag){case 5:case 31:case 13:ti=!1;return;case 27:case 3:ti=!0;return;default:un=un.return}}function wu(c){if(c!==un)return!1;if(!qt)return HS(c),qt=!0,!1;var A=c.tag,x;if((x=A!==3&&A!==27)&&((x=A===5)&&(x=c.type,x=!(x!=="form"&&x!=="button")||by(c.type,c.memoizedProps)),x=!x),x&&Ir&&Vo(c),HS(c),A===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));Ir=f_(c)}else if(A===31){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));Ir=f_(c)}else A===27?(A=Ir,sc(c.type)?(c=Cy,Cy=null,Ir=c):Ir=A):Ir=un?ai(c.stateNode.nextSibling):null;return!0}function rd(){Ir=un=null,qt=!1}function r1(){var c=$o;return c!==null&&(cs===null?cs=c:cs.push.apply(cs,c),$o=null),c}function g0(c){$o===null?$o=[c]:$o.push(c)}var a1=M(null),ad=null,Ql=null;function Go(c,A,x){q(a1,A._currentValue),A._currentValue=x}function Hl(c){c._currentValue=a1.current,O(a1)}function n1(c,A,x){for(;c!==null;){var g=c.alternate;if((c.childLanes&A)!==A?(c.childLanes|=A,g!==null&&(g.childLanes|=A)):g!==null&&(g.childLanes&A)!==A&&(g.childLanes|=A),c===x)break;c=c.return}}function s1(c,A,x,g){var S=c.child;for(S!==null&&(S.return=c);S!==null;){var I=S.dependencies;if(I!==null){var V=S.child;I=I.firstContext;e:for(;I!==null;){var se=I;I=S;for(var xe=0;xe<A.length;xe++)if(se.context===A[xe]){I.lanes|=x,se=I.alternate,se!==null&&(se.lanes|=x),n1(I.return,x,c),g||(V=null);break e}I=se.next}}else if(S.tag===18){if(V=S.return,V===null)throw Error(a(341));V.lanes|=x,I=V.alternate,I!==null&&(I.lanes|=x),n1(V,x,c),V=null}else V=S.child;if(V!==null)V.return=S;else for(V=S;V!==null;){if(V===c){V=null;break}if(S=V.sibling,S!==null){S.return=V.return,V=S;break}V=V.return}S=V}}function Nu(c,A,x,g){c=null;for(var S=A,I=!1;S!==null;){if(!I){if((S.flags&524288)!==0)I=!0;else if((S.flags&262144)!==0)break}if(S.tag===10){var V=S.alternate;if(V===null)throw Error(a(387));if(V=V.memoizedProps,V!==null){var se=S.type;js(S.pendingProps.value,V.value)||(c!==null?c.push(se):c=[se])}}else if(S===le.current){if(V=S.alternate,V===null)throw Error(a(387));V.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(c!==null?c.push(V0):c=[V0])}S=S.return}c!==null&&s1(A,c,x,g),A.flags|=262144}function Cx(c){for(c=c.firstContext;c!==null;){if(!js(c.context._currentValue,c.memoizedValue))return!0;c=c.next}return!1}function nd(c){ad=c,Ql=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function An(c){return zS(ad,c)}function kx(c,A){return ad===null&&nd(c),zS(c,A)}function zS(c,A){var x=A._currentValue;if(A={context:A,memoizedValue:x,next:null},Ql===null){if(c===null)throw Error(a(308));Ql=A,c.dependencies={lanes:0,firstContext:A},c.flags|=524288}else Ql=Ql.next=A;return x}var E$=typeof AbortController<"u"?AbortController:function(){var c=[],A=this.signal={aborted:!1,addEventListener:function(x,g){c.push(g)}};this.abort=function(){A.aborted=!0,c.forEach(function(x){return x()})}},S$=e.unstable_scheduleCallback,B$=e.unstable_NormalPriority,Na={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function i1(){return{controller:new E$,data:new Map,refCount:0}}function b0(c){c.refCount--,c.refCount===0&&S$(B$,function(){c.controller.abort()})}var v0=null,l1=0,Cu=0,ku=null;function _$(c,A){if(v0===null){var x=v0=[];l1=0,Cu=dy(),ku={status:"pending",value:void 0,then:function(g){x.push(g)}}}return l1++,A.then($S,$S),A}function $S(){if(--l1===0&&v0!==null){ku!==null&&(ku.status="fulfilled");var c=v0;v0=null,Cu=0,ku=null;for(var A=0;A<c.length;A++)(0,c[A])()}}function T$(c,A){var x=[],g={status:"pending",value:null,reason:null,then:function(S){x.push(S)}};return c.then(function(){g.status="fulfilled",g.value=A;for(var S=0;S<x.length;S++)(0,x[S])(A)},function(S){for(g.status="rejected",g.reason=S,S=0;S<x.length;S++)(0,x[S])(void 0)}),g}var VS=X.S;X.S=function(c,A){SB=ft(),typeof A=="object"&&A!==null&&typeof A.then=="function"&&_$(c,A),VS!==null&&VS(c,A)};var sd=M(null);function o1(){var c=sd.current;return c!==null?c:vr.pooledCache}function jx(c,A){A===null?q(sd,sd.current):q(sd,A.pool)}function GS(){var c=o1();return c===null?null:{parent:Na._currentValue,pool:c}}var ju=Error(a(460)),c1=Error(a(474)),Ex=Error(a(542)),Sx={then:function(){}};function KS(c){return c=c.status,c==="fulfilled"||c==="rejected"}function qS(c,A,x){switch(x=c[x],x===void 0?c.push(A):x!==A&&(A.then(Rl,Rl),A=x),A.status){case"fulfilled":return A.value;case"rejected":throw c=A.reason,YS(c),c;default:if(typeof A.status=="string")A.then(Rl,Rl);else{if(c=vr,c!==null&&100<c.shellSuspendCounter)throw Error(a(482));c=A,c.status="pending",c.then(function(g){if(A.status==="pending"){var S=A;S.status="fulfilled",S.value=g}},function(g){if(A.status==="pending"){var S=A;S.status="rejected",S.reason=g}})}switch(A.status){case"fulfilled":return A.value;case"rejected":throw c=A.reason,YS(c),c}throw ld=A,ju}}function id(c){try{var A=c._init;return A(c._payload)}catch(x){throw x!==null&&typeof x=="object"&&typeof x.then=="function"?(ld=x,ju):x}}var ld=null;function WS(){if(ld===null)throw Error(a(459));var c=ld;return ld=null,c}function YS(c){if(c===ju||c===Ex)throw Error(a(483))}var Eu=null,y0=0;function Bx(c){var A=y0;return y0+=1,Eu===null&&(Eu=[]),qS(Eu,c,A)}function w0(c,A){A=A.props.ref,c.ref=A!==void 0?A:null}function _x(c,A){throw A.$$typeof===h?Error(a(525)):(c=Object.prototype.toString.call(A),Error(a(31,c==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":c)))}function XS(c){function A(ve,ge){if(c){var je=ve.deletions;je===null?(ve.deletions=[ge],ve.flags|=16):je.push(ge)}}function x(ve,ge){if(!c)return null;for(;ge!==null;)A(ve,ge),ge=ge.sibling;return null}function g(ve){for(var ge=new Map;ve!==null;)ve.key!==null?ge.set(ve.key,ve):ge.set(ve.index,ve),ve=ve.sibling;return ge}function S(ve,ge){return ve=Pl(ve,ge),ve.index=0,ve.sibling=null,ve}function I(ve,ge,je){return ve.index=je,c?(je=ve.alternate,je!==null?(je=je.index,je<ge?(ve.flags|=67108866,ge):je):(ve.flags|=67108866,ge)):(ve.flags|=1048576,ge)}function V(ve){return c&&ve.alternate===null&&(ve.flags|=67108866),ve}function se(ve,ge,je,Le){return ge===null||ge.tag!==6?(ge=Xv(je,ve.mode,Le),ge.return=ve,ge):(ge=S(ge,je),ge.return=ve,ge)}function xe(ve,ge,je,Le){var pt=je.type;return pt===v?Pe(ve,ge,je.props.children,Le,je.key):ge!==null&&(ge.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===R&&id(pt)===ge.type)?(ge=S(ge,je.props),w0(ge,je),ge.return=ve,ge):(ge=wx(je.type,je.key,je.props,null,ve.mode,Le),w0(ge,je),ge.return=ve,ge)}function Ee(ve,ge,je,Le){return ge===null||ge.tag!==4||ge.stateNode.containerInfo!==je.containerInfo||ge.stateNode.implementation!==je.implementation?(ge=Jv(je,ve.mode,Le),ge.return=ve,ge):(ge=S(ge,je.children||[]),ge.return=ve,ge)}function Pe(ve,ge,je,Le,pt){return ge===null||ge.tag!==7?(ge=td(je,ve.mode,Le,pt),ge.return=ve,ge):(ge=S(ge,je),ge.return=ve,ge)}function Qe(ve,ge,je){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return ge=Xv(""+ge,ve.mode,je),ge.return=ve,ge;if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case m:return je=wx(ge.type,ge.key,ge.props,null,ve.mode,je),w0(je,ge),je.return=ve,je;case b:return ge=Jv(ge,ve.mode,je),ge.return=ve,ge;case R:return ge=id(ge),Qe(ve,ge,je)}if(H(ge)||P(ge))return ge=td(ge,ve.mode,je,null),ge.return=ve,ge;if(typeof ge.then=="function")return Qe(ve,Bx(ge),je);if(ge.$$typeof===N)return Qe(ve,kx(ve,ge),je);_x(ve,ge)}return null}function _e(ve,ge,je,Le){var pt=ge!==null?ge.key:null;if(typeof je=="string"&&je!==""||typeof je=="number"||typeof je=="bigint")return pt!==null?null:se(ve,ge,""+je,Le);if(typeof je=="object"&&je!==null){switch(je.$$typeof){case m:return je.key===pt?xe(ve,ge,je,Le):null;case b:return je.key===pt?Ee(ve,ge,je,Le):null;case R:return je=id(je),_e(ve,ge,je,Le)}if(H(je)||P(je))return pt!==null?null:Pe(ve,ge,je,Le,null);if(typeof je.then=="function")return _e(ve,ge,Bx(je),Le);if(je.$$typeof===N)return _e(ve,ge,kx(ve,je),Le);_x(ve,je)}return null}function Fe(ve,ge,je,Le,pt){if(typeof Le=="string"&&Le!==""||typeof Le=="number"||typeof Le=="bigint")return ve=ve.get(je)||null,se(ge,ve,""+Le,pt);if(typeof Le=="object"&&Le!==null){switch(Le.$$typeof){case m:return ve=ve.get(Le.key===null?je:Le.key)||null,xe(ge,ve,Le,pt);case b:return ve=ve.get(Le.key===null?je:Le.key)||null,Ee(ge,ve,Le,pt);case R:return Le=id(Le),Fe(ve,ge,je,Le,pt)}if(H(Le)||P(Le))return ve=ve.get(je)||null,Pe(ge,ve,Le,pt,null);if(typeof Le.then=="function")return Fe(ve,ge,je,Bx(Le),pt);if(Le.$$typeof===N)return Fe(ve,ge,je,kx(ge,Le),pt);_x(ge,Le)}return null}function ot(ve,ge,je,Le){for(var pt=null,Xt=null,ut=ge,Ft=ge=0,Ht=null;ut!==null&&Ft<je.length;Ft++){ut.index>Ft?(Ht=ut,ut=null):Ht=ut.sibling;var Jt=_e(ve,ut,je[Ft],Le);if(Jt===null){ut===null&&(ut=Ht);break}c&&ut&&Jt.alternate===null&&A(ve,ut),ge=I(Jt,ge,Ft),Xt===null?pt=Jt:Xt.sibling=Jt,Xt=Jt,ut=Ht}if(Ft===je.length)return x(ve,ut),qt&&Ll(ve,Ft),pt;if(ut===null){for(;Ft<je.length;Ft++)ut=Qe(ve,je[Ft],Le),ut!==null&&(ge=I(ut,ge,Ft),Xt===null?pt=ut:Xt.sibling=ut,Xt=ut);return qt&&Ll(ve,Ft),pt}for(ut=g(ut);Ft<je.length;Ft++)Ht=Fe(ut,ve,Ft,je[Ft],Le),Ht!==null&&(c&&Ht.alternate!==null&&ut.delete(Ht.key===null?Ft:Ht.key),ge=I(Ht,ge,Ft),Xt===null?pt=Ht:Xt.sibling=Ht,Xt=Ht);return c&&ut.forEach(function(dc){return A(ve,dc)}),qt&&Ll(ve,Ft),pt}function bt(ve,ge,je,Le){if(je==null)throw Error(a(151));for(var pt=null,Xt=null,ut=ge,Ft=ge=0,Ht=null,Jt=je.next();ut!==null&&!Jt.done;Ft++,Jt=je.next()){ut.index>Ft?(Ht=ut,ut=null):Ht=ut.sibling;var dc=_e(ve,ut,Jt.value,Le);if(dc===null){ut===null&&(ut=Ht);break}c&&ut&&dc.alternate===null&&A(ve,ut),ge=I(dc,ge,Ft),Xt===null?pt=dc:Xt.sibling=dc,Xt=dc,ut=Ht}if(Jt.done)return x(ve,ut),qt&&Ll(ve,Ft),pt;if(ut===null){for(;!Jt.done;Ft++,Jt=je.next())Jt=Qe(ve,Jt.value,Le),Jt!==null&&(ge=I(Jt,ge,Ft),Xt===null?pt=Jt:Xt.sibling=Jt,Xt=Jt);return qt&&Ll(ve,Ft),pt}for(ut=g(ut);!Jt.done;Ft++,Jt=je.next())Jt=Fe(ut,ve,Ft,Jt.value,Le),Jt!==null&&(c&&Jt.alternate!==null&&ut.delete(Jt.key===null?Ft:Jt.key),ge=I(Jt,ge,Ft),Xt===null?pt=Jt:Xt.sibling=Jt,Xt=Jt);return c&&ut.forEach(function(H7){return A(ve,H7)}),qt&&Ll(ve,Ft),pt}function hr(ve,ge,je,Le){if(typeof je=="object"&&je!==null&&je.type===v&&je.key===null&&(je=je.props.children),typeof je=="object"&&je!==null){switch(je.$$typeof){case m:e:{for(var pt=je.key;ge!==null;){if(ge.key===pt){if(pt=je.type,pt===v){if(ge.tag===7){x(ve,ge.sibling),Le=S(ge,je.props.children),Le.return=ve,ve=Le;break e}}else if(ge.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===R&&id(pt)===ge.type){x(ve,ge.sibling),Le=S(ge,je.props),w0(Le,je),Le.return=ve,ve=Le;break e}x(ve,ge);break}else A(ve,ge);ge=ge.sibling}je.type===v?(Le=td(je.props.children,ve.mode,Le,je.key),Le.return=ve,ve=Le):(Le=wx(je.type,je.key,je.props,null,ve.mode,Le),w0(Le,je),Le.return=ve,ve=Le)}return V(ve);case b:e:{for(pt=je.key;ge!==null;){if(ge.key===pt)if(ge.tag===4&&ge.stateNode.containerInfo===je.containerInfo&&ge.stateNode.implementation===je.implementation){x(ve,ge.sibling),Le=S(ge,je.children||[]),Le.return=ve,ve=Le;break e}else{x(ve,ge);break}else A(ve,ge);ge=ge.sibling}Le=Jv(je,ve.mode,Le),Le.return=ve,ve=Le}return V(ve);case R:return je=id(je),hr(ve,ge,je,Le)}if(H(je))return ot(ve,ge,je,Le);if(P(je)){if(pt=P(je),typeof pt!="function")throw Error(a(150));return je=pt.call(je),bt(ve,ge,je,Le)}if(typeof je.then=="function")return hr(ve,ge,Bx(je),Le);if(je.$$typeof===N)return hr(ve,ge,kx(ve,je),Le);_x(ve,je)}return typeof je=="string"&&je!==""||typeof je=="number"||typeof je=="bigint"?(je=""+je,ge!==null&&ge.tag===6?(x(ve,ge.sibling),Le=S(ge,je),Le.return=ve,ve=Le):(x(ve,ge),Le=Xv(je,ve.mode,Le),Le.return=ve,ve=Le),V(ve)):x(ve,ge)}return function(ve,ge,je,Le){try{y0=0;var pt=hr(ve,ge,je,Le);return Eu=null,pt}catch(ut){if(ut===ju||ut===Ex)throw ut;var Xt=Es(29,ut,null,ve.mode);return Xt.lanes=Le,Xt.return=ve,Xt}finally{}}}var od=XS(!0),JS=XS(!1),Ko=!1;function d1(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function u1(c,A){c=c.updateQueue,A.updateQueue===c&&(A.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function qo(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function Wo(c,A,x){var g=c.updateQueue;if(g===null)return null;if(g=g.shared,(ar&2)!==0){var S=g.pending;return S===null?A.next=A:(A.next=S.next,S.next=A),g.pending=A,A=yx(c),US(c,null,x),A}return vx(c,g,A,x),yx(c)}function N0(c,A,x){if(A=A.updateQueue,A!==null&&(A=A.shared,(x&4194048)!==0)){var g=A.lanes;g&=c.pendingLanes,x|=g,A.lanes=x,Ma(c,x)}}function A1(c,A){var x=c.updateQueue,g=c.alternate;if(g!==null&&(g=g.updateQueue,x===g)){var S=null,I=null;if(x=x.firstBaseUpdate,x!==null){do{var V={lane:x.lane,tag:x.tag,payload:x.payload,callback:null,next:null};I===null?S=I=V:I=I.next=V,x=x.next}while(x!==null);I===null?S=I=A:I=I.next=A}else S=I=A;x={baseState:g.baseState,firstBaseUpdate:S,lastBaseUpdate:I,shared:g.shared,callbacks:g.callbacks},c.updateQueue=x;return}c=x.lastBaseUpdate,c===null?x.firstBaseUpdate=A:c.next=A,x.lastBaseUpdate=A}var f1=!1;function C0(){if(f1){var c=ku;if(c!==null)throw c}}function k0(c,A,x,g){f1=!1;var S=c.updateQueue;Ko=!1;var I=S.firstBaseUpdate,V=S.lastBaseUpdate,se=S.shared.pending;if(se!==null){S.shared.pending=null;var xe=se,Ee=xe.next;xe.next=null,V===null?I=Ee:V.next=Ee,V=xe;var Pe=c.alternate;Pe!==null&&(Pe=Pe.updateQueue,se=Pe.lastBaseUpdate,se!==V&&(se===null?Pe.firstBaseUpdate=Ee:se.next=Ee,Pe.lastBaseUpdate=xe))}if(I!==null){var Qe=S.baseState;V=0,Pe=Ee=xe=null,se=I;do{var _e=se.lane&-536870913,Fe=_e!==se.lane;if(Fe?(Qt&_e)===_e:(g&_e)===_e){_e!==0&&_e===Cu&&(f1=!0),Pe!==null&&(Pe=Pe.next={lane:0,tag:se.tag,payload:se.payload,callback:null,next:null});e:{var ot=c,bt=se;_e=A;var hr=x;switch(bt.tag){case 1:if(ot=bt.payload,typeof ot=="function"){Qe=ot.call(hr,Qe,_e);break e}Qe=ot;break e;case 3:ot.flags=ot.flags&-65537|128;case 0:if(ot=bt.payload,_e=typeof ot=="function"?ot.call(hr,Qe,_e):ot,_e==null)break e;Qe=p({},Qe,_e);break e;case 2:Ko=!0}}_e=se.callback,_e!==null&&(c.flags|=64,Fe&&(c.flags|=8192),Fe=S.callbacks,Fe===null?S.callbacks=[_e]:Fe.push(_e))}else Fe={lane:_e,tag:se.tag,payload:se.payload,callback:se.callback,next:null},Pe===null?(Ee=Pe=Fe,xe=Qe):Pe=Pe.next=Fe,V|=_e;if(se=se.next,se===null){if(se=S.shared.pending,se===null)break;Fe=se,se=Fe.next,Fe.next=null,S.lastBaseUpdate=Fe,S.shared.pending=null}}while(!0);Pe===null&&(xe=Qe),S.baseState=xe,S.firstBaseUpdate=Ee,S.lastBaseUpdate=Pe,I===null&&(S.shared.lanes=0),ec|=V,c.lanes=V,c.memoizedState=Qe}}function ZS(c,A){if(typeof c!="function")throw Error(a(191,c));c.call(A)}function e4(c,A){var x=c.callbacks;if(x!==null)for(c.callbacks=null,c=0;c<x.length;c++)ZS(x[c],A)}var Su=M(null),Tx=M(0);function t4(c,A){c=Xl,q(Tx,c),q(Su,A),Xl=c|A.baseLanes}function p1(){q(Tx,Xl),q(Su,Su.current)}function x1(){Xl=Tx.current,O(Su),O(Tx)}var Ss=M(null),ri=null;function Yo(c){var A=c.alternate;q(xa,xa.current&1),q(Ss,c),ri===null&&(A===null||Su.current!==null||A.memoizedState!==null)&&(ri=c)}function h1(c){q(xa,xa.current),q(Ss,c),ri===null&&(ri=c)}function r4(c){c.tag===22?(q(xa,xa.current),q(Ss,c),ri===null&&(ri=c)):Xo()}function Xo(){q(xa,xa.current),q(Ss,Ss.current)}function Bs(c){O(Ss),ri===c&&(ri=null),O(xa)}var xa=M(0);function Ix(c){for(var A=c;A!==null;){if(A.tag===13){var x=A.memoizedState;if(x!==null&&(x=x.dehydrated,x===null||wy(x)||Ny(x)))return A}else if(A.tag===19&&(A.memoizedProps.revealOrder==="forwards"||A.memoizedProps.revealOrder==="backwards"||A.memoizedProps.revealOrder==="unstable_legacy-backwards"||A.memoizedProps.revealOrder==="together")){if((A.flags&128)!==0)return A}else if(A.child!==null){A.child.return=A,A=A.child;continue}if(A===c)break;for(;A.sibling===null;){if(A.return===null||A.return===c)return null;A=A.return}A.sibling.return=A.return,A=A.sibling}return null}var zl=0,_t=null,pr=null,Ca=null,Fx=!1,Bu=!1,cd=!1,Dx=0,j0=0,_u=null,I$=0;function aa(){throw Error(a(321))}function m1(c,A){if(A===null)return!1;for(var x=0;x<A.length&&x<c.length;x++)if(!js(c[x],A[x]))return!1;return!0}function g1(c,A,x,g,S,I){return zl=I,_t=A,A.memoizedState=null,A.updateQueue=null,A.lanes=0,X.H=c===null||c.memoizedState===null?P4:F1,cd=!1,I=x(g,S),cd=!1,Bu&&(I=n4(A,x,g,S)),a4(c),I}function a4(c){X.H=B0;var A=pr!==null&&pr.next!==null;if(zl=0,Ca=pr=_t=null,Fx=!1,j0=0,_u=null,A)throw Error(a(300));c===null||ka||(c=c.dependencies,c!==null&&Cx(c)&&(ka=!0))}function n4(c,A,x,g){_t=c;var S=0;do{if(Bu&&(_u=null),j0=0,Bu=!1,25<=S)throw Error(a(301));if(S+=1,Ca=pr=null,c.updateQueue!=null){var I=c.updateQueue;I.lastEffect=null,I.events=null,I.stores=null,I.memoCache!=null&&(I.memoCache.index=0)}X.H=L4,I=A(x,g)}while(Bu);return I}function F$(){var c=X.H,A=c.useState()[0];return A=typeof A.then=="function"?E0(A):A,c=c.useState()[0],(pr!==null?pr.memoizedState:null)!==c&&(_t.flags|=1024),A}function b1(){var c=Dx!==0;return Dx=0,c}function v1(c,A,x){A.updateQueue=c.updateQueue,A.flags&=-2053,c.lanes&=~x}function y1(c){if(Fx){for(c=c.memoizedState;c!==null;){var A=c.queue;A!==null&&(A.pending=null),c=c.next}Fx=!1}zl=0,Ca=pr=_t=null,Bu=!1,j0=Dx=0,_u=null}function Vn(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ca===null?_t.memoizedState=Ca=c:Ca=Ca.next=c,Ca}function ha(){if(pr===null){var c=_t.alternate;c=c!==null?c.memoizedState:null}else c=pr.next;var A=Ca===null?_t.memoizedState:Ca.next;if(A!==null)Ca=A,pr=c;else{if(c===null)throw _t.alternate===null?Error(a(467)):Error(a(310));pr=c,c={memoizedState:pr.memoizedState,baseState:pr.baseState,baseQueue:pr.baseQueue,queue:pr.queue,next:null},Ca===null?_t.memoizedState=Ca=c:Ca=Ca.next=c}return Ca}function Ux(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function E0(c){var A=j0;return j0+=1,_u===null&&(_u=[]),c=qS(_u,c,A),A=_t,(Ca===null?A.memoizedState:Ca.next)===null&&(A=A.alternate,X.H=A===null||A.memoizedState===null?P4:F1),c}function Mx(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return E0(c);if(c.$$typeof===N)return An(c)}throw Error(a(438,String(c)))}function w1(c){var A=null,x=_t.updateQueue;if(x!==null&&(A=x.memoCache),A==null){var g=_t.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(A={data:g.data.map(function(S){return S.slice()}),index:0})))}if(A==null&&(A={data:[],index:0}),x===null&&(x=Ux(),_t.updateQueue=x),x.memoCache=A,x=A.data[A.index],x===void 0)for(x=A.data[A.index]=Array(c),g=0;g<c;g++)x[g]=D;return A.index++,x}function $l(c,A){return typeof A=="function"?A(c):A}function Rx(c){var A=ha();return N1(A,pr,c)}function N1(c,A,x){var g=c.queue;if(g===null)throw Error(a(311));g.lastRenderedReducer=x;var S=c.baseQueue,I=g.pending;if(I!==null){if(S!==null){var V=S.next;S.next=I.next,I.next=V}A.baseQueue=S=I,g.pending=null}if(I=c.baseState,S===null)c.memoizedState=I;else{A=S.next;var se=V=null,xe=null,Ee=A,Pe=!1;do{var Qe=Ee.lane&-536870913;if(Qe!==Ee.lane?(Qt&Qe)===Qe:(zl&Qe)===Qe){var _e=Ee.revertLane;if(_e===0)xe!==null&&(xe=xe.next={lane:0,revertLane:0,gesture:null,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null}),Qe===Cu&&(Pe=!0);else if((zl&_e)===_e){Ee=Ee.next,_e===Cu&&(Pe=!0);continue}else Qe={lane:0,revertLane:Ee.revertLane,gesture:null,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null},xe===null?(se=xe=Qe,V=I):xe=xe.next=Qe,_t.lanes|=_e,ec|=_e;Qe=Ee.action,cd&&x(I,Qe),I=Ee.hasEagerState?Ee.eagerState:x(I,Qe)}else _e={lane:Qe,revertLane:Ee.revertLane,gesture:Ee.gesture,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null},xe===null?(se=xe=_e,V=I):xe=xe.next=_e,_t.lanes|=Qe,ec|=Qe;Ee=Ee.next}while(Ee!==null&&Ee!==A);if(xe===null?V=I:xe.next=se,!js(I,c.memoizedState)&&(ka=!0,Pe&&(x=ku,x!==null)))throw x;c.memoizedState=I,c.baseState=V,c.baseQueue=xe,g.lastRenderedState=I}return S===null&&(g.lanes=0),[c.memoizedState,g.dispatch]}function C1(c){var A=ha(),x=A.queue;if(x===null)throw Error(a(311));x.lastRenderedReducer=c;var g=x.dispatch,S=x.pending,I=A.memoizedState;if(S!==null){x.pending=null;var V=S=S.next;do I=c(I,V.action),V=V.next;while(V!==S);js(I,A.memoizedState)||(ka=!0),A.memoizedState=I,A.baseQueue===null&&(A.baseState=I),x.lastRenderedState=I}return[I,g]}function s4(c,A,x){var g=_t,S=ha(),I=qt;if(I){if(x===void 0)throw Error(a(407));x=x()}else x=A();var V=!js((pr||S).memoizedState,x);if(V&&(S.memoizedState=x,ka=!0),S=S.queue,E1(o4.bind(null,g,S,c),[c]),S.getSnapshot!==A||V||Ca!==null&&Ca.memoizedState.tag&1){if(g.flags|=2048,Tu(9,{destroy:void 0},l4.bind(null,g,S,x,A),null),vr===null)throw Error(a(349));I||(zl&127)!==0||i4(g,A,x)}return x}function i4(c,A,x){c.flags|=16384,c={getSnapshot:A,value:x},A=_t.updateQueue,A===null?(A=Ux(),_t.updateQueue=A,A.stores=[c]):(x=A.stores,x===null?A.stores=[c]:x.push(c))}function l4(c,A,x,g){A.value=x,A.getSnapshot=g,c4(A)&&d4(c)}function o4(c,A,x){return x(function(){c4(A)&&d4(c)})}function c4(c){var A=c.getSnapshot;c=c.value;try{var x=A();return!js(c,x)}catch{return!0}}function d4(c){var A=ed(c,2);A!==null&&ds(A,c,2)}function k1(c){var A=Vn();if(typeof c=="function"){var x=c;if(c=x(),cd){fr(!0);try{x()}finally{fr(!1)}}}return A.memoizedState=A.baseState=c,A.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$l,lastRenderedState:c},A}function u4(c,A,x,g){return c.baseState=x,N1(c,pr,typeof g=="function"?g:$l)}function D$(c,A,x,g,S){if(Lx(c))throw Error(a(485));if(c=A.action,c!==null){var I={payload:S,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(V){I.listeners.push(V)}};X.T!==null?x(!0):I.isTransition=!1,g(I),x=A.pending,x===null?(I.next=A.pending=I,A4(A,I)):(I.next=x.next,A.pending=x.next=I)}}function A4(c,A){var x=A.action,g=A.payload,S=c.state;if(A.isTransition){var I=X.T,V={};X.T=V;try{var se=x(S,g),xe=X.S;xe!==null&&xe(V,se),f4(c,A,se)}catch(Ee){j1(c,A,Ee)}finally{I!==null&&V.types!==null&&(I.types=V.types),X.T=I}}else try{I=x(S,g),f4(c,A,I)}catch(Ee){j1(c,A,Ee)}}function f4(c,A,x){x!==null&&typeof x=="object"&&typeof x.then=="function"?x.then(function(g){p4(c,A,g)},function(g){return j1(c,A,g)}):p4(c,A,x)}function p4(c,A,x){A.status="fulfilled",A.value=x,x4(A),c.state=x,A=c.pending,A!==null&&(x=A.next,x===A?c.pending=null:(x=x.next,A.next=x,A4(c,x)))}function j1(c,A,x){var g=c.pending;if(c.pending=null,g!==null){g=g.next;do A.status="rejected",A.reason=x,x4(A),A=A.next;while(A!==g)}c.action=null}function x4(c){c=c.listeners;for(var A=0;A<c.length;A++)(0,c[A])()}function h4(c,A){return A}function m4(c,A){if(qt){var x=vr.formState;if(x!==null){e:{var g=_t;if(qt){if(Ir){t:{for(var S=Ir,I=ti;S.nodeType!==8;){if(!I){S=null;break t}if(S=ai(S.nextSibling),S===null){S=null;break t}}I=S.data,S=I==="F!"||I==="F"?S:null}if(S){Ir=ai(S.nextSibling),g=S.data==="F!";break e}}Vo(g)}g=!1}g&&(A=x[0])}}return x=Vn(),x.memoizedState=x.baseState=A,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:h4,lastRenderedState:A},x.queue=g,x=M4.bind(null,_t,g),g.dispatch=x,g=k1(!1),I=I1.bind(null,_t,!1,g.queue),g=Vn(),S={state:A,dispatch:null,action:c,pending:null},g.queue=S,x=D$.bind(null,_t,S,I,x),S.dispatch=x,g.memoizedState=c,[A,x,!1]}function g4(c){var A=ha();return b4(A,pr,c)}function b4(c,A,x){if(A=N1(c,A,h4)[0],c=Rx($l)[0],typeof A=="object"&&A!==null&&typeof A.then=="function")try{var g=E0(A)}catch(V){throw V===ju?Ex:V}else g=A;A=ha();var S=A.queue,I=S.dispatch;return x!==A.memoizedState&&(_t.flags|=2048,Tu(9,{destroy:void 0},U$.bind(null,S,x),null)),[g,I,c]}function U$(c,A){c.action=A}function v4(c){var A=ha(),x=pr;if(x!==null)return b4(A,x,c);ha(),A=A.memoizedState,x=ha();var g=x.queue.dispatch;return x.memoizedState=c,[A,g,!1]}function Tu(c,A,x,g){return c={tag:c,create:x,deps:g,inst:A,next:null},A=_t.updateQueue,A===null&&(A=Ux(),_t.updateQueue=A),x=A.lastEffect,x===null?A.lastEffect=c.next=c:(g=x.next,x.next=c,c.next=g,A.lastEffect=c),c}function y4(){return ha().memoizedState}function Ox(c,A,x,g){var S=Vn();_t.flags|=c,S.memoizedState=Tu(1|A,{destroy:void 0},x,g===void 0?null:g)}function Px(c,A,x,g){var S=ha();g=g===void 0?null:g;var I=S.memoizedState.inst;pr!==null&&g!==null&&m1(g,pr.memoizedState.deps)?S.memoizedState=Tu(A,I,x,g):(_t.flags|=c,S.memoizedState=Tu(1|A,I,x,g))}function w4(c,A){Ox(8390656,8,c,A)}function E1(c,A){Px(2048,8,c,A)}function M$(c){_t.flags|=4;var A=_t.updateQueue;if(A===null)A=Ux(),_t.updateQueue=A,A.events=[c];else{var x=A.events;x===null?A.events=[c]:x.push(c)}}function N4(c){var A=ha().memoizedState;return M$({ref:A,nextImpl:c}),function(){if((ar&2)!==0)throw Error(a(440));return A.impl.apply(void 0,arguments)}}function C4(c,A){return Px(4,2,c,A)}function k4(c,A){return Px(4,4,c,A)}function j4(c,A){if(typeof A=="function"){c=c();var x=A(c);return function(){typeof x=="function"?x():A(null)}}if(A!=null)return c=c(),A.current=c,function(){A.current=null}}function E4(c,A,x){x=x!=null?x.concat([c]):null,Px(4,4,j4.bind(null,A,c),x)}function S1(){}function S4(c,A){var x=ha();A=A===void 0?null:A;var g=x.memoizedState;return A!==null&&m1(A,g[1])?g[0]:(x.memoizedState=[c,A],c)}function B4(c,A){var x=ha();A=A===void 0?null:A;var g=x.memoizedState;if(A!==null&&m1(A,g[1]))return g[0];if(g=c(),cd){fr(!0);try{c()}finally{fr(!1)}}return x.memoizedState=[g,A],g}function B1(c,A,x){return x===void 0||(zl&1073741824)!==0&&(Qt&261930)===0?c.memoizedState=A:(c.memoizedState=x,c=_B(),_t.lanes|=c,ec|=c,x)}function _4(c,A,x,g){return js(x,A)?x:Su.current!==null?(c=B1(c,x,g),js(c,A)||(ka=!0),c):(zl&42)===0||(zl&1073741824)!==0&&(Qt&261930)===0?(ka=!0,c.memoizedState=x):(c=_B(),_t.lanes|=c,ec|=c,A)}function T4(c,A,x,g,S){var I=K.p;K.p=I!==0&&8>I?I:8;var V=X.T,se={};X.T=se,I1(c,!1,A,x);try{var xe=S(),Ee=X.S;if(Ee!==null&&Ee(se,xe),xe!==null&&typeof xe=="object"&&typeof xe.then=="function"){var Pe=T$(xe,g);S0(c,A,Pe,Is(c))}else S0(c,A,g,Is(c))}catch(Qe){S0(c,A,{then:function(){},status:"rejected",reason:Qe},Is())}finally{K.p=I,V!==null&&se.types!==null&&(V.types=se.types),X.T=V}}function R$(){}function _1(c,A,x,g){if(c.tag!==5)throw Error(a(476));var S=I4(c).queue;T4(c,S,A,ee,x===null?R$:function(){return F4(c),x(g)})}function I4(c){var A=c.memoizedState;if(A!==null)return A;A={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$l,lastRenderedState:ee},next:null};var x={};return A.next={memoizedState:x,baseState:x,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$l,lastRenderedState:x},next:null},c.memoizedState=A,c=c.alternate,c!==null&&(c.memoizedState=A),A}function F4(c){var A=I4(c);A.next===null&&(A=c.alternate.memoizedState),S0(c,A.next.queue,{},Is())}function T1(){return An(V0)}function D4(){return ha().memoizedState}function U4(){return ha().memoizedState}function O$(c){for(var A=c.return;A!==null;){switch(A.tag){case 24:case 3:var x=Is();c=qo(x);var g=Wo(A,c,x);g!==null&&(ds(g,A,x),N0(g,A,x)),A={cache:i1()},c.payload=A;return}A=A.return}}function P$(c,A,x){var g=Is();x={lane:g,revertLane:0,gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},Lx(c)?R4(A,x):(x=Wv(c,A,x,g),x!==null&&(ds(x,c,g),O4(x,A,g)))}function M4(c,A,x){var g=Is();S0(c,A,x,g)}function S0(c,A,x,g){var S={lane:g,revertLane:0,gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null};if(Lx(c))R4(A,S);else{var I=c.alternate;if(c.lanes===0&&(I===null||I.lanes===0)&&(I=A.lastRenderedReducer,I!==null))try{var V=A.lastRenderedState,se=I(V,x);if(S.hasEagerState=!0,S.eagerState=se,js(se,V))return vx(c,A,S,0),vr===null&&bx(),!1}catch{}finally{}if(x=Wv(c,A,S,g),x!==null)return ds(x,c,g),O4(x,A,g),!0}return!1}function I1(c,A,x,g){if(g={lane:2,revertLane:dy(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Lx(c)){if(A)throw Error(a(479))}else A=Wv(c,x,g,2),A!==null&&ds(A,c,2)}function Lx(c){var A=c.alternate;return c===_t||A!==null&&A===_t}function R4(c,A){Bu=Fx=!0;var x=c.pending;x===null?A.next=A:(A.next=x.next,x.next=A),c.pending=A}function O4(c,A,x){if((x&4194048)!==0){var g=A.lanes;g&=c.pendingLanes,x|=g,A.lanes=x,Ma(c,x)}}var B0={readContext:An,use:Mx,useCallback:aa,useContext:aa,useEffect:aa,useImperativeHandle:aa,useLayoutEffect:aa,useInsertionEffect:aa,useMemo:aa,useReducer:aa,useRef:aa,useState:aa,useDebugValue:aa,useDeferredValue:aa,useTransition:aa,useSyncExternalStore:aa,useId:aa,useHostTransitionStatus:aa,useFormState:aa,useActionState:aa,useOptimistic:aa,useMemoCache:aa,useCacheRefresh:aa};B0.useEffectEvent=aa;var P4={readContext:An,use:Mx,useCallback:function(c,A){return Vn().memoizedState=[c,A===void 0?null:A],c},useContext:An,useEffect:w4,useImperativeHandle:function(c,A,x){x=x!=null?x.concat([c]):null,Ox(4194308,4,j4.bind(null,A,c),x)},useLayoutEffect:function(c,A){return Ox(4194308,4,c,A)},useInsertionEffect:function(c,A){Ox(4,2,c,A)},useMemo:function(c,A){var x=Vn();A=A===void 0?null:A;var g=c();if(cd){fr(!0);try{c()}finally{fr(!1)}}return x.memoizedState=[g,A],g},useReducer:function(c,A,x){var g=Vn();if(x!==void 0){var S=x(A);if(cd){fr(!0);try{x(A)}finally{fr(!1)}}}else S=A;return g.memoizedState=g.baseState=S,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:S},g.queue=c,c=c.dispatch=P$.bind(null,_t,c),[g.memoizedState,c]},useRef:function(c){var A=Vn();return c={current:c},A.memoizedState=c},useState:function(c){c=k1(c);var A=c.queue,x=M4.bind(null,_t,A);return A.dispatch=x,[c.memoizedState,x]},useDebugValue:S1,useDeferredValue:function(c,A){var x=Vn();return B1(x,c,A)},useTransition:function(){var c=k1(!1);return c=T4.bind(null,_t,c.queue,!0,!1),Vn().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,A,x){var g=_t,S=Vn();if(qt){if(x===void 0)throw Error(a(407));x=x()}else{if(x=A(),vr===null)throw Error(a(349));(Qt&127)!==0||i4(g,A,x)}S.memoizedState=x;var I={value:x,getSnapshot:A};return S.queue=I,w4(o4.bind(null,g,I,c),[c]),g.flags|=2048,Tu(9,{destroy:void 0},l4.bind(null,g,I,x,A),null),x},useId:function(){var c=Vn(),A=vr.identifierPrefix;if(qt){var x=al,g=rl;x=(g&~(1<<32-Cr(g)-1)).toString(32)+x,A="_"+A+"R_"+x,x=Dx++,0<x&&(A+="H"+x.toString(32)),A+="_"}else x=I$++,A="_"+A+"r_"+x.toString(32)+"_";return c.memoizedState=A},useHostTransitionStatus:T1,useFormState:m4,useActionState:m4,useOptimistic:function(c){var A=Vn();A.memoizedState=A.baseState=c;var x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return A.queue=x,A=I1.bind(null,_t,!0,x),x.dispatch=A,[c,A]},useMemoCache:w1,useCacheRefresh:function(){return Vn().memoizedState=O$.bind(null,_t)},useEffectEvent:function(c){var A=Vn(),x={impl:c};return A.memoizedState=x,function(){if((ar&2)!==0)throw Error(a(440));return x.impl.apply(void 0,arguments)}}},F1={readContext:An,use:Mx,useCallback:S4,useContext:An,useEffect:E1,useImperativeHandle:E4,useInsertionEffect:C4,useLayoutEffect:k4,useMemo:B4,useReducer:Rx,useRef:y4,useState:function(){return Rx($l)},useDebugValue:S1,useDeferredValue:function(c,A){var x=ha();return _4(x,pr.memoizedState,c,A)},useTransition:function(){var c=Rx($l)[0],A=ha().memoizedState;return[typeof c=="boolean"?c:E0(c),A]},useSyncExternalStore:s4,useId:D4,useHostTransitionStatus:T1,useFormState:g4,useActionState:g4,useOptimistic:function(c,A){var x=ha();return u4(x,pr,c,A)},useMemoCache:w1,useCacheRefresh:U4};F1.useEffectEvent=N4;var L4={readContext:An,use:Mx,useCallback:S4,useContext:An,useEffect:E1,useImperativeHandle:E4,useInsertionEffect:C4,useLayoutEffect:k4,useMemo:B4,useReducer:C1,useRef:y4,useState:function(){return C1($l)},useDebugValue:S1,useDeferredValue:function(c,A){var x=ha();return pr===null?B1(x,c,A):_4(x,pr.memoizedState,c,A)},useTransition:function(){var c=C1($l)[0],A=ha().memoizedState;return[typeof c=="boolean"?c:E0(c),A]},useSyncExternalStore:s4,useId:D4,useHostTransitionStatus:T1,useFormState:v4,useActionState:v4,useOptimistic:function(c,A){var x=ha();return pr!==null?u4(x,pr,c,A):(x.baseState=c,[c,x.queue.dispatch])},useMemoCache:w1,useCacheRefresh:U4};L4.useEffectEvent=N4;function D1(c,A,x,g){A=c.memoizedState,x=x(g,A),x=x==null?A:p({},A,x),c.memoizedState=x,c.lanes===0&&(c.updateQueue.baseState=x)}var U1={enqueueSetState:function(c,A,x){c=c._reactInternals;var g=Is(),S=qo(g);S.payload=A,x!=null&&(S.callback=x),A=Wo(c,S,g),A!==null&&(ds(A,c,g),N0(A,c,g))},enqueueReplaceState:function(c,A,x){c=c._reactInternals;var g=Is(),S=qo(g);S.tag=1,S.payload=A,x!=null&&(S.callback=x),A=Wo(c,S,g),A!==null&&(ds(A,c,g),N0(A,c,g))},enqueueForceUpdate:function(c,A){c=c._reactInternals;var x=Is(),g=qo(x);g.tag=2,A!=null&&(g.callback=A),A=Wo(c,g,x),A!==null&&(ds(A,c,x),N0(A,c,x))}};function Q4(c,A,x,g,S,I,V){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(g,I,V):A.prototype&&A.prototype.isPureReactComponent?!x0(x,g)||!x0(S,I):!0}function H4(c,A,x,g){c=A.state,typeof A.componentWillReceiveProps=="function"&&A.componentWillReceiveProps(x,g),typeof A.UNSAFE_componentWillReceiveProps=="function"&&A.UNSAFE_componentWillReceiveProps(x,g),A.state!==c&&U1.enqueueReplaceState(A,A.state,null)}function dd(c,A){var x=A;if("ref"in A){x={};for(var g in A)g!=="ref"&&(x[g]=A[g])}if(c=c.defaultProps){x===A&&(x=p({},x));for(var S in c)x[S]===void 0&&(x[S]=c[S])}return x}function z4(c){gx(c)}function $4(c){console.error(c)}function V4(c){gx(c)}function Qx(c,A){try{var x=c.onUncaughtError;x(A.value,{componentStack:A.stack})}catch(g){setTimeout(function(){throw g})}}function G4(c,A,x){try{var g=c.onCaughtError;g(x.value,{componentStack:x.stack,errorBoundary:A.tag===1?A.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function M1(c,A,x){return x=qo(x),x.tag=3,x.payload={element:null},x.callback=function(){Qx(c,A)},x}function K4(c){return c=qo(c),c.tag=3,c}function q4(c,A,x,g){var S=x.type.getDerivedStateFromError;if(typeof S=="function"){var I=g.value;c.payload=function(){return S(I)},c.callback=function(){G4(A,x,g)}}var V=x.stateNode;V!==null&&typeof V.componentDidCatch=="function"&&(c.callback=function(){G4(A,x,g),typeof S!="function"&&(tc===null?tc=new Set([this]):tc.add(this));var se=g.stack;this.componentDidCatch(g.value,{componentStack:se!==null?se:""})})}function L$(c,A,x,g,S){if(x.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(A=x.alternate,A!==null&&Nu(A,x,S,!0),x=Ss.current,x!==null){switch(x.tag){case 31:case 13:return ri===null?Zx():x.alternate===null&&na===0&&(na=3),x.flags&=-257,x.flags|=65536,x.lanes=S,g===Sx?x.flags|=16384:(A=x.updateQueue,A===null?x.updateQueue=new Set([g]):A.add(g),ly(c,g,S)),!1;case 22:return x.flags|=65536,g===Sx?x.flags|=16384:(A=x.updateQueue,A===null?(A={transitions:null,markerInstances:null,retryQueue:new Set([g])},x.updateQueue=A):(x=A.retryQueue,x===null?A.retryQueue=new Set([g]):x.add(g)),ly(c,g,S)),!1}throw Error(a(435,x.tag))}return ly(c,g,S),Zx(),!1}if(qt)return A=Ss.current,A!==null?((A.flags&65536)===0&&(A.flags|=256),A.flags|=65536,A.lanes=S,g!==t1&&(c=Error(a(422),{cause:g}),g0(Js(c,x)))):(g!==t1&&(A=Error(a(423),{cause:g}),g0(Js(A,x))),c=c.current.alternate,c.flags|=65536,S&=-S,c.lanes|=S,g=Js(g,x),S=M1(c.stateNode,g,S),A1(c,S),na!==4&&(na=2)),!1;var I=Error(a(520),{cause:g});if(I=Js(I,x),R0===null?R0=[I]:R0.push(I),na!==4&&(na=2),A===null)return!0;g=Js(g,x),x=A;do{switch(x.tag){case 3:return x.flags|=65536,c=S&-S,x.lanes|=c,c=M1(x.stateNode,g,c),A1(x,c),!1;case 1:if(A=x.type,I=x.stateNode,(x.flags&128)===0&&(typeof A.getDerivedStateFromError=="function"||I!==null&&typeof I.componentDidCatch=="function"&&(tc===null||!tc.has(I))))return x.flags|=65536,S&=-S,x.lanes|=S,S=K4(S),q4(S,c,x,g),A1(x,S),!1}x=x.return}while(x!==null);return!1}var R1=Error(a(461)),ka=!1;function fn(c,A,x,g){A.child=c===null?JS(A,null,x,g):od(A,c.child,x,g)}function W4(c,A,x,g,S){x=x.render;var I=A.ref;if("ref"in g){var V={};for(var se in g)se!=="ref"&&(V[se]=g[se])}else V=g;return nd(A),g=g1(c,A,x,V,I,S),se=b1(),c!==null&&!ka?(v1(c,A,S),Vl(c,A,S)):(qt&&se&&Zv(A),A.flags|=1,fn(c,A,g,S),A.child)}function Y4(c,A,x,g,S){if(c===null){var I=x.type;return typeof I=="function"&&!Yv(I)&&I.defaultProps===void 0&&x.compare===null?(A.tag=15,A.type=I,X4(c,A,I,g,S)):(c=wx(x.type,null,g,A,A.mode,S),c.ref=A.ref,c.return=A,A.child=c)}if(I=c.child,!V1(c,S)){var V=I.memoizedProps;if(x=x.compare,x=x!==null?x:x0,x(V,g)&&c.ref===A.ref)return Vl(c,A,S)}return A.flags|=1,c=Pl(I,g),c.ref=A.ref,c.return=A,A.child=c}function X4(c,A,x,g,S){if(c!==null){var I=c.memoizedProps;if(x0(I,g)&&c.ref===A.ref)if(ka=!1,A.pendingProps=g=I,V1(c,S))(c.flags&131072)!==0&&(ka=!0);else return A.lanes=c.lanes,Vl(c,A,S)}return O1(c,A,x,g,S)}function J4(c,A,x,g){var S=g.children,I=c!==null?c.memoizedState:null;if(c===null&&A.stateNode===null&&(A.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((A.flags&128)!==0){if(I=I!==null?I.baseLanes|x:x,c!==null){for(g=A.child=c.child,S=0;g!==null;)S=S|g.lanes|g.childLanes,g=g.sibling;g=S&~I}else g=0,A.child=null;return Z4(c,A,I,x,g)}if((x&536870912)!==0)A.memoizedState={baseLanes:0,cachePool:null},c!==null&&jx(A,I!==null?I.cachePool:null),I!==null?t4(A,I):p1(),r4(A);else return g=A.lanes=536870912,Z4(c,A,I!==null?I.baseLanes|x:x,x,g)}else I!==null?(jx(A,I.cachePool),t4(A,I),Xo(),A.memoizedState=null):(c!==null&&jx(A,null),p1(),Xo());return fn(c,A,S,x),A.child}function _0(c,A){return c!==null&&c.tag===22||A.stateNode!==null||(A.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),A.sibling}function Z4(c,A,x,g,S){var I=o1();return I=I===null?null:{parent:Na._currentValue,pool:I},A.memoizedState={baseLanes:x,cachePool:I},c!==null&&jx(A,null),p1(),r4(A),c!==null&&Nu(c,A,g,!0),A.childLanes=S,null}function Hx(c,A){return A=$x({mode:A.mode,children:A.children},c.mode),A.ref=c.ref,c.child=A,A.return=c,A}function eB(c,A,x){return od(A,c.child,null,x),c=Hx(A,A.pendingProps),c.flags|=2,Bs(A),A.memoizedState=null,c}function Q$(c,A,x){var g=A.pendingProps,S=(A.flags&128)!==0;if(A.flags&=-129,c===null){if(qt){if(g.mode==="hidden")return c=Hx(A,g),A.lanes=536870912,_0(null,c);if(h1(A),(c=Ir)?(c=A_(c,ti),c=c!==null&&c.data==="&"?c:null,c!==null&&(A.memoizedState={dehydrated:c,treeContext:zo!==null?{id:rl,overflow:al}:null,retryLane:536870912,hydrationErrors:null},x=RS(c),x.return=A,A.child=x,un=A,Ir=null)):c=null,c===null)throw Vo(A);return A.lanes=536870912,null}return Hx(A,g)}var I=c.memoizedState;if(I!==null){var V=I.dehydrated;if(h1(A),S)if(A.flags&256)A.flags&=-257,A=eB(c,A,x);else if(A.memoizedState!==null)A.child=c.child,A.flags|=128,A=null;else throw Error(a(558));else if(ka||Nu(c,A,x,!1),S=(x&c.childLanes)!==0,ka||S){if(g=vr,g!==null&&(V=be(g,x),V!==0&&V!==I.retryLane))throw I.retryLane=V,ed(c,V),ds(g,c,V),R1;Zx(),A=eB(c,A,x)}else c=I.treeContext,Ir=ai(V.nextSibling),un=A,qt=!0,$o=null,ti=!1,c!==null&&LS(A,c),A=Hx(A,g),A.flags|=4096;return A}return c=Pl(c.child,{mode:g.mode,children:g.children}),c.ref=A.ref,A.child=c,c.return=A,c}function zx(c,A){var x=A.ref;if(x===null)c!==null&&c.ref!==null&&(A.flags|=4194816);else{if(typeof x!="function"&&typeof x!="object")throw Error(a(284));(c===null||c.ref!==x)&&(A.flags|=4194816)}}function O1(c,A,x,g,S){return nd(A),x=g1(c,A,x,g,void 0,S),g=b1(),c!==null&&!ka?(v1(c,A,S),Vl(c,A,S)):(qt&&g&&Zv(A),A.flags|=1,fn(c,A,x,S),A.child)}function tB(c,A,x,g,S,I){return nd(A),A.updateQueue=null,x=n4(A,g,x,S),a4(c),g=b1(),c!==null&&!ka?(v1(c,A,I),Vl(c,A,I)):(qt&&g&&Zv(A),A.flags|=1,fn(c,A,x,I),A.child)}function rB(c,A,x,g,S){if(nd(A),A.stateNode===null){var I=bu,V=x.contextType;typeof V=="object"&&V!==null&&(I=An(V)),I=new x(g,I),A.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,I.updater=U1,A.stateNode=I,I._reactInternals=A,I=A.stateNode,I.props=g,I.state=A.memoizedState,I.refs={},d1(A),V=x.contextType,I.context=typeof V=="object"&&V!==null?An(V):bu,I.state=A.memoizedState,V=x.getDerivedStateFromProps,typeof V=="function"&&(D1(A,x,V,g),I.state=A.memoizedState),typeof x.getDerivedStateFromProps=="function"||typeof I.getSnapshotBeforeUpdate=="function"||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(V=I.state,typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount(),V!==I.state&&U1.enqueueReplaceState(I,I.state,null),k0(A,g,I,S),C0(),I.state=A.memoizedState),typeof I.componentDidMount=="function"&&(A.flags|=4194308),g=!0}else if(c===null){I=A.stateNode;var se=A.memoizedProps,xe=dd(x,se);I.props=xe;var Ee=I.context,Pe=x.contextType;V=bu,typeof Pe=="object"&&Pe!==null&&(V=An(Pe));var Qe=x.getDerivedStateFromProps;Pe=typeof Qe=="function"||typeof I.getSnapshotBeforeUpdate=="function",se=A.pendingProps!==se,Pe||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(se||Ee!==V)&&H4(A,I,g,V),Ko=!1;var _e=A.memoizedState;I.state=_e,k0(A,g,I,S),C0(),Ee=A.memoizedState,se||_e!==Ee||Ko?(typeof Qe=="function"&&(D1(A,x,Qe,g),Ee=A.memoizedState),(xe=Ko||Q4(A,x,xe,g,_e,Ee,V))?(Pe||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount()),typeof I.componentDidMount=="function"&&(A.flags|=4194308)):(typeof I.componentDidMount=="function"&&(A.flags|=4194308),A.memoizedProps=g,A.memoizedState=Ee),I.props=g,I.state=Ee,I.context=V,g=xe):(typeof I.componentDidMount=="function"&&(A.flags|=4194308),g=!1)}else{I=A.stateNode,u1(c,A),V=A.memoizedProps,Pe=dd(x,V),I.props=Pe,Qe=A.pendingProps,_e=I.context,Ee=x.contextType,xe=bu,typeof Ee=="object"&&Ee!==null&&(xe=An(Ee)),se=x.getDerivedStateFromProps,(Ee=typeof se=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(V!==Qe||_e!==xe)&&H4(A,I,g,xe),Ko=!1,_e=A.memoizedState,I.state=_e,k0(A,g,I,S),C0();var Fe=A.memoizedState;V!==Qe||_e!==Fe||Ko||c!==null&&c.dependencies!==null&&Cx(c.dependencies)?(typeof se=="function"&&(D1(A,x,se,g),Fe=A.memoizedState),(Pe=Ko||Q4(A,x,Pe,g,_e,Fe,xe)||c!==null&&c.dependencies!==null&&Cx(c.dependencies))?(Ee||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(g,Fe,xe),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(g,Fe,xe)),typeof I.componentDidUpdate=="function"&&(A.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(A.flags|=1024)):(typeof I.componentDidUpdate!="function"||V===c.memoizedProps&&_e===c.memoizedState||(A.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||V===c.memoizedProps&&_e===c.memoizedState||(A.flags|=1024),A.memoizedProps=g,A.memoizedState=Fe),I.props=g,I.state=Fe,I.context=xe,g=Pe):(typeof I.componentDidUpdate!="function"||V===c.memoizedProps&&_e===c.memoizedState||(A.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||V===c.memoizedProps&&_e===c.memoizedState||(A.flags|=1024),g=!1)}return I=g,zx(c,A),g=(A.flags&128)!==0,I||g?(I=A.stateNode,x=g&&typeof x.getDerivedStateFromError!="function"?null:I.render(),A.flags|=1,c!==null&&g?(A.child=od(A,c.child,null,S),A.child=od(A,null,x,S)):fn(c,A,x,S),A.memoizedState=I.state,c=A.child):c=Vl(c,A,S),c}function aB(c,A,x,g){return rd(),A.flags|=256,fn(c,A,x,g),A.child}var P1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function L1(c){return{baseLanes:c,cachePool:GS()}}function Q1(c,A,x){return c=c!==null?c.childLanes&~x:0,A&&(c|=Ts),c}function nB(c,A,x){var g=A.pendingProps,S=!1,I=(A.flags&128)!==0,V;if((V=I)||(V=c!==null&&c.memoizedState===null?!1:(xa.current&2)!==0),V&&(S=!0,A.flags&=-129),V=(A.flags&32)!==0,A.flags&=-33,c===null){if(qt){if(S?Yo(A):Xo(),(c=Ir)?(c=A_(c,ti),c=c!==null&&c.data!=="&"?c:null,c!==null&&(A.memoizedState={dehydrated:c,treeContext:zo!==null?{id:rl,overflow:al}:null,retryLane:536870912,hydrationErrors:null},x=RS(c),x.return=A,A.child=x,un=A,Ir=null)):c=null,c===null)throw Vo(A);return Ny(c)?A.lanes=32:A.lanes=536870912,null}var se=g.children;return g=g.fallback,S?(Xo(),S=A.mode,se=$x({mode:"hidden",children:se},S),g=td(g,S,x,null),se.return=A,g.return=A,se.sibling=g,A.child=se,g=A.child,g.memoizedState=L1(x),g.childLanes=Q1(c,V,x),A.memoizedState=P1,_0(null,g)):(Yo(A),H1(A,se))}var xe=c.memoizedState;if(xe!==null&&(se=xe.dehydrated,se!==null)){if(I)A.flags&256?(Yo(A),A.flags&=-257,A=z1(c,A,x)):A.memoizedState!==null?(Xo(),A.child=c.child,A.flags|=128,A=null):(Xo(),se=g.fallback,S=A.mode,g=$x({mode:"visible",children:g.children},S),se=td(se,S,x,null),se.flags|=2,g.return=A,se.return=A,g.sibling=se,A.child=g,od(A,c.child,null,x),g=A.child,g.memoizedState=L1(x),g.childLanes=Q1(c,V,x),A.memoizedState=P1,A=_0(null,g));else if(Yo(A),Ny(se)){if(V=se.nextSibling&&se.nextSibling.dataset,V)var Ee=V.dgst;V=Ee,g=Error(a(419)),g.stack="",g.digest=V,g0({value:g,source:null,stack:null}),A=z1(c,A,x)}else if(ka||Nu(c,A,x,!1),V=(x&c.childLanes)!==0,ka||V){if(V=vr,V!==null&&(g=be(V,x),g!==0&&g!==xe.retryLane))throw xe.retryLane=g,ed(c,g),ds(V,c,g),R1;wy(se)||Zx(),A=z1(c,A,x)}else wy(se)?(A.flags|=192,A.child=c.child,A=null):(c=xe.treeContext,Ir=ai(se.nextSibling),un=A,qt=!0,$o=null,ti=!1,c!==null&&LS(A,c),A=H1(A,g.children),A.flags|=4096);return A}return S?(Xo(),se=g.fallback,S=A.mode,xe=c.child,Ee=xe.sibling,g=Pl(xe,{mode:"hidden",children:g.children}),g.subtreeFlags=xe.subtreeFlags&65011712,Ee!==null?se=Pl(Ee,se):(se=td(se,S,x,null),se.flags|=2),se.return=A,g.return=A,g.sibling=se,A.child=g,_0(null,g),g=A.child,se=c.child.memoizedState,se===null?se=L1(x):(S=se.cachePool,S!==null?(xe=Na._currentValue,S=S.parent!==xe?{parent:xe,pool:xe}:S):S=GS(),se={baseLanes:se.baseLanes|x,cachePool:S}),g.memoizedState=se,g.childLanes=Q1(c,V,x),A.memoizedState=P1,_0(c.child,g)):(Yo(A),x=c.child,c=x.sibling,x=Pl(x,{mode:"visible",children:g.children}),x.return=A,x.sibling=null,c!==null&&(V=A.deletions,V===null?(A.deletions=[c],A.flags|=16):V.push(c)),A.child=x,A.memoizedState=null,x)}function H1(c,A){return A=$x({mode:"visible",children:A},c.mode),A.return=c,c.child=A}function $x(c,A){return c=Es(22,c,null,A),c.lanes=0,c}function z1(c,A,x){return od(A,c.child,null,x),c=H1(A,A.pendingProps.children),c.flags|=2,A.memoizedState=null,c}function sB(c,A,x){c.lanes|=A;var g=c.alternate;g!==null&&(g.lanes|=A),n1(c.return,A,x)}function $1(c,A,x,g,S,I){var V=c.memoizedState;V===null?c.memoizedState={isBackwards:A,rendering:null,renderingStartTime:0,last:g,tail:x,tailMode:S,treeForkCount:I}:(V.isBackwards=A,V.rendering=null,V.renderingStartTime=0,V.last=g,V.tail=x,V.tailMode=S,V.treeForkCount=I)}function iB(c,A,x){var g=A.pendingProps,S=g.revealOrder,I=g.tail;g=g.children;var V=xa.current,se=(V&2)!==0;if(se?(V=V&1|2,A.flags|=128):V&=1,q(xa,V),fn(c,A,g,x),g=qt?m0:0,!se&&c!==null&&(c.flags&128)!==0)e:for(c=A.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&sB(c,x,A);else if(c.tag===19)sB(c,x,A);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===A)break e;for(;c.sibling===null;){if(c.return===null||c.return===A)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}switch(S){case"forwards":for(x=A.child,S=null;x!==null;)c=x.alternate,c!==null&&Ix(c)===null&&(S=x),x=x.sibling;x=S,x===null?(S=A.child,A.child=null):(S=x.sibling,x.sibling=null),$1(A,!1,S,x,I,g);break;case"backwards":case"unstable_legacy-backwards":for(x=null,S=A.child,A.child=null;S!==null;){if(c=S.alternate,c!==null&&Ix(c)===null){A.child=S;break}c=S.sibling,S.sibling=x,x=S,S=c}$1(A,!0,x,null,I,g);break;case"together":$1(A,!1,null,null,void 0,g);break;default:A.memoizedState=null}return A.child}function Vl(c,A,x){if(c!==null&&(A.dependencies=c.dependencies),ec|=A.lanes,(x&A.childLanes)===0)if(c!==null){if(Nu(c,A,x,!1),(x&A.childLanes)===0)return null}else return null;if(c!==null&&A.child!==c.child)throw Error(a(153));if(A.child!==null){for(c=A.child,x=Pl(c,c.pendingProps),A.child=x,x.return=A;c.sibling!==null;)c=c.sibling,x=x.sibling=Pl(c,c.pendingProps),x.return=A;x.sibling=null}return A.child}function V1(c,A){return(c.lanes&A)!==0?!0:(c=c.dependencies,!!(c!==null&&Cx(c)))}function H$(c,A,x){switch(A.tag){case 3:ne(A,A.stateNode.containerInfo),Go(A,Na,c.memoizedState.cache),rd();break;case 27:case 5:ie(A);break;case 4:ne(A,A.stateNode.containerInfo);break;case 10:Go(A,A.type,A.memoizedProps.value);break;case 31:if(A.memoizedState!==null)return A.flags|=128,h1(A),null;break;case 13:var g=A.memoizedState;if(g!==null)return g.dehydrated!==null?(Yo(A),A.flags|=128,null):(x&A.child.childLanes)!==0?nB(c,A,x):(Yo(A),c=Vl(c,A,x),c!==null?c.sibling:null);Yo(A);break;case 19:var S=(c.flags&128)!==0;if(g=(x&A.childLanes)!==0,g||(Nu(c,A,x,!1),g=(x&A.childLanes)!==0),S){if(g)return iB(c,A,x);A.flags|=128}if(S=A.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),q(xa,xa.current),g)break;return null;case 22:return A.lanes=0,J4(c,A,x,A.pendingProps);case 24:Go(A,Na,c.memoizedState.cache)}return Vl(c,A,x)}function lB(c,A,x){if(c!==null)if(c.memoizedProps!==A.pendingProps)ka=!0;else{if(!V1(c,x)&&(A.flags&128)===0)return ka=!1,H$(c,A,x);ka=(c.flags&131072)!==0}else ka=!1,qt&&(A.flags&1048576)!==0&&PS(A,m0,A.index);switch(A.lanes=0,A.tag){case 16:e:{var g=A.pendingProps;if(c=id(A.elementType),A.type=c,typeof c=="function")Yv(c)?(g=dd(c,g),A.tag=1,A=rB(null,A,c,g,x)):(A.tag=0,A=O1(null,A,c,g,x));else{if(c!=null){var S=c.$$typeof;if(S===E){A.tag=11,A=W4(null,A,c,g,x);break e}else if(S===F){A.tag=14,A=Y4(null,A,c,g,x);break e}}throw A=Q(c)||c,Error(a(306,A,""))}}return A;case 0:return O1(c,A,A.type,A.pendingProps,x);case 1:return g=A.type,S=dd(g,A.pendingProps),rB(c,A,g,S,x);case 3:e:{if(ne(A,A.stateNode.containerInfo),c===null)throw Error(a(387));g=A.pendingProps;var I=A.memoizedState;S=I.element,u1(c,A),k0(A,g,null,x);var V=A.memoizedState;if(g=V.cache,Go(A,Na,g),g!==I.cache&&s1(A,[Na],x,!0),C0(),g=V.element,I.isDehydrated)if(I={element:g,isDehydrated:!1,cache:V.cache},A.updateQueue.baseState=I,A.memoizedState=I,A.flags&256){A=aB(c,A,g,x);break e}else if(g!==S){S=Js(Error(a(424)),A),g0(S),A=aB(c,A,g,x);break e}else{switch(c=A.stateNode.containerInfo,c.nodeType){case 9:c=c.body;break;default:c=c.nodeName==="HTML"?c.ownerDocument.body:c}for(Ir=ai(c.firstChild),un=A,qt=!0,$o=null,ti=!0,x=JS(A,null,g,x),A.child=x;x;)x.flags=x.flags&-3|4096,x=x.sibling}else{if(rd(),g===S){A=Vl(c,A,x);break e}fn(c,A,g,x)}A=A.child}return A;case 26:return zx(c,A),c===null?(x=g_(A.type,null,A.pendingProps,null))?A.memoizedState=x:qt||(x=A.type,c=A.pendingProps,g=ih(re.current).createElement(x),g[ce]=A,g[ue]=c,pn(g,x,c),dt(g),A.stateNode=g):A.memoizedState=g_(A.type,c.memoizedProps,A.pendingProps,c.memoizedState),null;case 27:return ie(A),c===null&&qt&&(g=A.stateNode=x_(A.type,A.pendingProps,re.current),un=A,ti=!0,S=Ir,sc(A.type)?(Cy=S,Ir=ai(g.firstChild)):Ir=S),fn(c,A,A.pendingProps.children,x),zx(c,A),c===null&&(A.flags|=4194304),A.child;case 5:return c===null&&qt&&((S=g=Ir)&&(g=g7(g,A.type,A.pendingProps,ti),g!==null?(A.stateNode=g,un=A,Ir=ai(g.firstChild),ti=!1,S=!0):S=!1),S||Vo(A)),ie(A),S=A.type,I=A.pendingProps,V=c!==null?c.memoizedProps:null,g=I.children,by(S,I)?g=null:V!==null&&by(S,V)&&(A.flags|=32),A.memoizedState!==null&&(S=g1(c,A,F$,null,null,x),V0._currentValue=S),zx(c,A),fn(c,A,g,x),A.child;case 6:return c===null&&qt&&((c=x=Ir)&&(x=b7(x,A.pendingProps,ti),x!==null?(A.stateNode=x,un=A,Ir=null,c=!0):c=!1),c||Vo(A)),null;case 13:return nB(c,A,x);case 4:return ne(A,A.stateNode.containerInfo),g=A.pendingProps,c===null?A.child=od(A,null,g,x):fn(c,A,g,x),A.child;case 11:return W4(c,A,A.type,A.pendingProps,x);case 7:return fn(c,A,A.pendingProps,x),A.child;case 8:return fn(c,A,A.pendingProps.children,x),A.child;case 12:return fn(c,A,A.pendingProps.children,x),A.child;case 10:return g=A.pendingProps,Go(A,A.type,g.value),fn(c,A,g.children,x),A.child;case 9:return S=A.type._context,g=A.pendingProps.children,nd(A),S=An(S),g=g(S),A.flags|=1,fn(c,A,g,x),A.child;case 14:return Y4(c,A,A.type,A.pendingProps,x);case 15:return X4(c,A,A.type,A.pendingProps,x);case 19:return iB(c,A,x);case 31:return Q$(c,A,x);case 22:return J4(c,A,x,A.pendingProps);case 24:return nd(A),g=An(Na),c===null?(S=o1(),S===null&&(S=vr,I=i1(),S.pooledCache=I,I.refCount++,I!==null&&(S.pooledCacheLanes|=x),S=I),A.memoizedState={parent:g,cache:S},d1(A),Go(A,Na,S)):((c.lanes&x)!==0&&(u1(c,A),k0(A,null,null,x),C0()),S=c.memoizedState,I=A.memoizedState,S.parent!==g?(S={parent:g,cache:g},A.memoizedState=S,A.lanes===0&&(A.memoizedState=A.updateQueue.baseState=S),Go(A,Na,g)):(g=I.cache,Go(A,Na,g),g!==S.cache&&s1(A,[Na],x,!0))),fn(c,A,A.pendingProps.children,x),A.child;case 29:throw A.pendingProps}throw Error(a(156,A.tag))}function Gl(c){c.flags|=4}function G1(c,A,x,g,S){if((A=(c.mode&32)!==0)&&(A=!1),A){if(c.flags|=16777216,(S&335544128)===S)if(c.stateNode.complete)c.flags|=8192;else if(DB())c.flags|=8192;else throw ld=Sx,c1}else c.flags&=-16777217}function oB(c,A){if(A.type!=="stylesheet"||(A.state.loading&4)!==0)c.flags&=-16777217;else if(c.flags|=16777216,!N_(A))if(DB())c.flags|=8192;else throw ld=Sx,c1}function Vx(c,A){A!==null&&(c.flags|=4),c.flags&16384&&(A=c.tag!==22?Lo():536870912,c.lanes|=A,Uu|=A)}function T0(c,A){if(!qt)switch(c.tailMode){case"hidden":A=c.tail;for(var x=null;A!==null;)A.alternate!==null&&(x=A),A=A.sibling;x===null?c.tail=null:x.sibling=null;break;case"collapsed":x=c.tail;for(var g=null;x!==null;)x.alternate!==null&&(g=x),x=x.sibling;g===null?A||c.tail===null?c.tail=null:c.tail.sibling=null:g.sibling=null}}function Fr(c){var A=c.alternate!==null&&c.alternate.child===c.child,x=0,g=0;if(A)for(var S=c.child;S!==null;)x|=S.lanes|S.childLanes,g|=S.subtreeFlags&65011712,g|=S.flags&65011712,S.return=c,S=S.sibling;else for(S=c.child;S!==null;)x|=S.lanes|S.childLanes,g|=S.subtreeFlags,g|=S.flags,S.return=c,S=S.sibling;return c.subtreeFlags|=g,c.childLanes=x,A}function z$(c,A,x){var g=A.pendingProps;switch(e1(A),A.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fr(A),null;case 1:return Fr(A),null;case 3:return x=A.stateNode,g=null,c!==null&&(g=c.memoizedState.cache),A.memoizedState.cache!==g&&(A.flags|=2048),Hl(Na),ae(),x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null),(c===null||c.child===null)&&(wu(A)?Gl(A):c===null||c.memoizedState.isDehydrated&&(A.flags&256)===0||(A.flags|=1024,r1())),Fr(A),null;case 26:var S=A.type,I=A.memoizedState;return c===null?(Gl(A),I!==null?(Fr(A),oB(A,I)):(Fr(A),G1(A,S,null,g,x))):I?I!==c.memoizedState?(Gl(A),Fr(A),oB(A,I)):(Fr(A),A.flags&=-16777217):(c=c.memoizedProps,c!==g&&Gl(A),Fr(A),G1(A,S,c,g,x)),null;case 27:if(me(A),x=re.current,S=A.type,c!==null&&A.stateNode!=null)c.memoizedProps!==g&&Gl(A);else{if(!g){if(A.stateNode===null)throw Error(a(166));return Fr(A),null}c=z.current,wu(A)?QS(A):(c=x_(S,g,x),A.stateNode=c,Gl(A))}return Fr(A),null;case 5:if(me(A),S=A.type,c!==null&&A.stateNode!=null)c.memoizedProps!==g&&Gl(A);else{if(!g){if(A.stateNode===null)throw Error(a(166));return Fr(A),null}if(I=z.current,wu(A))QS(A);else{var V=ih(re.current);switch(I){case 1:I=V.createElementNS("http://www.w3.org/2000/svg",S);break;case 2:I=V.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;default:switch(S){case"svg":I=V.createElementNS("http://www.w3.org/2000/svg",S);break;case"math":I=V.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;case"script":I=V.createElement("div"),I.innerHTML="<script><\/script>",I=I.removeChild(I.firstChild);break;case"select":I=typeof g.is=="string"?V.createElement("select",{is:g.is}):V.createElement("select"),g.multiple?I.multiple=!0:g.size&&(I.size=g.size);break;default:I=typeof g.is=="string"?V.createElement(S,{is:g.is}):V.createElement(S)}}I[ce]=A,I[ue]=g;e:for(V=A.child;V!==null;){if(V.tag===5||V.tag===6)I.appendChild(V.stateNode);else if(V.tag!==4&&V.tag!==27&&V.child!==null){V.child.return=V,V=V.child;continue}if(V===A)break e;for(;V.sibling===null;){if(V.return===null||V.return===A)break e;V=V.return}V.sibling.return=V.return,V=V.sibling}A.stateNode=I;e:switch(pn(I,S,g),S){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Gl(A)}}return Fr(A),G1(A,A.type,c===null?null:c.memoizedProps,A.pendingProps,x),null;case 6:if(c&&A.stateNode!=null)c.memoizedProps!==g&&Gl(A);else{if(typeof g!="string"&&A.stateNode===null)throw Error(a(166));if(c=re.current,wu(A)){if(c=A.stateNode,x=A.memoizedProps,g=null,S=un,S!==null)switch(S.tag){case 27:case 5:g=S.memoizedProps}c[ce]=A,c=!!(c.nodeValue===x||g!==null&&g.suppressHydrationWarning===!0||n_(c.nodeValue,x)),c||Vo(A,!0)}else c=ih(c).createTextNode(g),c[ce]=A,A.stateNode=c}return Fr(A),null;case 31:if(x=A.memoizedState,c===null||c.memoizedState!==null){if(g=wu(A),x!==null){if(c===null){if(!g)throw Error(a(318));if(c=A.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(557));c[ce]=A}else rd(),(A.flags&128)===0&&(A.memoizedState=null),A.flags|=4;Fr(A),c=!1}else x=r1(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=x),c=!0;if(!c)return A.flags&256?(Bs(A),A):(Bs(A),null);if((A.flags&128)!==0)throw Error(a(558))}return Fr(A),null;case 13:if(g=A.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(S=wu(A),g!==null&&g.dehydrated!==null){if(c===null){if(!S)throw Error(a(318));if(S=A.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(a(317));S[ce]=A}else rd(),(A.flags&128)===0&&(A.memoizedState=null),A.flags|=4;Fr(A),S=!1}else S=r1(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=S),S=!0;if(!S)return A.flags&256?(Bs(A),A):(Bs(A),null)}return Bs(A),(A.flags&128)!==0?(A.lanes=x,A):(x=g!==null,c=c!==null&&c.memoizedState!==null,x&&(g=A.child,S=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(S=g.alternate.memoizedState.cachePool.pool),I=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(I=g.memoizedState.cachePool.pool),I!==S&&(g.flags|=2048)),x!==c&&x&&(A.child.flags|=8192),Vx(A,A.updateQueue),Fr(A),null);case 4:return ae(),c===null&&py(A.stateNode.containerInfo),Fr(A),null;case 10:return Hl(A.type),Fr(A),null;case 19:if(O(xa),g=A.memoizedState,g===null)return Fr(A),null;if(S=(A.flags&128)!==0,I=g.rendering,I===null)if(S)T0(g,!1);else{if(na!==0||c!==null&&(c.flags&128)!==0)for(c=A.child;c!==null;){if(I=Ix(c),I!==null){for(A.flags|=128,T0(g,!1),c=I.updateQueue,A.updateQueue=c,Vx(A,c),A.subtreeFlags=0,c=x,x=A.child;x!==null;)MS(x,c),x=x.sibling;return q(xa,xa.current&1|2),qt&&Ll(A,g.treeForkCount),A.child}c=c.sibling}g.tail!==null&&ft()>Yx&&(A.flags|=128,S=!0,T0(g,!1),A.lanes=4194304)}else{if(!S)if(c=Ix(I),c!==null){if(A.flags|=128,S=!0,c=c.updateQueue,A.updateQueue=c,Vx(A,c),T0(g,!0),g.tail===null&&g.tailMode==="hidden"&&!I.alternate&&!qt)return Fr(A),null}else 2*ft()-g.renderingStartTime>Yx&&x!==536870912&&(A.flags|=128,S=!0,T0(g,!1),A.lanes=4194304);g.isBackwards?(I.sibling=A.child,A.child=I):(c=g.last,c!==null?c.sibling=I:A.child=I,g.last=I)}return g.tail!==null?(c=g.tail,g.rendering=c,g.tail=c.sibling,g.renderingStartTime=ft(),c.sibling=null,x=xa.current,q(xa,S?x&1|2:x&1),qt&&Ll(A,g.treeForkCount),c):(Fr(A),null);case 22:case 23:return Bs(A),x1(),g=A.memoizedState!==null,c!==null?c.memoizedState!==null!==g&&(A.flags|=8192):g&&(A.flags|=8192),g?(x&536870912)!==0&&(A.flags&128)===0&&(Fr(A),A.subtreeFlags&6&&(A.flags|=8192)):Fr(A),x=A.updateQueue,x!==null&&Vx(A,x.retryQueue),x=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),g=null,A.memoizedState!==null&&A.memoizedState.cachePool!==null&&(g=A.memoizedState.cachePool.pool),g!==x&&(A.flags|=2048),c!==null&&O(sd),null;case 24:return x=null,c!==null&&(x=c.memoizedState.cache),A.memoizedState.cache!==x&&(A.flags|=2048),Hl(Na),Fr(A),null;case 25:return null;case 30:return null}throw Error(a(156,A.tag))}function $$(c,A){switch(e1(A),A.tag){case 1:return c=A.flags,c&65536?(A.flags=c&-65537|128,A):null;case 3:return Hl(Na),ae(),c=A.flags,(c&65536)!==0&&(c&128)===0?(A.flags=c&-65537|128,A):null;case 26:case 27:case 5:return me(A),null;case 31:if(A.memoizedState!==null){if(Bs(A),A.alternate===null)throw Error(a(340));rd()}return c=A.flags,c&65536?(A.flags=c&-65537|128,A):null;case 13:if(Bs(A),c=A.memoizedState,c!==null&&c.dehydrated!==null){if(A.alternate===null)throw Error(a(340));rd()}return c=A.flags,c&65536?(A.flags=c&-65537|128,A):null;case 19:return O(xa),null;case 4:return ae(),null;case 10:return Hl(A.type),null;case 22:case 23:return Bs(A),x1(),c!==null&&O(sd),c=A.flags,c&65536?(A.flags=c&-65537|128,A):null;case 24:return Hl(Na),null;case 25:return null;default:return null}}function cB(c,A){switch(e1(A),A.tag){case 3:Hl(Na),ae();break;case 26:case 27:case 5:me(A);break;case 4:ae();break;case 31:A.memoizedState!==null&&Bs(A);break;case 13:Bs(A);break;case 19:O(xa);break;case 10:Hl(A.type);break;case 22:case 23:Bs(A),x1(),c!==null&&O(sd);break;case 24:Hl(Na)}}function I0(c,A){try{var x=A.updateQueue,g=x!==null?x.lastEffect:null;if(g!==null){var S=g.next;x=S;do{if((x.tag&c)===c){g=void 0;var I=x.create,V=x.inst;g=I(),V.destroy=g}x=x.next}while(x!==S)}}catch(se){lr(A,A.return,se)}}function Jo(c,A,x){try{var g=A.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var I=S.next;g=I;do{if((g.tag&c)===c){var V=g.inst,se=V.destroy;if(se!==void 0){V.destroy=void 0,S=A;var xe=x,Ee=se;try{Ee()}catch(Pe){lr(S,xe,Pe)}}}g=g.next}while(g!==I)}}catch(Pe){lr(A,A.return,Pe)}}function dB(c){var A=c.updateQueue;if(A!==null){var x=c.stateNode;try{e4(A,x)}catch(g){lr(c,c.return,g)}}}function uB(c,A,x){x.props=dd(c.type,c.memoizedProps),x.state=c.memoizedState;try{x.componentWillUnmount()}catch(g){lr(c,A,g)}}function F0(c,A){try{var x=c.ref;if(x!==null){switch(c.tag){case 26:case 27:case 5:var g=c.stateNode;break;case 30:g=c.stateNode;break;default:g=c.stateNode}typeof x=="function"?c.refCleanup=x(g):x.current=g}}catch(S){lr(c,A,S)}}function nl(c,A){var x=c.ref,g=c.refCleanup;if(x!==null)if(typeof g=="function")try{g()}catch(S){lr(c,A,S)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof x=="function")try{x(null)}catch(S){lr(c,A,S)}else x.current=null}function AB(c){var A=c.type,x=c.memoizedProps,g=c.stateNode;try{e:switch(A){case"button":case"input":case"select":case"textarea":x.autoFocus&&g.focus();break e;case"img":x.src?g.src=x.src:x.srcSet&&(g.srcset=x.srcSet)}}catch(S){lr(c,c.return,S)}}function K1(c,A,x){try{var g=c.stateNode;A7(g,c.type,x,A),g[ue]=A}catch(S){lr(c,c.return,S)}}function fB(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&sc(c.type)||c.tag===4}function q1(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||fB(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&sc(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function W1(c,A,x){var g=c.tag;if(g===5||g===6)c=c.stateNode,A?(x.nodeType===9?x.body:x.nodeName==="HTML"?x.ownerDocument.body:x).insertBefore(c,A):(A=x.nodeType===9?x.body:x.nodeName==="HTML"?x.ownerDocument.body:x,A.appendChild(c),x=x._reactRootContainer,x!=null||A.onclick!==null||(A.onclick=Rl));else if(g!==4&&(g===27&&sc(c.type)&&(x=c.stateNode,A=null),c=c.child,c!==null))for(W1(c,A,x),c=c.sibling;c!==null;)W1(c,A,x),c=c.sibling}function Gx(c,A,x){var g=c.tag;if(g===5||g===6)c=c.stateNode,A?x.insertBefore(c,A):x.appendChild(c);else if(g!==4&&(g===27&&sc(c.type)&&(x=c.stateNode),c=c.child,c!==null))for(Gx(c,A,x),c=c.sibling;c!==null;)Gx(c,A,x),c=c.sibling}function pB(c){var A=c.stateNode,x=c.memoizedProps;try{for(var g=c.type,S=A.attributes;S.length;)A.removeAttributeNode(S[0]);pn(A,g,x),A[ce]=c,A[ue]=x}catch(I){lr(c,c.return,I)}}var Kl=!1,ja=!1,Y1=!1,xB=typeof WeakSet=="function"?WeakSet:Set,Ka=null;function V$(c,A){if(c=c.containerInfo,my=fh,c=ES(c),zv(c)){if("selectionStart"in c)var x={start:c.selectionStart,end:c.selectionEnd};else e:{x=(x=c.ownerDocument)&&x.defaultView||window;var g=x.getSelection&&x.getSelection();if(g&&g.rangeCount!==0){x=g.anchorNode;var S=g.anchorOffset,I=g.focusNode;g=g.focusOffset;try{x.nodeType,I.nodeType}catch{x=null;break e}var V=0,se=-1,xe=-1,Ee=0,Pe=0,Qe=c,_e=null;t:for(;;){for(var Fe;Qe!==x||S!==0&&Qe.nodeType!==3||(se=V+S),Qe!==I||g!==0&&Qe.nodeType!==3||(xe=V+g),Qe.nodeType===3&&(V+=Qe.nodeValue.length),(Fe=Qe.firstChild)!==null;)_e=Qe,Qe=Fe;for(;;){if(Qe===c)break t;if(_e===x&&++Ee===S&&(se=V),_e===I&&++Pe===g&&(xe=V),(Fe=Qe.nextSibling)!==null)break;Qe=_e,_e=Qe.parentNode}Qe=Fe}x=se===-1||xe===-1?null:{start:se,end:xe}}else x=null}x=x||{start:0,end:0}}else x=null;for(gy={focusedElem:c,selectionRange:x},fh=!1,Ka=A;Ka!==null;)if(A=Ka,c=A.child,(A.subtreeFlags&1028)!==0&&c!==null)c.return=A,Ka=c;else for(;Ka!==null;){switch(A=Ka,I=A.alternate,c=A.flags,A.tag){case 0:if((c&4)!==0&&(c=A.updateQueue,c=c!==null?c.events:null,c!==null))for(x=0;x<c.length;x++)S=c[x],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((c&1024)!==0&&I!==null){c=void 0,x=A,S=I.memoizedProps,I=I.memoizedState,g=x.stateNode;try{var ot=dd(x.type,S);c=g.getSnapshotBeforeUpdate(ot,I),g.__reactInternalSnapshotBeforeUpdate=c}catch(bt){lr(x,x.return,bt)}}break;case 3:if((c&1024)!==0){if(c=A.stateNode.containerInfo,x=c.nodeType,x===9)yy(c);else if(x===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":yy(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((c&1024)!==0)throw Error(a(163))}if(c=A.sibling,c!==null){c.return=A.return,Ka=c;break}Ka=A.return}}function hB(c,A,x){var g=x.flags;switch(x.tag){case 0:case 11:case 15:Wl(c,x),g&4&&I0(5,x);break;case 1:if(Wl(c,x),g&4)if(c=x.stateNode,A===null)try{c.componentDidMount()}catch(V){lr(x,x.return,V)}else{var S=dd(x.type,A.memoizedProps);A=A.memoizedState;try{c.componentDidUpdate(S,A,c.__reactInternalSnapshotBeforeUpdate)}catch(V){lr(x,x.return,V)}}g&64&&dB(x),g&512&&F0(x,x.return);break;case 3:if(Wl(c,x),g&64&&(c=x.updateQueue,c!==null)){if(A=null,x.child!==null)switch(x.child.tag){case 27:case 5:A=x.child.stateNode;break;case 1:A=x.child.stateNode}try{e4(c,A)}catch(V){lr(x,x.return,V)}}break;case 27:A===null&&g&4&&pB(x);case 26:case 5:Wl(c,x),A===null&&g&4&&AB(x),g&512&&F0(x,x.return);break;case 12:Wl(c,x);break;case 31:Wl(c,x),g&4&&bB(c,x);break;case 13:Wl(c,x),g&4&&vB(c,x),g&64&&(c=x.memoizedState,c!==null&&(c=c.dehydrated,c!==null&&(x=e7.bind(null,x),v7(c,x))));break;case 22:if(g=x.memoizedState!==null||Kl,!g){A=A!==null&&A.memoizedState!==null||ja,S=Kl;var I=ja;Kl=g,(ja=A)&&!I?Yl(c,x,(x.subtreeFlags&8772)!==0):Wl(c,x),Kl=S,ja=I}break;case 30:break;default:Wl(c,x)}}function mB(c){var A=c.alternate;A!==null&&(c.alternate=null,mB(A)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(A=c.stateNode,A!==null&&ze(A)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}var Hr=null,is=!1;function ql(c,A,x){for(x=x.child;x!==null;)gB(c,A,x),x=x.sibling}function gB(c,A,x){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(jt,x)}catch{}switch(x.tag){case 26:ja||nl(x,A),ql(c,A,x),x.memoizedState?x.memoizedState.count--:x.stateNode&&(x=x.stateNode,x.parentNode.removeChild(x));break;case 27:ja||nl(x,A);var g=Hr,S=is;sc(x.type)&&(Hr=x.stateNode,is=!1),ql(c,A,x),H0(x.stateNode),Hr=g,is=S;break;case 5:ja||nl(x,A);case 6:if(g=Hr,S=is,Hr=null,ql(c,A,x),Hr=g,is=S,Hr!==null)if(is)try{(Hr.nodeType===9?Hr.body:Hr.nodeName==="HTML"?Hr.ownerDocument.body:Hr).removeChild(x.stateNode)}catch(I){lr(x,A,I)}else try{Hr.removeChild(x.stateNode)}catch(I){lr(x,A,I)}break;case 18:Hr!==null&&(is?(c=Hr,d_(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,x.stateNode),zu(c)):d_(Hr,x.stateNode));break;case 4:g=Hr,S=is,Hr=x.stateNode.containerInfo,is=!0,ql(c,A,x),Hr=g,is=S;break;case 0:case 11:case 14:case 15:Jo(2,x,A),ja||Jo(4,x,A),ql(c,A,x);break;case 1:ja||(nl(x,A),g=x.stateNode,typeof g.componentWillUnmount=="function"&&uB(x,A,g)),ql(c,A,x);break;case 21:ql(c,A,x);break;case 22:ja=(g=ja)||x.memoizedState!==null,ql(c,A,x),ja=g;break;default:ql(c,A,x)}}function bB(c,A){if(A.memoizedState===null&&(c=A.alternate,c!==null&&(c=c.memoizedState,c!==null))){c=c.dehydrated;try{zu(c)}catch(x){lr(A,A.return,x)}}}function vB(c,A){if(A.memoizedState===null&&(c=A.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{zu(c)}catch(x){lr(A,A.return,x)}}function G$(c){switch(c.tag){case 31:case 13:case 19:var A=c.stateNode;return A===null&&(A=c.stateNode=new xB),A;case 22:return c=c.stateNode,A=c._retryCache,A===null&&(A=c._retryCache=new xB),A;default:throw Error(a(435,c.tag))}}function Kx(c,A){var x=G$(c);A.forEach(function(g){if(!x.has(g)){x.add(g);var S=t7.bind(null,c,g);g.then(S,S)}})}function ls(c,A){var x=A.deletions;if(x!==null)for(var g=0;g<x.length;g++){var S=x[g],I=c,V=A,se=V;e:for(;se!==null;){switch(se.tag){case 27:if(sc(se.type)){Hr=se.stateNode,is=!1;break e}break;case 5:Hr=se.stateNode,is=!1;break e;case 3:case 4:Hr=se.stateNode.containerInfo,is=!0;break e}se=se.return}if(Hr===null)throw Error(a(160));gB(I,V,S),Hr=null,is=!1,I=S.alternate,I!==null&&(I.return=null),S.return=null}if(A.subtreeFlags&13886)for(A=A.child;A!==null;)yB(A,c),A=A.sibling}var Ii=null;function yB(c,A){var x=c.alternate,g=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:ls(A,c),os(c),g&4&&(Jo(3,c,c.return),I0(3,c),Jo(5,c,c.return));break;case 1:ls(A,c),os(c),g&512&&(ja||x===null||nl(x,x.return)),g&64&&Kl&&(c=c.updateQueue,c!==null&&(g=c.callbacks,g!==null&&(x=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=x===null?g:x.concat(g))));break;case 26:var S=Ii;if(ls(A,c),os(c),g&512&&(ja||x===null||nl(x,x.return)),g&4){var I=x!==null?x.memoizedState:null;if(g=c.memoizedState,x===null)if(g===null)if(c.stateNode===null){e:{g=c.type,x=c.memoizedProps,S=S.ownerDocument||S;t:switch(g){case"title":I=S.getElementsByTagName("title")[0],(!I||I[Be]||I[ce]||I.namespaceURI==="http://www.w3.org/2000/svg"||I.hasAttribute("itemprop"))&&(I=S.createElement(g),S.head.insertBefore(I,S.querySelector("head > title"))),pn(I,g,x),I[ce]=c,dt(I),g=I;break e;case"link":var V=y_("link","href",S).get(g+(x.href||""));if(V){for(var se=0;se<V.length;se++)if(I=V[se],I.getAttribute("href")===(x.href==null||x.href===""?null:x.href)&&I.getAttribute("rel")===(x.rel==null?null:x.rel)&&I.getAttribute("title")===(x.title==null?null:x.title)&&I.getAttribute("crossorigin")===(x.crossOrigin==null?null:x.crossOrigin)){V.splice(se,1);break t}}I=S.createElement(g),pn(I,g,x),S.head.appendChild(I);break;case"meta":if(V=y_("meta","content",S).get(g+(x.content||""))){for(se=0;se<V.length;se++)if(I=V[se],I.getAttribute("content")===(x.content==null?null:""+x.content)&&I.getAttribute("name")===(x.name==null?null:x.name)&&I.getAttribute("property")===(x.property==null?null:x.property)&&I.getAttribute("http-equiv")===(x.httpEquiv==null?null:x.httpEquiv)&&I.getAttribute("charset")===(x.charSet==null?null:x.charSet)){V.splice(se,1);break t}}I=S.createElement(g),pn(I,g,x),S.head.appendChild(I);break;default:throw Error(a(468,g))}I[ce]=c,dt(I),g=I}c.stateNode=g}else w_(S,c.type,c.stateNode);else c.stateNode=v_(S,g,c.memoizedProps);else I!==g?(I===null?x.stateNode!==null&&(x=x.stateNode,x.parentNode.removeChild(x)):I.count--,g===null?w_(S,c.type,c.stateNode):v_(S,g,c.memoizedProps)):g===null&&c.stateNode!==null&&K1(c,c.memoizedProps,x.memoizedProps)}break;case 27:ls(A,c),os(c),g&512&&(ja||x===null||nl(x,x.return)),x!==null&&g&4&&K1(c,c.memoizedProps,x.memoizedProps);break;case 5:if(ls(A,c),os(c),g&512&&(ja||x===null||nl(x,x.return)),c.flags&32){S=c.stateNode;try{Au(S,"")}catch(ot){lr(c,c.return,ot)}}g&4&&c.stateNode!=null&&(S=c.memoizedProps,K1(c,S,x!==null?x.memoizedProps:S)),g&1024&&(Y1=!0);break;case 6:if(ls(A,c),os(c),g&4){if(c.stateNode===null)throw Error(a(162));g=c.memoizedProps,x=c.stateNode;try{x.nodeValue=g}catch(ot){lr(c,c.return,ot)}}break;case 3:if(ch=null,S=Ii,Ii=lh(A.containerInfo),ls(A,c),Ii=S,os(c),g&4&&x!==null&&x.memoizedState.isDehydrated)try{zu(A.containerInfo)}catch(ot){lr(c,c.return,ot)}Y1&&(Y1=!1,wB(c));break;case 4:g=Ii,Ii=lh(c.stateNode.containerInfo),ls(A,c),os(c),Ii=g;break;case 12:ls(A,c),os(c);break;case 31:ls(A,c),os(c),g&4&&(g=c.updateQueue,g!==null&&(c.updateQueue=null,Kx(c,g)));break;case 13:ls(A,c),os(c),c.child.flags&8192&&c.memoizedState!==null!=(x!==null&&x.memoizedState!==null)&&(Wx=ft()),g&4&&(g=c.updateQueue,g!==null&&(c.updateQueue=null,Kx(c,g)));break;case 22:S=c.memoizedState!==null;var xe=x!==null&&x.memoizedState!==null,Ee=Kl,Pe=ja;if(Kl=Ee||S,ja=Pe||xe,ls(A,c),ja=Pe,Kl=Ee,os(c),g&8192)e:for(A=c.stateNode,A._visibility=S?A._visibility&-2:A._visibility|1,S&&(x===null||xe||Kl||ja||ud(c)),x=null,A=c;;){if(A.tag===5||A.tag===26){if(x===null){xe=x=A;try{if(I=xe.stateNode,S)V=I.style,typeof V.setProperty=="function"?V.setProperty("display","none","important"):V.display="none";else{se=xe.stateNode;var Qe=xe.memoizedProps.style,_e=Qe!=null&&Qe.hasOwnProperty("display")?Qe.display:null;se.style.display=_e==null||typeof _e=="boolean"?"":(""+_e).trim()}}catch(ot){lr(xe,xe.return,ot)}}}else if(A.tag===6){if(x===null){xe=A;try{xe.stateNode.nodeValue=S?"":xe.memoizedProps}catch(ot){lr(xe,xe.return,ot)}}}else if(A.tag===18){if(x===null){xe=A;try{var Fe=xe.stateNode;S?u_(Fe,!0):u_(xe.stateNode,!1)}catch(ot){lr(xe,xe.return,ot)}}}else if((A.tag!==22&&A.tag!==23||A.memoizedState===null||A===c)&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===c)break e;for(;A.sibling===null;){if(A.return===null||A.return===c)break e;x===A&&(x=null),A=A.return}x===A&&(x=null),A.sibling.return=A.return,A=A.sibling}g&4&&(g=c.updateQueue,g!==null&&(x=g.retryQueue,x!==null&&(g.retryQueue=null,Kx(c,x))));break;case 19:ls(A,c),os(c),g&4&&(g=c.updateQueue,g!==null&&(c.updateQueue=null,Kx(c,g)));break;case 30:break;case 21:break;default:ls(A,c),os(c)}}function os(c){var A=c.flags;if(A&2){try{for(var x,g=c.return;g!==null;){if(fB(g)){x=g;break}g=g.return}if(x==null)throw Error(a(160));switch(x.tag){case 27:var S=x.stateNode,I=q1(c);Gx(c,I,S);break;case 5:var V=x.stateNode;x.flags&32&&(Au(V,""),x.flags&=-33);var se=q1(c);Gx(c,se,V);break;case 3:case 4:var xe=x.stateNode.containerInfo,Ee=q1(c);W1(c,Ee,xe);break;default:throw Error(a(161))}}catch(Pe){lr(c,c.return,Pe)}c.flags&=-3}A&4096&&(c.flags&=-4097)}function wB(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var A=c;wB(A),A.tag===5&&A.flags&1024&&A.stateNode.reset(),c=c.sibling}}function Wl(c,A){if(A.subtreeFlags&8772)for(A=A.child;A!==null;)hB(c,A.alternate,A),A=A.sibling}function ud(c){for(c=c.child;c!==null;){var A=c;switch(A.tag){case 0:case 11:case 14:case 15:Jo(4,A,A.return),ud(A);break;case 1:nl(A,A.return);var x=A.stateNode;typeof x.componentWillUnmount=="function"&&uB(A,A.return,x),ud(A);break;case 27:H0(A.stateNode);case 26:case 5:nl(A,A.return),ud(A);break;case 22:A.memoizedState===null&&ud(A);break;case 30:ud(A);break;default:ud(A)}c=c.sibling}}function Yl(c,A,x){for(x=x&&(A.subtreeFlags&8772)!==0,A=A.child;A!==null;){var g=A.alternate,S=c,I=A,V=I.flags;switch(I.tag){case 0:case 11:case 15:Yl(S,I,x),I0(4,I);break;case 1:if(Yl(S,I,x),g=I,S=g.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(Ee){lr(g,g.return,Ee)}if(g=I,S=g.updateQueue,S!==null){var se=g.stateNode;try{var xe=S.shared.hiddenCallbacks;if(xe!==null)for(S.shared.hiddenCallbacks=null,S=0;S<xe.length;S++)ZS(xe[S],se)}catch(Ee){lr(g,g.return,Ee)}}x&&V&64&&dB(I),F0(I,I.return);break;case 27:pB(I);case 26:case 5:Yl(S,I,x),x&&g===null&&V&4&&AB(I),F0(I,I.return);break;case 12:Yl(S,I,x);break;case 31:Yl(S,I,x),x&&V&4&&bB(S,I);break;case 13:Yl(S,I,x),x&&V&4&&vB(S,I);break;case 22:I.memoizedState===null&&Yl(S,I,x),F0(I,I.return);break;case 30:break;default:Yl(S,I,x)}A=A.sibling}}function X1(c,A){var x=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),c=null,A.memoizedState!==null&&A.memoizedState.cachePool!==null&&(c=A.memoizedState.cachePool.pool),c!==x&&(c!=null&&c.refCount++,x!=null&&b0(x))}function J1(c,A){c=null,A.alternate!==null&&(c=A.alternate.memoizedState.cache),A=A.memoizedState.cache,A!==c&&(A.refCount++,c!=null&&b0(c))}function Fi(c,A,x,g){if(A.subtreeFlags&10256)for(A=A.child;A!==null;)NB(c,A,x,g),A=A.sibling}function NB(c,A,x,g){var S=A.flags;switch(A.tag){case 0:case 11:case 15:Fi(c,A,x,g),S&2048&&I0(9,A);break;case 1:Fi(c,A,x,g);break;case 3:Fi(c,A,x,g),S&2048&&(c=null,A.alternate!==null&&(c=A.alternate.memoizedState.cache),A=A.memoizedState.cache,A!==c&&(A.refCount++,c!=null&&b0(c)));break;case 12:if(S&2048){Fi(c,A,x,g),c=A.stateNode;try{var I=A.memoizedProps,V=I.id,se=I.onPostCommit;typeof se=="function"&&se(V,A.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(xe){lr(A,A.return,xe)}}else Fi(c,A,x,g);break;case 31:Fi(c,A,x,g);break;case 13:Fi(c,A,x,g);break;case 23:break;case 22:I=A.stateNode,V=A.alternate,A.memoizedState!==null?I._visibility&2?Fi(c,A,x,g):D0(c,A):I._visibility&2?Fi(c,A,x,g):(I._visibility|=2,Iu(c,A,x,g,(A.subtreeFlags&10256)!==0||!1)),S&2048&&X1(V,A);break;case 24:Fi(c,A,x,g),S&2048&&J1(A.alternate,A);break;default:Fi(c,A,x,g)}}function Iu(c,A,x,g,S){for(S=S&&((A.subtreeFlags&10256)!==0||!1),A=A.child;A!==null;){var I=c,V=A,se=x,xe=g,Ee=V.flags;switch(V.tag){case 0:case 11:case 15:Iu(I,V,se,xe,S),I0(8,V);break;case 23:break;case 22:var Pe=V.stateNode;V.memoizedState!==null?Pe._visibility&2?Iu(I,V,se,xe,S):D0(I,V):(Pe._visibility|=2,Iu(I,V,se,xe,S)),S&&Ee&2048&&X1(V.alternate,V);break;case 24:Iu(I,V,se,xe,S),S&&Ee&2048&&J1(V.alternate,V);break;default:Iu(I,V,se,xe,S)}A=A.sibling}}function D0(c,A){if(A.subtreeFlags&10256)for(A=A.child;A!==null;){var x=c,g=A,S=g.flags;switch(g.tag){case 22:D0(x,g),S&2048&&X1(g.alternate,g);break;case 24:D0(x,g),S&2048&&J1(g.alternate,g);break;default:D0(x,g)}A=A.sibling}}var U0=8192;function Fu(c,A,x){if(c.subtreeFlags&U0)for(c=c.child;c!==null;)CB(c,A,x),c=c.sibling}function CB(c,A,x){switch(c.tag){case 26:Fu(c,A,x),c.flags&U0&&c.memoizedState!==null&&I7(x,Ii,c.memoizedState,c.memoizedProps);break;case 5:Fu(c,A,x);break;case 3:case 4:var g=Ii;Ii=lh(c.stateNode.containerInfo),Fu(c,A,x),Ii=g;break;case 22:c.memoizedState===null&&(g=c.alternate,g!==null&&g.memoizedState!==null?(g=U0,U0=16777216,Fu(c,A,x),U0=g):Fu(c,A,x));break;default:Fu(c,A,x)}}function kB(c){var A=c.alternate;if(A!==null&&(c=A.child,c!==null)){A.child=null;do A=c.sibling,c.sibling=null,c=A;while(c!==null)}}function M0(c){var A=c.deletions;if((c.flags&16)!==0){if(A!==null)for(var x=0;x<A.length;x++){var g=A[x];Ka=g,EB(g,c)}kB(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)jB(c),c=c.sibling}function jB(c){switch(c.tag){case 0:case 11:case 15:M0(c),c.flags&2048&&Jo(9,c,c.return);break;case 3:M0(c);break;case 12:M0(c);break;case 22:var A=c.stateNode;c.memoizedState!==null&&A._visibility&2&&(c.return===null||c.return.tag!==13)?(A._visibility&=-3,qx(c)):M0(c);break;default:M0(c)}}function qx(c){var A=c.deletions;if((c.flags&16)!==0){if(A!==null)for(var x=0;x<A.length;x++){var g=A[x];Ka=g,EB(g,c)}kB(c)}for(c=c.child;c!==null;){switch(A=c,A.tag){case 0:case 11:case 15:Jo(8,A,A.return),qx(A);break;case 22:x=A.stateNode,x._visibility&2&&(x._visibility&=-3,qx(A));break;default:qx(A)}c=c.sibling}}function EB(c,A){for(;Ka!==null;){var x=Ka;switch(x.tag){case 0:case 11:case 15:Jo(8,x,A);break;case 23:case 22:if(x.memoizedState!==null&&x.memoizedState.cachePool!==null){var g=x.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:b0(x.memoizedState.cache)}if(g=x.child,g!==null)g.return=x,Ka=g;else e:for(x=c;Ka!==null;){g=Ka;var S=g.sibling,I=g.return;if(mB(g),g===x){Ka=null;break e}if(S!==null){S.return=I,Ka=S;break e}Ka=I}}}var K$={getCacheForType:function(c){var A=An(Na),x=A.data.get(c);return x===void 0&&(x=c(),A.data.set(c,x)),x},cacheSignal:function(){return An(Na).controller.signal}},q$=typeof WeakMap=="function"?WeakMap:Map,ar=0,vr=null,Pt=null,Qt=0,ir=0,_s=null,Zo=!1,Du=!1,Z1=!1,Xl=0,na=0,ec=0,Ad=0,ey=0,Ts=0,Uu=0,R0=null,cs=null,ty=!1,Wx=0,SB=0,Yx=1/0,Xx=null,tc=null,Ra=0,rc=null,Mu=null,Jl=0,ry=0,ay=null,BB=null,O0=0,ny=null;function Is(){return(ar&2)!==0&&Qt!==0?Qt&-Qt:X.T!==null?dy():te()}function _B(){if(Ts===0)if((Qt&536870912)===0||qt){var c=Bi;Bi<<=1,(Bi&3932160)===0&&(Bi=262144),Ts=c}else Ts=536870912;return c=Ss.current,c!==null&&(c.flags|=32),Ts}function ds(c,A,x){(c===vr&&(ir===2||ir===9)||c.cancelPendingCommit!==null)&&(Ru(c,0),ac(c,Qt,Ts,!1)),Ve(c,x),((ar&2)===0||c!==vr)&&(c===vr&&((ar&2)===0&&(Ad|=x),na===4&&ac(c,Qt,Ts,!1)),sl(c))}function TB(c,A,x){if((ar&6)!==0)throw Error(a(327));var g=!x&&(A&127)===0&&(A&c.expiredLanes)===0||_i(c,A),S=g?X$(c,A):iy(c,A,!0),I=g;do{if(S===0){Du&&!g&&ac(c,A,0,!1);break}else{if(x=c.current.alternate,I&&!W$(x)){S=iy(c,A,!1),I=!1;continue}if(S===2){if(I=A,c.errorRecoveryDisabledLanes&I)var V=0;else V=c.pendingLanes&-536870913,V=V!==0?V:V&536870912?536870912:0;if(V!==0){A=V;e:{var se=c;S=R0;var xe=se.current.memoizedState.isDehydrated;if(xe&&(Ru(se,V).flags|=256),V=iy(se,V,!1),V!==2){if(Z1&&!xe){se.errorRecoveryDisabledLanes|=I,Ad|=I,S=4;break e}I=cs,cs=S,I!==null&&(cs===null?cs=I:cs.push.apply(cs,I))}S=V}if(I=!1,S!==2)continue}}if(S===1){Ru(c,0),ac(c,A,0,!0);break}e:{switch(g=c,I=S,I){case 0:case 1:throw Error(a(345));case 4:if((A&4194048)!==A)break;case 6:ac(g,A,Ts,!Zo);break e;case 2:cs=null;break;case 3:case 5:break;default:throw Error(a(329))}if((A&62914560)===A&&(S=Wx+300-ft(),10<S)){if(ac(g,A,Ts,!Zo),el(g,0,!0)!==0)break e;Jl=A,g.timeoutHandle=o_(IB.bind(null,g,x,cs,Xx,ty,A,Ts,Ad,Uu,Zo,I,"Throttled",-0,0),S);break e}IB(g,x,cs,Xx,ty,A,Ts,Ad,Uu,Zo,I,null,-0,0)}}break}while(!0);sl(c)}function IB(c,A,x,g,S,I,V,se,xe,Ee,Pe,Qe,_e,Fe){if(c.timeoutHandle=-1,Qe=A.subtreeFlags,Qe&8192||(Qe&16785408)===16785408){Qe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Rl},CB(A,I,Qe);var ot=(I&62914560)===I?Wx-ft():(I&4194048)===I?SB-ft():0;if(ot=F7(Qe,ot),ot!==null){Jl=I,c.cancelPendingCommit=ot(LB.bind(null,c,A,I,x,g,S,V,se,xe,Pe,Qe,null,_e,Fe)),ac(c,I,V,!Ee);return}}LB(c,A,I,x,g,S,V,se,xe)}function W$(c){for(var A=c;;){var x=A.tag;if((x===0||x===11||x===15)&&A.flags&16384&&(x=A.updateQueue,x!==null&&(x=x.stores,x!==null)))for(var g=0;g<x.length;g++){var S=x[g],I=S.getSnapshot;S=S.value;try{if(!js(I(),S))return!1}catch{return!1}}if(x=A.child,A.subtreeFlags&16384&&x!==null)x.return=A,A=x;else{if(A===c)break;for(;A.sibling===null;){if(A.return===null||A.return===c)return!0;A=A.return}A.sibling.return=A.return,A=A.sibling}}return!0}function ac(c,A,x,g){A&=~ey,A&=~Ad,c.suspendedLanes|=A,c.pingedLanes&=~A,g&&(c.warmLanes|=A),g=c.expirationTimes;for(var S=A;0<S;){var I=31-Cr(S),V=1<<I;g[I]=-1,S&=~V}x!==0&&ra(c,x,A)}function Jx(){return(ar&6)===0?(P0(0),!1):!0}function sy(){if(Pt!==null){if(ir===0)var c=Pt.return;else c=Pt,Ql=ad=null,y1(c),Eu=null,y0=0,c=Pt;for(;c!==null;)cB(c.alternate,c),c=c.return;Pt=null}}function Ru(c,A){var x=c.timeoutHandle;x!==-1&&(c.timeoutHandle=-1,x7(x)),x=c.cancelPendingCommit,x!==null&&(c.cancelPendingCommit=null,x()),Jl=0,sy(),vr=c,Pt=x=Pl(c.current,null),Qt=A,ir=0,_s=null,Zo=!1,Du=_i(c,A),Z1=!1,Uu=Ts=ey=Ad=ec=na=0,cs=R0=null,ty=!1,(A&8)!==0&&(A|=A&32);var g=c.entangledLanes;if(g!==0)for(c=c.entanglements,g&=A;0<g;){var S=31-Cr(g),I=1<<S;A|=c[S],g&=~I}return Xl=A,bx(),x}function FB(c,A){_t=null,X.H=B0,A===ju||A===Ex?(A=WS(),ir=3):A===c1?(A=WS(),ir=4):ir=A===R1?8:A!==null&&typeof A=="object"&&typeof A.then=="function"?6:1,_s=A,Pt===null&&(na=1,Qx(c,Js(A,c.current)))}function DB(){var c=Ss.current;return c===null?!0:(Qt&4194048)===Qt?ri===null:(Qt&62914560)===Qt||(Qt&536870912)!==0?c===ri:!1}function UB(){var c=X.H;return X.H=B0,c===null?B0:c}function MB(){var c=X.A;return X.A=K$,c}function Zx(){na=4,Zo||(Qt&4194048)!==Qt&&Ss.current!==null||(Du=!0),(ec&134217727)===0&&(Ad&134217727)===0||vr===null||ac(vr,Qt,Ts,!1)}function iy(c,A,x){var g=ar;ar|=2;var S=UB(),I=MB();(vr!==c||Qt!==A)&&(Xx=null,Ru(c,A)),A=!1;var V=na;e:do try{if(ir!==0&&Pt!==null){var se=Pt,xe=_s;switch(ir){case 8:sy(),V=6;break e;case 3:case 2:case 9:case 6:Ss.current===null&&(A=!0);var Ee=ir;if(ir=0,_s=null,Ou(c,se,xe,Ee),x&&Du){V=0;break e}break;default:Ee=ir,ir=0,_s=null,Ou(c,se,xe,Ee)}}Y$(),V=na;break}catch(Pe){FB(c,Pe)}while(!0);return A&&c.shellSuspendCounter++,Ql=ad=null,ar=g,X.H=S,X.A=I,Pt===null&&(vr=null,Qt=0,bx()),V}function Y$(){for(;Pt!==null;)RB(Pt)}function X$(c,A){var x=ar;ar|=2;var g=UB(),S=MB();vr!==c||Qt!==A?(Xx=null,Yx=ft()+500,Ru(c,A)):Du=_i(c,A);e:do try{if(ir!==0&&Pt!==null){A=Pt;var I=_s;t:switch(ir){case 1:ir=0,_s=null,Ou(c,A,I,1);break;case 2:case 9:if(KS(I)){ir=0,_s=null,OB(A);break}A=function(){ir!==2&&ir!==9||vr!==c||(ir=7),sl(c)},I.then(A,A);break e;case 3:ir=7;break e;case 4:ir=5;break e;case 7:KS(I)?(ir=0,_s=null,OB(A)):(ir=0,_s=null,Ou(c,A,I,7));break;case 5:var V=null;switch(Pt.tag){case 26:V=Pt.memoizedState;case 5:case 27:var se=Pt;if(V?N_(V):se.stateNode.complete){ir=0,_s=null;var xe=se.sibling;if(xe!==null)Pt=xe;else{var Ee=se.return;Ee!==null?(Pt=Ee,eh(Ee)):Pt=null}break t}}ir=0,_s=null,Ou(c,A,I,5);break;case 6:ir=0,_s=null,Ou(c,A,I,6);break;case 8:sy(),na=6;break e;default:throw Error(a(462))}}J$();break}catch(Pe){FB(c,Pe)}while(!0);return Ql=ad=null,X.H=g,X.A=S,ar=x,Pt!==null?0:(vr=null,Qt=0,bx(),na)}function J$(){for(;Pt!==null&&!Ct();)RB(Pt)}function RB(c){var A=lB(c.alternate,c,Xl);c.memoizedProps=c.pendingProps,A===null?eh(c):Pt=A}function OB(c){var A=c,x=A.alternate;switch(A.tag){case 15:case 0:A=tB(x,A,A.pendingProps,A.type,void 0,Qt);break;case 11:A=tB(x,A,A.pendingProps,A.type.render,A.ref,Qt);break;case 5:y1(A);default:cB(x,A),A=Pt=MS(A,Xl),A=lB(x,A,Xl)}c.memoizedProps=c.pendingProps,A===null?eh(c):Pt=A}function Ou(c,A,x,g){Ql=ad=null,y1(A),Eu=null,y0=0;var S=A.return;try{if(L$(c,S,A,x,Qt)){na=1,Qx(c,Js(x,c.current)),Pt=null;return}}catch(I){if(S!==null)throw Pt=S,I;na=1,Qx(c,Js(x,c.current)),Pt=null;return}A.flags&32768?(qt||g===1?c=!0:Du||(Qt&536870912)!==0?c=!1:(Zo=c=!0,(g===2||g===9||g===3||g===6)&&(g=Ss.current,g!==null&&g.tag===13&&(g.flags|=16384))),PB(A,c)):eh(A)}function eh(c){var A=c;do{if((A.flags&32768)!==0){PB(A,Zo);return}c=A.return;var x=z$(A.alternate,A,Xl);if(x!==null){Pt=x;return}if(A=A.sibling,A!==null){Pt=A;return}Pt=A=c}while(A!==null);na===0&&(na=5)}function PB(c,A){do{var x=$$(c.alternate,c);if(x!==null){x.flags&=32767,Pt=x;return}if(x=c.return,x!==null&&(x.flags|=32768,x.subtreeFlags=0,x.deletions=null),!A&&(c=c.sibling,c!==null)){Pt=c;return}Pt=c=x}while(c!==null);na=6,Pt=null}function LB(c,A,x,g,S,I,V,se,xe){c.cancelPendingCommit=null;do th();while(Ra!==0);if((ar&6)!==0)throw Error(a(327));if(A!==null){if(A===c.current)throw Error(a(177));if(I=A.lanes|A.childLanes,I|=qv,It(c,x,I,V,se,xe),c===vr&&(Pt=vr=null,Qt=0),Mu=A,rc=c,Jl=x,ry=I,ay=S,BB=g,(A.subtreeFlags&10256)!==0||(A.flags&10256)!==0?(c.callbackNode=null,c.callbackPriority=0,r7(Ut,function(){return VB(),null})):(c.callbackNode=null,c.callbackPriority=0),g=(A.flags&13878)!==0,(A.subtreeFlags&13878)!==0||g){g=X.T,X.T=null,S=K.p,K.p=2,V=ar,ar|=4;try{V$(c,A,x)}finally{ar=V,K.p=S,X.T=g}}Ra=1,QB(),HB(),zB()}}function QB(){if(Ra===1){Ra=0;var c=rc,A=Mu,x=(A.flags&13878)!==0;if((A.subtreeFlags&13878)!==0||x){x=X.T,X.T=null;var g=K.p;K.p=2;var S=ar;ar|=4;try{yB(A,c);var I=gy,V=ES(c.containerInfo),se=I.focusedElem,xe=I.selectionRange;if(V!==se&&se&&se.ownerDocument&&jS(se.ownerDocument.documentElement,se)){if(xe!==null&&zv(se)){var Ee=xe.start,Pe=xe.end;if(Pe===void 0&&(Pe=Ee),"selectionStart"in se)se.selectionStart=Ee,se.selectionEnd=Math.min(Pe,se.value.length);else{var Qe=se.ownerDocument||document,_e=Qe&&Qe.defaultView||window;if(_e.getSelection){var Fe=_e.getSelection(),ot=se.textContent.length,bt=Math.min(xe.start,ot),hr=xe.end===void 0?bt:Math.min(xe.end,ot);!Fe.extend&&bt>hr&&(V=hr,hr=bt,bt=V);var ve=kS(se,bt),ge=kS(se,hr);if(ve&&ge&&(Fe.rangeCount!==1||Fe.anchorNode!==ve.node||Fe.anchorOffset!==ve.offset||Fe.focusNode!==ge.node||Fe.focusOffset!==ge.offset)){var je=Qe.createRange();je.setStart(ve.node,ve.offset),Fe.removeAllRanges(),bt>hr?(Fe.addRange(je),Fe.extend(ge.node,ge.offset)):(je.setEnd(ge.node,ge.offset),Fe.addRange(je))}}}}for(Qe=[],Fe=se;Fe=Fe.parentNode;)Fe.nodeType===1&&Qe.push({element:Fe,left:Fe.scrollLeft,top:Fe.scrollTop});for(typeof se.focus=="function"&&se.focus(),se=0;se<Qe.length;se++){var Le=Qe[se];Le.element.scrollLeft=Le.left,Le.element.scrollTop=Le.top}}fh=!!my,gy=my=null}finally{ar=S,K.p=g,X.T=x}}c.current=A,Ra=2}}function HB(){if(Ra===2){Ra=0;var c=rc,A=Mu,x=(A.flags&8772)!==0;if((A.subtreeFlags&8772)!==0||x){x=X.T,X.T=null;var g=K.p;K.p=2;var S=ar;ar|=4;try{hB(c,A.alternate,A)}finally{ar=S,K.p=g,X.T=x}}Ra=3}}function zB(){if(Ra===4||Ra===3){Ra=0,kt();var c=rc,A=Mu,x=Jl,g=BB;(A.subtreeFlags&10256)!==0||(A.flags&10256)!==0?Ra=5:(Ra=0,Mu=rc=null,$B(c,c.pendingLanes));var S=c.pendingLanes;if(S===0&&(tc=null),tt(x),A=A.stateNode,Kt&&typeof Kt.onCommitFiberRoot=="function")try{Kt.onCommitFiberRoot(jt,A,void 0,(A.current.flags&128)===128)}catch{}if(g!==null){A=X.T,S=K.p,K.p=2,X.T=null;try{for(var I=c.onRecoverableError,V=0;V<g.length;V++){var se=g[V];I(se.value,{componentStack:se.stack})}}finally{X.T=A,K.p=S}}(Jl&3)!==0&&th(),sl(c),S=c.pendingLanes,(x&261930)!==0&&(S&42)!==0?c===ny?O0++:(O0=0,ny=c):O0=0,P0(0)}}function $B(c,A){(c.pooledCacheLanes&=A)===0&&(A=c.pooledCache,A!=null&&(c.pooledCache=null,b0(A)))}function th(){return QB(),HB(),zB(),VB()}function VB(){if(Ra!==5)return!1;var c=rc,A=ry;ry=0;var x=tt(Jl),g=X.T,S=K.p;try{K.p=32>x?32:x,X.T=null,x=ay,ay=null;var I=rc,V=Jl;if(Ra=0,Mu=rc=null,Jl=0,(ar&6)!==0)throw Error(a(331));var se=ar;if(ar|=4,jB(I.current),NB(I,I.current,V,x),ar=se,P0(0,!1),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(jt,I)}catch{}return!0}finally{K.p=S,X.T=g,$B(c,A)}}function GB(c,A,x){A=Js(x,A),A=M1(c.stateNode,A,2),c=Wo(c,A,2),c!==null&&(Ve(c,2),sl(c))}function lr(c,A,x){if(c.tag===3)GB(c,c,x);else for(;A!==null;){if(A.tag===3){GB(A,c,x);break}else if(A.tag===1){var g=A.stateNode;if(typeof A.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(tc===null||!tc.has(g))){c=Js(x,c),x=K4(2),g=Wo(A,x,2),g!==null&&(q4(x,g,A,c),Ve(g,2),sl(g));break}}A=A.return}}function ly(c,A,x){var g=c.pingCache;if(g===null){g=c.pingCache=new q$;var S=new Set;g.set(A,S)}else S=g.get(A),S===void 0&&(S=new Set,g.set(A,S));S.has(x)||(Z1=!0,S.add(x),c=Z$.bind(null,c,A,x),A.then(c,c))}function Z$(c,A,x){var g=c.pingCache;g!==null&&g.delete(A),c.pingedLanes|=c.suspendedLanes&x,c.warmLanes&=~x,vr===c&&(Qt&x)===x&&(na===4||na===3&&(Qt&62914560)===Qt&&300>ft()-Wx?(ar&2)===0&&Ru(c,0):ey|=x,Uu===Qt&&(Uu=0)),sl(c)}function KB(c,A){A===0&&(A=Lo()),c=ed(c,A),c!==null&&(Ve(c,A),sl(c))}function e7(c){var A=c.memoizedState,x=0;A!==null&&(x=A.retryLane),KB(c,x)}function t7(c,A){var x=0;switch(c.tag){case 31:case 13:var g=c.stateNode,S=c.memoizedState;S!==null&&(x=S.retryLane);break;case 19:g=c.stateNode;break;case 22:g=c.stateNode._retryCache;break;default:throw Error(a(314))}g!==null&&g.delete(A),KB(c,x)}function r7(c,A){return at(c,A)}var rh=null,Pu=null,oy=!1,ah=!1,cy=!1,nc=0;function sl(c){c!==Pu&&c.next===null&&(Pu===null?rh=Pu=c:Pu=Pu.next=c),ah=!0,oy||(oy=!0,n7())}function P0(c,A){if(!cy&&ah){cy=!0;do for(var x=!1,g=rh;g!==null;){if(c!==0){var S=g.pendingLanes;if(S===0)var I=0;else{var V=g.suspendedLanes,se=g.pingedLanes;I=(1<<31-Cr(42|c)+1)-1,I&=S&~(V&~se),I=I&201326741?I&201326741|1:I?I|2:0}I!==0&&(x=!0,XB(g,I))}else I=Qt,I=el(g,g===vr?I:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(I&3)===0||_i(g,I)||(x=!0,XB(g,I));g=g.next}while(x);cy=!1}}function a7(){qB()}function qB(){ah=oy=!1;var c=0;nc!==0&&p7()&&(c=nc);for(var A=ft(),x=null,g=rh;g!==null;){var S=g.next,I=WB(g,A);I===0?(g.next=null,x===null?rh=S:x.next=S,S===null&&(Pu=x)):(x=g,(c!==0||(I&3)!==0)&&(ah=!0)),g=S}Ra!==0&&Ra!==5||P0(c),nc!==0&&(nc=0)}function WB(c,A){for(var x=c.suspendedLanes,g=c.pingedLanes,S=c.expirationTimes,I=c.pendingLanes&-62914561;0<I;){var V=31-Cr(I),se=1<<V,xe=S[V];xe===-1?((se&x)===0||(se&g)!==0)&&(S[V]=Wc(se,A)):xe<=A&&(c.expiredLanes|=se),I&=~se}if(A=vr,x=Qt,x=el(c,c===A?x:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),g=c.callbackNode,x===0||c===A&&(ir===2||ir===9)||c.cancelPendingCommit!==null)return g!==null&&g!==null&&nt(g),c.callbackNode=null,c.callbackPriority=0;if((x&3)===0||_i(c,x)){if(A=x&-x,A===c.callbackPriority)return A;switch(g!==null&&nt(g),tt(x)){case 2:case 8:x=pa;break;case 32:x=Ut;break;case 268435456:x=it;break;default:x=Ut}return g=YB.bind(null,c),x=at(x,g),c.callbackPriority=A,c.callbackNode=x,A}return g!==null&&g!==null&&nt(g),c.callbackPriority=2,c.callbackNode=null,2}function YB(c,A){if(Ra!==0&&Ra!==5)return c.callbackNode=null,c.callbackPriority=0,null;var x=c.callbackNode;if(th()&&c.callbackNode!==x)return null;var g=Qt;return g=el(c,c===vr?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),g===0?null:(TB(c,g,A),WB(c,ft()),c.callbackNode!=null&&c.callbackNode===x?YB.bind(null,c):null)}function XB(c,A){if(th())return null;TB(c,A,!0)}function n7(){h7(function(){(ar&6)!==0?at(Ar,a7):qB()})}function dy(){if(nc===0){var c=Cu;c===0&&(c=ks,ks<<=1,(ks&261888)===0&&(ks=256)),nc=c}return nc}function JB(c){return c==null||typeof c=="symbol"||typeof c=="boolean"?null:typeof c=="function"?c:ux(""+c)}function ZB(c,A){var x=A.ownerDocument.createElement("input");return x.name=A.name,x.value=A.value,c.id&&x.setAttribute("form",c.id),A.parentNode.insertBefore(x,A),c=new FormData(c),x.parentNode.removeChild(x),c}function s7(c,A,x,g,S){if(A==="submit"&&x&&x.stateNode===S){var I=JB((S[ue]||null).action),V=g.submitter;V&&(A=(A=V[ue]||null)?JB(A.formAction):V.getAttribute("formAction"),A!==null&&(I=A,V=null));var se=new xx("action","action",null,g,S);c.push({event:se,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(nc!==0){var xe=V?ZB(S,V):new FormData(S);_1(x,{pending:!0,data:xe,method:S.method,action:I},null,xe)}}else typeof I=="function"&&(se.preventDefault(),xe=V?ZB(S,V):new FormData(S),_1(x,{pending:!0,data:xe,method:S.method,action:I},I,xe))},currentTarget:S}]})}}for(var uy=0;uy<Kv.length;uy++){var Ay=Kv[uy],i7=Ay.toLowerCase(),l7=Ay[0].toUpperCase()+Ay.slice(1);Ti(i7,"on"+l7)}Ti(_S,"onAnimationEnd"),Ti(TS,"onAnimationIteration"),Ti(IS,"onAnimationStart"),Ti("dblclick","onDoubleClick"),Ti("focusin","onFocus"),Ti("focusout","onBlur"),Ti(N$,"onTransitionRun"),Ti(C$,"onTransitionStart"),Ti(k$,"onTransitionCancel"),Ti(FS,"onTransitionEnd"),qs("onMouseEnter",["mouseout","mouseover"]),qs("onMouseLeave",["mouseout","mouseover"]),qs("onPointerEnter",["pointerout","pointerover"]),qs("onPointerLeave",["pointerout","pointerover"]),Qr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var L0="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(" "),o7=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(L0));function e_(c,A){A=(A&4)!==0;for(var x=0;x<c.length;x++){var g=c[x],S=g.event;g=g.listeners;e:{var I=void 0;if(A)for(var V=g.length-1;0<=V;V--){var se=g[V],xe=se.instance,Ee=se.currentTarget;if(se=se.listener,xe!==I&&S.isPropagationStopped())break e;I=se,S.currentTarget=Ee;try{I(S)}catch(Pe){gx(Pe)}S.currentTarget=null,I=xe}else for(V=0;V<g.length;V++){if(se=g[V],xe=se.instance,Ee=se.currentTarget,se=se.listener,xe!==I&&S.isPropagationStopped())break e;I=se,S.currentTarget=Ee;try{I(S)}catch(Pe){gx(Pe)}S.currentTarget=null,I=xe}}}}function Lt(c,A){var x=A[Ce];x===void 0&&(x=A[Ce]=new Set);var g=c+"__bubble";x.has(g)||(t_(A,c,2,!1),x.add(g))}function fy(c,A,x){var g=0;A&&(g|=4),t_(x,c,g,A)}var nh="_reactListening"+Math.random().toString(36).slice(2);function py(c){if(!c[nh]){c[nh]=!0,kr.forEach(function(x){x!=="selectionchange"&&(o7.has(x)||fy(x,!1,c),fy(x,!0,c))});var A=c.nodeType===9?c:c.ownerDocument;A===null||A[nh]||(A[nh]=!0,fy("selectionchange",!1,A))}}function t_(c,A,x,g){switch(__(A)){case 2:var S=M7;break;case 8:S=R7;break;default:S=By}x=S.bind(null,A,x,c),S=void 0,!Dv||A!=="touchstart"&&A!=="touchmove"&&A!=="wheel"||(S=!0),g?S!==void 0?c.addEventListener(A,x,{capture:!0,passive:S}):c.addEventListener(A,x,!0):S!==void 0?c.addEventListener(A,x,{passive:S}):c.addEventListener(A,x,!1)}function xy(c,A,x,g,S){var I=g;if((A&1)===0&&(A&2)===0&&g!==null)e:for(;;){if(g===null)return;var V=g.tag;if(V===3||V===4){var se=g.stateNode.containerInfo;if(se===S)break;if(V===4)for(V=g.return;V!==null;){var xe=V.tag;if((xe===3||xe===4)&&V.stateNode.containerInfo===S)return;V=V.return}for(;se!==null;){if(V=Ke(se),V===null)return;if(xe=V.tag,xe===5||xe===6||xe===26||xe===27){g=I=V;continue e}se=se.parentNode}}g=g.return}iS(function(){var Ee=I,Pe=Iv(x),Qe=[];e:{var _e=DS.get(c);if(_e!==void 0){var Fe=xx,ot=c;switch(c){case"keypress":if(fx(x)===0)break e;case"keydown":case"keyup":Fe=t$;break;case"focusin":ot="focus",Fe=Ov;break;case"focusout":ot="blur",Fe=Ov;break;case"beforeblur":case"afterblur":Fe=Ov;break;case"click":if(x.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Fe=cS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Fe=zz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Fe=n$;break;case _S:case TS:case IS:Fe=Gz;break;case FS:Fe=i$;break;case"scroll":case"scrollend":Fe=Qz;break;case"wheel":Fe=o$;break;case"copy":case"cut":case"paste":Fe=qz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Fe=uS;break;case"toggle":case"beforetoggle":Fe=d$}var bt=(A&4)!==0,hr=!bt&&(c==="scroll"||c==="scrollend"),ve=bt?_e!==null?_e+"Capture":null:_e;bt=[];for(var ge=Ee,je;ge!==null;){var Le=ge;if(je=Le.stateNode,Le=Le.tag,Le!==5&&Le!==26&&Le!==27||je===null||ve===null||(Le=o0(ge,ve),Le!=null&&bt.push(Q0(ge,Le,je))),hr)break;ge=ge.return}0<bt.length&&(_e=new Fe(_e,ot,null,x,Pe),Qe.push({event:_e,listeners:bt}))}}if((A&7)===0){e:{if(_e=c==="mouseover"||c==="pointerover",Fe=c==="mouseout"||c==="pointerout",_e&&x!==Tv&&(ot=x.relatedTarget||x.fromElement)&&(Ke(ot)||ot[Ae]))break e;if((Fe||_e)&&(_e=Pe.window===Pe?Pe:(_e=Pe.ownerDocument)?_e.defaultView||_e.parentWindow:window,Fe?(ot=x.relatedTarget||x.toElement,Fe=Ee,ot=ot?Ke(ot):null,ot!==null&&(hr=i(ot),bt=ot.tag,ot!==hr||bt!==5&&bt!==27&&bt!==6)&&(ot=null)):(Fe=null,ot=Ee),Fe!==ot)){if(bt=cS,Le="onMouseLeave",ve="onMouseEnter",ge="mouse",(c==="pointerout"||c==="pointerover")&&(bt=uS,Le="onPointerLeave",ve="onPointerEnter",ge="pointer"),hr=Fe==null?_e:$e(Fe),je=ot==null?_e:$e(ot),_e=new bt(Le,ge+"leave",Fe,x,Pe),_e.target=hr,_e.relatedTarget=je,Le=null,Ke(Pe)===Ee&&(bt=new bt(ve,ge+"enter",ot,x,Pe),bt.target=je,bt.relatedTarget=hr,Le=bt),hr=Le,Fe&&ot)t:{for(bt=c7,ve=Fe,ge=ot,je=0,Le=ve;Le;Le=bt(Le))je++;Le=0;for(var pt=ge;pt;pt=bt(pt))Le++;for(;0<je-Le;)ve=bt(ve),je--;for(;0<Le-je;)ge=bt(ge),Le--;for(;je--;){if(ve===ge||ge!==null&&ve===ge.alternate){bt=ve;break t}ve=bt(ve),ge=bt(ge)}bt=null}else bt=null;Fe!==null&&r_(Qe,_e,Fe,bt,!1),ot!==null&&hr!==null&&r_(Qe,hr,ot,bt,!0)}}e:{if(_e=Ee?$e(Ee):window,Fe=_e.nodeName&&_e.nodeName.toLowerCase(),Fe==="select"||Fe==="input"&&_e.type==="file")var Xt=bS;else if(mS(_e))if(vS)Xt=v$;else{Xt=g$;var ut=m$}else Fe=_e.nodeName,!Fe||Fe.toLowerCase()!=="input"||_e.type!=="checkbox"&&_e.type!=="radio"?Ee&&_v(Ee.elementType)&&(Xt=bS):Xt=b$;if(Xt&&(Xt=Xt(c,Ee))){gS(Qe,Xt,x,Pe);break e}ut&&ut(c,_e,Ee),c==="focusout"&&Ee&&_e.type==="number"&&Ee.memoizedProps.value!=null&&Bv(_e,"number",_e.value)}switch(ut=Ee?$e(Ee):window,c){case"focusin":(mS(ut)||ut.contentEditable==="true")&&(hu=ut,$v=Ee,h0=null);break;case"focusout":h0=$v=hu=null;break;case"mousedown":Vv=!0;break;case"contextmenu":case"mouseup":case"dragend":Vv=!1,SS(Qe,x,Pe);break;case"selectionchange":if(w$)break;case"keydown":case"keyup":SS(Qe,x,Pe)}var Ft;if(Lv)e:{switch(c){case"compositionstart":var Ht="onCompositionStart";break e;case"compositionend":Ht="onCompositionEnd";break e;case"compositionupdate":Ht="onCompositionUpdate";break e}Ht=void 0}else xu?xS(c,x)&&(Ht="onCompositionEnd"):c==="keydown"&&x.keyCode===229&&(Ht="onCompositionStart");Ht&&(AS&&x.locale!=="ko"&&(xu||Ht!=="onCompositionStart"?Ht==="onCompositionEnd"&&xu&&(Ft=lS()):(Ho=Pe,Uv="value"in Ho?Ho.value:Ho.textContent,xu=!0)),ut=sh(Ee,Ht),0<ut.length&&(Ht=new dS(Ht,c,null,x,Pe),Qe.push({event:Ht,listeners:ut}),Ft?Ht.data=Ft:(Ft=hS(x),Ft!==null&&(Ht.data=Ft)))),(Ft=A$?f$(c,x):p$(c,x))&&(Ht=sh(Ee,"onBeforeInput"),0<Ht.length&&(ut=new dS("onBeforeInput","beforeinput",null,x,Pe),Qe.push({event:ut,listeners:Ht}),ut.data=Ft)),s7(Qe,c,Ee,x,Pe)}e_(Qe,A)})}function Q0(c,A,x){return{instance:c,listener:A,currentTarget:x}}function sh(c,A){for(var x=A+"Capture",g=[];c!==null;){var S=c,I=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||I===null||(S=o0(c,x),S!=null&&g.unshift(Q0(c,S,I)),S=o0(c,A),S!=null&&g.push(Q0(c,S,I))),c.tag===3)return g;c=c.return}return[]}function c7(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5&&c.tag!==27);return c||null}function r_(c,A,x,g,S){for(var I=A._reactName,V=[];x!==null&&x!==g;){var se=x,xe=se.alternate,Ee=se.stateNode;if(se=se.tag,xe!==null&&xe===g)break;se!==5&&se!==26&&se!==27||Ee===null||(xe=Ee,S?(Ee=o0(x,I),Ee!=null&&V.unshift(Q0(x,Ee,xe))):S||(Ee=o0(x,I),Ee!=null&&V.push(Q0(x,Ee,xe)))),x=x.return}V.length!==0&&c.push({event:A,listeners:V})}var d7=/\r\n?/g,u7=/\u0000|\uFFFD/g;function a_(c){return(typeof c=="string"?c:""+c).replace(d7,`
`).replace(u7,"")}function n_(c,A){return A=a_(A),a_(c)===A}function xr(c,A,x,g,S,I){switch(x){case"children":typeof g=="string"?A==="body"||A==="textarea"&&g===""||Au(c,g):(typeof g=="number"||typeof g=="bigint")&&A!=="body"&&Au(c,""+g);break;case"className":cx(c,"class",g);break;case"tabIndex":cx(c,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":cx(c,x,g);break;case"style":nS(c,g,I);break;case"data":if(A!=="object"){cx(c,"data",g);break}case"src":case"href":if(g===""&&(A!=="a"||x!=="href")){c.removeAttribute(x);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){c.removeAttribute(x);break}g=ux(""+g),c.setAttribute(x,g);break;case"action":case"formAction":if(typeof g=="function"){c.setAttribute(x,"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 I=="function"&&(x==="formAction"?(A!=="input"&&xr(c,A,"name",S.name,S,null),xr(c,A,"formEncType",S.formEncType,S,null),xr(c,A,"formMethod",S.formMethod,S,null),xr(c,A,"formTarget",S.formTarget,S,null)):(xr(c,A,"encType",S.encType,S,null),xr(c,A,"method",S.method,S,null),xr(c,A,"target",S.target,S,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){c.removeAttribute(x);break}g=ux(""+g),c.setAttribute(x,g);break;case"onClick":g!=null&&(c.onclick=Rl);break;case"onScroll":g!=null&&Lt("scroll",c);break;case"onScrollEnd":g!=null&&Lt("scrollend",c);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(a(61));if(x=g.__html,x!=null){if(S.children!=null)throw Error(a(60));c.innerHTML=x}}break;case"multiple":c.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":c.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){c.removeAttribute("xlink:href");break}x=ux(""+g),c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",x);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?c.setAttribute(x,""+g):c.removeAttribute(x);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?c.setAttribute(x,""):c.removeAttribute(x);break;case"capture":case"download":g===!0?c.setAttribute(x,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?c.setAttribute(x,g):c.removeAttribute(x);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?c.setAttribute(x,g):c.removeAttribute(x);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?c.removeAttribute(x):c.setAttribute(x,g);break;case"popover":Lt("beforetoggle",c),Lt("toggle",c),ns(c,"popover",g);break;case"xlinkActuate":Ml(c,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Ml(c,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Ml(c,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Ml(c,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Ml(c,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Ml(c,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Ml(c,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Ml(c,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Ml(c,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":ns(c,"is",g);break;case"innerText":case"textContent":break;default:(!(2<x.length)||x[0]!=="o"&&x[0]!=="O"||x[1]!=="n"&&x[1]!=="N")&&(x=Pz.get(x)||x,ns(c,x,g))}}function hy(c,A,x,g,S,I){switch(x){case"style":nS(c,g,I);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(a(61));if(x=g.__html,x!=null){if(S.children!=null)throw Error(a(60));c.innerHTML=x}}break;case"children":typeof g=="string"?Au(c,g):(typeof g=="number"||typeof g=="bigint")&&Au(c,""+g);break;case"onScroll":g!=null&&Lt("scroll",c);break;case"onScrollEnd":g!=null&&Lt("scrollend",c);break;case"onClick":g!=null&&(c.onclick=Rl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jr.hasOwnProperty(x))e:{if(x[0]==="o"&&x[1]==="n"&&(S=x.endsWith("Capture"),A=x.slice(2,S?x.length-7:void 0),I=c[ue]||null,I=I!=null?I[x]:null,typeof I=="function"&&c.removeEventListener(A,I,S),typeof g=="function")){typeof I!="function"&&I!==null&&(x in c?c[x]=null:c.hasAttribute(x)&&c.removeAttribute(x)),c.addEventListener(A,g,S);break e}x in c?c[x]=g:g===!0?c.setAttribute(x,""):ns(c,x,g)}}}function pn(c,A,x){switch(A){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Lt("error",c),Lt("load",c);var g=!1,S=!1,I;for(I in x)if(x.hasOwnProperty(I)){var V=x[I];if(V!=null)switch(I){case"src":g=!0;break;case"srcSet":S=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,A));default:xr(c,A,I,V,x,null)}}S&&xr(c,A,"srcSet",x.srcSet,x,null),g&&xr(c,A,"src",x.src,x,null);return;case"input":Lt("invalid",c);var se=I=V=S=null,xe=null,Ee=null;for(g in x)if(x.hasOwnProperty(g)){var Pe=x[g];if(Pe!=null)switch(g){case"name":S=Pe;break;case"type":V=Pe;break;case"checked":xe=Pe;break;case"defaultChecked":Ee=Pe;break;case"value":I=Pe;break;case"defaultValue":se=Pe;break;case"children":case"dangerouslySetInnerHTML":if(Pe!=null)throw Error(a(137,A));break;default:xr(c,A,g,Pe,x,null)}}eS(c,I,se,xe,Ee,V,S,!1);return;case"select":Lt("invalid",c),g=V=I=null;for(S in x)if(x.hasOwnProperty(S)&&(se=x[S],se!=null))switch(S){case"value":I=se;break;case"defaultValue":V=se;break;case"multiple":g=se;default:xr(c,A,S,se,x,null)}A=I,x=V,c.multiple=!!g,A!=null?uu(c,!!g,A,!1):x!=null&&uu(c,!!g,x,!0);return;case"textarea":Lt("invalid",c),I=S=g=null;for(V in x)if(x.hasOwnProperty(V)&&(se=x[V],se!=null))switch(V){case"value":g=se;break;case"defaultValue":S=se;break;case"children":I=se;break;case"dangerouslySetInnerHTML":if(se!=null)throw Error(a(91));break;default:xr(c,A,V,se,x,null)}rS(c,g,S,I);return;case"option":for(xe in x)if(x.hasOwnProperty(xe)&&(g=x[xe],g!=null))switch(xe){case"selected":c.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:xr(c,A,xe,g,x,null)}return;case"dialog":Lt("beforetoggle",c),Lt("toggle",c),Lt("cancel",c),Lt("close",c);break;case"iframe":case"object":Lt("load",c);break;case"video":case"audio":for(g=0;g<L0.length;g++)Lt(L0[g],c);break;case"image":Lt("error",c),Lt("load",c);break;case"details":Lt("toggle",c);break;case"embed":case"source":case"link":Lt("error",c),Lt("load",c);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Ee in x)if(x.hasOwnProperty(Ee)&&(g=x[Ee],g!=null))switch(Ee){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,A));default:xr(c,A,Ee,g,x,null)}return;default:if(_v(A)){for(Pe in x)x.hasOwnProperty(Pe)&&(g=x[Pe],g!==void 0&&hy(c,A,Pe,g,x,void 0));return}}for(se in x)x.hasOwnProperty(se)&&(g=x[se],g!=null&&xr(c,A,se,g,x,null))}function A7(c,A,x,g){switch(A){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var S=null,I=null,V=null,se=null,xe=null,Ee=null,Pe=null;for(Fe in x){var Qe=x[Fe];if(x.hasOwnProperty(Fe)&&Qe!=null)switch(Fe){case"checked":break;case"value":break;case"defaultValue":xe=Qe;default:g.hasOwnProperty(Fe)||xr(c,A,Fe,null,g,Qe)}}for(var _e in g){var Fe=g[_e];if(Qe=x[_e],g.hasOwnProperty(_e)&&(Fe!=null||Qe!=null))switch(_e){case"type":I=Fe;break;case"name":S=Fe;break;case"checked":Ee=Fe;break;case"defaultChecked":Pe=Fe;break;case"value":V=Fe;break;case"defaultValue":se=Fe;break;case"children":case"dangerouslySetInnerHTML":if(Fe!=null)throw Error(a(137,A));break;default:Fe!==Qe&&xr(c,A,_e,Fe,g,Qe)}}Sv(c,V,se,xe,Ee,Pe,I,S);return;case"select":Fe=V=se=_e=null;for(I in x)if(xe=x[I],x.hasOwnProperty(I)&&xe!=null)switch(I){case"value":break;case"multiple":Fe=xe;default:g.hasOwnProperty(I)||xr(c,A,I,null,g,xe)}for(S in g)if(I=g[S],xe=x[S],g.hasOwnProperty(S)&&(I!=null||xe!=null))switch(S){case"value":_e=I;break;case"defaultValue":se=I;break;case"multiple":V=I;default:I!==xe&&xr(c,A,S,I,g,xe)}A=se,x=V,g=Fe,_e!=null?uu(c,!!x,_e,!1):!!g!=!!x&&(A!=null?uu(c,!!x,A,!0):uu(c,!!x,x?[]:"",!1));return;case"textarea":Fe=_e=null;for(se in x)if(S=x[se],x.hasOwnProperty(se)&&S!=null&&!g.hasOwnProperty(se))switch(se){case"value":break;case"children":break;default:xr(c,A,se,null,g,S)}for(V in g)if(S=g[V],I=x[V],g.hasOwnProperty(V)&&(S!=null||I!=null))switch(V){case"value":_e=S;break;case"defaultValue":Fe=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(a(91));break;default:S!==I&&xr(c,A,V,S,g,I)}tS(c,_e,Fe);return;case"option":for(var ot in x)if(_e=x[ot],x.hasOwnProperty(ot)&&_e!=null&&!g.hasOwnProperty(ot))switch(ot){case"selected":c.selected=!1;break;default:xr(c,A,ot,null,g,_e)}for(xe in g)if(_e=g[xe],Fe=x[xe],g.hasOwnProperty(xe)&&_e!==Fe&&(_e!=null||Fe!=null))switch(xe){case"selected":c.selected=_e&&typeof _e!="function"&&typeof _e!="symbol";break;default:xr(c,A,xe,_e,g,Fe)}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 bt in x)_e=x[bt],x.hasOwnProperty(bt)&&_e!=null&&!g.hasOwnProperty(bt)&&xr(c,A,bt,null,g,_e);for(Ee in g)if(_e=g[Ee],Fe=x[Ee],g.hasOwnProperty(Ee)&&_e!==Fe&&(_e!=null||Fe!=null))switch(Ee){case"children":case"dangerouslySetInnerHTML":if(_e!=null)throw Error(a(137,A));break;default:xr(c,A,Ee,_e,g,Fe)}return;default:if(_v(A)){for(var hr in x)_e=x[hr],x.hasOwnProperty(hr)&&_e!==void 0&&!g.hasOwnProperty(hr)&&hy(c,A,hr,void 0,g,_e);for(Pe in g)_e=g[Pe],Fe=x[Pe],!g.hasOwnProperty(Pe)||_e===Fe||_e===void 0&&Fe===void 0||hy(c,A,Pe,_e,g,Fe);return}}for(var ve in x)_e=x[ve],x.hasOwnProperty(ve)&&_e!=null&&!g.hasOwnProperty(ve)&&xr(c,A,ve,null,g,_e);for(Qe in g)_e=g[Qe],Fe=x[Qe],!g.hasOwnProperty(Qe)||_e===Fe||_e==null&&Fe==null||xr(c,A,Qe,_e,g,Fe)}function s_(c){switch(c){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function f7(){if(typeof performance.getEntriesByType=="function"){for(var c=0,A=0,x=performance.getEntriesByType("resource"),g=0;g<x.length;g++){var S=x[g],I=S.transferSize,V=S.initiatorType,se=S.duration;if(I&&se&&s_(V)){for(V=0,se=S.responseEnd,g+=1;g<x.length;g++){var xe=x[g],Ee=xe.startTime;if(Ee>se)break;var Pe=xe.transferSize,Qe=xe.initiatorType;Pe&&s_(Qe)&&(xe=xe.responseEnd,V+=Pe*(xe<se?1:(se-Ee)/(xe-Ee)))}if(--g,A+=8*(I+V)/(S.duration/1e3),c++,10<c)break}}if(0<c)return A/c/1e6}return navigator.connection&&(c=navigator.connection.downlink,typeof c=="number")?c:5}var my=null,gy=null;function ih(c){return c.nodeType===9?c:c.ownerDocument}function i_(c){switch(c){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function l_(c,A){if(c===0)switch(A){case"svg":return 1;case"math":return 2;default:return 0}return c===1&&A==="foreignObject"?0:c}function by(c,A){return c==="textarea"||c==="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 vy=null;function p7(){var c=window.event;return c&&c.type==="popstate"?c===vy?!1:(vy=c,!0):(vy=null,!1)}var o_=typeof setTimeout=="function"?setTimeout:void 0,x7=typeof clearTimeout=="function"?clearTimeout:void 0,c_=typeof Promise=="function"?Promise:void 0,h7=typeof queueMicrotask=="function"?queueMicrotask:typeof c_<"u"?function(c){return c_.resolve(null).then(c).catch(m7)}:o_;function m7(c){setTimeout(function(){throw c})}function sc(c){return c==="head"}function d_(c,A){var x=A,g=0;do{var S=x.nextSibling;if(c.removeChild(x),S&&S.nodeType===8)if(x=S.data,x==="/$"||x==="/&"){if(g===0){c.removeChild(S),zu(A);return}g--}else if(x==="$"||x==="$?"||x==="$~"||x==="$!"||x==="&")g++;else if(x==="html")H0(c.ownerDocument.documentElement);else if(x==="head"){x=c.ownerDocument.head,H0(x);for(var I=x.firstChild;I;){var V=I.nextSibling,se=I.nodeName;I[Be]||se==="SCRIPT"||se==="STYLE"||se==="LINK"&&I.rel.toLowerCase()==="stylesheet"||x.removeChild(I),I=V}}else x==="body"&&H0(c.ownerDocument.body);x=S}while(x);zu(A)}function u_(c,A){var x=c;c=0;do{var g=x.nextSibling;if(x.nodeType===1?A?(x._stashedDisplay=x.style.display,x.style.display="none"):(x.style.display=x._stashedDisplay||"",x.getAttribute("style")===""&&x.removeAttribute("style")):x.nodeType===3&&(A?(x._stashedText=x.nodeValue,x.nodeValue=""):x.nodeValue=x._stashedText||""),g&&g.nodeType===8)if(x=g.data,x==="/$"){if(c===0)break;c--}else x!=="$"&&x!=="$?"&&x!=="$~"&&x!=="$!"||c++;x=g}while(x)}function yy(c){var A=c.firstChild;for(A&&A.nodeType===10&&(A=A.nextSibling);A;){var x=A;switch(A=A.nextSibling,x.nodeName){case"HTML":case"HEAD":case"BODY":yy(x),ze(x);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(x.rel.toLowerCase()==="stylesheet")continue}c.removeChild(x)}}function g7(c,A,x,g){for(;c.nodeType===1;){var S=x;if(c.nodeName.toLowerCase()!==A.toLowerCase()){if(!g&&(c.nodeName!=="INPUT"||c.type!=="hidden"))break}else if(g){if(!c[Be])switch(A){case"meta":if(!c.hasAttribute("itemprop"))break;return c;case"link":if(I=c.getAttribute("rel"),I==="stylesheet"&&c.hasAttribute("data-precedence"))break;if(I!==S.rel||c.getAttribute("href")!==(S.href==null||S.href===""?null:S.href)||c.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin)||c.getAttribute("title")!==(S.title==null?null:S.title))break;return c;case"style":if(c.hasAttribute("data-precedence"))break;return c;case"script":if(I=c.getAttribute("src"),(I!==(S.src==null?null:S.src)||c.getAttribute("type")!==(S.type==null?null:S.type)||c.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin))&&I&&c.hasAttribute("async")&&!c.hasAttribute("itemprop"))break;return c;default:return c}}else if(A==="input"&&c.type==="hidden"){var I=S.name==null?null:""+S.name;if(S.type==="hidden"&&c.getAttribute("name")===I)return c}else return c;if(c=ai(c.nextSibling),c===null)break}return null}function b7(c,A,x){if(A==="")return null;for(;c.nodeType!==3;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!x||(c=ai(c.nextSibling),c===null))return null;return c}function A_(c,A){for(;c.nodeType!==8;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!A||(c=ai(c.nextSibling),c===null))return null;return c}function wy(c){return c.data==="$?"||c.data==="$~"}function Ny(c){return c.data==="$!"||c.data==="$?"&&c.ownerDocument.readyState!=="loading"}function v7(c,A){var x=c.ownerDocument;if(c.data==="$~")c._reactRetry=A;else if(c.data!=="$?"||x.readyState!=="loading")A();else{var g=function(){A(),x.removeEventListener("DOMContentLoaded",g)};x.addEventListener("DOMContentLoaded",g),c._reactRetry=g}}function ai(c){for(;c!=null;c=c.nextSibling){var A=c.nodeType;if(A===1||A===3)break;if(A===8){if(A=c.data,A==="$"||A==="$!"||A==="$?"||A==="$~"||A==="&"||A==="F!"||A==="F")break;if(A==="/$"||A==="/&")return null}}return c}var Cy=null;function f_(c){c=c.nextSibling;for(var A=0;c;){if(c.nodeType===8){var x=c.data;if(x==="/$"||x==="/&"){if(A===0)return ai(c.nextSibling);A--}else x!=="$"&&x!=="$!"&&x!=="$?"&&x!=="$~"&&x!=="&"||A++}c=c.nextSibling}return null}function p_(c){c=c.previousSibling;for(var A=0;c;){if(c.nodeType===8){var x=c.data;if(x==="$"||x==="$!"||x==="$?"||x==="$~"||x==="&"){if(A===0)return c;A--}else x!=="/$"&&x!=="/&"||A++}c=c.previousSibling}return null}function x_(c,A,x){switch(A=ih(x),c){case"html":if(c=A.documentElement,!c)throw Error(a(452));return c;case"head":if(c=A.head,!c)throw Error(a(453));return c;case"body":if(c=A.body,!c)throw Error(a(454));return c;default:throw Error(a(451))}}function H0(c){for(var A=c.attributes;A.length;)c.removeAttributeNode(A[0]);ze(c)}var ni=new Map,h_=new Set;function lh(c){return typeof c.getRootNode=="function"?c.getRootNode():c.nodeType===9?c:c.ownerDocument}var Zl=K.d;K.d={f:y7,r:w7,D:N7,C:C7,L:k7,m:j7,X:S7,S:E7,M:B7};function y7(){var c=Zl.f(),A=Jx();return c||A}function w7(c){var A=Ze(c);A!==null&&A.tag===5&&A.type==="form"?F4(A):Zl.r(c)}var Lu=typeof document>"u"?null:document;function m_(c,A,x){var g=Lu;if(g&&typeof A=="string"&&A){var S=Ys(A);S='link[rel="'+c+'"][href="'+S+'"]',typeof x=="string"&&(S+='[crossorigin="'+x+'"]'),h_.has(S)||(h_.add(S),c={rel:c,crossOrigin:x,href:A},g.querySelector(S)===null&&(A=g.createElement("link"),pn(A,"link",c),dt(A),g.head.appendChild(A)))}}function N7(c){Zl.D(c),m_("dns-prefetch",c,null)}function C7(c,A){Zl.C(c,A),m_("preconnect",c,A)}function k7(c,A,x){Zl.L(c,A,x);var g=Lu;if(g&&c&&A){var S='link[rel="preload"][as="'+Ys(A)+'"]';A==="image"&&x&&x.imageSrcSet?(S+='[imagesrcset="'+Ys(x.imageSrcSet)+'"]',typeof x.imageSizes=="string"&&(S+='[imagesizes="'+Ys(x.imageSizes)+'"]')):S+='[href="'+Ys(c)+'"]';var I=S;switch(A){case"style":I=Qu(c);break;case"script":I=Hu(c)}ni.has(I)||(c=p({rel:"preload",href:A==="image"&&x&&x.imageSrcSet?void 0:c,as:A},x),ni.set(I,c),g.querySelector(S)!==null||A==="style"&&g.querySelector(z0(I))||A==="script"&&g.querySelector($0(I))||(A=g.createElement("link"),pn(A,"link",c),dt(A),g.head.appendChild(A)))}}function j7(c,A){Zl.m(c,A);var x=Lu;if(x&&c){var g=A&&typeof A.as=="string"?A.as:"script",S='link[rel="modulepreload"][as="'+Ys(g)+'"][href="'+Ys(c)+'"]',I=S;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":I=Hu(c)}if(!ni.has(I)&&(c=p({rel:"modulepreload",href:c},A),ni.set(I,c),x.querySelector(S)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(x.querySelector($0(I)))return}g=x.createElement("link"),pn(g,"link",c),dt(g),x.head.appendChild(g)}}}function E7(c,A,x){Zl.S(c,A,x);var g=Lu;if(g&&c){var S=Je(g).hoistableStyles,I=Qu(c);A=A||"default";var V=S.get(I);if(!V){var se={loading:0,preload:null};if(V=g.querySelector(z0(I)))se.loading=5;else{c=p({rel:"stylesheet",href:c,"data-precedence":A},x),(x=ni.get(I))&&ky(c,x);var xe=V=g.createElement("link");dt(xe),pn(xe,"link",c),xe._p=new Promise(function(Ee,Pe){xe.onload=Ee,xe.onerror=Pe}),xe.addEventListener("load",function(){se.loading|=1}),xe.addEventListener("error",function(){se.loading|=2}),se.loading|=4,oh(V,A,g)}V={type:"stylesheet",instance:V,count:1,state:se},S.set(I,V)}}}function S7(c,A){Zl.X(c,A);var x=Lu;if(x&&c){var g=Je(x).hoistableScripts,S=Hu(c),I=g.get(S);I||(I=x.querySelector($0(S)),I||(c=p({src:c,async:!0},A),(A=ni.get(S))&&jy(c,A),I=x.createElement("script"),dt(I),pn(I,"link",c),x.head.appendChild(I)),I={type:"script",instance:I,count:1,state:null},g.set(S,I))}}function B7(c,A){Zl.M(c,A);var x=Lu;if(x&&c){var g=Je(x).hoistableScripts,S=Hu(c),I=g.get(S);I||(I=x.querySelector($0(S)),I||(c=p({src:c,async:!0,type:"module"},A),(A=ni.get(S))&&jy(c,A),I=x.createElement("script"),dt(I),pn(I,"link",c),x.head.appendChild(I)),I={type:"script",instance:I,count:1,state:null},g.set(S,I))}}function g_(c,A,x,g){var S=(S=re.current)?lh(S):null;if(!S)throw Error(a(446));switch(c){case"meta":case"title":return null;case"style":return typeof x.precedence=="string"&&typeof x.href=="string"?(A=Qu(x.href),x=Je(S).hoistableStyles,g=x.get(A),g||(g={type:"style",instance:null,count:0,state:null},x.set(A,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(x.rel==="stylesheet"&&typeof x.href=="string"&&typeof x.precedence=="string"){c=Qu(x.href);var I=Je(S).hoistableStyles,V=I.get(c);if(V||(S=S.ownerDocument||S,V={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},I.set(c,V),(I=S.querySelector(z0(c)))&&!I._p&&(V.instance=I,V.state.loading=5),ni.has(c)||(x={rel:"preload",as:"style",href:x.href,crossOrigin:x.crossOrigin,integrity:x.integrity,media:x.media,hrefLang:x.hrefLang,referrerPolicy:x.referrerPolicy},ni.set(c,x),I||_7(S,c,x,V.state))),A&&g===null)throw Error(a(528,""));return V}if(A&&g!==null)throw Error(a(529,""));return null;case"script":return A=x.async,x=x.src,typeof x=="string"&&A&&typeof A!="function"&&typeof A!="symbol"?(A=Hu(x),x=Je(S).hoistableScripts,g=x.get(A),g||(g={type:"script",instance:null,count:0,state:null},x.set(A,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,c))}}function Qu(c){return'href="'+Ys(c)+'"'}function z0(c){return'link[rel="stylesheet"]['+c+"]"}function b_(c){return p({},c,{"data-precedence":c.precedence,precedence:null})}function _7(c,A,x,g){c.querySelector('link[rel="preload"][as="style"]['+A+"]")?g.loading=1:(A=c.createElement("link"),g.preload=A,A.addEventListener("load",function(){return g.loading|=1}),A.addEventListener("error",function(){return g.loading|=2}),pn(A,"link",x),dt(A),c.head.appendChild(A))}function Hu(c){return'[src="'+Ys(c)+'"]'}function $0(c){return"script[async]"+c}function v_(c,A,x){if(A.count++,A.instance===null)switch(A.type){case"style":var g=c.querySelector('style[data-href~="'+Ys(x.href)+'"]');if(g)return A.instance=g,dt(g),g;var S=p({},x,{"data-href":x.href,"data-precedence":x.precedence,href:null,precedence:null});return g=(c.ownerDocument||c).createElement("style"),dt(g),pn(g,"style",S),oh(g,x.precedence,c),A.instance=g;case"stylesheet":S=Qu(x.href);var I=c.querySelector(z0(S));if(I)return A.state.loading|=4,A.instance=I,dt(I),I;g=b_(x),(S=ni.get(S))&&ky(g,S),I=(c.ownerDocument||c).createElement("link"),dt(I);var V=I;return V._p=new Promise(function(se,xe){V.onload=se,V.onerror=xe}),pn(I,"link",g),A.state.loading|=4,oh(I,x.precedence,c),A.instance=I;case"script":return I=Hu(x.src),(S=c.querySelector($0(I)))?(A.instance=S,dt(S),S):(g=x,(S=ni.get(I))&&(g=p({},x),jy(g,S)),c=c.ownerDocument||c,S=c.createElement("script"),dt(S),pn(S,"link",g),c.head.appendChild(S),A.instance=S);case"void":return null;default:throw Error(a(443,A.type))}else A.type==="stylesheet"&&(A.state.loading&4)===0&&(g=A.instance,A.state.loading|=4,oh(g,x.precedence,c));return A.instance}function oh(c,A,x){for(var g=x.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=g.length?g[g.length-1]:null,I=S,V=0;V<g.length;V++){var se=g[V];if(se.dataset.precedence===A)I=se;else if(I!==S)break}I?I.parentNode.insertBefore(c,I.nextSibling):(A=x.nodeType===9?x.head:x,A.insertBefore(c,A.firstChild))}function ky(c,A){c.crossOrigin==null&&(c.crossOrigin=A.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=A.referrerPolicy),c.title==null&&(c.title=A.title)}function jy(c,A){c.crossOrigin==null&&(c.crossOrigin=A.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=A.referrerPolicy),c.integrity==null&&(c.integrity=A.integrity)}var ch=null;function y_(c,A,x){if(ch===null){var g=new Map,S=ch=new Map;S.set(x,g)}else S=ch,g=S.get(x),g||(g=new Map,S.set(x,g));if(g.has(c))return g;for(g.set(c,null),x=x.getElementsByTagName(c),S=0;S<x.length;S++){var I=x[S];if(!(I[Be]||I[ce]||c==="link"&&I.getAttribute("rel")==="stylesheet")&&I.namespaceURI!=="http://www.w3.org/2000/svg"){var V=I.getAttribute(A)||"";V=c+V;var se=g.get(V);se?se.push(I):g.set(V,[I])}}return g}function w_(c,A,x){c=c.ownerDocument||c,c.head.insertBefore(x,A==="title"?c.querySelector("head > title"):null)}function T7(c,A,x){if(x===1||A.itemProp!=null)return!1;switch(c){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 c=A.disabled,typeof A.precedence=="string"&&c==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 N_(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function I7(c,A,x,g){if(x.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(x.state.loading&4)===0){if(x.instance===null){var S=Qu(g.href),I=A.querySelector(z0(S));if(I){A=I._p,A!==null&&typeof A=="object"&&typeof A.then=="function"&&(c.count++,c=dh.bind(c),A.then(c,c)),x.state.loading|=4,x.instance=I,dt(I);return}I=A.ownerDocument||A,g=b_(g),(S=ni.get(S))&&ky(g,S),I=I.createElement("link"),dt(I);var V=I;V._p=new Promise(function(se,xe){V.onload=se,V.onerror=xe}),pn(I,"link",g),x.instance=I}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(x,A),(A=x.state.preload)&&(x.state.loading&3)===0&&(c.count++,x=dh.bind(c),A.addEventListener("load",x),A.addEventListener("error",x))}}var Ey=0;function F7(c,A){return c.stylesheets&&c.count===0&&Ah(c,c.stylesheets),0<c.count||0<c.imgCount?function(x){var g=setTimeout(function(){if(c.stylesheets&&Ah(c,c.stylesheets),c.unsuspend){var I=c.unsuspend;c.unsuspend=null,I()}},6e4+A);0<c.imgBytes&&Ey===0&&(Ey=62500*f7());var S=setTimeout(function(){if(c.waitingForImages=!1,c.count===0&&(c.stylesheets&&Ah(c,c.stylesheets),c.unsuspend)){var I=c.unsuspend;c.unsuspend=null,I()}},(c.imgBytes>Ey?50:800)+A);return c.unsuspend=x,function(){c.unsuspend=null,clearTimeout(g),clearTimeout(S)}}:null}function dh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ah(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var uh=null;function Ah(c,A){c.stylesheets=null,c.unsuspend!==null&&(c.count++,uh=new Map,A.forEach(D7,c),uh=null,dh.call(c))}function D7(c,A){if(!(A.state.loading&4)){var x=uh.get(c);if(x)var g=x.get(null);else{x=new Map,uh.set(c,x);for(var S=c.querySelectorAll("link[data-precedence],style[data-precedence]"),I=0;I<S.length;I++){var V=S[I];(V.nodeName==="LINK"||V.getAttribute("media")!=="not all")&&(x.set(V.dataset.precedence,V),g=V)}g&&x.set(null,g)}S=A.instance,V=S.getAttribute("data-precedence"),I=x.get(V)||g,I===g&&x.set(null,S),x.set(V,S),this.count++,g=dh.bind(this),S.addEventListener("load",g),S.addEventListener("error",g),I?I.parentNode.insertBefore(S,I.nextSibling):(c=c.nodeType===9?c.head:c,c.insertBefore(S,c.firstChild)),A.state.loading|=4}}var V0={$$typeof:N,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function U7(c,A,x,g,S,I,V,se,xe){this.tag=1,this.containerInfo=c,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=Ul(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ul(0),this.hiddenUpdates=Ul(null),this.identifierPrefix=g,this.onUncaughtError=S,this.onCaughtError=I,this.onRecoverableError=V,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=xe,this.incompleteTransitions=new Map}function C_(c,A,x,g,S,I,V,se,xe,Ee,Pe,Qe){return c=new U7(c,A,x,V,xe,Ee,Pe,Qe,se),A=1,I===!0&&(A|=24),I=Es(3,null,null,A),c.current=I,I.stateNode=c,A=i1(),A.refCount++,c.pooledCache=A,A.refCount++,I.memoizedState={element:g,isDehydrated:x,cache:A},d1(I),c}function k_(c){return c?(c=bu,c):bu}function j_(c,A,x,g,S,I){S=k_(S),g.context===null?g.context=S:g.pendingContext=S,g=qo(A),g.payload={element:x},I=I===void 0?null:I,I!==null&&(g.callback=I),x=Wo(c,g,A),x!==null&&(ds(x,c,A),N0(x,c,A))}function E_(c,A){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var x=c.retryLane;c.retryLane=x!==0&&x<A?x:A}}function Sy(c,A){E_(c,A),(c=c.alternate)&&E_(c,A)}function S_(c){if(c.tag===13||c.tag===31){var A=ed(c,67108864);A!==null&&ds(A,c,67108864),Sy(c,67108864)}}function B_(c){if(c.tag===13||c.tag===31){var A=Is();A=Ye(A);var x=ed(c,A);x!==null&&ds(x,c,A),Sy(c,A)}}var fh=!0;function M7(c,A,x,g){var S=X.T;X.T=null;var I=K.p;try{K.p=2,By(c,A,x,g)}finally{K.p=I,X.T=S}}function R7(c,A,x,g){var S=X.T;X.T=null;var I=K.p;try{K.p=8,By(c,A,x,g)}finally{K.p=I,X.T=S}}function By(c,A,x,g){if(fh){var S=_y(g);if(S===null)xy(c,A,g,ph,x),T_(c,g);else if(P7(S,c,A,x,g))g.stopPropagation();else if(T_(c,g),A&4&&-1<O7.indexOf(c)){for(;S!==null;){var I=Ze(S);if(I!==null)switch(I.tag){case 3:if(I=I.stateNode,I.current.memoizedState.isDehydrated){var V=dn(I.pendingLanes);if(V!==0){var se=I;for(se.pendingLanes|=2,se.entangledLanes|=2;V;){var xe=1<<31-Cr(V);se.entanglements[1]|=xe,V&=~xe}sl(I),(ar&6)===0&&(Yx=ft()+500,P0(0))}}break;case 31:case 13:se=ed(I,2),se!==null&&ds(se,I,2),Jx(),Sy(I,2)}if(I=_y(g),I===null&&xy(c,A,g,ph,x),I===S)break;S=I}S!==null&&g.stopPropagation()}else xy(c,A,g,null,x)}}function _y(c){return c=Iv(c),Ty(c)}var ph=null;function Ty(c){if(ph=null,c=Ke(c),c!==null){var A=i(c);if(A===null)c=null;else{var x=A.tag;if(x===13){if(c=l(A),c!==null)return c;c=null}else if(x===31){if(c=o(A),c!==null)return c;c=null}else if(x===3){if(A.stateNode.current.memoizedState.isDehydrated)return A.tag===3?A.stateNode.containerInfo:null;c=null}else A!==c&&(c=null)}}return ph=c,null}function __(c){switch(c){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(_r()){case Ar:return 2;case pa:return 8;case Ut:case Tr:return 32;case it:return 268435456;default:return 32}default:return 32}}var Iy=!1,ic=null,lc=null,oc=null,G0=new Map,K0=new Map,cc=[],O7="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 T_(c,A){switch(c){case"focusin":case"focusout":ic=null;break;case"dragenter":case"dragleave":lc=null;break;case"mouseover":case"mouseout":oc=null;break;case"pointerover":case"pointerout":G0.delete(A.pointerId);break;case"gotpointercapture":case"lostpointercapture":K0.delete(A.pointerId)}}function q0(c,A,x,g,S,I){return c===null||c.nativeEvent!==I?(c={blockedOn:A,domEventName:x,eventSystemFlags:g,nativeEvent:I,targetContainers:[S]},A!==null&&(A=Ze(A),A!==null&&S_(A)),c):(c.eventSystemFlags|=g,A=c.targetContainers,S!==null&&A.indexOf(S)===-1&&A.push(S),c)}function P7(c,A,x,g,S){switch(A){case"focusin":return ic=q0(ic,c,A,x,g,S),!0;case"dragenter":return lc=q0(lc,c,A,x,g,S),!0;case"mouseover":return oc=q0(oc,c,A,x,g,S),!0;case"pointerover":var I=S.pointerId;return G0.set(I,q0(G0.get(I)||null,c,A,x,g,S)),!0;case"gotpointercapture":return I=S.pointerId,K0.set(I,q0(K0.get(I)||null,c,A,x,g,S)),!0}return!1}function I_(c){var A=Ke(c.target);if(A!==null){var x=i(A);if(x!==null){if(A=x.tag,A===13){if(A=l(x),A!==null){c.blockedOn=A,de(c.priority,function(){B_(x)});return}}else if(A===31){if(A=o(x),A!==null){c.blockedOn=A,de(c.priority,function(){B_(x)});return}}else if(A===3&&x.stateNode.current.memoizedState.isDehydrated){c.blockedOn=x.tag===3?x.stateNode.containerInfo:null;return}}}c.blockedOn=null}function xh(c){if(c.blockedOn!==null)return!1;for(var A=c.targetContainers;0<A.length;){var x=_y(c.nativeEvent);if(x===null){x=c.nativeEvent;var g=new x.constructor(x.type,x);Tv=g,x.target.dispatchEvent(g),Tv=null}else return A=Ze(x),A!==null&&S_(A),c.blockedOn=x,!1;A.shift()}return!0}function F_(c,A,x){xh(c)&&x.delete(A)}function L7(){Iy=!1,ic!==null&&xh(ic)&&(ic=null),lc!==null&&xh(lc)&&(lc=null),oc!==null&&xh(oc)&&(oc=null),G0.forEach(F_),K0.forEach(F_)}function hh(c,A){c.blockedOn===A&&(c.blockedOn=null,Iy||(Iy=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,L7)))}var mh=null;function D_(c){mh!==c&&(mh=c,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){mh===c&&(mh=null);for(var A=0;A<c.length;A+=3){var x=c[A],g=c[A+1],S=c[A+2];if(typeof g!="function"){if(Ty(g||x)===null)continue;break}var I=Ze(x);I!==null&&(c.splice(A,3),A-=3,_1(I,{pending:!0,data:S,method:x.method,action:g},g,S))}}))}function zu(c){function A(xe){return hh(xe,c)}ic!==null&&hh(ic,c),lc!==null&&hh(lc,c),oc!==null&&hh(oc,c),G0.forEach(A),K0.forEach(A);for(var x=0;x<cc.length;x++){var g=cc[x];g.blockedOn===c&&(g.blockedOn=null)}for(;0<cc.length&&(x=cc[0],x.blockedOn===null);)I_(x),x.blockedOn===null&&cc.shift();if(x=(c.ownerDocument||c).$$reactFormReplay,x!=null)for(g=0;g<x.length;g+=3){var S=x[g],I=x[g+1],V=S[ue]||null;if(typeof I=="function")V||D_(x);else if(V){var se=null;if(I&&I.hasAttribute("formAction")){if(S=I,V=I[ue]||null)se=V.formAction;else if(Ty(S)!==null)continue}else se=V.action;typeof se=="function"?x[g+1]=se:(x.splice(g,3),g-=3),D_(x)}}}function U_(){function c(I){I.canIntercept&&I.info==="react-transition"&&I.intercept({handler:function(){return new Promise(function(V){return S=V})},focusReset:"manual",scroll:"manual"})}function A(){S!==null&&(S(),S=null),g||setTimeout(x,20)}function x(){if(!g&&!navigation.transition){var I=navigation.currentEntry;I&&I.url!=null&&navigation.navigate(I.url,{state:I.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,S=null;return navigation.addEventListener("navigate",c),navigation.addEventListener("navigatesuccess",A),navigation.addEventListener("navigateerror",A),setTimeout(x,100),function(){g=!0,navigation.removeEventListener("navigate",c),navigation.removeEventListener("navigatesuccess",A),navigation.removeEventListener("navigateerror",A),S!==null&&(S(),S=null)}}}function Fy(c){this._internalRoot=c}gh.prototype.render=Fy.prototype.render=function(c){var A=this._internalRoot;if(A===null)throw Error(a(409));var x=A.current,g=Is();j_(x,g,c,A,null,null)},gh.prototype.unmount=Fy.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var A=c.containerInfo;j_(c.current,2,null,c,null,null),Jx(),A[Ae]=null}};function gh(c){this._internalRoot=c}gh.prototype.unstable_scheduleHydration=function(c){if(c){var A=te();c={blockedOn:null,target:c,priority:A};for(var x=0;x<cc.length&&A!==0&&A<cc[x].priority;x++);cc.splice(x,0,c),x===0&&I_(c)}};var M_=t.version;if(M_!=="19.2.4")throw Error(a(527,M_,"19.2.4"));K.findDOMNode=function(c){var A=c._reactInternals;if(A===void 0)throw typeof c.render=="function"?Error(a(188)):(c=Object.keys(c).join(","),Error(a(268,c)));return c=u(A),c=c!==null?f(c):null,c=c===null?null:c.stateNode,c};var Q7={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:X,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bh.isDisabled&&bh.supportsFiber)try{jt=bh.inject(Q7),Kt=bh}catch{}}return Y0.createRoot=function(c,A){if(!s(c))throw Error(a(299));var x=!1,g="",S=z4,I=$4,V=V4;return A!=null&&(A.unstable_strictMode===!0&&(x=!0),A.identifierPrefix!==void 0&&(g=A.identifierPrefix),A.onUncaughtError!==void 0&&(S=A.onUncaughtError),A.onCaughtError!==void 0&&(I=A.onCaughtError),A.onRecoverableError!==void 0&&(V=A.onRecoverableError)),A=C_(c,1,!1,null,null,x,g,null,S,I,V,U_),c[Ae]=A.current,py(c),new Fy(A)},Y0.hydrateRoot=function(c,A,x){if(!s(c))throw Error(a(299));var g=!1,S="",I=z4,V=$4,se=V4,xe=null;return x!=null&&(x.unstable_strictMode===!0&&(g=!0),x.identifierPrefix!==void 0&&(S=x.identifierPrefix),x.onUncaughtError!==void 0&&(I=x.onUncaughtError),x.onCaughtError!==void 0&&(V=x.onCaughtError),x.onRecoverableError!==void 0&&(se=x.onRecoverableError),x.formState!==void 0&&(xe=x.formState)),A=C_(c,1,!0,A,x??null,g,S,xe,I,V,se,U_),A.context=k_(null),x=A.current,g=Is(),g=Ye(g),S=qo(g),S.callback=null,Wo(x,S,g),x=g,A.current.lanes=x,Ve(A,x),sl(A),c[Ae]=A.current,py(c),new gh(A)},Y0.version="19.2.4",Y0}var G_;function eV(){if(G_)return Ry.exports;G_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ry.exports=Z7(),Ry.exports}var tV=eV();const rV=Sl(tV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aV=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),nV=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,a)=>a?a.toUpperCase():r.toLowerCase()),K_=e=>{const t=nV(e);return t.charAt(0).toUpperCase()+t.slice(1)},CM=(...e)=>e.filter((t,r,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===r).join(" ").trim(),sV=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var iV={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"};/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lV=k.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:a,className:s="",children:i,iconNode:l,...o},d)=>k.createElement("svg",{ref:d,...iV,width:t,height:t,stroke:e,strokeWidth:a?Number(r)*24/Number(t):r,className:CM("lucide",s),...!i&&!sV(o)&&{"aria-hidden":"true"},...o},[...l.map(([u,f])=>k.createElement(u,f)),...Array.isArray(i)?i:[i]]));/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ie=(e,t)=>{const r=k.forwardRef(({className:a,...s},i)=>k.createElement(lV,{ref:i,iconNode:t,className:CM(`lucide-${aV(K_(e))}`,`lucide-${e}`,a),...s}));return r.displayName=K_(e),r};/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oV=[["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-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],za=Ie("activity",oV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cV=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],dV=Ie("arrow-down-right",cV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uV=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],gs=Ie("arrow-left",uV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AV=[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]],jA=Ie("arrow-right-left",AV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fV=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],_c=Ie("arrow-right",fV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pV=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],nk=Ie("arrow-up-right",pV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xV=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],If=Ie("award",xV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hV=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]],Ki=Ie("banknote",hV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mV=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],kM=Ie("book-open",mV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gV=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],q_=Ie("bookmark",gV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bV=[["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"}]],W_=Ie("bot",bV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vV=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],ea=Ie("building-2",vV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yV=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]],vi=Ie("calculator",yV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wV=[["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"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]],jM=Ie("calendar-check",wV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NV=[["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"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],Y_=Ie("calendar-days",NV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CV=[["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"}]],Wr=Ie("calendar",CV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kV=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],sk=Ie("camera",kV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jV=[["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"}]],xo=Ie("chart-column",jV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const EV=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V9",key:"uvy0l4"}],["path",{d:"M19 21V3",key:"11j9sm"}]],EM=Ie("chart-no-axes-column-increasing",EV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SV=[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]],Rd=Ie("chart-pie",SV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BV=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],X_=Ie("check",BV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _V=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ik=Ie("chevron-down",_V);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TV=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Hs=Ie("chevron-right",TV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IV=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],lk=Ie("chevron-up",IV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FV=[["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"}]],Sr=Ie("circle-alert",FV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]],UV=Ie("circle-arrow-down",DV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const MV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],RV=Ie("circle-arrow-up",MV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const OV=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Xi=Ie("circle-check-big",OV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Gt=Ie("circle-check",PV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LV=[["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"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],QV=Ie("circle-play",LV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],db=Ie("circle-plus",HV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],$V=Ie("circle-question-mark",zV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VV=[["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"}]],SM=Ie("circle-x",VV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GV=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M11 9h4a2 2 0 0 0 2-2V3",key:"1ve2rv"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"M7 21v-4a2 2 0 0 1 2-2h4",key:"1fwkro"}],["circle",{cx:"15",cy:"15",r:"2",key:"3i40o0"}]],KV=Ie("circuit-board",GV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qV=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],Jd=Ie("clipboard-list",qV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const WV=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Pc=Ie("clock",WV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YV=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],XV=Ie("code-xml",YV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const JV=[["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"}]],ub=Ie("copy",JV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZV=[["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"}],["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"}]],Qy=Ie("cpu",ZV);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eG=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Fp=Ie("credit-card",eG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tG=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 15 21.84",key:"14ibmq"}],["path",{d:"M21 5V8",key:"1marbg"}],["path",{d:"M21 12L18 17H22L19 22",key:"zafso"}],["path",{d:"M3 12A9 3 0 0 0 14.59 14.87",key:"1y4wr8"}]],rG=Ie("database-zap",tG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aG=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],jo=Ie("database",aG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nG=[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]],sG=Ie("delete",nG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iG=[["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"}]],kn=Ie("dollar-sign",iG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lG=[["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"}]],Gs=Ie("download",lG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oG=[["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"}]],cG=Ie("earth",oG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dG=[["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"}]],BM=Ie("external-link",dG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uG=[["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"}]],Tc=Ie("eye",uG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AG=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],Zd=Ie("file-code",AG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fG=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],Kf=Ie("file-search",fG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pG=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],gl=Ie("file-spreadsheet",pG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xG=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],yr=Ie("file-text",xG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hG=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],mG=Ie("fingerprint-pattern",hG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gG=[["circle",{cx:"15",cy:"19",r:"2",key:"u2pros"}],["path",{d:"M20.9 19.8A2 2 0 0 0 22 18V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h5.1",key:"1jj40k"}],["path",{d:"M15 11v-1",key:"cntcp"}],["path",{d:"M15 17v-2",key:"1279jj"}]],Lm=Ie("folder-archive",gG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bG=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],J_=Ie("folder",bG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vG=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],ok=Ie("funnel",vG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yG=[["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"}]],wr=Ie("globe",yG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wG=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],eu=Ie("handshake",wG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NG=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],CG=Ie("hard-drive",NG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kG=[["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"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Da=Ie("history",kG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jG=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],EG=Ie("house",jG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const SG=[["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"}]],Dp=Ie("image",SG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BG=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],jn=Ie("info",BG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _G=[["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"}]],EA=Ie("key",_G);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const TG=[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z",key:"1m329m"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]],br=Ie("landmark",TG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IG=[["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"}]],Lc=Ie("layers",IG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const FG=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],DG=Ie("layout-dashboard",FG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const UG=[["rect",{width:"7",height:"18",x:"3",y:"3",rx:"1",key:"2obqm"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}]],MG=Ie("layout-panel-left",UG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RG=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],Qm=Ie("layout-template",RG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const OG=[["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"}]],qf=Ie("link",OG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PG=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],_M=Ie("list-filter",PG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LG=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],qi=Ie("loader-circle",LG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const QG=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],$t=Ie("loader",QG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HG=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],TM=Ie("lock-open",HG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zG=[["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"}]],Od=Ie("lock",zG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $G=[["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"}]],Wf=Ie("log-out",$G);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VG=[["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"}]],Br=Ie("mail",VG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GG=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],IM=Ie("map-pin",GG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KG=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],bl=Ie("megaphone",KG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qG=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],WG=Ie("menu",qG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YG=[["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"}]],Ha=Ie("message-circle",YG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XG=[["path",{d:"M14 14a2 2 0 0 0 2-2V8h-2",key:"1r06pg"}],["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"}],["path",{d:"M8 14a2 2 0 0 0 2-2V8H8",key:"1jzu5j"}]],JG=Ie("message-square-quote",XG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZG=[["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"}]],eK=Ie("message-square",ZG);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tK=[["rect",{width:"20",height:"15",x:"2",y:"4",rx:"2",key:"2no95f"}],["rect",{width:"8",height:"7",x:"6",y:"8",rx:"1",key:"zh9wx"}],["path",{d:"M18 8v7",key:"o5zi4n"}],["path",{d:"M6 19v2",key:"1loha6"}],["path",{d:"M18 19v2",key:"1dawf0"}]],rK=Ie("microwave",tK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aK=[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]],nK=Ie("octagon-alert",aK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sK=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],ck=Ie("panels-top-left",sK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iK=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Hm=Ie("pen-line",iK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lK=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],yl=Ie("pencil",lK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oK=[["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"}]],bs=Ie("percent",oK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cK=[["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"}]],dk=Ie("phone",cK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dK=[["path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",key:"1v9wt8"}]],Bl=Ie("plane",dK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uK=[["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"}]],AK=Ie("play",uK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fK=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],En=Ie("plus",fK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pK=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],wt=Ie("printer",pK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xK=[["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"}]],Yf=Ie("radio",xK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hK=[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]],ca=Ie("receipt-text",hK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mK=[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]],gK=Ie("receipt",mK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bK=[["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"}]],ct=Ie("refresh-cw",bK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vK=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],yK=Ie("rotate-cw",vK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wK=[["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"}]],Zn=Ie("save",wK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const NK=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]],Up=Ie("scale",NK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const CK=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],kK=Ie("scissors",CK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jK=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],er=Ie("search",jK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const EK=[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],SK=Ie("send-horizontal",EK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const BK=[["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"}]],zs=Ie("send",BK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _K=[["path",{d:"M6 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-2",key:"4b9dqc"}],["path",{d:"M6 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2",key:"22nnkd"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"m13 6-4 6h6l-4 6",key:"14hqih"}]],TK=Ie("server-crash",_K);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const IK=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],FK=Ie("server",IK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const DK=[["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"}]],PA=Ie("settings",DK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const UK=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Ab=Ie("settings-2",UK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const MK=[["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"}]],Aa=Ie("share-2",MK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const RK=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],vs=Ie("shield-alert",RK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const OK=[["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"}]],Ia=Ie("shield-check",OK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const PK=[["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:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]],FM=Ie("shield-x",PK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const LK=[["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"}]],ho=Ie("shield",LK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const QK=[["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"}]],Qc=Ie("star",QK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const HK=[["path",{d:"M12 3v18",key:"108xh3"}],["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"}]],wl=Ie("table",HK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zK=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],$K=Ie("tag",zK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const VK=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],uk=Ie("target",VK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const GK=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Ak=Ie("terminal",GK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const KK=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],DM=Ie("toggle-left",KK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qK=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],UM=Ie("toggle-right",qK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const WK=[["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"}]],Ua=Ie("trash-2",WK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const YK=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],fb=Ie("trending-down",YK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const XK=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],da=Ie("trending-up",XK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const JK=[["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"}]],Xr=Ie("triangle-alert",JK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ZK=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]],pb=Ie("truck",ZK);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eq=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],tq=Ie("type",eq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rq=[["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"}]],LA=Ie("upload",rq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aq=[["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"}]],MM=Ie("user-check",aq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nq=[["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"}]],sq=Ie("user-minus",nq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const iq=[["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"}]],fN=Ie("user-plus",iq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lq=[["circle",{cx:"10",cy:"7",r:"4",key:"e45bow"}],["path",{d:"M10.3 15H7a4 4 0 0 0-4 4v2",key:"3bnktk"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}]],QA=Ie("user-search",lq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const oq=[["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"}]],RM=Ie("user-x",oq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cq=[["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"}]],tu=Ie("user",cq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dq=[["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"}]],Qi=Ie("users",dq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uq=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],Ic=Ie("wallet",uq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Aq=[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]],Z_=Ie("waves",Aq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fq=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Xf=Ie("wrench",fq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pq=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],mt=Ie("x",pq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xq=[["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"}]],Kr=Ie("zap",xq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hq=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],mq=Ie("zoom-in",hq);/**
 * @license lucide-react v0.562.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gq=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],bq=Ie("zoom-out",gq),vq="https://condominios.microautomatismo.com",yq="/CBO/SanDiego/AvDJC/UrbVDO/Tejar/",Rr=`${vq}${yq}`,Ne=`${Rr}api`,Ln="Kernel V4.2.12 LOCAL MC/MB",va="El Tejar",Te=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],Dr=()=>{const e=new Date;return new Intl.DateTimeFormat("en-CA",{timeZone:"America/Caracas",year:"numeric",month:"2-digit",day:"2-digit"}).format(e)};let OM=!1,PM=null;const Ge=async(e,t={})=>{const r=e.includes("get_settings.php")||e.includes("get_license_status.php")||e.includes("login.php")||e.includes("logout.php")||e.includes("session.php")||e.includes("log_navigation.php");if(OM&&PM!=="programmer"&&!r)throw new Error("falla de conexión al servidor");const a=t.method||"GET",s={...t,mode:"cors",credentials:"include",cache:"no-cache",headers:{"Content-Type":"application/json",Accept:"application/json",...t.headers}};try{const i=await fetch(e,s);if(i.status===404){if(a==="GET")return{ok:!0,status:200,json:async()=>[]};throw new Error("Endpoint no encontrado (404).")}if(!i.ok){const l=await i.text();let o=`Error ${i.status}`;try{const d=JSON.parse(l);o=d.error||d.message||o}catch{o=l.substring(0,100)||o}throw new Error(o)}return i}catch(i){throw i}},we={getInitialDebtData:async()=>(await(await Ge(`${Ne}/get_initial_debt_data.php`)).json()).data||[],getArchivedAgreements:async()=>(await(await Ge(`${Ne}/get_archived_agreements.php`)).json()).data||[],getModuleStatus:async()=>await(await Ge(`${Ne}/get_modules.php`)).json(),saveModuleStatus:async(e,t)=>await Ge(`${Ne}/save_module_status.php`,{method:"POST",body:JSON.stringify({moduleId:e,isActive:t})}),getFinancialTotals:async()=>await(await Ge(`${Ne}/get_financial_totals.php`)).json(),runDiagnostics:async e=>await(await Ge(`${Ne}/system_diagnostics.php`,{method:"POST",body:JSON.stringify({action:e})})).json(),getProviders:async()=>await(await Ge(`${Ne}/get_providers.php`)).json(),saveProvider:async e=>await Ge(`${Ne}/save_provider.php`,{method:"POST",body:JSON.stringify(e)}),deleteProvider:async e=>await Ge(`${Ne}/delete_provider.php`,{method:"POST",body:JSON.stringify({rif:e})}),getProviderHistory:async e=>await(await Ge(`${Ne}/get_provider_history.php?rif=${e}`)).json(),getAuditLogs:async()=>await(await Ge(`${Ne}/get_logs.php`)).json(),clearAuditLogs:async()=>await Ge(`${Ne}/clear_logs.php`,{method:"POST"}),logNavigation:async e=>{try{await fetch(`${Ne}/log_navigation.php`,{method:"POST",mode:"cors",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({module:e})})}catch{}},sendWelcomeEmail:async e=>await Ge(`${Ne}/send_welcome_email.php`,{method:"POST",body:JSON.stringify({userId:e})}),getExchangeRateHistory:async()=>{try{const t=await(await Ge(`${Ne}/get_exchange_rates.php`)).json();return Array.isArray(t)?t:[]}catch{return[]}},saveExchangeRate:async e=>await Ge(`${Ne}/save_exchange_rate.php`,{method:"POST",body:JSON.stringify(e)}),saveExchangeRateBatch:async e=>await Ge(`${Ne}/save_exchange_rate_batch.php`,{method:"POST",body:JSON.stringify({rates:e})}),syncExternalDb:async()=>await Ge(`${Ne}/sync_external_db.php`,{method:"POST"}),syncLiveRate:async()=>await(await Ge(`${Ne}/sync_external_db.php`,{method:"POST"})).json(),syncMissingRates:async e=>({success:!1,message:"Auto-sync deshabilitado"}),getReservations:async()=>{const t=await(await Ge(`${Ne}/get_reservations.php`)).json();return Array.isArray(t)?t:[]},saveReservation:async e=>await Ge(`${Ne}/save_reservation.php`,{method:"POST",body:JSON.stringify(e)}),updateReservationStatus:async(e,t)=>await Ge(`${Ne}/update_reservation_status.php`,{method:"POST",body:JSON.stringify({id:e,status:t})}),deleteReservation:async e=>await Ge(`${Ne}/delete_reservation.php`,{method:"POST",body:JSON.stringify({id:e})}),getAnnouncements:async()=>{const t=await(await Ge(`${Ne}/get_announcements.php`)).json();return Array.isArray(t)?t:[]},saveAnnouncement:async e=>await Ge(`${Ne}/save_announcement.php`,{method:"POST",body:JSON.stringify(e)}),updateAnnouncementStatus:async(e,t)=>await Ge(`${Ne}/update_announcement_status.php`,{method:"POST",body:JSON.stringify({id:e,status:t})}),deleteAnnouncement:async e=>await Ge(`${Ne}/delete_announcement.php`,{method:"POST",body:JSON.stringify({id:e})}),getMaintenanceRequests:async()=>{const t=await(await Ge(`${Ne}/get_maintenance.php`)).json();return Array.isArray(t)?t:[]},saveMaintenanceRequest:async e=>await Ge(`${Ne}/save_maintenance.php`,{method:"POST",body:JSON.stringify(e)}),updateMaintenanceStatus:async(e,t)=>await Ge(`${Ne}/update_maintenance_status.php`,{method:"POST",body:JSON.stringify({id:e,status:t})}),deleteMaintenance:async e=>await Ge(`${Ne}/delete_maintenance.php`,{method:"POST",body:JSON.stringify({id:e})}),getSystemSettings:async()=>await(await Ge(`${Ne}/get_settings.php`)).json(),updateSystemSetting:async(e,t)=>await Ge(`${Ne}/update_setting.php`,{method:"POST",body:JSON.stringify({key:e,value:t})}),toggleMaintenanceMode:async e=>await(await Ge(`${Ne}/toggle_maintenance_mode.php`,{method:"POST",body:JSON.stringify({enabled:e})})).json(),checkSession:async()=>{try{const t=await(await Ge(`${Ne}/session.php`)).json();return t.active?t.user:null}catch{return null}},login:async e=>{const r=await(await Ge(`${Ne}/login.php`,{method:"POST",body:JSON.stringify(e)})).json();if(!r.user)throw new Error(r.error||"Fallo de autenticación");return r.user},logout:async()=>{try{await Ge(`${Ne}/logout.php`,{method:"POST"})}catch{console.warn("Logout API failed, continuing with local cleanup")}},getFees:async()=>{const t=await(await Ge(`${Ne}/get_fees.php`)).json();return Array.isArray(t)?t:[]},saveFee:async e=>await Ge(`${Ne}/save_fee.php`,{method:"POST",body:JSON.stringify(e)}),deleteFee:async e=>await Ge(`${Ne}/delete_fee.php`,{method:"POST",body:JSON.stringify({id:e})}),registerPayment:async(e,t,r,a,s,i,l,o)=>await Ge(`${Ne}/register_payment.php`,{method:"POST",body:JSON.stringify({feeId:e,propertyId:t,amount:r,method:a,reference:s,date:i,slot:l,amount_bs:o})}),getProperties:async()=>{const t=await(await Ge(`${Ne}/get_properties.php`)).json();return Array.isArray(t)?t:[]},saveProperty:async e=>await Ge(`${Ne}/save_property.php`,{method:"POST",body:JSON.stringify(e)}),deleteProperty:async e=>await Ge(`${Ne}/delete_property.php`,{method:"POST",body:JSON.stringify({id:e})}),getMyProperty:async e=>await(await Ge(`${Ne}/get_my_status.php`)).json(),getResidents:async()=>{const t=await(await Ge(`${Ne}/get_residents.php`)).json();return Array.isArray(t)?t:[]},saveResident:async e=>await Ge(`${Ne}/save_resident.php`,{method:"POST",body:JSON.stringify(e)}),deleteResident:async e=>await Ge(`${Ne}/delete_resident.php`,{method:"POST",body:JSON.stringify({id:e})}),getUsers:async()=>{const t=await(await Ge(`${Ne}/get_users.php`)).json();return Array.isArray(t)?t:[]},saveUser:async e=>await Ge(`${Ne}/save_user.php`,{method:"POST",body:JSON.stringify(e)}),deleteUser:async e=>await Ge(`${Ne}/delete_user.php`,{method:"POST",body:JSON.stringify({id:e})}),getDashboardStats:async()=>await(await Ge(`${Ne}/get_dashboard_stats.php`)).json(),getBankTransactions:async e=>{const t=e?`${Ne}/get_bank_transactions.php?role=${e}`:`${Ne}/get_bank_transactions.php`,a=await(await Ge(t)).json();return Array.isArray(a)?a:[]},getCriticalBills:async()=>{const t=await(await Ge(`${Ne}/get_critical_bills.php`)).json();return Array.isArray(t)?t:[]},getBankPreciseTransactions:async(e,t)=>{const a=await(await Ge(`${Ne}/get_bank_precise.php?month=${e}&year=${t}`)).json();return Array.isArray(a.transactions)?a.transactions:[]},getPendingBills:async()=>{const t=await(await Ge(`${Ne}/get_pending_bills.php`)).json();return Array.isArray(t)?t:[]},savePendingBill:async e=>await Ge(`${Ne}/save_pending_bill.php`,{method:"POST",body:JSON.stringify(e)}),deletePendingBill:async e=>await Ge(`${Ne}/delete_pending_bill.php`,{method:"POST",body:JSON.stringify({id:e})}),payPendingBill:async(e,t,r,a)=>await Ge(`${Ne}/pay_pending_bill.php`,{method:"POST",body:JSON.stringify({id:e,reference:t,source:r,date:a})}),getPolls:async()=>{const t=await(await Ge(`${Ne}/get_polls.php`)).json();return Array.isArray(t)?t:[]},savePoll:async e=>await Ge(`${Ne}/save_poll.php`,{method:"POST",body:JSON.stringify(e)}),closePoll:async e=>await Ge(`${Ne}/close_poll.php`,{method:"POST",body:JSON.stringify({id:e})}),deletePoll:async e=>await Ge(`${Ne}/delete_poll.php`,{method:"POST",body:JSON.stringify({id:e})}),submitVote:async(e,t)=>await Ge(`${Ne}/submit_vote.php`,{method:"POST",body:JSON.stringify({pollId:e,answers:t})}),getDataForms:async()=>{const t=await(await Ge(`${Ne}/get_data_forms.php`)).json();return Array.isArray(t)?t:[]},saveDataForm:async e=>await Ge(`${Ne}/save_data_form.php`,{method:"POST",body:JSON.stringify(e)}),deleteDataForm:async e=>await Ge(`${Ne}/delete_data_form.php`,{method:"POST",body:JSON.stringify({id:e})}),toggleDataFormStatus:async e=>await Ge(`${Ne}/toggle_data_form_status.php`,{method:"POST",body:JSON.stringify({id:e})}),submitDataFormResponse:async(e,t)=>await Ge(`${Ne}/submit_data_form_response.php`,{method:"POST",body:JSON.stringify({formId:e,data:t})}),getLiveVotes:async()=>{const t=await(await Ge(`${Ne}/get_live_votes.php`)).json();return Array.isArray(t)?t:[]},saveLiveVote:async e=>await Ge(`${Ne}/save_live_vote.php`,{method:"POST",body:JSON.stringify(e)}),updateLiveVoteStatus:async(e,t)=>await Ge(`${Ne}/update_live_vote_status.php`,{method:"POST",body:JSON.stringify({id:e,status:t})}),castLiveVote:async(e,t)=>await Ge(`${Ne}/cast_live_vote.php`,{method:"POST",body:JSON.stringify({voteId:e,optionId:t})}),deleteLiveVote:async e=>await Ge(`${Ne}/delete_live_vote.php`,{method:"POST",body:JSON.stringify({id:e})}),getAssemblies:async()=>{const t=await(await Ge(`${Ne}/get_assemblies.php`)).json();return Array.isArray(t)?t:[]},saveAssembly:async e=>await Ge(`${Ne}/save_assembly.php`,{method:"POST",body:JSON.stringify(e)}),deleteAssembly:async e=>await Ge(`${Ne}/delete_assembly.php`,{method:"POST",body:JSON.stringify({id:e})}),getReserveFundHistory:async(e,t)=>{const r=e&&t?`${Ne}/get_reserve_fund_history.php?start=${e}&end=${t}`:`${Ne}/get_reserve_fund_history.php`;return await(await Ge(r)).json()},getDetailedExcelReport:async(e,t,r)=>await(await Ge(`${Ne}/get_detailed_excel_report.php?month=${e}&year=${t}&type=${r}`)).json(),getCreditBalances:async()=>{const t=await(await Ge(`${Ne}/get_credit_balances.php`)).json();return Array.isArray(t.data)?t.data:[]},exportDatabaseSQL:()=>{window.open(`${Ne}/export_sql.php`,"_blank")},getMonthlyCollectionHistory:async()=>{const t=await(await Ge(`${Ne}/get_monthly_collection.php`)).json();return Array.isArray(t)?t:[]},syncMonthlyCollection:async()=>await(await Ge(`${Ne}/sync_monthly_collection.php`)).json(),deleteMonthlyCollection:async e=>await(await Ge(`${Ne}/delete_monthly_collection.php?id=${e}`)).json(),getPaymentReports:async e=>{const t=e?`${Ne}/get_payment_reports.php?propertyId=${e}`:`${Ne}/get_payment_reports.php`,a=await(await Ge(t)).json();return Array.isArray(a)?a:[]},savePaymentReport:async e=>await Ge(`${Ne}/report_payment_owner.php`,{method:"POST",body:JSON.stringify(e)}),updatePaymentReportStatus:async(e,t,r,a,s)=>await Ge(`${Ne}/update_payment_report_status.php`,{method:"POST",body:JSON.stringify({id:e,status:t,observations:r,assignedTo:a,targetId:s})}),getDebtList:async(e,t)=>await(await Ge(`${Ne}/get_debt_list.php?month=${e}&year=${t}`)).json(),getSolventList:async(e,t)=>await(await Ge(`${Ne}/get_solvent_list.php?month=${e}&year=${t}`)).json(),getSaldoDesglosado:async(e,t,r)=>await(await Ge(`${Ne}/get_saldo_desglosado.php?propertyId=${e}&month=${t}&year=${r}`)).json(),saveSaldoDesglosadoVisibility:async e=>await Ge(`${Ne}/save_module_status.php`,{method:"POST",body:JSON.stringify({moduleId:"saldo-desglosado",isActive:e})}),setElectricalFailure:e=>{OM=e},setUserRole:e=>{PM=e}},LM=k.createContext(void 0),wq=({children:e})=>{const[t,r]=k.useState([]),[a,s]=k.useState([]),[i,l]=k.useState([]),[o,d]=k.useState([]),[u,f]=k.useState([]),[p,h]=k.useState([]),[m,b]=k.useState([]),[v,y]=k.useState([]),[j,_]=k.useState([]),[N,E]=k.useState([]),[T,B]=k.useState([]),[F,R]=k.useState([]),[U,D]=k.useState([]),[L,P]=k.useState([]),[G,Q]=k.useState([]),[H,X]=k.useState(null),[K,ee]=k.useState([]),[W,Y]=k.useState(!1),[M,O]=k.useState({incomeTransferPercent:0,expenseTransferPercent:0}),[q,z]=k.useState(!1),[J,re]=k.useState(null),le=k.useMemo(()=>{if(!v||v.length===0)return 1;const It=[...v].sort((ra,Ma)=>new Date(Ma.date).getTime()-new Date(ra.date).getTime())[0];return It.pmValue&&It.pmValue>0?It.pmValue:It.amValue||1},[v]),ne=k.useCallback(async Ve=>{const It=Ve||J;z(!0);try{const[ra,Ma,be,Ye,tt,te,de,oe,ce,ue,Ae,Ce,Re,ke,Se,Be,ze,Ke]=await Promise.all([we.getFees().catch(()=>[]),we.getProperties().catch(()=>[]),we.getResidents().catch(()=>[]),It==="admin"||It==="programmer"?we.getUsers().catch(()=>[]):Promise.resolve([]),we.getProviders().catch(()=>[]),It==="admin"||It==="programmer"?we.getBankTransactions("admin").catch(()=>[]):Promise.resolve([]),we.getExchangeRateHistory().catch(()=>[]),we.getPendingBills().catch(()=>[]),we.getPolls().catch(()=>[]),we.getDataForms().catch(()=>[]),we.getLiveVotes().catch(()=>[]),we.getReservations().catch(()=>[]),we.getAnnouncements().catch(()=>[]),we.getMaintenanceRequests().catch(()=>[]),we.getSystemSettings().catch(()=>({pool_enabled:"false"})),we.getAssemblies().catch(()=>[]),we.getFinancialTotals().catch(()=>null),we.getModuleStatus().catch(()=>[])]);r(ra),s(Ma),l(be),d(Ye),f(tt),h(te),y(de),b(oe),_(ce),E(ue),B(Ae),R(Ce),D(Re),P(ke),Y(Se.pool_enabled==="true"),Q(Be),X(ze),ee(Ke)}catch(ra){console.error(ra)}finally{z(!1)}},[J]),ae=k.useCallback(Ve=>{re(Ve)},[]),ie=async(Ve,It)=>{await we.saveModuleStatus(Ve,It),await ne()},me=async Ve=>{await we.saveReservation(Ve),await ne()},Z=async(Ve,It)=>{await we.updateReservationStatus(Ve,It),await ne()},Me=async Ve=>{await we.deleteReservation(Ve),await ne()},pe=async Ve=>{await we.saveAnnouncement(Ve),await ne()},he=async(Ve,It)=>{await we.updateAnnouncementStatus(Ve,It),await ne()},ye=async Ve=>{await we.deleteAnnouncement(Ve),await ne()},fe=async Ve=>{await we.saveMaintenanceRequest(Ve),await ne()},Ue=async(Ve,It)=>{await we.updateMaintenanceStatus(Ve,It),await ne()},qe=async Ve=>{await we.deleteMaintenance(Ve),await ne()},at=async Ve=>{await we.updateSystemSetting("pool_enabled",String(Ve)),await ne()},nt=async Ve=>{await we.saveAssembly(Ve),await ne()},Ct=async Ve=>{await we.deleteAssembly(Ve),await ne()},kt=async Ve=>{await we.saveFee(Ve),await ne()},ft=async Ve=>{await we.deleteFee(Ve),await ne()},_r=async(Ve,It,ra,Ma,be,Ye,tt,te)=>{const de=await fetch(`${Ne}/register_payment.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:Ve,propertyId:It,amount:ra,method:Ma,reference:be,date:Ye,slot:tt,amount_bs:te})}),oe=await de.json();if(!de.ok)throw new Error(oe.error||"Fallo crítico en motor de pagos");await ne()},Ar=async Ve=>{const It=await fetch(`${Ne}/delete_payment.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:Ve})}),ra=await It.json();if(!It.ok)throw new Error(ra.error||"Fallo al anular pago");await ne()},pa=async(Ve,It,ra)=>{const Ma=await fetch(`${Ne}/update_payment.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:Ve,propertyId:It,payment:ra})}),be=await Ma.json();if(!Ma.ok)throw new Error(be.error||"Fallo al actualizar pago");await ne()},Ut=async Ve=>{},Tr=async Ve=>{},it=async Ve=>{},Rt=async Ve=>{await we.savePendingBill(Ve),await ne()},Et=async Ve=>{await we.deletePendingBill(Ve),await ne()},jt=async Ve=>{await we.savePendingBill(Ve),await ne()},Kt=async(Ve,It,ra,Ma)=>{await we.payPendingBill(Ve,It,ra,Ma),await ne()},fr=async(Ve,It,ra)=>{await we.updateSystemSetting("receipt_sent","true"),await ne()},Cr=Ve=>O(Ve),cn=async Ve=>{await we.savePoll(Ve),await ne()},$n=async Ve=>{await we.closePoll(Ve),await ne()},Cs=async Ve=>{await we.deletePoll(Ve),await ne()},ks=async(Ve,It)=>{await we.submitVote(Ve,It),await ne()},Bi=async Ve=>{await we.saveDataForm(Ve),await ne()},ta=async Ve=>{await we.deleteDataForm(Ve),await ne()},dn=async Ve=>{await we.toggleDataFormStatus(Ve),await ne()},el=async(Ve,It)=>{await we.submitDataFormResponse(Ve,It),await ne()},_i=async Ve=>{await we.saveLiveVote(Ve),await ne()},Wc=async(Ve,It)=>{await we.updateLiveVoteStatus(Ve,It),await ne()},Lo=async(Ve,It)=>{await we.castLiveVote(Ve,It),await ne()},Ul=async Ve=>{await we.deleteLiveVote(Ve),await ne()};return n.jsx(LM.Provider,{value:{fees:t,properties:a,residents:i,users:o,providers:u,transactions:p,pendingBills:m,exchangeRateHistory:v,polls:j,dataForms:N,liveVotes:T,reservations:F,announcements:U,maintenance:L,assemblies:G,financialTotals:H,moduleStatus:K,isPoolEnabled:W,loading:q,refreshData:ne,setUserRole:ae,latestRate:le,updateModuleStatus:ie,addFee:kt,deleteFee:ft,registerPayment:_r,deletePayment:Ar,updatePayment:pa,addTransaction:Ut,deleteTransaction:Tr,updateTransaction:it,addPendingBill:Rt,deletePendingBill:Et,updatePendingBill:jt,markReceiptSent:fr,payPendingBill:Kt,bankFees:M,updateBankFees:Cr,addPoll:cn,closePoll:$n,deletePoll:Cs,submitVote:ks,addDataForm:Bi,deleteDataForm:ta,toggleDataFormStatus:dn,submitDataForm:el,addLiveVote:_i,updateLiveVoteStatus:Wc,castLiveVote:Lo,deleteLiveVote:Ul,addReservation:me,updateReservationStatus:Z,deleteReservation:Me,addAnnouncement:pe,updateAnnouncementStatus:he,deleteAnnouncement:ye,addMaintenance:fe,updateMaintenanceStatus:Ue,deleteMaintenance:qe,togglePoolAvailability:at,addAssembly:nt,deleteAssembly:Ct},children:e})},ht=()=>{const e=k.useContext(LM);if(!e)throw new Error("useData must be used within DataProvider");return e};function QM(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=QM(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function Lr(){for(var e,t,r=0,a="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=QM(e))&&(a&&(a+=" "),a+=t);return a}var Nq=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function fk(e){if(typeof e!="string")return!1;var t=Nq;return t.includes(e)}var Cq=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],kq=new Set(Cq);function HM(e){return typeof e!="string"?!1:kq.has(e)}function zM(e){return typeof e=="string"&&e.startsWith("data-")}function Wi(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(HM(r)||zM(r))&&(t[r]=e[r]);return t}function xb(e){if(e==null)return null;if(k.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Wi(t)}return typeof e=="object"&&!Array.isArray(e)?Wi(e):null}function wi(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(HM(r)||zM(r)||fk(r))&&(t[r]=e[r]);return t}function jq(e){return e==null?null:k.isValidElement(e)?wi(e.props):typeof e=="object"&&!Array.isArray(e)?wi(e):null}var Eq=["children","width","height","viewBox","className","style","title","desc"];function pN(){return pN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},pN.apply(null,arguments)}function Sq(e,t){if(e==null)return{};var r,a,s=Bq(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Bq(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var $M=k.forwardRef((e,t)=>{var{children:r,width:a,height:s,viewBox:i,className:l,style:o,title:d,desc:u}=e,f=Sq(e,Eq),p=i||{width:a,height:s,x:0,y:0},h=Lr("recharts-surface",l);return k.createElement("svg",pN({},wi(f),{className:h,width:a,height:s,style:o,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height),ref:t}),k.createElement("title",null,d),k.createElement("desc",null,u),r)}),_q=["children","className"];function xN(){return xN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},xN.apply(null,arguments)}function Tq(e,t){if(e==null)return{};var r,a,s=Iq(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Iq(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var Nl=k.forwardRef((e,t)=>{var{children:r,className:a}=e,s=Tq(e,_q),i=Lr("recharts-layer",a);return k.createElement("g",xN({className:i},wi(s),{ref:t}),r)}),VM=NM(),Fq=k.createContext(null);function ia(e){return function(){return e}}const hN=Math.PI,mN=2*hN,xd=1e-6,Dq=mN-xd;function GM(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Uq(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return GM;const r=10**t;return function(a){this._+=a[0];for(let s=1,i=a.length;s<i;++s)this._+=Math.round(arguments[s]*r)/r+a[s]}}class Mq{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?GM:Uq(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,a,s){this._append`Q${+t},${+r},${this._x1=+a},${this._y1=+s}`}bezierCurveTo(t,r,a,s,i,l){this._append`C${+t},${+r},${+a},${+s},${this._x1=+i},${this._y1=+l}`}arcTo(t,r,a,s,i){if(t=+t,r=+r,a=+a,s=+s,i=+i,i<0)throw new Error(`negative radius: ${i}`);let l=this._x1,o=this._y1,d=a-t,u=s-r,f=l-t,p=o-r,h=f*f+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>xd)if(!(Math.abs(p*d-u*f)>xd)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let m=a-l,b=s-o,v=d*d+u*u,y=m*m+b*b,j=Math.sqrt(v),_=Math.sqrt(h),N=i*Math.tan((hN-Math.acos((v+h-y)/(2*j*_)))/2),E=N/_,T=N/j;Math.abs(E-1)>xd&&this._append`L${t+E*f},${r+E*p}`,this._append`A${i},${i},0,0,${+(p*m>f*b)},${this._x1=t+T*d},${this._y1=r+T*u}`}}arc(t,r,a,s,i,l){if(t=+t,r=+r,a=+a,l=!!l,a<0)throw new Error(`negative radius: ${a}`);let o=a*Math.cos(s),d=a*Math.sin(s),u=t+o,f=r+d,p=1^l,h=l?s-i:i-s;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>xd||Math.abs(this._y1-f)>xd)&&this._append`L${u},${f}`,a&&(h<0&&(h=h%mN+mN),h>Dq?this._append`A${a},${a},0,1,${p},${t-o},${r-d}A${a},${a},0,1,${p},${this._x1=u},${this._y1=f}`:h>xd&&this._append`A${a},${a},0,${+(h>=hN)},${p},${this._x1=t+a*Math.cos(i)},${this._y1=r+a*Math.sin(i)}`)}rect(t,r,a,s){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${a=+a}v${+s}h${-a}Z`}toString(){return this._}}function KM(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const a=Math.floor(r);if(!(a>=0))throw new RangeError(`invalid digits: ${r}`);t=a}return e},()=>new Mq(t)}function pk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qM(e){this._context=e}qM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function hb(e){return new qM(e)}function WM(e){return e[0]}function YM(e){return e[1]}function XM(e,t){var r=ia(!0),a=null,s=hb,i=null,l=KM(o);e=typeof e=="function"?e:e===void 0?WM:ia(e),t=typeof t=="function"?t:t===void 0?YM:ia(t);function o(d){var u,f=(d=pk(d)).length,p,h=!1,m;for(a==null&&(i=s(m=l())),u=0;u<=f;++u)!(u<f&&r(p=d[u],u,d))===h&&((h=!h)?i.lineStart():i.lineEnd()),h&&i.point(+e(p,u,d),+t(p,u,d));if(m)return i=null,m+""||null}return o.x=function(d){return arguments.length?(e=typeof d=="function"?d:ia(+d),o):e},o.y=function(d){return arguments.length?(t=typeof d=="function"?d:ia(+d),o):t},o.defined=function(d){return arguments.length?(r=typeof d=="function"?d:ia(!!d),o):r},o.curve=function(d){return arguments.length?(s=d,a!=null&&(i=s(a)),o):s},o.context=function(d){return arguments.length?(d==null?a=i=null:i=s(a=d),o):a},o}function vh(e,t,r){var a=null,s=ia(!0),i=null,l=hb,o=null,d=KM(u);e=typeof e=="function"?e:e===void 0?WM:ia(+e),t=typeof t=="function"?t:ia(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?YM:ia(+r);function u(p){var h,m,b,v=(p=pk(p)).length,y,j=!1,_,N=new Array(v),E=new Array(v);for(i==null&&(o=l(_=d())),h=0;h<=v;++h){if(!(h<v&&s(y=p[h],h,p))===j)if(j=!j)m=h,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),b=h-1;b>=m;--b)o.point(N[b],E[b]);o.lineEnd(),o.areaEnd()}j&&(N[h]=+e(y,h,p),E[h]=+t(y,h,p),o.point(a?+a(y,h,p):N[h],r?+r(y,h,p):E[h]))}if(_)return o=null,_+""||null}function f(){return XM().defined(s).curve(l).context(i)}return u.x=function(p){return arguments.length?(e=typeof p=="function"?p:ia(+p),a=null,u):e},u.x0=function(p){return arguments.length?(e=typeof p=="function"?p:ia(+p),u):e},u.x1=function(p){return arguments.length?(a=p==null?null:typeof p=="function"?p:ia(+p),u):a},u.y=function(p){return arguments.length?(t=typeof p=="function"?p:ia(+p),r=null,u):t},u.y0=function(p){return arguments.length?(t=typeof p=="function"?p:ia(+p),u):t},u.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:ia(+p),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(a).y(t)},u.defined=function(p){return arguments.length?(s=typeof p=="function"?p:ia(!!p),u):s},u.curve=function(p){return arguments.length?(l=p,i!=null&&(o=l(i)),u):l},u.context=function(p){return arguments.length?(p==null?i=o=null:o=l(i=p),u):i},u}class JM{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Rq(e){return new JM(e,!0)}function Oq(e){return new JM(e,!1)}function zm(){}function $m(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function ZM(e){this._context=e}ZM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:$m(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:$m(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Pq(e){return new ZM(e)}function eR(e){this._context=e}eR.prototype={areaStart:zm,areaEnd:zm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:$m(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Lq(e){return new eR(e)}function tR(e){this._context=e}tR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,a=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,a):this._context.moveTo(r,a);break;case 3:this._point=4;default:$m(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Qq(e){return new tR(e)}function rR(e){this._context=e}rR.prototype={areaStart:zm,areaEnd:zm,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Hq(e){return new rR(e)}function eT(e){return e<0?-1:1}function tT(e,t,r){var a=e._x1-e._x0,s=t-e._x1,i=(e._y1-e._y0)/(a||s<0&&-0),l=(r-e._y1)/(s||a<0&&-0),o=(i*s+l*a)/(a+s);return(eT(i)+eT(l))*Math.min(Math.abs(i),Math.abs(l),.5*Math.abs(o))||0}function rT(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Hy(e,t,r){var a=e._x0,s=e._y0,i=e._x1,l=e._y1,o=(i-a)/3;e._context.bezierCurveTo(a+o,s+o*t,i-o,l-o*r,i,l)}function Vm(e){this._context=e}Vm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Hy(this,this._t0,rT(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Hy(this,rT(this,r=tT(this,e,t)),r);break;default:Hy(this,this._t0,r=tT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function aR(e){this._context=new nR(e)}(aR.prototype=Object.create(Vm.prototype)).point=function(e,t){Vm.prototype.point.call(this,t,e)};function nR(e){this._context=e}nR.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,a,s,i){this._context.bezierCurveTo(t,e,a,r,i,s)}};function zq(e){return new Vm(e)}function $q(e){return new aR(e)}function sR(e){this._context=e}sR.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var a=aT(e),s=aT(t),i=0,l=1;l<r;++i,++l)this._context.bezierCurveTo(a[0][i],s[0][i],a[1][i],s[1][i],e[l],t[l]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function aT(e){var t,r=e.length-1,a,s=new Array(r),i=new Array(r),l=new Array(r);for(s[0]=0,i[0]=2,l[0]=e[0]+2*e[1],t=1;t<r-1;++t)s[t]=1,i[t]=4,l[t]=4*e[t]+2*e[t+1];for(s[r-1]=2,i[r-1]=7,l[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)a=s[t]/i[t-1],i[t]-=a,l[t]-=a*l[t-1];for(s[r-1]=l[r-1]/i[r-1],t=r-2;t>=0;--t)s[t]=(l[t]-s[t+1])/i[t];for(i[r-1]=(e[r]+s[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-s[t+1];return[s,i]}function Vq(e){return new sR(e)}function mb(e,t){this._context=e,this._t=t}mb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Gq(e){return new mb(e,.5)}function Kq(e){return new mb(e,0)}function qq(e){return new mb(e,1)}function Pd(e,t){if((l=e.length)>1)for(var r=1,a,s,i=e[t[0]],l,o=i.length;r<l;++r)for(s=i,i=e[t[r]],a=0;a<o;++a)i[a][1]+=i[a][0]=isNaN(s[a][1])?s[a][0]:s[a][1]}function gN(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function Wq(e,t){return e[t]}function Yq(e){const t=[];return t.key=e,t}function Xq(){var e=ia([]),t=gN,r=Pd,a=Wq;function s(i){var l=Array.from(e.apply(this,arguments),Yq),o,d=l.length,u=-1,f;for(const p of i)for(o=0,++u;o<d;++o)(l[o][u]=[0,+a(p,l[o].key,u,i)]).data=p;for(o=0,f=pk(t(l));o<d;++o)l[f[o]].index=o;return r(l,f),l}return s.keys=function(i){return arguments.length?(e=typeof i=="function"?i:ia(Array.from(i)),s):e},s.value=function(i){return arguments.length?(a=typeof i=="function"?i:ia(+i),s):a},s.order=function(i){return arguments.length?(t=i==null?gN:typeof i=="function"?i:ia(Array.from(i)),s):t},s.offset=function(i){return arguments.length?(r=i??Pd,s):r},s}function Jq(e,t){if((a=e.length)>0){for(var r,a,s=0,i=e[0].length,l;s<i;++s){for(l=r=0;r<a;++r)l+=e[r][s][1]||0;if(l)for(r=0;r<a;++r)e[r][s][1]/=l}Pd(e,t)}}function Zq(e,t){if((s=e.length)>0){for(var r=0,a=e[t[0]],s,i=a.length;r<i;++r){for(var l=0,o=0;l<s;++l)o+=e[l][r][1]||0;a[r][1]+=a[r][0]=-o/2}Pd(e,t)}}function eW(e,t){if(!(!((l=e.length)>0)||!((i=(s=e[t[0]]).length)>0))){for(var r=0,a=1,s,i,l;a<i;++a){for(var o=0,d=0,u=0;o<l;++o){for(var f=e[t[o]],p=f[a][1]||0,h=f[a-1][1]||0,m=(p-h)/2,b=0;b<o;++b){var v=e[t[b]],y=v[a][1]||0,j=v[a-1][1]||0;m+=y-j}d+=p,u+=m*p}s[a-1][1]+=s[a-1][0]=r,d&&(r-=u/d)}s[a-1][1]+=s[a-1][0]=r,Pd(e,t)}}var zy={},$y={},nT;function tW(){return nT||(nT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t})($y)),$y}var Vy={},sT;function iR(){return sT||(sT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){switch(typeof r){case"number":case"symbol":return!1;case"string":return r.includes(".")||r.includes("[")||r.includes("]")}}e.isDeepKey=t})(Vy)),Vy}var Gy={},iT;function xk(){return iT||(iT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var a;return typeof r=="string"||typeof r=="symbol"?r:Object.is((a=r==null?void 0:r.valueOf)==null?void 0:a.call(r),-0)?"-0":String(r)}e.toKey=t})(Gy)),Gy}var Ky={},qy={},lT;function rW(){return lT||(lT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(r==null)return"";if(typeof r=="string")return r;if(Array.isArray(r))return r.map(t).join(",");const a=String(r);return a==="0"&&Object.is(Number(r),-0)?"-0":a}e.toString=t})(qy)),qy}var oT;function hk(){return oT||(oT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rW(),r=xk();function a(s){if(Array.isArray(s))return s.map(r.toKey);if(typeof s=="symbol")return[s];s=t.toString(s);const i=[],l=s.length;if(l===0)return i;let o=0,d="",u="",f=!1;for(s.charCodeAt(0)===46&&(i.push(""),o++);o<l;){const p=s[o];u?p==="\\"&&o+1<l?(o++,d+=s[o]):p===u?u="":d+=p:f?p==='"'||p==="'"?u=p:p==="]"?(f=!1,i.push(d),d=""):d+=p:p==="["?(f=!0,d&&(i.push(d),d="")):p==="."?d&&(i.push(d),d=""):d+=p,o++}return d&&i.push(d),i}e.toPath=a})(Ky)),Ky}var cT;function mk(){return cT||(cT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tW(),r=iR(),a=xk(),s=hk();function i(o,d,u){if(o==null)return u;switch(typeof d){case"string":{if(t.isUnsafeProperty(d))return u;const f=o[d];return f===void 0?r.isDeepKey(d)?i(o,s.toPath(d),u):u:f}case"number":case"symbol":{typeof d=="number"&&(d=a.toKey(d));const f=o[d];return f===void 0?u:f}default:{if(Array.isArray(d))return l(o,d,u);if(Object.is(d==null?void 0:d.valueOf(),-0)?d="-0":d=String(d),t.isUnsafeProperty(d))return u;const f=o[d];return f===void 0?u:f}}}function l(o,d,u){if(d.length===0)return u;let f=o;for(let p=0;p<d.length;p++){if(f==null||t.isUnsafeProperty(d[p]))return u;f=f[d[p]]}return f===void 0?u:f}e.get=i})(zy)),zy}var Wy,dT;function aW(){return dT||(dT=1,Wy=mk().get),Wy}var nW=aW();const gb=Sl(nW);var sW=4;function bc(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sW,r=10**t,a=Math.round(e*r)/r;return Object.is(a,-0)?0:a}function mn(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];return e.reduce((s,i,l)=>{var o=r[l-1];return typeof o=="string"?s+o+i:o!==void 0?s+bc(o)+i:s+i},"")}var xi=e=>e===0?0:e>0?1:-1,Cl=e=>typeof e=="number"&&e!=+e,Ld=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,At=e=>(typeof e=="number"||e instanceof Number)&&!Cl(e),kl=e=>At(e)||typeof e=="string",iW=0,Jf=e=>{var t=++iW;return"".concat(e||"").concat(t)},Fc=function(t,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!At(t)&&typeof t!="string")return a;var i;if(Ld(t)){if(r==null)return a;var l=t.indexOf("%");i=r*parseFloat(t.slice(0,l))/100}else i=+t;return Cl(i)&&(i=a),s&&r!=null&&i>r&&(i=r),i},lR=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},a=0;a<t;a++)if(!r[String(e[a])])r[String(e[a])]=!0;else return!0;return!1};function pl(e,t,r){return At(e)&&At(t)?bc(e+r*(t-e)):t}function oR(e,t,r){if(!(!e||!e.length))return e.find(a=>a&&(typeof t=="function"?t(a):gb(a,t))===r)}var Qn=e=>e===null||typeof e>"u",gk=e=>Qn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function xs(e){return e!=null}function HA(){}var cR=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,bk=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(k.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var a={};return Object.keys(r).forEach(s=>{fk(s)&&(a[s]=(i=>r[s](r,i)))}),a},lW=(e,t,r)=>a=>(e(t,r,a),null),oW=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var a=null;return Object.keys(e).forEach(s=>{var i=e[s];fk(s)&&typeof i=="function"&&(a||(a={}),a[s]=lW(i,t,r))}),a};function uT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function cW(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uT(Object(r),!0).forEach(function(a){dW(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uT(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function dW(e,t,r){return(t=uW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uW(e){var t=AW(e,"string");return typeof t=="symbol"?t:t+""}function AW(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ks(e,t){var r=cW({},e),a=t,s=Object.keys(t),i=s.reduce((l,o)=>(l[o]===void 0&&a[o]!==void 0&&(l[o]=a[o]),l),r);return i}var Yy={},Xy={},AT;function fW(){return AT||(AT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,a){const s=new Map;for(let i=0;i<r.length;i++){const l=r[i],o=a(l,i,r);s.has(o)||s.set(o,l)}return Array.from(s.values())}e.uniqBy=t})(Xy)),Xy}var Jy={},fT;function pW(){return fT||(fT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,a){return function(...s){return r.apply(this,s.slice(0,a))}}e.ary=t})(Jy)),Jy}var Zy={},pT;function dR(){return pT||(pT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r}e.identity=t})(Zy)),Zy}var ew={},tw={},rw={},xT;function xW(){return xT||(xT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=t})(rw)),rw}var hT;function vk(){return hT||(hT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xW();function r(a){return a!=null&&typeof a!="function"&&t.isLength(a.length)}e.isArrayLike=r})(tw)),tw}var aw={},mT;function hW(){return mT||(mT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})(aw)),aw}var gT;function mW(){return gT||(gT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vk(),r=hW();function a(s){return r.isObjectLike(s)&&t.isArrayLike(s)}e.isArrayLikeObject=a})(ew)),ew}var nw={},sw={},bT;function gW(){return bT||(bT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mk();function r(a){return function(s){return t.get(s,a)}}e.property=r})(sw)),sw}var iw={},lw={},ow={},cw={},vT;function uR(){return vT||(vT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t})(cw)),cw}var dw={},yT;function AR(){return yT||(yT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t})(dw)),dw}var uw={},wT;function fR(){return wT||(wT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,a){return r===a||Number.isNaN(r)&&Number.isNaN(a)}e.isEqualsSameValueZero=t})(uw)),uw}var NT;function bW(){return NT||(NT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=uR(),r=AR(),a=fR();function s(f,p,h){return typeof h!="function"?s(f,p,()=>{}):i(f,p,function m(b,v,y,j,_,N){const E=h(b,v,y,j,_,N);return E!==void 0?!!E:i(b,v,m,N)},new Map)}function i(f,p,h,m){if(p===f)return!0;switch(typeof p){case"object":return l(f,p,h,m);case"function":return Object.keys(p).length>0?i(f,{...p},h,m):a.isEqualsSameValueZero(f,p);default:return t.isObject(f)?typeof p=="string"?p==="":!0:a.isEqualsSameValueZero(f,p)}}function l(f,p,h,m){if(p==null)return!0;if(Array.isArray(p))return d(f,p,h,m);if(p instanceof Map)return o(f,p,h,m);if(p instanceof Set)return u(f,p,h,m);const b=Object.keys(p);if(f==null||r.isPrimitive(f))return b.length===0;if(b.length===0)return!0;if(m!=null&&m.has(p))return m.get(p)===f;m==null||m.set(p,f);try{for(let v=0;v<b.length;v++){const y=b[v];if(!r.isPrimitive(f)&&!(y in f)||p[y]===void 0&&f[y]!==void 0||p[y]===null&&f[y]!==null||!h(f[y],p[y],y,f,p,m))return!1}return!0}finally{m==null||m.delete(p)}}function o(f,p,h,m){if(p.size===0)return!0;if(!(f instanceof Map))return!1;for(const[b,v]of p.entries()){const y=f.get(b);if(h(y,v,b,f,p,m)===!1)return!1}return!0}function d(f,p,h,m){if(p.length===0)return!0;if(!Array.isArray(f))return!1;const b=new Set;for(let v=0;v<p.length;v++){const y=p[v];let j=!1;for(let _=0;_<f.length;_++){if(b.has(_))continue;const N=f[_];let E=!1;if(h(N,y,v,f,p,m)&&(E=!0),E){b.add(_),j=!0;break}}if(!j)return!1}return!0}function u(f,p,h,m){return p.size===0?!0:f instanceof Set?d([...f],[...p],h,m):!1}e.isMatchWith=s,e.isSetMatch=u})(ow)),ow}var CT;function pR(){return CT||(CT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bW();function r(a,s){return t.isMatchWith(a,s,()=>{})}e.isMatch=r})(lw)),lw}var Aw={},fw={},pw={},kT;function vW(){return kT||(kT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Object.getOwnPropertySymbols(r).filter(a=>Object.prototype.propertyIsEnumerable.call(r,a))}e.getSymbols=t})(pw)),pw}var xw={},jT;function yk(){return jT||(jT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}e.getTag=t})(xw)),xw}var hw={},ET;function xR(){return ET||(ET=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",r="[object String]",a="[object Number]",s="[object Boolean]",i="[object Arguments]",l="[object Symbol]",o="[object Date]",d="[object Map]",u="[object Set]",f="[object Array]",p="[object Function]",h="[object ArrayBuffer]",m="[object Object]",b="[object Error]",v="[object DataView]",y="[object Uint8Array]",j="[object Uint8ClampedArray]",_="[object Uint16Array]",N="[object Uint32Array]",E="[object BigUint64Array]",T="[object Int8Array]",B="[object Int16Array]",F="[object Int32Array]",R="[object BigInt64Array]",U="[object Float32Array]",D="[object Float64Array]";e.argumentsTag=i,e.arrayBufferTag=h,e.arrayTag=f,e.bigInt64ArrayTag=R,e.bigUint64ArrayTag=E,e.booleanTag=s,e.dataViewTag=v,e.dateTag=o,e.errorTag=b,e.float32ArrayTag=U,e.float64ArrayTag=D,e.functionTag=p,e.int16ArrayTag=B,e.int32ArrayTag=F,e.int8ArrayTag=T,e.mapTag=d,e.numberTag=a,e.objectTag=m,e.regexpTag=t,e.setTag=u,e.stringTag=r,e.symbolTag=l,e.uint16ArrayTag=_,e.uint32ArrayTag=N,e.uint8ArrayTag=y,e.uint8ClampedArrayTag=j})(hw)),hw}var mw={},ST;function yW(){return ST||(ST=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t})(mw)),mw}var BT;function hR(){return BT||(BT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vW(),r=yk(),a=xR(),s=AR(),i=yW();function l(f,p){return o(f,void 0,f,new Map,p)}function o(f,p,h,m=new Map,b=void 0){const v=b==null?void 0:b(f,p,h,m);if(v!==void 0)return v;if(s.isPrimitive(f))return f;if(m.has(f))return m.get(f);if(Array.isArray(f)){const y=new Array(f.length);m.set(f,y);for(let j=0;j<f.length;j++)y[j]=o(f[j],j,h,m,b);return Object.hasOwn(f,"index")&&(y.index=f.index),Object.hasOwn(f,"input")&&(y.input=f.input),y}if(f instanceof Date)return new Date(f.getTime());if(f instanceof RegExp){const y=new RegExp(f.source,f.flags);return y.lastIndex=f.lastIndex,y}if(f instanceof Map){const y=new Map;m.set(f,y);for(const[j,_]of f)y.set(j,o(_,j,h,m,b));return y}if(f instanceof Set){const y=new Set;m.set(f,y);for(const j of f)y.add(o(j,void 0,h,m,b));return y}if(typeof Buffer<"u"&&Buffer.isBuffer(f))return f.subarray();if(i.isTypedArray(f)){const y=new(Object.getPrototypeOf(f)).constructor(f.length);m.set(f,y);for(let j=0;j<f.length;j++)y[j]=o(f[j],j,h,m,b);return y}if(f instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&f instanceof SharedArrayBuffer)return f.slice(0);if(f instanceof DataView){const y=new DataView(f.buffer.slice(0),f.byteOffset,f.byteLength);return m.set(f,y),d(y,f,h,m,b),y}if(typeof File<"u"&&f instanceof File){const y=new File([f],f.name,{type:f.type});return m.set(f,y),d(y,f,h,m,b),y}if(typeof Blob<"u"&&f instanceof Blob){const y=new Blob([f],{type:f.type});return m.set(f,y),d(y,f,h,m,b),y}if(f instanceof Error){const y=new f.constructor;return m.set(f,y),y.message=f.message,y.name=f.name,y.stack=f.stack,y.cause=f.cause,d(y,f,h,m,b),y}if(f instanceof Boolean){const y=new Boolean(f.valueOf());return m.set(f,y),d(y,f,h,m,b),y}if(f instanceof Number){const y=new Number(f.valueOf());return m.set(f,y),d(y,f,h,m,b),y}if(f instanceof String){const y=new String(f.valueOf());return m.set(f,y),d(y,f,h,m,b),y}if(typeof f=="object"&&u(f)){const y=Object.create(Object.getPrototypeOf(f));return m.set(f,y),d(y,f,h,m,b),y}return f}function d(f,p,h=f,m,b){const v=[...Object.keys(p),...t.getSymbols(p)];for(let y=0;y<v.length;y++){const j=v[y],_=Object.getOwnPropertyDescriptor(f,j);(_==null||_.writable)&&(f[j]=o(p[j],j,h,m,b))}}function u(f){switch(r.getTag(f)){case a.argumentsTag:case a.arrayTag:case a.arrayBufferTag:case a.dataViewTag:case a.booleanTag:case a.dateTag:case a.float32ArrayTag:case a.float64ArrayTag:case a.int8ArrayTag:case a.int16ArrayTag:case a.int32ArrayTag:case a.mapTag:case a.numberTag:case a.objectTag:case a.regexpTag:case a.setTag:case a.stringTag:case a.symbolTag:case a.uint8ArrayTag:case a.uint8ClampedArrayTag:case a.uint16ArrayTag:case a.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=l,e.cloneDeepWithImpl=o,e.copyProperties=d})(fw)),fw}var _T;function wW(){return _T||(_T=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hR();function r(a){return t.cloneDeepWithImpl(a,void 0,a,new Map,void 0)}e.cloneDeep=r})(Aw)),Aw}var TT;function NW(){return TT||(TT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pR(),r=wW();function a(s){return s=r.cloneDeep(s),i=>t.isMatch(i,s)}e.matches=a})(iw)),iw}var gw={},bw={},vw={},IT;function CW(){return IT||(IT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hR(),r=yk(),a=xR();function s(i,l){return t.cloneDeepWith(i,(o,d,u,f)=>{const p=l==null?void 0:l(o,d,u,f);if(p!==void 0)return p;if(typeof i=="object"){if(r.getTag(i)===a.objectTag&&typeof i.constructor!="function"){const h={};return f.set(i,h),t.copyProperties(h,i,u,f),h}switch(Object.prototype.toString.call(i)){case a.numberTag:case a.stringTag:case a.booleanTag:{const h=new i.constructor(i==null?void 0:i.valueOf());return t.copyProperties(h,i),h}case a.argumentsTag:{const h={};return t.copyProperties(h,i),h.length=i.length,h[Symbol.iterator]=i[Symbol.iterator],h}default:return}}})}e.cloneDeepWith=s})(vw)),vw}var FT;function kW(){return FT||(FT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=CW();function r(a){return t.cloneDeepWith(a)}e.cloneDeep=r})(bw)),bw}var yw={},ww={},DT;function mR(){return DT||(DT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function r(a,s=Number.MAX_SAFE_INTEGER){switch(typeof a){case"number":return Number.isInteger(a)&&a>=0&&a<s;case"symbol":return!1;case"string":return t.test(a)}}e.isIndex=r})(ww)),ww}var Nw={},UT;function jW(){return UT||(UT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=yk();function r(a){return a!==null&&typeof a=="object"&&t.getTag(a)==="[object Arguments]"}e.isArguments=r})(Nw)),Nw}var MT;function EW(){return MT||(MT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=iR(),r=mR(),a=jW(),s=hk();function i(l,o){let d;if(Array.isArray(o)?d=o:typeof o=="string"&&t.isDeepKey(o)&&(l==null?void 0:l[o])==null?d=s.toPath(o):d=[o],d.length===0)return!1;let u=l;for(let f=0;f<d.length;f++){const p=d[f];if((u==null||!Object.hasOwn(u,p))&&!((Array.isArray(u)||a.isArguments(u))&&r.isIndex(p)&&p<u.length))return!1;u=u[p]}return!0}e.has=i})(yw)),yw}var RT;function SW(){return RT||(RT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pR(),r=xk(),a=kW(),s=mk(),i=EW();function l(o,d){switch(typeof o){case"object":{Object.is(o==null?void 0:o.valueOf(),-0)&&(o="-0");break}case"number":{o=r.toKey(o);break}}return d=a.cloneDeep(d),function(u){const f=s.get(u,o);return f===void 0?i.has(u,o):d===void 0?f===void 0:t.isMatch(f,d)}}e.matchesProperty=l})(gw)),gw}var OT;function BW(){return OT||(OT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=dR(),r=gW(),a=NW(),s=SW();function i(l){if(l==null)return t.identity;switch(typeof l){case"function":return l;case"object":return Array.isArray(l)&&l.length===2?s.matchesProperty(l[0],l[1]):a.matches(l);case"string":case"symbol":case"number":return r.property(l)}}e.iteratee=i})(nw)),nw}var PT;function _W(){return PT||(PT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fW(),r=pW(),a=dR(),s=mW(),i=BW();function l(o,d=a.identity){return s.isArrayLikeObject(o)?t.uniqBy(Array.from(o),r.ary(i.iteratee(d),1)):[]}e.uniqBy=l})(Yy)),Yy}var Cw,LT;function TW(){return LT||(LT=1,Cw=_W().uniqBy),Cw}var IW=TW();const QT=Sl(IW);function FW(e,t,r){return t===!0?QT(e,r):typeof t=="function"?QT(e,t):e}var kw={exports:{}},jw={},Ew={exports:{}},Sw={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var HT;function DW(){if(HT)return Sw;HT=1;var e=OA();function t(p,h){return p===h&&(p!==0||1/p===1/h)||p!==p&&h!==h}var r=typeof Object.is=="function"?Object.is:t,a=e.useState,s=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function o(p,h){var m=h(),b=a({inst:{value:m,getSnapshot:h}}),v=b[0].inst,y=b[1];return i(function(){v.value=m,v.getSnapshot=h,d(v)&&y({inst:v})},[p,m,h]),s(function(){return d(v)&&y({inst:v}),p(function(){d(v)&&y({inst:v})})},[p]),l(m),m}function d(p){var h=p.getSnapshot;p=p.value;try{var m=h();return!r(p,m)}catch{return!0}}function u(p,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return Sw.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Sw}var zT;function UW(){return zT||(zT=1,Ew.exports=DW()),Ew.exports}/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var $T;function MW(){if($T)return jw;$T=1;var e=OA(),t=UW();function r(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var a=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,o=e.useMemo,d=e.useDebugValue;return jw.useSyncExternalStoreWithSelector=function(u,f,p,h,m){var b=i(null);if(b.current===null){var v={hasValue:!1,value:null};b.current=v}else v=b.current;b=o(function(){function j(B){if(!_){if(_=!0,N=B,B=h(B),m!==void 0&&v.hasValue){var F=v.value;if(m(F,B))return E=F}return E=B}if(F=E,a(N,B))return F;var R=h(B);return m!==void 0&&m(F,R)?(N=B,F):(N=B,E=R)}var _=!1,N,E,T=p===void 0?null:p;return[function(){return j(f())},T===null?void 0:function(){return j(T())}]},[f,p,h,m]);var y=s(u,b[0],b[1]);return l(function(){v.hasValue=!0,v.value=y},[y]),d(y),y},jw}var VT;function RW(){return VT||(VT=1,kw.exports=MW()),kw.exports}var OW=RW(),wk=k.createContext(null),PW=e=>e,an=()=>{var e=k.useContext(wk);return e?e.store.dispatch:PW},Em=()=>{},LW=()=>Em,QW=(e,t)=>e===t;function gt(e){var t=k.useContext(wk),r=k.useMemo(()=>t?a=>{if(a!=null)return e(a)}:Em,[t,e]);return OW.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:LW,t?t.store.getState:Em,t?t.store.getState:Em,r,QW)}function HW(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function zW(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function $W(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(a=>typeof a=="function"?`function ${a.name||"unnamed"}()`:typeof a).join(", ");throw new TypeError(`${t}[${r}]`)}}var GT=e=>Array.isArray(e)?e:[e];function VW(e){const t=Array.isArray(e[0])?e[0]:e;return $W(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function GW(e,t){const r=[],{length:a}=e;for(let s=0;s<a;s++)r.push(e[s].apply(null,t));return r}var KW=class{constructor(e){this.value=e}deref(){return this.value}},qW=typeof WeakRef<"u"?WeakRef:KW,WW=0,KT=1;function yh(){return{s:WW,v:void 0,o:null,p:null}}function gR(e,t={}){let r=yh();const{resultEqualityCheck:a}=t;let s,i=0;function l(){var p;let o=r;const{length:d}=arguments;for(let h=0,m=d;h<m;h++){const b=arguments[h];if(typeof b=="function"||typeof b=="object"&&b!==null){let v=o.o;v===null&&(o.o=v=new WeakMap);const y=v.get(b);y===void 0?(o=yh(),v.set(b,o)):o=y}else{let v=o.p;v===null&&(o.p=v=new Map);const y=v.get(b);y===void 0?(o=yh(),v.set(b,o)):o=y}}const u=o;let f;if(o.s===KT)f=o.v;else if(f=e.apply(null,arguments),i++,a){const h=((p=s==null?void 0:s.deref)==null?void 0:p.call(s))??s;h!=null&&a(h,f)&&(f=h,i!==0&&i--),s=typeof f=="object"&&f!==null||typeof f=="function"?new qW(f):f}return u.s=KT,u.v=f,f}return l.clearCache=()=>{r=yh(),l.resetResultsCount()},l.resultsCount=()=>i,l.resetResultsCount=()=>{i=0},l}function YW(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,a=(...s)=>{let i=0,l=0,o,d={},u=s.pop();typeof u=="object"&&(d=u,u=s.pop()),HW(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const f={...r,...d},{memoize:p,memoizeOptions:h=[],argsMemoize:m=gR,argsMemoizeOptions:b=[]}=f,v=GT(h),y=GT(b),j=VW(s),_=p(function(){return i++,u.apply(null,arguments)},...v),N=m(function(){l++;const T=GW(j,arguments);return o=_.apply(null,T),o},...y);return Object.assign(N,{resultFunc:u,memoizedResultFunc:_,dependencies:j,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>o,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:p,argsMemoize:m})};return Object.assign(a,{withTypes:()=>a}),a}var De=YW(gR),XW=Object.assign((e,t=De)=>{zW(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),a=r.map(i=>e[i]);return t(a,(...i)=>i.reduce((l,o,d)=>(l[r[d]]=o,l),{}))},{withTypes:()=>XW}),Bw={},_w={},Tw={},qT;function JW(){return qT||(qT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(a){return typeof a=="symbol"?1:a===null?2:a===void 0?3:a!==a?4:0}const r=(a,s,i)=>{if(a!==s){const l=t(a),o=t(s);if(l===o&&l===0){if(a<s)return i==="desc"?1:-1;if(a>s)return i==="desc"?-1:1}return i==="desc"?o-l:l-o}return 0};e.compareValues=r})(Tw)),Tw}var Iw={},Fw={},WT;function bR(){return WT||(WT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=t})(Fw)),Fw}var YT;function ZW(){return YT||(YT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bR(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function s(i,l){return Array.isArray(i)?!1:typeof i=="number"||typeof i=="boolean"||i==null||t.isSymbol(i)?!0:typeof i=="string"&&(a.test(i)||!r.test(i))||l!=null&&Object.hasOwn(l,i)}e.isKey=s})(Iw)),Iw}var XT;function eY(){return XT||(XT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=JW(),r=ZW(),a=hk();function s(i,l,o,d){if(i==null)return[];o=d?void 0:o,Array.isArray(i)||(i=Object.values(i)),Array.isArray(l)||(l=l==null?[null]:[l]),l.length===0&&(l=[null]),Array.isArray(o)||(o=o==null?[]:[o]),o=o.map(m=>String(m));const u=(m,b)=>{let v=m;for(let y=0;y<b.length&&v!=null;++y)v=v[b[y]];return v},f=(m,b)=>b==null||m==null?b:typeof m=="object"&&"key"in m?Object.hasOwn(b,m.key)?b[m.key]:u(b,m.path):typeof m=="function"?m(b):Array.isArray(m)?u(b,m):typeof b=="object"?b[m]:b,p=l.map(m=>(Array.isArray(m)&&m.length===1&&(m=m[0]),m==null||typeof m=="function"||Array.isArray(m)||r.isKey(m)?m:{key:m,path:a.toPath(m)}));return i.map(m=>({original:m,criteria:p.map(b=>f(b,m))})).slice().sort((m,b)=>{for(let v=0;v<p.length;v++){const y=t.compareValues(m.criteria[v],b.criteria[v],o[v]);if(y!==0)return y}return 0}).map(m=>m.original)}e.orderBy=s})(_w)),_w}var Dw={},JT;function tY(){return JT||(JT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,a=1){const s=[],i=Math.floor(a),l=(o,d)=>{for(let u=0;u<o.length;u++){const f=o[u];Array.isArray(f)&&d<i?l(f,d+1):s.push(f)}};return l(r,0),s}e.flatten=t})(Dw)),Dw}var Uw={},ZT;function vR(){return ZT||(ZT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mR(),r=vk(),a=uR(),s=fR();function i(l,o,d){return a.isObject(d)&&(typeof o=="number"&&r.isArrayLike(d)&&t.isIndex(o)&&o<d.length||typeof o=="string"&&o in d)?s.isEqualsSameValueZero(d[o],l):!1}e.isIterateeCall=i})(Uw)),Uw}var eI;function rY(){return eI||(eI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=eY(),r=tY(),a=vR();function s(i,...l){const o=l.length;return o>1&&a.isIterateeCall(i,l[0],l[1])?l=[]:o>2&&a.isIterateeCall(l[0],l[1],l[2])&&(l=[l[0]]),t.orderBy(i,r.flatten(l),["asc"])}e.sortBy=s})(Bw)),Bw}var Mw,tI;function aY(){return tI||(tI=1,Mw=rY().sortBy),Mw}var nY=aY();const bb=Sl(nY);var yR=e=>e.legend.settings,sY=e=>e.legend.size,iY=e=>e.legend.payload;De([iY,yR],(e,t)=>{var{itemSorter:r}=t,a=e.flat(1);return r?bb(a,r):a});var wh=1;function lY(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,r]=k.useState({height:0,left:0,top:0,width:0}),a=k.useCallback(s=>{if(s!=null){var i=s.getBoundingClientRect(),l={height:i.height,left:i.left,top:i.top,width:i.width};(Math.abs(l.height-t.height)>wh||Math.abs(l.left-t.left)>wh||Math.abs(l.top-t.top)>wh||Math.abs(l.width-t.width)>wh)&&r({height:l.height,left:l.left,top:l.top,width:l.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,a]}function hn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var oY=typeof Symbol=="function"&&Symbol.observable||"@@observable",rI=oY,Rw=()=>Math.random().toString(36).substring(7).split("").join("."),cY={INIT:`@@redux/INIT${Rw()}`,REPLACE:`@@redux/REPLACE${Rw()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Rw()}`},Gm=cY;function Nk(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function wR(e,t,r){if(typeof e!="function")throw new Error(hn(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(hn(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(hn(1));return r(wR)(e,t)}let a=e,s=t,i=new Map,l=i,o=0,d=!1;function u(){l===i&&(l=new Map,i.forEach((y,j)=>{l.set(j,y)}))}function f(){if(d)throw new Error(hn(3));return s}function p(y){if(typeof y!="function")throw new Error(hn(4));if(d)throw new Error(hn(5));let j=!0;u();const _=o++;return l.set(_,y),function(){if(j){if(d)throw new Error(hn(6));j=!1,u(),l.delete(_),i=null}}}function h(y){if(!Nk(y))throw new Error(hn(7));if(typeof y.type>"u")throw new Error(hn(8));if(typeof y.type!="string")throw new Error(hn(17));if(d)throw new Error(hn(9));try{d=!0,s=a(s,y)}finally{d=!1}return(i=l).forEach(_=>{_()}),y}function m(y){if(typeof y!="function")throw new Error(hn(10));a=y,h({type:Gm.REPLACE})}function b(){const y=p;return{subscribe(j){if(typeof j!="object"||j===null)throw new Error(hn(11));function _(){const E=j;E.next&&E.next(f())}return _(),{unsubscribe:y(_)}},[rI](){return this}}}return h({type:Gm.INIT}),{dispatch:h,subscribe:p,getState:f,replaceReducer:m,[rI]:b}}function dY(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Gm.INIT})>"u")throw new Error(hn(12));if(typeof r(void 0,{type:Gm.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(hn(13))})}function NR(e){const t=Object.keys(e),r={};for(let i=0;i<t.length;i++){const l=t[i];typeof e[l]=="function"&&(r[l]=e[l])}const a=Object.keys(r);let s;try{dY(r)}catch(i){s=i}return function(l={},o){if(s)throw s;let d=!1;const u={};for(let f=0;f<a.length;f++){const p=a[f],h=r[p],m=l[p],b=h(m,o);if(typeof b>"u")throw o&&o.type,new Error(hn(14));u[p]=b,d=d||b!==m}return d=d||a.length!==Object.keys(l).length,d?u:l}}function Km(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...a)=>t(r(...a)))}function uY(...e){return t=>(r,a)=>{const s=t(r,a);let i=()=>{throw new Error(hn(15))};const l={getState:s.getState,dispatch:(d,...u)=>i(d,...u)},o=e.map(d=>d(l));return i=Km(...o)(s.dispatch),{...s,dispatch:i}}}function CR(e){return Nk(e)&&"type"in e&&typeof e.type=="string"}var kR=Symbol.for("immer-nothing"),aI=Symbol.for("immer-draftable"),es=Symbol.for("immer-state");function Mi(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ps=Object,SA=Ps.getPrototypeOf,qm="constructor",vb="prototype",bN="configurable",Wm="enumerable",Sm="writable",Zf="value",mo=e=>!!e&&!!e[es];function Yi(e){var t;return e?jR(e)||wb(e)||!!e[aI]||!!((t=e[qm])!=null&&t[aI])||Nb(e)||Cb(e):!1}var AY=Ps[vb][qm].toString(),nI=new WeakMap;function jR(e){if(!e||!Ck(e))return!1;const t=SA(e);if(t===null||t===Ps[vb])return!0;const r=Ps.hasOwnProperty.call(t,qm)&&t[qm];if(r===Object)return!0;if(!sA(r))return!1;let a=nI.get(r);return a===void 0&&(a=Function.toString.call(r),nI.set(r,a)),a===AY}function yb(e,t,r=!0){Mp(e)===0?(r?Reflect.ownKeys(e):Ps.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((a,s)=>t(s,a,e))}function Mp(e){const t=e[es];return t?t.type_:wb(e)?1:Nb(e)?2:Cb(e)?3:0}var sI=(e,t,r=Mp(e))=>r===2?e.has(t):Ps[vb].hasOwnProperty.call(e,t),vN=(e,t,r=Mp(e))=>r===2?e.get(t):e[t],Ym=(e,t,r,a=Mp(e))=>{a===2?e.set(t,r):a===3?e.add(r):e[t]=r};function fY(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var wb=Array.isArray,Nb=e=>e instanceof Map,Cb=e=>e instanceof Set,Ck=e=>typeof e=="object",sA=e=>typeof e=="function",Ow=e=>typeof e=="boolean";function pY(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ao=e=>e.copy_||e.base_,kk=e=>e.modified_?e.copy_:e.base_;function yN(e,t){if(Nb(e))return new Map(e);if(Cb(e))return new Set(e);if(wb(e))return Array[vb].slice.call(e);const r=jR(e);if(t===!0||t==="class_only"&&!r){const a=Ps.getOwnPropertyDescriptors(e);delete a[es];let s=Reflect.ownKeys(a);for(let i=0;i<s.length;i++){const l=s[i],o=a[l];o[Sm]===!1&&(o[Sm]=!0,o[bN]=!0),(o.get||o.set)&&(a[l]={[bN]:!0,[Sm]:!0,[Wm]:o[Wm],[Zf]:e[l]})}return Ps.create(SA(e),a)}else{const a=SA(e);if(a!==null&&r)return{...e};const s=Ps.create(a);return Ps.assign(s,e)}}function jk(e,t=!1){return kb(e)||mo(e)||!Yi(e)||(Mp(e)>1&&Ps.defineProperties(e,{set:Nh,add:Nh,clear:Nh,delete:Nh}),Ps.freeze(e),t&&yb(e,(r,a)=>{jk(a,!0)},!1)),e}function xY(){Mi(2)}var Nh={[Zf]:xY};function kb(e){return e===null||!Ck(e)?!0:Ps.isFrozen(e)}var Xm="MapSet",wN="Patches",iI="ArrayMethods",ER={};function Qd(e){const t=ER[e];return t||Mi(0,e),t}var lI=e=>!!ER[e],ep,SR=()=>ep,hY=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:lI(Xm)?Qd(Xm):void 0,arrayMethodsPlugin_:lI(iI)?Qd(iI):void 0});function oI(e,t){t&&(e.patchPlugin_=Qd(wN),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function NN(e){CN(e),e.drafts_.forEach(mY),e.drafts_=null}function CN(e){e===ep&&(ep=e.parent_)}var cI=e=>ep=hY(ep,e);function mY(e){const t=e[es];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function dI(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[es].modified_&&(NN(t),Mi(4)),Yi(e)&&(e=uI(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(r[es].base_,e,t)}else e=uI(t,r);return gY(t,e,!0),NN(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==kR?e:void 0}function uI(e,t){if(kb(t))return t;const r=t[es];if(!r)return Jm(t,e.handledSet_,e);if(!jb(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:a}=r;if(a)for(;a.length>0;)a.pop()(e);TR(r,e)}return r.copy_}function gY(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&jk(t,r)}function BR(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var jb=(e,t)=>e.scope_===t,bY=[];function _R(e,t,r,a){const s=ao(e),i=e.type_;if(a!==void 0&&vN(s,a,i)===t){Ym(s,a,r,i);return}if(!e.draftLocations_){const o=e.draftLocations_=new Map;yb(s,(d,u)=>{if(mo(u)){const f=o.get(u)||[];f.push(d),o.set(u,f)}})}const l=e.draftLocations_.get(t)??bY;for(const o of l)Ym(s,o,r,i)}function vY(e,t,r){e.callbacks_.push(function(s){var o;const i=t;if(!i||!jb(i,s))return;(o=s.mapSetPlugin_)==null||o.fixSetContents(i);const l=kk(i);_R(e,i.draft_??i,l,r),TR(i,s)})}function TR(e,t){var a;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((a=e.assigned_)==null?void 0:a.size)??0)>0)){const{patchPlugin_:s}=t;if(s){const i=s.getPath(e);i&&s.generatePatches_(e,i,t)}BR(e)}}function yY(e,t,r){const{scope_:a}=e;if(mo(r)){const s=r[es];jb(s,a)&&s.callbacks_.push(function(){Bm(e);const l=kk(s);_R(e,r,l,t)})}else Yi(r)&&e.callbacks_.push(function(){const i=ao(e);e.type_===3?i.has(r)&&Jm(r,a.handledSet_,a):vN(i,t,e.type_)===r&&a.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Jm(vN(e.copy_,t,e.type_),a.handledSet_,a)})}function Jm(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||mo(e)||t.has(e)||!Yi(e)||kb(e)||(t.add(e),yb(e,(a,s)=>{if(mo(s)){const i=s[es];if(jb(i,r)){const l=kk(i);Ym(e,a,l,e.type_),BR(i)}}else Yi(s)&&Jm(s,t,r)})),e}function wY(e,t){const r=wb(e),a={type_:r?1:0,scope_:t?t.scope_:SR(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let s=a,i=Zm;r&&(s=[a],i=tp);const{revoke:l,proxy:o}=Proxy.revocable(s,i);return a.draft_=o,a.revoke_=l,[o,a]}var Zm={get(e,t){if(t===es)return e;let r=e.scope_.arrayMethodsPlugin_;const a=e.type_===1&&typeof t=="string";if(a&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const s=ao(e);if(!sI(s,t,e.type_))return NY(e,s,t);const i=s[t];if(e.finalized_||!Yi(i)||a&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&pY(t))return i;if(i===Pw(e.base_,t)){Bm(e);const l=e.type_===1?+t:t,o=jN(e.scope_,i,e,l);return e.copy_[l]=o}return i},has(e,t){return t in ao(e)},ownKeys(e){return Reflect.ownKeys(ao(e))},set(e,t,r){const a=IR(ao(e),t);if(a!=null&&a.set)return a.set.call(e.draft_,r),!0;if(!e.modified_){const s=Pw(ao(e),t),i=s==null?void 0:s[es];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(fY(r,s)&&(r!==void 0||sI(e.base_,t,e.type_)))return!0;Bm(e),kN(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),yY(e,t,r)),!0},deleteProperty(e,t){return Bm(e),Pw(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),kN(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ao(e),a=Reflect.getOwnPropertyDescriptor(r,t);return a&&{[Sm]:!0,[bN]:e.type_!==1||t!=="length",[Wm]:a[Wm],[Zf]:r[t]}},defineProperty(){Mi(11)},getPrototypeOf(e){return SA(e.base_)},setPrototypeOf(){Mi(12)}},tp={};for(let e in Zm){let t=Zm[e];tp[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}tp.deleteProperty=function(e,t){return tp.set.call(this,e,t,void 0)};tp.set=function(e,t,r){return Zm.set.call(this,e[0],t,r,e[0])};function Pw(e,t){const r=e[es];return(r?ao(r):e)[t]}function NY(e,t,r){var s;const a=IR(t,r);return a?Zf in a?a[Zf]:(s=a.get)==null?void 0:s.call(e.draft_):void 0}function IR(e,t){if(!(t in e))return;let r=SA(e);for(;r;){const a=Object.getOwnPropertyDescriptor(r,t);if(a)return a;r=SA(r)}}function kN(e){e.modified_||(e.modified_=!0,e.parent_&&kN(e.parent_))}function Bm(e){e.copy_||(e.assigned_=new Map,e.copy_=yN(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var CY=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,a,s)=>{if(sA(r)&&!sA(a)){const l=a;a=r;const o=this;return function(u=l,...f){return o.produce(u,p=>a.call(this,p,...f))}}sA(a)||Mi(6),s!==void 0&&!sA(s)&&Mi(7);let i;if(Yi(r)){const l=cI(this),o=jN(l,r,void 0);let d=!0;try{i=a(o),d=!1}finally{d?NN(l):CN(l)}return oI(l,s),dI(i,l)}else if(!r||!Ck(r)){if(i=a(r),i===void 0&&(i=r),i===kR&&(i=void 0),this.autoFreeze_&&jk(i,!0),s){const l=[],o=[];Qd(wN).generateReplacementPatches_(r,i,{patches_:l,inversePatches_:o}),s(l,o)}return i}else Mi(1,r)},this.produceWithPatches=(r,a)=>{if(sA(r))return(o,...d)=>this.produceWithPatches(o,u=>r(u,...d));let s,i;return[this.produce(r,a,(o,d)=>{s=o,i=d}),s,i]},Ow(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Ow(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Ow(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Yi(t)||Mi(8),mo(t)&&(t=Hi(t));const r=cI(this),a=jN(r,t,void 0);return a[es].isManual_=!0,CN(r),a}finishDraft(t,r){const a=t&&t[es];(!a||!a.isManual_)&&Mi(9);const{scope_:s}=a;return oI(s,r),dI(void 0,s)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,r){let a;for(a=r.length-1;a>=0;a--){const i=r[a];if(i.path.length===0&&i.op==="replace"){t=i.value;break}}a>-1&&(r=r.slice(a+1));const s=Qd(wN).applyPatches_;return mo(t)?s(t,r):this.produce(t,i=>s(i,r))}};function jN(e,t,r,a){const[s,i]=Nb(t)?Qd(Xm).proxyMap_(t,r):Cb(t)?Qd(Xm).proxySet_(t,r):wY(t,r);return((r==null?void 0:r.scope_)??SR()).drafts_.push(s),i.callbacks_=(r==null?void 0:r.callbacks_)??[],i.key_=a,r&&a!==void 0?vY(r,i,a):i.callbacks_.push(function(d){var f;(f=d.mapSetPlugin_)==null||f.fixSetContents(i);const{patchPlugin_:u}=d;i.modified_&&u&&u.generatePatches_(i,[],d)}),s}function Hi(e){return mo(e)||Mi(10,e),FR(e)}function FR(e){if(!Yi(e)||kb(e))return e;const t=e[es];let r,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=yN(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else r=yN(e,!0);return yb(r,(s,i)=>{Ym(r,s,FR(i))},a),t&&(t.finalized_=!1),r}var kY=new CY,DR=kY.produce;function UR(e){return({dispatch:r,getState:a})=>s=>i=>typeof i=="function"?i(r,a,e):s(i)}var jY=UR(),EY=UR,SY=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Km:Km.apply(null,arguments)};function Ni(e,t){function r(...a){if(t){let s=t(...a);if(!s)throw new Error(Qs(0));return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:a[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=a=>CR(a)&&a.type===e,r}var MR=class gf extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,gf.prototype)}static get[Symbol.species](){return gf}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new gf(...t[0].concat(this)):new gf(...t.concat(this))}};function AI(e){return Yi(e)?DR(e,()=>{}):e}function Ch(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function BY(e){return typeof e=="boolean"}var _Y=()=>function(t){const{thunk:r=!0,immutableCheck:a=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=t??{};let l=new MR;return r&&(BY(r)?l.push(jY):l.push(EY(r.extraArgument))),l},RR="RTK_autoBatch",Gr=()=>e=>({payload:e,meta:{[RR]:!0}}),fI=e=>t=>{setTimeout(t,e)},OR=(e={type:"raf"})=>t=>(...r)=>{const a=t(...r);let s=!0,i=!1,l=!1;const o=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:fI(10):e.type==="callback"?e.queueNotification:fI(e.timeout),u=()=>{l=!1,i&&(i=!1,o.forEach(f=>f()))};return Object.assign({},a,{subscribe(f){const p=()=>s&&f(),h=a.subscribe(p);return o.add(f),()=>{h(),o.delete(f)}},dispatch(f){var p;try{return s=!((p=f==null?void 0:f.meta)!=null&&p[RR]),i=!s,i&&(l||(l=!0,d(u))),a.dispatch(f)}finally{s=!0}}})},TY=e=>function(r){const{autoBatch:a=!0}=r??{};let s=new MR(e);return a&&s.push(OR(typeof a=="object"?a:void 0)),s};function IY(e){const t=_Y(),{reducer:r=void 0,middleware:a,devTools:s=!0,preloadedState:i=void 0,enhancers:l=void 0}=e||{};let o;if(typeof r=="function")o=r;else if(Nk(r))o=NR(r);else throw new Error(Qs(1));let d;typeof a=="function"?d=a(t):d=t();let u=Km;s&&(u=SY({trace:!1,...typeof s=="object"&&s}));const f=uY(...d),p=TY(f);let h=typeof l=="function"?l(p):p();const m=u(...h);return wR(o,i,m)}function PR(e){const t={},r=[];let a;const s={addCase(i,l){const o=typeof i=="string"?i:i.type;if(!o)throw new Error(Qs(28));if(o in t)throw new Error(Qs(29));return t[o]=l,s},addAsyncThunk(i,l){return l.pending&&(t[i.pending.type]=l.pending),l.rejected&&(t[i.rejected.type]=l.rejected),l.fulfilled&&(t[i.fulfilled.type]=l.fulfilled),l.settled&&r.push({matcher:i.settled,reducer:l.settled}),s},addMatcher(i,l){return r.push({matcher:i,reducer:l}),s},addDefaultCase(i){return a=i,s}};return e(s),[t,r,a]}function FY(e){return typeof e=="function"}function DY(e,t){let[r,a,s]=PR(t),i;if(FY(e))i=()=>AI(e());else{const o=AI(e);i=()=>o}function l(o=i(),d){let u=[r[d.type],...a.filter(({matcher:f})=>f(d)).map(({reducer:f})=>f)];return u.filter(f=>!!f).length===0&&(u=[s]),u.reduce((f,p)=>{if(p)if(mo(f)){const m=p(f,d);return m===void 0?f:m}else{if(Yi(f))return DR(f,h=>p(h,d));{const h=p(f,d);if(h===void 0){if(f===null)return f;throw Error("A case reducer on a non-draftable value must not return undefined")}return h}}return f},o)}return l.getInitialState=i,l}var UY="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",MY=(e=21)=>{let t="",r=e;for(;r--;)t+=UY[Math.random()*64|0];return t},RY=Symbol.for("rtk-slice-createasyncthunk");function OY(e,t){return`${e}/${t}`}function PY({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[RY];return function(s){const{name:i,reducerPath:l=i}=s;if(!i)throw new Error(Qs(11));const o=(typeof s.reducers=="function"?s.reducers(QY()):s.reducers)||{},d=Object.keys(o),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(E,T){const B=typeof E=="string"?E:E.type;if(!B)throw new Error(Qs(12));if(B in u.sliceCaseReducersByType)throw new Error(Qs(13));return u.sliceCaseReducersByType[B]=T,f},addMatcher(E,T){return u.sliceMatchers.push({matcher:E,reducer:T}),f},exposeAction(E,T){return u.actionCreators[E]=T,f},exposeCaseReducer(E,T){return u.sliceCaseReducersByName[E]=T,f}};d.forEach(E=>{const T=o[E],B={reducerName:E,type:OY(i,E),createNotation:typeof s.reducers=="function"};zY(T)?VY(B,T,f,t):HY(B,T,f)});function p(){const[E={},T=[],B=void 0]=typeof s.extraReducers=="function"?PR(s.extraReducers):[s.extraReducers],F={...E,...u.sliceCaseReducersByType};return DY(s.initialState,R=>{for(let U in F)R.addCase(U,F[U]);for(let U of u.sliceMatchers)R.addMatcher(U.matcher,U.reducer);for(let U of T)R.addMatcher(U.matcher,U.reducer);B&&R.addDefaultCase(B)})}const h=E=>E,m=new Map,b=new WeakMap;let v;function y(E,T){return v||(v=p()),v(E,T)}function j(){return v||(v=p()),v.getInitialState()}function _(E,T=!1){function B(R){let U=R[E];return typeof U>"u"&&T&&(U=Ch(b,B,j)),U}function F(R=h){const U=Ch(m,T,()=>new WeakMap);return Ch(U,R,()=>{const D={};for(const[L,P]of Object.entries(s.selectors??{}))D[L]=LY(P,R,()=>Ch(b,R,j),T);return D})}return{reducerPath:E,getSelectors:F,get selectors(){return F(B)},selectSlice:B}}const N={name:i,reducer:y,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:j,..._(l),injectInto(E,{reducerPath:T,...B}={}){const F=T??l;return E.inject({reducerPath:F,reducer:y},B),{...N,..._(F,!0)}}};return N}}function LY(e,t,r,a){function s(i,...l){let o=t(i);return typeof o>"u"&&a&&(o=r()),e(o,...l)}return s.unwrapped=e,s}var ws=PY();function QY(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function HY({type:e,reducerName:t,createNotation:r},a,s){let i,l;if("reducer"in a){if(r&&!$Y(a))throw new Error(Qs(17));i=a.reducer,l=a.prepare}else i=a;s.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,l?Ni(e,l):Ni(e))}function zY(e){return e._reducerDefinitionType==="asyncThunk"}function $Y(e){return e._reducerDefinitionType==="reducerWithPrepare"}function VY({type:e,reducerName:t},r,a,s){if(!s)throw new Error(Qs(18));const{payloadCreator:i,fulfilled:l,pending:o,rejected:d,settled:u,options:f}=r,p=s(e,i,f);a.exposeAction(t,p),l&&a.addCase(p.fulfilled,l),o&&a.addCase(p.pending,o),d&&a.addCase(p.rejected,d),u&&a.addMatcher(p.settled,u),a.exposeCaseReducer(t,{fulfilled:l||kh,pending:o||kh,rejected:d||kh,settled:u||kh})}function kh(){}var GY="task",LR="listener",QR="completed",Ek="cancelled",KY=`task-${Ek}`,qY=`task-${QR}`,EN=`${LR}-${Ek}`,WY=`${LR}-${QR}`,Eb=class{constructor(e){Dy(this,"name","TaskAbortError");Dy(this,"message");this.code=e,this.message=`${GY} ${Ek} (reason: ${e})`}},Sk=(e,t)=>{if(typeof e!="function")throw new TypeError(Qs(32))},eg=()=>{},HR=(e,t=eg)=>(e.catch(t),e),zR=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ed=e=>{if(e.aborted)throw new Eb(e.reason)};function $R(e,t){let r=eg;return new Promise((a,s)=>{const i=()=>s(new Eb(e.reason));if(e.aborted){i();return}r=zR(e,i),t.finally(()=>r()).then(a,s)}).finally(()=>{r=eg})}var YY=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof Eb?"cancelled":"rejected",error:r}}finally{t==null||t()}},tg=e=>t=>HR($R(e,t).then(r=>(Ed(e),r))),VR=e=>{const t=tg(e);return r=>t(new Promise(a=>setTimeout(a,r)))},{assign:mA}=Object,pI={},Sb="listenerMiddleware",XY=(e,t)=>{const r=a=>zR(e,()=>a.abort(e.reason));return(a,s)=>{Sk(a);const i=new AbortController;r(i);const l=YY(async()=>{Ed(e),Ed(i.signal);const o=await a({pause:tg(i.signal),delay:VR(i.signal),signal:i.signal});return Ed(i.signal),o},()=>i.abort(qY));return s!=null&&s.autoJoin&&t.push(l.catch(eg)),{result:tg(e)(l),cancel(){i.abort(KY)}}}},JY=(e,t)=>{const r=async(a,s)=>{Ed(t);let i=()=>{};const o=[new Promise((d,u)=>{let f=e({predicate:a,effect:(p,h)=>{h.unsubscribe(),d([p,h.getState(),h.getOriginalState()])}});i=()=>{f(),u()}})];s!=null&&o.push(new Promise(d=>setTimeout(d,s,null)));try{const d=await $R(t,Promise.race(o));return Ed(t),d}finally{i()}};return(a,s)=>HR(r(a,s))},GR=e=>{let{type:t,actionCreator:r,matcher:a,predicate:s,effect:i}=e;if(t)s=Ni(t).match;else if(r)t=r.type,s=r.match;else if(a)s=a;else if(!s)throw new Error(Qs(21));return Sk(i),{predicate:s,type:t,effect:i}},KR=mA(e=>{const{type:t,predicate:r,effect:a}=GR(e);return{id:MY(),effect:a,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Qs(22))}}},{withTypes:()=>KR}),xI=(e,t)=>{const{type:r,effect:a,predicate:s}=GR(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===s)&&i.effect===a)},SN=e=>{e.pending.forEach(t=>{t.abort(EN)})},ZY=(e,t)=>()=>{for(const r of t.keys())SN(r);e.clear()},hI=(e,t,r)=>{try{e(t,r)}catch(a){setTimeout(()=>{throw a},0)}},qR=mA(Ni(`${Sb}/add`),{withTypes:()=>qR}),eX=Ni(`${Sb}/removeAll`),WR=mA(Ni(`${Sb}/remove`),{withTypes:()=>WR}),tX=(...e)=>{console.error(`${Sb}/error`,...e)},Rp=(e={})=>{const t=new Map,r=new Map,a=m=>{const b=r.get(m)??0;r.set(m,b+1)},s=m=>{const b=r.get(m)??1;b===1?r.delete(m):r.set(m,b-1)},{extra:i,onError:l=tX}=e;Sk(l);const o=m=>(m.unsubscribe=()=>t.delete(m.id),t.set(m.id,m),b=>{m.unsubscribe(),b!=null&&b.cancelActive&&SN(m)}),d=m=>{const b=xI(t,m)??KR(m);return o(b)};mA(d,{withTypes:()=>d});const u=m=>{const b=xI(t,m);return b&&(b.unsubscribe(),m.cancelActive&&SN(b)),!!b};mA(u,{withTypes:()=>u});const f=async(m,b,v,y)=>{const j=new AbortController,_=JY(d,j.signal),N=[];try{m.pending.add(j),a(m),await Promise.resolve(m.effect(b,mA({},v,{getOriginalState:y,condition:(E,T)=>_(E,T).then(Boolean),take:_,delay:VR(j.signal),pause:tg(j.signal),extra:i,signal:j.signal,fork:XY(j.signal,N),unsubscribe:m.unsubscribe,subscribe:()=>{t.set(m.id,m)},cancelActiveListeners:()=>{m.pending.forEach((E,T,B)=>{E!==j&&(E.abort(EN),B.delete(E))})},cancel:()=>{j.abort(EN),m.pending.delete(j)},throwIfCancelled:()=>{Ed(j.signal)}})))}catch(E){E instanceof Eb||hI(l,E,{raisedBy:"effect"})}finally{await Promise.all(N),j.abort(WY),s(m),m.pending.delete(j)}},p=ZY(t,r);return{middleware:m=>b=>v=>{if(!CR(v))return b(v);if(qR.match(v))return d(v.payload);if(eX.match(v)){p();return}if(WR.match(v))return u(v.payload);let y=m.getState();const j=()=>{if(y===pI)throw new Error(Qs(23));return y};let _;try{if(_=b(v),t.size>0){const N=m.getState(),E=Array.from(t.values());for(const T of E){let B=!1;try{B=T.predicate(v,N,y)}catch(F){B=!1,hI(l,F,{raisedBy:"predicate"})}B&&f(T,v,m,j)}}}finally{y=pI}return _},startListening:d,stopListening:u,clearListeners:p}};function Qs(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var rX={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},YR=ws({name:"chartLayout",initialState:rX,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,a,s,i;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(a=t.payload.right)!==null&&a!==void 0?a:0,e.margin.bottom=(s=t.payload.bottom)!==null&&s!==void 0?s:0,e.margin.left=(i=t.payload.left)!==null&&i!==void 0?i:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:aX,setLayout:nX,setChartSize:sX,setScale:iX}=YR.actions,lX=YR.reducer;function XR(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function Vt(e){return Number.isFinite(e)}function jl(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function mI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function dA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mI(Object(r),!0).forEach(function(a){oX(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function oX(e,t,r){return(t=cX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cX(e){var t=dX(e,"string");return typeof t=="symbol"?t:t+""}function dX(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cn(e,t,r){return Qn(e)||Qn(t)?r:kl(t)?gb(e,t,r):typeof t=="function"?t(e):r}var uX=(e,t,r)=>{if(t&&r){var{width:a,height:s}=r,{align:i,verticalAlign:l,layout:o}=t;if((o==="vertical"||o==="horizontal"&&l==="middle")&&i!=="center"&&At(e[i]))return dA(dA({},e),{},{[i]:e[i]+(a||0)});if((o==="horizontal"||o==="vertical"&&i==="center")&&l!=="middle"&&At(e[l]))return dA(dA({},e),{},{[l]:e[l]+(s||0)})}return e},_l=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",JR=(e,t,r,a)=>{if(a)return e.map(o=>o.coordinate);var s,i,l=e.map(o=>(o.coordinate===t&&(s=!0),o.coordinate===r&&(i=!0),o.coordinate));return s||l.push(t),i||l.push(r),l},ZR=(e,t,r)=>{if(!e)return null;var{duplicateDomain:a,type:s,range:i,scale:l,realScaleType:o,isCategorical:d,categoricalDomain:u,tickCount:f,ticks:p,niceTicks:h,axisType:m}=e;if(!l)return null;var b=o==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,v=s==="category"&&l.bandwidth?l.bandwidth()/b:0;if(v=m==="angleAxis"&&i&&i.length>=2?xi(i[0]-i[1])*2*v:v,p||h){var y=(p||h||[]).map((j,_)=>{var N=a?a.indexOf(j):j,E=l.map(N);return Vt(E)?{coordinate:E+v,value:j,offset:v,index:_}:null}).filter(xs);return y}return d&&u?u.map((j,_)=>{var N=l.map(j);return Vt(N)?{coordinate:N+v,value:j,index:_,offset:v}:null}).filter(xs):l.ticks&&f!=null?l.ticks(f).map((j,_)=>{var N=l.map(j);return Vt(N)?{coordinate:N+v,value:j,index:_,offset:v}:null}).filter(xs):l.domain().map((j,_)=>{var N=l.map(j);return Vt(N)?{coordinate:N+v,value:a?a[j]:j,index:_,offset:v}:null}).filter(xs)},AX=e=>{var t,r=e.length;if(!(r<=0)){var a=(t=e[0])===null||t===void 0?void 0:t.length;if(!(a==null||a<=0))for(var s=0;s<a;++s)for(var i=0,l=0,o=0;o<r;++o){var d=e[o],u=d==null?void 0:d[s];if(u!=null){var f=u[1],p=u[0],h=Cl(f)?p:f;h>=0?(u[0]=i,i+=h,u[1]=i):(u[0]=l,l+=h,u[1]=l)}}}},fX=e=>{var t,r=e.length;if(!(r<=0)){var a=(t=e[0])===null||t===void 0?void 0:t.length;if(!(a==null||a<=0))for(var s=0;s<a;++s)for(var i=0,l=0;l<r;++l){var o=e[l],d=o==null?void 0:o[s];if(d!=null){var u=Cl(d[1])?d[0]:d[1];u>=0?(d[0]=i,i+=u,d[1]=i):(d[0]=0,d[1]=0)}}}},pX={sign:AX,expand:Jq,none:Pd,silhouette:Zq,wiggle:eW,positive:fX},xX=(e,t,r)=>{var a,s=(a=pX[r])!==null&&a!==void 0?a:Pd,i=Xq().keys(t).value((o,d)=>Number(Cn(o,d,0))).order(gN).offset(s),l=i(e);return l.forEach((o,d)=>{o.forEach((u,f)=>{var p=Cn(e[f],t[d],0);Array.isArray(p)&&p.length===2&&At(p[0])&&At(p[1])&&(u[0]=p[0],u[1]=p[1])})}),l};function hX(e){return e==null?void 0:String(e)}function gI(e){var{axis:t,ticks:r,bandSize:a,entry:s,index:i,dataKey:l}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Qn(s[t.dataKey])){var o=oR(r,"value",s[t.dataKey]);if(o)return o.coordinate+a/2}return r!=null&&r[i]?r[i].coordinate+a/2:null}var d=Cn(s,Qn(l)?t.dataKey:l),u=t.scale.map(d);return At(u)?u:null}var mX=e=>{var t=e.flat(2).filter(At);return[Math.min(...t),Math.max(...t)]},gX=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],bX=(e,t,r)=>{if(e!=null)return gX(Object.keys(e).reduce((a,s)=>{var i=e[s];if(!i)return a;var{stackedData:l}=i,o=l.reduce((d,u)=>{var f=XR(u,t,r),p=mX(f);return!Vt(p[0])||!Vt(p[1])?d:[Math.min(d[0],p[0]),Math.max(d[1],p[1])]},[1/0,-1/0]);return[Math.min(o[0],a[0]),Math.max(o[1],a[1])]},[1/0,-1/0]))},bI=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,vI=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,rg=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var a=e.scale.bandwidth();if(!r||a>0)return a}if(e&&t&&t.length>=2){for(var s=bb(t,f=>f.coordinate),i=1/0,l=1,o=s.length;l<o;l++){var d=s[l],u=s[l-1];i=Math.min(((d==null?void 0:d.coordinate)||0)-((u==null?void 0:u.coordinate)||0),i)}return i===1/0?0:i}return r?void 0:0};function yI(e){var{tooltipEntrySettings:t,dataKey:r,payload:a,value:s,name:i}=e;return dA(dA({},t),{},{dataKey:r,payload:a,value:s,name:i})}function e8(e,t){if(e)return String(e);if(typeof t=="string")return t}var vX=(e,t)=>{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},yX=(e,t)=>t==="centric"?e.angle:e.radius,Eo=e=>e.layout.width,So=e=>e.layout.height,wX=e=>e.layout.scale,t8=e=>e.layout.margin,Bb=De(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),_b=De(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),NX="data-recharts-item-index",CX="data-recharts-item-id",Op=60;function wI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function jh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wI(Object(r),!0).forEach(function(a){kX(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function kX(e,t,r){return(t=jX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jX(e){var t=EX(e,"string");return typeof t=="symbol"?t:t+""}function EX(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var SX=e=>e.brush.height;function BX(e){var t=_b(e);return t.reduce((r,a)=>{if(a.orientation==="left"&&!a.mirror&&!a.hide){var s=typeof a.width=="number"?a.width:Op;return r+s}return r},0)}function _X(e){var t=_b(e);return t.reduce((r,a)=>{if(a.orientation==="right"&&!a.mirror&&!a.hide){var s=typeof a.width=="number"?a.width:Op;return r+s}return r},0)}function TX(e){var t=Bb(e);return t.reduce((r,a)=>a.orientation==="top"&&!a.mirror&&!a.hide?r+a.height:r,0)}function IX(e){var t=Bb(e);return t.reduce((r,a)=>a.orientation==="bottom"&&!a.mirror&&!a.hide?r+a.height:r,0)}var Sn=De([Eo,So,t8,SX,BX,_X,TX,IX,yR,sY],(e,t,r,a,s,i,l,o,d,u)=>{var f={left:(r.left||0)+s,right:(r.right||0)+i},p={top:(r.top||0)+l,bottom:(r.bottom||0)+o},h=jh(jh({},p),f),m=h.bottom;h.bottom+=a,h=uX(h,d,u);var b=e-h.left-h.right,v=t-h.top-h.bottom;return jh(jh({brushBottom:m},h),{},{width:Math.max(b,0),height:Math.max(v,0)})}),FX=De(Sn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),r8=De(Eo,So,(e,t)=>({x:0,y:0,width:e,height:t})),DX=k.createContext(null),Ns=()=>k.useContext(DX)!=null,Tb=e=>e.brush,Ib=De([Tb,Sn,t8],(e,t,r)=>({height:e.height,x:At(e.x)?e.x:t.left,y:At(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:At(e.width)?e.width:t.width})),Lw={},Qw={},Hw={},NI;function UX(){return NI||(NI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,a,{signal:s,edges:i}={}){let l,o=null;const d=i!=null&&i.includes("leading"),u=i==null||i.includes("trailing"),f=()=>{o!==null&&(r.apply(l,o),l=void 0,o=null)},p=()=>{u&&f(),v()};let h=null;const m=()=>{h!=null&&clearTimeout(h),h=setTimeout(()=>{h=null,p()},a)},b=()=>{h!==null&&(clearTimeout(h),h=null)},v=()=>{b(),l=void 0,o=null},y=()=>{f()},j=function(..._){if(s!=null&&s.aborted)return;l=this,o=_;const N=h==null;m(),d&&N&&f()};return j.schedule=m,j.cancel=v,j.flush=y,s==null||s.addEventListener("abort",v,{once:!0}),j}e.debounce=t})(Hw)),Hw}var CI;function MX(){return CI||(CI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=UX();function r(a,s=0,i={}){typeof i!="object"&&(i={});const{leading:l=!1,trailing:o=!0,maxWait:d}=i,u=Array(2);l&&(u[0]="leading"),o&&(u[1]="trailing");let f,p=null;const h=t.debounce(function(...v){f=a.apply(this,v),p=null},s,{edges:u}),m=function(...v){return d!=null&&(p===null&&(p=Date.now()),Date.now()-p>=d)?(f=a.apply(this,v),p=Date.now(),h.cancel(),h.schedule(),f):(h.apply(this,v),f)},b=()=>(h.flush(),f);return m.cancel=h.cancel,m.flush=b,m}e.debounce=r})(Qw)),Qw}var kI;function RX(){return kI||(kI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=MX();function r(a,s=0,i={}){const{leading:l=!0,trailing:o=!0}=i;return t.debounce(a,s,{leading:l,maxWait:s,trailing:o})}e.throttle=r})(Lw)),Lw}var zw,jI;function OX(){return jI||(jI=1,zw=RX().throttle),zw}var PX=OX();const LX=Sl(PX);var ag=function(t,r){for(var a=arguments.length,s=new Array(a>2?a-2:0),i=2;i<a;i++)s[i-2]=arguments[i];if(typeof console<"u"&&console.warn&&(r===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(r===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(r.replace(/%s/g,()=>s[l++]))}},xl={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},a8=(e,t,r)=>{var{width:a=xl.width,height:s=xl.height,aspect:i,maxHeight:l}=r,o=Ld(a)?e:Number(a),d=Ld(s)?t:Number(s);return i&&i>0&&(o?d=o/i:d&&(o=d*i),l&&d!=null&&d>l&&(d=l)),{calculatedWidth:o,calculatedHeight:d}},QX={width:0,height:0,overflow:"visible"},HX={width:0,overflowX:"visible"},zX={height:0,overflowY:"visible"},$X={},VX=e=>{var{width:t,height:r}=e,a=Ld(t),s=Ld(r);return a&&s?QX:a?HX:s?zX:$X};function GX(e){var{width:t,height:r,aspect:a}=e,s=t,i=r;return s===void 0&&i===void 0?(s=xl.width,i=xl.height):s===void 0?s=a&&a>0?void 0:xl.width:i===void 0&&(i=a&&a>0?void 0:xl.height),{width:s,height:i}}function BN(){return BN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},BN.apply(null,arguments)}function EI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function SI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?EI(Object(r),!0).forEach(function(a){KX(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):EI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function KX(e,t,r){return(t=qX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qX(e){var t=WX(e,"string");return typeof t=="symbol"?t:t+""}function WX(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var n8=k.createContext(xl.initialDimension);function YX(e){return jl(e.width)&&jl(e.height)}function s8(e){var{children:t,width:r,height:a}=e,s=k.useMemo(()=>({width:r,height:a}),[r,a]);return YX(s)?k.createElement(n8.Provider,{value:s},t):null}var Bk=()=>k.useContext(n8),XX=k.forwardRef((e,t)=>{var{aspect:r,initialDimension:a=xl.initialDimension,width:s,height:i,minWidth:l=xl.minWidth,minHeight:o,maxHeight:d,children:u,debounce:f=xl.debounce,id:p,className:h,onResize:m,style:b={}}=e,v=k.useRef(null),y=k.useRef();y.current=m,k.useImperativeHandle(t,()=>v.current);var[j,_]=k.useState({containerWidth:a.width,containerHeight:a.height}),N=k.useCallback((R,U)=>{_(D=>{var L=Math.round(R),P=Math.round(U);return D.containerWidth===L&&D.containerHeight===P?D:{containerWidth:L,containerHeight:P}})},[]);k.useEffect(()=>{if(v.current==null||typeof ResizeObserver>"u")return HA;var R=P=>{var G,Q=P[0];if(Q!=null){var{width:H,height:X}=Q.contentRect;N(H,X),(G=y.current)===null||G===void 0||G.call(y,H,X)}};f>0&&(R=LX(R,f,{trailing:!0,leading:!1}));var U=new ResizeObserver(R),{width:D,height:L}=v.current.getBoundingClientRect();return N(D,L),U.observe(v.current),()=>{U.disconnect()}},[N,f]);var{containerWidth:E,containerHeight:T}=j;ag(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:B,calculatedHeight:F}=a8(E,T,{width:s,height:i,aspect:r,maxHeight:d});return ag(B!=null&&B>0||F!=null&&F>0,`The width(%s) and height(%s) of chart should be greater than 0,
       please check the style of container, or the props width(%s) and height(%s),
       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
       height and width.`,B,F,s,i,l,o,r),k.createElement("div",{id:p?"".concat(p):void 0,className:Lr("recharts-responsive-container",h),style:SI(SI({},b),{},{width:s,height:i,minWidth:l,minHeight:o,maxHeight:d}),ref:v},k.createElement("div",{style:VX({width:s,height:i})},k.createElement(s8,{width:B,height:F},u)))}),_k=k.forwardRef((e,t)=>{var r=Bk();if(jl(r.width)&&jl(r.height))return e.children;var{width:a,height:s}=GX({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:i,calculatedHeight:l}=a8(void 0,void 0,{width:a,height:s,aspect:e.aspect,maxHeight:e.maxHeight});return At(i)&&At(l)?k.createElement(s8,{width:i,height:l},e.children):k.createElement(XX,BN({},e,{width:a,height:s,ref:t}))});function Tk(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Fb=()=>{var e,t=Ns(),r=gt(FX),a=gt(Ib),s=(e=gt(Tb))===null||e===void 0?void 0:e.padding;return!t||!a||!s?r:{width:a.width-s.left-s.right,height:a.height-s.top-s.bottom,x:s.left,y:s.top}},JX={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},i8=()=>{var e;return(e=gt(Sn))!==null&&e!==void 0?e:JX},l8=()=>gt(Eo),o8=()=>gt(So),Yr=e=>e.layout.layoutType,zA=()=>gt(Yr),Ik=()=>{var e=zA();if(e==="horizontal"||e==="vertical")return e},c8=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},ZX=()=>{var e=zA();return e!==void 0},Pp=e=>{var t=an(),r=Ns(),{width:a,height:s}=e,i=Bk(),l=a,o=s;return i&&(l=i.width>0?i.width:a,o=i.height>0?i.height:s),k.useEffect(()=>{!r&&jl(l)&&jl(o)&&t(sX({width:l,height:o}))},[t,r,l,o]),null},d8=Symbol.for("immer-nothing"),BI=Symbol.for("immer-draftable"),$s=Symbol.for("immer-state");function Ri(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var rp=Object.getPrototypeOf;function BA(e){return!!e&&!!e[$s]}function Hd(e){var t;return e?u8(e)||Array.isArray(e)||!!e[BI]||!!((t=e.constructor)!=null&&t[BI])||Lp(e)||Ub(e):!1}var eJ=Object.prototype.constructor.toString(),_I=new WeakMap;function u8(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let a=_I.get(r);return a===void 0&&(a=Function.toString.call(r),_I.set(r,a)),a===eJ}function ng(e,t,r=!0){Db(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((a,s)=>t(s,a,e))}function Db(e){const t=e[$s];return t?t.type_:Array.isArray(e)?1:Lp(e)?2:Ub(e)?3:0}function _N(e,t){return Db(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function A8(e,t,r){const a=Db(e);a===2?e.set(t,r):a===3?e.add(r):e[t]=r}function tJ(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Lp(e){return e instanceof Map}function Ub(e){return e instanceof Set}function hd(e){return e.copy_||e.base_}function TN(e,t){if(Lp(e))return new Map(e);if(Ub(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=u8(e);if(t===!0||t==="class_only"&&!r){const a=Object.getOwnPropertyDescriptors(e);delete a[$s];let s=Reflect.ownKeys(a);for(let i=0;i<s.length;i++){const l=s[i],o=a[l];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(a[l]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[l]})}return Object.create(rp(e),a)}else{const a=rp(e);if(a!==null&&r)return{...e};const s=Object.create(a);return Object.assign(s,e)}}function Fk(e,t=!1){return Mb(e)||BA(e)||!Hd(e)||(Db(e)>1&&Object.defineProperties(e,{set:Eh,add:Eh,clear:Eh,delete:Eh}),Object.freeze(e),t&&Object.values(e).forEach(r=>Fk(r,!0))),e}function rJ(){Ri(2)}var Eh={value:rJ};function Mb(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var aJ={};function zd(e){const t=aJ[e];return t||Ri(0,e),t}var ap;function f8(){return ap}function nJ(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function TI(e,t){t&&(zd("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function IN(e){FN(e),e.drafts_.forEach(sJ),e.drafts_=null}function FN(e){e===ap&&(ap=e.parent_)}function II(e){return ap=nJ(ap,e)}function sJ(e){const t=e[$s];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function FI(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[$s].modified_&&(IN(t),Ri(4)),Hd(e)&&(e=sg(t,e),t.parent_||ig(t,e)),t.patches_&&zd("Patches").generateReplacementPatches_(r[$s].base_,e,t.patches_,t.inversePatches_)):e=sg(t,r,[]),IN(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==d8?e:void 0}function sg(e,t,r){if(Mb(t))return t;const a=e.immer_.shouldUseStrictIteration(),s=t[$s];if(!s)return ng(t,(i,l)=>DI(e,s,t,i,l,r),a),t;if(s.scope_!==e)return t;if(!s.modified_)return ig(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;const i=s.copy_;let l=i,o=!1;s.type_===3&&(l=new Set(i),i.clear(),o=!0),ng(l,(d,u)=>DI(e,s,i,d,u,r,o),a),ig(e,i,!1),r&&e.patches_&&zd("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function DI(e,t,r,a,s,i,l){if(s==null||typeof s!="object"&&!l)return;const o=Mb(s);if(!(o&&!l)){if(BA(s)){const d=i&&t&&t.type_!==3&&!_N(t.assigned_,a)?i.concat(a):void 0,u=sg(e,s,d);if(A8(r,a,u),BA(u))e.canAutoFreeze_=!1;else return}else l&&r.add(s);if(Hd(s)&&!o){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[a]===s&&o)return;sg(e,s),(!t||!t.scope_.parent_)&&typeof a!="symbol"&&(Lp(r)?r.has(a):Object.prototype.propertyIsEnumerable.call(r,a))&&ig(e,s)}}}function ig(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Fk(t,r)}function iJ(e,t){const r=Array.isArray(e),a={type_:r?1:0,scope_:t?t.scope_:f8(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=a,i=Dk;r&&(s=[a],i=np);const{revoke:l,proxy:o}=Proxy.revocable(s,i);return a.draft_=o,a.revoke_=l,o}var Dk={get(e,t){if(t===$s)return e;const r=hd(e);if(!_N(r,t))return lJ(e,r,t);const a=r[t];return e.finalized_||!Hd(a)?a:a===$w(e.base_,t)?(Vw(e),e.copy_[t]=UN(a,e)):a},has(e,t){return t in hd(e)},ownKeys(e){return Reflect.ownKeys(hd(e))},set(e,t,r){const a=p8(hd(e),t);if(a!=null&&a.set)return a.set.call(e.draft_,r),!0;if(!e.modified_){const s=$w(hd(e),t),i=s==null?void 0:s[$s];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(tJ(r,s)&&(r!==void 0||_N(e.base_,t)))return!0;Vw(e),DN(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return $w(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Vw(e),DN(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=hd(e),a=Reflect.getOwnPropertyDescriptor(r,t);return a&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:a.enumerable,value:r[t]}},defineProperty(){Ri(11)},getPrototypeOf(e){return rp(e.base_)},setPrototypeOf(){Ri(12)}},np={};ng(Dk,(e,t)=>{np[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});np.deleteProperty=function(e,t){return np.set.call(this,e,t,void 0)};np.set=function(e,t,r){return Dk.set.call(this,e[0],t,r,e[0])};function $w(e,t){const r=e[$s];return(r?hd(r):e)[t]}function lJ(e,t,r){var s;const a=p8(t,r);return a?"value"in a?a.value:(s=a.get)==null?void 0:s.call(e.draft_):void 0}function p8(e,t){if(!(t in e))return;let r=rp(e);for(;r;){const a=Object.getOwnPropertyDescriptor(r,t);if(a)return a;r=rp(r)}}function DN(e){e.modified_||(e.modified_=!0,e.parent_&&DN(e.parent_))}function Vw(e){e.copy_||(e.copy_=TN(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var oJ=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,a)=>{if(typeof t=="function"&&typeof r!="function"){const i=r;r=t;const l=this;return function(d=i,...u){return l.produce(d,f=>r.call(this,f,...u))}}typeof r!="function"&&Ri(6),a!==void 0&&typeof a!="function"&&Ri(7);let s;if(Hd(t)){const i=II(this),l=UN(t,void 0);let o=!0;try{s=r(l),o=!1}finally{o?IN(i):FN(i)}return TI(i,a),FI(s,i)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===d8&&(s=void 0),this.autoFreeze_&&Fk(s,!0),a){const i=[],l=[];zd("Patches").generateReplacementPatches_(t,s,i,l),a(i,l)}return s}else Ri(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(l,...o)=>this.produceWithPatches(l,d=>t(d,...o));let a,s;return[this.produce(t,r,(l,o)=>{a=l,s=o}),a,s]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Hd(e)||Ri(8),BA(e)&&(e=cJ(e));const t=II(this),r=UN(e,void 0);return r[$s].isManual_=!0,FN(t),r}finishDraft(e,t){const r=e&&e[$s];(!r||!r.isManual_)&&Ri(9);const{scope_:a}=r;return TI(a,t),FI(void 0,a)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const s=t[r];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}r>-1&&(t=t.slice(r+1));const a=zd("Patches").applyPatches_;return BA(e)?a(e,t):this.produce(e,s=>a(s,t))}};function UN(e,t){const r=Lp(e)?zd("MapSet").proxyMap_(e,t):Ub(e)?zd("MapSet").proxySet_(e,t):iJ(e,t);return(t?t.scope_:f8()).drafts_.push(r),r}function cJ(e){return BA(e)||Ri(10,e),x8(e)}function x8(e){if(!Hd(e)||Mb(e))return e;const t=e[$s];let r,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=TN(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else r=TN(e,!0);return ng(r,(s,i)=>{A8(r,s,x8(i))},a),t&&(t.finalized_=!1),r}var dJ=new oJ;dJ.produce;var uJ={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},h8=ws({name:"legend",initialState:uJ,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:Gr()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:a}=t.payload,s=Hi(e).payload.indexOf(r);s>-1&&(e.payload[s]=a)},prepare:Gr()},removeLegendPayload:{reducer(e,t){var r=Hi(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:Gr()}}}),{setLegendSize:yFe,setLegendSettings:wFe,addLegendPayload:AJ,replaceLegendPayload:fJ,removeLegendPayload:pJ}=h8.actions,xJ=h8.reducer;function MN(){return MN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},MN.apply(null,arguments)}function UI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function X0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?UI(Object(r),!0).forEach(function(a){hJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function hJ(e,t,r){return(t=mJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mJ(e){var t=gJ(e,"string");return typeof t=="symbol"?t:t+""}function gJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bJ(e){return Array.isArray(e)&&kl(e[0])&&kl(e[1])?e.join(" ~ "):e}var $u={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1},vJ=e=>{var{separator:t=$u.separator,contentStyle:r,itemStyle:a,labelStyle:s=$u.labelStyle,payload:i,formatter:l,itemSorter:o,wrapperClassName:d,labelClassName:u,label:f,labelFormatter:p,accessibilityLayer:h=$u.accessibilityLayer}=e,m=()=>{if(i&&i.length){var T={padding:0,margin:0},B=(o?bb(i,o):i).map((F,R)=>{if(F.type==="none")return null;var U=F.formatter||l||bJ,{value:D,name:L}=F,P=D,G=L;if(U){var Q=U(D,L,F,R,i);if(Array.isArray(Q))[P,G]=Q;else if(Q!=null)P=Q;else return null}var H=X0(X0({},$u.itemStyle),{},{color:F.color||$u.itemStyle.color},a);return k.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(R),style:H},kl(G)?k.createElement("span",{className:"recharts-tooltip-item-name"},G):null,kl(G)?k.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,k.createElement("span",{className:"recharts-tooltip-item-value"},P),k.createElement("span",{className:"recharts-tooltip-item-unit"},F.unit||""))});return k.createElement("ul",{className:"recharts-tooltip-item-list",style:T},B)}return null},b=X0(X0({},$u.contentStyle),r),v=X0({margin:0},s),y=!Qn(f),j=y?f:"",_=Lr("recharts-default-tooltip",d),N=Lr("recharts-tooltip-label",u);y&&p&&i!==void 0&&i!==null&&(j=p(f,i));var E=h?{role:"status","aria-live":"assertive"}:{};return k.createElement("div",MN({className:_,style:b},E),k.createElement("p",{className:N,style:v},k.isValidElement(j)?j:"".concat(j)),m())},J0="recharts-tooltip-wrapper",yJ={visibility:"hidden"};function wJ(e){var{coordinate:t,translateX:r,translateY:a}=e;return Lr(J0,{["".concat(J0,"-right")]:At(r)&&t&&At(t.x)&&r>=t.x,["".concat(J0,"-left")]:At(r)&&t&&At(t.x)&&r<t.x,["".concat(J0,"-bottom")]:At(a)&&t&&At(t.y)&&a>=t.y,["".concat(J0,"-top")]:At(a)&&t&&At(t.y)&&a<t.y})}function MI(e){var{allowEscapeViewBox:t,coordinate:r,key:a,offset:s,position:i,reverseDirection:l,tooltipDimension:o,viewBox:d,viewBoxDimension:u}=e;if(i&&At(i[a]))return i[a];var f=r[a]-o-(s>0?s:0),p=r[a]+s;if(t[a])return l[a]?f:p;var h=d[a];if(h==null)return 0;if(l[a]){var m=f,b=h;return m<b?Math.max(p,h):Math.max(f,h)}if(u==null)return 0;var v=p+o,y=h+u;return v>y?Math.max(f,h):Math.max(p,h)}function NJ(e){var{translateX:t,translateY:r,useTranslate3d:a}=e;return{transform:a?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function CJ(e){var{allowEscapeViewBox:t,coordinate:r,offsetTop:a,offsetLeft:s,position:i,reverseDirection:l,tooltipBox:o,useTranslate3d:d,viewBox:u}=e,f,p,h;return o.height>0&&o.width>0&&r?(p=MI({allowEscapeViewBox:t,coordinate:r,key:"x",offset:s,position:i,reverseDirection:l,tooltipDimension:o.width,viewBox:u,viewBoxDimension:u.width}),h=MI({allowEscapeViewBox:t,coordinate:r,key:"y",offset:a,position:i,reverseDirection:l,tooltipDimension:o.height,viewBox:u,viewBoxDimension:u.height}),f=NJ({translateX:p,translateY:h,useTranslate3d:d})):f=yJ,{cssProperties:f,cssClasses:wJ({translateX:p,translateY:h,coordinate:r})}}function RI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Sh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?RI(Object(r),!0).forEach(function(a){RN(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):RI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function RN(e,t,r){return(t=kJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kJ(e){var t=jJ(e,"string");return typeof t=="symbol"?t:t+""}function jJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class EJ extends k.PureComponent{constructor(){super(...arguments),RN(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),RN(this,"handleKeyDown",t=>{if(t.key==="Escape"){var r,a,s,i;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(r=(a=this.props.coordinate)===null||a===void 0?void 0:a.x)!==null&&r!==void 0?r:0,y:(s=(i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==null&&s!==void 0?s:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,r;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((r=this.props.coordinate)===null||r===void 0?void 0:r.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:r,animationDuration:a,animationEasing:s,children:i,coordinate:l,hasPayload:o,isAnimationActive:d,offset:u,position:f,reverseDirection:p,useTranslate3d:h,viewBox:m,wrapperStyle:b,lastBoundingBox:v,innerRef:y,hasPortalFromProps:j}=this.props,_=typeof u=="number"?u:u.x,N=typeof u=="number"?u:u.y,{cssClasses:E,cssProperties:T}=CJ({allowEscapeViewBox:r,coordinate:l,offsetLeft:_,offsetTop:N,position:f,reverseDirection:p,tooltipBox:{height:v.height,width:v.width},useTranslate3d:h,viewBox:m}),B=j?{}:Sh(Sh({transition:d&&t?"transform ".concat(a,"ms ").concat(s):void 0},T),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&o?"visible":"hidden",position:"absolute",top:0,left:0}),F=Sh(Sh({},B),{},{visibility:!this.state.dismissed&&t&&o?"visible":"hidden"},b);return k.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:E,style:F,ref:y},i)}}var m8=()=>{var e;return(e=gt(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function ON(){return ON=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},ON.apply(null,arguments)}function OI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function PI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OI(Object(r),!0).forEach(function(a){SJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function SJ(e,t,r){return(t=BJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BJ(e){var t=_J(e,"string");return typeof t=="symbol"?t:t+""}function _J(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var LI={curveBasisClosed:Lq,curveBasisOpen:Qq,curveBasis:Pq,curveBumpX:Rq,curveBumpY:Oq,curveLinearClosed:Hq,curveLinear:hb,curveMonotoneX:zq,curveMonotoneY:$q,curveNatural:Vq,curveStep:Gq,curveStepAfter:qq,curveStepBefore:Kq},lg=e=>Vt(e.x)&&Vt(e.y),QI=e=>e.base!=null&&lg(e.base)&&lg(e),Z0=e=>e.x,ef=e=>e.y,TJ=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(gk(e));if((r==="curveMonotone"||r==="curveBump")&&t){var a=LI["".concat(r).concat(t==="vertical"?"Y":"X")];if(a)return a}return LI[r]||hb},HI={connectNulls:!1,type:"linear"},IJ=e=>{var{type:t=HI.type,points:r=[],baseLine:a,layout:s,connectNulls:i=HI.connectNulls}=e,l=TJ(t,s),o=i?r.filter(lg):r;if(Array.isArray(a)){var d,u=r.map((b,v)=>PI(PI({},b),{},{base:a[v]}));s==="vertical"?d=vh().y(ef).x1(Z0).x0(b=>b.base.x):d=vh().x(Z0).y1(ef).y0(b=>b.base.y);var f=d.defined(QI).curve(l),p=i?u.filter(QI):u;return f(p)}var h;s==="vertical"&&At(a)?h=vh().y(ef).x1(Z0).x0(a):At(a)?h=vh().x(Z0).y1(ef).y0(a):h=XM().x(Z0).y(ef);var m=h.defined(lg).curve(l);return m(o)},_m=e=>{var{className:t,points:r,path:a,pathRef:s}=e,i=zA();if((!r||!r.length)&&!a)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||i,connectNulls:e.connectNulls},o=r&&r.length?IJ(l):a;return k.createElement("path",ON({},Wi(e),bk(e),{className:Lr("recharts-curve",t),d:o===null?void 0:o,ref:s}))},FJ=["x","y","top","left","width","height","className"];function PN(){return PN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},PN.apply(null,arguments)}function zI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function DJ(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zI(Object(r),!0).forEach(function(a){UJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function UJ(e,t,r){return(t=MJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MJ(e){var t=RJ(e,"string");return typeof t=="symbol"?t:t+""}function RJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OJ(e,t){if(e==null)return{};var r,a,s=PJ(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function PJ(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var LJ=(e,t,r,a,s,i)=>"M".concat(e,",").concat(s,"v").concat(a,"M").concat(i,",").concat(t,"h").concat(r),QJ=e=>{var{x:t=0,y:r=0,top:a=0,left:s=0,width:i=0,height:l=0,className:o}=e,d=OJ(e,FJ),u=DJ({x:t,y:r,top:a,left:s,width:i,height:l},d);return!At(t)||!At(r)||!At(i)||!At(l)||!At(a)||!At(s)?null:k.createElement("path",PN({},wi(u),{className:Lr("recharts-cross",o),d:LJ(t,r,i,l,a,s)}))};function HJ(e,t,r,a){var s=a/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-s:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-s,width:e==="horizontal"?a:r.width-1,height:e==="horizontal"?r.height-1:a}}function $I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function VI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$I(Object(r),!0).forEach(function(a){zJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$I(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function zJ(e,t,r){return(t=$J(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $J(e){var t=VJ(e,"string");return typeof t=="symbol"?t:t+""}function VJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var GJ=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),KJ=(e,t,r)=>e.map(a=>"".concat(GJ(a)," ").concat(t,"ms ").concat(r)).join(","),qJ=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((r,a)=>r.filter(s=>a.includes(s))),sp=(e,t)=>Object.keys(t).reduce((r,a)=>VI(VI({},r),{},{[a]:e(a,t[a])}),{});function GI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Pa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?GI(Object(r),!0).forEach(function(a){WJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):GI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function WJ(e,t,r){return(t=YJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YJ(e){var t=XJ(e,"string");return typeof t=="symbol"?t:t+""}function XJ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var og=(e,t,r)=>e+(t-e)*r,LN=e=>{var{from:t,to:r}=e;return t!==r},g8=(e,t,r)=>{var a=sp((s,i)=>{if(LN(i)){var[l,o]=e(i.from,i.to,i.velocity);return Pa(Pa({},i),{},{from:l,velocity:o})}return i},t);return r<1?sp((s,i)=>LN(i)&&a[s]!=null?Pa(Pa({},i),{},{velocity:og(i.velocity,a[s].velocity,r),from:og(i.from,a[s].from,r)}):i,t):g8(e,a,r-1)};function JJ(e,t,r,a,s,i){var l,o=a.reduce((h,m)=>Pa(Pa({},h),{},{[m]:{from:e[m],velocity:0,to:t[m]}}),{}),d=()=>sp((h,m)=>m.from,o),u=()=>!Object.values(o).filter(LN).length,f=null,p=h=>{l||(l=h);var m=h-l,b=m/r.dt;o=g8(r,o,b),s(Pa(Pa(Pa({},e),t),d())),l=h,u()||(f=i.setTimeout(p))};return()=>(f=i.setTimeout(p),()=>{var h;(h=f)===null||h===void 0||h()})}function ZJ(e,t,r,a,s,i,l){var o=null,d=s.reduce((p,h)=>{var m=e[h],b=t[h];return m==null||b==null?p:Pa(Pa({},p),{},{[h]:[m,b]})},{}),u,f=p=>{u||(u=p);var h=(p-u)/a,m=sp((v,y)=>og(...y,r(h)),d);if(i(Pa(Pa(Pa({},e),t),m)),h<1)o=l.setTimeout(f);else{var b=sp((v,y)=>og(...y,r(1)),d);i(Pa(Pa(Pa({},e),t),b))}};return()=>(o=l.setTimeout(f),()=>{var p;(p=o)===null||p===void 0||p()})}const eZ=(e,t,r,a,s,i)=>{var l=qJ(e,t);return r==null?()=>(s(Pa(Pa({},e),t)),()=>{}):r.isStepper===!0?JJ(e,t,r,l,s,i):ZJ(e,t,r,a,l,s,i)};var cg=1e-4,b8=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],v8=(e,t)=>e.map((r,a)=>r*t**a).reduce((r,a)=>r+a),KI=(e,t)=>r=>{var a=b8(e,t);return v8(a,r)},tZ=(e,t)=>r=>{var a=b8(e,t),s=[...a.map((i,l)=>i*l).slice(1),0];return v8(s,r)},rZ=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var a=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(a==null||a.length!==4)return null;var s=a.map(i=>parseFloat(i));return[s[0],s[1],s[2],s[3]]},aZ=function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];if(r.length===1)switch(r[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var s=rZ(r[0]);if(s)return s}}return r.length===4?r:[0,0,1,1]},nZ=(e,t,r,a)=>{var s=KI(e,r),i=KI(t,a),l=tZ(e,r),o=u=>u>1?1:u<0?0:u,d=u=>{for(var f=u>1?1:u,p=f,h=0;h<8;++h){var m=s(p)-f,b=l(p);if(Math.abs(m-f)<cg||b<cg)return i(p);p=o(p-m/b)}return i(p)};return d.isStepper=!1,d},qI=function(){return nZ(...aZ(...arguments))},sZ=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:r=100,damping:a=8,dt:s=17}=t,i=(l,o,d)=>{var u=-(l-o)*r,f=d*a,p=d+(u-f)*s/1e3,h=d*s/1e3+l;return Math.abs(h-o)<cg&&Math.abs(p)<cg?[o,0]:[h,p]};return i.isStepper=!0,i.dt=s,i},iZ=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return qI(e);case"spring":return sZ();default:if(e.split("(")[0]==="cubic-bezier")return qI(e)}return typeof e=="function"?e:null};function lZ(e){var t,r=()=>null,a=!1,s=null,i=l=>{if(!a){if(Array.isArray(l)){if(!l.length)return;var o=l,[d,...u]=o;if(typeof d=="number"){s=e.setTimeout(i.bind(null,u),d);return}i(d),s=e.setTimeout(i.bind(null,u));return}typeof l=="string"&&(t=l,r(t)),typeof l=="object"&&(t=l,r(t)),typeof l=="function"&&l()}};return{stop:()=>{a=!0},start:l=>{a=!1,s&&(s(),s=null),i(l)},subscribe:l=>(r=l,()=>{r=()=>null}),getTimeoutController:()=>e}}class oZ{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=performance.now(),s=null,i=l=>{l-a>=r?t(l):typeof requestAnimationFrame=="function"&&(s=requestAnimationFrame(i))};return s=requestAnimationFrame(i),()=>{s!=null&&cancelAnimationFrame(s)}}}function cZ(){return lZ(new oZ)}var dZ=k.createContext(cZ);function uZ(e,t){var r=k.useContext(dZ);return k.useMemo(()=>t??r(e),[e,t,r])}var AZ=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Qp={isSsr:AZ()},fZ={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},WI={t:0},Gw={t:1};function y8(e){var t=Ks(e,fZ),{isActive:r,canBegin:a,duration:s,easing:i,begin:l,onAnimationEnd:o,onAnimationStart:d,children:u}=t,f=r==="auto"?!Qp.isSsr:r,p=uZ(t.animationId,t.animationManager),[h,m]=k.useState(f?WI:Gw),b=k.useRef(null);return k.useEffect(()=>{f||m(Gw)},[f]),k.useEffect(()=>{if(!f||!a)return HA;var v=eZ(WI,Gw,iZ(i),s,m,p.getTimeoutController()),y=()=>{b.current=v()};return p.start([d,l,y,s,o]),()=>{p.stop(),b.current&&b.current(),o()}},[f,a,s,i,l,d,o,p]),u(h.t)}function w8(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=k.useRef(Jf(t)),a=k.useRef(e);return a.current!==e&&(r.current=Jf(t),a.current=e),r.current}var pZ=["radius"],xZ=["radius"],YI,XI,JI,ZI,eF,tF,rF,aF,nF,sF;function iF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function lF(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iF(Object(r),!0).forEach(function(a){hZ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iF(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function hZ(e,t,r){return(t=mZ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mZ(e){var t=gZ(e,"string");return typeof t=="symbol"?t:t+""}function gZ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dg(){return dg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},dg.apply(null,arguments)}function oF(e,t){if(e==null)return{};var r,a,s=bZ(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function bZ(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function il(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var cF=(e,t,r,a,s)=>{var i=bc(r),l=bc(a),o=Math.min(Math.abs(i)/2,Math.abs(l)/2),d=l>=0?1:-1,u=i>=0?1:-1,f=l>=0&&i>=0||l<0&&i<0?1:0,p;if(o>0&&Array.isArray(s)){for(var h=[0,0,0,0],m=0,b=4;m<b;m++){var v,y=(v=s[m])!==null&&v!==void 0?v:0;h[m]=y>o?o:y}p=mn(YI||(YI=il(["M",",",""])),e,t+d*h[0]),h[0]>0&&(p+=mn(XI||(XI=il(["A ",",",",0,0,",",",",",""])),h[0],h[0],f,e+u*h[0],t)),p+=mn(JI||(JI=il(["L ",",",""])),e+r-u*h[1],t),h[1]>0&&(p+=mn(ZI||(ZI=il(["A ",",",",0,0,",`,
        `,",",""])),h[1],h[1],f,e+r,t+d*h[1])),p+=mn(eF||(eF=il(["L ",",",""])),e+r,t+a-d*h[2]),h[2]>0&&(p+=mn(tF||(tF=il(["A ",",",",0,0,",`,
        `,",",""])),h[2],h[2],f,e+r-u*h[2],t+a)),p+=mn(rF||(rF=il(["L ",",",""])),e+u*h[3],t+a),h[3]>0&&(p+=mn(aF||(aF=il(["A ",",",",0,0,",`,
        `,",",""])),h[3],h[3],f,e,t+a-d*h[3])),p+="Z"}else if(o>0&&s===+s&&s>0){var j=Math.min(o,s);p=mn(nF||(nF=il(["M ",",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",","," Z"])),e,t+d*j,j,j,f,e+u*j,t,e+r-u*j,t,j,j,f,e+r,t+d*j,e+r,t+a-d*j,j,j,f,e+r-u*j,t+a,e+u*j,t+a,j,j,f,e,t+a-d*j)}else p=mn(sF||(sF=il(["M ",","," h "," v "," h "," Z"])),e,t,r,a,-r);return p},dF={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},vZ=e=>{var t=Ks(e,dF),r=k.useRef(null),[a,s]=k.useState(-1);k.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var K=r.current.getTotalLength();K&&s(K)}catch{}},[]);var{x:i,y:l,width:o,height:d,radius:u,className:f}=t,{animationEasing:p,animationDuration:h,animationBegin:m,isAnimationActive:b,isUpdateAnimationActive:v}=t,y=k.useRef(o),j=k.useRef(d),_=k.useRef(i),N=k.useRef(l),E=k.useMemo(()=>({x:i,y:l,width:o,height:d,radius:u}),[i,l,o,d,u]),T=w8(E,"rectangle-");if(i!==+i||l!==+l||o!==+o||d!==+d||o===0||d===0)return null;var B=Lr("recharts-rectangle",f);if(!v){var F=wi(t),{radius:R}=F,U=oF(F,pZ);return k.createElement("path",dg({},U,{x:bc(i),y:bc(l),width:bc(o),height:bc(d),radius:typeof u=="number"?u:void 0,className:B,d:cF(i,l,o,d,u)}))}var D=y.current,L=j.current,P=_.current,G=N.current,Q="0px ".concat(a===-1?1:a,"px"),H="".concat(a,"px 0px"),X=KJ(["strokeDasharray"],h,typeof p=="string"?p:dF.animationEasing);return k.createElement(y8,{animationId:T,key:T,canBegin:a>0,duration:h,easing:p,isActive:v,begin:m},K=>{var ee=pl(D,o,K),W=pl(L,d,K),Y=pl(P,i,K),M=pl(G,l,K);r.current&&(y.current=ee,j.current=W,_.current=Y,N.current=M);var O;b?K>0?O={transition:X,strokeDasharray:H}:O={strokeDasharray:Q}:O={strokeDasharray:H};var q=wi(t),{radius:z}=q,J=oF(q,xZ);return k.createElement("path",dg({},J,{radius:typeof u=="number"?u:void 0,className:B,d:cF(Y,M,ee,W,u),ref:r,style:lF(lF({},O),t.style)}))})};function uF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function AF(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uF(Object(r),!0).forEach(function(a){yZ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uF(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function yZ(e,t,r){return(t=wZ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wZ(e){var t=NZ(e,"string");return typeof t=="symbol"?t:t+""}function NZ(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ug=Math.PI/180,CZ=e=>e*180/Math.PI,wn=(e,t,r,a)=>({x:e+Math.cos(-ug*a)*r,y:t+Math.sin(-ug*a)*r}),kZ=function(t,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(a.left||0)-(a.right||0)),Math.abs(r-(a.top||0)-(a.bottom||0)))/2},jZ=(e,t)=>{var{x:r,y:a}=e,{x:s,y:i}=t;return Math.sqrt((r-s)**2+(a-i)**2)},EZ=(e,t)=>{var{x:r,y:a}=e,{cx:s,cy:i}=t,l=jZ({x:r,y:a},{x:s,y:i});if(l<=0)return{radius:l,angle:0};var o=(r-s)/l,d=Math.acos(o);return a>i&&(d=2*Math.PI-d),{radius:l,angle:CZ(d),angleInRadian:d}},SZ=e=>{var{startAngle:t,endAngle:r}=e,a=Math.floor(t/360),s=Math.floor(r/360),i=Math.min(a,s);return{startAngle:t-i*360,endAngle:r-i*360}},BZ=(e,t)=>{var{startAngle:r,endAngle:a}=t,s=Math.floor(r/360),i=Math.floor(a/360),l=Math.min(s,i);return e+l*360},_Z=(e,t)=>{var{chartX:r,chartY:a}=e,{radius:s,angle:i}=EZ({x:r,y:a},t),{innerRadius:l,outerRadius:o}=t;if(s<l||s>o||s===0)return null;var{startAngle:d,endAngle:u}=SZ(t),f=i,p;if(d<=u){for(;f>u;)f-=360;for(;f<d;)f+=360;p=f>=d&&f<=u}else{for(;f>d;)f-=360;for(;f<u;)f+=360;p=f>=u&&f<=d}return p?AF(AF({},t),{},{radius:s,angle:BZ(f,t)}):null};function N8(e){var{cx:t,cy:r,radius:a,startAngle:s,endAngle:i}=e,l=wn(t,r,a,s),o=wn(t,r,a,i);return{points:[l,o],cx:t,cy:r,radius:a,startAngle:s,endAngle:i}}var fF,pF,xF,hF,mF,gF,bF;function QN(){return QN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},QN.apply(null,arguments)}function yd(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var TZ=(e,t)=>{var r=xi(t-e),a=Math.min(Math.abs(t-e),359.999);return r*a},Bh=e=>{var{cx:t,cy:r,radius:a,angle:s,sign:i,isExternal:l,cornerRadius:o,cornerIsExternal:d}=e,u=o*(l?1:-1)+a,f=Math.asin(o/u)/ug,p=d?s:s+i*f,h=wn(t,r,u,p),m=wn(t,r,a,p),b=d?s-i*f:s,v=wn(t,r,u*Math.cos(f*ug),b);return{center:h,circleTangency:m,lineTangency:v,theta:f}},C8=e=>{var{cx:t,cy:r,innerRadius:a,outerRadius:s,startAngle:i,endAngle:l}=e,o=TZ(i,l),d=i+o,u=wn(t,r,s,i),f=wn(t,r,s,d),p=mn(fF||(fF=yd(["M ",",",`
    A `,",",`,0,
    `,",",`,
    `,",",`
  `])),u.x,u.y,s,s,+(Math.abs(o)>180),+(i>d),f.x,f.y);if(a>0){var h=wn(t,r,a,i),m=wn(t,r,a,d);p+=mn(pF||(pF=yd(["L ",",",`
            A `,",",`,0,
            `,",",`,
            `,","," Z"])),m.x,m.y,a,a,+(Math.abs(o)>180),+(i<=d),h.x,h.y)}else p+=mn(xF||(xF=yd(["L ",","," Z"])),t,r);return p},IZ=e=>{var{cx:t,cy:r,innerRadius:a,outerRadius:s,cornerRadius:i,forceCornerRadius:l,cornerIsExternal:o,startAngle:d,endAngle:u}=e,f=xi(u-d),{circleTangency:p,lineTangency:h,theta:m}=Bh({cx:t,cy:r,radius:s,angle:d,sign:f,cornerRadius:i,cornerIsExternal:o}),{circleTangency:b,lineTangency:v,theta:y}=Bh({cx:t,cy:r,radius:s,angle:u,sign:-f,cornerRadius:i,cornerIsExternal:o}),j=o?Math.abs(d-u):Math.abs(d-u)-m-y;if(j<0)return l?mn(hF||(hF=yd(["M ",",",`
        a`,",",",0,0,1,",`,0
        a`,",",",0,0,1,",`,0
      `])),h.x,h.y,i,i,i*2,i,i,-i*2):C8({cx:t,cy:r,innerRadius:a,outerRadius:s,startAngle:d,endAngle:u});var _=mn(mF||(mF=yd(["M ",",",`
    A`,",",",0,0,",",",",",`
    A`,",",",0,",",",",",",",`
    A`,",",",0,0,",",",",",`
  `])),h.x,h.y,i,i,+(f<0),p.x,p.y,s,s,+(j>180),+(f<0),b.x,b.y,i,i,+(f<0),v.x,v.y);if(a>0){var{circleTangency:N,lineTangency:E,theta:T}=Bh({cx:t,cy:r,radius:a,angle:d,sign:f,isExternal:!0,cornerRadius:i,cornerIsExternal:o}),{circleTangency:B,lineTangency:F,theta:R}=Bh({cx:t,cy:r,radius:a,angle:u,sign:-f,isExternal:!0,cornerRadius:i,cornerIsExternal:o}),U=o?Math.abs(d-u):Math.abs(d-u)-T-R;if(U<0&&i===0)return"".concat(_,"L").concat(t,",").concat(r,"Z");_+=mn(gF||(gF=yd(["L",",",`
      A`,",",",0,0,",",",",",`
      A`,",",",0,",",",",",",",`
      A`,",",",0,0,",",",",","Z"])),F.x,F.y,i,i,+(f<0),B.x,B.y,a,a,+(U>180),+(f>0),N.x,N.y,i,i,+(f<0),E.x,E.y)}else _+=mn(bF||(bF=yd(["L",",","Z"])),t,r);return _},FZ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},DZ=e=>{var t=Ks(e,FZ),{cx:r,cy:a,innerRadius:s,outerRadius:i,cornerRadius:l,forceCornerRadius:o,cornerIsExternal:d,startAngle:u,endAngle:f,className:p}=t;if(i<s||u===f)return null;var h=Lr("recharts-sector",p),m=i-s,b=Fc(l,m,0,!0),v;return b>0&&Math.abs(u-f)<360?v=IZ({cx:r,cy:a,innerRadius:s,outerRadius:i,cornerRadius:Math.min(b,m/2),forceCornerRadius:o,cornerIsExternal:d,startAngle:u,endAngle:f}):v=C8({cx:r,cy:a,innerRadius:s,outerRadius:i,startAngle:u,endAngle:f}),k.createElement("path",QN({},wi(t),{className:h,d:v}))};function UZ(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(cR(t)){if(e==="centric"){var{cx:a,cy:s,innerRadius:i,outerRadius:l,angle:o}=t,d=wn(a,s,i,o),u=wn(a,s,l,o);return[{x:d.x,y:d.y},{x:u.x,y:u.y}]}return N8(t)}}var Kw={},qw={},Ww={},vF;function MZ(){return vF||(vF=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bR();function r(a){return t.isSymbol(a)?NaN:Number(a)}e.toNumber=r})(Ww)),Ww}var yF;function RZ(){return yF||(yF=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=MZ();function r(a){return a?(a=t.toNumber(a),a===1/0||a===-1/0?(a<0?-1:1)*Number.MAX_VALUE:a===a?a:0):a===0?a:0}e.toFinite=r})(qw)),qw}var wF;function OZ(){return wF||(wF=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vR(),r=RZ();function a(s,i,l){l&&typeof l!="number"&&t.isIterateeCall(s,i,l)&&(i=l=void 0),s=r.toFinite(s),i===void 0?(i=s,s=0):i=r.toFinite(i),l=l===void 0?s<i?1:-1:r.toFinite(l);const o=Math.max(Math.ceil((i-s)/(l||1)),0),d=new Array(o);for(let u=0;u<o;u++)d[u]=s,s+=l;return d}e.range=a})(Kw)),Kw}var Yw,NF;function PZ(){return NF||(NF=1,Yw=OZ().range),Yw}var LZ=PZ();const k8=Sl(LZ);function jc(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function QZ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Uk(e){let t,r,a;e.length!==2?(t=jc,r=(o,d)=>jc(e(o),d),a=(o,d)=>e(o)-d):(t=e===jc||e===QZ?e:HZ,r=e,a=e);function s(o,d,u=0,f=o.length){if(u<f){if(t(d,d)!==0)return f;do{const p=u+f>>>1;r(o[p],d)<0?u=p+1:f=p}while(u<f)}return u}function i(o,d,u=0,f=o.length){if(u<f){if(t(d,d)!==0)return f;do{const p=u+f>>>1;r(o[p],d)<=0?u=p+1:f=p}while(u<f)}return u}function l(o,d,u=0,f=o.length){const p=s(o,d,u,f-1);return p>u&&a(o[p-1],d)>-a(o[p],d)?p-1:p}return{left:s,center:l,right:i}}function HZ(){return 0}function j8(e){return e===null?NaN:+e}function*zZ(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const $Z=Uk(jc),Hp=$Z.right;Uk(j8).center;class CF extends Map{constructor(t,r=KZ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[a,s]of t)this.set(a,s)}get(t){return super.get(kF(this,t))}has(t){return super.has(kF(this,t))}set(t,r){return super.set(VZ(this,t),r)}delete(t){return super.delete(GZ(this,t))}}function kF({_intern:e,_key:t},r){const a=t(r);return e.has(a)?e.get(a):r}function VZ({_intern:e,_key:t},r){const a=t(r);return e.has(a)?e.get(a):(e.set(a,r),r)}function GZ({_intern:e,_key:t},r){const a=t(r);return e.has(a)&&(r=e.get(a),e.delete(a)),r}function KZ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function qZ(e=jc){if(e===jc)return E8;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const a=e(t,r);return a||a===0?a:(e(r,r)===0)-(e(t,t)===0)}}function E8(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const WZ=Math.sqrt(50),YZ=Math.sqrt(10),XZ=Math.sqrt(2);function Ag(e,t,r){const a=(t-e)/Math.max(0,r),s=Math.floor(Math.log10(a)),i=a/Math.pow(10,s),l=i>=WZ?10:i>=YZ?5:i>=XZ?2:1;let o,d,u;return s<0?(u=Math.pow(10,-s)/l,o=Math.round(e*u),d=Math.round(t*u),o/u<e&&++o,d/u>t&&--d,u=-u):(u=Math.pow(10,s)*l,o=Math.round(e/u),d=Math.round(t/u),o*u<e&&++o,d*u>t&&--d),d<o&&.5<=r&&r<2?Ag(e,t,r*2):[o,d,u]}function HN(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const a=t<e,[s,i,l]=a?Ag(t,e,r):Ag(e,t,r);if(!(i>=s))return[];const o=i-s+1,d=new Array(o);if(a)if(l<0)for(let u=0;u<o;++u)d[u]=(i-u)/-l;else for(let u=0;u<o;++u)d[u]=(i-u)*l;else if(l<0)for(let u=0;u<o;++u)d[u]=(s+u)/-l;else for(let u=0;u<o;++u)d[u]=(s+u)*l;return d}function zN(e,t,r){return t=+t,e=+e,r=+r,Ag(e,t,r)[2]}function $N(e,t,r){t=+t,e=+e,r=+r;const a=t<e,s=a?zN(t,e,r):zN(e,t,r);return(a?-1:1)*(s<0?1/-s:s)}function jF(e,t){let r;for(const a of e)a!=null&&(r<a||r===void 0&&a>=a)&&(r=a);return r}function EF(e,t){let r;for(const a of e)a!=null&&(r>a||r===void 0&&a>=a)&&(r=a);return r}function S8(e,t,r=0,a=1/0,s){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),a=Math.floor(Math.min(e.length-1,a)),!(r<=t&&t<=a))return e;for(s=s===void 0?E8:qZ(s);a>r;){if(a-r>600){const d=a-r+1,u=t-r+1,f=Math.log(d),p=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*p*(d-p)/d)*(u-d/2<0?-1:1),m=Math.max(r,Math.floor(t-u*p/d+h)),b=Math.min(a,Math.floor(t+(d-u)*p/d+h));S8(e,t,m,b,s)}const i=e[t];let l=r,o=a;for(tf(e,r,t),s(e[a],i)>0&&tf(e,r,a);l<o;){for(tf(e,l,o),++l,--o;s(e[l],i)<0;)++l;for(;s(e[o],i)>0;)--o}s(e[r],i)===0?tf(e,r,o):(++o,tf(e,o,a)),o<=t&&(r=o+1),t<=o&&(a=o-1)}return e}function tf(e,t,r){const a=e[t];e[t]=e[r],e[r]=a}function JZ(e,t,r){if(e=Float64Array.from(zZ(e)),!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return EF(e);if(t>=1)return jF(e);var a,s=(a-1)*t,i=Math.floor(s),l=jF(S8(e,i).subarray(0,i+1)),o=EF(e.subarray(i+1));return l+(o-l)*(s-i)}}function ZZ(e,t,r=j8){if(!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return+r(e[0],0,e);if(t>=1)return+r(e[a-1],a-1,e);var a,s=(a-1)*t,i=Math.floor(s),l=+r(e[i],i,e),o=+r(e[i+1],i+1,e);return l+(o-l)*(s-i)}}function eee(e,t,r){e=+e,t=+t,r=(s=arguments.length)<2?(t=e,e=0,1):s<3?1:+r;for(var a=-1,s=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(s);++a<s;)i[a]=e+a*r;return i}function Ei(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Bo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const VN=Symbol("implicit");function Mk(){var e=new CF,t=[],r=[],a=VN;function s(i){let l=e.get(i);if(l===void 0){if(a!==VN)return a;e.set(i,l=t.push(i)-1)}return r[l%r.length]}return s.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new CF;for(const l of i)e.has(l)||e.set(l,t.push(l)-1);return s},s.range=function(i){return arguments.length?(r=Array.from(i),s):r.slice()},s.unknown=function(i){return arguments.length?(a=i,s):a},s.copy=function(){return Mk(t,r).unknown(a)},Ei.apply(s,arguments),s}function Rk(){var e=Mk().unknown(void 0),t=e.domain,r=e.range,a=0,s=1,i,l,o=!1,d=0,u=0,f=.5;delete e.unknown;function p(){var h=t().length,m=s<a,b=m?s:a,v=m?a:s;i=(v-b)/Math.max(1,h-d+u*2),o&&(i=Math.floor(i)),b+=(v-b-i*(h-d))*f,l=i*(1-d),o&&(b=Math.round(b),l=Math.round(l));var y=eee(h).map(function(j){return b+i*j});return r(m?y.reverse():y)}return e.domain=function(h){return arguments.length?(t(h),p()):t()},e.range=function(h){return arguments.length?([a,s]=h,a=+a,s=+s,p()):[a,s]},e.rangeRound=function(h){return[a,s]=h,a=+a,s=+s,o=!0,p()},e.bandwidth=function(){return l},e.step=function(){return i},e.round=function(h){return arguments.length?(o=!!h,p()):o},e.padding=function(h){return arguments.length?(d=Math.min(1,u=+h),p()):d},e.paddingInner=function(h){return arguments.length?(d=Math.min(1,h),p()):d},e.paddingOuter=function(h){return arguments.length?(u=+h,p()):u},e.align=function(h){return arguments.length?(f=Math.max(0,Math.min(1,h)),p()):f},e.copy=function(){return Rk(t(),[a,s]).round(o).paddingInner(d).paddingOuter(u).align(f)},Ei.apply(p(),arguments)}function B8(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return B8(t())},e}function tee(){return B8(Rk.apply(null,arguments).paddingInner(1))}function Ok(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function _8(e,t){var r=Object.create(e.prototype);for(var a in t)r[a]=t[a];return r}function zp(){}var ip=.7,fg=1/ip,gA="\\s*([+-]?\\d+)\\s*",lp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",vl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ree=/^#([0-9a-f]{3,8})$/,aee=new RegExp(`^rgb\\(${gA},${gA},${gA}\\)$`),nee=new RegExp(`^rgb\\(${vl},${vl},${vl}\\)$`),see=new RegExp(`^rgba\\(${gA},${gA},${gA},${lp}\\)$`),iee=new RegExp(`^rgba\\(${vl},${vl},${vl},${lp}\\)$`),lee=new RegExp(`^hsl\\(${lp},${vl},${vl}\\)$`),oee=new RegExp(`^hsla\\(${lp},${vl},${vl},${lp}\\)$`),SF={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ok(zp,op,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:BF,formatHex:BF,formatHex8:cee,formatHsl:dee,formatRgb:_F,toString:_F});function BF(){return this.rgb().formatHex()}function cee(){return this.rgb().formatHex8()}function dee(){return T8(this).formatHsl()}function _F(){return this.rgb().formatRgb()}function op(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=ree.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?TF(t):r===3?new hs(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?_h(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?_h(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=aee.exec(e))?new hs(t[1],t[2],t[3],1):(t=nee.exec(e))?new hs(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=see.exec(e))?_h(t[1],t[2],t[3],t[4]):(t=iee.exec(e))?_h(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=lee.exec(e))?DF(t[1],t[2]/100,t[3]/100,1):(t=oee.exec(e))?DF(t[1],t[2]/100,t[3]/100,t[4]):SF.hasOwnProperty(e)?TF(SF[e]):e==="transparent"?new hs(NaN,NaN,NaN,0):null}function TF(e){return new hs(e>>16&255,e>>8&255,e&255,1)}function _h(e,t,r,a){return a<=0&&(e=t=r=NaN),new hs(e,t,r,a)}function uee(e){return e instanceof zp||(e=op(e)),e?(e=e.rgb(),new hs(e.r,e.g,e.b,e.opacity)):new hs}function GN(e,t,r,a){return arguments.length===1?uee(e):new hs(e,t,r,a??1)}function hs(e,t,r,a){this.r=+e,this.g=+t,this.b=+r,this.opacity=+a}Ok(hs,GN,_8(zp,{brighter(e){return e=e==null?fg:Math.pow(fg,e),new hs(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ip:Math.pow(ip,e),new hs(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hs(Sd(this.r),Sd(this.g),Sd(this.b),pg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:IF,formatHex:IF,formatHex8:Aee,formatRgb:FF,toString:FF}));function IF(){return`#${wd(this.r)}${wd(this.g)}${wd(this.b)}`}function Aee(){return`#${wd(this.r)}${wd(this.g)}${wd(this.b)}${wd((isNaN(this.opacity)?1:this.opacity)*255)}`}function FF(){const e=pg(this.opacity);return`${e===1?"rgb(":"rgba("}${Sd(this.r)}, ${Sd(this.g)}, ${Sd(this.b)}${e===1?")":`, ${e})`}`}function pg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Sd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function wd(e){return e=Sd(e),(e<16?"0":"")+e.toString(16)}function DF(e,t,r,a){return a<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Oi(e,t,r,a)}function T8(e){if(e instanceof Oi)return new Oi(e.h,e.s,e.l,e.opacity);if(e instanceof zp||(e=op(e)),!e)return new Oi;if(e instanceof Oi)return e;e=e.rgb();var t=e.r/255,r=e.g/255,a=e.b/255,s=Math.min(t,r,a),i=Math.max(t,r,a),l=NaN,o=i-s,d=(i+s)/2;return o?(t===i?l=(r-a)/o+(r<a)*6:r===i?l=(a-t)/o+2:l=(t-r)/o+4,o/=d<.5?i+s:2-i-s,l*=60):o=d>0&&d<1?0:l,new Oi(l,o,d,e.opacity)}function fee(e,t,r,a){return arguments.length===1?T8(e):new Oi(e,t,r,a??1)}function Oi(e,t,r,a){this.h=+e,this.s=+t,this.l=+r,this.opacity=+a}Ok(Oi,fee,_8(zp,{brighter(e){return e=e==null?fg:Math.pow(fg,e),new Oi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ip:Math.pow(ip,e),new Oi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,a=r+(r<.5?r:1-r)*t,s=2*r-a;return new hs(Xw(e>=240?e-240:e+120,s,a),Xw(e,s,a),Xw(e<120?e+240:e-120,s,a),this.opacity)},clamp(){return new Oi(UF(this.h),Th(this.s),Th(this.l),pg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=pg(this.opacity);return`${e===1?"hsl(":"hsla("}${UF(this.h)}, ${Th(this.s)*100}%, ${Th(this.l)*100}%${e===1?")":`, ${e})`}`}}));function UF(e){return e=(e||0)%360,e<0?e+360:e}function Th(e){return Math.max(0,Math.min(1,e||0))}function Xw(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Pk=e=>()=>e;function pee(e,t){return function(r){return e+r*t}}function xee(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(a){return Math.pow(e+a*t,r)}}function hee(e){return(e=+e)==1?I8:function(t,r){return r-t?xee(t,r,e):Pk(isNaN(t)?r:t)}}function I8(e,t){var r=t-e;return r?pee(e,r):Pk(isNaN(e)?t:e)}const MF=(function e(t){var r=hee(t);function a(s,i){var l=r((s=GN(s)).r,(i=GN(i)).r),o=r(s.g,i.g),d=r(s.b,i.b),u=I8(s.opacity,i.opacity);return function(f){return s.r=l(f),s.g=o(f),s.b=d(f),s.opacity=u(f),s+""}}return a.gamma=e,a})(1);function mee(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,a=t.slice(),s;return function(i){for(s=0;s<r;++s)a[s]=e[s]*(1-i)+t[s]*i;return a}}function gee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function bee(e,t){var r=t?t.length:0,a=e?Math.min(r,e.length):0,s=new Array(a),i=new Array(r),l;for(l=0;l<a;++l)s[l]=$A(e[l],t[l]);for(;l<r;++l)i[l]=t[l];return function(o){for(l=0;l<a;++l)i[l]=s[l](o);return i}}function vee(e,t){var r=new Date;return e=+e,t=+t,function(a){return r.setTime(e*(1-a)+t*a),r}}function xg(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function yee(e,t){var r={},a={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?r[s]=$A(e[s],t[s]):a[s]=t[s];return function(i){for(s in r)a[s]=r[s](i);return a}}var KN=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Jw=new RegExp(KN.source,"g");function wee(e){return function(){return e}}function Nee(e){return function(t){return e(t)+""}}function Cee(e,t){var r=KN.lastIndex=Jw.lastIndex=0,a,s,i,l=-1,o=[],d=[];for(e=e+"",t=t+"";(a=KN.exec(e))&&(s=Jw.exec(t));)(i=s.index)>r&&(i=t.slice(r,i),o[l]?o[l]+=i:o[++l]=i),(a=a[0])===(s=s[0])?o[l]?o[l]+=s:o[++l]=s:(o[++l]=null,d.push({i:l,x:xg(a,s)})),r=Jw.lastIndex;return r<t.length&&(i=t.slice(r),o[l]?o[l]+=i:o[++l]=i),o.length<2?d[0]?Nee(d[0].x):wee(t):(t=d.length,function(u){for(var f=0,p;f<t;++f)o[(p=d[f]).i]=p.x(u);return o.join("")})}function $A(e,t){var r=typeof t,a;return t==null||r==="boolean"?Pk(t):(r==="number"?xg:r==="string"?(a=op(t))?(t=a,MF):Cee:t instanceof op?MF:t instanceof Date?vee:gee(t)?mee:Array.isArray(t)?bee:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?yee:xg)(e,t)}function Lk(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function kee(e,t){t===void 0&&(t=e,e=$A);for(var r=0,a=t.length-1,s=t[0],i=new Array(a<0?0:a);r<a;)i[r]=e(s,s=t[++r]);return function(l){var o=Math.max(0,Math.min(a-1,Math.floor(l*=a)));return i[o](l-o)}}function jee(e){return function(){return e}}function hg(e){return+e}var RF=[0,1];function Yn(e){return e}function qN(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:jee(isNaN(t)?NaN:.5)}function Eee(e,t){var r;return e>t&&(r=e,e=t,t=r),function(a){return Math.max(e,Math.min(t,a))}}function See(e,t,r){var a=e[0],s=e[1],i=t[0],l=t[1];return s<a?(a=qN(s,a),i=r(l,i)):(a=qN(a,s),i=r(i,l)),function(o){return i(a(o))}}function Bee(e,t,r){var a=Math.min(e.length,t.length)-1,s=new Array(a),i=new Array(a),l=-1;for(e[a]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<a;)s[l]=qN(e[l],e[l+1]),i[l]=r(t[l],t[l+1]);return function(o){var d=Hp(e,o,1,a)-1;return i[d](s[d](o))}}function $p(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Rb(){var e=RF,t=RF,r=$A,a,s,i,l=Yn,o,d,u;function f(){var h=Math.min(e.length,t.length);return l!==Yn&&(l=Eee(e[0],e[h-1])),o=h>2?Bee:See,d=u=null,p}function p(h){return h==null||isNaN(h=+h)?i:(d||(d=o(e.map(a),t,r)))(a(l(h)))}return p.invert=function(h){return l(s((u||(u=o(t,e.map(a),xg)))(h)))},p.domain=function(h){return arguments.length?(e=Array.from(h,hg),f()):e.slice()},p.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},p.rangeRound=function(h){return t=Array.from(h),r=Lk,f()},p.clamp=function(h){return arguments.length?(l=h?!0:Yn,f()):l!==Yn},p.interpolate=function(h){return arguments.length?(r=h,f()):r},p.unknown=function(h){return arguments.length?(i=h,p):i},function(h,m){return a=h,s=m,f()}}function Qk(){return Rb()(Yn,Yn)}function _ee(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function mg(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),a=e.slice(0,r);return[a.length>1?a[0]+a.slice(2):a,+e.slice(r+1)]}function _A(e){return e=mg(Math.abs(e)),e?e[1]:NaN}function Tee(e,t){return function(r,a){for(var s=r.length,i=[],l=0,o=e[0],d=0;s>0&&o>0&&(d+o+1>a&&(o=Math.max(1,a-d)),i.push(r.substring(s-=o,s+o)),!((d+=o+1)>a));)o=e[l=(l+1)%e.length];return i.reverse().join(t)}}function Iee(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Fee=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function cp(e){if(!(t=Fee.exec(e)))throw new Error("invalid format: "+e);var t;return new Hk({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}cp.prototype=Hk.prototype;function Hk(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Hk.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Dee(e){e:for(var t=e.length,r=1,a=-1,s;r<t;++r)switch(e[r]){case".":a=s=r;break;case"0":a===0&&(a=r),s=r;break;default:if(!+e[r])break e;a>0&&(a=0);break}return a>0?e.slice(0,a)+e.slice(s+1):e}var gg;function Uee(e,t){var r=mg(e,t);if(!r)return gg=void 0,e.toPrecision(t);var a=r[0],s=r[1],i=s-(gg=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,l=a.length;return i===l?a:i>l?a+new Array(i-l+1).join("0"):i>0?a.slice(0,i)+"."+a.slice(i):"0."+new Array(1-i).join("0")+mg(e,Math.max(0,t+i-1))[0]}function OF(e,t){var r=mg(e,t);if(!r)return e+"";var a=r[0],s=r[1];return s<0?"0."+new Array(-s).join("0")+a:a.length>s+1?a.slice(0,s+1)+"."+a.slice(s+1):a+new Array(s-a.length+2).join("0")}const PF={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:_ee,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>OF(e*100,t),r:OF,s:Uee,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function LF(e){return e}var QF=Array.prototype.map,HF=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Mee(e){var t=e.grouping===void 0||e.thousands===void 0?LF:Tee(QF.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",a=e.currency===void 0?"":e.currency[1]+"",s=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?LF:Iee(QF.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function u(p,h){p=cp(p);var m=p.fill,b=p.align,v=p.sign,y=p.symbol,j=p.zero,_=p.width,N=p.comma,E=p.precision,T=p.trim,B=p.type;B==="n"?(N=!0,B="g"):PF[B]||(E===void 0&&(E=12),T=!0,B="g"),(j||m==="0"&&b==="=")&&(j=!0,m="0",b="=");var F=(h&&h.prefix!==void 0?h.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(B)?"0"+B.toLowerCase():""),R=(y==="$"?a:/[%p]/.test(B)?l:"")+(h&&h.suffix!==void 0?h.suffix:""),U=PF[B],D=/[defgprs%]/.test(B);E=E===void 0?6:/[gprs]/.test(B)?Math.max(1,Math.min(21,E)):Math.max(0,Math.min(20,E));function L(P){var G=F,Q=R,H,X,K;if(B==="c")Q=U(P)+Q,P="";else{P=+P;var ee=P<0||1/P<0;if(P=isNaN(P)?d:U(Math.abs(P),E),T&&(P=Dee(P)),ee&&+P==0&&v!=="+"&&(ee=!1),G=(ee?v==="("?v:o:v==="-"||v==="("?"":v)+G,Q=(B==="s"&&!isNaN(P)&&gg!==void 0?HF[8+gg/3]:"")+Q+(ee&&v==="("?")":""),D){for(H=-1,X=P.length;++H<X;)if(K=P.charCodeAt(H),48>K||K>57){Q=(K===46?s+P.slice(H+1):P.slice(H))+Q,P=P.slice(0,H);break}}}N&&!j&&(P=t(P,1/0));var W=G.length+P.length+Q.length,Y=W<_?new Array(_-W+1).join(m):"";switch(N&&j&&(P=t(Y+P,Y.length?_-Q.length:1/0),Y=""),b){case"<":P=G+P+Q+Y;break;case"=":P=G+Y+P+Q;break;case"^":P=Y.slice(0,W=Y.length>>1)+G+P+Q+Y.slice(W);break;default:P=Y+G+P+Q;break}return i(P)}return L.toString=function(){return p+""},L}function f(p,h){var m=Math.max(-8,Math.min(8,Math.floor(_A(h)/3)))*3,b=Math.pow(10,-m),v=u((p=cp(p),p.type="f",p),{suffix:HF[8+m/3]});return function(y){return v(b*y)}}return{format:u,formatPrefix:f}}var Ih,zk,F8;Ree({thousands:",",grouping:[3],currency:["$",""]});function Ree(e){return Ih=Mee(e),zk=Ih.format,F8=Ih.formatPrefix,Ih}function Oee(e){return Math.max(0,-_A(Math.abs(e)))}function Pee(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(_A(t)/3)))*3-_A(Math.abs(e)))}function Lee(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,_A(t)-_A(e))+1}function D8(e,t,r,a){var s=$N(e,t,r),i;switch(a=cp(a??",f"),a.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return a.precision==null&&!isNaN(i=Pee(s,l))&&(a.precision=i),F8(a,l)}case"":case"e":case"g":case"p":case"r":{a.precision==null&&!isNaN(i=Lee(s,Math.max(Math.abs(e),Math.abs(t))))&&(a.precision=i-(a.type==="e"));break}case"f":case"%":{a.precision==null&&!isNaN(i=Oee(s))&&(a.precision=i-(a.type==="%")*2);break}}return zk(a)}function Hc(e){var t=e.domain;return e.ticks=function(r){var a=t();return HN(a[0],a[a.length-1],r??10)},e.tickFormat=function(r,a){var s=t();return D8(s[0],s[s.length-1],r??10,a)},e.nice=function(r){r==null&&(r=10);var a=t(),s=0,i=a.length-1,l=a[s],o=a[i],d,u,f=10;for(o<l&&(u=l,l=o,o=u,u=s,s=i,i=u);f-- >0;){if(u=zN(l,o,r),u===d)return a[s]=l,a[i]=o,t(a);if(u>0)l=Math.floor(l/u)*u,o=Math.ceil(o/u)*u;else if(u<0)l=Math.ceil(l*u)/u,o=Math.floor(o*u)/u;else break;d=u}return e},e}function U8(){var e=Qk();return e.copy=function(){return $p(e,U8())},Ei.apply(e,arguments),Hc(e)}function M8(e){var t;function r(a){return a==null||isNaN(a=+a)?t:a}return r.invert=r,r.domain=r.range=function(a){return arguments.length?(e=Array.from(a,hg),r):e.slice()},r.unknown=function(a){return arguments.length?(t=a,r):t},r.copy=function(){return M8(e).unknown(t)},e=arguments.length?Array.from(e,hg):[0,1],Hc(r)}function R8(e,t){e=e.slice();var r=0,a=e.length-1,s=e[r],i=e[a],l;return i<s&&(l=r,r=a,a=l,l=s,s=i,i=l),e[r]=t.floor(s),e[a]=t.ceil(i),e}function zF(e){return Math.log(e)}function $F(e){return Math.exp(e)}function Qee(e){return-Math.log(-e)}function Hee(e){return-Math.exp(-e)}function zee(e){return isFinite(e)?+("1e"+e):e<0?0:e}function $ee(e){return e===10?zee:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Vee(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function VF(e){return(t,r)=>-e(-t,r)}function $k(e){const t=e(zF,$F),r=t.domain;let a=10,s,i;function l(){return s=Vee(a),i=$ee(a),r()[0]<0?(s=VF(s),i=VF(i),e(Qee,Hee)):e(zF,$F),t}return t.base=function(o){return arguments.length?(a=+o,l()):a},t.domain=function(o){return arguments.length?(r(o),l()):r()},t.ticks=o=>{const d=r();let u=d[0],f=d[d.length-1];const p=f<u;p&&([u,f]=[f,u]);let h=s(u),m=s(f),b,v;const y=o==null?10:+o;let j=[];if(!(a%1)&&m-h<y){if(h=Math.floor(h),m=Math.ceil(m),u>0){for(;h<=m;++h)for(b=1;b<a;++b)if(v=h<0?b/i(-h):b*i(h),!(v<u)){if(v>f)break;j.push(v)}}else for(;h<=m;++h)for(b=a-1;b>=1;--b)if(v=h>0?b/i(-h):b*i(h),!(v<u)){if(v>f)break;j.push(v)}j.length*2<y&&(j=HN(u,f,y))}else j=HN(h,m,Math.min(m-h,y)).map(i);return p?j.reverse():j},t.tickFormat=(o,d)=>{if(o==null&&(o=10),d==null&&(d=a===10?"s":","),typeof d!="function"&&(!(a%1)&&(d=cp(d)).precision==null&&(d.trim=!0),d=zk(d)),o===1/0)return d;const u=Math.max(1,a*o/t.ticks().length);return f=>{let p=f/i(Math.round(s(f)));return p*a<a-.5&&(p*=a),p<=u?d(f):""}},t.nice=()=>r(R8(r(),{floor:o=>i(Math.floor(s(o))),ceil:o=>i(Math.ceil(s(o)))})),t}function O8(){const e=$k(Rb()).domain([1,10]);return e.copy=()=>$p(e,O8()).base(e.base()),Ei.apply(e,arguments),e}function GF(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function KF(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Vk(e){var t=1,r=e(GF(t),KF(t));return r.constant=function(a){return arguments.length?e(GF(t=+a),KF(t)):t},Hc(r)}function P8(){var e=Vk(Rb());return e.copy=function(){return $p(e,P8()).constant(e.constant())},Ei.apply(e,arguments)}function qF(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Gee(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Kee(e){return e<0?-e*e:e*e}function Gk(e){var t=e(Yn,Yn),r=1;function a(){return r===1?e(Yn,Yn):r===.5?e(Gee,Kee):e(qF(r),qF(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,a()):r},Hc(t)}function Kk(){var e=Gk(Rb());return e.copy=function(){return $p(e,Kk()).exponent(e.exponent())},Ei.apply(e,arguments),e}function qee(){return Kk.apply(null,arguments).exponent(.5)}function WF(e){return Math.sign(e)*e*e}function Wee(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function L8(){var e=Qk(),t=[0,1],r=!1,a;function s(i){var l=Wee(e(i));return isNaN(l)?a:r?Math.round(l):l}return s.invert=function(i){return e.invert(WF(i))},s.domain=function(i){return arguments.length?(e.domain(i),s):e.domain()},s.range=function(i){return arguments.length?(e.range((t=Array.from(i,hg)).map(WF)),s):t.slice()},s.rangeRound=function(i){return s.range(i).round(!0)},s.round=function(i){return arguments.length?(r=!!i,s):r},s.clamp=function(i){return arguments.length?(e.clamp(i),s):e.clamp()},s.unknown=function(i){return arguments.length?(a=i,s):a},s.copy=function(){return L8(e.domain(),t).round(r).clamp(e.clamp()).unknown(a)},Ei.apply(s,arguments),Hc(s)}function Q8(){var e=[],t=[],r=[],a;function s(){var l=0,o=Math.max(1,t.length);for(r=new Array(o-1);++l<o;)r[l-1]=ZZ(e,l/o);return i}function i(l){return l==null||isNaN(l=+l)?a:t[Hp(r,l)]}return i.invertExtent=function(l){var o=t.indexOf(l);return o<0?[NaN,NaN]:[o>0?r[o-1]:e[0],o<r.length?r[o]:e[e.length-1]]},i.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let o of l)o!=null&&!isNaN(o=+o)&&e.push(o);return e.sort(jc),s()},i.range=function(l){return arguments.length?(t=Array.from(l),s()):t.slice()},i.unknown=function(l){return arguments.length?(a=l,i):a},i.quantiles=function(){return r.slice()},i.copy=function(){return Q8().domain(e).range(t).unknown(a)},Ei.apply(i,arguments)}function H8(){var e=0,t=1,r=1,a=[.5],s=[0,1],i;function l(d){return d!=null&&d<=d?s[Hp(a,d,0,r)]:i}function o(){var d=-1;for(a=new Array(r);++d<r;)a[d]=((d+1)*t-(d-r)*e)/(r+1);return l}return l.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,o()):[e,t]},l.range=function(d){return arguments.length?(r=(s=Array.from(d)).length-1,o()):s.slice()},l.invertExtent=function(d){var u=s.indexOf(d);return u<0?[NaN,NaN]:u<1?[e,a[0]]:u>=r?[a[r-1],t]:[a[u-1],a[u]]},l.unknown=function(d){return arguments.length&&(i=d),l},l.thresholds=function(){return a.slice()},l.copy=function(){return H8().domain([e,t]).range(s).unknown(i)},Ei.apply(Hc(l),arguments)}function z8(){var e=[.5],t=[0,1],r,a=1;function s(i){return i!=null&&i<=i?t[Hp(e,i,0,a)]:r}return s.domain=function(i){return arguments.length?(e=Array.from(i),a=Math.min(e.length,t.length-1),s):e.slice()},s.range=function(i){return arguments.length?(t=Array.from(i),a=Math.min(e.length,t.length-1),s):t.slice()},s.invertExtent=function(i){var l=t.indexOf(i);return[e[l-1],e[l]]},s.unknown=function(i){return arguments.length?(r=i,s):r},s.copy=function(){return z8().domain(e).range(t).unknown(r)},Ei.apply(s,arguments)}const Zw=new Date,e2=new Date;function Va(e,t,r,a){function s(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return s.floor=i=>(e(i=new Date(+i)),i),s.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),s.round=i=>{const l=s(i),o=s.ceil(i);return i-l<o-i?l:o},s.offset=(i,l)=>(t(i=new Date(+i),l==null?1:Math.floor(l)),i),s.range=(i,l,o)=>{const d=[];if(i=s.ceil(i),o=o==null?1:Math.floor(o),!(i<l)||!(o>0))return d;let u;do d.push(u=new Date(+i)),t(i,o),e(i);while(u<i&&i<l);return d},s.filter=i=>Va(l=>{if(l>=l)for(;e(l),!i(l);)l.setTime(l-1)},(l,o)=>{if(l>=l)if(o<0)for(;++o<=0;)for(;t(l,-1),!i(l););else for(;--o>=0;)for(;t(l,1),!i(l););}),r&&(s.count=(i,l)=>(Zw.setTime(+i),e2.setTime(+l),e(Zw),e(e2),Math.floor(r(Zw,e2))),s.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?s.filter(a?l=>a(l)%i===0:l=>s.count(0,l)%i===0):s)),s}const bg=Va(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);bg.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Va(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):bg);bg.range;const so=1e3,hi=so*60,io=hi*60,go=io*24,qk=go*7,YF=go*30,t2=go*365,Nd=Va(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*so)},(e,t)=>(t-e)/so,e=>e.getUTCSeconds());Nd.range;const Wk=Va(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*so)},(e,t)=>{e.setTime(+e+t*hi)},(e,t)=>(t-e)/hi,e=>e.getMinutes());Wk.range;const Yk=Va(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*hi)},(e,t)=>(t-e)/hi,e=>e.getUTCMinutes());Yk.range;const Xk=Va(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*so-e.getMinutes()*hi)},(e,t)=>{e.setTime(+e+t*io)},(e,t)=>(t-e)/io,e=>e.getHours());Xk.range;const Jk=Va(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*io)},(e,t)=>(t-e)/io,e=>e.getUTCHours());Jk.range;const Vp=Va(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*hi)/go,e=>e.getDate()-1);Vp.range;const Ob=Va(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/go,e=>e.getUTCDate()-1);Ob.range;const $8=Va(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/go,e=>Math.floor(e/go));$8.range;function ru(e){return Va(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*hi)/qk)}const Pb=ru(0),vg=ru(1),Yee=ru(2),Xee=ru(3),TA=ru(4),Jee=ru(5),Zee=ru(6);Pb.range;vg.range;Yee.range;Xee.range;TA.range;Jee.range;Zee.range;function au(e){return Va(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/qk)}const Lb=au(0),yg=au(1),ete=au(2),tte=au(3),IA=au(4),rte=au(5),ate=au(6);Lb.range;yg.range;ete.range;tte.range;IA.range;rte.range;ate.range;const Zk=Va(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Zk.range;const ej=Va(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());ej.range;const bo=Va(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());bo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Va(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});bo.range;const vo=Va(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());vo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Va(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});vo.range;function V8(e,t,r,a,s,i){const l=[[Nd,1,so],[Nd,5,5*so],[Nd,15,15*so],[Nd,30,30*so],[i,1,hi],[i,5,5*hi],[i,15,15*hi],[i,30,30*hi],[s,1,io],[s,3,3*io],[s,6,6*io],[s,12,12*io],[a,1,go],[a,2,2*go],[r,1,qk],[t,1,YF],[t,3,3*YF],[e,1,t2]];function o(u,f,p){const h=f<u;h&&([u,f]=[f,u]);const m=p&&typeof p.range=="function"?p:d(u,f,p),b=m?m.range(u,+f+1):[];return h?b.reverse():b}function d(u,f,p){const h=Math.abs(f-u)/p,m=Uk(([,,y])=>y).right(l,h);if(m===l.length)return e.every($N(u/t2,f/t2,p));if(m===0)return bg.every(Math.max($N(u,f,p),1));const[b,v]=l[h/l[m-1][2]<l[m][2]/h?m-1:m];return b.every(v)}return[o,d]}const[nte,ste]=V8(vo,ej,Lb,$8,Jk,Yk),[ite,lte]=V8(bo,Zk,Pb,Vp,Xk,Wk);function r2(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function a2(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function rf(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function ote(e){var t=e.dateTime,r=e.date,a=e.time,s=e.periods,i=e.days,l=e.shortDays,o=e.months,d=e.shortMonths,u=af(s),f=nf(s),p=af(i),h=nf(i),m=af(l),b=nf(l),v=af(o),y=nf(o),j=af(d),_=nf(d),N={a:K,A:ee,b:W,B:Y,c:null,d:r5,e:r5,f:Tte,g:Qte,G:zte,H:Ste,I:Bte,j:_te,L:G8,m:Ite,M:Fte,p:M,q:O,Q:s5,s:i5,S:Dte,u:Ute,U:Mte,V:Rte,w:Ote,W:Pte,x:null,X:null,y:Lte,Y:Hte,Z:$te,"%":n5},E={a:q,A:z,b:J,B:re,c:null,d:a5,e:a5,f:qte,g:nre,G:ire,H:Vte,I:Gte,j:Kte,L:q8,m:Wte,M:Yte,p:le,q:ne,Q:s5,s:i5,S:Xte,u:Jte,U:Zte,V:ere,w:tre,W:rre,x:null,X:null,y:are,Y:sre,Z:lre,"%":n5},T={a:D,A:L,b:P,B:G,c:Q,d:e5,e:e5,f:Cte,g:ZF,G:JF,H:t5,I:t5,j:vte,L:Nte,m:bte,M:yte,p:U,q:gte,Q:jte,s:Ete,S:wte,u:fte,U:pte,V:xte,w:Ate,W:hte,x:H,X,y:ZF,Y:JF,Z:mte,"%":kte};N.x=B(r,N),N.X=B(a,N),N.c=B(t,N),E.x=B(r,E),E.X=B(a,E),E.c=B(t,E);function B(ae,ie){return function(me){var Z=[],Me=-1,pe=0,he=ae.length,ye,fe,Ue;for(me instanceof Date||(me=new Date(+me));++Me<he;)ae.charCodeAt(Me)===37&&(Z.push(ae.slice(pe,Me)),(fe=XF[ye=ae.charAt(++Me)])!=null?ye=ae.charAt(++Me):fe=ye==="e"?" ":"0",(Ue=ie[ye])&&(ye=Ue(me,fe)),Z.push(ye),pe=Me+1);return Z.push(ae.slice(pe,Me)),Z.join("")}}function F(ae,ie){return function(me){var Z=rf(1900,void 0,1),Me=R(Z,ae,me+="",0),pe,he;if(Me!=me.length)return null;if("Q"in Z)return new Date(Z.Q);if("s"in Z)return new Date(Z.s*1e3+("L"in Z?Z.L:0));if(ie&&!("Z"in Z)&&(Z.Z=0),"p"in Z&&(Z.H=Z.H%12+Z.p*12),Z.m===void 0&&(Z.m="q"in Z?Z.q:0),"V"in Z){if(Z.V<1||Z.V>53)return null;"w"in Z||(Z.w=1),"Z"in Z?(pe=a2(rf(Z.y,0,1)),he=pe.getUTCDay(),pe=he>4||he===0?yg.ceil(pe):yg(pe),pe=Ob.offset(pe,(Z.V-1)*7),Z.y=pe.getUTCFullYear(),Z.m=pe.getUTCMonth(),Z.d=pe.getUTCDate()+(Z.w+6)%7):(pe=r2(rf(Z.y,0,1)),he=pe.getDay(),pe=he>4||he===0?vg.ceil(pe):vg(pe),pe=Vp.offset(pe,(Z.V-1)*7),Z.y=pe.getFullYear(),Z.m=pe.getMonth(),Z.d=pe.getDate()+(Z.w+6)%7)}else("W"in Z||"U"in Z)&&("w"in Z||(Z.w="u"in Z?Z.u%7:"W"in Z?1:0),he="Z"in Z?a2(rf(Z.y,0,1)).getUTCDay():r2(rf(Z.y,0,1)).getDay(),Z.m=0,Z.d="W"in Z?(Z.w+6)%7+Z.W*7-(he+5)%7:Z.w+Z.U*7-(he+6)%7);return"Z"in Z?(Z.H+=Z.Z/100|0,Z.M+=Z.Z%100,a2(Z)):r2(Z)}}function R(ae,ie,me,Z){for(var Me=0,pe=ie.length,he=me.length,ye,fe;Me<pe;){if(Z>=he)return-1;if(ye=ie.charCodeAt(Me++),ye===37){if(ye=ie.charAt(Me++),fe=T[ye in XF?ie.charAt(Me++):ye],!fe||(Z=fe(ae,me,Z))<0)return-1}else if(ye!=me.charCodeAt(Z++))return-1}return Z}function U(ae,ie,me){var Z=u.exec(ie.slice(me));return Z?(ae.p=f.get(Z[0].toLowerCase()),me+Z[0].length):-1}function D(ae,ie,me){var Z=m.exec(ie.slice(me));return Z?(ae.w=b.get(Z[0].toLowerCase()),me+Z[0].length):-1}function L(ae,ie,me){var Z=p.exec(ie.slice(me));return Z?(ae.w=h.get(Z[0].toLowerCase()),me+Z[0].length):-1}function P(ae,ie,me){var Z=j.exec(ie.slice(me));return Z?(ae.m=_.get(Z[0].toLowerCase()),me+Z[0].length):-1}function G(ae,ie,me){var Z=v.exec(ie.slice(me));return Z?(ae.m=y.get(Z[0].toLowerCase()),me+Z[0].length):-1}function Q(ae,ie,me){return R(ae,t,ie,me)}function H(ae,ie,me){return R(ae,r,ie,me)}function X(ae,ie,me){return R(ae,a,ie,me)}function K(ae){return l[ae.getDay()]}function ee(ae){return i[ae.getDay()]}function W(ae){return d[ae.getMonth()]}function Y(ae){return o[ae.getMonth()]}function M(ae){return s[+(ae.getHours()>=12)]}function O(ae){return 1+~~(ae.getMonth()/3)}function q(ae){return l[ae.getUTCDay()]}function z(ae){return i[ae.getUTCDay()]}function J(ae){return d[ae.getUTCMonth()]}function re(ae){return o[ae.getUTCMonth()]}function le(ae){return s[+(ae.getUTCHours()>=12)]}function ne(ae){return 1+~~(ae.getUTCMonth()/3)}return{format:function(ae){var ie=B(ae+="",N);return ie.toString=function(){return ae},ie},parse:function(ae){var ie=F(ae+="",!1);return ie.toString=function(){return ae},ie},utcFormat:function(ae){var ie=B(ae+="",E);return ie.toString=function(){return ae},ie},utcParse:function(ae){var ie=F(ae+="",!0);return ie.toString=function(){return ae},ie}}}var XF={"-":"",_:" ",0:"0"},nn=/^\s*\d+/,cte=/^%/,dte=/[\\^$*+?|[\]().{}]/g;function tr(e,t,r){var a=e<0?"-":"",s=(a?-e:e)+"",i=s.length;return a+(i<r?new Array(r-i+1).join(t)+s:s)}function ute(e){return e.replace(dte,"\\$&")}function af(e){return new RegExp("^(?:"+e.map(ute).join("|")+")","i")}function nf(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function Ate(e,t,r){var a=nn.exec(t.slice(r,r+1));return a?(e.w=+a[0],r+a[0].length):-1}function fte(e,t,r){var a=nn.exec(t.slice(r,r+1));return a?(e.u=+a[0],r+a[0].length):-1}function pte(e,t,r){var a=nn.exec(t.slice(r,r+2));return a?(e.U=+a[0],r+a[0].length):-1}function xte(e,t,r){var a=nn.exec(t.slice(r,r+2));return a?(e.V=+a[0],r+a[0].length):-1}function hte(e,t,r){var a=nn.exec(t.slice(r,r+2));return a?(e.W=+a[0],r+a[0].length):-1}function JF(e,t,r){var a=nn.exec(t.slice(r,r+4));return a?(e.y=+a[0],r+a[0].length):-1}function ZF(e,t,r){var a=nn.exec(t.slice(r,r+2));return a?(e.y=+a[0]+(+a[0]>68?1900:2e3),r+a[0].length):-1}function mte(e,t,r){var a=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return a?(e.Z=a[1]?0:-(a[2]+(a[3]||"00")),r+a[0].length):-1}function gte(e,t,r){var a=nn.exec(t.slice(r,r+1));return a?(e.q=a[0]*3-3,r+a[0].length):-1}function bte(e,t,r){var a=nn.exec(t.slice(r,r+2));return a?(e.m=a[0]-1,r+a[0].length):-1}function e5(e,t,r){var a=nn.exec(t.slice(r,r+2));return a?(e.d=+a[0],r+a[0].length):-1}function vte(e,t,r){var a=nn.exec(t.slice(r,r+3));return a?(e.m=0,e.d=+a[0],r+a[0].length):-1}function t5(e,t,r){var a=nn.exec(t.slice(r,r+2));return a?(e.H=+a[0],r+a[0].length):-1}function yte(e,t,r){var a=nn.exec(t.slice(r,r+2));return a?(e.M=+a[0],r+a[0].length):-1}function wte(e,t,r){var a=nn.exec(t.slice(r,r+2));return a?(e.S=+a[0],r+a[0].length):-1}function Nte(e,t,r){var a=nn.exec(t.slice(r,r+3));return a?(e.L=+a[0],r+a[0].length):-1}function Cte(e,t,r){var a=nn.exec(t.slice(r,r+6));return a?(e.L=Math.floor(a[0]/1e3),r+a[0].length):-1}function kte(e,t,r){var a=cte.exec(t.slice(r,r+1));return a?r+a[0].length:-1}function jte(e,t,r){var a=nn.exec(t.slice(r));return a?(e.Q=+a[0],r+a[0].length):-1}function Ete(e,t,r){var a=nn.exec(t.slice(r));return a?(e.s=+a[0],r+a[0].length):-1}function r5(e,t){return tr(e.getDate(),t,2)}function Ste(e,t){return tr(e.getHours(),t,2)}function Bte(e,t){return tr(e.getHours()%12||12,t,2)}function _te(e,t){return tr(1+Vp.count(bo(e),e),t,3)}function G8(e,t){return tr(e.getMilliseconds(),t,3)}function Tte(e,t){return G8(e,t)+"000"}function Ite(e,t){return tr(e.getMonth()+1,t,2)}function Fte(e,t){return tr(e.getMinutes(),t,2)}function Dte(e,t){return tr(e.getSeconds(),t,2)}function Ute(e){var t=e.getDay();return t===0?7:t}function Mte(e,t){return tr(Pb.count(bo(e)-1,e),t,2)}function K8(e){var t=e.getDay();return t>=4||t===0?TA(e):TA.ceil(e)}function Rte(e,t){return e=K8(e),tr(TA.count(bo(e),e)+(bo(e).getDay()===4),t,2)}function Ote(e){return e.getDay()}function Pte(e,t){return tr(vg.count(bo(e)-1,e),t,2)}function Lte(e,t){return tr(e.getFullYear()%100,t,2)}function Qte(e,t){return e=K8(e),tr(e.getFullYear()%100,t,2)}function Hte(e,t){return tr(e.getFullYear()%1e4,t,4)}function zte(e,t){var r=e.getDay();return e=r>=4||r===0?TA(e):TA.ceil(e),tr(e.getFullYear()%1e4,t,4)}function $te(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+tr(t/60|0,"0",2)+tr(t%60,"0",2)}function a5(e,t){return tr(e.getUTCDate(),t,2)}function Vte(e,t){return tr(e.getUTCHours(),t,2)}function Gte(e,t){return tr(e.getUTCHours()%12||12,t,2)}function Kte(e,t){return tr(1+Ob.count(vo(e),e),t,3)}function q8(e,t){return tr(e.getUTCMilliseconds(),t,3)}function qte(e,t){return q8(e,t)+"000"}function Wte(e,t){return tr(e.getUTCMonth()+1,t,2)}function Yte(e,t){return tr(e.getUTCMinutes(),t,2)}function Xte(e,t){return tr(e.getUTCSeconds(),t,2)}function Jte(e){var t=e.getUTCDay();return t===0?7:t}function Zte(e,t){return tr(Lb.count(vo(e)-1,e),t,2)}function W8(e){var t=e.getUTCDay();return t>=4||t===0?IA(e):IA.ceil(e)}function ere(e,t){return e=W8(e),tr(IA.count(vo(e),e)+(vo(e).getUTCDay()===4),t,2)}function tre(e){return e.getUTCDay()}function rre(e,t){return tr(yg.count(vo(e)-1,e),t,2)}function are(e,t){return tr(e.getUTCFullYear()%100,t,2)}function nre(e,t){return e=W8(e),tr(e.getUTCFullYear()%100,t,2)}function sre(e,t){return tr(e.getUTCFullYear()%1e4,t,4)}function ire(e,t){var r=e.getUTCDay();return e=r>=4||r===0?IA(e):IA.ceil(e),tr(e.getUTCFullYear()%1e4,t,4)}function lre(){return"+0000"}function n5(){return"%"}function s5(e){return+e}function i5(e){return Math.floor(+e/1e3)}var Vu,Y8,X8;ore({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function ore(e){return Vu=ote(e),Y8=Vu.format,Vu.parse,X8=Vu.utcFormat,Vu.utcParse,Vu}function cre(e){return new Date(e)}function dre(e){return e instanceof Date?+e:+new Date(+e)}function tj(e,t,r,a,s,i,l,o,d,u){var f=Qk(),p=f.invert,h=f.domain,m=u(".%L"),b=u(":%S"),v=u("%I:%M"),y=u("%I %p"),j=u("%a %d"),_=u("%b %d"),N=u("%B"),E=u("%Y");function T(B){return(d(B)<B?m:o(B)<B?b:l(B)<B?v:i(B)<B?y:a(B)<B?s(B)<B?j:_:r(B)<B?N:E)(B)}return f.invert=function(B){return new Date(p(B))},f.domain=function(B){return arguments.length?h(Array.from(B,dre)):h().map(cre)},f.ticks=function(B){var F=h();return e(F[0],F[F.length-1],B??10)},f.tickFormat=function(B,F){return F==null?T:u(F)},f.nice=function(B){var F=h();return(!B||typeof B.range!="function")&&(B=t(F[0],F[F.length-1],B??10)),B?h(R8(F,B)):f},f.copy=function(){return $p(f,tj(e,t,r,a,s,i,l,o,d,u))},f}function ure(){return Ei.apply(tj(ite,lte,bo,Zk,Pb,Vp,Xk,Wk,Nd,Y8).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Are(){return Ei.apply(tj(nte,ste,vo,ej,Lb,Ob,Jk,Yk,Nd,X8).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Qb(){var e=0,t=1,r,a,s,i,l=Yn,o=!1,d;function u(p){return p==null||isNaN(p=+p)?d:l(s===0?.5:(p=(i(p)-r)*s,o?Math.max(0,Math.min(1,p)):p))}u.domain=function(p){return arguments.length?([e,t]=p,r=i(e=+e),a=i(t=+t),s=r===a?0:1/(a-r),u):[e,t]},u.clamp=function(p){return arguments.length?(o=!!p,u):o},u.interpolator=function(p){return arguments.length?(l=p,u):l};function f(p){return function(h){var m,b;return arguments.length?([m,b]=h,l=p(m,b),u):[l(0),l(1)]}}return u.range=f($A),u.rangeRound=f(Lk),u.unknown=function(p){return arguments.length?(d=p,u):d},function(p){return i=p,r=p(e),a=p(t),s=r===a?0:1/(a-r),u}}function zc(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function J8(){var e=Hc(Qb()(Yn));return e.copy=function(){return zc(e,J8())},Bo.apply(e,arguments)}function Z8(){var e=$k(Qb()).domain([1,10]);return e.copy=function(){return zc(e,Z8()).base(e.base())},Bo.apply(e,arguments)}function eO(){var e=Vk(Qb());return e.copy=function(){return zc(e,eO()).constant(e.constant())},Bo.apply(e,arguments)}function rj(){var e=Gk(Qb());return e.copy=function(){return zc(e,rj()).exponent(e.exponent())},Bo.apply(e,arguments)}function fre(){return rj.apply(null,arguments).exponent(.5)}function tO(){var e=[],t=Yn;function r(a){if(a!=null&&!isNaN(a=+a))return t((Hp(e,a,1)-1)/(e.length-1))}return r.domain=function(a){if(!arguments.length)return e.slice();e=[];for(let s of a)s!=null&&!isNaN(s=+s)&&e.push(s);return e.sort(jc),r},r.interpolator=function(a){return arguments.length?(t=a,r):t},r.range=function(){return e.map((a,s)=>t(s/(e.length-1)))},r.quantiles=function(a){return Array.from({length:a+1},(s,i)=>JZ(e,i/a))},r.copy=function(){return tO(t).domain(e)},Bo.apply(r,arguments)}function Hb(){var e=0,t=.5,r=1,a=1,s,i,l,o,d,u=Yn,f,p=!1,h;function m(v){return isNaN(v=+v)?h:(v=.5+((v=+f(v))-i)*(a*v<a*i?o:d),u(p?Math.max(0,Math.min(1,v)):v))}m.domain=function(v){return arguments.length?([e,t,r]=v,s=f(e=+e),i=f(t=+t),l=f(r=+r),o=s===i?0:.5/(i-s),d=i===l?0:.5/(l-i),a=i<s?-1:1,m):[e,t,r]},m.clamp=function(v){return arguments.length?(p=!!v,m):p},m.interpolator=function(v){return arguments.length?(u=v,m):u};function b(v){return function(y){var j,_,N;return arguments.length?([j,_,N]=y,u=kee(v,[j,_,N]),m):[u(0),u(.5),u(1)]}}return m.range=b($A),m.rangeRound=b(Lk),m.unknown=function(v){return arguments.length?(h=v,m):h},function(v){return f=v,s=v(e),i=v(t),l=v(r),o=s===i?0:.5/(i-s),d=i===l?0:.5/(l-i),a=i<s?-1:1,m}}function rO(){var e=Hc(Hb()(Yn));return e.copy=function(){return zc(e,rO())},Bo.apply(e,arguments)}function aO(){var e=$k(Hb()).domain([.1,1,10]);return e.copy=function(){return zc(e,aO()).base(e.base())},Bo.apply(e,arguments)}function nO(){var e=Vk(Hb());return e.copy=function(){return zc(e,nO()).constant(e.constant())},Bo.apply(e,arguments)}function aj(){var e=Gk(Hb());return e.copy=function(){return zc(e,aj()).exponent(e.exponent())},Bo.apply(e,arguments)}function pre(){return aj.apply(null,arguments).exponent(.5)}const bf=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Rk,scaleDiverging:rO,scaleDivergingLog:aO,scaleDivergingPow:aj,scaleDivergingSqrt:pre,scaleDivergingSymlog:nO,scaleIdentity:M8,scaleImplicit:VN,scaleLinear:U8,scaleLog:O8,scaleOrdinal:Mk,scalePoint:tee,scalePow:Kk,scaleQuantile:Q8,scaleQuantize:H8,scaleRadial:L8,scaleSequential:J8,scaleSequentialLog:Z8,scaleSequentialPow:rj,scaleSequentialQuantile:tO,scaleSequentialSqrt:fre,scaleSequentialSymlog:eO,scaleSqrt:qee,scaleSymlog:P8,scaleThreshold:z8,scaleTime:ure,scaleUtc:Are,tickFormat:D8},Symbol.toStringTag,{value:"Module"}));var _o=e=>e.chartData,sO=De([_o],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),iO=(e,t,r,a)=>a?sO(e):_o(e),xre=(e,t,r)=>r?sO(e):_o(e);function yo(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(Vt(t)&&Vt(r))return!0}return!1}function l5(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function lO(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,a]=e,s,i;if(Vt(r))s=r;else if(typeof r=="function")return;if(Vt(a))i=a;else if(typeof a=="function")return;var l=[s,i];if(yo(l))return l}}function hre(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var a=e(t,r);if(yo(a))return l5(a,t,r)}catch{}if(Array.isArray(e)&&e.length===2){var[s,i]=e,l,o;if(s==="auto")t!=null&&(l=Math.min(...t));else if(At(s))l=s;else if(typeof s=="function")try{t!=null&&(l=s(t==null?void 0:t[0]))}catch{}else if(typeof s=="string"&&bI.test(s)){var d=bI.exec(s);if(d==null||d[1]==null||t==null)l=void 0;else{var u=+d[1];l=t[0]-u}}else l=t==null?void 0:t[0];if(i==="auto")t!=null&&(o=Math.max(...t));else if(At(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t==null?void 0:t[1]))}catch{}else if(typeof i=="string"&&vI.test(i)){var f=vI.exec(i);if(f==null||f[1]==null||t==null)o=void 0;else{var p=+f[1];o=t[1]+p}}else o=t==null?void 0:t[1];var h=[l,o];if(yo(h))return t==null?h:l5(h,t,r)}}}var VA=1e9,mre={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},sj,qr=!0,Ci="[DecimalError] ",Bd=Ci+"Invalid argument: ",nj=Ci+"Exponent out of range: ",GA=Math.floor,md=Math.pow,gre=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ms,Ja=1e7,Ur=7,oO=9007199254740991,wg=GA(oO/Ur),lt={};lt.absoluteValue=lt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};lt.comparedTo=lt.cmp=function(e){var t,r,a,s,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(a=i.d.length,s=e.d.length,t=0,r=a<s?a:s;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return a===s?0:a>s^i.s<0?1:-1};lt.decimalPlaces=lt.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Ur;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};lt.dividedBy=lt.div=function(e){return oo(this,new this.constructor(e))};lt.dividedToIntegerBy=lt.idiv=function(e){var t=this,r=t.constructor;return Nr(oo(t,new r(e),0,1),r.precision)};lt.equals=lt.eq=function(e){return!this.cmp(e)};lt.exponent=function(){return Fa(this)};lt.greaterThan=lt.gt=function(e){return this.cmp(e)>0};lt.greaterThanOrEqualTo=lt.gte=function(e){return this.cmp(e)>=0};lt.isInteger=lt.isint=function(){return this.e>this.d.length-2};lt.isNegative=lt.isneg=function(){return this.s<0};lt.isPositive=lt.ispos=function(){return this.s>0};lt.isZero=function(){return this.s===0};lt.lessThan=lt.lt=function(e){return this.cmp(e)<0};lt.lessThanOrEqualTo=lt.lte=function(e){return this.cmp(e)<1};lt.logarithm=lt.log=function(e){var t,r=this,a=r.constructor,s=a.precision,i=s+5;if(e===void 0)e=new a(10);else if(e=new a(e),e.s<1||e.eq(Ms))throw Error(Ci+"NaN");if(r.s<1)throw Error(Ci+(r.s?"NaN":"-Infinity"));return r.eq(Ms)?new a(0):(qr=!1,t=oo(dp(r,i),dp(e,i),i),qr=!0,Nr(t,s))};lt.minus=lt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?uO(t,e):cO(t,(e.s=-e.s,e))};lt.modulo=lt.mod=function(e){var t,r=this,a=r.constructor,s=a.precision;if(e=new a(e),!e.s)throw Error(Ci+"NaN");return r.s?(qr=!1,t=oo(r,e,0,1).times(e),qr=!0,r.minus(t)):Nr(new a(r),s)};lt.naturalExponential=lt.exp=function(){return dO(this)};lt.naturalLogarithm=lt.ln=function(){return dp(this)};lt.negated=lt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};lt.plus=lt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?cO(t,e):uO(t,(e.s=-e.s,e))};lt.precision=lt.sd=function(e){var t,r,a,s=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Bd+e);if(t=Fa(s)+1,a=s.d.length-1,r=a*Ur+1,a=s.d[a],a){for(;a%10==0;a/=10)r--;for(a=s.d[0];a>=10;a/=10)r++}return e&&t>r?t:r};lt.squareRoot=lt.sqrt=function(){var e,t,r,a,s,i,l,o=this,d=o.constructor;if(o.s<1){if(!o.s)return new d(0);throw Error(Ci+"NaN")}for(e=Fa(o),qr=!1,s=Math.sqrt(+o),s==0||s==1/0?(t=hl(o.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=GA((e+1)/2)-(e<0||e%2),s==1/0?t="5e"+e:(t=s.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),a=new d(t)):a=new d(s.toString()),r=d.precision,s=l=r+3;;)if(i=a,a=i.plus(oo(o,i,l+2)).times(.5),hl(i.d).slice(0,l)===(t=hl(a.d)).slice(0,l)){if(t=t.slice(l-3,l+1),s==l&&t=="4999"){if(Nr(i,r+1,0),i.times(i).eq(o)){a=i;break}}else if(t!="9999")break;l+=4}return qr=!0,Nr(a,r)};lt.times=lt.mul=function(e){var t,r,a,s,i,l,o,d,u,f=this,p=f.constructor,h=f.d,m=(e=new p(e)).d;if(!f.s||!e.s)return new p(0);for(e.s*=f.s,r=f.e+e.e,d=h.length,u=m.length,d<u&&(i=h,h=m,m=i,l=d,d=u,u=l),i=[],l=d+u,a=l;a--;)i.push(0);for(a=u;--a>=0;){for(t=0,s=d+a;s>a;)o=i[s]+m[a]*h[s-a-1]+t,i[s--]=o%Ja|0,t=o/Ja|0;i[s]=(i[s]+t)%Ja|0}for(;!i[--l];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,qr?Nr(e,p.precision):e};lt.toDecimalPlaces=lt.todp=function(e,t){var r=this,a=r.constructor;return r=new a(r),e===void 0?r:(El(e,0,VA),t===void 0?t=a.rounding:El(t,0,8),Nr(r,e+Fa(r)+1,t))};lt.toExponential=function(e,t){var r,a=this,s=a.constructor;return e===void 0?r=$d(a,!0):(El(e,0,VA),t===void 0?t=s.rounding:El(t,0,8),a=Nr(new s(a),e+1,t),r=$d(a,!0,e+1)),r};lt.toFixed=function(e,t){var r,a,s=this,i=s.constructor;return e===void 0?$d(s):(El(e,0,VA),t===void 0?t=i.rounding:El(t,0,8),a=Nr(new i(s),e+Fa(s)+1,t),r=$d(a.abs(),!1,e+Fa(a)+1),s.isneg()&&!s.isZero()?"-"+r:r)};lt.toInteger=lt.toint=function(){var e=this,t=e.constructor;return Nr(new t(e),Fa(e)+1,t.rounding)};lt.toNumber=function(){return+this};lt.toPower=lt.pow=function(e){var t,r,a,s,i,l,o=this,d=o.constructor,u=12,f=+(e=new d(e));if(!e.s)return new d(Ms);if(o=new d(o),!o.s){if(e.s<1)throw Error(Ci+"Infinity");return o}if(o.eq(Ms))return o;if(a=d.precision,e.eq(Ms))return Nr(o,a);if(t=e.e,r=e.d.length-1,l=t>=r,i=o.s,l){if((r=f<0?-f:f)<=oO){for(s=new d(Ms),t=Math.ceil(a/Ur+4),qr=!1;r%2&&(s=s.times(o),c5(s.d,t)),r=GA(r/2),r!==0;)o=o.times(o),c5(o.d,t);return qr=!0,e.s<0?new d(Ms).div(s):Nr(s,a)}}else if(i<0)throw Error(Ci+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,o.s=1,qr=!1,s=e.times(dp(o,a+u)),qr=!0,s=dO(s),s.s=i,s};lt.toPrecision=function(e,t){var r,a,s=this,i=s.constructor;return e===void 0?(r=Fa(s),a=$d(s,r<=i.toExpNeg||r>=i.toExpPos)):(El(e,1,VA),t===void 0?t=i.rounding:El(t,0,8),s=Nr(new i(s),e,t),r=Fa(s),a=$d(s,e<=r||r<=i.toExpNeg,e)),a};lt.toSignificantDigits=lt.tosd=function(e,t){var r=this,a=r.constructor;return e===void 0?(e=a.precision,t=a.rounding):(El(e,1,VA),t===void 0?t=a.rounding:El(t,0,8)),Nr(new a(r),e,t)};lt.toString=lt.valueOf=lt.val=lt.toJSON=lt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Fa(e),r=e.constructor;return $d(e,t<=r.toExpNeg||t>=r.toExpPos)};function cO(e,t){var r,a,s,i,l,o,d,u,f=e.constructor,p=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),qr?Nr(t,p):t;if(d=e.d,u=t.d,l=e.e,s=t.e,d=d.slice(),i=l-s,i){for(i<0?(a=d,i=-i,o=u.length):(a=u,s=l,o=d.length),l=Math.ceil(p/Ur),o=l>o?l+1:o+1,i>o&&(i=o,a.length=1),a.reverse();i--;)a.push(0);a.reverse()}for(o=d.length,i=u.length,o-i<0&&(i=o,a=u,u=d,d=a),r=0;i;)r=(d[--i]=d[i]+u[i]+r)/Ja|0,d[i]%=Ja;for(r&&(d.unshift(r),++s),o=d.length;d[--o]==0;)d.pop();return t.d=d,t.e=s,qr?Nr(t,p):t}function El(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Bd+e)}function hl(e){var t,r,a,s=e.length-1,i="",l=e[0];if(s>0){for(i+=l,t=1;t<s;t++)a=e[t]+"",r=Ur-a.length,r&&(i+=xc(r)),i+=a;l=e[t],a=l+"",r=Ur-a.length,r&&(i+=xc(r))}else if(l===0)return"0";for(;l%10===0;)l/=10;return i+l}var oo=(function(){function e(a,s){var i,l=0,o=a.length;for(a=a.slice();o--;)i=a[o]*s+l,a[o]=i%Ja|0,l=i/Ja|0;return l&&a.unshift(l),a}function t(a,s,i,l){var o,d;if(i!=l)d=i>l?1:-1;else for(o=d=0;o<i;o++)if(a[o]!=s[o]){d=a[o]>s[o]?1:-1;break}return d}function r(a,s,i){for(var l=0;i--;)a[i]-=l,l=a[i]<s[i]?1:0,a[i]=l*Ja+a[i]-s[i];for(;!a[0]&&a.length>1;)a.shift()}return function(a,s,i,l){var o,d,u,f,p,h,m,b,v,y,j,_,N,E,T,B,F,R,U=a.constructor,D=a.s==s.s?1:-1,L=a.d,P=s.d;if(!a.s)return new U(a);if(!s.s)throw Error(Ci+"Division by zero");for(d=a.e-s.e,F=P.length,T=L.length,m=new U(D),b=m.d=[],u=0;P[u]==(L[u]||0);)++u;if(P[u]>(L[u]||0)&&--d,i==null?_=i=U.precision:l?_=i+(Fa(a)-Fa(s))+1:_=i,_<0)return new U(0);if(_=_/Ur+2|0,u=0,F==1)for(f=0,P=P[0],_++;(u<T||f)&&_--;u++)N=f*Ja+(L[u]||0),b[u]=N/P|0,f=N%P|0;else{for(f=Ja/(P[0]+1)|0,f>1&&(P=e(P,f),L=e(L,f),F=P.length,T=L.length),E=F,v=L.slice(0,F),y=v.length;y<F;)v[y++]=0;R=P.slice(),R.unshift(0),B=P[0],P[1]>=Ja/2&&++B;do f=0,o=t(P,v,F,y),o<0?(j=v[0],F!=y&&(j=j*Ja+(v[1]||0)),f=j/B|0,f>1?(f>=Ja&&(f=Ja-1),p=e(P,f),h=p.length,y=v.length,o=t(p,v,h,y),o==1&&(f--,r(p,F<h?R:P,h))):(f==0&&(o=f=1),p=P.slice()),h=p.length,h<y&&p.unshift(0),r(v,p,y),o==-1&&(y=v.length,o=t(P,v,F,y),o<1&&(f++,r(v,F<y?R:P,y))),y=v.length):o===0&&(f++,v=[0]),b[u++]=f,o&&v[0]?v[y++]=L[E]||0:(v=[L[E]],y=1);while((E++<T||v[0]!==void 0)&&_--)}return b[0]||b.shift(),m.e=d,Nr(m,l?i+Fa(m)+1:i)}})();function dO(e,t){var r,a,s,i,l,o,d=0,u=0,f=e.constructor,p=f.precision;if(Fa(e)>16)throw Error(nj+Fa(e));if(!e.s)return new f(Ms);for(qr=!1,o=p,l=new f(.03125);e.abs().gte(.1);)e=e.times(l),u+=5;for(a=Math.log(md(2,u))/Math.LN10*2+5|0,o+=a,r=s=i=new f(Ms),f.precision=o;;){if(s=Nr(s.times(e),o),r=r.times(++d),l=i.plus(oo(s,r,o)),hl(l.d).slice(0,o)===hl(i.d).slice(0,o)){for(;u--;)i=Nr(i.times(i),o);return f.precision=p,t==null?(qr=!0,Nr(i,p)):i}i=l}}function Fa(e){for(var t=e.e*Ur,r=e.d[0];r>=10;r/=10)t++;return t}function n2(e,t,r){if(t>e.LN10.sd())throw qr=!0,r&&(e.precision=r),Error(Ci+"LN10 precision limit exceeded");return Nr(new e(e.LN10),t)}function xc(e){for(var t="";e--;)t+="0";return t}function dp(e,t){var r,a,s,i,l,o,d,u,f,p=1,h=10,m=e,b=m.d,v=m.constructor,y=v.precision;if(m.s<1)throw Error(Ci+(m.s?"NaN":"-Infinity"));if(m.eq(Ms))return new v(0);if(t==null?(qr=!1,u=y):u=t,m.eq(10))return t==null&&(qr=!0),n2(v,u);if(u+=h,v.precision=u,r=hl(b),a=r.charAt(0),i=Fa(m),Math.abs(i)<15e14){for(;a<7&&a!=1||a==1&&r.charAt(1)>3;)m=m.times(e),r=hl(m.d),a=r.charAt(0),p++;i=Fa(m),a>1?(m=new v("0."+r),i++):m=new v(a+"."+r.slice(1))}else return d=n2(v,u+2,y).times(i+""),m=dp(new v(a+"."+r.slice(1)),u-h).plus(d),v.precision=y,t==null?(qr=!0,Nr(m,y)):m;for(o=l=m=oo(m.minus(Ms),m.plus(Ms),u),f=Nr(m.times(m),u),s=3;;){if(l=Nr(l.times(f),u),d=o.plus(oo(l,new v(s),u)),hl(d.d).slice(0,u)===hl(o.d).slice(0,u))return o=o.times(2),i!==0&&(o=o.plus(n2(v,u+2,y).times(i+""))),o=oo(o,new v(p),u),v.precision=y,t==null?(qr=!0,Nr(o,y)):o;o=d,s+=2}}function o5(e,t){var r,a,s;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(a=t.search(/e/i))>0?(r<0&&(r=a),r+=+t.slice(a+1),t=t.substring(0,a)):r<0&&(r=t.length),a=0;t.charCodeAt(a)===48;)++a;for(s=t.length;t.charCodeAt(s-1)===48;)--s;if(t=t.slice(a,s),t){if(s-=a,r=r-a-1,e.e=GA(r/Ur),e.d=[],a=(r+1)%Ur,r<0&&(a+=Ur),a<s){for(a&&e.d.push(+t.slice(0,a)),s-=Ur;a<s;)e.d.push(+t.slice(a,a+=Ur));t=t.slice(a),a=Ur-t.length}else a-=s;for(;a--;)t+="0";if(e.d.push(+t),qr&&(e.e>wg||e.e<-wg))throw Error(nj+r)}else e.s=0,e.e=0,e.d=[0];return e}function Nr(e,t,r){var a,s,i,l,o,d,u,f,p=e.d;for(l=1,i=p[0];i>=10;i/=10)l++;if(a=t-l,a<0)a+=Ur,s=t,u=p[f=0];else{if(f=Math.ceil((a+1)/Ur),i=p.length,f>=i)return e;for(u=i=p[f],l=1;i>=10;i/=10)l++;a%=Ur,s=a-Ur+l}if(r!==void 0&&(i=md(10,l-s-1),o=u/i%10|0,d=t<0||p[f+1]!==void 0||u%i,d=r<4?(o||d)&&(r==0||r==(e.s<0?3:2)):o>5||o==5&&(r==4||d||r==6&&(a>0?s>0?u/md(10,l-s):0:p[f-1])%10&1||r==(e.s<0?8:7))),t<1||!p[0])return d?(i=Fa(e),p.length=1,t=t-i-1,p[0]=md(10,(Ur-t%Ur)%Ur),e.e=GA(-t/Ur)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(a==0?(p.length=f,i=1,f--):(p.length=f+1,i=md(10,Ur-a),p[f]=s>0?(u/md(10,l-s)%md(10,s)|0)*i:0),d)for(;;)if(f==0){(p[0]+=i)==Ja&&(p[0]=1,++e.e);break}else{if(p[f]+=i,p[f]!=Ja)break;p[f--]=0,i=1}for(a=p.length;p[--a]===0;)p.pop();if(qr&&(e.e>wg||e.e<-wg))throw Error(nj+Fa(e));return e}function uO(e,t){var r,a,s,i,l,o,d,u,f,p,h=e.constructor,m=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),qr?Nr(t,m):t;if(d=e.d,p=t.d,a=t.e,u=e.e,d=d.slice(),l=u-a,l){for(f=l<0,f?(r=d,l=-l,o=p.length):(r=p,a=u,o=d.length),s=Math.max(Math.ceil(m/Ur),o)+2,l>s&&(l=s,r.length=1),r.reverse(),s=l;s--;)r.push(0);r.reverse()}else{for(s=d.length,o=p.length,f=s<o,f&&(o=s),s=0;s<o;s++)if(d[s]!=p[s]){f=d[s]<p[s];break}l=0}for(f&&(r=d,d=p,p=r,t.s=-t.s),o=d.length,s=p.length-o;s>0;--s)d[o++]=0;for(s=p.length;s>l;){if(d[--s]<p[s]){for(i=s;i&&d[--i]===0;)d[i]=Ja-1;--d[i],d[s]+=Ja}d[s]-=p[s]}for(;d[--o]===0;)d.pop();for(;d[0]===0;d.shift())--a;return d[0]?(t.d=d,t.e=a,qr?Nr(t,m):t):new h(0)}function $d(e,t,r){var a,s=Fa(e),i=hl(e.d),l=i.length;return t?(r&&(a=r-l)>0?i=i.charAt(0)+"."+i.slice(1)+xc(a):l>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+xc(-s-1)+i,r&&(a=r-l)>0&&(i+=xc(a))):s>=l?(i+=xc(s+1-l),r&&(a=r-s-1)>0&&(i=i+"."+xc(a))):((a=s+1)<l&&(i=i.slice(0,a)+"."+i.slice(a)),r&&(a=r-l)>0&&(s+1===l&&(i+="."),i+=xc(a))),e.s<0?"-"+i:i}function c5(e,t){if(e.length>t)return e.length=t,!0}function AO(e){var t,r,a;function s(i){var l=this;if(!(l instanceof s))return new s(i);if(l.constructor=s,i instanceof s){l.s=i.s,l.e=i.e,l.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Bd+i);if(i>0)l.s=1;else if(i<0)i=-i,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(i===~~i&&i<1e7){l.e=0,l.d=[i];return}return o5(l,i.toString())}else if(typeof i!="string")throw Error(Bd+i);if(i.charCodeAt(0)===45?(i=i.slice(1),l.s=-1):l.s=1,gre.test(i))o5(l,i);else throw Error(Bd+i)}if(s.prototype=lt,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=AO,s.config=s.set=bre,e===void 0&&(e={}),e)for(a=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<a.length;)e.hasOwnProperty(r=a[t++])||(e[r]=this[r]);return s.config(e),s}function bre(e){if(!e||typeof e!="object")throw Error(Ci+"Object expected");var t,r,a,s=["precision",1,VA,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<s.length;t+=3)if((a=e[r=s[t]])!==void 0)if(GA(a)===a&&a>=s[t+1]&&a<=s[t+2])this[r]=a;else throw Error(Bd+r+": "+a);if((a=e[r="LN10"])!==void 0)if(a==Math.LN10)this[r]=new this(a);else throw Error(Bd+r+": "+a);return this}var sj=AO(mre);Ms=new sj(1);const dr=sj;function fO(e){var t;return e===0?t=1:t=Math.floor(new dr(e).abs().log(10).toNumber())+1,t}function pO(e,t,r){for(var a=new dr(e),s=0,i=[];a.lt(t)&&s<1e5;)i.push(a.toNumber()),a=a.add(r),s++;return i}var xO=e=>{var[t,r]=e,[a,s]=[t,r];return t>r&&([a,s]=[r,t]),[a,s]},hO=(e,t,r)=>{if(e.lte(0))return new dr(0);var a=fO(e.toNumber()),s=new dr(10).pow(a),i=e.div(s),l=a!==1?.05:.1,o=new dr(Math.ceil(i.div(l).toNumber())).add(r).mul(l),d=o.mul(s);return t?new dr(d.toNumber()):new dr(Math.ceil(d.toNumber()))},vre=(e,t,r)=>{var a=new dr(1),s=new dr(e);if(!s.isint()&&r){var i=Math.abs(e);i<1?(a=new dr(10).pow(fO(e)-1),s=new dr(Math.floor(s.div(a).toNumber())).mul(a)):i>1&&(s=new dr(Math.floor(e)))}else e===0?s=new dr(Math.floor((t-1)/2)):r||(s=new dr(Math.floor(e)));for(var l=Math.floor((t-1)/2),o=[],d=0;d<t;d++)o.push(s.add(new dr(d-l).mul(a)).toNumber());return o},mO=function(t,r,a,s){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((r-t)/(a-1)))return{step:new dr(0),tickMin:new dr(0),tickMax:new dr(0)};var l=hO(new dr(r).sub(t).div(a-1),s,i),o;t<=0&&r>=0?o=new dr(0):(o=new dr(t).add(r).div(2),o=o.sub(new dr(o).mod(l)));var d=Math.ceil(o.sub(t).div(l).toNumber()),u=Math.ceil(new dr(r).sub(o).div(l).toNumber()),f=d+u+1;return f>a?mO(t,r,a,s,i+1):(f<a&&(u=r>0?u+(a-f):u,d=r>0?d:d+(a-f)),{step:l,tickMin:o.sub(new dr(d).mul(l)),tickMax:o.add(new dr(u).mul(l))})},yre=function(t){var[r,a]=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Math.max(s,2),[o,d]=xO([r,a]);if(o===-1/0||d===1/0){var u=d===1/0?[o,...Array(s-1).fill(1/0)]:[...Array(s-1).fill(-1/0),d];return r>a?u.reverse():u}if(o===d)return vre(o,s,i);var{step:f,tickMin:p,tickMax:h}=mO(o,d,l,i,0),m=pO(p,h.add(new dr(.1).mul(f)),f);return r>a?m.reverse():m},wre=function(t,r){var[a,s]=t,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[l,o]=xO([a,s]);if(l===-1/0||o===1/0)return[a,s];if(l===o)return[l];var d=Math.max(r,2),u=hO(new dr(o).sub(l).div(d-1),i,0),f=[...pO(new dr(l),new dr(o),u),o];return i===!1&&(f=f.map(p=>Math.round(p))),a>s?f.reverse():f},Nre=e=>e.rootProps.barCategoryGap,zb=e=>e.rootProps.stackOffset,gO=e=>e.rootProps.reverseStackOrder,ij=e=>e.options.chartName,lj=e=>e.rootProps.syncId,bO=e=>e.rootProps.syncMethod,oj=e=>e.options.eventEmitter,Cre=e=>e.rootProps.baseValue,Xn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},fd={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},ll={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},$b=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Vb(e,t,r){if(r!=="auto")return r;if(e!=null)return _l(e,t)?"category":"number"}function d5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Ng(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?d5(Object(r),!0).forEach(function(a){kre(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function kre(e,t,r){return(t=jre(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jre(e){var t=Ere(e,"string");return typeof t=="symbol"?t:t+""}function Ere(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var u5={allowDataOverflow:fd.allowDataOverflow,allowDecimals:fd.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:fd.angleAxisId,includeHidden:!1,name:void 0,reversed:fd.reversed,scale:fd.scale,tick:fd.tick,tickCount:void 0,ticks:void 0,type:fd.type,unit:void 0},A5={allowDataOverflow:ll.allowDataOverflow,allowDecimals:ll.allowDecimals,allowDuplicatedCategory:ll.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:ll.radiusAxisId,includeHidden:ll.includeHidden,name:void 0,reversed:ll.reversed,scale:ll.scale,tick:ll.tick,tickCount:ll.tickCount,ticks:void 0,type:ll.type,unit:void 0},Sre=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},cj=De([Sre,c8],(e,t)=>{var r;if(e!=null)return e;var a=(r=Vb(t,"angleAxis",u5.type))!==null&&r!==void 0?r:"category";return Ng(Ng({},u5),{},{type:a})}),Bre=(e,t)=>e.polarAxis.radiusAxis[t],dj=De([Bre,c8],(e,t)=>{var r;if(e!=null)return e;var a=(r=Vb(t,"radiusAxis",A5.type))!==null&&r!==void 0?r:"category";return Ng(Ng({},A5),{},{type:a})}),Gb=e=>e.polarOptions,uj=De([Eo,So,Sn],kZ),vO=De([Gb,uj],(e,t)=>{if(e!=null)return Fc(e.innerRadius,t,0)}),yO=De([Gb,uj],(e,t)=>{if(e!=null)return Fc(e.outerRadius,t,t*.8)}),_re=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},wO=De([Gb],_re);De([cj,wO],$b);var NO=De([uj,vO,yO],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});De([dj,NO],$b);var CO=De([Yr,Gb,vO,yO,Eo,So],(e,t,r,a,s,i)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||a==null)){var{cx:l,cy:o,startAngle:d,endAngle:u}=t;return{cx:Fc(l,s,s/2),cy:Fc(o,i,i/2),innerRadius:r,outerRadius:a,startAngle:d,endAngle:u,clockWise:!1}}}),sn=(e,t)=>t,Kb=(e,t,r)=>r;function Aj(e){return e==null?void 0:e.id}function kO(e,t,r){var{chartData:a=[]}=t,{allowDuplicatedCategory:s,dataKey:i}=r,l=new Map;return e.forEach(o=>{var d,u=(d=o.data)!==null&&d!==void 0?d:a;if(!(u==null||u.length===0)){var f=Aj(o);u.forEach((p,h)=>{var m=i==null||s?h:String(Cn(p,i,null)),b=Cn(p,o.dataKey,0),v;l.has(m)?v=l.get(m):v={},Object.assign(v,{[f]:b}),l.set(m,v)})}}),Array.from(l.values())}function fj(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var qb=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Wb(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Tre(e,t){if(e.length===t.length){for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return!1}var ln=e=>{var t=Yr(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},KA=e=>e.tooltip.settings.axisId;function Ire(e){if(e in bf)return bf[e]();var t="scale".concat(gk(e));if(t in bf)return bf[t]()}function f5(e){var t=e.ticks,r=e.bandwidth,a=e.range(),s=[Math.min(...a),Math.max(...a)];return{domain:()=>e.domain(),range:(function(i){function l(){return i.apply(this,arguments)}return l.toString=function(){return i.toString()},l})(()=>s),rangeMin:()=>s[0],rangeMax:()=>s[1],isInRange(i){var l=s[0],o=s[1];return l<=o?i>=l&&i<=o:i>=o&&i<=l},bandwidth:r?()=>r.call(e):void 0,ticks:t?i=>t.call(e,i):void 0,map:(i,l)=>{var o=e(i);if(o!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var d=e.bandwidth();switch(l.position){case"middle":o+=d/2;break;case"end":o+=d;break}}return o}}}}function p5(e,t,r){if(typeof e=="function")return f5(e.copy().domain(t).range(r));if(e!=null){var a=Ire(e);if(a!=null)return a.domain(t).range(r),f5(a)}}var Fre=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!yo(t)){for(var r,a,s=0;s<t.length;s++){var i=t[s];Vt(i)&&((r===void 0||i<r)&&(r=i),(a===void 0||i>a)&&(a=i))}return r!==void 0&&a!==void 0?[r,a]:void 0}return t}default:return t}};function x5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Cg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x5(Object(r),!0).forEach(function(a){Dre(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Dre(e,t,r){return(t=Ure(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ure(e){var t=Mre(e,"string");return typeof t=="symbol"?t:t+""}function Mre(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WN=[0,"auto"],Ya={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0},jO=(e,t)=>e.cartesianAxis.xAxis[t],To=(e,t)=>{var r=jO(e,t);return r??Ya},Xa={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:WN,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:Op},EO=(e,t)=>e.cartesianAxis.yAxis[t],Io=(e,t)=>{var r=EO(e,t);return r??Xa},Rre={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},pj=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??Rre},as=(e,t,r)=>{switch(t){case"xAxis":return To(e,r);case"yAxis":return Io(e,r);case"zAxis":return pj(e,r);case"angleAxis":return cj(e,r);case"radiusAxis":return dj(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},Ore=(e,t,r)=>{switch(t){case"xAxis":return To(e,r);case"yAxis":return Io(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},Gp=(e,t,r)=>{switch(t){case"xAxis":return To(e,r);case"yAxis":return Io(e,r);case"angleAxis":return cj(e,r);case"radiusAxis":return dj(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},SO=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function BO(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var _O=e=>e.graphicalItems.cartesianItems,Pre=De([sn,Kb],BO),TO=(e,t,r)=>e.filter(r).filter(a=>(t==null?void 0:t.includeHidden)===!0?!0:!a.hide),Kp=De([_O,as,Pre],TO,{memoizeOptions:{resultEqualityCheck:Wb}}),IO=De([Kp],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(fj)),FO=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Lre=De([Kp],FO),DO=e=>e.map(t=>t.data).filter(Boolean).flat(1),Qre=De([Kp],DO,{memoizeOptions:{resultEqualityCheck:Wb}}),UO=(e,t)=>{var{chartData:r=[],dataStartIndex:a,dataEndIndex:s}=t;return e.length>0?e:r.slice(a,s+1)},xj=De([Qre,iO],UO),MO=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(a=>({value:Cn(a,t.dataKey)})):r.length>0?r.map(a=>a.dataKey).flatMap(a=>e.map(s=>({value:Cn(s,a)}))):e.map(a=>({value:a})),Yb=De([xj,as,Kp],MO);function RO(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Tm(e){if(kl(e)||e instanceof Date){var t=Number(e);if(Vt(t))return t}}function h5(e){if(Array.isArray(e)){var t=[Tm(e[0]),Tm(e[1])];return yo(t)?t:void 0}var r=Tm(e);if(r!=null)return[r,r]}function wo(e){return e.map(Tm).filter(xs)}function Hre(e,t,r){return!r||typeof t!="number"||Cl(t)?[]:r.length?wo(r.flatMap(a=>{var s=Cn(e,a.dataKey),i,l;if(Array.isArray(s)?[i,l]=s:i=l=s,!(!Vt(i)||!Vt(l)))return[t-i,t+l]})):[]}var Ga=e=>{var t=ln(e),r=KA(e);return Gp(e,t,r)},qp=De([Ga],e=>e==null?void 0:e.dataKey),zre=De([IO,iO,Ga],kO),OO=(e,t,r,a)=>{var s={},i=t.reduce((l,o)=>{if(o.stackId==null)return l;var d=l[o.stackId];return d==null&&(d=[]),d.push(o),l[o.stackId]=d,l},s);return Object.fromEntries(Object.entries(i).map(l=>{var[o,d]=l,u=a?[...d].reverse():d,f=u.map(Aj);return[o,{stackedData:xX(e,f,r),graphicalItems:u}]}))},PO=De([zre,IO,zb,gO],OO),LO=(e,t,r,a)=>{var{dataStartIndex:s,dataEndIndex:i}=t;if(a==null&&r!=="zAxis"){var l=bX(e,s,i);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},$re=De([as],e=>e.allowDataOverflow),hj=e=>{var t;if(e==null||!("domain"in e))return WN;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=wo(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:WN},QO=De([as],hj),HO=De([QO,$re],lO),Vre=De([PO,_o,sn,HO],LO,{memoizeOptions:{resultEqualityCheck:qb}}),mj=e=>e.errorBars,Gre=(e,t,r)=>e.flatMap(a=>t[a.id]).filter(Boolean).filter(a=>RO(r,a)),kg=function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];var s=r.filter(Boolean);if(s.length!==0){var i=s.flat(),l=Math.min(...i),o=Math.max(...i);return[l,o]}},zO=(e,t,r,a,s)=>{var i,l;if(r.length>0&&e.forEach(o=>{r.forEach(d=>{var u,f,p=(u=a[d.id])===null||u===void 0?void 0:u.filter(j=>RO(s,j)),h=Cn(o,(f=t.dataKey)!==null&&f!==void 0?f:d.dataKey),m=Hre(o,h,p);if(m.length>=2){var b=Math.min(...m),v=Math.max(...m);(i==null||b<i)&&(i=b),(l==null||v>l)&&(l=v)}var y=h5(h);y!=null&&(i=i==null?y[0]:Math.min(i,y[0]),l=l==null?y[1]:Math.max(l,y[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(o=>{var d=h5(Cn(o,t.dataKey));d!=null&&(i=i==null?d[0]:Math.min(i,d[0]),l=l==null?d[1]:Math.max(l,d[1]))}),Vt(i)&&Vt(l))return[i,l]},Kre=De([xj,as,Lre,mj,sn],zO,{memoizeOptions:{resultEqualityCheck:qb}});function qre(e){var{value:t}=e;if(kl(t)||t instanceof Date)return t}var Wre=(e,t,r)=>{var a=e.map(qre).filter(s=>s!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&lR(a))?k8(0,e.length):t.allowDuplicatedCategory?a:Array.from(new Set(a))},$O=e=>e.referenceElements.dots,qA=(e,t,r)=>e.filter(a=>a.ifOverflow==="extendDomain").filter(a=>t==="xAxis"?a.xAxisId===r:a.yAxisId===r),Yre=De([$O,sn,Kb],qA),VO=e=>e.referenceElements.areas,Xre=De([VO,sn,Kb],qA),GO=e=>e.referenceElements.lines,Jre=De([GO,sn,Kb],qA),KO=(e,t)=>{if(e!=null){var r=wo(e.map(a=>t==="xAxis"?a.x:a.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Zre=De(Yre,sn,KO),qO=(e,t)=>{if(e!=null){var r=wo(e.flatMap(a=>[t==="xAxis"?a.x1:a.y1,t==="xAxis"?a.x2:a.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},eae=De([Xre,sn],qO);function tae(e){var t;if(e.x!=null)return wo([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.x);return r==null||r.length===0?[]:wo(r)}function rae(e){var t;if(e.y!=null)return wo([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.y);return r==null||r.length===0?[]:wo(r)}var WO=(e,t)=>{if(e!=null){var r=e.flatMap(a=>t==="xAxis"?tae(a):rae(a));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},aae=De([Jre,sn],WO),nae=De(Zre,aae,eae,(e,t,r)=>kg(e,r,t)),YO=(e,t,r,a,s,i,l,o)=>{if(r!=null)return r;var d=l==="vertical"&&o==="xAxis"||l==="horizontal"&&o==="yAxis",u=d?kg(a,i,s):kg(i,s);return hre(t,u,e.allowDataOverflow)},sae=De([as,QO,HO,Vre,Kre,nae,Yr,sn],YO,{memoizeOptions:{resultEqualityCheck:qb}}),iae=[0,1],XO=(e,t,r,a,s,i,l)=>{if(!((e==null||r==null||r.length===0)&&l===void 0)){var{dataKey:o,type:d}=e,u=_l(t,i);if(u&&o==null){var f;return k8(0,(f=r==null?void 0:r.length)!==null&&f!==void 0?f:0)}return d==="category"?Wre(a,e,u):s==="expand"?iae:l}},gj=De([as,Yr,xj,Yb,zb,sn,sae],XO);function lae(e){return e in bf}var JO=(e,t,r)=>{if(e!=null){var{scale:a,type:s}=e;if(a==="auto")return s==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":s==="category"?"band":"linear";if(typeof a=="string"){var i="scale".concat(gk(a));return lae(i)?i:"point"}}},WA=De([as,SO,ij],JO);function bj(e,t,r,a){if(!(r==null||a==null))return typeof e.scale=="function"?p5(e.scale,r,a):p5(t,r,a)}var ZO=(e,t,r)=>{var a=hj(t);if(!(r!=="auto"&&r!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(a)&&(a[0]==="auto"||a[1]==="auto")&&yo(e))return yre(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&yo(e))return wre(e,t.tickCount,t.allowDecimals)}},vj=De([gj,Gp,WA],ZO),eP=(e,t,r,a)=>{if(a!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&yo(t)&&Array.isArray(r)&&r.length>0){var s,i,l=t[0],o=(s=r[0])!==null&&s!==void 0?s:0,d=t[1],u=(i=r[r.length-1])!==null&&i!==void 0?i:0;return[Math.min(l,o),Math.max(d,u)]}return t},oae=De([as,gj,vj,sn],eP),cae=De(Yb,as,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,a=Array.from(wo(e.map(p=>p.value))).sort((p,h)=>p-h),s=a[0],i=a[a.length-1];if(s==null||i==null)return 1/0;var l=i-s;if(l===0)return 1/0;for(var o=0;o<a.length-1;o++){var d=a[o],u=a[o+1];if(!(d==null||u==null)){var f=u-d;r=Math.min(r,f)}}return r/l}}),tP=De(cae,Yr,Nre,Sn,(e,t,r,a,s)=>s,(e,t,r,a,s)=>{if(!Vt(e))return 0;var i=t==="vertical"?a.height:a.width;if(s==="gap")return e*i/2;if(s==="no-gap"){var l=Fc(r,e*i),o=e*i/2;return o-l-(o-l)/i*l}return 0}),dae=(e,t,r)=>{var a=To(e,t);return a==null||typeof a.padding!="string"?0:tP(e,"xAxis",t,r,a.padding)},uae=(e,t,r)=>{var a=Io(e,t);return a==null||typeof a.padding!="string"?0:tP(e,"yAxis",t,r,a.padding)},Aae=De(To,dae,(e,t)=>{var r,a;if(e==null)return{left:0,right:0};var{padding:s}=e;return typeof s=="string"?{left:t,right:t}:{left:((r=s.left)!==null&&r!==void 0?r:0)+t,right:((a=s.right)!==null&&a!==void 0?a:0)+t}}),fae=De(Io,uae,(e,t)=>{var r,a;if(e==null)return{top:0,bottom:0};var{padding:s}=e;return typeof s=="string"?{top:t,bottom:t}:{top:((r=s.top)!==null&&r!==void 0?r:0)+t,bottom:((a=s.bottom)!==null&&a!==void 0?a:0)+t}}),pae=De([Sn,Aae,Ib,Tb,(e,t,r)=>r],(e,t,r,a,s)=>{var{padding:i}=a;return s?[i.left,r.width-i.right]:[e.left+t.left,e.left+e.width-t.right]}),xae=De([Sn,Yr,fae,Ib,Tb,(e,t,r)=>r],(e,t,r,a,s,i)=>{var{padding:l}=s;return i?[a.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),Wp=(e,t,r,a)=>{var s;switch(t){case"xAxis":return pae(e,r,a);case"yAxis":return xae(e,r,a);case"zAxis":return(s=pj(e,r))===null||s===void 0?void 0:s.range;case"angleAxis":return wO(e);case"radiusAxis":return NO(e,r);default:return}},rP=De([as,Wp],$b),hae=De([WA,oae],Fre),Xb=De([as,WA,hae,rP],bj);De([Kp,mj,sn],Gre);function aP(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Jb=(e,t)=>t,Zb=(e,t,r)=>r,mae=De(Bb,Jb,Zb,(e,t,r)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===r).sort(aP)),gae=De(_b,Jb,Zb,(e,t,r)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===r).sort(aP)),nP=(e,t)=>({width:e.width,height:t.height}),bae=(e,t)=>{var r=typeof t.width=="number"?t.width:Op;return{width:r,height:e.height}},vae=De(Sn,To,nP),yae=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},wae=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},Nae=De(So,Sn,mae,Jb,Zb,(e,t,r,a,s)=>{var i={},l;return r.forEach(o=>{var d=nP(t,o);l==null&&(l=yae(t,a,e));var u=a==="top"&&!s||a==="bottom"&&s;i[o.id]=l-Number(u)*d.height,l+=(u?-1:1)*d.height}),i}),Cae=De(Eo,Sn,gae,Jb,Zb,(e,t,r,a,s)=>{var i={},l;return r.forEach(o=>{var d=bae(t,o);l==null&&(l=wae(t,a,e));var u=a==="left"&&!s||a==="right"&&s;i[o.id]=l-Number(u)*d.width,l+=(u?-1:1)*d.width}),i}),kae=(e,t)=>{var r=To(e,t);if(r!=null)return Nae(e,r.orientation,r.mirror)},jae=De([Sn,To,kae,(e,t)=>t],(e,t,r,a)=>{if(t!=null){var s=r==null?void 0:r[a];return s==null?{x:e.left,y:0}:{x:e.left,y:s}}}),Eae=(e,t)=>{var r=Io(e,t);if(r!=null)return Cae(e,r.orientation,r.mirror)},Sae=De([Sn,Io,Eae,(e,t)=>t],(e,t,r,a)=>{if(t!=null){var s=r==null?void 0:r[a];return s==null?{x:0,y:e.top}:{x:s,y:e.top}}}),Bae=De(Sn,Io,(e,t)=>{var r=typeof t.width=="number"?t.width:Op;return{width:r,height:e.height}}),sP=(e,t,r,a)=>{if(r!=null){var{allowDuplicatedCategory:s,type:i,dataKey:l}=r,o=_l(e,a),d=t.map(u=>u.value);if(l&&o&&i==="category"&&s&&lR(d))return d}},yj=De([Yr,Yb,as,sn],sP),iP=(e,t,r,a)=>{if(!(r==null||r.dataKey==null)){var{type:s,scale:i}=r,l=_l(e,a);if(l&&(s==="number"||i!=="auto"))return t.map(o=>o.value)}},wj=De([Yr,Yb,Gp,sn],iP),m5=De([Yr,Ore,WA,Xb,yj,wj,Wp,vj,sn],(e,t,r,a,s,i,l,o,d)=>{if(t!=null){var u=_l(e,d);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:d,categoricalDomain:i,duplicateDomain:s,isCategorical:u,niceTicks:o,range:l,realScaleType:r,scale:a}}}),_ae=(e,t,r,a,s,i,l,o,d)=>{if(!(t==null||a==null)){var u=_l(e,d),{type:f,ticks:p,tickCount:h}=t,m=r==="scaleBand"&&typeof a.bandwidth=="function"?a.bandwidth()/2:2,b=f==="category"&&a.bandwidth?a.bandwidth()/m:0;b=d==="angleAxis"&&i!=null&&i.length>=2?xi(i[0]-i[1])*2*b:b;var v=p||s;return v?v.map((y,j)=>{var _=l?l.indexOf(y):y,N=a.map(_);return Vt(N)?{index:j,coordinate:N+b,value:y,offset:b}:null}).filter(xs):u&&o?o.map((y,j)=>{var _=a.map(y);return Vt(_)?{coordinate:_+b,value:y,index:j,offset:b}:null}).filter(xs):a.ticks?a.ticks(h).map((y,j)=>{var _=a.map(y);return Vt(_)?{coordinate:_+b,value:y,index:j,offset:b}:null}).filter(xs):a.domain().map((y,j)=>{var _=a.map(y);return Vt(_)?{coordinate:_+b,value:l?l[y]:y,index:j,offset:b}:null}).filter(xs)}},lP=De([Yr,Gp,WA,Xb,vj,Wp,yj,wj,sn],_ae),Tae=(e,t,r,a,s,i,l)=>{if(!(t==null||r==null||a==null||a[0]===a[1])){var o=_l(e,l),{tickCount:d}=t,u=0;return u=l==="angleAxis"&&(a==null?void 0:a.length)>=2?xi(a[0]-a[1])*2*u:u,o&&i?i.map((f,p)=>{var h=r.map(f);return Vt(h)?{coordinate:h+u,value:f,index:p,offset:u}:null}).filter(xs):r.ticks?r.ticks(d).map((f,p)=>{var h=r.map(f);return Vt(h)?{coordinate:h+u,value:f,index:p,offset:u}:null}).filter(xs):r.domain().map((f,p)=>{var h=r.map(f);return Vt(h)?{coordinate:h+u,value:s?s[f]:f,index:p,offset:u}:null}).filter(xs)}},oP=De([Yr,Gp,Xb,Wp,yj,wj,sn],Tae),cP=De(as,Xb,(e,t)=>{if(!(e==null||t==null))return Cg(Cg({},e),{},{scale:t})}),Iae=De([as,WA,gj,rP],bj);De((e,t,r)=>pj(e,r),Iae,(e,t)=>{if(!(e==null||t==null))return Cg(Cg({},e),{},{scale:t})});var Fae=De([Yr,Bb,_b],(e,t,r)=>{switch(e){case"horizontal":return t.some(a=>a.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(a=>a.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),dP=e=>e.options.defaultTooltipEventType,uP=e=>e.options.validateTooltipEventTypes;function AP(e,t,r){if(e==null)return t;var a=e?"axis":"item";return r==null?t:r.includes(a)?a:t}function Nj(e,t){var r=dP(e),a=uP(e);return AP(t,r,a)}function Dae(e){return gt(t=>Nj(t,e))}var fP=(e,t)=>{var r,a=Number(t);if(!(Cl(a)||t==null))return a>=0?e==null||(r=e[a])===null||r===void 0?void 0:r.value:void 0},Uae=e=>e.tooltip.settings,gc={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},Mae={itemInteraction:{click:gc,hover:gc},axisInteraction:{click:gc,hover:gc},keyboardInteraction:gc,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},pP=ws({name:"tooltip",initialState:Mae,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Gr()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:a}=t.payload,s=Hi(e).tooltipItemPayloads.indexOf(r);s>-1&&(e.tooltipItemPayloads[s]=a)},prepare:Gr()},removeTooltipEntrySettings:{reducer(e,t){var r=Hi(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:Gr()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:Rae,replaceTooltipEntrySettings:Oae,removeTooltipEntrySettings:Pae,setTooltipSettingsState:Lae,setActiveMouseOverItemIndex:Qae,mouseLeaveItem:NFe,mouseLeaveChart:xP,setActiveClickItemIndex:CFe,setMouseOverAxisIndex:hP,setMouseClickAxisIndex:Hae,setSyncInteraction:YN,setKeyboardInteraction:XN}=pP.actions,zae=pP.reducer;function g5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Fh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?g5(Object(r),!0).forEach(function(a){$ae(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function $ae(e,t,r){return(t=Vae(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vae(e){var t=Gae(e,"string");return typeof t=="symbol"?t:t+""}function Gae(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Kae(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function qae(e){return e.index!=null}var mP=(e,t,r,a)=>{if(t==null)return gc;var s=Kae(e,t,r);if(s==null)return gc;if(s.active)return s;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var i=e.settings.active===!0;if(qae(s)){if(i)return Fh(Fh({},s),{},{active:!0})}else if(a!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:a,graphicalItemId:void 0};return Fh(Fh({},gc),{},{coordinate:s.coordinate})};function Wae(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}function Yae(e,t){var r=Wae(e),a=t[0],s=t[1];if(r===void 0)return!1;var i=Math.min(a,s),l=Math.max(a,s);return r>=i&&r<=l}function Xae(e,t,r){if(r==null||t==null)return!0;var a=Cn(e,t);return a==null||!yo(r)?!0:Yae(a,r)}var Cj=(e,t,r,a)=>{var s=e==null?void 0:e.index;if(s==null)return null;var i=Number(s);if(!Vt(i))return s;var l=0,o=1/0;t.length>0&&(o=t.length-1);var d=Math.max(l,Math.min(i,o)),u=t[d];return u==null||Xae(u,r,a)?String(d):null},gP=(e,t,r,a,s,i,l)=>{if(i!=null){var o=l[0],d=o==null?void 0:o.getPosition(i);if(d!=null)return d;var u=s==null?void 0:s[Number(i)];if(u)switch(r){case"horizontal":return{x:u.coordinate,y:(a.top+t)/2};default:return{x:(a.left+e)/2,y:u.coordinate}}}},bP=(e,t,r,a)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var s;if(r==="hover"?s=e.itemInteraction.hover.graphicalItemId:s=e.itemInteraction.click.graphicalItemId,s==null&&a!=null){var i=e.tooltipItemPayloads[0];return i!=null?[i]:[]}return e.tooltipItemPayloads.filter(l=>{var o;return((o=l.settings)===null||o===void 0?void 0:o.graphicalItemId)===s})},vP=e=>e.options.tooltipPayloadSearcher,YA=e=>e.tooltip;function b5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function v5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?b5(Object(r),!0).forEach(function(a){Jae(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Jae(e,t,r){return(t=Zae(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zae(e){var t=ene(e,"string");return typeof t=="symbol"?t:t+""}function ene(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function tne(e,t){return e??t}var yP=(e,t,r,a,s,i,l)=>{if(!(t==null||i==null)){var{chartData:o,computedData:d,dataStartIndex:u,dataEndIndex:f}=r,p=[];return e.reduce((h,m)=>{var b,{dataDefinedOnItem:v,settings:y}=m,j=tne(v,o),_=Array.isArray(j)?XR(j,u,f):j,N=(b=y==null?void 0:y.dataKey)!==null&&b!==void 0?b:a,E=y==null?void 0:y.nameKey,T;if(a&&Array.isArray(_)&&!Array.isArray(_[0])&&l==="axis"?T=oR(_,a,s):T=i(_,t,d,E),Array.isArray(T))T.forEach(F=>{var R=v5(v5({},y),{},{name:F.name,unit:F.unit,color:void 0,fill:void 0});h.push(yI({tooltipEntrySettings:R,dataKey:F.dataKey,payload:F.payload,value:Cn(F.payload,F.dataKey),name:F.name}))});else{var B;h.push(yI({tooltipEntrySettings:y,dataKey:N,payload:T,value:Cn(T,N),name:(B=Cn(T,E))!==null&&B!==void 0?B:y==null?void 0:y.name}))}return h},p)}},kj=De([Ga,SO,ij],JO),rne=De([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),ane=De([ln,KA],BO),XA=De([rne,Ga,ane],TO,{memoizeOptions:{resultEqualityCheck:Wb}}),nne=De([XA],e=>e.filter(fj)),sne=De([XA],DO,{memoizeOptions:{resultEqualityCheck:Wb}}),JA=De([sne,_o],UO),ine=De([nne,_o,Ga],kO),jj=De([JA,Ga,XA],MO),wP=De([Ga],hj),lne=De([Ga],e=>e.allowDataOverflow),NP=De([wP,lne],lO),one=De([XA],e=>e.filter(fj)),cne=De([ine,one,zb,gO],OO),dne=De([cne,_o,ln,NP],LO),une=De([XA],FO),Ane=De([JA,Ga,une,mj,ln],zO,{memoizeOptions:{resultEqualityCheck:qb}}),fne=De([$O,ln,KA],qA),pne=De([fne,ln],KO),xne=De([VO,ln,KA],qA),hne=De([xne,ln],qO),mne=De([GO,ln,KA],qA),gne=De([mne,ln],WO),bne=De([pne,gne,hne],kg),vne=De([Ga,wP,NP,dne,Ane,bne,Yr,ln],YO),Yp=De([Ga,Yr,JA,jj,zb,ln,vne],XO),yne=De([Yp,Ga,kj],ZO),wne=De([Ga,Yp,yne,ln],eP),CP=e=>{var t=ln(e),r=KA(e),a=!1;return Wp(e,t,r,a)},kP=De([Ga,CP],$b),jP=De([Ga,kj,wne,kP],bj),Nne=De([Yr,jj,Ga,ln],sP),Cne=De([Yr,jj,Ga,ln],iP),kne=(e,t,r,a,s,i,l,o)=>{if(t){var{type:d}=t,u=_l(e,o);if(a){var f=r==="scaleBand"&&a.bandwidth?a.bandwidth()/2:2,p=d==="category"&&a.bandwidth?a.bandwidth()/f:0;return p=o==="angleAxis"&&s!=null&&(s==null?void 0:s.length)>=2?xi(s[0]-s[1])*2*p:p,u&&l?l.map((h,m)=>{var b=a.map(h);return Vt(b)?{coordinate:b+p,value:h,index:m,offset:p}:null}).filter(xs):a.domain().map((h,m)=>{var b=a.map(h);return Vt(b)?{coordinate:b+p,value:i?i[h]:h,index:m,offset:p}:null}).filter(xs)}}},Fo=De([Yr,Ga,kj,jP,CP,Nne,Cne,ln],kne),Ej=De([dP,uP,Uae],(e,t,r)=>AP(r.shared,e,t)),EP=e=>e.tooltip.settings.trigger,Sj=e=>e.tooltip.settings.defaultIndex,Xp=De([YA,Ej,EP,Sj],mP),up=De([Xp,JA,qp,Yp],Cj),SP=De([Fo,up],fP),jne=De([Xp],e=>{if(e)return e.dataKey});De([Xp],e=>{if(e)return e.graphicalItemId});var BP=De([YA,Ej,EP,Sj],bP),Ene=De([Eo,So,Yr,Sn,Fo,Sj,BP],gP),Sne=De([Xp,Ene],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),Bne=De([Xp],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),_ne=De([BP,up,_o,qp,SP,vP,Ej],yP),Tne=De([_ne],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function y5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function w5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?y5(Object(r),!0).forEach(function(a){Ine(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):y5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Ine(e,t,r){return(t=Fne(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fne(e){var t=Dne(e,"string");return typeof t=="symbol"?t:t+""}function Dne(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Une=()=>gt(Ga),Mne=()=>{var e=Une(),t=gt(Fo),r=gt(jP);return rg(!e||!r?void 0:w5(w5({},e),{},{scale:r}),t)};function N5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Gu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?N5(Object(r),!0).forEach(function(a){Rne(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Rne(e,t,r){return(t=One(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function One(e){var t=Pne(e,"string");return typeof t=="symbol"?t:t+""}function Pne(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lne=(e,t,r,a)=>{var s=t.find(i=>i&&i.index===r);if(s){if(e==="horizontal")return{x:s.coordinate,y:a.chartY};if(e==="vertical")return{x:a.chartX,y:s.coordinate}}return{x:0,y:0}},Qne=(e,t,r,a)=>{var s=t.find(u=>u&&u.index===r);if(s){if(e==="centric"){var i=s.coordinate,{radius:l}=a;return Gu(Gu(Gu({},a),wn(a.cx,a.cy,l,i)),{},{angle:i,radius:l})}var o=s.coordinate,{angle:d}=a;return Gu(Gu(Gu({},a),wn(a.cx,a.cy,o,d)),{},{angle:d,radius:o})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Hne(e,t){var{chartX:r,chartY:a}=e;return r>=t.left&&r<=t.left+t.width&&a>=t.top&&a<=t.top+t.height}var _P=(e,t,r,a,s)=>{var i,l=(i=t==null?void 0:t.length)!==null&&i!==void 0?i:0;if(l<=1||e==null)return 0;if(a==="angleAxis"&&s!=null&&Math.abs(Math.abs(s[1]-s[0])-360)<=1e-6)for(var o=0;o<l;o++){var d,u,f,p,h,m=o>0?(d=r[o-1])===null||d===void 0?void 0:d.coordinate:(u=r[l-1])===null||u===void 0?void 0:u.coordinate,b=(f=r[o])===null||f===void 0?void 0:f.coordinate,v=o>=l-1?(p=r[0])===null||p===void 0?void 0:p.coordinate:(h=r[o+1])===null||h===void 0?void 0:h.coordinate,y=void 0;if(!(m==null||b==null||v==null))if(xi(b-m)!==xi(v-b)){var j=[];if(xi(v-b)===xi(s[1]-s[0])){y=v;var _=b+s[1]-s[0];j[0]=Math.min(_,(_+m)/2),j[1]=Math.max(_,(_+m)/2)}else{y=m;var N=v+s[1]-s[0];j[0]=Math.min(b,(N+b)/2),j[1]=Math.max(b,(N+b)/2)}var E=[Math.min(b,(y+b)/2),Math.max(b,(y+b)/2)];if(e>E[0]&&e<=E[1]||e>=j[0]&&e<=j[1]){var T;return(T=r[o])===null||T===void 0?void 0:T.index}}else{var B=Math.min(m,v),F=Math.max(m,v);if(e>(B+b)/2&&e<=(F+b)/2){var R;return(R=r[o])===null||R===void 0?void 0:R.index}}}else if(t)for(var U=0;U<l;U++){var D=t[U];if(D!=null){var L=t[U+1],P=t[U-1];if(U===0&&L!=null&&e<=(D.coordinate+L.coordinate)/2||U===l-1&&P!=null&&e>(D.coordinate+P.coordinate)/2||U>0&&U<l-1&&P!=null&&L!=null&&e>(D.coordinate+P.coordinate)/2&&e<=(D.coordinate+L.coordinate)/2)return D.index}}return-1},TP=()=>gt(ij),Bj=(e,t)=>t,IP=(e,t,r)=>r,_j=(e,t,r,a)=>a,zne=De(Fo,e=>bb(e,t=>t.coordinate)),Tj=De([YA,Bj,IP,_j],mP),Ij=De([Tj,JA,qp,Yp],Cj),$ne=(e,t,r)=>{if(t!=null){var a=YA(e);return t==="axis"?r==="hover"?a.axisInteraction.hover.dataKey:a.axisInteraction.click.dataKey:r==="hover"?a.itemInteraction.hover.dataKey:a.itemInteraction.click.dataKey}},FP=De([YA,Bj,IP,_j],bP),jg=De([Eo,So,Yr,Sn,Fo,_j,FP],gP),Vne=De([Tj,jg],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),DP=De([Fo,Ij],fP),Gne=De([FP,Ij,_o,qp,DP,vP,Bj],yP),Kne=De([Tj,Ij],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),qne=(e,t,r,a,s,i,l)=>{if(!(!e||!r||!a||!s)&&Hne(e,l)){var o=vX(e,t),d=_P(o,i,s,r,a),u=Lne(t,s,d,e);return{activeIndex:String(d),activeCoordinate:u}}},Wne=(e,t,r,a,s,i,l)=>{if(!(!e||!a||!s||!i||!r)){var o=_Z(e,r);if(o){var d=yX(o,t),u=_P(d,l,i,a,s),f=Qne(t,i,u,o);return{activeIndex:String(u),activeCoordinate:f}}}},Yne=(e,t,r,a,s,i,l,o)=>{if(!(!e||!t||!a||!s||!i))return t==="horizontal"||t==="vertical"?qne(e,t,a,s,i,l,o):Wne(e,t,r,a,s,i,l)},Xne=De(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var a=e[t];if(a!=null)return r?a.panoramaElement:a.element}}),Jne=De(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(a=>parseInt(a,10)).concat(Object.values(Xn)),r=Array.from(new Set(t));return r.sort((a,s)=>a-s)},{memoizeOptions:{resultEqualityCheck:Tre}});function C5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function k5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?C5(Object(r),!0).forEach(function(a){Zne(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Zne(e,t,r){return(t=ese(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ese(e){var t=tse(e,"string");return typeof t=="symbol"?t:t+""}function tse(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rse={},ase={zIndexMap:Object.values(Xn).reduce((e,t)=>k5(k5({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),rse)},nse=new Set(Object.values(Xn));function sse(e){return nse.has(e)}var UP=ws({name:"zIndex",initialState:ase,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:Gr()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!sse(r)&&delete e.zIndexMap[r])},prepare:Gr()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r,element:a,isPanorama:s}=t.payload;e.zIndexMap[r]?s?e.zIndexMap[r].panoramaElement=a:e.zIndexMap[r].element=a:e.zIndexMap[r]={consumers:0,element:s?void 0:a,panoramaElement:s?a:void 0}},prepare:Gr()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:Gr()}}}),{registerZIndexPortal:ise,unregisterZIndexPortal:lse,registerZIndexPortalElement:ose,unregisterZIndexPortalElement:cse}=UP.actions,dse=UP.reducer;function Do(e){var{zIndex:t,children:r}=e,a=ZX(),s=a&&t!==void 0&&t!==0,i=Ns(),l=an();k.useLayoutEffect(()=>s?(l(ise({zIndex:t})),()=>{l(lse({zIndex:t}))}):HA,[l,t,s]);var o=gt(d=>Xne(d,t,i));return s?o?VM.createPortal(r,o):null:r}function JN(){return JN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},JN.apply(null,arguments)}function j5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Dh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?j5(Object(r),!0).forEach(function(a){use(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function use(e,t,r){return(t=Ase(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ase(e){var t=fse(e,"string");return typeof t=="symbol"?t:t+""}function fse(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pse(e){var{cursor:t,cursorComp:r,cursorProps:a}=e;return k.isValidElement(t)?k.cloneElement(t,a):k.createElement(r,a)}function xse(e){var t,{coordinate:r,payload:a,index:s,offset:i,tooltipAxisBandSize:l,layout:o,cursor:d,tooltipEventType:u,chartName:f}=e,p=r,h=a,m=s;if(!d||!p||f!=="ScatterChart"&&u!=="axis")return null;var b,v,y;if(f==="ScatterChart")b=p,v=QJ,y=Xn.cursorLine;else if(f==="BarChart")b=HJ(o,p,i,l),v=vZ,y=Xn.cursorRectangle;else if(o==="radial"&&cR(p)){var{cx:j,cy:_,radius:N,startAngle:E,endAngle:T}=N8(p);b={cx:j,cy:_,startAngle:E,endAngle:T,innerRadius:N,outerRadius:N},v=DZ,y=Xn.cursorLine}else b={points:UZ(o,p,i)},v=_m,y=Xn.cursorLine;var B=typeof d=="object"&&"className"in d?d.className:void 0,F=Dh(Dh(Dh(Dh({stroke:"#ccc",pointerEvents:"none"},i),b),xb(d)),{},{payload:h,payloadIndex:m,className:Lr("recharts-tooltip-cursor",B)});return k.createElement(Do,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:y},k.createElement(pse,{cursor:d,cursorComp:v,cursorProps:F}))}function hse(e){var t=Mne(),r=i8(),a=zA(),s=TP();return t==null||r==null||a==null||s==null?null:k.createElement(xse,JN({},e,{offset:r,layout:a,tooltipAxisBandSize:t,chartName:s}))}var MP=k.createContext(null),mse=()=>k.useContext(MP),s2={exports:{}},E5;function gse(){return E5||(E5=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(r=!1));function s(d,u,f){this.fn=d,this.context=u,this.once=f||!1}function i(d,u,f,p,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var m=new s(f,p||d,h),b=r?r+u:u;return d._events[b]?d._events[b].fn?d._events[b]=[d._events[b],m]:d._events[b].push(m):(d._events[b]=m,d._eventsCount++),d}function l(d,u){--d._eventsCount===0?d._events=new a:delete d._events[u]}function o(){this._events=new a,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],f,p;if(this._eventsCount===0)return u;for(p in f=this._events)t.call(f,p)&&u.push(r?p.slice(1):p);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(f)):u},o.prototype.listeners=function(u){var f=r?r+u:u,p=this._events[f];if(!p)return[];if(p.fn)return[p.fn];for(var h=0,m=p.length,b=new Array(m);h<m;h++)b[h]=p[h].fn;return b},o.prototype.listenerCount=function(u){var f=r?r+u:u,p=this._events[f];return p?p.fn?1:p.length:0},o.prototype.emit=function(u,f,p,h,m,b){var v=r?r+u:u;if(!this._events[v])return!1;var y=this._events[v],j=arguments.length,_,N;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),j){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,f),!0;case 3:return y.fn.call(y.context,f,p),!0;case 4:return y.fn.call(y.context,f,p,h),!0;case 5:return y.fn.call(y.context,f,p,h,m),!0;case 6:return y.fn.call(y.context,f,p,h,m,b),!0}for(N=1,_=new Array(j-1);N<j;N++)_[N-1]=arguments[N];y.fn.apply(y.context,_)}else{var E=y.length,T;for(N=0;N<E;N++)switch(y[N].once&&this.removeListener(u,y[N].fn,void 0,!0),j){case 1:y[N].fn.call(y[N].context);break;case 2:y[N].fn.call(y[N].context,f);break;case 3:y[N].fn.call(y[N].context,f,p);break;case 4:y[N].fn.call(y[N].context,f,p,h);break;default:if(!_)for(T=1,_=new Array(j-1);T<j;T++)_[T-1]=arguments[T];y[N].fn.apply(y[N].context,_)}}return!0},o.prototype.on=function(u,f,p){return i(this,u,f,p,!1)},o.prototype.once=function(u,f,p){return i(this,u,f,p,!0)},o.prototype.removeListener=function(u,f,p,h){var m=r?r+u:u;if(!this._events[m])return this;if(!f)return l(this,m),this;var b=this._events[m];if(b.fn)b.fn===f&&(!h||b.once)&&(!p||b.context===p)&&l(this,m);else{for(var v=0,y=[],j=b.length;v<j;v++)(b[v].fn!==f||h&&!b[v].once||p&&b[v].context!==p)&&y.push(b[v]);y.length?this._events[m]=y.length===1?y[0]:y:l(this,m)}return this},o.prototype.removeAllListeners=function(u){var f;return u?(f=r?r+u:u,this._events[f]&&l(this,f)):(this._events=new a,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o})(s2)),s2.exports}var bse=gse();const vse=Sl(bse);var Ap=new vse,ZN="recharts.syncEvent.tooltip",S5="recharts.syncEvent.brush",yse=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Cl(r))return e[r]}},wse={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},RP=ws({name:"options",initialState:wse,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Nse=RP.reducer,{createEventEmitter:Cse}=RP.actions;function kse(e){return e.tooltip.syncInteraction}var jse={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},OP=ws({name:"chartData",initialState:jse,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:r,endIndex:a}=t.payload;r!=null&&(e.dataStartIndex=r),a!=null&&(e.dataEndIndex=a)}}}),{setChartData:B5,setDataStartEndIndexes:Ese,setComputedData:kFe}=OP.actions,Sse=OP.reducer,Bse=["x","y"];function _5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Ku(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_5(Object(r),!0).forEach(function(a){_se(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function _se(e,t,r){return(t=Tse(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tse(e){var t=Ise(e,"string");return typeof t=="symbol"?t:t+""}function Ise(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fse(e,t){if(e==null)return{};var r,a,s=Dse(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Dse(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function Use(){var e=gt(lj),t=gt(oj),r=an(),a=gt(bO),s=gt(Fo),i=zA(),l=Fb(),o=gt(d=>d.rootProps.className);k.useEffect(()=>{if(e==null)return HA;var d=(u,f,p)=>{if(t!==p&&e===u){if(a==="index"){var h;if(l&&f!==null&&f!==void 0&&(h=f.payload)!==null&&h!==void 0&&h.coordinate&&f.payload.sourceViewBox){var m=f.payload.coordinate,{x:b,y:v}=m,y=Fse(m,Bse),{x:j,y:_,width:N,height:E}=f.payload.sourceViewBox,T=Ku(Ku({},y),{},{x:l.x+(N?(b-j)/N:0)*l.width,y:l.y+(E?(v-_)/E:0)*l.height});r(Ku(Ku({},f),{},{payload:Ku(Ku({},f.payload),{},{coordinate:T})}))}else r(f);return}if(s!=null){var B;if(typeof a=="function"){var F={activeTooltipIndex:f.payload.index==null?void 0:Number(f.payload.index),isTooltipActive:f.payload.active,activeIndex:f.payload.index==null?void 0:Number(f.payload.index),activeLabel:f.payload.label,activeDataKey:f.payload.dataKey,activeCoordinate:f.payload.coordinate},R=a(s,F);B=s[R]}else a==="value"&&(B=s.find(X=>String(X.value)===f.payload.label));var{coordinate:U}=f.payload;if(B==null||f.payload.active===!1||U==null||l==null){r(YN({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:D,y:L}=U,P=Math.min(D,l.x+l.width),G=Math.min(L,l.y+l.height),Q={x:i==="horizontal"?B.coordinate:P,y:i==="horizontal"?G:B.coordinate},H=YN({active:f.payload.active,coordinate:Q,dataKey:f.payload.dataKey,index:String(B.index),label:f.payload.label,sourceViewBox:f.payload.sourceViewBox,graphicalItemId:f.payload.graphicalItemId});r(H)}}};return Ap.on(ZN,d),()=>{Ap.off(ZN,d)}},[o,r,t,e,a,s,i,l])}function Mse(){var e=gt(lj),t=gt(oj),r=an();k.useEffect(()=>{if(e==null)return HA;var a=(s,i,l)=>{t!==l&&e===s&&r(Ese(i))};return Ap.on(S5,a),()=>{Ap.off(S5,a)}},[r,t,e])}function Rse(){var e=an();k.useEffect(()=>{e(Cse())},[e]),Use(),Mse()}function Ose(e,t,r,a,s,i){var l=gt(m=>$ne(m,e,t)),o=gt(oj),d=gt(lj),u=gt(bO),f=gt(kse),p=f==null?void 0:f.active,h=Fb();k.useEffect(()=>{if(!p&&d!=null&&o!=null){var m=YN({active:i,coordinate:r,dataKey:l,index:s,label:typeof a=="number"?String(a):a,sourceViewBox:h,graphicalItemId:void 0});Ap.emit(ZN,d,m,o)}},[p,r,l,s,a,o,d,u,i,h])}function T5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function I5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?T5(Object(r),!0).forEach(function(a){Pse(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Pse(e,t,r){return(t=Lse(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lse(e){var t=Qse(e,"string");return typeof t=="symbol"?t:t+""}function Qse(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Hse(e){return e.dataKey}function zse(e,t){return k.isValidElement(e)?k.cloneElement(e,t):typeof e=="function"?k.createElement(e,t):k.createElement(vJ,t)}var F5=[],$se={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function Fj(e){var t,r,a=Ks(e,$se),{active:s,allowEscapeViewBox:i,animationDuration:l,animationEasing:o,content:d,filterNull:u,isAnimationActive:f,offset:p,payloadUniqBy:h,position:m,reverseDirection:b,useTranslate3d:v,wrapperStyle:y,cursor:j,shared:_,trigger:N,defaultIndex:E,portal:T,axisId:B}=a,F=an(),R=typeof E=="number"?String(E):E;k.useEffect(()=>{F(Lae({shared:_,trigger:N,axisId:B,active:s,defaultIndex:R}))},[F,_,N,B,s,R]);var U=Fb(),D=m8(),L=Dae(_),{activeIndex:P,isActive:G}=(t=gt(le=>Kne(le,L,N,R)))!==null&&t!==void 0?t:{},Q=gt(le=>Gne(le,L,N,R)),H=gt(le=>DP(le,L,N,R)),X=gt(le=>Vne(le,L,N,R)),K=Q,ee=mse(),W=(r=s??G)!==null&&r!==void 0?r:!1,[Y,M]=lY([K,W]),O=L==="axis"?H:void 0;Ose(L,N,X,O,P,W);var q=T??ee;if(q==null||U==null||L==null)return null;var z=K??F5;W||(z=F5),u&&z.length&&(z=FW(z.filter(le=>le.value!=null&&(le.hide!==!0||a.includeHidden)),h,Hse));var J=z.length>0,re=k.createElement(EJ,{allowEscapeViewBox:i,animationDuration:l,animationEasing:o,isAnimationActive:f,active:W,coordinate:X,hasPayload:J,offset:p,position:m,reverseDirection:b,useTranslate3d:v,viewBox:U,wrapperStyle:y,lastBoundingBox:Y,innerRef:M,hasPortalFromProps:!!T},zse(d,I5(I5({},a),{},{payload:z,label:O,active:W,activeIndex:P,coordinate:X,accessibilityLayer:D})));return k.createElement(k.Fragment,null,VM.createPortal(re,q),W&&k.createElement(hse,{cursor:j,tooltipEventType:L,coordinate:X,payload:z,index:P}))}function Vse(e,t,r){return(t=Gse(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gse(e){var t=Kse(e,"string");return typeof t=="symbol"?t:t+""}function Kse(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class qse{constructor(t){Vse(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var a=this.cache.keys().next().value;a!=null&&this.cache.delete(a)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function D5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Wse(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?D5(Object(r),!0).forEach(function(a){Yse(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):D5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Yse(e,t,r){return(t=Xse(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xse(e){var t=Jse(e,"string");return typeof t=="symbol"?t:t+""}function Jse(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zse={cacheSize:2e3,enableCache:!0},PP=Wse({},Zse),U5=new qse(PP.cacheSize),eie={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},M5="recharts_measurement_span";function tie(e,t){var r=t.fontSize||"",a=t.fontFamily||"",s=t.fontWeight||"",i=t.fontStyle||"",l=t.letterSpacing||"",o=t.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(a,"|").concat(s,"|").concat(i,"|").concat(l,"|").concat(o)}var R5=(e,t)=>{try{var r=document.getElementById(M5);r||(r=document.createElement("span"),r.setAttribute("id",M5),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,eie,t),r.textContent="".concat(e);var a=r.getBoundingClientRect();return{width:a.width,height:a.height}}catch{return{width:0,height:0}}},Ff=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Qp.isSsr)return{width:0,height:0};if(!PP.enableCache)return R5(t,r);var a=tie(t,r),s=U5.get(a);if(s)return s;var i=R5(t,r);return U5.set(a,i),i},LP;function rie(e,t,r){return(t=aie(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aie(e){var t=nie(e,"string");return typeof t=="symbol"?t:t+""}function nie(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var O5=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,P5=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,sie=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,iie=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,lie={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},oie=["cm","mm","pt","pc","in","Q","px"];function cie(e){return oie.includes(e)}var uA="NaN";function die(e,t){return e*lie[t]}class gn{static parse(t){var r,[,a,s]=(r=iie.exec(t))!==null&&r!==void 0?r:[];return a==null?gn.NaN:new gn(parseFloat(a),s??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,Cl(t)&&(this.unit=""),r!==""&&!sie.test(r)&&(this.num=NaN,this.unit=""),cie(r)&&(this.num=die(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new gn(NaN,""):new gn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new gn(NaN,""):new gn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new gn(NaN,""):new gn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new gn(NaN,""):new gn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Cl(this.num)}}LP=gn;rie(gn,"NaN",new LP(NaN,""));function QP(e){if(e==null||e.includes(uA))return uA;for(var t=e;t.includes("*")||t.includes("/");){var r,[,a,s,i]=(r=O5.exec(t))!==null&&r!==void 0?r:[],l=gn.parse(a??""),o=gn.parse(i??""),d=s==="*"?l.multiply(o):l.divide(o);if(d.isNaN())return uA;t=t.replace(O5,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,f,p,h]=(u=P5.exec(t))!==null&&u!==void 0?u:[],m=gn.parse(f??""),b=gn.parse(h??""),v=p==="+"?m.add(b):m.subtract(b);if(v.isNaN())return uA;t=t.replace(P5,v.toString())}return t}var L5=/\(([^()]*)\)/;function uie(e){for(var t=e,r;(r=L5.exec(t))!=null;){var[,a]=r;t=t.replace(L5,QP(a))}return t}function Aie(e){var t=e.replace(/\s+/g,"");return t=uie(t),t=QP(t),t}function fie(e){try{return Aie(e)}catch{return uA}}function i2(e){var t=fie(e.slice(5,-1));return t===uA?"":t}var pie=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],xie=["dx","dy","angle","className","breakAll"];function eC(){return eC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},eC.apply(null,arguments)}function Q5(e,t){if(e==null)return{};var r,a,s=hie(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function hie(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var HP=/[ \f\n\r\t\v\u2028\u2029]+/,zP=e=>{var{children:t,breakAll:r,style:a}=e;try{var s=[];Qn(t)||(r?s=t.toString().split(""):s=t.toString().split(HP));var i=s.map(o=>({word:o,width:Ff(o,a).width})),l=r?0:Ff(" ",a).width;return{wordsWithComputedWidth:i,spaceWidth:l}}catch{return null}};function mie(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var $P=(e,t,r,a)=>e.reduce((s,i)=>{var{word:l,width:o}=i,d=s[s.length-1];if(d&&o!=null&&(t==null||a||d.width+o+r<Number(t)))d.words.push(l),d.width+=o+r;else{var u={words:[l],width:o};s.push(u)}return s},[]),VP=e=>e.reduce((t,r)=>t.width>r.width?t:r),gie="…",H5=(e,t,r,a,s,i,l,o)=>{var d=e.slice(0,t),u=zP({breakAll:r,style:a,children:d+gie});if(!u)return[!1,[]];var f=$P(u.wordsWithComputedWidth,i,l,o),p=f.length>s||VP(f).width>Number(i);return[p,f]},bie=(e,t,r,a,s)=>{var{maxLines:i,children:l,style:o,breakAll:d}=e,u=At(i),f=String(l),p=$P(t,a,r,s);if(!u||s)return p;var h=p.length>i||VP(p).width>Number(a);if(!h)return p;for(var m=0,b=f.length-1,v=0,y;m<=b&&v<=f.length-1;){var j=Math.floor((m+b)/2),_=j-1,[N,E]=H5(f,_,d,o,i,a,r,s),[T]=H5(f,j,d,o,i,a,r,s);if(!N&&!T&&(m=j+1),N&&T&&(b=j-1),!N&&T){y=E;break}v++}return y||p},z5=e=>{var t=Qn(e)?[]:e.toString().split(HP);return[{words:t,width:void 0}]},vie=e=>{var{width:t,scaleToFit:r,children:a,style:s,breakAll:i,maxLines:l}=e;if((t||r)&&!Qp.isSsr){var o,d,u=zP({breakAll:i,children:a,style:s});if(u){var{wordsWithComputedWidth:f,spaceWidth:p}=u;o=f,d=p}else return z5(a);return bie({breakAll:i,children:a,maxLines:l,style:s},o,d,t,!!r)}return z5(a)},GP="#808080",yie={angle:0,breakAll:!1,capHeight:"0.71em",fill:GP,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Dj=k.forwardRef((e,t)=>{var r=Ks(e,yie),{x:a,y:s,lineHeight:i,capHeight:l,fill:o,scaleToFit:d,textAnchor:u,verticalAnchor:f}=r,p=Q5(r,pie),h=k.useMemo(()=>vie({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:d,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,d,p.style,p.width]),{dx:m,dy:b,angle:v,className:y,breakAll:j}=p,_=Q5(p,xie);if(!kl(a)||!kl(s)||h.length===0)return null;var N=Number(a)+(At(m)?m:0),E=Number(s)+(At(b)?b:0);if(!Vt(N)||!Vt(E))return null;var T;switch(f){case"start":T=i2("calc(".concat(l,")"));break;case"middle":T=i2("calc(".concat((h.length-1)/2," * -").concat(i," + (").concat(l," / 2))"));break;default:T=i2("calc(".concat(h.length-1," * -").concat(i,")"));break}var B=[],F=h[0];if(d&&F!=null){var R=F.width,{width:U}=p;B.push("scale(".concat(At(U)&&At(R)?U/R:1,")"))}return v&&B.push("rotate(".concat(v,", ").concat(N,", ").concat(E,")")),B.length&&(_.transform=B.join(" ")),k.createElement("text",eC({},wi(_),{ref:t,x:N,y:E,className:Lr("recharts-text",y),textAnchor:u,fill:o.includes("url")?GP:o}),h.map((D,L)=>{var P=D.words.join(j?"":" ");return k.createElement("tspan",{x:N,dy:L===0?T:i,key:"".concat(P,"-").concat(L)},P)}))});Dj.displayName="Text";function $5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function ol(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$5(Object(r),!0).forEach(function(a){wie(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function wie(e,t,r){return(t=Nie(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nie(e){var t=Cie(e,"string");return typeof t=="symbol"?t:t+""}function Cie(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kie=e=>{var{viewBox:t,position:r,offset:a=0,parentViewBox:s}=e,{x:i,y:l,height:o,upperWidth:d,lowerWidth:u}=Tk(t),f=i,p=i+(d-u)/2,h=(f+p)/2,m=(d+u)/2,b=f+d/2,v=o>=0?1:-1,y=v*a,j=v>0?"end":"start",_=v>0?"start":"end",N=d>=0?1:-1,E=N*a,T=N>0?"end":"start",B=N>0?"start":"end",F=s;if(r==="top"){var R={x:f+d/2,y:l-y,horizontalAnchor:"middle",verticalAnchor:j};return F&&(R.height=Math.max(l-F.y,0),R.width=d),R}if(r==="bottom"){var U={x:p+u/2,y:l+o+y,horizontalAnchor:"middle",verticalAnchor:_};return F&&(U.height=Math.max(F.y+F.height-(l+o),0),U.width=u),U}if(r==="left"){var D={x:h-E,y:l+o/2,horizontalAnchor:T,verticalAnchor:"middle"};return F&&(D.width=Math.max(D.x-F.x,0),D.height=o),D}if(r==="right"){var L={x:h+m+E,y:l+o/2,horizontalAnchor:B,verticalAnchor:"middle"};return F&&(L.width=Math.max(F.x+F.width-L.x,0),L.height=o),L}var P=F?{width:m,height:o}:{};return r==="insideLeft"?ol({x:h+E,y:l+o/2,horizontalAnchor:B,verticalAnchor:"middle"},P):r==="insideRight"?ol({x:h+m-E,y:l+o/2,horizontalAnchor:T,verticalAnchor:"middle"},P):r==="insideTop"?ol({x:f+d/2,y:l+y,horizontalAnchor:"middle",verticalAnchor:_},P):r==="insideBottom"?ol({x:p+u/2,y:l+o-y,horizontalAnchor:"middle",verticalAnchor:j},P):r==="insideTopLeft"?ol({x:f+E,y:l+y,horizontalAnchor:B,verticalAnchor:_},P):r==="insideTopRight"?ol({x:f+d-E,y:l+y,horizontalAnchor:T,verticalAnchor:_},P):r==="insideBottomLeft"?ol({x:p+E,y:l+o-y,horizontalAnchor:B,verticalAnchor:j},P):r==="insideBottomRight"?ol({x:p+u-E,y:l+o-y,horizontalAnchor:T,verticalAnchor:j},P):r&&typeof r=="object"&&(At(r.x)||Ld(r.x))&&(At(r.y)||Ld(r.y))?ol({x:i+Fc(r.x,m),y:l+Fc(r.y,o),horizontalAnchor:"end",verticalAnchor:"end"},P):ol({x:b,y:l+o/2,horizontalAnchor:"middle",verticalAnchor:"middle"},P)},jie=["labelRef"],Eie=["content"];function V5(e,t){if(e==null)return{};var r,a,s=Sie(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Sie(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function G5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function vf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?G5(Object(r),!0).forEach(function(a){Bie(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):G5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Bie(e,t,r){return(t=_ie(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _ie(e){var t=Tie(e,"string");return typeof t=="symbol"?t:t+""}function Tie(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function no(){return no=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},no.apply(null,arguments)}var KP=k.createContext(null),Iie=e=>{var{x:t,y:r,upperWidth:a,lowerWidth:s,width:i,height:l,children:o}=e,d=k.useMemo(()=>({x:t,y:r,upperWidth:a,lowerWidth:s,width:i,height:l}),[t,r,a,s,i,l]);return k.createElement(KP.Provider,{value:d},o)},qP=()=>{var e=k.useContext(KP),t=Fb();return e||(t?Tk(t):void 0)},Fie=k.createContext(null),Die=()=>{var e=k.useContext(Fie),t=gt(CO);return e||t},Uie=e=>{var{value:t,formatter:r}=e,a=Qn(e.children)?t:e.children;return typeof r=="function"?r(a):a},Uj=e=>e!=null&&typeof e=="function",Mie=(e,t)=>{var r=xi(t-e),a=Math.min(Math.abs(t-e),360);return r*a},Rie=(e,t,r,a,s)=>{var{offset:i,className:l}=e,{cx:o,cy:d,innerRadius:u,outerRadius:f,startAngle:p,endAngle:h,clockWise:m}=s,b=(u+f)/2,v=Mie(p,h),y=v>=0?1:-1,j,_;switch(t){case"insideStart":j=p+y*i,_=m;break;case"insideEnd":j=h-y*i,_=!m;break;case"end":j=h+y*i,_=m;break;default:throw new Error("Unsupported position ".concat(t))}_=v<=0?_:!_;var N=wn(o,d,b,j),E=wn(o,d,b,j+(_?1:-1)*359),T="M".concat(N.x,",").concat(N.y,`
    A`).concat(b,",").concat(b,",0,1,").concat(_?0:1,`,
    `).concat(E.x,",").concat(E.y),B=Qn(e.id)?Jf("recharts-radial-line-"):e.id;return k.createElement("text",no({},a,{dominantBaseline:"central",className:Lr("recharts-radial-bar-label",l)}),k.createElement("defs",null,k.createElement("path",{id:B,d:T})),k.createElement("textPath",{xlinkHref:"#".concat(B)},r))},Oie=(e,t,r)=>{var{cx:a,cy:s,innerRadius:i,outerRadius:l,startAngle:o,endAngle:d}=e,u=(o+d)/2;if(r==="outside"){var{x:f,y:p}=wn(a,s,l+t,u);return{x:f,y:p,textAnchor:f>=a?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var h=(i+l)/2,{x:m,y:b}=wn(a,s,h,u);return{x:m,y:b,textAnchor:"middle",verticalAnchor:"middle"}},Im=e=>e!=null&&"cx"in e&&At(e.cx),Pie={angle:0,offset:5,zIndex:Xn.label,position:"middle",textBreakAll:!1};function Lie(e){if(!Im(e))return e;var{cx:t,cy:r,outerRadius:a}=e,s=a*2;return{x:t-a,y:r-a,width:s,upperWidth:s,lowerWidth:s,height:s}}function hc(e){var t=Ks(e,Pie),{viewBox:r,parentViewBox:a,position:s,value:i,children:l,content:o,className:d="",textBreakAll:u,labelRef:f}=t,p=Die(),h=qP(),m=s==="center"?h:p??h,b,v,y;r==null?b=m:Im(r)?b=r:b=Tk(r);var j=Lie(b);if(!b||Qn(i)&&Qn(l)&&!k.isValidElement(o)&&typeof o!="function")return null;var _=vf(vf({},t),{},{viewBox:b});if(k.isValidElement(o)){var{labelRef:N}=_,E=V5(_,jie);return k.cloneElement(o,E)}if(typeof o=="function"){var{content:T}=_,B=V5(_,Eie);if(v=k.createElement(o,B),k.isValidElement(v))return v}else v=Uie(t);var F=wi(t);if(Im(b)){if(s==="insideStart"||s==="insideEnd"||s==="end")return Rie(t,s,v,F,b);y=Oie(b,t.offset,t.position)}else{if(!j)return null;var R=kie({viewBox:j,position:s,offset:t.offset,parentViewBox:Im(a)?void 0:a});y=vf(vf({x:R.x,y:R.y,textAnchor:R.horizontalAnchor,verticalAnchor:R.verticalAnchor},R.width!==void 0?{width:R.width}:{}),R.height!==void 0?{height:R.height}:{})}return k.createElement(Do,{zIndex:t.zIndex},k.createElement(Dj,no({ref:f,className:Lr("recharts-label",d)},F,y,{textAnchor:mie(F.textAnchor)?F.textAnchor:y.textAnchor,breakAll:u}),v))}hc.displayName="Label";var Qie=(e,t,r)=>{if(!e)return null;var a={viewBox:t,labelRef:r};return e===!0?k.createElement(hc,no({key:"label-implicit"},a)):kl(e)?k.createElement(hc,no({key:"label-implicit",value:e},a)):k.isValidElement(e)?e.type===hc?k.cloneElement(e,vf({key:"label-implicit"},a)):k.createElement(hc,no({key:"label-implicit",content:e},a)):Uj(e)?k.createElement(hc,no({key:"label-implicit",content:e},a)):e&&typeof e=="object"?k.createElement(hc,no({},e,{key:"label-implicit"},a)):null};function Hie(e){var{label:t,labelRef:r}=e,a=qP();return Qie(t,a,r)||null}var l2={},o2={},K5;function zie(){return K5||(K5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(o2)),o2}var c2={},q5;function $ie(){return q5||(q5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(c2)),c2}var W5;function Vie(){return W5||(W5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zie(),r=$ie(),a=vk();function s(i){if(a.isArrayLike(i))return t.last(r.toArray(i))}e.last=s})(l2)),l2}var d2,Y5;function Gie(){return Y5||(Y5=1,d2=Vie().last),d2}var Kie=Gie();const qie=Sl(Kie);var Wie=["valueAccessor"],Yie=["dataKey","clockWise","id","textBreakAll","zIndex"];function Eg(){return Eg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Eg.apply(null,arguments)}function X5(e,t){if(e==null)return{};var r,a,s=Xie(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Xie(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var Jie=e=>Array.isArray(e.value)?qie(e.value):e.value,WP=k.createContext(void 0),Zie=WP.Provider,YP=k.createContext(void 0);YP.Provider;function ele(){return k.useContext(WP)}function tle(){return k.useContext(YP)}function Fm(e){var{valueAccessor:t=Jie}=e,r=X5(e,Wie),{dataKey:a,clockWise:s,id:i,textBreakAll:l,zIndex:o}=r,d=X5(r,Yie),u=ele(),f=tle(),p=u||f;return!p||!p.length?null:k.createElement(Do,{zIndex:o??Xn.label},k.createElement(Nl,{className:"recharts-label-list"},p.map((h,m)=>{var b,v=Qn(a)?t(h,m):Cn(h.payload,a),y=Qn(i)?{}:{id:"".concat(i,"-").concat(m)};return k.createElement(hc,Eg({key:"label-".concat(m)},wi(h),d,y,{fill:(b=r.fill)!==null&&b!==void 0?b:h.fill,parentViewBox:h.parentViewBox,value:v,textBreakAll:l,viewBox:h.viewBox,index:m,zIndex:0}))})))}Fm.displayName="LabelList";function rle(e){var{label:t}=e;return t?t===!0?k.createElement(Fm,{key:"labelList-implicit"}):k.isValidElement(t)||Uj(t)?k.createElement(Fm,{key:"labelList-implicit",content:t}):typeof t=="object"?k.createElement(Fm,Eg({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function tC(){return tC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},tC.apply(null,arguments)}var XP=e=>{var{cx:t,cy:r,r:a,className:s}=e,i=Lr("recharts-dot",s);return At(t)&&At(r)&&At(a)?k.createElement("circle",tC({},Wi(e),bk(e),{className:i,cx:t,cy:r,r:a})):null},ale={radiusAxis:{},angleAxis:{}},JP=ws({name:"polarAxis",initialState:ale,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:jFe,removeRadiusAxis:EFe,addAngleAxis:SFe,removeAngleAxis:BFe}=JP.actions,nle=JP.reducer;function sle(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var ZP=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function ile(e){var{tooltipEntrySettings:t}=e,r=an(),a=Ns(),s=k.useRef(null);return k.useLayoutEffect(()=>{a||(s.current===null?r(Rae(t)):s.current!==t&&r(Oae({prev:s.current,next:t})),s.current=t)},[t,r,a]),k.useLayoutEffect(()=>()=>{s.current&&(r(Pae(s.current)),s.current=null)},[r]),null}function lle(e){var{legendPayload:t}=e,r=an(),a=Ns(),s=k.useRef(null);return k.useLayoutEffect(()=>{a||(s.current===null?r(AJ(t)):s.current!==t&&r(fJ({prev:s.current,next:t})),s.current=t)},[r,a,t]),k.useLayoutEffect(()=>()=>{s.current&&(r(pJ(s.current)),s.current=null)},[r]),null}var u2,ole=()=>{var[e]=k.useState(()=>Jf("uid-"));return e},cle=(u2=W7.useId)!==null&&u2!==void 0?u2:ole;function dle(e,t){var r=cle();return t||(e?"".concat(e,"-").concat(r):r)}var ule=k.createContext(void 0),Ale=e=>{var{id:t,type:r,children:a}=e,s=dle("recharts-".concat(r),t);return k.createElement(ule.Provider,{value:s},a(s))},fle={cartesianItems:[],polarItems:[]},eL=ws({name:"graphicalItems",initialState:fle,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Gr()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:a}=t.payload,s=Hi(e).cartesianItems.indexOf(r);s>-1&&(e.cartesianItems[s]=a)},prepare:Gr()},removeCartesianGraphicalItem:{reducer(e,t){var r=Hi(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:Gr()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Gr()},removePolarGraphicalItem:{reducer(e,t){var r=Hi(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:Gr()}}}),{addCartesianGraphicalItem:ple,replaceCartesianGraphicalItem:xle,removeCartesianGraphicalItem:hle,addPolarGraphicalItem:_Fe,removePolarGraphicalItem:TFe}=eL.actions,mle=eL.reducer,gle=e=>{var t=an(),r=k.useRef(null);return k.useLayoutEffect(()=>{r.current===null?t(ple(e)):r.current!==e&&t(xle({prev:r.current,next:e})),r.current=e},[t,e]),k.useLayoutEffect(()=>()=>{r.current&&(t(hle(r.current)),r.current=null)},[t]),null},ble=k.memo(gle),vle=["points"];function J5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function A2(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?J5(Object(r),!0).forEach(function(a){yle(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function yle(e,t,r){return(t=wle(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wle(e){var t=Nle(e,"string");return typeof t=="symbol"?t:t+""}function Nle(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sg(){return Sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Sg.apply(null,arguments)}function Cle(e,t){if(e==null)return{};var r,a,s=kle(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function kle(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function jle(e){var{option:t,dotProps:r,className:a}=e;if(k.isValidElement(t))return k.cloneElement(t,r);if(typeof t=="function")return t(r);var s=Lr(a,typeof t!="boolean"?t.className:""),i=r??{},{points:l}=i,o=Cle(i,vle);return k.createElement(XP,Sg({},o,{className:s}))}function Ele(e,t){return e==null?!1:t?!0:e.length===1}function Sle(e){var{points:t,dot:r,className:a,dotClassName:s,dataKey:i,baseProps:l,needClip:o,clipPathId:d,zIndex:u=Xn.scatter}=e;if(!Ele(t,r))return null;var f=ZP(r),p=jq(r),h=t.map((b,v)=>{var y,j,_=A2(A2(A2({r:3},l),p),{},{index:v,cx:(y=b.x)!==null&&y!==void 0?y:void 0,cy:(j=b.y)!==null&&j!==void 0?j:void 0,dataKey:i,value:b.value,payload:b.payload,points:t});return k.createElement(jle,{key:"dot-".concat(v),option:r,dotProps:_,className:s})}),m={};return o&&d!=null&&(m.clipPath="url(#clipPath-".concat(f?"":"dots-").concat(d,")")),k.createElement(Do,{zIndex:u},k.createElement(Nl,Sg({className:a},m),h))}function Z5(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function e6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Z5(Object(r),!0).forEach(function(a){Ble(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Ble(e,t,r){return(t=_le(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _le(e){var t=Tle(e,"string");return typeof t=="symbol"?t:t+""}function Tle(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tL=0,Ile={xAxis:{},yAxis:{},zAxis:{}},rL=ws({name:"cartesianAxis",initialState:Ile,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Gr()},replaceXAxis:{reducer(e,t){var{prev:r,next:a}=t.payload;e.xAxis[r.id]!==void 0&&(r.id!==a.id&&delete e.xAxis[r.id],e.xAxis[a.id]=a)},prepare:Gr()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Gr()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Gr()},replaceYAxis:{reducer(e,t){var{prev:r,next:a}=t.payload;e.yAxis[r.id]!==void 0&&(r.id!==a.id&&delete e.yAxis[r.id],e.yAxis[a.id]=a)},prepare:Gr()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Gr()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Gr()},replaceZAxis:{reducer(e,t){var{prev:r,next:a}=t.payload;e.zAxis[r.id]!==void 0&&(r.id!==a.id&&delete e.zAxis[r.id],e.zAxis[a.id]=a)},prepare:Gr()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Gr()},updateYAxisWidth(e,t){var{id:r,width:a}=t.payload,s=e.yAxis[r];if(s){var i,l=s.widthHistory||[];if(l.length===3&&l[0]===l[2]&&a===l[1]&&a!==s.width&&Math.abs(a-((i=l[0])!==null&&i!==void 0?i:0))<=1)return;var o=[...l,a].slice(-3);e.yAxis[r]=e6(e6({},s),{},{width:a,widthHistory:o})}}}}),{addXAxis:Fle,replaceXAxis:Dle,removeXAxis:Ule,addYAxis:Mle,replaceYAxis:Rle,removeYAxis:Ole,addZAxis:IFe,replaceZAxis:FFe,removeZAxis:DFe,updateYAxisWidth:Ple}=rL.actions,Lle=rL.reducer,Qle=De([Sn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Hle=De([Qle,Eo,So],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),Mj=()=>gt(Hle),zle=()=>gt(Tne);function t6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function f2(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?t6(Object(r),!0).forEach(function(a){$le(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function $le(e,t,r){return(t=Vle(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vle(e){var t=Gle(e,"string");return typeof t=="symbol"?t:t+""}function Gle(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Kle=e=>{var{point:t,childIndex:r,mainColor:a,activeDot:s,dataKey:i,clipPath:l}=e;if(s===!1||t.x==null||t.y==null)return null;var o={index:r,dataKey:i,cx:t.x,cy:t.y,r:4,fill:a??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=f2(f2(f2({},o),xb(s)),bk(s)),u;return k.isValidElement(s)?u=k.cloneElement(s,d):typeof s=="function"?u=s(d):u=k.createElement(XP,d),k.createElement(Nl,{className:"recharts-active-dot",clipPath:l},u)};function r6(e){var{points:t,mainColor:r,activeDot:a,itemDataKey:s,clipPath:i,zIndex:l=Xn.activeDot}=e,o=gt(up),d=zle();if(t==null||d==null)return null;var u=t.find(f=>d.includes(f.payload));return Qn(u)?null:k.createElement(Do,{zIndex:l},k.createElement(Kle,{point:u,childIndex:Number(o),mainColor:r,dataKey:s,activeDot:a,clipPath:i}))}var qle=e=>{var{chartData:t}=e,r=an(),a=Ns();return k.useEffect(()=>a?()=>{}:(r(B5(t)),()=>{r(B5(void 0))}),[t,r,a]),null},a6={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},aL=ws({name:"brush",initialState:a6,reducers:{setBrushSettings(e,t){return t.payload==null?a6:t.payload}}}),{setBrushSettings:UFe}=aL.actions,Wle=aL.reducer;function Yle(e){return(e%180+180)%180}var Xle=function(t){var{width:r,height:a}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Yle(s),l=i*Math.PI/180,o=Math.atan(a/r),d=l>o&&l<Math.PI-o?a/Math.sin(l):r/Math.cos(l);return Math.abs(d)},Jle={dots:[],areas:[],lines:[]},nL=ws({name:"referenceElements",initialState:Jle,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=Hi(e).dots.findIndex(a=>a===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=Hi(e).areas.findIndex(a=>a===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=Hi(e).lines.findIndex(a=>a===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:MFe,removeDot:RFe,addArea:OFe,removeArea:PFe,addLine:LFe,removeLine:QFe}=nL.actions,Zle=nL.reducer,eoe=k.createContext(void 0),toe=e=>{var{children:t}=e,[r]=k.useState("".concat(Jf("recharts"),"-clip")),a=Mj();if(a==null)return null;var{x:s,y:i,width:l,height:o}=a;return k.createElement(eoe.Provider,{value:r},k.createElement("defs",null,k.createElement("clipPath",{id:r},k.createElement("rect",{x:s,y:i,height:o,width:l}))),t)};function sL(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],a=0;a<e.length;a+=t){var s=e[a];s!==void 0&&r.push(s)}return r}function roe(e,t,r){var a={width:e.width+t.width,height:e.height+t.height};return Xle(a,r)}function aoe(e,t,r){var a=r==="width",{x:s,y:i,width:l,height:o}=e;return t===1?{start:a?s:i,end:a?s+l:i+o}:{start:a?s+l:i+o,end:a?s:i}}function fp(e,t,r,a,s){if(e*t<e*a||e*t>e*s)return!1;var i=r();return e*(t-e*i/2-a)>=0&&e*(t+e*i/2-s)<=0}function noe(e,t){return sL(e,t+1)}function soe(e,t,r,a,s){for(var i=(a||[]).slice(),{start:l,end:o}=t,d=0,u=1,f=l,p=function(){var b=a==null?void 0:a[d];if(b===void 0)return{v:sL(a,u)};var v=d,y,j=()=>(y===void 0&&(y=r(b,v)),y),_=b.coordinate,N=d===0||fp(e,_,j,f,o);N||(d=0,f=l,u+=1),N&&(f=_+e*(j()/2+s),d+=u)},h;u<=i.length;)if(h=p(),h)return h.v;return[]}function ioe(e,t,r,a,s){var i=(a||[]).slice(),l=i.length;if(l===0)return[];for(var{start:o,end:d}=t,u=1;u<=l;u++){for(var f=(l-1)%u,p=o,h=!0,m=function(){var E=a[v];if(E==null)return 0;var T=v,B,F=()=>(B===void 0&&(B=r(E,T)),B),R=E.coordinate,U=v===f||fp(e,R,F,p,d);if(!U)return h=!1,1;U&&(p=R+e*(F()/2+s))},b,v=f;v<l&&(b=m(),!(b!==0&&b===1));v+=u);if(h){for(var y=[],j=f;j<l;j+=u){var _=a[j];_!=null&&y.push(_)}return y}}return[]}function n6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function In(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?n6(Object(r),!0).forEach(function(a){loe(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function loe(e,t,r){return(t=ooe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ooe(e){var t=coe(e,"string");return typeof t=="symbol"?t:t+""}function coe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function doe(e,t,r,a,s){for(var i=(a||[]).slice(),l=i.length,{start:o}=t,{end:d}=t,u=function(h){var m=i[h];if(m==null)return 1;var b=m,v,y=()=>(v===void 0&&(v=r(m,h)),v);if(h===l-1){var j=e*(b.coordinate+e*y()/2-d);i[h]=b=In(In({},b),{},{tickCoord:j>0?b.coordinate-j*e:b.coordinate})}else i[h]=b=In(In({},b),{},{tickCoord:b.coordinate});if(b.tickCoord!=null){var _=fp(e,b.tickCoord,y,o,d);_&&(d=b.tickCoord-e*(y()/2+s),i[h]=In(In({},b),{},{isShow:!0}))}},f=l-1;f>=0;f--)u(f);return i}function uoe(e,t,r,a,s,i){var l=(a||[]).slice(),o=l.length,{start:d,end:u}=t;if(i){var f=a[o-1];if(f!=null){var p=r(f,o-1),h=e*(f.coordinate+e*p/2-u);if(l[o-1]=f=In(In({},f),{},{tickCoord:h>0?f.coordinate-h*e:f.coordinate}),f.tickCoord!=null){var m=fp(e,f.tickCoord,()=>p,d,u);m&&(u=f.tickCoord-e*(p/2+s),l[o-1]=In(In({},f),{},{isShow:!0}))}}}for(var b=i?o-1:o,v=function(_){var N=l[_];if(N==null)return 1;var E=N,T,B=()=>(T===void 0&&(T=r(N,_)),T);if(_===0){var F=e*(E.coordinate-e*B()/2-d);l[_]=E=In(In({},E),{},{tickCoord:F<0?E.coordinate-F*e:E.coordinate})}else l[_]=E=In(In({},E),{},{tickCoord:E.coordinate});if(E.tickCoord!=null){var R=fp(e,E.tickCoord,B,d,u);R&&(d=E.tickCoord+e*(B()/2+s),l[_]=In(In({},E),{},{isShow:!0}))}},y=0;y<b;y++)v(y);return l}function Rj(e,t,r){var{tick:a,ticks:s,viewBox:i,minTickGap:l,orientation:o,interval:d,tickFormatter:u,unit:f,angle:p}=e;if(!s||!s.length||!a)return[];if(At(d)||Qp.isSsr){var h;return(h=noe(s,At(d)?d:0))!==null&&h!==void 0?h:[]}var m=[],b=o==="top"||o==="bottom"?"width":"height",v=f&&b==="width"?Ff(f,{fontSize:t,letterSpacing:r}):{width:0,height:0},y=(T,B)=>{var F=typeof u=="function"?u(T.value,B):T.value;return b==="width"?roe(Ff(F,{fontSize:t,letterSpacing:r}),v,p):Ff(F,{fontSize:t,letterSpacing:r})[b]},j=s[0],_=s[1],N=s.length>=2&&j!=null&&_!=null?xi(_.coordinate-j.coordinate):1,E=aoe(i,N,b);return d==="equidistantPreserveStart"?soe(N,E,y,s,l):d==="equidistantPreserveEnd"?ioe(N,E,y,s,l):(d==="preserveStart"||d==="preserveStartEnd"?m=uoe(N,E,y,s,l,d==="preserveStartEnd"):m=doe(N,E,y,s,l),m.filter(T=>T.isShow))}var Aoe=e=>{var{ticks:t,label:r,labelGapWithTick:a=5,tickSize:s=0,tickMargin:i=0}=e,l=0;if(t){Array.from(t).forEach(f=>{if(f){var p=f.getBoundingClientRect();p.width>l&&(l=p.width)}});var o=r?r.getBoundingClientRect().width:0,d=s+i,u=l+d+o+(r?a:0);return Math.round(u)}return 0},foe=["axisLine","width","height","className","hide","ticks","axisType"];function poe(e,t){if(e==null)return{};var r,a,s=xoe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function xoe(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function Vd(){return Vd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Vd.apply(null,arguments)}function s6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function la(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?s6(Object(r),!0).forEach(function(a){hoe(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function hoe(e,t,r){return(t=moe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function moe(e){var t=goe(e,"string");return typeof t=="symbol"?t:t+""}function goe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var co={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:Xn.axis};function boe(e){var{x:t,y:r,width:a,height:s,orientation:i,mirror:l,axisLine:o,otherSvgProps:d}=e;if(!o)return null;var u=la(la(la({},d),Wi(o)),{},{fill:"none"});if(i==="top"||i==="bottom"){var f=+(i==="top"&&!l||i==="bottom"&&l);u=la(la({},u),{},{x1:t,y1:r+f*s,x2:t+a,y2:r+f*s})}else{var p=+(i==="left"&&!l||i==="right"&&l);u=la(la({},u),{},{x1:t+p*a,y1:r,x2:t+p*a,y2:r+s})}return k.createElement("line",Vd({},u,{className:Lr("recharts-cartesian-axis-line",gb(o,"className"))}))}function voe(e,t,r,a,s,i,l,o,d){var u,f,p,h,m,b,v=o?-1:1,y=e.tickSize||l,j=At(e.tickCoord)?e.tickCoord:e.coordinate;switch(i){case"top":u=f=e.coordinate,h=r+ +!o*s,p=h-v*y,b=p-v*d,m=j;break;case"left":p=h=e.coordinate,f=t+ +!o*a,u=f-v*y,m=u-v*d,b=j;break;case"right":p=h=e.coordinate,f=t+ +o*a,u=f+v*y,m=u+v*d,b=j;break;default:u=f=e.coordinate,h=r+ +o*s,p=h+v*y,b=p+v*d,m=j;break}return{line:{x1:u,y1:p,x2:f,y2:h},tick:{x:m,y:b}}}function yoe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function woe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function Noe(e){var{option:t,tickProps:r,value:a}=e,s,i=Lr(r.className,"recharts-cartesian-axis-tick-value");if(k.isValidElement(t))s=k.cloneElement(t,la(la({},r),{},{className:i}));else if(typeof t=="function")s=t(la(la({},r),{},{className:i}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=Lr(l,sle(t))),s=k.createElement(Dj,Vd({},r,{className:l}),a)}return s}var Coe=k.forwardRef((e,t)=>{var{ticks:r=[],tick:a,tickLine:s,stroke:i,tickFormatter:l,unit:o,padding:d,tickTextProps:u,orientation:f,mirror:p,x:h,y:m,width:b,height:v,tickSize:y,tickMargin:j,fontSize:_,letterSpacing:N,getTicksConfig:E,events:T,axisType:B}=e,F=Rj(la(la({},E),{},{ticks:r}),_,N),R=yoe(f,p),U=woe(f,p),D=Wi(E),L=xb(a),P={};typeof s=="object"&&(P=s);var G=la(la({},D),{},{fill:"none"},P),Q=F.map(K=>la({entry:K},voe(K,h,m,b,v,f,y,p,j))),H=Q.map(K=>{var{entry:ee,line:W}=K;return k.createElement(Nl,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(ee.value,"-").concat(ee.coordinate,"-").concat(ee.tickCoord)},s&&k.createElement("line",Vd({},G,W,{className:Lr("recharts-cartesian-axis-tick-line",gb(s,"className"))})))}),X=Q.map((K,ee)=>{var W,Y,{entry:M,tick:O}=K,q=la(la(la(la({verticalAnchor:U},D),{},{textAnchor:R,stroke:"none",fill:i},O),{},{index:ee,payload:M,visibleTicksCount:F.length,tickFormatter:l,padding:d},u),{},{angle:(W=(Y=u==null?void 0:u.angle)!==null&&Y!==void 0?Y:D.angle)!==null&&W!==void 0?W:0}),z=la(la({},q),L);return k.createElement(Nl,Vd({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(M.value,"-").concat(M.coordinate,"-").concat(M.tickCoord)},oW(T,M,ee)),a&&k.createElement(Noe,{option:a,tickProps:z,value:"".concat(typeof l=="function"?l(M.value,ee):M.value).concat(o||"")}))});return k.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(B,"-ticks")},X.length>0&&k.createElement(Do,{zIndex:Xn.label},k.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(B,"-tick-labels"),ref:t},X)),H.length>0&&k.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(B,"-tick-lines")},H))}),koe=k.forwardRef((e,t)=>{var{axisLine:r,width:a,height:s,className:i,hide:l,ticks:o,axisType:d}=e,u=poe(e,foe),[f,p]=k.useState(""),[h,m]=k.useState(""),b=k.useRef(null);k.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var y;return Aoe({ticks:b.current,label:(y=e.labelRef)===null||y===void 0?void 0:y.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var v=k.useCallback(y=>{if(y){var j=y.getElementsByClassName("recharts-cartesian-axis-tick-value");b.current=j;var _=j[0];if(_){var N=window.getComputedStyle(_),E=N.fontSize,T=N.letterSpacing;(E!==f||T!==h)&&(p(E),m(T))}}},[f,h]);return l||a!=null&&a<=0||s!=null&&s<=0?null:k.createElement(Do,{zIndex:e.zIndex},k.createElement(Nl,{className:Lr("recharts-cartesian-axis",i)},k.createElement(boe,{x:e.x,y:e.y,width:a,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:Wi(e)}),k.createElement(Coe,{ref:v,axisType:d,events:u,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:h,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:o,unit:e.unit,width:e.width,x:e.x,y:e.y}),k.createElement(Iie,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},k.createElement(Hie,{label:e.label,labelRef:e.labelRef}),e.children)))}),Oj=k.forwardRef((e,t)=>{var r=Ks(e,co);return k.createElement(koe,Vd({},r,{ref:t}))});Oj.displayName="CartesianAxis";var joe=["x1","y1","x2","y2","key"],Eoe=["offset"],Soe=["xAxisId","yAxisId"],Boe=["xAxisId","yAxisId"];function i6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Mn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?i6(Object(r),!0).forEach(function(a){_oe(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function _oe(e,t,r){return(t=Toe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Toe(e){var t=Ioe(e,"string");return typeof t=="symbol"?t:t+""}function Ioe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cd(){return Cd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Cd.apply(null,arguments)}function Bg(e,t){if(e==null)return{};var r,a,s=Foe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Foe(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var Doe=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:a,y:s,width:i,height:l,ry:o}=e;return k.createElement("rect",{x:a,y:s,ry:o,width:i,height:l,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function iL(e){var{option:t,lineItemProps:r}=e,a;if(k.isValidElement(t))a=k.cloneElement(t,r);else if(typeof t=="function")a=t(r);else{var s,{x1:i,y1:l,x2:o,y2:d,key:u}=r,f=Bg(r,joe),p=(s=Wi(f))!==null&&s!==void 0?s:{},{offset:h}=p,m=Bg(p,Eoe);a=k.createElement("line",Cd({},m,{x1:i,y1:l,x2:o,y2:d,fill:"none",key:u}))}return a}function Uoe(e){var{x:t,width:r,horizontal:a=!0,horizontalPoints:s}=e;if(!a||!s||!s.length)return null;var{xAxisId:i,yAxisId:l}=e,o=Bg(e,Soe),d=s.map((u,f)=>{var p=Mn(Mn({},o),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(f),index:f});return k.createElement(iL,{key:"line-".concat(f),option:a,lineItemProps:p})});return k.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function Moe(e){var{y:t,height:r,vertical:a=!0,verticalPoints:s}=e;if(!a||!s||!s.length)return null;var{xAxisId:i,yAxisId:l}=e,o=Bg(e,Boe),d=s.map((u,f)=>{var p=Mn(Mn({},o),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(f),index:f});return k.createElement(iL,{option:a,lineItemProps:p,key:"line-".concat(f)})});return k.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function Roe(e){var{horizontalFill:t,fillOpacity:r,x:a,y:s,width:i,height:l,horizontalPoints:o,horizontal:d=!0}=e;if(!d||!t||!t.length||o==null)return null;var u=o.map(p=>Math.round(p+s-s)).sort((p,h)=>p-h);s!==u[0]&&u.unshift(0);var f=u.map((p,h)=>{var m=u[h+1],b=m==null,v=b?s+l-p:m-p;if(v<=0)return null;var y=h%t.length;return k.createElement("rect",{key:"react-".concat(h),y:p,x:a,height:v,width:i,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return k.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function Ooe(e){var{vertical:t=!0,verticalFill:r,fillOpacity:a,x:s,y:i,width:l,height:o,verticalPoints:d}=e;if(!t||!r||!r.length)return null;var u=d.map(p=>Math.round(p+s-s)).sort((p,h)=>p-h);s!==u[0]&&u.unshift(0);var f=u.map((p,h)=>{var m=u[h+1],b=m==null,v=b?s+l-p:m-p;if(v<=0)return null;var y=h%r.length;return k.createElement("rect",{key:"react-".concat(h),x:p,y:i,width:v,height:o,stroke:"none",fill:r[y],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return k.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Poe=(e,t)=>{var{xAxis:r,width:a,height:s,offset:i}=e;return JR(Rj(Mn(Mn(Mn({},co),r),{},{ticks:ZR(r),viewBox:{x:0,y:0,width:a,height:s}})),i.left,i.left+i.width,t)},Loe=(e,t)=>{var{yAxis:r,width:a,height:s,offset:i}=e;return JR(Rj(Mn(Mn(Mn({},co),r),{},{ticks:ZR(r),viewBox:{x:0,y:0,width:a,height:s}})),i.top,i.top+i.height,t)},Qoe={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Xn.grid};function ev(e){var t=l8(),r=o8(),a=i8(),s=Mn(Mn({},Ks(e,Qoe)),{},{x:At(e.x)?e.x:a.left,y:At(e.y)?e.y:a.top,width:At(e.width)?e.width:a.width,height:At(e.height)?e.height:a.height}),{xAxisId:i,yAxisId:l,x:o,y:d,width:u,height:f,syncWithTicks:p,horizontalValues:h,verticalValues:m}=s,b=Ns(),v=gt(U=>m5(U,"xAxis",i,b)),y=gt(U=>m5(U,"yAxis",l,b));if(!jl(u)||!jl(f)||!At(o)||!At(d))return null;var j=s.verticalCoordinatesGenerator||Poe,_=s.horizontalCoordinatesGenerator||Loe,{horizontalPoints:N,verticalPoints:E}=s;if((!N||!N.length)&&typeof _=="function"){var T=h&&h.length,B=_({yAxis:y?Mn(Mn({},y),{},{ticks:T?h:y.ticks}):void 0,width:t??u,height:r??f,offset:a},T?!0:p);ag(Array.isArray(B),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof B,"]")),Array.isArray(B)&&(N=B)}if((!E||!E.length)&&typeof j=="function"){var F=m&&m.length,R=j({xAxis:v?Mn(Mn({},v),{},{ticks:F?m:v.ticks}):void 0,width:t??u,height:r??f,offset:a},F?!0:p);ag(Array.isArray(R),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof R,"]")),Array.isArray(R)&&(E=R)}return k.createElement(Do,{zIndex:s.zIndex},k.createElement("g",{className:"recharts-cartesian-grid"},k.createElement(Doe,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),k.createElement(Roe,Cd({},s,{horizontalPoints:N})),k.createElement(Ooe,Cd({},s,{verticalPoints:E})),k.createElement(Uoe,Cd({},s,{offset:a,horizontalPoints:N,xAxis:v,yAxis:y})),k.createElement(Moe,Cd({},s,{offset:a,verticalPoints:E,xAxis:v,yAxis:y}))))}ev.displayName="CartesianGrid";var Hoe={},lL=ws({name:"errorBars",initialState:Hoe,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:a}=t.payload;e[r]||(e[r]=[]),e[r].push(a)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:a,next:s}=t.payload;e[r]&&(e[r]=e[r].map(i=>i.dataKey===a.dataKey&&i.direction===a.direction?s:i))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:a}=t.payload;e[r]&&(e[r]=e[r].filter(s=>s.dataKey!==a.dataKey||s.direction!==a.direction))}}}),{addErrorBar:HFe,replaceErrorBar:zFe,removeErrorBar:$Fe}=lL.actions,zoe=lL.reducer;function oL(e,t){var r,a,s=gt(u=>To(u,e)),i=gt(u=>Io(u,t)),l=(r=s==null?void 0:s.allowDataOverflow)!==null&&r!==void 0?r:Ya.allowDataOverflow,o=(a=i==null?void 0:i.allowDataOverflow)!==null&&a!==void 0?a:Xa.allowDataOverflow,d=l||o;return{needClip:d,needClipX:l,needClipY:o}}function $oe(e){var{xAxisId:t,yAxisId:r,clipPathId:a}=e,s=Mj(),{needClipX:i,needClipY:l,needClip:o}=oL(t,r);if(!o||!s)return null;var{x:d,y:u,width:f,height:p}=s;return k.createElement("clipPath",{id:"clipPath-".concat(a)},k.createElement("rect",{x:i?d:d-f/2,y:l?u:u-p/2,width:i?f:f*2,height:l?p:p*2}))}function Voe(e){var t=xb(e),r=3,a=2;if(t!=null){var{r:s,strokeWidth:i}=t,l=Number(s),o=Number(i);return(Number.isNaN(l)||l<0)&&(l=r),(Number.isNaN(o)||o<0)&&(o=a),{r:l,strokeWidth:o}}return{r,strokeWidth:a}}var p2={exports:{}},x2={};/**
 * @license React
 * use-sync-external-store-with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var l6;function Goe(){if(l6)return x2;l6=1;var e=OA();function t(d,u){return d===u&&(d!==0||1/d===1/u)||d!==d&&u!==u}var r=typeof Object.is=="function"?Object.is:t,a=e.useSyncExternalStore,s=e.useRef,i=e.useEffect,l=e.useMemo,o=e.useDebugValue;return x2.useSyncExternalStoreWithSelector=function(d,u,f,p,h){var m=s(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=l(function(){function y(T){if(!j){if(j=!0,_=T,T=p(T),h!==void 0&&b.hasValue){var B=b.value;if(h(B,T))return N=B}return N=T}if(B=N,r(_,T))return B;var F=p(T);return h!==void 0&&h(B,F)?(_=T,B):(_=T,N=F)}var j=!1,_,N,E=f===void 0?null:f;return[function(){return y(u())},E===null?void 0:function(){return y(E())}]},[u,f,p,h]);var v=a(d,m[0],m[1]);return i(function(){b.hasValue=!0,b.value=v},[v]),o(v),v},x2}var o6;function Koe(){return o6||(o6=1,p2.exports=Goe()),p2.exports}Koe();function qoe(e){e()}function Woe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){qoe(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let a=e;for(;a;)r.push(a),a=a.next;return r},subscribe(r){let a=!0;const s=t={callback:r,next:null,prev:t};return s.prev?s.prev.next=s:e=s,function(){!a||e===null||(a=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}var c6={notify(){},get:()=>[]};function Yoe(e,t){let r,a=c6,s=0,i=!1;function l(v){f();const y=a.subscribe(v);let j=!1;return()=>{j||(j=!0,y(),p())}}function o(){a.notify()}function d(){b.onStateChange&&b.onStateChange()}function u(){return i}function f(){s++,r||(r=e.subscribe(d),a=Woe())}function p(){s--,r&&s===0&&(r(),r=void 0,a.clear(),a=c6)}function h(){i||(i=!0,f())}function m(){i&&(i=!1,p())}const b={addNestedSub:l,notifyNestedSubs:o,handleChangeWrapper:d,isSubscribed:u,trySubscribe:h,tryUnsubscribe:m,getListeners:()=>a};return b}var Xoe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Joe=Xoe(),Zoe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",ece=Zoe(),tce=()=>Joe||ece?k.useLayoutEffect:k.useEffect,rce=tce();function d6(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function ace(e,t){if(d6(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(let s=0;s<r.length;s++)if(!Object.prototype.hasOwnProperty.call(t,r[s])||!d6(e[r[s]],t[r[s]]))return!1;return!0}var h2=Symbol.for("react-redux-context"),m2=typeof globalThis<"u"?globalThis:{};function nce(){if(!k.createContext)return{};const e=m2[h2]??(m2[h2]=new Map);let t=e.get(k.createContext);return t||(t=k.createContext(null),e.set(k.createContext,t)),t}var sce=nce();function ice(e){const{children:t,context:r,serverState:a,store:s}=e,i=k.useMemo(()=>{const d=Yoe(s);return{store:s,subscription:d,getServerState:a?()=>a:void 0}},[s,a]),l=k.useMemo(()=>s.getState(),[s]);rce(()=>{const{subscription:d}=i;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),l!==s.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[i,l]);const o=r||sce;return k.createElement(o.Provider,{value:i},t)}var lce=ice,oce=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function cce(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Pj(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var a of r)if(oce.has(a)){if(e[a]==null&&t[a]==null)continue;if(!ace(e[a],t[a]))return!1}else if(!cce(e[a],t[a]))return!1;return!0}function Lj(e,t){var r,a;return(r=(a=e.graphicalItems.cartesianItems.find(s=>s.id===t))===null||a===void 0?void 0:a.xAxisId)!==null&&r!==void 0?r:tL}function Qj(e,t){var r,a;return(r=(a=e.graphicalItems.cartesianItems.find(s=>s.id===t))===null||a===void 0?void 0:a.yAxisId)!==null&&r!==void 0?r:tL}var cL=(e,t,r)=>cP(e,"xAxis",Lj(e,t),r),dL=(e,t,r)=>oP(e,"xAxis",Lj(e,t),r),uL=(e,t,r)=>cP(e,"yAxis",Qj(e,t),r),AL=(e,t,r)=>oP(e,"yAxis",Qj(e,t),r),dce=De([Yr,cL,uL,dL,AL],(e,t,r,a,s)=>_l(e,"xAxis")?rg(t,a,!1):rg(r,s,!1)),uce=(e,t)=>t,fL=De([_O,uce],(e,t)=>e.filter(r=>r.type==="area").find(r=>r.id===t)),pL=e=>{var t=Yr(e),r=_l(t,"xAxis");return r?"yAxis":"xAxis"},Ace=(e,t)=>{var r=pL(e);return r==="yAxis"?Qj(e,t):Lj(e,t)},fce=(e,t,r)=>PO(e,pL(e),Ace(e,t),r),pce=De([fL,fce],(e,t)=>{var r;if(!(e==null||t==null)){var{stackId:a}=e,s=Aj(e);if(!(a==null||s==null)){var i=(r=t[a])===null||r===void 0?void 0:r.stackedData,l=i==null?void 0:i.find(o=>o.key===s);if(l!=null)return l.map(o=>[o[0],o[1]])}}}),xce=De([Yr,cL,uL,dL,AL,pce,xre,dce,fL,Cre],(e,t,r,a,s,i,l,o,d,u)=>{var{chartData:f,dataStartIndex:p,dataEndIndex:h}=l;if(!(d==null||e!=="horizontal"&&e!=="vertical"||t==null||r==null||a==null||s==null||a.length===0||s.length===0||o==null)){var{data:m}=d,b;if(m&&m.length>0?b=m:b=f==null?void 0:f.slice(p,h+1),b!=null)return Dce({layout:e,xAxis:t,yAxis:r,xAxisTicks:a,yAxisTicks:s,dataStartIndex:p,areaSettings:d,stackedData:i,displayedData:b,chartBaseValue:u,bandSize:o})}}),hce=["id"],mce=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function _d(){return _d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},_d.apply(null,arguments)}function xL(e,t){if(e==null)return{};var r,a,s=gce(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function gce(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function u6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function AA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?u6(Object(r),!0).forEach(function(a){bce(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function bce(e,t,r){return(t=vce(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vce(e){var t=yce(e,"string");return typeof t=="symbol"?t:t+""}function yce(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _g(e,t){return e&&e!=="none"?e:t}var wce=e=>{var{dataKey:t,name:r,stroke:a,fill:s,legendType:i,hide:l}=e;return[{inactive:l,dataKey:t,type:i,color:_g(a,s),value:e8(r,t),payload:e}]},Nce=k.memo(e=>{var{dataKey:t,data:r,stroke:a,strokeWidth:s,fill:i,name:l,hide:o,unit:d,tooltipType:u,id:f}=e,p={dataDefinedOnItem:r,getPosition:HA,settings:{stroke:a,strokeWidth:s,fill:i,dataKey:t,nameKey:void 0,name:e8(l,t),hide:o,type:u,color:_g(a,i),unit:d,graphicalItemId:f}};return k.createElement(ile,{tooltipEntrySettings:p})});function Cce(e){var{clipPathId:t,points:r,props:a}=e,{needClip:s,dot:i,dataKey:l}=a,o=Wi(a);return k.createElement(Sle,{points:r,dot:i,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:o,needClip:s,clipPathId:t})}function kce(e){var{showLabels:t,children:r,points:a}=e,s=a.map(i=>{var l,o,d={x:(l=i.x)!==null&&l!==void 0?l:0,y:(o=i.y)!==null&&o!==void 0?o:0,width:0,lowerWidth:0,upperWidth:0,height:0};return AA(AA({},d),{},{value:i.value,payload:i.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return k.createElement(Zie,{value:t?s:void 0},r)}function A6(e){var{points:t,baseLine:r,needClip:a,clipPathId:s,props:i}=e,{layout:l,type:o,stroke:d,connectNulls:u,isRange:f}=i,{id:p}=i,h=xL(i,hce),m=Wi(h),b=wi(h);return k.createElement(k.Fragment,null,(t==null?void 0:t.length)>1&&k.createElement(Nl,{clipPath:a?"url(#clipPath-".concat(s,")"):void 0},k.createElement(_m,_d({},b,{id:p,points:t,connectNulls:u,type:o,baseLine:r,layout:l,stroke:"none",className:"recharts-area-area"})),d!=="none"&&k.createElement(_m,_d({},m,{className:"recharts-area-curve",layout:l,type:o,connectNulls:u,fill:"none",points:t})),d!=="none"&&f&&k.createElement(_m,_d({},m,{className:"recharts-area-curve",layout:l,type:o,connectNulls:u,fill:"none",points:r}))),k.createElement(Cce,{points:t,props:h,clipPathId:s}))}function jce(e){var t,r,{alpha:a,baseLine:s,points:i,strokeWidth:l}=e,o=(t=i[0])===null||t===void 0?void 0:t.y,d=(r=i[i.length-1])===null||r===void 0?void 0:r.y;if(!Vt(o)||!Vt(d))return null;var u=a*Math.abs(o-d),f=Math.max(...i.map(p=>p.x||0));return At(s)?f=Math.max(s,f):s&&Array.isArray(s)&&s.length&&(f=Math.max(...s.map(p=>p.x||0),f)),At(f)?k.createElement("rect",{x:0,y:o<d?o:o-u,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(u)}):null}function Ece(e){var t,r,{alpha:a,baseLine:s,points:i,strokeWidth:l}=e,o=(t=i[0])===null||t===void 0?void 0:t.x,d=(r=i[i.length-1])===null||r===void 0?void 0:r.x;if(!Vt(o)||!Vt(d))return null;var u=a*Math.abs(o-d),f=Math.max(...i.map(p=>p.y||0));return At(s)?f=Math.max(s,f):s&&Array.isArray(s)&&s.length&&(f=Math.max(...s.map(p=>p.y||0),f)),At(f)?k.createElement("rect",{x:o<d?o:o-u,y:0,width:u,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}function Sce(e){var{alpha:t,layout:r,points:a,baseLine:s,strokeWidth:i}=e;return r==="vertical"?k.createElement(jce,{alpha:t,points:a,baseLine:s,strokeWidth:i}):k.createElement(Ece,{alpha:t,points:a,baseLine:s,strokeWidth:i})}function Bce(e){var{needClip:t,clipPathId:r,props:a,previousPointsRef:s,previousBaselineRef:i}=e,{points:l,baseLine:o,isAnimationActive:d,animationBegin:u,animationDuration:f,animationEasing:p,onAnimationStart:h,onAnimationEnd:m}=a,b=k.useMemo(()=>({points:l,baseLine:o}),[l,o]),v=w8(b,"recharts-area-"),y=Ik(),[j,_]=k.useState(!1),N=!j,E=k.useCallback(()=>{typeof m=="function"&&m(),_(!1)},[m]),T=k.useCallback(()=>{typeof h=="function"&&h(),_(!0)},[h]);if(y==null)return null;var B=s.current,F=i.current;return k.createElement(kce,{showLabels:N,points:l},a.children,k.createElement(y8,{animationId:v,begin:u,duration:f,isActive:d,easing:p,onAnimationEnd:E,onAnimationStart:T,key:v},R=>{if(B){var U=B.length/l.length,D=R===1?l:l.map((P,G)=>{var Q=Math.floor(G*U);if(B[Q]){var H=B[Q];return AA(AA({},P),{},{x:pl(H.x,P.x,R),y:pl(H.y,P.y,R)})}return P}),L;return At(o)?L=pl(F,o,R):Qn(o)||Cl(o)?L=pl(F,0,R):L=o.map((P,G)=>{var Q=Math.floor(G*U);if(Array.isArray(F)&&F[Q]){var H=F[Q];return AA(AA({},P),{},{x:pl(H.x,P.x,R),y:pl(H.y,P.y,R)})}return P}),R>0&&(s.current=D,i.current=L),k.createElement(A6,{points:D,baseLine:L,needClip:t,clipPathId:r,props:a})}return R>0&&(s.current=l,i.current=o),k.createElement(Nl,null,d&&k.createElement("defs",null,k.createElement("clipPath",{id:"animationClipPath-".concat(r)},k.createElement(Sce,{alpha:R,points:l,baseLine:o,layout:y,strokeWidth:a.strokeWidth}))),k.createElement(Nl,{clipPath:"url(#animationClipPath-".concat(r,")")},k.createElement(A6,{points:l,baseLine:o,needClip:t,clipPathId:r,props:a})))}),k.createElement(rle,{label:a.label}))}function _ce(e){var{needClip:t,clipPathId:r,props:a}=e,s=k.useRef(null),i=k.useRef();return k.createElement(Bce,{needClip:t,clipPathId:r,props:a,previousPointsRef:s,previousBaselineRef:i})}class Tce extends k.PureComponent{render(){var{hide:t,dot:r,points:a,className:s,top:i,left:l,needClip:o,xAxisId:d,yAxisId:u,width:f,height:p,id:h,baseLine:m,zIndex:b}=this.props;if(t)return null;var v=Lr("recharts-area",s),y=h,{r:j,strokeWidth:_}=Voe(r),N=ZP(r),E=j*2+_,T=o?"url(#clipPath-".concat(N?"":"dots-").concat(y,")"):void 0;return k.createElement(Do,{zIndex:b},k.createElement(Nl,{className:v},o&&k.createElement("defs",null,k.createElement($oe,{clipPathId:y,xAxisId:d,yAxisId:u}),!N&&k.createElement("clipPath",{id:"clipPath-dots-".concat(y)},k.createElement("rect",{x:l-E/2,y:i-E/2,width:f+E,height:p+E}))),k.createElement(_ce,{needClip:o,clipPathId:y,props:this.props})),k.createElement(r6,{points:a,mainColor:_g(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}),this.props.isRange&&Array.isArray(m)&&k.createElement(r6,{points:m,mainColor:_g(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}))}}var hL={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:Xn.area};function Ice(e){var t,r=Ks(e,hL),{activeDot:a,animationBegin:s,animationDuration:i,animationEasing:l,connectNulls:o,dot:d,fill:u,fillOpacity:f,hide:p,isAnimationActive:h,legendType:m,stroke:b,xAxisId:v,yAxisId:y}=r,j=xL(r,mce),_=zA(),N=TP(),{needClip:E}=oL(v,y),T=Ns(),{points:B,isRange:F,baseLine:R}=(t=gt(Q=>xce(Q,e.id,T)))!==null&&t!==void 0?t:{},U=Mj();if(_!=="horizontal"&&_!=="vertical"||U==null||N!=="AreaChart"&&N!=="ComposedChart")return null;var{height:D,width:L,x:P,y:G}=U;return!B||!B.length?null:k.createElement(Tce,_d({},j,{activeDot:a,animationBegin:s,animationDuration:i,animationEasing:l,baseLine:R,connectNulls:o,dot:d,fill:u,fillOpacity:f,height:D,hide:p,layout:_,isAnimationActive:h==="auto"?!Qp.isSsr:h,isRange:F,legendType:m,needClip:E,points:B,stroke:b,width:L,left:P,top:G,xAxisId:v,yAxisId:y}))}var Fce=(e,t,r,a,s)=>{var i=r??t;if(At(i))return i;var l=e==="horizontal"?s:a,o=l.scale.domain();if(l.type==="number"){var d=Math.max(o[0],o[1]),u=Math.min(o[0],o[1]);return i==="dataMin"?u:i==="dataMax"||d<0?d:Math.max(Math.min(o[0],o[1]),0)}return i==="dataMin"?o[0]:i==="dataMax"?o[1]:o[0]};function Dce(e){var{areaSettings:{connectNulls:t,baseValue:r,dataKey:a},stackedData:s,layout:i,chartBaseValue:l,xAxis:o,yAxis:d,displayedData:u,dataStartIndex:f,xAxisTicks:p,yAxisTicks:h,bandSize:m}=e,b=s&&s.length,v=Fce(i,l,r,o,d),y=i==="horizontal",j=!1,_=u.map((E,T)=>{var B,F,R,U;if(b)U=s[f+T];else{var D=Cn(E,a);Array.isArray(D)?(U=D,j=!0):U=[v,D]}var L=(B=(F=U)===null||F===void 0?void 0:F[1])!==null&&B!==void 0?B:null,P=L==null||b&&!t&&Cn(E,a)==null;if(y){var G;return{x:gI({axis:o,ticks:p,bandSize:m,entry:E,index:T}),y:P?null:(G=d.scale.map(L))!==null&&G!==void 0?G:null,value:U,payload:E}}return{x:P?null:(R=o.scale.map(L))!==null&&R!==void 0?R:null,y:gI({axis:d,ticks:h,bandSize:m,entry:E,index:T}),value:U,payload:E}}),N;return b||j?N=_.map(E=>{var T,B=Array.isArray(E.value)?E.value[0]:null;if(y){var F;return{x:E.x,y:B!=null&&E.y!=null&&(F=d.scale.map(B))!==null&&F!==void 0?F:null,payload:E.payload}}return{x:B!=null&&(T=o.scale.map(B))!==null&&T!==void 0?T:null,y:E.y,payload:E.payload}}):N=y?d.scale.map(v):o.scale.map(v),{points:_,baseLine:N??0,isRange:j}}function Uce(e){var t=Ks(e,hL),r=Ns();return k.createElement(Ale,{id:t.id,type:"area"},a=>k.createElement(k.Fragment,null,k.createElement(lle,{legendPayload:wce(t)}),k.createElement(Nce,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:a}),k.createElement(ble,{type:"area",id:a,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:hX(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:r,connectNulls:t.connectNulls}),k.createElement(Ice,_d({},t,{id:a}))))}var FA=k.memo(Uce,Pj);FA.displayName="Area";var Mce=["domain","range"],Rce=["domain","range"];function f6(e,t){if(e==null)return{};var r,a,s=Oce(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Oce(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function p6(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function mL(e,t){if(e===t)return!0;var{domain:r,range:a}=e,s=f6(e,Mce),{domain:i,range:l}=t,o=f6(t,Rce);return!p6(r,i)||!p6(a,l)?!1:Pj(s,o)}var Pce=["type"],Lce=["dangerouslySetInnerHTML","ticks","scale"],Qce=["id","scale"];function rC(){return rC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},rC.apply(null,arguments)}function x6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function h6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x6(Object(r),!0).forEach(function(a){Hce(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Hce(e,t,r){return(t=zce(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zce(e){var t=$ce(e,"string");return typeof t=="symbol"?t:t+""}function $ce(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aC(e,t){if(e==null)return{};var r,a,s=Vce(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Vce(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function Gce(e){var t=an(),r=k.useRef(null),a=Ik(),{type:s}=e,i=aC(e,Pce),l=Vb(a,"xAxis",s),o=k.useMemo(()=>{if(l!=null)return h6(h6({},i),{},{type:l})},[i,l]);return k.useLayoutEffect(()=>{o!=null&&(r.current===null?t(Fle(o)):r.current!==o&&t(Dle({prev:r.current,next:o})),r.current=o)},[o,t]),k.useLayoutEffect(()=>()=>{r.current&&(t(Ule(r.current)),r.current=null)},[t]),null}var Kce=e=>{var{xAxisId:t,className:r}=e,a=gt(r8),s=Ns(),i="xAxis",l=gt(j=>lP(j,i,t,s)),o=gt(j=>vae(j,t)),d=gt(j=>jae(j,t)),u=gt(j=>jO(j,t));if(o==null||d==null||u==null)return null;var{dangerouslySetInnerHTML:f,ticks:p,scale:h}=e,m=aC(e,Lce),{id:b,scale:v}=u,y=aC(u,Qce);return k.createElement(Oj,rC({},m,y,{x:d.x,y:d.y,width:o.width,height:o.height,className:Lr("recharts-".concat(i," ").concat(i),r),viewBox:a,ticks:l,axisType:i}))},qce={allowDataOverflow:Ya.allowDataOverflow,allowDecimals:Ya.allowDecimals,allowDuplicatedCategory:Ya.allowDuplicatedCategory,angle:Ya.angle,axisLine:co.axisLine,height:Ya.height,hide:!1,includeHidden:Ya.includeHidden,interval:Ya.interval,label:!1,minTickGap:Ya.minTickGap,mirror:Ya.mirror,orientation:Ya.orientation,padding:Ya.padding,reversed:Ya.reversed,scale:Ya.scale,tick:Ya.tick,tickCount:Ya.tickCount,tickLine:co.tickLine,tickSize:co.tickSize,type:Ya.type,xAxisId:0},Wce=e=>{var t=Ks(e,qce);return k.createElement(k.Fragment,null,k.createElement(Gce,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit}),k.createElement(Kce,t))},tv=k.memo(Wce,mL);tv.displayName="XAxis";var Yce=["type"],Xce=["dangerouslySetInnerHTML","ticks","scale"],Jce=["id","scale"];function nC(){return nC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},nC.apply(null,arguments)}function m6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function g6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?m6(Object(r),!0).forEach(function(a){Zce(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Zce(e,t,r){return(t=ede(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ede(e){var t=tde(e,"string");return typeof t=="symbol"?t:t+""}function tde(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sC(e,t){if(e==null)return{};var r,a,s=rde(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function rde(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function ade(e){var t=an(),r=k.useRef(null),a=Ik(),{type:s}=e,i=sC(e,Yce),l=Vb(a,"yAxis",s),o=k.useMemo(()=>{if(l!=null)return g6(g6({},i),{},{type:l})},[l,i]);return k.useLayoutEffect(()=>{o!=null&&(r.current===null?t(Mle(o)):r.current!==o&&t(Rle({prev:r.current,next:o})),r.current=o)},[o,t]),k.useLayoutEffect(()=>()=>{r.current&&(t(Ole(r.current)),r.current=null)},[t]),null}function nde(e){var{yAxisId:t,className:r,width:a,label:s}=e,i=k.useRef(null),l=k.useRef(null),o=gt(r8),d=Ns(),u=an(),f="yAxis",p=gt(B=>Bae(B,t)),h=gt(B=>Sae(B,t)),m=gt(B=>lP(B,f,t,d)),b=gt(B=>EO(B,t));if(k.useLayoutEffect(()=>{if(!(a!=="auto"||!p||Uj(s)||k.isValidElement(s)||b==null)){var B=i.current;if(B){var F=B.getCalculatedWidth();Math.round(p.width)!==Math.round(F)&&u(Ple({id:t,width:F}))}}},[m,p,u,s,t,a,b]),p==null||h==null||b==null)return null;var{dangerouslySetInnerHTML:v,ticks:y,scale:j}=e,_=sC(e,Xce),{id:N,scale:E}=b,T=sC(b,Jce);return k.createElement(Oj,nC({},_,T,{ref:i,labelRef:l,x:h.x,y:h.y,tickTextProps:a==="auto"?{width:void 0}:{width:a},width:p.width,height:p.height,className:Lr("recharts-".concat(f," ").concat(f),r),viewBox:o,ticks:m,axisType:f}))}var sde={allowDataOverflow:Xa.allowDataOverflow,allowDecimals:Xa.allowDecimals,allowDuplicatedCategory:Xa.allowDuplicatedCategory,angle:Xa.angle,axisLine:co.axisLine,hide:!1,includeHidden:Xa.includeHidden,interval:Xa.interval,label:!1,minTickGap:Xa.minTickGap,mirror:Xa.mirror,orientation:Xa.orientation,padding:Xa.padding,reversed:Xa.reversed,scale:Xa.scale,tick:Xa.tick,tickCount:Xa.tickCount,tickLine:co.tickLine,tickSize:co.tickSize,type:Xa.type,width:Xa.width,yAxisId:0},ide=e=>{var t=Ks(e,sde);return k.createElement(k.Fragment,null,k.createElement(ade,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter}),k.createElement(nde,t))},rv=k.memo(ide,mL);rv.displayName="YAxis";var lde=(e,t)=>t,Hj=De([lde,Yr,CO,ln,kP,Fo,zne,Sn],Yne),zj=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,a=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/a)}},gL=Ni("mouseClick"),bL=Rp();bL.startListening({actionCreator:gL,effect:(e,t)=>{var r=e.payload,a=Hj(t.getState(),zj(r));(a==null?void 0:a.activeIndex)!=null&&t.dispatch(Hae({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}});var iC=Ni("mouseMove"),vL=Rp(),Uh=null;vL.startListening({actionCreator:iC,effect:(e,t)=>{var r=e.payload;Uh!==null&&cancelAnimationFrame(Uh);var a=zj(r);Uh=requestAnimationFrame(()=>{var s=t.getState(),i=Nj(s,s.tooltip.settings.shared);if(i==="axis"){var l=Hj(s,a);(l==null?void 0:l.activeIndex)!=null?t.dispatch(hP({activeIndex:l.activeIndex,activeDataKey:void 0,activeCoordinate:l.activeCoordinate})):t.dispatch(xP())}Uh=null})}});function ode(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var b6={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},yL=ws({name:"rootProps",initialState:b6,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:b6.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),cde=yL.reducer,{updateOptions:dde}=yL.actions,ude=null,Ade={updatePolarOptions:(e,t)=>t.payload},wL=ws({name:"polarOptions",initialState:ude,reducers:Ade}),{updatePolarOptions:VFe}=wL.actions,fde=wL.reducer,NL=Ni("keyDown"),CL=Ni("focus"),$j=Rp();$j.startListening({actionCreator:NL,effect:(e,t)=>{var r=t.getState(),a=r.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:s}=r.tooltip,i=e.payload;if(!(i!=="ArrowRight"&&i!=="ArrowLeft"&&i!=="Enter")){var l=Cj(s,JA(r),qp(r),Yp(r)),o=l==null?-1:Number(l);if(!(!Number.isFinite(o)||o<0)){var d=Fo(r);if(i==="Enter"){var u=jg(r,"axis","hover",String(s.index));t.dispatch(XN({active:!s.active,activeIndex:s.index,activeCoordinate:u}));return}var f=Fae(r),p=f==="left-to-right"?1:-1,h=i==="ArrowRight"?1:-1,m=o+h*p;if(!(d==null||m>=d.length||m<0)){var b=jg(r,"axis","hover",String(m));t.dispatch(XN({active:!0,activeIndex:m.toString(),activeCoordinate:b}))}}}}}});$j.startListening({actionCreator:CL,effect:(e,t)=>{var r=t.getState(),a=r.rootProps.accessibilityLayer!==!1;if(a){var{keyboardInteraction:s}=r.tooltip;if(!s.active&&s.index==null){var i="0",l=jg(r,"axis","hover",String(i));t.dispatch(XN({active:!0,activeIndex:i,activeCoordinate:l}))}}}});var li=Ni("externalEvent"),kL=Rp(),g2=new Map;kL.startListening({actionCreator:li,effect:(e,t)=>{var{handler:r,reactEvent:a}=e.payload;if(r!=null){a.persist();var s=a.type,i=g2.get(s);i!==void 0&&cancelAnimationFrame(i);var l=requestAnimationFrame(()=>{try{var o=t.getState(),d={activeCoordinate:Sne(o),activeDataKey:jne(o),activeIndex:up(o),activeLabel:SP(o),activeTooltipIndex:up(o),isTooltipActive:Bne(o)};r(d,a)}finally{g2.delete(s)}});g2.set(s,l)}}});var pde=De([YA],e=>e.tooltipItemPayloads),xde=De([pde,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var a=e.find(i=>i.settings.graphicalItemId===r);if(a!=null){var{getPosition:s}=a;if(s!=null)return s(t)}}}),jL=Ni("touchMove"),EL=Rp();EL.startListening({actionCreator:jL,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){var a=t.getState(),s=Nj(a,a.tooltip.settings.shared);if(s==="axis"){var i=r.touches[0];if(i==null)return;var l=Hj(a,zj({clientX:i.clientX,clientY:i.clientY,currentTarget:r.currentTarget}));(l==null?void 0:l.activeIndex)!=null&&t.dispatch(hP({activeIndex:l.activeIndex,activeDataKey:void 0,activeCoordinate:l.activeCoordinate}))}else if(s==="item"){var o,d=r.touches[0];if(document.elementFromPoint==null||d==null)return;var u=document.elementFromPoint(d.clientX,d.clientY);if(!u||!u.getAttribute)return;var f=u.getAttribute(NX),p=(o=u.getAttribute(CX))!==null&&o!==void 0?o:void 0,h=XA(a).find(v=>v.id===p);if(f==null||h==null||p==null)return;var{dataKey:m}=h,b=xde(a,f,p);t.dispatch(Qae({activeDataKey:m,activeIndex:f,activeCoordinate:b,activeGraphicalItemId:p}))}}}});var hde=NR({brush:Wle,cartesianAxis:Lle,chartData:Sse,errorBars:zoe,graphicalItems:mle,layout:lX,legend:xJ,options:Nse,polarAxis:nle,polarOptions:fde,referenceElements:Zle,rootProps:cde,tooltip:zae,zIndex:dse}),mde=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return IY({reducer:hde,preloadedState:t,middleware:a=>{var s;return a({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([bL.middleware,vL.middleware,$j.middleware,kL.middleware,EL.middleware])},enhancers:a=>{var s=a;return typeof a=="function"&&(s=a()),s.concat(OR({type:"raf"}))},devTools:{serialize:{replacer:ode},name:"recharts-".concat(r)}})};function gde(e){var{preloadedState:t,children:r,reduxStoreName:a}=e,s=Ns(),i=k.useRef(null);if(s)return r;i.current==null&&(i.current=mde(t,a));var l=wk;return k.createElement(lce,{context:l,store:i.current},r)}function bde(e){var{layout:t,margin:r}=e,a=an(),s=Ns();return k.useEffect(()=>{s||(a(nX(t)),a(aX(r)))},[a,s,t,r]),null}var vde=k.memo(bde,Pj);function yde(e){var t=an();return k.useEffect(()=>{t(dde(e))},[t,e]),null}function v6(e){var{zIndex:t,isPanorama:r}=e,a=k.useRef(null),s=an();return k.useLayoutEffect(()=>(a.current&&s(ose({zIndex:t,element:a.current,isPanorama:r})),()=>{s(cse({zIndex:t,isPanorama:r}))}),[s,t,r]),k.createElement("g",{tabIndex:-1,ref:a})}function y6(e){var{children:t,isPanorama:r}=e,a=gt(Jne);if(!a||a.length===0)return t;var s=a.filter(l=>l<0),i=a.filter(l=>l>0);return k.createElement(k.Fragment,null,s.map(l=>k.createElement(v6,{key:l,zIndex:l,isPanorama:r})),t,i.map(l=>k.createElement(v6,{key:l,zIndex:l,isPanorama:r})))}var wde=["children"];function Nde(e,t){if(e==null)return{};var r,a,s=Cde(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Cde(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}function Tg(){return Tg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Tg.apply(null,arguments)}var kde={width:"100%",height:"100%",display:"block"},jde=k.forwardRef((e,t)=>{var r=l8(),a=o8(),s=m8();if(!jl(r)||!jl(a))return null;var{children:i,otherAttributes:l,title:o,desc:d}=e,u,f;return l!=null&&(typeof l.tabIndex=="number"?u=l.tabIndex:u=s?0:void 0,typeof l.role=="string"?f=l.role:f=s?"application":void 0),k.createElement($M,Tg({},l,{title:o,desc:d,role:f,tabIndex:u,width:r,height:a,style:kde,ref:t}),i)}),Ede=e=>{var{children:t}=e,r=gt(Ib);if(!r)return null;var{width:a,height:s,y:i,x:l}=r;return k.createElement($M,{width:a,height:s,x:l,y:i},t)},w6=k.forwardRef((e,t)=>{var{children:r}=e,a=Nde(e,wde),s=Ns();return s?k.createElement(Ede,null,k.createElement(y6,{isPanorama:!0},r)):k.createElement(jde,Tg({ref:t},a),k.createElement(y6,{isPanorama:!1},r))});function Sde(){var e=an(),[t,r]=k.useState(null),a=gt(wX);return k.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),i=s.width/t.offsetWidth;Vt(i)&&i!==a&&e(iX(i))}},[t,e,a]),r}function N6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,a)}return r}function Bde(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?N6(Object(r),!0).forEach(function(a){_de(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function _de(e,t,r){return(t=Tde(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tde(e){var t=Ide(e,"string");return typeof t=="symbol"?t:t+""}function Ide(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ec(){return Ec=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Ec.apply(null,arguments)}var Fde=()=>(Rse(),null);function Ig(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var Dde=k.forwardRef((e,t)=>{var r,a,s=k.useRef(null),[i,l]=k.useState({containerWidth:Ig((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Ig((a=e.style)===null||a===void 0?void 0:a.height)}),o=k.useCallback((u,f)=>{l(p=>{var h=Math.round(u),m=Math.round(f);return p.containerWidth===h&&p.containerHeight===m?p:{containerWidth:h,containerHeight:m}})},[]),d=k.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:f,height:p}=u.getBoundingClientRect();o(f,p);var h=b=>{var v=b[0];if(v!=null){var{width:y,height:j}=v.contentRect;o(y,j)}},m=new ResizeObserver(h);m.observe(u),s.current=m}},[t,o]);return k.useEffect(()=>()=>{var u=s.current;u!=null&&u.disconnect()},[o]),k.createElement(k.Fragment,null,k.createElement(Pp,{width:i.containerWidth,height:i.containerHeight}),k.createElement("div",Ec({ref:d},e)))}),Ude=k.forwardRef((e,t)=>{var{width:r,height:a}=e,[s,i]=k.useState({containerWidth:Ig(r),containerHeight:Ig(a)}),l=k.useCallback((d,u)=>{i(f=>{var p=Math.round(d),h=Math.round(u);return f.containerWidth===p&&f.containerHeight===h?f:{containerWidth:p,containerHeight:h}})},[]),o=k.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:u,height:f}=d.getBoundingClientRect();l(u,f)}},[t,l]);return k.createElement(k.Fragment,null,k.createElement(Pp,{width:s.containerWidth,height:s.containerHeight}),k.createElement("div",Ec({ref:o},e)))}),Mde=k.forwardRef((e,t)=>{var{width:r,height:a}=e;return k.createElement(k.Fragment,null,k.createElement(Pp,{width:r,height:a}),k.createElement("div",Ec({ref:t},e)))}),Rde=k.forwardRef((e,t)=>{var{width:r,height:a}=e;return typeof r=="string"||typeof a=="string"?k.createElement(Ude,Ec({},e,{ref:t})):typeof r=="number"&&typeof a=="number"?k.createElement(Mde,Ec({},e,{width:r,height:a,ref:t})):k.createElement(k.Fragment,null,k.createElement(Pp,{width:r,height:a}),k.createElement("div",Ec({ref:t},e)))});function Ode(e){return e?Dde:Rde}var Pde=k.forwardRef((e,t)=>{var{children:r,className:a,height:s,onClick:i,onContextMenu:l,onDoubleClick:o,onMouseDown:d,onMouseEnter:u,onMouseLeave:f,onMouseMove:p,onMouseUp:h,onTouchEnd:m,onTouchMove:b,onTouchStart:v,style:y,width:j,responsive:_,dispatchTouchEvents:N=!0}=e,E=k.useRef(null),T=an(),[B,F]=k.useState(null),[R,U]=k.useState(null),D=Sde(),L=Bk(),P=(L==null?void 0:L.width)>0?L.width:j,G=(L==null?void 0:L.height)>0?L.height:s,Q=k.useCallback(ae=>{D(ae),typeof t=="function"&&t(ae),F(ae),U(ae),ae!=null&&(E.current=ae)},[D,t,F,U]),H=k.useCallback(ae=>{T(gL(ae)),T(li({handler:i,reactEvent:ae}))},[T,i]),X=k.useCallback(ae=>{T(iC(ae)),T(li({handler:u,reactEvent:ae}))},[T,u]),K=k.useCallback(ae=>{T(xP()),T(li({handler:f,reactEvent:ae}))},[T,f]),ee=k.useCallback(ae=>{T(iC(ae)),T(li({handler:p,reactEvent:ae}))},[T,p]),W=k.useCallback(()=>{T(CL())},[T]),Y=k.useCallback(ae=>{T(NL(ae.key))},[T]),M=k.useCallback(ae=>{T(li({handler:l,reactEvent:ae}))},[T,l]),O=k.useCallback(ae=>{T(li({handler:o,reactEvent:ae}))},[T,o]),q=k.useCallback(ae=>{T(li({handler:d,reactEvent:ae}))},[T,d]),z=k.useCallback(ae=>{T(li({handler:h,reactEvent:ae}))},[T,h]),J=k.useCallback(ae=>{T(li({handler:v,reactEvent:ae}))},[T,v]),re=k.useCallback(ae=>{N&&T(jL(ae)),T(li({handler:b,reactEvent:ae}))},[T,N,b]),le=k.useCallback(ae=>{T(li({handler:m,reactEvent:ae}))},[T,m]),ne=Ode(_);return k.createElement(MP.Provider,{value:B},k.createElement(Fq.Provider,{value:R},k.createElement(ne,{width:P??(y==null?void 0:y.width),height:G??(y==null?void 0:y.height),className:Lr("recharts-wrapper",a),style:Bde({position:"relative",cursor:"default",width:P,height:G},y),onClick:H,onContextMenu:M,onDoubleClick:O,onFocus:W,onKeyDown:Y,onMouseDown:q,onMouseEnter:X,onMouseLeave:K,onMouseMove:ee,onMouseUp:z,onTouchEnd:le,onTouchMove:re,onTouchStart:J,ref:Q},k.createElement(Fde,null),r)))}),Lde=["width","height","responsive","children","className","style","compact","title","desc"];function Qde(e,t){if(e==null)return{};var r,a,s=Hde(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function Hde(e,t){if(e==null)return{};var r={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;r[a]=e[a]}return r}var zde=k.forwardRef((e,t)=>{var{width:r,height:a,responsive:s,children:i,className:l,style:o,compact:d,title:u,desc:f}=e,p=Qde(e,Lde),h=Wi(p);return d?k.createElement(k.Fragment,null,k.createElement(Pp,{width:r,height:a}),k.createElement(w6,{otherAttributes:h,title:u,desc:f},i)):k.createElement(Pde,{className:l,style:o,width:r,height:a,responsive:s??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},k.createElement(w6,{otherAttributes:h,title:u,desc:f,ref:t},k.createElement(toe,null,i)))});function lC(){return lC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)({}).hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},lC.apply(null,arguments)}var $de={top:5,right:5,bottom:5,left:5},Vde={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:$de,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Gde=k.forwardRef(function(t,r){var a,s=Ks(t.categoricalChartProps,Vde),{chartName:i,defaultTooltipEventType:l,validateTooltipEventTypes:o,tooltipPayloadSearcher:d,categoricalChartProps:u}=t,f={chartName:i,defaultTooltipEventType:l,validateTooltipEventTypes:o,tooltipPayloadSearcher:d,eventEmitter:void 0};return k.createElement(gde,{preloadedState:{options:f},reduxStoreName:(a=u.id)!==null&&a!==void 0?a:i},k.createElement(qle,{chartData:u.data}),k.createElement(vde,{layout:s.layout,margin:s.margin}),k.createElement(yde,{baseValue:s.baseValue,accessibilityLayer:s.accessibilityLayer,barCategoryGap:s.barCategoryGap,maxBarSize:s.maxBarSize,stackOffset:s.stackOffset,barGap:s.barGap,barSize:s.barSize,syncId:s.syncId,syncMethod:s.syncMethod,className:s.className,reverseStackOrder:s.reverseStackOrder}),k.createElement(zde,lC({},s,{ref:r})))}),Kde=["axis"],Vj=k.forwardRef((e,t)=>k.createElement(Gde,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Kde,tooltipPayloadSearcher:yse,categoricalChartProps:e,ref:t}));const C6=({user:e,onNavigate:t})=>{var F,R;const{maintenance:r,refreshData:a,financialTotals:s}=ht(),[i,l]=k.useState(null),[o,d]=k.useState([]),[u,f]=k.useState([]),[p,h]=k.useState(!0),[m,b]=k.useState(null),[v,y]=k.useState(!1),[j,_]=k.useState({president:"",secretary:"",treasurer:"",nextAssembly:"S/A"}),N=["admin","programmer","board"].includes(e.role),E=async()=>{h(!0),b(null);try{const[U,D,L]=await Promise.all([we.getDashboardStats(),we.getAnnouncements(),we.getSystemSettings()]);if(l(U),d(D||[]),_({president:(L==null?void 0:L.board_president)||"No Asignado",secretary:(L==null?void 0:L.board_secretary)||"No Asignado",treasurer:(L==null?void 0:L.board_treasurer)||"No Asignado",nextAssembly:(L==null?void 0:L.next_assembly_date)||"S/A"}),N){const P=await we.getCriticalBills();f(P||[])}}catch(U){console.error("Error loading dashboard",U),b(U.message||"Error al cargar datos del panel.")}finally{h(!1)}};k.useEffect(()=>{E();const U=setTimeout(()=>y(!0),200);return()=>clearTimeout(U)},[e.role,N]);const T=(r==null?void 0:r.filter(U=>U.status!=="Completado"&&U.status!=="Rechazada").length)||0;if(p)return n.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-4",children:[n.jsx("div",{className:"w-10 h-10 border-4 border-blue-100 border-t-blue-600 rounded-full animate-spin"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:"Iniciando Motor..."})]});if(m)return n.jsxs("div",{className:"bg-red-50 border border-red-100 p-8 sm:p-10 rounded-[2rem] sm:rounded-[3rem] text-center max-w-lg mx-auto shadow-xl",children:[n.jsx(Sr,{className:"w-12 h-12 sm:w-16 sm:h-16 text-red-500 mx-auto mb-6"}),n.jsx("h3",{className:"text-xl sm:text-2xl font-black text-red-800 tracking-tight",children:"Error de Acceso"}),n.jsx("p",{className:"text-red-600 font-medium mb-6 text-sm sm:text-base",children:m}),n.jsxs("button",{onClick:E,className:"bg-red-600 text-white px-8 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest hover:bg-red-700 transition-all flex items-center gap-2 mx-auto",children:[n.jsx(ct,{size:14})," Reintentar Carga"]})]});const B=((R=(F=e==null?void 0:e.fullName)==null?void 0:F.split(" "))==null?void 0:R[0])||"Usuario";return n.jsxs("div",{className:"space-y-6 sm:space-y-8 animate-in fade-in duration-700",children:[N&&u.length>0&&n.jsxs("div",{className:"bg-red-50 border border-red-100 p-5 sm:p-6 rounded-2xl sm:rounded-[2rem] flex flex-col md:flex-row items-center justify-between gap-4 shadow-sm",children:[n.jsxs("div",{className:"flex items-center gap-4 text-center md:text-left flex-col md:flex-row",children:[n.jsx("div",{className:"bg-red-500 p-3 rounded-2xl text-white shadow-lg shadow-red-200",children:n.jsx(nK,{size:24})}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-red-700 font-black uppercase text-[10px] tracking-widest",children:"Pagos Vencidos"}),n.jsxs("p",{className:"text-red-600/70 text-xs sm:text-sm font-medium",children:["Hay ",u.length," facturas esperando aprobación."]})]})]}),n.jsx("button",{onClick:()=>t("balance"),className:"w-full md:w-auto bg-red-600 hover:bg-red-700 text-white text-xs font-bold px-8 py-2.5 rounded-xl transition-all active:scale-95 shadow-lg shadow-red-200",children:"Gestionar"})]}),n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-center gap-6 sm:gap-8 bg-white p-7 sm:p-10 lg:p-12 rounded-[2rem] sm:rounded-[3rem] border border-slate-200 shadow-sm relative overflow-hidden group",children:[["admin","programmer"].includes(e.role)&&n.jsx("button",{onClick:()=>window.location.reload(),className:"absolute top-6 right-6 p-3 bg-slate-50 hover:bg-blue-50 text-slate-400 hover:text-blue-600 rounded-xl transition-all border border-slate-100 z-20 group/refresh shadow-sm active:scale-95",title:"Recargar Sistema (F5)",children:n.jsx(ct,{size:18,className:"group-hover/refresh:rotate-180 transition-transform duration-500"})}),n.jsxs("div",{className:"relative z-10 text-center lg:text-left w-full lg:w-auto",children:[n.jsxs("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter",children:["Hola, ",n.jsx("span",{className:"text-blue-600",children:B})]}),n.jsx("p",{className:"text-slate-400 mt-2 sm:mt-3 font-medium text-base sm:text-lg leading-relaxed max-w-md mx-auto lg:mx-0",children:"Bienvenido de nuevo al panel."}),n.jsxs("div",{className:"mt-6 sm:mt-8 flex items-center justify-center lg:justify-start gap-3",children:[n.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-pulse"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-[0.2em] text-blue-600 bg-blue-50 px-4 py-1.5 rounded-full border border-blue-100",children:"Estado: Online"})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:gap-4 w-full lg:w-auto relative z-10",children:[n.jsxs("div",{className:"bg-slate-50 p-4 sm:p-6 rounded-2xl sm:rounded-[2rem] border border-slate-100 flex flex-col items-center",children:[n.jsxs("span",{className:"text-xl sm:text-2xl font-black text-slate-800 tracking-tight",children:[(i==null?void 0:i.collectionRate)??0,"%"]}),n.jsx("span",{className:"text-[8px] sm:text-[10px] font-bold text-slate-400 uppercase tracking-widest mt-1 text-center",children:"Recaudación"})]}),n.jsxs("div",{className:"bg-slate-50 p-4 sm:p-6 rounded-2xl sm:rounded-[2rem] border border-slate-100 flex flex-col items-center",children:[n.jsxs("span",{className:"text-xl sm:text-2xl font-black text-slate-800 tracking-tight",children:[(i==null?void 0:i.occupancyRate)??0,"%"]}),n.jsx("span",{className:"text-[8px] sm:text-[10px] font-bold text-slate-400 uppercase tracking-widest mt-1 text-center",children:"Ocupación"})]})]}),n.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 sm:w-64 sm:h-64 bg-blue-50/50 rounded-full blur-[100px] pointer-events-none -translate-y-1/2 translate-x-1/3"})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-5 gap-4 sm:gap-6",children:[n.jsx(sf,{title:"Recaudado",value:`$${((i==null?void 0:i.totalCollection)??0).toLocaleString()}`,icon:kn,color:"blue",trend:"+12% mes"}),e.role==="programmer"&&n.jsx(sf,{title:"Caja en Divisa",value:`$${((s==null?void 0:s.initialCashUsd)??0).toLocaleString(void 0,{minimumFractionDigits:2})}`,icon:Ic,color:"emerald",trend:"Efectivo"}),n.jsx(sf,{title:"Fondo Reserva",value:`$ ${((s==null?void 0:s.reserveFundUsd)??0).toLocaleString(void 0,{maximumFractionDigits:0})}`,icon:ho,color:"indigo",trend:"Patrimonio"}),n.jsx(sf,{title:"Fallas",value:T.toString(),icon:Xf,color:"amber",trend:"Tickets"}),n.jsx(sf,{title:"Asamblea",value:j.nextAssembly,icon:Wr,color:"slate",trend:"Fecha"})]}),n.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-6 sm:gap-8",children:[n.jsxs("div",{className:"xl:col-span-2 bg-white p-6 sm:p-8 lg:p-10 rounded-[2rem] sm:rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden flex flex-col min-w-0",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-8 sm:mb-10 gap-4",children:[n.jsxs("h3",{className:"text-lg sm:text-xl font-black flex items-center gap-3 tracking-tight text-slate-800 uppercase",children:[n.jsx(da,{className:"text-blue-600",size:20})," FLUJO USD"]}),n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("div",{className:"flex items-center gap-2 text-[9px] font-bold uppercase text-slate-400",children:[n.jsx("div",{className:"w-1.5 h-1.5 bg-slate-200 rounded-full"})," Proy."]}),n.jsxs("div",{className:"flex items-center gap-2 text-[9px] font-bold uppercase text-blue-600",children:[n.jsx("div",{className:"w-1.5 h-1.5 bg-blue-600 rounded-full"})," Real"]})]})]}),n.jsx("div",{className:"relative w-full h-[250px] sm:h-[320px] min-h-[250px]",children:n.jsx("div",{className:"absolute inset-0",children:v&&i&&n.jsx(_k,{width:"100%",height:"100%",minWidth:0,children:n.jsxs(Vj,{data:(i==null?void 0:i.monthlyTrend)||[],margin:{top:10,right:5,left:-25,bottom:0},children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:"colorRec",x1:"0",y1:"0",x2:"0",y2:"1",children:[n.jsx("stop",{offset:"5%",stopColor:"#2563eb",stopOpacity:.1}),n.jsx("stop",{offset:"95%",stopColor:"#2563eb",stopOpacity:0})]})}),n.jsx(ev,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),n.jsx(tv,{dataKey:"label",stroke:"#94a3b8",fontSize:10,fontStyle:"bold",axisLine:!1,tickLine:!1}),n.jsx(rv,{stroke:"#94a3b8",fontSize:10,fontStyle:"bold",axisLine:!1,tickLine:!1}),n.jsx(Fj,{cursor:{stroke:"#e2e8f0",strokeWidth:2},contentStyle:{backgroundColor:"#fff",border:"1px solid #e2e8f0",borderRadius:"15px",fontSize:"12px"}}),n.jsx(FA,{type:"monotone",dataKey:"total",stroke:"#cbd5e1",fill:"transparent",strokeWidth:2,strokeDasharray:"6 6"}),n.jsx(FA,{type:"monotone",dataKey:"collected",stroke:"#2563eb",fillOpacity:1,fill:"url(#colorRec)",strokeWidth:3})]})})})})]}),n.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[n.jsxs("div",{className:"bg-slate-900 p-7 sm:p-8 rounded-[2rem] sm:rounded-[3rem] text-white shadow-2xl relative overflow-hidden group border-r-4 border-blue-600",children:[n.jsxs("h3",{className:"text-[10px] font-black flex items-center gap-3 tracking-widest mb-6 sm:mb-8 text-blue-400 uppercase",children:[n.jsx(Ia,{size:16})," Junta Directiva"]}),n.jsxs("div",{className:"space-y-5 sm:space-y-6 relative z-10",children:[n.jsxs("div",{className:"border-l-2 border-blue-600/30 pl-4",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest mb-1",children:"Presidente"}),n.jsx("p",{className:"text-xs sm:text-sm font-black text-white uppercase tracking-tight truncate",children:j.president})]}),n.jsxs("div",{className:"border-l-2 border-blue-600/30 pl-4",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest mb-1",children:"Secretario(a)"}),n.jsx("p",{className:"text-xs sm:text-sm font-black text-white uppercase tracking-tight truncate",children:j.secretary})]}),n.jsxs("div",{className:"border-l-2 border-blue-600/30 pl-4",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest mb-1",children:"Tesorero(a)"}),n.jsx("p",{className:"text-xs sm:text-sm font-black text-white uppercase tracking-tight truncate",children:j.treasurer})]})]}),n.jsx(Qi,{size:100,className:"absolute right-[-10px] bottom-[-10px] text-white/5 pointer-events-none group-hover:scale-110 transition-transform duration-[2s]"})]}),n.jsxs("div",{className:"bg-white p-6 sm:p-8 rounded-[2rem] sm:rounded-[3rem] border border-slate-200 shadow-sm",children:[n.jsxs("h3",{className:"text-lg sm:text-xl font-black flex items-center gap-3 tracking-tight mb-6 sm:mb-8 text-slate-800 uppercase",children:[n.jsx(Pc,{className:"text-indigo-600",size:20})," NOTICIAS"]}),n.jsxs("div",{className:"space-y-4",children:[o.slice(0,3).map((U,D)=>n.jsxs("div",{className:"flex gap-4 p-3 hover:bg-slate-50 rounded-xl transition-all group cursor-pointer border border-transparent",children:[n.jsx("div",{className:`w-1.5 h-1.5 rounded-full mt-1.5 flex-shrink-0 ${U.priority==="Alta"?"bg-red-500":"bg-blue-400"}`}),n.jsxs("div",{className:"flex-1 min-w-0",children:[n.jsx("h4",{className:"text-[11px] font-black text-slate-700 group-hover:text-blue-600 transition-colors truncate",children:U.title}),n.jsx("p",{className:"text-[8px] text-slate-400 mt-0.5 uppercase font-black tracking-widest",children:U.date})]})]},D)),o.length===0&&n.jsx("p",{className:"text-[10px] text-slate-400 text-center italic py-4",children:"Sin noticias recientes"})]})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 sm:gap-6 pb-6",children:[n.jsx(b2,{color:"blue",icon:kn,title:"Pagar Recibo",desc:"Cargar comprobante",onClick:()=>t(e.role==="owner"?"properties":"view-fees")}),n.jsx(b2,{color:"indigo",icon:Wr,title:"Reservar Áreas",desc:"Cancha, Caney, Salón",onClick:()=>t("reservations")}),n.jsx(b2,{color:"slate",icon:Jd,title:"Reportar Falla",desc:"Tickets técnicos",onClick:()=>t("services")})]}),n.jsx("div",{className:"pt-10 border-t border-slate-100 text-center",children:n.jsxs("p",{className:"text-xs sm:text-sm text-slate-700 font-black uppercase tracking-[0.2em]",children:["SISTEMA ADMINISTRATIVO • ",n.jsx("span",{className:"text-blue-600",children:"BY ANDRES MATHISON"})]})})]})},sf=({title:e,value:t,icon:r,color:a,trend:s})=>{const i={blue:"text-blue-600 bg-blue-50 border-blue-100 shadow-blue-100/50",indigo:"text-indigo-600 bg-indigo-50 border-indigo-100 shadow-indigo-100/50",amber:"text-amber-600 bg-amber-50 border-amber-100 shadow-amber-100/50",emerald:"text-emerald-600 bg-emerald-50 border-emerald-100 shadow-emerald-100/50",slate:"text-slate-600 bg-slate-100 border-slate-200 shadow-slate-100/50"};return n.jsxs("div",{className:"bg-white p-4 sm:p-6 lg:p-7 rounded-2xl sm:rounded-[2.5rem] border border-slate-200 hover:border-blue-400 transition-all group shadow-sm",children:[n.jsx("div",{className:`w-10 h-10 sm:w-14 sm:h-14 rounded-xl sm:rounded-2xl flex items-center justify-center border mb-3 sm:mb-5 transition-transform group-hover:scale-110 shadow-lg ${i[a]}`,children:n.jsx(r,{className:"w-5 h-5 sm:w-7 sm:h-7"})}),n.jsx("p",{className:"text-slate-400 text-[8px] sm:text-[10px] font-black uppercase tracking-widest leading-none truncate",children:e}),n.jsx("h3",{className:"text-lg sm:text-2xl lg:text-3xl font-black text-slate-800 mt-1 sm:mt-2 tracking-tighter truncate",children:t}),n.jsx("div",{className:"flex items-center gap-1.5 mt-2 sm:mt-3 overflow-hidden",children:n.jsxs("div",{className:"bg-slate-100 px-2 py-0.5 rounded-full flex items-center gap-1 shrink-0",children:[n.jsx(nk,{size:10,className:"text-blue-600"}),n.jsx("span",{className:"text-[7px] sm:text-[10px] text-slate-600 font-bold whitespace-nowrap",children:s})]})})]})},b2=({color:e,icon:t,title:r,desc:a,onClick:s})=>{const i={blue:"from-blue-600 to-blue-800 shadow-blue-200",indigo:"from-indigo-600 to-indigo-800 shadow-indigo-200",slate:"from-slate-700 to-slate-900 shadow-slate-200"};return n.jsxs("button",{onClick:s,className:`p-6 sm:p-8 rounded-2xl sm:rounded-[2.5rem] bg-gradient-to-br ${i[e]} text-white text-left shadow-2xl transition-all hover:-translate-y-1 sm:hover:-translate-y-2 group overflow-hidden relative active:scale-95`,children:[n.jsxs("div",{className:"relative z-10",children:[n.jsx(t,{className:"w-7 h-7 sm:w-8 sm:h-8 mb-3 sm:mb-4 opacity-70 group-hover:scale-110 transition-transform"}),n.jsx("h4",{className:"text-lg sm:text-xl font-black tracking-tight",children:r}),n.jsx("p",{className:"text-white/60 text-[10px] sm:text-xs font-bold mt-1 uppercase tracking-widest",children:a})]}),n.jsx("div",{className:"absolute -right-4 -bottom-4 bg-white/10 w-24 h-24 sm:w-32 sm:h-32 rounded-full blur-3xl group-hover:scale-150 transition-transform"})]})},qde=({user:e})=>{const{fees:t,properties:r}=ht(),[a,s]=k.useState(null),[i,l]=k.useState(!0);k.useEffect(()=>{(async()=>{try{const m=await we.getMyProperty(e.propertyCode||"");s(m)}catch(m){console.error("Error fetching property status",m)}finally{l(!1)}})()},[e.propertyCode]);const o=k.useMemo(()=>{if(!a)return null;for(const h of t){const m=h.debts.find(b=>b.propertyId===a.id);if(m&&m.rejectionMessage)return{message:m.rejectionMessage,period:`${new Intl.DateTimeFormat("es-ES",{month:"long"}).format(new Date(0,h.month))} ${h.year}`}}return null},[t,a]),d=k.useMemo(()=>{const h=[];return t.forEach(m=>{const b=m.debts.find(v=>v.propertyId===(a==null?void 0:a.id));b&&b.payments&&b.payments.forEach(v=>{h.push({...v,feeName:`${new Intl.DateTimeFormat("es-ES",{month:"long"}).format(new Date(0,m.month))} ${m.year}`})})}),h.sort((m,b)=>new Date(b.date).getTime()-new Date(m.date).getTime())},[t,a]);if(i)return n.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-4",children:[n.jsx("div",{className:"w-10 h-10 border-4 border-blue-100 border-t-blue-600 rounded-full animate-spin"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:"Consultando estatus..."})]});const u=(a==null?void 0:a.debt)??0,f=u<0,p=Math.abs(u);return n.jsxs("div",{className:"max-w-6xl mx-auto space-y-6 sm:space-y-8 animate-in slide-in-from-bottom duration-500 pb-12 px-1",children:[o&&n.jsx("div",{className:"bg-red-600 text-white p-6 sm:p-8 rounded-2xl sm:rounded-[2.5rem] shadow-2xl shadow-red-200 flex flex-col md:flex-row items-center justify-between gap-6 animate-pulse-subtle",children:n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"bg-white/20 p-3 sm:p-4 rounded-xl sm:rounded-2xl",children:n.jsx(Xr,{size:28,className:"text-white"})}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-black uppercase text-[11px] sm:text-sm tracking-[0.15em]",children:"Atención: Pago Anulado"}),n.jsxs("p",{className:"text-red-100 text-base sm:text-lg font-bold mt-1 leading-tight",children:['"',o.message,'"']}),n.jsxs("p",{className:"text-[9px] font-black uppercase tracking-widest opacity-70 mt-2",children:["Correspondiente a: ",o.period]})]})]})}),n.jsxs("div",{className:`rounded-[2rem] sm:rounded-[3.5rem] p-6 sm:p-10 lg:p-14 text-white relative overflow-hidden shadow-2xl transition-all duration-500 ${f?"bg-gradient-to-br from-emerald-500 to-teal-700 shadow-emerald-500/20":"bg-gradient-to-br from-blue-600 to-blue-800 shadow-blue-500/20"}`,children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-8 sm:gap-12",children:[n.jsxs("div",{className:"text-center lg:text-left flex-1 w-full",children:[n.jsxs("div",{className:"bg-white/10 w-fit px-4 py-1.5 rounded-full backdrop-blur-md border border-white/20 mb-6 sm:mb-8 mx-auto lg:mx-0 flex items-center gap-2",children:[n.jsx(Qc,{size:12,className:"text-yellow-300 fill-yellow-300"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-[0.2em]",children:"Estatus de Cuenta SAC 2026"})]}),n.jsxs("h1",{className:"text-4xl sm:text-5xl lg:text-7xl font-black mb-3 tracking-tighter leading-none",children:["Unidad ",n.jsx("span",{className:f?"text-emerald-100":"text-blue-200",children:a==null?void 0:a.code})]}),n.jsx("p",{className:"text-white/80 font-bold text-base sm:text-xl uppercase tracking-tight opacity-90 truncate max-w-full px-2",children:e.fullName}),n.jsxs("div",{className:"flex flex-wrap gap-3 mt-8 sm:mt-10 justify-center lg:justify-start px-2",children:[n.jsxs("div",{className:"px-4 py-3 sm:px-6 sm:py-4 bg-black/10 rounded-xl sm:rounded-2xl backdrop-blur-md flex items-center gap-3 border border-white/5",children:[n.jsx(ea,{size:20,className:"text-white/50"}),n.jsxs("div",{className:"text-left",children:[n.jsx("p",{className:"text-[7px] sm:text-[8px] font-black uppercase opacity-50",children:"Tipo"}),n.jsxs("p",{className:"text-xs sm:text-sm font-black whitespace-nowrap",children:[a==null?void 0:a.type," ",a==null?void 0:a.number]})]})]}),n.jsxs("div",{className:"px-4 py-3 sm:px-6 sm:py-4 bg-black/10 rounded-xl sm:rounded-2xl backdrop-blur-md flex items-center gap-3 border border-white/5",children:[n.jsx(da,{size:20,className:"text-white/50"}),n.jsxs("div",{className:"text-left",children:[n.jsx("p",{className:"text-[7px] sm:text-[8px] font-black uppercase opacity-50",children:"Alícuota"}),n.jsxs("p",{className:"text-xs sm:text-sm font-black whitespace-nowrap",children:[Number((a==null?void 0:a.aliquot)??0).toFixed(4),"%"]})]})]})]})]}),n.jsxs("div",{className:"bg-white p-7 sm:p-10 lg:p-14 rounded-[2rem] sm:rounded-[3.5rem] shadow-2xl flex flex-col items-center w-full max-w-sm sm:min-w-[320px] transform hover:scale-105 transition-transform duration-300",children:[n.jsx("span",{className:`text-[8px] sm:text-[10px] font-black uppercase tracking-widest mb-3 sm:mb-4 px-4 py-1.5 rounded-full border ${f?"text-emerald-600 border-emerald-100 bg-emerald-50":"text-slate-400 border-slate-100 bg-slate-50"}`,children:f?"PAGO EN EXCESO":"TOTAL PENDIENTE"}),n.jsxs("div",{className:"flex items-start gap-1",children:[n.jsx("span",{className:`text-xl sm:text-2xl font-black mt-1.5 sm:mt-2 ${f?"text-emerald-600":"text-slate-900"}`,children:"$"}),n.jsx("span",{className:`text-5xl sm:text-7xl lg:text-8xl font-black tracking-tighter ${f?"text-emerald-600":"text-slate-900"}`,children:p.toLocaleString(void 0,{minimumFractionDigits:2})})]}),n.jsx("p",{className:`text-center font-bold text-[10px] sm:text-xs mt-3 sm:mt-4 uppercase tracking-tighter ${f?"text-emerald-500":"text-slate-400"}`,children:f?"Abonado a su próxima factura":"Agradecemos su pago oportuno"})]})]}),n.jsx("div",{className:"absolute top-0 right-0 w-[300px] h-[300px] sm:w-[500px] h-[500px] bg-white/10 rounded-full -translate-y-1/2 translate-x-1/2 blur-[80px] sm:blur-[120px] pointer-events-none"})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 sm:gap-8",children:[n.jsxs("div",{className:"lg:col-span-2 bg-white p-6 sm:p-8 lg:p-12 rounded-[2rem] sm:rounded-[3.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8 sm:mb-10 gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3 sm:gap-4",children:[n.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-slate-900 text-white rounded-xl sm:rounded-2xl flex items-center justify-center",children:n.jsx(Pc,{size:20})}),n.jsx("h3",{className:"text-xl sm:text-2xl font-black text-slate-800 tracking-tight",children:"Últimos Abonos"})]}),n.jsxs("span",{className:"text-[8px] sm:text-[10px] font-black uppercase tracking-widest text-slate-400 bg-slate-50 px-3 py-1.5 rounded-full",children:[d.length," Ops"]})]}),n.jsx("div",{className:"space-y-3 sm:space-y-4",children:d.length===0?n.jsxs("div",{className:"py-16 sm:py-20 text-center border-2 border-dashed border-slate-100 rounded-2xl sm:rounded-[2.5rem]",children:[n.jsx(Sr,{className:"mx-auto mb-4 text-slate-200",size:40}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:"Sin pagos registrados aún."})]}):d.slice(0,5).map((h,m)=>n.jsxs("div",{className:"flex items-center justify-between p-4 sm:p-6 bg-slate-50 rounded-xl sm:rounded-[2rem] border border-transparent hover:border-blue-200 hover:bg-white transition-all group overflow-hidden",children:[n.jsxs("div",{className:"flex items-center gap-3 sm:gap-5 flex-1 min-w-0",children:[n.jsx("div",{className:"w-10 h-10 sm:w-14 sm:h-14 bg-white border border-slate-200 rounded-xl sm:rounded-2xl flex items-center justify-center text-emerald-600 shadow-sm group-hover:scale-110 transition-transform shrink-0",children:n.jsx(Gt,{size:20})}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-[7px] sm:text-[9px] font-black text-slate-400 uppercase tracking-widest mb-1 truncate",children:h.feeName}),n.jsx("p",{className:"text-sm sm:text-lg font-black text-slate-800 tracking-tight truncate uppercase",children:h.method}),n.jsxs("p",{className:"text-[8px] sm:text-[10px] text-slate-400 font-bold uppercase truncate",children:["REF: ",h.reference," • ",h.date]})]})]}),n.jsxs("div",{className:"text-right ml-3 shrink-0",children:[n.jsxs("p",{className:"text-lg sm:text-2xl font-black text-emerald-600 tracking-tighter",children:["$",Number(h.amount).toFixed(2)]}),n.jsx("span",{className:"text-[8px] font-black uppercase tracking-widest text-emerald-500 bg-emerald-50 px-2 py-0.5 rounded-full border border-emerald-100",children:"OK"})]})]},m))})]}),n.jsx("div",{className:"space-y-6 sm:space-y-8",children:n.jsxs("div",{className:"bg-white p-8 sm:p-10 rounded-[2rem] sm:rounded-[3.5rem] border border-slate-200 shadow-sm flex flex-col relative overflow-hidden group min-h-[220px]",children:[n.jsxs("h3",{className:"text-lg sm:text-xl font-black flex items-center gap-3 tracking-tight text-slate-800 mb-6 sm:mb-8 relative z-10",children:[n.jsx(Ic,{className:"text-blue-600",size:20})," SALDO"]}),n.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center relative z-10",children:[n.jsx("div",{className:`w-16 h-16 sm:w-20 sm:h-20 rounded-[1.5rem] sm:rounded-[2rem] flex items-center justify-center mb-5 sm:mb-6 shadow-xl transition-all duration-500 ${f?"bg-emerald-600 text-white shadow-emerald-200":"bg-blue-50 text-blue-600"}`,children:n.jsx(da,{size:32})}),n.jsxs("div",{className:`text-4xl sm:text-5xl lg:text-6xl font-black tracking-tighter mb-2 ${f?"text-emerald-600":"text-slate-300"}`,children:["$",f?p.toLocaleString(void 0,{minimumFractionDigits:2}):"0.00"]}),n.jsx("p",{className:"text-slate-400 text-[8px] sm:text-[9px] font-black uppercase tracking-widest text-center max-w-[180px] leading-relaxed",children:f?"Crédito disponible para su próximo recibo.":"No posee créditos a favor."})]}),n.jsx("div",{className:"absolute right-[-10px] bottom-[-10px] opacity-[0.03] group-hover:opacity-[0.07] transition-opacity",children:n.jsx(Ic,{size:150})})]})})]}),n.jsx("style",{children:`
        @keyframes pulse-subtle {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.95; transform: scale(0.99); }
        }
        .animate-pulse-subtle {
            animation: pulse-subtle 3s infinite ease-in-out;
        }
      `})]})},$c=(e,t,r)=>{const a=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>${e}</title>
    <style>
        body { 
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
            padding: 40px; 
            color: #1e293b; 
            background-color: #f8fafc;
            line-height: 1.5;
        }
        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            padding: 40px;
            border-radius: 20px;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }
        header {
            text-align: center;
            margin-bottom: 40px;
            border-bottom: 4px solid #3b82f6;
            padding-bottom: 20px;
        }
        h1 { 
            margin: 0;
            font-size: 28px;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: -0.025em;
            color: #0f172a;
        }
        .subtitle {
            font-size: 12px;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin-top: 8px;
        }
        table { 
            width: 100%; 
            border-collapse: collapse; 
            margin-top: 20px; 
            font-size: 13px;
        }
        th, td { 
            border: 1px solid #e2e8f0; 
            padding: 14px; 
            text-align: left; 
        }
        th { 
            background-color: #f1f5f9; 
            font-weight: 800; 
            text-transform: uppercase; 
            font-size: 11px; 
            color: #475569; 
            letter-spacing: 0.05em;
        }
        tr:nth-child(even) { background-color: #f8fafc; }
        tr:hover { background-color: #f1f5f9; }
        .footer { 
            margin-top: 50px; 
            padding-top: 20px;
            border-top: 1px solid #e2e8f0;
            font-size: 10px; 
            color: #94a3b8; 
            text-align: center; 
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .stamp {
            margin-top: 40px;
            display: flex;
            justify-content: flex-end;
        }
        .stamp-box {
            border: 2px solid #e2e8f0;
            padding: 20px;
            width: 200px;
            text-align: center;
            border-radius: 10px;
            color: #cbd5e1;
            font-size: 9px;
            font-weight: 900;
            text-transform: uppercase;
        }
        @media print {
            body { background: white; padding: 0; }
            .container { box-shadow: none; border: none; width: 100%; max-width: none; padding: 0; }
        }
    </style>
</head>
<body>
    <div class="container">
        <header>
            <h1>${e}</h1>
            <div class="subtitle">Condominio El Tejar - Reporte Oficial de Gestión</div>
        </header>
        <table>
            <thead>
                <tr>
                    ${t.map(o=>`<th>${o}</th>`).join("")}
                </tr>
            </thead>
            <tbody>
                ${r.map(o=>`
                    <tr>
                        ${o.map(d=>`<td>${d||""}</td>`).join("")}
                    </tr>
                `).join("")}
            </tbody>
        </table>
        <div class="stamp">
            <div class="stamp-box">
                Sello de Auditoría<br>SAC 2026
            </div>
        </div>
        <div class="footer">
            Generado por SAC - Kernel V4.1.55 MC/MB - ${new Date().toLocaleString("es-VE")}
            <br>ID: ${Math.random().toString(36).substring(2,15).toUpperCase()}
        </div>
    </div>
</body>
</html>
    `,s=new Blob([a],{type:"text/html"}),i=URL.createObjectURL(s),l=document.createElement("a");l.href=i,l.download=`${e.replace(/\s+/g,"_")}_${new Date().getTime()}.html`,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(i)},Wde=({user:e})=>{const{transactions:t,refreshData:r,exchangeRateHistory:a,loading:s,financialTotals:i,properties:l}=ht(),[o,d]=k.useState(new Date().getMonth()),[u,f]=k.useState(new Date().getFullYear()),[p,h]=k.useState(""),[m,b]=k.useState(!1),[v,y]=k.useState(!1),[j,_]=k.useState(!1),[N,E]=k.useState(!1),[T,B]=k.useState(null),[F,R]=k.useState({income:1.5,expense:.3}),[U,D]=k.useState(!1),[L,P]=k.useState({type:"Ingreso",category:"Ingresos",date:Dr(),amountBs:0,description:"",reference:""}),[G,Q]=k.useState({propertyId:"",amountBs:0,date:Dr(),reference:"",description:"ABONO DIRECTO A SALDO A FAVOR"});k.useEffect(()=>{(async()=>{const J=await we.getSystemSettings();R({income:parseFloat(J.bank_comm_income||"1.5"),expense:parseFloat(J.bank_comm_expense||"0.3")})})()},[]);const H=k.useMemo(()=>{if(!a||a.length===0)return 45;const z=a[0],J=Number(z.pmValue)>0?Number(z.pmValue):Number(z.amValue)>0?Number(z.amValue):45;return Number(J)},[a]),X=z=>{if(!a||a.length===0)return 45;const J=a.find(ae=>ae.date===z);if(J)return Number(J.pmValue)>0?Number(J.pmValue):Number(J.amValue);const re=[...a].sort((ae,ie)=>ie.date.localeCompare(ae.date)),le=re.find(ae=>ae.date<z);if(le)return Number(le.pmValue)>0?Number(le.pmValue):Number(le.amValue);const ne=re[re.length-1];return Number(ne.pmValue)>0?Number(ne.pmValue):Number(ne.amValue)},K=k.useMemo(()=>t.reduce((z,J)=>{if(J.category==="Cierre/Apertura")return z;const re=Number(J.amountBs)||0;return J.type==="Ingreso"?z+re:z-re},0),[t]),ee=k.useMemo(()=>t.filter(z=>{var ae;const[J,re]=z.date.split("-").map(Number),le=J===u&&re-1===o,ne=!p||z.description.toLowerCase().includes(p.toLowerCase())||((ae=z.reference)==null?void 0:ae.toLowerCase().includes(p.toLowerCase()));return le&&ne}).sort((z,J)=>new Date(J.date).getTime()-new Date(z.date).getTime()),[t,o,u,p]),W=async z=>{z.preventDefault(),D(!0);try{const J=X(L.date||Dr()),re={...L,amount:(Number(L.amountBs)||0)/J,commissionsConfig:F},le=await fetch(`${Ne}/save_bank_transaction.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(re)});if(le.ok)await r(),b(!1),P({type:"Ingreso",category:"Ingresos",date:Dr(),amountBs:0,description:"",reference:""});else{const ne=await le.json();alert(`Error: ${ne.error||"No se pudo guardar"}`)}}catch{alert("Error de conexión al registrar movimiento.")}finally{D(!1)}},Y=async()=>{if(!L.amountBs||L.amountBs<=0){alert("Por favor ingrese un monto de apertura válido.");return}D(!0);try{const z=X(L.date||Dr()),J={date:L.date,category:"Apertura",description:"SALDO INICIAL GESTIÓN ADMINISTRATIVA",reference:"OPENING",amountBs:L.amountBs,amount:(Number(L.amountBs)||0)/z,type:"Ingreso"},re=await fetch(`${Ne}/save_bank_transaction.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)});if(re.ok)await r(),_(!1),alert("Saldo inicial sellado correctamente.");else{const le=await re.json();alert(`Error del servidor: ${le.error}`)}}catch{alert("Error al conectar con el servidor.")}finally{D(!1)}},M=async z=>{try{(await fetch(`${Ne}/delete_bank_transaction.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:z})})).ok&&(await r(),B(null))}catch{alert("Error al eliminar.")}},O=async z=>{if(z.preventDefault(),!G.propertyId||!G.amountBs||G.amountBs<=0){alert("Por favor complete todos los campos correctamente.");return}D(!0);try{const J=X(G.date||Dr()),re=l.find(ae=>ae.id===parseInt(G.propertyId)),le={date:G.date,description:`${G.description}: ${(re==null?void 0:re.code)||""}`,amountBs:G.amountBs,amount:(Number(G.amountBs)||0)/J,type:"Ingreso",category:"Ingresos",reference:G.reference,propertyId:parseInt(G.propertyId),isCredit:!0,commissionsConfig:F},ne=await fetch(`${Ne}/save_bank_transaction.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(le)});if(ne.ok)await r(),E(!1),Q({propertyId:"",amountBs:0,date:Dr(),reference:"",description:"ABONO DIRECTO A SALDO A FAVOR"}),alert("Saldo a favor registrado y comisión bancaria aplicada.");else{const ae=await ne.json();alert(`Error: ${ae.error||"No se pudo guardar"}`)}}catch{alert("Error de conexión al registrar saldo a favor.")}finally{D(!1)}},q=async()=>{D(!0);try{await we.updateSystemSetting("bank_comm_income",String(F.income)),await we.updateSystemSetting("bank_comm_expense",String(F.expense)),alert("Porcentajes de comisión actualizados."),y(!1)}catch{alert("Error al guardar configuración.")}finally{D(!1)}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-24 no-print",children:[n.jsxs("div",{className:"bg-[#1e293b] text-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl relative overflow-hidden group border-b-8 border-slate-900",children:[n.jsxs("div",{className:"relative z-10 flex flex-col md:flex-row justify-between items-start gap-10",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsx("div",{className:"w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-500/20",children:n.jsx(br,{size:22})}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.4em] text-blue-400",children:"Estado de Cuenta Consolidado"})]}),n.jsxs("h3",{className:"text-6xl lg:text-7xl font-black tracking-tighter",children:["Bs. ",Number(K).toLocaleString("es-VE",{minimumFractionDigits:2})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-8",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-500 animate-pulse"}),n.jsxs("p",{className:"text-sm font-bold text-slate-400 uppercase tracking-widest",children:["Equivalente USD: ",n.jsxs("span",{className:"text-emerald-400 font-black",children:["$",(Number(K)/H).toLocaleString(void 0,{minimumFractionDigits:2})]})]})]}),(i==null?void 0:i.reserveFundBs)!==void 0&&n.jsxs("div",{className:"bg-indigo-900/40 border border-indigo-500/30 px-6 py-3 rounded-2xl flex items-center gap-4 shadow-xl backdrop-blur-sm animate-in zoom-in-95 duration-700",children:[n.jsx("div",{className:"p-2 bg-indigo-600 rounded-lg text-white",children:n.jsx(Ia,{size:18})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[8px] font-black text-indigo-300 uppercase tracking-widest mb-0.5",children:"Reserva Nominal (Estática en VES)"}),n.jsxs("p",{className:"text-sm font-black text-white leading-none",children:["Bs. ",Number(i.reserveFundBs).toLocaleString("es-VE",{minimumFractionDigits:2})]}),n.jsxs("p",{className:"text-[7px] font-bold text-indigo-400 uppercase mt-1",children:["Valor Depreciado: $",i.reserveFundUsd.toFixed(2)," USD"]})]})]})]}),n.jsxs("p",{className:"text-[9px] text-slate-500 font-bold uppercase tracking-widest mt-4",children:["Tasa del día (Ref): ",Number(H).toFixed(2)," Bs/$"]})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 w-full md:w-auto self-center md:self-auto",children:[n.jsxs("button",{onClick:()=>y(!0),className:"flex-1 bg-slate-800 hover:bg-slate-700 text-slate-300 px-6 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest border border-slate-700 transition-all flex items-center justify-center gap-2",children:[n.jsx(bs,{size:16})," Comisiones"]}),n.jsxs("button",{onClick:()=>_(!0),className:"flex-1 bg-white text-slate-900 px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:scale-105 active:scale-95 transition-all shadow-xl flex items-center justify-center gap-2",children:[n.jsx(Wr,{size:16})," Saldo Inicial"]})]})]}),n.jsx(za,{className:"absolute right-[-40px] top-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none group-hover:scale-110 transition-transform duration-[10s]"})]}),n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-end gap-6 bg-white p-8 rounded-[2.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("div",{className:"w-full lg:w-auto space-y-4",children:[n.jsxs("h2",{className:"text-2xl font-black text-slate-900 tracking-tight flex items-center gap-3",children:[n.jsx(Ki,{className:"text-blue-600"})," Libro Diario Bancario (VES)"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("div",{className:"bg-slate-100 p-1.5 rounded-xl flex gap-1 border border-slate-200",children:[n.jsx("select",{value:o,onChange:z=>d(Number(z.target.value)),className:"bg-transparent border-none text-[10px] font-black uppercase tracking-widest text-slate-500 outline-none px-3 py-1 cursor-pointer",children:Te.map((z,J)=>n.jsx("option",{value:J,children:z},J))}),n.jsx("div",{className:"w-px h-4 bg-slate-300 self-center"}),n.jsx("input",{type:"number",value:u,onChange:z=>f(Number(z.target.value)),className:"bg-transparent border-none text-[10px] font-black text-blue-600 outline-none w-16 text-center"})]}),n.jsxs("div",{className:"relative flex-1 sm:w-64",children:[n.jsx(er,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400",size:14}),n.jsx("input",{type:"text",placeholder:"Buscar por concepto o ref...",className:"w-full bg-slate-50 border border-slate-100 rounded-xl pl-9 pr-4 py-2 text-xs font-bold text-slate-800 focus:ring-2 focus:ring-blue-100 transition-all",value:p,onChange:z=>h(z.target.value)})]})]})]}),n.jsxs("div",{className:"flex gap-3 w-full lg:w-auto",children:[n.jsxs("button",{onClick:()=>E(!0),className:"flex-1 lg:flex-none bg-emerald-600 hover:bg-emerald-700 text-white px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl shadow-emerald-500/20 transition-all active:scale-95 flex items-center justify-center gap-2",children:[n.jsx(br,{size:18})," Abonar Saldo a Favor"]}),n.jsxs("button",{onClick:()=>{const z=["Fecha","Referencia","Descripción","Categoría","Monto USD","Monto VES"],J=ee.map(re=>[re.date,re.reference||"S/R",re.description,re.category,`$${Number(re.amount).toFixed(2)}`,`Bs. ${Number(re.amountBs).toLocaleString("es-VE",{minimumFractionDigits:2})}`]);$c("Estado de Cuenta Bancario",z,J)},className:"flex-1 lg:flex-none bg-slate-100 text-slate-500 px-6 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-200 transition-all flex items-center justify-center gap-2",title:"Exportar a HTML",children:[n.jsx(yr,{size:18})," Exportar HTML"]}),n.jsxs("button",{onClick:()=>window.print(),className:"flex-1 lg:flex-none bg-slate-100 text-slate-500 px-6 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-200 transition-all flex items-center justify-center gap-2",children:[n.jsx(wt,{size:18})," Imprimir Estado"]}),n.jsxs("button",{onClick:()=>b(!0),className:"flex-[2] lg:flex-none bg-blue-600 hover:bg-blue-700 text-white px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl shadow-blue-500/20 transition-all active:scale-95 flex items-center justify-center gap-2",children:[n.jsx(En,{size:18})," Registrar Movimiento"]})]})]}),n.jsx("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Descripción / Concepto"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Categoría"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acción"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:ee.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:6,className:"py-24 text-center",children:[n.jsx(br,{size:48,className:"mx-auto mb-4 text-slate-100"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-xs",children:"Sin movimientos registrados para este periodo"})]})}):ee.map(z=>{const J=X(z.date),re=Number(z.amountBs)/Number(J);return n.jsxs("tr",{className:`hover:bg-slate-50/50 transition-all group ${z.category==="Cierre/Apertura"?"bg-blue-50/20":""}`,children:[n.jsx("td",{className:"px-8 py-6 text-xs font-black text-slate-400 whitespace-nowrap",children:z.date}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0 ${z.category==="Cierre/Apertura"?"bg-slate-900 text-white":z.type==="Ingreso"?"bg-emerald-50 text-emerald-600":"bg-red-50 text-red-600"}`,children:z.category==="Cierre/Apertura"?n.jsx(ct,{size:18}):z.type==="Ingreso"?n.jsx(da,{size:18}):n.jsx(fb,{size:18})}),n.jsxs("div",{children:[n.jsx("p",{className:`font-black text-sm leading-tight uppercase ${z.category==="Cierre/Apertura"?"text-blue-600":"text-slate-800"}`,children:z.description}),z.category==="Cierre/Apertura"&&n.jsx("p",{className:"text-[9px] text-blue-500 font-black uppercase mt-0.5 tracking-tighter",children:"Asiento Informativo de Balance"})]})]})}),n.jsx("td",{className:"px-8 py-6 text-center",children:n.jsx("span",{className:`px-4 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest ${z.category==="Cierre/Apertura"?"bg-blue-600 text-white":"bg-slate-100 text-slate-500"}`,children:z.category})}),n.jsxs("td",{className:"px-8 py-6 text-right",children:[n.jsxs("div",{className:`font-black text-lg tracking-tighter ${z.category==="Cierre/Apertura"?"text-slate-900":z.type==="Ingreso"?"text-emerald-600":"text-rose-600"}`,children:[z.category==="Cierre/Apertura"?"":z.type==="Ingreso"?"+":"-"," Bs. ",Number(z.amountBs).toLocaleString("es-VE",{minimumFractionDigits:2})]}),n.jsxs("div",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-tighter",title:`Tasa aplicada de ese día: ${Number(J).toFixed(2)} Bs/$`,children:["Ref: $",re.toLocaleString(void 0,{minimumFractionDigits:2})," USD"]})]}),n.jsx("td",{className:"px-8 py-6 text-center",children:n.jsx("span",{className:`font-mono text-xs font-black bg-slate-50 px-3 py-1 rounded-lg border border-slate-100 ${z.category==="Cierre/Apertura"?"text-blue-600 border-blue-200":"text-slate-400"}`,children:z.reference||"S/R"})}),n.jsx("td",{className:"px-8 py-6 text-right",children:T===z.id?n.jsxs("div",{className:"flex justify-end gap-2 animate-in slide-in-from-right-2",children:[n.jsx("button",{onClick:()=>M(z.id),className:"bg-red-600 text-white px-4 py-2 rounded-lg text-[9px] font-black uppercase",children:"¿Seguro?"}),n.jsx("button",{onClick:()=>B(null),className:"bg-slate-200 text-slate-600 px-4 py-2 rounded-lg text-[9px] font-black uppercase",children:"No"})]}):z.category!=="Cierre/Apertura"&&n.jsx("button",{onClick:()=>B(z.id),className:"p-3 bg-slate-50 text-slate-300 hover:bg-red-50 hover:text-red-600 rounded-xl transition-all opacity-0 group-hover:opacity-100",children:n.jsx(Ua,{size:16})})})]},z.id)})})]})})}),m&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Nuevo Asiento Bancario"}),n.jsx("button",{onClick:()=>b(!1),className:"p-3 bg-slate-100 rounded-full text-slate-400 hover:text-red-500 transition-colors",children:n.jsx(mt,{size:24})})]}),n.jsxs("form",{onSubmit:W,className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Tipo de Operación"}),n.jsxs("div",{className:"flex gap-3",children:[n.jsx("button",{type:"button",onClick:()=>P({...L,type:"Ingreso",category:"Ingresos"}),className:`flex-1 py-4 rounded-2xl font-black text-xs uppercase tracking-widest border transition-all ${L.type==="Ingreso"?"bg-emerald-600 text-white border-emerald-600 shadow-xl":"bg-slate-50 text-slate-400 border-slate-200"}`,children:"Ingreso"}),n.jsx("button",{type:"button",onClick:()=>P({...L,type:"Egreso",category:"Gastos"}),className:`flex-1 py-4 rounded-2xl font-black text-xs uppercase tracking-widest border transition-all ${L.type==="Egreso"?"bg-rose-600 text-white border-rose-600 shadow-xl":"bg-slate-50 text-slate-400 border-slate-200"}`,children:"Egreso"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Descripción / Concepto"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold text-slate-900 outline-none focus:ring-2 focus:ring-blue-600",value:L.description,onChange:z=>P({...L,description:z.target.value.toUpperCase()}),placeholder:"EJ: PAGO PROVEEDOR AGUA"})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Fecha Valor"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-slate-900 text-xs",value:L.date,onChange:z=>P({...L,date:z.target.value})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Referencia"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-slate-900 text-xs",value:L.reference,onChange:z=>P({...L,reference:z.target.value}),placeholder:"000000"})]})]}),n.jsxs("div",{className:"bg-blue-50 border border-blue-100 p-8 rounded-[2.5rem] space-y-4",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-blue-600 tracking-widest ml-1 block text-center",children:"Monto en Bolívares (VES)"}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full bg-white rounded-2xl px-6 py-5 text-3xl font-black text-slate-900 outline-none border-2 border-blue-100 focus:border-blue-500 shadow-inner",value:L.amountBs||"",onChange:z=>P({...L,amountBs:parseFloat(z.target.value)}),placeholder:"0,00"}),n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("span",{className:"text-[10px] font-black text-blue-400 uppercase",children:"Equivalente Estimado:"}),n.jsxs("span",{className:"text-xl font-black text-blue-600",children:["$",((Number(L.amountBs)||0)/X(L.date||Dr())).toFixed(2)," USD"]})]})]}),n.jsxs("button",{disabled:U,type:"submit",className:"w-full bg-slate-900 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.3em] shadow-2xl active:scale-95 transition-all flex items-center justify-center gap-3",children:[U?n.jsx(ct,{className:"animate-spin"}):n.jsx(Zn,{size:18}),"PROCESAR ASIENTO"]})]})]})}),v&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 w-full max-sm shadow-2xl animate-in zoom-in-95",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsx("h3",{className:"text-xl font-black text-slate-900",children:"Parámetros Bancarios"}),n.jsx("button",{onClick:()=>y(!1),children:n.jsx(mt,{})})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Comisión Ingresos (%)"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-blue-600",value:F.income,onChange:z=>R({...F,income:parseFloat(z.target.value)})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Comisión Egresos (%)"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-rose-600",value:F.expense,onChange:z=>R({...F,expense:parseFloat(z.target.value)})})]}),n.jsx("button",{disabled:U,onClick:q,className:"w-full bg-blue-600 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-100 active:scale-95",children:U?"GUARDANDO...":"ACTUALIZAR POLÍTICA"})]})]})}),j&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 w-full max-w-sm shadow-2xl animate-in zoom-in-95",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsx("h3",{className:"text-xl font-black text-slate-900",children:"Apertura Fiscal"}),n.jsx("button",{onClick:()=>_(!1),children:n.jsx(mt,{})})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsx("p",{className:"text-xs text-slate-500 font-medium leading-relaxed",children:"Declare el monto en banco al momento de iniciar esta gestión. Este registro se guardará como 'APERTURA'."}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Fecha de Inicio Fiscal"}),n.jsx("input",{type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black",value:L.date,onChange:z=>P({...L,date:z.target.value})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Saldo de Apertura (Bs.)"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-2xl",value:L.amountBs||"",onChange:z=>P({...L,amountBs:parseFloat(z.target.value)}),placeholder:"0,00"})]}),n.jsx("button",{disabled:U,onClick:Y,className:"w-full bg-slate-900 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-slate-300 active:scale-95 transition-all",children:U?"PROCESANDO...":"SELLAR SALDO DE APERTURA"})]})]})}),N&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 w-full max-w-md shadow-2xl animate-in zoom-in-95 overflow-y-auto max-h-[90vh]",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsx("h3",{className:"text-xl font-black text-slate-900 tracking-tight",children:"Abonar Saldo a Favor"}),n.jsx("button",{onClick:()=>E(!1),className:"p-2 bg-slate-100 rounded-full text-slate-400 hover:text-red-500 transition-colors",children:n.jsx(mt,{size:20})})]}),n.jsxs("form",{onSubmit:O,className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Unidad / Inmueble"}),n.jsxs("select",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 outline-none focus:ring-2 focus:ring-blue-600",value:G.propertyId,onChange:z=>Q({...G,propertyId:z.target.value}),children:[n.jsx("option",{value:"",children:"Seleccione Unidad"}),l.sort((z,J)=>z.code.localeCompare(J.code)).map(z=>n.jsx("option",{value:z.id,children:z.code},z.id))]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Fecha"}),n.jsx("input",{type:"date",required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 text-xs outline-none focus:ring-2 focus:ring-blue-600",value:G.date,onChange:z=>Q({...G,date:z.target.value})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Referencia Bancaria"}),n.jsx("input",{type:"text",required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 text-xs outline-none focus:ring-2 focus:ring-blue-600",value:G.reference,onChange:z=>Q({...G,reference:z.target.value}),placeholder:"Nro. Ref"})]})]}),n.jsxs("div",{className:"bg-emerald-50 border border-emerald-100 p-8 rounded-[2.5rem] space-y-4",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-emerald-600 tracking-widest ml-1 block text-center",children:"Monto en Bolívares (Bs.)"}),n.jsx("input",{type:"number",step:"0.01",required:!0,className:"w-full bg-white rounded-2xl px-6 py-5 text-3xl font-black text-emerald-600 outline-none border-2 border-emerald-100 focus:border-emerald-500 shadow-inner",value:G.amountBs||"",onChange:z=>Q({...G,amountBs:parseFloat(z.target.value)}),placeholder:"0,00"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Descripción"}),n.jsx("input",{type:"text",required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold text-slate-900 outline-none focus:ring-2 focus:ring-blue-600",value:G.description,onChange:z=>Q({...G,description:z.target.value.toUpperCase()})})]}),n.jsxs("div",{className:"flex items-start gap-3 p-4 bg-blue-50 rounded-2xl border border-blue-100",children:[n.jsx(bs,{size:16,className:"text-blue-600 mt-1 flex-shrink-0"}),n.jsxs("p",{className:"text-[10px] text-blue-700 font-bold leading-relaxed",children:["Se generará automáticamente el egreso por comisión bancaria (",F.income,"%) con la misma referencia."]})]}),n.jsx("button",{disabled:U,type:"submit",className:"w-full bg-emerald-600 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-emerald-500/20 active:scale-95 transition-all",children:U?"PROCESANDO...":"REGISTRAR ABONO"})]})]})})]})},sr=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},Fg=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},Yde=()=>{const{properties:e,residents:t}=ht(),r=k.useMemo(()=>e.filter(a=>Number(a.initialDebt)>0).map(a=>{const s=t.find(i=>i.propertyId===a.id&&i.isOwner);return{...a,ownerName:(s==null?void 0:s.fullName)||"Sin Asignar"}}).sort((a,s)=>s.initialDebt-a.initialDebt),[e,t]);return r.length===0?null:n.jsxs("div",{className:"bg-slate-900 rounded-[3rem] p-8 lg:p-12 text-white shadow-2xl relative overflow-hidden animate-in fade-in duration-1000 mb-12",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[n.jsx("div",{className:"w-12 h-12 bg-amber-500 rounded-2xl flex items-center justify-center text-white shadow-lg shadow-amber-500/20",children:n.jsx(Xr,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black tracking-tight uppercase",children:"Monitor de Convenios de Pago"}),n.jsx("p",{className:"text-amber-400 font-bold text-[10px] uppercase tracking-widest",children:"Protocolo de Recuperación de Deuda Histórica V4.0.70"})]})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:r.map(a=>n.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 rounded-[2rem] hover:bg-white/10 transition-all group",children:[n.jsxs("div",{className:"flex justify-between items-start mb-4",children:[n.jsx("span",{className:"bg-amber-500 text-slate-900 px-3 py-1 rounded-lg text-[10px] font-black uppercase tracking-tighter",children:"EN CONVENIO"}),n.jsx("span",{className:"text-2xl font-black text-white",children:a.code})]}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest truncate",children:a.ownerName}),n.jsxs("div",{className:"mt-6 pt-4 border-t border-white/5",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-500 uppercase tracking-widest mb-1",children:"Saldo Histórico Pendiente"}),n.jsxs("p",{className:"text-xl font-black text-amber-400",children:["$",sr(a.initialDebt)]})]}),n.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[n.jsxs("div",{className:"flex-1 h-1.5 bg-white/5 rounded-full overflow-hidden",children:[n.jsx("div",{className:"h-full bg-amber-500 w-1/3 animate-pulse"})," "]}),n.jsx("span",{className:"text-[8px] font-black text-amber-500/50 uppercase",children:"Auditando..."})]})]},a.id))})]}),n.jsx(br,{size:200,className:"absolute right-[-40px] bottom-[-40px] text-white/[0.03] pointer-events-none"})]})},Xde=({onCancel:e,existingFee:t,onTabChange:r})=>{const{addFee:a,exchangeRateHistory:s,properties:i,refreshData:l}=ht(),[o,d]=k.useState(!1),[u,f]=k.useState(!1),p=()=>{if(!s||s.length===0)return 45.5;const M=s[0];return Number(M.pmValue)>0?Number(M.pmValue):Number(M.amValue)},[h,m]=k.useState((t==null?void 0:t.month)??new Date().getMonth()),[b,v]=k.useState((t==null?void 0:t.year)??new Date().getFullYear()),[y,j]=k.useState((t==null?void 0:t.exchangeRate)??p()),_=M=>Array(M).fill(null).map(()=>({description:"",amountUsd:0,isUncommon:!1,isSpecial:!1,specialPropertyIds:[]})),[N,E]=k.useState(t?[...t.fixedExpenses,..._(Math.max(0,20-t.fixedExpenses.length))]:_(20)),[T,B]=k.useState(t?[...t.variableExpenses,..._(Math.max(0,15-t.variableExpenses.length))]:_(15)),[F,R]=k.useState(t?[...t.otherExpenses,..._(Math.max(0,8-t.otherExpenses.length))]:_(8)),[U,D]=k.useState((t==null?void 0:t.reserveFundPercent)??10),L=async()=>{f(!0);try{const O=await(await fetch(`${Ne}/get_prefill_expenses.php?month=${h}&year=${b}`,{credentials:"include"})).json();if(Array.isArray(O)){if(O.length===0){alert("No se encontraron facturas marcadas para pre-llenado en este periodo.");return}const q=O.filter(re=>re.category==="fixed"),z=O.filter(re=>re.category==="variable"),J=O.filter(re=>re.category==="other");E([...q,..._(Math.max(0,20-q.length))]),B([...z,..._(Math.max(0,15-z.length))]),R([...J,..._(Math.max(0,8-J.length))]),alert(`¡Importación Exitosa! Se cargaron ${O.length} conceptos.`)}}catch{alert("Error al importar datos.")}finally{f(!1)}},P=(M,O,q,z,J)=>{const re=[...z];re[M]={...re[M],[O]:q},J(re)},G=(M,O,q,z)=>{const J=[...q],re=J[M].specialPropertyIds||[];re.includes(O)?J[M].specialPropertyIds=re.filter(le=>le!==O):J[M].specialPropertyIds=[...re,O],z(J)},Q=M=>M.reduce((O,q)=>O+(Number(q.amountUsd)||0),0),H=Number(Q(N))+Number(Q(T))+Number(Q(F)),X=Number(H)*(Number(U)/100),K=Number(H)+Number(X),ee=Number(K)*Number(y),W=async()=>{if(Math.abs(K)<.01&&K!==0){alert("Monto total inválido.");return}if(confirm(`¿Generar cuota para ${Te[h]} ${b}?`)){d(!0);try{await a({id:(t==null?void 0:t.id)||`fee-${h}-${b}-${Date.now()}`,month:h,year:b,exchangeRate:y,fixedExpenses:N.filter(M=>M.description&&Number(M.amountUsd)!==0),variableExpenses:T.filter(M=>M.description&&Number(M.amountUsd)!==0),otherExpenses:F.filter(M=>M.description&&Number(M.amountUsd)!==0),reserveFundPercent:U,totalUsd:K,totalBs:ee,status:"Generada",createdAt:(t==null?void 0:t.createdAt)||Dr()}),alert("¡Facturación Generada con Éxito!"),r?r("view-fees"):e()}catch(M){alert("Error: "+M.message)}finally{d(!1)}}},Y=k.useMemo(()=>[...i].sort((M,O)=>M.code.localeCompare(O.code,void 0,{numeric:!0})),[i]);return n.jsxs("div",{className:"bg-white rounded-[2.5rem] shadow-sm border border-slate-200 p-8 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center mb-8 border-b pb-6 gap-6",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-2xl flex items-center justify-center text-white shadow-lg",children:n.jsx(vi,{size:24})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-black text-slate-800 tracking-tight",children:"Generación de Facturación"}),n.jsx("p",{className:"text-slate-400 text-xs font-bold uppercase tracking-widest",children:"Periodo de Gestión"})]})]}),n.jsxs("div",{className:"flex gap-3 w-full md:w-auto",children:[n.jsxs("button",{onClick:L,disabled:u,className:"bg-emerald-50 text-emerald-600 hover:bg-emerald-600 hover:text-white px-6 py-3.5 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all shadow-sm flex items-center justify-center gap-3 active:scale-95 disabled:opacity-50",children:[u?n.jsx(ct,{className:"animate-spin",size:16}):n.jsx(Kr,{size:16})," PRE-CARGAR DESDE BALANCE"]}),n.jsx("button",{onClick:e,className:"p-3 bg-slate-100 rounded-full text-slate-400 hover:bg-slate-200 transition-all",children:n.jsx(mt,{size:20})})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-5 gap-6 mb-10 bg-slate-50 p-6 rounded-[2rem] border border-slate-100",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase block mb-1",children:"Mes"}),n.jsx("select",{value:h,onChange:M=>m(Number(M.target.value)),className:"w-full bg-white border border-slate-200 rounded-xl px-4 py-2.5 font-bold text-slate-700 outline-none text-sm",children:Te.map((M,O)=>n.jsx("option",{value:O,children:M},O))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase block mb-1",children:"Año"}),n.jsx("input",{type:"number",value:b,onChange:M=>v(Number(M.target.value)),className:"w-full bg-white border border-slate-200 rounded-xl px-4 py-2.5 font-bold text-slate-700 outline-none text-sm"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase block mb-1",children:"Tasa (Bs)"}),n.jsx("input",{type:"number",step:"0.01",value:y,onChange:M=>j(Number(M.target.value)),className:"w-full bg-white border border-slate-200 rounded-xl px-4 py-2.5 font-black text-blue-600 outline-none text-sm"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase block mb-1",children:"Reserva (%)"}),n.jsx("input",{type:"number",value:U,onChange:M=>D(Number(M.target.value)),className:"w-full bg-white border border-slate-200 rounded-xl px-4 py-2.5 font-bold text-slate-700 outline-none text-sm"})]}),n.jsxs("div",{className:"flex items-end",children:[n.jsx("button",{type:"button",onClick:()=>{const M=[...N];M[0].specialPropertyIds=i.map(O=>O.id),E(M)},className:"hidden",children:"Trigger"}),n.jsxs("button",{disabled:o,onClick:W,className:"w-full bg-blue-600 hover:bg-blue-700 text-white px-8 py-5 rounded-2xl font-black shadow-xl shadow-blue-600/20 flex items-center justify-center gap-3 active:scale-95 transition-all disabled:opacity-50 text-xs",children:[o?n.jsx(ct,{className:"animate-spin",size:16}):n.jsx(Zn,{size:16})," ",o?"PROCESANDO...":"GENERAR CUOTA"]})]})]}),n.jsx("div",{className:"space-y-12",children:[{title:"Gastos Fijos",data:N,setter:E},{title:"Gastos Variables",data:T,setter:B},{title:"Otros Gastos",data:F,setter:R}].map((M,O)=>n.jsxs("div",{children:[n.jsxs("div",{className:"flex justify-between items-center mb-4 border-b pb-2 px-1",children:[n.jsx("h3",{className:"text-lg font-black text-slate-800 uppercase tracking-tight",children:M.title}),n.jsxs("div",{className:"flex gap-8 text-[9px] font-black text-slate-400 uppercase tracking-widest",children:[n.jsx("span",{className:"w-10 text-center",children:"GNC"}),n.jsx("span",{className:"text-center",children:"ESP"}),n.jsx("span",{className:"w-32 text-right",children:"USD"})]})]}),n.jsx("div",{className:"space-y-3",children:M.data.map((q,z)=>n.jsxs("div",{className:"flex flex-col gap-2 p-1 rounded-2xl hover:bg-slate-50/50 transition-all",children:[n.jsxs("div",{className:"flex items-center gap-4 group",children:[n.jsx("span",{className:"text-[9px] font-bold text-slate-300 w-4",children:z+1}),n.jsx("input",{placeholder:"Descripción...",className:"flex-1 bg-slate-50 border border-slate-200 rounded-xl px-4 py-2 text-sm focus:bg-white focus:ring-2 focus:ring-blue-100 outline-none transition-all",value:q.description,onChange:J=>P(z,"description",J.target.value,M.data,M.setter)}),n.jsx("div",{className:"w-10 flex justify-center",children:n.jsx("button",{type:"button",onClick:()=>P(z,"isUncommon",!q.isUncommon,M.data,M.setter),className:`w-8 h-8 rounded-xl border transition-all flex items-center justify-center ${q.isUncommon?"bg-indigo-600 border-indigo-600 text-white shadow-lg":"bg-white border-slate-200 text-slate-200 hover:text-slate-400"}`,children:n.jsx(Qc,{size:14,fill:q.isUncommon?"currentColor":"none"})})}),n.jsx("div",{className:"w-10 flex justify-center",children:n.jsx("button",{type:"button",onClick:()=>P(z,"isSpecial",!q.isSpecial,M.data,M.setter),className:`w-8 h-8 rounded-xl border transition-all flex items-center justify-center ${q.isSpecial?"bg-amber-500 border-amber-500 text-white shadow-lg":"bg-white border-slate-200 text-slate-200 hover:text-slate-400"}`,children:n.jsx(Ab,{size:14})})}),n.jsx("input",{type:"number",step:"0.01",className:`w-32 border rounded-xl px-4 py-2 text-sm text-right font-black group-hover:bg-blue-50 transition-all outline-none ${Number(q.amountUsd)<0?"bg-rose-50 border-rose-200 text-rose-600":"bg-slate-50 border-slate-200 text-slate-800"}`,value:q.amountUsd||"",onChange:J=>P(z,"amountUsd",Number(J.target.value),M.data,M.setter)})]}),q.isSpecial&&n.jsxs("div",{className:"ml-8 p-6 bg-amber-50/50 border border-amber-100 rounded-[2rem] animate-in slide-in-from-top-2 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-4",children:[n.jsxs("h4",{className:"text-[10px] font-black text-amber-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(uk,{size:14})," Seleccionar Unidades"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{type:"button",onClick:()=>{const J=[...M.data];J[z].specialPropertyIds=i.map(re=>re.id),M.setter(J)},className:"text-[9px] font-black text-blue-600 uppercase tracking-tighter hover:underline",children:"Marcar Todas"}),n.jsx("span",{className:"text-slate-300 text-[9px]",children:"|"}),n.jsx("button",{type:"button",onClick:()=>P(z,"specialPropertyIds",[],M.data,M.setter),className:"text-[9px] font-black text-slate-400 uppercase tracking-tighter hover:underline",children:"Limpiar"})]})]}),n.jsx("div",{className:"grid grid-cols-4 sm:grid-cols-6 md:grid-cols-10 gap-2",children:Y.map(J=>{var le;const re=(le=q.specialPropertyIds)==null?void 0:le.includes(J.id);return n.jsx("button",{type:"button",onClick:()=>G(z,J.id,M.data,M.setter),className:`py-2 rounded-xl text-[9px] font-black uppercase transition-all border shadow-sm ${re?"bg-amber-500 border-amber-500 text-white":"bg-white border-slate-200 text-slate-400 hover:border-amber-300 hover:text-amber-600"}`,children:J.code},J.id)})})]})]},z))})]},O))})]})},Jde=({user:e,onEdit:t,onTabChange:r})=>{const{fees:a,deleteFee:s,exchangeRateHistory:i,properties:l}=ht(),[o,d]=k.useState(null),u=["admin","programmer","board"].includes(e.role),f=k.useMemo(()=>{if(!i||i.length===0)return 45;const h=i[0];return Number(h.pmValue)>0?Number(h.pmValue):Number(h.amValue)},[i]),p=k.useMemo(()=>a.find(h=>h.id===o)||null,[a,o]);return p?n.jsx(rue,{fee:p,user:e,onBack:()=>d(null)}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-12 px-1",children:[n.jsx("h2",{className:"text-3xl font-black text-slate-900 tracking-tight uppercase",children:"Control de Recaudación"}),u&&n.jsx(Yde,{}),n.jsx("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Periodo"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Facturación Total"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Recaudación"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Tasa Sello"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:a.map(h=>{const m=Number(h.totalUsd)||0,b=(h.debts||[]).reduce((y,j)=>y+(Number(j.paidAmount)||0),0),v=m>0?Math.min(100,Math.round(b/m*100)):0;return n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsxs("td",{className:"px-8 py-6",children:[n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase mb-1",children:h.year}),n.jsx("span",{className:"font-black text-slate-800 text-lg uppercase tracking-tight",children:Te[h.month]})]}),n.jsxs("td",{className:"px-8 py-6 text-center",children:[n.jsxs("span",{className:"text-2xl font-black text-slate-900 tracking-tighter",children:["$",sr(m)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase mt-0.5",children:["≈ Bs. ",Fg(m*f)]})]}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"w-full max-w-[140px] mx-auto space-y-1.5",children:[n.jsxs("div",{className:"flex justify-between items-center text-[9px] font-black uppercase tracking-tighter",children:[n.jsxs("span",{className:"text-emerald-600",children:["$",sr(b)]}),n.jsxs("span",{className:"text-slate-400",children:[v,"%"]})]}),n.jsx("div",{className:"w-full bg-slate-100 h-2.5 rounded-full overflow-hidden border border-slate-100",children:n.jsx("div",{className:`h-full transition-all duration-1000 shadow-sm ${v>=100?"bg-emerald-50":v>50?"bg-blue-50":"bg-amber-50"}`,style:{width:`${v}%`}})})]})}),n.jsxs("td",{className:"px-8 py-6 text-right font-mono font-black text-blue-600 text-xs",children:[Number(h.exchangeRate).toFixed(2)," Bs"]}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:()=>d(h.id),className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm",children:n.jsx(Tc,{size:18})}),u&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>t(h),className:"p-3 bg-indigo-50 text-indigo-600 rounded-xl hover:bg-indigo-600 hover:text-white transition-all shadow-sm",children:n.jsx(yl,{size:18})}),n.jsx("button",{onClick:()=>{confirm("¿Eliminar?")&&s(h.id)},className:"p-3 bg-red-50 text-red-600 rounded-xl hover:bg-red-600 hover:text-white transition-all shadow-sm",children:n.jsx(Ua,{size:18})})]})]})})]},h.id)})})]})})})]})},k6=({feeId:e,propertyId:t,feeRate:r,currentBalance:a,availableCredit:s,isOwnerReporting:i=!1,existingPayment:l,onSuccess:o})=>{const{registerPayment:d,updatePayment:u,exchangeRateHistory:f,refreshData:p,properties:h}=ht(),[m,b]=k.useState(l?(Number(l.amount)*(l.appliedRate||r)).toString():""),[v,y]=k.useState((l==null?void 0:l.method)||"Transferencia Bancaria"),[j,_]=k.useState("pm"),[N,E]=k.useState((l==null?void 0:l.reference)||""),[T,B]=k.useState((l==null?void 0:l.date)||Dr()),[F,R]=k.useState(!1),[U,D]=k.useState(null),[L,P]=k.useState(!1),G=async M=>{if(!(!M||M==="S/R"||M.length<3))try{const q=await(await fetch(`${Ne}/check_duplicate_reference.php?reference=${M}`,{credentials:"include"})).json();q.duplicate?D(q):D(null)}catch(O){console.error("Error checking duplicate",O)}},Q=k.useMemo(()=>h.find(M=>M.id===t),[h,t]),H=Number((Q==null?void 0:Q.initialDebt)||0),X=Number((Q==null?void 0:Q.creditBalance)||0),K=k.useMemo(()=>{const M=f.find(q=>q.date===T);if(!M)return Number(r);if(j==="parallel")return Number(M.parallelValue)||Number(r);if(j==="am")return Number(M.amValue)||Number(M.pmValue)||Number(r);const O=Number(M.pmValue)>0?M.pmValue:M.amValue;return Number(O)||Number(r)},[T,f,r,j]),ee=Number(m)>0?Number(m)/Number(K):0,W=Math.max(0,ee-a),Y=async M=>{if(M.preventDefault(),U&&!L)if(i){alert("ATENCIÓN: Este número de transferencia ya existe en el sistema. Por favor, verifique nuevamente. Si el código es correcto y el problema persiste, debe enviar el pago directamente a la administración para su procesamiento manual.");return}else{alert("ALERTA DE SEGURIDAD: Este código de transferencia ya ha sido utilizado. Verifique la información mostrada en el recuadro de alerta. Para proceder, debe marcar la casilla de autorización del programador/administrador.");return}const O=Number(m);if(isNaN(O)||O<=0){alert("Monto inválido.");return}if(!N&&v!=="Efectivo / Divisa"){alert("Referencia obligatoria.");return}R(!0);try{if(i&&!l){const q=await fetch(`${Ne}/report_payment_owner.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:e,propertyId:t,amountBs:O,amount:Number(ee.toFixed(2)),method:v,reference:N||"EFECTIVO",date:T,slot:j})}),z=await q.json();if(!q.ok)throw new Error(z.error||"Fallo al reportar");await p(),alert("¡Reporte enviado exitosamente! La administración revisará su comprobante.")}else l?(await u(e,t,{...l,amount:Number(ee.toFixed(2)),method:v,reference:N||"EFECTIVO",date:T,slot:j}),alert("¡Pago Actualizado con Éxito!")):(await d(e,t,Number(ee.toFixed(2)),v,N||"EFECTIVO",T,j,O),alert("¡Pago Registrado Directamente!"));o()}catch(q){alert("ERROR: "+(q.message||"Fallo de red."))}finally{R(!1)}};return n.jsxs("form",{onSubmit:Y,className:"space-y-6",children:[n.jsxs("div",{className:"space-y-3",children:[H>0&&n.jsxs("div",{className:"flex items-start gap-4 p-5 bg-red-600 text-white rounded-[2rem] shadow-2xl animate-in zoom-in-95 relative overflow-hidden",children:[n.jsx("div",{className:"bg-white/20 p-3 rounded-2xl relative z-10",children:n.jsx(Xr,{size:32})}),n.jsxs("div",{className:"relative z-10",children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.2em] mb-1 opacity-70",children:"Cerrojo de Deuda Histórica"}),n.jsxs("p",{className:"text-xl font-black leading-none",children:["$",H.toFixed(2)," USD"]}),n.jsx("p",{className:"text-[10px] font-bold mt-3 leading-tight opacity-90",children:"⚠ BLOQUEO ACTIVO: Este pago se absorberá 100% por la deuda anterior. La cuota del mes seguirá pendiente hasta que el histórico sea $0.00."})]}),n.jsx(ho,{className:"absolute right-[-20px] bottom-[-20px] w-24 h-24 text-white/10 pointer-events-none"})]}),X>0&&n.jsxs("div",{className:"flex items-center gap-3 p-4 bg-blue-50 border border-blue-100 rounded-2xl",children:[n.jsx(Qc,{className:"text-blue-500 shrink-0",size:20,fill:"currentColor"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-blue-700 uppercase tracking-widest",children:"Saldo a Favor Disponible"}),n.jsxs("p",{className:"text-sm font-bold text-blue-600",children:["Crédito migrado utilizable: $",X.toFixed(2)]})]})]})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-200 shadow-inner",children:[n.jsxs("div",{className:"flex justify-between items-center mb-4 px-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-600 block tracking-widest",children:"Monto Voucher (Bolívares)"}),n.jsxs("div",{className:"flex bg-white border border-slate-200 rounded-xl p-1 shadow-sm",children:[n.jsx("button",{type:"button",onClick:()=>_("am"),className:`px-4 py-1.5 rounded-lg text-[10px] font-black uppercase transition-all ${j==="am"?"bg-blue-600 text-white shadow-md":"text-slate-400 hover:text-slate-600"}`,children:"AM"}),n.jsx("button",{type:"button",onClick:()=>_("pm"),className:`px-4 py-1.5 rounded-lg text-[10px] font-black uppercase transition-all ${j==="pm"?"bg-blue-600 text-white shadow-md":"text-slate-400 hover:text-slate-600"}`,children:"PM"}),n.jsx("button",{type:"button",onClick:()=>_("parallel"),className:`px-4 py-1.5 rounded-lg text-[10px] font-black uppercase transition-all ${j==="parallel"?"bg-indigo-600 text-white shadow-md":"text-slate-400 hover:text-slate-600"}`,children:"Paralela"})]})]}),n.jsxs("div",{className:"flex items-center gap-3 bg-white border border-slate-200 p-5 rounded-2xl",children:[n.jsx("span",{className:"font-black text-slate-300 text-2xl",children:"Bs."}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full text-3xl font-black text-slate-900 outline-none",value:m,onChange:M=>b(M.target.value),placeholder:"0.00"})]}),n.jsxs("div",{className:"mt-6 space-y-4",children:[n.jsx("div",{className:"flex justify-between items-start px-1",children:n.jsxs("div",{className:"space-y-1",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:"Fecha Contable:"}),n.jsx("input",{required:!0,type:"date",className:"bg-white border border-slate-200 rounded-lg px-3 py-1 text-xs font-black text-slate-600 outline-none",value:T,onChange:M=>B(M.target.value)}),K>0&&n.jsxs("p",{className:"text-[10px] font-black text-slate-500 mt-1 uppercase tracking-tighter",children:["Tasa del día: ",K.toFixed(2)," Bs/$"]})]})}),n.jsxs("div",{className:"flex justify-between items-center bg-slate-800 text-white p-4 rounded-xl shadow-lg",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Abono Proyectado:"}),n.jsxs("span",{className:"text-xl font-black",children:["$",sr(ee)," USD"]})]}),ee>0&&n.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[n.jsxs("div",{className:"bg-blue-50 border border-blue-100 p-3 rounded-xl",children:[n.jsx("span",{className:"text-[8px] font-black text-blue-400 uppercase block",children:"Saldo Cuota"}),n.jsxs("span",{className:"text-sm font-black text-blue-700",children:["$",sr(a)]})]}),n.jsxs("div",{className:`p-3 rounded-xl border ${W>0?"bg-emerald-50 border-emerald-100":"bg-slate-50 border-slate-100"}`,children:[n.jsx("span",{className:`text-[8px] font-black uppercase block ${W>0?"text-emerald-400":"text-slate-400"}`,children:"Excedente"}),n.jsxs("span",{className:`text-sm font-black ${W>0?"text-emerald-700":"text-slate-400"}`,children:["$",sr(W)]})]})]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 text-sm",value:N,onChange:M=>{const O=M.target.value;E(O),O.length>=3&&G(O)},placeholder:"Número de Referencia"}),U&&n.jsx("div",{className:"p-5 bg-red-50 border-2 border-red-200 rounded-3xl animate-in slide-in-from-top duration-500",children:n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx(Sr,{className:"text-red-600 shrink-0 mt-1",size:20}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-red-900 font-black text-[11px] uppercase tracking-tight",children:"¡ALERTA: REFERENCIA DUPLICADA!"}),n.jsx("p",{className:"text-red-700 text-[10px] font-bold mt-1 leading-relaxed",children:i?"Este número de transferencia ya ha sido utilizado. Verifique su comprobante o contacte a la administración.":"Este código ya existe en los registros del sistema SAC 2026."}),!i&&U.matches&&n.jsxs("div",{className:"mt-3 space-y-2",children:[n.jsx("p",{className:"text-[9px] font-black text-red-900 uppercase tracking-widest underline",children:"Rastro Encontrado:"}),U.matches.map((M,O)=>n.jsxs("div",{className:"bg-white/50 p-2 rounded-lg border border-red-100 text-[9px] font-mono",children:[n.jsxs("span",{className:"font-black text-red-600",children:["[",M.source,"]"]})," ",M.detail," - ",M.date]},O)),n.jsxs("div",{className:"mt-4 flex items-center gap-3 bg-red-600 text-white p-3 rounded-xl shadow-lg",children:[n.jsx("input",{type:"checkbox",id:"auth_dup_fees",className:"w-5 h-5 accent-white cursor-pointer",checked:L,onChange:M=>P(M.target.checked)}),n.jsx("label",{htmlFor:"auth_dup_fees",className:"text-[9px] font-black uppercase tracking-widest cursor-pointer",children:"AUTORIZAR CARGA DUPLICADA"})]})]})]})]})}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 text-sm",value:v,onChange:M=>y(M.target.value),children:[n.jsx("option",{value:"Transferencia Bancaria",children:"Transferencia Bancaria"}),n.jsx("option",{value:"Pago Móvil",children:"Pago Móvil"}),n.jsx("option",{value:"Efectivo / Divisa",children:"Efectivo / Divisa"})]})]}),n.jsxs("button",{disabled:F,type:"submit",className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl flex items-center justify-center gap-3 transition-all active:scale-95 disabled:opacity-50",children:[F?n.jsx(ct,{className:"animate-spin"}):n.jsx(Gt,{size:24})," ",l?"ACTUALIZAR PAGO":i?"ENVIAR REPORTE":"SELLAR PAGO"]})]})},Zde=({feeId:e,propertyId:t,feeRate:r,onSuccess:a})=>{const{exchangeRateHistory:s,refreshData:i}=ht(),[l,o]=k.useState(""),[d,u]=k.useState(""),[f,p]=k.useState("pm"),[h,m]=k.useState(Dr()),[b,v]=k.useState(""),[y,j]=k.useState(!1),[_,N]=k.useState(!1),E=Ip.useMemo(()=>{const F=s.find(U=>U.date===h);if(!F)return Number(r);if(f==="parallel")return Number(F.parallelValue)||Number(r);if(f==="am")return Number(F.amValue)||Number(F.pmValue)||Number(r);const R=Number(F.pmValue)>0?F.pmValue:F.amValue;return Number(R)||Number(r)},[h,s,r,f]),T=_?Number(l)>0?Number(l)/Number(E):0:Number(d),B=async F=>{F.preventDefault();const R=Number(T.toFixed(2));if(R<=0){alert("Monto inválido.");return}j(!0);try{const U=await fetch(`${Ne}/add_extra_charge.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:e,propertyId:t,amount:R,amount_bs:_?Number(l):0,exchange_rate:E,description:b})}),D=await U.json();if(!U.ok)throw new Error(D.error||"Fallo al agregar cargo");await i(),alert("¡Cargo Extra Agregado con Éxito!"),a()}catch(U){alert("ERROR: "+(U.message||"Fallo de red."))}finally{j(!1)}};return n.jsxs("form",{onSubmit:B,className:"space-y-6",children:[n.jsxs("div",{className:"flex bg-slate-100 p-1 rounded-2xl mb-4",children:[n.jsx("button",{type:"button",onClick:()=>N(!1),className:`flex-1 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest transition-all ${_?"text-slate-400":"bg-white text-blue-600 shadow-sm"}`,children:"Monto en USD"}),n.jsx("button",{type:"button",onClick:()=>N(!0),className:`flex-1 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest transition-all ${_?"bg-white text-blue-600 shadow-sm":"text-slate-400"}`,children:"Monto en BS"})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-200 shadow-inner",children:[_?n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-600 block tracking-widest",children:"Monto en Bolívares"}),n.jsxs("div",{className:"flex bg-white border border-slate-200 rounded-xl p-1 shadow-sm",children:[n.jsx("button",{type:"button",onClick:()=>p("am"),className:`px-3 py-1 rounded-lg text-[9px] font-black uppercase ${f==="am"?"bg-blue-600 text-white":"text-slate-400"}`,children:"AM"}),n.jsx("button",{type:"button",onClick:()=>p("pm"),className:`px-3 py-1 rounded-lg text-[9px] font-black uppercase ${f==="pm"?"bg-blue-600 text-white":"text-slate-400"}`,children:"PM"}),n.jsx("button",{type:"button",onClick:()=>p("parallel"),className:`px-3 py-1 rounded-lg text-[9px] font-black uppercase ${f==="parallel"?"bg-indigo-600 text-white":"text-slate-400"}`,children:"Paralela"})]})]}),n.jsxs("div",{className:"flex items-center gap-3 bg-white border border-slate-200 p-5 rounded-2xl",children:[n.jsx("span",{className:"font-black text-slate-300 text-2xl",children:"Bs."}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full text-3xl font-black text-slate-900 outline-none",value:l,onChange:F=>o(F.target.value),placeholder:"0.00"})]}),n.jsxs("div",{className:"flex justify-between items-center bg-slate-800 text-white p-4 rounded-xl shadow-lg",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Equivalente USD:"}),n.jsxs("span",{className:"text-xl font-black",children:["$",sr(T)]})]})]}):n.jsxs("div",{className:"space-y-4",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-600 block tracking-widest px-1",children:"Monto en Dólares"}),n.jsxs("div",{className:"flex items-center gap-3 bg-white border border-slate-200 p-5 rounded-2xl",children:[n.jsx("span",{className:"font-black text-slate-300 text-2xl",children:"$"}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full text-3xl font-black text-slate-900 outline-none",value:d,onChange:F=>u(F.target.value),placeholder:"0.00"})]})]}),n.jsx("div",{className:"mt-6 space-y-4",children:n.jsxs("div",{className:"space-y-1",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:"Fecha Contable:"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-white border border-slate-200 rounded-xl px-4 py-3 text-sm font-black text-slate-600 outline-none",value:h,onChange:F=>m(F.target.value)}),_&&E>0&&n.jsxs("p",{className:"text-[10px] font-black text-slate-500 mt-1 uppercase tracking-tighter",children:["Tasa aplicada: ",E.toFixed(2)," Bs/$"]})]})})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-600 block tracking-widest px-1",children:"Descripción / Motivo"}),n.jsx("textarea",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 text-sm min-h-[100px]",value:b,onChange:F=>v(F.target.value),placeholder:"Ej: Multa por retraso, Reparación extra, etc."})]}),n.jsxs("button",{disabled:y,type:"submit",className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl flex items-center justify-center gap-3 transition-all active:scale-95 disabled:opacity-50",children:[y?n.jsx(ct,{className:"animate-spin"}):n.jsx(db,{size:24})," AGREGAR CARGO EXTRA"]})]})},eue=({fee:e,user:t,onBack:r})=>{const{properties:a,financialTotals:s,latestRate:i}=ht(),l=["admin","programmer","board"].includes(t.role),o=t.propertyId,d=k.useMemo(()=>a.find(_=>_.id===o),[a,o]),u=Number(d==null?void 0:d.aliquot)||0,f=!!(d!=null&&d.hasUncommonExpense),p=k.useMemo(()=>a.filter(_=>_.hasUncommonExpense).length,[a]),h=k.useMemo(()=>{const _=N=>{var F,R;const E=Number(N.amountUsd)||0;let T=0,B="";if(l)T=E,B="GLOBAL";else if(N.isSpecial){const U=((F=N.specialPropertyIds)==null?void 0:F.length)||1,D=(R=N.specialPropertyIds)==null?void 0:R.includes(o);T=D?E/U:0,B=D?`ESP (1/${U})`:"Exento"}else N.isUncommon?(T=f&&p>0?E/p:0,B=f&&p>0?`GNC (1/${p})`:"Exento"):(T=E*(u/100),B=`ALIQ (${u.toFixed(4)}%)`);return{...N,global:E,myPortion:T,basisDesc:B}};return[{title:"Gastos Fijos",items:e.fixedExpenses.map(_)},{title:"Gastos Variables",items:e.variableExpenses.map(_)},{title:"Otros Gastos",items:e.otherExpenses.map(_)}]},[e,o,u,f,p,a,l]),m=h.reduce((_,N)=>_+N.items.reduce((E,T)=>E+T.myPortion,0),0),b=h.reduce((_,N)=>_+N.items.reduce((E,T)=>E+T.global,0),0),v=Number(e.reserveFundPercent)||10,y=m*(v/100),j=m+y;return n.jsxs("div",{className:"max-w-7xl mx-auto space-y-10 animate-in fade-in duration-500 pb-24 px-1 print:p-0 print:space-y-2 print-compact",children:[n.jsx("style",{children:`
                @media print {
                    @page { margin: 0.5cm; size: auto; }
                    .print-compact { font-size: 8pt !important; width: 100% !important; overflow: visible !important; }
                    .print-compact table td, .print-compact table th { padding-top: 2px !important; padding-bottom: 2px !important; line-height: 1.1 !important; font-size: 8pt !important; }
                    .print-compact h2 { font-size: 14pt !important; margin-bottom: 4px !important; }
                    .print-compact h3 { font-size: 10pt !important; margin-bottom: 6px !important; margin-top: 6px !important; border-bottom-width: 1px !important; padding-bottom: 2px !important; }
                    .print-compact .p-10, .print-compact .p-14, .print-compact .p-8 { padding: 12px !important; }
                    .print-compact .mt-8, .print-compact .mt-10, .print-compact .mt-6 { margin-top: 6px !important; }
                    .print-compact .mb-8, .print-compact .mb-10, .print-compact .mb-4, .print-compact .mb-2 { margin-bottom: 4px !important; }
                    .print-compact .rounded-[3rem], .print-compact .rounded-2xl, .print-compact .rounded-[2.5rem] { border-radius: 8px !important; }
                    .print-compact .shadow-xl, .print-compact .shadow-2xl, .print-compact .shadow-lg { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
                    .print-compact .bg-slate-900 { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                    .print-compact .bg-slate-50 { background-color: #f8fafc !important; -webkit-print-color-adjust: exact; }
                    .print-compact .bg-blue-600 { background-color: #2563eb !important; -webkit-print-color-adjust: exact; }
                    .print-compact .bg-indigo-600 { background-color: #4f46e5 !important; -webkit-print-color-adjust: exact; }
                    .print-compact table { page-break-inside: auto !important; }
                    .print-compact tr { page-break-inside: avoid !important; page-break-after: auto !important; }
                }
            `}),n.jsxs("div",{className:"flex justify-between items-center no-print",children:[n.jsxs("button",{onClick:r,className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(gs,{size:16})," Monitor"]}),n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",children:n.jsx(wt,{size:20})})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] shadow-xl border border-slate-200 overflow-hidden print:border-none print:shadow-none",children:[n.jsxs("div",{className:"p-10 lg:p-14 bg-slate-900 text-white text-center relative overflow-hidden print:p-6",children:[n.jsx("h2",{className:"text-2xl lg:text-3xl font-black uppercase tracking-[0.2em] mb-2 print:text-xl",children:l?"Relación Global de Gastos":"Relación de Gastos Mensuales"}),n.jsxs("p",{className:"text-blue-400 font-black uppercase tracking-widest text-xs",children:[Te[e.month]," ",e.year]}),n.jsx("div",{className:"mt-8 mb-4 max-w-md mx-auto print:mt-4 print:mb-2",children:n.jsxs("div",{className:"bg-indigo-600/20 border border-indigo-400/30 p-4 rounded-2xl backdrop-blur-sm flex items-center justify-between print:p-2 print:border-none",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ho,{className:"text-blue-400",size:24}),n.jsxs("div",{className:"text-left",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-blue-300 tracking-widest",children:"Disponibilidad Fondo de Reserva"}),n.jsxs("p",{className:"text-lg font-black text-white",children:["$ ",sr((s==null?void 0:s.reserveFundUsd)||0)]})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[7px] font-black uppercase text-indigo-300",children:"Equiv. VES"}),n.jsxs("p",{className:"text-xs font-black text-blue-200",children:["Bs. ",Fg((s==null?void 0:s.reserveFundBs)||0)]})]})]})}),n.jsxs("div",{className:"mt-6 flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8 print:mt-2 print:gap-4",children:[!l&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Inmueble"}),n.jsxs("p",{className:"text-lg font-black text-blue-300 print:text-sm",children:[d==null?void 0:d.type," ",d==null?void 0:d.number]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Alícuota"}),n.jsxs("p",{className:"text-lg font-black text-emerald-400 print:text-sm",children:[u.toFixed(4),"%"]})]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:l?"Tasa Emisión":"Tasa del Día"}),n.jsxs("p",{className:"text-lg font-black text-amber-400 print:text-sm",children:[Number(l?e.exchangeRate:i).toFixed(2)," Bs/$"]})]})]})]}),n.jsx("div",{className:"p-8 lg:p-14 space-y-12 bg-white print:p-4 print:space-y-4",children:h.map((_,N)=>{const E=_.items.reduce((T,B)=>T+B.global,0);return _.items.length===0?null:n.jsxs("div",{className:"print:break-inside-auto",children:[n.jsxs("h3",{className:"text-lg font-black text-slate-900 uppercase tracking-tighter mb-6 flex items-center gap-3 print:text-sm print:mb-2",children:[n.jsx("div",{className:"w-2 h-6 bg-blue-600 rounded-full print:h-4"})," ",_.title]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b-2 border-slate-100",children:[n.jsx("th",{className:"py-4 text-[9px] font-black uppercase text-slate-400 tracking-widest print:py-1",children:"Concepto"}),!l&&n.jsx("th",{className:"py-4 text-[9px] font-black uppercase text-slate-400 text-center print:py-1",children:"Base"}),n.jsx("th",{className:`py-4 text-[9px] font-black uppercase text-right print:py-1 ${l?"text-blue-600 bg-blue-50/30 px-4":"text-slate-400"}`,children:"Gasto Global ($)"}),!l&&n.jsx("th",{className:"py-4 text-[9px] font-black uppercase text-blue-600 text-right bg-blue-50/30 px-4 print:py-1",children:"Su Cuota ($)"})]})}),n.jsxs("tbody",{className:"divide-y divide-slate-50",children:[_.items.map((T,B)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors",children:[n.jsxs("td",{className:"py-4 text-xs font-bold text-slate-600 uppercase flex items-center gap-3 print:py-0.5 print:text-[7pt]",children:[T.isSpecial?n.jsx(Ab,{size:12,className:"text-amber-500 no-print"}):T.isUncommon?n.jsx(Qc,{size:12,className:"text-indigo-500 no-print",fill:"currentColor"}):n.jsx("div",{className:"w-3 no-print"}),T.description]}),!l&&n.jsx("td",{className:"py-4 text-center print:py-0.5",children:n.jsx("span",{className:"px-3 py-1 rounded-lg text-[8px] font-black uppercase tracking-tighter border bg-slate-50 text-slate-500 print:text-[6pt] print:px-1",children:T.basisDesc})}),n.jsxs("td",{className:`py-4 text-xs font-black text-right print:py-0.5 ${l?"text-blue-900 bg-blue-50/10 px-4 text-sm":"text-slate-400"}`,children:["$",sr(T.global)]}),!l&&n.jsxs("td",{className:"py-4 text-sm font-black text-blue-900 text-right bg-blue-50/10 px-4 print:py-0.5 print:text-[8pt]",children:["$",sr(T.myPortion)]})]},B)),l&&n.jsxs("tr",{className:"bg-slate-100/50 border-t border-slate-200",children:[n.jsxs("td",{className:"py-4 px-4 font-black text-xs text-slate-900 uppercase print:py-1",children:["SUBTOTAL ",_.title.toUpperCase()]}),n.jsxs("td",{className:"py-4 px-4 text-right font-black text-slate-900 text-sm print:py-1",children:["$",sr(E)]})]})]})]})})]},N)})}),n.jsxs("div",{className:"bg-slate-50 p-10 lg:p-14 border-t border-slate-100 grid grid-cols-1 lg:grid-cols-2 gap-12 print:p-6 print:gap-4 print:grid-cols-2",children:[n.jsxs("div",{className:"space-y-4 print:space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-3 text-amber-600 print:gap-1",children:[n.jsx(Sr,{size:20,className:"print:w-4 print:h-4"}),n.jsx("h4",{className:"text-sm font-black uppercase tracking-widest print:text-[8pt]",children:"Resumen"})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-2 pt-4 print:pt-1",children:[n.jsxs("div",{className:"p-3 bg-white border border-slate-200 rounded-xl text-center print:p-1",children:[n.jsx("span",{className:"block text-[8px] font-black text-slate-400 uppercase print:text-[6pt]",children:"Subtotal"}),n.jsxs("span",{className:"font-black text-slate-800 text-xs print:text-[8pt]",children:["$",sr(l?b:m)]})]}),n.jsxs("div",{className:"p-3 bg-white border border-slate-200 rounded-xl text-center print:p-1",children:[n.jsxs("span",{className:"block text-[8px] font-black text-blue-400 uppercase print:text-[6pt]",children:["Reserva (",v,"%)"]}),n.jsxs("span",{className:"font-black text-blue-600 text-xs print:text-[8pt]",children:["$",sr(l?b*(v/100):y)]})]}),n.jsxs("div",{className:"p-3 bg-white border border-slate-200 rounded-xl text-center print:p-1",children:[n.jsx("span",{className:"block text-[8px] font-black text-amber-400 uppercase print:text-[6pt]",children:"Gasto Global"}),n.jsxs("span",{className:"font-black text-amber-600 text-xs print:text-[8pt]",children:["$",sr(b)]})]})]})]}),n.jsxs("div",{className:"bg-slate-900 rounded-[2.5rem] p-10 text-white shadow-2xl relative overflow-hidden flex flex-col justify-center print:p-4",children:[n.jsxs("div",{className:"relative z-10 flex flex-col gap-6 print:gap-2",children:[n.jsxs("div",{className:"flex justify-between items-center border-b border-white/10 pb-4 print:pb-1",children:[n.jsx("span",{className:"text-[10px] font-black uppercase text-blue-400 print:text-[7pt]",children:l?"Gran Total a Recaudar":"Total a Pagar"}),n.jsxs("span",{className:"text-4xl font-black tracking-tighter print:text-xl",children:["$",sr(l?b*(1+v/100):j)]})]}),n.jsxs("div",{className:"flex justify-between items-center bg-blue-600/20 p-5 rounded-2xl border border-blue-500/20 print:p-2",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-[9px] font-black uppercase text-blue-300 block print:text-[6pt]",children:"Equivalente VES"}),n.jsxs("p",{className:"text-2xl font-black tracking-tight mt-1 print:text-sm print:mt-0",children:["Bs. ",Fg((l?b*(1+v/100):j)*Number(l?e.exchangeRate:i))]})]}),n.jsx(Ki,{size:32,className:"text-blue-400 opacity-50 print:w-6 print:h-6"})]})]}),n.jsx(Up,{className:"absolute right-[-20px] bottom-[-20px] w-48 h-48 text-white/[0.05] pointer-events-none no-print"})]})]})]}),n.jsx("div",{className:"hidden print:block text-center mt-4 border-t pt-4",children:n.jsx("p",{className:"text-[8pt] font-black uppercase text-slate-300 tracking-[0.4em]",children:"Certificado Digital de Gestión • SAC 2026 • By Andres Mathison"})})]})},tue=({debt:e,property:t,onClose:r})=>{const{residents:a,users:s,latestRate:i}=ht(),[l,o]=k.useState(null),d=e.payments||[],u=d.reduce((_,N)=>_+Number(N.amount),0),f=Number(e.amountUsd),p=f-u,h=u>=f,m=k.useMemo(()=>{if(!t)return null;const _=a.find(E=>E.propertyId===t.id&&E.isOwner),N=s.find(E=>E.cedula===(_==null?void 0:_.cedula));return{fullName:(_==null?void 0:_.fullName)||"Propietario",email:(N==null?void 0:N.email)||"",phone:(_==null?void 0:_.phone)||(N==null?void 0:N.phone)||"",telegramId:(N==null?void 0:N.telegramChatId)||"",propertyCode:t.code}},[t,a,s]),b=_=>{if(!_)return"";let N=_.trim();return N.startsWith("+")?N.replace(/\D/g,""):N.startsWith("0")?"58"+N.substring(1).replace(/\D/g,""):N.length===10?"58"+N.replace(/\D/g,""):N.replace(/\D/g,"")},v=()=>{if(!t||!e)return"";const _=h?"✅ SOLVENTE":"⚠️ PAGO PARCIAL",N=p>0?`📉 *Deuda Restante:* $${sr(p)}
`:`✨ *CUOTA CANCELADA*
`;let E="";return d.forEach((T,B)=>{E+=`🔹 Pago ${B+1}: $${sr(T.amount)} (${T.date} - Ref: ${T.reference})
`}),`📄 *RECIBO DE PAGO - SAC 2026*

Unidad: *${t.code}*
Propietario: *${m==null?void 0:m.fullName}*
------------------------------------------
💰 *Monto Cuota:* $${sr(f)}
💵 *Total Pagado:* $${sr(u)}
🔢 *Cant. Pagos:* ${d.length}
------------------------------------------
📋 *DETALLE DE PAGOS:*
${E}------------------------------------------
📊 *ESTATUS:* ${_}
`+N+`------------------------------------------
Fecha de Emisión: ${new Date().toLocaleDateString()}

¡Gracias por su compromiso!`},y=async _=>{if(!m||!t||!e)return;const N=v();if(_==="whatsapp"){const E=b(m.phone);if(!E)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${E}?text=${encodeURIComponent(N)}`,"_blank");return}if(_==="share"){if(navigator.share)try{await navigator.share({title:`Recibo de Pago - ${t.code}`,text:N.replace(/\*/g,""),url:Rr})}catch(E){console.warn("Share failed",E)}else alert("La función de compartir no está disponible en este navegador.");return}o(_);try{const E={channel:_,messageType:"receipt",monthName:"Periodo Actual",year:new Date().getFullYear(),recipients:[{name:m.fullName,email:m.email,telegramChatId:m.telegramId,propName:`${t.code}`,amount:sr(f),paid:sr(u),status:h?"Solvente":"Parcial",balance:sr(p)}]},B=await(await fetch(`${Ne}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(E)})).json();B.status==="success"?alert(`¡Éxito! Recibo enviado por ${_}.`):alert("Error: "+B.message)}catch{alert("Error de red al enviar.")}finally{o(null)}},j=()=>{const _=v();navigator.clipboard.writeText(_),alert("Copiado al portapapeles")};return n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl relative overflow-hidden animate-in zoom-in-95 duration-300 max-h-[90vh] overflow-y-auto custom-scrollbar",children:[n.jsx("button",{onClick:r,className:"absolute top-8 right-8 p-3 bg-slate-100 rounded-full text-slate-400 hover:bg-red-50 hover:text-red-500 transition-all no-print",children:n.jsx(mt,{size:20})}),n.jsxs("div",{className:"text-center mb-10",children:[n.jsx("div",{className:"w-20 h-20 bg-emerald-50 text-emerald-600 rounded-[2rem] flex items-center justify-center mx-auto mb-6 shadow-inner",children:n.jsx(Gt,{size:40})}),n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Recibo de Pago"}),n.jsx("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-[0.3em] mt-2",children:"Certificado Digital SAC 2026"})]}),n.jsxs("div",{className:"space-y-5 border-y border-slate-100 py-8 mb-10",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Inmueble:"}),n.jsx("span",{className:"font-black text-slate-800 text-lg uppercase",children:(t==null?void 0:t.code)||"S/I"})]}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Monto Cuota:"}),n.jsxs("span",{className:"font-black text-slate-800",children:["$",sr(f)]})]}),n.jsxs("div",{className:"flex justify-between items-center bg-emerald-50/50 p-4 rounded-2xl border border-emerald-100",children:[n.jsx("span",{className:"text-[10px] font-black text-emerald-700 uppercase tracking-widest",children:"Total Pagado:"}),n.jsxs("span",{className:"font-black text-emerald-600 text-2xl",children:["$",sr(u)]})]}),d.length>0&&n.jsxs("div",{className:"space-y-3 mt-4",children:[n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest text-center",children:["Historial de Pagos (",d.length,")"]}),d.map((_,N)=>n.jsxs("div",{className:"p-3 bg-slate-50 rounded-xl border border-slate-100 flex justify-between items-center",children:[n.jsxs("div",{children:[n.jsxs("p",{className:"text-[10px] font-black text-slate-800 uppercase",children:["Ref: #",_.reference]}),n.jsx("p",{className:"text-[8px] font-bold text-slate-400 uppercase",children:_.date})]}),n.jsxs("span",{className:"font-black text-slate-700 text-xs",children:["$",sr(_.amount)]})]},N))]})]}),n.jsxs("div",{className:"grid grid-cols-1 gap-3 no-print",children:[n.jsxs("button",{onClick:()=>window.print(),className:"w-full bg-slate-900 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl flex items-center justify-center gap-3 active:scale-95 transition-all",children:[n.jsx(wt,{size:18})," IMPRIMIR"]}),n.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[n.jsx("button",{onClick:()=>y("whatsapp"),className:"p-4 bg-emerald-500 text-white rounded-2xl shadow-lg active:scale-95 transition-all flex justify-center",title:"WhatsApp",children:n.jsx(Ha,{size:20})}),n.jsx("button",{onClick:()=>y("telegram"),disabled:!(m!=null&&m.telegramId)||!!l,className:`p-4 rounded-2xl text-white shadow-lg active:scale-95 transition-all flex justify-center ${m!=null&&m.telegramId?"bg-sky-500":"bg-slate-200"}`,title:"Telegram",children:l==="telegram"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Bl,{size:20})}),n.jsx("button",{onClick:()=>y("email"),disabled:!(m!=null&&m.email)||!!l,className:`p-4 rounded-2xl text-white shadow-lg active:scale-95 transition-all flex justify-center ${m!=null&&m.email?"bg-indigo-600":"bg-slate-200"}`,title:"Email",children:l==="email"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Br,{size:20})}),n.jsx("button",{onClick:()=>y("share"),className:"p-4 bg-blue-600 text-white rounded-2xl shadow-lg active:scale-95 transition-all flex justify-center",title:"Compartir",children:n.jsx(Aa,{size:20})})]}),n.jsxs("button",{onClick:j,className:"w-full bg-slate-100 text-slate-600 py-3 rounded-2xl font-black text-[9px] uppercase tracking-widest flex items-center justify-center gap-2 hover:bg-slate-200 transition-all",children:[n.jsx(ub,{size:16})," COPIAR TEXTO"]})]}),n.jsx("div",{className:"mt-6 text-center",children:n.jsx("p",{className:"text-[9px] font-bold text-slate-300 uppercase tracking-widest leading-relaxed",children:"Este documento es una representación digital de una transacción confirmada en el Libro Diario."})})]})})},rue=({fee:e,user:t,onBack:r})=>{var P,G,Q,H,X,K,ee,W,Y;const{properties:a,residents:s,users:i,deletePayment:l,refreshData:o}=ht(),[d,u]=k.useState("debts"),[f,p]=k.useState(null),[h,m]=k.useState(null),[b,v]=k.useState(null),[y,j]=k.useState(!1),[_,N]=k.useState(null),[E,T]=k.useState(null),B=["admin","programmer","board"].includes(t.role),[F,R]=k.useState(!1),U=async M=>{j(!0);try{const O=await fetch(`${Ne}/approve_payment.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:e.id,propertyId:M.propertyId})});if(O.ok)alert("¡Pago Validado y Registrado en el Sistema!"),await o(),N(null);else{const q=await O.json();alert("Error: "+q.error)}}catch{alert("Fallo de conexión.")}finally{j(!1)}},D=async M=>{const O=prompt("Indique el motivo del rechazo para que el propietario pueda corregirlo:","Comprobante no coincide con el banco.");if(O!==null){j(!0);try{(await fetch(`${Ne}/reject_payment.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:e.id,propertyId:M.propertyId,reason:O})})).ok&&(alert("Reporte rechazado. El propietario será notificado."),await o(),N(null))}catch{alert("Fallo de conexión.")}finally{j(!1)}}};if(d==="breakdown")return n.jsx(eue,{fee:e,user:t,onBack:()=>u("debts")});const L=[...e.debts||[]].sort((M,O)=>{var J,re;const q=((J=a.find(le=>le.id===M.propertyId))==null?void 0:J.code)||"",z=((re=a.find(le=>le.id===O.propertyId))==null?void 0:re.code)||"";return q.localeCompare(z,void 0,{numeric:!0})});return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-12 px-1",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6 no-print",children:[n.jsxs("div",{className:"flex gap-2 w-full md:w-auto",children:[n.jsxs("button",{onClick:r,className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(gs,{size:16})," Volver al Listado"]}),n.jsx("button",{onClick:()=>{const M=["Unidad","Propietario","Monto $","Pagado $","Pendiente $","Estatus"],O=L.map(q=>{const z=a.find(le=>le.id===q.propertyId),J=s.find(le=>le.propertyId===q.propertyId&&le.isOwner),re=Number(q.amountUsd)-Number(q.paidAmount);return[(z==null?void 0:z.code)||"",(J==null?void 0:J.fullName)||"Sin Propietario",`$${Number(q.amountUsd).toFixed(2)}`,`$${Number(q.paidAmount).toFixed(2)}`,`$${re.toFixed(2)}`,q.paidAmount>=q.amountUsd?"PAGADO":q.paidAmount>0?"PARCIAL":"PENDIENTE"]});$c(`Monitor de Cobranza - ${Te[e.month]} ${e.year}`,M,O)},className:"p-3 bg-white border border-slate-200 rounded-2xl text-slate-500 hover:bg-indigo-600 hover:text-white transition-all shadow-sm",title:"Exportar a HTML",children:n.jsx(yr,{size:20})}),n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-white border border-slate-200 rounded-2xl text-slate-500 hover:bg-indigo-600 hover:text-white transition-all shadow-sm",children:n.jsx(wt,{size:20})})]}),n.jsxs("button",{onClick:()=>u("breakdown"),className:"w-full md:w-auto bg-indigo-600 hover:bg-indigo-700 text-white px-8 py-3.5 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all shadow-xl shadow-indigo-100 flex items-center justify-center gap-3",children:[n.jsx(Lc,{size:18})," Ver Relación de Gastos"]})]}),n.jsxs("div",{className:`bg-white rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden ${h?"no-print":""}`,children:[n.jsxs("div",{className:"p-8 lg:p-10 border-b border-slate-100 bg-slate-50/50",children:[n.jsxs("h3",{className:"text-2xl font-black text-slate-800 tracking-tight uppercase",children:["Monitor de Cobranza: ",Te[e.month]," ",e.year]}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest mt-1",children:"Sincronización en tiempo real con tesorería"})]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Unidad"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Titular / Propietario"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Detalle de Pago"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto $"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Estatus"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acción"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:L.map(M=>{const O=a.find(re=>re.id===M.propertyId),q=s.find(re=>re.propertyId===M.propertyId&&re.isOwner),z=M.pendingPayment!==null,J=Number((O==null?void 0:O.initialDebt)||0)>0;return n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-8 py-6",children:n.jsx("span",{className:"font-black text-slate-900 text-lg",children:O==null?void 0:O.code})}),n.jsx("td",{className:"px-8 py-6",children:n.jsx("p",{className:"text-sm font-bold text-slate-700 uppercase",children:(q==null?void 0:q.fullName)||"Sin Propietario"})}),n.jsx("td",{className:"px-8 py-6 text-center",children:n.jsxs("div",{className:"inline-flex flex-col items-center gap-1",children:[n.jsxs("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-tighter",children:["Cuota: $",sr(M.amountUsd)]}),(M.paidAmount||0)>0&&M.status!=="Pagado"&&n.jsxs("span",{className:"text-[9px] font-black text-amber-600 uppercase tracking-tighter",children:["Pendiente: $",sr(M.amountUsd-(M.paidAmount||0))]}),Number(M.previousDebt)>0&&Number(M.paidAmount)<Number(M.previousDebt)&&n.jsxs("span",{className:"text-[9px] font-black text-rose-600 uppercase tracking-tighter",children:["Deuda Ant: $",sr(Number(M.previousDebt)-Number(M.paidAmount))]})]})}),n.jsxs("td",{className:"px-8 py-6 text-right font-mono font-black text-slate-800 text-lg",children:["$",sr(M.amountUsd),J&&M.status!=="Pagado"&&n.jsx("span",{className:"block text-[8px] font-black text-red-600 bg-red-50 px-2 py-0.5 rounded-lg uppercase tracking-widest mt-1 animate-pulse",children:"Convenio Activo"})]}),n.jsx("td",{className:"px-8 py-6 text-center",children:z?n.jsx("span",{className:"px-4 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest bg-amber-50 text-amber-600 border border-amber-100 animate-pulse",children:"En Revisión"}):n.jsx("span",{className:`px-4 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest border ${M.status==="Pagado"?"bg-emerald-50 text-emerald-600 border-emerald-100":M.status==="Parcial"?"bg-amber-50 text-amber-600 border-amber-100":"bg-red-50 text-red-600 border-red-100"}`,children:M.status})}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[z&&B&&n.jsx("div",{className:"flex gap-2 animate-in zoom-in",children:n.jsxs("button",{onClick:()=>N(M),className:"p-3 bg-indigo-600 text-white rounded-xl shadow-lg hover:bg-indigo-700 transition-all flex items-center gap-2 font-black text-[9px] uppercase tracking-widest",title:"Verificar Reporte",children:[n.jsx(Kf,{size:18})," REVISAR"]})}),!z&&n.jsxs("div",{className:"flex justify-end gap-2",children:[M.payments&&M.payments.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>m(M),className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm",title:"Ver Recibo Sello",children:n.jsx(yr,{size:18})}),B&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>v({...M,payment:M.payments[0]}),className:"p-3 bg-amber-50 text-amber-600 rounded-xl hover:bg-amber-600 hover:text-white transition-all shadow-sm",title:"Modificar Pago",children:n.jsx(yl,{size:18})}),n.jsx("button",{onClick:()=>{confirm("¿Anular pago?")&&l(M.payments[M.payments.length-1].id)},className:"p-3 bg-red-50 text-red-600 rounded-xl hover:bg-red-600 hover:text-white transition-all shadow-sm",title:"Borrar Pago",children:n.jsx(Ua,{size:18})})]})]}),B&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>p(M),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg hover:bg-blue-700 transition-all active:scale-95",title:"Registrar Pago",children:n.jsx(Fp,{size:18})}),n.jsx("button",{onClick:()=>T(M),className:"p-3 bg-indigo-50 text-indigo-600 rounded-xl hover:bg-indigo-600 hover:text-white transition-all shadow-sm",title:"Agregar Cargo Extra",children:n.jsx(db,{size:18})})]})]})]})})]},M.id)})})]})})]}),_&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-8 lg:p-12 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300 border-2 border-indigo-100 flex flex-col relative max-h-[90vh] overflow-y-auto custom-scrollbar",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-indigo-600 rounded-2xl flex items-center justify-center text-white shadow-lg shadow-indigo-100",children:n.jsx(Kf,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black text-slate-900 tracking-tight uppercase",children:"Validación de Pago"}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest mt-1",children:["Unidad: ",(P=a.find(M=>M.id===_.propertyId))==null?void 0:P.code]})]})]}),n.jsx("button",{onClick:()=>N(null),className:"p-2 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(mt,{size:20})})]}),n.jsxs("div",{className:"space-y-6 flex-1",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-200 space-y-4 shadow-inner",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Monto Reportado:"}),n.jsxs("span",{className:"text-2xl font-black text-slate-900",children:["Bs. ",Fg((G=_.pendingPayment)==null?void 0:G.amountBs)]})]}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Abono Proyectado:"}),n.jsxs("span",{className:"text-lg font-black text-blue-600",children:["$",sr((Q=_.pendingPayment)==null?void 0:Q.amount)," USD"]})]}),n.jsx("div",{className:"h-px bg-slate-200 w-full"}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Referencia:"}),n.jsxs("span",{className:"font-mono font-black text-slate-800 bg-white px-3 py-1 rounded-lg",children:["#",(H=_.pendingPayment)==null?void 0:H.reference]})]}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Fecha Valor:"}),n.jsx("span",{className:"font-black text-slate-800",children:(X=_.pendingPayment)==null?void 0:X.date})]}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Método:"}),n.jsx("span",{className:"font-black text-slate-800 uppercase text-xs",children:(K=_.pendingPayment)==null?void 0:K.method})]})]}),n.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[n.jsxs("button",{disabled:y,onClick:()=>U(_),className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl flex items-center justify-center gap-3 transition-all active:scale-95 disabled:opacity-50",children:[y?n.jsx(ct,{className:"animate-spin"}):n.jsx(Kr,{size:18})," VALIDAR Y ASENTAR EN LIBROS"]}),n.jsxs("button",{disabled:y,onClick:()=>D(_),className:"w-full bg-red-50 text-red-600 py-4 rounded-2xl font-black text-xs uppercase tracking-widest border border-red-100 hover:bg-red-600 hover:text-white transition-all flex items-center justify-center gap-3 active:scale-95 disabled:opacity-50",children:[n.jsx(RM,{size:18})," RECHAZAR REPORTE"]})]})]})]})}),f&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[300] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300 border border-slate-100 relative max-h-[90vh] overflow-y-auto custom-scrollbar",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:B?"Carga de Pago":"Reporte de Pago"}),n.jsxs("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest mt-1",children:["Unidad: ",(ee=a.find(M=>M.id===f.propertyId))==null?void 0:ee.code]})]}),n.jsx("button",{onClick:()=>p(null),className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(mt,{size:24})})]}),n.jsx(k6,{feeId:e.id,propertyId:f.propertyId,feeRate:e.exchangeRate,currentBalance:Number(f.amountUsd)-(Number(f.paidAmount)||0),availableCredit:0,isOwnerReporting:!B,onSuccess:()=>p(null)})]})}),b&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[300] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300 border-2 border-amber-100 relative max-h-[90vh] overflow-y-auto custom-scrollbar",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-amber-600 tracking-tight",children:"Editar Transacción"}),n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mt-1",children:["Unidad: ",(W=a.find(M=>M.id===b.propertyId))==null?void 0:W.code]})]}),n.jsx("button",{onClick:()=>v(null),className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(mt,{size:24})})]}),n.jsx(k6,{feeId:e.id,propertyId:b.propertyId,feeRate:e.exchangeRate,currentBalance:Number(b.amountUsd)-(Number(b.paidAmount)||0)+Number(b.payment.amount),availableCredit:0,existingPayment:b.payment,onSuccess:()=>v(null)})]})}),h&&n.jsx(tue,{debt:h,property:a.find(M=>M.id===h.propertyId),onClose:()=>m(null)}),E&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl relative animate-in zoom-in-95 duration-300",children:[n.jsx("button",{onClick:()=>T(null),className:"absolute top-8 right-8 p-3 bg-slate-100 rounded-full text-slate-400 hover:bg-red-50 hover:text-red-500 transition-all",children:n.jsx(mt,{size:20})}),n.jsxs("div",{className:"mb-10",children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Cargo Extra"}),n.jsxs("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-[0.3em] mt-2",children:["Unidad: ",(Y=a.find(M=>M.id===E.propertyId))==null?void 0:Y.code]})]}),n.jsx(Zde,{feeId:e.id,propertyId:E.propertyId,feeRate:Number(e.exchangeRate),onSuccess:()=>T(null)})]})})]})},j6=({user:e,viewMode:t,onTabChange:r})=>{const[a,s]=k.useState(t),[i,l]=k.useState();return k.useEffect(()=>{s(t)},[t]),a==="generate"?n.jsx(Xde,{onCancel:()=>s("list"),existingFee:i,onTabChange:r}):n.jsx(Jde,{user:e,onEdit:o=>{l(o),s("generate")},onTabChange:r})};var lf={exports:{}},v2={},y2,E6;function aue(){if(E6)return y2;E6=1;function e(t,r){typeof r=="boolean"&&(r={forever:r}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=r||{},this._maxRetryTime=r&&r.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return y2=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var r=new Date().getTime();if(t&&r-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var a=this._timeouts.shift();if(a===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),a=this._cachedTimeouts.slice(-1);else return!1;var s=this;return this._timer=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},a),this._options.unref&&this._timer.unref(),!0},e.prototype.attempt=function(t,r){this._fn=t,r&&(r.timeout&&(this._operationTimeout=r.timeout),r.cb&&(this._operationTimeoutCb=r.cb));var a=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){a._operationTimeoutCb()},a._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},e.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},e.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},r=null,a=0,s=0;s<this._errors.length;s++){var i=this._errors[s],l=i.message,o=(t[l]||0)+1;t[l]=o,o>=a&&(r=i,a=o)}return r},y2}var S6;function nue(){return S6||(S6=1,(function(e){var t=aue();e.operation=function(r){var a=e.timeouts(r);return new t(a,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})},e.timeouts=function(r){if(r instanceof Array)return[].concat(r);var a={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var s in r)a[s]=r[s];if(a.minTimeout>a.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],l=0;l<a.retries;l++)i.push(this.createTimeout(l,a));return r&&r.forever&&!i.length&&i.push(this.createTimeout(l,a)),i.sort(function(o,d){return o-d}),i},e.createTimeout=function(r,a){var s=a.randomize?Math.random()+1:1,i=Math.round(s*Math.max(a.minTimeout,1)*Math.pow(a.factor,r));return i=Math.min(i,a.maxTimeout),i},e.wrap=function(r,a,s){if(a instanceof Array&&(s=a,a=null),!s){s=[];for(var i in r)typeof r[i]=="function"&&s.push(i)}for(var l=0;l<s.length;l++){var o=s[l],d=r[o];r[o]=(function(f){var p=e.operation(a),h=Array.prototype.slice.call(arguments,1),m=h.pop();h.push(function(b){p.retry(b)||(b&&(arguments[0]=p.mainError()),m.apply(this,arguments))}),p.attempt(function(){f.apply(r,h)})}).bind(r,d),r[o].options=a}}})(v2)),v2}var w2,B6;function sue(){return B6||(B6=1,w2=nue()),w2}var _6;function iue(){if(_6)return lf.exports;_6=1;const e=sue(),t=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class r extends Error{constructor(o){super(),o instanceof Error?(this.originalError=o,{message:o}=o):(this.originalError=new Error(o),this.originalError.stack=this.stack),this.name="AbortError",this.message=o}}const a=(l,o,d)=>{const u=d.retries-(o-1);return l.attemptNumber=o,l.retriesLeft=u,l},s=l=>t.includes(l),i=(l,o)=>new Promise((d,u)=>{o={onFailedAttempt:()=>{},retries:10,...o};const f=e.operation(o);f.attempt(async p=>{try{d(await l(p))}catch(h){if(!(h instanceof Error)){u(new TypeError(`Non-error was thrown: "${h}". You should only throw errors.`));return}if(h instanceof r)f.stop(),u(h.originalError);else if(h instanceof TypeError&&!s(h.message))f.stop(),u(h);else{a(h,p,o);try{await o.onFailedAttempt(h)}catch(m){u(m);return}f.retry(h)||u(f.mainError())}}})});return lf.exports=i,lf.exports.default=i,lf.exports.AbortError=r,lf.exports}var SL=iue();const lue=Sl(SL);var oue={};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */let cue,due;function uue(){return{geminiUrl:cue,vertexUrl:due}}function Aue(e,t,r,a){var s,i;if(!(e!=null&&e.baseUrl)){const l=uue();return t?(s=l.vertexUrl)!==null&&s!==void 0?s:r:(i=l.geminiUrl)!==null&&i!==void 0?i:a}return e.baseUrl}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Uo{}function et(e,t){const r=/\{([^}]+)\}/g;return e.replace(r,(a,s)=>{if(Object.prototype.hasOwnProperty.call(t,s)){const i=t[s];return i!=null?String(i):""}else throw new Error(`Key '${s}' not found in valueMap.`)})}function C(e,t,r){for(let i=0;i<t.length-1;i++){const l=t[i];if(l.endsWith("[]")){const o=l.slice(0,-2);if(!(o in e))if(Array.isArray(r))e[o]=Array.from({length:r.length},()=>({}));else throw new Error(`Value must be a list given an array path ${l}`);if(Array.isArray(e[o])){const d=e[o];if(Array.isArray(r))for(let u=0;u<d.length;u++){const f=d[u];C(f,t.slice(i+1),r[u])}else for(const u of d)C(u,t.slice(i+1),r)}return}else if(l.endsWith("[0]")){const o=l.slice(0,-3);o in e||(e[o]=[{}]);const d=e[o];C(d[0],t.slice(i+1),r);return}(!e[l]||typeof e[l]!="object")&&(e[l]={}),e=e[l]}const a=t[t.length-1],s=e[a];if(s!==void 0){if(!r||typeof r=="object"&&Object.keys(r).length===0||r===s)return;if(typeof s=="object"&&typeof r=="object"&&s!==null&&r!==null)Object.assign(s,r);else throw new Error(`Cannot set value for an existing key. Key: ${a}`)}else a==="_self"&&typeof r=="object"&&r!==null&&!Array.isArray(r)?Object.assign(e,r):e[a]=r}function w(e,t,r=void 0){try{if(t.length===1&&t[0]==="_self")return e;for(let a=0;a<t.length;a++){if(typeof e!="object"||e===null)return r;const s=t[a];if(s.endsWith("[]")){const i=s.slice(0,-2);if(i in e){const l=e[i];return Array.isArray(l)?l.map(o=>w(o,t.slice(a+1),r)):r}else return r}else e=e[s]}return e}catch(a){if(a instanceof TypeError)return r;throw a}}function fue(e,t){for(const[r,a]of Object.entries(t)){const s=r.split("."),i=a.split("."),l=new Set;let o=-1;for(let d=0;d<s.length;d++)if(s[d]==="*"){o=d;break}if(o!==-1&&i.length>o)for(let d=o;d<i.length;d++){const u=i[d];u!=="*"&&!u.endsWith("[]")&&!u.endsWith("[0]")&&l.add(u)}oC(e,s,i,0,l)}}function oC(e,t,r,a,s){if(a>=t.length||typeof e!="object"||e===null)return;const i=t[a];if(i.endsWith("[]")){const l=i.slice(0,-2),o=e;if(l in o&&Array.isArray(o[l]))for(const d of o[l])oC(d,t,r,a+1,s)}else if(i==="*"){if(typeof e=="object"&&e!==null&&!Array.isArray(e)){const l=e,o=Object.keys(l).filter(u=>!u.startsWith("_")&&!s.has(u)),d={};for(const u of o)d[u]=l[u];for(const[u,f]of Object.entries(d)){const p=[];for(const h of r.slice(a))h==="*"?p.push(u):p.push(h);C(l,p,f)}for(const u of o)delete l[u]}}else{const l=e;i in l&&oC(l[i],t,r,a+1,s)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Gj(e){if(typeof e!="string")throw new Error("fromImageBytes must be a string");return e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function pue(e){const t={},r=w(e,["operationName"]);r!=null&&C(t,["operationName"],r);const a=w(e,["resourceName"]);return a!=null&&C(t,["_url","resourceName"],a),t}function xue(e){const t={},r=w(e,["name"]);r!=null&&C(t,["name"],r);const a=w(e,["metadata"]);a!=null&&C(t,["metadata"],a);const s=w(e,["done"]);s!=null&&C(t,["done"],s);const i=w(e,["error"]);i!=null&&C(t,["error"],i);const l=w(e,["response","generateVideoResponse"]);return l!=null&&C(t,["response"],mue(l)),t}function hue(e){const t={},r=w(e,["name"]);r!=null&&C(t,["name"],r);const a=w(e,["metadata"]);a!=null&&C(t,["metadata"],a);const s=w(e,["done"]);s!=null&&C(t,["done"],s);const i=w(e,["error"]);i!=null&&C(t,["error"],i);const l=w(e,["response"]);return l!=null&&C(t,["response"],gue(l)),t}function mue(e){const t={},r=w(e,["generatedSamples"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(l=>bue(l))),C(t,["generatedVideos"],i)}const a=w(e,["raiMediaFilteredCount"]);a!=null&&C(t,["raiMediaFilteredCount"],a);const s=w(e,["raiMediaFilteredReasons"]);return s!=null&&C(t,["raiMediaFilteredReasons"],s),t}function gue(e){const t={},r=w(e,["videos"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(l=>vue(l))),C(t,["generatedVideos"],i)}const a=w(e,["raiMediaFilteredCount"]);a!=null&&C(t,["raiMediaFilteredCount"],a);const s=w(e,["raiMediaFilteredReasons"]);return s!=null&&C(t,["raiMediaFilteredReasons"],s),t}function bue(e){const t={},r=w(e,["video"]);return r!=null&&C(t,["video"],jue(r)),t}function vue(e){const t={},r=w(e,["_self"]);return r!=null&&C(t,["video"],Eue(r)),t}function yue(e){const t={},r=w(e,["operationName"]);return r!=null&&C(t,["_url","operationName"],r),t}function wue(e){const t={},r=w(e,["operationName"]);return r!=null&&C(t,["_url","operationName"],r),t}function Nue(e){const t={},r=w(e,["name"]);r!=null&&C(t,["name"],r);const a=w(e,["metadata"]);a!=null&&C(t,["metadata"],a);const s=w(e,["done"]);s!=null&&C(t,["done"],s);const i=w(e,["error"]);i!=null&&C(t,["error"],i);const l=w(e,["response"]);return l!=null&&C(t,["response"],Cue(l)),t}function Cue(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&C(t,["sdkHttpResponse"],r);const a=w(e,["parent"]);a!=null&&C(t,["parent"],a);const s=w(e,["documentName"]);return s!=null&&C(t,["documentName"],s),t}function BL(e){const t={},r=w(e,["name"]);r!=null&&C(t,["name"],r);const a=w(e,["metadata"]);a!=null&&C(t,["metadata"],a);const s=w(e,["done"]);s!=null&&C(t,["done"],s);const i=w(e,["error"]);i!=null&&C(t,["error"],i);const l=w(e,["response"]);return l!=null&&C(t,["response"],kue(l)),t}function kue(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&C(t,["sdkHttpResponse"],r);const a=w(e,["parent"]);a!=null&&C(t,["parent"],a);const s=w(e,["documentName"]);return s!=null&&C(t,["documentName"],s),t}function jue(e){const t={},r=w(e,["uri"]);r!=null&&C(t,["uri"],r);const a=w(e,["encodedVideo"]);a!=null&&C(t,["videoBytes"],Gj(a));const s=w(e,["encoding"]);return s!=null&&C(t,["mimeType"],s),t}function Eue(e){const t={},r=w(e,["gcsUri"]);r!=null&&C(t,["uri"],r);const a=w(e,["bytesBase64Encoded"]);a!=null&&C(t,["videoBytes"],Gj(a));const s=w(e,["mimeType"]);return s!=null&&C(t,["mimeType"],s),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var T6;(function(e){e.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",e.OUTCOME_OK="OUTCOME_OK",e.OUTCOME_FAILED="OUTCOME_FAILED",e.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(T6||(T6={}));var I6;(function(e){e.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",e.PYTHON="PYTHON"})(I6||(I6={}));var F6;(function(e){e.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",e.SILENT="SILENT",e.WHEN_IDLE="WHEN_IDLE",e.INTERRUPT="INTERRUPT"})(F6||(F6={}));var vc;(function(e){e.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",e.STRING="STRING",e.NUMBER="NUMBER",e.INTEGER="INTEGER",e.BOOLEAN="BOOLEAN",e.ARRAY="ARRAY",e.OBJECT="OBJECT",e.NULL="NULL"})(vc||(vc={}));var D6;(function(e){e.API_SPEC_UNSPECIFIED="API_SPEC_UNSPECIFIED",e.SIMPLE_SEARCH="SIMPLE_SEARCH",e.ELASTIC_SEARCH="ELASTIC_SEARCH"})(D6||(D6={}));var U6;(function(e){e.AUTH_TYPE_UNSPECIFIED="AUTH_TYPE_UNSPECIFIED",e.NO_AUTH="NO_AUTH",e.API_KEY_AUTH="API_KEY_AUTH",e.HTTP_BASIC_AUTH="HTTP_BASIC_AUTH",e.GOOGLE_SERVICE_ACCOUNT_AUTH="GOOGLE_SERVICE_ACCOUNT_AUTH",e.OAUTH="OAUTH",e.OIDC_AUTH="OIDC_AUTH"})(U6||(U6={}));var M6;(function(e){e.HTTP_IN_UNSPECIFIED="HTTP_IN_UNSPECIFIED",e.HTTP_IN_QUERY="HTTP_IN_QUERY",e.HTTP_IN_HEADER="HTTP_IN_HEADER",e.HTTP_IN_PATH="HTTP_IN_PATH",e.HTTP_IN_BODY="HTTP_IN_BODY",e.HTTP_IN_COOKIE="HTTP_IN_COOKIE"})(M6||(M6={}));var R6;(function(e){e.PHISH_BLOCK_THRESHOLD_UNSPECIFIED="PHISH_BLOCK_THRESHOLD_UNSPECIFIED",e.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",e.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",e.BLOCK_HIGH_AND_ABOVE="BLOCK_HIGH_AND_ABOVE",e.BLOCK_HIGHER_AND_ABOVE="BLOCK_HIGHER_AND_ABOVE",e.BLOCK_VERY_HIGH_AND_ABOVE="BLOCK_VERY_HIGH_AND_ABOVE",e.BLOCK_ONLY_EXTREMELY_HIGH="BLOCK_ONLY_EXTREMELY_HIGH"})(R6||(R6={}));var O6;(function(e){e.UNSPECIFIED="UNSPECIFIED",e.BLOCKING="BLOCKING",e.NON_BLOCKING="NON_BLOCKING"})(O6||(O6={}));var P6;(function(e){e.MODE_UNSPECIFIED="MODE_UNSPECIFIED",e.MODE_DYNAMIC="MODE_DYNAMIC"})(P6||(P6={}));var L6;(function(e){e.MODE_UNSPECIFIED="MODE_UNSPECIFIED",e.AUTO="AUTO",e.ANY="ANY",e.NONE="NONE",e.VALIDATED="VALIDATED"})(L6||(L6={}));var Q6;(function(e){e.THINKING_LEVEL_UNSPECIFIED="THINKING_LEVEL_UNSPECIFIED",e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH",e.MINIMAL="MINIMAL"})(Q6||(Q6={}));var H6;(function(e){e.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",e.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",e.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",e.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",e.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",e.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY",e.HARM_CATEGORY_IMAGE_HATE="HARM_CATEGORY_IMAGE_HATE",e.HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT="HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT",e.HARM_CATEGORY_IMAGE_HARASSMENT="HARM_CATEGORY_IMAGE_HARASSMENT",e.HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT="HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT",e.HARM_CATEGORY_JAILBREAK="HARM_CATEGORY_JAILBREAK"})(H6||(H6={}));var z6;(function(e){e.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",e.SEVERITY="SEVERITY",e.PROBABILITY="PROBABILITY"})(z6||(z6={}));var $6;(function(e){e.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",e.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",e.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",e.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",e.BLOCK_NONE="BLOCK_NONE",e.OFF="OFF"})($6||($6={}));var V6;(function(e){e.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",e.STOP="STOP",e.MAX_TOKENS="MAX_TOKENS",e.SAFETY="SAFETY",e.RECITATION="RECITATION",e.LANGUAGE="LANGUAGE",e.OTHER="OTHER",e.BLOCKLIST="BLOCKLIST",e.PROHIBITED_CONTENT="PROHIBITED_CONTENT",e.SPII="SPII",e.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",e.IMAGE_SAFETY="IMAGE_SAFETY",e.UNEXPECTED_TOOL_CALL="UNEXPECTED_TOOL_CALL",e.IMAGE_PROHIBITED_CONTENT="IMAGE_PROHIBITED_CONTENT",e.NO_IMAGE="NO_IMAGE",e.IMAGE_RECITATION="IMAGE_RECITATION",e.IMAGE_OTHER="IMAGE_OTHER"})(V6||(V6={}));var G6;(function(e){e.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",e.NEGLIGIBLE="NEGLIGIBLE",e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH"})(G6||(G6={}));var K6;(function(e){e.HARM_SEVERITY_UNSPECIFIED="HARM_SEVERITY_UNSPECIFIED",e.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",e.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",e.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",e.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH"})(K6||(K6={}));var q6;(function(e){e.URL_RETRIEVAL_STATUS_UNSPECIFIED="URL_RETRIEVAL_STATUS_UNSPECIFIED",e.URL_RETRIEVAL_STATUS_SUCCESS="URL_RETRIEVAL_STATUS_SUCCESS",e.URL_RETRIEVAL_STATUS_ERROR="URL_RETRIEVAL_STATUS_ERROR",e.URL_RETRIEVAL_STATUS_PAYWALL="URL_RETRIEVAL_STATUS_PAYWALL",e.URL_RETRIEVAL_STATUS_UNSAFE="URL_RETRIEVAL_STATUS_UNSAFE"})(q6||(q6={}));var W6;(function(e){e.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",e.SAFETY="SAFETY",e.OTHER="OTHER",e.BLOCKLIST="BLOCKLIST",e.PROHIBITED_CONTENT="PROHIBITED_CONTENT",e.IMAGE_SAFETY="IMAGE_SAFETY",e.MODEL_ARMOR="MODEL_ARMOR",e.JAILBREAK="JAILBREAK"})(W6||(W6={}));var Y6;(function(e){e.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",e.ON_DEMAND="ON_DEMAND",e.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(Y6||(Y6={}));var Dg;(function(e){e.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",e.TEXT="TEXT",e.IMAGE="IMAGE",e.AUDIO="AUDIO"})(Dg||(Dg={}));var X6;(function(e){e.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",e.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",e.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",e.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH"})(X6||(X6={}));var J6;(function(e){e.TUNING_MODE_UNSPECIFIED="TUNING_MODE_UNSPECIFIED",e.TUNING_MODE_FULL="TUNING_MODE_FULL",e.TUNING_MODE_PEFT_ADAPTER="TUNING_MODE_PEFT_ADAPTER"})(J6||(J6={}));var Z6;(function(e){e.ADAPTER_SIZE_UNSPECIFIED="ADAPTER_SIZE_UNSPECIFIED",e.ADAPTER_SIZE_ONE="ADAPTER_SIZE_ONE",e.ADAPTER_SIZE_TWO="ADAPTER_SIZE_TWO",e.ADAPTER_SIZE_FOUR="ADAPTER_SIZE_FOUR",e.ADAPTER_SIZE_EIGHT="ADAPTER_SIZE_EIGHT",e.ADAPTER_SIZE_SIXTEEN="ADAPTER_SIZE_SIXTEEN",e.ADAPTER_SIZE_THIRTY_TWO="ADAPTER_SIZE_THIRTY_TWO"})(Z6||(Z6={}));var cC;(function(e){e.JOB_STATE_UNSPECIFIED="JOB_STATE_UNSPECIFIED",e.JOB_STATE_QUEUED="JOB_STATE_QUEUED",e.JOB_STATE_PENDING="JOB_STATE_PENDING",e.JOB_STATE_RUNNING="JOB_STATE_RUNNING",e.JOB_STATE_SUCCEEDED="JOB_STATE_SUCCEEDED",e.JOB_STATE_FAILED="JOB_STATE_FAILED",e.JOB_STATE_CANCELLING="JOB_STATE_CANCELLING",e.JOB_STATE_CANCELLED="JOB_STATE_CANCELLED",e.JOB_STATE_PAUSED="JOB_STATE_PAUSED",e.JOB_STATE_EXPIRED="JOB_STATE_EXPIRED",e.JOB_STATE_UPDATING="JOB_STATE_UPDATING",e.JOB_STATE_PARTIALLY_SUCCEEDED="JOB_STATE_PARTIALLY_SUCCEEDED"})(cC||(cC={}));var e3;(function(e){e.TUNING_TASK_UNSPECIFIED="TUNING_TASK_UNSPECIFIED",e.TUNING_TASK_I2V="TUNING_TASK_I2V",e.TUNING_TASK_T2V="TUNING_TASK_T2V",e.TUNING_TASK_R2V="TUNING_TASK_R2V"})(e3||(e3={}));var t3;(function(e){e.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",e.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",e.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",e.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH",e.MEDIA_RESOLUTION_ULTRA_HIGH="MEDIA_RESOLUTION_ULTRA_HIGH"})(t3||(t3={}));var dC;(function(e){e.COLLECTION="COLLECTION"})(dC||(dC={}));var r3;(function(e){e.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",e.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",e.BALANCED="BALANCED",e.PRIORITIZE_COST="PRIORITIZE_COST"})(r3||(r3={}));var a3;(function(e){e.ENVIRONMENT_UNSPECIFIED="ENVIRONMENT_UNSPECIFIED",e.ENVIRONMENT_BROWSER="ENVIRONMENT_BROWSER"})(a3||(a3={}));var Ug;(function(e){e.PREDICT="PREDICT",e.EMBED_CONTENT="EMBED_CONTENT"})(Ug||(Ug={}));var n3;(function(e){e.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",e.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",e.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",e.BLOCK_NONE="BLOCK_NONE"})(n3||(n3={}));var s3;(function(e){e.DONT_ALLOW="DONT_ALLOW",e.ALLOW_ADULT="ALLOW_ADULT",e.ALLOW_ALL="ALLOW_ALL"})(s3||(s3={}));var i3;(function(e){e.auto="auto",e.en="en",e.ja="ja",e.ko="ko",e.hi="hi",e.zh="zh",e.pt="pt",e.es="es"})(i3||(i3={}));var l3;(function(e){e.MASK_MODE_DEFAULT="MASK_MODE_DEFAULT",e.MASK_MODE_USER_PROVIDED="MASK_MODE_USER_PROVIDED",e.MASK_MODE_BACKGROUND="MASK_MODE_BACKGROUND",e.MASK_MODE_FOREGROUND="MASK_MODE_FOREGROUND",e.MASK_MODE_SEMANTIC="MASK_MODE_SEMANTIC"})(l3||(l3={}));var o3;(function(e){e.CONTROL_TYPE_DEFAULT="CONTROL_TYPE_DEFAULT",e.CONTROL_TYPE_CANNY="CONTROL_TYPE_CANNY",e.CONTROL_TYPE_SCRIBBLE="CONTROL_TYPE_SCRIBBLE",e.CONTROL_TYPE_FACE_MESH="CONTROL_TYPE_FACE_MESH"})(o3||(o3={}));var c3;(function(e){e.SUBJECT_TYPE_DEFAULT="SUBJECT_TYPE_DEFAULT",e.SUBJECT_TYPE_PERSON="SUBJECT_TYPE_PERSON",e.SUBJECT_TYPE_ANIMAL="SUBJECT_TYPE_ANIMAL",e.SUBJECT_TYPE_PRODUCT="SUBJECT_TYPE_PRODUCT"})(c3||(c3={}));var d3;(function(e){e.EDIT_MODE_DEFAULT="EDIT_MODE_DEFAULT",e.EDIT_MODE_INPAINT_REMOVAL="EDIT_MODE_INPAINT_REMOVAL",e.EDIT_MODE_INPAINT_INSERTION="EDIT_MODE_INPAINT_INSERTION",e.EDIT_MODE_OUTPAINT="EDIT_MODE_OUTPAINT",e.EDIT_MODE_CONTROLLED_EDITING="EDIT_MODE_CONTROLLED_EDITING",e.EDIT_MODE_STYLE="EDIT_MODE_STYLE",e.EDIT_MODE_BGSWAP="EDIT_MODE_BGSWAP",e.EDIT_MODE_PRODUCT_IMAGE="EDIT_MODE_PRODUCT_IMAGE"})(d3||(d3={}));var u3;(function(e){e.FOREGROUND="FOREGROUND",e.BACKGROUND="BACKGROUND",e.PROMPT="PROMPT",e.SEMANTIC="SEMANTIC",e.INTERACTIVE="INTERACTIVE"})(u3||(u3={}));var A3;(function(e){e.ASSET="ASSET",e.STYLE="STYLE"})(A3||(A3={}));var f3;(function(e){e.INSERT="INSERT",e.REMOVE="REMOVE",e.REMOVE_STATIC="REMOVE_STATIC",e.OUTPAINT="OUTPAINT"})(f3||(f3={}));var p3;(function(e){e.OPTIMIZED="OPTIMIZED",e.LOSSLESS="LOSSLESS"})(p3||(p3={}));var x3;(function(e){e.SUPERVISED_FINE_TUNING="SUPERVISED_FINE_TUNING",e.PREFERENCE_TUNING="PREFERENCE_TUNING",e.DISTILLATION="DISTILLATION"})(x3||(x3={}));var h3;(function(e){e.STATE_UNSPECIFIED="STATE_UNSPECIFIED",e.STATE_PENDING="STATE_PENDING",e.STATE_ACTIVE="STATE_ACTIVE",e.STATE_FAILED="STATE_FAILED"})(h3||(h3={}));var m3;(function(e){e.STATE_UNSPECIFIED="STATE_UNSPECIFIED",e.PROCESSING="PROCESSING",e.ACTIVE="ACTIVE",e.FAILED="FAILED"})(m3||(m3={}));var g3;(function(e){e.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",e.UPLOADED="UPLOADED",e.GENERATED="GENERATED",e.REGISTERED="REGISTERED"})(g3||(g3={}));var b3;(function(e){e.TURN_COMPLETE_REASON_UNSPECIFIED="TURN_COMPLETE_REASON_UNSPECIFIED",e.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",e.RESPONSE_REJECTED="RESPONSE_REJECTED",e.NEED_MORE_INPUT="NEED_MORE_INPUT"})(b3||(b3={}));var v3;(function(e){e.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",e.TEXT="TEXT",e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.AUDIO="AUDIO",e.DOCUMENT="DOCUMENT"})(v3||(v3={}));var y3;(function(e){e.VAD_SIGNAL_TYPE_UNSPECIFIED="VAD_SIGNAL_TYPE_UNSPECIFIED",e.VAD_SIGNAL_TYPE_SOS="VAD_SIGNAL_TYPE_SOS",e.VAD_SIGNAL_TYPE_EOS="VAD_SIGNAL_TYPE_EOS"})(y3||(y3={}));var w3;(function(e){e.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",e.ACTIVITY_START="ACTIVITY_START",e.ACTIVITY_END="ACTIVITY_END"})(w3||(w3={}));var N3;(function(e){e.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",e.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",e.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(N3||(N3={}));var C3;(function(e){e.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",e.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",e.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(C3||(C3={}));var k3;(function(e){e.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",e.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",e.NO_INTERRUPTION="NO_INTERRUPTION"})(k3||(k3={}));var j3;(function(e){e.TURN_COVERAGE_UNSPECIFIED="TURN_COVERAGE_UNSPECIFIED",e.TURN_INCLUDES_ONLY_ACTIVITY="TURN_INCLUDES_ONLY_ACTIVITY",e.TURN_INCLUDES_ALL_INPUT="TURN_INCLUDES_ALL_INPUT"})(j3||(j3={}));var E3;(function(e){e.SCALE_UNSPECIFIED="SCALE_UNSPECIFIED",e.C_MAJOR_A_MINOR="C_MAJOR_A_MINOR",e.D_FLAT_MAJOR_B_FLAT_MINOR="D_FLAT_MAJOR_B_FLAT_MINOR",e.D_MAJOR_B_MINOR="D_MAJOR_B_MINOR",e.E_FLAT_MAJOR_C_MINOR="E_FLAT_MAJOR_C_MINOR",e.E_MAJOR_D_FLAT_MINOR="E_MAJOR_D_FLAT_MINOR",e.F_MAJOR_D_MINOR="F_MAJOR_D_MINOR",e.G_FLAT_MAJOR_E_FLAT_MINOR="G_FLAT_MAJOR_E_FLAT_MINOR",e.G_MAJOR_E_MINOR="G_MAJOR_E_MINOR",e.A_FLAT_MAJOR_F_MINOR="A_FLAT_MAJOR_F_MINOR",e.A_MAJOR_G_FLAT_MINOR="A_MAJOR_G_FLAT_MINOR",e.B_FLAT_MAJOR_G_MINOR="B_FLAT_MAJOR_G_MINOR",e.B_MAJOR_A_FLAT_MINOR="B_MAJOR_A_FLAT_MINOR"})(E3||(E3={}));var S3;(function(e){e.MUSIC_GENERATION_MODE_UNSPECIFIED="MUSIC_GENERATION_MODE_UNSPECIFIED",e.QUALITY="QUALITY",e.DIVERSITY="DIVERSITY",e.VOCALIZATION="VOCALIZATION"})(S3||(S3={}));var fA;(function(e){e.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",e.PLAY="PLAY",e.PAUSE="PAUSE",e.STOP="STOP",e.RESET_CONTEXT="RESET_CONTEXT"})(fA||(fA={}));class uC{constructor(t){const r={};for(const a of t.headers.entries())r[a[0]]=a[1];this.headers=r,this.responseInternal=t}json(){return this.responseInternal.json()}}class of{get text(){var t,r,a,s,i,l,o,d;if(((s=(a=(r=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||r===void 0?void 0:r.content)===null||a===void 0?void 0:a.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning text from the first one.");let u="",f=!1;const p=[];for(const h of(d=(o=(l=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||l===void 0?void 0:l.content)===null||o===void 0?void 0:o.parts)!==null&&d!==void 0?d:[]){for(const[m,b]of Object.entries(h))m!=="text"&&m!=="thought"&&m!=="thoughtSignature"&&(b!==null||b!==void 0)&&p.push(m);if(typeof h.text=="string"){if(typeof h.thought=="boolean"&&h.thought)continue;f=!0,u+=h.text}}return p.length>0&&console.warn(`there are non-text parts ${p} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),f?u:void 0}get data(){var t,r,a,s,i,l,o,d;if(((s=(a=(r=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||r===void 0?void 0:r.content)===null||a===void 0?void 0:a.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning data from the first one.");let u="";const f=[];for(const p of(d=(o=(l=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||l===void 0?void 0:l.content)===null||o===void 0?void 0:o.parts)!==null&&d!==void 0?d:[]){for(const[h,m]of Object.entries(p))h!=="inlineData"&&(m!==null||m!==void 0)&&f.push(h);p.inlineData&&typeof p.inlineData.data=="string"&&(u+=atob(p.inlineData.data))}return f.length>0&&console.warn(`there are non-data parts ${f} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),u.length>0?btoa(u):void 0}get functionCalls(){var t,r,a,s,i,l,o,d;if(((s=(a=(r=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||r===void 0?void 0:r.content)===null||a===void 0?void 0:a.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning function calls from the first one.");const u=(d=(o=(l=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||l===void 0?void 0:l.content)===null||o===void 0?void 0:o.parts)===null||d===void 0?void 0:d.filter(f=>f.functionCall).map(f=>f.functionCall).filter(f=>f!==void 0);if((u==null?void 0:u.length)!==0)return u}get executableCode(){var t,r,a,s,i,l,o,d,u;if(((s=(a=(r=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||r===void 0?void 0:r.content)===null||a===void 0?void 0:a.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning executable code from the first one.");const f=(d=(o=(l=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||l===void 0?void 0:l.content)===null||o===void 0?void 0:o.parts)===null||d===void 0?void 0:d.filter(p=>p.executableCode).map(p=>p.executableCode).filter(p=>p!==void 0);if((f==null?void 0:f.length)!==0)return(u=f==null?void 0:f[0])===null||u===void 0?void 0:u.code}get codeExecutionResult(){var t,r,a,s,i,l,o,d,u;if(((s=(a=(r=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||r===void 0?void 0:r.content)===null||a===void 0?void 0:a.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning code execution result from the first one.");const f=(d=(o=(l=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||l===void 0?void 0:l.content)===null||o===void 0?void 0:o.parts)===null||d===void 0?void 0:d.filter(p=>p.codeExecutionResult).map(p=>p.codeExecutionResult).filter(p=>p!==void 0);if((f==null?void 0:f.length)!==0)return(u=f==null?void 0:f[0])===null||u===void 0?void 0:u.output}}class B3{}class _3{}class Sue{}class Bue{}class _ue{}class Tue{}class T3{}class I3{}class F3{}class Iue{}class Mg{_fromAPIResponse({apiResponse:t,_isVertexAI:r}){const a=new Mg;let s;const i=t;return r?s=hue(i):s=xue(i),Object.assign(a,s),a}}class D3{}class U3{}class M3{}class R3{}class Fue{}class Due{}class Uue{}class Kj{_fromAPIResponse({apiResponse:t,_isVertexAI:r}){const a=new Kj,i=Nue(t);return Object.assign(a,i),a}}class Mue{}class Rue{}class Oue{}class Pue{}class O3{}class Lue{get text(){var t,r,a;let s="",i=!1;const l=[];for(const o of(a=(r=(t=this.serverContent)===null||t===void 0?void 0:t.modelTurn)===null||r===void 0?void 0:r.parts)!==null&&a!==void 0?a:[]){for(const[d,u]of Object.entries(o))d!=="text"&&d!=="thought"&&u!==null&&l.push(d);if(typeof o.text=="string"){if(typeof o.thought=="boolean"&&o.thought)continue;i=!0,s+=o.text}}return l.length>0&&console.warn(`there are non-text parts ${l} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),i?s:void 0}get data(){var t,r,a;let s="";const i=[];for(const l of(a=(r=(t=this.serverContent)===null||t===void 0?void 0:t.modelTurn)===null||r===void 0?void 0:r.parts)!==null&&a!==void 0?a:[]){for(const[o,d]of Object.entries(l))o!=="inlineData"&&d!==null&&i.push(o);l.inlineData&&typeof l.inlineData.data=="string"&&(s+=atob(l.inlineData.data))}return i.length>0&&console.warn(`there are non-data parts ${i} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),s.length>0?btoa(s):void 0}}class Que{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}}class qj{_fromAPIResponse({apiResponse:t,_isVertexAI:r}){const a=new qj,i=BL(t);return Object.assign(a,i),a}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function rr(e,t){if(!t||typeof t!="string")throw new Error("model is required and must be a string");if(t.includes("..")||t.includes("?")||t.includes("&"))throw new Error("invalid model parameter");if(e.isVertexAI()){if(t.startsWith("publishers/")||t.startsWith("projects/")||t.startsWith("models/"))return t;if(t.indexOf("/")>=0){const r=t.split("/",2);return`publishers/${r[0]}/models/${r[1]}`}else return`publishers/google/models/${t}`}else return t.startsWith("models/")||t.startsWith("tunedModels/")?t:`models/${t}`}function _L(e,t){const r=rr(e,t);return r?r.startsWith("publishers/")&&e.isVertexAI()?`projects/${e.getProject()}/locations/${e.getLocation()}/${r}`:r.startsWith("models/")&&e.isVertexAI()?`projects/${e.getProject()}/locations/${e.getLocation()}/publishers/google/${r}`:r:""}function TL(e){return Array.isArray(e)?e.map(t=>Rg(t)):[Rg(e)]}function Rg(e){if(typeof e=="object"&&e!==null)return e;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof e}`)}function IL(e){const t=Rg(e);if(t.mimeType&&t.mimeType.startsWith("image/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function FL(e){const t=Rg(e);if(t.mimeType&&t.mimeType.startsWith("audio/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function P3(e){if(e==null)throw new Error("PartUnion is required");if(typeof e=="object")return e;if(typeof e=="string")return{text:e};throw new Error(`Unsupported part type: ${typeof e}`)}function DL(e){if(e==null||Array.isArray(e)&&e.length===0)throw new Error("PartListUnion is required");return Array.isArray(e)?e.map(t=>P3(t)):[P3(e)]}function AC(e){return e!=null&&typeof e=="object"&&"parts"in e&&Array.isArray(e.parts)}function L3(e){return e!=null&&typeof e=="object"&&"functionCall"in e}function Q3(e){return e!=null&&typeof e=="object"&&"functionResponse"in e}function tn(e){if(e==null)throw new Error("ContentUnion is required");return AC(e)?e:{role:"user",parts:DL(e)}}function Wj(e,t){if(!t)return[];if(e.isVertexAI()&&Array.isArray(t))return t.flatMap(r=>{const a=tn(r);return a.parts&&a.parts.length>0&&a.parts[0].text!==void 0?[a.parts[0].text]:[]});if(e.isVertexAI()){const r=tn(t);return r.parts&&r.parts.length>0&&r.parts[0].text!==void 0?[r.parts[0].text]:[]}return Array.isArray(t)?t.map(r=>tn(r)):[tn(t)]}function Ls(e){if(e==null||Array.isArray(e)&&e.length===0)throw new Error("contents are required");if(!Array.isArray(e)){if(L3(e)||Q3(e))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[tn(e)]}const t=[],r=[],a=AC(e[0]);for(const s of e){const i=AC(s);if(i!=a)throw new Error("Mixing Content and Parts is not supported, please group the parts into a the appropriate Content objects and specify the roles for them");if(i)t.push(s);else{if(L3(s)||Q3(s))throw new Error("To specify functionCall or functionResponse parts, please wrap them, and any other parts, in Content objects as appropriate, specifying the role for them");r.push(s)}}return a||t.push({role:"user",parts:DL(r)}),t}function Hue(e,t){e.includes("null")&&(t.nullable=!0);const r=e.filter(a=>a!=="null");if(r.length===1)t.type=Object.values(vc).includes(r[0].toUpperCase())?r[0].toUpperCase():vc.TYPE_UNSPECIFIED;else{t.anyOf=[];for(const a of r)t.anyOf.push({type:Object.values(vc).includes(a.toUpperCase())?a.toUpperCase():vc.TYPE_UNSPECIFIED})}}function bA(e){const t={},r=["items"],a=["anyOf"],s=["properties"];if(e.type&&e.anyOf)throw new Error("type and anyOf cannot be both populated.");const i=e.anyOf;i!=null&&i.length==2&&(i[0].type==="null"?(t.nullable=!0,e=i[1]):i[1].type==="null"&&(t.nullable=!0,e=i[0])),e.type instanceof Array&&Hue(e.type,t);for(const[l,o]of Object.entries(e))if(o!=null)if(l=="type"){if(o==="null")throw new Error("type: null can not be the only possible type for the field.");if(o instanceof Array)continue;t.type=Object.values(vc).includes(o.toUpperCase())?o.toUpperCase():vc.TYPE_UNSPECIFIED}else if(r.includes(l))t[l]=bA(o);else if(a.includes(l)){const d=[];for(const u of o){if(u.type=="null"){t.nullable=!0;continue}d.push(bA(u))}t[l]=d}else if(s.includes(l)){const d={};for(const[u,f]of Object.entries(o))d[u]=bA(f);t[l]=d}else{if(l==="additionalProperties")continue;t[l]=o}return t}function Yj(e){return bA(e)}function Xj(e){if(typeof e=="object")return e;if(typeof e=="string")return{voiceConfig:{prebuiltVoiceConfig:{voiceName:e}}};throw new Error(`Unsupported speechConfig type: ${typeof e}`)}function Jj(e){if("multiSpeakerVoiceConfig"in e)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return e}function ZA(e){if(e.functionDeclarations)for(const t of e.functionDeclarations)t.parameters&&(Object.keys(t.parameters).includes("$schema")?t.parametersJsonSchema||(t.parametersJsonSchema=t.parameters,delete t.parameters):t.parameters=bA(t.parameters)),t.response&&(Object.keys(t.response).includes("$schema")?t.responseJsonSchema||(t.responseJsonSchema=t.response,delete t.response):t.response=bA(t.response));return e}function e0(e){if(e==null)throw new Error("tools is required");if(!Array.isArray(e))throw new Error("tools is required and must be an array of Tools");const t=[];for(const r of e)t.push(r);return t}function zue(e,t,r,a=1){const s=!t.startsWith(`${r}/`)&&t.split("/").length===a;return e.isVertexAI()?t.startsWith("projects/")?t:t.startsWith("locations/")?`projects/${e.getProject()}/${t}`:t.startsWith(`${r}/`)?`projects/${e.getProject()}/locations/${e.getLocation()}/${t}`:s?`projects/${e.getProject()}/locations/${e.getLocation()}/${r}/${t}`:t:s?`${r}/${t}`:t}function Mo(e,t){if(typeof t!="string")throw new Error("name must be a string");return zue(e,t,"cachedContents")}function UL(e){switch(e){case"STATE_UNSPECIFIED":return"JOB_STATE_UNSPECIFIED";case"CREATING":return"JOB_STATE_RUNNING";case"ACTIVE":return"JOB_STATE_SUCCEEDED";case"FAILED":return"JOB_STATE_FAILED";default:return e}}function Vc(e){return Gj(e)}function $ue(e){return e!=null&&typeof e=="object"&&"name"in e}function Vue(e){return e!=null&&typeof e=="object"&&"video"in e}function Gue(e){return e!=null&&typeof e=="object"&&"uri"in e}function ML(e){var t;let r;if($ue(e)&&(r=e.name),!(Gue(e)&&(r=e.uri,r===void 0))&&!(Vue(e)&&(r=(t=e.video)===null||t===void 0?void 0:t.uri,r===void 0))){if(typeof e=="string"&&(r=e),r===void 0)throw new Error("Could not extract file name from the provided input.");if(r.startsWith("https://")){const s=r.split("files/")[1].match(/[a-z0-9]+/);if(s===null)throw new Error(`Could not extract file name from URI ${r}`);r=s[0]}else r.startsWith("files/")&&(r=r.split("files/")[1]);return r}}function RL(e,t){let r;return e.isVertexAI()?r=t?"publishers/google/models":"models":r=t?"models":"tunedModels",r}function OL(e){for(const t of["models","tunedModels","publisherModels"])if(Kue(e,t))return e[t];return[]}function Kue(e,t){return e!==null&&typeof e=="object"&&t in e}function que(e,t={}){const r=e,a={name:r.name,description:r.description,parametersJsonSchema:r.inputSchema};return r.outputSchema&&(a.responseJsonSchema=r.outputSchema),t.behavior&&(a.behavior=t.behavior),{functionDeclarations:[a]}}function Wue(e,t={}){const r=[],a=new Set;for(const s of e){const i=s.name;if(a.has(i))throw new Error(`Duplicate function name ${i} found in MCP tools. Please ensure function names are unique.`);a.add(i);const l=que(s,t);l.functionDeclarations&&r.push(...l.functionDeclarations)}return{functionDeclarations:r}}function PL(e,t){let r;if(typeof t=="string")if(e.isVertexAI())if(t.startsWith("gs://"))r={format:"jsonl",gcsUri:[t]};else if(t.startsWith("bq://"))r={format:"bigquery",bigqueryUri:t};else throw new Error(`Unsupported string source for Vertex AI: ${t}`);else if(t.startsWith("files/"))r={fileName:t};else throw new Error(`Unsupported string source for Gemini API: ${t}`);else if(Array.isArray(t)){if(e.isVertexAI())throw new Error("InlinedRequest[] is not supported in Vertex AI.");r={inlinedRequests:t}}else r=t;const a=[r.gcsUri,r.bigqueryUri].filter(Boolean).length,s=[r.inlinedRequests,r.fileName].filter(Boolean).length;if(e.isVertexAI()){if(s>0||a!==1)throw new Error("Exactly one of `gcsUri` or `bigqueryUri` must be set for Vertex AI.")}else if(a>0||s!==1)throw new Error("Exactly one of `inlinedRequests`, `fileName`, must be set for Gemini API.");return r}function Yue(e){if(typeof e!="string")return e;const t=e;if(t.startsWith("gs://"))return{format:"jsonl",gcsUri:t};if(t.startsWith("bq://"))return{format:"bigquery",bigqueryUri:t};throw new Error(`Unsupported destination: ${t}`)}function LL(e){if(typeof e!="object"||e===null)return{};const t=e,r=t.inlinedResponses;if(typeof r!="object"||r===null)return e;const s=r.inlinedResponses;if(!Array.isArray(s)||s.length===0)return e;let i=!1;for(const l of s){if(typeof l!="object"||l===null)continue;const d=l.response;if(typeof d!="object"||d===null)continue;if(d.embedding!==void 0){i=!0;break}}return i&&(t.inlinedEmbedContentResponses=t.inlinedResponses,delete t.inlinedResponses),e}function t0(e,t){const r=t;if(!e.isVertexAI()){if(/batches\/[^/]+$/.test(r))return r.split("/").pop();throw new Error(`Invalid batch job name: ${r}.`)}if(/^projects\/[^/]+\/locations\/[^/]+\/batchPredictionJobs\/[^/]+$/.test(r))return r.split("/").pop();if(/^\d+$/.test(r))return r;throw new Error(`Invalid batch job name: ${r}.`)}function QL(e){const t=e;return t==="BATCH_STATE_UNSPECIFIED"?"JOB_STATE_UNSPECIFIED":t==="BATCH_STATE_PENDING"?"JOB_STATE_PENDING":t==="BATCH_STATE_RUNNING"?"JOB_STATE_RUNNING":t==="BATCH_STATE_SUCCEEDED"?"JOB_STATE_SUCCEEDED":t==="BATCH_STATE_FAILED"?"JOB_STATE_FAILED":t==="BATCH_STATE_CANCELLED"?"JOB_STATE_CANCELLED":t==="BATCH_STATE_EXPIRED"?"JOB_STATE_EXPIRED":t}function Xue(e){return e.includes("gemini")&&e!=="gemini-embedding-001"||e.includes("maas")}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Jue(e){const t={},r=w(e,["responsesFile"]);r!=null&&C(t,["fileName"],r);const a=w(e,["inlinedResponses","inlinedResponses"]);if(a!=null){let i=a;Array.isArray(i)&&(i=i.map(l=>IAe(l))),C(t,["inlinedResponses"],i)}const s=w(e,["inlinedEmbedContentResponses","inlinedResponses"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),C(t,["inlinedEmbedContentResponses"],i)}return t}function Zue(e){const t={},r=w(e,["predictionsFormat"]);r!=null&&C(t,["format"],r);const a=w(e,["gcsDestination","outputUriPrefix"]);a!=null&&C(t,["gcsUri"],a);const s=w(e,["bigqueryDestination","outputUri"]);return s!=null&&C(t,["bigqueryUri"],s),t}function eAe(e){const t={},r=w(e,["format"]);r!=null&&C(t,["predictionsFormat"],r);const a=w(e,["gcsUri"]);a!=null&&C(t,["gcsDestination","outputUriPrefix"],a);const s=w(e,["bigqueryUri"]);if(s!=null&&C(t,["bigqueryDestination","outputUri"],s),w(e,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(w(e,["inlinedResponses"])!==void 0)throw new Error("inlinedResponses parameter is not supported in Vertex AI.");if(w(e,["inlinedEmbedContentResponses"])!==void 0)throw new Error("inlinedEmbedContentResponses parameter is not supported in Vertex AI.");return t}function Dm(e){const t={},r=w(e,["name"]);r!=null&&C(t,["name"],r);const a=w(e,["metadata","displayName"]);a!=null&&C(t,["displayName"],a);const s=w(e,["metadata","state"]);s!=null&&C(t,["state"],QL(s));const i=w(e,["metadata","createTime"]);i!=null&&C(t,["createTime"],i);const l=w(e,["metadata","endTime"]);l!=null&&C(t,["endTime"],l);const o=w(e,["metadata","updateTime"]);o!=null&&C(t,["updateTime"],o);const d=w(e,["metadata","model"]);d!=null&&C(t,["model"],d);const u=w(e,["metadata","output"]);return u!=null&&C(t,["dest"],Jue(LL(u))),t}function fC(e){const t={},r=w(e,["name"]);r!=null&&C(t,["name"],r);const a=w(e,["displayName"]);a!=null&&C(t,["displayName"],a);const s=w(e,["state"]);s!=null&&C(t,["state"],QL(s));const i=w(e,["error"]);i!=null&&C(t,["error"],i);const l=w(e,["createTime"]);l!=null&&C(t,["createTime"],l);const o=w(e,["startTime"]);o!=null&&C(t,["startTime"],o);const d=w(e,["endTime"]);d!=null&&C(t,["endTime"],d);const u=w(e,["updateTime"]);u!=null&&C(t,["updateTime"],u);const f=w(e,["model"]);f!=null&&C(t,["model"],f);const p=w(e,["inputConfig"]);p!=null&&C(t,["src"],tAe(p));const h=w(e,["outputConfig"]);h!=null&&C(t,["dest"],Zue(LL(h)));const m=w(e,["completionStats"]);return m!=null&&C(t,["completionStats"],m),t}function tAe(e){const t={},r=w(e,["instancesFormat"]);r!=null&&C(t,["format"],r);const a=w(e,["gcsSource","uris"]);a!=null&&C(t,["gcsUri"],a);const s=w(e,["bigquerySource","inputUri"]);return s!=null&&C(t,["bigqueryUri"],s),t}function rAe(e,t){const r={};if(w(t,["format"])!==void 0)throw new Error("format parameter is not supported in Gemini API.");if(w(t,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(w(t,["bigqueryUri"])!==void 0)throw new Error("bigqueryUri parameter is not supported in Gemini API.");const a=w(t,["fileName"]);a!=null&&C(r,["fileName"],a);const s=w(t,["inlinedRequests"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>TAe(e,l))),C(r,["requests","requests"],i)}return r}function aAe(e){const t={},r=w(e,["format"]);r!=null&&C(t,["instancesFormat"],r);const a=w(e,["gcsUri"]);a!=null&&C(t,["gcsSource","uris"],a);const s=w(e,["bigqueryUri"]);if(s!=null&&C(t,["bigquerySource","inputUri"],s),w(e,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(w(e,["inlinedRequests"])!==void 0)throw new Error("inlinedRequests parameter is not supported in Vertex AI.");return t}function nAe(e){const t={},r=w(e,["data"]);if(r!=null&&C(t,["data"],r),w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=w(e,["mimeType"]);return a!=null&&C(t,["mimeType"],a),t}function sAe(e,t){const r={},a=w(t,["name"]);return a!=null&&C(r,["_url","name"],t0(e,a)),r}function iAe(e,t){const r={},a=w(t,["name"]);return a!=null&&C(r,["_url","name"],t0(e,a)),r}function lAe(e){const t={},r=w(e,["content"]);r!=null&&C(t,["content"],r);const a=w(e,["citationMetadata"]);a!=null&&C(t,["citationMetadata"],oAe(a));const s=w(e,["tokenCount"]);s!=null&&C(t,["tokenCount"],s);const i=w(e,["finishReason"]);i!=null&&C(t,["finishReason"],i);const l=w(e,["avgLogprobs"]);l!=null&&C(t,["avgLogprobs"],l);const o=w(e,["groundingMetadata"]);o!=null&&C(t,["groundingMetadata"],o);const d=w(e,["index"]);d!=null&&C(t,["index"],d);const u=w(e,["logprobsResult"]);u!=null&&C(t,["logprobsResult"],u);const f=w(e,["safetyRatings"]);if(f!=null){let h=f;Array.isArray(h)&&(h=h.map(m=>m)),C(t,["safetyRatings"],h)}const p=w(e,["urlContextMetadata"]);return p!=null&&C(t,["urlContextMetadata"],p),t}function oAe(e){const t={},r=w(e,["citationSources"]);if(r!=null){let a=r;Array.isArray(a)&&(a=a.map(s=>s)),C(t,["citations"],a)}return t}function HL(e){const t={},r=w(e,["parts"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>PAe(i))),C(t,["parts"],s)}const a=w(e,["role"]);return a!=null&&C(t,["role"],a),t}function cAe(e,t){const r={},a=w(e,["displayName"]);if(t!==void 0&&a!=null&&C(t,["batch","displayName"],a),w(e,["dest"])!==void 0)throw new Error("dest parameter is not supported in Gemini API.");return r}function dAe(e,t){const r={},a=w(e,["displayName"]);t!==void 0&&a!=null&&C(t,["displayName"],a);const s=w(e,["dest"]);return t!==void 0&&s!=null&&C(t,["outputConfig"],eAe(Yue(s))),r}function H3(e,t){const r={},a=w(t,["model"]);a!=null&&C(r,["_url","model"],rr(e,a));const s=w(t,["src"]);s!=null&&C(r,["batch","inputConfig"],rAe(e,PL(e,s)));const i=w(t,["config"]);return i!=null&&cAe(i,r),r}function uAe(e,t){const r={},a=w(t,["model"]);a!=null&&C(r,["model"],rr(e,a));const s=w(t,["src"]);s!=null&&C(r,["inputConfig"],aAe(PL(e,s)));const i=w(t,["config"]);return i!=null&&dAe(i,r),r}function AAe(e,t){const r={},a=w(e,["displayName"]);return t!==void 0&&a!=null&&C(t,["batch","displayName"],a),r}function fAe(e,t){const r={},a=w(t,["model"]);a!=null&&C(r,["_url","model"],rr(e,a));const s=w(t,["src"]);s!=null&&C(r,["batch","inputConfig"],vAe(e,s));const i=w(t,["config"]);return i!=null&&AAe(i,r),r}function pAe(e,t){const r={},a=w(t,["name"]);return a!=null&&C(r,["_url","name"],t0(e,a)),r}function xAe(e,t){const r={},a=w(t,["name"]);return a!=null&&C(r,["_url","name"],t0(e,a)),r}function hAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&C(t,["sdkHttpResponse"],r);const a=w(e,["name"]);a!=null&&C(t,["name"],a);const s=w(e,["done"]);s!=null&&C(t,["done"],s);const i=w(e,["error"]);return i!=null&&C(t,["error"],i),t}function mAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&C(t,["sdkHttpResponse"],r);const a=w(e,["name"]);a!=null&&C(t,["name"],a);const s=w(e,["done"]);s!=null&&C(t,["done"],s);const i=w(e,["error"]);return i!=null&&C(t,["error"],i),t}function gAe(e,t){const r={},a=w(t,["contents"]);if(a!=null){let i=Wj(e,a);Array.isArray(i)&&(i=i.map(l=>l)),C(r,["requests[]","request","content"],i)}const s=w(t,["config"]);return s!=null&&(C(r,["_self"],bAe(s,r)),fue(r,{"requests[].*":"requests[].request.*"})),r}function bAe(e,t){const r={},a=w(e,["taskType"]);t!==void 0&&a!=null&&C(t,["requests[]","taskType"],a);const s=w(e,["title"]);t!==void 0&&s!=null&&C(t,["requests[]","title"],s);const i=w(e,["outputDimensionality"]);if(t!==void 0&&i!=null&&C(t,["requests[]","outputDimensionality"],i),w(e,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(w(e,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return r}function vAe(e,t){const r={},a=w(t,["fileName"]);a!=null&&C(r,["file_name"],a);const s=w(t,["inlinedRequests"]);return s!=null&&C(r,["requests"],gAe(e,s)),r}function yAe(e){const t={};if(w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const r=w(e,["fileUri"]);r!=null&&C(t,["fileUri"],r);const a=w(e,["mimeType"]);return a!=null&&C(t,["mimeType"],a),t}function wAe(e){const t={},r=w(e,["id"]);r!=null&&C(t,["id"],r);const a=w(e,["args"]);a!=null&&C(t,["args"],a);const s=w(e,["name"]);if(s!=null&&C(t,["name"],s),w(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(w(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function NAe(e){const t={},r=w(e,["allowedFunctionNames"]);r!=null&&C(t,["allowedFunctionNames"],r);const a=w(e,["mode"]);if(a!=null&&C(t,["mode"],a),w(e,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function CAe(e,t,r){const a={},s=w(t,["systemInstruction"]);r!==void 0&&s!=null&&C(r,["systemInstruction"],HL(tn(s)));const i=w(t,["temperature"]);i!=null&&C(a,["temperature"],i);const l=w(t,["topP"]);l!=null&&C(a,["topP"],l);const o=w(t,["topK"]);o!=null&&C(a,["topK"],o);const d=w(t,["candidateCount"]);d!=null&&C(a,["candidateCount"],d);const u=w(t,["maxOutputTokens"]);u!=null&&C(a,["maxOutputTokens"],u);const f=w(t,["stopSequences"]);f!=null&&C(a,["stopSequences"],f);const p=w(t,["responseLogprobs"]);p!=null&&C(a,["responseLogprobs"],p);const h=w(t,["logprobs"]);h!=null&&C(a,["logprobs"],h);const m=w(t,["presencePenalty"]);m!=null&&C(a,["presencePenalty"],m);const b=w(t,["frequencyPenalty"]);b!=null&&C(a,["frequencyPenalty"],b);const v=w(t,["seed"]);v!=null&&C(a,["seed"],v);const y=w(t,["responseMimeType"]);y!=null&&C(a,["responseMimeType"],y);const j=w(t,["responseSchema"]);j!=null&&C(a,["responseSchema"],Yj(j));const _=w(t,["responseJsonSchema"]);if(_!=null&&C(a,["responseJsonSchema"],_),w(t,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(w(t,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const N=w(t,["safetySettings"]);if(r!==void 0&&N!=null){let G=N;Array.isArray(G)&&(G=G.map(Q=>LAe(Q))),C(r,["safetySettings"],G)}const E=w(t,["tools"]);if(r!==void 0&&E!=null){let G=e0(E);Array.isArray(G)&&(G=G.map(Q=>HAe(ZA(Q)))),C(r,["tools"],G)}const T=w(t,["toolConfig"]);if(r!==void 0&&T!=null&&C(r,["toolConfig"],QAe(T)),w(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const B=w(t,["cachedContent"]);r!==void 0&&B!=null&&C(r,["cachedContent"],Mo(e,B));const F=w(t,["responseModalities"]);F!=null&&C(a,["responseModalities"],F);const R=w(t,["mediaResolution"]);R!=null&&C(a,["mediaResolution"],R);const U=w(t,["speechConfig"]);if(U!=null&&C(a,["speechConfig"],Xj(U)),w(t,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const D=w(t,["thinkingConfig"]);D!=null&&C(a,["thinkingConfig"],D);const L=w(t,["imageConfig"]);L!=null&&C(a,["imageConfig"],_Ae(L));const P=w(t,["enableEnhancedCivicAnswers"]);if(P!=null&&C(a,["enableEnhancedCivicAnswers"],P),w(t,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");return a}function kAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&C(t,["sdkHttpResponse"],r);const a=w(e,["candidates"]);if(a!=null){let d=a;Array.isArray(d)&&(d=d.map(u=>lAe(u))),C(t,["candidates"],d)}const s=w(e,["modelVersion"]);s!=null&&C(t,["modelVersion"],s);const i=w(e,["promptFeedback"]);i!=null&&C(t,["promptFeedback"],i);const l=w(e,["responseId"]);l!=null&&C(t,["responseId"],l);const o=w(e,["usageMetadata"]);return o!=null&&C(t,["usageMetadata"],o),t}function jAe(e,t){const r={},a=w(t,["name"]);return a!=null&&C(r,["_url","name"],t0(e,a)),r}function EAe(e,t){const r={},a=w(t,["name"]);return a!=null&&C(r,["_url","name"],t0(e,a)),r}function SAe(e){const t={};if(w(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const r=w(e,["enableWidget"]);return r!=null&&C(t,["enableWidget"],r),t}function BAe(e){const t={};if(w(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(w(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const r=w(e,["timeRangeFilter"]);return r!=null&&C(t,["timeRangeFilter"],r),t}function _Ae(e){const t={},r=w(e,["aspectRatio"]);r!=null&&C(t,["aspectRatio"],r);const a=w(e,["imageSize"]);if(a!=null&&C(t,["imageSize"],a),w(e,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(w(e,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(w(e,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");return t}function TAe(e,t){const r={},a=w(t,["model"]);a!=null&&C(r,["request","model"],rr(e,a));const s=w(t,["contents"]);if(s!=null){let o=Ls(s);Array.isArray(o)&&(o=o.map(d=>HL(d))),C(r,["request","contents"],o)}const i=w(t,["metadata"]);i!=null&&C(r,["metadata"],i);const l=w(t,["config"]);return l!=null&&C(r,["request","generationConfig"],CAe(e,l,w(r,["request"],{}))),r}function IAe(e){const t={},r=w(e,["response"]);r!=null&&C(t,["response"],kAe(r));const a=w(e,["metadata"]);a!=null&&C(t,["metadata"],a);const s=w(e,["error"]);return s!=null&&C(t,["error"],s),t}function FAe(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&C(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);if(t!==void 0&&s!=null&&C(t,["_query","pageToken"],s),w(e,["filter"])!==void 0)throw new Error("filter parameter is not supported in Gemini API.");return r}function DAe(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&C(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);t!==void 0&&s!=null&&C(t,["_query","pageToken"],s);const i=w(e,["filter"]);return t!==void 0&&i!=null&&C(t,["_query","filter"],i),r}function UAe(e){const t={},r=w(e,["config"]);return r!=null&&FAe(r,t),t}function MAe(e){const t={},r=w(e,["config"]);return r!=null&&DAe(r,t),t}function RAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&C(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&C(t,["nextPageToken"],a);const s=w(e,["operations"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>Dm(l))),C(t,["batchJobs"],i)}return t}function OAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&C(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&C(t,["nextPageToken"],a);const s=w(e,["batchPredictionJobs"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>fC(l))),C(t,["batchJobs"],i)}return t}function PAe(e){const t={},r=w(e,["mediaResolution"]);r!=null&&C(t,["mediaResolution"],r);const a=w(e,["codeExecutionResult"]);a!=null&&C(t,["codeExecutionResult"],a);const s=w(e,["executableCode"]);s!=null&&C(t,["executableCode"],s);const i=w(e,["fileData"]);i!=null&&C(t,["fileData"],yAe(i));const l=w(e,["functionCall"]);l!=null&&C(t,["functionCall"],wAe(l));const o=w(e,["functionResponse"]);o!=null&&C(t,["functionResponse"],o);const d=w(e,["inlineData"]);d!=null&&C(t,["inlineData"],nAe(d));const u=w(e,["text"]);u!=null&&C(t,["text"],u);const f=w(e,["thought"]);f!=null&&C(t,["thought"],f);const p=w(e,["thoughtSignature"]);p!=null&&C(t,["thoughtSignature"],p);const h=w(e,["videoMetadata"]);return h!=null&&C(t,["videoMetadata"],h),t}function LAe(e){const t={},r=w(e,["category"]);if(r!=null&&C(t,["category"],r),w(e,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const a=w(e,["threshold"]);return a!=null&&C(t,["threshold"],a),t}function QAe(e){const t={},r=w(e,["retrievalConfig"]);r!=null&&C(t,["retrievalConfig"],r);const a=w(e,["functionCallingConfig"]);return a!=null&&C(t,["functionCallingConfig"],NAe(a)),t}function HAe(e){const t={};if(w(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const r=w(e,["computerUse"]);r!=null&&C(t,["computerUse"],r);const a=w(e,["fileSearch"]);a!=null&&C(t,["fileSearch"],a);const s=w(e,["codeExecution"]);if(s!=null&&C(t,["codeExecution"],s),w(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=w(e,["functionDeclarations"]);if(i!=null){let f=i;Array.isArray(f)&&(f=f.map(p=>p)),C(t,["functionDeclarations"],f)}const l=w(e,["googleMaps"]);l!=null&&C(t,["googleMaps"],SAe(l));const o=w(e,["googleSearch"]);o!=null&&C(t,["googleSearch"],BAe(o));const d=w(e,["googleSearchRetrieval"]);d!=null&&C(t,["googleSearchRetrieval"],d);const u=w(e,["urlContext"]);return u!=null&&C(t,["urlContext"],u),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var No;(function(e){e.PAGED_ITEM_BATCH_JOBS="batchJobs",e.PAGED_ITEM_MODELS="models",e.PAGED_ITEM_TUNING_JOBS="tuningJobs",e.PAGED_ITEM_FILES="files",e.PAGED_ITEM_CACHED_CONTENTS="cachedContents",e.PAGED_ITEM_FILE_SEARCH_STORES="fileSearchStores",e.PAGED_ITEM_DOCUMENTS="documents"})(No||(No={}));class nu{constructor(t,r,a,s){this.pageInternal=[],this.paramsInternal={},this.requestInternal=r,this.init(t,a,s)}init(t,r,a){var s,i;this.nameInternal=t,this.pageInternal=r[this.nameInternal]||[],this.sdkHttpResponseInternal=r==null?void 0:r.sdkHttpResponse,this.idxInternal=0;let l={config:{}};!a||Object.keys(a).length===0?l={config:{}}:typeof a=="object"?l=Object.assign({},a):l=a,l.config&&(l.config.pageToken=r.nextPageToken),this.paramsInternal=l,this.pageInternalSize=(i=(s=l.config)===null||s===void 0?void 0:s.pageSize)!==null&&i!==void 0?i:this.pageInternal.length}initNextPage(t){this.init(this.nameInternal,t,this.paramsInternal)}get page(){return this.pageInternal}get name(){return this.nameInternal}get pageSize(){return this.pageInternalSize}get sdkHttpResponse(){return this.sdkHttpResponseInternal}get params(){return this.paramsInternal}get pageLength(){return this.pageInternal.length}getItem(t){return this.pageInternal[t]}[Symbol.asyncIterator](){return{next:async()=>{if(this.idxInternal>=this.pageLength)if(this.hasNextPage())await this.nextPage();else return{value:void 0,done:!0};const t=this.getItem(this.idxInternal);return this.idxInternal+=1,{value:t,done:!1}},return:async()=>({value:void 0,done:!0})}}async nextPage(){if(!this.hasNextPage())throw new Error("No more pages to fetch.");const t=await this.requestInternal(this.params);return this.initNextPage(t),this.page}hasNextPage(){var t;return((t=this.params.config)===null||t===void 0?void 0:t.pageToken)!==void 0}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class zAe extends Uo{constructor(t){super(),this.apiClient=t,this.list=async(r={})=>new nu(No.PAGED_ITEM_BATCH_JOBS,a=>this.listInternal(a),await this.listInternal(r),r),this.create=async r=>(this.apiClient.isVertexAI()&&(r.config=this.formatDestination(r.src,r.config)),this.createInternal(r)),this.createEmbeddings=async r=>{if(console.warn("batches.createEmbeddings() is experimental and may change without notice."),this.apiClient.isVertexAI())throw new Error("Vertex AI does not support batches.createEmbeddings.");return this.createEmbeddingsInternal(r)}}createInlinedGenerateContentRequest(t){const r=H3(this.apiClient,t),a=r._url,s=et("{model}:batchGenerateContent",a),o=r.batch.inputConfig.requests,d=o.requests,u=[];for(const f of d){const p=Object.assign({},f);if(p.systemInstruction){const h=p.systemInstruction;delete p.systemInstruction;const m=p.request;m.systemInstruction=h,p.request=m}u.push(p)}return o.requests=u,delete r.config,delete r._url,delete r._query,{path:s,body:r}}getGcsUri(t){if(typeof t=="string")return t.startsWith("gs://")?t:void 0;if(!Array.isArray(t)&&t.gcsUri&&t.gcsUri.length>0)return t.gcsUri[0]}getBigqueryUri(t){if(typeof t=="string")return t.startsWith("bq://")?t:void 0;if(!Array.isArray(t))return t.bigqueryUri}formatDestination(t,r){const a=r?Object.assign({},r):{},s=Date.now().toString();if(a.displayName||(a.displayName=`genaiBatchJob_${s}`),a.dest===void 0){const i=this.getGcsUri(t),l=this.getBigqueryUri(t);if(i)i.endsWith(".jsonl")?a.dest=`${i.slice(0,-6)}/dest`:a.dest=`${i}_dest_${s}`;else if(l)a.dest=`${l}_dest_${s}`;else throw new Error("Unsupported source for Vertex AI: No GCS or BigQuery URI found.")}return a}async createInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=uAe(this.apiClient,t);return o=et("batchPredictionJobs",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>fC(f))}else{const u=H3(this.apiClient,t);return o=et("{model}:batchGenerateContent",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>Dm(f))}}async createEmbeddingsInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=fAe(this.apiClient,t);return i=et("{model}:asyncBatchEmbedContent",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>Dm(d))}}async get(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=EAe(this.apiClient,t);return o=et("batchPredictionJobs/{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>fC(f))}else{const u=jAe(this.apiClient,t);return o=et("batches/{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>Dm(f))}}async cancel(t){var r,a,s,i;let l="",o={};if(this.apiClient.isVertexAI()){const d=iAe(this.apiClient,t);l=et("batchPredictionJobs/{name}:cancel",d._url),o=d._query,delete d._url,delete d._query,await this.apiClient.request({path:l,queryParams:o,body:JSON.stringify(d),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal})}else{const d=sAe(this.apiClient,t);l=et("batches/{name}:cancel",d._url),o=d._query,delete d._url,delete d._query,await this.apiClient.request({path:l,queryParams:o,body:JSON.stringify(d),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal})}}async listInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=MAe(t);return o=et("batchPredictionJobs",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=OAe(f),h=new O3;return Object.assign(h,p),h})}else{const u=UAe(t);return o=et("batches",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=RAe(f),h=new O3;return Object.assign(h,p),h})}}async delete(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=xAe(this.apiClient,t);return o=et("batchPredictionJobs/{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>mAe(f))}else{const u=pAe(this.apiClient,t);return o=et("batches/{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>hAe(f))}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function $Ae(e){const t={},r=w(e,["data"]);if(r!=null&&C(t,["data"],r),w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=w(e,["mimeType"]);return a!=null&&C(t,["mimeType"],a),t}function z3(e){const t={},r=w(e,["parts"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>f0e(i))),C(t,["parts"],s)}const a=w(e,["role"]);return a!=null&&C(t,["role"],a),t}function VAe(e,t){const r={},a=w(e,["ttl"]);t!==void 0&&a!=null&&C(t,["ttl"],a);const s=w(e,["expireTime"]);t!==void 0&&s!=null&&C(t,["expireTime"],s);const i=w(e,["displayName"]);t!==void 0&&i!=null&&C(t,["displayName"],i);const l=w(e,["contents"]);if(t!==void 0&&l!=null){let f=Ls(l);Array.isArray(f)&&(f=f.map(p=>z3(p))),C(t,["contents"],f)}const o=w(e,["systemInstruction"]);t!==void 0&&o!=null&&C(t,["systemInstruction"],z3(tn(o)));const d=w(e,["tools"]);if(t!==void 0&&d!=null){let f=d;Array.isArray(f)&&(f=f.map(p=>x0e(p))),C(t,["tools"],f)}const u=w(e,["toolConfig"]);if(t!==void 0&&u!=null&&C(t,["toolConfig"],p0e(u)),w(e,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is not supported in Gemini API.");return r}function GAe(e,t){const r={},a=w(e,["ttl"]);t!==void 0&&a!=null&&C(t,["ttl"],a);const s=w(e,["expireTime"]);t!==void 0&&s!=null&&C(t,["expireTime"],s);const i=w(e,["displayName"]);t!==void 0&&i!=null&&C(t,["displayName"],i);const l=w(e,["contents"]);if(t!==void 0&&l!=null){let p=Ls(l);Array.isArray(p)&&(p=p.map(h=>h)),C(t,["contents"],p)}const o=w(e,["systemInstruction"]);t!==void 0&&o!=null&&C(t,["systemInstruction"],tn(o));const d=w(e,["tools"]);if(t!==void 0&&d!=null){let p=d;Array.isArray(p)&&(p=p.map(h=>h0e(h))),C(t,["tools"],p)}const u=w(e,["toolConfig"]);t!==void 0&&u!=null&&C(t,["toolConfig"],u);const f=w(e,["kmsKeyName"]);return t!==void 0&&f!=null&&C(t,["encryption_spec","kmsKeyName"],f),r}function KAe(e,t){const r={},a=w(t,["model"]);a!=null&&C(r,["model"],_L(e,a));const s=w(t,["config"]);return s!=null&&VAe(s,r),r}function qAe(e,t){const r={},a=w(t,["model"]);a!=null&&C(r,["model"],_L(e,a));const s=w(t,["config"]);return s!=null&&GAe(s,r),r}function WAe(e,t){const r={},a=w(t,["name"]);return a!=null&&C(r,["_url","name"],Mo(e,a)),r}function YAe(e,t){const r={},a=w(t,["name"]);return a!=null&&C(r,["_url","name"],Mo(e,a)),r}function XAe(e){const t={},r=w(e,["sdkHttpResponse"]);return r!=null&&C(t,["sdkHttpResponse"],r),t}function JAe(e){const t={},r=w(e,["sdkHttpResponse"]);return r!=null&&C(t,["sdkHttpResponse"],r),t}function ZAe(e){const t={};if(w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const r=w(e,["fileUri"]);r!=null&&C(t,["fileUri"],r);const a=w(e,["mimeType"]);return a!=null&&C(t,["mimeType"],a),t}function e0e(e){const t={},r=w(e,["id"]);r!=null&&C(t,["id"],r);const a=w(e,["args"]);a!=null&&C(t,["args"],a);const s=w(e,["name"]);if(s!=null&&C(t,["name"],s),w(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(w(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function t0e(e){const t={},r=w(e,["allowedFunctionNames"]);r!=null&&C(t,["allowedFunctionNames"],r);const a=w(e,["mode"]);if(a!=null&&C(t,["mode"],a),w(e,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function r0e(e){const t={},r=w(e,["description"]);r!=null&&C(t,["description"],r);const a=w(e,["name"]);a!=null&&C(t,["name"],a);const s=w(e,["parameters"]);s!=null&&C(t,["parameters"],s);const i=w(e,["parametersJsonSchema"]);i!=null&&C(t,["parametersJsonSchema"],i);const l=w(e,["response"]);l!=null&&C(t,["response"],l);const o=w(e,["responseJsonSchema"]);if(o!=null&&C(t,["responseJsonSchema"],o),w(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function a0e(e,t){const r={},a=w(t,["name"]);return a!=null&&C(r,["_url","name"],Mo(e,a)),r}function n0e(e,t){const r={},a=w(t,["name"]);return a!=null&&C(r,["_url","name"],Mo(e,a)),r}function s0e(e){const t={};if(w(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const r=w(e,["enableWidget"]);return r!=null&&C(t,["enableWidget"],r),t}function i0e(e){const t={};if(w(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(w(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const r=w(e,["timeRangeFilter"]);return r!=null&&C(t,["timeRangeFilter"],r),t}function l0e(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&C(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);return t!==void 0&&s!=null&&C(t,["_query","pageToken"],s),r}function o0e(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&C(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);return t!==void 0&&s!=null&&C(t,["_query","pageToken"],s),r}function c0e(e){const t={},r=w(e,["config"]);return r!=null&&l0e(r,t),t}function d0e(e){const t={},r=w(e,["config"]);return r!=null&&o0e(r,t),t}function u0e(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&C(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&C(t,["nextPageToken"],a);const s=w(e,["cachedContents"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),C(t,["cachedContents"],i)}return t}function A0e(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&C(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&C(t,["nextPageToken"],a);const s=w(e,["cachedContents"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),C(t,["cachedContents"],i)}return t}function f0e(e){const t={},r=w(e,["mediaResolution"]);r!=null&&C(t,["mediaResolution"],r);const a=w(e,["codeExecutionResult"]);a!=null&&C(t,["codeExecutionResult"],a);const s=w(e,["executableCode"]);s!=null&&C(t,["executableCode"],s);const i=w(e,["fileData"]);i!=null&&C(t,["fileData"],ZAe(i));const l=w(e,["functionCall"]);l!=null&&C(t,["functionCall"],e0e(l));const o=w(e,["functionResponse"]);o!=null&&C(t,["functionResponse"],o);const d=w(e,["inlineData"]);d!=null&&C(t,["inlineData"],$Ae(d));const u=w(e,["text"]);u!=null&&C(t,["text"],u);const f=w(e,["thought"]);f!=null&&C(t,["thought"],f);const p=w(e,["thoughtSignature"]);p!=null&&C(t,["thoughtSignature"],p);const h=w(e,["videoMetadata"]);return h!=null&&C(t,["videoMetadata"],h),t}function p0e(e){const t={},r=w(e,["retrievalConfig"]);r!=null&&C(t,["retrievalConfig"],r);const a=w(e,["functionCallingConfig"]);return a!=null&&C(t,["functionCallingConfig"],t0e(a)),t}function x0e(e){const t={};if(w(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const r=w(e,["computerUse"]);r!=null&&C(t,["computerUse"],r);const a=w(e,["fileSearch"]);a!=null&&C(t,["fileSearch"],a);const s=w(e,["codeExecution"]);if(s!=null&&C(t,["codeExecution"],s),w(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=w(e,["functionDeclarations"]);if(i!=null){let f=i;Array.isArray(f)&&(f=f.map(p=>p)),C(t,["functionDeclarations"],f)}const l=w(e,["googleMaps"]);l!=null&&C(t,["googleMaps"],s0e(l));const o=w(e,["googleSearch"]);o!=null&&C(t,["googleSearch"],i0e(o));const d=w(e,["googleSearchRetrieval"]);d!=null&&C(t,["googleSearchRetrieval"],d);const u=w(e,["urlContext"]);return u!=null&&C(t,["urlContext"],u),t}function h0e(e){const t={},r=w(e,["retrieval"]);r!=null&&C(t,["retrieval"],r);const a=w(e,["computerUse"]);if(a!=null&&C(t,["computerUse"],a),w(e,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const s=w(e,["codeExecution"]);s!=null&&C(t,["codeExecution"],s);const i=w(e,["enterpriseWebSearch"]);i!=null&&C(t,["enterpriseWebSearch"],i);const l=w(e,["functionDeclarations"]);if(l!=null){let p=l;Array.isArray(p)&&(p=p.map(h=>r0e(h))),C(t,["functionDeclarations"],p)}const o=w(e,["googleMaps"]);o!=null&&C(t,["googleMaps"],o);const d=w(e,["googleSearch"]);d!=null&&C(t,["googleSearch"],d);const u=w(e,["googleSearchRetrieval"]);u!=null&&C(t,["googleSearchRetrieval"],u);const f=w(e,["urlContext"]);return f!=null&&C(t,["urlContext"],f),t}function m0e(e,t){const r={},a=w(e,["ttl"]);t!==void 0&&a!=null&&C(t,["ttl"],a);const s=w(e,["expireTime"]);return t!==void 0&&s!=null&&C(t,["expireTime"],s),r}function g0e(e,t){const r={},a=w(e,["ttl"]);t!==void 0&&a!=null&&C(t,["ttl"],a);const s=w(e,["expireTime"]);return t!==void 0&&s!=null&&C(t,["expireTime"],s),r}function b0e(e,t){const r={},a=w(t,["name"]);a!=null&&C(r,["_url","name"],Mo(e,a));const s=w(t,["config"]);return s!=null&&m0e(s,r),r}function v0e(e,t){const r={},a=w(t,["name"]);a!=null&&C(r,["_url","name"],Mo(e,a));const s=w(t,["config"]);return s!=null&&g0e(s,r),r}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class y0e extends Uo{constructor(t){super(),this.apiClient=t,this.list=async(r={})=>new nu(No.PAGED_ITEM_CACHED_CONTENTS,a=>this.listInternal(a),await this.listInternal(r),r)}async create(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=qAe(this.apiClient,t);return o=et("cachedContents",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>f)}else{const u=KAe(this.apiClient,t);return o=et("cachedContents",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>f)}}async get(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=n0e(this.apiClient,t);return o=et("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>f)}else{const u=a0e(this.apiClient,t);return o=et("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>f)}}async delete(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=YAe(this.apiClient,t);return o=et("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=JAe(f),h=new M3;return Object.assign(h,p),h})}else{const u=WAe(this.apiClient,t);return o=et("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=XAe(f),h=new M3;return Object.assign(h,p),h})}}async update(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=v0e(this.apiClient,t);return o=et("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>f)}else{const u=b0e(this.apiClient,t);return o=et("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>f)}}async listInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=d0e(t);return o=et("cachedContents",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=A0e(f),h=new R3;return Object.assign(h,p),h})}else{const u=c0e(t);return o=et("cachedContents",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=u0e(f),h=new R3;return Object.assign(h,p),h})}}}function Og(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(e);s<a.length;s++)t.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(e,a[s])&&(r[a[s]]=e[a[s]]);return r}function $3(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],a=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function St(e){return this instanceof St?(this.v=e,this):new St(e)}function zi(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=r.apply(e,t||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",l),s[Symbol.asyncIterator]=function(){return this},s;function l(m){return function(b){return Promise.resolve(b).then(m,p)}}function o(m,b){a[m]&&(s[m]=function(v){return new Promise(function(y,j){i.push([m,v,y,j])>1||d(m,v)})},b&&(s[m]=b(s[m])))}function d(m,b){try{u(a[m](b))}catch(v){h(i[0][3],v)}}function u(m){m.value instanceof St?Promise.resolve(m.value.v).then(f,p):h(i[0][2],m)}function f(m){d("next",m)}function p(m){d("throw",m)}function h(m,b){m(b),i.shift(),i.length&&d(i[0][0],i[0][1])}}function $i(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof $3=="function"?$3(e):e[Symbol.iterator](),r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r);function a(i){r[i]=e[i]&&function(l){return new Promise(function(o,d){l=e[i](l),s(o,d,l.done,l.value)})}}function s(i,l,o,d){Promise.resolve(d).then(function(u){i({value:u,done:o})},l)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function w0e(e){var t;if(e.candidates==null||e.candidates.length===0)return!1;const r=(t=e.candidates[0])===null||t===void 0?void 0:t.content;return r===void 0?!1:zL(r)}function zL(e){if(e.parts===void 0||e.parts.length===0)return!1;for(const t of e.parts)if(t===void 0||Object.keys(t).length===0)return!1;return!0}function N0e(e){if(e.length!==0){for(const t of e)if(t.role!=="user"&&t.role!=="model")throw new Error(`Role must be user or model, but got ${t.role}.`)}}function V3(e){if(e===void 0||e.length===0)return[];const t=[],r=e.length;let a=0;for(;a<r;)if(e[a].role==="user")t.push(e[a]),a++;else{const s=[];let i=!0;for(;a<r&&e[a].role==="model";)s.push(e[a]),i&&!zL(e[a])&&(i=!1),a++;i?t.push(...s):t.pop()}return t}class C0e{constructor(t,r){this.modelsModule=t,this.apiClient=r}create(t){return new k0e(this.apiClient,this.modelsModule,t.model,t.config,structuredClone(t.history))}}class k0e{constructor(t,r,a,s={},i=[]){this.apiClient=t,this.modelsModule=r,this.model=a,this.config=s,this.history=i,this.sendPromise=Promise.resolve(),N0e(i)}async sendMessage(t){var r;await this.sendPromise;const a=tn(t.message),s=this.modelsModule.generateContent({model:this.model,contents:this.getHistory(!0).concat(a),config:(r=t.config)!==null&&r!==void 0?r:this.config});return this.sendPromise=(async()=>{var i,l,o;const d=await s,u=(l=(i=d.candidates)===null||i===void 0?void 0:i[0])===null||l===void 0?void 0:l.content,f=d.automaticFunctionCallingHistory,p=this.getHistory(!0).length;let h=[];f!=null&&(h=(o=f.slice(p))!==null&&o!==void 0?o:[]);const m=u?[u]:[];this.recordHistory(a,m,h)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),s}async sendMessageStream(t){var r;await this.sendPromise;const a=tn(t.message),s=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(a),config:(r=t.config)!==null&&r!==void 0?r:this.config});this.sendPromise=s.then(()=>{}).catch(()=>{});const i=await s;return this.processStreamResponse(i,a)}getHistory(t=!1){const r=t?V3(this.history):this.history;return structuredClone(r)}processStreamResponse(t,r){return zi(this,arguments,function*(){var s,i,l,o,d,u;const f=[];try{for(var p=!0,h=$i(t),m;m=yield St(h.next()),s=m.done,!s;p=!0){o=m.value,p=!1;const b=o;if(w0e(b)){const v=(u=(d=b.candidates)===null||d===void 0?void 0:d[0])===null||u===void 0?void 0:u.content;v!==void 0&&f.push(v)}yield yield St(b)}}catch(b){i={error:b}}finally{try{!p&&!s&&(l=h.return)&&(yield St(l.call(h)))}finally{if(i)throw i.error}}this.recordHistory(r,f)})}recordHistory(t,r,a){let s=[];r.length>0&&r.every(i=>i.role!==void 0)?s=r:s.push({role:"model",parts:[]}),a&&a.length>0?this.history.push(...V3(a)):this.history.push(t),this.history.push(...s)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class pp extends Error{constructor(t){super(t.message),this.name="ApiError",this.status=t.status,Object.setPrototypeOf(this,pp.prototype)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function j0e(e){const t={},r=w(e,["file"]);return r!=null&&C(t,["file"],r),t}function E0e(e){const t={},r=w(e,["sdkHttpResponse"]);return r!=null&&C(t,["sdkHttpResponse"],r),t}function S0e(e){const t={},r=w(e,["name"]);return r!=null&&C(t,["_url","file"],ML(r)),t}function B0e(e){const t={},r=w(e,["sdkHttpResponse"]);return r!=null&&C(t,["sdkHttpResponse"],r),t}function _0e(e){const t={},r=w(e,["name"]);return r!=null&&C(t,["_url","file"],ML(r)),t}function T0e(e){const t={},r=w(e,["uris"]);return r!=null&&C(t,["uris"],r),t}function I0e(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&C(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);return t!==void 0&&s!=null&&C(t,["_query","pageToken"],s),r}function F0e(e){const t={},r=w(e,["config"]);return r!=null&&I0e(r,t),t}function D0e(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&C(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&C(t,["nextPageToken"],a);const s=w(e,["files"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),C(t,["files"],i)}return t}function U0e(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&C(t,["sdkHttpResponse"],r);const a=w(e,["files"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(i=>i)),C(t,["files"],s)}return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class M0e extends Uo{constructor(t){super(),this.apiClient=t,this.list=async(r={})=>new nu(No.PAGED_ITEM_FILES,a=>this.listInternal(a),await this.listInternal(r),r)}async upload(t){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files. You can share files through a GCS bucket.");return this.apiClient.uploadFile(t.file,t.config).then(r=>r)}async download(t){await this.apiClient.downloadFile(t)}async registerFiles(t){throw new Error("registerFiles is only supported in Node.js environments.")}async _registerFiles(t){return this.registerFilesInternal(t)}async listInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=F0e(t);return i=et("files",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json().then(u=>{const f=u;return f.sdkHttpResponse={headers:d.headers},f})),s.then(d=>{const u=D0e(d),f=new Mue;return Object.assign(f,u),f})}}async createInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=j0e(t);return i=et("upload/v1beta/files",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=E0e(d),f=new Rue;return Object.assign(f,u),f})}}async get(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=_0e(t);return i=et("files/{file}",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>d)}}async delete(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=S0e(t);return i=et("files/{file}",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"DELETE",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json().then(u=>{const f=u;return f.sdkHttpResponse={headers:d.headers},f})),s.then(d=>{const u=B0e(d),f=new Oue;return Object.assign(f,u),f})}}async registerFilesInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=T0e(t);return i=et("files:register",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=U0e(d),f=new Pue;return Object.assign(f,u),f})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Um(e){const t={},r=w(e,["data"]);if(r!=null&&C(t,["data"],r),w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=w(e,["mimeType"]);return a!=null&&C(t,["mimeType"],a),t}function R0e(e){const t={},r=w(e,["parts"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>Z0e(i))),C(t,["parts"],s)}const a=w(e,["role"]);return a!=null&&C(t,["role"],a),t}function O0e(e){const t={};if(w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const r=w(e,["fileUri"]);r!=null&&C(t,["fileUri"],r);const a=w(e,["mimeType"]);return a!=null&&C(t,["mimeType"],a),t}function P0e(e){const t={},r=w(e,["id"]);r!=null&&C(t,["id"],r);const a=w(e,["args"]);a!=null&&C(t,["args"],a);const s=w(e,["name"]);if(s!=null&&C(t,["name"],s),w(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(w(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function L0e(e){const t={},r=w(e,["description"]);r!=null&&C(t,["description"],r);const a=w(e,["name"]);a!=null&&C(t,["name"],a);const s=w(e,["parameters"]);s!=null&&C(t,["parameters"],s);const i=w(e,["parametersJsonSchema"]);i!=null&&C(t,["parametersJsonSchema"],i);const l=w(e,["response"]);l!=null&&C(t,["response"],l);const o=w(e,["responseJsonSchema"]);if(o!=null&&C(t,["responseJsonSchema"],o),w(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function Q0e(e){const t={},r=w(e,["modelSelectionConfig"]);r!=null&&C(t,["modelConfig"],r);const a=w(e,["responseJsonSchema"]);a!=null&&C(t,["responseJsonSchema"],a);const s=w(e,["audioTimestamp"]);s!=null&&C(t,["audioTimestamp"],s);const i=w(e,["candidateCount"]);i!=null&&C(t,["candidateCount"],i);const l=w(e,["enableAffectiveDialog"]);l!=null&&C(t,["enableAffectiveDialog"],l);const o=w(e,["frequencyPenalty"]);o!=null&&C(t,["frequencyPenalty"],o);const d=w(e,["logprobs"]);d!=null&&C(t,["logprobs"],d);const u=w(e,["maxOutputTokens"]);u!=null&&C(t,["maxOutputTokens"],u);const f=w(e,["mediaResolution"]);f!=null&&C(t,["mediaResolution"],f);const p=w(e,["presencePenalty"]);p!=null&&C(t,["presencePenalty"],p);const h=w(e,["responseLogprobs"]);h!=null&&C(t,["responseLogprobs"],h);const m=w(e,["responseMimeType"]);m!=null&&C(t,["responseMimeType"],m);const b=w(e,["responseModalities"]);b!=null&&C(t,["responseModalities"],b);const v=w(e,["responseSchema"]);v!=null&&C(t,["responseSchema"],v);const y=w(e,["routingConfig"]);y!=null&&C(t,["routingConfig"],y);const j=w(e,["seed"]);j!=null&&C(t,["seed"],j);const _=w(e,["speechConfig"]);_!=null&&C(t,["speechConfig"],_);const N=w(e,["stopSequences"]);N!=null&&C(t,["stopSequences"],N);const E=w(e,["temperature"]);E!=null&&C(t,["temperature"],E);const T=w(e,["thinkingConfig"]);T!=null&&C(t,["thinkingConfig"],T);const B=w(e,["topK"]);B!=null&&C(t,["topK"],B);const F=w(e,["topP"]);if(F!=null&&C(t,["topP"],F),w(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return t}function H0e(e){const t={};if(w(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const r=w(e,["enableWidget"]);return r!=null&&C(t,["enableWidget"],r),t}function z0e(e){const t={};if(w(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(w(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const r=w(e,["timeRangeFilter"]);return r!=null&&C(t,["timeRangeFilter"],r),t}function $0e(e,t){const r={},a=w(e,["generationConfig"]);t!==void 0&&a!=null&&C(t,["setup","generationConfig"],a);const s=w(e,["responseModalities"]);t!==void 0&&s!=null&&C(t,["setup","generationConfig","responseModalities"],s);const i=w(e,["temperature"]);t!==void 0&&i!=null&&C(t,["setup","generationConfig","temperature"],i);const l=w(e,["topP"]);t!==void 0&&l!=null&&C(t,["setup","generationConfig","topP"],l);const o=w(e,["topK"]);t!==void 0&&o!=null&&C(t,["setup","generationConfig","topK"],o);const d=w(e,["maxOutputTokens"]);t!==void 0&&d!=null&&C(t,["setup","generationConfig","maxOutputTokens"],d);const u=w(e,["mediaResolution"]);t!==void 0&&u!=null&&C(t,["setup","generationConfig","mediaResolution"],u);const f=w(e,["seed"]);t!==void 0&&f!=null&&C(t,["setup","generationConfig","seed"],f);const p=w(e,["speechConfig"]);t!==void 0&&p!=null&&C(t,["setup","generationConfig","speechConfig"],Jj(p));const h=w(e,["thinkingConfig"]);t!==void 0&&h!=null&&C(t,["setup","generationConfig","thinkingConfig"],h);const m=w(e,["enableAffectiveDialog"]);t!==void 0&&m!=null&&C(t,["setup","generationConfig","enableAffectiveDialog"],m);const b=w(e,["systemInstruction"]);t!==void 0&&b!=null&&C(t,["setup","systemInstruction"],R0e(tn(b)));const v=w(e,["tools"]);if(t!==void 0&&v!=null){let B=e0(v);Array.isArray(B)&&(B=B.map(F=>tfe(ZA(F)))),C(t,["setup","tools"],B)}const y=w(e,["sessionResumption"]);t!==void 0&&y!=null&&C(t,["setup","sessionResumption"],efe(y));const j=w(e,["inputAudioTranscription"]);t!==void 0&&j!=null&&C(t,["setup","inputAudioTranscription"],j);const _=w(e,["outputAudioTranscription"]);t!==void 0&&_!=null&&C(t,["setup","outputAudioTranscription"],_);const N=w(e,["realtimeInputConfig"]);t!==void 0&&N!=null&&C(t,["setup","realtimeInputConfig"],N);const E=w(e,["contextWindowCompression"]);t!==void 0&&E!=null&&C(t,["setup","contextWindowCompression"],E);const T=w(e,["proactivity"]);if(t!==void 0&&T!=null&&C(t,["setup","proactivity"],T),w(e,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return r}function V0e(e,t){const r={},a=w(e,["generationConfig"]);t!==void 0&&a!=null&&C(t,["setup","generationConfig"],Q0e(a));const s=w(e,["responseModalities"]);t!==void 0&&s!=null&&C(t,["setup","generationConfig","responseModalities"],s);const i=w(e,["temperature"]);t!==void 0&&i!=null&&C(t,["setup","generationConfig","temperature"],i);const l=w(e,["topP"]);t!==void 0&&l!=null&&C(t,["setup","generationConfig","topP"],l);const o=w(e,["topK"]);t!==void 0&&o!=null&&C(t,["setup","generationConfig","topK"],o);const d=w(e,["maxOutputTokens"]);t!==void 0&&d!=null&&C(t,["setup","generationConfig","maxOutputTokens"],d);const u=w(e,["mediaResolution"]);t!==void 0&&u!=null&&C(t,["setup","generationConfig","mediaResolution"],u);const f=w(e,["seed"]);t!==void 0&&f!=null&&C(t,["setup","generationConfig","seed"],f);const p=w(e,["speechConfig"]);t!==void 0&&p!=null&&C(t,["setup","generationConfig","speechConfig"],Jj(p));const h=w(e,["thinkingConfig"]);t!==void 0&&h!=null&&C(t,["setup","generationConfig","thinkingConfig"],h);const m=w(e,["enableAffectiveDialog"]);t!==void 0&&m!=null&&C(t,["setup","generationConfig","enableAffectiveDialog"],m);const b=w(e,["systemInstruction"]);t!==void 0&&b!=null&&C(t,["setup","systemInstruction"],tn(b));const v=w(e,["tools"]);if(t!==void 0&&v!=null){let F=e0(v);Array.isArray(F)&&(F=F.map(R=>rfe(ZA(R)))),C(t,["setup","tools"],F)}const y=w(e,["sessionResumption"]);t!==void 0&&y!=null&&C(t,["setup","sessionResumption"],y);const j=w(e,["inputAudioTranscription"]);t!==void 0&&j!=null&&C(t,["setup","inputAudioTranscription"],j);const _=w(e,["outputAudioTranscription"]);t!==void 0&&_!=null&&C(t,["setup","outputAudioTranscription"],_);const N=w(e,["realtimeInputConfig"]);t!==void 0&&N!=null&&C(t,["setup","realtimeInputConfig"],N);const E=w(e,["contextWindowCompression"]);t!==void 0&&E!=null&&C(t,["setup","contextWindowCompression"],E);const T=w(e,["proactivity"]);t!==void 0&&T!=null&&C(t,["setup","proactivity"],T);const B=w(e,["explicitVadSignal"]);return t!==void 0&&B!=null&&C(t,["setup","explicitVadSignal"],B),r}function G0e(e,t){const r={},a=w(t,["model"]);a!=null&&C(r,["setup","model"],rr(e,a));const s=w(t,["config"]);return s!=null&&C(r,["config"],$0e(s,r)),r}function K0e(e,t){const r={},a=w(t,["model"]);a!=null&&C(r,["setup","model"],rr(e,a));const s=w(t,["config"]);return s!=null&&C(r,["config"],V0e(s,r)),r}function q0e(e){const t={},r=w(e,["musicGenerationConfig"]);return r!=null&&C(t,["musicGenerationConfig"],r),t}function W0e(e){const t={},r=w(e,["weightedPrompts"]);if(r!=null){let a=r;Array.isArray(a)&&(a=a.map(s=>s)),C(t,["weightedPrompts"],a)}return t}function Y0e(e){const t={},r=w(e,["media"]);if(r!=null){let u=TL(r);Array.isArray(u)&&(u=u.map(f=>Um(f))),C(t,["mediaChunks"],u)}const a=w(e,["audio"]);a!=null&&C(t,["audio"],Um(FL(a)));const s=w(e,["audioStreamEnd"]);s!=null&&C(t,["audioStreamEnd"],s);const i=w(e,["video"]);i!=null&&C(t,["video"],Um(IL(i)));const l=w(e,["text"]);l!=null&&C(t,["text"],l);const o=w(e,["activityStart"]);o!=null&&C(t,["activityStart"],o);const d=w(e,["activityEnd"]);return d!=null&&C(t,["activityEnd"],d),t}function X0e(e){const t={},r=w(e,["media"]);if(r!=null){let u=TL(r);Array.isArray(u)&&(u=u.map(f=>f)),C(t,["mediaChunks"],u)}const a=w(e,["audio"]);a!=null&&C(t,["audio"],FL(a));const s=w(e,["audioStreamEnd"]);s!=null&&C(t,["audioStreamEnd"],s);const i=w(e,["video"]);i!=null&&C(t,["video"],IL(i));const l=w(e,["text"]);l!=null&&C(t,["text"],l);const o=w(e,["activityStart"]);o!=null&&C(t,["activityStart"],o);const d=w(e,["activityEnd"]);return d!=null&&C(t,["activityEnd"],d),t}function J0e(e){const t={},r=w(e,["setupComplete"]);r!=null&&C(t,["setupComplete"],r);const a=w(e,["serverContent"]);a!=null&&C(t,["serverContent"],a);const s=w(e,["toolCall"]);s!=null&&C(t,["toolCall"],s);const i=w(e,["toolCallCancellation"]);i!=null&&C(t,["toolCallCancellation"],i);const l=w(e,["usageMetadata"]);l!=null&&C(t,["usageMetadata"],afe(l));const o=w(e,["goAway"]);o!=null&&C(t,["goAway"],o);const d=w(e,["sessionResumptionUpdate"]);d!=null&&C(t,["sessionResumptionUpdate"],d);const u=w(e,["voiceActivityDetectionSignal"]);u!=null&&C(t,["voiceActivityDetectionSignal"],u);const f=w(e,["voiceActivity"]);return f!=null&&C(t,["voiceActivity"],nfe(f)),t}function Z0e(e){const t={},r=w(e,["mediaResolution"]);r!=null&&C(t,["mediaResolution"],r);const a=w(e,["codeExecutionResult"]);a!=null&&C(t,["codeExecutionResult"],a);const s=w(e,["executableCode"]);s!=null&&C(t,["executableCode"],s);const i=w(e,["fileData"]);i!=null&&C(t,["fileData"],O0e(i));const l=w(e,["functionCall"]);l!=null&&C(t,["functionCall"],P0e(l));const o=w(e,["functionResponse"]);o!=null&&C(t,["functionResponse"],o);const d=w(e,["inlineData"]);d!=null&&C(t,["inlineData"],Um(d));const u=w(e,["text"]);u!=null&&C(t,["text"],u);const f=w(e,["thought"]);f!=null&&C(t,["thought"],f);const p=w(e,["thoughtSignature"]);p!=null&&C(t,["thoughtSignature"],p);const h=w(e,["videoMetadata"]);return h!=null&&C(t,["videoMetadata"],h),t}function efe(e){const t={},r=w(e,["handle"]);if(r!=null&&C(t,["handle"],r),w(e,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function tfe(e){const t={};if(w(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const r=w(e,["computerUse"]);r!=null&&C(t,["computerUse"],r);const a=w(e,["fileSearch"]);a!=null&&C(t,["fileSearch"],a);const s=w(e,["codeExecution"]);if(s!=null&&C(t,["codeExecution"],s),w(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=w(e,["functionDeclarations"]);if(i!=null){let f=i;Array.isArray(f)&&(f=f.map(p=>p)),C(t,["functionDeclarations"],f)}const l=w(e,["googleMaps"]);l!=null&&C(t,["googleMaps"],H0e(l));const o=w(e,["googleSearch"]);o!=null&&C(t,["googleSearch"],z0e(o));const d=w(e,["googleSearchRetrieval"]);d!=null&&C(t,["googleSearchRetrieval"],d);const u=w(e,["urlContext"]);return u!=null&&C(t,["urlContext"],u),t}function rfe(e){const t={},r=w(e,["retrieval"]);r!=null&&C(t,["retrieval"],r);const a=w(e,["computerUse"]);if(a!=null&&C(t,["computerUse"],a),w(e,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const s=w(e,["codeExecution"]);s!=null&&C(t,["codeExecution"],s);const i=w(e,["enterpriseWebSearch"]);i!=null&&C(t,["enterpriseWebSearch"],i);const l=w(e,["functionDeclarations"]);if(l!=null){let p=l;Array.isArray(p)&&(p=p.map(h=>L0e(h))),C(t,["functionDeclarations"],p)}const o=w(e,["googleMaps"]);o!=null&&C(t,["googleMaps"],o);const d=w(e,["googleSearch"]);d!=null&&C(t,["googleSearch"],d);const u=w(e,["googleSearchRetrieval"]);u!=null&&C(t,["googleSearchRetrieval"],u);const f=w(e,["urlContext"]);return f!=null&&C(t,["urlContext"],f),t}function afe(e){const t={},r=w(e,["promptTokenCount"]);r!=null&&C(t,["promptTokenCount"],r);const a=w(e,["cachedContentTokenCount"]);a!=null&&C(t,["cachedContentTokenCount"],a);const s=w(e,["candidatesTokenCount"]);s!=null&&C(t,["responseTokenCount"],s);const i=w(e,["toolUsePromptTokenCount"]);i!=null&&C(t,["toolUsePromptTokenCount"],i);const l=w(e,["thoughtsTokenCount"]);l!=null&&C(t,["thoughtsTokenCount"],l);const o=w(e,["totalTokenCount"]);o!=null&&C(t,["totalTokenCount"],o);const d=w(e,["promptTokensDetails"]);if(d!=null){let m=d;Array.isArray(m)&&(m=m.map(b=>b)),C(t,["promptTokensDetails"],m)}const u=w(e,["cacheTokensDetails"]);if(u!=null){let m=u;Array.isArray(m)&&(m=m.map(b=>b)),C(t,["cacheTokensDetails"],m)}const f=w(e,["candidatesTokensDetails"]);if(f!=null){let m=f;Array.isArray(m)&&(m=m.map(b=>b)),C(t,["responseTokensDetails"],m)}const p=w(e,["toolUsePromptTokensDetails"]);if(p!=null){let m=p;Array.isArray(m)&&(m=m.map(b=>b)),C(t,["toolUsePromptTokensDetails"],m)}const h=w(e,["trafficType"]);return h!=null&&C(t,["trafficType"],h),t}function nfe(e){const t={},r=w(e,["type"]);return r!=null&&C(t,["voiceActivityType"],r),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function sfe(e,t){const r={},a=w(e,["data"]);if(a!=null&&C(r,["data"],a),w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const s=w(e,["mimeType"]);return s!=null&&C(r,["mimeType"],s),r}function ife(e,t){const r={},a=w(e,["content"]);a!=null&&C(r,["content"],a);const s=w(e,["citationMetadata"]);s!=null&&C(r,["citationMetadata"],lfe(s));const i=w(e,["tokenCount"]);i!=null&&C(r,["tokenCount"],i);const l=w(e,["finishReason"]);l!=null&&C(r,["finishReason"],l);const o=w(e,["avgLogprobs"]);o!=null&&C(r,["avgLogprobs"],o);const d=w(e,["groundingMetadata"]);d!=null&&C(r,["groundingMetadata"],d);const u=w(e,["index"]);u!=null&&C(r,["index"],u);const f=w(e,["logprobsResult"]);f!=null&&C(r,["logprobsResult"],f);const p=w(e,["safetyRatings"]);if(p!=null){let m=p;Array.isArray(m)&&(m=m.map(b=>b)),C(r,["safetyRatings"],m)}const h=w(e,["urlContextMetadata"]);return h!=null&&C(r,["urlContextMetadata"],h),r}function lfe(e,t){const r={},a=w(e,["citationSources"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(i=>i)),C(r,["citations"],s)}return r}function ofe(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));const i=w(t,["contents"]);if(i!=null){let l=Ls(i);Array.isArray(l)&&(l=l.map(o=>o)),C(a,["contents"],l)}return a}function cfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["tokensInfo"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),C(r,["tokensInfo"],i)}return r}function dfe(e,t){const r={},a=w(e,["values"]);a!=null&&C(r,["values"],a);const s=w(e,["statistics"]);return s!=null&&C(r,["statistics"],ufe(s)),r}function ufe(e,t){const r={},a=w(e,["truncated"]);a!=null&&C(r,["truncated"],a);const s=w(e,["token_count"]);return s!=null&&C(r,["tokenCount"],s),r}function Jp(e,t){const r={},a=w(e,["parts"]);if(a!=null){let i=a;Array.isArray(i)&&(i=i.map(l=>vpe(l))),C(r,["parts"],i)}const s=w(e,["role"]);return s!=null&&C(r,["role"],s),r}function Afe(e,t){const r={},a=w(e,["controlType"]);a!=null&&C(r,["controlType"],a);const s=w(e,["enableControlImageComputation"]);return s!=null&&C(r,["computeControl"],s),r}function ffe(e,t){const r={};if(w(e,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is not supported in Gemini API.");if(w(e,["tools"])!==void 0)throw new Error("tools parameter is not supported in Gemini API.");if(w(e,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is not supported in Gemini API.");return r}function pfe(e,t,r){const a={},s=w(e,["systemInstruction"]);t!==void 0&&s!=null&&C(t,["systemInstruction"],tn(s));const i=w(e,["tools"]);if(t!==void 0&&i!=null){let o=i;Array.isArray(o)&&(o=o.map(d=>KL(d))),C(t,["tools"],o)}const l=w(e,["generationConfig"]);return t!==void 0&&l!=null&&C(t,["generationConfig"],spe(l)),a}function xfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));const i=w(t,["contents"]);if(i!=null){let o=Ls(i);Array.isArray(o)&&(o=o.map(d=>Jp(d))),C(a,["contents"],o)}const l=w(t,["config"]);return l!=null&&ffe(l),a}function hfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));const i=w(t,["contents"]);if(i!=null){let o=Ls(i);Array.isArray(o)&&(o=o.map(d=>d)),C(a,["contents"],o)}const l=w(t,["config"]);return l!=null&&pfe(l,a),a}function mfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["totalTokens"]);s!=null&&C(r,["totalTokens"],s);const i=w(e,["cachedContentTokenCount"]);return i!=null&&C(r,["cachedContentTokenCount"],i),r}function gfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["totalTokens"]);return s!=null&&C(r,["totalTokens"],s),r}function bfe(e,t,r){const a={},s=w(t,["model"]);return s!=null&&C(a,["_url","name"],rr(e,s)),a}function vfe(e,t,r){const a={},s=w(t,["model"]);return s!=null&&C(a,["_url","name"],rr(e,s)),a}function yfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);return a!=null&&C(r,["sdkHttpResponse"],a),r}function wfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);return a!=null&&C(r,["sdkHttpResponse"],a),r}function Nfe(e,t,r){const a={},s=w(e,["outputGcsUri"]);t!==void 0&&s!=null&&C(t,["parameters","storageUri"],s);const i=w(e,["negativePrompt"]);t!==void 0&&i!=null&&C(t,["parameters","negativePrompt"],i);const l=w(e,["numberOfImages"]);t!==void 0&&l!=null&&C(t,["parameters","sampleCount"],l);const o=w(e,["aspectRatio"]);t!==void 0&&o!=null&&C(t,["parameters","aspectRatio"],o);const d=w(e,["guidanceScale"]);t!==void 0&&d!=null&&C(t,["parameters","guidanceScale"],d);const u=w(e,["seed"]);t!==void 0&&u!=null&&C(t,["parameters","seed"],u);const f=w(e,["safetyFilterLevel"]);t!==void 0&&f!=null&&C(t,["parameters","safetySetting"],f);const p=w(e,["personGeneration"]);t!==void 0&&p!=null&&C(t,["parameters","personGeneration"],p);const h=w(e,["includeSafetyAttributes"]);t!==void 0&&h!=null&&C(t,["parameters","includeSafetyAttributes"],h);const m=w(e,["includeRaiReason"]);t!==void 0&&m!=null&&C(t,["parameters","includeRaiReason"],m);const b=w(e,["language"]);t!==void 0&&b!=null&&C(t,["parameters","language"],b);const v=w(e,["outputMimeType"]);t!==void 0&&v!=null&&C(t,["parameters","outputOptions","mimeType"],v);const y=w(e,["outputCompressionQuality"]);t!==void 0&&y!=null&&C(t,["parameters","outputOptions","compressionQuality"],y);const j=w(e,["addWatermark"]);t!==void 0&&j!=null&&C(t,["parameters","addWatermark"],j);const _=w(e,["labels"]);t!==void 0&&_!=null&&C(t,["labels"],_);const N=w(e,["editMode"]);t!==void 0&&N!=null&&C(t,["parameters","editMode"],N);const E=w(e,["baseSteps"]);return t!==void 0&&E!=null&&C(t,["parameters","editConfig","baseSteps"],E),a}function Cfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));const i=w(t,["prompt"]);i!=null&&C(a,["instances[0]","prompt"],i);const l=w(t,["referenceImages"]);if(l!=null){let d=l;Array.isArray(d)&&(d=d.map(u=>jpe(u))),C(a,["instances[0]","referenceImages"],d)}const o=w(t,["config"]);return o!=null&&Nfe(o,a),a}function kfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["predictions"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>av(l))),C(r,["generatedImages"],i)}return r}function jfe(e,t,r){const a={},s=w(e,["taskType"]);t!==void 0&&s!=null&&C(t,["requests[]","taskType"],s);const i=w(e,["title"]);t!==void 0&&i!=null&&C(t,["requests[]","title"],i);const l=w(e,["outputDimensionality"]);if(t!==void 0&&l!=null&&C(t,["requests[]","outputDimensionality"],l),w(e,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(w(e,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return a}function Efe(e,t,r){const a={};let s=w(r,["embeddingApiType"]);if(s===void 0&&(s="PREDICT"),s==="PREDICT"){const u=w(e,["taskType"]);t!==void 0&&u!=null&&C(t,["instances[]","task_type"],u)}else if(s==="EMBED_CONTENT"){const u=w(e,["taskType"]);t!==void 0&&u!=null&&C(t,["taskType"],u)}let i=w(r,["embeddingApiType"]);if(i===void 0&&(i="PREDICT"),i==="PREDICT"){const u=w(e,["title"]);t!==void 0&&u!=null&&C(t,["instances[]","title"],u)}else if(i==="EMBED_CONTENT"){const u=w(e,["title"]);t!==void 0&&u!=null&&C(t,["title"],u)}let l=w(r,["embeddingApiType"]);if(l===void 0&&(l="PREDICT"),l==="PREDICT"){const u=w(e,["outputDimensionality"]);t!==void 0&&u!=null&&C(t,["parameters","outputDimensionality"],u)}else if(l==="EMBED_CONTENT"){const u=w(e,["outputDimensionality"]);t!==void 0&&u!=null&&C(t,["outputDimensionality"],u)}let o=w(r,["embeddingApiType"]);if(o===void 0&&(o="PREDICT"),o==="PREDICT"){const u=w(e,["mimeType"]);t!==void 0&&u!=null&&C(t,["instances[]","mimeType"],u)}let d=w(r,["embeddingApiType"]);if(d===void 0&&(d="PREDICT"),d==="PREDICT"){const u=w(e,["autoTruncate"]);t!==void 0&&u!=null&&C(t,["parameters","autoTruncate"],u)}else if(d==="EMBED_CONTENT"){const u=w(e,["autoTruncate"]);t!==void 0&&u!=null&&C(t,["autoTruncate"],u)}return a}function Sfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));const i=w(t,["contents"]);if(i!=null){let u=Wj(e,i);Array.isArray(u)&&(u=u.map(f=>f)),C(a,["requests[]","content"],u)}const l=w(t,["content"]);l!=null&&Jp(tn(l));const o=w(t,["config"]);o!=null&&jfe(o,a);const d=w(t,["model"]);return d!==void 0&&C(a,["requests[]","model"],rr(e,d)),a}function Bfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));let i=w(r,["embeddingApiType"]);if(i===void 0&&(i="PREDICT"),i==="PREDICT"){const d=w(t,["contents"]);if(d!=null){let u=Wj(e,d);Array.isArray(u)&&(u=u.map(f=>f)),C(a,["instances[]","content"],u)}}let l=w(r,["embeddingApiType"]);if(l===void 0&&(l="PREDICT"),l==="EMBED_CONTENT"){const d=w(t,["content"]);d!=null&&C(a,["content"],tn(d))}const o=w(t,["config"]);return o!=null&&Efe(o,a,r),a}function _fe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["embeddings"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(o=>o)),C(r,["embeddings"],l)}const i=w(e,["metadata"]);return i!=null&&C(r,["metadata"],i),r}function Tfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["predictions[]","embeddings"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(o=>dfe(o))),C(r,["embeddings"],l)}const i=w(e,["metadata"]);if(i!=null&&C(r,["metadata"],i),t&&w(t,["embeddingApiType"])==="EMBED_CONTENT"){const l=w(e,["embedding"]),o=w(e,["usageMetadata"]),d=w(e,["truncated"]);if(l){const u={};o&&o.promptTokenCount&&(u.tokenCount=o.promptTokenCount),d&&(u.truncated=d),l.statistics=u,C(r,["embeddings"],[l])}}return r}function Ife(e,t){const r={},a=w(e,["endpoint"]);a!=null&&C(r,["name"],a);const s=w(e,["deployedModelId"]);return s!=null&&C(r,["deployedModelId"],s),r}function Ffe(e,t){const r={};if(w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=w(e,["fileUri"]);a!=null&&C(r,["fileUri"],a);const s=w(e,["mimeType"]);return s!=null&&C(r,["mimeType"],s),r}function Dfe(e,t){const r={},a=w(e,["id"]);a!=null&&C(r,["id"],a);const s=w(e,["args"]);s!=null&&C(r,["args"],s);const i=w(e,["name"]);if(i!=null&&C(r,["name"],i),w(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(w(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return r}function Ufe(e,t){const r={},a=w(e,["allowedFunctionNames"]);a!=null&&C(r,["allowedFunctionNames"],a);const s=w(e,["mode"]);if(s!=null&&C(r,["mode"],s),w(e,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return r}function Mfe(e,t){const r={},a=w(e,["description"]);a!=null&&C(r,["description"],a);const s=w(e,["name"]);s!=null&&C(r,["name"],s);const i=w(e,["parameters"]);i!=null&&C(r,["parameters"],i);const l=w(e,["parametersJsonSchema"]);l!=null&&C(r,["parametersJsonSchema"],l);const o=w(e,["response"]);o!=null&&C(r,["response"],o);const d=w(e,["responseJsonSchema"]);if(d!=null&&C(r,["responseJsonSchema"],d),w(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return r}function Rfe(e,t,r,a){const s={},i=w(t,["systemInstruction"]);r!==void 0&&i!=null&&C(r,["systemInstruction"],Jp(tn(i)));const l=w(t,["temperature"]);l!=null&&C(s,["temperature"],l);const o=w(t,["topP"]);o!=null&&C(s,["topP"],o);const d=w(t,["topK"]);d!=null&&C(s,["topK"],d);const u=w(t,["candidateCount"]);u!=null&&C(s,["candidateCount"],u);const f=w(t,["maxOutputTokens"]);f!=null&&C(s,["maxOutputTokens"],f);const p=w(t,["stopSequences"]);p!=null&&C(s,["stopSequences"],p);const h=w(t,["responseLogprobs"]);h!=null&&C(s,["responseLogprobs"],h);const m=w(t,["logprobs"]);m!=null&&C(s,["logprobs"],m);const b=w(t,["presencePenalty"]);b!=null&&C(s,["presencePenalty"],b);const v=w(t,["frequencyPenalty"]);v!=null&&C(s,["frequencyPenalty"],v);const y=w(t,["seed"]);y!=null&&C(s,["seed"],y);const j=w(t,["responseMimeType"]);j!=null&&C(s,["responseMimeType"],j);const _=w(t,["responseSchema"]);_!=null&&C(s,["responseSchema"],Yj(_));const N=w(t,["responseJsonSchema"]);if(N!=null&&C(s,["responseJsonSchema"],N),w(t,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(w(t,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const E=w(t,["safetySettings"]);if(r!==void 0&&E!=null){let Q=E;Array.isArray(Q)&&(Q=Q.map(H=>Epe(H))),C(r,["safetySettings"],Q)}const T=w(t,["tools"]);if(r!==void 0&&T!=null){let Q=e0(T);Array.isArray(Q)&&(Q=Q.map(H=>Dpe(ZA(H)))),C(r,["tools"],Q)}const B=w(t,["toolConfig"]);if(r!==void 0&&B!=null&&C(r,["toolConfig"],Fpe(B)),w(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const F=w(t,["cachedContent"]);r!==void 0&&F!=null&&C(r,["cachedContent"],Mo(e,F));const R=w(t,["responseModalities"]);R!=null&&C(s,["responseModalities"],R);const U=w(t,["mediaResolution"]);U!=null&&C(s,["mediaResolution"],U);const D=w(t,["speechConfig"]);if(D!=null&&C(s,["speechConfig"],Xj(D)),w(t,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const L=w(t,["thinkingConfig"]);L!=null&&C(s,["thinkingConfig"],L);const P=w(t,["imageConfig"]);P!=null&&C(s,["imageConfig"],dpe(P));const G=w(t,["enableEnhancedCivicAnswers"]);if(G!=null&&C(s,["enableEnhancedCivicAnswers"],G),w(t,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");return s}function Ofe(e,t,r,a){const s={},i=w(t,["systemInstruction"]);r!==void 0&&i!=null&&C(r,["systemInstruction"],tn(i));const l=w(t,["temperature"]);l!=null&&C(s,["temperature"],l);const o=w(t,["topP"]);o!=null&&C(s,["topP"],o);const d=w(t,["topK"]);d!=null&&C(s,["topK"],d);const u=w(t,["candidateCount"]);u!=null&&C(s,["candidateCount"],u);const f=w(t,["maxOutputTokens"]);f!=null&&C(s,["maxOutputTokens"],f);const p=w(t,["stopSequences"]);p!=null&&C(s,["stopSequences"],p);const h=w(t,["responseLogprobs"]);h!=null&&C(s,["responseLogprobs"],h);const m=w(t,["logprobs"]);m!=null&&C(s,["logprobs"],m);const b=w(t,["presencePenalty"]);b!=null&&C(s,["presencePenalty"],b);const v=w(t,["frequencyPenalty"]);v!=null&&C(s,["frequencyPenalty"],v);const y=w(t,["seed"]);y!=null&&C(s,["seed"],y);const j=w(t,["responseMimeType"]);j!=null&&C(s,["responseMimeType"],j);const _=w(t,["responseSchema"]);_!=null&&C(s,["responseSchema"],Yj(_));const N=w(t,["responseJsonSchema"]);N!=null&&C(s,["responseJsonSchema"],N);const E=w(t,["routingConfig"]);E!=null&&C(s,["routingConfig"],E);const T=w(t,["modelSelectionConfig"]);T!=null&&C(s,["modelConfig"],T);const B=w(t,["safetySettings"]);if(r!==void 0&&B!=null){let ee=B;Array.isArray(ee)&&(ee=ee.map(W=>W)),C(r,["safetySettings"],ee)}const F=w(t,["tools"]);if(r!==void 0&&F!=null){let ee=e0(F);Array.isArray(ee)&&(ee=ee.map(W=>KL(ZA(W)))),C(r,["tools"],ee)}const R=w(t,["toolConfig"]);r!==void 0&&R!=null&&C(r,["toolConfig"],R);const U=w(t,["labels"]);r!==void 0&&U!=null&&C(r,["labels"],U);const D=w(t,["cachedContent"]);r!==void 0&&D!=null&&C(r,["cachedContent"],Mo(e,D));const L=w(t,["responseModalities"]);L!=null&&C(s,["responseModalities"],L);const P=w(t,["mediaResolution"]);P!=null&&C(s,["mediaResolution"],P);const G=w(t,["speechConfig"]);G!=null&&C(s,["speechConfig"],Xj(G));const Q=w(t,["audioTimestamp"]);Q!=null&&C(s,["audioTimestamp"],Q);const H=w(t,["thinkingConfig"]);H!=null&&C(s,["thinkingConfig"],H);const X=w(t,["imageConfig"]);if(X!=null&&C(s,["imageConfig"],upe(X)),w(t,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");const K=w(t,["modelArmorConfig"]);return r!==void 0&&K!=null&&C(r,["modelArmorConfig"],K),s}function G3(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));const i=w(t,["contents"]);if(i!=null){let o=Ls(i);Array.isArray(o)&&(o=o.map(d=>Jp(d))),C(a,["contents"],o)}const l=w(t,["config"]);return l!=null&&C(a,["generationConfig"],Rfe(e,l,a)),a}function K3(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));const i=w(t,["contents"]);if(i!=null){let o=Ls(i);Array.isArray(o)&&(o=o.map(d=>d)),C(a,["contents"],o)}const l=w(t,["config"]);return l!=null&&C(a,["generationConfig"],Ofe(e,l,a)),a}function q3(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["candidates"]);if(s!=null){let u=s;Array.isArray(u)&&(u=u.map(f=>ife(f))),C(r,["candidates"],u)}const i=w(e,["modelVersion"]);i!=null&&C(r,["modelVersion"],i);const l=w(e,["promptFeedback"]);l!=null&&C(r,["promptFeedback"],l);const o=w(e,["responseId"]);o!=null&&C(r,["responseId"],o);const d=w(e,["usageMetadata"]);return d!=null&&C(r,["usageMetadata"],d),r}function W3(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["candidates"]);if(s!=null){let f=s;Array.isArray(f)&&(f=f.map(p=>p)),C(r,["candidates"],f)}const i=w(e,["createTime"]);i!=null&&C(r,["createTime"],i);const l=w(e,["modelVersion"]);l!=null&&C(r,["modelVersion"],l);const o=w(e,["promptFeedback"]);o!=null&&C(r,["promptFeedback"],o);const d=w(e,["responseId"]);d!=null&&C(r,["responseId"],d);const u=w(e,["usageMetadata"]);return u!=null&&C(r,["usageMetadata"],u),r}function Pfe(e,t,r){const a={};if(w(e,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(w(e,["negativePrompt"])!==void 0)throw new Error("negativePrompt parameter is not supported in Gemini API.");const s=w(e,["numberOfImages"]);t!==void 0&&s!=null&&C(t,["parameters","sampleCount"],s);const i=w(e,["aspectRatio"]);t!==void 0&&i!=null&&C(t,["parameters","aspectRatio"],i);const l=w(e,["guidanceScale"]);if(t!==void 0&&l!=null&&C(t,["parameters","guidanceScale"],l),w(e,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const o=w(e,["safetyFilterLevel"]);t!==void 0&&o!=null&&C(t,["parameters","safetySetting"],o);const d=w(e,["personGeneration"]);t!==void 0&&d!=null&&C(t,["parameters","personGeneration"],d);const u=w(e,["includeSafetyAttributes"]);t!==void 0&&u!=null&&C(t,["parameters","includeSafetyAttributes"],u);const f=w(e,["includeRaiReason"]);t!==void 0&&f!=null&&C(t,["parameters","includeRaiReason"],f);const p=w(e,["language"]);t!==void 0&&p!=null&&C(t,["parameters","language"],p);const h=w(e,["outputMimeType"]);t!==void 0&&h!=null&&C(t,["parameters","outputOptions","mimeType"],h);const m=w(e,["outputCompressionQuality"]);if(t!==void 0&&m!=null&&C(t,["parameters","outputOptions","compressionQuality"],m),w(e,["addWatermark"])!==void 0)throw new Error("addWatermark parameter is not supported in Gemini API.");if(w(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const b=w(e,["imageSize"]);if(t!==void 0&&b!=null&&C(t,["parameters","sampleImageSize"],b),w(e,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return a}function Lfe(e,t,r){const a={},s=w(e,["outputGcsUri"]);t!==void 0&&s!=null&&C(t,["parameters","storageUri"],s);const i=w(e,["negativePrompt"]);t!==void 0&&i!=null&&C(t,["parameters","negativePrompt"],i);const l=w(e,["numberOfImages"]);t!==void 0&&l!=null&&C(t,["parameters","sampleCount"],l);const o=w(e,["aspectRatio"]);t!==void 0&&o!=null&&C(t,["parameters","aspectRatio"],o);const d=w(e,["guidanceScale"]);t!==void 0&&d!=null&&C(t,["parameters","guidanceScale"],d);const u=w(e,["seed"]);t!==void 0&&u!=null&&C(t,["parameters","seed"],u);const f=w(e,["safetyFilterLevel"]);t!==void 0&&f!=null&&C(t,["parameters","safetySetting"],f);const p=w(e,["personGeneration"]);t!==void 0&&p!=null&&C(t,["parameters","personGeneration"],p);const h=w(e,["includeSafetyAttributes"]);t!==void 0&&h!=null&&C(t,["parameters","includeSafetyAttributes"],h);const m=w(e,["includeRaiReason"]);t!==void 0&&m!=null&&C(t,["parameters","includeRaiReason"],m);const b=w(e,["language"]);t!==void 0&&b!=null&&C(t,["parameters","language"],b);const v=w(e,["outputMimeType"]);t!==void 0&&v!=null&&C(t,["parameters","outputOptions","mimeType"],v);const y=w(e,["outputCompressionQuality"]);t!==void 0&&y!=null&&C(t,["parameters","outputOptions","compressionQuality"],y);const j=w(e,["addWatermark"]);t!==void 0&&j!=null&&C(t,["parameters","addWatermark"],j);const _=w(e,["labels"]);t!==void 0&&_!=null&&C(t,["labels"],_);const N=w(e,["imageSize"]);t!==void 0&&N!=null&&C(t,["parameters","sampleImageSize"],N);const E=w(e,["enhancePrompt"]);return t!==void 0&&E!=null&&C(t,["parameters","enhancePrompt"],E),a}function Qfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));const i=w(t,["prompt"]);i!=null&&C(a,["instances[0]","prompt"],i);const l=w(t,["config"]);return l!=null&&Pfe(l,a),a}function Hfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));const i=w(t,["prompt"]);i!=null&&C(a,["instances[0]","prompt"],i);const l=w(t,["config"]);return l!=null&&Lfe(l,a),a}function zfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["predictions"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(o=>tpe(o))),C(r,["generatedImages"],l)}const i=w(e,["positivePromptSafetyAttributes"]);return i!=null&&C(r,["positivePromptSafetyAttributes"],VL(i)),r}function $fe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["predictions"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(o=>av(o))),C(r,["generatedImages"],l)}const i=w(e,["positivePromptSafetyAttributes"]);return i!=null&&C(r,["positivePromptSafetyAttributes"],GL(i)),r}function Vfe(e,t,r){const a={},s=w(e,["numberOfVideos"]);if(t!==void 0&&s!=null&&C(t,["parameters","sampleCount"],s),w(e,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(w(e,["fps"])!==void 0)throw new Error("fps parameter is not supported in Gemini API.");const i=w(e,["durationSeconds"]);if(t!==void 0&&i!=null&&C(t,["parameters","durationSeconds"],i),w(e,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const l=w(e,["aspectRatio"]);t!==void 0&&l!=null&&C(t,["parameters","aspectRatio"],l);const o=w(e,["resolution"]);t!==void 0&&o!=null&&C(t,["parameters","resolution"],o);const d=w(e,["personGeneration"]);if(t!==void 0&&d!=null&&C(t,["parameters","personGeneration"],d),w(e,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is not supported in Gemini API.");const u=w(e,["negativePrompt"]);t!==void 0&&u!=null&&C(t,["parameters","negativePrompt"],u);const f=w(e,["enhancePrompt"]);if(t!==void 0&&f!=null&&C(t,["parameters","enhancePrompt"],f),w(e,["generateAudio"])!==void 0)throw new Error("generateAudio parameter is not supported in Gemini API.");const p=w(e,["lastFrame"]);t!==void 0&&p!=null&&C(t,["instances[0]","lastFrame"],nv(p));const h=w(e,["referenceImages"]);if(t!==void 0&&h!=null){let m=h;Array.isArray(m)&&(m=m.map(b=>Kpe(b))),C(t,["instances[0]","referenceImages"],m)}if(w(e,["mask"])!==void 0)throw new Error("mask parameter is not supported in Gemini API.");if(w(e,["compressionQuality"])!==void 0)throw new Error("compressionQuality parameter is not supported in Gemini API.");return a}function Gfe(e,t,r){const a={},s=w(e,["numberOfVideos"]);t!==void 0&&s!=null&&C(t,["parameters","sampleCount"],s);const i=w(e,["outputGcsUri"]);t!==void 0&&i!=null&&C(t,["parameters","storageUri"],i);const l=w(e,["fps"]);t!==void 0&&l!=null&&C(t,["parameters","fps"],l);const o=w(e,["durationSeconds"]);t!==void 0&&o!=null&&C(t,["parameters","durationSeconds"],o);const d=w(e,["seed"]);t!==void 0&&d!=null&&C(t,["parameters","seed"],d);const u=w(e,["aspectRatio"]);t!==void 0&&u!=null&&C(t,["parameters","aspectRatio"],u);const f=w(e,["resolution"]);t!==void 0&&f!=null&&C(t,["parameters","resolution"],f);const p=w(e,["personGeneration"]);t!==void 0&&p!=null&&C(t,["parameters","personGeneration"],p);const h=w(e,["pubsubTopic"]);t!==void 0&&h!=null&&C(t,["parameters","pubsubTopic"],h);const m=w(e,["negativePrompt"]);t!==void 0&&m!=null&&C(t,["parameters","negativePrompt"],m);const b=w(e,["enhancePrompt"]);t!==void 0&&b!=null&&C(t,["parameters","enhancePrompt"],b);const v=w(e,["generateAudio"]);t!==void 0&&v!=null&&C(t,["parameters","generateAudio"],v);const y=w(e,["lastFrame"]);t!==void 0&&y!=null&&C(t,["instances[0]","lastFrame"],Ji(y));const j=w(e,["referenceImages"]);if(t!==void 0&&j!=null){let E=j;Array.isArray(E)&&(E=E.map(T=>qpe(T))),C(t,["instances[0]","referenceImages"],E)}const _=w(e,["mask"]);t!==void 0&&_!=null&&C(t,["instances[0]","mask"],Gpe(_));const N=w(e,["compressionQuality"]);return t!==void 0&&N!=null&&C(t,["parameters","compressionQuality"],N),a}function Kfe(e,t){const r={},a=w(e,["name"]);a!=null&&C(r,["name"],a);const s=w(e,["metadata"]);s!=null&&C(r,["metadata"],s);const i=w(e,["done"]);i!=null&&C(r,["done"],i);const l=w(e,["error"]);l!=null&&C(r,["error"],l);const o=w(e,["response","generateVideoResponse"]);return o!=null&&C(r,["response"],Xfe(o)),r}function qfe(e,t){const r={},a=w(e,["name"]);a!=null&&C(r,["name"],a);const s=w(e,["metadata"]);s!=null&&C(r,["metadata"],s);const i=w(e,["done"]);i!=null&&C(r,["done"],i);const l=w(e,["error"]);l!=null&&C(r,["error"],l);const o=w(e,["response"]);return o!=null&&C(r,["response"],Jfe(o)),r}function Wfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));const i=w(t,["prompt"]);i!=null&&C(a,["instances[0]","prompt"],i);const l=w(t,["image"]);l!=null&&C(a,["instances[0]","image"],nv(l));const o=w(t,["video"]);o!=null&&C(a,["instances[0]","video"],qL(o));const d=w(t,["source"]);d!=null&&Zfe(d,a);const u=w(t,["config"]);return u!=null&&Vfe(u,a),a}function Yfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));const i=w(t,["prompt"]);i!=null&&C(a,["instances[0]","prompt"],i);const l=w(t,["image"]);l!=null&&C(a,["instances[0]","image"],Ji(l));const o=w(t,["video"]);o!=null&&C(a,["instances[0]","video"],WL(o));const d=w(t,["source"]);d!=null&&epe(d,a);const u=w(t,["config"]);return u!=null&&Gfe(u,a),a}function Xfe(e,t){const r={},a=w(e,["generatedSamples"]);if(a!=null){let l=a;Array.isArray(l)&&(l=l.map(o=>ape(o))),C(r,["generatedVideos"],l)}const s=w(e,["raiMediaFilteredCount"]);s!=null&&C(r,["raiMediaFilteredCount"],s);const i=w(e,["raiMediaFilteredReasons"]);return i!=null&&C(r,["raiMediaFilteredReasons"],i),r}function Jfe(e,t){const r={},a=w(e,["videos"]);if(a!=null){let l=a;Array.isArray(l)&&(l=l.map(o=>npe(o))),C(r,["generatedVideos"],l)}const s=w(e,["raiMediaFilteredCount"]);s!=null&&C(r,["raiMediaFilteredCount"],s);const i=w(e,["raiMediaFilteredReasons"]);return i!=null&&C(r,["raiMediaFilteredReasons"],i),r}function Zfe(e,t,r){const a={},s=w(e,["prompt"]);t!==void 0&&s!=null&&C(t,["instances[0]","prompt"],s);const i=w(e,["image"]);t!==void 0&&i!=null&&C(t,["instances[0]","image"],nv(i));const l=w(e,["video"]);return t!==void 0&&l!=null&&C(t,["instances[0]","video"],qL(l)),a}function epe(e,t,r){const a={},s=w(e,["prompt"]);t!==void 0&&s!=null&&C(t,["instances[0]","prompt"],s);const i=w(e,["image"]);t!==void 0&&i!=null&&C(t,["instances[0]","image"],Ji(i));const l=w(e,["video"]);return t!==void 0&&l!=null&&C(t,["instances[0]","video"],WL(l)),a}function tpe(e,t){const r={},a=w(e,["_self"]);a!=null&&C(r,["image"],Ape(a));const s=w(e,["raiFilteredReason"]);s!=null&&C(r,["raiFilteredReason"],s);const i=w(e,["_self"]);return i!=null&&C(r,["safetyAttributes"],VL(i)),r}function av(e,t){const r={},a=w(e,["_self"]);a!=null&&C(r,["image"],$L(a));const s=w(e,["raiFilteredReason"]);s!=null&&C(r,["raiFilteredReason"],s);const i=w(e,["_self"]);i!=null&&C(r,["safetyAttributes"],GL(i));const l=w(e,["prompt"]);return l!=null&&C(r,["enhancedPrompt"],l),r}function rpe(e,t){const r={},a=w(e,["_self"]);a!=null&&C(r,["mask"],$L(a));const s=w(e,["labels"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),C(r,["labels"],i)}return r}function ape(e,t){const r={},a=w(e,["video"]);return a!=null&&C(r,["video"],$pe(a)),r}function npe(e,t){const r={},a=w(e,["_self"]);return a!=null&&C(r,["video"],Vpe(a)),r}function spe(e,t){const r={},a=w(e,["modelSelectionConfig"]);a!=null&&C(r,["modelConfig"],a);const s=w(e,["responseJsonSchema"]);s!=null&&C(r,["responseJsonSchema"],s);const i=w(e,["audioTimestamp"]);i!=null&&C(r,["audioTimestamp"],i);const l=w(e,["candidateCount"]);l!=null&&C(r,["candidateCount"],l);const o=w(e,["enableAffectiveDialog"]);o!=null&&C(r,["enableAffectiveDialog"],o);const d=w(e,["frequencyPenalty"]);d!=null&&C(r,["frequencyPenalty"],d);const u=w(e,["logprobs"]);u!=null&&C(r,["logprobs"],u);const f=w(e,["maxOutputTokens"]);f!=null&&C(r,["maxOutputTokens"],f);const p=w(e,["mediaResolution"]);p!=null&&C(r,["mediaResolution"],p);const h=w(e,["presencePenalty"]);h!=null&&C(r,["presencePenalty"],h);const m=w(e,["responseLogprobs"]);m!=null&&C(r,["responseLogprobs"],m);const b=w(e,["responseMimeType"]);b!=null&&C(r,["responseMimeType"],b);const v=w(e,["responseModalities"]);v!=null&&C(r,["responseModalities"],v);const y=w(e,["responseSchema"]);y!=null&&C(r,["responseSchema"],y);const j=w(e,["routingConfig"]);j!=null&&C(r,["routingConfig"],j);const _=w(e,["seed"]);_!=null&&C(r,["seed"],_);const N=w(e,["speechConfig"]);N!=null&&C(r,["speechConfig"],N);const E=w(e,["stopSequences"]);E!=null&&C(r,["stopSequences"],E);const T=w(e,["temperature"]);T!=null&&C(r,["temperature"],T);const B=w(e,["thinkingConfig"]);B!=null&&C(r,["thinkingConfig"],B);const F=w(e,["topK"]);F!=null&&C(r,["topK"],F);const R=w(e,["topP"]);if(R!=null&&C(r,["topP"],R),w(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return r}function ipe(e,t,r){const a={},s=w(t,["model"]);return s!=null&&C(a,["_url","name"],rr(e,s)),a}function lpe(e,t,r){const a={},s=w(t,["model"]);return s!=null&&C(a,["_url","name"],rr(e,s)),a}function ope(e,t){const r={};if(w(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const a=w(e,["enableWidget"]);return a!=null&&C(r,["enableWidget"],a),r}function cpe(e,t){const r={};if(w(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(w(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const a=w(e,["timeRangeFilter"]);return a!=null&&C(r,["timeRangeFilter"],a),r}function dpe(e,t){const r={},a=w(e,["aspectRatio"]);a!=null&&C(r,["aspectRatio"],a);const s=w(e,["imageSize"]);if(s!=null&&C(r,["imageSize"],s),w(e,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(w(e,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(w(e,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");return r}function upe(e,t){const r={},a=w(e,["aspectRatio"]);a!=null&&C(r,["aspectRatio"],a);const s=w(e,["imageSize"]);s!=null&&C(r,["imageSize"],s);const i=w(e,["personGeneration"]);i!=null&&C(r,["personGeneration"],i);const l=w(e,["outputMimeType"]);l!=null&&C(r,["imageOutputOptions","mimeType"],l);const o=w(e,["outputCompressionQuality"]);return o!=null&&C(r,["imageOutputOptions","compressionQuality"],o),r}function Ape(e,t){const r={},a=w(e,["bytesBase64Encoded"]);a!=null&&C(r,["imageBytes"],Vc(a));const s=w(e,["mimeType"]);return s!=null&&C(r,["mimeType"],s),r}function $L(e,t){const r={},a=w(e,["gcsUri"]);a!=null&&C(r,["gcsUri"],a);const s=w(e,["bytesBase64Encoded"]);s!=null&&C(r,["imageBytes"],Vc(s));const i=w(e,["mimeType"]);return i!=null&&C(r,["mimeType"],i),r}function nv(e,t){const r={};if(w(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");const a=w(e,["imageBytes"]);a!=null&&C(r,["bytesBase64Encoded"],Vc(a));const s=w(e,["mimeType"]);return s!=null&&C(r,["mimeType"],s),r}function Ji(e,t){const r={},a=w(e,["gcsUri"]);a!=null&&C(r,["gcsUri"],a);const s=w(e,["imageBytes"]);s!=null&&C(r,["bytesBase64Encoded"],Vc(s));const i=w(e,["mimeType"]);return i!=null&&C(r,["mimeType"],i),r}function fpe(e,t,r,a){const s={},i=w(t,["pageSize"]);r!==void 0&&i!=null&&C(r,["_query","pageSize"],i);const l=w(t,["pageToken"]);r!==void 0&&l!=null&&C(r,["_query","pageToken"],l);const o=w(t,["filter"]);r!==void 0&&o!=null&&C(r,["_query","filter"],o);const d=w(t,["queryBase"]);return r!==void 0&&d!=null&&C(r,["_url","models_url"],RL(e,d)),s}function ppe(e,t,r,a){const s={},i=w(t,["pageSize"]);r!==void 0&&i!=null&&C(r,["_query","pageSize"],i);const l=w(t,["pageToken"]);r!==void 0&&l!=null&&C(r,["_query","pageToken"],l);const o=w(t,["filter"]);r!==void 0&&o!=null&&C(r,["_query","filter"],o);const d=w(t,["queryBase"]);return r!==void 0&&d!=null&&C(r,["_url","models_url"],RL(e,d)),s}function xpe(e,t,r){const a={},s=w(t,["config"]);return s!=null&&fpe(e,s,a),a}function hpe(e,t,r){const a={},s=w(t,["config"]);return s!=null&&ppe(e,s,a),a}function mpe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["nextPageToken"]);s!=null&&C(r,["nextPageToken"],s);const i=w(e,["_self"]);if(i!=null){let l=OL(i);Array.isArray(l)&&(l=l.map(o=>pC(o))),C(r,["models"],l)}return r}function gpe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["nextPageToken"]);s!=null&&C(r,["nextPageToken"],s);const i=w(e,["_self"]);if(i!=null){let l=OL(i);Array.isArray(l)&&(l=l.map(o=>xC(o))),C(r,["models"],l)}return r}function bpe(e,t){const r={},a=w(e,["maskMode"]);a!=null&&C(r,["maskMode"],a);const s=w(e,["segmentationClasses"]);s!=null&&C(r,["maskClasses"],s);const i=w(e,["maskDilation"]);return i!=null&&C(r,["dilation"],i),r}function pC(e,t){const r={},a=w(e,["name"]);a!=null&&C(r,["name"],a);const s=w(e,["displayName"]);s!=null&&C(r,["displayName"],s);const i=w(e,["description"]);i!=null&&C(r,["description"],i);const l=w(e,["version"]);l!=null&&C(r,["version"],l);const o=w(e,["_self"]);o!=null&&C(r,["tunedModelInfo"],Upe(o));const d=w(e,["inputTokenLimit"]);d!=null&&C(r,["inputTokenLimit"],d);const u=w(e,["outputTokenLimit"]);u!=null&&C(r,["outputTokenLimit"],u);const f=w(e,["supportedGenerationMethods"]);f!=null&&C(r,["supportedActions"],f);const p=w(e,["temperature"]);p!=null&&C(r,["temperature"],p);const h=w(e,["maxTemperature"]);h!=null&&C(r,["maxTemperature"],h);const m=w(e,["topP"]);m!=null&&C(r,["topP"],m);const b=w(e,["topK"]);b!=null&&C(r,["topK"],b);const v=w(e,["thinking"]);return v!=null&&C(r,["thinking"],v),r}function xC(e,t){const r={},a=w(e,["name"]);a!=null&&C(r,["name"],a);const s=w(e,["displayName"]);s!=null&&C(r,["displayName"],s);const i=w(e,["description"]);i!=null&&C(r,["description"],i);const l=w(e,["versionId"]);l!=null&&C(r,["version"],l);const o=w(e,["deployedModels"]);if(o!=null){let h=o;Array.isArray(h)&&(h=h.map(m=>Ife(m))),C(r,["endpoints"],h)}const d=w(e,["labels"]);d!=null&&C(r,["labels"],d);const u=w(e,["_self"]);u!=null&&C(r,["tunedModelInfo"],Mpe(u));const f=w(e,["defaultCheckpointId"]);f!=null&&C(r,["defaultCheckpointId"],f);const p=w(e,["checkpoints"]);if(p!=null){let h=p;Array.isArray(h)&&(h=h.map(m=>m)),C(r,["checkpoints"],h)}return r}function vpe(e,t){const r={},a=w(e,["mediaResolution"]);a!=null&&C(r,["mediaResolution"],a);const s=w(e,["codeExecutionResult"]);s!=null&&C(r,["codeExecutionResult"],s);const i=w(e,["executableCode"]);i!=null&&C(r,["executableCode"],i);const l=w(e,["fileData"]);l!=null&&C(r,["fileData"],Ffe(l));const o=w(e,["functionCall"]);o!=null&&C(r,["functionCall"],Dfe(o));const d=w(e,["functionResponse"]);d!=null&&C(r,["functionResponse"],d);const u=w(e,["inlineData"]);u!=null&&C(r,["inlineData"],sfe(u));const f=w(e,["text"]);f!=null&&C(r,["text"],f);const p=w(e,["thought"]);p!=null&&C(r,["thought"],p);const h=w(e,["thoughtSignature"]);h!=null&&C(r,["thoughtSignature"],h);const m=w(e,["videoMetadata"]);return m!=null&&C(r,["videoMetadata"],m),r}function ype(e,t){const r={},a=w(e,["productImage"]);return a!=null&&C(r,["image"],Ji(a)),r}function wpe(e,t,r){const a={},s=w(e,["numberOfImages"]);t!==void 0&&s!=null&&C(t,["parameters","sampleCount"],s);const i=w(e,["baseSteps"]);t!==void 0&&i!=null&&C(t,["parameters","baseSteps"],i);const l=w(e,["outputGcsUri"]);t!==void 0&&l!=null&&C(t,["parameters","storageUri"],l);const o=w(e,["seed"]);t!==void 0&&o!=null&&C(t,["parameters","seed"],o);const d=w(e,["safetyFilterLevel"]);t!==void 0&&d!=null&&C(t,["parameters","safetySetting"],d);const u=w(e,["personGeneration"]);t!==void 0&&u!=null&&C(t,["parameters","personGeneration"],u);const f=w(e,["addWatermark"]);t!==void 0&&f!=null&&C(t,["parameters","addWatermark"],f);const p=w(e,["outputMimeType"]);t!==void 0&&p!=null&&C(t,["parameters","outputOptions","mimeType"],p);const h=w(e,["outputCompressionQuality"]);t!==void 0&&h!=null&&C(t,["parameters","outputOptions","compressionQuality"],h);const m=w(e,["enhancePrompt"]);t!==void 0&&m!=null&&C(t,["parameters","enhancePrompt"],m);const b=w(e,["labels"]);return t!==void 0&&b!=null&&C(t,["labels"],b),a}function Npe(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));const i=w(t,["source"]);i!=null&&kpe(i,a);const l=w(t,["config"]);return l!=null&&wpe(l,a),a}function Cpe(e,t){const r={},a=w(e,["predictions"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(i=>av(i))),C(r,["generatedImages"],s)}return r}function kpe(e,t,r){const a={},s=w(e,["prompt"]);t!==void 0&&s!=null&&C(t,["instances[0]","prompt"],s);const i=w(e,["personImage"]);t!==void 0&&i!=null&&C(t,["instances[0]","personImage","image"],Ji(i));const l=w(e,["productImages"]);if(t!==void 0&&l!=null){let o=l;Array.isArray(o)&&(o=o.map(d=>ype(d))),C(t,["instances[0]","productImages"],o)}return a}function jpe(e,t){const r={},a=w(e,["referenceImage"]);a!=null&&C(r,["referenceImage"],Ji(a));const s=w(e,["referenceId"]);s!=null&&C(r,["referenceId"],s);const i=w(e,["referenceType"]);i!=null&&C(r,["referenceType"],i);const l=w(e,["maskImageConfig"]);l!=null&&C(r,["maskImageConfig"],bpe(l));const o=w(e,["controlImageConfig"]);o!=null&&C(r,["controlImageConfig"],Afe(o));const d=w(e,["styleImageConfig"]);d!=null&&C(r,["styleImageConfig"],d);const u=w(e,["subjectImageConfig"]);return u!=null&&C(r,["subjectImageConfig"],u),r}function VL(e,t){const r={},a=w(e,["safetyAttributes","categories"]);a!=null&&C(r,["categories"],a);const s=w(e,["safetyAttributes","scores"]);s!=null&&C(r,["scores"],s);const i=w(e,["contentType"]);return i!=null&&C(r,["contentType"],i),r}function GL(e,t){const r={},a=w(e,["safetyAttributes","categories"]);a!=null&&C(r,["categories"],a);const s=w(e,["safetyAttributes","scores"]);s!=null&&C(r,["scores"],s);const i=w(e,["contentType"]);return i!=null&&C(r,["contentType"],i),r}function Epe(e,t){const r={},a=w(e,["category"]);if(a!=null&&C(r,["category"],a),w(e,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const s=w(e,["threshold"]);return s!=null&&C(r,["threshold"],s),r}function Spe(e,t){const r={},a=w(e,["image"]);return a!=null&&C(r,["image"],Ji(a)),r}function Bpe(e,t,r){const a={},s=w(e,["mode"]);t!==void 0&&s!=null&&C(t,["parameters","mode"],s);const i=w(e,["maxPredictions"]);t!==void 0&&i!=null&&C(t,["parameters","maxPredictions"],i);const l=w(e,["confidenceThreshold"]);t!==void 0&&l!=null&&C(t,["parameters","confidenceThreshold"],l);const o=w(e,["maskDilation"]);t!==void 0&&o!=null&&C(t,["parameters","maskDilation"],o);const d=w(e,["binaryColorThreshold"]);t!==void 0&&d!=null&&C(t,["parameters","binaryColorThreshold"],d);const u=w(e,["labels"]);return t!==void 0&&u!=null&&C(t,["labels"],u),a}function _pe(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));const i=w(t,["source"]);i!=null&&Ipe(i,a);const l=w(t,["config"]);return l!=null&&Bpe(l,a),a}function Tpe(e,t){const r={},a=w(e,["predictions"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(i=>rpe(i))),C(r,["generatedMasks"],s)}return r}function Ipe(e,t,r){const a={},s=w(e,["prompt"]);t!==void 0&&s!=null&&C(t,["instances[0]","prompt"],s);const i=w(e,["image"]);t!==void 0&&i!=null&&C(t,["instances[0]","image"],Ji(i));const l=w(e,["scribbleImage"]);return t!==void 0&&l!=null&&C(t,["instances[0]","scribble"],Spe(l)),a}function Fpe(e,t){const r={},a=w(e,["retrievalConfig"]);a!=null&&C(r,["retrievalConfig"],a);const s=w(e,["functionCallingConfig"]);return s!=null&&C(r,["functionCallingConfig"],Ufe(s)),r}function Dpe(e,t){const r={};if(w(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const a=w(e,["computerUse"]);a!=null&&C(r,["computerUse"],a);const s=w(e,["fileSearch"]);s!=null&&C(r,["fileSearch"],s);const i=w(e,["codeExecution"]);if(i!=null&&C(r,["codeExecution"],i),w(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const l=w(e,["functionDeclarations"]);if(l!=null){let p=l;Array.isArray(p)&&(p=p.map(h=>h)),C(r,["functionDeclarations"],p)}const o=w(e,["googleMaps"]);o!=null&&C(r,["googleMaps"],ope(o));const d=w(e,["googleSearch"]);d!=null&&C(r,["googleSearch"],cpe(d));const u=w(e,["googleSearchRetrieval"]);u!=null&&C(r,["googleSearchRetrieval"],u);const f=w(e,["urlContext"]);return f!=null&&C(r,["urlContext"],f),r}function KL(e,t){const r={},a=w(e,["retrieval"]);a!=null&&C(r,["retrieval"],a);const s=w(e,["computerUse"]);if(s!=null&&C(r,["computerUse"],s),w(e,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const i=w(e,["codeExecution"]);i!=null&&C(r,["codeExecution"],i);const l=w(e,["enterpriseWebSearch"]);l!=null&&C(r,["enterpriseWebSearch"],l);const o=w(e,["functionDeclarations"]);if(o!=null){let h=o;Array.isArray(h)&&(h=h.map(m=>Mfe(m))),C(r,["functionDeclarations"],h)}const d=w(e,["googleMaps"]);d!=null&&C(r,["googleMaps"],d);const u=w(e,["googleSearch"]);u!=null&&C(r,["googleSearch"],u);const f=w(e,["googleSearchRetrieval"]);f!=null&&C(r,["googleSearchRetrieval"],f);const p=w(e,["urlContext"]);return p!=null&&C(r,["urlContext"],p),r}function Upe(e,t){const r={},a=w(e,["baseModel"]);a!=null&&C(r,["baseModel"],a);const s=w(e,["createTime"]);s!=null&&C(r,["createTime"],s);const i=w(e,["updateTime"]);return i!=null&&C(r,["updateTime"],i),r}function Mpe(e,t){const r={},a=w(e,["labels","google-vertex-llm-tuning-base-model-id"]);a!=null&&C(r,["baseModel"],a);const s=w(e,["createTime"]);s!=null&&C(r,["createTime"],s);const i=w(e,["updateTime"]);return i!=null&&C(r,["updateTime"],i),r}function Rpe(e,t,r){const a={},s=w(e,["displayName"]);t!==void 0&&s!=null&&C(t,["displayName"],s);const i=w(e,["description"]);t!==void 0&&i!=null&&C(t,["description"],i);const l=w(e,["defaultCheckpointId"]);return t!==void 0&&l!=null&&C(t,["defaultCheckpointId"],l),a}function Ope(e,t,r){const a={},s=w(e,["displayName"]);t!==void 0&&s!=null&&C(t,["displayName"],s);const i=w(e,["description"]);t!==void 0&&i!=null&&C(t,["description"],i);const l=w(e,["defaultCheckpointId"]);return t!==void 0&&l!=null&&C(t,["defaultCheckpointId"],l),a}function Ppe(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","name"],rr(e,s));const i=w(t,["config"]);return i!=null&&Rpe(i,a),a}function Lpe(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));const i=w(t,["config"]);return i!=null&&Ope(i,a),a}function Qpe(e,t,r){const a={},s=w(e,["outputGcsUri"]);t!==void 0&&s!=null&&C(t,["parameters","storageUri"],s);const i=w(e,["safetyFilterLevel"]);t!==void 0&&i!=null&&C(t,["parameters","safetySetting"],i);const l=w(e,["personGeneration"]);t!==void 0&&l!=null&&C(t,["parameters","personGeneration"],l);const o=w(e,["includeRaiReason"]);t!==void 0&&o!=null&&C(t,["parameters","includeRaiReason"],o);const d=w(e,["outputMimeType"]);t!==void 0&&d!=null&&C(t,["parameters","outputOptions","mimeType"],d);const u=w(e,["outputCompressionQuality"]);t!==void 0&&u!=null&&C(t,["parameters","outputOptions","compressionQuality"],u);const f=w(e,["enhanceInputImage"]);t!==void 0&&f!=null&&C(t,["parameters","upscaleConfig","enhanceInputImage"],f);const p=w(e,["imagePreservationFactor"]);t!==void 0&&p!=null&&C(t,["parameters","upscaleConfig","imagePreservationFactor"],p);const h=w(e,["labels"]);t!==void 0&&h!=null&&C(t,["labels"],h);const m=w(e,["numberOfImages"]);t!==void 0&&m!=null&&C(t,["parameters","sampleCount"],m);const b=w(e,["mode"]);return t!==void 0&&b!=null&&C(t,["parameters","mode"],b),a}function Hpe(e,t,r){const a={},s=w(t,["model"]);s!=null&&C(a,["_url","model"],rr(e,s));const i=w(t,["image"]);i!=null&&C(a,["instances[0]","image"],Ji(i));const l=w(t,["upscaleFactor"]);l!=null&&C(a,["parameters","upscaleConfig","upscaleFactor"],l);const o=w(t,["config"]);return o!=null&&Qpe(o,a),a}function zpe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["predictions"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>av(l))),C(r,["generatedImages"],i)}return r}function $pe(e,t){const r={},a=w(e,["uri"]);a!=null&&C(r,["uri"],a);const s=w(e,["encodedVideo"]);s!=null&&C(r,["videoBytes"],Vc(s));const i=w(e,["encoding"]);return i!=null&&C(r,["mimeType"],i),r}function Vpe(e,t){const r={},a=w(e,["gcsUri"]);a!=null&&C(r,["uri"],a);const s=w(e,["bytesBase64Encoded"]);s!=null&&C(r,["videoBytes"],Vc(s));const i=w(e,["mimeType"]);return i!=null&&C(r,["mimeType"],i),r}function Gpe(e,t){const r={},a=w(e,["image"]);a!=null&&C(r,["_self"],Ji(a));const s=w(e,["maskMode"]);return s!=null&&C(r,["maskMode"],s),r}function Kpe(e,t){const r={},a=w(e,["image"]);a!=null&&C(r,["image"],nv(a));const s=w(e,["referenceType"]);return s!=null&&C(r,["referenceType"],s),r}function qpe(e,t){const r={},a=w(e,["image"]);a!=null&&C(r,["image"],Ji(a));const s=w(e,["referenceType"]);return s!=null&&C(r,["referenceType"],s),r}function qL(e,t){const r={},a=w(e,["uri"]);a!=null&&C(r,["uri"],a);const s=w(e,["videoBytes"]);s!=null&&C(r,["encodedVideo"],Vc(s));const i=w(e,["mimeType"]);return i!=null&&C(r,["encoding"],i),r}function WL(e,t){const r={},a=w(e,["uri"]);a!=null&&C(r,["gcsUri"],a);const s=w(e,["videoBytes"]);s!=null&&C(r,["bytesBase64Encoded"],Vc(s));const i=w(e,["mimeType"]);return i!=null&&C(r,["mimeType"],i),r}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Wpe(e,t){const r={},a=w(e,["displayName"]);return t!==void 0&&a!=null&&C(t,["displayName"],a),r}function Ype(e){const t={},r=w(e,["config"]);return r!=null&&Wpe(r,t),t}function Xpe(e,t){const r={},a=w(e,["force"]);return t!==void 0&&a!=null&&C(t,["_query","force"],a),r}function Jpe(e){const t={},r=w(e,["name"]);r!=null&&C(t,["_url","name"],r);const a=w(e,["config"]);return a!=null&&Xpe(a,t),t}function Zpe(e){const t={},r=w(e,["name"]);return r!=null&&C(t,["_url","name"],r),t}function exe(e,t){const r={},a=w(e,["customMetadata"]);if(t!==void 0&&a!=null){let i=a;Array.isArray(i)&&(i=i.map(l=>l)),C(t,["customMetadata"],i)}const s=w(e,["chunkingConfig"]);return t!==void 0&&s!=null&&C(t,["chunkingConfig"],s),r}function txe(e){const t={},r=w(e,["name"]);r!=null&&C(t,["name"],r);const a=w(e,["metadata"]);a!=null&&C(t,["metadata"],a);const s=w(e,["done"]);s!=null&&C(t,["done"],s);const i=w(e,["error"]);i!=null&&C(t,["error"],i);const l=w(e,["response"]);return l!=null&&C(t,["response"],axe(l)),t}function rxe(e){const t={},r=w(e,["fileSearchStoreName"]);r!=null&&C(t,["_url","file_search_store_name"],r);const a=w(e,["fileName"]);a!=null&&C(t,["fileName"],a);const s=w(e,["config"]);return s!=null&&exe(s,t),t}function axe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&C(t,["sdkHttpResponse"],r);const a=w(e,["parent"]);a!=null&&C(t,["parent"],a);const s=w(e,["documentName"]);return s!=null&&C(t,["documentName"],s),t}function nxe(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&C(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);return t!==void 0&&s!=null&&C(t,["_query","pageToken"],s),r}function sxe(e){const t={},r=w(e,["config"]);return r!=null&&nxe(r,t),t}function ixe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&C(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&C(t,["nextPageToken"],a);const s=w(e,["fileSearchStores"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),C(t,["fileSearchStores"],i)}return t}function YL(e,t){const r={},a=w(e,["mimeType"]);t!==void 0&&a!=null&&C(t,["mimeType"],a);const s=w(e,["displayName"]);t!==void 0&&s!=null&&C(t,["displayName"],s);const i=w(e,["customMetadata"]);if(t!==void 0&&i!=null){let o=i;Array.isArray(o)&&(o=o.map(d=>d)),C(t,["customMetadata"],o)}const l=w(e,["chunkingConfig"]);return t!==void 0&&l!=null&&C(t,["chunkingConfig"],l),r}function lxe(e){const t={},r=w(e,["fileSearchStoreName"]);r!=null&&C(t,["_url","file_search_store_name"],r);const a=w(e,["config"]);return a!=null&&YL(a,t),t}function oxe(e){const t={},r=w(e,["sdkHttpResponse"]);return r!=null&&C(t,["sdkHttpResponse"],r),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const cxe="Content-Type",dxe="X-Server-Timeout",uxe="User-Agent",hC="x-goog-api-client",Axe="1.42.0",fxe=`google-genai-sdk/${Axe}`,pxe="v1beta1",xxe="v1beta",hxe=5,mxe=[408,429,500,502,503,504];class gxe{constructor(t){var r,a,s;this.clientOptions=Object.assign({},t),this.customBaseUrl=(r=t.httpOptions)===null||r===void 0?void 0:r.baseUrl,this.clientOptions.vertexai&&(this.clientOptions.project&&this.clientOptions.location?this.clientOptions.apiKey=void 0:this.clientOptions.apiKey&&(this.clientOptions.project=void 0,this.clientOptions.location=void 0));const i={};if(this.clientOptions.vertexai){if(!this.clientOptions.location&&!this.clientOptions.apiKey&&!this.customBaseUrl&&(this.clientOptions.location="global"),!(this.clientOptions.project&&this.clientOptions.location||this.clientOptions.apiKey)&&!this.customBaseUrl)throw new Error("Authentication is not set up. Please provide either a project and location, or an API key, or a custom base URL.");const o=t.project&&t.location||!!t.apiKey;this.customBaseUrl&&!o?(i.baseUrl=this.customBaseUrl,this.clientOptions.project=void 0,this.clientOptions.location=void 0):this.clientOptions.apiKey||this.clientOptions.location==="global"?i.baseUrl="https://aiplatform.googleapis.com/":this.clientOptions.project&&this.clientOptions.location&&(i.baseUrl=`https://${this.clientOptions.location}-aiplatform.googleapis.com/`),i.apiVersion=(a=this.clientOptions.apiVersion)!==null&&a!==void 0?a:pxe}else{if(!this.clientOptions.apiKey)throw new pp({message:"API key must be set when using the Gemini API.",status:403});i.apiVersion=(s=this.clientOptions.apiVersion)!==null&&s!==void 0?s:xxe,i.baseUrl="https://generativelanguage.googleapis.com/"}i.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=i,t.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(i,t.httpOptions))}isVertexAI(){var t;return(t=this.clientOptions.vertexai)!==null&&t!==void 0?t:!1}getProject(){return this.clientOptions.project}getLocation(){return this.clientOptions.location}getCustomBaseUrl(){return this.customBaseUrl}async getAuthHeaders(){const t=new Headers;return await this.clientOptions.auth.addAuthHeaders(t),t}getApiVersion(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.apiVersion!==void 0)return this.clientOptions.httpOptions.apiVersion;throw new Error("API version is not set.")}getBaseUrl(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.baseUrl!==void 0)return this.clientOptions.httpOptions.baseUrl;throw new Error("Base URL is not set.")}getRequestUrl(){return this.getRequestUrlInternal(this.clientOptions.httpOptions)}getHeaders(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.headers!==void 0)return this.clientOptions.httpOptions.headers;throw new Error("Headers are not set.")}getRequestUrlInternal(t){if(!t||t.baseUrl===void 0||t.apiVersion===void 0)throw new Error("HTTP options are not correctly set.");const a=[t.baseUrl.endsWith("/")?t.baseUrl.slice(0,-1):t.baseUrl];return t.apiVersion&&t.apiVersion!==""&&a.push(t.apiVersion),a.join("/")}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){const t=this.getBaseUrl(),r=new URL(t);return r.protocol=r.protocol=="http:"?"ws":"wss",r.toString()}setBaseUrl(t){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=t;else throw new Error("HTTP options are not correctly set.")}constructUrl(t,r,a){const s=[this.getRequestUrlInternal(r)];return a&&s.push(this.getBaseResourcePath()),t!==""&&s.push(t),new URL(`${s.join("/")}`)}shouldPrependVertexProjectPath(t,r){return!(r.baseUrl&&r.baseUrlResourceScope===dC.COLLECTION||this.clientOptions.apiKey||!this.clientOptions.vertexai||t.path.startsWith("projects/")||t.httpMethod==="GET"&&t.path.startsWith("publishers/google/models"))}async request(t){let r=this.clientOptions.httpOptions;t.httpOptions&&(r=this.patchHttpOptions(this.clientOptions.httpOptions,t.httpOptions));const a=this.shouldPrependVertexProjectPath(t,r),s=this.constructUrl(t.path,r,a);if(t.queryParams)for(const[l,o]of Object.entries(t.queryParams))s.searchParams.append(l,String(o));let i={};if(t.httpMethod==="GET"){if(t.body&&t.body!=="{}")throw new Error("Request body should be empty for GET request, but got non empty request body")}else i.body=t.body;return i=await this.includeExtraHttpOptionsToRequestInit(i,r,s.toString(),t.abortSignal),this.unaryApiCall(s,i,t.httpMethod)}patchHttpOptions(t,r){const a=JSON.parse(JSON.stringify(t));for(const[s,i]of Object.entries(r))typeof i=="object"?a[s]=Object.assign(Object.assign({},a[s]),i):i!==void 0&&(a[s]=i);return a}async requestStream(t){let r=this.clientOptions.httpOptions;t.httpOptions&&(r=this.patchHttpOptions(this.clientOptions.httpOptions,t.httpOptions));const a=this.shouldPrependVertexProjectPath(t,r),s=this.constructUrl(t.path,r,a);(!s.searchParams.has("alt")||s.searchParams.get("alt")!=="sse")&&s.searchParams.set("alt","sse");let i={};return i.body=t.body,i=await this.includeExtraHttpOptionsToRequestInit(i,r,s.toString(),t.abortSignal),this.streamApiCall(s,i,t.httpMethod)}async includeExtraHttpOptionsToRequestInit(t,r,a,s){if(r&&r.timeout||s){const i=new AbortController,l=i.signal;if(r.timeout&&(r==null?void 0:r.timeout)>0){const o=setTimeout(()=>i.abort(),r.timeout);o&&typeof o.unref=="function"&&o.unref()}s&&s.addEventListener("abort",()=>{i.abort()}),t.signal=l}return r&&r.extraBody!==null&&bxe(t,r.extraBody),t.headers=await this.getHeadersInternal(r,a),t}async unaryApiCall(t,r,a){return this.apiCall(t.toString(),Object.assign(Object.assign({},r),{method:a})).then(async s=>(await Y3(s),new uC(s))).catch(s=>{throw s instanceof Error?s:new Error(JSON.stringify(s))})}async streamApiCall(t,r,a){return this.apiCall(t.toString(),Object.assign(Object.assign({},r),{method:a})).then(async s=>(await Y3(s),this.processStreamResponse(s))).catch(s=>{throw s instanceof Error?s:new Error(JSON.stringify(s))})}processStreamResponse(t){return zi(this,arguments,function*(){var a;const s=(a=t==null?void 0:t.body)===null||a===void 0?void 0:a.getReader(),i=new TextDecoder("utf-8");if(!s)throw new Error("Response body is empty");try{let l="";const o="data:",d=[`

`,"\r\r",`\r
\r
`];for(;;){const{done:u,value:f}=yield St(s.read());if(u){if(l.trim().length>0)throw new Error("Incomplete JSON segment at the end");break}const p=i.decode(f,{stream:!0});try{const b=JSON.parse(p);if("error"in b){const v=JSON.parse(JSON.stringify(b.error)),y=v.status,j=v.code,_=`got status: ${y}. ${JSON.stringify(b)}`;if(j>=400&&j<600)throw new pp({message:_,status:j})}}catch(b){if(b.name==="ApiError")throw b}l+=p;let h=-1,m=0;for(;;){h=-1,m=0;for(const y of d){const j=l.indexOf(y);j!==-1&&(h===-1||j<h)&&(h=j,m=y.length)}if(h===-1)break;const b=l.substring(0,h);l=l.substring(h+m);const v=b.trim();if(v.startsWith(o)){const y=v.substring(o.length).trim();try{const j=new Response(y,{headers:t==null?void 0:t.headers,status:t==null?void 0:t.status,statusText:t==null?void 0:t.statusText});yield yield St(new uC(j))}catch(j){throw new Error(`exception parsing stream chunk ${y}. ${j}`)}}}}}finally{s.releaseLock()}})}async apiCall(t,r){var a;if(!this.clientOptions.httpOptions||!this.clientOptions.httpOptions.retryOptions)return fetch(t,r);const s=this.clientOptions.httpOptions.retryOptions;return lue(async()=>{const l=await fetch(t,r);if(l.ok)return l;throw mxe.includes(l.status)?new Error(`Retryable HTTP Error: ${l.statusText}`):new SL.AbortError(`Non-retryable exception ${l.statusText} sending request`)},{retries:((a=s.attempts)!==null&&a!==void 0?a:hxe)-1})}getDefaultHeaders(){const t={},r=fxe+" "+this.clientOptions.userAgentExtra;return t[uxe]=r,t[hC]=r,t[cxe]="application/json",t}async getHeadersInternal(t,r){const a=new Headers;if(t&&t.headers){for(const[s,i]of Object.entries(t.headers))a.append(s,i);t.timeout&&t.timeout>0&&a.append(dxe,String(Math.ceil(t.timeout/1e3)))}return await this.clientOptions.auth.addAuthHeaders(a,r),a}getFileName(t){var r;let a="";return typeof t=="string"&&(a=t.replace(/[/\\]+$/,""),a=(r=a.split(/[/\\]/).pop())!==null&&r!==void 0?r:""),a}async uploadFile(t,r){var a;const s={};r!=null&&(s.mimeType=r.mimeType,s.name=r.name,s.displayName=r.displayName),s.name&&!s.name.startsWith("files/")&&(s.name=`files/${s.name}`);const i=this.clientOptions.uploader,l=await i.stat(t);s.sizeBytes=String(l.size);const o=(a=r==null?void 0:r.mimeType)!==null&&a!==void 0?a:l.type;if(o===void 0||o==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");s.mimeType=o;const d={file:s},u=this.getFileName(t),f=et("upload/v1beta/files",d._url),p=await this.fetchUploadUrl(f,s.sizeBytes,s.mimeType,u,d,r==null?void 0:r.httpOptions);return i.upload(t,p,this)}async uploadFileToFileSearchStore(t,r,a){var s;const i=this.clientOptions.uploader,l=await i.stat(r),o=String(l.size),d=(s=a==null?void 0:a.mimeType)!==null&&s!==void 0?s:l.type;if(d===void 0||d==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");const u=`upload/v1beta/${t}:uploadToFileSearchStore`,f=this.getFileName(r),p={};a!=null&&YL(a,p);const h=await this.fetchUploadUrl(u,o,d,f,p,a==null?void 0:a.httpOptions);return i.uploadToFileSearchStore(r,h,this)}async downloadFile(t){await this.clientOptions.downloader.download(t,this)}async fetchUploadUrl(t,r,a,s,i,l){var o;let d={};l?d=l:d={apiVersion:"",headers:Object.assign({"Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${r}`,"X-Goog-Upload-Header-Content-Type":`${a}`},s?{"X-Goog-Upload-File-Name":s}:{})};const u=await this.request({path:t,body:JSON.stringify(i),httpMethod:"POST",httpOptions:d});if(!u||!(u!=null&&u.headers))throw new Error("Server did not return an HttpResponse or the returned HttpResponse did not have headers.");const f=(o=u==null?void 0:u.headers)===null||o===void 0?void 0:o["x-goog-upload-url"];if(f===void 0)throw new Error("Failed to get upload url. Server did not return the x-google-upload-url in the headers");return f}}async function Y3(e){var t;if(e===void 0)throw new Error("response is undefined");if(!e.ok){const r=e.status;let a;!((t=e.headers.get("content-type"))===null||t===void 0)&&t.includes("application/json")?a=await e.json():a={error:{message:await e.text(),code:e.status,status:e.statusText}};const s=JSON.stringify(a);throw r>=400&&r<600?new pp({message:s,status:r}):new Error(s)}}function bxe(e,t){if(!t||Object.keys(t).length===0)return;if(e.body instanceof Blob){console.warn("includeExtraBodyToRequestInit: extraBody provided but current request body is a Blob. extraBody will be ignored as merging is not supported for Blob bodies.");return}let r={};if(typeof e.body=="string"&&e.body.length>0)try{const i=JSON.parse(e.body);if(typeof i=="object"&&i!==null&&!Array.isArray(i))r=i;else{console.warn("includeExtraBodyToRequestInit: Original request body is valid JSON but not a non-array object. Skip applying extraBody to the request body.");return}}catch{console.warn("includeExtraBodyToRequestInit: Original request body is not valid JSON. Skip applying extraBody to the request body.");return}function a(i,l){const o=Object.assign({},i);for(const d in l)if(Object.prototype.hasOwnProperty.call(l,d)){const u=l[d],f=o[d];u&&typeof u=="object"&&!Array.isArray(u)&&f&&typeof f=="object"&&!Array.isArray(f)?o[d]=a(f,u):(f&&u&&typeof f!=typeof u&&console.warn(`includeExtraBodyToRequestInit:deepMerge: Type mismatch for key "${d}". Original type: ${typeof f}, New type: ${typeof u}. Overwriting.`),o[d]=u)}return o}const s=a(r,t);e.body=JSON.stringify(s)}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const vxe="mcp_used/unknown";let yxe=!1;function XL(e){for(const t of e)if(wxe(t)||typeof t=="object"&&"inputSchema"in t)return!0;return yxe}function JL(e){var t;const r=(t=e[hC])!==null&&t!==void 0?t:"";e[hC]=(r+` ${vxe}`).trimStart()}function wxe(e){return e!==null&&typeof e=="object"&&e instanceof Zj}function Nxe(e){return zi(this,arguments,function*(r,a=100){let s,i=0;for(;i<a;){const l=yield St(r.listTools({cursor:s}));for(const o of l.tools)yield yield St(o),i++;if(!l.nextCursor)break;s=l.nextCursor}})}class Zj{constructor(t=[],r){this.mcpTools=[],this.functionNameToMcpClient={},this.mcpClients=t,this.config=r}static create(t,r){return new Zj(t,r)}async initialize(){var t,r,a,s;if(this.mcpTools.length>0)return;const i={},l=[];for(const f of this.mcpClients)try{for(var o=!0,d=(r=void 0,$i(Nxe(f))),u;u=await d.next(),t=u.done,!t;o=!0){s=u.value,o=!1;const p=s;l.push(p);const h=p.name;if(i[h])throw new Error(`Duplicate function name ${h} found in MCP tools. Please ensure function names are unique.`);i[h]=f}}catch(p){r={error:p}}finally{try{!o&&!t&&(a=d.return)&&await a.call(d)}finally{if(r)throw r.error}}this.mcpTools=l,this.functionNameToMcpClient=i}async tool(){return await this.initialize(),Wue(this.mcpTools,this.config)}async callTool(t){await this.initialize();const r=[];for(const a of t)if(a.name in this.functionNameToMcpClient){const s=this.functionNameToMcpClient[a.name];let i;this.config.timeout&&(i={timeout:this.config.timeout});const l=await s.callTool({name:a.name,arguments:a.args},void 0,i);r.push({functionResponse:{name:a.name,response:l.isError?{error:l}:l}})}return r}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */async function Cxe(e,t,r){const a=new Que;let s;r.data instanceof Blob?s=JSON.parse(await r.data.text()):s=JSON.parse(r.data),Object.assign(a,s),t(a)}class kxe{constructor(t,r,a){this.apiClient=t,this.auth=r,this.webSocketFactory=a}async connect(t){var r,a;if(this.apiClient.isVertexAI())throw new Error("Live music is not supported for Vertex AI.");console.warn("Live music generation is experimental and may change in future versions.");const s=this.apiClient.getWebsocketBaseUrl(),i=this.apiClient.getApiVersion(),l=Sxe(this.apiClient.getDefaultHeaders()),o=this.apiClient.getApiKey(),d=`${s}/ws/google.ai.generativelanguage.${i}.GenerativeService.BidiGenerateMusic?key=${o}`;let u=()=>{};const f=new Promise(N=>{u=N}),p=t.callbacks,h=function(){u({})},m=this.apiClient,b={onopen:h,onmessage:N=>{Cxe(m,p.onmessage,N)},onerror:(r=p==null?void 0:p.onerror)!==null&&r!==void 0?r:function(N){},onclose:(a=p==null?void 0:p.onclose)!==null&&a!==void 0?a:function(N){}},v=this.webSocketFactory.create(d,Exe(l),b);v.connect(),await f;const _={setup:{model:rr(this.apiClient,t.model)}};return v.send(JSON.stringify(_)),new jxe(v,this.apiClient)}}class jxe{constructor(t,r){this.conn=t,this.apiClient=r}async setWeightedPrompts(t){if(!t.weightedPrompts||Object.keys(t.weightedPrompts).length===0)throw new Error("Weighted prompts must be set and contain at least one entry.");const r=W0e(t);this.conn.send(JSON.stringify({clientContent:r}))}async setMusicGenerationConfig(t){t.musicGenerationConfig||(t.musicGenerationConfig={});const r=q0e(t);this.conn.send(JSON.stringify(r))}sendPlaybackControl(t){const r={playbackControl:t};this.conn.send(JSON.stringify(r))}play(){this.sendPlaybackControl(fA.PLAY)}pause(){this.sendPlaybackControl(fA.PAUSE)}stop(){this.sendPlaybackControl(fA.STOP)}resetContext(){this.sendPlaybackControl(fA.RESET_CONTEXT)}close(){this.conn.close()}}function Exe(e){const t={};return e.forEach((r,a)=>{t[a]=r}),t}function Sxe(e){const t=new Headers;for(const[r,a]of Object.entries(e))t.append(r,a);return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Bxe="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";async function _xe(e,t,r){const a=new Lue;let s;r.data instanceof Blob?s=await r.data.text():r.data instanceof ArrayBuffer?s=new TextDecoder().decode(r.data):s=r.data;const i=JSON.parse(s);if(e.isVertexAI()){const l=J0e(i);Object.assign(a,l)}else Object.assign(a,i);t(a)}class Txe{constructor(t,r,a){this.apiClient=t,this.auth=r,this.webSocketFactory=a,this.music=new kxe(this.apiClient,this.auth,this.webSocketFactory)}async connect(t){var r,a,s,i,l,o;if(t.config&&t.config.httpOptions)throw new Error("The Live module does not support httpOptions at request-level in LiveConnectConfig yet. Please use the client-level httpOptions configuration instead.");const d=this.apiClient.getWebsocketBaseUrl(),u=this.apiClient.getApiVersion();let f;const p=this.apiClient.getHeaders();t.config&&t.config.tools&&XL(t.config.tools)&&JL(p);const h=Uxe(p);if(this.apiClient.isVertexAI()){const U=this.apiClient.getProject(),D=this.apiClient.getLocation(),L=this.apiClient.getApiKey(),P=!!U&&!!D||!!L;this.apiClient.getCustomBaseUrl()&&!P?f=d:(f=`${d}/ws/google.cloud.aiplatform.${u}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(h,f))}else{const U=this.apiClient.getApiKey();let D="BidiGenerateContent",L="key";U!=null&&U.startsWith("auth_tokens/")&&(console.warn("Warning: Ephemeral token support is experimental and may change in future versions."),u!=="v1alpha"&&console.warn("Warning: The SDK's ephemeral token support is in v1alpha only. Please use const ai = new GoogleGenAI({apiKey: token.name, httpOptions: { apiVersion: 'v1alpha' }}); before session connection."),D="BidiGenerateContentConstrained",L="access_token"),f=`${d}/ws/google.ai.generativelanguage.${u}.GenerativeService.${D}?${L}=${U}`}let m=()=>{};const b=new Promise(U=>{m=U}),v=t.callbacks,y=function(){var U;(U=v==null?void 0:v.onopen)===null||U===void 0||U.call(v),m({})},j=this.apiClient,_={onopen:y,onmessage:U=>{_xe(j,v.onmessage,U)},onerror:(r=v==null?void 0:v.onerror)!==null&&r!==void 0?r:function(U){},onclose:(a=v==null?void 0:v.onclose)!==null&&a!==void 0?a:function(U){}},N=this.webSocketFactory.create(f,Dxe(h),_);N.connect(),await b;let E=rr(this.apiClient,t.model);if(this.apiClient.isVertexAI()&&E.startsWith("publishers/")){const U=this.apiClient.getProject(),D=this.apiClient.getLocation();U&&D&&(E=`projects/${U}/locations/${D}/`+E)}let T={};this.apiClient.isVertexAI()&&((s=t.config)===null||s===void 0?void 0:s.responseModalities)===void 0&&(t.config===void 0?t.config={responseModalities:[Dg.AUDIO]}:t.config.responseModalities=[Dg.AUDIO]),!((i=t.config)===null||i===void 0)&&i.generationConfig&&console.warn("Setting `LiveConnectConfig.generation_config` is deprecated, please set the fields on `LiveConnectConfig` directly. This will become an error in a future version (not before Q3 2025).");const B=(o=(l=t.config)===null||l===void 0?void 0:l.tools)!==null&&o!==void 0?o:[],F=[];for(const U of B)if(this.isCallableTool(U)){const D=U;F.push(await D.tool())}else F.push(U);F.length>0&&(t.config.tools=F);const R={model:E,config:t.config,callbacks:t.callbacks};return this.apiClient.isVertexAI()?T=K0e(this.apiClient,R):T=G0e(this.apiClient,R),delete T.config,N.send(JSON.stringify(T)),new Fxe(N,this.apiClient)}isCallableTool(t){return"callTool"in t&&typeof t.callTool=="function"}}const Ixe={turnComplete:!0};class Fxe{constructor(t,r){this.conn=t,this.apiClient=r}tLiveClientContent(t,r){if(r.turns!==null&&r.turns!==void 0){let a=[];try{a=Ls(r.turns),t.isVertexAI()||(a=a.map(s=>Jp(s)))}catch{throw new Error(`Failed to parse client content "turns", type: '${typeof r.turns}'`)}return{clientContent:{turns:a,turnComplete:r.turnComplete}}}return{clientContent:{turnComplete:r.turnComplete}}}tLiveClienttToolResponse(t,r){let a=[];if(r.functionResponses==null)throw new Error("functionResponses is required.");if(Array.isArray(r.functionResponses)?a=r.functionResponses:a=[r.functionResponses],a.length===0)throw new Error("functionResponses is required.");for(const i of a){if(typeof i!="object"||i===null||!("name"in i)||!("response"in i))throw new Error(`Could not parse function response, type '${typeof i}'.`);if(!t.isVertexAI()&&!("id"in i))throw new Error(Bxe)}return{toolResponse:{functionResponses:a}}}sendClientContent(t){t=Object.assign(Object.assign({},Ixe),t);const r=this.tLiveClientContent(this.apiClient,t);this.conn.send(JSON.stringify(r))}sendRealtimeInput(t){let r={};this.apiClient.isVertexAI()?r={realtimeInput:X0e(t)}:r={realtimeInput:Y0e(t)},this.conn.send(JSON.stringify(r))}sendToolResponse(t){if(t.functionResponses==null)throw new Error("Tool response parameters are required.");const r=this.tLiveClienttToolResponse(this.apiClient,t);this.conn.send(JSON.stringify(r))}close(){this.conn.close()}}function Dxe(e){const t={};return e.forEach((r,a)=>{t[a]=r}),t}function Uxe(e){const t=new Headers;for(const[r,a]of Object.entries(e))t.append(r,a);return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const X3=10;function J3(e){var t,r,a;if(!((t=e==null?void 0:e.automaticFunctionCalling)===null||t===void 0)&&t.disable)return!0;let s=!1;for(const l of(r=e==null?void 0:e.tools)!==null&&r!==void 0?r:[])if(vA(l)){s=!0;break}if(!s)return!0;const i=(a=e==null?void 0:e.automaticFunctionCalling)===null||a===void 0?void 0:a.maximumRemoteCalls;return i&&(i<0||!Number.isInteger(i))||i==0?(console.warn("Invalid maximumRemoteCalls value provided for automatic function calling. Disabled automatic function calling. Please provide a valid integer value greater than 0. maximumRemoteCalls provided:",i),!0):!1}function vA(e){return"callTool"in e&&typeof e.callTool=="function"}function Mxe(e){var t,r,a;return(a=(r=(t=e.config)===null||t===void 0?void 0:t.tools)===null||r===void 0?void 0:r.some(s=>vA(s)))!==null&&a!==void 0?a:!1}function Z3(e){var t;const r=[];return!((t=e==null?void 0:e.config)===null||t===void 0)&&t.tools&&e.config.tools.forEach((a,s)=>{if(vA(a))return;const i=a;i.functionDeclarations&&i.functionDeclarations.length>0&&r.push(s)}),r}function eD(e){var t;return!(!((t=e==null?void 0:e.automaticFunctionCalling)===null||t===void 0)&&t.ignoreCallHistory)}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Rxe extends Uo{constructor(t){super(),this.apiClient=t,this.embedContent=async r=>{if(!this.apiClient.isVertexAI())return await this.embedContentInternal(r);if(r.model.includes("gemini")&&r.model!=="gemini-embedding-001"||r.model.includes("maas")){const s=Ls(r.contents);if(s.length>1)throw new Error("The embedContent API for this model only supports one content at a time.");const i=Object.assign(Object.assign({},r),{content:s[0],embeddingApiType:Ug.EMBED_CONTENT});return await this.embedContentInternal(i)}else{const s=Object.assign(Object.assign({},r),{embeddingApiType:Ug.PREDICT});return await this.embedContentInternal(s)}},this.generateContent=async r=>{var a,s,i,l,o;const d=await this.processParamsMaybeAddMcpUsage(r);if(this.maybeMoveToResponseJsonSchem(r),!Mxe(r)||J3(r.config))return await this.generateContentInternal(d);const u=Z3(r);if(u.length>0){const v=u.map(y=>`tools[${y}]`).join(", ");throw new Error(`Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations is not yet supported. Incompatible tools found at ${v}.`)}let f,p;const h=Ls(d.contents),m=(i=(s=(a=d.config)===null||a===void 0?void 0:a.automaticFunctionCalling)===null||s===void 0?void 0:s.maximumRemoteCalls)!==null&&i!==void 0?i:X3;let b=0;for(;b<m&&(f=await this.generateContentInternal(d),!(!f.functionCalls||f.functionCalls.length===0));){const v=f.candidates[0].content,y=[];for(const j of(o=(l=r.config)===null||l===void 0?void 0:l.tools)!==null&&o!==void 0?o:[])if(vA(j)){const N=await j.callTool(f.functionCalls);y.push(...N)}b++,p={role:"user",parts:y},d.contents=Ls(d.contents),d.contents.push(v),d.contents.push(p),eD(d.config)&&(h.push(v),h.push(p))}return eD(d.config)&&(f.automaticFunctionCallingHistory=h),f},this.generateContentStream=async r=>{var a,s,i,l,o;if(this.maybeMoveToResponseJsonSchem(r),J3(r.config)){const p=await this.processParamsMaybeAddMcpUsage(r);return await this.generateContentStreamInternal(p)}const d=Z3(r);if(d.length>0){const p=d.map(h=>`tools[${h}]`).join(", ");throw new Error(`Incompatible tools found at ${p}. Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations" is not yet supported.`)}const u=(i=(s=(a=r==null?void 0:r.config)===null||a===void 0?void 0:a.toolConfig)===null||s===void 0?void 0:s.functionCallingConfig)===null||i===void 0?void 0:i.streamFunctionCallArguments,f=(o=(l=r==null?void 0:r.config)===null||l===void 0?void 0:l.automaticFunctionCalling)===null||o===void 0?void 0:o.disable;if(u&&!f)throw new Error("Running in streaming mode with 'streamFunctionCallArguments' enabled, this feature is not compatible with automatic function calling (AFC). Please set 'config.automaticFunctionCalling.disable' to true to disable AFC or leave 'config.toolConfig.functionCallingConfig.streamFunctionCallArguments' to be undefined or set to false to disable streaming function call arguments feature.");return await this.processAfcStream(r)},this.generateImages=async r=>await this.generateImagesInternal(r).then(a=>{var s;let i;const l=[];if(a!=null&&a.generatedImages)for(const d of a.generatedImages)d&&(d!=null&&d.safetyAttributes)&&((s=d==null?void 0:d.safetyAttributes)===null||s===void 0?void 0:s.contentType)==="Positive Prompt"?i=d==null?void 0:d.safetyAttributes:l.push(d);let o;return i?o={generatedImages:l,positivePromptSafetyAttributes:i,sdkHttpResponse:a.sdkHttpResponse}:o={generatedImages:l,sdkHttpResponse:a.sdkHttpResponse},o}),this.list=async r=>{var a;const l={config:Object.assign(Object.assign({},{queryBase:!0}),r==null?void 0:r.config)};if(this.apiClient.isVertexAI()&&!l.config.queryBase){if(!((a=l.config)===null||a===void 0)&&a.filter)throw new Error("Filtering tuned models list for Vertex AI is not currently supported");l.config.filter="labels.tune-type:*"}return new nu(No.PAGED_ITEM_MODELS,o=>this.listInternal(o),await this.listInternal(l),l)},this.editImage=async r=>{const a={model:r.model,prompt:r.prompt,referenceImages:[],config:r.config};return r.referenceImages&&r.referenceImages&&(a.referenceImages=r.referenceImages.map(s=>s.toReferenceImageAPI())),await this.editImageInternal(a)},this.upscaleImage=async r=>{let a={numberOfImages:1,mode:"upscale"};r.config&&(a=Object.assign(Object.assign({},a),r.config));const s={model:r.model,image:r.image,upscaleFactor:r.upscaleFactor,config:a};return await this.upscaleImageInternal(s)},this.generateVideos=async r=>{var a,s,i,l,o,d;if((r.prompt||r.image||r.video)&&r.source)throw new Error("Source and prompt/image/video are mutually exclusive. Please only use source.");return this.apiClient.isVertexAI()||(!((a=r.video)===null||a===void 0)&&a.uri&&(!((s=r.video)===null||s===void 0)&&s.videoBytes)?r.video={uri:r.video.uri,mimeType:r.video.mimeType}:!((l=(i=r.source)===null||i===void 0?void 0:i.video)===null||l===void 0)&&l.uri&&(!((d=(o=r.source)===null||o===void 0?void 0:o.video)===null||d===void 0)&&d.videoBytes)&&(r.source.video={uri:r.source.video.uri,mimeType:r.source.video.mimeType})),await this.generateVideosInternal(r)}}maybeMoveToResponseJsonSchem(t){t.config&&t.config.responseSchema&&(t.config.responseJsonSchema||Object.keys(t.config.responseSchema).includes("$schema")&&(t.config.responseJsonSchema=t.config.responseSchema,delete t.config.responseSchema))}async processParamsMaybeAddMcpUsage(t){var r,a,s;const i=(r=t.config)===null||r===void 0?void 0:r.tools;if(!i)return t;const l=await Promise.all(i.map(async d=>vA(d)?await d.tool():d)),o={model:t.model,contents:t.contents,config:Object.assign(Object.assign({},t.config),{tools:l})};if(o.config.tools=l,t.config&&t.config.tools&&XL(t.config.tools)){const d=(s=(a=t.config.httpOptions)===null||a===void 0?void 0:a.headers)!==null&&s!==void 0?s:{};let u=Object.assign({},d);Object.keys(u).length===0&&(u=this.apiClient.getDefaultHeaders()),JL(u),o.config.httpOptions=Object.assign(Object.assign({},t.config.httpOptions),{headers:u})}return o}async initAfcToolsMap(t){var r,a,s;const i=new Map;for(const l of(a=(r=t.config)===null||r===void 0?void 0:r.tools)!==null&&a!==void 0?a:[])if(vA(l)){const o=l,d=await o.tool();for(const u of(s=d.functionDeclarations)!==null&&s!==void 0?s:[]){if(!u.name)throw new Error("Function declaration name is required.");if(i.has(u.name))throw new Error(`Duplicate tool declaration name: ${u.name}`);i.set(u.name,o)}}return i}async processAfcStream(t){var r,a,s;const i=(s=(a=(r=t.config)===null||r===void 0?void 0:r.automaticFunctionCalling)===null||a===void 0?void 0:a.maximumRemoteCalls)!==null&&s!==void 0?s:X3;let l=!1,o=0;const d=await this.initAfcToolsMap(t);return(function(u,f,p){return zi(this,arguments,function*(){for(var h,m,b,v,y,j;o<i;){l&&(o++,l=!1);const T=yield St(u.processParamsMaybeAddMcpUsage(p)),B=yield St(u.generateContentStreamInternal(T)),F=[],R=[];try{for(var _=!0,N=(m=void 0,$i(B)),E;E=yield St(N.next()),h=E.done,!h;_=!0){v=E.value,_=!1;const U=v;if(yield yield St(U),U.candidates&&(!((y=U.candidates[0])===null||y===void 0)&&y.content)){R.push(U.candidates[0].content);for(const D of(j=U.candidates[0].content.parts)!==null&&j!==void 0?j:[])if(o<i&&D.functionCall){if(!D.functionCall.name)throw new Error("Function call name was not returned by the model.");if(f.has(D.functionCall.name)){const L=yield St(f.get(D.functionCall.name).callTool([D.functionCall]));F.push(...L)}else throw new Error(`Automatic function calling was requested, but not all the tools the model used implement the CallableTool interface. Available tools: ${f.keys()}, mising tool: ${D.functionCall.name}`)}}}}catch(U){m={error:U}}finally{try{!_&&!h&&(b=N.return)&&(yield St(b.call(N)))}finally{if(m)throw m.error}}if(F.length>0){l=!0;const U=new of;U.candidates=[{content:{role:"user",parts:F}}],yield yield St(U);const D=[];D.push(...R),D.push({role:"user",parts:F});const L=Ls(p.contents).concat(D);p.contents=L}else break}})})(this,d,t)}async generateContentInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=K3(this.apiClient,t);return o=et("{model}:generateContent",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=W3(f),h=new of;return Object.assign(h,p),h})}else{const u=G3(this.apiClient,t);return o=et("{model}:generateContent",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=q3(f),h=new of;return Object.assign(h,p),h})}}async generateContentStreamInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=K3(this.apiClient,t);return o=et("{model}:streamGenerateContent?alt=sse",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.requestStream({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}),l.then(function(p){return zi(this,arguments,function*(){var h,m,b,v;try{for(var y=!0,j=$i(p),_;_=yield St(j.next()),h=_.done,!h;y=!0){v=_.value,y=!1;const N=v,E=W3(yield St(N.json()),t);E.sdkHttpResponse={headers:N.headers};const T=new of;Object.assign(T,E),yield yield St(T)}}catch(N){m={error:N}}finally{try{!y&&!h&&(b=j.return)&&(yield St(b.call(j)))}finally{if(m)throw m.error}}})})}else{const u=G3(this.apiClient,t);return o=et("{model}:streamGenerateContent?alt=sse",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.requestStream({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}),l.then(function(p){return zi(this,arguments,function*(){var h,m,b,v;try{for(var y=!0,j=$i(p),_;_=yield St(j.next()),h=_.done,!h;y=!0){v=_.value,y=!1;const N=v,E=q3(yield St(N.json()),t);E.sdkHttpResponse={headers:N.headers};const T=new of;Object.assign(T,E),yield yield St(T)}}catch(N){m={error:N}}finally{try{!y&&!h&&(b=j.return)&&(yield St(b.call(j)))}finally{if(m)throw m.error}}})})}}async embedContentInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Bfe(this.apiClient,t,t),f=Xue(t.model)?"{model}:embedContent":"{model}:predict";return o=et(f,u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(p=>p.json().then(h=>{const m=h;return m.sdkHttpResponse={headers:p.headers},m})),l.then(p=>{const h=Tfe(p,t),m=new B3;return Object.assign(m,h),m})}else{const u=Sfe(this.apiClient,t);return o=et("{model}:batchEmbedContents",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=_fe(f),h=new B3;return Object.assign(h,p),h})}}async generateImagesInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Hfe(this.apiClient,t);return o=et("{model}:predict",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=$fe(f),h=new _3;return Object.assign(h,p),h})}else{const u=Qfe(this.apiClient,t);return o=et("{model}:predict",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=zfe(f),h=new _3;return Object.assign(h,p),h})}}async editImageInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=Cfe(this.apiClient,t);return i=et("{model}:predict",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json().then(u=>{const f=u;return f.sdkHttpResponse={headers:d.headers},f})),s.then(d=>{const u=kfe(d),f=new Sue;return Object.assign(f,u),f})}else throw new Error("This method is only supported by the Vertex AI.")}async upscaleImageInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=Hpe(this.apiClient,t);return i=et("{model}:predict",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json().then(u=>{const f=u;return f.sdkHttpResponse={headers:d.headers},f})),s.then(d=>{const u=zpe(d),f=new Bue;return Object.assign(f,u),f})}else throw new Error("This method is only supported by the Vertex AI.")}async recontextImage(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=Npe(this.apiClient,t);return i=et("{model}:predict",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=Cpe(d),f=new _ue;return Object.assign(f,u),f})}else throw new Error("This method is only supported by the Vertex AI.")}async segmentImage(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=_pe(this.apiClient,t);return i=et("{model}:predict",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=Tpe(d),f=new Tue;return Object.assign(f,u),f})}else throw new Error("This method is only supported by the Vertex AI.")}async get(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=lpe(this.apiClient,t);return o=et("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>xC(f))}else{const u=ipe(this.apiClient,t);return o=et("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>pC(f))}}async listInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=hpe(this.apiClient,t);return o=et("{models_url}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=gpe(f),h=new T3;return Object.assign(h,p),h})}else{const u=xpe(this.apiClient,t);return o=et("{models_url}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=mpe(f),h=new T3;return Object.assign(h,p),h})}}async update(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Lpe(this.apiClient,t);return o=et("{model}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>xC(f))}else{const u=Ppe(this.apiClient,t);return o=et("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>pC(f))}}async delete(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=vfe(this.apiClient,t);return o=et("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=wfe(f),h=new I3;return Object.assign(h,p),h})}else{const u=bfe(this.apiClient,t);return o=et("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=yfe(f),h=new I3;return Object.assign(h,p),h})}}async countTokens(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=hfe(this.apiClient,t);return o=et("{model}:countTokens",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=gfe(f),h=new F3;return Object.assign(h,p),h})}else{const u=xfe(this.apiClient,t);return o=et("{model}:countTokens",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=mfe(f),h=new F3;return Object.assign(h,p),h})}}async computeTokens(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=ofe(this.apiClient,t);return i=et("{model}:computeTokens",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json().then(u=>{const f=u;return f.sdkHttpResponse={headers:d.headers},f})),s.then(d=>{const u=cfe(d),f=new Iue;return Object.assign(f,u),f})}else throw new Error("This method is only supported by the Vertex AI.")}async generateVideosInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Yfe(this.apiClient,t);return o=et("{model}:predictLongRunning",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l.then(f=>{const p=qfe(f),h=new Mg;return Object.assign(h,p),h})}else{const u=Wfe(this.apiClient,t);return o=et("{model}:predictLongRunning",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l.then(f=>{const p=Kfe(f),h=new Mg;return Object.assign(h,p),h})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Oxe extends Uo{constructor(t){super(),this.apiClient=t}async getVideosOperation(t){const r=t.operation,a=t.config;if(r.name===void 0||r.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const s=r.name.split("/operations/")[0];let i;a&&"httpOptions"in a&&(i=a.httpOptions);const l=await this.fetchPredictVideosOperationInternal({operationName:r.name,resourceName:s,config:{httpOptions:i}});return r._fromAPIResponse({apiResponse:l,_isVertexAI:!0})}else{const s=await this.getVideosOperationInternal({operationName:r.name,config:a});return r._fromAPIResponse({apiResponse:s,_isVertexAI:!1})}}async get(t){const r=t.operation,a=t.config;if(r.name===void 0||r.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const s=r.name.split("/operations/")[0];let i;a&&"httpOptions"in a&&(i=a.httpOptions);const l=await this.fetchPredictVideosOperationInternal({operationName:r.name,resourceName:s,config:{httpOptions:i}});return r._fromAPIResponse({apiResponse:l,_isVertexAI:!0})}else{const s=await this.getVideosOperationInternal({operationName:r.name,config:a});return r._fromAPIResponse({apiResponse:s,_isVertexAI:!1})}}async getVideosOperationInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=wue(t);return o=et("{operationName}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json()),l}else{const u=yue(t);return o=et("{operationName}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json()),l}}async fetchPredictVideosOperationInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=pue(t);return i=et("{resourceName}:fetchPredictOperation",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s}else throw new Error("This method is only supported by the Vertex AI.")}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Pxe(e){const t={},r=w(e,["data"]);if(r!=null&&C(t,["data"],r),w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=w(e,["mimeType"]);return a!=null&&C(t,["mimeType"],a),t}function Lxe(e){const t={},r=w(e,["parts"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>Wxe(i))),C(t,["parts"],s)}const a=w(e,["role"]);return a!=null&&C(t,["role"],a),t}function Qxe(e,t,r){const a={},s=w(t,["expireTime"]);r!==void 0&&s!=null&&C(r,["expireTime"],s);const i=w(t,["newSessionExpireTime"]);r!==void 0&&i!=null&&C(r,["newSessionExpireTime"],i);const l=w(t,["uses"]);r!==void 0&&l!=null&&C(r,["uses"],l);const o=w(t,["liveConnectConstraints"]);r!==void 0&&o!=null&&C(r,["bidiGenerateContentSetup"],qxe(e,o));const d=w(t,["lockAdditionalFields"]);return r!==void 0&&d!=null&&C(r,["fieldMask"],d),a}function Hxe(e,t){const r={},a=w(t,["config"]);return a!=null&&C(r,["config"],Qxe(e,a,r)),r}function zxe(e){const t={};if(w(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const r=w(e,["fileUri"]);r!=null&&C(t,["fileUri"],r);const a=w(e,["mimeType"]);return a!=null&&C(t,["mimeType"],a),t}function $xe(e){const t={},r=w(e,["id"]);r!=null&&C(t,["id"],r);const a=w(e,["args"]);a!=null&&C(t,["args"],a);const s=w(e,["name"]);if(s!=null&&C(t,["name"],s),w(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(w(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function Vxe(e){const t={};if(w(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const r=w(e,["enableWidget"]);return r!=null&&C(t,["enableWidget"],r),t}function Gxe(e){const t={};if(w(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(w(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const r=w(e,["timeRangeFilter"]);return r!=null&&C(t,["timeRangeFilter"],r),t}function Kxe(e,t){const r={},a=w(e,["generationConfig"]);t!==void 0&&a!=null&&C(t,["setup","generationConfig"],a);const s=w(e,["responseModalities"]);t!==void 0&&s!=null&&C(t,["setup","generationConfig","responseModalities"],s);const i=w(e,["temperature"]);t!==void 0&&i!=null&&C(t,["setup","generationConfig","temperature"],i);const l=w(e,["topP"]);t!==void 0&&l!=null&&C(t,["setup","generationConfig","topP"],l);const o=w(e,["topK"]);t!==void 0&&o!=null&&C(t,["setup","generationConfig","topK"],o);const d=w(e,["maxOutputTokens"]);t!==void 0&&d!=null&&C(t,["setup","generationConfig","maxOutputTokens"],d);const u=w(e,["mediaResolution"]);t!==void 0&&u!=null&&C(t,["setup","generationConfig","mediaResolution"],u);const f=w(e,["seed"]);t!==void 0&&f!=null&&C(t,["setup","generationConfig","seed"],f);const p=w(e,["speechConfig"]);t!==void 0&&p!=null&&C(t,["setup","generationConfig","speechConfig"],Jj(p));const h=w(e,["thinkingConfig"]);t!==void 0&&h!=null&&C(t,["setup","generationConfig","thinkingConfig"],h);const m=w(e,["enableAffectiveDialog"]);t!==void 0&&m!=null&&C(t,["setup","generationConfig","enableAffectiveDialog"],m);const b=w(e,["systemInstruction"]);t!==void 0&&b!=null&&C(t,["setup","systemInstruction"],Lxe(tn(b)));const v=w(e,["tools"]);if(t!==void 0&&v!=null){let B=e0(v);Array.isArray(B)&&(B=B.map(F=>Xxe(ZA(F)))),C(t,["setup","tools"],B)}const y=w(e,["sessionResumption"]);t!==void 0&&y!=null&&C(t,["setup","sessionResumption"],Yxe(y));const j=w(e,["inputAudioTranscription"]);t!==void 0&&j!=null&&C(t,["setup","inputAudioTranscription"],j);const _=w(e,["outputAudioTranscription"]);t!==void 0&&_!=null&&C(t,["setup","outputAudioTranscription"],_);const N=w(e,["realtimeInputConfig"]);t!==void 0&&N!=null&&C(t,["setup","realtimeInputConfig"],N);const E=w(e,["contextWindowCompression"]);t!==void 0&&E!=null&&C(t,["setup","contextWindowCompression"],E);const T=w(e,["proactivity"]);if(t!==void 0&&T!=null&&C(t,["setup","proactivity"],T),w(e,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return r}function qxe(e,t){const r={},a=w(t,["model"]);a!=null&&C(r,["setup","model"],rr(e,a));const s=w(t,["config"]);return s!=null&&C(r,["config"],Kxe(s,r)),r}function Wxe(e){const t={},r=w(e,["mediaResolution"]);r!=null&&C(t,["mediaResolution"],r);const a=w(e,["codeExecutionResult"]);a!=null&&C(t,["codeExecutionResult"],a);const s=w(e,["executableCode"]);s!=null&&C(t,["executableCode"],s);const i=w(e,["fileData"]);i!=null&&C(t,["fileData"],zxe(i));const l=w(e,["functionCall"]);l!=null&&C(t,["functionCall"],$xe(l));const o=w(e,["functionResponse"]);o!=null&&C(t,["functionResponse"],o);const d=w(e,["inlineData"]);d!=null&&C(t,["inlineData"],Pxe(d));const u=w(e,["text"]);u!=null&&C(t,["text"],u);const f=w(e,["thought"]);f!=null&&C(t,["thought"],f);const p=w(e,["thoughtSignature"]);p!=null&&C(t,["thoughtSignature"],p);const h=w(e,["videoMetadata"]);return h!=null&&C(t,["videoMetadata"],h),t}function Yxe(e){const t={},r=w(e,["handle"]);if(r!=null&&C(t,["handle"],r),w(e,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function Xxe(e){const t={};if(w(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const r=w(e,["computerUse"]);r!=null&&C(t,["computerUse"],r);const a=w(e,["fileSearch"]);a!=null&&C(t,["fileSearch"],a);const s=w(e,["codeExecution"]);if(s!=null&&C(t,["codeExecution"],s),w(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=w(e,["functionDeclarations"]);if(i!=null){let f=i;Array.isArray(f)&&(f=f.map(p=>p)),C(t,["functionDeclarations"],f)}const l=w(e,["googleMaps"]);l!=null&&C(t,["googleMaps"],Vxe(l));const o=w(e,["googleSearch"]);o!=null&&C(t,["googleSearch"],Gxe(o));const d=w(e,["googleSearchRetrieval"]);d!=null&&C(t,["googleSearchRetrieval"],d);const u=w(e,["urlContext"]);return u!=null&&C(t,["urlContext"],u),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Jxe(e){const t=[];for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const a=e[r];if(typeof a=="object"&&a!=null&&Object.keys(a).length>0){const s=Object.keys(a).map(i=>`${r}.${i}`);t.push(...s)}else t.push(r)}return t.join(",")}function Zxe(e,t){let r=null;const a=e.bidiGenerateContentSetup;if(typeof a=="object"&&a!==null&&"setup"in a){const i=a.setup;typeof i=="object"&&i!==null?(e.bidiGenerateContentSetup=i,r=i):delete e.bidiGenerateContentSetup}else a!==void 0&&delete e.bidiGenerateContentSetup;const s=e.fieldMask;if(r){const i=Jxe(r);if(Array.isArray(t==null?void 0:t.lockAdditionalFields)&&(t==null?void 0:t.lockAdditionalFields.length)===0)i?e.fieldMask=i:delete e.fieldMask;else if(t!=null&&t.lockAdditionalFields&&t.lockAdditionalFields.length>0&&s!==null&&Array.isArray(s)&&s.length>0){const l=["temperature","topK","topP","maxOutputTokens","responseModalities","seed","speechConfig"];let o=[];s.length>0&&(o=s.map(u=>l.includes(u)?`generationConfig.${u}`:u));const d=[];i&&d.push(i),o.length>0&&d.push(...o),d.length>0?e.fieldMask=d.join(","):delete e.fieldMask}else delete e.fieldMask}else s!==null&&Array.isArray(s)&&s.length>0?e.fieldMask=s.join(","):delete e.fieldMask;return e}class ehe extends Uo{constructor(t){super(),this.apiClient=t}async create(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");{const o=Hxe(this.apiClient,t);i=et("auth_tokens",o._url),l=o._query,delete o.config,delete o._url,delete o._query;const d=Zxe(o,t.config);return s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(d),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(u=>u.json()),s.then(u=>u)}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function the(e,t){const r={},a=w(e,["force"]);return t!==void 0&&a!=null&&C(t,["_query","force"],a),r}function rhe(e){const t={},r=w(e,["name"]);r!=null&&C(t,["_url","name"],r);const a=w(e,["config"]);return a!=null&&the(a,t),t}function ahe(e){const t={},r=w(e,["name"]);return r!=null&&C(t,["_url","name"],r),t}function nhe(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&C(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);return t!==void 0&&s!=null&&C(t,["_query","pageToken"],s),r}function she(e){const t={},r=w(e,["parent"]);r!=null&&C(t,["_url","parent"],r);const a=w(e,["config"]);return a!=null&&nhe(a,t),t}function ihe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&C(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&C(t,["nextPageToken"],a);const s=w(e,["documents"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),C(t,["documents"],i)}return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class lhe extends Uo{constructor(t){super(),this.apiClient=t,this.list=async r=>new nu(No.PAGED_ITEM_DOCUMENTS,a=>this.listInternal({parent:r.parent,config:a.config}),await this.listInternal(r),r)}async get(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=ahe(t);return i=et("{name}",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>d)}}async delete(t){var r,a;let s="",i={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=rhe(t);s=et("{name}",l._url),i=l._query,delete l._url,delete l._query,await this.apiClient.request({path:s,queryParams:i,body:JSON.stringify(l),httpMethod:"DELETE",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal})}}async listInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=she(t);return i=et("{parent}/documents",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=ihe(d),f=new Fue;return Object.assign(f,u),f})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class ohe extends Uo{constructor(t,r=new lhe(t)){super(),this.apiClient=t,this.documents=r,this.list=async(a={})=>new nu(No.PAGED_ITEM_FILE_SEARCH_STORES,s=>this.listInternal(s),await this.listInternal(a),a)}async uploadToFileSearchStore(t){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files to a file search store.");return this.apiClient.uploadFileToFileSearchStore(t.fileSearchStoreName,t.file,t.config)}async create(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Ype(t);return i=et("fileSearchStores",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>d)}}async get(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Zpe(t);return i=et("{name}",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>d)}}async delete(t){var r,a;let s="",i={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=Jpe(t);s=et("{name}",l._url),i=l._query,delete l._url,delete l._query,await this.apiClient.request({path:s,queryParams:i,body:JSON.stringify(l),httpMethod:"DELETE",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal})}}async listInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=sxe(t);return i=et("fileSearchStores",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=ixe(d),f=new Due;return Object.assign(f,u),f})}}async uploadToFileSearchStoreInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=lxe(t);return i=et("upload/v1beta/{file_search_store_name}:uploadToFileSearchStore",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=oxe(d),f=new Uue;return Object.assign(f,u),f})}}async importFile(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=rxe(t);return i=et("{file_search_store_name}:importFile",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json()),s.then(d=>{const u=txe(d),f=new Kj;return Object.assign(f,u),f})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */let ZL=function(){const{crypto:e}=globalThis;if(e!=null&&e.randomUUID)return ZL=e.randomUUID.bind(e),e.randomUUID();const t=new Uint8Array(1),r=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,a=>(+a^r()&15>>+a/4).toString(16))};const che=()=>ZL();/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function mC(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const gC=e=>{if(e instanceof Error)return e;if(typeof e=="object"&&e!==null){try{if(Object.prototype.toString.call(e)==="[object Error]"){const t=new Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return new Error(JSON.stringify(e))}catch{}}return new Error(e)};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class ki extends Error{}class ts extends ki{constructor(t,r,a,s){super(`${ts.makeMessage(t,r,a)}`),this.status=t,this.headers=s,this.error=r}static makeMessage(t,r,a){const s=r!=null&&r.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):a;return t&&s?`${t} ${s}`:t?`${t} status code (no body)`:s||"(no status code or body)"}static generate(t,r,a,s){if(!t||!s)return new sv({message:a,cause:gC(r)});const i=r;return t===400?new tQ(t,i,a,s):t===401?new rQ(t,i,a,s):t===403?new aQ(t,i,a,s):t===404?new nQ(t,i,a,s):t===409?new sQ(t,i,a,s):t===422?new iQ(t,i,a,s):t===429?new lQ(t,i,a,s):t>=500?new oQ(t,i,a,s):new ts(t,i,a,s)}}class bC extends ts{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}}class sv extends ts{constructor({message:t,cause:r}){super(void 0,void 0,t||"Connection error.",void 0),r&&(this.cause=r)}}class eQ extends sv{constructor({message:t}={}){super({message:t??"Request timed out."})}}class tQ extends ts{}class rQ extends ts{}class aQ extends ts{}class nQ extends ts{}class sQ extends ts{}class iQ extends ts{}class lQ extends ts{}class oQ extends ts{}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const dhe=/^[a-z][a-z0-9+.-]*:/i,uhe=e=>dhe.test(e);let vC=e=>(vC=Array.isArray,vC(e));const Ahe=vC;let fhe=Ahe;const tD=fhe;function phe(e){if(!e)return!0;for(const t in e)return!1;return!0}function xhe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const hhe=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new ki(`${e} must be an integer`);if(t<0)throw new ki(`${e} must be a positive integer`);return t},mhe=e=>{try{return JSON.parse(e)}catch{return}};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const ghe=e=>new Promise(t=>setTimeout(t,e));/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const iA="0.0.1";/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function bhe(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const vhe=()=>{var e,t,r,a,s;const i=bhe();if(i==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":iA,"X-Stainless-OS":aD(Deno.build.os),"X-Stainless-Arch":rD(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:(t=(e=Deno.version)===null||e===void 0?void 0:e.deno)!==null&&t!==void 0?t:"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":iA,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(i==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":iA,"X-Stainless-OS":aD((r=globalThis.process.platform)!==null&&r!==void 0?r:"unknown"),"X-Stainless-Arch":rD((a=globalThis.process.arch)!==null&&a!==void 0?a:"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":(s=globalThis.process.version)!==null&&s!==void 0?s:"unknown"};const l=yhe();return l?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":iA,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${l.browser}`,"X-Stainless-Runtime-Version":l.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":iA,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function yhe(){if(typeof navigator>"u"||!navigator)return null;const e=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:t,pattern:r}of e){const a=r.exec(navigator.userAgent);if(a){const s=a[1]||0,i=a[2]||0,l=a[3]||0;return{browser:t,version:`${s}.${i}.${l}`}}}return null}const rD=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",aD=e=>(e=e.toLowerCase(),e.includes("ios")?"iOS":e==="android"?"Android":e==="darwin"?"MacOS":e==="win32"?"Windows":e==="freebsd"?"FreeBSD":e==="openbsd"?"OpenBSD":e==="linux"?"Linux":e?`Other:${e}`:"Unknown");let Mh;const whe=()=>Mh??(Mh=vhe());/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Nhe(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new GeminiNextGenAPIClient({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function cQ(...e){const t=globalThis.ReadableStream;if(typeof t>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function Che(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return cQ({start(){},async pull(r){const{done:a,value:s}=await t.next();a?r.close():r.enqueue(s)},async cancel(){var r;await((r=t.return)===null||r===void 0?void 0:r.call(t))}})}function dQ(e){if(e[Symbol.asyncIterator])return e;const t=e.getReader();return{async next(){try{const r=await t.read();return r!=null&&r.done&&t.releaseLock(),r}catch(r){throw t.releaseLock(),r}},async return(){const r=t.cancel();return t.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function khe(e){var t,r;if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await((r=(t=e[Symbol.asyncIterator]()).return)===null||r===void 0?void 0:r.call(t));return}const a=e.getReader(),s=a.cancel();a.releaseLock(),await s}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const jhe=({headers:e,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const uQ=()=>{var e;if(typeof File>"u"){const{process:t}=globalThis,r=typeof((e=t==null?void 0:t.versions)===null||e===void 0?void 0:e.node)=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(r?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function N2(e,t,r){return uQ(),new File(e,t??"unknown_file",r)}function Ehe(e){return(typeof e=="object"&&e!==null&&("name"in e&&e.name&&String(e.name)||"url"in e&&e.url&&String(e.url)||"filename"in e&&e.filename&&String(e.filename)||"path"in e&&e.path&&String(e.path))||"").split(/[\\/]/).pop()||void 0}const She=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function";/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const AQ=e=>e!=null&&typeof e=="object"&&typeof e.size=="number"&&typeof e.type=="string"&&typeof e.text=="function"&&typeof e.slice=="function"&&typeof e.arrayBuffer=="function",Bhe=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&AQ(e),_he=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function The(e,t,r){if(uQ(),e=await e,Bhe(e))return e instanceof File?e:N2([await e.arrayBuffer()],e.name);if(_he(e)){const s=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),N2(await yC(s),t,r)}const a=await yC(e);if(t||(t=Ehe(e)),!(r!=null&&r.type)){const s=a.find(i=>typeof i=="object"&&"type"in i&&i.type);typeof s=="string"&&(r=Object.assign(Object.assign({},r),{type:s}))}return N2(a,t,r)}async function yC(e){var t,r,a,s,i;let l=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)l.push(e);else if(AQ(e))l.push(e instanceof Blob?e:await e.arrayBuffer());else if(She(e))try{for(var o=!0,d=$i(e),u;u=await d.next(),t=u.done,!t;o=!0){s=u.value,o=!1;const f=s;l.push(...await yC(f))}}catch(f){r={error:f}}finally{try{!o&&!t&&(a=d.return)&&await a.call(d)}finally{if(r)throw r.error}}else{const f=(i=e==null?void 0:e.constructor)===null||i===void 0?void 0:i.name;throw new Error(`Unexpected data type: ${typeof e}${f?`; constructor: ${f}`:""}${Ihe(e)}`)}return l}function Ihe(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(r=>`"${r}"`).join(", ")}]`}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class fQ{constructor(t){this._client=t}}fQ._key=[];/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function pQ(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const nD=Object.freeze(Object.create(null)),Fhe=(e=pQ)=>(function(r,...a){if(r.length===1)return r[0];let s=!1;const i=[],l=r.reduce((f,p,h)=>{var m,b,v;/[?#]/.test(p)&&(s=!0);const y=a[h];let j=(s?encodeURIComponent:e)(""+y);return h!==a.length&&(y==null||typeof y=="object"&&y.toString===((v=Object.getPrototypeOf((b=Object.getPrototypeOf((m=y.hasOwnProperty)!==null&&m!==void 0?m:nD))!==null&&b!==void 0?b:nD))===null||v===void 0?void 0:v.toString))&&(j=y+"",i.push({start:f.length+p.length,length:j.length,error:`Value of type ${Object.prototype.toString.call(y).slice(8,-1)} is not a valid path parameter`})),f+p+(h===a.length?"":j)},""),o=l.split(/[?#]/,1)[0],d=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let u;for(;(u=d.exec(o))!==null;)i.push({start:u.index,length:u[0].length,error:`Value "${u[0]}" can't be safely passed as a path parameter`});if(i.sort((f,p)=>f.start-p.start),i.length>0){let f=0;const p=i.reduce((h,m)=>{const b=" ".repeat(m.start-f),v="^".repeat(m.length);return f=m.start+m.length,h+b+v},"");throw new ki(`Path parameters result in path with invalid segments:
${i.map(h=>h.error).join(`
`)}
${l}
${p}`)}return l}),Rh=Fhe(pQ);/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class xQ extends fQ{create(t,r){var a;const{api_version:s=this._client.apiVersion}=t,i=Og(t,["api_version"]);if("model"in i&&"agent_config"in i)throw new ki("Invalid request: specified `model` and `agent_config`. If specifying `model`, use `generation_config`.");if("agent"in i&&"generation_config"in i)throw new ki("Invalid request: specified `agent` and `generation_config`. If specifying `agent`, use `agent_config`.");return this._client.post(Rh`/${s}/interactions`,Object.assign(Object.assign({body:i},r),{stream:(a=t.stream)!==null&&a!==void 0?a:!1}))}delete(t,r={},a){const{api_version:s=this._client.apiVersion}=r??{};return this._client.delete(Rh`/${s}/interactions/${t}`,a)}cancel(t,r={},a){const{api_version:s=this._client.apiVersion}=r??{};return this._client.post(Rh`/${s}/interactions/${t}/cancel`,a)}get(t,r={},a){var s;const i=r??{},{api_version:l=this._client.apiVersion}=i,o=Og(i,["api_version"]);return this._client.get(Rh`/${l}/interactions/${t}`,Object.assign(Object.assign({query:o},a),{stream:(s=r==null?void 0:r.stream)!==null&&s!==void 0?s:!1}))}}xQ._key=Object.freeze(["interactions"]);class hQ extends xQ{}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Dhe(e){let t=0;for(const s of e)t+=s.length;const r=new Uint8Array(t);let a=0;for(const s of e)r.set(s,a),a+=s.length;return r}let Oh;function eE(e){let t;return(Oh??(t=new globalThis.TextEncoder,Oh=t.encode.bind(t)))(e)}let Ph;function sD(e){let t;return(Ph??(t=new globalThis.TextDecoder,Ph=t.decode.bind(t)))(e)}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class iv{constructor(){this.buffer=new Uint8Array,this.carriageReturnIndex=null}decode(t){if(t==null)return[];const r=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?eE(t):t;this.buffer=Dhe([this.buffer,r]);const a=[];let s;for(;(s=Uhe(this.buffer,this.carriageReturnIndex))!=null;){if(s.carriage&&this.carriageReturnIndex==null){this.carriageReturnIndex=s.index;continue}if(this.carriageReturnIndex!=null&&(s.index!==this.carriageReturnIndex+1||s.carriage)){a.push(sD(this.buffer.subarray(0,this.carriageReturnIndex-1))),this.buffer=this.buffer.subarray(this.carriageReturnIndex),this.carriageReturnIndex=null;continue}const i=this.carriageReturnIndex!==null?s.preceding-1:s.preceding,l=sD(this.buffer.subarray(0,i));a.push(l),this.buffer=this.buffer.subarray(s.index),this.carriageReturnIndex=null}return a}flush(){return this.buffer.length?this.decode(`
`):[]}}iv.NEWLINE_CHARS=new Set([`
`,"\r"]);iv.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Uhe(e,t){for(let s=t??0;s<e.length;s++){if(e[s]===10)return{preceding:s,index:s+1,carriage:!1};if(e[s]===13)return{preceding:s,index:s+1,carriage:!0}}return null}function Mhe(e){for(let a=0;a<e.length-1;a++){if(e[a]===10&&e[a+1]===10||e[a]===13&&e[a+1]===13)return a+2;if(e[a]===13&&e[a+1]===10&&a+3<e.length&&e[a+2]===13&&e[a+3]===10)return a+4}return-1}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Pg={off:0,error:200,warn:300,info:400,debug:500},iD=(e,t,r)=>{if(e){if(xhe(Pg,e))return e;Gn(r).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Pg))}`)}};function yf(){}function Lh(e,t,r){return!t||Pg[e]>Pg[r]?yf:t[e].bind(t)}const Rhe={error:yf,warn:yf,info:yf,debug:yf};let lD=new WeakMap;function Gn(e){var t;const r=e.logger,a=(t=e.logLevel)!==null&&t!==void 0?t:"off";if(!r)return Rhe;const s=lD.get(r);if(s&&s[0]===a)return s[1];const i={error:Lh("error",r,a),warn:Lh("warn",r,a),info:Lh("info",r,a),debug:Lh("debug",r,a)};return lD.set(r,[a,i]),i}const gd=e=>(e.options&&(e.options=Object.assign({},e.options),delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([t,r])=>[t,t.toLowerCase()==="x-goog-api-key"||t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e);/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class pA{constructor(t,r,a){this.iterator=t,this.controller=r,this.client=a}static fromSSEResponse(t,r,a){let s=!1;const i=a?Gn(a):console;function l(){return zi(this,arguments,function*(){var d,u,f,p;if(s)throw new ki("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let h=!1;try{try{for(var m=!0,b=$i(Ohe(t,r)),v;v=yield St(b.next()),d=v.done,!d;m=!0){p=v.value,m=!1;const y=p;if(!h)if(y.data.startsWith("[DONE]")){h=!0;continue}else try{yield yield St(JSON.parse(y.data))}catch(j){throw i.error("Could not parse message into JSON:",y.data),i.error("From chunk:",y.raw),j}}}catch(y){u={error:y}}finally{try{!m&&!d&&(f=b.return)&&(yield St(f.call(b)))}finally{if(u)throw u.error}}h=!0}catch(y){if(mC(y))return yield St(void 0);throw y}finally{h||r.abort()}})}return new pA(l,r,a)}static fromReadableStream(t,r,a){let s=!1;function i(){return zi(this,arguments,function*(){var d,u,f,p;const h=new iv,m=dQ(t);try{for(var b=!0,v=$i(m),y;y=yield St(v.next()),d=y.done,!d;b=!0){p=y.value,b=!1;const j=p;for(const _ of h.decode(j))yield yield St(_)}}catch(j){u={error:j}}finally{try{!b&&!d&&(f=v.return)&&(yield St(f.call(v)))}finally{if(u)throw u.error}}for(const j of h.flush())yield yield St(j)})}function l(){return zi(this,arguments,function*(){var d,u,f,p;if(s)throw new ki("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let h=!1;try{try{for(var m=!0,b=$i(i()),v;v=yield St(b.next()),d=v.done,!d;m=!0){p=v.value,m=!1;const y=p;h||y&&(yield yield St(JSON.parse(y)))}}catch(y){u={error:y}}finally{try{!m&&!d&&(f=b.return)&&(yield St(f.call(b)))}finally{if(u)throw u.error}}h=!0}catch(y){if(mC(y))return yield St(void 0);throw y}finally{h||r.abort()}})}return new pA(l,r,a)}[Symbol.asyncIterator](){return this.iterator()}tee(){const t=[],r=[],a=this.iterator(),s=i=>({next:()=>{if(i.length===0){const l=a.next();t.push(l),r.push(l)}return i.shift()}});return[new pA(()=>s(t),this.controller,this.client),new pA(()=>s(r),this.controller,this.client)]}toReadableStream(){const t=this;let r;return cQ({async start(){r=t[Symbol.asyncIterator]()},async pull(a){try{const{value:s,done:i}=await r.next();if(i)return a.close();const l=eE(JSON.stringify(s)+`
`);a.enqueue(l)}catch(s){a.error(s)}},async cancel(){var a;await((a=r.return)===null||a===void 0?void 0:a.call(r))}})}}function Ohe(e,t){return zi(this,arguments,function*(){var a,s,i,l;if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new ki("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new ki("Attempted to iterate over a response with no body");const o=new Lhe,d=new iv,u=dQ(e.body);try{for(var f=!0,p=$i(Phe(u)),h;h=yield St(p.next()),a=h.done,!a;f=!0){l=h.value,f=!1;const m=l;for(const b of d.decode(m)){const v=o.decode(b);v&&(yield yield St(v))}}}catch(m){s={error:m}}finally{try{!f&&!a&&(i=p.return)&&(yield St(i.call(p)))}finally{if(s)throw s.error}}for(const m of d.flush()){const b=o.decode(m);b&&(yield yield St(b))}})}function Phe(e){return zi(this,arguments,function*(){var r,a,s,i;let l=new Uint8Array;try{for(var o=!0,d=$i(e),u;u=yield St(d.next()),r=u.done,!r;o=!0){i=u.value,o=!1;const f=i;if(f==null)continue;const p=f instanceof ArrayBuffer?new Uint8Array(f):typeof f=="string"?eE(f):f;let h=new Uint8Array(l.length+p.length);h.set(l),h.set(p,l.length),l=h;let m;for(;(m=Mhe(l))!==-1;)yield yield St(l.slice(0,m)),l=l.slice(m)}}catch(f){a={error:f}}finally{try{!o&&!r&&(s=d.return)&&(yield St(s.call(d)))}finally{if(a)throw a.error}}l.length>0&&(yield yield St(l))})}class Lhe{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;const i={event:this.event,data:this.data.join(`
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],i}if(this.chunks.push(t),t.startsWith(":"))return null;let[r,a,s]=Qhe(t,":");return s.startsWith(" ")&&(s=s.substring(1)),r==="event"?this.event=s:r==="data"&&this.data.push(s),null}}function Qhe(e,t){const r=e.indexOf(t);return r!==-1?[e.substring(0,r),t,e.substring(r+t.length)]:[e,"",""]}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */async function Hhe(e,t){const{response:r,requestLogID:a,retryOfRequestLogID:s,startTime:i}=t,l=await(async()=>{var o;if(t.options.stream)return Gn(e).debug("response",r.status,r.url,r.headers,r.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(r,t.controller,e):pA.fromSSEResponse(r,t.controller,e);if(r.status===204)return null;if(t.options.__binaryResponse)return r;const d=r.headers.get("content-type"),u=(o=d==null?void 0:d.split(";")[0])===null||o===void 0?void 0:o.trim();return(u==null?void 0:u.includes("application/json"))||(u==null?void 0:u.endsWith("+json"))?r.headers.get("content-length")==="0"?void 0:await r.json():await r.text()})();return Gn(e).debug(`[${a}] response parsed`,gd({retryOfRequestLogID:s,url:r.url,status:r.status,body:l,durationMs:Date.now()-i})),l}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class tE extends Promise{constructor(t,r,a=Hhe){super(s=>{s(null)}),this.responsePromise=r,this.parseResponse=a,this.client=t}_thenUnwrap(t){return new tE(this.client,this.responsePromise,async(r,a)=>t(await this.parseResponse(r,a),a))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){const[t,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:r}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(this.client,t))),this.parsedPromise}then(t,r){return this.parse().then(t,r)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const mQ=Symbol("brand.privateNullableHeaders");function*zhe(e){if(!e)return;if(mQ in e){const{values:a,nulls:s}=e;yield*a.entries();for(const i of s)yield[i,null];return}let t=!1,r;e instanceof Headers?r=e.entries():tD(e)?r=e:(t=!0,r=Object.entries(e??{}));for(let a of r){const s=a[0];if(typeof s!="string")throw new TypeError("expected header name to be a string");const i=tD(a[1])?a[1]:[a[1]];let l=!1;for(const o of i)o!==void 0&&(t&&!l&&(l=!0,yield[s,null]),yield[s,o])}}const cf=e=>{const t=new Headers,r=new Set;for(const a of e){const s=new Set;for(const[i,l]of zhe(a)){const o=i.toLowerCase();s.has(o)||(t.delete(i),s.add(o)),l===null?(t.delete(i),r.add(o)):(t.append(i,l),r.delete(o))}}return{[mQ]:!0,values:t,nulls:r}};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const C2=e=>{var t,r,a,s,i,l;if(typeof globalThis.process<"u")return(a=(r=(t=oue)===null||t===void 0?void 0:t[e])===null||r===void 0?void 0:r.trim())!==null&&a!==void 0?a:void 0;if(typeof globalThis.Deno<"u")return(l=(i=(s=globalThis.Deno.env)===null||s===void 0?void 0:s.get)===null||i===void 0?void 0:i.call(s,e))===null||l===void 0?void 0:l.trim()};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var gQ;class lv{constructor(t){var r,a,s,i,l,o,d,{baseURL:u=C2("GEMINI_NEXT_GEN_API_BASE_URL"),apiKey:f=(r=C2("GEMINI_API_KEY"))!==null&&r!==void 0?r:null,apiVersion:p="v1beta"}=t,h=Og(t,["baseURL","apiKey","apiVersion"]);const m=Object.assign(Object.assign({apiKey:f,apiVersion:p},h),{baseURL:u||"https://generativelanguage.googleapis.com"});this.baseURL=m.baseURL,this.timeout=(a=m.timeout)!==null&&a!==void 0?a:lv.DEFAULT_TIMEOUT,this.logger=(s=m.logger)!==null&&s!==void 0?s:console;const b="warn";this.logLevel=b,this.logLevel=(l=(i=iD(m.logLevel,"ClientOptions.logLevel",this))!==null&&i!==void 0?i:iD(C2("GEMINI_NEXT_GEN_API_LOG"),"process.env['GEMINI_NEXT_GEN_API_LOG']",this))!==null&&l!==void 0?l:b,this.fetchOptions=m.fetchOptions,this.maxRetries=(o=m.maxRetries)!==null&&o!==void 0?o:2,this.fetch=(d=m.fetch)!==null&&d!==void 0?d:Nhe(),this.encoder=jhe,this._options=m,this.apiKey=f,this.apiVersion=p,this.clientAdapter=m.clientAdapter}withOptions(t){return new this.constructor(Object.assign(Object.assign(Object.assign({},this._options),{baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,apiVersion:this.apiVersion}),t))}baseURLOverridden(){return this.baseURL!=="https://generativelanguage.googleapis.com"}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:r}){if(!(t.has("authorization")||t.has("x-goog-api-key"))&&!(this.apiKey&&t.get("x-goog-api-key"))&&!r.has("x-goog-api-key"))throw new Error('Could not resolve authentication method. Expected the apiKey to be set. Or for the "x-goog-api-key" headers to be explicitly omitted')}async authHeaders(t){const r=cf([t.headers]);if(!(r.values.has("authorization")||r.values.has("x-goog-api-key"))){if(this.apiKey)return cf([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter.isVertexAI())return cf([await this.clientAdapter.getAuthHeaders()])}}stringifyQuery(t){return Object.entries(t).filter(([r,a])=>typeof a<"u").map(([r,a])=>{if(typeof a=="string"||typeof a=="number"||typeof a=="boolean")return`${encodeURIComponent(r)}=${encodeURIComponent(a)}`;if(a===null)return`${encodeURIComponent(r)}=`;throw new ki(`Cannot stringify type ${typeof a}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}getUserAgent(){return`${this.constructor.name}/JS ${iA}`}defaultIdempotencyKey(){return`stainless-node-retry-${che()}`}makeStatusError(t,r,a,s){return ts.generate(t,r,a,s)}buildURL(t,r,a){const s=!this.baseURLOverridden()&&a||this.baseURL,i=uhe(t)?new URL(t):new URL(s+(s.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),l=this.defaultQuery();return phe(l)||(r=Object.assign(Object.assign({},l),r)),typeof r=="object"&&r&&!Array.isArray(r)&&(i.search=this.stringifyQuery(r)),i.toString()}async prepareOptions(t){if(this.clientAdapter&&this.clientAdapter.isVertexAI()&&!t.path.startsWith(`/${this.apiVersion}/projects/`)){const r=t.path.slice(this.apiVersion.length+1);t.path=`/${this.apiVersion}/projects/${this.clientAdapter.getProject()}/locations/${this.clientAdapter.getLocation()}${r}`}}async prepareRequest(t,{url:r,options:a}){}get(t,r){return this.methodRequest("get",t,r)}post(t,r){return this.methodRequest("post",t,r)}patch(t,r){return this.methodRequest("patch",t,r)}put(t,r){return this.methodRequest("put",t,r)}delete(t,r){return this.methodRequest("delete",t,r)}methodRequest(t,r,a){return this.request(Promise.resolve(a).then(s=>Object.assign({method:t,path:r},s)))}request(t,r=null){return new tE(this,this.makeRequest(t,r,void 0))}async makeRequest(t,r,a){var s,i,l;const o=await t,d=(s=o.maxRetries)!==null&&s!==void 0?s:this.maxRetries;r==null&&(r=d),await this.prepareOptions(o);const{req:u,url:f,timeout:p}=await this.buildRequest(o,{retryCount:d-r});await this.prepareRequest(u,{url:f,options:o});const h="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),m=a===void 0?"":`, retryOf: ${a}`,b=Date.now();if(Gn(this).debug(`[${h}] sending request`,gd({retryOfRequestLogID:a,method:o.method,url:f,options:o,headers:u.headers})),!((i=o.signal)===null||i===void 0)&&i.aborted)throw new bC;const v=new AbortController,y=await this.fetchWithTimeout(f,u,p,v).catch(gC),j=Date.now();if(y instanceof globalThis.Error){const N=`retrying, ${r} attempts remaining`;if(!((l=o.signal)===null||l===void 0)&&l.aborted)throw new bC;const E=mC(y)||/timed? ?out/i.test(String(y)+("cause"in y?String(y.cause):""));if(r)return Gn(this).info(`[${h}] connection ${E?"timed out":"failed"} - ${N}`),Gn(this).debug(`[${h}] connection ${E?"timed out":"failed"} (${N})`,gd({retryOfRequestLogID:a,url:f,durationMs:j-b,message:y.message})),this.retryRequest(o,r,a??h);throw Gn(this).info(`[${h}] connection ${E?"timed out":"failed"} - error; no more retries left`),Gn(this).debug(`[${h}] connection ${E?"timed out":"failed"} (error; no more retries left)`,gd({retryOfRequestLogID:a,url:f,durationMs:j-b,message:y.message})),E?new eQ:new sv({cause:y})}const _=`[${h}${m}] ${u.method} ${f} ${y.ok?"succeeded":"failed"} with status ${y.status} in ${j-b}ms`;if(!y.ok){const N=await this.shouldRetry(y);if(r&&N){const U=`retrying, ${r} attempts remaining`;return await khe(y.body),Gn(this).info(`${_} - ${U}`),Gn(this).debug(`[${h}] response error (${U})`,gd({retryOfRequestLogID:a,url:y.url,status:y.status,headers:y.headers,durationMs:j-b})),this.retryRequest(o,r,a??h,y.headers)}const E=N?"error; no more retries left":"error; not retryable";Gn(this).info(`${_} - ${E}`);const T=await y.text().catch(U=>gC(U).message),B=mhe(T),F=B?void 0:T;throw Gn(this).debug(`[${h}] response error (${E})`,gd({retryOfRequestLogID:a,url:y.url,status:y.status,headers:y.headers,message:F,durationMs:Date.now()-b})),this.makeStatusError(y.status,B,F,y.headers)}return Gn(this).info(_),Gn(this).debug(`[${h}] response start`,gd({retryOfRequestLogID:a,url:y.url,status:y.status,headers:y.headers,durationMs:j-b})),{response:y,options:o,controller:v,requestLogID:h,retryOfRequestLogID:a,startTime:b}}async fetchWithTimeout(t,r,a,s){const i=r||{},{signal:l,method:o}=i,d=Og(i,["signal","method"]),u=this._makeAbort(s);l&&l.addEventListener("abort",u,{once:!0});const f=setTimeout(u,a),p=globalThis.ReadableStream&&d.body instanceof globalThis.ReadableStream||typeof d.body=="object"&&d.body!==null&&Symbol.asyncIterator in d.body,h=Object.assign(Object.assign(Object.assign({signal:s.signal},p?{duplex:"half"}:{}),{method:"GET"}),d);o&&(h.method=o.toUpperCase());try{return await this.fetch.call(void 0,t,h)}finally{clearTimeout(f)}}async shouldRetry(t){const r=t.headers.get("x-should-retry");return r==="true"?!0:r==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,r,a,s){var i;let l;const o=s==null?void 0:s.get("retry-after-ms");if(o){const u=parseFloat(o);Number.isNaN(u)||(l=u)}const d=s==null?void 0:s.get("retry-after");if(d&&!l){const u=parseFloat(d);Number.isNaN(u)?l=Date.parse(d)-Date.now():l=u*1e3}if(!(l&&0<=l&&l<60*1e3)){const u=(i=t.maxRetries)!==null&&i!==void 0?i:this.maxRetries;l=this.calculateDefaultRetryTimeoutMillis(r,u)}return await ghe(l),this.makeRequest(t,r-1,a)}calculateDefaultRetryTimeoutMillis(t,r){const i=r-t,l=Math.min(.5*Math.pow(2,i),8),o=1-Math.random()*.25;return l*o*1e3}async buildRequest(t,{retryCount:r=0}={}){var a,s,i;const l=Object.assign({},t),{method:o,path:d,query:u,defaultBaseURL:f}=l,p=this.buildURL(d,u,f);"timeout"in l&&hhe("timeout",l.timeout),l.timeout=(a=l.timeout)!==null&&a!==void 0?a:this.timeout;const{bodyHeaders:h,body:m}=this.buildBody({options:l}),b=await this.buildHeaders({options:t,method:o,bodyHeaders:h,retryCount:r});return{req:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({method:o,headers:b},l.signal&&{signal:l.signal}),globalThis.ReadableStream&&m instanceof globalThis.ReadableStream&&{duplex:"half"}),m&&{body:m}),(s=this.fetchOptions)!==null&&s!==void 0?s:{}),(i=l.fetchOptions)!==null&&i!==void 0?i:{}),url:p,timeout:l.timeout}}async buildHeaders({options:t,method:r,bodyHeaders:a,retryCount:s}){let i={};this.idempotencyHeader&&r!=="get"&&(t.idempotencyKey||(t.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=t.idempotencyKey);const l=await this.authHeaders(t);let o=cf([i,Object.assign(Object.assign({Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(s)},t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{}),whe()),this._options.defaultHeaders,a,t.headers,l]);return this.validateHeaders(o),o.values}_makeAbort(t){return()=>t.abort()}buildBody({options:{body:t,headers:r}}){if(!t)return{bodyHeaders:void 0,body:void 0};const a=cf([r]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&a.values.has("content-type")||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t=="object"&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")?{bodyHeaders:void 0,body:Che(t)}:typeof t=="object"&&a.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(t)}:this.encoder({body:t,headers:a})}}lv.DEFAULT_TIMEOUT=6e4;class on extends lv{constructor(){super(...arguments),this.interactions=new hQ(this)}}gQ=on;on.GeminiNextGenAPIClient=gQ;on.GeminiNextGenAPIClientError=ki;on.APIError=ts;on.APIConnectionError=sv;on.APIConnectionTimeoutError=eQ;on.APIUserAbortError=bC;on.NotFoundError=nQ;on.ConflictError=sQ;on.RateLimitError=lQ;on.BadRequestError=tQ;on.AuthenticationError=rQ;on.InternalServerError=oQ;on.PermissionDeniedError=aQ;on.UnprocessableEntityError=iQ;on.toFile=The;on.Interactions=hQ;/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function $he(e,t){const r={},a=w(e,["name"]);return a!=null&&C(r,["_url","name"],a),r}function Vhe(e,t){const r={},a=w(e,["name"]);return a!=null&&C(r,["_url","name"],a),r}function Ghe(e,t){const r={},a=w(e,["sdkHttpResponse"]);return a!=null&&C(r,["sdkHttpResponse"],a),r}function Khe(e,t){const r={},a=w(e,["sdkHttpResponse"]);return a!=null&&C(r,["sdkHttpResponse"],a),r}function qhe(e,t,r){const a={};if(w(e,["validationDataset"])!==void 0)throw new Error("validationDataset parameter is not supported in Gemini API.");const s=w(e,["tunedModelDisplayName"]);if(t!==void 0&&s!=null&&C(t,["displayName"],s),w(e,["description"])!==void 0)throw new Error("description parameter is not supported in Gemini API.");const i=w(e,["epochCount"]);t!==void 0&&i!=null&&C(t,["tuningTask","hyperparameters","epochCount"],i);const l=w(e,["learningRateMultiplier"]);if(l!=null&&C(a,["tuningTask","hyperparameters","learningRateMultiplier"],l),w(e,["exportLastCheckpointOnly"])!==void 0)throw new Error("exportLastCheckpointOnly parameter is not supported in Gemini API.");if(w(e,["preTunedModelCheckpointId"])!==void 0)throw new Error("preTunedModelCheckpointId parameter is not supported in Gemini API.");if(w(e,["adapterSize"])!==void 0)throw new Error("adapterSize parameter is not supported in Gemini API.");if(w(e,["tuningMode"])!==void 0)throw new Error("tuningMode parameter is not supported in Gemini API.");if(w(e,["customBaseModel"])!==void 0)throw new Error("customBaseModel parameter is not supported in Gemini API.");const o=w(e,["batchSize"]);t!==void 0&&o!=null&&C(t,["tuningTask","hyperparameters","batchSize"],o);const d=w(e,["learningRate"]);if(t!==void 0&&d!=null&&C(t,["tuningTask","hyperparameters","learningRate"],d),w(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");if(w(e,["beta"])!==void 0)throw new Error("beta parameter is not supported in Gemini API.");if(w(e,["baseTeacherModel"])!==void 0)throw new Error("baseTeacherModel parameter is not supported in Gemini API.");if(w(e,["tunedTeacherModelSource"])!==void 0)throw new Error("tunedTeacherModelSource parameter is not supported in Gemini API.");if(w(e,["sftLossWeightMultiplier"])!==void 0)throw new Error("sftLossWeightMultiplier parameter is not supported in Gemini API.");if(w(e,["outputUri"])!==void 0)throw new Error("outputUri parameter is not supported in Gemini API.");if(w(e,["encryptionSpec"])!==void 0)throw new Error("encryptionSpec parameter is not supported in Gemini API.");return a}function Whe(e,t,r){const a={};let s=w(r,["config","method"]);if(s===void 0&&(s="SUPERVISED_FINE_TUNING"),s==="SUPERVISED_FINE_TUNING"){const B=w(e,["validationDataset"]);t!==void 0&&B!=null&&C(t,["supervisedTuningSpec"],k2(B))}else if(s==="PREFERENCE_TUNING"){const B=w(e,["validationDataset"]);t!==void 0&&B!=null&&C(t,["preferenceOptimizationSpec"],k2(B))}else if(s==="DISTILLATION"){const B=w(e,["validationDataset"]);t!==void 0&&B!=null&&C(t,["distillationSpec"],k2(B))}const i=w(e,["tunedModelDisplayName"]);t!==void 0&&i!=null&&C(t,["tunedModelDisplayName"],i);const l=w(e,["description"]);t!==void 0&&l!=null&&C(t,["description"],l);let o=w(r,["config","method"]);if(o===void 0&&(o="SUPERVISED_FINE_TUNING"),o==="SUPERVISED_FINE_TUNING"){const B=w(e,["epochCount"]);t!==void 0&&B!=null&&C(t,["supervisedTuningSpec","hyperParameters","epochCount"],B)}else if(o==="PREFERENCE_TUNING"){const B=w(e,["epochCount"]);t!==void 0&&B!=null&&C(t,["preferenceOptimizationSpec","hyperParameters","epochCount"],B)}else if(o==="DISTILLATION"){const B=w(e,["epochCount"]);t!==void 0&&B!=null&&C(t,["distillationSpec","hyperParameters","epochCount"],B)}let d=w(r,["config","method"]);if(d===void 0&&(d="SUPERVISED_FINE_TUNING"),d==="SUPERVISED_FINE_TUNING"){const B=w(e,["learningRateMultiplier"]);t!==void 0&&B!=null&&C(t,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],B)}else if(d==="PREFERENCE_TUNING"){const B=w(e,["learningRateMultiplier"]);t!==void 0&&B!=null&&C(t,["preferenceOptimizationSpec","hyperParameters","learningRateMultiplier"],B)}else if(d==="DISTILLATION"){const B=w(e,["learningRateMultiplier"]);t!==void 0&&B!=null&&C(t,["distillationSpec","hyperParameters","learningRateMultiplier"],B)}let u=w(r,["config","method"]);if(u===void 0&&(u="SUPERVISED_FINE_TUNING"),u==="SUPERVISED_FINE_TUNING"){const B=w(e,["exportLastCheckpointOnly"]);t!==void 0&&B!=null&&C(t,["supervisedTuningSpec","exportLastCheckpointOnly"],B)}else if(u==="PREFERENCE_TUNING"){const B=w(e,["exportLastCheckpointOnly"]);t!==void 0&&B!=null&&C(t,["preferenceOptimizationSpec","exportLastCheckpointOnly"],B)}else if(u==="DISTILLATION"){const B=w(e,["exportLastCheckpointOnly"]);t!==void 0&&B!=null&&C(t,["distillationSpec","exportLastCheckpointOnly"],B)}let f=w(r,["config","method"]);if(f===void 0&&(f="SUPERVISED_FINE_TUNING"),f==="SUPERVISED_FINE_TUNING"){const B=w(e,["adapterSize"]);t!==void 0&&B!=null&&C(t,["supervisedTuningSpec","hyperParameters","adapterSize"],B)}else if(f==="PREFERENCE_TUNING"){const B=w(e,["adapterSize"]);t!==void 0&&B!=null&&C(t,["preferenceOptimizationSpec","hyperParameters","adapterSize"],B)}else if(f==="DISTILLATION"){const B=w(e,["adapterSize"]);t!==void 0&&B!=null&&C(t,["distillationSpec","hyperParameters","adapterSize"],B)}let p=w(r,["config","method"]);if(p===void 0&&(p="SUPERVISED_FINE_TUNING"),p==="SUPERVISED_FINE_TUNING"){const B=w(e,["tuningMode"]);t!==void 0&&B!=null&&C(t,["supervisedTuningSpec","tuningMode"],B)}const h=w(e,["customBaseModel"]);t!==void 0&&h!=null&&C(t,["customBaseModel"],h);let m=w(r,["config","method"]);if(m===void 0&&(m="SUPERVISED_FINE_TUNING"),m==="SUPERVISED_FINE_TUNING"){const B=w(e,["batchSize"]);t!==void 0&&B!=null&&C(t,["supervisedTuningSpec","hyperParameters","batchSize"],B)}let b=w(r,["config","method"]);if(b===void 0&&(b="SUPERVISED_FINE_TUNING"),b==="SUPERVISED_FINE_TUNING"){const B=w(e,["learningRate"]);t!==void 0&&B!=null&&C(t,["supervisedTuningSpec","hyperParameters","learningRate"],B)}const v=w(e,["labels"]);t!==void 0&&v!=null&&C(t,["labels"],v);const y=w(e,["beta"]);t!==void 0&&y!=null&&C(t,["preferenceOptimizationSpec","hyperParameters","beta"],y);const j=w(e,["baseTeacherModel"]);t!==void 0&&j!=null&&C(t,["distillationSpec","baseTeacherModel"],j);const _=w(e,["tunedTeacherModelSource"]);t!==void 0&&_!=null&&C(t,["distillationSpec","tunedTeacherModelSource"],_);const N=w(e,["sftLossWeightMultiplier"]);t!==void 0&&N!=null&&C(t,["distillationSpec","hyperParameters","sftLossWeightMultiplier"],N);const E=w(e,["outputUri"]);t!==void 0&&E!=null&&C(t,["outputUri"],E);const T=w(e,["encryptionSpec"]);return t!==void 0&&T!=null&&C(t,["encryptionSpec"],T),a}function Yhe(e,t){const r={},a=w(e,["baseModel"]);a!=null&&C(r,["baseModel"],a);const s=w(e,["preTunedModel"]);s!=null&&C(r,["preTunedModel"],s);const i=w(e,["trainingDataset"]);i!=null&&lme(i);const l=w(e,["config"]);return l!=null&&qhe(l,r),r}function Xhe(e,t){const r={},a=w(e,["baseModel"]);a!=null&&C(r,["baseModel"],a);const s=w(e,["preTunedModel"]);s!=null&&C(r,["preTunedModel"],s);const i=w(e,["trainingDataset"]);i!=null&&ome(i,r,t);const l=w(e,["config"]);return l!=null&&Whe(l,r,t),r}function Jhe(e,t){const r={},a=w(e,["name"]);return a!=null&&C(r,["_url","name"],a),r}function Zhe(e,t){const r={},a=w(e,["name"]);return a!=null&&C(r,["_url","name"],a),r}function eme(e,t,r){const a={},s=w(e,["pageSize"]);t!==void 0&&s!=null&&C(t,["_query","pageSize"],s);const i=w(e,["pageToken"]);t!==void 0&&i!=null&&C(t,["_query","pageToken"],i);const l=w(e,["filter"]);return t!==void 0&&l!=null&&C(t,["_query","filter"],l),a}function tme(e,t,r){const a={},s=w(e,["pageSize"]);t!==void 0&&s!=null&&C(t,["_query","pageSize"],s);const i=w(e,["pageToken"]);t!==void 0&&i!=null&&C(t,["_query","pageToken"],i);const l=w(e,["filter"]);return t!==void 0&&l!=null&&C(t,["_query","filter"],l),a}function rme(e,t){const r={},a=w(e,["config"]);return a!=null&&eme(a,r),r}function ame(e,t){const r={},a=w(e,["config"]);return a!=null&&tme(a,r),r}function nme(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["nextPageToken"]);s!=null&&C(r,["nextPageToken"],s);const i=w(e,["tunedModels"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(o=>bQ(o))),C(r,["tuningJobs"],l)}return r}function sme(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["nextPageToken"]);s!=null&&C(r,["nextPageToken"],s);const i=w(e,["tuningJobs"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(o=>wC(o))),C(r,["tuningJobs"],l)}return r}function ime(e,t){const r={},a=w(e,["name"]);a!=null&&C(r,["model"],a);const s=w(e,["name"]);return s!=null&&C(r,["endpoint"],s),r}function lme(e,t){const r={};if(w(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(w(e,["vertexDatasetResource"])!==void 0)throw new Error("vertexDatasetResource parameter is not supported in Gemini API.");const a=w(e,["examples"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(i=>i)),C(r,["examples","examples"],s)}return r}function ome(e,t,r){const a={};let s=w(r,["config","method"]);if(s===void 0&&(s="SUPERVISED_FINE_TUNING"),s==="SUPERVISED_FINE_TUNING"){const l=w(e,["gcsUri"]);t!==void 0&&l!=null&&C(t,["supervisedTuningSpec","trainingDatasetUri"],l)}else if(s==="PREFERENCE_TUNING"){const l=w(e,["gcsUri"]);t!==void 0&&l!=null&&C(t,["preferenceOptimizationSpec","trainingDatasetUri"],l)}else if(s==="DISTILLATION"){const l=w(e,["gcsUri"]);t!==void 0&&l!=null&&C(t,["distillationSpec","promptDatasetUri"],l)}let i=w(r,["config","method"]);if(i===void 0&&(i="SUPERVISED_FINE_TUNING"),i==="SUPERVISED_FINE_TUNING"){const l=w(e,["vertexDatasetResource"]);t!==void 0&&l!=null&&C(t,["supervisedTuningSpec","trainingDatasetUri"],l)}else if(i==="PREFERENCE_TUNING"){const l=w(e,["vertexDatasetResource"]);t!==void 0&&l!=null&&C(t,["preferenceOptimizationSpec","trainingDatasetUri"],l)}else if(i==="DISTILLATION"){const l=w(e,["vertexDatasetResource"]);t!==void 0&&l!=null&&C(t,["distillationSpec","promptDatasetUri"],l)}if(w(e,["examples"])!==void 0)throw new Error("examples parameter is not supported in Vertex AI.");return a}function bQ(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["name"]);s!=null&&C(r,["name"],s);const i=w(e,["state"]);i!=null&&C(r,["state"],UL(i));const l=w(e,["createTime"]);l!=null&&C(r,["createTime"],l);const o=w(e,["tuningTask","startTime"]);o!=null&&C(r,["startTime"],o);const d=w(e,["tuningTask","completeTime"]);d!=null&&C(r,["endTime"],d);const u=w(e,["updateTime"]);u!=null&&C(r,["updateTime"],u);const f=w(e,["description"]);f!=null&&C(r,["description"],f);const p=w(e,["baseModel"]);p!=null&&C(r,["baseModel"],p);const h=w(e,["_self"]);return h!=null&&C(r,["tunedModel"],ime(h)),r}function wC(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["name"]);s!=null&&C(r,["name"],s);const i=w(e,["state"]);i!=null&&C(r,["state"],UL(i));const l=w(e,["createTime"]);l!=null&&C(r,["createTime"],l);const o=w(e,["startTime"]);o!=null&&C(r,["startTime"],o);const d=w(e,["endTime"]);d!=null&&C(r,["endTime"],d);const u=w(e,["updateTime"]);u!=null&&C(r,["updateTime"],u);const f=w(e,["error"]);f!=null&&C(r,["error"],f);const p=w(e,["description"]);p!=null&&C(r,["description"],p);const h=w(e,["baseModel"]);h!=null&&C(r,["baseModel"],h);const m=w(e,["tunedModel"]);m!=null&&C(r,["tunedModel"],m);const b=w(e,["preTunedModel"]);b!=null&&C(r,["preTunedModel"],b);const v=w(e,["supervisedTuningSpec"]);v!=null&&C(r,["supervisedTuningSpec"],v);const y=w(e,["preferenceOptimizationSpec"]);y!=null&&C(r,["preferenceOptimizationSpec"],y);const j=w(e,["distillationSpec"]);j!=null&&C(r,["distillationSpec"],j);const _=w(e,["tuningDataStats"]);_!=null&&C(r,["tuningDataStats"],_);const N=w(e,["encryptionSpec"]);N!=null&&C(r,["encryptionSpec"],N);const E=w(e,["partnerModelTuningSpec"]);E!=null&&C(r,["partnerModelTuningSpec"],E);const T=w(e,["customBaseModel"]);T!=null&&C(r,["customBaseModel"],T);const B=w(e,["experiment"]);B!=null&&C(r,["experiment"],B);const F=w(e,["labels"]);F!=null&&C(r,["labels"],F);const R=w(e,["outputUri"]);R!=null&&C(r,["outputUri"],R);const U=w(e,["pipelineJob"]);U!=null&&C(r,["pipelineJob"],U);const D=w(e,["serviceAccount"]);D!=null&&C(r,["serviceAccount"],D);const L=w(e,["tunedModelDisplayName"]);L!=null&&C(r,["tunedModelDisplayName"],L);const P=w(e,["veoTuningSpec"]);return P!=null&&C(r,["veoTuningSpec"],P),r}function cme(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&C(r,["sdkHttpResponse"],a);const s=w(e,["name"]);s!=null&&C(r,["name"],s);const i=w(e,["metadata"]);i!=null&&C(r,["metadata"],i);const l=w(e,["done"]);l!=null&&C(r,["done"],l);const o=w(e,["error"]);return o!=null&&C(r,["error"],o),r}function k2(e,t){const r={},a=w(e,["gcsUri"]);a!=null&&C(r,["validationDatasetUri"],a);const s=w(e,["vertexDatasetResource"]);return s!=null&&C(r,["validationDatasetUri"],s),r}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class dme extends Uo{constructor(t){super(),this.apiClient=t,this.list=async(r={})=>new nu(No.PAGED_ITEM_TUNING_JOBS,a=>this.listInternal(a),await this.listInternal(r),r),this.get=async r=>await this.getInternal(r),this.tune=async r=>{var a;if(this.apiClient.isVertexAI())if(r.baseModel.startsWith("projects/")){const s={tunedModelName:r.baseModel};!((a=r.config)===null||a===void 0)&&a.preTunedModelCheckpointId&&(s.checkpointId=r.config.preTunedModelCheckpointId);const i=Object.assign(Object.assign({},r),{preTunedModel:s});return i.baseModel=void 0,await this.tuneInternal(i)}else{const s=Object.assign({},r);return await this.tuneInternal(s)}else{const s=Object.assign({},r),i=await this.tuneMldevInternal(s);let l="";return i.metadata!==void 0&&i.metadata.tunedModel!==void 0?l=i.metadata.tunedModel:i.name!==void 0&&i.name.includes("/operations/")&&(l=i.name.split("/operations/")[0]),{name:l,state:cC.JOB_STATE_QUEUED}}}}async getInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Zhe(t);return o=et("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>wC(f))}else{const u=Jhe(t);return o=et("{name}",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>bQ(f))}}async listInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=ame(t);return o=et("tuningJobs",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=sme(f),h=new D3;return Object.assign(h,p),h})}else{const u=rme(t);return o=et("tunedModels",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=nme(f),h=new D3;return Object.assign(h,p),h})}}async cancel(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Vhe(t);return o=et("{name}:cancel",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=Khe(f),h=new U3;return Object.assign(h,p),h})}else{const u=$he(t);return o=et("{name}:cancel",u._url),d=u._query,delete u._url,delete u._query,l=this.apiClient.request({path:o,queryParams:d,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(f=>f.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:f.headers},h})),l.then(f=>{const p=Ghe(f),h=new U3;return Object.assign(h,p),h})}}async tuneInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=Xhe(t,t);return i=et("tuningJobs",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json().then(u=>{const f=u;return f.sdkHttpResponse={headers:d.headers},f})),s.then(d=>wC(d))}else throw new Error("This method is only supported by the Vertex AI.")}async tuneMldevInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const o=Yhe(t);return i=et("tunedModels",o._url),l=o._query,delete o._url,delete o._query,s=this.apiClient.request({path:i,queryParams:l,body:JSON.stringify(o),httpMethod:"POST",httpOptions:(r=t.config)===null||r===void 0?void 0:r.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(d=>d.json().then(u=>{const f=u;return f.sdkHttpResponse={headers:d.headers},f})),s.then(d=>cme(d))}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class ume{async download(t,r){throw new Error("Download to file is not supported in the browser, please use a browser compliant download like an <a> tag.")}}const Ame=1024*1024*8,fme=3,pme=1e3,xme=2,Lg="x-goog-upload-status";async function hme(e,t,r){var a;const s=await vQ(e,t,r),i=await(s==null?void 0:s.json());if(((a=s==null?void 0:s.headers)===null||a===void 0?void 0:a[Lg])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return i.file}async function mme(e,t,r){var a;const s=await vQ(e,t,r),i=await(s==null?void 0:s.json());if(((a=s==null?void 0:s.headers)===null||a===void 0?void 0:a[Lg])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");const l=BL(i),o=new qj;return Object.assign(o,l),o}async function vQ(e,t,r){var a,s;let i=0,l=0,o=new uC(new Response),d="upload";for(i=e.size;l<i;){const u=Math.min(Ame,i-l),f=e.slice(l,l+u);l+u>=i&&(d+=", finalize");let p=0,h=pme;for(;p<fme&&(o=await r.request({path:"",body:f,httpMethod:"POST",httpOptions:{apiVersion:"",baseUrl:t,headers:{"X-Goog-Upload-Command":d,"X-Goog-Upload-Offset":String(l),"Content-Length":String(u)}}}),!(!((a=o==null?void 0:o.headers)===null||a===void 0)&&a[Lg]));)p++,await bme(h),h=h*xme;if(l+=u,((s=o==null?void 0:o.headers)===null||s===void 0?void 0:s[Lg])!=="active")break;if(i<=l)throw new Error("All content has been uploaded, but the upload status is not finalized.")}return o}async function gme(e){return{size:e.size,type:e.type}}function bme(e){return new Promise(t=>setTimeout(t,e))}class vme{async upload(t,r,a){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await hme(t,r,a)}async uploadToFileSearchStore(t,r,a){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await mme(t,r,a)}async stat(t){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await gme(t)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class yme{create(t,r,a){return new wme(t,r,a)}}class wme{constructor(t,r,a){this.url=t,this.headers=r,this.callbacks=a}connect(){this.ws=new WebSocket(this.url),this.ws.onopen=this.callbacks.onopen,this.ws.onerror=this.callbacks.onerror,this.ws.onclose=this.callbacks.onclose,this.ws.onmessage=this.callbacks.onmessage}send(t){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.send(t)}close(){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.close()}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const oD="x-goog-api-key";class Nme{constructor(t){this.apiKey=t}async addAuthHeaders(t,r){if(t.get(oD)===null){if(this.apiKey.startsWith("auth_tokens/"))throw new Error("Ephemeral tokens are only supported by the live API.");if(!this.apiKey)throw new Error("API key is missing. Please provide a valid API key.");t.append(oD,this.apiKey)}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Cme="gl-node/";class kme{get interactions(){var t;if(this._interactions!==void 0)return this._interactions;console.warn("GoogleGenAI.interactions: Interactions usage is experimental and may change in future versions.");const r=this.httpOptions;r!=null&&r.extraBody&&console.warn("GoogleGenAI.interactions: Client level httpOptions.extraBody is not supported by the interactions client and will be ignored.");const a=new on({baseURL:this.apiClient.getBaseUrl(),apiKey:this.apiKey,apiVersion:this.apiClient.getApiVersion(),clientAdapter:this.apiClient,defaultHeaders:this.apiClient.getDefaultHeaders(),timeout:r==null?void 0:r.timeout,maxRetries:(t=r==null?void 0:r.retryOptions)===null||t===void 0?void 0:t.attempts});return this._interactions=a.interactions,this._interactions}constructor(t){var r;if(t.apiKey==null)throw new Error("An API Key must be set when running in a browser");if(t.project||t.location)throw new Error("Vertex AI project based authentication is not supported on browser runtimes. Please do not provide a project or location.");this.vertexai=(r=t.vertexai)!==null&&r!==void 0?r:!1,this.apiKey=t.apiKey;const a=Aue(t.httpOptions,t.vertexai,void 0,void 0);a&&(t.httpOptions?t.httpOptions.baseUrl=a:t.httpOptions={baseUrl:a}),this.apiVersion=t.apiVersion,this.httpOptions=t.httpOptions;const s=new Nme(this.apiKey);this.apiClient=new gxe({auth:s,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:this.httpOptions,userAgentExtra:Cme+"web",uploader:new vme,downloader:new ume}),this.models=new Rxe(this.apiClient),this.live=new Txe(this.apiClient,s,new yme),this.batches=new zAe(this.apiClient),this.chats=new C0e(this.models,this.apiClient),this.caches=new y0e(this.apiClient),this.files=new M0e(this.apiClient),this.operations=new Oxe(this.apiClient),this.authTokens=new ehe(this.apiClient),this.tunings=new dme(this.apiClient),this.fileSearchStores=new ohe(this.apiClient)}}async function jme(e){try{const t=new kme({apiKey:void 0}),r=`Actúa como un Auditor Contable Senior y Arquitecto de Sistemas. 
    Analiza los siguientes datos financieros del Condominio Tejar y genera un dictamen profesional breve en formato HTML.
    Resalta hallazgos, riesgos y recomendaciones operativas.
    
    Datos: ${JSON.stringify(e)}
    
    Instrucciones de Diseño:
    1. Usa un tono experto y asertivo.
    2. Divide en secciones claras usando clases de Tailwind CSS (text-slate-800, font-black, etc).
    3. Resalta las discrepancias en rojo y los éxitos en verde esmeralda.
    4. Termina con una breve nota sobre la integridad del rastro de auditoría del sistema SAC 2026.`;return(await t.models.generateContent({model:"gemini-3-pro-preview",contents:r})).text||"<div class='p-6 text-amber-600 bg-amber-50 rounded-3xl border border-amber-200'>La IA no pudo procesar el dictamen en este momento.</div>"}catch(t){return console.error("Gemini Audit Error:",t),"<div class='p-6 text-red-600 bg-red-50 rounded-3xl border border-red-200'>Fallo crítico en el motor de IA. Verifique su conexión y cuotas de API.</div>"}}const Ea=e=>e.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),Eme=({user:e})=>{const{fees:t,pendingBills:r,transactions:a,refreshData:s,loading:i,financialTotals:l}=ht(),[o,d]=k.useState(new Date().getMonth()),[u,f]=k.useState(new Date().getFullYear()),[p,h]=k.useState(null),[m,b]=k.useState(!1);k.useEffect(()=>{s()},[]);const v=k.useMemo(()=>{let _=0,N=0,E=0;t.forEach(R=>{R.month===o&&R.year===u&&(R.debts||[]).forEach(U=>{(U.payments||[]).forEach(D=>{const L=Number(D.amount)||0;_+=L;const P=(D.method||"").toLowerCase();P.includes("efectivo")||P.includes("divisa")?E+=L:N+=L})})}),a.forEach(R=>{const U=(R.description||"").toUpperCase();if(R.type==="Ingreso"&&(U.includes("RECUPERACIÓN DEUDA HISTÓRICA")||U.includes("RECUPERACIÓN DEUDA ANTERIOR"))){const[D,L]=R.date.split("-").map(Number);if(D===u&&L-1===o){const P=Number(R.amount)||0;_+=P,U.includes("(EFECTIVO/CAJA)")?E+=P:N+=P}}});let T=0,B=0;a.forEach(R=>{if(R.type==="Egreso"){const[U,D]=R.date.split("-").map(Number);U===u&&D-1===o&&(T+=Number(R.amount)||0)}}),r.forEach(R=>{if(R.status==="Pagado"&&R.paidDate&&(R.paymentSource||"").toLowerCase()==="efectivo"){const[U,D]=R.paidDate.split("-").map(Number);U===u&&D-1===o&&(B+=Number(R.amount)||0)}});const F=T+B;return{ingresos:{total:_,banco:N,oficina:E},egresos:{total:F,banco:T,oficina:B},cajaChica:{anterior:(l==null?void 0:l.initialCashUsd)||0,ingresos:E,egresos:B,final:(l==null?void 0:l.initialCashUsd)||0}}},[o,u,t,r,a,l]),y=async()=>{b(!0);try{const _=await jme({periodo:`${Te[o]} ${u}`,conciliacion_ingresos:v.ingresos,conciliacion_egresos:v.egresos,caja_chica:v.cajaChica,disponibilidad_efectivo_usd:(l==null?void 0:l.initialCashUsd)||0});h(_)}catch{alert("Error al conectar con el servicio de IA.")}finally{b(!1)}},j=()=>{const _=`
        <!DOCTYPE html>
        <html lang="es">
        <head>
            <meta charset="UTF-8">
            <title>Auditoría Financiera - ${Te[o]} ${u}</title>
            <style>
                body { font-family: Arial, sans-serif; padding: 40px; line-height: 1.6; color: #1e293b; }
                .header { background: #0A2647; color: white; padding: 30px; border-radius: 10px; margin-bottom: 30px; }
                h1 { margin: 0; font-size: 24px; }
                .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 30px; }
                .card { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
                .card-header { background: #5B9BD5; color: white; padding: 10px; text-align: center; font-weight: bold; }
                .card-body { padding: 20px; }
                .row { display: flex; justify-content: space-between; margin-bottom: 10px; border-bottom: 1px solid #f1f5f9; padding-bottom: 5px; }
                .total { font-weight: bold; font-size: 18px; color: #2563eb; }
                .caja-chica { background: #f1f5f9; padding: 30px; border-radius: 10px; }
                .footer { margin-top: 50px; text-align: center; font-size: 12px; color: #64748b; }
            </style>
        </head>
        <body>
            <div class="header">
                <h1>AUDITORÍA FINANCIERA - ${Te[o]} ${u}</h1>
                <p>Condominio Residencial El Tejar | SAC 2026</p>
            </div>

            <div class="grid">
                <div class="card">
                    <div class="card-header">INGRESOS</div>
                    <div class="card-body">
                        <div class="row total"><span>Total Cobranza:</span><span>$${Ea(v.ingresos.total)}</span></div>
                        <div class="row"><span>Banco:</span><span>$${Ea(v.ingresos.banco)}</span></div>
                        <div class="row"><span>Oficina:</span><span>$${Ea(v.ingresos.oficina)}</span></div>
                    </div>
                </div>
                <div class="card">
                    <div class="card-header">EGRESOS</div>
                    <div class="card-body">
                        <div class="row total"><span>Total Egresos:</span><span>$${Ea(v.egresos.total)}</span></div>
                        <div class="row"><span>Banco:</span><span>$${Ea(v.egresos.banco)}</span></div>
                        <div class="row"><span>Oficina:</span><span>$${Ea(v.egresos.oficina)}</span></div>
                    </div>
                </div>
            </div>

            <div class="caja-chica">
                <h2 style="text-align:center; font-size: 16px; margin-bottom: 20px;">BALANCE DE CAJA CHICA</h2>
                <div class="row"><span>Saldo Inicial:</span><span>$${Ea(v.cajaChica.anterior)}</span></div>
                <div class="row" style="color: #059669;"><span>(+) Ingresos Efectivo:</span><span>$${Ea(v.cajaChica.ingresos)}</span></div>
                <div class="row" style="color: #dc2626;"><span>(-) Egresos Efectivo:</span><span>$${Ea(v.cajaChica.egresos)}</span></div>
                <div class="row" style="font-weight:bold; font-size: 20px; margin-top: 10px; border-top: 2px solid #cbd5e1; padding-top: 10px;">
                    <span>SALDO FINAL:</span><span>$${Ea(v.cajaChica.final)}</span>
                </div>
            </div>

            <div class="footer">
                Reporte generado por SAC Kernel V5.6 el ${new Date().toLocaleString()}
            </div>
        </body>
        </html>
    `,N=new Blob([_],{type:"text/html"}),E=URL.createObjectURL(N),T=document.createElement("a");T.href=E,T.download=`Auditoria_${Te[o]}_${u}.html`,T.click(),URL.revokeObjectURL(E)};return n.jsxs("div",{className:"min-h-screen bg-[#F5F5F5] font-sans pb-20",children:[n.jsxs("div",{className:"max-w-[900px] mx-auto mb-6 flex flex-col md:flex-row justify-between items-center pt-8 gap-4 px-4 no-print",children:[n.jsxs("div",{className:"flex gap-2 bg-white p-2 rounded-2xl border border-slate-200 shadow-sm w-full md:w-auto",children:[n.jsx("select",{value:o,onChange:_=>d(Number(_.target.value)),className:"bg-transparent border-none text-[11px] font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Te.map((_,N)=>n.jsx("option",{value:N,children:_},N))}),n.jsx("div",{className:"w-px h-4 bg-slate-200 self-center"}),n.jsx("input",{type:"number",value:u,onChange:_=>f(Number(_.target.value)),className:"bg-transparent border-none text-[11px] font-black text-blue-600 outline-none w-16 text-center"})]}),n.jsxs("div",{className:"flex gap-2 w-full md:w-auto",children:[n.jsxs("button",{onClick:j,className:"flex-1 md:flex-none bg-blue-600 text-white px-6 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center justify-center gap-2 hover:bg-blue-700 shadow-sm",children:[n.jsx(Zd,{size:16})," HTML"]}),n.jsxs("button",{onClick:()=>window.print(),className:"flex-1 md:flex-none bg-white border border-slate-200 text-slate-600 px-6 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center justify-center gap-2 hover:bg-slate-50 shadow-sm",children:[n.jsx(wt,{size:16})," Imprimir"]}),n.jsxs("button",{onClick:y,disabled:m,className:"flex-1 md:flex-none bg-[#0A2647] text-white px-6 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center justify-center gap-2 shadow-lg active:scale-95 disabled:opacity-50",children:[m?n.jsx(ct,{className:"animate-spin",size:16}):n.jsx(W_,{size:16}),"Auditoría IA"]})]})]}),n.jsxs("div",{className:`max-w-[900px] mx-auto bg-white shadow-2xl rounded-sm overflow-hidden flex flex-col min-h-[900px] print:shadow-none print:m-0 print:w-full ${p?"no-print":""}`,id:"printable-audit",children:[n.jsxs("div",{className:"bg-[#0A2647] p-10 flex justify-between items-center text-white border-b-4 border-[#2563eb]",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-16 h-16 bg-white rounded-full flex items-center justify-center border-4 border-[#2563eb] shadow-xl",children:n.jsx("span",{className:"text-[#0A2647] font-black text-2xl italic tracking-tighter",children:"TM"})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-3xl font-black tracking-tighter leading-none uppercase",children:"AUDITORÍA FINANCIERA V5.6"}),n.jsx("p",{className:"text-[11px] font-bold text-blue-400 uppercase tracking-[0.3em] mt-1",children:"SISTEMA ADMINISTRATIVO SAC 2026"})]})]}),n.jsxs("div",{className:"text-right border-l border-white/10 pl-8",children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest opacity-60",children:"Periodo Fiscal"}),n.jsxs("p",{className:"text-2xl font-black tracking-tighter uppercase",children:[Te[o]," ",u]})]})]}),n.jsxs("div",{className:"p-10 space-y-10",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"bg-white border-2 border-slate-100 rounded-2xl overflow-hidden shadow-sm flex flex-col",children:[n.jsxs("div",{className:"bg-[#5B9BD5] p-3 text-center text-white flex items-center justify-center gap-2",children:[n.jsx(da,{size:16}),n.jsx("span",{className:"text-[11px] font-black uppercase tracking-widest",children:"Conciliación de Ingresos"})]}),n.jsxs("div",{className:"p-8 flex-1 space-y-5",children:[n.jsxs("div",{className:"flex justify-between items-center border-b pb-2",children:[n.jsx("span",{className:"text-xs font-black text-slate-800 uppercase",children:"Cobranza Consolidada:"}),n.jsxs("span",{className:"text-lg font-black text-blue-600",children:["$",Ea(v.ingresos.total)]})]}),n.jsxs("div",{className:"space-y-2 pl-4 border-l-2 border-slate-100",children:[n.jsxs("div",{className:"flex justify-between text-[11px] text-slate-500 font-bold",children:[n.jsx("span",{children:"Banco (Transferencias):"}),n.jsxs("span",{children:["$",Ea(v.ingresos.banco)]})]}),n.jsxs("div",{className:"flex justify-between text-[11px] text-slate-500 font-bold",children:[n.jsx("span",{children:"Oficina (Efectivo):"}),n.jsxs("span",{children:["$",Ea(v.ingresos.oficina)]})]})]})]}),n.jsxs("div",{className:"p-4 bg-slate-50 border-t flex justify-between items-center px-8",children:[n.jsx("span",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest",children:"ESTADO:"}),n.jsxs("div",{className:"flex items-center gap-1.5 text-emerald-600 font-black text-[10px] uppercase",children:["VERIFICADO ",n.jsx(X_,{size:14})]})]})]}),n.jsxs("div",{className:"bg-white border-2 border-slate-100 rounded-2xl overflow-hidden shadow-sm flex flex-col",children:[n.jsxs("div",{className:"bg-[#5B9BD5] p-3 text-center text-white flex items-center justify-center gap-2",children:[n.jsx(fb,{size:16}),n.jsx("span",{className:"text-[11px] font-black uppercase tracking-widest",children:"Conciliación de Egresos"})]}),n.jsxs("div",{className:"p-8 flex-1 space-y-5",children:[n.jsxs("div",{className:"flex justify-between items-center border-b pb-2",children:[n.jsx("span",{className:"text-xs font-black text-slate-800 uppercase",children:"Egresos Consolidados:"}),n.jsxs("span",{className:"text-lg font-black text-rose-600",children:["$",Ea(v.egresos.total)]})]}),n.jsxs("div",{className:"space-y-2 pl-4 border-l-2 border-slate-100",children:[n.jsxs("div",{className:"flex justify-between text-[11px] text-slate-500 font-bold",children:[n.jsx("span",{children:"Banco (Libro Diario):"}),n.jsxs("span",{children:["$",Ea(v.egresos.banco)]})]}),n.jsxs("div",{className:"flex justify-between text-[11px] text-slate-500 font-bold",children:[n.jsx("span",{children:"Oficina (Facturas):"}),n.jsxs("span",{children:["$",Ea(v.egresos.oficina)]})]})]})]}),n.jsxs("div",{className:"p-4 bg-slate-50 border-t flex justify-between items-center px-8",children:[n.jsx("span",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest",children:"ESTADO:"}),n.jsxs("div",{className:"flex items-center gap-1.5 text-emerald-600 font-black text-[10px] uppercase",children:["VERIFICADO ",n.jsx(X_,{size:14})]})]})]})]}),n.jsxs("div",{className:"max-w-[700px] mx-auto bg-[#ECECEC] border-2 border-slate-200 rounded-sm overflow-hidden shadow-lg mt-10",children:[n.jsxs("div",{className:"bg-[#0A2647] py-3 text-center text-white flex items-center justify-center gap-3",children:[n.jsx(br,{size:18}),n.jsx("span",{className:"text-[12px] font-black uppercase tracking-[0.3em]",children:"Balance de Caja Chica (Efectivo)"})]}),n.jsxs("div",{className:"p-10 space-y-8 font-mono",children:[n.jsxs("div",{className:"flex justify-between items-center text-slate-600 border-b border-slate-300 pb-4",children:[n.jsx("span",{className:"text-xs font-black uppercase",children:"SALDO INICIAL"}),n.jsxs("span",{className:"text-xl font-black text-slate-800",children:["$",Ea(v.cajaChica.anterior)]})]}),n.jsxs("div",{className:"flex justify-between items-center text-emerald-600",children:[n.jsx("span",{className:"text-xs font-black uppercase",children:"(+) COBRANZA EFECTIVO"}),n.jsxs("span",{className:"text-xl font-black",children:["$",Ea(v.cajaChica.ingresos)]})]}),n.jsxs("div",{className:"flex justify-between items-center text-red-600 border-b border-slate-300 pb-4",children:[n.jsx("span",{className:"text-xs font-black uppercase",children:"(-) PAGOS EFECTIVO"}),n.jsxs("span",{className:"text-xl font-black",children:["$",Ea(v.cajaChica.egresos)]})]}),n.jsxs("div",{className:"pt-4 flex justify-between items-center",children:[n.jsx("span",{className:"text-sm font-black text-slate-900 uppercase",children:"SALDO EN EFECTIVO"}),n.jsxs("span",{className:"text-3xl font-black text-slate-900",children:["$",Ea(v.cajaChica.final)]})]})]})]}),n.jsx("div",{className:"pt-10 border-t border-slate-200 text-center",children:n.jsxs("div",{className:"inline-flex items-center gap-3 px-8 py-3 bg-blue-50 text-blue-700 rounded-full border border-blue-100",children:[n.jsx(Ia,{size:24}),n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"Certificación de integridad Kernel V4.0.86 - 100% Auditado"})]})})]}),n.jsxs("div",{className:"bg-[#1a1a1a] p-8 flex justify-between items-center text-white/60",children:[n.jsx("div",{className:"text-xs font-black uppercase tracking-widest",children:"TecnoMath SAC 2026"}),n.jsx("div",{className:"text-[9px] font-bold uppercase tracking-widest",children:"Arquitecto: Andres Mathison • Cod: 4.0.86-PRO"})]})]}),p&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] w-full max-w-4xl h-[90vh] shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95",children:[n.jsxs("div",{className:"p-8 border-b flex justify-between items-center bg-slate-50 no-print",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-2xl flex items-center justify-center text-white",children:n.jsx(W_,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black text-slate-800 tracking-tight",children:"Dictamen Gemini AI"}),n.jsx("p",{className:"text-[10px] text-blue-600 font-black uppercase tracking-widest",children:"Análisis Robótico de Auditoría"})]})]}),n.jsx("button",{onClick:()=>h(null),className:"p-3 bg-slate-900 text-white rounded-xl",children:n.jsx(mt,{size:20})})]}),n.jsx("div",{className:"flex-1 overflow-y-auto p-12 bg-white prose prose-slate max-w-none custom-scrollbar",dangerouslySetInnerHTML:{__html:p}})]})})]})},Sme=({user:e})=>{const[t,r]=k.useState([]),[a,s]=k.useState(!0),[i,l]=k.useState(!1),[o,d]=k.useState(null),[u,f]=k.useState(""),[p,h]=k.useState({type:"Casa",status:"Ocupada",aliquot:0,hasUncommonExpense:!1,creditBalance:0,initialDebt:0}),m=["admin","programmer","board"].includes(e.role),b=async()=>{s(!0);try{const E=await we.getProperties();r(E)}catch(E){console.error(E)}finally{s(!1)}};k.useEffect(()=>{b()},[]);const v=E=>{E?(d(E),h(E)):(d(null),h({type:"Casa",status:"Ocupada",aliquot:0,code:"",towerBlock:"",floor:"",number:"",hasUncommonExpense:!1,creditBalance:0,initialDebt:0})),l(!0)},y=async E=>{if(confirm("¿Desea eliminar este registro?"))try{await we.deleteProperty(E),b()}catch{alert("Error")}},j=async E=>{E.preventDefault();try{await we.saveProperty(p),l(!1),b()}catch{alert("Error")}},_=()=>{if(t.length===0)return;const E=`codigo,tipo,numero,alicuota,es_gnc,deuda_inicial,saldo_favor,estatus
`,T=t.map(D=>[D.code,D.type,D.number,D.aliquot,D.hasUncommonExpense?1:0,D.initialDebt,D.creditBalance,D.status]),B=E+T.map(D=>D.join(",")).join(`
`),F=new Blob([B],{type:"text/csv;charset=utf-8;"}),R=URL.createObjectURL(F),U=document.createElement("a");U.setAttribute("href",R),U.setAttribute("download","sac_propiedades_mirror.csv"),document.body.appendChild(U),U.click(),document.body.removeChild(U)},N=t.filter(E=>E.code.toLowerCase().includes(u.toLowerCase())||E.number.toLowerCase().includes(u.toLowerCase()));return n.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Catálogo de Unidades"}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Gestión de alícuotas y estatus habitacional."})]}),n.jsx("div",{className:"flex gap-3 w-full sm:w-auto",children:m&&n.jsxs(n.Fragment,{children:[n.jsxs("button",{onClick:_,className:"flex-1 sm:flex-none bg-emerald-600 hover:bg-emerald-700 text-white px-6 py-4 rounded-2xl flex items-center justify-center font-black shadow-xl shadow-emerald-500/20 transition-all active:scale-95 gap-2 text-xs uppercase tracking-widest",title:"Exportar archivo mirror para Carga Masiva",children:[n.jsx(Gs,{size:18})," CSV"]}),n.jsxs("button",{onClick:()=>v(),className:"flex-[2] sm:flex-none bg-blue-600 hover:bg-blue-700 text-white px-8 py-4 rounded-2xl flex items-center justify-center font-black shadow-xl shadow-blue-500/20 transition-all active:scale-95",children:[n.jsx(En,{className:"w-5 h-5 mr-2"}),"Nueva Unidad"]})]})})]}),n.jsxs("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-6 lg:p-8 border-b border-slate-100 flex flex-col md:flex-row items-center justify-between gap-6",children:[n.jsxs("div",{className:"relative w-full max-w-md",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar unidad por código...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm focus:ring-2 focus:ring-blue-500 outline-none transition-all font-bold text-slate-800",value:u,onChange:E=>f(E.target.value)})]}),n.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-black text-slate-400 uppercase tracking-widest bg-slate-50 px-5 py-2 rounded-full",children:["TOTAL REGISTRADO: ",t.length]})]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Código"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Inmueble"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Alícuota"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Saldos"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Estado"}),m&&n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:a?n.jsx("tr",{children:n.jsxs("td",{colSpan:6,className:"px-8 py-20 text-center",children:[n.jsx(qi,{className:"w-10 h-10 text-blue-600 animate-spin mx-auto mb-4"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:"Consultando servidor..."})]})}):N.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"px-8 py-20 text-center text-slate-400 font-medium italic",children:"No se encontraron registros."})}):N.map(E=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-6 font-black text-slate-900",children:E.code}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-slate-700 font-bold text-sm",children:[E.type," ",E.number]}),E.hasUncommonExpense&&n.jsx("span",{className:"bg-indigo-50 text-indigo-600 p-1 rounded-md",title:"Gasto No Común",children:n.jsx(Qc,{size:12,fill:"currentColor"})})]})}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("span",{className:"font-mono text-blue-600 font-black",children:[E.aliquot,"%"]})}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex flex-col gap-1",children:[Number(E.initialDebt)>0&&n.jsxs("span",{className:"text-[10px] font-black text-red-500 uppercase tracking-tighter",children:["Debe: $",Number(E.initialDebt).toFixed(2)]}),Number(E.creditBalance)>0&&n.jsxs("span",{className:"text-[10px] font-black text-blue-600 uppercase tracking-tighter",children:["Favor: $",Number(E.creditBalance).toFixed(2)]}),Number(E.initialDebt)===0&&Number(E.creditBalance)===0&&n.jsx("span",{className:"text-slate-300 text-xs",children:"-"})]})}),n.jsx("td",{className:"px-8 py-6",children:n.jsx("span",{className:`px-4 py-1.5 rounded-full text-[10px] font-black uppercase tracking-widest border ${E.status==="Ocupada"?"bg-blue-50 text-blue-600 border-blue-100":E.status==="Vacía"?"bg-slate-100 text-slate-500 border-slate-200":"bg-red-50 text-red-600 border-red-100"}`,children:E.status})}),m&&n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2 opacity-10 lg:opacity-0 lg:group-hover:opacity-100 transition-opacity",children:[n.jsx("button",{onClick:()=>v(E),className:"p-2.5 bg-slate-100 hover:bg-blue-600 hover:text-white rounded-xl text-slate-500 transition-all shadow-sm",children:n.jsx(yl,{size:18})}),n.jsx("button",{onClick:()=>y(E.id),className:"p-2.5 bg-slate-100 hover:bg-red-600 hover:text-white rounded-xl text-slate-500 transition-all shadow-sm",children:n.jsx(Ua,{size:18})})]})})]},E.id))})]})})]}),i&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-md flex items-center justify-center z-[100] p-0 sm:p-4",children:n.jsxs("div",{className:"bg-white rounded-none sm:rounded-[3rem] p-8 lg:p-12 w-full max-w-2xl shadow-2xl overflow-y-auto h-full sm:h-auto max-h-screen sm:max-h-[90vh]",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-14 h-14 bg-blue-600 rounded-2xl flex items-center justify-center text-white shadow-xl shadow-blue-200",children:n.jsx(ea,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:o?"Editar Unidad":"Nueva Unidad"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Complete los parámetros técnicos."})]})]}),n.jsx("button",{onClick:()=>l(!1),className:"p-3 bg-slate-100 rounded-full text-slate-500 hover:bg-slate-200 transition-colors",children:n.jsx(mt,{size:24})})]}),n.jsxs("form",{onSubmit:j,className:"space-y-8",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Código Identificador"}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 focus:ring-2 focus:ring-blue-600 outline-none text-slate-900 font-bold",value:p.code,onChange:E=>h({...p,code:E.target.value}),placeholder:"Ej: PH-1"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Tipo de Inmueble"}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 focus:ring-2 focus:ring-blue-600 outline-none text-slate-900 font-bold appearance-none",value:p.type,onChange:E=>h({...p,type:E.target.value}),children:[n.jsx("option",{value:"Apartamento",children:"Apartamento"}),n.jsx("option",{value:"Casa",children:"Casa"}),n.jsx("option",{value:"Local",children:"Local"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Número / Apt"}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 focus:ring-2 focus:ring-blue-600 outline-none text-slate-900 font-bold",value:p.number,onChange:E=>h({...p,number:E.target.value})})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Alícuota (%)"}),n.jsx("input",{required:!0,type:"number",step:"0.000001",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 focus:ring-2 focus:ring-blue-600 outline-none text-slate-900 font-bold",value:p.aliquot,onChange:E=>h({...p,aliquot:parseFloat(E.target.value)})})]}),n.jsxs("div",{className:"md:col-span-2 bg-slate-50 p-8 rounded-[2rem] border border-slate-100 space-y-6",children:[n.jsxs("h4",{className:"font-black text-slate-800 flex items-center gap-3 text-sm uppercase tracking-tight",children:[n.jsx(Ic,{className:"w-5 h-5 text-blue-600"})," Gestión de Saldos Migrados"]}),n.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black text-red-500 uppercase tracking-widest",children:"Deuda Anterior ($)"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-white border border-slate-200 rounded-xl px-5 py-3 text-red-600 font-bold outline-none focus:border-red-500",value:p.initialDebt,onChange:E=>h({...p,initialDebt:parseFloat(E.target.value)})})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest",children:"Saldo a Favor ($)"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-white border border-slate-200 rounded-xl px-5 py-3 text-blue-600 font-bold outline-none focus:border-blue-500",value:p.creditBalance,onChange:E=>h({...p,creditBalance:parseFloat(E.target.value)})})]})]})]}),n.jsx("div",{className:"md:col-span-2",children:n.jsxs("label",{className:`flex items-center gap-4 p-6 rounded-[2rem] border transition-all cursor-pointer ${p.hasUncommonExpense?"bg-indigo-50 border-indigo-200":"bg-slate-50 border-slate-200 hover:bg-slate-100"}`,children:[n.jsx("input",{type:"checkbox",className:"w-6 h-6 rounded-lg text-indigo-600 focus:ring-indigo-500 border-slate-300",checked:p.hasUncommonExpense||!1,onChange:E=>h({...p,hasUncommonExpense:E.target.checked})}),n.jsxs("div",{children:[n.jsx("span",{className:"text-sm font-black text-slate-900 block",children:"Aplicar Gasto No Común"}),n.jsx("span",{className:"text-[10px] text-slate-500 font-bold uppercase tracking-widest",children:"Cuotas especiales para servicios exclusivos."})]})]})})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 pt-6",children:[n.jsx("button",{type:"button",onClick:()=>l(!1),className:"order-2 sm:order-1 flex-1 px-8 py-5 bg-slate-100 hover:bg-slate-200 text-slate-600 font-black rounded-2xl transition-all",children:"Descartar"}),n.jsxs("button",{type:"submit",className:"order-1 sm:order-2 flex-[2] bg-blue-600 hover:bg-blue-700 text-white px-8 py-5 rounded-2xl font-black shadow-xl shadow-blue-600/20 flex items-center justify-center gap-3 active:scale-95 transition-all",children:[n.jsx(Zn,{size:20})," GUARDAR CONFIGURACIÓN"]})]})]})]})})]})},Bme=({user:e})=>{const[t,r]=k.useState([]),[a,s]=k.useState([]),[i,l]=k.useState([]),[o,d]=k.useState(!0),[u,f]=k.useState(!1),[p,h]=k.useState(null),[m,b]=k.useState(null),[v,y]=k.useState(""),[j,_]=k.useState(""),[N,E]=k.useState(0),[T,B]=k.useState(""),[F,R]=k.useState(!1),U=["programmer","admin"].includes(e.role),D=async()=>{d(!0);try{const[X,K,ee]=await Promise.all([we.getResidents(),we.getProperties(),we.getUsers()]);r(X),s(K),l(ee),K.length>0&&E(K[0].id)}catch(X){console.error(X)}finally{d(!1)}};k.useEffect(()=>{D()},[]);const L=X=>{var K;X?(h(X),y(X.cedula),_(X.fullName),b(null),B(X.phone),E(X.propertyId),R(X.isOwner)):(h(null),b(null),y(""),_(""),B(""),E(((K=a[0])==null?void 0:K.id)||0),R(!1)),f(!0)},P=X=>{const K=Number(X),ee=i.find(W=>W.id===K);ee?(b(K),y(ee.cedula||"S/C"),_(ee.fullName),B(ee.phone||""),ee.role==="owner"&&R(!0)):(b(null),y(""),_(""),B(""))},G=async X=>{if(confirm("¿Desea desvincular a este residente?"))try{await we.deleteResident(X),D()}catch{alert("Error al eliminar")}},Q=async X=>{X.preventDefault();try{if(p)await we.saveResident({id:p.id,propertyId:N,phone:T,isOwner:F});else{if(!m){alert("Debe seleccionar un usuario válido.");return}await we.saveResident({userId:m,propertyId:N,phone:T,isOwner:F})}f(!1),D()}catch(K){alert(K.message||"Error al guardar asignación")}},H=i.filter(X=>X.cedula&&X.cedula.length>0);return o?n.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-4",children:[n.jsx("div",{className:"w-10 h-10 border-4 border-blue-100 border-t-blue-600 rounded-full animate-spin"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:"Cargando Residentes..."})]}):n.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Gestión de Residentes"}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Asignación de propietarios e inquilinos a unidades."})]}),U&&n.jsxs("button",{onClick:()=>L(),className:"w-full md:w-auto bg-blue-600 hover:bg-blue-700 text-white px-8 py-4 rounded-2xl flex items-center justify-center font-black shadow-xl shadow-blue-500/20 transition-all active:scale-95",children:[n.jsx(fN,{className:"w-5 h-5 mr-2"}),"Asignar Residente"]})]}),n.jsx("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Residente"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Cédula"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Propiedad"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Teléfono"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Rol"}),U&&n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:t.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"px-8 py-20 text-center text-slate-400 font-medium italic",children:"No hay residentes asignados."})}):t.map(X=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-6 font-black text-slate-900",children:X.fullName}),n.jsx("td",{className:"px-8 py-6 text-slate-500 font-medium",children:X.cedula}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("span",{className:"text-slate-700 font-bold text-sm",children:[X.propertyType," ",X.propertyNumber," (",X.propertyCode,")"]})}),n.jsx("td",{className:"px-8 py-6 text-slate-500",children:X.phone}),n.jsx("td",{className:"px-8 py-6",children:X.isOwner?n.jsx("span",{className:"px-4 py-1.5 rounded-full text-[10px] font-black uppercase tracking-widest bg-emerald-50 text-emerald-600 border border-emerald-100",children:"Propietario"}):n.jsx("span",{className:"px-4 py-1.5 rounded-full text-[10px] font-black uppercase tracking-widest bg-slate-100 text-slate-500 border border-slate-200",children:"Inquilino"})}),U&&n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2 opacity-100 lg:opacity-0 lg:group-hover:opacity-100 transition-opacity",children:[n.jsx("button",{onClick:()=>L(X),className:"p-2.5 bg-slate-100 hover:bg-blue-600 hover:text-white rounded-xl text-slate-500 transition-all shadow-sm",children:n.jsx(yl,{size:18})}),n.jsx("button",{onClick:()=>G(X.id),className:"p-2.5 bg-slate-100 hover:bg-red-600 hover:text-white rounded-xl text-slate-500 transition-all shadow-sm",children:n.jsx(sq,{size:18})})]})})]},X.id))})]})})}),u&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-md flex items-center justify-center z-[100] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-8 lg:p-12 w-full max-w-2xl shadow-2xl overflow-y-auto max-h-[90vh]",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-14 h-14 bg-blue-600 rounded-2xl flex items-center justify-center text-white shadow-xl shadow-blue-200",children:n.jsx(fN,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:p?"Editar Asignación":"Nueva Asignación"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Vincule un usuario a una unidad inmobiliaria."})]})]}),n.jsx("button",{onClick:()=>f(!1),className:"p-3 bg-slate-100 rounded-full text-slate-500 hover:bg-slate-200 transition-colors",children:n.jsx(mt,{size:24})})]}),n.jsxs("form",{onSubmit:Q,className:"space-y-8",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-100",children:[n.jsxs("h4",{className:"text-xs font-black text-blue-600 mb-4 flex items-center gap-2 uppercase tracking-widest",children:[n.jsx(EA,{className:"w-4 h-4"})," 1. Selección de Usuario"]}),p?n.jsxs("div",{className:"mb-6 p-4 bg-blue-600 text-white rounded-2xl shadow-lg shadow-blue-200",children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest opacity-70",children:"Residente Actual"}),n.jsx("p",{className:"text-lg font-black",children:j}),n.jsxs("p",{className:"text-xs font-bold opacity-80",children:["C.I: ",v]})]}):n.jsxs("div",{className:"mb-6",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Buscar Usuario del Sistema"}),n.jsxs("div",{className:"relative",children:[n.jsxs("select",{required:!0,className:"w-full bg-white border border-slate-200 rounded-2xl px-10 py-4 focus:ring-2 focus:ring-blue-600 outline-none text-slate-900 font-bold appearance-none",onChange:X=>P(X.target.value),defaultValue:"",children:[n.jsx("option",{value:"",disabled:!0,children:"-- Seleccione por Cédula / Nombre --"}),H.map(X=>n.jsxs("option",{value:X.id,children:[X.cedula," - ",X.fullName]},X.id))]}),n.jsx(er,{className:"w-4 h-4 text-slate-400 absolute left-4 top-1/2 -translate-y-1/2"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Nombre"}),n.jsx("input",{disabled:!0,type:"text",className:"w-full bg-slate-100 border border-slate-200 rounded-xl px-4 py-3 text-sm text-slate-500 font-bold",value:j})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Documento"}),n.jsx("input",{disabled:!0,type:"text",className:"w-full bg-slate-100 border border-slate-200 rounded-xl px-4 py-3 text-sm text-slate-500 font-bold",value:v})]})]})]}),n.jsxs("div",{className:"bg-emerald-50 p-6 rounded-[2rem] border border-emerald-100",children:[n.jsxs("h4",{className:"text-xs font-black text-emerald-600 mb-4 flex items-center gap-2 uppercase tracking-widest",children:[n.jsx(EG,{className:"w-4 h-4"})," 2. Datos de Residencia"]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Propiedad Asignada"}),n.jsx("select",{className:"w-full bg-white border border-slate-200 rounded-2xl px-5 py-4 focus:ring-2 focus:ring-emerald-500 outline-none text-slate-900 font-bold appearance-none",value:N,onChange:X=>E(Number(X.target.value)),children:a.map(X=>n.jsxs("option",{value:X.id,children:[X.type," ",X.number," - ",X.code]},X.id))})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Teléfono de Contacto"}),n.jsx("input",{type:"text",className:"w-full bg-white border border-slate-200 rounded-2xl px-5 py-4 focus:ring-2 focus:ring-emerald-500 outline-none text-slate-900 font-bold",value:T,onChange:X=>B(X.target.value)})]}),n.jsxs("div",{className:"md:col-span-2 pt-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-4 block",children:"Rol del Usuario en esta Propiedad"}),n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("label",{className:`flex-1 flex items-center justify-center gap-3 p-4 rounded-2xl border transition-all cursor-pointer ${F?"bg-emerald-600 text-white border-emerald-600 shadow-lg shadow-emerald-200":"bg-white text-slate-500 border-slate-200"}`,children:[n.jsx("input",{type:"radio",className:"hidden",name:"role",checked:F,onChange:()=>R(!0)}),n.jsx("span",{className:"text-sm font-black uppercase tracking-widest",children:"Propietario"})]}),n.jsxs("label",{className:`flex-1 flex items-center justify-center gap-3 p-4 rounded-2xl border transition-all cursor-pointer ${F?"bg-white text-slate-500 border-slate-200":"bg-blue-600 text-white border-blue-600 shadow-lg shadow-blue-200"}`,children:[n.jsx("input",{type:"radio",className:"hidden",name:"role",checked:!F,onChange:()=>R(!1)}),n.jsx("span",{className:"text-sm font-black uppercase tracking-widest",children:"Inquilino"})]})]})]})]})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 pt-6",children:[n.jsx("button",{type:"button",onClick:()=>f(!1),className:"order-2 sm:order-1 flex-1 px-8 py-5 bg-slate-100 hover:bg-slate-200 text-slate-600 font-black rounded-2xl transition-all",children:"Cancelar"}),n.jsxs("button",{type:"submit",className:"order-1 sm:order-2 flex-[2] bg-blue-600 hover:bg-blue-700 text-white px-8 py-5 rounded-2xl font-black shadow-xl shadow-blue-600/20 flex items-center justify-center gap-3 active:scale-95 transition-all",children:[n.jsx(Zn,{size:20})," ",p?"ACTUALIZAR ASIGNACIÓN":"CONFIRMAR ASIGNACIÓN"]})]})]})]})})]})},_me=({user:e})=>{const[t,r]=k.useState([]),[a,s]=k.useState(!0),[i,l]=k.useState(!1),[o,d]=k.useState(""),[u,f]=k.useState(null),[p,h]=k.useState(null),[m,b]=k.useState(""),[v,y]=k.useState(""),[j,_]=k.useState(""),[N,E]=k.useState(""),[T,B]=k.useState(""),[F,R]=k.useState(""),[U,D]=k.useState(""),[L,P]=k.useState("owner"),[G,Q]=k.useState(""),[H,X]=k.useState("Activo"),[K,ee]=k.useState(null),W=async()=>{s(!0);try{const le=await we.getUsers();r(le)}catch(le){console.error(le)}finally{s(!1)}};k.useEffect(()=>{W()},[]);const Y=async le=>{f(le);try{const ae=await(await we.sendWelcomeEmail(le)).json();ae.status==="success"?alert(`¡ENVÍO EXITOSO!
`+(ae.message||"Las credenciales han sido enviadas.")):alert(`ERROR EN EL ENVÍO:
`+(ae.message||ae.error||"No se pudo procesar la solicitud."))}catch(ne){alert(`FALLO DE CONEXIÓN:
`+(ne.message||"No se pudo contactar con el motor de correos."))}finally{f(null)}},M=async le=>{const ne=prompt("Indique los días de duración para este periodo Demo (1-10):","3");if(ne===null)return;const ae=parseInt(ne);if(isNaN(ae)||ae<1||ae>10){alert("Valor inválido. Ingrese un número entre 1 y 10.");return}h(le.id);try{(await fetch(`${Ne}/save_user.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...le,role:"demo",activate_demo_days:ae,status:"active"})})).ok?(alert(`Periodo Demo activado por ${ae} días exitosamente.`),W()):alert("Error al activar demo en el servidor.")}catch{alert("Fallo de red.")}finally{h(null)}},O=()=>{if(t.length===0)return;const le=`cedula,nombre_completo,correo,telefono,rol,telegram_id
`,ne=t.map(Me=>[Me.cedula||Me.username,Me.fullName,Me.email,Me.phone,Me.role,Me.telegramChatId||""]),ae=le+ne.map(Me=>Me.join(",")).join(`
`),ie=new Blob([ae],{type:"text/csv;charset=utf-8;"}),me=URL.createObjectURL(ie),Z=document.createElement("a");Z.setAttribute("href",me),Z.setAttribute("download","sac_usuarios_mirror.csv"),document.body.appendChild(Z),Z.click(),document.body.removeChild(Z)};if(e.role!=="programmer"&&e.role!=="admin")return n.jsx("div",{className:"flex flex-col items-center justify-center min-h-[60vh] px-4",children:n.jsxs("div",{className:"bg-red-50 border border-red-100 p-10 rounded-[3rem] text-center max-w-lg shadow-xl",children:[n.jsx("div",{className:"w-20 h-20 bg-red-500 rounded-3xl flex items-center justify-center text-white mx-auto mb-6 shadow-xl shadow-red-200",children:n.jsx(vs,{size:40})}),n.jsx("h3",{className:"text-2xl font-black text-red-700 tracking-tight mb-2",children:"Acceso Restringido"}),n.jsx("p",{className:"text-red-600/70 font-medium",children:"Módulo exclusivo para el Personal Administrativo."})]})});const q=le=>{if(le){ee(le.id);const ne=(le.fullName||"").split(" ");b(ne[0]||""),y(ne.slice(1).join(" ")||""),_(le.cedula||le.username),E(le.phone||""),B(le.email||""),R(le.telegramChatId||""),D(""),P(le.role),Q(le.relationship||""),X(le.status==="Activo"||le.status==="active"?"Activo":"Inactivo")}else ee(null),b(""),y(""),_(""),E(""),B(""),R(""),D(""),P("owner"),Q(""),X("Activo");l(!0)},z=async le=>{if(le===e.id)return alert("No puedes eliminar tu propia cuenta en sesión.");if(confirm("¿Desea eliminar este usuario permanentemente?"))try{await we.deleteUser(le),W()}catch{alert("Error al eliminar")}},J=async le=>{le.preventDefault();const ne=`${m} ${v}`.trim(),ae={id:K,username:j,fullName:ne,cedula:j,phone:N,email:T,telegramChatId:F,password:U||void 0,role:L,relationship:G,status:H==="Activo"?"active":"inactive"};try{await we.saveUser(ae),l(!1),W(),alert("Usuario guardado con éxito.")}catch(ie){alert(ie.message||"Error al guardar usuario")}},re=t.filter(le=>(le.fullName||"").toLowerCase().includes(o.toLowerCase())||(le.cedula||"").toLowerCase().includes(o.toLowerCase()));return n.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Gestión de Usuarios"}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Control maestro de credenciales y notificaciones."})]}),n.jsxs("div",{className:"flex gap-3 w-full md:w-auto",children:[n.jsxs("button",{onClick:O,className:"flex-1 md:flex-none bg-emerald-600 hover:bg-emerald-700 text-white px-6 py-4 rounded-2xl flex items-center justify-center font-black shadow-xl shadow-emerald-500/20 transition-all active:scale-95 gap-2 text-xs uppercase tracking-widest",title:"Exportar archivo mirror para Carga Masiva",children:[n.jsx(Gs,{size:18})," CSV"]}),n.jsxs("button",{onClick:()=>q(),className:"flex-[2] md:flex-none bg-blue-600 hover:bg-blue-700 text-white px-8 py-4 rounded-2xl flex items-center justify-center font-black shadow-xl transition-all active:scale-95",children:[n.jsx(fN,{className:"w-5 h-5 mr-2"}),"Nuevo Usuario"]})]})]}),n.jsxs("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsx("div",{className:"p-6 lg:p-8 border-b border-slate-100 flex flex-col md:flex-row items-center justify-between gap-6",children:n.jsxs("div",{className:"relative w-full max-w-md",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por nombre o cédula...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm focus:ring-2 focus:ring-blue-500 outline-none font-bold",value:o,onChange:le=>d(le.target.value)})]})}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Nombre Completo"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Usuario / C.I"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Rol"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acciones Maestras"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:re.map(le=>{const ne=le.role==="demo"&&le.expiresAt&&new Date(le.expiresAt)<new Date;return n.jsxs("tr",{className:`hover:bg-slate-50/50 transition-colors group ${ne?"opacity-60 bg-red-50/20":""}`,children:[n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:`w-9 h-9 rounded-full flex items-center justify-center font-black text-xs ${le.role==="programmer"?"bg-blue-600 text-white":"bg-slate-100 text-slate-500"}`,children:(le.fullName||"?")[0]}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-900",children:le.fullName||"Sin Nombre"}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest",children:le.email||"Sin Email"})]})]})}),n.jsx("td",{className:"px-8 py-6 text-slate-500 font-bold",children:le.username}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("span",{className:`w-fit px-3 py-1 rounded-lg text-[9px] font-black uppercase tracking-widest border ${le.role==="programmer"?"bg-blue-50 text-blue-600 border-blue-100":le.role==="demo"?ne?"bg-red-600 text-white":"bg-amber-50 text-amber-600 border-amber-100":"bg-slate-100 text-slate-500 border-slate-200"}`,children:le.role}),le.role==="demo"&&le.expiresAt&&n.jsx("span",{className:`text-[8px] font-bold uppercase ${ne?"text-red-500":"text-slate-400"}`,children:ne?"Expirado":`Exp: ${le.expiresAt}`})]})}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[e.role==="programmer"&&n.jsx("button",{onClick:()=>M(le),disabled:p===le.id,className:"p-2.5 bg-emerald-50 text-emerald-600 hover:bg-emerald-600 hover:text-white rounded-xl transition-all",title:"Activar Periodo Demo",children:p===le.id?n.jsx(qi,{size:18,className:"animate-spin"}):n.jsx(Pc,{size:18})}),n.jsx("button",{onClick:()=>Y(le.id),disabled:u===le.id,className:"p-2.5 bg-amber-50 text-amber-600 hover:bg-amber-600 hover:text-white rounded-xl transition-all disabled:opacity-50",title:"Enviar Bienvenida",children:u===le.id?n.jsx(qi,{size:18,className:"animate-spin"}):n.jsx(Br,{size:18})}),n.jsx("button",{onClick:()=>q(le),className:"p-2.5 bg-blue-50 text-blue-600 hover:bg-blue-600 hover:text-white rounded-xl transition-all",title:"Editar Perfil",children:n.jsx(yl,{size:18})}),n.jsx("button",{onClick:()=>z(le.id),className:"p-2.5 bg-red-50 text-red-600 hover:bg-red-600 hover:text-white rounded-xl transition-all",title:"Eliminar",children:n.jsx(Ua,{size:18})})]})})]},le.id)})})]})})]}),i&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-8 lg:p-12 w-full max-w-3xl shadow-2xl overflow-y-auto max-h-[90vh]",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:K?"Editar Perfil de Usuario":"Nuevo Usuario"}),n.jsx("button",{onClick:()=>l(!1),className:"p-3 bg-slate-100 rounded-full text-slate-500",children:n.jsx(mt,{size:24})})]}),n.jsxs("form",{onSubmit:J,className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block",children:"Nombres"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-bold",value:m,onChange:le=>b(le.target.value)})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block",children:"Apellidos"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-bold",value:v,onChange:le=>y(le.target.value)})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block",children:"Cédula / Login"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black",value:j,onChange:le=>_(le.target.value)})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block",children:"Rol"}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-slate-800 outline-none",value:L,onChange:le=>P(le.target.value),children:[n.jsx("option",{value:"admin",children:"Administrador"}),n.jsx("option",{value:"board",children:"Junta"}),n.jsx("option",{value:"owner",children:"Propietario"}),n.jsx("option",{value:"family",children:"Familiar"}),n.jsx("option",{value:"guest",children:"Invitado"}),n.jsx("option",{value:"demo",children:"Demo (Temporal)"}),n.jsx("option",{value:"programmer",children:"Programador (Core)"})]})]}),n.jsxs("div",{className:"md:col-span-2 bg-slate-50 p-6 rounded-[2rem] border border-slate-100",children:[n.jsxs("h4",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest mb-6 flex items-center gap-2",children:[n.jsx(eK,{size:14})," Canales de Notificación"]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 ml-1",children:"Correo Electrónico"}),n.jsxs("div",{className:"relative",children:[n.jsx(Br,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:16}),n.jsx("input",{type:"email",className:"w-full bg-white border border-slate-200 rounded-xl pl-12 pr-4 py-3 text-sm font-bold outline-none focus:ring-2 focus:ring-blue-500",value:T,onChange:le=>B(le.target.value),placeholder:"email@ejemplo.com"})]})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 ml-1",children:"Teléfono WhatsApp (Intl)"}),n.jsxs("div",{className:"relative",children:[n.jsx(dk,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:16}),n.jsx("input",{type:"tel",className:"w-full bg-white border border-slate-200 rounded-xl pl-12 pr-4 py-3 text-sm font-bold outline-none focus:ring-2 focus:ring-blue-500",value:N,onChange:le=>E(le.target.value),placeholder:"Ej: +58412... o +1..."})]}),n.jsx("p",{className:"text-[8px] text-slate-400 font-bold uppercase tracking-widest mt-1 ml-1",children:"Incluya el signo + y el código de país."})]}),n.jsxs("div",{className:"md:col-span-2 space-y-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 ml-1",children:"Telegram Chat ID (Para el Bot)"}),n.jsxs("div",{className:"relative",children:[n.jsx(SK,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:16}),n.jsx("input",{type:"text",className:"w-full bg-white border border-slate-200 rounded-xl pl-12 pr-4 py-3 text-sm font-bold outline-none focus:ring-2 focus:ring-blue-500",value:F,onChange:le=>R(le.target.value),placeholder:"Ej: 123456789"})]})]})]})]}),n.jsxs("div",{className:"md:col-span-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-blue-600 mb-2 block",children:"Nueva Contraseña (Se guardará como HASH)"}),n.jsxs("div",{className:"relative",children:[n.jsx(EA,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-blue-300",size:16}),n.jsx("input",{type:"password",placeholder:K?"Dejar vacío para no cambiar":"Mínimo 8 caracteres",className:"w-full bg-blue-50 border border-blue-100 rounded-2xl pl-12 pr-4 py-4 font-bold text-slate-800",value:U,onChange:le=>D(le.target.value)})]})]})]}),n.jsxs("button",{type:"submit",className:"w-full bg-blue-600 text-white py-6 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl active:scale-95 transition-all flex items-center justify-center gap-3",children:[n.jsx(Zn,{size:18})," ",K?"ACTUALIZAR USUARIO":"CREAR USUARIO SEGURO"]})]})]})})]})},Oa=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},qu=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},Tme=({user:e,onNavigate:t})=>{const{fees:r,residents:a,properties:s,pendingBills:i,providers:l,addPendingBill:o,payPendingBill:d,deletePendingBill:u,updatePendingBill:f,exchangeRateHistory:p,refreshData:h}=ht(),[m,b]=k.useState("payable"),[v,y]=k.useState(new Date().getMonth()),[j,_]=k.useState(new Date().getFullYear()),[N,E]=k.useState(""),[T,B]=k.useState(!1),[F,R]=k.useState(!1),[U,D]=k.useState(!1),[L,P]=k.useState(null),[G,Q]=k.useState(null),[H,X]=k.useState(!1),[K,ee]=k.useState(null),[W,Y]=k.useState(!1),M=async be=>{if(!be||be==="S/R"||be.length<3){ee(null);return}try{const tt=await(await fetch(`${Ne}/check_duplicate_reference.php?reference=${be}`)).json();tt.isDuplicate?ee(tt):ee(null)}catch(Ye){console.error("Error checking duplicate:",Ye)}},O=()=>{const be=window.open("","","width=900,height=900");if(!be)return;const Ye=ta.items.map(tt=>`
        <tr>
            <td style="padding:10px; border-bottom:1px solid #eee;">${tt.provider}</td>
            <td style="padding:10px; border-bottom:1px solid #eee; font-size:10px;">${tt.description}</td>
            <td style="padding:10px; border-bottom:1px solid #eee; text-align:center;">${tt.status}</td>
            <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${Oa(tt.amount)}</td>
            <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${Oa(Number(tt.amount)-(Number(tt.paid_amount_usd)||0))}</td>
        </tr>
    `).join("");be.document.write(`
        <html>
        <head>
            <title>Cuentas por Pagar - ${Te[v]} ${j}</title>
            <style>
                body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; }
                .header { text-align: center; border-bottom: 4px solid #e11d48; padding-bottom: 20px; margin-bottom: 30px; }
                h1 { margin: 0; font-size: 24px; text-transform: uppercase; color: #9f1239; }
                table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                th { text-align: left; padding: 12px; background: #9f1239; color: white; font-size: 11px; text-transform: uppercase; }
                .footer { margin-top: 50px; font-size: 10px; text-align: center; color: #94a3b8; border-top: 1px solid #eee; padding-top: 20px; }
            </style>
        </head>
        <body>
            <div class="header">
                <h1>RELACIÓN DE CUENTAS POR PAGAR</h1>
                <p>Periodo: ${Te[v]} ${j}</p>
                <p>Condominio Residencial El Tejar | SAC 2026</p>
            </div>
            <table>
                <thead>
                    <tr>
                        <th>Proveedor</th>
                        <th>Concepto</th>
                        <th>Estatus</th>
                        <th>Total USD</th>
                        <th>Pendiente USD</th>
                    </tr>
                </thead>
                <tbody>${Ye}</tbody>
            </table>
            <div class="footer">Reporte generado el ${new Date().toLocaleString()} • SAC Kernel V4.1.70 MC/MB</div>
        </body>
        </html>
    `),be.document.close(),be.print()},q=()=>{const be=ta.items.map(oe=>`
        <tr>
            <td>${oe.provider}</td>
            <td>${oe.description}</td>
            <td>${oe.status}</td>
            <td>$${Oa(oe.amount)}</td>
            <td>$${Oa(Number(oe.amount)-(Number(oe.paid_amount_usd)||0))}</td>
            <td>${oe.dueDate}</td>
        </tr>
    `).join(""),Ye=`
        <!DOCTYPE html>
        <html lang="es">
        <head>
            <meta charset="UTF-8">
            <title>Cuentas por Pagar - Exportación</title>
            <style>
                body { font-family: Arial, sans-serif; padding: 30px; line-height: 1.6; }
                h1 { color: #9f1239; border-bottom: 2px solid #e11d48; padding-bottom: 10px; }
                table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                th { background-color: #f8fafc; font-size: 12px; text-transform: uppercase; color: #64748b; }
                tr:nth-child(even) { background-color: #f9fafb; }
            </style>
        </head>
        <body>
            <h1>Relación de Cuentas por Pagar</h1>
            <p>Periodo: ${Te[v]} ${j}</p>
            <p>Fecha de generación: ${new Date().toLocaleString()}</p>
            <table>
                <thead>
                    <tr>
                        <th>Proveedor</th>
                        <th>Concepto</th>
                        <th>Estatus</th>
                        <th>Total USD</th>
                        <th>Pendiente USD</th>
                        <th>Vencimiento</th>
                    </tr>
                </thead>
                <tbody>${be}</tbody>
            </table>
        </body>
        </html>
    `,tt=new Blob([Ye],{type:"text/html"}),te=URL.createObjectURL(tt),de=document.createElement("a");de.href=te,de.download=`Cuentas_por_Pagar_${Te[v]}_${j}.html`,de.click(),URL.revokeObjectURL(te)},[z,J]=k.useState(!1),[re,le]=k.useState(2),[ne,ae]=k.useState([]),[ie,me]=k.useState({status:"Pendiente",dueDate:Dr(),creationDate:Dr(),provider:"",description:"",amountBs:0,prefill_fee:!1,fee_category:"variable",is_uncommon:!1,is_special:!1,is_silent:!1,special_props_json:[],target_month:new Date().getMonth(),target_year:new Date().getFullYear()}),[Z,Me]=k.useState("am"),[pe,he]=k.useState(null),[ye,fe]=k.useState(""),[Ue,qe]=k.useState(""),[at,nt]=k.useState("Banco"),[Ct,kt]=k.useState(Dr()),[ft,_r]=k.useState(!1),[Ar,pa]=k.useState(!1),[Ut,Tr]=k.useState([]),[it,Rt]=k.useState("pm"),[Et,jt]=k.useState(""),[Kt,fr]=k.useState(!1),Cr=k.useMemo(()=>Et?l.filter(be=>be.name.toLowerCase().includes(Et.toLowerCase())||be.rif.toLowerCase().includes(Et.toLowerCase())):[],[l,Et]),cn=(be,Ye="pm")=>{const tt=p.find(de=>de.date===be);if(!tt)return 45;if(Ye==="parallel")return Number(tt.parallelValue)||45;const te=Ye==="am"?Number(tt.amValue)||Number(tt.pmValue):Number(tt.pmValue)||Number(tt.amValue);return Number(te)||45},$n=k.useMemo(()=>cn(ie.creationDate||Dr(),Z),[ie.creationDate,Z,p]),Cs=k.useMemo(()=>$n<=0?0:Number(ie.amountBs)/Number($n),[ie.amountBs,$n]),ks=k.useMemo(()=>{if(!p||p.length===0)return 45;const be=p[0];return Number(be.pmValue)>0?Number(be.pmValue):Number(be.amValue)},[p]),Bi=k.useMemo(()=>{let be=0;const Ye=[],tt=r.find(te=>te.month===v&&te.year===j);return tt&&tt.debts.forEach(te=>{const de=(Number(te.amountUsd)||0)-(Number(te.paidAmount)||0);if(Math.abs(de)>.005){const oe=s.find(Ae=>Ae.id===te.propertyId),ce=a.find(Ae=>Ae.propertyId===te.propertyId&&Ae.isOwner);(!N||(oe==null?void 0:oe.code.toLowerCase().includes(N.toLowerCase()))||(ce==null?void 0:ce.fullName.toLowerCase().includes(N.toLowerCase())))&&(Ye.push({prop:oe?`${oe.type} ${oe.number}`:`ID ${te.propertyId}`,code:(oe==null?void 0:oe.code)||"S/I",owner:ce?ce.fullName:"Sin Asignar",amount:de,amountBs:de*ks,status:te.status}),be+=de)}}),{totalDebt:be,items:Ye.sort((te,de)=>de.amount-te.amount)}},[r,s,a,v,j,ks,N]),ta=k.useMemo(()=>{const be=i.filter(ce=>{const[ue,Ae]=ce.dueDate.split("-").map(Number),Ce=ce.target_month!==void 0&&ce.target_month!==null?ce.target_month:Ae-1,Re=ce.target_year!==void 0&&ce.target_year!==null?ce.target_year:ue,ke=!N||ce.provider.toLowerCase().includes(N.toLowerCase())||ce.description.toLowerCase().includes(N.toLowerCase());return Re===j&&Ce===v&&ke}),Ye=be.reduce((ce,ue)=>ce+Number(ue.amount),0),tt=be.reduce((ce,ue)=>ce+Number(ue.amountBs),0),te=be.reduce((ce,ue)=>ce+(Number(ue.paid_amount_usd)||0),0),de=be.reduce((ce,ue)=>ce+(Number(ue.paid_amount_bs)||0),0);return{pendingTotal:Ye-te,totalUsd:Ye,totalBs:tt,paidUsd:te,paidBs:de,items:be.sort((ce,ue)=>new Date(ce.dueDate).getTime()-new Date(ue.dueDate).getTime())}},[i,v,j,N]),dn=be=>{J(!1),le(2),ae([]),be?(Q(be.id),me({...be,prefill_fee:!!be.prefill_fee,is_uncommon:!!be.is_uncommon,is_special:!!be.is_special,is_silent:!!be.is_silent,special_props_json:be.special_props_json||[],target_month:be.target_month??new Date().getMonth(),target_year:be.target_year??new Date().getFullYear()}),jt(be.provider)):(Q(null),me({status:"Pendiente",dueDate:Dr(),creationDate:Dr(),provider:"",description:"",amountBs:0,prefill_fee:!1,fee_category:"variable",is_uncommon:!1,is_special:!1,is_silent:!1,special_props_json:[],target_month:new Date().getMonth(),target_year:new Date().getFullYear()}),jt("")),B(!0),fr(!1)},el=async be=>{if(be.preventDefault(),!ie.provider)return alert("Seleccione un proveedor.");if(z&&ne.length!==re)return alert(`Debe seleccionar exactamente ${re} meses para el fraccionamiento.`);const Ye={...ie,id:G||void 0,amount:Number(Cs.toFixed(2)),creationRate:$n,is_fractioned:z,fraction_parts:re,fraction_months:ne};try{const tt=await fetch(`${Ne}/save_pending_bill.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ye)});if(tt.ok)B(!1),h();else{const te=await tt.json();alert("Error: "+te.error)}}catch{alert("Error de conexión.")}},_i=be=>{ne.includes(be)?ae(Ye=>Ye.filter(tt=>tt!==be)):ne.length<re&&ae(Ye=>[...Ye,be].sort((tt,te)=>tt-te))},Wc=be=>{const Ye=Number(be.amount)-(Number(be.paid_amount_usd)||0),tt=cn(Dr(),"pm");he(be),fe(Number(Ye*tt).toFixed(2)),qe(""),nt("Banco"),kt(Dr()),_r(!!be.is_silent),pa(!1),Tr([{amountBs:(Ye*tt).toFixed(2),ref:"",date:Dr()}]),R(!0)},Lo=()=>{Tr([...Ut,{amountBs:"0.00",ref:"",date:Dr()}])},Ul=be=>{Ut.length>1&&Tr(Ut.filter((Ye,tt)=>tt!==be))},Ve=(be,Ye,tt)=>{const te=[...Ut];te[be]={...te[be],[Ye]:tt},Tr(te)},It=async be=>{if(be.preventDefault(),!pe)return;const Ye=e.role==="programmer"||e.role==="admin";if(Ar){for(const te of Ut)if(te.ref&&te.ref!=="S/R"&&te.ref.length>=3&&(await(await fetch(`${Ne}/check_duplicate_reference.php?reference=${te.ref}`)).json()).isDuplicate&&!W){alert(Ye?`El código de transferencia ${te.ref} ya existe en el sistema. Verifique los detalles en el formulario y marque la casilla de autorización si desea proceder.`:`El código de transferencia ${te.ref} ya ha sido usado. Por favor, envíe el comprobante a la administración para su verificación manual.`);return}Ut.reduce((te,de)=>te+parseFloat(de.amountBs||"0"),0);const tt=Ut.map(te=>{const de=cn(te.date,"pm");return{...te,amount_bs:parseFloat(te.amountBs),amount_usd:ra(parseFloat(te.amountBs)/de,2)}});try{if(!(await fetch(`${Ne}/pay_pending_bill.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:pe.id,is_multiple:!0,payments:tt,source:at,is_silent:ft,force_close:U})})).ok)throw new Error("Kernel Error");R(!1),D(!1),Y(!1),ee(null),h(),alert("Múltiples Abonos Registrados")}catch(te){alert("Error al liquidar factura: "+(te.message||"Fallo desconocido"))}}else{if(Ue&&Ue!=="S/R"&&Ue.length>=3&&(await(await fetch(`${Ne}/check_duplicate_reference.php?reference=${Ue}`)).json()).isDuplicate&&!W){alert(Ye?`El código de transferencia ${Ue} ya existe en el sistema. Verifique los detalles en el formulario y marque la casilla de autorización si desea proceder.`:`El código de transferencia ${Ue} ya ha sido usado. Por favor, envíe el comprobante a la administración para su verificación manual.`);return}const tt=cn(Ct,it),te=parseFloat(ye),de=ra(te/tt,2);try{if(!(await fetch(`${Ne}/pay_pending_bill.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:pe.id,amount_bs:te,amount_usd:de,reference:Ue||"S/R",source:at,date:Ct,is_silent:ft,force_close:U})})).ok)throw new Error("Kernel Error");R(!1),D(!1),Y(!1),ee(null),h(),alert(U||de>=Number(pe.amount)-(Number(pe.paid_amount_usd)||0)?"Factura Liquidada Completa":"Abono Parcial Registrado")}catch(oe){alert("Error al liquidar factura: "+(oe.message||"Fallo desconocido"))}}},ra=(be,Ye)=>{const tt=Math.pow(10,Ye);return Math.round(be*tt)/tt},Ma=k.useMemo(()=>[...s].sort((be,Ye)=>be.code.localeCompare(Ye.code,void 0,{numeric:!0})),[s]);return n.jsxs("div",{className:`max-w-7xl mx-auto space-y-8 animate-in fade-in duration-700 pb-20 balance-root-container ${H?"is-printing-report":""}`,children:[n.jsx("div",{className:`p-10 lg:p-14 rounded-[4rem] text-white shadow-2xl relative overflow-hidden transition-all duration-700 ${m==="receivable"?"bg-gradient-to-br from-emerald-600 to-teal-800 shadow-emerald-500/20":"bg-gradient-to-br from-rose-600 to-red-800 shadow-red-500/20"}`,children:n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-white/10 w-fit px-5 py-2 rounded-full backdrop-blur-md border border-white/20 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(Up,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Estado de Cartera Kernel V4.1.70 MC/MB"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:[m==="receivable"?"Cuentas por":"Relación de"," ",n.jsx("br",{}),n.jsx("span",{className:m==="receivable"?"text-emerald-300":"text-rose-300",children:m==="receivable"?"Cobrar":"Egresos"})]})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsx("span",{className:`text-[10px] font-black uppercase tracking-widest mb-4 px-5 py-2 rounded-full border ${m==="receivable"?"text-emerald-600 border-emerald-100 bg-emerald-50":"text-rose-600 border-rose-100 bg-rose-50"}`,children:m==="receivable"?"VALOR POR RECAUDAR":"DEUDA PENDIENTE PROVEEDORES"}),n.jsxs("div",{className:"flex items-start gap-1",children:[n.jsx("span",{className:`text-2xl font-black mt-2 ${m==="receivable"?"text-emerald-600":"text-rose-600"}`,children:"$"}),n.jsx("span",{className:"text-7xl lg:text-8xl font-black tracking-tighter text-slate-900",children:(m==="receivable"?Bi.totalDebt:ta.pendingTotal).toLocaleString(void 0,{minimumFractionDigits:2})})]}),n.jsx("div",{className:"w-full h-px bg-slate-100 my-8"}),n.jsxs("div",{className:"flex gap-3 w-full",children:[n.jsx("button",{onClick:()=>m==="receivable"?window.print():O(),className:"flex-1 p-4 bg-slate-50 text-slate-400 hover:bg-slate-100 rounded-2xl transition-all flex items-center justify-center shadow-sm",children:n.jsx(wt,{size:20})}),m==="payable"&&n.jsxs("div",{className:"flex-[4] flex gap-2",children:[n.jsxs("button",{onClick:q,className:"flex-1 bg-blue-600 hover:bg-blue-700 text-white font-black py-4 rounded-2xl shadow-xl shadow-blue-200 transition-all flex items-center justify-center gap-2 text-[10px] uppercase tracking-widest",children:[n.jsx(Zd,{size:18})," HTML"]}),n.jsxs("button",{onClick:()=>X(!0),className:"flex-1 bg-slate-800 hover:bg-slate-900 text-white font-black py-4 rounded-2xl shadow-xl transition-all flex items-center justify-center gap-2 text-[10px] uppercase tracking-widest",children:[n.jsx(wt,{size:18})," PAGOS"]}),n.jsxs("button",{onClick:()=>dn(),className:"flex-[1.5] bg-rose-600 hover:bg-rose-700 text-white font-black py-4 rounded-2xl shadow-xl shadow-rose-200 transition-all flex items-center justify-center gap-2 text-[10px] uppercase tracking-widest",children:[n.jsx(En,{size:18})," FACTURA"]})]})]})]})]})}),n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-center gap-6 bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm no-print",children:[n.jsxs("div",{className:"flex p-1.5 bg-slate-100 rounded-[1.8rem] w-full lg:w-auto",children:[n.jsx("button",{onClick:()=>b("receivable"),className:`flex-1 lg:flex-none px-10 py-3.5 rounded-full text-[10px] font-black uppercase tracking-[0.2em] transition-all ${m==="receivable"?"bg-white text-emerald-600 shadow-lg":"text-slate-400 hover:text-slate-600"}`,children:"Cuentas por Cobrar"}),n.jsx("button",{onClick:()=>b("payable"),className:`flex-1 lg:flex-none px-10 py-3.5 rounded-full text-[10px] font-black uppercase tracking-[0.2em] transition-all ${m==="payable"?"bg-white text-rose-600 shadow-lg":"text-slate-400 hover:text-slate-600"}`,children:"Cuentas por Pagar"})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4 w-full lg:w-auto",children:[n.jsxs("div",{className:"bg-slate-50 p-2 rounded-2xl border border-slate-100 flex gap-2 w-full sm:w-auto shadow-inner",children:[n.jsx("select",{value:v,onChange:be=>y(Number(be.target.value)),className:"bg-transparent border-none text-[10px] font-black uppercase tracking-widest text-slate-500 outline-none px-4 py-2 cursor-pointer",children:Te.map((be,Ye)=>n.jsx("option",{value:Ye,children:be},Ye))}),n.jsx("input",{type:"number",value:j,onChange:be=>_(Number(be.target.value)),className:"bg-transparent border-none text-[10px] font-black text-blue-600 outline-none w-20 text-center py-2"})]}),n.jsxs("div",{className:"relative w-full sm:w-72",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:16}),n.jsx("input",{type:"text",placeholder:"Buscar registro...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-3.5 text-xs focus:ring-2 focus:ring-blue-500 outline-none transition-all font-bold",value:N,onChange:be=>E(be.target.value)})]})]})]}),n.jsx("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:m==="receivable"?"Unidad / Propietario":"Proveedor / Concepto"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:m==="receivable"?"Estado Cobro":"Balance Liquidación"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:m==="receivable"?"Deuda Acumulada":"Importe USD"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:m==="receivable"?Bi.items.map((be,Ye)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsxs("td",{className:"px-10 py-6",children:[n.jsx("p",{className:"font-black text-slate-900 text-lg",children:be.code}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:be.owner})]}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsx("span",{className:`px-4 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest border ${be.amount<0?"bg-blue-50 text-blue-600 border-blue-100":be.status==="Pendiente"?"bg-red-50 text-red-600 border-red-100":"bg-amber-50 text-amber-600 border-amber-100"}`,children:be.amount<0?"REEMBOLSO":be.status})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsx("p",{className:`font-black text-xl tracking-tighter ${be.amount<0?"text-blue-600":"text-slate-900"}`,children:be.amount<0?`(${Oa(Math.abs(be.amount))})`:`$${Oa(be.amount)}`})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsx("button",{className:"p-3 bg-slate-100 text-slate-400 hover:bg-emerald-600 hover:text-white rounded-xl shadow-sm",children:n.jsx(gK,{size:18})})})]},Ye)):ta.items.map(be=>{const Ye=Number(be.paid_amount_usd)||0,tt=Number(be.amount),te=tt-Ye,de=Ye>0&&Ye<tt;return n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center shrink-0 shadow-sm ${be.prefill_fee?"bg-blue-600 text-white":"bg-slate-50 text-slate-400"}`,children:be.prefill_fee?n.jsx(Kr,{size:24}):n.jsx(ea,{size:24})}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-900 text-lg uppercase leading-none truncate",children:be.provider}),n.jsx("p",{className:"text-xs font-bold text-slate-500 mt-1 uppercase line-clamp-1 italic opacity-70",children:be.description})]})]})}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("div",{className:"flex flex-col items-center gap-1",children:[n.jsxs("span",{className:`px-4 py-1.5 rounded-full text-[9px] font-black uppercase border flex items-center justify-center gap-1.5 w-fit mx-auto ${be.status==="Pagado"?"bg-emerald-50 text-emerald-600 border-emerald-100":be.status==="Parcial"?"bg-amber-50 text-amber-600 border-amber-100 animate-pulse":"bg-slate-100 text-slate-500"}`,children:[be.status==="Pagado"&&n.jsx(Xi,{size:12}),be.status]}),de&&n.jsx("div",{className:"w-24 h-1.5 bg-slate-100 rounded-full mt-2 overflow-hidden border",children:n.jsx("div",{className:"h-full bg-amber-500",style:{width:`${Ye/tt*100}%`}})})]})}),n.jsxs("td",{className:"px-10 py-6 text-right",children:[n.jsxs("p",{className:"font-black text-xl tracking-tighter text-slate-900",children:["$",Oa(te)]}),n.jsxs("p",{className:"text-[9px] font-bold text-blue-600 uppercase mt-0.5",children:["≈ Bs. ",qu(te*ks)]}),Ye>0&&n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:["Pagado: $",Oa(Ye)," de $",Oa(tt)]})]}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[be.status!=="Pagado"&&n.jsx("button",{onClick:()=>Wc(be),className:"px-6 py-2.5 bg-emerald-600 hover:bg-emerald-700 text-white rounded-xl text-[10px] font-black uppercase tracking-widest shadow-lg active:scale-95",children:"ABONAR"}),Ye>0&&n.jsx("button",{onClick:()=>alert("Historial de abonos detallado disponible en Auditoría Bancaria"),className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm",children:n.jsx(Da,{size:18})}),n.jsx("button",{onClick:()=>dn(be),className:"p-3 bg-slate-100 text-slate-400 hover:bg-blue-600 hover:text-white rounded-xl transition-all shadow-sm",children:n.jsx(yl,{size:18})}),n.jsx("button",{onClick:()=>P({id:be.id,provider:be.provider}),className:"p-3 bg-slate-100 text-slate-400 hover:bg-red-600 hover:text-white rounded-xl transition-all shadow-sm",children:n.jsx(Ua,{size:18})})]})})]},be.id)})})]})})}),L&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/80 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 w-full max-w-sm shadow-2xl animate-in zoom-in-95 duration-200 text-center relative overflow-hidden",children:[n.jsx("div",{className:"w-20 h-20 bg-red-50 text-red-600 rounded-3xl flex items-center justify-center mx-auto mb-6",children:n.jsx(vs,{size:40})}),n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight mb-2",children:"¿Eliminar Registro?"}),n.jsxs("p",{className:"text-slate-500 font-medium text-sm leading-relaxed mb-10 px-2",children:["Está a punto de borrar permanentemente el registro de ",n.jsxs("span",{className:"font-black text-slate-800 uppercase",children:['"',L.provider,'"']}),"."]}),n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx("button",{onClick:async()=>{await u(L.id),P(null),h()},className:"w-full bg-red-600 hover:bg-red-700 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl transition-all active:scale-95",children:"SÍ, CONFIRMAR BORRADO"}),n.jsx("button",{onClick:()=>P(null),className:"w-full py-4 text-slate-400 hover:text-slate-600 font-black text-[10px] uppercase transition-colors",children:"CANCELAR"})]})]})}),T&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-5xl shadow-2xl overflow-y-auto max-h-[95vh] custom-scrollbar animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"mb-10 flex justify-between items-center border-b border-slate-100 pb-6",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:G?"Editar Egresos":"Nuevo Registro de Egreso"}),n.jsx("p",{className:"text-slate-400 font-medium mt-1",children:"Configure los parámetros contables de este compromiso de pago."})]}),n.jsx("button",{onClick:()=>B(!1),className:"p-3 bg-slate-100 rounded-full text-slate-500 hover:bg-red-500 hover:text-white transition-all",children:n.jsx(mt,{size:24})})]}),n.jsxs("form",{onSubmit:el,className:"space-y-10",children:[n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-10",children:[n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{className:"relative",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Proveedor Autorizado"}),n.jsxs("div",{className:"relative",children:[n.jsx(pb,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-5 py-4 font-bold text-slate-800 outline-none focus:ring-2 focus:ring-blue-500",value:Et,onChange:be=>{jt(be.target.value),me({...ie,provider:be.target.value}),fr(!0)},onFocus:()=>fr(!0),placeholder:"Buscar o escribir nombre..."}),Kt&&(Et.length>0||Cr.length>0)&&n.jsx("div",{className:"absolute left-0 right-0 top-full mt-2 bg-white rounded-2xl shadow-2xl border border-slate-100 z-50 overflow-hidden",children:n.jsx("div",{className:"max-h-[160px] overflow-y-auto custom-scrollbar",children:Cr.map(be=>n.jsx("button",{type:"button",onClick:()=>{me({...ie,provider:be.name}),jt(be.name),fr(!1)},className:"w-full px-6 py-4 text-left hover:bg-slate-50 border-b border-slate-50 last:border-0 font-black text-sm uppercase text-slate-700",children:be.name},be.rif))})})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Concepto / Glosa"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold text-slate-900",value:ie.description,onChange:be=>me({...ie,description:be.target.value.toUpperCase()}),placeholder:"EJ: REPARACIÓN DE BOMBA DE AGUA"})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Fecha Contable"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-xs",value:ie.creationDate,onChange:be=>me({...ie,creationDate:be.target.value})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Vencimiento"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-xs",value:ie.dueDate,onChange:be=>me({...ie,dueDate:be.target.value})})]})]}),n.jsxs("div",{className:"p-6 bg-emerald-50 border border-emerald-100 rounded-[2.5rem] shadow-inner space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase tracking-widest block text-emerald-600",children:"Importe Factura (Bolívares)"}),n.jsxs("div",{className:"flex p-1 bg-white/50 rounded-xl border border-emerald-100 scale-90 origin-right",children:[n.jsx("button",{type:"button",onClick:()=>Me("am"),className:`px-3 py-1 rounded-lg text-[8px] font-black uppercase transition-all ${Z==="am"?"bg-emerald-600 text-white shadow-md":"text-emerald-400 hover:text-emerald-600"}`,children:"AM"}),n.jsx("button",{type:"button",onClick:()=>Me("pm"),className:`px-3 py-1 rounded-lg text-[8px] font-black uppercase transition-all ${Z==="pm"?"bg-emerald-600 text-white shadow-md":"text-emerald-400 hover:text-emerald-600"}`,children:"PM"}),n.jsx("button",{type:"button",onClick:()=>Me("parallel"),className:`px-3 py-1 rounded-lg text-[8px] font-black uppercase transition-all ${Z==="parallel"?"bg-emerald-600 text-white shadow-md":"text-emerald-400 hover:text-emerald-600"}`,children:"Paralelo"})]})]}),n.jsxs("div",{className:"bg-white rounded-2xl px-5 py-4 flex items-center gap-3 border border-slate-200",children:[n.jsx("span",{className:"font-black text-slate-300",children:"Bs."}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full text-2xl font-black outline-none text-slate-900",value:ie.amountBs||"",onChange:be=>me({...ie,amountBs:parseFloat(be.target.value)}),placeholder:"0,00"})]}),n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsxs("span",{className:"text-[9px] font-black text-emerald-600 uppercase",children:["Equivalente USD (@",$n.toFixed(2),"):"]}),n.jsxs("span",{className:"text-xl font-black text-slate-800",children:["$",Oa(Cs)]})]})]})]}),n.jsx("div",{className:"bg-slate-900 rounded-[3rem] p-10 text-white relative overflow-hidden shadow-2xl border-b-8 border-blue-600",children:n.jsxs("div",{className:"relative z-10 space-y-8",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("h4",{className:"text-lg font-black tracking-tight flex items-center gap-3",children:[n.jsx(Kr,{className:"text-blue-400"})," Auto-Facturación"]}),n.jsx("button",{type:"button",onClick:()=>me({...ie,prefill_fee:!ie.prefill_fee}),className:`w-16 h-8 rounded-full transition-all relative ${ie.prefill_fee?"bg-blue-600":"bg-slate-700"}`,children:n.jsx("div",{className:`absolute top-1 w-6 h-6 bg-white rounded-full transition-all ${ie.prefill_fee?"left-9 shadow-lg":"left-1"}`})})]}),ie.prefill_fee?n.jsxs("div",{className:"space-y-8 animate-in fade-in zoom-in-95 duration-500",children:[n.jsxs("div",{className:"p-6 bg-white/5 border border-white/10 rounded-3xl space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("h5",{className:"text-[11px] font-black uppercase text-blue-400 flex items-center gap-2",children:[n.jsx(kK,{size:14})," ¿Fraccionar este Pago?"]}),n.jsx("button",{type:"button",onClick:()=>J(!z),className:`w-12 h-6 rounded-full transition-all relative ${z?"bg-emerald-600":"bg-slate-700"}`,children:n.jsx("div",{className:`absolute top-1 w-4 h-4 bg-white rounded-full transition-all ${z?"left-7 shadow-lg":"left-1"}`})})]}),z?n.jsxs("div",{className:"space-y-6 animate-in slide-in-from-top-2",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[8px] font-black uppercase text-slate-500 mb-2 block",children:"Número de Partes"}),n.jsx("select",{className:"w-full bg-white/10 border border-white/10 rounded-xl px-4 py-3 font-black text-white",value:re,onChange:be=>{le(parseInt(be.target.value)),ae([])},children:[2,3,4,5,6,8,10,12].map(be=>n.jsxs("option",{value:be,className:"text-slate-900",children:[be," Partes"]},be))})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("label",{className:"text-[8px] font-black uppercase text-slate-500 mb-2 block",children:"Monto por Fracción"}),n.jsxs("p",{className:"text-xl font-black text-emerald-400",children:["$",Oa(Cs/re)]})]})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"text-[9px] font-black text-blue-400 uppercase tracking-widest mb-3 block text-center",children:["Seleccione los ",re," meses de aplicación"]}),n.jsx("div",{className:"grid grid-cols-4 gap-1.5",children:Te.map((be,Ye)=>n.jsx("button",{type:"button",onClick:()=>_i(Ye),className:`py-2 rounded-lg text-[8px] font-black border transition-all ${ne.includes(Ye)?"bg-blue-600 border-blue-500 text-white":"bg-white/5 border-white/10 text-slate-500"}`,children:be.substring(0,3).toUpperCase()},Ye))})]})]}):n.jsxs("div",{className:"grid grid-cols-2 gap-4 animate-in fade-in",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black text-blue-400 uppercase tracking-widest ml-1 mb-2 block",children:"Mes a Facturar"}),n.jsx("select",{className:"w-full bg-white/10 border border-white/10 rounded-xl px-4 py-3 font-black text-white outline-none",value:ie.target_month,onChange:be=>me({...ie,target_month:parseInt(be.target.value)}),children:Te.map((be,Ye)=>n.jsx("option",{value:Ye,children:be},Ye))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black text-blue-400 uppercase tracking-widest ml-1 mb-2 block",children:"Año de Cobro"}),n.jsx("input",{type:"number",className:"w-full bg-white/10 border border-white/10 rounded-xl px-4 py-3 font-black text-white outline-none",value:ie.target_year,onChange:be=>me({...ie,target_year:parseInt(be.target.value)})})]})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black text-blue-400 uppercase tracking-widest ml-1 mb-2 block",children:"Ubicación en Planilla"}),n.jsx("div",{className:"flex gap-2",children:["fixed","variable","other"].map(be=>n.jsx("button",{type:"button",onClick:()=>me({...ie,fee_category:be}),className:`flex-1 py-3 rounded-xl text-[9px] font-black uppercase border transition-all ${ie.fee_category===be?"bg-blue-600 border-blue-600 text-white shadow-lg":"bg-white/5 border-white/10 text-slate-400 hover:text-white"}`,children:be==="fixed"?"Fijo":be==="variable"?"Variable":"Otros"},be))})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("button",{type:"button",onClick:()=>me({...ie,is_uncommon:!ie.is_uncommon}),className:`p-5 rounded-2xl border transition-all flex flex-col items-center gap-2 ${ie.is_uncommon?"bg-indigo-600 border-indigo-500 shadow-xl":"bg-white/5 border-white/10 text-slate-400"}`,children:[n.jsx(Qc,{size:20,fill:ie.is_uncommon?"currentColor":"none"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest",children:"Gasto GNC"})]}),n.jsxs("button",{type:"button",onClick:()=>me({...ie,is_special:!ie.is_special}),className:`p-5 rounded-2xl border transition-all flex flex-col items-center gap-2 ${ie.is_special?"bg-amber-600 border-amber-500 shadow-xl":"bg-white/5 border-white/10 text-slate-400"}`,children:[n.jsx(uk,{size:20}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest",children:"Especial"})]})]}),n.jsxs("div",{className:"p-6 bg-white/5 border border-white/10 rounded-3xl flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Kr,{size:20,className:"text-amber-400"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black uppercase text-white",children:"Silent Offset Mode"}),n.jsx("p",{className:"text-[8px] font-bold text-slate-500 uppercase tracking-widest",children:"Sin Efecto en Banco"})]})]}),n.jsx("button",{type:"button",onClick:()=>me({...ie,is_silent:!ie.is_silent}),className:`w-14 h-7 rounded-full transition-all relative ${ie.is_silent?"bg-amber-600":"bg-slate-700"}`,children:n.jsx("div",{className:`absolute top-1 w-5 h-5 bg-white rounded-full transition-all ${ie.is_silent?"left-8 shadow-lg":"left-1"}`})})]}),ie.is_special&&n.jsxs("div",{className:"p-6 bg-white/5 border border-white/10 rounded-3xl animate-in slide-in-from-top-2",children:[n.jsx("p",{className:"text-[9px] font-black text-blue-400 uppercase mb-4 text-center",children:"Unidades Beneficiarias"}),n.jsx("div",{className:"grid grid-cols-5 gap-1 max-h-[150px] overflow-y-auto custom-scrollbar pr-2",children:Ma.map(be=>{var Ye;return n.jsx("button",{type:"button",onClick:()=>{const tt=ie.special_props_json||[];me({...ie,special_props_json:tt.includes(be.id)?tt.filter(te=>te!==be.id):[...tt,be.id]})},className:`py-2 rounded-lg text-[8px] font-black border transition-all ${(Ye=ie.special_props_json)!=null&&Ye.includes(be.id)?"bg-blue-600 border-blue-500 text-white":"bg-white/5 border-white/10 text-slate-500 hover:text-white"}`,children:be.code.split("-")[1]||be.code},be.id)})})]})]}):n.jsxs("div",{className:"py-20 text-center opacity-30",children:[n.jsx(vs,{size:48,className:"mx-auto mb-4"}),n.jsx("p",{className:"text-xs font-black uppercase tracking-[0.2em]",children:"Modo Manual Activado"}),n.jsx("p",{className:"text-[9px] mt-2 italic",children:"Este gasto no se incluirá en el pre-llenado de cuotas."})]})]})})]}),n.jsx("button",{type:"submit",className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2.5rem] font-black text-xs uppercase tracking-[0.3em] shadow-2xl active:scale-95 transition-all",children:"SELLAR COMPROMISO CONTABLE"})]})]})}),F&&pe&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[300] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-8 sm:p-12 w-full max-w-lg shadow-2xl animate-in zoom-in-95 duration-300 relative overflow-y-auto max-h-[95vh] custom-scrollbar",children:[n.jsx("button",{onClick:()=>R(!1),className:"absolute top-8 right-8 p-2 bg-slate-100 rounded-full text-slate-400 hover:bg-red-50 hover:text-white transition-all",children:n.jsx(mt,{size:20})}),n.jsx("div",{className:"mb-10",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-emerald-600 rounded-2xl flex items-center justify-center text-white shadow-lg",children:n.jsx(Ki,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Amortizar Factura"}),n.jsxs("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest mt-1",children:["Proveedor: ",pe.provider]})]})]})}),n.jsxs("form",{onSubmit:It,className:"space-y-8",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"p-4 bg-slate-50 border border-slate-100 rounded-2xl",children:[n.jsx("span",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest block mb-1",children:"Deuda Total"}),n.jsxs("span",{className:"text-sm font-black text-slate-900",children:["$ ",Oa(pe.amount)]})]}),n.jsxs("div",{className:"p-4 bg-emerald-50 border border-emerald-100 rounded-2xl",children:[n.jsx("span",{className:"text-[8px] font-black text-emerald-600 uppercase tracking-widest block mb-1",children:"Saldo Restante"}),n.jsxs("span",{className:"text-sm font-black text-emerald-700",children:["$ ",Oa(Number(pe.amount)-(Number(pe.paid_amount_usd)||0))]})]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 bg-blue-50 border border-blue-100 rounded-2xl",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Lc,{size:16,className:"text-blue-600"}),n.jsx("span",{className:"text-[9px] font-black text-blue-700 uppercase",children:"Múltiples Referencias"})]}),n.jsx("button",{type:"button",onClick:()=>pa(!Ar),className:`w-10 h-5 rounded-full transition-all relative ${Ar?"bg-blue-600":"bg-slate-300"}`,children:n.jsx("div",{className:`absolute top-0.5 w-4 h-4 bg-white rounded-full transition-all shadow-sm ${Ar?"left-5":"left-0.5"}`})})]}),Ar?n.jsxs("div",{className:"space-y-4",children:[Ut.map((be,Ye)=>n.jsxs("div",{className:"p-4 bg-slate-50 border border-slate-200 rounded-2xl space-y-3 relative group",children:[n.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[8px] font-black uppercase text-slate-400 ml-1",children:"Monto Bs."}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full bg-white border border-slate-200 rounded-lg px-3 py-2 font-black text-xs",value:be.amountBs,onChange:tt=>Ve(Ye,"amountBs",tt.target.value)})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[8px] font-black uppercase text-slate-400 ml-1",children:"Referencia"}),n.jsx("input",{required:!0,className:"w-full bg-white border border-slate-200 rounded-lg px-3 py-2 font-black text-xs",value:be.ref,onChange:tt=>{Ve(Ye,"ref",tt.target.value),tt.target.value.length>=3&&M(tt.target.value)},placeholder:"Ref"})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[8px] font-black uppercase text-slate-400 ml-1",children:"Fecha"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-white border border-slate-200 rounded-lg px-2 py-2 font-black text-[10px]",value:be.date,onChange:tt=>Ve(Ye,"date",tt.target.value)})]})]}),Ut.length>1&&n.jsx("button",{type:"button",onClick:()=>Ul(Ye),className:"absolute -top-2 -right-2 w-6 h-6 bg-red-500 text-white rounded-full flex items-center justify-center shadow-lg opacity-0 group-hover:opacity-100 transition-all",children:n.jsx(mt,{size:12})})]},Ye)),n.jsxs("button",{type:"button",onClick:Lo,className:"w-full py-3 border-2 border-dashed border-slate-200 rounded-2xl text-slate-400 hover:text-blue-600 hover:border-blue-200 transition-all flex items-center justify-center gap-2 text-[10px] font-black uppercase tracking-widest",children:[n.jsx(En,{size:14})," Añadir Referencia"]}),n.jsxs("div",{className:"p-4 bg-blue-600 rounded-2xl text-white flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Total Acumulado:"}),n.jsxs("span",{className:"text-lg font-black",children:["Bs. ",Ut.reduce((be,Ye)=>be+parseFloat(Ye.amountBs||"0"),0).toLocaleString("es-VE",{minimumFractionDigits:2})]})]})]}):n.jsxs("div",{className:"p-8 bg-blue-600 rounded-[2.5rem] text-white shadow-xl relative overflow-hidden",children:[n.jsxs("div",{className:"flex justify-between items-center mb-4",children:[n.jsx("label",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-blue-200",children:"Monto del Abono (Bolívares)"}),n.jsxs("div",{className:"flex p-1 bg-white/10 rounded-xl border border-white/20 scale-90 origin-right",children:[n.jsx("button",{type:"button",onClick:()=>Rt("am"),className:`px-3 py-1 rounded-lg text-[8px] font-black uppercase transition-all ${it==="am"?"bg-white text-blue-600 shadow-md":"text-blue-200 hover:text-white"}`,children:"AM"}),n.jsx("button",{type:"button",onClick:()=>Rt("pm"),className:`px-3 py-1 rounded-lg text-[8px] font-black uppercase transition-all ${it==="pm"?"bg-white text-blue-600 shadow-md":"text-blue-200 hover:text-white"}`,children:"PM"}),n.jsx("button",{type:"button",onClick:()=>Rt("parallel"),className:`px-3 py-1 rounded-lg text-[8px] font-black uppercase transition-all ${it==="parallel"?"bg-white text-blue-600 shadow-md":"text-blue-200 hover:text-white"}`,children:"Paralelo"})]})]}),n.jsxs("div",{className:"flex items-center gap-3 border-b-2 border-blue-400 pb-2",children:[n.jsx("span",{className:"text-2xl font-black opacity-50",children:"Bs."}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"bg-transparent w-full text-4xl font-black outline-none placeholder:text-blue-400",value:ye,onChange:be=>fe(be.target.value)})]}),n.jsxs("div",{className:"mt-6 flex justify-between items-center relative z-10",children:[n.jsx("span",{className:"text-[10px] font-bold text-blue-100",children:"Equivalente Aproximado:"}),n.jsxs("span",{className:"text-xl font-black",children:["$ ",Oa(parseFloat(ye)/cn(Ct,it))]})]}),n.jsx(za,{size:100,className:"absolute right-[-20px] bottom-[-20px] opacity-10"})]}),!Ar&&n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-slate-400 ml-1",children:"Referencia"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-xl px-5 py-3.5 font-black text-xs",value:Ue,onChange:be=>{qe(be.target.value),be.target.value.length>=3&&M(be.target.value)},placeholder:"000000"})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-slate-400 ml-1",children:"Fecha Pago"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-xl px-4 py-3 font-black text-xs",value:Ct,onChange:be=>kt(be.target.value)})]})]}),K&&n.jsxs("div",{className:"p-6 bg-amber-50 border-2 border-amber-200 rounded-[2rem] space-y-4 animate-in zoom-in-95",children:[n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-amber-500 rounded-2xl flex items-center justify-center text-white shadow-lg shrink-0",children:n.jsx(Xr,{size:24})}),n.jsxs("div",{className:"flex-1",children:[n.jsx("h4",{className:"text-sm font-black text-amber-900 uppercase tracking-tight",children:"Referencia Duplicada Detectada"}),n.jsx("p",{className:"text-[10px] font-bold text-amber-700 mt-1 leading-relaxed",children:e.role==="programmer"||e.role==="admin"?"Este código ya ha sido utilizado en el sistema. Verifique la información a continuación.":"Este código ya ha sido reportado anteriormente. Por favor, contacte a la administración para verificar su pago."})]})]}),(e.role==="programmer"||e.role==="admin")&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"bg-white/60 rounded-2xl p-4 space-y-3",children:[n.jsxs("p",{className:"text-[9px] font-black text-amber-900 uppercase border-b border-amber-200 pb-2 flex items-center gap-2",children:[n.jsx(jn,{size:12})," Detalles del Hallazgo:"]}),n.jsx("div",{className:"space-y-2 max-h-[120px] overflow-y-auto custom-scrollbar pr-2",children:K.matches.map((be,Ye)=>n.jsxs("div",{className:"text-[9px] font-bold text-slate-700 bg-white p-2 rounded-lg border border-amber-100 flex justify-between",children:[n.jsxs("span",{children:[be.table==="payment_reports"?"Reporte":be.table==="payments"?"Pago":be.table==="bank_transactions"?"Banco":"CxP",": ",be.details]}),n.jsx("span",{className:"text-amber-600",children:be.date})]},Ye))})]}),n.jsxs("div",{className:"flex items-center gap-3 p-4 bg-white rounded-2xl border-2 border-amber-200 shadow-sm",children:[n.jsx("input",{type:"checkbox",id:"authDuplicateBalance",checked:W,onChange:be=>Y(be.target.checked),className:"w-5 h-5 rounded-lg border-amber-300 text-amber-600 focus:ring-amber-500"}),n.jsx("label",{htmlFor:"authDuplicateBalance",className:"text-[10px] font-black text-amber-900 uppercase cursor-pointer select-none",children:"Autorizo el uso de esta referencia duplicada"})]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-slate-400 ml-1",children:"Origen de Fondos"}),n.jsx("div",{className:"flex gap-3",children:["Banco","Efectivo","Otro"].map(be=>n.jsx("button",{type:"button",onClick:()=>nt(be),className:`flex-1 py-3 rounded-xl font-black text-[9px] uppercase transition-all ${at===be?"bg-slate-900 text-white shadow-lg":"bg-slate-50 text-slate-400 border border-slate-100"}`,children:be},be))})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 bg-amber-50 border border-amber-100 rounded-2xl",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Kr,{size:16,className:"text-amber-600"}),n.jsx("span",{className:"text-[9px] font-black text-amber-700 uppercase",children:"Silent Offset Mode"})]}),n.jsx("button",{type:"button",onClick:()=>_r(!ft),className:`w-10 h-5 rounded-full transition-all relative ${ft?"bg-amber-600":"bg-slate-300"}`,children:n.jsx("div",{className:`absolute top-0.5 w-4 h-4 bg-white rounded-full transition-all shadow-sm ${ft?"left-5":"left-0.5"}`})})]}),n.jsxs("div",{className:"flex items-center gap-3 p-4 bg-rose-50 border border-rose-100 rounded-2xl",children:[n.jsx("input",{type:"checkbox",id:"forceClose",checked:U,onChange:be=>D(be.target.checked),className:"w-5 h-5 rounded-lg border-rose-300 text-rose-600 focus:ring-rose-500"}),n.jsx("label",{htmlFor:"forceClose",className:"text-[10px] font-black text-rose-700 uppercase cursor-pointer select-none",children:"Cerrar cuenta con este pago (Total)"})]})]}),n.jsx("button",{type:"submit",className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl active:scale-95 transition-all",children:"PROCESAR LIQUIDACIÓN"})]})]})}),H&&n.jsxs("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:[n.jsxs("div",{className:"bg-white w-full max-w-5xl max-h-[90vh] rounded-[2.5rem] shadow-2xl overflow-hidden flex flex-col",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex justify-between items-center bg-slate-50 no-print",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tighter uppercase",children:"Reporte Detallado CxP"}),n.jsxs("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest mt-1",children:["Periodo: ",Te[v]," ",j]})]}),n.jsxs("div",{className:"flex gap-3",children:[n.jsxs("button",{onClick:()=>window.print(),className:"bg-slate-900 text-white px-6 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2 hover:bg-slate-800 transition-all",children:[n.jsx(wt,{size:16})," Imprimir / PDF"]}),n.jsx("button",{onClick:()=>X(!1),className:"p-3 bg-white text-slate-400 hover:text-slate-600 rounded-xl border border-slate-200 transition-all",children:n.jsx(mt,{size:20})})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto p-8 custom-scrollbar",children:n.jsxs("div",{id:"printable-report",className:"space-y-8",children:[n.jsxs("div",{className:"text-center border-b-4 border-slate-900 pb-6 mb-8 hidden print:block",children:[n.jsx("h1",{className:"text-3xl font-black uppercase tracking-tighter",children:"Reporte Detallado de Cuentas por Pagar"}),n.jsx("p",{className:"text-xs font-bold text-slate-500 uppercase tracking-[0.3em] mt-2",children:"Condominio El Tejar • Kernel V4.1.70 MC/MB"}),n.jsxs("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest mt-4",children:["Periodo: ",Te[v]," ",j]})]}),n.jsxs("table",{className:"w-full border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b-2 border-slate-900",children:[n.jsx("th",{className:"py-4 text-left text-[9px] font-black uppercase text-slate-400 tracking-widest",children:"Proveedor / Concepto"}),n.jsx("th",{className:"py-4 text-center text-[9px] font-black uppercase text-slate-400 tracking-widest",children:"Vencimiento"}),n.jsx("th",{className:"py-4 text-right text-[9px] font-black uppercase text-slate-400 tracking-widest",children:"Monto USD"}),n.jsx("th",{className:"py-4 text-right text-[9px] font-black uppercase text-slate-400 tracking-widest",children:"Monto BS"}),n.jsx("th",{className:"py-4 text-center text-[9px] font-black uppercase text-slate-400 tracking-widest",children:"Estatus"})]})}),n.jsx("tbody",{children:ta.items.map(be=>n.jsxs(Ip.Fragment,{children:[n.jsxs("tr",{className:"border-b border-slate-100 bg-slate-50/50",children:[n.jsxs("td",{className:"py-4",children:[n.jsx("p",{className:"text-xs font-black text-slate-900 uppercase",children:be.provider}),n.jsx("p",{className:"text-[10px] font-bold text-slate-500 mt-0.5",children:be.description})]}),n.jsx("td",{className:"py-4 text-center text-[10px] font-bold text-slate-600",children:be.dueDate}),n.jsxs("td",{className:"py-4 text-right text-xs font-black text-slate-900",children:["$ ",Oa(be.amount)]}),n.jsxs("td",{className:"py-4 text-right text-xs font-black text-slate-600",children:["Bs. ",qu(be.amountBs)]}),n.jsx("td",{className:"py-4 text-center",children:n.jsx("span",{className:`px-3 py-1 rounded-full text-[8px] font-black uppercase tracking-widest ${be.status==="Pagado"?"bg-emerald-100 text-emerald-700":be.status==="Parcial"?"bg-amber-100 text-amber-700":"bg-rose-100 text-rose-700"}`,children:be.status})})]}),be.payments&&be.payments.length>0&&n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-2 px-8",children:n.jsxs("div",{className:"bg-white border border-slate-100 rounded-xl p-4 space-y-2",children:[n.jsx("p",{className:"text-[8px] font-black text-blue-600 uppercase tracking-widest",children:"Historial de Pagos:"}),n.jsxs("table",{className:"w-full",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-slate-50",children:[n.jsx("th",{className:"py-2 text-left text-[8px] font-black text-slate-400 uppercase",children:"Fecha"}),n.jsx("th",{className:"py-2 text-left text-[8px] font-black text-slate-400 uppercase",children:"Referencia"}),n.jsx("th",{className:"py-2 text-left text-[8px] font-black text-slate-400 uppercase",children:"Origen"}),n.jsx("th",{className:"py-2 text-right text-[8px] font-black text-slate-400 uppercase",children:"Monto USD"}),n.jsx("th",{className:"py-2 text-right text-[8px] font-black text-slate-400 uppercase",children:"Monto BS"})]})}),n.jsx("tbody",{children:be.payments.map(Ye=>n.jsxs("tr",{className:"border-b border-slate-50 last:border-0",children:[n.jsx("td",{className:"py-2 text-[9px] font-bold text-slate-600",children:Ye.payment_date}),n.jsx("td",{className:"py-2 text-[9px] font-black text-slate-900",children:Ye.reference}),n.jsx("td",{className:"py-2 text-[9px] font-bold text-slate-500",children:Ye.source}),n.jsxs("td",{className:"py-2 text-right text-[9px] font-black text-slate-900",children:["$ ",Oa(Ye.amount_usd)]}),n.jsxs("td",{className:"py-2 text-right text-[9px] font-black text-slate-600",children:["Bs. ",qu(Ye.amount_bs)]})]},Ye.id))})]})]})})})]},be.id))})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-8 pt-8 border-t-2 border-slate-900",children:[n.jsxs("div",{className:"p-6 bg-slate-900 rounded-[2rem] text-white",children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400 mb-2",children:"Total Facturado"}),n.jsxs("p",{className:"text-2xl font-black tracking-tighter",children:["$ ",Oa(ta.totalUsd)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 mt-1",children:["Bs. ",qu(ta.totalBs)]})]}),n.jsxs("div",{className:"p-6 bg-emerald-600 rounded-[2rem] text-white",children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-emerald-200 mb-2",children:"Total Pagado"}),n.jsxs("p",{className:"text-2xl font-black tracking-tighter",children:["$ ",Oa(ta.paidUsd)]}),n.jsxs("p",{className:"text-[10px] font-bold text-emerald-200 mt-1",children:["Bs. ",qu(ta.paidBs)]})]}),n.jsxs("div",{className:"p-6 bg-rose-600 rounded-[2rem] text-white",children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest text-rose-200 mb-2",children:"Saldo Pendiente"}),n.jsxs("p",{className:"text-2xl font-black tracking-tighter",children:["$ ",Oa(ta.totalUsd-ta.paidUsd)]}),n.jsxs("p",{className:"text-[10px] font-bold text-rose-200 mt-1",children:["Bs. ",qu(ta.totalBs-ta.paidBs)]})]})]}),n.jsxs("div",{className:"mt-20 flex justify-around items-end text-center print:mt-40",children:[n.jsx("div",{className:"w-48 border-t border-slate-900 pt-4",children:n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"Administración"})}),n.jsx("div",{className:"w-48 border-t border-slate-900 pt-4",children:n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"Junta de Condominio"})})]}),n.jsxs("div",{className:"text-right text-[8px] font-bold text-slate-400 uppercase tracking-widest mt-8",children:["Generado el: ",new Date().toLocaleString()," • Kernel V4.1.70 MC/MB"]})]})})]}),n.jsx("style",{children:`
            @media print {
              .no-print { display: none !important; }
              body { background: white !important; padding: 0 !important; margin: 0 !important; overflow: visible !important; }
              html { overflow: visible !important; height: auto !important; }
              
              /* Hide everything by default */
              body > #root > div > aside,
              body > #root > div > div > header,
              body > #root > div > div > main > div > div.balance-root-container:not(.is-printing-report) {
                display: none !important;
              }

              /* Hide non-report content inside Balance when printing report */
              .balance-root-container.is-printing-report > *:not(.fixed) {
                display: none !important;
              }

              #printable-report { 
                display: block !important; 
                width: 100% !important; 
                padding: 0 !important; 
                margin: 0 !important; 
                overflow: visible !important;
                position: relative !important;
              }

              .fixed { 
                position: static !important; 
                display: block !important; 
                visibility: visible !important;
                opacity: 1 !important;
                background: white !important; 
                z-index: auto !important; 
                padding: 0 !important; 
                margin: 0 !important;
                overflow: visible !important;
                box-shadow: none !important;
                backdrop-filter: none !important;
                width: 100% !important;
                height: auto !important;
              }

              .bg-white { background: white !important; }
              .bg-slate-50 { background: #f8fafc !important; }
              .bg-slate-900 { background: #0f172a !important; color: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
              .bg-emerald-600 { background: #059669 !important; color: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
              .bg-rose-600 { background: #e11d48 !important; color: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
              
              .shadow-2xl, .shadow-xl, .shadow-lg, .shadow-md, .shadow-sm { box-shadow: none !important; }
              .rounded-[2.5rem], .rounded-[2rem], .rounded-2xl, .rounded-xl { border-radius: 0 !important; border: 1px solid #e2e8f0 !important; }
              
              .overflow-hidden, .overflow-y-auto { 
                overflow: visible !important; 
                height: auto !important; 
                max-height: none !important; 
              }
              
              .max-h-[90vh], .max-h-[95vh] { max-height: none !important; }
              .p-8, .p-6, .p-4 { padding: 10px !important; }
              
              table { 
                border-collapse: collapse !important; 
                width: 100% !important; 
                page-break-inside: auto !important; 
                table-layout: auto !important;
              }
              
              tr { page-break-inside: auto !important; page-break-after: auto !important; }
              th, td { border: 1px solid #e2e8f0 !important; padding: 8px !important; page-break-inside: avoid !important; }
              
              .hidden.print\\:block { display: block !important; }
              * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; transition: none !important; animation: none !important; }
              
              /* Ensure the modal content takes full width */
              .max-w-5xl { max-width: 100% !important; width: 100% !important; }
            }
          `})]})]})};/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */var Qg={};Qg.version="0.18.5";var yQ=1252,Ime=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],rE={0:1252,1:65001,2:65001,77:1e4,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,255:1252,69:6969},aE=function(e){Ime.indexOf(e)!=-1&&(yQ=rE[0]=e)};function Fme(){aE(1252)}var Pi=function(e){aE(e)};function nE(){Pi(1200),Fme()}function cD(e){for(var t=[],r=0,a=e.length;r<a;++r)t[r]=e.charCodeAt(r);return t}function Dme(e){for(var t=[],r=0;r<e.length>>1;++r)t[r]=String.fromCharCode(e.charCodeAt(2*r)+(e.charCodeAt(2*r+1)<<8));return t.join("")}function wQ(e){for(var t=[],r=0;r<e.length>>1;++r)t[r]=String.fromCharCode(e.charCodeAt(2*r+1)+(e.charCodeAt(2*r)<<8));return t.join("")}var wf=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1);return t==255&&r==254?Dme(e.slice(2)):t==254&&r==255?wQ(e.slice(2)):t==65279?e.slice(1):e},Qh=function(t){return String.fromCharCode(t)},dD=function(t){return String.fromCharCode(t)},xp,yc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function hp(e){for(var t="",r=0,a=0,s=0,i=0,l=0,o=0,d=0,u=0;u<e.length;)r=e.charCodeAt(u++),i=r>>2,a=e.charCodeAt(u++),l=(r&3)<<4|a>>4,s=e.charCodeAt(u++),o=(a&15)<<2|s>>6,d=s&63,isNaN(a)?o=d=64:isNaN(s)&&(d=64),t+=yc.charAt(i)+yc.charAt(l)+yc.charAt(o)+yc.charAt(d);return t}function Vs(e){var t="",r=0,a=0,s=0,i=0,l=0,o=0,d=0;e=e.replace(/[^\w\+\/\=]/g,"");for(var u=0;u<e.length;)i=yc.indexOf(e.charAt(u++)),l=yc.indexOf(e.charAt(u++)),r=i<<2|l>>4,t+=String.fromCharCode(r),o=yc.indexOf(e.charAt(u++)),a=(l&15)<<4|o>>2,o!==64&&(t+=String.fromCharCode(a)),d=yc.indexOf(e.charAt(u++)),s=(o&3)<<6|d,d!==64&&(t+=String.fromCharCode(s));return t}var Mt=(function(){return typeof Buffer<"u"&&typeof process<"u"&&typeof process.versions<"u"&&!!process.versions.node})(),Ro=(function(){if(typeof Buffer<"u"){var e=!Buffer.from;if(!e)try{Buffer.from("foo","utf8")}catch{e=!0}return e?function(t,r){return r?new Buffer(t,r):new Buffer(t)}:Buffer.from.bind(Buffer)}return function(){}})();function Dc(e){return Mt?Buffer.alloc?Buffer.alloc(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}function uD(e){return Mt?Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}var Rs=function(t){return Mt?Ro(t,"binary"):t.split("").map(function(r){return r.charCodeAt(0)&255})};function ov(e){if(typeof ArrayBuffer>"u")return Rs(e);for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),a=0;a!=e.length;++a)r[a]=e.charCodeAt(a)&255;return t}function Gc(e){if(Array.isArray(e))return e.map(function(a){return String.fromCharCode(a)}).join("");for(var t=[],r=0;r<e.length;++r)t[r]=String.fromCharCode(e[r]);return t.join("")}function Ume(e){if(typeof Uint8Array>"u")throw new Error("Unsupported");return new Uint8Array(e)}function sE(e){if(typeof ArrayBuffer>"u")throw new Error("Unsupported");if(e instanceof ArrayBuffer)return sE(new Uint8Array(e));for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=e[r];return t}var en=Mt?function(e){return Buffer.concat(e.map(function(t){return Buffer.isBuffer(t)?t:Ro(t)}))}:function(e){if(typeof Uint8Array<"u"){var t=0,r=0;for(t=0;t<e.length;++t)r+=e[t].length;var a=new Uint8Array(r),s=0;for(t=0,r=0;t<e.length;r+=s,++t)if(s=e[t].length,e[t]instanceof Uint8Array)a.set(e[t],r);else{if(typeof e[t]=="string")throw"wtf";a.set(new Uint8Array(e[t]),r)}return a}return[].concat.apply([],e.map(function(i){return Array.isArray(i)?i:[].slice.call(i)}))};function Mme(e){for(var t=[],r=0,a=e.length+250,s=Dc(e.length+255),i=0;i<e.length;++i){var l=e.charCodeAt(i);if(l<128)s[r++]=l;else if(l<2048)s[r++]=192|l>>6&31,s[r++]=128|l&63;else if(l>=55296&&l<57344){l=(l&1023)+64;var o=e.charCodeAt(++i)&1023;s[r++]=240|l>>8&7,s[r++]=128|l>>2&63,s[r++]=128|o>>6&15|(l&3)<<4,s[r++]=128|o&63}else s[r++]=224|l>>12&15,s[r++]=128|l>>6&63,s[r++]=128|l&63;r>a&&(t.push(s.slice(0,r)),r=0,s=Dc(65535),a=65530)}return t.push(s.slice(0,r)),en(t)}var Jn=/\u0000/g,Nf=/[\u0001-\u0006]/g;function yA(e){for(var t="",r=e.length-1;r>=0;)t+=e.charAt(r--);return t}function Li(e,t){var r=""+e;return r.length>=t?r:oa("0",t-r.length)+r}function iE(e,t){var r=""+e;return r.length>=t?r:oa(" ",t-r.length)+r}function Hg(e,t){var r=""+e;return r.length>=t?r:r+oa(" ",t-r.length)}function Rme(e,t){var r=""+Math.round(e);return r.length>=t?r:oa("0",t-r.length)+r}function Ome(e,t){var r=""+e;return r.length>=t?r:oa("0",t-r.length)+r}var AD=Math.pow(2,32);function Wu(e,t){if(e>AD||e<-AD)return Rme(e,t);var r=Math.round(e);return Ome(r,t)}function zg(e,t){return t=t||0,e.length>=7+t&&(e.charCodeAt(t)|32)===103&&(e.charCodeAt(t+1)|32)===101&&(e.charCodeAt(t+2)|32)===110&&(e.charCodeAt(t+3)|32)===101&&(e.charCodeAt(t+4)|32)===114&&(e.charCodeAt(t+5)|32)===97&&(e.charCodeAt(t+6)|32)===108}var fD=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],j2=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function Pme(e){return e||(e={}),e[0]="General",e[1]="0",e[2]="0.00",e[3]="#,##0",e[4]="#,##0.00",e[9]="0%",e[10]="0.00%",e[11]="0.00E+00",e[12]="# ?/?",e[13]="# ??/??",e[14]="m/d/yy",e[15]="d-mmm-yy",e[16]="d-mmm",e[17]="mmm-yy",e[18]="h:mm AM/PM",e[19]="h:mm:ss AM/PM",e[20]="h:mm",e[21]="h:mm:ss",e[22]="m/d/yy h:mm",e[37]="#,##0 ;(#,##0)",e[38]="#,##0 ;[Red](#,##0)",e[39]="#,##0.00;(#,##0.00)",e[40]="#,##0.00;[Red](#,##0.00)",e[45]="mm:ss",e[46]="[h]:mm:ss",e[47]="mmss.0",e[48]="##0.0E+0",e[49]="@",e[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',e}var vt={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "'},pD={5:37,6:38,7:39,8:40,23:0,24:0,25:0,26:0,27:14,28:14,29:14,30:14,31:14,50:14,51:14,52:14,53:14,54:14,55:14,56:14,57:14,58:14,59:1,60:2,61:3,62:4,67:9,68:10,69:12,70:13,71:14,72:14,73:15,74:16,75:17,76:20,77:21,78:22,79:45,80:46,81:47,82:0},Lme={5:'"$"#,##0_);\\("$"#,##0\\)',63:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',41:'_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'};function $g(e,t,r){for(var a=e<0?-1:1,s=e*a,i=0,l=1,o=0,d=1,u=0,f=0,p=Math.floor(s);u<t&&(p=Math.floor(s),o=p*l+i,f=p*u+d,!(s-p<5e-8));)s=1/(s-p),i=l,l=o,d=u,u=f;if(f>t&&(u>t?(f=d,o=i):(f=u,o=l)),!r)return[0,a*o,f];var h=Math.floor(a*o/f);return[h,a*o-h*f,f]}function kd(e,t,r){if(e>2958465||e<0)return null;var a=e|0,s=Math.floor(86400*(e-a)),i=0,l=[],o={D:a,T:s,u:86400*(e-a)-s,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(o.u)<1e-6&&(o.u=0),t&&t.date1904&&(a+=1462),o.u>.9999&&(o.u=0,++s==86400&&(o.T=s=0,++a,++o.D)),a===60)l=r?[1317,10,29]:[1900,2,29],i=3;else if(a===0)l=r?[1317,8,29]:[1900,1,0],i=6;else{a>60&&--a;var d=new Date(1900,0,1);d.setDate(d.getDate()+a-1),l=[d.getFullYear(),d.getMonth()+1,d.getDate()],i=d.getDay(),a<60&&(i=(i+6)%7),r&&(i=Gme(d,l))}return o.y=l[0],o.m=l[1],o.d=l[2],o.S=s%60,s=Math.floor(s/60),o.M=s%60,s=Math.floor(s/60),o.H=s,o.q=i,o}var NQ=new Date(1899,11,31,0,0,0),Qme=NQ.getTime(),Hme=new Date(1900,2,1,0,0,0);function CQ(e,t){var r=e.getTime();return t?r-=1461*24*60*60*1e3:e>=Hme&&(r+=1440*60*1e3),(r-(Qme+(e.getTimezoneOffset()-NQ.getTimezoneOffset())*6e4))/(1440*60*1e3)}function lE(e){return e.indexOf(".")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function zme(e){return e.indexOf("E")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function $me(e){var t=e<0?12:11,r=lE(e.toFixed(12));return r.length<=t||(r=e.toPrecision(10),r.length<=t)?r:e.toExponential(5)}function Vme(e){var t=lE(e.toFixed(11));return t.length>(e<0?12:11)||t==="0"||t==="-0"?e.toPrecision(6):t}function mp(e){var t=Math.floor(Math.log(Math.abs(e))*Math.LOG10E),r;return t>=-4&&t<=-1?r=e.toPrecision(10+t):Math.abs(t)<=9?r=$me(e):t===10?r=e.toFixed(10).substr(0,12):r=Vme(e),lE(zme(r.toUpperCase()))}function Gd(e,t){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(e|0)===e?e.toString(10):mp(e);case"undefined":return"";case"object":if(e==null)return"";if(e instanceof Date)return ji(14,CQ(e,t&&t.date1904),t)}throw new Error("unsupported value in General format: "+e)}function Gme(e,t){t[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}function Kme(e,t,r,a){var s="",i=0,l=0,o=r.y,d,u=0;switch(e){case 98:o=r.y+543;case 121:switch(t.length){case 1:case 2:d=o%100,u=2;break;default:d=o%1e4,u=4;break}break;case 109:switch(t.length){case 1:case 2:d=r.m,u=t.length;break;case 3:return j2[r.m-1][1];case 5:return j2[r.m-1][0];default:return j2[r.m-1][2]}break;case 100:switch(t.length){case 1:case 2:d=r.d,u=t.length;break;case 3:return fD[r.q][0];default:return fD[r.q][1]}break;case 104:switch(t.length){case 1:case 2:d=1+(r.H+11)%12,u=t.length;break;default:throw"bad hour format: "+t}break;case 72:switch(t.length){case 1:case 2:d=r.H,u=t.length;break;default:throw"bad hour format: "+t}break;case 77:switch(t.length){case 1:case 2:d=r.M,u=t.length;break;default:throw"bad minute format: "+t}break;case 115:if(t!="s"&&t!="ss"&&t!=".0"&&t!=".00"&&t!=".000")throw"bad second format: "+t;return r.u===0&&(t=="s"||t=="ss")?Li(r.S,t.length):(a>=2?l=a===3?1e3:100:l=a===1?10:1,i=Math.round(l*(r.S+r.u)),i>=60*l&&(i=0),t==="s"?i===0?"0":""+i/l:(s=Li(i,2+a),t==="ss"?s.substr(0,2):"."+s.substr(2,t.length-1)));case 90:switch(t){case"[h]":case"[hh]":d=r.D*24+r.H;break;case"[m]":case"[mm]":d=(r.D*24+r.H)*60+r.M;break;case"[s]":case"[ss]":d=((r.D*24+r.H)*60+r.M)*60+Math.round(r.S+r.u);break;default:throw"bad abstime format: "+t}u=t.length===3?1:2;break;case 101:d=o,u=1;break}var f=u>0?Li(d,u):"";return f}function wc(e){var t=3;if(e.length<=t)return e;for(var r=e.length%t,a=e.substr(0,r);r!=e.length;r+=t)a+=(a.length>0?",":"")+e.substr(r,t);return a}var kQ=/%/g;function qme(e,t,r){var a=t.replace(kQ,""),s=t.length-a.length;return uo(e,a,r*Math.pow(10,2*s))+oa("%",s)}function Wme(e,t,r){for(var a=t.length-1;t.charCodeAt(a-1)===44;)--a;return uo(e,t.substr(0,a),r/Math.pow(10,3*(t.length-a)))}function jQ(e,t){var r,a=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(t==0)return"0.0E+0";if(t<0)return"-"+jQ(e,-t);var s=e.indexOf(".");s===-1&&(s=e.indexOf("E"));var i=Math.floor(Math.log(t)*Math.LOG10E)%s;if(i<0&&(i+=s),r=(t/Math.pow(10,i)).toPrecision(a+1+(s+i)%s),r.indexOf("e")===-1){var l=Math.floor(Math.log(t)*Math.LOG10E);for(r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(l-r.length+i):r+="E+"+(l-i);r.substr(0,2)==="0.";)r=r.charAt(0)+r.substr(2,s)+"."+r.substr(2+s),r=r.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,d,u,f){return d+u+f.substr(0,(s+i)%s)+"."+f.substr(i)+"E"})}else r=t.toExponential(a);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}var EQ=/# (\?+)( ?)\/( ?)(\d+)/;function Yme(e,t,r){var a=parseInt(e[4],10),s=Math.round(t*a),i=Math.floor(s/a),l=s-i*a,o=a;return r+(i===0?"":""+i)+" "+(l===0?oa(" ",e[1].length+1+e[4].length):iE(l,e[1].length)+e[2]+"/"+e[3]+Li(o,e[4].length))}function Xme(e,t,r){return r+(t===0?"":""+t)+oa(" ",e[1].length+2+e[4].length)}var SQ=/^#*0*\.([0#]+)/,BQ=/\).*[0#]/,_Q=/\(###\) ###\\?-####/;function qn(e){for(var t="",r,a=0;a!=e.length;++a)switch(r=e.charCodeAt(a)){case 35:break;case 63:t+=" ";break;case 48:t+="0";break;default:t+=String.fromCharCode(r)}return t}function xD(e,t){var r=Math.pow(10,t);return""+Math.round(e*r)/r}function hD(e,t){var r=e-Math.floor(e),a=Math.pow(10,t);return t<(""+Math.round(r*a)).length?0:Math.round(r*a)}function Jme(e,t){return t<(""+Math.round((e-Math.floor(e))*Math.pow(10,t))).length?1:0}function Zme(e){return e<2147483647&&e>-2147483648?""+(e>=0?e|0:e-1|0):""+Math.floor(e)}function oi(e,t,r){if(e.charCodeAt(0)===40&&!t.match(BQ)){var a=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?oi("n",a,r):"("+oi("n",a,-r)+")"}if(t.charCodeAt(t.length-1)===44)return Wme(e,t,r);if(t.indexOf("%")!==-1)return qme(e,t,r);if(t.indexOf("E")!==-1)return jQ(t,r);if(t.charCodeAt(0)===36)return"$"+oi(e,t.substr(t.charAt(1)==" "?2:1),r);var s,i,l,o,d=Math.abs(r),u=r<0?"-":"";if(t.match(/^00+$/))return u+Wu(d,t.length);if(t.match(/^[#?]+$/))return s=Wu(r,0),s==="0"&&(s=""),s.length>t.length?s:qn(t.substr(0,t.length-s.length))+s;if(i=t.match(EQ))return Yme(i,d,u);if(t.match(/^#+0+$/))return u+Wu(d,t.length-t.indexOf("0"));if(i=t.match(SQ))return s=xD(r,i[1].length).replace(/^([^\.]+)$/,"$1."+qn(i[1])).replace(/\.$/,"."+qn(i[1])).replace(/\.(\d*)$/,function(b,v){return"."+v+oa("0",qn(i[1]).length-v.length)}),t.indexOf("0.")!==-1?s:s.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),i=t.match(/^(0*)\.(#*)$/))return u+xD(d,i[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=t.match(/^#{1,3},##0(\.?)$/))return u+wc(Wu(d,0));if(i=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+oi(e,t,-r):wc(""+(Math.floor(r)+Jme(r,i[1].length)))+"."+Li(hD(r,i[1].length),i[1].length);if(i=t.match(/^#,#*,#0/))return oi(e,t.replace(/^#,#*,/,""),r);if(i=t.match(/^([0#]+)(\\?-([0#]+))+$/))return s=yA(oi(e,t.replace(/[\\-]/g,""),r)),l=0,yA(yA(t.replace(/\\/g,"")).replace(/[0#]/g,function(b){return l<s.length?s.charAt(l++):b==="0"?"0":""}));if(t.match(_Q))return s=oi(e,"##########",r),"("+s.substr(0,3)+") "+s.substr(3,3)+"-"+s.substr(6);var f="";if(i=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return l=Math.min(i[4].length,7),o=$g(d,Math.pow(10,l)-1,!1),s=""+u,f=uo("n",i[1],o[1]),f.charAt(f.length-1)==" "&&(f=f.substr(0,f.length-1)+"0"),s+=f+i[2]+"/"+i[3],f=Hg(o[2],l),f.length<i[4].length&&(f=qn(i[4].substr(i[4].length-f.length))+f),s+=f,s;if(i=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return l=Math.min(Math.max(i[1].length,i[4].length),7),o=$g(d,Math.pow(10,l)-1,!0),u+(o[0]||(o[1]?"":"0"))+" "+(o[1]?iE(o[1],l)+i[2]+"/"+i[3]+Hg(o[2],l):oa(" ",2*l+1+i[2].length+i[3].length));if(i=t.match(/^[#0?]+$/))return s=Wu(r,0),t.length<=s.length?s:qn(t.substr(0,t.length-s.length))+s;if(i=t.match(/^([#0?]+)\.([#0]+)$/)){s=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),l=s.indexOf(".");var p=t.indexOf(".")-l,h=t.length-s.length-p;return qn(t.substr(0,p)+s+t.substr(t.length-h))}if(i=t.match(/^00,000\.([#0]*0)$/))return l=hD(r,i[1].length),r<0?"-"+oi(e,t,-r):wc(Zme(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(b){return"00,"+(b.length<3?Li(0,3-b.length):"")+b})+"."+Li(l,i[1].length);switch(t){case"###,##0.00":return oi(e,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var m=wc(Wu(d,0));return m!=="0"?u+m:"";case"###,###.00":return oi(e,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return oi(e,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+t+"|")}function ege(e,t,r){for(var a=t.length-1;t.charCodeAt(a-1)===44;)--a;return uo(e,t.substr(0,a),r/Math.pow(10,3*(t.length-a)))}function tge(e,t,r){var a=t.replace(kQ,""),s=t.length-a.length;return uo(e,a,r*Math.pow(10,2*s))+oa("%",s)}function TQ(e,t){var r,a=e.indexOf("E")-e.indexOf(".")-1;if(e.match(/^#+0.0E\+0$/)){if(t==0)return"0.0E+0";if(t<0)return"-"+TQ(e,-t);var s=e.indexOf(".");s===-1&&(s=e.indexOf("E"));var i=Math.floor(Math.log(t)*Math.LOG10E)%s;if(i<0&&(i+=s),r=(t/Math.pow(10,i)).toPrecision(a+1+(s+i)%s),!r.match(/[Ee]/)){var l=Math.floor(Math.log(t)*Math.LOG10E);r.indexOf(".")===-1?r=r.charAt(0)+"."+r.substr(1)+"E+"+(l-r.length+i):r+="E+"+(l-i),r=r.replace(/\+-/,"-")}r=r.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(o,d,u,f){return d+u+f.substr(0,(s+i)%s)+"."+f.substr(i)+"E"})}else r=t.toExponential(a);return e.match(/E\+00$/)&&r.match(/e[+-]\d$/)&&(r=r.substr(0,r.length-1)+"0"+r.charAt(r.length-1)),e.match(/E\-/)&&r.match(/e\+/)&&(r=r.replace(/e\+/,"e")),r.replace("e","E")}function Al(e,t,r){if(e.charCodeAt(0)===40&&!t.match(BQ)){var a=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?Al("n",a,r):"("+Al("n",a,-r)+")"}if(t.charCodeAt(t.length-1)===44)return ege(e,t,r);if(t.indexOf("%")!==-1)return tge(e,t,r);if(t.indexOf("E")!==-1)return TQ(t,r);if(t.charCodeAt(0)===36)return"$"+Al(e,t.substr(t.charAt(1)==" "?2:1),r);var s,i,l,o,d=Math.abs(r),u=r<0?"-":"";if(t.match(/^00+$/))return u+Li(d,t.length);if(t.match(/^[#?]+$/))return s=""+r,r===0&&(s=""),s.length>t.length?s:qn(t.substr(0,t.length-s.length))+s;if(i=t.match(EQ))return Xme(i,d,u);if(t.match(/^#+0+$/))return u+Li(d,t.length-t.indexOf("0"));if(i=t.match(SQ))return s=(""+r).replace(/^([^\.]+)$/,"$1."+qn(i[1])).replace(/\.$/,"."+qn(i[1])),s=s.replace(/\.(\d*)$/,function(b,v){return"."+v+oa("0",qn(i[1]).length-v.length)}),t.indexOf("0.")!==-1?s:s.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),i=t.match(/^(0*)\.(#*)$/))return u+(""+d).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,i[1].length?"0.":".");if(i=t.match(/^#{1,3},##0(\.?)$/))return u+wc(""+d);if(i=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+Al(e,t,-r):wc(""+r)+"."+oa("0",i[1].length);if(i=t.match(/^#,#*,#0/))return Al(e,t.replace(/^#,#*,/,""),r);if(i=t.match(/^([0#]+)(\\?-([0#]+))+$/))return s=yA(Al(e,t.replace(/[\\-]/g,""),r)),l=0,yA(yA(t.replace(/\\/g,"")).replace(/[0#]/g,function(b){return l<s.length?s.charAt(l++):b==="0"?"0":""}));if(t.match(_Q))return s=Al(e,"##########",r),"("+s.substr(0,3)+") "+s.substr(3,3)+"-"+s.substr(6);var f="";if(i=t.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return l=Math.min(i[4].length,7),o=$g(d,Math.pow(10,l)-1,!1),s=""+u,f=uo("n",i[1],o[1]),f.charAt(f.length-1)==" "&&(f=f.substr(0,f.length-1)+"0"),s+=f+i[2]+"/"+i[3],f=Hg(o[2],l),f.length<i[4].length&&(f=qn(i[4].substr(i[4].length-f.length))+f),s+=f,s;if(i=t.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return l=Math.min(Math.max(i[1].length,i[4].length),7),o=$g(d,Math.pow(10,l)-1,!0),u+(o[0]||(o[1]?"":"0"))+" "+(o[1]?iE(o[1],l)+i[2]+"/"+i[3]+Hg(o[2],l):oa(" ",2*l+1+i[2].length+i[3].length));if(i=t.match(/^[#0?]+$/))return s=""+r,t.length<=s.length?s:qn(t.substr(0,t.length-s.length))+s;if(i=t.match(/^([#0]+)\.([#0]+)$/)){s=""+r.toFixed(Math.min(i[2].length,10)).replace(/([^0])0+$/,"$1"),l=s.indexOf(".");var p=t.indexOf(".")-l,h=t.length-s.length-p;return qn(t.substr(0,p)+s+t.substr(t.length-h))}if(i=t.match(/^00,000\.([#0]*0)$/))return r<0?"-"+Al(e,t,-r):wc(""+r).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(b){return"00,"+(b.length<3?Li(0,3-b.length):"")+b})+"."+Li(0,i[1].length);switch(t){case"###,###":case"##,###":case"#,###":var m=wc(""+d);return m!=="0"?u+m:"";default:if(t.match(/\.[0#?]*$/))return Al(e,t.slice(0,t.lastIndexOf(".")),r)+qn(t.slice(t.lastIndexOf(".")))}throw new Error("unsupported format |"+t+"|")}function uo(e,t,r){return(r|0)===r?Al(e,t,r):oi(e,t,r)}function rge(e){for(var t=[],r=!1,a=0,s=0;a<e.length;++a)switch(e.charCodeAt(a)){case 34:r=!r;break;case 95:case 42:case 92:++a;break;case 59:t[t.length]=e.substr(s,a-s),s=a+1}if(t[t.length]=e.substr(s),r===!0)throw new Error("Format |"+e+"| unterminated string ");return t}var IQ=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function r0(e){for(var t=0,r="",a="";t<e.length;)switch(r=e.charAt(t)){case"G":zg(e,t)&&(t+=6),t++;break;case'"':for(;e.charCodeAt(++t)!==34&&t<e.length;);++t;break;case"\\":t+=2;break;case"_":t+=2;break;case"@":++t;break;case"B":case"b":if(e.charAt(t+1)==="1"||e.charAt(t+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":case"上":if(e.substr(t,3).toUpperCase()==="A/P"||e.substr(t,5).toUpperCase()==="AM/PM"||e.substr(t,5).toUpperCase()==="上午/下午")return!0;++t;break;case"[":for(a=r;e.charAt(t++)!=="]"&&t<e.length;)a+=e.charAt(t);if(a.match(IQ))return!0;break;case".":case"0":case"#":for(;t<e.length&&("0#?.,E+-%".indexOf(r=e.charAt(++t))>-1||r=="\\"&&e.charAt(t+1)=="-"&&"0#".indexOf(e.charAt(t+2))>-1););break;case"?":for(;e.charAt(++t)===r;);break;case"*":++t,(e.charAt(t)==" "||e.charAt(t)=="*")&&++t;break;case"(":case")":++t;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;t<e.length&&"0123456789".indexOf(e.charAt(++t))>-1;);break;case" ":++t;break;default:++t;break}return!1}function age(e,t,r,a){for(var s=[],i="",l=0,o="",d="t",u,f,p,h="H";l<e.length;)switch(o=e.charAt(l)){case"G":if(!zg(e,l))throw new Error("unrecognized character "+o+" in "+e);s[s.length]={t:"G",v:"General"},l+=7;break;case'"':for(i="";(p=e.charCodeAt(++l))!==34&&l<e.length;)i+=String.fromCharCode(p);s[s.length]={t:"t",v:i},++l;break;case"\\":var m=e.charAt(++l),b=m==="("||m===")"?m:"t";s[s.length]={t:b,v:m},++l;break;case"_":s[s.length]={t:"t",v:" "},l+=2;break;case"@":s[s.length]={t:"T",v:t},++l;break;case"B":case"b":if(e.charAt(l+1)==="1"||e.charAt(l+1)==="2"){if(u==null&&(u=kd(t,r,e.charAt(l+1)==="2"),u==null))return"";s[s.length]={t:"X",v:e.substr(l,2)},d=o,l+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":o=o.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(t<0||u==null&&(u=kd(t,r),u==null))return"";for(i=o;++l<e.length&&e.charAt(l).toLowerCase()===o;)i+=o;o==="m"&&d.toLowerCase()==="h"&&(o="M"),o==="h"&&(o=h),s[s.length]={t:o,v:i},d=o;break;case"A":case"a":case"上":var v={t:o,v:o};if(u==null&&(u=kd(t,r)),e.substr(l,3).toUpperCase()==="A/P"?(u!=null&&(v.v=u.H>=12?"P":"A"),v.t="T",h="h",l+=3):e.substr(l,5).toUpperCase()==="AM/PM"?(u!=null&&(v.v=u.H>=12?"PM":"AM"),v.t="T",l+=5,h="h"):e.substr(l,5).toUpperCase()==="上午/下午"?(u!=null&&(v.v=u.H>=12?"下午":"上午"),v.t="T",l+=5,h="h"):(v.t="t",++l),u==null&&v.t==="T")return"";s[s.length]=v,d=o;break;case"[":for(i=o;e.charAt(l++)!=="]"&&l<e.length;)i+=e.charAt(l);if(i.slice(-1)!=="]")throw'unterminated "[" block: |'+i+"|";if(i.match(IQ)){if(u==null&&(u=kd(t,r),u==null))return"";s[s.length]={t:"Z",v:i.toLowerCase()},d=i.charAt(1)}else i.indexOf("$")>-1&&(i=(i.match(/\$([^-\[\]]*)/)||[])[1]||"$",r0(e)||(s[s.length]={t:"t",v:i}));break;case".":if(u!=null){for(i=o;++l<e.length&&(o=e.charAt(l))==="0";)i+=o;s[s.length]={t:"s",v:i};break}case"0":case"#":for(i=o;++l<e.length&&"0#?.,E+-%".indexOf(o=e.charAt(l))>-1;)i+=o;s[s.length]={t:"n",v:i};break;case"?":for(i=o;e.charAt(++l)===o;)i+=o;s[s.length]={t:o,v:i},d=o;break;case"*":++l,(e.charAt(l)==" "||e.charAt(l)=="*")&&++l;break;case"(":case")":s[s.length]={t:a===1?"t":o,v:o},++l;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(i=o;l<e.length&&"0123456789".indexOf(e.charAt(++l))>-1;)i+=e.charAt(l);s[s.length]={t:"D",v:i};break;case" ":s[s.length]={t:o,v:o},++l;break;case"$":s[s.length]={t:"t",v:"$"},++l;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(o)===-1)throw new Error("unrecognized character "+o+" in "+e);s[s.length]={t:"t",v:o},++l;break}var y=0,j=0,_;for(l=s.length-1,d="t";l>=0;--l)switch(s[l].t){case"h":case"H":s[l].t=h,d="h",y<1&&(y=1);break;case"s":(_=s[l].v.match(/\.0+$/))&&(j=Math.max(j,_[0].length-1)),y<3&&(y=3);case"d":case"y":case"M":case"e":d=s[l].t;break;case"m":d==="s"&&(s[l].t="M",y<2&&(y=2));break;case"X":break;case"Z":y<1&&s[l].v.match(/[Hh]/)&&(y=1),y<2&&s[l].v.match(/[Mm]/)&&(y=2),y<3&&s[l].v.match(/[Ss]/)&&(y=3)}switch(y){case 0:break;case 1:u.u>=.5&&(u.u=0,++u.S),u.S>=60&&(u.S=0,++u.M),u.M>=60&&(u.M=0,++u.H);break;case 2:u.u>=.5&&(u.u=0,++u.S),u.S>=60&&(u.S=0,++u.M);break}var N="",E;for(l=0;l<s.length;++l)switch(s[l].t){case"t":case"T":case" ":case"D":break;case"X":s[l].v="",s[l].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":s[l].v=Kme(s[l].t.charCodeAt(0),s[l].v,u,j),s[l].t="t";break;case"n":case"?":for(E=l+1;s[E]!=null&&((o=s[E].t)==="?"||o==="D"||(o===" "||o==="t")&&s[E+1]!=null&&(s[E+1].t==="?"||s[E+1].t==="t"&&s[E+1].v==="/")||s[l].t==="("&&(o===" "||o==="n"||o===")")||o==="t"&&(s[E].v==="/"||s[E].v===" "&&s[E+1]!=null&&s[E+1].t=="?"));)s[l].v+=s[E].v,s[E]={v:"",t:";"},++E;N+=s[l].v,l=E-1;break;case"G":s[l].t="t",s[l].v=Gd(t,r);break}var T="",B,F;if(N.length>0){N.charCodeAt(0)==40?(B=t<0&&N.charCodeAt(0)===45?-t:t,F=uo("n",N,B)):(B=t<0&&a>1?-t:t,F=uo("n",N,B),B<0&&s[0]&&s[0].t=="t"&&(F=F.substr(1),s[0].v="-"+s[0].v)),E=F.length-1;var R=s.length;for(l=0;l<s.length;++l)if(s[l]!=null&&s[l].t!="t"&&s[l].v.indexOf(".")>-1){R=l;break}var U=s.length;if(R===s.length&&F.indexOf("E")===-1){for(l=s.length-1;l>=0;--l)s[l]==null||"n?".indexOf(s[l].t)===-1||(E>=s[l].v.length-1?(E-=s[l].v.length,s[l].v=F.substr(E+1,s[l].v.length)):E<0?s[l].v="":(s[l].v=F.substr(0,E+1),E=-1),s[l].t="t",U=l);E>=0&&U<s.length&&(s[U].v=F.substr(0,E+1)+s[U].v)}else if(R!==s.length&&F.indexOf("E")===-1){for(E=F.indexOf(".")-1,l=R;l>=0;--l)if(!(s[l]==null||"n?".indexOf(s[l].t)===-1)){for(f=s[l].v.indexOf(".")>-1&&l===R?s[l].v.indexOf(".")-1:s[l].v.length-1,T=s[l].v.substr(f+1);f>=0;--f)E>=0&&(s[l].v.charAt(f)==="0"||s[l].v.charAt(f)==="#")&&(T=F.charAt(E--)+T);s[l].v=T,s[l].t="t",U=l}for(E>=0&&U<s.length&&(s[U].v=F.substr(0,E+1)+s[U].v),E=F.indexOf(".")+1,l=R;l<s.length;++l)if(!(s[l]==null||"n?(".indexOf(s[l].t)===-1&&l!==R)){for(f=s[l].v.indexOf(".")>-1&&l===R?s[l].v.indexOf(".")+1:0,T=s[l].v.substr(0,f);f<s[l].v.length;++f)E<F.length&&(T+=F.charAt(E++));s[l].v=T,s[l].t="t",U=l}}}for(l=0;l<s.length;++l)s[l]!=null&&"n?".indexOf(s[l].t)>-1&&(B=a>1&&t<0&&l>0&&s[l-1].v==="-"?-t:t,s[l].v=uo(s[l].t,s[l].v,B),s[l].t="t");var D="";for(l=0;l!==s.length;++l)s[l]!=null&&(D+=s[l].v);return D}var mD=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function gD(e,t){if(t==null)return!1;var r=parseFloat(t[2]);switch(t[1]){case"=":if(e==r)return!0;break;case">":if(e>r)return!0;break;case"<":if(e<r)return!0;break;case"<>":if(e!=r)return!0;break;case">=":if(e>=r)return!0;break;case"<=":if(e<=r)return!0;break}return!1}function nge(e,t){var r=rge(e),a=r.length,s=r[a-1].indexOf("@");if(a<4&&s>-1&&--a,r.length>4)throw new Error("cannot find right format for |"+r.join("|")+"|");if(typeof t!="number")return[4,r.length===4||s>-1?r[r.length-1]:"@"];switch(r.length){case 1:r=s>-1?["General","General","General",r[0]]:[r[0],r[0],r[0],"@"];break;case 2:r=s>-1?[r[0],r[0],r[0],r[1]]:[r[0],r[1],r[0],"@"];break;case 3:r=s>-1?[r[0],r[1],r[0],r[2]]:[r[0],r[1],r[2],"@"];break}var i=t>0?r[0]:t<0?r[1]:r[2];if(r[0].indexOf("[")===-1&&r[1].indexOf("[")===-1)return[a,i];if(r[0].match(/\[[=<>]/)!=null||r[1].match(/\[[=<>]/)!=null){var l=r[0].match(mD),o=r[1].match(mD);return gD(t,l)?[a,r[0]]:gD(t,o)?[a,r[1]]:[a,r[l!=null&&o!=null?2:1]]}return[a,i]}function ji(e,t,r){r==null&&(r={});var a="";switch(typeof e){case"string":e=="m/d/yy"&&r.dateNF?a=r.dateNF:a=e;break;case"number":e==14&&r.dateNF?a=r.dateNF:a=(r.table!=null?r.table:vt)[e],a==null&&(a=r.table&&r.table[pD[e]]||vt[pD[e]]),a==null&&(a=Lme[e]||"General");break}if(zg(a,0))return Gd(t,r);t instanceof Date&&(t=CQ(t,r.date1904));var s=nge(a,t);if(zg(s[1]))return Gd(t,r);if(t===!0)t="TRUE";else if(t===!1)t="FALSE";else if(t===""||t==null)return"";return age(s[1],t,r,s[0])}function Ao(e,t){if(typeof t!="number"){t=+t||-1;for(var r=0;r<392;++r){if(vt[r]==null){t<0&&(t=r);continue}if(vt[r]==e){t=r;break}}t<0&&(t=391)}return vt[t]=e,t}function cv(e){for(var t=0;t!=392;++t)e[t]!==void 0&&Ao(e[t],t)}function a0(){vt=Pme()}var sge={5:'"$"#,##0_);\\("$"#,##0\\)',6:'"$"#,##0_);[Red]\\("$"#,##0\\)',7:'"$"#,##0.00_);\\("$"#,##0.00\\)',8:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',23:"General",24:"General",25:"General",26:"General",27:"m/d/yy",28:"m/d/yy",29:"m/d/yy",30:"m/d/yy",31:"m/d/yy",32:"h:mm:ss",33:"h:mm:ss",34:"h:mm:ss",35:"h:mm:ss",36:"m/d/yy",41:'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)',42:'_("$"* #,##0_);_("$"* (#,##0);_("$"* "-"_);_(@_)',43:'_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)',44:'_("$"* #,##0.00_);_("$"* (#,##0.00);_("$"* "-"??_);_(@_)',50:"m/d/yy",51:"m/d/yy",52:"m/d/yy",53:"m/d/yy",54:"m/d/yy",55:"m/d/yy",56:"m/d/yy",57:"m/d/yy",58:"m/d/yy",59:"0",60:"0.00",61:"#,##0",62:"#,##0.00",63:'"$"#,##0_);\\("$"#,##0\\)',64:'"$"#,##0_);[Red]\\("$"#,##0\\)',65:'"$"#,##0.00_);\\("$"#,##0.00\\)',66:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',67:"0%",68:"0.00%",69:"# ?/?",70:"# ??/??",71:"m/d/yy",72:"m/d/yy",73:"d-mmm-yy",74:"d-mmm",75:"mmm-yy",76:"h:mm",77:"h:mm:ss",78:"m/d/yy h:mm",79:"mm:ss",80:"[h]:mm:ss",81:"mmss.0"},FQ=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function ige(e){var t=typeof e=="number"?vt[e]:e;return t=t.replace(FQ,"(\\d+)"),new RegExp("^"+t+"$")}function lge(e,t,r){var a=-1,s=-1,i=-1,l=-1,o=-1,d=-1;(t.match(FQ)||[]).forEach(function(p,h){var m=parseInt(r[h+1],10);switch(p.toLowerCase().charAt(0)){case"y":a=m;break;case"d":i=m;break;case"h":l=m;break;case"s":d=m;break;case"m":l>=0?o=m:s=m;break}}),d>=0&&o==-1&&s>=0&&(o=s,s=-1);var u=(""+(a>=0?a:new Date().getFullYear())).slice(-4)+"-"+("00"+(s>=1?s:1)).slice(-2)+"-"+("00"+(i>=1?i:1)).slice(-2);u.length==7&&(u="0"+u),u.length==8&&(u="20"+u);var f=("00"+(l>=0?l:0)).slice(-2)+":"+("00"+(o>=0?o:0)).slice(-2)+":"+("00"+(d>=0?d:0)).slice(-2);return l==-1&&o==-1&&d==-1?u:a==-1&&s==-1&&i==-1?f:u+"T"+f}var oge=(function(){var e={};e.version="1.2.0";function t(){for(var F=0,R=new Array(256),U=0;U!=256;++U)F=U,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,F=F&1?-306674912^F>>>1:F>>>1,R[U]=F;return typeof Int32Array<"u"?new Int32Array(R):R}var r=t();function a(F){var R=0,U=0,D=0,L=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(D=0;D!=256;++D)L[D]=F[D];for(D=0;D!=256;++D)for(U=F[D],R=256+D;R<4096;R+=256)U=L[R]=U>>>8^F[U&255];var P=[];for(D=1;D!=16;++D)P[D-1]=typeof Int32Array<"u"?L.subarray(D*256,D*256+256):L.slice(D*256,D*256+256);return P}var s=a(r),i=s[0],l=s[1],o=s[2],d=s[3],u=s[4],f=s[5],p=s[6],h=s[7],m=s[8],b=s[9],v=s[10],y=s[11],j=s[12],_=s[13],N=s[14];function E(F,R){for(var U=R^-1,D=0,L=F.length;D<L;)U=U>>>8^r[(U^F.charCodeAt(D++))&255];return~U}function T(F,R){for(var U=R^-1,D=F.length-15,L=0;L<D;)U=N[F[L++]^U&255]^_[F[L++]^U>>8&255]^j[F[L++]^U>>16&255]^y[F[L++]^U>>>24]^v[F[L++]]^b[F[L++]]^m[F[L++]]^h[F[L++]]^p[F[L++]]^f[F[L++]]^u[F[L++]]^d[F[L++]]^o[F[L++]]^l[F[L++]]^i[F[L++]]^r[F[L++]];for(D+=15;L<D;)U=U>>>8^r[(U^F[L++])&255];return~U}function B(F,R){for(var U=R^-1,D=0,L=F.length,P=0,G=0;D<L;)P=F.charCodeAt(D++),P<128?U=U>>>8^r[(U^P)&255]:P<2048?(U=U>>>8^r[(U^(192|P>>6&31))&255],U=U>>>8^r[(U^(128|P&63))&255]):P>=55296&&P<57344?(P=(P&1023)+64,G=F.charCodeAt(D++)&1023,U=U>>>8^r[(U^(240|P>>8&7))&255],U=U>>>8^r[(U^(128|P>>2&63))&255],U=U>>>8^r[(U^(128|G>>6&15|(P&3)<<4))&255],U=U>>>8^r[(U^(128|G&63))&255]):(U=U>>>8^r[(U^(224|P>>12&15))&255],U=U>>>8^r[(U^(128|P>>6&63))&255],U=U>>>8^r[(U^(128|P&63))&255]);return~U}return e.table=r,e.bstr=E,e.buf=T,e.str=B,e})(),xt=(function(){var t={};t.version="1.2.1";function r(te,de){for(var oe=te.split("/"),ce=de.split("/"),ue=0,Ae=0,Ce=Math.min(oe.length,ce.length);ue<Ce;++ue){if(Ae=oe[ue].length-ce[ue].length)return Ae;if(oe[ue]!=ce[ue])return oe[ue]<ce[ue]?-1:1}return oe.length-ce.length}function a(te){if(te.charAt(te.length-1)=="/")return te.slice(0,-1).indexOf("/")===-1?te:a(te.slice(0,-1));var de=te.lastIndexOf("/");return de===-1?te:te.slice(0,de+1)}function s(te){if(te.charAt(te.length-1)=="/")return s(te.slice(0,-1));var de=te.lastIndexOf("/");return de===-1?te:te.slice(de+1)}function i(te,de){typeof de=="string"&&(de=new Date(de));var oe=de.getHours();oe=oe<<6|de.getMinutes(),oe=oe<<5|de.getSeconds()>>>1,te.write_shift(2,oe);var ce=de.getFullYear()-1980;ce=ce<<4|de.getMonth()+1,ce=ce<<5|de.getDate(),te.write_shift(2,ce)}function l(te){var de=te.read_shift(2)&65535,oe=te.read_shift(2)&65535,ce=new Date,ue=oe&31;oe>>>=5;var Ae=oe&15;oe>>>=4,ce.setMilliseconds(0),ce.setFullYear(oe+1980),ce.setMonth(Ae-1),ce.setDate(ue);var Ce=de&31;de>>>=5;var Re=de&63;return de>>>=6,ce.setHours(de),ce.setMinutes(Re),ce.setSeconds(Ce<<1),ce}function o(te){vn(te,0);for(var de={},oe=0;te.l<=te.length-4;){var ce=te.read_shift(2),ue=te.read_shift(2),Ae=te.l+ue,Ce={};switch(ce){case 21589:oe=te.read_shift(1),oe&1&&(Ce.mtime=te.read_shift(4)),ue>5&&(oe&2&&(Ce.atime=te.read_shift(4)),oe&4&&(Ce.ctime=te.read_shift(4))),Ce.mtime&&(Ce.mt=new Date(Ce.mtime*1e3));break}te.l=Ae,de[ce]=Ce}return de}var d;function u(){return d||(d={})}function f(te,de){if(te[0]==80&&te[1]==75)return ks(te,de);if((te[0]|32)==109&&(te[1]|32)==105)return Ve(te,de);if(te.length<512)throw new Error("CFB file size "+te.length+" < 512");var oe=3,ce=512,ue=0,Ae=0,Ce=0,Re=0,ke=0,Se=[],Be=te.slice(0,512);vn(Be,0);var ze=p(Be);switch(oe=ze[0],oe){case 3:ce=512;break;case 4:ce=4096;break;case 0:if(ze[1]==0)return ks(te,de);default:throw new Error("Major Version: Expected 3 or 4 saw "+oe)}ce!==512&&(Be=te.slice(0,ce),vn(Be,28));var Ke=te.slice(0,ce);h(Be,oe);var Ze=Be.read_shift(4,"i");if(oe===3&&Ze!==0)throw new Error("# Directory Sectors: Expected 0 saw "+Ze);Be.l+=4,Ce=Be.read_shift(4,"i"),Be.l+=4,Be.chk("00100000","Mini Stream Cutoff Size: "),Re=Be.read_shift(4,"i"),ue=Be.read_shift(4,"i"),ke=Be.read_shift(4,"i"),Ae=Be.read_shift(4,"i");for(var $e=-1,Je=0;Je<109&&($e=Be.read_shift(4,"i"),!($e<0));++Je)Se[Je]=$e;var dt=m(te,ce);y(ke,Ae,dt,ce,Se);var kr=_(dt,Ce,Se,ce);kr[Ce].name="!Directory",ue>0&&Re!==G&&(kr[Re].name="!MiniFAT"),kr[Se[0]].name="!FAT",kr.fat_addrs=Se,kr.ssz=ce;var jr={},Qr=[],qs=[],Yc=[];N(Ce,kr,dt,Qr,ue,jr,qs,Re),b(qs,Yc,Qr),Qr.shift();var Qo={FileIndex:qs,FullPaths:Yc};return de&&de.raw&&(Qo.raw={header:Ke,sectors:dt}),Qo}function p(te){if(te[te.l]==80&&te[te.l+1]==75)return[0,0];te.chk(Q,"Header Signature: "),te.l+=16;var de=te.read_shift(2,"u");return[te.read_shift(2,"u"),de]}function h(te,de){var oe=9;switch(te.l+=2,oe=te.read_shift(2)){case 9:if(de!=3)throw new Error("Sector Shift: Expected 9 saw "+oe);break;case 12:if(de!=4)throw new Error("Sector Shift: Expected 12 saw "+oe);break;default:throw new Error("Sector Shift: Expected 9 or 12 saw "+oe)}te.chk("0600","Mini Sector Shift: "),te.chk("000000000000","Reserved: ")}function m(te,de){for(var oe=Math.ceil(te.length/de)-1,ce=[],ue=1;ue<oe;++ue)ce[ue-1]=te.slice(ue*de,(ue+1)*de);return ce[oe-1]=te.slice(oe*de),ce}function b(te,de,oe){for(var ce=0,ue=0,Ae=0,Ce=0,Re=0,ke=oe.length,Se=[],Be=[];ce<ke;++ce)Se[ce]=Be[ce]=ce,de[ce]=oe[ce];for(;Re<Be.length;++Re)ce=Be[Re],ue=te[ce].L,Ae=te[ce].R,Ce=te[ce].C,Se[ce]===ce&&(ue!==-1&&Se[ue]!==ue&&(Se[ce]=Se[ue]),Ae!==-1&&Se[Ae]!==Ae&&(Se[ce]=Se[Ae])),Ce!==-1&&(Se[Ce]=ce),ue!==-1&&ce!=Se[ce]&&(Se[ue]=Se[ce],Be.lastIndexOf(ue)<Re&&Be.push(ue)),Ae!==-1&&ce!=Se[ce]&&(Se[Ae]=Se[ce],Be.lastIndexOf(Ae)<Re&&Be.push(Ae));for(ce=1;ce<ke;++ce)Se[ce]===ce&&(Ae!==-1&&Se[Ae]!==Ae?Se[ce]=Se[Ae]:ue!==-1&&Se[ue]!==ue&&(Se[ce]=Se[ue]));for(ce=1;ce<ke;++ce)if(te[ce].type!==0){if(Re=ce,Re!=Se[Re])do Re=Se[Re],de[ce]=de[Re]+"/"+de[ce];while(Re!==0&&Se[Re]!==-1&&Re!=Se[Re]);Se[ce]=-1}for(de[0]+="/",ce=1;ce<ke;++ce)te[ce].type!==2&&(de[ce]+="/")}function v(te,de,oe){for(var ce=te.start,ue=te.size,Ae=[],Ce=ce;oe&&ue>0&&Ce>=0;)Ae.push(de.slice(Ce*P,Ce*P+P)),ue-=P,Ce=bd(oe,Ce*4);return Ae.length===0?Oe(0):en(Ae).slice(0,te.size)}function y(te,de,oe,ce,ue){var Ae=G;if(te===G){if(de!==0)throw new Error("DIFAT chain shorter than expected")}else if(te!==-1){var Ce=oe[te],Re=(ce>>>2)-1;if(!Ce)return;for(var ke=0;ke<Re&&(Ae=bd(Ce,ke*4))!==G;++ke)ue.push(Ae);y(bd(Ce,ce-4),de-1,oe,ce,ue)}}function j(te,de,oe,ce,ue){var Ae=[],Ce=[];ue||(ue=[]);var Re=ce-1,ke=0,Se=0;for(ke=de;ke>=0;){ue[ke]=!0,Ae[Ae.length]=ke,Ce.push(te[ke]);var Be=oe[Math.floor(ke*4/ce)];if(Se=ke*4&Re,ce<4+Se)throw new Error("FAT boundary crossed: "+ke+" 4 "+ce);if(!te[Be])break;ke=bd(te[Be],Se)}return{nodes:Ae,data:_D([Ce])}}function _(te,de,oe,ce){var ue=te.length,Ae=[],Ce=[],Re=[],ke=[],Se=ce-1,Be=0,ze=0,Ke=0,Ze=0;for(Be=0;Be<ue;++Be)if(Re=[],Ke=Be+de,Ke>=ue&&(Ke-=ue),!Ce[Ke]){ke=[];var $e=[];for(ze=Ke;ze>=0;){$e[ze]=!0,Ce[ze]=!0,Re[Re.length]=ze,ke.push(te[ze]);var Je=oe[Math.floor(ze*4/ce)];if(Ze=ze*4&Se,ce<4+Ze)throw new Error("FAT boundary crossed: "+ze+" 4 "+ce);if(!te[Je]||(ze=bd(te[Je],Ze),$e[ze]))break}Ae[Ke]={nodes:Re,data:_D([ke])}}return Ae}function N(te,de,oe,ce,ue,Ae,Ce,Re){for(var ke=0,Se=ce.length?2:0,Be=de[te].data,ze=0,Ke=0,Ze;ze<Be.length;ze+=128){var $e=Be.slice(ze,ze+128);vn($e,64),Ke=$e.read_shift(2),Ze=pE($e,0,Ke-Se),ce.push(Ze);var Je={name:Ze,type:$e.read_shift(1),color:$e.read_shift(1),L:$e.read_shift(4,"i"),R:$e.read_shift(4,"i"),C:$e.read_shift(4,"i"),clsid:$e.read_shift(16),state:$e.read_shift(4,"i"),start:0,size:0},dt=$e.read_shift(2)+$e.read_shift(2)+$e.read_shift(2)+$e.read_shift(2);dt!==0&&(Je.ct=E($e,$e.l-8));var kr=$e.read_shift(2)+$e.read_shift(2)+$e.read_shift(2)+$e.read_shift(2);kr!==0&&(Je.mt=E($e,$e.l-8)),Je.start=$e.read_shift(4,"i"),Je.size=$e.read_shift(4,"i"),Je.size<0&&Je.start<0&&(Je.size=Je.type=0,Je.start=G,Je.name=""),Je.type===5?(ke=Je.start,ue>0&&ke!==G&&(de[ke].name="!StreamData")):Je.size>=4096?(Je.storage="fat",de[Je.start]===void 0&&(de[Je.start]=j(oe,Je.start,de.fat_addrs,de.ssz)),de[Je.start].name=Je.name,Je.content=de[Je.start].data.slice(0,Je.size)):(Je.storage="minifat",Je.size<0?Je.size=0:ke!==G&&Je.start!==G&&de[ke]&&(Je.content=v(Je,de[ke].data,(de[Re]||{}).data))),Je.content&&vn(Je.content,0),Ae[Ze]=Je,Ce.push(Je)}}function E(te,de){return new Date((Us(te,de+4)/1e7*Math.pow(2,32)+Us(te,de)/1e7-11644473600)*1e3)}function T(te,de){return u(),f(d.readFileSync(te),de)}function B(te,de){var oe=de&&de.type;switch(oe||Mt&&Buffer.isBuffer(te)&&(oe="buffer"),oe||"base64"){case"file":return T(te,de);case"base64":return f(Rs(Vs(te)),de);case"binary":return f(Rs(te),de)}return f(te,de)}function F(te,de){var oe=de||{},ce=oe.root||"Root Entry";if(te.FullPaths||(te.FullPaths=[]),te.FileIndex||(te.FileIndex=[]),te.FullPaths.length!==te.FileIndex.length)throw new Error("inconsistent CFB structure");te.FullPaths.length===0&&(te.FullPaths[0]=ce+"/",te.FileIndex[0]={name:ce,type:5}),oe.CLSID&&(te.FileIndex[0].clsid=oe.CLSID),R(te)}function R(te){var de="Sh33tJ5";if(!xt.find(te,"/"+de)){var oe=Oe(4);oe[0]=55,oe[1]=oe[3]=50,oe[2]=54,te.FileIndex.push({name:de,type:2,content:oe,size:4,L:69,R:69,C:69}),te.FullPaths.push(te.FullPaths[0]+de),U(te)}}function U(te,de){F(te);for(var oe=!1,ce=!1,ue=te.FullPaths.length-1;ue>=0;--ue){var Ae=te.FileIndex[ue];switch(Ae.type){case 0:ce?oe=!0:(te.FileIndex.pop(),te.FullPaths.pop());break;case 1:case 2:case 5:ce=!0,isNaN(Ae.R*Ae.L*Ae.C)&&(oe=!0),Ae.R>-1&&Ae.L>-1&&Ae.R==Ae.L&&(oe=!0);break;default:oe=!0;break}}if(!(!oe&&!de)){var Ce=new Date(1987,1,19),Re=0,ke=Object.create?Object.create(null):{},Se=[];for(ue=0;ue<te.FullPaths.length;++ue)ke[te.FullPaths[ue]]=!0,te.FileIndex[ue].type!==0&&Se.push([te.FullPaths[ue],te.FileIndex[ue]]);for(ue=0;ue<Se.length;++ue){var Be=a(Se[ue][0]);ce=ke[Be],ce||(Se.push([Be,{name:s(Be).replace("/",""),type:1,clsid:X,ct:Ce,mt:Ce,content:null}]),ke[Be]=!0)}for(Se.sort(function(Ze,$e){return r(Ze[0],$e[0])}),te.FullPaths=[],te.FileIndex=[],ue=0;ue<Se.length;++ue)te.FullPaths[ue]=Se[ue][0],te.FileIndex[ue]=Se[ue][1];for(ue=0;ue<Se.length;++ue){var ze=te.FileIndex[ue],Ke=te.FullPaths[ue];if(ze.name=s(Ke).replace("/",""),ze.L=ze.R=ze.C=-(ze.color=1),ze.size=ze.content?ze.content.length:0,ze.start=0,ze.clsid=ze.clsid||X,ue===0)ze.C=Se.length>1?1:-1,ze.size=0,ze.type=5;else if(Ke.slice(-1)=="/"){for(Re=ue+1;Re<Se.length&&a(te.FullPaths[Re])!=Ke;++Re);for(ze.C=Re>=Se.length?-1:Re,Re=ue+1;Re<Se.length&&a(te.FullPaths[Re])!=a(Ke);++Re);ze.R=Re>=Se.length?-1:Re,ze.type=1}else a(te.FullPaths[ue+1]||"")==a(Ke)&&(ze.R=ue+1),ze.type=2}}}function D(te,de){var oe=de||{};if(oe.fileType=="mad")return It(te,oe);switch(U(te),oe.fileType){case"zip":return ta(te,oe)}var ce=(function(Ze){for(var $e=0,Je=0,dt=0;dt<Ze.FileIndex.length;++dt){var kr=Ze.FileIndex[dt];if(kr.content){var jr=kr.content.length;jr>0&&(jr<4096?$e+=jr+63>>6:Je+=jr+511>>9)}}for(var Qr=Ze.FullPaths.length+3>>2,qs=$e+7>>3,Yc=$e+127>>7,Qo=qs+Je+Qr+Yc,tl=Qo+127>>7,l0=tl<=109?0:Math.ceil((tl-109)/127);Qo+tl+l0+127>>7>tl;)l0=++tl<=109?0:Math.ceil((tl-109)/127);var ns=[1,l0,tl,Yc,Qr,Je,$e,0];return Ze.FileIndex[0].size=$e<<6,ns[7]=(Ze.FileIndex[0].start=ns[0]+ns[1]+ns[2]+ns[3]+ns[4]+ns[5])+(ns[6]+7>>3),ns})(te),ue=Oe(ce[7]<<9),Ae=0,Ce=0;{for(Ae=0;Ae<8;++Ae)ue.write_shift(1,H[Ae]);for(Ae=0;Ae<8;++Ae)ue.write_shift(2,0);for(ue.write_shift(2,62),ue.write_shift(2,3),ue.write_shift(2,65534),ue.write_shift(2,9),ue.write_shift(2,6),Ae=0;Ae<3;++Ae)ue.write_shift(2,0);for(ue.write_shift(4,0),ue.write_shift(4,ce[2]),ue.write_shift(4,ce[0]+ce[1]+ce[2]+ce[3]-1),ue.write_shift(4,0),ue.write_shift(4,4096),ue.write_shift(4,ce[3]?ce[0]+ce[1]+ce[2]-1:G),ue.write_shift(4,ce[3]),ue.write_shift(-4,ce[1]?ce[0]-1:G),ue.write_shift(4,ce[1]),Ae=0;Ae<109;++Ae)ue.write_shift(-4,Ae<ce[2]?ce[1]+Ae:-1)}if(ce[1])for(Ce=0;Ce<ce[1];++Ce){for(;Ae<236+Ce*127;++Ae)ue.write_shift(-4,Ae<ce[2]?ce[1]+Ae:-1);ue.write_shift(-4,Ce===ce[1]-1?G:Ce+1)}var Re=function(Ze){for(Ce+=Ze;Ae<Ce-1;++Ae)ue.write_shift(-4,Ae+1);Ze&&(++Ae,ue.write_shift(-4,G))};for(Ce=Ae=0,Ce+=ce[1];Ae<Ce;++Ae)ue.write_shift(-4,K.DIFSECT);for(Ce+=ce[2];Ae<Ce;++Ae)ue.write_shift(-4,K.FATSECT);Re(ce[3]),Re(ce[4]);for(var ke=0,Se=0,Be=te.FileIndex[0];ke<te.FileIndex.length;++ke)Be=te.FileIndex[ke],Be.content&&(Se=Be.content.length,!(Se<4096)&&(Be.start=Ce,Re(Se+511>>9)));for(Re(ce[6]+7>>3);ue.l&511;)ue.write_shift(-4,K.ENDOFCHAIN);for(Ce=Ae=0,ke=0;ke<te.FileIndex.length;++ke)Be=te.FileIndex[ke],Be.content&&(Se=Be.content.length,!(!Se||Se>=4096)&&(Be.start=Ce,Re(Se+63>>6)));for(;ue.l&511;)ue.write_shift(-4,K.ENDOFCHAIN);for(Ae=0;Ae<ce[4]<<2;++Ae){var ze=te.FullPaths[Ae];if(!ze||ze.length===0){for(ke=0;ke<17;++ke)ue.write_shift(4,0);for(ke=0;ke<3;++ke)ue.write_shift(4,-1);for(ke=0;ke<12;++ke)ue.write_shift(4,0);continue}Be=te.FileIndex[Ae],Ae===0&&(Be.start=Be.size?Be.start-1:G);var Ke=Ae===0&&oe.root||Be.name;if(Se=2*(Ke.length+1),ue.write_shift(64,Ke,"utf16le"),ue.write_shift(2,Se),ue.write_shift(1,Be.type),ue.write_shift(1,Be.color),ue.write_shift(-4,Be.L),ue.write_shift(-4,Be.R),ue.write_shift(-4,Be.C),Be.clsid)ue.write_shift(16,Be.clsid,"hex");else for(ke=0;ke<4;++ke)ue.write_shift(4,0);ue.write_shift(4,Be.state||0),ue.write_shift(4,0),ue.write_shift(4,0),ue.write_shift(4,0),ue.write_shift(4,0),ue.write_shift(4,Be.start),ue.write_shift(4,Be.size),ue.write_shift(4,0)}for(Ae=1;Ae<te.FileIndex.length;++Ae)if(Be=te.FileIndex[Ae],Be.size>=4096)if(ue.l=Be.start+1<<9,Mt&&Buffer.isBuffer(Be.content))Be.content.copy(ue,ue.l,0,Be.size),ue.l+=Be.size+511&-512;else{for(ke=0;ke<Be.size;++ke)ue.write_shift(1,Be.content[ke]);for(;ke&511;++ke)ue.write_shift(1,0)}for(Ae=1;Ae<te.FileIndex.length;++Ae)if(Be=te.FileIndex[Ae],Be.size>0&&Be.size<4096)if(Mt&&Buffer.isBuffer(Be.content))Be.content.copy(ue,ue.l,0,Be.size),ue.l+=Be.size+63&-64;else{for(ke=0;ke<Be.size;++ke)ue.write_shift(1,Be.content[ke]);for(;ke&63;++ke)ue.write_shift(1,0)}if(Mt)ue.l=ue.length;else for(;ue.l<ue.length;)ue.write_shift(1,0);return ue}function L(te,de){var oe=te.FullPaths.map(function(ke){return ke.toUpperCase()}),ce=oe.map(function(ke){var Se=ke.split("/");return Se[Se.length-(ke.slice(-1)=="/"?2:1)]}),ue=!1;de.charCodeAt(0)===47?(ue=!0,de=oe[0].slice(0,-1)+de):ue=de.indexOf("/")!==-1;var Ae=de.toUpperCase(),Ce=ue===!0?oe.indexOf(Ae):ce.indexOf(Ae);if(Ce!==-1)return te.FileIndex[Ce];var Re=!Ae.match(Nf);for(Ae=Ae.replace(Jn,""),Re&&(Ae=Ae.replace(Nf,"!")),Ce=0;Ce<oe.length;++Ce)if((Re?oe[Ce].replace(Nf,"!"):oe[Ce]).replace(Jn,"")==Ae||(Re?ce[Ce].replace(Nf,"!"):ce[Ce]).replace(Jn,"")==Ae)return te.FileIndex[Ce];return null}var P=64,G=-2,Q="d0cf11e0a1b11ae1",H=[208,207,17,224,161,177,26,225],X="00000000000000000000000000000000",K={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:G,FREESECT:-1,HEADER_SIGNATURE:Q,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:X,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function ee(te,de,oe){u();var ce=D(te,oe);d.writeFileSync(de,ce)}function W(te){for(var de=new Array(te.length),oe=0;oe<te.length;++oe)de[oe]=String.fromCharCode(te[oe]);return de.join("")}function Y(te,de){var oe=D(te,de);switch(de&&de.type||"buffer"){case"file":return u(),d.writeFileSync(de.filename,oe),oe;case"binary":return typeof oe=="string"?oe:W(oe);case"base64":return hp(typeof oe=="string"?oe:W(oe));case"buffer":if(Mt)return Buffer.isBuffer(oe)?oe:Ro(oe);case"array":return typeof oe=="string"?Rs(oe):oe}return oe}var M;function O(te){try{var de=te.InflateRaw,oe=new de;if(oe._processChunk(new Uint8Array([3,0]),oe._finishFlushFlag),oe.bytesRead)M=te;else throw new Error("zlib does not expose bytesRead")}catch(ce){console.error("cannot use native zlib: "+(ce.message||ce))}}function q(te,de){if(!M)return $n(te,de);var oe=M.InflateRaw,ce=new oe,ue=ce._processChunk(te.slice(te.l),ce._finishFlushFlag);return te.l+=ce.bytesRead,ue}function z(te){return M?M.deflateRawSync(te):it(te)}var J=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],re=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],le=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];function ne(te){var de=(te<<1|te<<11)&139536|(te<<5|te<<15)&558144;return(de>>16|de>>8|de)&255}for(var ae=typeof Uint8Array<"u",ie=ae?new Uint8Array(256):[],me=0;me<256;++me)ie[me]=ne(me);function Z(te,de){var oe=ie[te&255];return de<=8?oe>>>8-de:(oe=oe<<8|ie[te>>8&255],de<=16?oe>>>16-de:(oe=oe<<8|ie[te>>16&255],oe>>>24-de))}function Me(te,de){var oe=de&7,ce=de>>>3;return(te[ce]|(oe<=6?0:te[ce+1]<<8))>>>oe&3}function pe(te,de){var oe=de&7,ce=de>>>3;return(te[ce]|(oe<=5?0:te[ce+1]<<8))>>>oe&7}function he(te,de){var oe=de&7,ce=de>>>3;return(te[ce]|(oe<=4?0:te[ce+1]<<8))>>>oe&15}function ye(te,de){var oe=de&7,ce=de>>>3;return(te[ce]|(oe<=3?0:te[ce+1]<<8))>>>oe&31}function fe(te,de){var oe=de&7,ce=de>>>3;return(te[ce]|(oe<=1?0:te[ce+1]<<8))>>>oe&127}function Ue(te,de,oe){var ce=de&7,ue=de>>>3,Ae=(1<<oe)-1,Ce=te[ue]>>>ce;return oe<8-ce||(Ce|=te[ue+1]<<8-ce,oe<16-ce)||(Ce|=te[ue+2]<<16-ce,oe<24-ce)||(Ce|=te[ue+3]<<24-ce),Ce&Ae}function qe(te,de,oe){var ce=de&7,ue=de>>>3;return ce<=5?te[ue]|=(oe&7)<<ce:(te[ue]|=oe<<ce&255,te[ue+1]=(oe&7)>>8-ce),de+3}function at(te,de,oe){var ce=de&7,ue=de>>>3;return oe=(oe&1)<<ce,te[ue]|=oe,de+1}function nt(te,de,oe){var ce=de&7,ue=de>>>3;return oe<<=ce,te[ue]|=oe&255,oe>>>=8,te[ue+1]=oe,de+8}function Ct(te,de,oe){var ce=de&7,ue=de>>>3;return oe<<=ce,te[ue]|=oe&255,oe>>>=8,te[ue+1]=oe&255,te[ue+2]=oe>>>8,de+16}function kt(te,de){var oe=te.length,ce=2*oe>de?2*oe:de+5,ue=0;if(oe>=de)return te;if(Mt){var Ae=uD(ce);if(te.copy)te.copy(Ae);else for(;ue<te.length;++ue)Ae[ue]=te[ue];return Ae}else if(ae){var Ce=new Uint8Array(ce);if(Ce.set)Ce.set(te);else for(;ue<oe;++ue)Ce[ue]=te[ue];return Ce}return te.length=ce,te}function ft(te){for(var de=new Array(te),oe=0;oe<te;++oe)de[oe]=0;return de}function _r(te,de,oe){var ce=1,ue=0,Ae=0,Ce=0,Re=0,ke=te.length,Se=ae?new Uint16Array(32):ft(32);for(Ae=0;Ae<32;++Ae)Se[Ae]=0;for(Ae=ke;Ae<oe;++Ae)te[Ae]=0;ke=te.length;var Be=ae?new Uint16Array(ke):ft(ke);for(Ae=0;Ae<ke;++Ae)Se[ue=te[Ae]]++,ce<ue&&(ce=ue),Be[Ae]=0;for(Se[0]=0,Ae=1;Ae<=ce;++Ae)Se[Ae+16]=Re=Re+Se[Ae-1]<<1;for(Ae=0;Ae<ke;++Ae)Re=te[Ae],Re!=0&&(Be[Ae]=Se[Re+16]++);var ze=0;for(Ae=0;Ae<ke;++Ae)if(ze=te[Ae],ze!=0)for(Re=Z(Be[Ae],ce)>>ce-ze,Ce=(1<<ce+4-ze)-1;Ce>=0;--Ce)de[Re|Ce<<ze]=ze&15|Ae<<4;return ce}var Ar=ae?new Uint16Array(512):ft(512),pa=ae?new Uint16Array(32):ft(32);if(!ae){for(var Ut=0;Ut<512;++Ut)Ar[Ut]=0;for(Ut=0;Ut<32;++Ut)pa[Ut]=0}(function(){for(var te=[],de=0;de<32;de++)te.push(5);_r(te,pa,32);var oe=[];for(de=0;de<=143;de++)oe.push(8);for(;de<=255;de++)oe.push(9);for(;de<=279;de++)oe.push(7);for(;de<=287;de++)oe.push(8);_r(oe,Ar,288)})();var Tr=(function(){for(var de=ae?new Uint8Array(32768):[],oe=0,ce=0;oe<le.length-1;++oe)for(;ce<le[oe+1];++ce)de[ce]=oe;for(;ce<32768;++ce)de[ce]=29;var ue=ae?new Uint8Array(259):[];for(oe=0,ce=0;oe<re.length-1;++oe)for(;ce<re[oe+1];++ce)ue[ce]=oe;function Ae(Re,ke){for(var Se=0;Se<Re.length;){var Be=Math.min(65535,Re.length-Se),ze=Se+Be==Re.length;for(ke.write_shift(1,+ze),ke.write_shift(2,Be),ke.write_shift(2,~Be&65535);Be-- >0;)ke[ke.l++]=Re[Se++]}return ke.l}function Ce(Re,ke){for(var Se=0,Be=0,ze=ae?new Uint16Array(32768):[];Be<Re.length;){var Ke=Math.min(65535,Re.length-Be);if(Ke<10){for(Se=qe(ke,Se,+(Be+Ke==Re.length)),Se&7&&(Se+=8-(Se&7)),ke.l=Se/8|0,ke.write_shift(2,Ke),ke.write_shift(2,~Ke&65535);Ke-- >0;)ke[ke.l++]=Re[Be++];Se=ke.l*8;continue}Se=qe(ke,Se,+(Be+Ke==Re.length)+2);for(var Ze=0;Ke-- >0;){var $e=Re[Be];Ze=(Ze<<5^$e)&32767;var Je=-1,dt=0;if((Je=ze[Ze])&&(Je|=Be&-32768,Je>Be&&(Je-=32768),Je<Be))for(;Re[Je+dt]==Re[Be+dt]&&dt<250;)++dt;if(dt>2){$e=ue[dt],$e<=22?Se=nt(ke,Se,ie[$e+1]>>1)-1:(nt(ke,Se,3),Se+=5,nt(ke,Se,ie[$e-23]>>5),Se+=3);var kr=$e<8?0:$e-4>>2;kr>0&&(Ct(ke,Se,dt-re[$e]),Se+=kr),$e=de[Be-Je],Se=nt(ke,Se,ie[$e]>>3),Se-=3;var jr=$e<4?0:$e-2>>1;jr>0&&(Ct(ke,Se,Be-Je-le[$e]),Se+=jr);for(var Qr=0;Qr<dt;++Qr)ze[Ze]=Be&32767,Ze=(Ze<<5^Re[Be])&32767,++Be;Ke-=dt-1}else $e<=143?$e=$e+48:Se=at(ke,Se,1),Se=nt(ke,Se,ie[$e]),ze[Ze]=Be&32767,++Be}Se=nt(ke,Se,0)-1}return ke.l=(Se+7)/8|0,ke.l}return function(ke,Se){return ke.length<8?Ae(ke,Se):Ce(ke,Se)}})();function it(te){var de=Oe(50+Math.floor(te.length*1.1)),oe=Tr(te,de);return de.slice(0,oe)}var Rt=ae?new Uint16Array(32768):ft(32768),Et=ae?new Uint16Array(32768):ft(32768),jt=ae?new Uint16Array(128):ft(128),Kt=1,fr=1;function Cr(te,de){var oe=ye(te,de)+257;de+=5;var ce=ye(te,de)+1;de+=5;var ue=he(te,de)+4;de+=4;for(var Ae=0,Ce=ae?new Uint8Array(19):ft(19),Re=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ke=1,Se=ae?new Uint8Array(8):ft(8),Be=ae?new Uint8Array(8):ft(8),ze=Ce.length,Ke=0;Ke<ue;++Ke)Ce[J[Ke]]=Ae=pe(te,de),ke<Ae&&(ke=Ae),Se[Ae]++,de+=3;var Ze=0;for(Se[0]=0,Ke=1;Ke<=ke;++Ke)Be[Ke]=Ze=Ze+Se[Ke-1]<<1;for(Ke=0;Ke<ze;++Ke)(Ze=Ce[Ke])!=0&&(Re[Ke]=Be[Ze]++);var $e=0;for(Ke=0;Ke<ze;++Ke)if($e=Ce[Ke],$e!=0){Ze=ie[Re[Ke]]>>8-$e;for(var Je=(1<<7-$e)-1;Je>=0;--Je)jt[Ze|Je<<$e]=$e&7|Ke<<3}var dt=[];for(ke=1;dt.length<oe+ce;)switch(Ze=jt[fe(te,de)],de+=Ze&7,Ze>>>=3){case 16:for(Ae=3+Me(te,de),de+=2,Ze=dt[dt.length-1];Ae-- >0;)dt.push(Ze);break;case 17:for(Ae=3+pe(te,de),de+=3;Ae-- >0;)dt.push(0);break;case 18:for(Ae=11+fe(te,de),de+=7;Ae-- >0;)dt.push(0);break;default:dt.push(Ze),ke<Ze&&(ke=Ze);break}var kr=dt.slice(0,oe),jr=dt.slice(oe);for(Ke=oe;Ke<286;++Ke)kr[Ke]=0;for(Ke=ce;Ke<30;++Ke)jr[Ke]=0;return Kt=_r(kr,Rt,286),fr=_r(jr,Et,30),de}function cn(te,de){if(te[0]==3&&!(te[1]&3))return[Dc(de),2];for(var oe=0,ce=0,ue=uD(de||1<<18),Ae=0,Ce=ue.length>>>0,Re=0,ke=0;(ce&1)==0;){if(ce=pe(te,oe),oe+=3,ce>>>1)ce>>1==1?(Re=9,ke=5):(oe=Cr(te,oe),Re=Kt,ke=fr);else{oe&7&&(oe+=8-(oe&7));var Se=te[oe>>>3]|te[(oe>>>3)+1]<<8;if(oe+=32,Se>0)for(!de&&Ce<Ae+Se&&(ue=kt(ue,Ae+Se),Ce=ue.length);Se-- >0;)ue[Ae++]=te[oe>>>3],oe+=8;continue}for(;;){!de&&Ce<Ae+32767&&(ue=kt(ue,Ae+32767),Ce=ue.length);var Be=Ue(te,oe,Re),ze=ce>>>1==1?Ar[Be]:Rt[Be];if(oe+=ze&15,ze>>>=4,(ze>>>8&255)===0)ue[Ae++]=ze;else{if(ze==256)break;ze-=257;var Ke=ze<8?0:ze-4>>2;Ke>5&&(Ke=0);var Ze=Ae+re[ze];Ke>0&&(Ze+=Ue(te,oe,Ke),oe+=Ke),Be=Ue(te,oe,ke),ze=ce>>>1==1?pa[Be]:Et[Be],oe+=ze&15,ze>>>=4;var $e=ze<4?0:ze-2>>1,Je=le[ze];for($e>0&&(Je+=Ue(te,oe,$e),oe+=$e),!de&&Ce<Ze&&(ue=kt(ue,Ze+100),Ce=ue.length);Ae<Ze;)ue[Ae]=ue[Ae-Je],++Ae}}}return de?[ue,oe+7>>>3]:[ue.slice(0,Ae),oe+7>>>3]}function $n(te,de){var oe=te.slice(te.l||0),ce=cn(oe,de);return te.l+=ce[1],ce[0]}function Cs(te,de){if(te)typeof console<"u"&&console.error(de);else throw new Error(de)}function ks(te,de){var oe=te;vn(oe,0);var ce=[],ue=[],Ae={FileIndex:ce,FullPaths:ue};F(Ae,{root:de.root});for(var Ce=oe.length-4;(oe[Ce]!=80||oe[Ce+1]!=75||oe[Ce+2]!=5||oe[Ce+3]!=6)&&Ce>=0;)--Ce;oe.l=Ce+4,oe.l+=4;var Re=oe.read_shift(2);oe.l+=6;var ke=oe.read_shift(4);for(oe.l=ke,Ce=0;Ce<Re;++Ce){oe.l+=20;var Se=oe.read_shift(4),Be=oe.read_shift(4),ze=oe.read_shift(2),Ke=oe.read_shift(2),Ze=oe.read_shift(2);oe.l+=8;var $e=oe.read_shift(4),Je=o(oe.slice(oe.l+ze,oe.l+ze+Ke));oe.l+=ze+Ke+Ze;var dt=oe.l;oe.l=$e+4,Bi(oe,Se,Be,Ae,Je),oe.l=dt}return Ae}function Bi(te,de,oe,ce,ue){te.l+=2;var Ae=te.read_shift(2),Ce=te.read_shift(2),Re=l(te);if(Ae&8257)throw new Error("Unsupported ZIP encryption");for(var ke=te.read_shift(4),Se=te.read_shift(4),Be=te.read_shift(4),ze=te.read_shift(2),Ke=te.read_shift(2),Ze="",$e=0;$e<ze;++$e)Ze+=String.fromCharCode(te[te.l++]);if(Ke){var Je=o(te.slice(te.l,te.l+Ke));(Je[21589]||{}).mt&&(Re=Je[21589].mt),((ue||{})[21589]||{}).mt&&(Re=ue[21589].mt)}te.l+=Ke;var dt=te.slice(te.l,te.l+Se);switch(Ce){case 8:dt=q(te,Be);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+Ce)}var kr=!1;Ae&8&&(ke=te.read_shift(4),ke==134695760&&(ke=te.read_shift(4),kr=!0),Se=te.read_shift(4),Be=te.read_shift(4)),Se!=de&&Cs(kr,"Bad compressed size: "+de+" != "+Se),Be!=oe&&Cs(kr,"Bad uncompressed size: "+oe+" != "+Be),Ma(ce,Ze,dt,{unsafe:!0,mt:Re})}function ta(te,de){var oe=de||{},ce=[],ue=[],Ae=Oe(1),Ce=oe.compression?8:0,Re=0,ke=0,Se=0,Be=0,ze=0,Ke=te.FullPaths[0],Ze=Ke,$e=te.FileIndex[0],Je=[],dt=0;for(ke=1;ke<te.FullPaths.length;++ke)if(Ze=te.FullPaths[ke].slice(Ke.length),$e=te.FileIndex[ke],!(!$e.size||!$e.content||Ze=="Sh33tJ5")){var kr=Be,jr=Oe(Ze.length);for(Se=0;Se<Ze.length;++Se)jr.write_shift(1,Ze.charCodeAt(Se)&127);jr=jr.slice(0,jr.l),Je[ze]=oge.buf($e.content,0);var Qr=$e.content;Ce==8&&(Qr=z(Qr)),Ae=Oe(30),Ae.write_shift(4,67324752),Ae.write_shift(2,20),Ae.write_shift(2,Re),Ae.write_shift(2,Ce),$e.mt?i(Ae,$e.mt):Ae.write_shift(4,0),Ae.write_shift(-4,Je[ze]),Ae.write_shift(4,Qr.length),Ae.write_shift(4,$e.content.length),Ae.write_shift(2,jr.length),Ae.write_shift(2,0),Be+=Ae.length,ce.push(Ae),Be+=jr.length,ce.push(jr),Be+=Qr.length,ce.push(Qr),Ae=Oe(46),Ae.write_shift(4,33639248),Ae.write_shift(2,0),Ae.write_shift(2,20),Ae.write_shift(2,Re),Ae.write_shift(2,Ce),Ae.write_shift(4,0),Ae.write_shift(-4,Je[ze]),Ae.write_shift(4,Qr.length),Ae.write_shift(4,$e.content.length),Ae.write_shift(2,jr.length),Ae.write_shift(2,0),Ae.write_shift(2,0),Ae.write_shift(2,0),Ae.write_shift(2,0),Ae.write_shift(4,0),Ae.write_shift(4,kr),dt+=Ae.l,ue.push(Ae),dt+=jr.length,ue.push(jr),++ze}return Ae=Oe(22),Ae.write_shift(4,101010256),Ae.write_shift(2,0),Ae.write_shift(2,0),Ae.write_shift(2,ze),Ae.write_shift(2,ze),Ae.write_shift(4,dt),Ae.write_shift(4,Be),Ae.write_shift(2,0),en([en(ce),en(ue),Ae])}var dn={htm:"text/html",xml:"text/xml",gif:"image/gif",jpg:"image/jpeg",png:"image/png",mso:"application/x-mso",thmx:"application/vnd.ms-officetheme",sh33tj5:"application/octet-stream"};function el(te,de){if(te.ctype)return te.ctype;var oe=te.name||"",ce=oe.match(/\.([^\.]+)$/);return ce&&dn[ce[1]]||de&&(ce=(oe=de).match(/[\.\\]([^\.\\])+$/),ce&&dn[ce[1]])?dn[ce[1]]:"application/octet-stream"}function _i(te){for(var de=hp(te),oe=[],ce=0;ce<de.length;ce+=76)oe.push(de.slice(ce,ce+76));return oe.join(`\r
`)+`\r
`}function Wc(te){var de=te.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,function(Se){var Be=Se.charCodeAt(0).toString(16).toUpperCase();return"="+(Be.length==1?"0"+Be:Be)});de=de.replace(/ $/mg,"=20").replace(/\t$/mg,"=09"),de.charAt(0)==`
`&&(de="=0D"+de.slice(1)),de=de.replace(/\r(?!\n)/mg,"=0D").replace(/\n\n/mg,`
=0A`).replace(/([^\r\n])\n/mg,"$1=0A");for(var oe=[],ce=de.split(`\r
`),ue=0;ue<ce.length;++ue){var Ae=ce[ue];if(Ae.length==0){oe.push("");continue}for(var Ce=0;Ce<Ae.length;){var Re=76,ke=Ae.slice(Ce,Ce+Re);ke.charAt(Re-1)=="="?Re--:ke.charAt(Re-2)=="="?Re-=2:ke.charAt(Re-3)=="="&&(Re-=3),ke=Ae.slice(Ce,Ce+Re),Ce+=Re,Ce<Ae.length&&(ke+="="),oe.push(ke)}}return oe.join(`\r
`)}function Lo(te){for(var de=[],oe=0;oe<te.length;++oe){for(var ce=te[oe];oe<=te.length&&ce.charAt(ce.length-1)=="=";)ce=ce.slice(0,ce.length-1)+te[++oe];de.push(ce)}for(var ue=0;ue<de.length;++ue)de[ue]=de[ue].replace(/[=][0-9A-Fa-f]{2}/g,function(Ae){return String.fromCharCode(parseInt(Ae.slice(1),16))});return Rs(de.join(`\r
`))}function Ul(te,de,oe){for(var ce="",ue="",Ae="",Ce,Re=0;Re<10;++Re){var ke=de[Re];if(!ke||ke.match(/^\s*$/))break;var Se=ke.match(/^(.*?):\s*([^\s].*)$/);if(Se)switch(Se[1].toLowerCase()){case"content-location":ce=Se[2].trim();break;case"content-type":Ae=Se[2].trim();break;case"content-transfer-encoding":ue=Se[2].trim();break}}switch(++Re,ue.toLowerCase()){case"base64":Ce=Rs(Vs(de.slice(Re).join("")));break;case"quoted-printable":Ce=Lo(de.slice(Re));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+ue)}var Be=Ma(te,ce.slice(oe.length),Ce,{unsafe:!0});Ae&&(Be.ctype=Ae)}function Ve(te,de){if(W(te.slice(0,13)).toLowerCase()!="mime-version:")throw new Error("Unsupported MAD header");var oe=de&&de.root||"",ce=(Mt&&Buffer.isBuffer(te)?te.toString("binary"):W(te)).split(`\r
`),ue=0,Ae="";for(ue=0;ue<ce.length;++ue)if(Ae=ce[ue],!!/^Content-Location:/i.test(Ae)&&(Ae=Ae.slice(Ae.indexOf("file")),oe||(oe=Ae.slice(0,Ae.lastIndexOf("/")+1)),Ae.slice(0,oe.length)!=oe))for(;oe.length>0&&(oe=oe.slice(0,oe.length-1),oe=oe.slice(0,oe.lastIndexOf("/")+1),Ae.slice(0,oe.length)!=oe););var Ce=(ce[1]||"").match(/boundary="(.*?)"/);if(!Ce)throw new Error("MAD cannot find boundary");var Re="--"+(Ce[1]||""),ke=[],Se=[],Be={FileIndex:ke,FullPaths:Se};F(Be);var ze,Ke=0;for(ue=0;ue<ce.length;++ue){var Ze=ce[ue];Ze!==Re&&Ze!==Re+"--"||(Ke++&&Ul(Be,ce.slice(ze,ue),oe),ze=ue)}return Be}function It(te,de){var oe=de||{},ce=oe.boundary||"SheetJS";ce="------="+ce;for(var ue=["MIME-Version: 1.0",'Content-Type: multipart/related; boundary="'+ce.slice(2)+'"',"","",""],Ae=te.FullPaths[0],Ce=Ae,Re=te.FileIndex[0],ke=1;ke<te.FullPaths.length;++ke)if(Ce=te.FullPaths[ke].slice(Ae.length),Re=te.FileIndex[ke],!(!Re.size||!Re.content||Ce=="Sh33tJ5")){Ce=Ce.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g,function(dt){return"_x"+dt.charCodeAt(0).toString(16)+"_"}).replace(/[\u0080-\uFFFF]/g,function(dt){return"_u"+dt.charCodeAt(0).toString(16)+"_"});for(var Se=Re.content,Be=Mt&&Buffer.isBuffer(Se)?Se.toString("binary"):W(Se),ze=0,Ke=Math.min(1024,Be.length),Ze=0,$e=0;$e<=Ke;++$e)(Ze=Be.charCodeAt($e))>=32&&Ze<128&&++ze;var Je=ze>=Ke*4/5;ue.push(ce),ue.push("Content-Location: "+(oe.root||"file:///C:/SheetJS/")+Ce),ue.push("Content-Transfer-Encoding: "+(Je?"quoted-printable":"base64")),ue.push("Content-Type: "+el(Re,Ce)),ue.push(""),ue.push(Je?Wc(Be):_i(Be))}return ue.push(ce+`--\r
`),ue.join(`\r
`)}function ra(te){var de={};return F(de,te),de}function Ma(te,de,oe,ce){var ue=ce&&ce.unsafe;ue||F(te);var Ae=!ue&&xt.find(te,de);if(!Ae){var Ce=te.FullPaths[0];de.slice(0,Ce.length)==Ce?Ce=de:(Ce.slice(-1)!="/"&&(Ce+="/"),Ce=(Ce+de).replace("//","/")),Ae={name:s(de),type:2},te.FileIndex.push(Ae),te.FullPaths.push(Ce),ue||xt.utils.cfb_gc(te)}return Ae.content=oe,Ae.size=oe?oe.length:0,ce&&(ce.CLSID&&(Ae.clsid=ce.CLSID),ce.mt&&(Ae.mt=ce.mt),ce.ct&&(Ae.ct=ce.ct)),Ae}function be(te,de){F(te);var oe=xt.find(te,de);if(oe){for(var ce=0;ce<te.FileIndex.length;++ce)if(te.FileIndex[ce]==oe)return te.FileIndex.splice(ce,1),te.FullPaths.splice(ce,1),!0}return!1}function Ye(te,de,oe){F(te);var ce=xt.find(te,de);if(ce){for(var ue=0;ue<te.FileIndex.length;++ue)if(te.FileIndex[ue]==ce)return te.FileIndex[ue].name=s(oe),te.FullPaths[ue]=oe,!0}return!1}function tt(te){U(te,!0)}return t.find=L,t.read=B,t.parse=f,t.write=Y,t.writeFile=ee,t.utils={cfb_new:ra,cfb_add:Ma,cfb_del:be,cfb_mov:Ye,cfb_gc:tt,ReadShift:Df,CheckField:t9,prep_blob:vn,bconcat:en,use_zlib:O,_deflateRaw:it,_inflateRaw:$n,consts:K},t})();function cge(e){return typeof e=="string"?ov(e):Array.isArray(e)?Ume(e):e}function Zp(e,t,r){if(typeof Deno<"u"){if(r&&typeof t=="string")switch(r){case"utf8":t=new TextEncoder(r).encode(t);break;case"binary":t=ov(t);break;default:throw new Error("Unsupported encoding "+r)}return Deno.writeFileSync(e,t)}var a=r=="utf8"?ml(t):t;if(typeof IE_SaveFile<"u")return IE_SaveFile(a,e);if(typeof Blob<"u"){var s=new Blob([cge(a)],{type:"application/octet-stream"});if(typeof navigator<"u"&&navigator.msSaveBlob)return navigator.msSaveBlob(s,e);if(typeof saveAs<"u")return saveAs(s,e);if(typeof URL<"u"&&typeof document<"u"&&document.createElement&&URL.createObjectURL){var i=URL.createObjectURL(s);if(typeof chrome=="object"&&typeof(chrome.downloads||{}).download=="function")return URL.revokeObjectURL&&typeof setTimeout<"u"&&setTimeout(function(){URL.revokeObjectURL(i)},6e4),chrome.downloads.download({url:i,filename:e,saveAs:!0});var l=document.createElement("a");if(l.download!=null)return l.download=e,l.href=i,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL&&typeof setTimeout<"u"&&setTimeout(function(){URL.revokeObjectURL(i)},6e4),i}}if(typeof $<"u"&&typeof File<"u"&&typeof Folder<"u")try{var o=File(e);return o.open("w"),o.encoding="binary",Array.isArray(t)&&(t=Gc(t)),o.write(t),o.close(),t}catch(d){if(!d.message||!d.message.match(/onstruct/))throw d}throw new Error("cannot save file "+e)}function dge(e){if(typeof Deno<"u")return Deno.readFileSync(e);if(typeof $<"u"&&typeof File<"u"&&typeof Folder<"u")try{var t=File(e);t.open("r"),t.encoding="binary";var r=t.read();return t.close(),r}catch(a){if(!a.message||!a.message.match(/onstruct/))throw a}throw new Error("Cannot access file "+e)}function fa(e){for(var t=Object.keys(e),r=[],a=0;a<t.length;++a)Object.prototype.hasOwnProperty.call(e,t[a])&&r.push(t[a]);return r}function bD(e,t){for(var r=[],a=fa(e),s=0;s!==a.length;++s)r[e[a[s]][t]]==null&&(r[e[a[s]][t]]=a[s]);return r}function dv(e){for(var t=[],r=fa(e),a=0;a!==r.length;++a)t[e[r[a]]]=r[a];return t}function uv(e){for(var t=[],r=fa(e),a=0;a!==r.length;++a)t[e[r[a]]]=parseInt(r[a],10);return t}function uge(e){for(var t=[],r=fa(e),a=0;a!==r.length;++a)t[e[r[a]]]==null&&(t[e[r[a]]]=[]),t[e[r[a]]].push(r[a]);return t}var Vg=new Date(1899,11,30,0,0,0);function $a(e,t){var r=e.getTime(),a=Vg.getTime()+(e.getTimezoneOffset()-Vg.getTimezoneOffset())*6e4;return(r-a)/(1440*60*1e3)}var DQ=new Date,Age=Vg.getTime()+(DQ.getTimezoneOffset()-Vg.getTimezoneOffset())*6e4,vD=DQ.getTimezoneOffset();function Av(e){var t=new Date;return t.setTime(e*24*60*60*1e3+Age),t.getTimezoneOffset()!==vD&&t.setTime(t.getTime()+(t.getTimezoneOffset()-vD)*6e4),t}function fge(e){var t=0,r=0,a=!1,s=e.match(/P([0-9\.]+Y)?([0-9\.]+M)?([0-9\.]+D)?T([0-9\.]+H)?([0-9\.]+M)?([0-9\.]+S)?/);if(!s)throw new Error("|"+e+"| is not an ISO8601 Duration");for(var i=1;i!=s.length;++i)if(s[i]){switch(r=1,i>3&&(a=!0),s[i].slice(s[i].length-1)){case"Y":throw new Error("Unsupported ISO Duration Field: "+s[i].slice(s[i].length-1));case"D":r*=24;case"H":r*=60;case"M":if(a)r*=60;else throw new Error("Unsupported ISO Duration Field: M")}t+=r*parseInt(s[i],10)}return t}var yD=new Date("2017-02-19T19:06:09.000Z"),UQ=isNaN(yD.getFullYear())?new Date("2/19/17"):yD,pge=UQ.getFullYear()==2017;function Or(e,t){var r=new Date(e);if(pge)return t>0?r.setTime(r.getTime()+r.getTimezoneOffset()*60*1e3):t<0&&r.setTime(r.getTime()-r.getTimezoneOffset()*60*1e3),r;if(e instanceof Date)return e;if(UQ.getFullYear()==1917&&!isNaN(r.getFullYear())){var a=r.getFullYear();return e.indexOf(""+a)>-1||r.setFullYear(r.getFullYear()+100),r}var s=e.match(/\d+/g)||["2017","2","19","0","0","0"],i=new Date(+s[0],+s[1]-1,+s[2],+s[3]||0,+s[4]||0,+s[5]||0);return e.indexOf("Z")>-1&&(i=new Date(i.getTime()-i.getTimezoneOffset()*60*1e3)),i}function Kd(e,t){if(Mt&&Buffer.isBuffer(e)){if(t){if(e[0]==255&&e[1]==254)return ml(e.slice(2).toString("utf16le"));if(e[1]==254&&e[2]==255)return ml(wQ(e.slice(2).toString("binary")))}return e.toString("binary")}if(typeof TextDecoder<"u")try{if(t){if(e[0]==255&&e[1]==254)return ml(new TextDecoder("utf-16le").decode(e.slice(2)));if(e[0]==254&&e[1]==255)return ml(new TextDecoder("utf-16be").decode(e.slice(2)))}var r={"€":"","‚":"",ƒ:"","„":"","…":"","†":"","‡":"","ˆ":"","‰":"",Š:"","‹":"",Œ:"",Ž:"","‘":"","’":"","“":"","”":"","•":"","–":"","—":"","˜":"","™":"",š:"","›":"",œ:"",ž:"",Ÿ:""};return Array.isArray(e)&&(e=new Uint8Array(e)),new TextDecoder("latin1").decode(e).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g,function(i){return r[i]||i})}catch{}for(var a=[],s=0;s!=e.length;++s)a.push(String.fromCharCode(e[s]));return a.join("")}function Pr(e){if(typeof JSON<"u"&&!Array.isArray(e))return JSON.parse(JSON.stringify(e));if(typeof e!="object"||e==null)return e;if(e instanceof Date)return new Date(e.getTime());var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=Pr(e[r]));return t}function oa(e,t){for(var r="";r.length<t;)r+=e;return r}function Vi(e){var t=Number(e);if(!isNaN(t))return isFinite(t)?t:NaN;if(!/\d/.test(e))return t;var r=1,a=e.replace(/([\d]),([\d])/g,"$1$2").replace(/[$]/g,"").replace(/[%]/g,function(){return r*=100,""});return!isNaN(t=Number(a))||(a=a.replace(/[(](.*)[)]/,function(s,i){return r=-r,i}),!isNaN(t=Number(a)))?t/r:t}var xge=["january","february","march","april","may","june","july","august","september","october","november","december"];function DA(e){var t=new Date(e),r=new Date(NaN),a=t.getYear(),s=t.getMonth(),i=t.getDate();if(isNaN(i))return r;var l=e.toLowerCase();if(l.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)){if(l=l.replace(/[^a-z]/g,"").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,""),l.length>3&&xge.indexOf(l)==-1)return r}else if(l.match(/[a-z]/))return r;return a<0||a>8099?r:(s>0||i>1)&&a!=101?t:e.match(/[^-0-9:,\/\\]/)?r:t}var hge=(function(){var e="abacaba".split(/(:?b)/i).length==5;return function(r,a,s){if(e||typeof a=="string")return r.split(a);for(var i=r.split(a),l=[i[0]],o=1;o<i.length;++o)l.push(s),l.push(i[o]);return l}})();function MQ(e){return e?e.content&&e.type?Kd(e.content,!0):e.data?wf(e.data):e.asNodeBuffer&&Mt?wf(e.asNodeBuffer().toString("binary")):e.asBinary?wf(e.asBinary()):e._data&&e._data.getContent?wf(Kd(Array.prototype.slice.call(e._data.getContent(),0))):null:null}function RQ(e){if(!e)return null;if(e.data)return cD(e.data);if(e.asNodeBuffer&&Mt)return e.asNodeBuffer();if(e._data&&e._data.getContent){var t=e._data.getContent();return typeof t=="string"?cD(t):Array.prototype.slice.call(t)}return e.content&&e.type?e.content:null}function mge(e){return e&&e.name.slice(-4)===".bin"?RQ(e):MQ(e)}function ui(e,t){for(var r=e.FullPaths||fa(e.files),a=t.toLowerCase().replace(/[\/]/g,"\\"),s=a.replace(/\\/g,"/"),i=0;i<r.length;++i){var l=r[i].replace(/^Root Entry[\/]/,"").toLowerCase();if(a==l||s==l)return e.files?e.files[r[i]]:e.FileIndex[i]}return null}function oE(e,t){var r=ui(e,t);if(r==null)throw new Error("Cannot find file "+t+" in zip");return r}function Ba(e,t,r){if(!r)return mge(oE(e,t));if(!t)return null;try{return Ba(e,t)}catch{return null}}function Os(e,t,r){if(!r)return MQ(oE(e,t));if(!t)return null;try{return Os(e,t)}catch{return null}}function gge(e,t,r){return RQ(oE(e,t))}function wD(e){for(var t=e.FullPaths||fa(e.files),r=[],a=0;a<t.length;++a)t[a].slice(-1)!="/"&&r.push(t[a].replace(/^Root Entry[\/]/,""));return r.sort()}function Dt(e,t,r){if(e.FullPaths){if(typeof r=="string"){var a;return Mt?a=Ro(r):a=Mme(r),xt.utils.cfb_add(e,t,a)}xt.utils.cfb_add(e,t,r)}else e.file(t,r)}function cE(){return xt.utils.cfb_new()}function OQ(e,t){switch(t.type){case"base64":return xt.read(e,{type:"base64"});case"binary":return xt.read(e,{type:"binary"});case"buffer":case"array":return xt.read(e,{type:"buffer"})}throw new Error("Unrecognized type "+t.type)}function Cf(e,t){if(e.charAt(0)=="/")return e.slice(1);var r=t.split("/");t.slice(-1)!="/"&&r.pop();for(var a=e.split("/");a.length!==0;){var s=a.shift();s===".."?r.pop():s!=="."&&r.push(s)}return r.join("/")}var wa=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
`,bge=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g,ND=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/mg,vge=/<[^>]*>/g,zn=wa.match(ND)?ND:vge,yge=/<\w*:/,wge=/<(\/?)\w+:/;function Nt(e,t,r){for(var a={},s=0,i=0;s!==e.length&&!((i=e.charCodeAt(s))===32||i===10||i===13);++s);if(t||(a[0]=e.slice(0,s)),s===e.length)return a;var l=e.match(bge),o=0,d="",u=0,f="",p="",h=1;if(l)for(u=0;u!=l.length;++u){for(p=l[u],i=0;i!=p.length&&p.charCodeAt(i)!==61;++i);for(f=p.slice(0,i).trim();p.charCodeAt(i+1)==32;)++i;for(h=(s=p.charCodeAt(i+1))==34||s==39?1:0,d=p.slice(i+1+h,p.length-h),o=0;o!=f.length&&f.charCodeAt(o)!==58;++o);if(o===f.length)f.indexOf("_")>0&&(f=f.slice(0,f.indexOf("_"))),a[f]=d,a[f.toLowerCase()]=d;else{var m=(o===5&&f.slice(0,5)==="xmlns"?"xmlns":"")+f.slice(o+1);if(a[m]&&f.slice(o-3,o)=="ext")continue;a[m]=d,a[m.toLowerCase()]=d}}return a}function Tl(e){return e.replace(wge,"<$1")}var PQ={"&quot;":'"',"&apos;":"'","&gt;":">","&lt;":"<","&amp;":"&"},dE=dv(PQ),Wt=(function(){var e=/&(?:quot|apos|gt|lt|amp|#x?([\da-fA-F]+));/ig,t=/_x([\da-fA-F]{4})_/ig;return function r(a){var s=a+"",i=s.indexOf("<![CDATA[");if(i==-1)return s.replace(e,function(o,d){return PQ[o]||String.fromCharCode(parseInt(d,o.indexOf("x")>-1?16:10))||o}).replace(t,function(o,d){return String.fromCharCode(parseInt(d,16))});var l=s.indexOf("]]>");return r(s.slice(0,i))+s.slice(i+9,l)+r(s.slice(l+3))}})(),uE=/[&<>'"]/g,Nge=/[\u0000-\u0008\u000b-\u001f]/g;function ur(e){var t=e+"";return t.replace(uE,function(r){return dE[r]}).replace(Nge,function(r){return"_x"+("000"+r.charCodeAt(0).toString(16)).slice(-4)+"_"})}function CD(e){return ur(e).replace(/ /g,"_x0020_")}var LQ=/[\u0000-\u001f]/g;function AE(e){var t=e+"";return t.replace(uE,function(r){return dE[r]}).replace(/\n/g,"<br/>").replace(LQ,function(r){return"&#x"+("000"+r.charCodeAt(0).toString(16)).slice(-4)+";"})}function Cge(e){var t=e+"";return t.replace(uE,function(r){return dE[r]}).replace(LQ,function(r){return"&#x"+r.charCodeAt(0).toString(16).toUpperCase()+";"})}var kD=(function(){var e=/&#(\d+);/g;function t(r,a){return String.fromCharCode(parseInt(a,10))}return function(a){return a.replace(e,t)}})();function kge(e){return e.replace(/(\r\n|[\r\n])/g,"&#10;")}function Mr(e){switch(e){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}function E2(e){for(var t="",r=0,a=0,s=0,i=0,l=0,o=0;r<e.length;){if(a=e.charCodeAt(r++),a<128){t+=String.fromCharCode(a);continue}if(s=e.charCodeAt(r++),a>191&&a<224){l=(a&31)<<6,l|=s&63,t+=String.fromCharCode(l);continue}if(i=e.charCodeAt(r++),a<240){t+=String.fromCharCode((a&15)<<12|(s&63)<<6|i&63);continue}l=e.charCodeAt(r++),o=((a&7)<<18|(s&63)<<12|(i&63)<<6|l&63)-65536,t+=String.fromCharCode(55296+(o>>>10&1023)),t+=String.fromCharCode(56320+(o&1023))}return t}function jD(e){var t=Dc(2*e.length),r,a,s=1,i=0,l=0,o;for(a=0;a<e.length;a+=s)s=1,(o=e.charCodeAt(a))<128?r=o:o<224?(r=(o&31)*64+(e.charCodeAt(a+1)&63),s=2):o<240?(r=(o&15)*4096+(e.charCodeAt(a+1)&63)*64+(e.charCodeAt(a+2)&63),s=3):(s=4,r=(o&7)*262144+(e.charCodeAt(a+1)&63)*4096+(e.charCodeAt(a+2)&63)*64+(e.charCodeAt(a+3)&63),r-=65536,l=55296+(r>>>10&1023),r=56320+(r&1023)),l!==0&&(t[i++]=l&255,t[i++]=l>>>8,l=0),t[i++]=r%256,t[i++]=r>>>8;return t.slice(0,i).toString("ucs2")}function ED(e){return Ro(e,"binary").toString("utf8")}var Hh="foo bar bazâð£",gr=Mt&&(ED(Hh)==E2(Hh)&&ED||jD(Hh)==E2(Hh)&&jD)||E2,ml=Mt?function(e){return Ro(e,"utf8").toString("binary")}:function(e){for(var t=[],r=0,a=0,s=0;r<e.length;)switch(a=e.charCodeAt(r++),!0){case a<128:t.push(String.fromCharCode(a));break;case a<2048:t.push(String.fromCharCode(192+(a>>6))),t.push(String.fromCharCode(128+(a&63)));break;case(a>=55296&&a<57344):a-=55296,s=e.charCodeAt(r++)-56320+(a<<10),t.push(String.fromCharCode(240+(s>>18&7))),t.push(String.fromCharCode(144+(s>>12&63))),t.push(String.fromCharCode(128+(s>>6&63))),t.push(String.fromCharCode(128+(s&63)));break;default:t.push(String.fromCharCode(224+(a>>12))),t.push(String.fromCharCode(128+(a>>6&63))),t.push(String.fromCharCode(128+(a&63)))}return t.join("")},gp=(function(){var e={};return function(r,a){var s=r+"|"+(a||"");return e[s]?e[s]:e[s]=new RegExp("<(?:\\w+:)?"+r+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+r+">",a||"")}})(),QQ=(function(){var e=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(t){return[new RegExp("&"+t[0]+";","ig"),t[1]]});return function(r){for(var a=r.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,`
`).replace(/<[^>]*>/g,""),s=0;s<e.length;++s)a=a.replace(e[s][0],e[s][1]);return a}})(),jge=(function(){var e={};return function(r){return e[r]!==void 0?e[r]:e[r]=new RegExp("<(?:vt:)?"+r+">([\\s\\S]*?)</(?:vt:)?"+r+">","g")}})(),Ege=/<\/?(?:vt:)?variant>/g,Sge=/<(?:vt:)([^>]*)>([\s\S]*)</;function SD(e,t){var r=Nt(e),a=e.match(jge(r.baseType))||[],s=[];if(a.length!=r.size){if(t.WTF)throw new Error("unexpected vector length "+a.length+" != "+r.size);return s}return a.forEach(function(i){var l=i.replace(Ege,"").match(Sge);l&&s.push({v:gr(l[2]),t:l[1]})}),s}var HQ=/(^\s|\s$|\n)/;function yn(e,t){return"<"+e+(t.match(HQ)?' xml:space="preserve"':"")+">"+t+"</"+e+">"}function bp(e){return fa(e).map(function(t){return" "+t+'="'+e[t]+'"'}).join("")}function We(e,t,r){return"<"+e+(r!=null?bp(r):"")+(t!=null?(t.match(HQ)?' xml:space="preserve"':"")+">"+t+"</"+e:"/")+">"}function NC(e,t){try{return e.toISOString().replace(/\.\d*/,"")}catch(r){if(t)throw r}return""}function Bge(e,t){switch(typeof e){case"string":var r=We("vt:lpwstr",ur(e));return r=r.replace(/&quot;/g,"_x0022_"),r;case"number":return We((e|0)==e?"vt:i4":"vt:r8",ur(String(e)));case"boolean":return We("vt:bool",e?"true":"false")}if(e instanceof Date)return We("vt:filetime",NC(e));throw new Error("Unable to serialize "+e)}function fE(e){if(Mt&&Buffer.isBuffer(e))return e.toString("utf8");if(typeof e=="string")return e;if(typeof Uint8Array<"u"&&e instanceof Uint8Array)return gr(Gc(sE(e)));throw new Error("Bad input format: expected Buffer or string")}var vp=/<(\/?)([^\s?><!\/:]*:|)([^\s?<>:\/]+)(?:[\s?:\/][^>]*)?>/mg,Qa={CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",CT:"http://schemas.openxmlformats.org/package/2006/content-types",RELS:"http://schemas.openxmlformats.org/package/2006/relationships",TCMNT:"http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSchema"},su=["http://schemas.openxmlformats.org/spreadsheetml/2006/main","http://purl.oclc.org/ooxml/spreadsheetml/main","http://schemas.microsoft.com/office/excel/2006/main","http://schemas.microsoft.com/office/excel/2006/2"],Ds={o:"urn:schemas-microsoft-com:office:office",x:"urn:schemas-microsoft-com:office:excel",ss:"urn:schemas-microsoft-com:office:spreadsheet",dt:"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882",mv:"http://macVmlSchemaUri",v:"urn:schemas-microsoft-com:vml",html:"http://www.w3.org/TR/REC-html40"};function _ge(e,t){for(var r=1-2*(e[t+7]>>>7),a=((e[t+7]&127)<<4)+(e[t+6]>>>4&15),s=e[t+6]&15,i=5;i>=0;--i)s=s*256+e[t+i];return a==2047?s==0?r*(1/0):NaN:(a==0?a=-1022:(a-=1023,s+=Math.pow(2,52)),r*Math.pow(2,a-52)*s)}function Tge(e,t,r){var a=(t<0||1/t==-1/0?1:0)<<7,s=0,i=0,l=a?-t:t;isFinite(l)?l==0?s=i=0:(s=Math.floor(Math.log(l)/Math.LN2),i=l*Math.pow(2,52-s),s<=-1023&&(!isFinite(i)||i<Math.pow(2,52))?s=-1022:(i-=Math.pow(2,52),s+=1023)):(s=2047,i=isNaN(t)?26985:0);for(var o=0;o<=5;++o,i/=256)e[r+o]=i&255;e[r+6]=(s&15)<<4|i&15,e[r+7]=s>>4|a}var BD=function(e){for(var t=[],r=10240,a=0;a<e[0].length;++a)if(e[0][a])for(var s=0,i=e[0][a].length;s<i;s+=r)t.push.apply(t,e[0][a].slice(s,s+r));return t},_D=Mt?function(e){return e[0].length>0&&Buffer.isBuffer(e[0][0])?Buffer.concat(e[0].map(function(t){return Buffer.isBuffer(t)?t:Ro(t)})):BD(e)}:BD,TD=function(e,t,r){for(var a=[],s=t;s<r;s+=2)a.push(String.fromCharCode(lo(e,s)));return a.join("").replace(Jn,"")},pE=Mt?function(e,t,r){return Buffer.isBuffer(e)?e.toString("utf16le",t,r).replace(Jn,""):TD(e,t,r)}:TD,ID=function(e,t,r){for(var a=[],s=t;s<t+r;++s)a.push(("0"+e[s].toString(16)).slice(-2));return a.join("")},zQ=Mt?function(e,t,r){return Buffer.isBuffer(e)?e.toString("hex",t,t+r):ID(e,t,r)}:ID,FD=function(e,t,r){for(var a=[],s=t;s<r;s++)a.push(String.fromCharCode(lA(e,s)));return a.join("")},ex=Mt?function(t,r,a){return Buffer.isBuffer(t)?t.toString("utf8",r,a):FD(t,r,a)}:FD,$Q=function(e,t){var r=Us(e,t);return r>0?ex(e,t+4,t+4+r-1):""},VQ=$Q,GQ=function(e,t){var r=Us(e,t);return r>0?ex(e,t+4,t+4+r-1):""},KQ=GQ,qQ=function(e,t){var r=2*Us(e,t);return r>0?ex(e,t+4,t+4+r-1):""},WQ=qQ,YQ=function(t,r){var a=Us(t,r);return a>0?pE(t,r+4,r+4+a):""},XQ=YQ,JQ=function(e,t){var r=Us(e,t);return r>0?ex(e,t+4,t+4+r):""},ZQ=JQ,e9=function(e,t){return _ge(e,t)},Gg=e9,xE=function(t){return Array.isArray(t)||typeof Uint8Array<"u"&&t instanceof Uint8Array};Mt&&(VQ=function(t,r){if(!Buffer.isBuffer(t))return $Q(t,r);var a=t.readUInt32LE(r);return a>0?t.toString("utf8",r+4,r+4+a-1):""},KQ=function(t,r){if(!Buffer.isBuffer(t))return GQ(t,r);var a=t.readUInt32LE(r);return a>0?t.toString("utf8",r+4,r+4+a-1):""},WQ=function(t,r){if(!Buffer.isBuffer(t))return qQ(t,r);var a=2*t.readUInt32LE(r);return t.toString("utf16le",r+4,r+4+a-1)},XQ=function(t,r){if(!Buffer.isBuffer(t))return YQ(t,r);var a=t.readUInt32LE(r);return t.toString("utf16le",r+4,r+4+a)},ZQ=function(t,r){if(!Buffer.isBuffer(t))return JQ(t,r);var a=t.readUInt32LE(r);return t.toString("utf8",r+4,r+4+a)},Gg=function(t,r){return Buffer.isBuffer(t)?t.readDoubleLE(r):e9(t,r)},xE=function(t){return Buffer.isBuffer(t)||Array.isArray(t)||typeof Uint8Array<"u"&&t instanceof Uint8Array});var lA=function(e,t){return e[t]},lo=function(e,t){return e[t+1]*256+e[t]},Ige=function(e,t){var r=e[t+1]*256+e[t];return r<32768?r:(65535-r+1)*-1},Us=function(e,t){return e[t+3]*(1<<24)+(e[t+2]<<16)+(e[t+1]<<8)+e[t]},bd=function(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]},Fge=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};function Df(e,t){var r="",a,s,i=[],l,o,d,u;switch(t){case"dbcs":if(u=this.l,Mt&&Buffer.isBuffer(this))r=this.slice(this.l,this.l+2*e).toString("utf16le");else for(d=0;d<e;++d)r+=String.fromCharCode(lo(this,u)),u+=2;e*=2;break;case"utf8":r=ex(this,this.l,this.l+e);break;case"utf16le":e*=2,r=pE(this,this.l,this.l+e);break;case"wstr":return Df.call(this,e,"dbcs");case"lpstr-ansi":r=VQ(this,this.l),e=4+Us(this,this.l);break;case"lpstr-cp":r=KQ(this,this.l),e=4+Us(this,this.l);break;case"lpwstr":r=WQ(this,this.l),e=4+2*Us(this,this.l);break;case"lpp4":e=4+Us(this,this.l),r=XQ(this,this.l),e&2&&(e+=2);break;case"8lpp4":e=4+Us(this,this.l),r=ZQ(this,this.l),e&3&&(e+=4-(e&3));break;case"cstr":for(e=0,r="";(l=lA(this,this.l+e++))!==0;)i.push(Qh(l));r=i.join("");break;case"_wstr":for(e=0,r="";(l=lo(this,this.l+e))!==0;)i.push(Qh(l)),e+=2;e+=2,r=i.join("");break;case"dbcs-cont":for(r="",u=this.l,d=0;d<e;++d){if(this.lens&&this.lens.indexOf(u)!==-1)return l=lA(this,u),this.l=u+1,o=Df.call(this,e-d,l?"dbcs-cont":"sbcs-cont"),i.join("")+o;i.push(Qh(lo(this,u))),u+=2}r=i.join(""),e*=2;break;case"cpstr":case"sbcs-cont":for(r="",u=this.l,d=0;d!=e;++d){if(this.lens&&this.lens.indexOf(u)!==-1)return l=lA(this,u),this.l=u+1,o=Df.call(this,e-d,l?"dbcs-cont":"sbcs-cont"),i.join("")+o;i.push(Qh(lA(this,u))),u+=1}r=i.join("");break;default:switch(e){case 1:return a=lA(this,this.l),this.l++,a;case 2:return a=(t==="i"?Ige:lo)(this,this.l),this.l+=2,a;case 4:case-4:return t==="i"||(this[this.l+3]&128)===0?(a=(e>0?bd:Fge)(this,this.l),this.l+=4,a):(s=Us(this,this.l),this.l+=4,s);case 8:case-8:if(t==="f")return e==8?s=Gg(this,this.l):s=Gg([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]],0),this.l+=8,s;e=8;case 16:r=zQ(this,this.l,e);break}}return this.l+=e,r}var Dge=function(e,t,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24&255},Uge=function(e,t,r){e[r]=t&255,e[r+1]=t>>8&255,e[r+2]=t>>16&255,e[r+3]=t>>24&255},Mge=function(e,t,r){e[r]=t&255,e[r+1]=t>>>8&255};function Rge(e,t,r){var a=0,s=0;if(r==="dbcs"){for(s=0;s!=t.length;++s)Mge(this,t.charCodeAt(s),this.l+2*s);a=2*t.length}else if(r==="sbcs"){for(t=t.replace(/[^\x00-\x7F]/g,"_"),s=0;s!=t.length;++s)this[this.l+s]=t.charCodeAt(s)&255;a=t.length}else if(r==="hex"){for(;s<e;++s)this[this.l++]=parseInt(t.slice(2*s,2*s+2),16)||0;return this}else if(r==="utf16le"){var i=Math.min(this.l+e,this.length);for(s=0;s<Math.min(t.length,e);++s){var l=t.charCodeAt(s);this[this.l++]=l&255,this[this.l++]=l>>8}for(;this.l<i;)this[this.l++]=0;return this}else switch(e){case 1:a=1,this[this.l]=t&255;break;case 2:a=2,this[this.l]=t&255,t>>>=8,this[this.l+1]=t&255;break;case 3:a=3,this[this.l]=t&255,t>>>=8,this[this.l+1]=t&255,t>>>=8,this[this.l+2]=t&255;break;case 4:a=4,Dge(this,t,this.l);break;case 8:if(a=8,r==="f"){Tge(this,t,this.l);break}case 16:break;case-4:a=4,Uge(this,t,this.l);break}return this.l+=a,this}function t9(e,t){var r=zQ(this,this.l,e.length>>1);if(r!==e)throw new Error(t+"Expected "+e+" saw "+r);this.l+=e.length>>1}function vn(e,t){e.l=t,e.read_shift=Df,e.chk=t9,e.write_shift=Rge}function Hn(e,t){e.l+=t}function Oe(e){var t=Dc(e);return vn(t,0),t}function Oo(e,t,r){if(e){var a,s,i;vn(e,e.l||0);for(var l=e.length,o=0,d=0;e.l<l;){o=e.read_shift(1),o&128&&(o=(o&127)+((e.read_shift(1)&127)<<7));var u=jp[o]||jp[65535];for(a=e.read_shift(1),i=a&127,s=1;s<4&&a&128;++s)i+=((a=e.read_shift(1))&127)<<7*s;d=e.l+i;var f=u.f&&u.f(e,i,r);if(e.l=d,t(f,u,o))return}}}function ms(){var e=[],t=Mt?256:2048,r=function(u){var f=Oe(u);return vn(f,0),f},a=r(t),s=function(){a&&(a.length>a.l&&(a=a.slice(0,a.l),a.l=a.length),a.length>0&&e.push(a),a=null)},i=function(u){return a&&u<a.length-a.l?a:(s(),a=r(Math.max(u+1,t)))},l=function(){return s(),en(e)},o=function(u){s(),a=u,a.l==null&&(a.l=a.length),i(t)};return{next:i,push:o,end:l,_bufs:e}}function He(e,t,r,a){var s=+t,i;if(!isNaN(s)){a||(a=jp[s].p||(r||[]).length||0),i=1+(s>=128?1:0)+1,a>=128&&++i,a>=16384&&++i,a>=2097152&&++i;var l=e.next(i);s<=127?l.write_shift(1,s):(l.write_shift(1,(s&127)+128),l.write_shift(1,s>>7));for(var o=0;o!=4;++o)if(a>=128)l.write_shift(1,(a&127)+128),a>>=7;else{l.write_shift(1,a);break}a>0&&xE(r)&&e.push(r)}}function Uf(e,t,r){var a=Pr(e);if(t.s?(a.cRel&&(a.c+=t.s.c),a.rRel&&(a.r+=t.s.r)):(a.cRel&&(a.c+=t.c),a.rRel&&(a.r+=t.r)),!r||r.biff<12){for(;a.c>=256;)a.c-=256;for(;a.r>=65536;)a.r-=65536}return a}function DD(e,t,r){var a=Pr(e);return a.s=Uf(a.s,t.s,r),a.e=Uf(a.e,t.s,r),a}function Mf(e,t){if(e.cRel&&e.c<0)for(e=Pr(e);e.c<0;)e.c+=t>8?16384:256;if(e.rRel&&e.r<0)for(e=Pr(e);e.r<0;)e.r+=t>8?1048576:t>5?65536:16384;var r=yt(e);return!e.cRel&&e.cRel!=null&&(r=Lge(r)),!e.rRel&&e.rRel!=null&&(r=Oge(r)),r}function S2(e,t){return e.s.r==0&&!e.s.rRel&&e.e.r==(t.biff>=12?1048575:t.biff>=8?65536:16384)&&!e.e.rRel?(e.s.cRel?"":"$")+Jr(e.s.c)+":"+(e.e.cRel?"":"$")+Jr(e.e.c):e.s.c==0&&!e.s.cRel&&e.e.c==(t.biff>=12?16383:255)&&!e.e.cRel?(e.s.rRel?"":"$")+ya(e.s.r)+":"+(e.e.rRel?"":"$")+ya(e.e.r):Mf(e.s,t.biff)+":"+Mf(e.e,t.biff)}function hE(e){return parseInt(Pge(e),10)-1}function ya(e){return""+(e+1)}function Oge(e){return e.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function Pge(e){return e.replace(/\$(\d+)$/,"$1")}function mE(e){for(var t=Qge(e),r=0,a=0;a!==t.length;++a)r=26*r+t.charCodeAt(a)-64;return r-1}function Jr(e){if(e<0)throw new Error("invalid column "+e);var t="";for(++e;e;e=Math.floor((e-1)/26))t=String.fromCharCode((e-1)%26+65)+t;return t}function Lge(e){return e.replace(/^([A-Z])/,"$$$1")}function Qge(e){return e.replace(/^\$([A-Z])/,"$1")}function Hge(e){return e.replace(/(\$?[A-Z]*)(\$?\d*)/,"$1,$2").split(",")}function Zr(e){for(var t=0,r=0,a=0;a<e.length;++a){var s=e.charCodeAt(a);s>=48&&s<=57?t=10*t+(s-48):s>=65&&s<=90&&(r=26*r+(s-64))}return{c:r-1,r:t-1}}function yt(e){for(var t=e.c+1,r="";t;t=(t-1)/26|0)r=String.fromCharCode((t-1)%26+65)+r;return r+(e.r+1)}function ys(e){var t=e.indexOf(":");return t==-1?{s:Zr(e),e:Zr(e)}:{s:Zr(e.slice(0,t)),e:Zr(e.slice(t+1))}}function Tt(e,t){return typeof t>"u"||typeof t=="number"?Tt(e.s,e.e):(typeof e!="string"&&(e=yt(e)),typeof t!="string"&&(t=yt(t)),e==t?e:e+":"+t)}function Yt(e){var t={s:{c:0,r:0},e:{c:0,r:0}},r=0,a=0,s=0,i=e.length;for(r=0;a<i&&!((s=e.charCodeAt(a)-64)<1||s>26);++a)r=26*r+s;for(t.s.c=--r,r=0;a<i&&!((s=e.charCodeAt(a)-48)<0||s>9);++a)r=10*r+s;if(t.s.r=--r,a===i||s!=10)return t.e.c=t.s.c,t.e.r=t.s.r,t;for(++a,r=0;a!=i&&!((s=e.charCodeAt(a)-64)<1||s>26);++a)r=26*r+s;for(t.e.c=--r,r=0;a!=i&&!((s=e.charCodeAt(a)-48)<0||s>9);++a)r=10*r+s;return t.e.r=--r,t}function UD(e,t){var r=e.t=="d"&&t instanceof Date;if(e.z!=null)try{return e.w=ji(e.z,r?$a(t):t)}catch{}try{return e.w=ji((e.XF||{}).numFmtId||(r?14:0),r?$a(t):t)}catch{return""+t}}function Co(e,t,r){return e==null||e.t==null||e.t=="z"?"":e.w!==void 0?e.w:(e.t=="d"&&!e.z&&r&&r.dateNF&&(e.z=r.dateNF),e.t=="e"?Po[e.v]||e.v:t==null?UD(e,e.v):UD(e,t))}function Kc(e,t){var r=t&&t.sheet?t.sheet:"Sheet1",a={};return a[r]=e,{SheetNames:[r],Sheets:a}}function r9(e,t,r){var a=r||{},s=e?Array.isArray(e):a.dense,i=e||(s?[]:{}),l=0,o=0;if(i&&a.origin!=null){if(typeof a.origin=="number")l=a.origin;else{var d=typeof a.origin=="string"?Zr(a.origin):a.origin;l=d.r,o=d.c}i["!ref"]||(i["!ref"]="A1:A1")}var u={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(i["!ref"]){var f=Yt(i["!ref"]);u.s.c=f.s.c,u.s.r=f.s.r,u.e.c=Math.max(u.e.c,f.e.c),u.e.r=Math.max(u.e.r,f.e.r),l==-1&&(u.e.r=l=f.e.r+1)}for(var p=0;p!=t.length;++p)if(t[p]){if(!Array.isArray(t[p]))throw new Error("aoa_to_sheet expects an array of arrays");for(var h=0;h!=t[p].length;++h)if(!(typeof t[p][h]>"u")){var m={v:t[p][h]},b=l+p,v=o+h;if(u.s.r>b&&(u.s.r=b),u.s.c>v&&(u.s.c=v),u.e.r<b&&(u.e.r=b),u.e.c<v&&(u.e.c=v),t[p][h]&&typeof t[p][h]=="object"&&!Array.isArray(t[p][h])&&!(t[p][h]instanceof Date))m=t[p][h];else if(Array.isArray(m.v)&&(m.f=t[p][h][1],m.v=m.v[0]),m.v===null)if(m.f)m.t="n";else if(a.nullError)m.t="e",m.v=0;else if(a.sheetStubs)m.t="z";else continue;else typeof m.v=="number"?m.t="n":typeof m.v=="boolean"?m.t="b":m.v instanceof Date?(m.z=a.dateNF||vt[14],a.cellDates?(m.t="d",m.w=ji(m.z,$a(m.v))):(m.t="n",m.v=$a(m.v),m.w=ji(m.z,m.v))):m.t="s";if(s)i[b]||(i[b]=[]),i[b][v]&&i[b][v].z&&(m.z=i[b][v].z),i[b][v]=m;else{var y=yt({c:v,r:b});i[y]&&i[y].z&&(m.z=i[y].z),i[y]=m}}}return u.s.c<1e7&&(i["!ref"]=Tt(u)),i}function n0(e,t){return r9(null,e,t)}function zge(e){return e.read_shift(4,"i")}function Gi(e,t){return t||(t=Oe(4)),t.write_shift(4,e),t}function Pn(e){var t=e.read_shift(4);return t===0?"":e.read_shift(t,"dbcs")}function rn(e,t){var r=!1;return t==null&&(r=!0,t=Oe(4+2*e.length)),t.write_shift(4,e.length),e.length>0&&t.write_shift(0,e,"dbcs"),r?t.slice(0,t.l):t}function $ge(e){return{ich:e.read_shift(2),ifnt:e.read_shift(2)}}function Vge(e,t){return t||(t=Oe(4)),t.write_shift(2,0),t.write_shift(2,0),t}function gE(e,t){var r=e.l,a=e.read_shift(1),s=Pn(e),i=[],l={t:s,h:s};if((a&1)!==0){for(var o=e.read_shift(4),d=0;d!=o;++d)i.push($ge(e));l.r=i}else l.r=[{ich:0,ifnt:0}];return e.l=r+t,l}function Gge(e,t){var r=!1;return t==null&&(r=!0,t=Oe(15+4*e.t.length)),t.write_shift(1,0),rn(e.t,t),r?t.slice(0,t.l):t}var Kge=gE;function qge(e,t){var r=!1;return t==null&&(r=!0,t=Oe(23+4*e.t.length)),t.write_shift(1,1),rn(e.t,t),t.write_shift(4,1),Vge({},t),r?t.slice(0,t.l):t}function Si(e){var t=e.read_shift(4),r=e.read_shift(2);return r+=e.read_shift(1)<<16,e.l++,{c:t,iStyleRef:r}}function iu(e,t){return t==null&&(t=Oe(8)),t.write_shift(-4,e.c),t.write_shift(3,e.iStyleRef||e.s),t.write_shift(1,0),t}function lu(e){var t=e.read_shift(2);return t+=e.read_shift(1)<<16,e.l++,{c:-1,iStyleRef:t}}function ou(e,t){return t==null&&(t=Oe(4)),t.write_shift(3,e.iStyleRef||e.s),t.write_shift(1,0),t}var Wge=Pn,a9=rn;function bE(e){var t=e.read_shift(4);return t===0||t===4294967295?"":e.read_shift(t,"dbcs")}function Kg(e,t){var r=!1;return t==null&&(r=!0,t=Oe(127)),t.write_shift(4,e.length>0?e.length:4294967295),e.length>0&&t.write_shift(0,e,"dbcs"),r?t.slice(0,t.l):t}var Yge=Pn,CC=bE,vE=Kg;function yE(e){var t=e.slice(e.l,e.l+4),r=t[0]&1,a=t[0]&2;e.l+=4;var s=a===0?Gg([0,0,0,0,t[0]&252,t[1],t[2],t[3]],0):bd(t,0)>>2;return r?s/100:s}function n9(e,t){t==null&&(t=Oe(4));var r=0,a=0,s=e*100;if(e==(e|0)&&e>=-536870912&&e<1<<29?a=1:s==(s|0)&&s>=-536870912&&s<1<<29&&(a=1,r=1),a)t.write_shift(-4,((r?s:e)<<2)+(r+2));else throw new Error("unsupported RkNumber "+e)}function s9(e){var t={s:{},e:{}};return t.s.r=e.read_shift(4),t.e.r=e.read_shift(4),t.s.c=e.read_shift(4),t.e.c=e.read_shift(4),t}function Xge(e,t){return t||(t=Oe(16)),t.write_shift(4,e.s.r),t.write_shift(4,e.e.r),t.write_shift(4,e.s.c),t.write_shift(4,e.e.c),t}var cu=s9,s0=Xge;function On(e){if(e.length-e.l<8)throw"XLS Xnum Buffer underflow";return e.read_shift(8,"f")}function qd(e,t){return(t||Oe(8)).write_shift(8,e,"f")}function Jge(e){var t={},r=e.read_shift(1),a=r>>>1,s=e.read_shift(1),i=e.read_shift(2,"i"),l=e.read_shift(1),o=e.read_shift(1),d=e.read_shift(1);switch(e.l++,a){case 0:t.auto=1;break;case 1:t.index=s;var u=Td[s];u&&(t.rgb=wp(u));break;case 2:t.rgb=wp([l,o,d]);break;case 3:t.theme=s;break}return i!=0&&(t.tint=i>0?i/32767:i/32768),t}function qg(e,t){if(t||(t=Oe(8)),!e||e.auto)return t.write_shift(4,0),t.write_shift(4,0),t;e.index!=null?(t.write_shift(1,2),t.write_shift(1,e.index)):e.theme!=null?(t.write_shift(1,6),t.write_shift(1,e.theme)):(t.write_shift(1,5),t.write_shift(1,0));var r=e.tint||0;if(r>0?r*=32767:r<0&&(r*=32768),t.write_shift(2,r),!e.rgb||e.theme!=null)t.write_shift(2,0),t.write_shift(1,0),t.write_shift(1,0);else{var a=e.rgb||"FFFFFF";typeof a=="number"&&(a=("000000"+a.toString(16)).slice(-6)),t.write_shift(1,parseInt(a.slice(0,2),16)),t.write_shift(1,parseInt(a.slice(2,4),16)),t.write_shift(1,parseInt(a.slice(4,6),16)),t.write_shift(1,255)}return t}function Zge(e){var t=e.read_shift(1);e.l++;var r={fBold:t&1,fItalic:t&2,fUnderline:t&4,fStrikeout:t&8,fOutline:t&16,fShadow:t&32,fCondense:t&64,fExtend:t&128};return r}function ebe(e,t){t||(t=Oe(2));var r=(e.italic?2:0)|(e.strike?8:0)|(e.outline?16:0)|(e.shadow?32:0)|(e.condense?64:0)|(e.extend?128:0);return t.write_shift(1,r),t.write_shift(1,0),t}function i9(e,t){var r={2:"BITMAP",3:"METAFILEPICT",8:"DIB",14:"ENHMETAFILE"},a=e.read_shift(4);switch(a){case 0:return"";case 4294967295:case 4294967294:return r[e.read_shift(4)]||""}if(a>400)throw new Error("Unsupported Clipboard: "+a.toString(16));return e.l-=4,e.read_shift(0,t==1?"lpstr":"lpwstr")}function tbe(e){return i9(e,1)}function rbe(e){return i9(e,2)}var wE=2,fs=3,zh=11,MD=12,Wg=19,$h=64,abe=65,nbe=71,sbe=4108,ibe=4126,Za=80,l9=81,lbe=[Za,l9],kC={1:{n:"CodePage",t:wE},2:{n:"Category",t:Za},3:{n:"PresentationFormat",t:Za},4:{n:"ByteCount",t:fs},5:{n:"LineCount",t:fs},6:{n:"ParagraphCount",t:fs},7:{n:"SlideCount",t:fs},8:{n:"NoteCount",t:fs},9:{n:"HiddenCount",t:fs},10:{n:"MultimediaClipCount",t:fs},11:{n:"ScaleCrop",t:zh},12:{n:"HeadingPairs",t:sbe},13:{n:"TitlesOfParts",t:ibe},14:{n:"Manager",t:Za},15:{n:"Company",t:Za},16:{n:"LinksUpToDate",t:zh},17:{n:"CharacterCount",t:fs},19:{n:"SharedDoc",t:zh},22:{n:"HyperlinksChanged",t:zh},23:{n:"AppVersion",t:fs,p:"version"},24:{n:"DigSig",t:abe},26:{n:"ContentType",t:Za},27:{n:"ContentStatus",t:Za},28:{n:"Language",t:Za},29:{n:"Version",t:Za},255:{},2147483648:{n:"Locale",t:Wg},2147483651:{n:"Behavior",t:Wg},1919054434:{}},jC={1:{n:"CodePage",t:wE},2:{n:"Title",t:Za},3:{n:"Subject",t:Za},4:{n:"Author",t:Za},5:{n:"Keywords",t:Za},6:{n:"Comments",t:Za},7:{n:"Template",t:Za},8:{n:"LastAuthor",t:Za},9:{n:"RevNumber",t:Za},10:{n:"EditTime",t:$h},11:{n:"LastPrinted",t:$h},12:{n:"CreatedDate",t:$h},13:{n:"ModifiedDate",t:$h},14:{n:"PageCount",t:fs},15:{n:"WordCount",t:fs},16:{n:"CharCount",t:fs},17:{n:"Thumbnail",t:nbe},18:{n:"Application",t:Za},19:{n:"DocSecurity",t:fs},255:{},2147483648:{n:"Locale",t:Wg},2147483651:{n:"Behavior",t:Wg},1919054434:{}},RD={1:"US",2:"CA",3:"",7:"RU",20:"EG",30:"GR",31:"NL",32:"BE",33:"FR",34:"ES",36:"HU",39:"IT",41:"CH",43:"AT",44:"GB",45:"DK",46:"SE",47:"NO",48:"PL",49:"DE",52:"MX",55:"BR",61:"AU",64:"NZ",66:"TH",81:"JP",82:"KR",84:"VN",86:"CN",90:"TR",105:"JS",213:"DZ",216:"MA",218:"LY",351:"PT",354:"IS",358:"FI",420:"CZ",886:"TW",961:"LB",962:"JO",963:"SY",964:"IQ",965:"KW",966:"SA",971:"AE",972:"IL",974:"QA",981:"IR",65535:"US"},obe=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];function cbe(e){return e.map(function(t){return[t>>16&255,t>>8&255,t&255]})}var dbe=cbe([0,16777215,16711680,65280,255,16776960,16711935,65535,0,16777215,16711680,65280,255,16776960,16711935,65535,8388608,32768,128,8421376,8388736,32896,12632256,8421504,10066431,10040166,16777164,13434879,6684774,16744576,26316,13421823,128,16711935,16776960,65535,8388736,8388608,32896,255,52479,13434879,13434828,16777113,10079487,16751052,13408767,16764057,3368703,3394764,10079232,16763904,16750848,16737792,6710937,9868950,13158,3381606,13056,3355392,10040064,10040166,3355545,3355443,16777215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Td=Pr(dbe),Po={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},o9={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43,"#WTF?":255},EC={"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":"workbooks","application/vnd.ms-excel.sheet.macroEnabled.main+xml":"workbooks","application/vnd.ms-excel.sheet.binary.macroEnabled.main":"workbooks","application/vnd.ms-excel.addin.macroEnabled.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":"workbooks","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":"sheets","application/vnd.ms-excel.worksheet":"sheets","application/vnd.ms-excel.binIndexWs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":"charts","application/vnd.ms-excel.chartsheet":"charts","application/vnd.ms-excel.macrosheet+xml":"macros","application/vnd.ms-excel.macrosheet":"macros","application/vnd.ms-excel.intlmacrosheet":"TODO","application/vnd.ms-excel.binIndexMs":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":"dialogs","application/vnd.ms-excel.dialogsheet":"dialogs","application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml":"strs","application/vnd.ms-excel.sharedStrings":"strs","application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":"styles","application/vnd.ms-excel.styles":"styles","application/vnd.openxmlformats-package.core-properties+xml":"coreprops","application/vnd.openxmlformats-officedocument.custom-properties+xml":"custprops","application/vnd.openxmlformats-officedocument.extended-properties+xml":"extprops","application/vnd.openxmlformats-officedocument.customXmlProperties+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":"comments","application/vnd.ms-excel.comments":"comments","application/vnd.ms-excel.threadedcomments+xml":"threadedcomments","application/vnd.ms-excel.person+xml":"people","application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml":"metadata","application/vnd.ms-excel.sheetMetadata":"metadata","application/vnd.ms-excel.pivotTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.chart+xml":"TODO","application/vnd.ms-office.chartcolorstyle+xml":"TODO","application/vnd.ms-office.chartstyle+xml":"TODO","application/vnd.ms-office.chartex+xml":"TODO","application/vnd.ms-excel.calcChain":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml":"calcchains","application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings":"TODO","application/vnd.ms-office.activeX":"TODO","application/vnd.ms-office.activeX+xml":"TODO","application/vnd.ms-excel.attachedToolbars":"TODO","application/vnd.ms-excel.connections":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":"TODO","application/vnd.ms-excel.externalLink":"links","application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml":"links","application/vnd.ms-excel.pivotCacheDefinition":"TODO","application/vnd.ms-excel.pivotCacheRecords":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml":"TODO","application/vnd.ms-excel.queryTable":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml":"TODO","application/vnd.ms-excel.userNames":"TODO","application/vnd.ms-excel.revisionHeaders":"TODO","application/vnd.ms-excel.revisionLog":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml":"TODO","application/vnd.ms-excel.tableSingleCells":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml":"TODO","application/vnd.ms-excel.slicer":"TODO","application/vnd.ms-excel.slicerCache":"TODO","application/vnd.ms-excel.slicer+xml":"TODO","application/vnd.ms-excel.slicerCache+xml":"TODO","application/vnd.ms-excel.wsSortMap":"TODO","application/vnd.ms-excel.table":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":"TODO","application/vnd.openxmlformats-officedocument.theme+xml":"themes","application/vnd.openxmlformats-officedocument.themeOverride+xml":"TODO","application/vnd.ms-excel.Timeline+xml":"TODO","application/vnd.ms-excel.TimelineCache+xml":"TODO","application/vnd.ms-office.vbaProject":"vba","application/vnd.ms-office.vbaProjectSignature":"TODO","application/vnd.ms-office.volatileDependencies":"TODO","application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml":"TODO","application/vnd.ms-excel.controlproperties+xml":"TODO","application/vnd.openxmlformats-officedocument.model+data":"TODO","application/vnd.ms-excel.Survey+xml":"TODO","application/vnd.openxmlformats-officedocument.drawing+xml":"drawings","application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml":"TODO","application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml":"TODO","application/vnd.openxmlformats-officedocument.vmlDrawing":"TODO","application/vnd.openxmlformats-package.relationships+xml":"rels","application/vnd.openxmlformats-officedocument.oleObject":"TODO","image/png":"TODO",sheet:"js"},Vh={workbooks:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",xlsm:"application/vnd.ms-excel.sheet.macroEnabled.main+xml",xlsb:"application/vnd.ms-excel.sheet.binary.macroEnabled.main",xlam:"application/vnd.ms-excel.addin.macroEnabled.main+xml",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"},strs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",xlsb:"application/vnd.ms-excel.sharedStrings"},comments:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",xlsb:"application/vnd.ms-excel.comments"},sheets:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",xlsb:"application/vnd.ms-excel.worksheet"},charts:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",xlsb:"application/vnd.ms-excel.chartsheet"},dialogs:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",xlsb:"application/vnd.ms-excel.dialogsheet"},macros:{xlsx:"application/vnd.ms-excel.macrosheet+xml",xlsb:"application/vnd.ms-excel.macrosheet"},metadata:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",xlsb:"application/vnd.ms-excel.sheetMetadata"},styles:{xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",xlsb:"application/vnd.ms-excel.styles"}};function NE(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function ube(e){var t=NE();if(!e||!e.match)return t;var r={};if((e.match(zn)||[]).forEach(function(a){var s=Nt(a);switch(s[0].replace(yge,"<")){case"<?xml":break;case"<Types":t.xmlns=s["xmlns"+(s[0].match(/<(\w+):/)||["",""])[1]];break;case"<Default":r[s.Extension]=s.ContentType;break;case"<Override":t[EC[s.ContentType]]!==void 0&&t[EC[s.ContentType]].push(s.PartName);break}}),t.xmlns!==Qa.CT)throw new Error("Unknown Namespace: "+t.xmlns);return t.calcchain=t.calcchains.length>0?t.calcchains[0]:"",t.sst=t.strs.length>0?t.strs[0]:"",t.style=t.styles.length>0?t.styles[0]:"",t.defaults=r,delete t.calcchains,t}function c9(e,t){var r=uge(EC),a=[],s;a[a.length]=wa,a[a.length]=We("Types",null,{xmlns:Qa.CT,"xmlns:xsd":Qa.xsd,"xmlns:xsi":Qa.xsi}),a=a.concat([["xml","application/xml"],["bin","application/vnd.ms-excel.sheet.binary.macroEnabled.main"],["vml","application/vnd.openxmlformats-officedocument.vmlDrawing"],["data","application/vnd.openxmlformats-officedocument.model+data"],["bmp","image/bmp"],["png","image/png"],["gif","image/gif"],["emf","image/x-emf"],["wmf","image/x-wmf"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["tif","image/tiff"],["tiff","image/tiff"],["pdf","application/pdf"],["rels","application/vnd.openxmlformats-package.relationships+xml"]].map(function(d){return We("Default",null,{Extension:d[0],ContentType:d[1]})}));var i=function(d){e[d]&&e[d].length>0&&(s=e[d][0],a[a.length]=We("Override",null,{PartName:(s[0]=="/"?"":"/")+s,ContentType:Vh[d][t.bookType]||Vh[d].xlsx}))},l=function(d){(e[d]||[]).forEach(function(u){a[a.length]=We("Override",null,{PartName:(u[0]=="/"?"":"/")+u,ContentType:Vh[d][t.bookType]||Vh[d].xlsx})})},o=function(d){(e[d]||[]).forEach(function(u){a[a.length]=We("Override",null,{PartName:(u[0]=="/"?"":"/")+u,ContentType:r[d][0]})})};return i("workbooks"),l("sheets"),l("charts"),o("themes"),["strs","styles"].forEach(i),["coreprops","extprops","custprops"].forEach(o),o("vba"),o("comments"),o("threadedcomments"),o("drawings"),l("metadata"),o("people"),a.length>2&&(a[a.length]="</Types>",a[1]=a[1].replace("/>",">")),a.join("")}var Ot={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",CMNT:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",CORE_PROPS:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",EXT_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",CUST_PROPS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",SST:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",STY:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",THEME:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",CHART:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",CHARTEX:"http://schemas.microsoft.com/office/2014/relationships/chartEx",CS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet",WS:["http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet","http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"],DS:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet",MS:"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet",IMG:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",DRAW:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",XLMETA:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",TCMNT:"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",PEOPLE:"http://schemas.microsoft.com/office/2017/10/relationships/person",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};function yp(e){var t=e.lastIndexOf("/");return e.slice(0,t+1)+"_rels/"+e.slice(t+1)+".rels"}function Rf(e,t){var r={"!id":{}};if(!e)return r;t.charAt(0)!=="/"&&(t="/"+t);var a={};return(e.match(zn)||[]).forEach(function(s){var i=Nt(s);if(i[0]==="<Relationship"){var l={};l.Type=i.Type,l.Target=i.Target,l.Id=i.Id,i.TargetMode&&(l.TargetMode=i.TargetMode);var o=i.TargetMode==="External"?i.Target:Cf(i.Target,t);r[o]=l,a[i.Id]=l}}),r["!id"]=a,r}function wA(e){var t=[wa,We("Relationships",null,{xmlns:Qa.RELS})];return fa(e["!id"]).forEach(function(r){t[t.length]=We("Relationship",null,e["!id"][r])}),t.length>2&&(t[t.length]="</Relationships>",t[1]=t[1].replace("/>",">")),t.join("")}function cr(e,t,r,a,s,i){if(s||(s={}),e["!id"]||(e["!id"]={}),e["!idx"]||(e["!idx"]=1),t<0)for(t=e["!idx"];e["!id"]["rId"+t];++t);if(e["!idx"]=t+1,s.Id="rId"+t,s.Type=a,s.Target=r,[Ot.HLINK,Ot.XPATH,Ot.XMISS].indexOf(s.Type)>-1&&(s.TargetMode="External"),e["!id"][s.Id])throw new Error("Cannot rewrite rId "+t);return e["!id"][s.Id]=s,e[("/"+s.Target).replace("//","/")]=s,t}var Abe="application/vnd.oasis.opendocument.spreadsheet";function fbe(e,t){for(var r=fE(e),a,s;a=vp.exec(r);)switch(a[3]){case"manifest":break;case"file-entry":if(s=Nt(a[0],!1),s.path=="/"&&s.type!==Abe)throw new Error("This OpenDocument is not a spreadsheet");break;case"encryption-data":case"algorithm":case"start-key-generation":case"key-derivation":throw new Error("Unsupported ODS Encryption");default:if(t&&t.WTF)throw a}}function pbe(e){var t=[wa];t.push(`<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">
`),t.push(`  <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/>
`);for(var r=0;r<e.length;++r)t.push('  <manifest:file-entry manifest:full-path="'+e[r][0]+'" manifest:media-type="'+e[r][1]+`"/>
`);return t.push("</manifest:manifest>"),t.join("")}function OD(e,t,r){return['  <rdf:Description rdf:about="'+e+`">
`,'    <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/'+(r||"odf")+"#"+t+`"/>
`,`  </rdf:Description>
`].join("")}function xbe(e,t){return['  <rdf:Description rdf:about="'+e+`">
`,'    <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="'+t+`"/>
`,`  </rdf:Description>
`].join("")}function hbe(e){var t=[wa];t.push(`<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
`);for(var r=0;r!=e.length;++r)t.push(OD(e[r][0],e[r][1])),t.push(xbe("",e[r][0]));return t.push(OD("","Document","pkg")),t.push("</rdf:RDF>"),t.join("")}function d9(){return'<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2"><office:meta><meta:generator>SheetJS '+Qg.version+"</meta:generator></office:meta></office:document-meta>"}var yi=[["cp:category","Category"],["cp:contentStatus","ContentStatus"],["cp:keywords","Keywords"],["cp:lastModifiedBy","LastAuthor"],["cp:lastPrinted","LastPrinted"],["cp:revision","RevNumber"],["cp:version","Version"],["dc:creator","Author"],["dc:description","Comments"],["dc:identifier","Identifier"],["dc:language","Language"],["dc:subject","Subject"],["dc:title","Title"],["dcterms:created","CreatedDate","date"],["dcterms:modified","ModifiedDate","date"]],mbe=(function(){for(var e=new Array(yi.length),t=0;t<yi.length;++t){var r=yi[t],a="(?:"+r[0].slice(0,r[0].indexOf(":"))+":)"+r[0].slice(r[0].indexOf(":")+1);e[t]=new RegExp("<"+a+"[^>]*>([\\s\\S]*?)</"+a+">")}return e})();function u9(e){var t={};e=gr(e);for(var r=0;r<yi.length;++r){var a=yi[r],s=e.match(mbe[r]);s!=null&&s.length>0&&(t[a[1]]=Wt(s[1])),a[2]==="date"&&t[a[1]]&&(t[a[1]]=Or(t[a[1]]))}return t}function B2(e,t,r,a,s){s[e]!=null||t==null||t===""||(s[e]=t,t=ur(t),a[a.length]=r?We(e,t,r):yn(e,t))}function A9(e,t){var r=t||{},a=[wa,We("cp:coreProperties",null,{"xmlns:cp":Qa.CORE_PROPS,"xmlns:dc":Qa.dc,"xmlns:dcterms":Qa.dcterms,"xmlns:dcmitype":Qa.dcmitype,"xmlns:xsi":Qa.xsi})],s={};if(!e&&!r.Props)return a.join("");e&&(e.CreatedDate!=null&&B2("dcterms:created",typeof e.CreatedDate=="string"?e.CreatedDate:NC(e.CreatedDate,r.WTF),{"xsi:type":"dcterms:W3CDTF"},a,s),e.ModifiedDate!=null&&B2("dcterms:modified",typeof e.ModifiedDate=="string"?e.ModifiedDate:NC(e.ModifiedDate,r.WTF),{"xsi:type":"dcterms:W3CDTF"},a,s));for(var i=0;i!=yi.length;++i){var l=yi[i],o=r.Props&&r.Props[l[1]]!=null?r.Props[l[1]]:e?e[l[1]]:null;o===!0?o="1":o===!1?o="0":typeof o=="number"&&(o=String(o)),o!=null&&B2(l[0],o,null,a,s)}return a.length>2&&(a[a.length]="</cp:coreProperties>",a[1]=a[1].replace("/>",">")),a.join("")}var Id=[["Application","Application","string"],["AppVersion","AppVersion","string"],["Company","Company","string"],["DocSecurity","DocSecurity","string"],["Manager","Manager","string"],["HyperlinksChanged","HyperlinksChanged","bool"],["SharedDoc","SharedDoc","bool"],["LinksUpToDate","LinksUpToDate","bool"],["ScaleCrop","ScaleCrop","bool"],["HeadingPairs","HeadingPairs","raw"],["TitlesOfParts","TitlesOfParts","raw"]],f9=["Worksheets","SheetNames","NamedRanges","DefinedNames","Chartsheets","ChartNames"];function p9(e,t,r,a){var s=[];if(typeof e=="string")s=SD(e,a);else for(var i=0;i<e.length;++i)s=s.concat(e[i].map(function(f){return{v:f}}));var l=typeof t=="string"?SD(t,a).map(function(f){return f.v}):t,o=0,d=0;if(l.length>0)for(var u=0;u!==s.length;u+=2){switch(d=+s[u+1].v,s[u].v){case"Worksheets":case"工作表":case"Листы":case"أوراق العمل":case"ワークシート":case"גליונות עבודה":case"Arbeitsblätter":case"Çalışma Sayfaları":case"Feuilles de calcul":case"Fogli di lavoro":case"Folhas de cálculo":case"Planilhas":case"Regneark":case"Hojas de cálculo":case"Werkbladen":r.Worksheets=d,r.SheetNames=l.slice(o,o+d);break;case"Named Ranges":case"Rangos con nombre":case"名前付き一覧":case"Benannte Bereiche":case"Navngivne områder":r.NamedRanges=d,r.DefinedNames=l.slice(o,o+d);break;case"Charts":case"Diagramme":r.Chartsheets=d,r.ChartNames=l.slice(o,o+d);break}o+=d}}function gbe(e,t,r){var a={};return t||(t={}),e=gr(e),Id.forEach(function(s){var i=(e.match(gp(s[0]))||[])[1];switch(s[2]){case"string":i&&(t[s[1]]=Wt(i));break;case"bool":t[s[1]]=i==="true";break;case"raw":var l=e.match(new RegExp("<"+s[0]+"[^>]*>([\\s\\S]*?)</"+s[0]+">"));l&&l.length>0&&(a[s[1]]=l[1]);break}}),a.HeadingPairs&&a.TitlesOfParts&&p9(a.HeadingPairs,a.TitlesOfParts,t,r),t}function x9(e){var t=[],r=We;return e||(e={}),e.Application="SheetJS",t[t.length]=wa,t[t.length]=We("Properties",null,{xmlns:Qa.EXT_PROPS,"xmlns:vt":Qa.vt}),Id.forEach(function(a){if(e[a[1]]!==void 0){var s;switch(a[2]){case"string":s=ur(String(e[a[1]]));break;case"bool":s=e[a[1]]?"true":"false";break}s!==void 0&&(t[t.length]=r(a[0],s))}}),t[t.length]=r("HeadingPairs",r("vt:vector",r("vt:variant","<vt:lpstr>Worksheets</vt:lpstr>")+r("vt:variant",r("vt:i4",String(e.Worksheets))),{size:2,baseType:"variant"})),t[t.length]=r("TitlesOfParts",r("vt:vector",e.SheetNames.map(function(a){return"<vt:lpstr>"+ur(a)+"</vt:lpstr>"}).join(""),{size:e.Worksheets,baseType:"lpstr"})),t.length>2&&(t[t.length]="</Properties>",t[1]=t[1].replace("/>",">")),t.join("")}var bbe=/<[^>]+>[^<]*/g;function vbe(e,t){var r={},a="",s=e.match(bbe);if(s)for(var i=0;i!=s.length;++i){var l=s[i],o=Nt(l);switch(o[0]){case"<?xml":break;case"<Properties":break;case"<property":a=Wt(o.name);break;case"</property>":a=null;break;default:if(l.indexOf("<vt:")===0){var d=l.split(">"),u=d[0].slice(4),f=d[1];switch(u){case"lpstr":case"bstr":case"lpwstr":r[a]=Wt(f);break;case"bool":r[a]=Mr(f);break;case"i1":case"i2":case"i4":case"i8":case"int":case"uint":r[a]=parseInt(f,10);break;case"r4":case"r8":case"decimal":r[a]=parseFloat(f);break;case"filetime":case"date":r[a]=Or(f);break;case"cy":case"error":r[a]=Wt(f);break;default:if(u.slice(-1)=="/")break;t.WTF&&typeof console<"u"&&console.warn("Unexpected",l,u,d)}}else if(l.slice(0,2)!=="</"){if(t.WTF)throw new Error(l)}}}return r}function h9(e){var t=[wa,We("Properties",null,{xmlns:Qa.CUST_PROPS,"xmlns:vt":Qa.vt})];if(!e)return t.join("");var r=1;return fa(e).forEach(function(s){++r,t[t.length]=We("property",Bge(e[s]),{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:r,name:ur(s)})}),t.length>2&&(t[t.length]="</Properties>",t[1]=t[1].replace("/>",">")),t.join("")}var SC={Title:"Title",Subject:"Subject",Author:"Author",Keywords:"Keywords",Comments:"Description",LastAuthor:"LastAuthor",RevNumber:"Revision",Application:"AppName",LastPrinted:"LastPrinted",CreatedDate:"Created",ModifiedDate:"LastSaved",Category:"Category",Manager:"Manager",Company:"Company",AppVersion:"Version",ContentStatus:"ContentStatus",Identifier:"Identifier",Language:"Language"},_2;function ybe(e,t,r){_2||(_2=dv(SC)),t=_2[t]||t,e[t]=r}function wbe(e,t){var r=[];return fa(SC).map(function(a){for(var s=0;s<yi.length;++s)if(yi[s][1]==a)return yi[s];for(s=0;s<Id.length;++s)if(Id[s][1]==a)return Id[s];throw a}).forEach(function(a){if(e[a[1]]!=null){var s=t&&t.Props&&t.Props[a[1]]!=null?t.Props[a[1]]:e[a[1]];switch(a[2]){case"date":s=new Date(s).toISOString().replace(/\.\d*Z/,"Z");break}typeof s=="number"?s=String(s):s===!0||s===!1?s=s?"1":"0":s instanceof Date&&(s=new Date(s).toISOString().replace(/\.\d*Z/,"")),r.push(yn(SC[a[1]]||a[1],s))}}),We("DocumentProperties",r.join(""),{xmlns:Ds.o})}function Nbe(e,t){var r=["Worksheets","SheetNames"],a="CustomDocumentProperties",s=[];return e&&fa(e).forEach(function(i){if(Object.prototype.hasOwnProperty.call(e,i)){for(var l=0;l<yi.length;++l)if(i==yi[l][1])return;for(l=0;l<Id.length;++l)if(i==Id[l][1])return;for(l=0;l<r.length;++l)if(i==r[l])return;var o=e[i],d="string";typeof o=="number"?(d="float",o=String(o)):o===!0||o===!1?(d="boolean",o=o?"1":"0"):o=String(o),s.push(We(CD(i),o,{"dt:dt":d}))}}),t&&fa(t).forEach(function(i){if(Object.prototype.hasOwnProperty.call(t,i)&&!(e&&Object.prototype.hasOwnProperty.call(e,i))){var l=t[i],o="string";typeof l=="number"?(o="float",l=String(l)):l===!0||l===!1?(o="boolean",l=l?"1":"0"):l instanceof Date?(o="dateTime.tz",l=l.toISOString()):l=String(l),s.push(We(CD(i),l,{"dt:dt":o}))}}),"<"+a+' xmlns="'+Ds.o+'">'+s.join("")+"</"+a+">"}function CE(e){var t=e.read_shift(4),r=e.read_shift(4);return new Date((r/1e7*Math.pow(2,32)+t/1e7-11644473600)*1e3).toISOString().replace(/\.000/,"")}function Cbe(e){var t=typeof e=="string"?new Date(Date.parse(e)):e,r=t.getTime()/1e3+11644473600,a=r%Math.pow(2,32),s=(r-a)/Math.pow(2,32);a*=1e7,s*=1e7;var i=a/Math.pow(2,32)|0;i>0&&(a=a%Math.pow(2,32),s+=i);var l=Oe(8);return l.write_shift(4,a),l.write_shift(4,s),l}function m9(e,t,r){var a=e.l,s=e.read_shift(0,"lpstr-cp");if(r)for(;e.l-a&3;)++e.l;return s}function g9(e,t,r){var a=e.read_shift(0,"lpwstr");return a}function b9(e,t,r){return t===31?g9(e):m9(e,t,r)}function BC(e,t,r){return b9(e,t,r===!1?0:4)}function kbe(e,t){if(!t)throw new Error("VtUnalignedString must have positive length");return b9(e,t,0)}function jbe(e){for(var t=e.read_shift(4),r=[],a=0;a!=t;++a){var s=e.l;r[a]=e.read_shift(0,"lpwstr").replace(Jn,""),e.l-s&2&&(e.l+=2)}return r}function Ebe(e){for(var t=e.read_shift(4),r=[],a=0;a!=t;++a)r[a]=e.read_shift(0,"lpstr-cp").replace(Jn,"");return r}function Sbe(e){var t=e.l,r=Yg(e,l9);e[e.l]==0&&e[e.l+1]==0&&e.l-t&2&&(e.l+=2);var a=Yg(e,fs);return[r,a]}function Bbe(e){for(var t=e.read_shift(4),r=[],a=0;a<t/2;++a)r.push(Sbe(e));return r}function PD(e,t){for(var r=e.read_shift(4),a={},s=0;s!=r;++s){var i=e.read_shift(4),l=e.read_shift(4);a[i]=e.read_shift(l,t===1200?"utf16le":"utf8").replace(Jn,"").replace(Nf,"!"),t===1200&&l%2&&(e.l+=2)}return e.l&3&&(e.l=e.l>>3<<2),a}function v9(e){var t=e.read_shift(4),r=e.slice(e.l,e.l+t);return e.l+=t,(t&3)>0&&(e.l+=4-(t&3)&3),r}function _be(e){var t={};return t.Size=e.read_shift(4),e.l+=t.Size+3-(t.Size-1)%4,t}function Yg(e,t,r){var a=e.read_shift(2),s,i=r||{};if(e.l+=2,t!==MD&&a!==t&&lbe.indexOf(t)===-1&&!((t&65534)==4126&&(a&65534)==4126))throw new Error("Expected type "+t+" saw "+a);switch(t===MD?a:t){case 2:return s=e.read_shift(2,"i"),i.raw||(e.l+=2),s;case 3:return s=e.read_shift(4,"i"),s;case 11:return e.read_shift(4)!==0;case 19:return s=e.read_shift(4),s;case 30:return m9(e,a,4).replace(Jn,"");case 31:return g9(e);case 64:return CE(e);case 65:return v9(e);case 71:return _be(e);case 80:return BC(e,a,!i.raw).replace(Jn,"");case 81:return kbe(e,a).replace(Jn,"");case 4108:return Bbe(e);case 4126:case 4127:return a==4127?jbe(e):Ebe(e);default:throw new Error("TypedPropertyValue unrecognized type "+t+" "+a)}}function LD(e,t){var r=Oe(4),a=Oe(4);switch(r.write_shift(4,e==80?31:e),e){case 3:a.write_shift(-4,t);break;case 5:a=Oe(8),a.write_shift(8,t,"f");break;case 11:a.write_shift(4,t?1:0);break;case 64:a=Cbe(t);break;case 31:case 80:for(a=Oe(4+2*(t.length+1)+(t.length%2?0:2)),a.write_shift(4,t.length+1),a.write_shift(0,t,"dbcs");a.l!=a.length;)a.write_shift(1,0);break;default:throw new Error("TypedPropertyValue unrecognized type "+e+" "+t)}return en([r,a])}function QD(e,t){var r=e.l,a=e.read_shift(4),s=e.read_shift(4),i=[],l=0,o=0,d=-1,u={};for(l=0;l!=s;++l){var f=e.read_shift(4),p=e.read_shift(4);i[l]=[f,p+r]}i.sort(function(_,N){return _[1]-N[1]});var h={};for(l=0;l!=s;++l){if(e.l!==i[l][1]){var m=!0;if(l>0&&t)switch(t[i[l-1][0]].t){case 2:e.l+2===i[l][1]&&(e.l+=2,m=!1);break;case 80:e.l<=i[l][1]&&(e.l=i[l][1],m=!1);break;case 4108:e.l<=i[l][1]&&(e.l=i[l][1],m=!1);break}if((!t||l==0)&&e.l<=i[l][1]&&(m=!1,e.l=i[l][1]),m)throw new Error("Read Error: Expected address "+i[l][1]+" at "+e.l+" :"+l)}if(t){var b=t[i[l][0]];if(h[b.n]=Yg(e,b.t,{raw:!0}),b.p==="version"&&(h[b.n]=String(h[b.n]>>16)+"."+("0000"+String(h[b.n]&65535)).slice(-4)),b.n=="CodePage")switch(h[b.n]){case 0:h[b.n]=1252;case 874:case 932:case 936:case 949:case 950:case 1250:case 1251:case 1253:case 1254:case 1255:case 1256:case 1257:case 1258:case 1e4:case 1200:case 1201:case 1252:case 65e3:case-536:case 65001:case-535:Pi(o=h[b.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+h[b.n])}}else if(i[l][0]===1){if(o=h.CodePage=Yg(e,wE),Pi(o),d!==-1){var v=e.l;e.l=i[d][1],u=PD(e,o),e.l=v}}else if(i[l][0]===0){if(o===0){d=l,e.l=i[l+1][1];continue}u=PD(e,o)}else{var y=u[i[l][0]],j;switch(e[e.l]){case 65:e.l+=4,j=v9(e);break;case 30:e.l+=4,j=BC(e,e[e.l-4]).replace(/\u0000+$/,"");break;case 31:e.l+=4,j=BC(e,e[e.l-4]).replace(/\u0000+$/,"");break;case 3:e.l+=4,j=e.read_shift(4,"i");break;case 19:e.l+=4,j=e.read_shift(4);break;case 5:e.l+=4,j=e.read_shift(8,"f");break;case 11:e.l+=4,j=ga(e,4);break;case 64:e.l+=4,j=Or(CE(e));break;default:throw new Error("unparsed value: "+e[e.l])}h[y]=j}}return e.l=r+a,h}var y9=["CodePage","Thumbnail","_PID_LINKBASE","_PID_HLINKS","SystemIdentifier","FMTID"];function Tbe(e){switch(typeof e){case"boolean":return 11;case"number":return(e|0)==e?3:5;case"string":return 31;case"object":if(e instanceof Date)return 64;break}return-1}function HD(e,t,r){var a=Oe(8),s=[],i=[],l=8,o=0,d=Oe(8),u=Oe(8);if(d.write_shift(4,2),d.write_shift(4,1200),u.write_shift(4,1),i.push(d),s.push(u),l+=8+d.length,!t){u=Oe(8),u.write_shift(4,0),s.unshift(u);var f=[Oe(4)];for(f[0].write_shift(4,e.length),o=0;o<e.length;++o){var p=e[o][0];for(d=Oe(8+2*(p.length+1)+(p.length%2?0:2)),d.write_shift(4,o+2),d.write_shift(4,p.length+1),d.write_shift(0,p,"dbcs");d.l!=d.length;)d.write_shift(1,0);f.push(d)}d=en(f),i.unshift(d),l+=8+d.length}for(o=0;o<e.length;++o)if(!(t&&!t[e[o][0]])&&!(y9.indexOf(e[o][0])>-1||f9.indexOf(e[o][0])>-1)&&e[o][1]!=null){var h=e[o][1],m=0;if(t){m=+t[e[o][0]];var b=r[m];if(b.p=="version"&&typeof h=="string"){var v=h.split(".");h=(+v[0]<<16)+(+v[1]||0)}d=LD(b.t,h)}else{var y=Tbe(h);y==-1&&(y=31,h=String(h)),d=LD(y,h)}i.push(d),u=Oe(8),u.write_shift(4,t?m:2+o),s.push(u),l+=8+d.length}var j=8*(i.length+1);for(o=0;o<i.length;++o)s[o].write_shift(4,j),j+=i[o].length;return a.write_shift(4,l),a.write_shift(4,i.length),en([a].concat(s).concat(i))}function zD(e,t,r){var a=e.content;if(!a)return{};vn(a,0);var s,i,l,o,d=0;a.chk("feff","Byte Order: "),a.read_shift(2);var u=a.read_shift(4),f=a.read_shift(16);if(f!==xt.utils.consts.HEADER_CLSID&&f!==r)throw new Error("Bad PropertySet CLSID "+f);if(s=a.read_shift(4),s!==1&&s!==2)throw new Error("Unrecognized #Sets: "+s);if(i=a.read_shift(16),o=a.read_shift(4),s===1&&o!==a.l)throw new Error("Length mismatch: "+o+" !== "+a.l);s===2&&(l=a.read_shift(16),d=a.read_shift(4));var p=QD(a,t),h={SystemIdentifier:u};for(var m in p)h[m]=p[m];if(h.FMTID=i,s===1)return h;if(d-a.l==2&&(a.l+=2),a.l!==d)throw new Error("Length mismatch 2: "+a.l+" !== "+d);var b;try{b=QD(a,null)}catch{}for(m in b)h[m]=b[m];return h.FMTID=[i,l],h}function $D(e,t,r,a,s,i){var l=Oe(s?68:48),o=[l];l.write_shift(2,65534),l.write_shift(2,0),l.write_shift(4,842412599),l.write_shift(16,xt.utils.consts.HEADER_CLSID,"hex"),l.write_shift(4,s?2:1),l.write_shift(16,t,"hex"),l.write_shift(4,s?68:48);var d=HD(e,r,a);if(o.push(d),s){var u=HD(s,null,null);l.write_shift(16,i,"hex"),l.write_shift(4,68+d.length),o.push(u)}return en(o)}function uc(e,t){return e.read_shift(t),null}function Ibe(e,t){t||(t=Oe(e));for(var r=0;r<e;++r)t.write_shift(1,0);return t}function Fbe(e,t,r){for(var a=[],s=e.l+t;e.l<s;)a.push(r(e,s-e.l));if(s!==e.l)throw new Error("Slurp error");return a}function ga(e,t){return e.read_shift(t)===1}function Wn(e,t){return t||(t=Oe(2)),t.write_shift(2,+!!e),t}function _a(e){return e.read_shift(2,"u")}function fi(e,t){return t||(t=Oe(2)),t.write_shift(2,e),t}function w9(e,t){return Fbe(e,t,_a)}function Dbe(e){var t=e.read_shift(1),r=e.read_shift(1);return r===1?t:t===1}function N9(e,t,r){return r||(r=Oe(2)),r.write_shift(1,t=="e"?+e:+!!e),r.write_shift(1,t=="e"?1:0),r}function tx(e,t,r){var a=e.read_shift(r&&r.biff>=12?2:1),s="sbcs-cont";if(r&&r.biff>=8,!r||r.biff==8){var i=e.read_shift(1);i&&(s="dbcs-cont")}else r.biff==12&&(s="wstr");r.biff>=2&&r.biff<=5&&(s="cpstr");var l=a?e.read_shift(a,s):"";return l}function Ube(e){var t=e.read_shift(2),r=e.read_shift(1),a=r&4,s=r&8,i=1+(r&1),l=0,o,d={};s&&(l=e.read_shift(2)),a&&(o=e.read_shift(4));var u=i==2?"dbcs-cont":"sbcs-cont",f=t===0?"":e.read_shift(t,u);return s&&(e.l+=4*l),a&&(e.l+=o),d.t=f,s||(d.raw="<t>"+d.t+"</t>",d.r=d.t),d}function Mbe(e){var t=e.t||"",r=Oe(3);r.write_shift(2,t.length),r.write_shift(1,1);var a=Oe(2*t.length);a.write_shift(2*t.length,t,"utf16le");var s=[r,a];return en(s)}function Wd(e,t,r){var a;if(r){if(r.biff>=2&&r.biff<=5)return e.read_shift(t,"cpstr");if(r.biff>=12)return e.read_shift(t,"dbcs-cont")}var s=e.read_shift(1);return s===0?a=e.read_shift(t,"sbcs-cont"):a=e.read_shift(t,"dbcs-cont"),a}function rx(e,t,r){var a=e.read_shift(r&&r.biff==2?1:2);return a===0?(e.l++,""):Wd(e,a,r)}function du(e,t,r){if(r.biff>5)return rx(e,t,r);var a=e.read_shift(1);return a===0?(e.l++,""):e.read_shift(a,r.biff<=4||!e.lens?"cpstr":"sbcs-cont")}function C9(e,t,r){return r||(r=Oe(3+2*e.length)),r.write_shift(2,e.length),r.write_shift(1,1),r.write_shift(31,e,"utf16le"),r}function Rbe(e){var t=e.read_shift(1);e.l++;var r=e.read_shift(2);return e.l+=2,[t,r]}function Obe(e){var t=e.read_shift(4),r=e.l,a=!1;t>24&&(e.l+=t-24,e.read_shift(16)==="795881f43b1d7f48af2c825dc4852763"&&(a=!0),e.l=r);var s=e.read_shift((a?t-24:t)>>1,"utf16le").replace(Jn,"");return a&&(e.l+=24),s}function Pbe(e){for(var t=e.read_shift(2),r="";t-- >0;)r+="../";var a=e.read_shift(0,"lpstr-ansi");if(e.l+=2,e.read_shift(2)!=57005)throw new Error("Bad FileMoniker");var s=e.read_shift(4);if(s===0)return r+a.replace(/\\/g,"/");var i=e.read_shift(4);if(e.read_shift(2)!=3)throw new Error("Bad FileMoniker");var l=e.read_shift(i>>1,"utf16le").replace(Jn,"");return r+l}function Lbe(e,t){var r=e.read_shift(16);switch(r){case"e0c9ea79f9bace118c8200aa004ba90b":return Obe(e);case"0303000000000000c000000000000046":return Pbe(e);default:throw new Error("Unsupported Moniker "+r)}}function Gh(e){var t=e.read_shift(4),r=t>0?e.read_shift(t,"utf16le").replace(Jn,""):"";return r}function VD(e,t){t||(t=Oe(6+e.length*2)),t.write_shift(4,1+e.length);for(var r=0;r<e.length;++r)t.write_shift(2,e.charCodeAt(r));return t.write_shift(2,0),t}function Qbe(e,t){var r=e.l+t,a=e.read_shift(4);if(a!==2)throw new Error("Unrecognized streamVersion: "+a);var s=e.read_shift(2);e.l+=2;var i,l,o,d,u="",f,p;s&16&&(i=Gh(e,r-e.l)),s&128&&(l=Gh(e,r-e.l)),(s&257)===257&&(o=Gh(e,r-e.l)),(s&257)===1&&(d=Lbe(e,r-e.l)),s&8&&(u=Gh(e,r-e.l)),s&32&&(f=e.read_shift(16)),s&64&&(p=CE(e)),e.l=r;var h=l||o||d||"";h&&u&&(h+="#"+u),h||(h="#"+u),s&2&&h.charAt(0)=="/"&&h.charAt(1)!="/"&&(h="file://"+h);var m={Target:h};return f&&(m.guid=f),p&&(m.time=p),i&&(m.Tooltip=i),m}function Hbe(e){var t=Oe(512),r=0,a=e.Target;a.slice(0,7)=="file://"&&(a=a.slice(7));var s=a.indexOf("#"),i=s>-1?31:23;switch(a.charAt(0)){case"#":i=28;break;case".":i&=-3;break}t.write_shift(4,2),t.write_shift(4,i);var l=[8,6815827,6619237,4849780,83];for(r=0;r<l.length;++r)t.write_shift(4,l[r]);if(i==28)a=a.slice(1),VD(a,t);else if(i&2){for(l="e0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),r=0;r<l.length;++r)t.write_shift(1,parseInt(l[r],16));var o=s>-1?a.slice(0,s):a;for(t.write_shift(4,2*(o.length+1)),r=0;r<o.length;++r)t.write_shift(2,o.charCodeAt(r));t.write_shift(2,0),i&8&&VD(s>-1?a.slice(s+1):"",t)}else{for(l="03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" "),r=0;r<l.length;++r)t.write_shift(1,parseInt(l[r],16));for(var d=0;a.slice(d*3,d*3+3)=="../"||a.slice(d*3,d*3+3)=="..\\";)++d;for(t.write_shift(2,d),t.write_shift(4,a.length-3*d+1),r=0;r<a.length-3*d;++r)t.write_shift(1,a.charCodeAt(r+3*d)&255);for(t.write_shift(1,0),t.write_shift(2,65535),t.write_shift(2,57005),r=0;r<6;++r)t.write_shift(4,0)}return t.slice(0,t.l)}function k9(e){var t=e.read_shift(1),r=e.read_shift(1),a=e.read_shift(1),s=e.read_shift(1);return[t,r,a,s]}function j9(e,t){var r=k9(e);return r[3]=0,r}function Il(e){var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(2);return{r:t,c:r,ixfe:a}}function Yd(e,t,r,a){return a||(a=Oe(6)),a.write_shift(2,e),a.write_shift(2,t),a.write_shift(2,r||0),a}function zbe(e){var t=e.read_shift(2),r=e.read_shift(2);return e.l+=8,{type:t,flags:r}}function $be(e,t,r){return t===0?"":du(e,t,r)}function Vbe(e,t,r){var a=r.biff>8?4:2,s=e.read_shift(a),i=e.read_shift(a,"i"),l=e.read_shift(a,"i");return[s,i,l]}function E9(e){var t=e.read_shift(2),r=yE(e);return[t,r]}function Gbe(e,t,r){e.l+=4,t-=4;var a=e.l+t,s=tx(e,t,r),i=e.read_shift(2);if(a-=e.l,i!==a)throw new Error("Malformed AddinUdf: padding = "+a+" != "+i);return e.l+=i,s}function fv(e){var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(2),s=e.read_shift(2);return{s:{c:a,r:t},e:{c:s,r}}}function S9(e,t){return t||(t=Oe(8)),t.write_shift(2,e.s.r),t.write_shift(2,e.e.r),t.write_shift(2,e.s.c),t.write_shift(2,e.e.c),t}function B9(e){var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(1),s=e.read_shift(1);return{s:{c:a,r:t},e:{c:s,r}}}var Kbe=B9;function _9(e){e.l+=4;var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(2);return e.l+=12,[r,t,a]}function qbe(e){var t={};return e.l+=4,e.l+=16,t.fSharedNote=e.read_shift(2),e.l+=4,t}function Wbe(e){var t={};return e.l+=4,e.cf=e.read_shift(2),t}function _n(e){e.l+=2,e.l+=e.read_shift(2)}var Ybe={0:_n,4:_n,5:_n,6:_n,7:Wbe,8:_n,9:_n,10:_n,11:_n,12:_n,13:qbe,14:_n,15:_n,16:_n,17:_n,18:_n,19:_n,20:_n,21:_9};function Xbe(e,t){for(var r=e.l+t,a=[];e.l<r;){var s=e.read_shift(2);e.l-=2;try{a.push(Ybe[s](e,r-e.l))}catch{return e.l=r,a}}return e.l!=r&&(e.l=r),a}function Kh(e,t){var r={BIFFVer:0,dt:0};switch(r.BIFFVer=e.read_shift(2),t-=2,t>=2&&(r.dt=e.read_shift(2),e.l-=2),r.BIFFVer){case 1536:case 1280:case 1024:case 768:case 512:case 2:case 7:break;default:if(t>6)throw new Error("Unexpected BIFF Ver "+r.BIFFVer)}return e.read_shift(t),r}function kE(e,t,r){var a=1536,s=16;switch(r.bookType){case"biff8":break;case"biff5":a=1280,s=8;break;case"biff4":a=4,s=6;break;case"biff3":a=3,s=6;break;case"biff2":a=2,s=4;break;case"xla":break;default:throw new Error("unsupported BIFF version")}var i=Oe(s);return i.write_shift(2,a),i.write_shift(2,t),s>4&&i.write_shift(2,29282),s>6&&i.write_shift(2,1997),s>8&&(i.write_shift(2,49161),i.write_shift(2,1),i.write_shift(2,1798),i.write_shift(2,0)),i}function Jbe(e,t){return t===0||e.read_shift(2),1200}function Zbe(e,t,r){if(r.enc)return e.l+=t,"";var a=e.l,s=du(e,0,r);return e.read_shift(t+a-e.l),s}function eve(e,t){var r=!t||t.biff==8,a=Oe(r?112:54);for(a.write_shift(t.biff==8?2:1,7),r&&a.write_shift(1,0),a.write_shift(4,859007059),a.write_shift(4,5458548|(r?0:536870912));a.l<a.length;)a.write_shift(1,r?0:32);return a}function tve(e,t,r){var a=r&&r.biff==8||t==2?e.read_shift(2):(e.l+=t,0);return{fDialog:a&16,fBelow:a&64,fRight:a&128}}function rve(e,t,r){var a=e.read_shift(4),s=e.read_shift(1)&3,i=e.read_shift(1);switch(i){case 0:i="Worksheet";break;case 1:i="Macrosheet";break;case 2:i="Chartsheet";break;case 6:i="VBAModule";break}var l=tx(e,0,r);return l.length===0&&(l="Sheet1"),{pos:a,hs:s,dt:i,name:l}}function ave(e,t){var r=!t||t.biff>=8?2:1,a=Oe(8+r*e.name.length);a.write_shift(4,e.pos),a.write_shift(1,e.hs||0),a.write_shift(1,e.dt),a.write_shift(1,e.name.length),t.biff>=8&&a.write_shift(1,1),a.write_shift(r*e.name.length,e.name,t.biff<8?"sbcs":"utf16le");var s=a.slice(0,a.l);return s.l=a.l,s}function nve(e,t){for(var r=e.l+t,a=e.read_shift(4),s=e.read_shift(4),i=[],l=0;l!=s&&e.l<r;++l)i.push(Ube(e));return i.Count=a,i.Unique=s,i}function sve(e,t){var r=Oe(8);r.write_shift(4,e.Count),r.write_shift(4,e.Unique);for(var a=[],s=0;s<e.length;++s)a[s]=Mbe(e[s]);var i=en([r].concat(a));return i.parts=[r.length].concat(a.map(function(l){return l.length})),i}function ive(e,t){var r={};return r.dsst=e.read_shift(2),e.l+=t-2,r}function lve(e){var t={};t.r=e.read_shift(2),t.c=e.read_shift(2),t.cnt=e.read_shift(2)-t.c;var r=e.read_shift(2);e.l+=4;var a=e.read_shift(1);return e.l+=3,a&7&&(t.level=a&7),a&32&&(t.hidden=!0),a&64&&(t.hpt=r/20),t}function ove(e){var t=zbe(e);if(t.type!=2211)throw new Error("Invalid Future Record "+t.type);var r=e.read_shift(4);return r!==0}function cve(e){return e.read_shift(2),e.read_shift(4)}function GD(e,t,r){var a=0;r&&r.biff==2||(a=e.read_shift(2));var s=e.read_shift(2);r&&r.biff==2&&(a=1-(s>>15),s&=32767);var i={Unsynced:a&1,DyZero:(a&2)>>1,ExAsc:(a&4)>>2,ExDsc:(a&8)>>3};return[i,s]}function dve(e){var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(2),s=e.read_shift(2),i=e.read_shift(2),l=e.read_shift(2),o=e.read_shift(2),d=e.read_shift(2),u=e.read_shift(2);return{Pos:[t,r],Dim:[a,s],Flags:i,CurTab:l,FirstTab:o,Selected:d,TabRatio:u}}function uve(){var e=Oe(18);return e.write_shift(2,0),e.write_shift(2,0),e.write_shift(2,29280),e.write_shift(2,17600),e.write_shift(2,56),e.write_shift(2,0),e.write_shift(2,0),e.write_shift(2,1),e.write_shift(2,500),e}function Ave(e,t,r){if(r&&r.biff>=2&&r.biff<5)return{};var a=e.read_shift(2);return{RTL:a&64}}function fve(e){var t=Oe(18),r=1718;return e&&e.RTL&&(r|=64),t.write_shift(2,r),t.write_shift(4,0),t.write_shift(4,64),t.write_shift(4,0),t.write_shift(4,0),t}function pve(){}function xve(e,t,r){var a={dyHeight:e.read_shift(2),fl:e.read_shift(2)};switch(r&&r.biff||8){case 2:break;case 3:case 4:e.l+=2;break;default:e.l+=10;break}return a.name=tx(e,0,r),a}function hve(e,t){var r=e.name||"Arial",a=t&&t.biff==5,s=a?15+r.length:16+2*r.length,i=Oe(s);return i.write_shift(2,e.sz*20),i.write_shift(4,0),i.write_shift(2,400),i.write_shift(4,0),i.write_shift(2,0),i.write_shift(1,r.length),a||i.write_shift(1,1),i.write_shift((a?1:2)*r.length,r,a?"sbcs":"utf16le"),i}function mve(e){var t=Il(e);return t.isst=e.read_shift(4),t}function gve(e,t,r,a){var s=Oe(10);return Yd(e,t,a,s),s.write_shift(4,r),s}function bve(e,t,r){r.biffguess&&r.biff==2&&(r.biff=5);var a=e.l+t,s=Il(e);r.biff==2&&e.l++;var i=rx(e,a-e.l,r);return s.val=i,s}function vve(e,t,r,a,s){var i=!s||s.biff==8,l=Oe(8+ +i+(1+i)*r.length);return Yd(e,t,a,l),l.write_shift(2,r.length),i&&l.write_shift(1,1),l.write_shift((1+i)*r.length,r,i?"utf16le":"sbcs"),l}function yve(e,t,r){var a=e.read_shift(2),s=du(e,0,r);return[a,s]}function wve(e,t,r,a){var s=r&&r.biff==5;a||(a=Oe(s?3+t.length:5+2*t.length)),a.write_shift(2,e),a.write_shift(s?1:2,t.length),s||a.write_shift(1,1),a.write_shift((s?1:2)*t.length,t,s?"sbcs":"utf16le");var i=a.length>a.l?a.slice(0,a.l):a;return i.l==null&&(i.l=i.length),i}var Nve=du;function KD(e,t,r){var a=e.l+t,s=r.biff==8||!r.biff?4:2,i=e.read_shift(s),l=e.read_shift(s),o=e.read_shift(2),d=e.read_shift(2);return e.l=a,{s:{r:i,c:o},e:{r:l,c:d}}}function Cve(e,t){var r=t.biff==8||!t.biff?4:2,a=Oe(2*r+6);return a.write_shift(r,e.s.r),a.write_shift(r,e.e.r+1),a.write_shift(2,e.s.c),a.write_shift(2,e.e.c+1),a.write_shift(2,0),a}function kve(e){var t=e.read_shift(2),r=e.read_shift(2),a=E9(e);return{r:t,c:r,ixfe:a[0],rknum:a[1]}}function jve(e,t){for(var r=e.l+t-2,a=e.read_shift(2),s=e.read_shift(2),i=[];e.l<r;)i.push(E9(e));if(e.l!==r)throw new Error("MulRK read error");var l=e.read_shift(2);if(i.length!=l-s+1)throw new Error("MulRK length mismatch");return{r:a,c:s,C:l,rkrec:i}}function Eve(e,t){for(var r=e.l+t-2,a=e.read_shift(2),s=e.read_shift(2),i=[];e.l<r;)i.push(e.read_shift(2));if(e.l!==r)throw new Error("MulBlank read error");var l=e.read_shift(2);if(i.length!=l-s+1)throw new Error("MulBlank length mismatch");return{r:a,c:s,C:l,ixfe:i}}function Sve(e,t,r,a){var s={},i=e.read_shift(4),l=e.read_shift(4),o=e.read_shift(4),d=e.read_shift(2);return s.patternType=obe[o>>26],a.cellStyles&&(s.alc=i&7,s.fWrap=i>>3&1,s.alcV=i>>4&7,s.fJustLast=i>>7&1,s.trot=i>>8&255,s.cIndent=i>>16&15,s.fShrinkToFit=i>>20&1,s.iReadOrder=i>>22&2,s.fAtrNum=i>>26&1,s.fAtrFnt=i>>27&1,s.fAtrAlc=i>>28&1,s.fAtrBdr=i>>29&1,s.fAtrPat=i>>30&1,s.fAtrProt=i>>31&1,s.dgLeft=l&15,s.dgRight=l>>4&15,s.dgTop=l>>8&15,s.dgBottom=l>>12&15,s.icvLeft=l>>16&127,s.icvRight=l>>23&127,s.grbitDiag=l>>30&3,s.icvTop=o&127,s.icvBottom=o>>7&127,s.icvDiag=o>>14&127,s.dgDiag=o>>21&15,s.icvFore=d&127,s.icvBack=d>>7&127,s.fsxButton=d>>14&1),s}function Bve(e,t,r){var a={};return a.ifnt=e.read_shift(2),a.numFmtId=e.read_shift(2),a.flags=e.read_shift(2),a.fStyle=a.flags>>2&1,t-=6,a.data=Sve(e,t,a.fStyle,r),a}function qD(e,t,r,a){var s=r&&r.biff==5;a||(a=Oe(s?16:20)),a.write_shift(2,0),e.style?(a.write_shift(2,e.numFmtId||0),a.write_shift(2,65524)):(a.write_shift(2,e.numFmtId||0),a.write_shift(2,t<<4));var i=0;return e.numFmtId>0&&s&&(i|=1024),a.write_shift(4,i),a.write_shift(4,0),s||a.write_shift(4,0),a.write_shift(2,0),a}function _ve(e){e.l+=4;var t=[e.read_shift(2),e.read_shift(2)];if(t[0]!==0&&t[0]--,t[1]!==0&&t[1]--,t[0]>7||t[1]>7)throw new Error("Bad Gutters: "+t.join("|"));return t}function Tve(e){var t=Oe(8);return t.write_shift(4,0),t.write_shift(2,0),t.write_shift(2,0),t}function WD(e,t,r){var a=Il(e);(r.biff==2||t==9)&&++e.l;var s=Dbe(e);return a.val=s,a.t=s===!0||s===!1?"b":"e",a}function Ive(e,t,r,a,s,i){var l=Oe(8);return Yd(e,t,a,l),N9(r,i,l),l}function Fve(e,t,r){r.biffguess&&r.biff==2&&(r.biff=5);var a=Il(e),s=On(e);return a.val=s,a}function Dve(e,t,r,a){var s=Oe(14);return Yd(e,t,a,s),qd(r,s),s}var YD=$be;function Uve(e,t,r){var a=e.l+t,s=e.read_shift(2),i=e.read_shift(2);if(r.sbcch=i,i==1025||i==14849)return[i,s];if(i<1||i>255)throw new Error("Unexpected SupBook type: "+i);for(var l=Wd(e,i),o=[];a>e.l;)o.push(rx(e));return[i,s,l,o]}function XD(e,t,r){var a=e.read_shift(2),s,i={fBuiltIn:a&1,fWantAdvise:a>>>1&1,fWantPict:a>>>2&1,fOle:a>>>3&1,fOleLink:a>>>4&1,cf:a>>>5&1023,fIcon:a>>>15&1};return r.sbcch===14849&&(s=Gbe(e,t-2,r)),i.body=s||e.read_shift(t-2),typeof s=="string"&&(i.Name=s),i}var Mve=["_xlnm.Consolidate_Area","_xlnm.Auto_Open","_xlnm.Auto_Close","_xlnm.Extract","_xlnm.Database","_xlnm.Criteria","_xlnm.Print_Area","_xlnm.Print_Titles","_xlnm.Recorder","_xlnm.Data_Form","_xlnm.Auto_Activate","_xlnm.Auto_Deactivate","_xlnm.Sheet_Title","_xlnm._FilterDatabase"];function JD(e,t,r){var a=e.l+t,s=e.read_shift(2),i=e.read_shift(1),l=e.read_shift(1),o=e.read_shift(r&&r.biff==2?1:2),d=0;(!r||r.biff>=5)&&(r.biff!=5&&(e.l+=2),d=e.read_shift(2),r.biff==5&&(e.l+=2),e.l+=4);var u=Wd(e,l,r);s&32&&(u=Mve[u.charCodeAt(0)]);var f=a-e.l;r&&r.biff==2&&--f;var p=a==e.l||o===0||!(f>0)?[]:X2e(e,f,r,o);return{chKey:i,Name:u,itab:d,rgce:p}}function T9(e,t,r){if(r.biff<8)return Rve(e,t,r);for(var a=[],s=e.l+t,i=e.read_shift(r.biff>8?4:2);i--!==0;)a.push(Vbe(e,r.biff>8?12:6,r));if(e.l!=s)throw new Error("Bad ExternSheet: "+e.l+" != "+s);return a}function Rve(e,t,r){e[e.l+1]==3&&e[e.l]++;var a=tx(e,t,r);return a.charCodeAt(0)==3?a.slice(1):a}function Ove(e,t,r){if(r.biff<8){e.l+=t;return}var a=e.read_shift(2),s=e.read_shift(2),i=Wd(e,a,r),l=Wd(e,s,r);return[i,l]}function Pve(e,t,r){var a=B9(e);e.l++;var s=e.read_shift(1);return t-=8,[J2e(e,t,r),s,a]}function ZD(e,t,r){var a=Kbe(e);switch(r.biff){case 2:e.l++,t-=7;break;case 3:case 4:e.l+=2,t-=8;break;default:e.l+=6,t-=12}return[a,W2e(e,t,r)]}function Lve(e){var t=e.read_shift(4)!==0,r=e.read_shift(4)!==0,a=e.read_shift(4);return[t,r,a]}function Qve(e,t,r){if(!(r.biff<8)){var a=e.read_shift(2),s=e.read_shift(2),i=e.read_shift(2),l=e.read_shift(2),o=du(e,0,r);return r.biff<8&&e.read_shift(1),[{r:a,c:s},o,l,i]}}function Hve(e,t,r){return Qve(e,t,r)}function zve(e,t){for(var r=[],a=e.read_shift(2);a--;)r.push(fv(e));return r}function $ve(e){var t=Oe(2+e.length*8);t.write_shift(2,e.length);for(var r=0;r<e.length;++r)S9(e[r],t);return t}function Vve(e,t,r){if(r&&r.biff<8)return Kve(e,t,r);var a=_9(e),s=Xbe(e,t-22,a[1]);return{cmo:a,ft:s}}var Gve={8:function(e,t){var r=e.l+t;e.l+=10;var a=e.read_shift(2);e.l+=4,e.l+=2,e.l+=2,e.l+=2,e.l+=4;var s=e.read_shift(1);return e.l+=s,e.l=r,{fmt:a}}};function Kve(e,t,r){e.l+=4;var a=e.read_shift(2),s=e.read_shift(2),i=e.read_shift(2);e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=2,e.l+=6,t-=36;var l=[];return l.push((Gve[a]||Hn)(e,t,r)),{cmo:[s,a,i],ft:l}}function qve(e,t,r){var a=e.l,s="";try{e.l+=4;var i=(r.lastobj||{cmo:[0,0]}).cmo[1],l;[0,5,7,11,12,14].indexOf(i)==-1?e.l+=6:l=Rbe(e,6,r);var o=e.read_shift(2);e.read_shift(2),_a(e,2);var d=e.read_shift(2);e.l+=d;for(var u=1;u<e.lens.length-1;++u){if(e.l-a!=e.lens[u])throw new Error("TxO: bad continue record");var f=e[e.l],p=Wd(e,e.lens[u+1]-e.lens[u]-1);if(s+=p,s.length>=(f?o:2*o))break}if(s.length!==o&&s.length!==o*2)throw new Error("cchText: "+o+" != "+s.length);return e.l=a+t,{t:s}}catch{return e.l=a+t,{t:s}}}function Wve(e,t){var r=fv(e);e.l+=16;var a=Qbe(e,t-24);return[r,a]}function Yve(e){var t=Oe(24),r=Zr(e[0]);t.write_shift(2,r.r),t.write_shift(2,r.r),t.write_shift(2,r.c),t.write_shift(2,r.c);for(var a="d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" "),s=0;s<16;++s)t.write_shift(1,parseInt(a[s],16));return en([t,Hbe(e[1])])}function Xve(e,t){e.read_shift(2);var r=fv(e),a=e.read_shift((t-10)/2,"dbcs-cont");return a=a.replace(Jn,""),[r,a]}function Jve(e){var t=e[1].Tooltip,r=Oe(10+2*(t.length+1));r.write_shift(2,2048);var a=Zr(e[0]);r.write_shift(2,a.r),r.write_shift(2,a.r),r.write_shift(2,a.c),r.write_shift(2,a.c);for(var s=0;s<t.length;++s)r.write_shift(2,t.charCodeAt(s));return r.write_shift(2,0),r}function Zve(e){var t=[0,0],r;return r=e.read_shift(2),t[0]=RD[r]||r,r=e.read_shift(2),t[1]=RD[r]||r,t}function e1e(e){return e||(e=Oe(4)),e.write_shift(2,1),e.write_shift(2,1),e}function t1e(e){for(var t=e.read_shift(2),r=[];t-- >0;)r.push(j9(e));return r}function r1e(e){for(var t=e.read_shift(2),r=[];t-- >0;)r.push(j9(e));return r}function a1e(e){e.l+=2;var t={cxfs:0,crc:0};return t.cxfs=e.read_shift(2),t.crc=e.read_shift(4),t}function I9(e,t,r){if(!r.cellStyles)return Hn(e,t);var a=r&&r.biff>=12?4:2,s=e.read_shift(a),i=e.read_shift(a),l=e.read_shift(a),o=e.read_shift(a),d=e.read_shift(2);a==2&&(e.l+=2);var u={s,e:i,w:l,ixfe:o,flags:d};return(r.biff>=5||!r.biff)&&(u.level=d>>8&7),u}function n1e(e,t){var r=Oe(12);r.write_shift(2,t),r.write_shift(2,t),r.write_shift(2,e.width*256),r.write_shift(2,0);var a=0;return e.hidden&&(a|=1),r.write_shift(1,a),a=e.level||0,r.write_shift(1,a),r.write_shift(2,0),r}function s1e(e,t){var r={};return t<32||(e.l+=16,r.header=On(e),r.footer=On(e),e.l+=2),r}function i1e(e,t,r){var a={area:!1};if(r.biff!=5)return e.l+=t,a;var s=e.read_shift(1);return e.l+=3,s&16&&(a.area=!0),a}function l1e(e){for(var t=Oe(2*e),r=0;r<e;++r)t.write_shift(2,r+1);return t}var o1e=Il,c1e=w9,d1e=rx;function u1e(e){var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(4),s={fmt:t,env:r,len:a,data:e.slice(e.l,e.l+a)};return e.l+=a,s}function A1e(e,t,r){r.biffguess&&r.biff==5&&(r.biff=2);var a=Il(e);++e.l;var s=du(e,t-7,r);return a.t="str",a.val=s,a}function f1e(e){var t=Il(e);++e.l;var r=On(e);return t.t="n",t.val=r,t}function p1e(e,t,r){var a=Oe(15);return ix(a,e,t),a.write_shift(8,r,"f"),a}function x1e(e){var t=Il(e);++e.l;var r=e.read_shift(2);return t.t="n",t.val=r,t}function h1e(e,t,r){var a=Oe(9);return ix(a,e,t),a.write_shift(2,r),a}function m1e(e){var t=e.read_shift(1);return t===0?(e.l++,""):e.read_shift(t,"sbcs-cont")}function g1e(e,t){e.l+=6,e.l+=2,e.l+=1,e.l+=3,e.l+=1,e.l+=t-13}function b1e(e,t,r){var a=e.l+t,s=Il(e),i=e.read_shift(2),l=Wd(e,i,r);return e.l=a,s.t="str",s.val=l,s}var v1e=[2,3,48,49,131,139,140,245],_C=(function(){var e={1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127,8:865,9:437,10:850,11:437,13:437,14:850,15:437,16:850,17:437,18:850,19:932,20:850,21:437,22:850,23:865,24:437,25:437,26:850,27:437,28:863,29:850,31:852,34:852,35:852,36:860,37:850,38:866,55:850,64:852,77:936,78:949,79:950,80:874,87:1252,88:1252,89:1252,108:863,134:737,135:852,136:857,204:1257,255:16969},t=dv({1:437,2:850,3:1252,4:1e4,100:852,101:866,102:865,103:861,104:895,105:620,106:737,107:857,120:950,121:949,122:936,123:932,124:874,125:1255,126:1256,150:10007,151:10029,152:10006,200:1250,201:1251,202:1254,203:1253,0:20127});function r(o,d){var u=[],f=Dc(1);switch(d.type){case"base64":f=Rs(Vs(o));break;case"binary":f=Rs(o);break;case"buffer":case"array":f=o;break}vn(f,0);var p=f.read_shift(1),h=!!(p&136),m=!1,b=!1;switch(p){case 2:break;case 3:break;case 48:m=!0,h=!0;break;case 49:m=!0,h=!0;break;case 131:break;case 139:break;case 140:b=!0;break;case 245:break;default:throw new Error("DBF Unsupported Version: "+p.toString(16))}var v=0,y=521;p==2&&(v=f.read_shift(2)),f.l+=3,p!=2&&(v=f.read_shift(4)),v>1048576&&(v=1e6),p!=2&&(y=f.read_shift(2));var j=f.read_shift(2),_=d.codepage||1252;p!=2&&(f.l+=16,f.read_shift(1),f[f.l]!==0&&(_=e[f[f.l]]),f.l+=1,f.l+=2),b&&(f.l+=36);for(var N=[],E={},T=Math.min(f.length,p==2?521:y-10-(m?264:0)),B=b?32:11;f.l<T&&f[f.l]!=13;)switch(E={},E.name=xp.utils.decode(_,f.slice(f.l,f.l+B)).replace(/[\u0000\r\n].*$/g,""),f.l+=B,E.type=String.fromCharCode(f.read_shift(1)),p!=2&&!b&&(E.offset=f.read_shift(4)),E.len=f.read_shift(1),p==2&&(E.offset=f.read_shift(2)),E.dec=f.read_shift(1),E.name.length&&N.push(E),p!=2&&(f.l+=b?13:14),E.type){case"B":(!m||E.len!=8)&&d.WTF&&console.log("Skipping "+E.name+":"+E.type);break;case"G":case"P":d.WTF&&console.log("Skipping "+E.name+":"+E.type);break;case"+":case"0":case"@":case"C":case"D":case"F":case"I":case"L":case"M":case"N":case"O":case"T":case"Y":break;default:throw new Error("Unknown Field Type: "+E.type)}if(f[f.l]!==13&&(f.l=y-1),f.read_shift(1)!==13)throw new Error("DBF Terminator not found "+f.l+" "+f[f.l]);f.l=y;var F=0,R=0;for(u[0]=[],R=0;R!=N.length;++R)u[0][R]=N[R].name;for(;v-- >0;){if(f[f.l]===42){f.l+=j;continue}for(++f.l,u[++F]=[],R=0,R=0;R!=N.length;++R){var U=f.slice(f.l,f.l+N[R].len);f.l+=N[R].len,vn(U,0);var D=xp.utils.decode(_,U);switch(N[R].type){case"C":D.trim().length&&(u[F][R]=D.replace(/\s+$/,""));break;case"D":D.length===8?u[F][R]=new Date(+D.slice(0,4),+D.slice(4,6)-1,+D.slice(6,8)):u[F][R]=D;break;case"F":u[F][R]=parseFloat(D.trim());break;case"+":case"I":u[F][R]=b?U.read_shift(-4,"i")^2147483648:U.read_shift(4,"i");break;case"L":switch(D.trim().toUpperCase()){case"Y":case"T":u[F][R]=!0;break;case"N":case"F":u[F][R]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+D+"|")}break;case"M":if(!h)throw new Error("DBF Unexpected MEMO for type "+p.toString(16));u[F][R]="##MEMO##"+(b?parseInt(D.trim(),10):U.read_shift(4));break;case"N":D=D.replace(/\u0000/g,"").trim(),D&&D!="."&&(u[F][R]=+D||0);break;case"@":u[F][R]=new Date(U.read_shift(-8,"f")-621356832e5);break;case"T":u[F][R]=new Date((U.read_shift(4)-2440588)*864e5+U.read_shift(4));break;case"Y":u[F][R]=U.read_shift(4,"i")/1e4+U.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":u[F][R]=-U.read_shift(-8,"f");break;case"B":if(m&&N[R].len==8){u[F][R]=U.read_shift(8,"f");break}case"G":case"P":U.l+=N[R].len;break;case"0":if(N[R].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+N[R].type)}}}if(p!=2&&f.l<f.length&&f[f.l++]!=26)throw new Error("DBF EOF Marker missing "+(f.l-1)+" of "+f.length+" "+f[f.l-1].toString(16));return d&&d.sheetRows&&(u=u.slice(0,d.sheetRows)),d.DBF=N,u}function a(o,d){var u=d||{};u.dateNF||(u.dateNF="yyyymmdd");var f=n0(r(o,u),u);return f["!cols"]=u.DBF.map(function(p){return{wch:p.len,DBF:p}}),delete u.DBF,f}function s(o,d){try{return Kc(a(o,d),d)}catch(u){if(d&&d.WTF)throw u}return{SheetNames:[],Sheets:{}}}var i={B:8,C:250,L:1,D:8,"?":0,"":0};function l(o,d){var u=d||{};if(+u.codepage>=0&&Pi(+u.codepage),u.type=="string")throw new Error("Cannot write DBF to JS string");var f=ms(),p=Zg(o,{header:1,raw:!0,cellDates:!0}),h=p[0],m=p.slice(1),b=o["!cols"]||[],v=0,y=0,j=0,_=1;for(v=0;v<h.length;++v){if(((b[v]||{}).DBF||{}).name){h[v]=b[v].DBF.name,++j;continue}if(h[v]!=null){if(++j,typeof h[v]=="number"&&(h[v]=h[v].toString(10)),typeof h[v]!="string")throw new Error("DBF Invalid column name "+h[v]+" |"+typeof h[v]+"|");if(h.indexOf(h[v])!==v){for(y=0;y<1024;++y)if(h.indexOf(h[v]+"_"+y)==-1){h[v]+="_"+y;break}}}}var N=Yt(o["!ref"]),E=[],T=[],B=[];for(v=0;v<=N.e.c-N.s.c;++v){var F="",R="",U=0,D=[];for(y=0;y<m.length;++y)m[y][v]!=null&&D.push(m[y][v]);if(D.length==0||h[v]==null){E[v]="?";continue}for(y=0;y<D.length;++y){switch(typeof D[y]){case"number":R="B";break;case"string":R="C";break;case"boolean":R="L";break;case"object":R=D[y]instanceof Date?"D":"C";break;default:R="C"}U=Math.max(U,String(D[y]).length),F=F&&F!=R?"C":R}U>250&&(U=250),R=((b[v]||{}).DBF||{}).type,R=="C"&&b[v].DBF.len>U&&(U=b[v].DBF.len),F=="B"&&R=="N"&&(F="N",B[v]=b[v].DBF.dec,U=b[v].DBF.len),T[v]=F=="C"||R=="N"?U:i[F]||0,_+=T[v],E[v]=F}var L=f.next(32);for(L.write_shift(4,318902576),L.write_shift(4,m.length),L.write_shift(2,296+32*j),L.write_shift(2,_),v=0;v<4;++v)L.write_shift(4,0);for(L.write_shift(4,0|(+t[yQ]||3)<<8),v=0,y=0;v<h.length;++v)if(h[v]!=null){var P=f.next(32),G=(h[v].slice(-10)+"\0\0\0\0\0\0\0\0\0\0\0").slice(0,11);P.write_shift(1,G,"sbcs"),P.write_shift(1,E[v]=="?"?"C":E[v],"sbcs"),P.write_shift(4,y),P.write_shift(1,T[v]||i[E[v]]||0),P.write_shift(1,B[v]||0),P.write_shift(1,2),P.write_shift(4,0),P.write_shift(1,0),P.write_shift(4,0),P.write_shift(4,0),y+=T[v]||i[E[v]]||0}var Q=f.next(264);for(Q.write_shift(4,13),v=0;v<65;++v)Q.write_shift(4,0);for(v=0;v<m.length;++v){var H=f.next(_);for(H.write_shift(1,0),y=0;y<h.length;++y)if(h[y]!=null)switch(E[y]){case"L":H.write_shift(1,m[v][y]==null?63:m[v][y]?84:70);break;case"B":H.write_shift(8,m[v][y]||0,"f");break;case"N":var X="0";for(typeof m[v][y]=="number"&&(X=m[v][y].toFixed(B[y]||0)),j=0;j<T[y]-X.length;++j)H.write_shift(1,32);H.write_shift(1,X,"sbcs");break;case"D":m[v][y]?(H.write_shift(4,("0000"+m[v][y].getFullYear()).slice(-4),"sbcs"),H.write_shift(2,("00"+(m[v][y].getMonth()+1)).slice(-2),"sbcs"),H.write_shift(2,("00"+m[v][y].getDate()).slice(-2),"sbcs")):H.write_shift(8,"00000000","sbcs");break;case"C":var K=String(m[v][y]!=null?m[v][y]:"").slice(0,T[y]);for(H.write_shift(1,K,"sbcs"),j=0;j<T[y]-K.length;++j)H.write_shift(1,32);break}}return f.next(1).write_shift(1,26),f.end()}return{to_workbook:s,to_sheet:a,from_sheet:l}})(),F9=(function(){var e={AA:"À",BA:"Á",CA:"Â",DA:195,HA:"Ä",JA:197,AE:"È",BE:"É",CE:"Ê",HE:"Ë",AI:"Ì",BI:"Í",CI:"Î",HI:"Ï",AO:"Ò",BO:"Ó",CO:"Ô",DO:213,HO:"Ö",AU:"Ù",BU:"Ú",CU:"Û",HU:"Ü",Aa:"à",Ba:"á",Ca:"â",Da:227,Ha:"ä",Ja:229,Ae:"è",Be:"é",Ce:"ê",He:"ë",Ai:"ì",Bi:"í",Ci:"î",Hi:"ï",Ao:"ò",Bo:"ó",Co:"ô",Do:245,Ho:"ö",Au:"ù",Bu:"ú",Cu:"û",Hu:"ü",KC:"Ç",Kc:"ç",q:"æ",z:"œ",a:"Æ",j:"Œ",DN:209,Dn:241,Hy:255,S:169,c:170,R:174,"B ":180,0:176,1:177,2:178,3:179,5:181,6:182,7:183,Q:185,k:186,b:208,i:216,l:222,s:240,y:248,"!":161,'"':162,"#":163,"(":164,"%":165,"'":167,"H ":168,"+":171,";":187,"<":188,"=":189,">":190,"?":191,"{":223},t=new RegExp("\x1BN("+fa(e).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),r=function(h,m){var b=e[m];return typeof b=="number"?dD(b):b},a=function(h,m,b){var v=m.charCodeAt(0)-32<<4|b.charCodeAt(0)-48;return v==59?h:dD(v)};e["|"]=254;function s(h,m){switch(m.type){case"base64":return i(Vs(h),m);case"binary":return i(h,m);case"buffer":return i(Mt&&Buffer.isBuffer(h)?h.toString("binary"):Gc(h),m);case"array":return i(Kd(h),m)}throw new Error("Unrecognized type "+m.type)}function i(h,m){var b=h.split(/[\n\r]+/),v=-1,y=-1,j=0,_=0,N=[],E=[],T=null,B={},F=[],R=[],U=[],D=0,L;for(+m.codepage>=0&&Pi(+m.codepage);j!==b.length;++j){D=0;var P=b[j].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,a).replace(t,r),G=P.replace(/;;/g,"\0").split(";").map(function(J){return J.replace(/\u0000/g,";")}),Q=G[0],H;if(P.length>0)switch(Q){case"ID":break;case"E":break;case"B":break;case"O":break;case"W":break;case"P":G[1].charAt(0)=="P"&&E.push(P.slice(3).replace(/;;/g,";"));break;case"C":var X=!1,K=!1,ee=!1,W=!1,Y=-1,M=-1;for(_=1;_<G.length;++_)switch(G[_].charAt(0)){case"A":break;case"X":y=parseInt(G[_].slice(1))-1,K=!0;break;case"Y":for(v=parseInt(G[_].slice(1))-1,K||(y=0),L=N.length;L<=v;++L)N[L]=[];break;case"K":H=G[_].slice(1),H.charAt(0)==='"'?H=H.slice(1,H.length-1):H==="TRUE"?H=!0:H==="FALSE"?H=!1:isNaN(Vi(H))?isNaN(DA(H).getDate())||(H=Or(H)):(H=Vi(H),T!==null&&r0(T)&&(H=Av(H))),X=!0;break;case"E":W=!0;var O=NA(G[_].slice(1),{r:v,c:y});N[v][y]=[N[v][y],O];break;case"S":ee=!0,N[v][y]=[N[v][y],"S5S"];break;case"G":break;case"R":Y=parseInt(G[_].slice(1))-1;break;case"C":M=parseInt(G[_].slice(1))-1;break;default:if(m&&m.WTF)throw new Error("SYLK bad record "+P)}if(X&&(N[v][y]&&N[v][y].length==2?N[v][y][0]=H:N[v][y]=H,T=null),ee){if(W)throw new Error("SYLK shared formula cannot have own formula");var q=Y>-1&&N[Y][M];if(!q||!q[1])throw new Error("SYLK shared formula cannot find base");N[v][y][1]=X9(q[1],{r:v-Y,c:y-M})}break;case"F":var z=0;for(_=1;_<G.length;++_)switch(G[_].charAt(0)){case"X":y=parseInt(G[_].slice(1))-1,++z;break;case"Y":for(v=parseInt(G[_].slice(1))-1,L=N.length;L<=v;++L)N[L]=[];break;case"M":D=parseInt(G[_].slice(1))/20;break;case"F":break;case"G":break;case"P":T=E[parseInt(G[_].slice(1))];break;case"S":break;case"D":break;case"N":break;case"W":for(U=G[_].slice(1).split(" "),L=parseInt(U[0],10);L<=parseInt(U[1],10);++L)D=parseInt(U[2],10),R[L-1]=D===0?{hidden:!0}:{wch:D},Uc(R[L-1]);break;case"C":y=parseInt(G[_].slice(1))-1,R[y]||(R[y]={});break;case"R":v=parseInt(G[_].slice(1))-1,F[v]||(F[v]={}),D>0?(F[v].hpt=D,F[v].hpx=MA(D)):D===0&&(F[v].hidden=!0);break;default:if(m&&m.WTF)throw new Error("SYLK bad record "+P)}z<1&&(T=null);break;default:if(m&&m.WTF)throw new Error("SYLK bad record "+P)}}return F.length>0&&(B["!rows"]=F),R.length>0&&(B["!cols"]=R),m&&m.sheetRows&&(N=N.slice(0,m.sheetRows)),[N,B]}function l(h,m){var b=s(h,m),v=b[0],y=b[1],j=n0(v,m);return fa(y).forEach(function(_){j[_]=y[_]}),j}function o(h,m){return Kc(l(h,m),m)}function d(h,m,b,v){var y="C;Y"+(b+1)+";X"+(v+1)+";K";switch(h.t){case"n":y+=h.v||0,h.f&&!h.F&&(y+=";E"+TE(h.f,{r:b,c:v}));break;case"b":y+=h.v?"TRUE":"FALSE";break;case"e":y+=h.w||h.v;break;case"d":y+='"'+(h.w||h.v)+'"';break;case"s":y+='"'+h.v.replace(/"/g,"").replace(/;/g,";;")+'"';break}return y}function u(h,m){m.forEach(function(b,v){var y="F;W"+(v+1)+" "+(v+1)+" ";b.hidden?y+="0":(typeof b.width=="number"&&!b.wpx&&(b.wpx=Np(b.width)),typeof b.wpx=="number"&&!b.wch&&(b.wch=Cp(b.wpx)),typeof b.wch=="number"&&(y+=Math.round(b.wch))),y.charAt(y.length-1)!=" "&&h.push(y)})}function f(h,m){m.forEach(function(b,v){var y="F;";b.hidden?y+="M0;":b.hpt?y+="M"+20*b.hpt+";":b.hpx&&(y+="M"+20*kp(b.hpx)+";"),y.length>2&&h.push(y+"R"+(v+1))})}function p(h,m){var b=["ID;PWXL;N;E"],v=[],y=Yt(h["!ref"]),j,_=Array.isArray(h),N=`\r
`;b.push("P;PGeneral"),b.push("F;P0;DG0G8;M255"),h["!cols"]&&u(b,h["!cols"]),h["!rows"]&&f(b,h["!rows"]),b.push("B;Y"+(y.e.r-y.s.r+1)+";X"+(y.e.c-y.s.c+1)+";D"+[y.s.c,y.s.r,y.e.c,y.e.r].join(" "));for(var E=y.s.r;E<=y.e.r;++E)for(var T=y.s.c;T<=y.e.c;++T){var B=yt({r:E,c:T});j=_?(h[E]||[])[T]:h[B],!(!j||j.v==null&&(!j.f||j.F))&&v.push(d(j,h,E,T))}return b.join(N)+N+v.join(N)+N+"E"+N}return{to_workbook:o,to_sheet:l,from_sheet:p}})(),D9=(function(){function e(i,l){switch(l.type){case"base64":return t(Vs(i),l);case"binary":return t(i,l);case"buffer":return t(Mt&&Buffer.isBuffer(i)?i.toString("binary"):Gc(i),l);case"array":return t(Kd(i),l)}throw new Error("Unrecognized type "+l.type)}function t(i,l){for(var o=i.split(`
`),d=-1,u=-1,f=0,p=[];f!==o.length;++f){if(o[f].trim()==="BOT"){p[++d]=[],u=0;continue}if(!(d<0)){var h=o[f].trim().split(","),m=h[0],b=h[1];++f;for(var v=o[f]||"";(v.match(/["]/g)||[]).length&1&&f<o.length-1;)v+=`
`+o[++f];switch(v=v.trim(),+m){case-1:if(v==="BOT"){p[++d]=[],u=0;continue}else if(v!=="EOD")throw new Error("Unrecognized DIF special command "+v);break;case 0:v==="TRUE"?p[d][u]=!0:v==="FALSE"?p[d][u]=!1:isNaN(Vi(b))?isNaN(DA(b).getDate())?p[d][u]=b:p[d][u]=Or(b):p[d][u]=Vi(b),++u;break;case 1:v=v.slice(1,v.length-1),v=v.replace(/""/g,'"'),v&&v.match(/^=".*"$/)&&(v=v.slice(2,-1)),p[d][u++]=v!==""?v:null;break}if(v==="EOD")break}}return l&&l.sheetRows&&(p=p.slice(0,l.sheetRows)),p}function r(i,l){return n0(e(i,l),l)}function a(i,l){return Kc(r(i,l),l)}var s=(function(){var i=function(d,u,f,p,h){d.push(u),d.push(f+","+p),d.push('"'+h.replace(/"/g,'""')+'"')},l=function(d,u,f,p){d.push(u+","+f),d.push(u==1?'"'+p.replace(/"/g,'""')+'"':p)};return function(d){var u=[],f=Yt(d["!ref"]),p,h=Array.isArray(d);i(u,"TABLE",0,1,"sheetjs"),i(u,"VECTORS",0,f.e.r-f.s.r+1,""),i(u,"TUPLES",0,f.e.c-f.s.c+1,""),i(u,"DATA",0,0,"");for(var m=f.s.r;m<=f.e.r;++m){l(u,-1,0,"BOT");for(var b=f.s.c;b<=f.e.c;++b){var v=yt({r:m,c:b});if(p=h?(d[m]||[])[b]:d[v],!p){l(u,1,0,"");continue}switch(p.t){case"n":var y=p.w;!y&&p.v!=null&&(y=p.v),y==null?p.f&&!p.F?l(u,1,0,"="+p.f):l(u,1,0,""):l(u,0,y,"V");break;case"b":l(u,0,p.v?1:0,p.v?"TRUE":"FALSE");break;case"s":l(u,1,0,isNaN(p.v)?p.v:'="'+p.v+'"');break;case"d":p.w||(p.w=ji(p.z||vt[14],$a(Or(p.v)))),l(u,0,p.w,"V");break;default:l(u,1,0,"")}}}l(u,-1,0,"EOD");var j=`\r
`,_=u.join(j);return _}})();return{to_workbook:a,to_sheet:r,from_sheet:s}})(),U9=(function(){function e(p){return p.replace(/\\b/g,"\\").replace(/\\c/g,":").replace(/\\n/g,`
`)}function t(p){return p.replace(/\\/g,"\\b").replace(/:/g,"\\c").replace(/\n/g,"\\n")}function r(p,h){for(var m=p.split(`
`),b=-1,v=-1,y=0,j=[];y!==m.length;++y){var _=m[y].trim().split(":");if(_[0]==="cell"){var N=Zr(_[1]);if(j.length<=N.r)for(b=j.length;b<=N.r;++b)j[b]||(j[b]=[]);switch(b=N.r,v=N.c,_[2]){case"t":j[b][v]=e(_[3]);break;case"v":j[b][v]=+_[3];break;case"vtf":var E=_[_.length-1];case"vtc":switch(_[3]){case"nl":j[b][v]=!!+_[4];break;default:j[b][v]=+_[4];break}_[2]=="vtf"&&(j[b][v]=[j[b][v],E])}}}return h&&h.sheetRows&&(j=j.slice(0,h.sheetRows)),j}function a(p,h){return n0(r(p,h),h)}function s(p,h){return Kc(a(p,h),h)}var i=["socialcalc:version:1.5","MIME-Version: 1.0","Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"].join(`
`),l=["--SocialCalcSpreadsheetControlSave","Content-type: text/plain; charset=UTF-8"].join(`
`)+`
`,o=["# SocialCalc Spreadsheet Control Save","part:sheet"].join(`
`),d="--SocialCalcSpreadsheetControlSave--";function u(p){if(!p||!p["!ref"])return"";for(var h=[],m=[],b,v="",y=ys(p["!ref"]),j=Array.isArray(p),_=y.s.r;_<=y.e.r;++_)for(var N=y.s.c;N<=y.e.c;++N)if(v=yt({r:_,c:N}),b=j?(p[_]||[])[N]:p[v],!(!b||b.v==null||b.t==="z")){switch(m=["cell",v,"t"],b.t){case"s":case"str":m.push(t(b.v));break;case"n":b.f?(m[2]="vtf",m[3]="n",m[4]=b.v,m[5]=t(b.f)):(m[2]="v",m[3]=b.v);break;case"b":m[2]="vt"+(b.f?"f":"c"),m[3]="nl",m[4]=b.v?"1":"0",m[5]=t(b.f||(b.v?"TRUE":"FALSE"));break;case"d":var E=$a(Or(b.v));m[2]="vtc",m[3]="nd",m[4]=""+E,m[5]=b.w||ji(b.z||vt[14],E);break;case"e":continue}h.push(m.join(":"))}return h.push("sheet:c:"+(y.e.c-y.s.c+1)+":r:"+(y.e.r-y.s.r+1)+":tvf:1"),h.push("valueformat:1:text-wiki"),h.join(`
`)}function f(p){return[i,l,o,l,u(p),d].join(`
`)}return{to_workbook:s,to_sheet:a,from_sheet:f}})(),UA=(function(){function e(f,p,h,m,b){b.raw?p[h][m]=f:f===""||(f==="TRUE"?p[h][m]=!0:f==="FALSE"?p[h][m]=!1:isNaN(Vi(f))?isNaN(DA(f).getDate())?p[h][m]=f:p[h][m]=Or(f):p[h][m]=Vi(f))}function t(f,p){var h=p||{},m=[];if(!f||f.length===0)return m;for(var b=f.split(/[\r\n]/),v=b.length-1;v>=0&&b[v].length===0;)--v;for(var y=10,j=0,_=0;_<=v;++_)j=b[_].indexOf(" "),j==-1?j=b[_].length:j++,y=Math.max(y,j);for(_=0;_<=v;++_){m[_]=[];var N=0;for(e(b[_].slice(0,y).trim(),m,_,N,h),N=1;N<=(b[_].length-y)/10+1;++N)e(b[_].slice(y+(N-1)*10,y+N*10).trim(),m,_,N,h)}return h.sheetRows&&(m=m.slice(0,h.sheetRows)),m}var r={44:",",9:"	",59:";",124:"|"},a={44:3,9:2,59:1,124:0};function s(f){for(var p={},h=!1,m=0,b=0;m<f.length;++m)(b=f.charCodeAt(m))==34?h=!h:!h&&b in r&&(p[b]=(p[b]||0)+1);b=[];for(m in p)Object.prototype.hasOwnProperty.call(p,m)&&b.push([p[m],m]);if(!b.length){p=a;for(m in p)Object.prototype.hasOwnProperty.call(p,m)&&b.push([p[m],m])}return b.sort(function(v,y){return v[0]-y[0]||a[v[1]]-a[y[1]]}),r[b.pop()[1]]||44}function i(f,p){var h=p||{},m="",b=h.dense?[]:{},v={s:{c:0,r:0},e:{c:0,r:0}};f.slice(0,4)=="sep="?f.charCodeAt(5)==13&&f.charCodeAt(6)==10?(m=f.charAt(4),f=f.slice(7)):f.charCodeAt(5)==13||f.charCodeAt(5)==10?(m=f.charAt(4),f=f.slice(6)):m=s(f.slice(0,1024)):h&&h.FS?m=h.FS:m=s(f.slice(0,1024));var y=0,j=0,_=0,N=0,E=0,T=m.charCodeAt(0),B=!1,F=0,R=f.charCodeAt(0);f=f.replace(/\r\n/mg,`
`);var U=h.dateNF!=null?ige(h.dateNF):null;function D(){var L=f.slice(N,E),P={};if(L.charAt(0)=='"'&&L.charAt(L.length-1)=='"'&&(L=L.slice(1,-1).replace(/""/g,'"')),L.length===0)P.t="z";else if(h.raw)P.t="s",P.v=L;else if(L.trim().length===0)P.t="s",P.v=L;else if(L.charCodeAt(0)==61)L.charCodeAt(1)==34&&L.charCodeAt(L.length-1)==34?(P.t="s",P.v=L.slice(2,-1).replace(/""/g,'"')):Uwe(L)?(P.t="n",P.f=L.slice(1)):(P.t="s",P.v=L);else if(L=="TRUE")P.t="b",P.v=!0;else if(L=="FALSE")P.t="b",P.v=!1;else if(!isNaN(_=Vi(L)))P.t="n",h.cellText!==!1&&(P.w=L),P.v=_;else if(!isNaN(DA(L).getDate())||U&&L.match(U)){P.z=h.dateNF||vt[14];var G=0;U&&L.match(U)&&(L=lge(L,h.dateNF,L.match(U)||[]),G=1),h.cellDates?(P.t="d",P.v=Or(L,G)):(P.t="n",P.v=$a(Or(L,G))),h.cellText!==!1&&(P.w=ji(P.z,P.v instanceof Date?$a(P.v):P.v)),h.cellNF||delete P.z}else P.t="s",P.v=L;if(P.t=="z"||(h.dense?(b[y]||(b[y]=[]),b[y][j]=P):b[yt({c:j,r:y})]=P),N=E+1,R=f.charCodeAt(N),v.e.c<j&&(v.e.c=j),v.e.r<y&&(v.e.r=y),F==T)++j;else if(j=0,++y,h.sheetRows&&h.sheetRows<=y)return!0}e:for(;E<f.length;++E)switch(F=f.charCodeAt(E)){case 34:R===34&&(B=!B);break;case T:case 10:case 13:if(!B&&D())break e;break}return E-N>0&&D(),b["!ref"]=Tt(v),b}function l(f,p){return!(p&&p.PRN)||p.FS||f.slice(0,4)=="sep="||f.indexOf("	")>=0||f.indexOf(",")>=0||f.indexOf(";")>=0?i(f,p):n0(t(f,p),p)}function o(f,p){var h="",m=p.type=="string"?[0,0,0,0]:PE(f,p);switch(p.type){case"base64":h=Vs(f);break;case"binary":h=f;break;case"buffer":p.codepage==65001?h=f.toString("utf8"):p.codepage&&typeof xp<"u"||(h=Mt&&Buffer.isBuffer(f)?f.toString("binary"):Gc(f));break;case"array":h=Kd(f);break;case"string":h=f;break;default:throw new Error("Unrecognized type "+p.type)}return m[0]==239&&m[1]==187&&m[2]==191?h=gr(h.slice(3)):p.type!="string"&&p.type!="buffer"&&p.codepage==65001?h=gr(h):p.type=="binary"&&typeof xp<"u",h.slice(0,19)=="socialcalc:version:"?U9.to_sheet(p.type=="string"?h:gr(h),p):l(h,p)}function d(f,p){return Kc(o(f,p),p)}function u(f){for(var p=[],h=Yt(f["!ref"]),m,b=Array.isArray(f),v=h.s.r;v<=h.e.r;++v){for(var y=[],j=h.s.c;j<=h.e.c;++j){var _=yt({r:v,c:j});if(m=b?(f[v]||[])[j]:f[_],!m||m.v==null){y.push("          ");continue}for(var N=(m.w||(Co(m),m.w)||"").slice(0,10);N.length<10;)N+=" ";y.push(N+(j===0?" ":""))}p.push(y.join(""))}return p.join(`
`)}return{to_workbook:d,to_sheet:o,from_sheet:u}})();function y1e(e,t){var r=t||{},a=!!r.WTF;r.WTF=!0;try{var s=F9.to_workbook(e,r);return r.WTF=a,s}catch(i){if(r.WTF=a,!i.message.match(/SYLK bad record ID/)&&a)throw i;return UA.to_workbook(e,t)}}var Fd=(function(){function e(O,q,z){if(O){vn(O,O.l||0);for(var J=z.Enum||Y;O.l<O.length;){var re=O.read_shift(2),le=J[re]||J[65535],ne=O.read_shift(2),ae=O.l+ne,ie=le.f&&le.f(O,ne,z);if(O.l=ae,q(ie,le,re))return}}}function t(O,q){switch(q.type){case"base64":return r(Rs(Vs(O)),q);case"binary":return r(Rs(O),q);case"buffer":case"array":return r(O,q)}throw"Unsupported type "+q.type}function r(O,q){if(!O)return O;var z=q||{},J=z.dense?[]:{},re="Sheet1",le="",ne=0,ae={},ie=[],me=[],Z={s:{r:0,c:0},e:{r:0,c:0}},Me=z.sheetRows||0;if(O[2]==0&&(O[3]==8||O[3]==9)&&O.length>=16&&O[14]==5&&O[15]===108)throw new Error("Unsupported Works 3 for Mac file");if(O[2]==2)z.Enum=Y,e(O,function(fe,Ue,qe){switch(qe){case 0:z.vers=fe,fe>=4096&&(z.qpro=!0);break;case 6:Z=fe;break;case 204:fe&&(le=fe);break;case 222:le=fe;break;case 15:case 51:z.qpro||(fe[1].v=fe[1].v.slice(1));case 13:case 14:case 16:qe==14&&(fe[2]&112)==112&&(fe[2]&15)>1&&(fe[2]&15)<15&&(fe[1].z=z.dateNF||vt[14],z.cellDates&&(fe[1].t="d",fe[1].v=Av(fe[1].v))),z.qpro&&fe[3]>ne&&(J["!ref"]=Tt(Z),ae[re]=J,ie.push(re),J=z.dense?[]:{},Z={s:{r:0,c:0},e:{r:0,c:0}},ne=fe[3],re=le||"Sheet"+(ne+1),le="");var at=z.dense?(J[fe[0].r]||[])[fe[0].c]:J[yt(fe[0])];if(at){at.t=fe[1].t,at.v=fe[1].v,fe[1].z!=null&&(at.z=fe[1].z),fe[1].f!=null&&(at.f=fe[1].f);break}z.dense?(J[fe[0].r]||(J[fe[0].r]=[]),J[fe[0].r][fe[0].c]=fe[1]):J[yt(fe[0])]=fe[1];break}},z);else if(O[2]==26||O[2]==14)z.Enum=M,O[2]==14&&(z.qpro=!0,O.l=0),e(O,function(fe,Ue,qe){switch(qe){case 204:re=fe;break;case 22:fe[1].v=fe[1].v.slice(1);case 23:case 24:case 25:case 37:case 39:case 40:if(fe[3]>ne&&(J["!ref"]=Tt(Z),ae[re]=J,ie.push(re),J=z.dense?[]:{},Z={s:{r:0,c:0},e:{r:0,c:0}},ne=fe[3],re="Sheet"+(ne+1)),Me>0&&fe[0].r>=Me)break;z.dense?(J[fe[0].r]||(J[fe[0].r]=[]),J[fe[0].r][fe[0].c]=fe[1]):J[yt(fe[0])]=fe[1],Z.e.c<fe[0].c&&(Z.e.c=fe[0].c),Z.e.r<fe[0].r&&(Z.e.r=fe[0].r);break;case 27:fe[14e3]&&(me[fe[14e3][0]]=fe[14e3][1]);break;case 1537:me[fe[0]]=fe[1],fe[0]==ne&&(re=fe[1]);break}},z);else throw new Error("Unrecognized LOTUS BOF "+O[2]);if(J["!ref"]=Tt(Z),ae[le||re]=J,ie.push(le||re),!me.length)return{SheetNames:ie,Sheets:ae};for(var pe={},he=[],ye=0;ye<me.length;++ye)ae[ie[ye]]?(he.push(me[ye]||ie[ye]),pe[me[ye]]=ae[me[ye]]||ae[ie[ye]]):(he.push(me[ye]),pe[me[ye]]={"!ref":"A1"});return{SheetNames:he,Sheets:pe}}function a(O,q){var z=q||{};if(+z.codepage>=0&&Pi(+z.codepage),z.type=="string")throw new Error("Cannot write WK1 to JS string");var J=ms(),re=Yt(O["!ref"]),le=Array.isArray(O),ne=[];Xe(J,0,i(1030)),Xe(J,6,d(re));for(var ae=Math.min(re.e.r,8191),ie=re.s.r;ie<=ae;++ie)for(var me=ya(ie),Z=re.s.c;Z<=re.e.c;++Z){ie===re.s.r&&(ne[Z]=Jr(Z));var Me=ne[Z]+me,pe=le?(O[ie]||[])[Z]:O[Me];if(!(!pe||pe.t=="z"))if(pe.t=="n")(pe.v|0)==pe.v&&pe.v>=-32768&&pe.v<=32767?Xe(J,13,m(ie,Z,pe.v)):Xe(J,14,v(ie,Z,pe.v));else{var he=Co(pe);Xe(J,15,p(ie,Z,he.slice(0,239)))}}return Xe(J,1),J.end()}function s(O,q){var z=q||{};if(+z.codepage>=0&&Pi(+z.codepage),z.type=="string")throw new Error("Cannot write WK3 to JS string");var J=ms();Xe(J,0,l(O));for(var re=0,le=0;re<O.SheetNames.length;++re)(O.Sheets[O.SheetNames[re]]||{})["!ref"]&&Xe(J,27,W(O.SheetNames[re],le++));var ne=0;for(re=0;re<O.SheetNames.length;++re){var ae=O.Sheets[O.SheetNames[re]];if(!(!ae||!ae["!ref"])){for(var ie=Yt(ae["!ref"]),me=Array.isArray(ae),Z=[],Me=Math.min(ie.e.r,8191),pe=ie.s.r;pe<=Me;++pe)for(var he=ya(pe),ye=ie.s.c;ye<=ie.e.c;++ye){pe===ie.s.r&&(Z[ye]=Jr(ye));var fe=Z[ye]+he,Ue=me?(ae[pe]||[])[ye]:ae[fe];if(!(!Ue||Ue.t=="z"))if(Ue.t=="n")Xe(J,23,D(pe,ye,ne,Ue.v));else{var qe=Co(Ue);Xe(J,22,F(pe,ye,ne,qe.slice(0,239)))}}++ne}}return Xe(J,1),J.end()}function i(O){var q=Oe(2);return q.write_shift(2,O),q}function l(O){var q=Oe(26);q.write_shift(2,4096),q.write_shift(2,4),q.write_shift(4,0);for(var z=0,J=0,re=0,le=0;le<O.SheetNames.length;++le){var ne=O.SheetNames[le],ae=O.Sheets[ne];if(!(!ae||!ae["!ref"])){++re;var ie=ys(ae["!ref"]);z<ie.e.r&&(z=ie.e.r),J<ie.e.c&&(J=ie.e.c)}}return z>8191&&(z=8191),q.write_shift(2,z),q.write_shift(1,re),q.write_shift(1,J),q.write_shift(2,0),q.write_shift(2,0),q.write_shift(1,1),q.write_shift(1,2),q.write_shift(4,0),q.write_shift(4,0),q}function o(O,q,z){var J={s:{c:0,r:0},e:{c:0,r:0}};return q==8&&z.qpro?(J.s.c=O.read_shift(1),O.l++,J.s.r=O.read_shift(2),J.e.c=O.read_shift(1),O.l++,J.e.r=O.read_shift(2),J):(J.s.c=O.read_shift(2),J.s.r=O.read_shift(2),q==12&&z.qpro&&(O.l+=2),J.e.c=O.read_shift(2),J.e.r=O.read_shift(2),q==12&&z.qpro&&(O.l+=2),J.s.c==65535&&(J.s.c=J.e.c=J.s.r=J.e.r=0),J)}function d(O){var q=Oe(8);return q.write_shift(2,O.s.c),q.write_shift(2,O.s.r),q.write_shift(2,O.e.c),q.write_shift(2,O.e.r),q}function u(O,q,z){var J=[{c:0,r:0},{t:"n",v:0},0,0];return z.qpro&&z.vers!=20768?(J[0].c=O.read_shift(1),J[3]=O.read_shift(1),J[0].r=O.read_shift(2),O.l+=2):(J[2]=O.read_shift(1),J[0].c=O.read_shift(2),J[0].r=O.read_shift(2)),J}function f(O,q,z){var J=O.l+q,re=u(O,q,z);if(re[1].t="s",z.vers==20768){O.l++;var le=O.read_shift(1);return re[1].v=O.read_shift(le,"utf8"),re}return z.qpro&&O.l++,re[1].v=O.read_shift(J-O.l,"cstr"),re}function p(O,q,z){var J=Oe(7+z.length);J.write_shift(1,255),J.write_shift(2,q),J.write_shift(2,O),J.write_shift(1,39);for(var re=0;re<J.length;++re){var le=z.charCodeAt(re);J.write_shift(1,le>=128?95:le)}return J.write_shift(1,0),J}function h(O,q,z){var J=u(O,q,z);return J[1].v=O.read_shift(2,"i"),J}function m(O,q,z){var J=Oe(7);return J.write_shift(1,255),J.write_shift(2,q),J.write_shift(2,O),J.write_shift(2,z,"i"),J}function b(O,q,z){var J=u(O,q,z);return J[1].v=O.read_shift(8,"f"),J}function v(O,q,z){var J=Oe(13);return J.write_shift(1,255),J.write_shift(2,q),J.write_shift(2,O),J.write_shift(8,z,"f"),J}function y(O,q,z){var J=O.l+q,re=u(O,q,z);if(re[1].v=O.read_shift(8,"f"),z.qpro)O.l=J;else{var le=O.read_shift(2);E(O.slice(O.l,O.l+le),re),O.l+=le}return re}function j(O,q,z){var J=q&32768;return q&=-32769,q=(J?O:0)+(q>=8192?q-16384:q),(J?"":"$")+(z?Jr(q):ya(q))}var _={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]},N=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function E(O,q){vn(O,0);for(var z=[],J=0,re="",le="",ne="",ae="";O.l<O.length;){var ie=O[O.l++];switch(ie){case 0:z.push(O.read_shift(8,"f"));break;case 1:le=j(q[0].c,O.read_shift(2),!0),re=j(q[0].r,O.read_shift(2),!1),z.push(le+re);break;case 2:{var me=j(q[0].c,O.read_shift(2),!0),Z=j(q[0].r,O.read_shift(2),!1);le=j(q[0].c,O.read_shift(2),!0),re=j(q[0].r,O.read_shift(2),!1),z.push(me+Z+":"+le+re)}break;case 3:if(O.l<O.length){console.error("WK1 premature formula end");return}break;case 4:z.push("("+z.pop()+")");break;case 5:z.push(O.read_shift(2));break;case 6:{for(var Me="";ie=O[O.l++];)Me+=String.fromCharCode(ie);z.push('"'+Me.replace(/"/g,'""')+'"')}break;case 8:z.push("-"+z.pop());break;case 23:z.push("+"+z.pop());break;case 22:z.push("NOT("+z.pop()+")");break;case 20:case 21:ae=z.pop(),ne=z.pop(),z.push(["AND","OR"][ie-20]+"("+ne+","+ae+")");break;default:if(ie<32&&N[ie])ae=z.pop(),ne=z.pop(),z.push(ne+N[ie]+ae);else if(_[ie]){if(J=_[ie][1],J==69&&(J=O[O.l++]),J>z.length){console.error("WK1 bad formula parse 0x"+ie.toString(16)+":|"+z.join("|")+"|");return}var pe=z.slice(-J);z.length-=J,z.push(_[ie][0]+"("+pe.join(",")+")")}else return ie<=7?console.error("WK1 invalid opcode "+ie.toString(16)):ie<=24?console.error("WK1 unsupported op "+ie.toString(16)):ie<=30?console.error("WK1 invalid opcode "+ie.toString(16)):ie<=115?console.error("WK1 unsupported function opcode "+ie.toString(16)):console.error("WK1 unrecognized opcode "+ie.toString(16))}}z.length==1?q[1].f=""+z[0]:console.error("WK1 bad formula parse |"+z.join("|")+"|")}function T(O){var q=[{c:0,r:0},{t:"n",v:0},0];return q[0].r=O.read_shift(2),q[3]=O[O.l++],q[0].c=O[O.l++],q}function B(O,q){var z=T(O);return z[1].t="s",z[1].v=O.read_shift(q-4,"cstr"),z}function F(O,q,z,J){var re=Oe(6+J.length);re.write_shift(2,O),re.write_shift(1,z),re.write_shift(1,q),re.write_shift(1,39);for(var le=0;le<J.length;++le){var ne=J.charCodeAt(le);re.write_shift(1,ne>=128?95:ne)}return re.write_shift(1,0),re}function R(O,q){var z=T(O);z[1].v=O.read_shift(2);var J=z[1].v>>1;if(z[1].v&1)switch(J&7){case 0:J=(J>>3)*5e3;break;case 1:J=(J>>3)*500;break;case 2:J=(J>>3)/20;break;case 3:J=(J>>3)/200;break;case 4:J=(J>>3)/2e3;break;case 5:J=(J>>3)/2e4;break;case 6:J=(J>>3)/16;break;case 7:J=(J>>3)/64;break}return z[1].v=J,z}function U(O,q){var z=T(O),J=O.read_shift(4),re=O.read_shift(4),le=O.read_shift(2);if(le==65535)return J===0&&re===3221225472?(z[1].t="e",z[1].v=15):J===0&&re===3489660928?(z[1].t="e",z[1].v=42):z[1].v=0,z;var ne=le&32768;return le=(le&32767)-16446,z[1].v=(1-ne*2)*(re*Math.pow(2,le+32)+J*Math.pow(2,le)),z}function D(O,q,z,J){var re=Oe(14);if(re.write_shift(2,O),re.write_shift(1,z),re.write_shift(1,q),J==0)return re.write_shift(4,0),re.write_shift(4,0),re.write_shift(2,65535),re;var le=0,ne=0,ae=0,ie=0;return J<0&&(le=1,J=-J),ne=Math.log2(J)|0,J/=Math.pow(2,ne-31),ie=J>>>0,(ie&2147483648)==0&&(J/=2,++ne,ie=J>>>0),J-=ie,ie|=2147483648,ie>>>=0,J*=Math.pow(2,32),ae=J>>>0,re.write_shift(4,ae),re.write_shift(4,ie),ne+=16383+(le?32768:0),re.write_shift(2,ne),re}function L(O,q){var z=U(O);return O.l+=q-14,z}function P(O,q){var z=T(O),J=O.read_shift(4);return z[1].v=J>>6,z}function G(O,q){var z=T(O),J=O.read_shift(8,"f");return z[1].v=J,z}function Q(O,q){var z=G(O);return O.l+=q-10,z}function H(O,q){return O[O.l+q-1]==0?O.read_shift(q,"cstr"):""}function X(O,q){var z=O[O.l++];z>q-1&&(z=q-1);for(var J="";J.length<z;)J+=String.fromCharCode(O[O.l++]);return J}function K(O,q,z){if(!(!z.qpro||q<21)){var J=O.read_shift(1);O.l+=17,O.l+=1,O.l+=2;var re=O.read_shift(q-21,"cstr");return[J,re]}}function ee(O,q){for(var z={},J=O.l+q;O.l<J;){var re=O.read_shift(2);if(re==14e3){for(z[re]=[0,""],z[re][0]=O.read_shift(2);O[O.l];)z[re][1]+=String.fromCharCode(O[O.l]),O.l++;O.l++}}return z}function W(O,q){var z=Oe(5+O.length);z.write_shift(2,14e3),z.write_shift(2,q);for(var J=0;J<O.length;++J){var re=O.charCodeAt(J);z[z.l++]=re>127?95:re}return z[z.l++]=0,z}var Y={0:{n:"BOF",f:_a},1:{n:"EOF"},2:{n:"CALCMODE"},3:{n:"CALCORDER"},4:{n:"SPLIT"},5:{n:"SYNC"},6:{n:"RANGE",f:o},7:{n:"WINDOW1"},8:{n:"COLW1"},9:{n:"WINTWO"},10:{n:"COLW2"},11:{n:"NAME"},12:{n:"BLANK"},13:{n:"INTEGER",f:h},14:{n:"NUMBER",f:b},15:{n:"LABEL",f},16:{n:"FORMULA",f:y},24:{n:"TABLE"},25:{n:"ORANGE"},26:{n:"PRANGE"},27:{n:"SRANGE"},28:{n:"FRANGE"},29:{n:"KRANGE1"},32:{n:"HRANGE"},35:{n:"KRANGE2"},36:{n:"PROTEC"},37:{n:"FOOTER"},38:{n:"HEADER"},39:{n:"SETUP"},40:{n:"MARGINS"},41:{n:"LABELFMT"},42:{n:"TITLES"},43:{n:"SHEETJS"},45:{n:"GRAPH"},46:{n:"NGRAPH"},47:{n:"CALCCOUNT"},48:{n:"UNFORMATTED"},49:{n:"CURSORW12"},50:{n:"WINDOW"},51:{n:"STRING",f},55:{n:"PASSWORD"},56:{n:"LOCKED"},60:{n:"QUERY"},61:{n:"QUERYNAME"},62:{n:"PRINT"},63:{n:"PRINTNAME"},64:{n:"GRAPH2"},65:{n:"GRAPHNAME"},66:{n:"ZOOM"},67:{n:"SYMSPLIT"},68:{n:"NSROWS"},69:{n:"NSCOLS"},70:{n:"RULER"},71:{n:"NNAME"},72:{n:"ACOMM"},73:{n:"AMACRO"},74:{n:"PARSE"},102:{n:"PRANGES??"},103:{n:"RRANGES??"},104:{n:"FNAME??"},105:{n:"MRANGES??"},204:{n:"SHEETNAMECS",f:H},222:{n:"SHEETNAMELP",f:X},65535:{n:""}},M={0:{n:"BOF"},1:{n:"EOF"},2:{n:"PASSWORD"},3:{n:"CALCSET"},4:{n:"WINDOWSET"},5:{n:"SHEETCELLPTR"},6:{n:"SHEETLAYOUT"},7:{n:"COLUMNWIDTH"},8:{n:"HIDDENCOLUMN"},9:{n:"USERRANGE"},10:{n:"SYSTEMRANGE"},11:{n:"ZEROFORCE"},12:{n:"SORTKEYDIR"},13:{n:"FILESEAL"},14:{n:"DATAFILLNUMS"},15:{n:"PRINTMAIN"},16:{n:"PRINTSTRING"},17:{n:"GRAPHMAIN"},18:{n:"GRAPHSTRING"},19:{n:"??"},20:{n:"ERRCELL"},21:{n:"NACELL"},22:{n:"LABEL16",f:B},23:{n:"NUMBER17",f:U},24:{n:"NUMBER18",f:R},25:{n:"FORMULA19",f:L},26:{n:"FORMULA1A"},27:{n:"XFORMAT",f:ee},28:{n:"DTLABELMISC"},29:{n:"DTLABELCELL"},30:{n:"GRAPHWINDOW"},31:{n:"CPA"},32:{n:"LPLAUTO"},33:{n:"QUERY"},34:{n:"HIDDENSHEET"},35:{n:"??"},37:{n:"NUMBER25",f:P},38:{n:"??"},39:{n:"NUMBER27",f:G},40:{n:"FORMULA28",f:Q},142:{n:"??"},147:{n:"??"},150:{n:"??"},151:{n:"??"},152:{n:"??"},153:{n:"??"},154:{n:"??"},155:{n:"??"},156:{n:"??"},163:{n:"??"},174:{n:"??"},175:{n:"??"},176:{n:"??"},177:{n:"??"},184:{n:"??"},185:{n:"??"},186:{n:"??"},187:{n:"??"},188:{n:"??"},195:{n:"??"},201:{n:"??"},204:{n:"SHEETNAMECS",f:H},205:{n:"??"},206:{n:"??"},207:{n:"??"},208:{n:"??"},256:{n:"??"},259:{n:"??"},260:{n:"??"},261:{n:"??"},262:{n:"??"},263:{n:"??"},265:{n:"??"},266:{n:"??"},267:{n:"??"},268:{n:"??"},270:{n:"??"},271:{n:"??"},384:{n:"??"},389:{n:"??"},390:{n:"??"},393:{n:"??"},396:{n:"??"},512:{n:"??"},514:{n:"??"},513:{n:"??"},516:{n:"??"},517:{n:"??"},640:{n:"??"},641:{n:"??"},642:{n:"??"},643:{n:"??"},644:{n:"??"},645:{n:"??"},646:{n:"??"},647:{n:"??"},648:{n:"??"},658:{n:"??"},659:{n:"??"},660:{n:"??"},661:{n:"??"},662:{n:"??"},665:{n:"??"},666:{n:"??"},768:{n:"??"},772:{n:"??"},1537:{n:"SHEETINFOQP",f:K},1600:{n:"??"},1602:{n:"??"},1793:{n:"??"},1794:{n:"??"},1795:{n:"??"},1796:{n:"??"},1920:{n:"??"},2048:{n:"??"},2049:{n:"??"},2052:{n:"??"},2688:{n:"??"},10998:{n:"??"},12849:{n:"??"},28233:{n:"??"},28484:{n:"??"},65535:{n:""}};return{sheet_to_wk1:a,book_to_wk3:s,to_workbook:t}})();function w1e(e){var t={},r=e.match(zn),a=0,s=!1;if(r)for(;a!=r.length;++a){var i=Nt(r[a]);switch(i[0].replace(/\w*:/g,"")){case"<condense":break;case"<extend":break;case"<shadow":if(!i.val)break;case"<shadow>":case"<shadow/>":t.shadow=1;break;case"</shadow>":break;case"<charset":if(i.val=="1")break;t.cp=rE[parseInt(i.val,10)];break;case"<outline":if(!i.val)break;case"<outline>":case"<outline/>":t.outline=1;break;case"</outline>":break;case"<rFont":t.name=i.val;break;case"<sz":t.sz=i.val;break;case"<strike":if(!i.val)break;case"<strike>":case"<strike/>":t.strike=1;break;case"</strike>":break;case"<u":if(!i.val)break;switch(i.val){case"double":t.uval="double";break;case"singleAccounting":t.uval="single-accounting";break;case"doubleAccounting":t.uval="double-accounting";break}case"<u>":case"<u/>":t.u=1;break;case"</u>":break;case"<b":if(i.val=="0")break;case"<b>":case"<b/>":t.b=1;break;case"</b>":break;case"<i":if(i.val=="0")break;case"<i>":case"<i/>":t.i=1;break;case"</i>":break;case"<color":i.rgb&&(t.color=i.rgb.slice(2,8));break;case"<color>":case"<color/>":case"</color>":break;case"<family":t.family=i.val;break;case"<family>":case"<family/>":case"</family>":break;case"<vertAlign":t.valign=i.val;break;case"<vertAlign>":case"<vertAlign/>":case"</vertAlign>":break;case"<scheme":break;case"<scheme>":case"<scheme/>":case"</scheme>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(i[0].charCodeAt(1)!==47&&!s)throw new Error("Unrecognized rich format "+i[0])}}return t}var N1e=(function(){var e=gp("t"),t=gp("rPr");function r(i){var l=i.match(e);if(!l)return{t:"s",v:""};var o={t:"s",v:Wt(l[1])},d=i.match(t);return d&&(o.s=w1e(d[1])),o}var a=/<(?:\w+:)?r>/g,s=/<\/(?:\w+:)?r>/;return function(l){return l.replace(a,"").split(s).map(r).filter(function(o){return o.v})}})(),C1e=(function(){var t=/(\r\n|\n)/g;function r(s,i,l){var o=[];s.u&&o.push("text-decoration: underline;"),s.uval&&o.push("text-underline-style:"+s.uval+";"),s.sz&&o.push("font-size:"+s.sz+"pt;"),s.outline&&o.push("text-effect: outline;"),s.shadow&&o.push("text-shadow: auto;"),i.push('<span style="'+o.join("")+'">'),s.b&&(i.push("<b>"),l.push("</b>")),s.i&&(i.push("<i>"),l.push("</i>")),s.strike&&(i.push("<s>"),l.push("</s>"));var d=s.valign||"";return d=="superscript"||d=="super"?d="sup":d=="subscript"&&(d="sub"),d!=""&&(i.push("<"+d+">"),l.push("</"+d+">")),l.push("</span>"),s}function a(s){var i=[[],s.v,[]];return s.v?(s.s&&r(s.s,i[0],i[2]),i[0].join("")+i[1].replace(t,"<br/>")+i[2].join("")):""}return function(i){return i.map(a).join("")}})(),k1e=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,j1e=/<(?:\w+:)?r>/,E1e=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function jE(e,t){var r=t?t.cellHTML:!0,a={};return e?(e.match(/^\s*<(?:\w+:)?t[^>]*>/)?(a.t=Wt(gr(e.slice(e.indexOf(">")+1).split(/<\/(?:\w+:)?t>/)[0]||"")),a.r=gr(e),r&&(a.h=AE(a.t))):e.match(j1e)&&(a.r=gr(e),a.t=Wt(gr((e.replace(E1e,"").match(k1e)||[]).join("").replace(zn,""))),r&&(a.h=C1e(N1e(a.r)))),a):{t:""}}var S1e=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/,B1e=/<(?:\w+:)?(?:si|sstItem)>/g,_1e=/<\/(?:\w+:)?(?:si|sstItem)>/;function T1e(e,t){var r=[],a="";if(!e)return r;var s=e.match(S1e);if(s){a=s[2].replace(B1e,"").split(_1e);for(var i=0;i!=a.length;++i){var l=jE(a[i].trim(),t);l!=null&&(r[r.length]=l)}s=Nt(s[1]),r.Count=s.count,r.Unique=s.uniqueCount}return r}var I1e=/^\s|\s$|[\t\n\r]/;function M9(e,t){if(!t.bookSST)return"";var r=[wa];r[r.length]=We("sst",null,{xmlns:su[0],count:e.Count,uniqueCount:e.Unique});for(var a=0;a!=e.length;++a)if(e[a]!=null){var s=e[a],i="<si>";s.r?i+=s.r:(i+="<t",s.t||(s.t=""),s.t.match(I1e)&&(i+=' xml:space="preserve"'),i+=">"+ur(s.t)+"</t>"),i+="</si>",r[r.length]=i}return r.length>2&&(r[r.length]="</sst>",r[1]=r[1].replace("/>",">")),r.join("")}function F1e(e){return[e.read_shift(4),e.read_shift(4)]}function D1e(e,t){var r=[],a=!1;return Oo(e,function(i,l,o){switch(o){case 159:r.Count=i[0],r.Unique=i[1];break;case 19:r.push(i);break;case 160:return!0;case 35:a=!0;break;case 36:a=!1;break;default:if(l.T,!a||t.WTF)throw new Error("Unexpected record 0x"+o.toString(16))}}),r}function U1e(e,t){return t||(t=Oe(8)),t.write_shift(4,e.Count),t.write_shift(4,e.Unique),t}var M1e=Gge;function R1e(e){var t=ms();He(t,159,U1e(e));for(var r=0;r<e.length;++r)He(t,19,M1e(e[r]));return He(t,160),t.end()}function R9(e){for(var t=[],r=e.split(""),a=0;a<r.length;++a)t[a]=r[a].charCodeAt(0);return t}function fo(e,t){var r={};return r.Major=e.read_shift(2),r.Minor=e.read_shift(2),t>=4&&(e.l+=t-4),r}function O1e(e){var t={};return t.id=e.read_shift(0,"lpp4"),t.R=fo(e,4),t.U=fo(e,4),t.W=fo(e,4),t}function P1e(e){for(var t=e.read_shift(4),r=e.l+t-4,a={},s=e.read_shift(4),i=[];s-- >0;)i.push({t:e.read_shift(4),v:e.read_shift(0,"lpp4")});if(a.name=e.read_shift(0,"lpp4"),a.comps=i,e.l!=r)throw new Error("Bad DataSpaceMapEntry: "+e.l+" != "+r);return a}function L1e(e){var t=[];e.l+=4;for(var r=e.read_shift(4);r-- >0;)t.push(P1e(e));return t}function Q1e(e){var t=[];e.l+=4;for(var r=e.read_shift(4);r-- >0;)t.push(e.read_shift(0,"lpp4"));return t}function H1e(e){var t={};return e.read_shift(4),e.l+=4,t.id=e.read_shift(0,"lpp4"),t.name=e.read_shift(0,"lpp4"),t.R=fo(e,4),t.U=fo(e,4),t.W=fo(e,4),t}function z1e(e){var t=H1e(e);if(t.ename=e.read_shift(0,"8lpp4"),t.blksz=e.read_shift(4),t.cmode=e.read_shift(4),e.read_shift(4)!=4)throw new Error("Bad !Primary record");return t}function O9(e,t){var r=e.l+t,a={};a.Flags=e.read_shift(4)&63,e.l+=4,a.AlgID=e.read_shift(4);var s=!1;switch(a.AlgID){case 26126:case 26127:case 26128:s=a.Flags==36;break;case 26625:s=a.Flags==4;break;case 0:s=a.Flags==16||a.Flags==4||a.Flags==36;break;default:throw"Unrecognized encryption algorithm: "+a.AlgID}if(!s)throw new Error("Encryption Flags/AlgID mismatch");return a.AlgIDHash=e.read_shift(4),a.KeySize=e.read_shift(4),a.ProviderType=e.read_shift(4),e.l+=8,a.CSPName=e.read_shift(r-e.l>>1,"utf16le"),e.l=r,a}function P9(e,t){var r={},a=e.l+t;return e.l+=4,r.Salt=e.slice(e.l,e.l+16),e.l+=16,r.Verifier=e.slice(e.l,e.l+16),e.l+=16,e.read_shift(4),r.VerifierHash=e.slice(e.l,a),e.l=a,r}function $1e(e){var t=fo(e);switch(t.Minor){case 2:return[t.Minor,V1e(e)];case 3:return[t.Minor,G1e()];case 4:return[t.Minor,K1e(e)]}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+t.Minor)}function V1e(e){var t=e.read_shift(4);if((t&63)!=36)throw new Error("EncryptionInfo mismatch");var r=e.read_shift(4),a=O9(e,r),s=P9(e,e.length-e.l);return{t:"Std",h:a,v:s}}function G1e(){throw new Error("File is password-protected: ECMA-376 Extensible")}function K1e(e){var t=["saltSize","blockSize","keyBits","hashSize","cipherAlgorithm","cipherChaining","hashAlgorithm","saltValue"];e.l+=4;var r=e.read_shift(e.length-e.l,"utf8"),a={};return r.replace(zn,function(i){var l=Nt(i);switch(Tl(l[0])){case"<?xml":break;case"<encryption":case"</encryption>":break;case"<keyData":t.forEach(function(o){a[o]=l[o]});break;case"<dataIntegrity":a.encryptedHmacKey=l.encryptedHmacKey,a.encryptedHmacValue=l.encryptedHmacValue;break;case"<keyEncryptors>":case"<keyEncryptors":a.encs=[];break;case"</keyEncryptors>":break;case"<keyEncryptor":a.uri=l.uri;break;case"</keyEncryptor>":break;case"<encryptedKey":a.encs.push(l);break;default:throw l[0]}}),a}function q1e(e,t){var r={},a=r.EncryptionVersionInfo=fo(e,4);if(t-=4,a.Minor!=2)throw new Error("unrecognized minor version code: "+a.Minor);if(a.Major>4||a.Major<2)throw new Error("unrecognized major version code: "+a.Major);r.Flags=e.read_shift(4),t-=4;var s=e.read_shift(4);return t-=4,r.EncryptionHeader=O9(e,s),t-=s,r.EncryptionVerifier=P9(e,t),r}function W1e(e){var t={},r=t.EncryptionVersionInfo=fo(e,4);if(r.Major!=1||r.Minor!=1)throw"unrecognized version code "+r.Major+" : "+r.Minor;return t.Salt=e.read_shift(16),t.EncryptedVerifier=e.read_shift(16),t.EncryptedVerifierHash=e.read_shift(16),t}function EE(e){var t=0,r,a=R9(e),s=a.length+1,i,l,o,d,u;for(r=Dc(s),r[0]=a.length,i=1;i!=s;++i)r[i]=a[i-1];for(i=s-1;i>=0;--i)l=r[i],o=(t&16384)===0?0:1,d=t<<1&32767,u=o|d,t=u^l;return t^52811}var L9=(function(){var e=[187,255,255,186,255,255,185,128,0,190,15,0,191,15,0],t=[57840,7439,52380,33984,4364,3600,61902,12606,6258,57657,54287,34041,10252,43370,20163],r=[44796,19929,39858,10053,20106,40212,10761,31585,63170,64933,60267,50935,40399,11199,17763,35526,1453,2906,5812,11624,23248,885,1770,3540,7080,14160,28320,56640,55369,41139,20807,41614,21821,43642,17621,28485,56970,44341,19019,38038,14605,29210,60195,50791,40175,10751,21502,43004,24537,18387,36774,3949,7898,15796,31592,63184,47201,24803,49606,37805,14203,28406,56812,17824,35648,1697,3394,6788,13576,27152,43601,17539,35078,557,1114,2228,4456,30388,60776,51953,34243,7079,14158,28316,14128,28256,56512,43425,17251,34502,7597,13105,26210,52420,35241,883,1766,3532,4129,8258,16516,33032,4657,9314,18628],a=function(l){return(l/2|l*128)&255},s=function(l,o){return a(l^o)},i=function(l){for(var o=t[l.length-1],d=104,u=l.length-1;u>=0;--u)for(var f=l[u],p=0;p!=7;++p)f&64&&(o^=r[d]),f*=2,--d;return o};return function(l){for(var o=R9(l),d=i(o),u=o.length,f=Dc(16),p=0;p!=16;++p)f[p]=0;var h,m,b;for((u&1)===1&&(h=d>>8,f[u]=s(e[0],h),--u,h=d&255,m=o[o.length-1],f[u]=s(m,h));u>0;)--u,h=d>>8,f[u]=s(o[u],h),--u,h=d&255,f[u]=s(o[u],h);for(u=15,b=15-o.length;b>0;)h=d>>8,f[u]=s(e[b],h),--u,--b,h=d&255,f[u]=s(o[u],h),--u,--b;return f}})(),Y1e=function(e,t,r,a,s){s||(s=t),a||(a=L9(e));var i,l;for(i=0;i!=t.length;++i)l=t[i],l^=a[r],l=(l>>5|l<<3)&255,s[i]=l,++r;return[s,r,a]},X1e=function(e){var t=0,r=L9(e);return function(a){var s=Y1e("",a,t,r);return t=s[1],s[0]}};function J1e(e,t,r,a){var s={key:_a(e),verificationBytes:_a(e)};return r.password&&(s.verifier=EE(r.password)),a.valid=s.verificationBytes===s.verifier,a.valid&&(a.insitu=X1e(r.password)),s}function Z1e(e,t,r){var a=r||{};return a.Info=e.read_shift(2),e.l-=2,a.Info===1?a.Data=W1e(e):a.Data=q1e(e,t),a}function eye(e,t,r){var a={Type:r.biff>=8?e.read_shift(2):0};return a.Type?Z1e(e,t-2,a):J1e(e,r.biff>=8?t:t-2,r,a),a}var Q9=(function(){function e(s,i){switch(i.type){case"base64":return t(Vs(s),i);case"binary":return t(s,i);case"buffer":return t(Mt&&Buffer.isBuffer(s)?s.toString("binary"):Gc(s),i);case"array":return t(Kd(s),i)}throw new Error("Unrecognized type "+i.type)}function t(s,i){var l=i||{},o=l.dense?[]:{},d=s.match(/\\trowd.*?\\row\b/g);if(!d.length)throw new Error("RTF missing table");var u={s:{c:0,r:0},e:{c:0,r:d.length-1}};return d.forEach(function(f,p){Array.isArray(o)&&(o[p]=[]);for(var h=/\\\w+\b/g,m=0,b,v=-1;b=h.exec(f);){switch(b[0]){case"\\cell":var y=f.slice(m,h.lastIndex-b[0].length);if(y[0]==" "&&(y=y.slice(1)),++v,y.length){var j={v:y,t:"s"};Array.isArray(o)?o[p][v]=j:o[yt({r:p,c:v})]=j}break}m=h.lastIndex}v>u.e.c&&(u.e.c=v)}),o["!ref"]=Tt(u),o}function r(s,i){return Kc(e(s,i),i)}function a(s){for(var i=["{\\rtf1\\ansi"],l=Yt(s["!ref"]),o,d=Array.isArray(s),u=l.s.r;u<=l.e.r;++u){i.push("\\trowd\\trautofit1");for(var f=l.s.c;f<=l.e.c;++f)i.push("\\cellx"+(f+1));for(i.push("\\pard\\intbl"),f=l.s.c;f<=l.e.c;++f){var p=yt({r:u,c:f});o=d?(s[u]||[])[f]:s[p],!(!o||o.v==null&&(!o.f||o.F))&&(i.push(" "+(o.w||(Co(o),o.w))),i.push("\\cell"))}i.push("\\pard\\intbl\\row")}return i.join("")+"}"}return{to_workbook:r,to_sheet:e,from_sheet:a}})();function tye(e){var t=e.slice(e[0]==="#"?1:0).slice(0,6);return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16)]}function wp(e){for(var t=0,r=1;t!=3;++t)r=r*256+(e[t]>255?255:e[t]<0?0:e[t]);return r.toString(16).toUpperCase().slice(1)}function rye(e){var t=e[0]/255,r=e[1]/255,a=e[2]/255,s=Math.max(t,r,a),i=Math.min(t,r,a),l=s-i;if(l===0)return[0,0,t];var o=0,d=0,u=s+i;switch(d=l/(u>1?2-u:u),s){case t:o=((r-a)/l+6)%6;break;case r:o=(a-t)/l+2;break;case a:o=(t-r)/l+4;break}return[o/6,d,u/2]}function aye(e){var t=e[0],r=e[1],a=e[2],s=r*2*(a<.5?a:1-a),i=a-s/2,l=[i,i,i],o=6*t,d;if(r!==0)switch(o|0){case 0:case 6:d=s*o,l[0]+=s,l[1]+=d;break;case 1:d=s*(2-o),l[0]+=d,l[1]+=s;break;case 2:d=s*(o-2),l[1]+=s,l[2]+=d;break;case 3:d=s*(4-o),l[1]+=d,l[2]+=s;break;case 4:d=s*(o-4),l[2]+=s,l[0]+=d;break;case 5:d=s*(6-o),l[2]+=d,l[0]+=s;break}for(var u=0;u!=3;++u)l[u]=Math.round(l[u]*255);return l}function Xg(e,t){if(t===0)return e;var r=rye(tye(e));return t<0?r[2]=r[2]*(1+t):r[2]=1-(1-r[2])*(1-t),wp(aye(r))}var H9=6,nye=15,sye=1,Rn=H9;function Np(e){return Math.floor((e+Math.round(128/Rn)/256)*Rn)}function Cp(e){return Math.floor((e-5)/Rn*100+.5)/100}function Jg(e){return Math.round((e*Rn+5)/Rn*256)/256}function T2(e){return Jg(Cp(Np(e)))}function SE(e){var t=Math.abs(e-T2(e)),r=Rn;if(t>.005)for(Rn=sye;Rn<nye;++Rn)Math.abs(e-T2(e))<=t&&(t=Math.abs(e-T2(e)),r=Rn);Rn=r}function Uc(e){e.width?(e.wpx=Np(e.width),e.wch=Cp(e.wpx),e.MDW=Rn):e.wpx?(e.wch=Cp(e.wpx),e.width=Jg(e.wch),e.MDW=Rn):typeof e.wch=="number"&&(e.width=Jg(e.wch),e.wpx=Np(e.width),e.MDW=Rn),e.customWidth&&delete e.customWidth}var iye=96,z9=iye;function kp(e){return e*96/z9}function MA(e){return e*z9/96}var lye={None:"none",Solid:"solid",Gray50:"mediumGray",Gray75:"darkGray",Gray25:"lightGray",HorzStripe:"darkHorizontal",VertStripe:"darkVertical",ReverseDiagStripe:"darkDown",DiagStripe:"darkUp",DiagCross:"darkGrid",ThickDiagCross:"darkTrellis",ThinHorzStripe:"lightHorizontal",ThinVertStripe:"lightVertical",ThinReverseDiagStripe:"lightDown",ThinHorzCross:"lightGrid"};function oye(e,t,r,a){t.Borders=[];var s={},i=!1;(e[0].match(zn)||[]).forEach(function(l){var o=Nt(l);switch(Tl(o[0])){case"<borders":case"<borders>":case"</borders>":break;case"<border":case"<border>":case"<border/>":s={},o.diagonalUp&&(s.diagonalUp=Mr(o.diagonalUp)),o.diagonalDown&&(s.diagonalDown=Mr(o.diagonalDown)),t.Borders.push(s);break;case"</border>":break;case"<left/>":break;case"<left":case"<left>":break;case"</left>":break;case"<right/>":break;case"<right":case"<right>":break;case"</right>":break;case"<top/>":break;case"<top":case"<top>":break;case"</top>":break;case"<bottom/>":break;case"<bottom":case"<bottom>":break;case"</bottom>":break;case"<diagonal":case"<diagonal>":case"<diagonal/>":break;case"</diagonal>":break;case"<horizontal":case"<horizontal>":case"<horizontal/>":break;case"</horizontal>":break;case"<vertical":case"<vertical>":case"<vertical/>":break;case"</vertical>":break;case"<start":case"<start>":case"<start/>":break;case"</start>":break;case"<end":case"<end>":case"<end/>":break;case"</end>":break;case"<color":case"<color>":break;case"<color/>":case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(a&&a.WTF&&!i)throw new Error("unrecognized "+o[0]+" in borders")}})}function cye(e,t,r,a){t.Fills=[];var s={},i=!1;(e[0].match(zn)||[]).forEach(function(l){var o=Nt(l);switch(Tl(o[0])){case"<fills":case"<fills>":case"</fills>":break;case"<fill>":case"<fill":case"<fill/>":s={},t.Fills.push(s);break;case"</fill>":break;case"<gradientFill>":break;case"<gradientFill":case"</gradientFill>":t.Fills.push(s),s={};break;case"<patternFill":case"<patternFill>":o.patternType&&(s.patternType=o.patternType);break;case"<patternFill/>":case"</patternFill>":break;case"<bgColor":s.bgColor||(s.bgColor={}),o.indexed&&(s.bgColor.indexed=parseInt(o.indexed,10)),o.theme&&(s.bgColor.theme=parseInt(o.theme,10)),o.tint&&(s.bgColor.tint=parseFloat(o.tint)),o.rgb&&(s.bgColor.rgb=o.rgb.slice(-6));break;case"<bgColor/>":case"</bgColor>":break;case"<fgColor":s.fgColor||(s.fgColor={}),o.theme&&(s.fgColor.theme=parseInt(o.theme,10)),o.tint&&(s.fgColor.tint=parseFloat(o.tint)),o.rgb!=null&&(s.fgColor.rgb=o.rgb.slice(-6));break;case"<fgColor/>":case"</fgColor>":break;case"<stop":case"<stop/>":break;case"</stop>":break;case"<color":case"<color/>":break;case"</color>":break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(a&&a.WTF&&!i)throw new Error("unrecognized "+o[0]+" in fills")}})}function dye(e,t,r,a){t.Fonts=[];var s={},i=!1;(e[0].match(zn)||[]).forEach(function(l){var o=Nt(l);switch(Tl(o[0])){case"<fonts":case"<fonts>":case"</fonts>":break;case"<font":case"<font>":break;case"</font>":case"<font/>":t.Fonts.push(s),s={};break;case"<name":o.val&&(s.name=gr(o.val));break;case"<name/>":case"</name>":break;case"<b":s.bold=o.val?Mr(o.val):1;break;case"<b/>":s.bold=1;break;case"<i":s.italic=o.val?Mr(o.val):1;break;case"<i/>":s.italic=1;break;case"<u":switch(o.val){case"none":s.underline=0;break;case"single":s.underline=1;break;case"double":s.underline=2;break;case"singleAccounting":s.underline=33;break;case"doubleAccounting":s.underline=34;break}break;case"<u/>":s.underline=1;break;case"<strike":s.strike=o.val?Mr(o.val):1;break;case"<strike/>":s.strike=1;break;case"<outline":s.outline=o.val?Mr(o.val):1;break;case"<outline/>":s.outline=1;break;case"<shadow":s.shadow=o.val?Mr(o.val):1;break;case"<shadow/>":s.shadow=1;break;case"<condense":s.condense=o.val?Mr(o.val):1;break;case"<condense/>":s.condense=1;break;case"<extend":s.extend=o.val?Mr(o.val):1;break;case"<extend/>":s.extend=1;break;case"<sz":o.val&&(s.sz=+o.val);break;case"<sz/>":case"</sz>":break;case"<vertAlign":o.val&&(s.vertAlign=o.val);break;case"<vertAlign/>":case"</vertAlign>":break;case"<family":o.val&&(s.family=parseInt(o.val,10));break;case"<family/>":case"</family>":break;case"<scheme":o.val&&(s.scheme=o.val);break;case"<scheme/>":case"</scheme>":break;case"<charset":if(o.val=="1")break;o.codepage=rE[parseInt(o.val,10)];break;case"<color":if(s.color||(s.color={}),o.auto&&(s.color.auto=Mr(o.auto)),o.rgb)s.color.rgb=o.rgb.slice(-6);else if(o.indexed){s.color.index=parseInt(o.indexed,10);var d=Td[s.color.index];s.color.index==81&&(d=Td[1]),d||(d=Td[1]),s.color.rgb=d[0].toString(16)+d[1].toString(16)+d[2].toString(16)}else o.theme&&(s.color.theme=parseInt(o.theme,10),o.tint&&(s.color.tint=parseFloat(o.tint)),o.theme&&r.themeElements&&r.themeElements.clrScheme&&(s.color.rgb=Xg(r.themeElements.clrScheme[s.color.theme].rgb,s.color.tint||0)));break;case"<color/>":case"</color>":break;case"<AlternateContent":i=!0;break;case"</AlternateContent>":i=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":i=!0;break;case"</ext>":i=!1;break;default:if(a&&a.WTF&&!i)throw new Error("unrecognized "+o[0]+" in fonts")}})}function uye(e,t,r){t.NumberFmt=[];for(var a=fa(vt),s=0;s<a.length;++s)t.NumberFmt[a[s]]=vt[a[s]];var i=e[0].match(zn);if(i)for(s=0;s<i.length;++s){var l=Nt(i[s]);switch(Tl(l[0])){case"<numFmts":case"</numFmts>":case"<numFmts/>":case"<numFmts>":break;case"<numFmt":{var o=Wt(gr(l.formatCode)),d=parseInt(l.numFmtId,10);if(t.NumberFmt[d]=o,d>0){if(d>392){for(d=392;d>60&&t.NumberFmt[d]!=null;--d);t.NumberFmt[d]=o}Ao(o,d)}}break;case"</numFmt>":break;default:if(r.WTF)throw new Error("unrecognized "+l[0]+" in numFmts")}}}function Aye(e){var t=["<numFmts>"];return[[5,8],[23,26],[41,44],[50,392]].forEach(function(r){for(var a=r[0];a<=r[1];++a)e[a]!=null&&(t[t.length]=We("numFmt",null,{numFmtId:a,formatCode:ur(e[a])}))}),t.length===1?"":(t[t.length]="</numFmts>",t[0]=We("numFmts",null,{count:t.length-2}).replace("/>",">"),t.join(""))}var qh=["numFmtId","fillId","fontId","borderId","xfId"],Wh=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];function fye(e,t,r){t.CellXf=[];var a,s=!1;(e[0].match(zn)||[]).forEach(function(i){var l=Nt(i),o=0;switch(Tl(l[0])){case"<cellXfs":case"<cellXfs>":case"<cellXfs/>":case"</cellXfs>":break;case"<xf":case"<xf/>":for(a=l,delete a[0],o=0;o<qh.length;++o)a[qh[o]]&&(a[qh[o]]=parseInt(a[qh[o]],10));for(o=0;o<Wh.length;++o)a[Wh[o]]&&(a[Wh[o]]=Mr(a[Wh[o]]));if(t.NumberFmt&&a.numFmtId>392){for(o=392;o>60;--o)if(t.NumberFmt[a.numFmtId]==t.NumberFmt[o]){a.numFmtId=o;break}}t.CellXf.push(a);break;case"</xf>":break;case"<alignment":case"<alignment/>":var d={};l.vertical&&(d.vertical=l.vertical),l.horizontal&&(d.horizontal=l.horizontal),l.textRotation!=null&&(d.textRotation=l.textRotation),l.indent&&(d.indent=l.indent),l.wrapText&&(d.wrapText=Mr(l.wrapText)),a.alignment=d;break;case"</alignment>":break;case"<protection":break;case"</protection>":case"<protection/>":break;case"<AlternateContent":s=!0;break;case"</AlternateContent>":s=!1;break;case"<extLst":case"<extLst>":case"</extLst>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;default:if(r&&r.WTF&&!s)throw new Error("unrecognized "+l[0]+" in cellXfs")}})}function pye(e){var t=[];return t[t.length]=We("cellXfs",null),e.forEach(function(r){t[t.length]=We("xf",null,r)}),t[t.length]="</cellXfs>",t.length===2?"":(t[0]=We("cellXfs",null,{count:t.length-2}).replace("/>",">"),t.join(""))}var xye=(function(){var t=/<(?:\w+:)?numFmts([^>]*)>[\S\s]*?<\/(?:\w+:)?numFmts>/,r=/<(?:\w+:)?cellXfs([^>]*)>[\S\s]*?<\/(?:\w+:)?cellXfs>/,a=/<(?:\w+:)?fills([^>]*)>[\S\s]*?<\/(?:\w+:)?fills>/,s=/<(?:\w+:)?fonts([^>]*)>[\S\s]*?<\/(?:\w+:)?fonts>/,i=/<(?:\w+:)?borders([^>]*)>[\S\s]*?<\/(?:\w+:)?borders>/;return function(o,d,u){var f={};if(!o)return f;o=o.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");var p;return(p=o.match(t))&&uye(p,f,u),(p=o.match(s))&&dye(p,f,d,u),(p=o.match(a))&&cye(p,f,d,u),(p=o.match(i))&&oye(p,f,d,u),(p=o.match(r))&&fye(p,f,u),f}})();function $9(e,t){var r=[wa,We("styleSheet",null,{xmlns:su[0],"xmlns:vt":Qa.vt})],a;return e.SSF&&(a=Aye(e.SSF))!=null&&(r[r.length]=a),r[r.length]='<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>',r[r.length]='<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>',r[r.length]='<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>',r[r.length]='<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>',(a=pye(t.cellXfs))&&(r[r.length]=a),r[r.length]='<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>',r[r.length]='<dxfs count="0"/>',r[r.length]='<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>',r.length>2&&(r[r.length]="</styleSheet>",r[1]=r[1].replace("/>",">")),r.join("")}function hye(e,t){var r=e.read_shift(2),a=Pn(e);return[r,a]}function mye(e,t,r){r||(r=Oe(6+4*t.length)),r.write_shift(2,e),rn(t,r);var a=r.length>r.l?r.slice(0,r.l):r;return r.l==null&&(r.l=r.length),a}function gye(e,t,r){var a={};a.sz=e.read_shift(2)/20;var s=Zge(e);s.fItalic&&(a.italic=1),s.fCondense&&(a.condense=1),s.fExtend&&(a.extend=1),s.fShadow&&(a.shadow=1),s.fOutline&&(a.outline=1),s.fStrikeout&&(a.strike=1);var i=e.read_shift(2);switch(i===700&&(a.bold=1),e.read_shift(2)){case 1:a.vertAlign="superscript";break;case 2:a.vertAlign="subscript";break}var l=e.read_shift(1);l!=0&&(a.underline=l);var o=e.read_shift(1);o>0&&(a.family=o);var d=e.read_shift(1);switch(d>0&&(a.charset=d),e.l++,a.color=Jge(e),e.read_shift(1)){case 1:a.scheme="major";break;case 2:a.scheme="minor";break}return a.name=Pn(e),a}function bye(e,t){t||(t=Oe(153)),t.write_shift(2,e.sz*20),ebe(e,t),t.write_shift(2,e.bold?700:400);var r=0;e.vertAlign=="superscript"?r=1:e.vertAlign=="subscript"&&(r=2),t.write_shift(2,r),t.write_shift(1,e.underline||0),t.write_shift(1,e.family||0),t.write_shift(1,e.charset||0),t.write_shift(1,0),qg(e.color,t);var a=0;return a=2,t.write_shift(1,a),rn(e.name,t),t.length>t.l?t.slice(0,t.l):t}var vye=["none","solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"],I2,yye=Hn;function eU(e,t){t||(t=Oe(84)),I2||(I2=dv(vye));var r=I2[e.patternType];r==null&&(r=40),t.write_shift(4,r);var a=0;if(r!=40)for(qg({auto:1},t),qg({auto:1},t);a<12;++a)t.write_shift(4,0);else{for(;a<4;++a)t.write_shift(4,0);for(;a<12;++a)t.write_shift(4,0)}return t.length>t.l?t.slice(0,t.l):t}function wye(e,t){var r=e.l+t,a=e.read_shift(2),s=e.read_shift(2);return e.l=r,{ixfe:a,numFmtId:s}}function V9(e,t,r){r||(r=Oe(16)),r.write_shift(2,t||0),r.write_shift(2,e.numFmtId||0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(1,0),r.write_shift(1,0);var a=0;return r.write_shift(1,a),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(1,0),r}function df(e,t){return t||(t=Oe(10)),t.write_shift(1,0),t.write_shift(1,0),t.write_shift(4,0),t.write_shift(4,0),t}var Nye=Hn;function Cye(e,t){return t||(t=Oe(51)),t.write_shift(1,0),df(null,t),df(null,t),df(null,t),df(null,t),df(null,t),t.length>t.l?t.slice(0,t.l):t}function kye(e,t){return t||(t=Oe(52)),t.write_shift(4,e.xfId),t.write_shift(2,1),t.write_shift(1,0),t.write_shift(1,0),Kg(e.name||"",t),t.length>t.l?t.slice(0,t.l):t}function jye(e,t,r){var a=Oe(2052);return a.write_shift(4,e),Kg(t,a),Kg(r,a),a.length>a.l?a.slice(0,a.l):a}function Eye(e,t,r){var a={};a.NumberFmt=[];for(var s in vt)a.NumberFmt[s]=vt[s];a.CellXf=[],a.Fonts=[];var i=[],l=!1;return Oo(e,function(d,u,f){switch(f){case 44:a.NumberFmt[d[0]]=d[1],Ao(d[1],d[0]);break;case 43:a.Fonts.push(d),d.color.theme!=null&&t&&t.themeElements&&t.themeElements.clrScheme&&(d.color.rgb=Xg(t.themeElements.clrScheme[d.color.theme].rgb,d.color.tint||0));break;case 1025:break;case 45:break;case 46:break;case 47:i[i.length-1]==617&&a.CellXf.push(d);break;case 48:case 507:case 572:case 475:break;case 1171:case 2102:case 1130:case 512:case 2095:case 3072:break;case 35:l=!0;break;case 36:l=!1;break;case 37:i.push(f),l=!0;break;case 38:i.pop(),l=!1;break;default:if(u.T>0)i.push(f);else if(u.T<0)i.pop();else if(!l||r.WTF&&i[i.length-1]!=37)throw new Error("Unexpected record 0x"+f.toString(16))}}),a}function Sye(e,t){if(t){var r=0;[[5,8],[23,26],[41,44],[50,392]].forEach(function(a){for(var s=a[0];s<=a[1];++s)t[s]!=null&&++r}),r!=0&&(He(e,615,Gi(r)),[[5,8],[23,26],[41,44],[50,392]].forEach(function(a){for(var s=a[0];s<=a[1];++s)t[s]!=null&&He(e,44,mye(s,t[s]))}),He(e,616))}}function Bye(e){var t=1;He(e,611,Gi(t)),He(e,43,bye({sz:12,color:{theme:1},name:"Calibri",family:2})),He(e,612)}function _ye(e){var t=2;He(e,603,Gi(t)),He(e,45,eU({patternType:"none"})),He(e,45,eU({patternType:"gray125"})),He(e,604)}function Tye(e){var t=1;He(e,613,Gi(t)),He(e,46,Cye()),He(e,614)}function Iye(e){var t=1;He(e,626,Gi(t)),He(e,47,V9({numFmtId:0},65535)),He(e,627)}function Fye(e,t){He(e,617,Gi(t.length)),t.forEach(function(r){He(e,47,V9(r,0))}),He(e,618)}function Dye(e){var t=1;He(e,619,Gi(t)),He(e,48,kye({xfId:0,name:"Normal"})),He(e,620)}function Uye(e){var t=0;He(e,505,Gi(t)),He(e,506)}function Mye(e){var t=0;He(e,508,jye(t,"TableStyleMedium9","PivotStyleMedium4")),He(e,509)}function Rye(e,t){var r=ms();return He(r,278),Sye(r,e.SSF),Bye(r),_ye(r),Tye(r),Iye(r),Fye(r,t.cellXfs),Dye(r),Uye(r),Mye(r),He(r,279),r.end()}var Oye=["</a:lt1>","</a:dk1>","</a:lt2>","</a:dk2>","</a:accent1>","</a:accent2>","</a:accent3>","</a:accent4>","</a:accent5>","</a:accent6>","</a:hlink>","</a:folHlink>"];function Pye(e,t,r){t.themeElements.clrScheme=[];var a={};(e[0].match(zn)||[]).forEach(function(s){var i=Nt(s);switch(i[0]){case"<a:clrScheme":case"</a:clrScheme>":break;case"<a:srgbClr":a.rgb=i.val;break;case"<a:sysClr":a.rgb=i.lastClr;break;case"<a:dk1>":case"</a:dk1>":case"<a:lt1>":case"</a:lt1>":case"<a:dk2>":case"</a:dk2>":case"<a:lt2>":case"</a:lt2>":case"<a:accent1>":case"</a:accent1>":case"<a:accent2>":case"</a:accent2>":case"<a:accent3>":case"</a:accent3>":case"<a:accent4>":case"</a:accent4>":case"<a:accent5>":case"</a:accent5>":case"<a:accent6>":case"</a:accent6>":case"<a:hlink>":case"</a:hlink>":case"<a:folHlink>":case"</a:folHlink>":i[0].charAt(1)==="/"?(t.themeElements.clrScheme[Oye.indexOf(i[0])]=a,a={}):a.name=i[0].slice(3,i[0].length-1);break;default:if(r&&r.WTF)throw new Error("Unrecognized "+i[0]+" in clrScheme")}})}function Lye(){}function Qye(){}var Hye=/<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/,zye=/<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/,$ye=/<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/;function Vye(e,t,r){t.themeElements={};var a;[["clrScheme",Hye,Pye],["fontScheme",zye,Lye],["fmtScheme",$ye,Qye]].forEach(function(s){if(!(a=e.match(s[1])))throw new Error(s[0]+" not found in themeElements");s[2](a,t,r)})}var Gye=/<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/;function G9(e,t){(!e||e.length===0)&&(e=BE());var r,a={};if(!(r=e.match(Gye)))throw new Error("themeElements not found in theme");return Vye(r[0],a,t),a.raw=e,a}function BE(e,t){if(t&&t.themeXLSX)return t.themeXLSX;if(e&&typeof e.raw=="string")return e.raw;var r=[wa];return r[r.length]='<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">',r[r.length]="<a:themeElements>",r[r.length]='<a:clrScheme name="Office">',r[r.length]='<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>',r[r.length]='<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>',r[r.length]='<a:dk2><a:srgbClr val="1F497D"/></a:dk2>',r[r.length]='<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>',r[r.length]='<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>',r[r.length]='<a:accent2><a:srgbClr val="C0504D"/></a:accent2>',r[r.length]='<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>',r[r.length]='<a:accent4><a:srgbClr val="8064A2"/></a:accent4>',r[r.length]='<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>',r[r.length]='<a:accent6><a:srgbClr val="F79646"/></a:accent6>',r[r.length]='<a:hlink><a:srgbClr val="0000FF"/></a:hlink>',r[r.length]='<a:folHlink><a:srgbClr val="800080"/></a:folHlink>',r[r.length]="</a:clrScheme>",r[r.length]='<a:fontScheme name="Office">',r[r.length]="<a:majorFont>",r[r.length]='<a:latin typeface="Cambria"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="ＭＳ Ｐゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Times New Roman"/>',r[r.length]='<a:font script="Hebr" typeface="Times New Roman"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="MoolBoran"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Times New Roman"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:majorFont>",r[r.length]="<a:minorFont>",r[r.length]='<a:latin typeface="Calibri"/>',r[r.length]='<a:ea typeface=""/>',r[r.length]='<a:cs typeface=""/>',r[r.length]='<a:font script="Jpan" typeface="ＭＳ Ｐゴシック"/>',r[r.length]='<a:font script="Hang" typeface="맑은 고딕"/>',r[r.length]='<a:font script="Hans" typeface="宋体"/>',r[r.length]='<a:font script="Hant" typeface="新細明體"/>',r[r.length]='<a:font script="Arab" typeface="Arial"/>',r[r.length]='<a:font script="Hebr" typeface="Arial"/>',r[r.length]='<a:font script="Thai" typeface="Tahoma"/>',r[r.length]='<a:font script="Ethi" typeface="Nyala"/>',r[r.length]='<a:font script="Beng" typeface="Vrinda"/>',r[r.length]='<a:font script="Gujr" typeface="Shruti"/>',r[r.length]='<a:font script="Khmr" typeface="DaunPenh"/>',r[r.length]='<a:font script="Knda" typeface="Tunga"/>',r[r.length]='<a:font script="Guru" typeface="Raavi"/>',r[r.length]='<a:font script="Cans" typeface="Euphemia"/>',r[r.length]='<a:font script="Cher" typeface="Plantagenet Cherokee"/>',r[r.length]='<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>',r[r.length]='<a:font script="Tibt" typeface="Microsoft Himalaya"/>',r[r.length]='<a:font script="Thaa" typeface="MV Boli"/>',r[r.length]='<a:font script="Deva" typeface="Mangal"/>',r[r.length]='<a:font script="Telu" typeface="Gautami"/>',r[r.length]='<a:font script="Taml" typeface="Latha"/>',r[r.length]='<a:font script="Syrc" typeface="Estrangelo Edessa"/>',r[r.length]='<a:font script="Orya" typeface="Kalinga"/>',r[r.length]='<a:font script="Mlym" typeface="Kartika"/>',r[r.length]='<a:font script="Laoo" typeface="DokChampa"/>',r[r.length]='<a:font script="Sinh" typeface="Iskoola Pota"/>',r[r.length]='<a:font script="Mong" typeface="Mongolian Baiti"/>',r[r.length]='<a:font script="Viet" typeface="Arial"/>',r[r.length]='<a:font script="Uigh" typeface="Microsoft Uighur"/>',r[r.length]='<a:font script="Geor" typeface="Sylfaen"/>',r[r.length]="</a:minorFont>",r[r.length]="</a:fontScheme>",r[r.length]='<a:fmtScheme name="Office">',r[r.length]="<a:fillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="1"/>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:lin ang="16200000" scaled="0"/>',r[r.length]="</a:gradFill>",r[r.length]="</a:fillStyleLst>",r[r.length]="<a:lnStyleLst>",r[r.length]='<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]='<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>',r[r.length]="</a:lnStyleLst>",r[r.length]="<a:effectStyleLst>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]="</a:effectStyle>",r[r.length]="<a:effectStyle>",r[r.length]="<a:effectLst>",r[r.length]='<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>',r[r.length]="</a:effectLst>",r[r.length]='<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>',r[r.length]='<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>',r[r.length]="</a:effectStyle>",r[r.length]="</a:effectStyleLst>",r[r.length]="<a:bgFillStyleLst>",r[r.length]='<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>',r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]='<a:gradFill rotWithShape="1">',r[r.length]="<a:gsLst>",r[r.length]='<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>',r[r.length]='<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>',r[r.length]="</a:gsLst>",r[r.length]='<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>',r[r.length]="</a:gradFill>",r[r.length]="</a:bgFillStyleLst>",r[r.length]="</a:fmtScheme>",r[r.length]="</a:themeElements>",r[r.length]="<a:objectDefaults>",r[r.length]="<a:spDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>',r[r.length]="</a:spDef>",r[r.length]="<a:lnDef>",r[r.length]='<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>',r[r.length]="</a:lnDef>",r[r.length]="</a:objectDefaults>",r[r.length]="<a:extraClrSchemeLst/>",r[r.length]="</a:theme>",r.join("")}function Kye(e,t,r){var a=e.l+t,s=e.read_shift(4);if(s!==124226){if(!r.cellStyles){e.l=a;return}var i=e.slice(e.l);e.l=a;var l;try{l=OQ(i,{type:"array"})}catch{return}var o=Os(l,"theme/theme/theme1.xml",!0);if(o)return G9(o,r)}}function qye(e){return e.read_shift(4)}function Wye(e){var t={};switch(t.xclrType=e.read_shift(2),t.nTintShade=e.read_shift(2),t.xclrType){case 0:e.l+=4;break;case 1:t.xclrValue=Yye(e,4);break;case 2:t.xclrValue=k9(e);break;case 3:t.xclrValue=qye(e);break;case 4:e.l+=4;break}return e.l+=8,t}function Yye(e,t){return Hn(e,t)}function Xye(e,t){return Hn(e,t)}function Jye(e){var t=e.read_shift(2),r=e.read_shift(2)-4,a=[t];switch(t){case 4:case 5:case 7:case 8:case 9:case 10:case 11:case 13:a[1]=Wye(e);break;case 6:a[1]=Xye(e,r);break;case 14:case 15:a[1]=e.read_shift(r===1?1:2);break;default:throw new Error("Unrecognized ExtProp type: "+t+" "+r)}return a}function Zye(e,t){var r=e.l+t;e.l+=2;var a=e.read_shift(2);e.l+=2;for(var s=e.read_shift(2),i=[];s-- >0;)i.push(Jye(e,r-e.l));return{ixfe:a,ext:i}}function ewe(e,t){t.forEach(function(r){r[0]})}function twe(e,t){return{flags:e.read_shift(4),version:e.read_shift(4),name:Pn(e)}}function rwe(e){var t=Oe(12+2*e.name.length);return t.write_shift(4,e.flags),t.write_shift(4,e.version),rn(e.name,t),t.slice(0,t.l)}function awe(e){for(var t=[],r=e.read_shift(4);r-- >0;)t.push([e.read_shift(4),e.read_shift(4)]);return t}function nwe(e){var t=Oe(4+8*e.length);t.write_shift(4,e.length);for(var r=0;r<e.length;++r)t.write_shift(4,e[r][0]),t.write_shift(4,e[r][1]);return t}function swe(e,t){var r=Oe(8+2*t.length);return r.write_shift(4,e),rn(t,r),r.slice(0,r.l)}function iwe(e){return e.l+=4,e.read_shift(4)!=0}function lwe(e,t){var r=Oe(8);return r.write_shift(4,e),r.write_shift(4,1),r}function owe(e,t,r){var a={Types:[],Cell:[],Value:[]},s=r||{},i=[],l=!1,o=2;return Oo(e,function(d,u,f){switch(f){case 335:a.Types.push({name:d.name});break;case 51:d.forEach(function(p){o==1?a.Cell.push({type:a.Types[p[0]-1].name,index:p[1]}):o==0&&a.Value.push({type:a.Types[p[0]-1].name,index:p[1]})});break;case 337:o=d?1:0;break;case 338:o=2;break;case 35:i.push(f),l=!0;break;case 36:i.pop(),l=!1;break;default:if(!u.T){if(!l||s.WTF&&i[i.length-1]!=35)throw new Error("Unexpected record 0x"+f.toString(16))}}}),a}function cwe(){var e=ms();return He(e,332),He(e,334,Gi(1)),He(e,335,rwe({name:"XLDAPR",version:12e4,flags:3496657072})),He(e,336),He(e,339,swe(1,"XLDAPR")),He(e,52),He(e,35,Gi(514)),He(e,4096,Gi(0)),He(e,4097,fi(1)),He(e,36),He(e,53),He(e,340),He(e,337,lwe(1)),He(e,51,nwe([[1,0]])),He(e,338),He(e,333),e.end()}function dwe(e,t,r){var a={Types:[],Cell:[],Value:[]};if(!e)return a;var s=!1,i=2,l;return e.replace(zn,function(o){var d=Nt(o);switch(Tl(d[0])){case"<?xml":break;case"<metadata":case"</metadata>":break;case"<metadataTypes":case"</metadataTypes>":break;case"<metadataType":a.Types.push({name:d.name});break;case"</metadataType>":break;case"<futureMetadata":for(var u=0;u<a.Types.length;++u)a.Types[u].name==d.name&&(l=a.Types[u]);break;case"</futureMetadata>":break;case"<bk>":break;case"</bk>":break;case"<rc":i==1?a.Cell.push({type:a.Types[d.t-1].name,index:+d.v}):i==0&&a.Value.push({type:a.Types[d.t-1].name,index:+d.v});break;case"</rc>":break;case"<cellMetadata":i=1;break;case"</cellMetadata>":i=2;break;case"<valueMetadata":i=0;break;case"</valueMetadata>":i=2;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":s=!0;break;case"</ext>":s=!1;break;case"<rvb":if(!l)break;l.offsets||(l.offsets=[]),l.offsets.push(+d.i);break;default:if(!s&&r.WTF)throw new Error("unrecognized "+d[0]+" in metadata")}return o}),a}function K9(){var e=[wa];return e.push(`<metadata xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xlrd="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" xmlns:xda="http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray">
  <metadataTypes count="1">
    <metadataType name="XLDAPR" minSupportedVersion="120000" copy="1" pasteAll="1" pasteValues="1" merge="1" splitFirst="1" rowColShift="1" clearFormats="1" clearComments="1" assign="1" coerce="1" cellMeta="1"/>
  </metadataTypes>
  <futureMetadata name="XLDAPR" count="1">
    <bk>
      <extLst>
        <ext uri="{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}">
          <xda:dynamicArrayProperties fDynamic="1" fCollapsed="0"/>
        </ext>
      </extLst>
    </bk>
  </futureMetadata>
  <cellMetadata count="1">
    <bk>
      <rc t="1" v="0"/>
    </bk>
  </cellMetadata>
</metadata>`),e.join("")}function uwe(e){var t=[];if(!e)return t;var r=1;return(e.match(zn)||[]).forEach(function(a){var s=Nt(a);switch(s[0]){case"<?xml":break;case"<calcChain":case"<calcChain>":case"</calcChain>":break;case"<c":delete s[0],s.i?r=s.i:s.i=r,t.push(s);break}}),t}function Awe(e){var t={};t.i=e.read_shift(4);var r={};r.r=e.read_shift(4),r.c=e.read_shift(4),t.r=yt(r);var a=e.read_shift(1);return a&2&&(t.l="1"),a&8&&(t.a="1"),t}function fwe(e,t,r){var a=[];return Oo(e,function(i,l,o){switch(o){case 63:a.push(i);break;default:if(!l.T)throw new Error("Unexpected record 0x"+o.toString(16))}}),a}function pwe(e,t,r,a){if(!e)return e;var s=a||{},i=!1;Oo(e,function(o,d,u){switch(u){case 359:case 363:case 364:case 366:case 367:case 368:case 369:case 370:case 371:case 472:case 577:case 578:case 579:case 580:case 581:case 582:case 583:case 584:case 585:case 586:case 587:break;case 35:i=!0;break;case 36:i=!1;break;default:if(!d.T){if(!i||s.WTF)throw new Error("Unexpected record 0x"+u.toString(16))}}},s)}function xwe(e,t){if(!e)return"??";var r=(e.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1];return t["!id"][r].Target}var xA=1024;function q9(e,t){for(var r=[21600,21600],a=["m0,0l0",r[1],r[0],r[1],r[0],"0xe"].join(","),s=[We("xml",null,{"xmlns:v":Ds.v,"xmlns:o":Ds.o,"xmlns:x":Ds.x,"xmlns:mv":Ds.mv}).replace(/\/>/,">"),We("o:shapelayout",We("o:idmap",null,{"v:ext":"edit",data:e}),{"v:ext":"edit"}),We("v:shapetype",[We("v:stroke",null,{joinstyle:"miter"}),We("v:path",null,{gradientshapeok:"t","o:connecttype":"rect"})].join(""),{id:"_x0000_t202","o:spt":202,coordsize:r.join(","),path:a})];xA<e*1e3;)xA+=1e3;return t.forEach(function(i){var l=Zr(i[0]),o={color2:"#BEFF82",type:"gradient"};o.type=="gradient"&&(o.angle="-180");var d=o.type=="gradient"?We("o:fill",null,{type:"gradientUnscaled","v:ext":"view"}):null,u=We("v:fill",d,o),f={on:"t",obscured:"t"};++xA,s=s.concat(["<v:shape"+bp({id:"_x0000_s"+xA,type:"#_x0000_t202",style:"position:absolute; margin-left:80pt;margin-top:5pt;width:104pt;height:64pt;z-index:10"+(i[1].hidden?";visibility:hidden":""),fillcolor:"#ECFAD4",strokecolor:"#edeaa1"})+">",u,We("v:shadow",null,f),We("v:path",null,{"o:connecttype":"none"}),'<v:textbox><div style="text-align:left"></div></v:textbox>','<x:ClientData ObjectType="Note">',"<x:MoveWithCells/>","<x:SizeWithCells/>",yn("x:Anchor",[l.c+1,0,l.r+1,0,l.c+3,20,l.r+5,20].join(",")),yn("x:AutoFill","False"),yn("x:Row",String(l.r)),yn("x:Column",String(l.c)),i[1].hidden?"":"<x:Visible/>","</x:ClientData>","</v:shape>"])}),s.push("</xml>"),s.join("")}function tU(e,t,r,a){var s=Array.isArray(e),i;t.forEach(function(l){var o=Zr(l.ref);if(s?(e[o.r]||(e[o.r]=[]),i=e[o.r][o.c]):i=e[l.ref],!i){i={t:"z"},s?e[o.r][o.c]=i:e[l.ref]=i;var d=Yt(e["!ref"]||"BDWGO1000001:A1");d.s.r>o.r&&(d.s.r=o.r),d.e.r<o.r&&(d.e.r=o.r),d.s.c>o.c&&(d.s.c=o.c),d.e.c<o.c&&(d.e.c=o.c);var u=Tt(d);u!==e["!ref"]&&(e["!ref"]=u)}i.c||(i.c=[]);var f={a:l.author,t:l.t,r:l.r,T:r};l.h&&(f.h=l.h);for(var p=i.c.length-1;p>=0;--p){if(!r&&i.c[p].T)return;r&&!i.c[p].T&&i.c.splice(p,1)}if(r&&a){for(p=0;p<a.length;++p)if(f.a==a[p].id){f.a=a[p].name||f.a;break}}i.c.push(f)})}function hwe(e,t){if(e.match(/<(?:\w+:)?comments *\/>/))return[];var r=[],a=[],s=e.match(/<(?:\w+:)?authors>([\s\S]*)<\/(?:\w+:)?authors>/);s&&s[1]&&s[1].split(/<\/\w*:?author>/).forEach(function(l){if(!(l===""||l.trim()==="")){var o=l.match(/<(?:\w+:)?author[^>]*>(.*)/);o&&r.push(o[1])}});var i=e.match(/<(?:\w+:)?commentList>([\s\S]*)<\/(?:\w+:)?commentList>/);return i&&i[1]&&i[1].split(/<\/\w*:?comment>/).forEach(function(l){if(!(l===""||l.trim()==="")){var o=l.match(/<(?:\w+:)?comment[^>]*>/);if(o){var d=Nt(o[0]),u={author:d.authorId&&r[d.authorId]||"sheetjsghost",ref:d.ref,guid:d.guid},f=Zr(d.ref);if(!(t.sheetRows&&t.sheetRows<=f.r)){var p=l.match(/<(?:\w+:)?text>([\s\S]*)<\/(?:\w+:)?text>/),h=!!p&&!!p[1]&&jE(p[1])||{r:"",t:"",h:""};u.r=h.r,h.r=="<t></t>"&&(h.t=h.h=""),u.t=(h.t||"").replace(/\r\n/g,`
`).replace(/\r/g,`
`),t.cellHTML&&(u.h=h.h),a.push(u)}}}}),a}function W9(e){var t=[wa,We("comments",null,{xmlns:su[0]})],r=[];return t.push("<authors>"),e.forEach(function(a){a[1].forEach(function(s){var i=ur(s.a);r.indexOf(i)==-1&&(r.push(i),t.push("<author>"+i+"</author>")),s.T&&s.ID&&r.indexOf("tc="+s.ID)==-1&&(r.push("tc="+s.ID),t.push("<author>tc="+s.ID+"</author>"))})}),r.length==0&&(r.push("SheetJ5"),t.push("<author>SheetJ5</author>")),t.push("</authors>"),t.push("<commentList>"),e.forEach(function(a){var s=0,i=[];if(a[1][0]&&a[1][0].T&&a[1][0].ID?s=r.indexOf("tc="+a[1][0].ID):a[1].forEach(function(d){d.a&&(s=r.indexOf(ur(d.a))),i.push(d.t||"")}),t.push('<comment ref="'+a[0]+'" authorId="'+s+'"><text>'),i.length<=1)t.push(yn("t",ur(i[0]||"")));else{for(var l=`Comment:
    `+i[0]+`
`,o=1;o<i.length;++o)l+=`Reply:
    `+i[o]+`
`;t.push(yn("t",ur(l)))}t.push("</text></comment>")}),t.push("</commentList>"),t.length>2&&(t[t.length]="</comments>",t[1]=t[1].replace("/>",">")),t.join("")}function mwe(e,t){var r=[],a=!1,s={},i=0;return e.replace(zn,function(o,d){var u=Nt(o);switch(Tl(u[0])){case"<?xml":break;case"<ThreadedComments":break;case"</ThreadedComments>":break;case"<threadedComment":s={author:u.personId,guid:u.id,ref:u.ref,T:1};break;case"</threadedComment>":s.t!=null&&r.push(s);break;case"<text>":case"<text":i=d+o.length;break;case"</text>":s.t=e.slice(i,d).replace(/\r\n/g,`
`).replace(/\r/g,`
`);break;case"<mentions":case"<mentions>":a=!0;break;case"</mentions>":a=!1;break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":a=!0;break;case"</ext>":a=!1;break;default:if(!a&&t.WTF)throw new Error("unrecognized "+u[0]+" in threaded comments")}return o}),r}function gwe(e,t,r){var a=[wa,We("ThreadedComments",null,{xmlns:Qa.TCMNT}).replace(/[\/]>/,">")];return e.forEach(function(s){var i="";(s[1]||[]).forEach(function(l,o){if(!l.T){delete l.ID;return}l.a&&t.indexOf(l.a)==-1&&t.push(l.a);var d={ref:s[0],id:"{54EE7951-7262-4200-6969-"+("000000000000"+r.tcid++).slice(-12)+"}"};o==0?i=d.id:d.parentId=i,l.ID=d.id,l.a&&(d.personId="{54EE7950-7262-4200-6969-"+("000000000000"+t.indexOf(l.a)).slice(-12)+"}"),a.push(We("threadedComment",yn("text",l.t||""),d))})}),a.push("</ThreadedComments>"),a.join("")}function bwe(e,t){var r=[],a=!1;return e.replace(zn,function(i){var l=Nt(i);switch(Tl(l[0])){case"<?xml":break;case"<personList":break;case"</personList>":break;case"<person":r.push({name:l.displayname,id:l.id});break;case"</person>":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":a=!0;break;case"</ext>":a=!1;break;default:if(!a&&t.WTF)throw new Error("unrecognized "+l[0]+" in threaded comments")}return i}),r}function vwe(e){var t=[wa,We("personList",null,{xmlns:Qa.TCMNT,"xmlns:x":su[0]}).replace(/[\/]>/,">")];return e.forEach(function(r,a){t.push(We("person",null,{displayName:r,id:"{54EE7950-7262-4200-6969-"+("000000000000"+a).slice(-12)+"}",userId:r,providerId:"None"}))}),t.push("</personList>"),t.join("")}function ywe(e){var t={};t.iauthor=e.read_shift(4);var r=cu(e);return t.rfx=r.s,t.ref=yt(r.s),e.l+=16,t}function wwe(e,t){return t==null&&(t=Oe(36)),t.write_shift(4,e[1].iauthor),s0(e[0],t),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t.write_shift(4,0),t}var Nwe=Pn;function Cwe(e){return rn(e.slice(0,54))}function kwe(e,t){var r=[],a=[],s={},i=!1;return Oo(e,function(o,d,u){switch(u){case 632:a.push(o);break;case 635:s=o;break;case 637:s.t=o.t,s.h=o.h,s.r=o.r;break;case 636:if(s.author=a[s.iauthor],delete s.iauthor,t.sheetRows&&s.rfx&&t.sheetRows<=s.rfx.r)break;s.t||(s.t=""),delete s.rfx,r.push(s);break;case 3072:break;case 35:i=!0;break;case 36:i=!1;break;case 37:break;case 38:break;default:if(!d.T){if(!i||t.WTF)throw new Error("Unexpected record 0x"+u.toString(16))}}}),r}function jwe(e){var t=ms(),r=[];return He(t,628),He(t,630),e.forEach(function(a){a[1].forEach(function(s){r.indexOf(s.a)>-1||(r.push(s.a.slice(0,54)),He(t,632,Cwe(s.a)))})}),He(t,631),He(t,633),e.forEach(function(a){a[1].forEach(function(s){s.iauthor=r.indexOf(s.a);var i={s:Zr(a[0]),e:Zr(a[0])};He(t,635,wwe([i,s])),s.t&&s.t.length>0&&He(t,637,qge(s)),He(t,636),delete s.iauthor})}),He(t,634),He(t,629),t.end()}var Ewe="application/vnd.ms-office.vbaProject";function Swe(e){var t=xt.utils.cfb_new({root:"R"});return e.FullPaths.forEach(function(r,a){if(!(r.slice(-1)==="/"||!r.match(/_VBA_PROJECT_CUR/))){var s=r.replace(/^[^\/]*/,"R").replace(/\/_VBA_PROJECT_CUR\u0000*/,"");xt.utils.cfb_add(t,s,e.FileIndex[a].content)}}),xt.write(t)}function Bwe(e,t){t.FullPaths.forEach(function(r,a){if(a!=0){var s=r.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");s.slice(-1)!=="/"&&xt.utils.cfb_add(e,s,t.FileIndex[a].content)}})}var Y9=["xlsb","xlsm","xlam","biff8","xla"];function _we(){return{"!type":"dialog"}}function Twe(){return{"!type":"dialog"}}function Iwe(){return{"!type":"macro"}}function Fwe(){return{"!type":"macro"}}var NA=(function(){var e=/(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g,t={r:0,c:0};function r(a,s,i,l){var o=!1,d=!1;i.length==0?d=!0:i.charAt(0)=="["&&(d=!0,i=i.slice(1,-1)),l.length==0?o=!0:l.charAt(0)=="["&&(o=!0,l=l.slice(1,-1));var u=i.length>0?parseInt(i,10)|0:0,f=l.length>0?parseInt(l,10)|0:0;return o?f+=t.c:--f,d?u+=t.r:--u,s+(o?"":"$")+Jr(f)+(d?"":"$")+ya(u)}return function(s,i){return t=i,s.replace(e,r)}})(),_E=/(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g,TE=(function(){return function(t,r){return t.replace(_E,function(a,s,i,l,o,d){var u=mE(l)-(i?0:r.c),f=hE(d)-(o?0:r.r),p=f==0?"":o?f+1:"["+f+"]",h=u==0?"":i?u+1:"["+u+"]";return s+"R"+p+"C"+h})}})();function X9(e,t){return e.replace(_E,function(r,a,s,i,l,o){return a+(s=="$"?s+i:Jr(mE(i)+t.c))+(l=="$"?l+o:ya(hE(o)+t.r))})}function Dwe(e,t,r){var a=ys(t),s=a.s,i=Zr(r),l={r:i.r-s.r,c:i.c-s.c};return X9(e,l)}function Uwe(e){return e.length!=1}function rU(e){return e.replace(/_xlfn\./g,"")}function Sa(e){e.l+=1}function Mc(e,t){var r=e.read_shift(2);return[r&16383,r>>14&1,r>>15&1]}function J9(e,t,r){var a=2;if(r){if(r.biff>=2&&r.biff<=5)return Z9(e);r.biff==12&&(a=4)}var s=e.read_shift(a),i=e.read_shift(a),l=Mc(e),o=Mc(e);return{s:{r:s,c:l[0],cRel:l[1],rRel:l[2]},e:{r:i,c:o[0],cRel:o[1],rRel:o[2]}}}function Z9(e){var t=Mc(e),r=Mc(e),a=e.read_shift(1),s=e.read_shift(1);return{s:{r:t[0],c:a,cRel:t[1],rRel:t[2]},e:{r:r[0],c:s,cRel:r[1],rRel:r[2]}}}function Mwe(e,t,r){if(r.biff<8)return Z9(e);var a=e.read_shift(r.biff==12?4:2),s=e.read_shift(r.biff==12?4:2),i=Mc(e),l=Mc(e);return{s:{r:a,c:i[0],cRel:i[1],rRel:i[2]},e:{r:s,c:l[0],cRel:l[1],rRel:l[2]}}}function eH(e,t,r){if(r&&r.biff>=2&&r.biff<=5)return Rwe(e);var a=e.read_shift(r&&r.biff==12?4:2),s=Mc(e);return{r:a,c:s[0],cRel:s[1],rRel:s[2]}}function Rwe(e){var t=Mc(e),r=e.read_shift(1);return{r:t[0],c:r,cRel:t[1],rRel:t[2]}}function Owe(e){var t=e.read_shift(2),r=e.read_shift(2);return{r:t,c:r&255,fQuoted:!!(r&16384),cRel:r>>15,rRel:r>>15}}function Pwe(e,t,r){var a=r&&r.biff?r.biff:8;if(a>=2&&a<=5)return Lwe(e);var s=e.read_shift(a>=12?4:2),i=e.read_shift(2),l=(i&16384)>>14,o=(i&32768)>>15;if(i&=16383,o==1)for(;s>524287;)s-=1048576;if(l==1)for(;i>8191;)i=i-16384;return{r:s,c:i,cRel:l,rRel:o}}function Lwe(e){var t=e.read_shift(2),r=e.read_shift(1),a=(t&32768)>>15,s=(t&16384)>>14;return t&=16383,a==1&&t>=8192&&(t=t-16384),s==1&&r>=128&&(r=r-256),{r:t,c:r,cRel:s,rRel:a}}function Qwe(e,t,r){var a=(e[e.l++]&96)>>5,s=J9(e,r.biff>=2&&r.biff<=5?6:8,r);return[a,s]}function Hwe(e,t,r){var a=(e[e.l++]&96)>>5,s=e.read_shift(2,"i"),i=8;if(r)switch(r.biff){case 5:e.l+=12,i=6;break;case 12:i=12;break}var l=J9(e,i,r);return[a,s,l]}function zwe(e,t,r){var a=(e[e.l++]&96)>>5;return e.l+=r&&r.biff>8?12:r.biff<8?6:8,[a]}function $we(e,t,r){var a=(e[e.l++]&96)>>5,s=e.read_shift(2),i=8;if(r)switch(r.biff){case 5:e.l+=12,i=6;break;case 12:i=12;break}return e.l+=i,[a,s]}function Vwe(e,t,r){var a=(e[e.l++]&96)>>5,s=Mwe(e,t-1,r);return[a,s]}function Gwe(e,t,r){var a=(e[e.l++]&96)>>5;return e.l+=r.biff==2?6:r.biff==12?14:7,[a]}function aU(e){var t=e[e.l+1]&1,r=1;return e.l+=4,[t,r]}function Kwe(e,t,r){e.l+=2;for(var a=e.read_shift(r&&r.biff==2?1:2),s=[],i=0;i<=a;++i)s.push(e.read_shift(r&&r.biff==2?1:2));return s}function qwe(e,t,r){var a=e[e.l+1]&255?1:0;return e.l+=2,[a,e.read_shift(r&&r.biff==2?1:2)]}function Wwe(e,t,r){var a=e[e.l+1]&255?1:0;return e.l+=2,[a,e.read_shift(r&&r.biff==2?1:2)]}function Ywe(e){var t=e[e.l+1]&255?1:0;return e.l+=2,[t,e.read_shift(2)]}function Xwe(e,t,r){var a=e[e.l+1]&255?1:0;return e.l+=r&&r.biff==2?3:4,[a]}function tH(e){var t=e.read_shift(1),r=e.read_shift(1);return[t,r]}function Jwe(e){return e.read_shift(2),tH(e)}function Zwe(e){return e.read_shift(2),tH(e)}function e2e(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var s=eH(e,0,r);return[a,s]}function t2e(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var s=Pwe(e,0,r);return[a,s]}function r2e(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var s=e.read_shift(2);r&&r.biff==5&&(e.l+=12);var i=eH(e,0,r);return[a,s,i]}function a2e(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var s=e.read_shift(r&&r.biff<=3?1:2);return[iNe[s],nH[s],a]}function n2e(e,t,r){var a=e[e.l++],s=e.read_shift(1),i=r&&r.biff<=3?[a==88?-1:0,e.read_shift(1)]:s2e(e);return[s,(i[0]===0?nH:sNe)[i[1]]]}function s2e(e){return[e[e.l+1]>>7,e.read_shift(2)&32767]}function i2e(e,t,r){e.l+=r&&r.biff==2?3:4}function l2e(e,t,r){if(e.l++,r&&r.biff==12)return[e.read_shift(4,"i"),0];var a=e.read_shift(2),s=e.read_shift(r&&r.biff==2?1:2);return[a,s]}function o2e(e){return e.l++,Po[e.read_shift(1)]}function c2e(e){return e.l++,e.read_shift(2)}function d2e(e){return e.l++,e.read_shift(1)!==0}function u2e(e){return e.l++,On(e)}function A2e(e,t,r){return e.l++,tx(e,t-1,r)}function f2e(e,t){var r=[e.read_shift(1)];if(t==12)switch(r[0]){case 2:r[0]=4;break;case 4:r[0]=16;break;case 0:r[0]=1;break;case 1:r[0]=2;break}switch(r[0]){case 4:r[1]=ga(e,1)?"TRUE":"FALSE",t!=12&&(e.l+=7);break;case 37:case 16:r[1]=Po[e[e.l]],e.l+=t==12?4:8;break;case 0:e.l+=8;break;case 1:r[1]=On(e);break;case 2:r[1]=du(e,0,{biff:t>0&&t<8?2:t});break;default:throw new Error("Bad SerAr: "+r[0])}return r}function p2e(e,t,r){for(var a=e.read_shift(r.biff==12?4:2),s=[],i=0;i!=a;++i)s.push((r.biff==12?cu:fv)(e));return s}function x2e(e,t,r){var a=0,s=0;r.biff==12?(a=e.read_shift(4),s=e.read_shift(4)):(s=1+e.read_shift(1),a=1+e.read_shift(2)),r.biff>=2&&r.biff<8&&(--a,--s==0&&(s=256));for(var i=0,l=[];i!=a&&(l[i]=[]);++i)for(var o=0;o!=s;++o)l[i][o]=f2e(e,r.biff);return l}function h2e(e,t,r){var a=e.read_shift(1)>>>5&3,s=!r||r.biff>=8?4:2,i=e.read_shift(s);switch(r.biff){case 2:e.l+=5;break;case 3:case 4:e.l+=8;break;case 5:e.l+=12;break}return[a,0,i]}function m2e(e,t,r){if(r.biff==5)return g2e(e);var a=e.read_shift(1)>>>5&3,s=e.read_shift(2),i=e.read_shift(4);return[a,s,i]}function g2e(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2,"i");e.l+=8;var a=e.read_shift(2);return e.l+=12,[t,r,a]}function b2e(e,t,r){var a=e.read_shift(1)>>>5&3;e.l+=r&&r.biff==2?3:4;var s=e.read_shift(r&&r.biff==2?1:2);return[a,s]}function v2e(e,t,r){var a=e.read_shift(1)>>>5&3,s=e.read_shift(r&&r.biff==2?1:2);return[a,s]}function y2e(e,t,r){var a=e.read_shift(1)>>>5&3;return e.l+=4,r.biff<8&&e.l--,r.biff==12&&(e.l+=2),[a]}function w2e(e,t,r){var a=(e[e.l++]&96)>>5,s=e.read_shift(2),i=4;if(r)switch(r.biff){case 5:i=15;break;case 12:i=6;break}return e.l+=i,[a,s]}var N2e=Hn,C2e=Hn,k2e=Hn;function ax(e,t,r){return e.l+=2,[Owe(e)]}function IE(e){return e.l+=6,[]}var j2e=ax,E2e=IE,S2e=IE,B2e=ax;function rH(e){return e.l+=2,[_a(e),e.read_shift(2)&1]}var _2e=ax,T2e=rH,I2e=IE,F2e=ax,D2e=ax,U2e=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function M2e(e){e.l+=2;var t=e.read_shift(2),r=e.read_shift(2),a=e.read_shift(4),s=e.read_shift(2),i=e.read_shift(2),l=U2e[r>>2&31];return{ixti:t,coltype:r&3,rt:l,idx:a,c:s,C:i}}function R2e(e){return e.l+=2,[e.read_shift(4)]}function O2e(e,t,r){return e.l+=5,e.l+=2,e.l+=r.biff==2?1:4,["PTGSHEET"]}function P2e(e,t,r){return e.l+=r.biff==2?4:5,["PTGENDSHEET"]}function L2e(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function Q2e(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function H2e(e){return e.l+=4,[0,0]}var nU={1:{n:"PtgExp",f:l2e},2:{n:"PtgTbl",f:k2e},3:{n:"PtgAdd",f:Sa},4:{n:"PtgSub",f:Sa},5:{n:"PtgMul",f:Sa},6:{n:"PtgDiv",f:Sa},7:{n:"PtgPower",f:Sa},8:{n:"PtgConcat",f:Sa},9:{n:"PtgLt",f:Sa},10:{n:"PtgLe",f:Sa},11:{n:"PtgEq",f:Sa},12:{n:"PtgGe",f:Sa},13:{n:"PtgGt",f:Sa},14:{n:"PtgNe",f:Sa},15:{n:"PtgIsect",f:Sa},16:{n:"PtgUnion",f:Sa},17:{n:"PtgRange",f:Sa},18:{n:"PtgUplus",f:Sa},19:{n:"PtgUminus",f:Sa},20:{n:"PtgPercent",f:Sa},21:{n:"PtgParen",f:Sa},22:{n:"PtgMissArg",f:Sa},23:{n:"PtgStr",f:A2e},26:{n:"PtgSheet",f:O2e},27:{n:"PtgEndSheet",f:P2e},28:{n:"PtgErr",f:o2e},29:{n:"PtgBool",f:d2e},30:{n:"PtgInt",f:c2e},31:{n:"PtgNum",f:u2e},32:{n:"PtgArray",f:Gwe},33:{n:"PtgFunc",f:a2e},34:{n:"PtgFuncVar",f:n2e},35:{n:"PtgName",f:h2e},36:{n:"PtgRef",f:e2e},37:{n:"PtgArea",f:Qwe},38:{n:"PtgMemArea",f:b2e},39:{n:"PtgMemErr",f:N2e},40:{n:"PtgMemNoMem",f:C2e},41:{n:"PtgMemFunc",f:v2e},42:{n:"PtgRefErr",f:y2e},43:{n:"PtgAreaErr",f:zwe},44:{n:"PtgRefN",f:t2e},45:{n:"PtgAreaN",f:Vwe},46:{n:"PtgMemAreaN",f:L2e},47:{n:"PtgMemNoMemN",f:Q2e},57:{n:"PtgNameX",f:m2e},58:{n:"PtgRef3d",f:r2e},59:{n:"PtgArea3d",f:Hwe},60:{n:"PtgRefErr3d",f:w2e},61:{n:"PtgAreaErr3d",f:$we},255:{}},z2e={64:32,96:32,65:33,97:33,66:34,98:34,67:35,99:35,68:36,100:36,69:37,101:37,70:38,102:38,71:39,103:39,72:40,104:40,73:41,105:41,74:42,106:42,75:43,107:43,76:44,108:44,77:45,109:45,78:46,110:46,79:47,111:47,88:34,120:34,89:57,121:57,90:58,122:58,91:59,123:59,92:60,124:60,93:61,125:61},$2e={1:{n:"PtgElfLel",f:rH},2:{n:"PtgElfRw",f:F2e},3:{n:"PtgElfCol",f:j2e},6:{n:"PtgElfRwV",f:D2e},7:{n:"PtgElfColV",f:B2e},10:{n:"PtgElfRadical",f:_2e},11:{n:"PtgElfRadicalS",f:I2e},13:{n:"PtgElfColS",f:E2e},15:{n:"PtgElfColSV",f:S2e},16:{n:"PtgElfRadicalLel",f:T2e},25:{n:"PtgList",f:M2e},29:{n:"PtgSxName",f:R2e},255:{}},V2e={0:{n:"PtgAttrNoop",f:H2e},1:{n:"PtgAttrSemi",f:Xwe},2:{n:"PtgAttrIf",f:Wwe},4:{n:"PtgAttrChoose",f:Kwe},8:{n:"PtgAttrGoto",f:qwe},16:{n:"PtgAttrSum",f:i2e},32:{n:"PtgAttrBaxcel",f:aU},33:{n:"PtgAttrBaxcel",f:aU},64:{n:"PtgAttrSpace",f:Jwe},65:{n:"PtgAttrSpaceSemi",f:Zwe},128:{n:"PtgAttrIfError",f:Ywe},255:{}};function nx(e,t,r,a){if(a.biff<8)return Hn(e,t);for(var s=e.l+t,i=[],l=0;l!==r.length;++l)switch(r[l][0]){case"PtgArray":r[l][1]=x2e(e,0,a),i.push(r[l][1]);break;case"PtgMemArea":r[l][2]=p2e(e,r[l][1],a),i.push(r[l][2]);break;case"PtgExp":a&&a.biff==12&&(r[l][1][1]=e.read_shift(4),i.push(r[l][1]));break;case"PtgList":case"PtgElfRadicalS":case"PtgElfColS":case"PtgElfColSV":throw"Unsupported "+r[l][0]}return t=s-e.l,t!==0&&i.push(Hn(e,t)),i}function sx(e,t,r){for(var a=e.l+t,s,i,l=[];a!=e.l;)t=a-e.l,i=e[e.l],s=nU[i]||nU[z2e[i]],(i===24||i===25)&&(s=(i===24?$2e:V2e)[e[e.l+1]]),!s||!s.f?Hn(e,t):l.push([s.n,s.f(e,t,r)]);return l}function G2e(e){for(var t=[],r=0;r<e.length;++r){for(var a=e[r],s=[],i=0;i<a.length;++i){var l=a[i];if(l)switch(l[0]){case 2:s.push('"'+l[1].replace(/"/g,'""')+'"');break;default:s.push(l[1])}else s.push("")}t.push(s.join(","))}return t.join(";")}var K2e={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function q2e(e,t){if(!e&&!(t&&t.biff<=5&&t.biff>=2))throw new Error("empty sheet name");return/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(e)?"'"+e+"'":e}function aH(e,t,r){if(!e)return"SH33TJSERR0";if(r.biff>8&&(!e.XTI||!e.XTI[t]))return e.SheetNames[t];if(!e.XTI)return"SH33TJSERR6";var a=e.XTI[t];if(r.biff<8)return t>1e4&&(t-=65536),t<0&&(t=-t),t==0?"":e.XTI[t-1];if(!a)return"SH33TJSERR1";var s="";if(r.biff>8)switch(e[a[0]][0]){case 357:return s=a[1]==-1?"#REF":e.SheetNames[a[1]],a[1]==a[2]?s:s+":"+e.SheetNames[a[2]];case 358:return r.SID!=null?e.SheetNames[r.SID]:"SH33TJSSAME"+e[a[0]][0];case 355:default:return"SH33TJSSRC"+e[a[0]][0]}switch(e[a[0]][0][0]){case 1025:return s=a[1]==-1?"#REF":e.SheetNames[a[1]]||"SH33TJSERR3",a[1]==a[2]?s:s+":"+e.SheetNames[a[2]];case 14849:return e[a[0]].slice(1).map(function(i){return i.Name}).join(";;");default:return e[a[0]][0][3]?(s=a[1]==-1?"#REF":e[a[0]][0][3][a[1]]||"SH33TJSERR4",a[1]==a[2]?s:s+":"+e[a[0]][0][3][a[2]]):"SH33TJSERR2"}}function sU(e,t,r){var a=aH(e,t,r);return a=="#REF"?a:q2e(a,r)}function Dn(e,t,r,a,s){var i=s&&s.biff||8,l={s:{c:0,r:0}},o=[],d,u,f,p=0,h=0,m,b="";if(!e[0]||!e[0][0])return"";for(var v=-1,y="",j=0,_=e[0].length;j<_;++j){var N=e[0][j];switch(N[0]){case"PtgUminus":o.push("-"+o.pop());break;case"PtgUplus":o.push("+"+o.pop());break;case"PtgPercent":o.push(o.pop()+"%");break;case"PtgAdd":case"PtgConcat":case"PtgDiv":case"PtgEq":case"PtgGe":case"PtgGt":case"PtgLe":case"PtgLt":case"PtgMul":case"PtgNe":case"PtgPower":case"PtgSub":if(d=o.pop(),u=o.pop(),v>=0){switch(e[0][v][1][0]){case 0:y=oa(" ",e[0][v][1][1]);break;case 1:y=oa("\r",e[0][v][1][1]);break;default:if(y="",s.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][v][1][0])}u=u+y,v=-1}o.push(u+K2e[N[0]]+d);break;case"PtgIsect":d=o.pop(),u=o.pop(),o.push(u+" "+d);break;case"PtgUnion":d=o.pop(),u=o.pop(),o.push(u+","+d);break;case"PtgRange":d=o.pop(),u=o.pop(),o.push(u+":"+d);break;case"PtgAttrChoose":break;case"PtgAttrGoto":break;case"PtgAttrIf":break;case"PtgAttrIfError":break;case"PtgRef":f=Uf(N[1][1],l,s),o.push(Mf(f,i));break;case"PtgRefN":f=r?Uf(N[1][1],r,s):N[1][1],o.push(Mf(f,i));break;case"PtgRef3d":p=N[1][1],f=Uf(N[1][2],l,s),b=sU(a,p,s),o.push(b+"!"+Mf(f,i));break;case"PtgFunc":case"PtgFuncVar":var E=N[1][0],T=N[1][1];E||(E=0),E&=127;var B=E==0?[]:o.slice(-E);o.length-=E,T==="User"&&(T=B.shift()),o.push(T+"("+B.join(",")+")");break;case"PtgBool":o.push(N[1]?"TRUE":"FALSE");break;case"PtgInt":o.push(N[1]);break;case"PtgNum":o.push(String(N[1]));break;case"PtgStr":o.push('"'+N[1].replace(/"/g,'""')+'"');break;case"PtgErr":o.push(N[1]);break;case"PtgAreaN":m=DD(N[1][1],r?{s:r}:l,s),o.push(S2(m,s));break;case"PtgArea":m=DD(N[1][1],l,s),o.push(S2(m,s));break;case"PtgArea3d":p=N[1][1],m=N[1][2],b=sU(a,p,s),o.push(b+"!"+S2(m,s));break;case"PtgAttrSum":o.push("SUM("+o.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":h=N[1][2];var F=(a.names||[])[h-1]||(a[0]||[])[h],R=F?F.Name:"SH33TJSNAME"+String(h);R&&R.slice(0,6)=="_xlfn."&&!s.xlfn&&(R=R.slice(6)),o.push(R);break;case"PtgNameX":var U=N[1][1];h=N[1][2];var D;if(s.biff<=5)U<0&&(U=-U),a[U]&&(D=a[U][h]);else{var L="";if(((a[U]||[])[0]||[])[0]==14849||(((a[U]||[])[0]||[])[0]==1025?a[U][h]&&a[U][h].itab>0&&(L=a.SheetNames[a[U][h].itab-1]+"!"):L=a.SheetNames[h-1]+"!"),a[U]&&a[U][h])L+=a[U][h].Name;else if(a[0]&&a[0][h])L+=a[0][h].Name;else{var P=(aH(a,U,s)||"").split(";;");P[h-1]?L=P[h-1]:L+="SH33TJSERRX"}o.push(L);break}D||(D={Name:"SH33TJSERRY"}),o.push(D.Name);break;case"PtgParen":var G="(",Q=")";if(v>=0){switch(y="",e[0][v][1][0]){case 2:G=oa(" ",e[0][v][1][1])+G;break;case 3:G=oa("\r",e[0][v][1][1])+G;break;case 4:Q=oa(" ",e[0][v][1][1])+Q;break;case 5:Q=oa("\r",e[0][v][1][1])+Q;break;default:if(s.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][v][1][0])}v=-1}o.push(G+o.pop()+Q);break;case"PtgRefErr":o.push("#REF!");break;case"PtgRefErr3d":o.push("#REF!");break;case"PtgExp":f={c:N[1][1],r:N[1][0]};var H={c:r.c,r:r.r};if(a.sharedf[yt(f)]){var X=a.sharedf[yt(f)];o.push(Dn(X,l,H,a,s))}else{var K=!1;for(d=0;d!=a.arrayf.length;++d)if(u=a.arrayf[d],!(f.c<u[0].s.c||f.c>u[0].e.c)&&!(f.r<u[0].s.r||f.r>u[0].e.r)){o.push(Dn(u[1],l,H,a,s)),K=!0;break}K||o.push(N[1])}break;case"PtgArray":o.push("{"+G2e(N[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":v=j;break;case"PtgTbl":break;case"PtgMemErr":break;case"PtgMissArg":o.push("");break;case"PtgAreaErr":o.push("#REF!");break;case"PtgAreaErr3d":o.push("#REF!");break;case"PtgList":o.push("Table"+N[1].idx+"[#"+N[1].rt+"]");break;case"PtgMemAreaN":case"PtgMemNoMemN":case"PtgAttrNoop":case"PtgSheet":case"PtgEndSheet":break;case"PtgMemFunc":break;case"PtgMemNoMem":break;case"PtgElfCol":case"PtgElfColS":case"PtgElfColSV":case"PtgElfColV":case"PtgElfLel":case"PtgElfRadical":case"PtgElfRadicalLel":case"PtgElfRadicalS":case"PtgElfRw":case"PtgElfRwV":throw new Error("Unsupported ELFs");case"PtgSxName":throw new Error("Unrecognized Formula Token: "+String(N));default:throw new Error("Unrecognized Formula Token: "+String(N))}var ee=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(s.biff!=3&&v>=0&&ee.indexOf(e[0][j][0])==-1){N=e[0][v];var W=!0;switch(N[1][0]){case 4:W=!1;case 0:y=oa(" ",N[1][1]);break;case 5:W=!1;case 1:y=oa("\r",N[1][1]);break;default:if(y="",s.WTF)throw new Error("Unexpected PtgAttrSpaceType "+N[1][0])}o.push((W?y:"")+o.pop()+(W?"":y)),v=-1}}if(o.length>1&&s.WTF)throw new Error("bad formula stack");return o[0]}function W2e(e,t,r){var a=e.l+t,s=r.biff==2?1:2,i,l=e.read_shift(s);if(l==65535)return[[],Hn(e,t-2)];var o=sx(e,l,r);return t!==l+s&&(i=nx(e,t-l-s,o,r)),e.l=a,[o,i]}function Y2e(e,t,r){var a=e.l+t,s=r.biff==2?1:2,i,l=e.read_shift(s);if(l==65535)return[[],Hn(e,t-2)];var o=sx(e,l,r);return t!==l+s&&(i=nx(e,t-l-s,o,r)),e.l=a,[o,i]}function X2e(e,t,r,a){var s=e.l+t,i=sx(e,a,r),l;return s!==e.l&&(l=nx(e,s-e.l,i,r)),[i,l]}function J2e(e,t,r){var a=e.l+t,s,i=e.read_shift(2),l=sx(e,i,r);return i==65535?[[],Hn(e,t-2)]:(t!==i+2&&(s=nx(e,a-i-2,l,r)),[l,s])}function Z2e(e){var t;if(lo(e,e.l+6)!==65535)return[On(e),"n"];switch(e[e.l]){case 0:return e.l+=8,["String","s"];case 1:return t=e[e.l+2]===1,e.l+=8,[t,"b"];case 2:return t=e[e.l+2],e.l+=8,[t,"e"];case 3:return e.l+=8,["","s"]}return[]}function eNe(e){if(e==null){var t=Oe(8);return t.write_shift(1,3),t.write_shift(1,0),t.write_shift(2,0),t.write_shift(2,0),t.write_shift(2,65535),t}else if(typeof e=="number")return qd(e);return qd(0)}function F2(e,t,r){var a=e.l+t,s=Il(e);r.biff==2&&++e.l;var i=Z2e(e),l=e.read_shift(1);r.biff!=2&&(e.read_shift(1),r.biff>=5&&e.read_shift(4));var o=Y2e(e,a-e.l,r);return{cell:s,val:i[0],formula:o,shared:l>>3&1,tt:i[1]}}function tNe(e,t,r,a,s){var i=Yd(t,r,s),l=eNe(e.v),o=Oe(6),d=33;o.write_shift(2,d),o.write_shift(4,0);for(var u=Oe(e.bf.length),f=0;f<e.bf.length;++f)u[f]=e.bf[f];var p=en([i,l,o,u]);return p}function pv(e,t,r){var a=e.read_shift(4),s=sx(e,a,r),i=e.read_shift(4),l=i>0?nx(e,i,s,r):null;return[s,l]}var rNe=pv,xv=pv,aNe=pv,nNe=pv,sNe={0:"BEEP",1:"OPEN",2:"OPEN.LINKS",3:"CLOSE.ALL",4:"SAVE",5:"SAVE.AS",6:"FILE.DELETE",7:"PAGE.SETUP",8:"PRINT",9:"PRINTER.SETUP",10:"QUIT",11:"NEW.WINDOW",12:"ARRANGE.ALL",13:"WINDOW.SIZE",14:"WINDOW.MOVE",15:"FULL",16:"CLOSE",17:"RUN",22:"SET.PRINT.AREA",23:"SET.PRINT.TITLES",24:"SET.PAGE.BREAK",25:"REMOVE.PAGE.BREAK",26:"FONT",27:"DISPLAY",28:"PROTECT.DOCUMENT",29:"PRECISION",30:"A1.R1C1",31:"CALCULATE.NOW",32:"CALCULATION",34:"DATA.FIND",35:"EXTRACT",36:"DATA.DELETE",37:"SET.DATABASE",38:"SET.CRITERIA",39:"SORT",40:"DATA.SERIES",41:"TABLE",42:"FORMAT.NUMBER",43:"ALIGNMENT",44:"STYLE",45:"BORDER",46:"CELL.PROTECTION",47:"COLUMN.WIDTH",48:"UNDO",49:"CUT",50:"COPY",51:"PASTE",52:"CLEAR",53:"PASTE.SPECIAL",54:"EDIT.DELETE",55:"INSERT",56:"FILL.RIGHT",57:"FILL.DOWN",61:"DEFINE.NAME",62:"CREATE.NAMES",63:"FORMULA.GOTO",64:"FORMULA.FIND",65:"SELECT.LAST.CELL",66:"SHOW.ACTIVE.CELL",67:"GALLERY.AREA",68:"GALLERY.BAR",69:"GALLERY.COLUMN",70:"GALLERY.LINE",71:"GALLERY.PIE",72:"GALLERY.SCATTER",73:"COMBINATION",74:"PREFERRED",75:"ADD.OVERLAY",76:"GRIDLINES",77:"SET.PREFERRED",78:"AXES",79:"LEGEND",80:"ATTACH.TEXT",81:"ADD.ARROW",82:"SELECT.CHART",83:"SELECT.PLOT.AREA",84:"PATTERNS",85:"MAIN.CHART",86:"OVERLAY",87:"SCALE",88:"FORMAT.LEGEND",89:"FORMAT.TEXT",90:"EDIT.REPEAT",91:"PARSE",92:"JUSTIFY",93:"HIDE",94:"UNHIDE",95:"WORKSPACE",96:"FORMULA",97:"FORMULA.FILL",98:"FORMULA.ARRAY",99:"DATA.FIND.NEXT",100:"DATA.FIND.PREV",101:"FORMULA.FIND.NEXT",102:"FORMULA.FIND.PREV",103:"ACTIVATE",104:"ACTIVATE.NEXT",105:"ACTIVATE.PREV",106:"UNLOCKED.NEXT",107:"UNLOCKED.PREV",108:"COPY.PICTURE",109:"SELECT",110:"DELETE.NAME",111:"DELETE.FORMAT",112:"VLINE",113:"HLINE",114:"VPAGE",115:"HPAGE",116:"VSCROLL",117:"HSCROLL",118:"ALERT",119:"NEW",120:"CANCEL.COPY",121:"SHOW.CLIPBOARD",122:"MESSAGE",124:"PASTE.LINK",125:"APP.ACTIVATE",126:"DELETE.ARROW",127:"ROW.HEIGHT",128:"FORMAT.MOVE",129:"FORMAT.SIZE",130:"FORMULA.REPLACE",131:"SEND.KEYS",132:"SELECT.SPECIAL",133:"APPLY.NAMES",134:"REPLACE.FONT",135:"FREEZE.PANES",136:"SHOW.INFO",137:"SPLIT",138:"ON.WINDOW",139:"ON.DATA",140:"DISABLE.INPUT",142:"OUTLINE",143:"LIST.NAMES",144:"FILE.CLOSE",145:"SAVE.WORKBOOK",146:"DATA.FORM",147:"COPY.CHART",148:"ON.TIME",149:"WAIT",150:"FORMAT.FONT",151:"FILL.UP",152:"FILL.LEFT",153:"DELETE.OVERLAY",155:"SHORT.MENUS",159:"SET.UPDATE.STATUS",161:"COLOR.PALETTE",162:"DELETE.STYLE",163:"WINDOW.RESTORE",164:"WINDOW.MAXIMIZE",166:"CHANGE.LINK",167:"CALCULATE.DOCUMENT",168:"ON.KEY",169:"APP.RESTORE",170:"APP.MOVE",171:"APP.SIZE",172:"APP.MINIMIZE",173:"APP.MAXIMIZE",174:"BRING.TO.FRONT",175:"SEND.TO.BACK",185:"MAIN.CHART.TYPE",186:"OVERLAY.CHART.TYPE",187:"SELECT.END",188:"OPEN.MAIL",189:"SEND.MAIL",190:"STANDARD.FONT",191:"CONSOLIDATE",192:"SORT.SPECIAL",193:"GALLERY.3D.AREA",194:"GALLERY.3D.COLUMN",195:"GALLERY.3D.LINE",196:"GALLERY.3D.PIE",197:"VIEW.3D",198:"GOAL.SEEK",199:"WORKGROUP",200:"FILL.GROUP",201:"UPDATE.LINK",202:"PROMOTE",203:"DEMOTE",204:"SHOW.DETAIL",206:"UNGROUP",207:"OBJECT.PROPERTIES",208:"SAVE.NEW.OBJECT",209:"SHARE",210:"SHARE.NAME",211:"DUPLICATE",212:"APPLY.STYLE",213:"ASSIGN.TO.OBJECT",214:"OBJECT.PROTECTION",215:"HIDE.OBJECT",216:"SET.EXTRACT",217:"CREATE.PUBLISHER",218:"SUBSCRIBE.TO",219:"ATTRIBUTES",220:"SHOW.TOOLBAR",222:"PRINT.PREVIEW",223:"EDIT.COLOR",224:"SHOW.LEVELS",225:"FORMAT.MAIN",226:"FORMAT.OVERLAY",227:"ON.RECALC",228:"EDIT.SERIES",229:"DEFINE.STYLE",240:"LINE.PRINT",243:"ENTER.DATA",249:"GALLERY.RADAR",250:"MERGE.STYLES",251:"EDITION.OPTIONS",252:"PASTE.PICTURE",253:"PASTE.PICTURE.LINK",254:"SPELLING",256:"ZOOM",259:"INSERT.OBJECT",260:"WINDOW.MINIMIZE",265:"SOUND.NOTE",266:"SOUND.PLAY",267:"FORMAT.SHAPE",268:"EXTEND.POLYGON",269:"FORMAT.AUTO",272:"GALLERY.3D.BAR",273:"GALLERY.3D.SURFACE",274:"FILL.AUTO",276:"CUSTOMIZE.TOOLBAR",277:"ADD.TOOL",278:"EDIT.OBJECT",279:"ON.DOUBLECLICK",280:"ON.ENTRY",281:"WORKBOOK.ADD",282:"WORKBOOK.MOVE",283:"WORKBOOK.COPY",284:"WORKBOOK.OPTIONS",285:"SAVE.WORKSPACE",288:"CHART.WIZARD",289:"DELETE.TOOL",290:"MOVE.TOOL",291:"WORKBOOK.SELECT",292:"WORKBOOK.ACTIVATE",293:"ASSIGN.TO.TOOL",295:"COPY.TOOL",296:"RESET.TOOL",297:"CONSTRAIN.NUMERIC",298:"PASTE.TOOL",302:"WORKBOOK.NEW",305:"SCENARIO.CELLS",306:"SCENARIO.DELETE",307:"SCENARIO.ADD",308:"SCENARIO.EDIT",309:"SCENARIO.SHOW",310:"SCENARIO.SHOW.NEXT",311:"SCENARIO.SUMMARY",312:"PIVOT.TABLE.WIZARD",313:"PIVOT.FIELD.PROPERTIES",314:"PIVOT.FIELD",315:"PIVOT.ITEM",316:"PIVOT.ADD.FIELDS",318:"OPTIONS.CALCULATION",319:"OPTIONS.EDIT",320:"OPTIONS.VIEW",321:"ADDIN.MANAGER",322:"MENU.EDITOR",323:"ATTACH.TOOLBARS",324:"VBAActivate",325:"OPTIONS.CHART",328:"VBA.INSERT.FILE",330:"VBA.PROCEDURE.DEFINITION",336:"ROUTING.SLIP",338:"ROUTE.DOCUMENT",339:"MAIL.LOGON",342:"INSERT.PICTURE",343:"EDIT.TOOL",344:"GALLERY.DOUGHNUT",350:"CHART.TREND",352:"PIVOT.ITEM.PROPERTIES",354:"WORKBOOK.INSERT",355:"OPTIONS.TRANSITION",356:"OPTIONS.GENERAL",370:"FILTER.ADVANCED",373:"MAIL.ADD.MAILER",374:"MAIL.DELETE.MAILER",375:"MAIL.REPLY",376:"MAIL.REPLY.ALL",377:"MAIL.FORWARD",378:"MAIL.NEXT.LETTER",379:"DATA.LABEL",380:"INSERT.TITLE",381:"FONT.PROPERTIES",382:"MACRO.OPTIONS",383:"WORKBOOK.HIDE",384:"WORKBOOK.UNHIDE",385:"WORKBOOK.DELETE",386:"WORKBOOK.NAME",388:"GALLERY.CUSTOM",390:"ADD.CHART.AUTOFORMAT",391:"DELETE.CHART.AUTOFORMAT",392:"CHART.ADD.DATA",393:"AUTO.OUTLINE",394:"TAB.ORDER",395:"SHOW.DIALOG",396:"SELECT.ALL",397:"UNGROUP.SHEETS",398:"SUBTOTAL.CREATE",399:"SUBTOTAL.REMOVE",400:"RENAME.OBJECT",412:"WORKBOOK.SCROLL",413:"WORKBOOK.NEXT",414:"WORKBOOK.PREV",415:"WORKBOOK.TAB.SPLIT",416:"FULL.SCREEN",417:"WORKBOOK.PROTECT",420:"SCROLLBAR.PROPERTIES",421:"PIVOT.SHOW.PAGES",422:"TEXT.TO.COLUMNS",423:"FORMAT.CHARTTYPE",424:"LINK.FORMAT",425:"TRACER.DISPLAY",430:"TRACER.NAVIGATE",431:"TRACER.CLEAR",432:"TRACER.ERROR",433:"PIVOT.FIELD.GROUP",434:"PIVOT.FIELD.UNGROUP",435:"CHECKBOX.PROPERTIES",436:"LABEL.PROPERTIES",437:"LISTBOX.PROPERTIES",438:"EDITBOX.PROPERTIES",439:"PIVOT.REFRESH",440:"LINK.COMBO",441:"OPEN.TEXT",442:"HIDE.DIALOG",443:"SET.DIALOG.FOCUS",444:"ENABLE.OBJECT",445:"PUSHBUTTON.PROPERTIES",446:"SET.DIALOG.DEFAULT",447:"FILTER",448:"FILTER.SHOW.ALL",449:"CLEAR.OUTLINE",450:"FUNCTION.WIZARD",451:"ADD.LIST.ITEM",452:"SET.LIST.ITEM",453:"REMOVE.LIST.ITEM",454:"SELECT.LIST.ITEM",455:"SET.CONTROL.VALUE",456:"SAVE.COPY.AS",458:"OPTIONS.LISTS.ADD",459:"OPTIONS.LISTS.DELETE",460:"SERIES.AXES",461:"SERIES.X",462:"SERIES.Y",463:"ERRORBAR.X",464:"ERRORBAR.Y",465:"FORMAT.CHART",466:"SERIES.ORDER",467:"MAIL.LOGOFF",468:"CLEAR.ROUTING.SLIP",469:"APP.ACTIVATE.MICROSOFT",470:"MAIL.EDIT.MAILER",471:"ON.SHEET",472:"STANDARD.WIDTH",473:"SCENARIO.MERGE",474:"SUMMARY.INFO",475:"FIND.FILE",476:"ACTIVE.CELL.FONT",477:"ENABLE.TIPWIZARD",478:"VBA.MAKE.ADDIN",480:"INSERTDATATABLE",481:"WORKGROUP.OPTIONS",482:"MAIL.SEND.MAILER",485:"AUTOCORRECT",489:"POST.DOCUMENT",491:"PICKLIST",493:"VIEW.SHOW",494:"VIEW.DEFINE",495:"VIEW.DELETE",509:"SHEET.BACKGROUND",510:"INSERT.MAP.OBJECT",511:"OPTIONS.MENONO",517:"MSOCHECKS",518:"NORMAL",519:"LAYOUT",520:"RM.PRINT.AREA",521:"CLEAR.PRINT.AREA",522:"ADD.PRINT.AREA",523:"MOVE.BRK",545:"HIDECURR.NOTE",546:"HIDEALL.NOTES",547:"DELETE.NOTE",548:"TRAVERSE.NOTES",549:"ACTIVATE.NOTES",620:"PROTECT.REVISIONS",621:"UNPROTECT.REVISIONS",647:"OPTIONS.ME",653:"WEB.PUBLISH",667:"NEWWEBQUERY",673:"PIVOT.TABLE.CHART",753:"OPTIONS.SAVE",755:"OPTIONS.SPELL",808:"HIDEALL.INKANNOTS"},nH={0:"COUNT",1:"IF",2:"ISNA",3:"ISERROR",4:"SUM",5:"AVERAGE",6:"MIN",7:"MAX",8:"ROW",9:"COLUMN",10:"NA",11:"NPV",12:"STDEV",13:"DOLLAR",14:"FIXED",15:"SIN",16:"COS",17:"TAN",18:"ATAN",19:"PI",20:"SQRT",21:"EXP",22:"LN",23:"LOG10",24:"ABS",25:"INT",26:"SIGN",27:"ROUND",28:"LOOKUP",29:"INDEX",30:"REPT",31:"MID",32:"LEN",33:"VALUE",34:"TRUE",35:"FALSE",36:"AND",37:"OR",38:"NOT",39:"MOD",40:"DCOUNT",41:"DSUM",42:"DAVERAGE",43:"DMIN",44:"DMAX",45:"DSTDEV",46:"VAR",47:"DVAR",48:"TEXT",49:"LINEST",50:"TREND",51:"LOGEST",52:"GROWTH",53:"GOTO",54:"HALT",55:"RETURN",56:"PV",57:"FV",58:"NPER",59:"PMT",60:"RATE",61:"MIRR",62:"IRR",63:"RAND",64:"MATCH",65:"DATE",66:"TIME",67:"DAY",68:"MONTH",69:"YEAR",70:"WEEKDAY",71:"HOUR",72:"MINUTE",73:"SECOND",74:"NOW",75:"AREAS",76:"ROWS",77:"COLUMNS",78:"OFFSET",79:"ABSREF",80:"RELREF",81:"ARGUMENT",82:"SEARCH",83:"TRANSPOSE",84:"ERROR",85:"STEP",86:"TYPE",87:"ECHO",88:"SET.NAME",89:"CALLER",90:"DEREF",91:"WINDOWS",92:"SERIES",93:"DOCUMENTS",94:"ACTIVE.CELL",95:"SELECTION",96:"RESULT",97:"ATAN2",98:"ASIN",99:"ACOS",100:"CHOOSE",101:"HLOOKUP",102:"VLOOKUP",103:"LINKS",104:"INPUT",105:"ISREF",106:"GET.FORMULA",107:"GET.NAME",108:"SET.VALUE",109:"LOG",110:"EXEC",111:"CHAR",112:"LOWER",113:"UPPER",114:"PROPER",115:"LEFT",116:"RIGHT",117:"EXACT",118:"TRIM",119:"REPLACE",120:"SUBSTITUTE",121:"CODE",122:"NAMES",123:"DIRECTORY",124:"FIND",125:"CELL",126:"ISERR",127:"ISTEXT",128:"ISNUMBER",129:"ISBLANK",130:"T",131:"N",132:"FOPEN",133:"FCLOSE",134:"FSIZE",135:"FREADLN",136:"FREAD",137:"FWRITELN",138:"FWRITE",139:"FPOS",140:"DATEVALUE",141:"TIMEVALUE",142:"SLN",143:"SYD",144:"DDB",145:"GET.DEF",146:"REFTEXT",147:"TEXTREF",148:"INDIRECT",149:"REGISTER",150:"CALL",151:"ADD.BAR",152:"ADD.MENU",153:"ADD.COMMAND",154:"ENABLE.COMMAND",155:"CHECK.COMMAND",156:"RENAME.COMMAND",157:"SHOW.BAR",158:"DELETE.MENU",159:"DELETE.COMMAND",160:"GET.CHART.ITEM",161:"DIALOG.BOX",162:"CLEAN",163:"MDETERM",164:"MINVERSE",165:"MMULT",166:"FILES",167:"IPMT",168:"PPMT",169:"COUNTA",170:"CANCEL.KEY",171:"FOR",172:"WHILE",173:"BREAK",174:"NEXT",175:"INITIATE",176:"REQUEST",177:"POKE",178:"EXECUTE",179:"TERMINATE",180:"RESTART",181:"HELP",182:"GET.BAR",183:"PRODUCT",184:"FACT",185:"GET.CELL",186:"GET.WORKSPACE",187:"GET.WINDOW",188:"GET.DOCUMENT",189:"DPRODUCT",190:"ISNONTEXT",191:"GET.NOTE",192:"NOTE",193:"STDEVP",194:"VARP",195:"DSTDEVP",196:"DVARP",197:"TRUNC",198:"ISLOGICAL",199:"DCOUNTA",200:"DELETE.BAR",201:"UNREGISTER",204:"USDOLLAR",205:"FINDB",206:"SEARCHB",207:"REPLACEB",208:"LEFTB",209:"RIGHTB",210:"MIDB",211:"LENB",212:"ROUNDUP",213:"ROUNDDOWN",214:"ASC",215:"DBCS",216:"RANK",219:"ADDRESS",220:"DAYS360",221:"TODAY",222:"VDB",223:"ELSE",224:"ELSE.IF",225:"END.IF",226:"FOR.CELL",227:"MEDIAN",228:"SUMPRODUCT",229:"SINH",230:"COSH",231:"TANH",232:"ASINH",233:"ACOSH",234:"ATANH",235:"DGET",236:"CREATE.OBJECT",237:"VOLATILE",238:"LAST.ERROR",239:"CUSTOM.UNDO",240:"CUSTOM.REPEAT",241:"FORMULA.CONVERT",242:"GET.LINK.INFO",243:"TEXT.BOX",244:"INFO",245:"GROUP",246:"GET.OBJECT",247:"DB",248:"PAUSE",251:"RESUME",252:"FREQUENCY",253:"ADD.TOOLBAR",254:"DELETE.TOOLBAR",255:"User",256:"RESET.TOOLBAR",257:"EVALUATE",258:"GET.TOOLBAR",259:"GET.TOOL",260:"SPELLING.CHECK",261:"ERROR.TYPE",262:"APP.TITLE",263:"WINDOW.TITLE",264:"SAVE.TOOLBAR",265:"ENABLE.TOOL",266:"PRESS.TOOL",267:"REGISTER.ID",268:"GET.WORKBOOK",269:"AVEDEV",270:"BETADIST",271:"GAMMALN",272:"BETAINV",273:"BINOMDIST",274:"CHIDIST",275:"CHIINV",276:"COMBIN",277:"CONFIDENCE",278:"CRITBINOM",279:"EVEN",280:"EXPONDIST",281:"FDIST",282:"FINV",283:"FISHER",284:"FISHERINV",285:"FLOOR",286:"GAMMADIST",287:"GAMMAINV",288:"CEILING",289:"HYPGEOMDIST",290:"LOGNORMDIST",291:"LOGINV",292:"NEGBINOMDIST",293:"NORMDIST",294:"NORMSDIST",295:"NORMINV",296:"NORMSINV",297:"STANDARDIZE",298:"ODD",299:"PERMUT",300:"POISSON",301:"TDIST",302:"WEIBULL",303:"SUMXMY2",304:"SUMX2MY2",305:"SUMX2PY2",306:"CHITEST",307:"CORREL",308:"COVAR",309:"FORECAST",310:"FTEST",311:"INTERCEPT",312:"PEARSON",313:"RSQ",314:"STEYX",315:"SLOPE",316:"TTEST",317:"PROB",318:"DEVSQ",319:"GEOMEAN",320:"HARMEAN",321:"SUMSQ",322:"KURT",323:"SKEW",324:"ZTEST",325:"LARGE",326:"SMALL",327:"QUARTILE",328:"PERCENTILE",329:"PERCENTRANK",330:"MODE",331:"TRIMMEAN",332:"TINV",334:"MOVIE.COMMAND",335:"GET.MOVIE",336:"CONCATENATE",337:"POWER",338:"PIVOT.ADD.DATA",339:"GET.PIVOT.TABLE",340:"GET.PIVOT.FIELD",341:"GET.PIVOT.ITEM",342:"RADIANS",343:"DEGREES",344:"SUBTOTAL",345:"SUMIF",346:"COUNTIF",347:"COUNTBLANK",348:"SCENARIO.GET",349:"OPTIONS.LISTS.GET",350:"ISPMT",351:"DATEDIF",352:"DATESTRING",353:"NUMBERSTRING",354:"ROMAN",355:"OPEN.DIALOG",356:"SAVE.DIALOG",357:"VIEW.GET",358:"GETPIVOTDATA",359:"HYPERLINK",360:"PHONETIC",361:"AVERAGEA",362:"MAXA",363:"MINA",364:"STDEVPA",365:"VARPA",366:"STDEVA",367:"VARA",368:"BAHTTEXT",369:"THAIDAYOFWEEK",370:"THAIDIGIT",371:"THAIMONTHOFYEAR",372:"THAINUMSOUND",373:"THAINUMSTRING",374:"THAISTRINGLENGTH",375:"ISTHAIDIGIT",376:"ROUNDBAHTDOWN",377:"ROUNDBAHTUP",378:"THAIYEAR",379:"RTD",380:"CUBEVALUE",381:"CUBEMEMBER",382:"CUBEMEMBERPROPERTY",383:"CUBERANKEDMEMBER",384:"HEX2BIN",385:"HEX2DEC",386:"HEX2OCT",387:"DEC2BIN",388:"DEC2HEX",389:"DEC2OCT",390:"OCT2BIN",391:"OCT2HEX",392:"OCT2DEC",393:"BIN2DEC",394:"BIN2OCT",395:"BIN2HEX",396:"IMSUB",397:"IMDIV",398:"IMPOWER",399:"IMABS",400:"IMSQRT",401:"IMLN",402:"IMLOG2",403:"IMLOG10",404:"IMSIN",405:"IMCOS",406:"IMEXP",407:"IMARGUMENT",408:"IMCONJUGATE",409:"IMAGINARY",410:"IMREAL",411:"COMPLEX",412:"IMSUM",413:"IMPRODUCT",414:"SERIESSUM",415:"FACTDOUBLE",416:"SQRTPI",417:"QUOTIENT",418:"DELTA",419:"GESTEP",420:"ISEVEN",421:"ISODD",422:"MROUND",423:"ERF",424:"ERFC",425:"BESSELJ",426:"BESSELK",427:"BESSELY",428:"BESSELI",429:"XIRR",430:"XNPV",431:"PRICEMAT",432:"YIELDMAT",433:"INTRATE",434:"RECEIVED",435:"DISC",436:"PRICEDISC",437:"YIELDDISC",438:"TBILLEQ",439:"TBILLPRICE",440:"TBILLYIELD",441:"PRICE",442:"YIELD",443:"DOLLARDE",444:"DOLLARFR",445:"NOMINAL",446:"EFFECT",447:"CUMPRINC",448:"CUMIPMT",449:"EDATE",450:"EOMONTH",451:"YEARFRAC",452:"COUPDAYBS",453:"COUPDAYS",454:"COUPDAYSNC",455:"COUPNCD",456:"COUPNUM",457:"COUPPCD",458:"DURATION",459:"MDURATION",460:"ODDLPRICE",461:"ODDLYIELD",462:"ODDFPRICE",463:"ODDFYIELD",464:"RANDBETWEEN",465:"WEEKNUM",466:"AMORDEGRC",467:"AMORLINC",468:"CONVERT",724:"SHEETJS",469:"ACCRINT",470:"ACCRINTM",471:"WORKDAY",472:"NETWORKDAYS",473:"GCD",474:"MULTINOMIAL",475:"LCM",476:"FVSCHEDULE",477:"CUBEKPIMEMBER",478:"CUBESET",479:"CUBESETCOUNT",480:"IFERROR",481:"COUNTIFS",482:"SUMIFS",483:"AVERAGEIF",484:"AVERAGEIFS"},iNe={2:1,3:1,10:0,15:1,16:1,17:1,18:1,19:0,20:1,21:1,22:1,23:1,24:1,25:1,26:1,27:2,30:2,31:3,32:1,33:1,34:0,35:0,38:1,39:2,40:3,41:3,42:3,43:3,44:3,45:3,47:3,48:2,53:1,61:3,63:0,65:3,66:3,67:1,68:1,69:1,70:1,71:1,72:1,73:1,74:0,75:1,76:1,77:1,79:2,80:2,83:1,85:0,86:1,89:0,90:1,94:0,95:0,97:2,98:1,99:1,101:3,102:3,105:1,106:1,108:2,111:1,112:1,113:1,114:1,117:2,118:1,119:4,121:1,126:1,127:1,128:1,129:1,130:1,131:1,133:1,134:1,135:1,136:2,137:2,138:2,140:1,141:1,142:3,143:4,144:4,161:1,162:1,163:1,164:1,165:2,172:1,175:2,176:2,177:3,178:2,179:1,184:1,186:1,189:3,190:1,195:3,196:3,197:1,198:1,199:3,201:1,207:4,210:3,211:1,212:2,213:2,214:1,215:1,225:0,229:1,230:1,231:1,232:1,233:1,234:1,235:3,244:1,247:4,252:2,257:1,261:1,271:1,273:4,274:2,275:2,276:2,277:3,278:3,279:1,280:3,281:3,282:3,283:1,284:1,285:2,286:4,287:3,288:2,289:4,290:3,291:3,292:3,293:4,294:1,295:3,296:1,297:3,298:1,299:2,300:3,301:3,302:4,303:2,304:2,305:2,306:2,307:2,308:2,309:3,310:2,311:2,312:2,313:2,314:2,315:2,316:4,325:2,326:2,327:2,328:2,331:2,332:2,337:2,342:1,343:1,346:2,347:1,350:4,351:3,352:1,353:2,360:1,368:1,369:1,370:1,371:1,372:1,373:1,374:1,375:1,376:1,377:1,378:1,382:3,385:1,392:1,393:1,396:2,397:2,398:2,399:1,400:1,401:1,402:1,403:1,404:1,405:1,406:1,407:1,408:1,409:1,410:1,414:4,415:1,416:1,417:2,420:1,421:1,422:2,424:1,425:2,426:2,427:2,428:2,430:3,438:3,439:3,440:3,443:2,444:2,445:2,446:2,447:6,448:6,449:2,450:2,464:2,468:3,476:2,479:1,480:2,65535:0};function iU(e){return e.slice(0,3)=="of:"&&(e=e.slice(3)),e.charCodeAt(0)==61&&(e=e.slice(1),e.charCodeAt(0)==61&&(e=e.slice(1))),e=e.replace(/COM\.MICROSOFT\./g,""),e=e.replace(/\[((?:\.[A-Z]+[0-9]+)(?::\.[A-Z]+[0-9]+)?)\]/g,function(t,r){return r.replace(/\./g,"")}),e=e.replace(/\[.(#[A-Z]*[?!])\]/g,"$1"),e.replace(/[;~]/g,",").replace(/\|/g,";")}function lNe(e){var t="of:="+e.replace(_E,"$1[.$2$3$4$5]").replace(/\]:\[/g,":");return t.replace(/;/g,"|").replace(/,/g,";")}function D2(e){var t=e.split(":"),r=t[0].split(".")[0];return[r,t[0].split(".")[1]+(t.length>1?":"+(t[1].split(".")[1]||t[1].split(".")[0]):"")]}function oNe(e){return e.replace(/\./,"!")}var Of={},CA={},Pf=typeof Map<"u";function FE(e,t,r){var a=0,s=e.length;if(r){if(Pf?r.has(t):Object.prototype.hasOwnProperty.call(r,t)){for(var i=Pf?r.get(t):r[t];a<i.length;++a)if(e[i[a]].t===t)return e.Count++,i[a]}}else for(;a<s;++a)if(e[a].t===t)return e.Count++,a;return e[s]={t},e.Count++,e.Unique++,r&&(Pf?(r.has(t)||r.set(t,[]),r.get(t).push(s)):(Object.prototype.hasOwnProperty.call(r,t)||(r[t]=[]),r[t].push(s))),s}function hv(e,t){var r={min:e+1,max:e+1},a=-1;return t.MDW&&(Rn=t.MDW),t.width!=null?r.customWidth=1:t.wpx!=null?a=Cp(t.wpx):t.wch!=null&&(a=t.wch),a>-1?(r.width=Jg(a),r.customWidth=1):t.width!=null&&(r.width=t.width),t.hidden&&(r.hidden=!0),t.level!=null&&(r.outlineLevel=r.level=t.level),r}function Dd(e,t){if(e){var r=[.7,.7,.75,.75,.3,.3];t=="xlml"&&(r=[1,1,1,1,.5,.5]),e.left==null&&(e.left=r[0]),e.right==null&&(e.right=r[1]),e.top==null&&(e.top=r[2]),e.bottom==null&&(e.bottom=r[3]),e.header==null&&(e.header=r[4]),e.footer==null&&(e.footer=r[5])}}function qc(e,t,r){var a=r.revssf[t.z!=null?t.z:"General"],s=60,i=e.length;if(a==null&&r.ssf){for(;s<392;++s)if(r.ssf[s]==null){Ao(t.z,s),r.ssf[s]=t.z,r.revssf[t.z]=a=s;break}}for(s=0;s!=i;++s)if(e[s].numFmtId===a)return s;return e[i]={numFmtId:a,fontId:0,fillId:0,borderId:0,xfId:0,applyNumberFormat:1},i}function sH(e,t,r,a,s,i){try{a.cellNF&&(e.z=vt[t])}catch(o){if(a.WTF)throw o}if(!(e.t==="z"&&!a.cellStyles)){if(e.t==="d"&&typeof e.v=="string"&&(e.v=Or(e.v)),(!a||a.cellText!==!1)&&e.t!=="z")try{if(vt[t]==null&&Ao(sge[t]||"General",t),e.t==="e")e.w=e.w||Po[e.v];else if(t===0)if(e.t==="n")(e.v|0)===e.v?e.w=e.v.toString(10):e.w=mp(e.v);else if(e.t==="d"){var l=$a(e.v);(l|0)===l?e.w=l.toString(10):e.w=mp(l)}else{if(e.v===void 0)return"";e.w=Gd(e.v,CA)}else e.t==="d"?e.w=ji(t,$a(e.v),CA):e.w=ji(t,e.v,CA)}catch(o){if(a.WTF)throw o}if(a.cellStyles&&r!=null)try{e.s=i.Fills[r],e.s.fgColor&&e.s.fgColor.theme&&!e.s.fgColor.rgb&&(e.s.fgColor.rgb=Xg(s.themeElements.clrScheme[e.s.fgColor.theme].rgb,e.s.fgColor.tint||0),a.WTF&&(e.s.fgColor.raw_rgb=s.themeElements.clrScheme[e.s.fgColor.theme].rgb)),e.s.bgColor&&e.s.bgColor.theme&&(e.s.bgColor.rgb=Xg(s.themeElements.clrScheme[e.s.bgColor.theme].rgb,e.s.bgColor.tint||0),a.WTF&&(e.s.bgColor.raw_rgb=s.themeElements.clrScheme[e.s.bgColor.theme].rgb))}catch(o){if(a.WTF&&i.Fills)throw o}}}function cNe(e,t,r){if(e&&e["!ref"]){var a=Yt(e["!ref"]);if(a.e.c<a.s.c||a.e.r<a.s.r)throw new Error("Bad range ("+r+"): "+e["!ref"])}}function dNe(e,t){var r=Yt(t);r.s.r<=r.e.r&&r.s.c<=r.e.c&&r.s.r>=0&&r.s.c>=0&&(e["!ref"]=Tt(r))}var uNe=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g,ANe=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/,fNe=/<(?:\w:)?hyperlink [^>]*>/mg,pNe=/"(\w*:\w*)"/,xNe=/<(?:\w:)?col\b[^>]*[\/]?>/g,hNe=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g,mNe=/<(?:\w:)?pageMargins[^>]*\/>/g,iH=/<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/,gNe=/<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/,bNe=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function vNe(e,t,r,a,s,i,l){if(!e)return e;a||(a={"!id":{}});var o=t.dense?[]:{},d={s:{r:2e6,c:2e6},e:{r:0,c:0}},u="",f="",p=e.match(ANe);p?(u=e.slice(0,p.index),f=e.slice(p.index+p[0].length)):u=f=e;var h=u.match(iH);h?DE(h[0],o,s,r):(h=u.match(gNe))&&wNe(h[0],h[1]||"",o,s,r);var m=(u.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(m>0){var b=u.slice(m,m+50).match(pNe);b&&dNe(o,b[1])}var v=u.match(bNe);v&&v[1]&&UNe(v[1],s);var y=[];if(t.cellStyles){var j=u.match(xNe);j&&_Ne(y,j)}p&&ONe(p[1],o,t,d,i,l);var _=f.match(hNe);_&&(o["!autofilter"]=INe(_[0]));var N=[],E=f.match(uNe);if(E)for(m=0;m!=E.length;++m)N[m]=Yt(E[m].slice(E[m].indexOf('"')+1));var T=f.match(fNe);T&&ENe(o,T,a);var B=f.match(mNe);if(B&&(o["!margins"]=SNe(Nt(B[0]))),!o["!ref"]&&d.e.c>=d.s.c&&d.e.r>=d.s.r&&(o["!ref"]=Tt(d)),t.sheetRows>0&&o["!ref"]){var F=Yt(o["!ref"]);t.sheetRows<=+F.e.r&&(F.e.r=t.sheetRows-1,F.e.r>d.e.r&&(F.e.r=d.e.r),F.e.r<F.s.r&&(F.s.r=F.e.r),F.e.c>d.e.c&&(F.e.c=d.e.c),F.e.c<F.s.c&&(F.s.c=F.e.c),o["!fullref"]=o["!ref"],o["!ref"]=Tt(F))}return y.length>0&&(o["!cols"]=y),N.length>0&&(o["!merges"]=N),o}function yNe(e){if(e.length===0)return"";for(var t='<mergeCells count="'+e.length+'">',r=0;r!=e.length;++r)t+='<mergeCell ref="'+Tt(e[r])+'"/>';return t+"</mergeCells>"}function DE(e,t,r,a){var s=Nt(e);r.Sheets[a]||(r.Sheets[a]={}),s.codeName&&(r.Sheets[a].CodeName=Wt(gr(s.codeName)))}function wNe(e,t,r,a,s){DE(e.slice(0,e.indexOf(">")),r,a,s)}function NNe(e,t,r,a,s){var i=!1,l={},o=null;if(a.bookType!=="xlsx"&&t.vbaraw){var d=t.SheetNames[r];try{t.Workbook&&(d=t.Workbook.Sheets[r].CodeName||d)}catch{}i=!0,l.codeName=ml(ur(d))}if(e&&e["!outline"]){var u={summaryBelow:1,summaryRight:1};e["!outline"].above&&(u.summaryBelow=0),e["!outline"].left&&(u.summaryRight=0),o=(o||"")+We("outlinePr",null,u)}!i&&!o||(s[s.length]=We("sheetPr",o,l))}var CNe=["objects","scenarios","selectLockedCells","selectUnlockedCells"],kNe=["formatColumns","formatRows","formatCells","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","autoFilter","pivotTables"];function jNe(e){var t={sheet:1};return CNe.forEach(function(r){e[r]!=null&&e[r]&&(t[r]="1")}),kNe.forEach(function(r){e[r]!=null&&!e[r]&&(t[r]="0")}),e.password&&(t.password=EE(e.password).toString(16).toUpperCase()),We("sheetProtection",null,t)}function ENe(e,t,r){for(var a=Array.isArray(e),s=0;s!=t.length;++s){var i=Nt(gr(t[s]),!0);if(!i.ref)return;var l=((r||{})["!id"]||[])[i.id];l?(i.Target=l.Target,i.location&&(i.Target+="#"+Wt(i.location))):(i.Target="#"+Wt(i.location),l={Target:i.Target,TargetMode:"Internal"}),i.Rel=l,i.tooltip&&(i.Tooltip=i.tooltip,delete i.tooltip);for(var o=Yt(i.ref),d=o.s.r;d<=o.e.r;++d)for(var u=o.s.c;u<=o.e.c;++u){var f=yt({c:u,r:d});a?(e[d]||(e[d]=[]),e[d][u]||(e[d][u]={t:"z",v:void 0}),e[d][u].l=i):(e[f]||(e[f]={t:"z",v:void 0}),e[f].l=i)}}}function SNe(e){var t={};return["left","right","top","bottom","header","footer"].forEach(function(r){e[r]&&(t[r]=parseFloat(e[r]))}),t}function BNe(e){return Dd(e),We("pageMargins",null,e)}function _Ne(e,t){for(var r=!1,a=0;a!=t.length;++a){var s=Nt(t[a],!0);s.hidden&&(s.hidden=Mr(s.hidden));var i=parseInt(s.min,10)-1,l=parseInt(s.max,10)-1;for(s.outlineLevel&&(s.level=+s.outlineLevel||0),delete s.min,delete s.max,s.width=+s.width,!r&&s.width&&(r=!0,SE(s.width)),Uc(s);i<=l;)e[i++]=Pr(s)}}function TNe(e,t){for(var r=["<cols>"],a,s=0;s!=t.length;++s)(a=t[s])&&(r[r.length]=We("col",null,hv(s,a)));return r[r.length]="</cols>",r.join("")}function INe(e){var t={ref:(e.match(/ref="([^"]*)"/)||[])[1]};return t}function FNe(e,t,r,a){var s=typeof e.ref=="string"?e.ref:Tt(e.ref);r.Workbook||(r.Workbook={Sheets:[]}),r.Workbook.Names||(r.Workbook.Names=[]);var i=r.Workbook.Names,l=ys(s);l.s.r==l.e.r&&(l.e.r=ys(t["!ref"]).e.r,s=Tt(l));for(var o=0;o<i.length;++o){var d=i[o];if(d.Name=="_xlnm._FilterDatabase"&&d.Sheet==a){d.Ref="'"+r.SheetNames[a]+"'!"+s;break}}return o==i.length&&i.push({Name:"_xlnm._FilterDatabase",Sheet:a,Ref:"'"+r.SheetNames[a]+"'!"+s}),We("autoFilter",null,{ref:s})}var DNe=/<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/;function UNe(e,t){t.Views||(t.Views=[{}]),(e.match(DNe)||[]).forEach(function(r,a){var s=Nt(r);t.Views[a]||(t.Views[a]={}),+s.zoomScale&&(t.Views[a].zoom=+s.zoomScale),Mr(s.rightToLeft)&&(t.Views[a].RTL=!0)})}function MNe(e,t,r,a){var s={workbookViewId:"0"};return(((a||{}).Workbook||{}).Views||[])[0]&&(s.rightToLeft=a.Workbook.Views[0].RTL?"1":"0"),We("sheetViews",We("sheetView",null,s),{})}function RNe(e,t,r,a){if(e.c&&r["!comments"].push([t,e.c]),e.v===void 0&&typeof e.f!="string"||e.t==="z"&&!e.f)return"";var s="",i=e.t,l=e.v;if(e.t!=="z")switch(e.t){case"b":s=e.v?"1":"0";break;case"n":s=""+e.v;break;case"e":s=Po[e.v];break;case"d":a&&a.cellDates?s=Or(e.v,-1).toISOString():(e=Pr(e),e.t="n",s=""+(e.v=$a(Or(e.v)))),typeof e.z>"u"&&(e.z=vt[14]);break;default:s=e.v;break}var o=yn("v",ur(s)),d={r:t},u=qc(a.cellXfs,e,a);switch(u!==0&&(d.s=u),e.t){case"n":break;case"d":d.t="d";break;case"b":d.t="b";break;case"e":d.t="e";break;case"z":break;default:if(e.v==null){delete e.t;break}if(e.v.length>32767)throw new Error("Text length must not exceed 32767 characters");if(a&&a.bookSST){o=yn("v",""+FE(a.Strings,e.v,a.revStrings)),d.t="s";break}d.t="str";break}if(e.t!=i&&(e.t=i,e.v=l),typeof e.f=="string"&&e.f){var f=e.F&&e.F.slice(0,t.length)==t?{t:"array",ref:e.F}:null;o=We("f",ur(e.f),f)+(e.v!=null?o:"")}return e.l&&r["!links"].push([t,e.l]),e.D&&(d.cm=1),We("c",o,d)}var ONe=(function(){var e=/<(?:\w+:)?c[ \/>]/,t=/<\/(?:\w+:)?row>/,r=/r=["']([^"']*)["']/,a=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/,s=/ref=["']([^"']*)["']/,i=gp("v"),l=gp("f");return function(d,u,f,p,h,m){for(var b=0,v="",y=[],j=[],_=0,N=0,E=0,T="",B,F,R=0,U=0,D,L,P=0,G=0,Q=Array.isArray(m.CellXf),H,X=[],K=[],ee=Array.isArray(u),W=[],Y={},M=!1,O=!!f.sheetStubs,q=d.split(t),z=0,J=q.length;z!=J;++z){v=q[z].trim();var re=v.length;if(re!==0){var le=0;e:for(b=0;b<re;++b)switch(v[b]){case">":if(v[b-1]!="/"){++b;break e}if(f&&f.cellStyles){if(F=Nt(v.slice(le,b),!0),R=F.r!=null?parseInt(F.r,10):R+1,U=-1,f.sheetRows&&f.sheetRows<R)continue;Y={},M=!1,F.ht&&(M=!0,Y.hpt=parseFloat(F.ht),Y.hpx=MA(Y.hpt)),F.hidden=="1"&&(M=!0,Y.hidden=!0),F.outlineLevel!=null&&(M=!0,Y.level=+F.outlineLevel),M&&(W[R-1]=Y)}break;case"<":le=b;break}if(le>=b)break;if(F=Nt(v.slice(le,b),!0),R=F.r!=null?parseInt(F.r,10):R+1,U=-1,!(f.sheetRows&&f.sheetRows<R)){p.s.r>R-1&&(p.s.r=R-1),p.e.r<R-1&&(p.e.r=R-1),f&&f.cellStyles&&(Y={},M=!1,F.ht&&(M=!0,Y.hpt=parseFloat(F.ht),Y.hpx=MA(Y.hpt)),F.hidden=="1"&&(M=!0,Y.hidden=!0),F.outlineLevel!=null&&(M=!0,Y.level=+F.outlineLevel),M&&(W[R-1]=Y)),y=v.slice(b).split(e);for(var ne=0;ne!=y.length&&y[ne].trim().charAt(0)=="<";++ne);for(y=y.slice(ne),b=0;b!=y.length;++b)if(v=y[b].trim(),v.length!==0){if(j=v.match(r),_=b,N=0,E=0,v="<c "+(v.slice(0,1)=="<"?">":"")+v,j!=null&&j.length===2){for(_=0,T=j[1],N=0;N!=T.length&&!((E=T.charCodeAt(N)-64)<1||E>26);++N)_=26*_+E;--_,U=_}else++U;for(N=0;N!=v.length&&v.charCodeAt(N)!==62;++N);if(++N,F=Nt(v.slice(0,N),!0),F.r||(F.r=yt({r:R-1,c:U})),T=v.slice(N),B={t:""},(j=T.match(i))!=null&&j[1]!==""&&(B.v=Wt(j[1])),f.cellFormula){if((j=T.match(l))!=null&&j[1]!==""){if(B.f=Wt(gr(j[1])).replace(/\r\n/g,`
`),f.xlfn||(B.f=rU(B.f)),j[0].indexOf('t="array"')>-1)B.F=(T.match(s)||[])[1],B.F.indexOf(":")>-1&&X.push([Yt(B.F),B.F]);else if(j[0].indexOf('t="shared"')>-1){L=Nt(j[0]);var ae=Wt(gr(j[1]));f.xlfn||(ae=rU(ae)),K[parseInt(L.si,10)]=[L,ae,F.r]}}else(j=T.match(/<f[^>]*\/>/))&&(L=Nt(j[0]),K[L.si]&&(B.f=Dwe(K[L.si][1],K[L.si][2],F.r)));var ie=Zr(F.r);for(N=0;N<X.length;++N)ie.r>=X[N][0].s.r&&ie.r<=X[N][0].e.r&&ie.c>=X[N][0].s.c&&ie.c<=X[N][0].e.c&&(B.F=X[N][1])}if(F.t==null&&B.v===void 0)if(B.f||B.F)B.v=0,B.t="n";else if(O)B.t="z";else continue;else B.t=F.t||"n";switch(p.s.c>U&&(p.s.c=U),p.e.c<U&&(p.e.c=U),B.t){case"n":if(B.v==""||B.v==null){if(!O)continue;B.t="z"}else B.v=parseFloat(B.v);break;case"s":if(typeof B.v>"u"){if(!O)continue;B.t="z"}else D=Of[parseInt(B.v,10)],B.v=D.t,B.r=D.r,f.cellHTML&&(B.h=D.h);break;case"str":B.t="s",B.v=B.v!=null?gr(B.v):"",f.cellHTML&&(B.h=AE(B.v));break;case"inlineStr":j=T.match(a),B.t="s",j!=null&&(D=jE(j[1]))?(B.v=D.t,f.cellHTML&&(B.h=D.h)):B.v="";break;case"b":B.v=Mr(B.v);break;case"d":f.cellDates?B.v=Or(B.v,1):(B.v=$a(Or(B.v,1)),B.t="n");break;case"e":(!f||f.cellText!==!1)&&(B.w=B.v),B.v=o9[B.v];break}if(P=G=0,H=null,Q&&F.s!==void 0&&(H=m.CellXf[F.s],H!=null&&(H.numFmtId!=null&&(P=H.numFmtId),f.cellStyles&&H.fillId!=null&&(G=H.fillId))),sH(B,P,G,f,h,m),f.cellDates&&Q&&B.t=="n"&&r0(vt[P])&&(B.t="d",B.v=Av(B.v)),F.cm&&f.xlmeta){var me=(f.xlmeta.Cell||[])[+F.cm-1];me&&me.type=="XLDAPR"&&(B.D=!0)}if(ee){var Z=Zr(F.r);u[Z.r]||(u[Z.r]=[]),u[Z.r][Z.c]=B}else u[F.r]=B}}}}W.length>0&&(u["!rows"]=W)}})();function PNe(e,t,r,a){var s=[],i=[],l=Yt(e["!ref"]),o="",d,u="",f=[],p=0,h=0,m=e["!rows"],b=Array.isArray(e),v={r:u},y,j=-1;for(h=l.s.c;h<=l.e.c;++h)f[h]=Jr(h);for(p=l.s.r;p<=l.e.r;++p){for(i=[],u=ya(p),h=l.s.c;h<=l.e.c;++h){d=f[h]+u;var _=b?(e[p]||[])[h]:e[d];_!==void 0&&(o=RNe(_,d,e,t))!=null&&i.push(o)}(i.length>0||m&&m[p])&&(v={r:u},m&&m[p]&&(y=m[p],y.hidden&&(v.hidden=1),j=-1,y.hpx?j=kp(y.hpx):y.hpt&&(j=y.hpt),j>-1&&(v.ht=j,v.customHeight=1),y.level&&(v.outlineLevel=y.level)),s[s.length]=We("row",i.join(""),v))}if(m)for(;p<m.length;++p)m&&m[p]&&(v={r:p+1},y=m[p],y.hidden&&(v.hidden=1),j=-1,y.hpx?j=kp(y.hpx):y.hpt&&(j=y.hpt),j>-1&&(v.ht=j,v.customHeight=1),y.level&&(v.outlineLevel=y.level),s[s.length]=We("row","",v));return s.join("")}function lH(e,t,r,a){var s=[wa,We("worksheet",null,{xmlns:su[0],"xmlns:r":Qa.r})],i=r.SheetNames[e],l=0,o="",d=r.Sheets[i];d==null&&(d={});var u=d["!ref"]||"A1",f=Yt(u);if(f.e.c>16383||f.e.r>1048575){if(t.WTF)throw new Error("Range "+u+" exceeds format limit A1:XFD1048576");f.e.c=Math.min(f.e.c,16383),f.e.r=Math.min(f.e.c,1048575),u=Tt(f)}a||(a={}),d["!comments"]=[];var p=[];NNe(d,r,e,t,s),s[s.length]=We("dimension",null,{ref:u}),s[s.length]=MNe(d,t,e,r),t.sheetFormat&&(s[s.length]=We("sheetFormatPr",null,{defaultRowHeight:t.sheetFormat.defaultRowHeight||"16",baseColWidth:t.sheetFormat.baseColWidth||"10",outlineLevelRow:t.sheetFormat.outlineLevelRow||"7"})),d["!cols"]!=null&&d["!cols"].length>0&&(s[s.length]=TNe(d,d["!cols"])),s[l=s.length]="<sheetData/>",d["!links"]=[],d["!ref"]!=null&&(o=PNe(d,t),o.length>0&&(s[s.length]=o)),s.length>l+1&&(s[s.length]="</sheetData>",s[l]=s[l].replace("/>",">")),d["!protect"]&&(s[s.length]=jNe(d["!protect"])),d["!autofilter"]!=null&&(s[s.length]=FNe(d["!autofilter"],d,r,e)),d["!merges"]!=null&&d["!merges"].length>0&&(s[s.length]=yNe(d["!merges"]));var h=-1,m,b=-1;return d["!links"].length>0&&(s[s.length]="<hyperlinks>",d["!links"].forEach(function(v){v[1].Target&&(m={ref:v[0]},v[1].Target.charAt(0)!="#"&&(b=cr(a,-1,ur(v[1].Target).replace(/#.*$/,""),Ot.HLINK),m["r:id"]="rId"+b),(h=v[1].Target.indexOf("#"))>-1&&(m.location=ur(v[1].Target.slice(h+1))),v[1].Tooltip&&(m.tooltip=ur(v[1].Tooltip)),s[s.length]=We("hyperlink",null,m))}),s[s.length]="</hyperlinks>"),delete d["!links"],d["!margins"]!=null&&(s[s.length]=BNe(d["!margins"])),(!t||t.ignoreEC||t.ignoreEC==null)&&(s[s.length]=yn("ignoredErrors",We("ignoredError",null,{numberStoredAsText:1,sqref:u}))),p.length>0&&(b=cr(a,-1,"../drawings/drawing"+(e+1)+".xml",Ot.DRAW),s[s.length]=We("drawing",null,{"r:id":"rId"+b}),d["!drawing"]=p),d["!comments"].length>0&&(b=cr(a,-1,"../drawings/vmlDrawing"+(e+1)+".vml",Ot.VML),s[s.length]=We("legacyDrawing",null,{"r:id":"rId"+b}),d["!legacy"]=b),s.length>1&&(s[s.length]="</worksheet>",s[1]=s[1].replace("/>",">")),s.join("")}function LNe(e,t){var r={},a=e.l+t;r.r=e.read_shift(4),e.l+=4;var s=e.read_shift(2);e.l+=1;var i=e.read_shift(1);return e.l=a,i&7&&(r.level=i&7),i&16&&(r.hidden=!0),i&32&&(r.hpt=s/20),r}function QNe(e,t,r){var a=Oe(145),s=(r["!rows"]||[])[e]||{};a.write_shift(4,e),a.write_shift(4,0);var i=320;s.hpx?i=kp(s.hpx)*20:s.hpt&&(i=s.hpt*20),a.write_shift(2,i),a.write_shift(1,0);var l=0;s.level&&(l|=s.level),s.hidden&&(l|=16),(s.hpx||s.hpt)&&(l|=32),a.write_shift(1,l),a.write_shift(1,0);var o=0,d=a.l;a.l+=4;for(var u={r:e,c:0},f=0;f<16;++f)if(!(t.s.c>f+1<<10||t.e.c<f<<10)){for(var p=-1,h=-1,m=f<<10;m<f+1<<10;++m){u.c=m;var b=Array.isArray(r)?(r[u.r]||[])[u.c]:r[yt(u)];b&&(p<0&&(p=m),h=m)}p<0||(++o,a.write_shift(4,p),a.write_shift(4,h))}var v=a.l;return a.l=d,a.write_shift(4,o),a.l=v,a.length>a.l?a.slice(0,a.l):a}function HNe(e,t,r,a){var s=QNe(a,r,t);(s.length>17||(t["!rows"]||[])[a])&&He(e,0,s)}var zNe=cu,$Ne=s0;function VNe(){}function GNe(e,t){var r={},a=e[e.l];return++e.l,r.above=!(a&64),r.left=!(a&128),e.l+=18,r.name=Wge(e),r}function KNe(e,t,r){r==null&&(r=Oe(84+4*e.length));var a=192;t&&(t.above&&(a&=-65),t.left&&(a&=-129)),r.write_shift(1,a);for(var s=1;s<3;++s)r.write_shift(1,0);return qg({auto:1},r),r.write_shift(-4,-1),r.write_shift(-4,-1),a9(e,r),r.slice(0,r.l)}function qNe(e){var t=Si(e);return[t]}function WNe(e,t,r){return r==null&&(r=Oe(8)),iu(t,r)}function YNe(e){var t=lu(e);return[t]}function XNe(e,t,r){return r==null&&(r=Oe(4)),ou(t,r)}function JNe(e){var t=Si(e),r=e.read_shift(1);return[t,r,"b"]}function ZNe(e,t,r){return r==null&&(r=Oe(9)),iu(t,r),r.write_shift(1,e.v?1:0),r}function eCe(e){var t=lu(e),r=e.read_shift(1);return[t,r,"b"]}function tCe(e,t,r){return r==null&&(r=Oe(5)),ou(t,r),r.write_shift(1,e.v?1:0),r}function rCe(e){var t=Si(e),r=e.read_shift(1);return[t,r,"e"]}function aCe(e,t,r){return r==null&&(r=Oe(9)),iu(t,r),r.write_shift(1,e.v),r}function nCe(e){var t=lu(e),r=e.read_shift(1);return[t,r,"e"]}function sCe(e,t,r){return r==null&&(r=Oe(8)),ou(t,r),r.write_shift(1,e.v),r.write_shift(2,0),r.write_shift(1,0),r}function iCe(e){var t=Si(e),r=e.read_shift(4);return[t,r,"s"]}function lCe(e,t,r){return r==null&&(r=Oe(12)),iu(t,r),r.write_shift(4,t.v),r}function oCe(e){var t=lu(e),r=e.read_shift(4);return[t,r,"s"]}function cCe(e,t,r){return r==null&&(r=Oe(8)),ou(t,r),r.write_shift(4,t.v),r}function dCe(e){var t=Si(e),r=On(e);return[t,r,"n"]}function uCe(e,t,r){return r==null&&(r=Oe(16)),iu(t,r),qd(e.v,r),r}function oH(e){var t=lu(e),r=On(e);return[t,r,"n"]}function ACe(e,t,r){return r==null&&(r=Oe(12)),ou(t,r),qd(e.v,r),r}function fCe(e){var t=Si(e),r=yE(e);return[t,r,"n"]}function pCe(e,t,r){return r==null&&(r=Oe(12)),iu(t,r),n9(e.v,r),r}function xCe(e){var t=lu(e),r=yE(e);return[t,r,"n"]}function hCe(e,t,r){return r==null&&(r=Oe(8)),ou(t,r),n9(e.v,r),r}function mCe(e){var t=Si(e),r=gE(e);return[t,r,"is"]}function gCe(e){var t=Si(e),r=Pn(e);return[t,r,"str"]}function bCe(e,t,r){return r==null&&(r=Oe(12+4*e.v.length)),iu(t,r),rn(e.v,r),r.length>r.l?r.slice(0,r.l):r}function vCe(e){var t=lu(e),r=Pn(e);return[t,r,"str"]}function yCe(e,t,r){return r==null&&(r=Oe(8+4*e.v.length)),ou(t,r),rn(e.v,r),r.length>r.l?r.slice(0,r.l):r}function wCe(e,t,r){var a=e.l+t,s=Si(e);s.r=r["!row"];var i=e.read_shift(1),l=[s,i,"b"];if(r.cellFormula){e.l+=2;var o=xv(e,a-e.l,r);l[3]=Dn(o,null,s,r.supbooks,r)}else e.l=a;return l}function NCe(e,t,r){var a=e.l+t,s=Si(e);s.r=r["!row"];var i=e.read_shift(1),l=[s,i,"e"];if(r.cellFormula){e.l+=2;var o=xv(e,a-e.l,r);l[3]=Dn(o,null,s,r.supbooks,r)}else e.l=a;return l}function CCe(e,t,r){var a=e.l+t,s=Si(e);s.r=r["!row"];var i=On(e),l=[s,i,"n"];if(r.cellFormula){e.l+=2;var o=xv(e,a-e.l,r);l[3]=Dn(o,null,s,r.supbooks,r)}else e.l=a;return l}function kCe(e,t,r){var a=e.l+t,s=Si(e);s.r=r["!row"];var i=Pn(e),l=[s,i,"str"];if(r.cellFormula){e.l+=2;var o=xv(e,a-e.l,r);l[3]=Dn(o,null,s,r.supbooks,r)}else e.l=a;return l}var jCe=cu,ECe=s0;function SCe(e,t){return t==null&&(t=Oe(4)),t.write_shift(4,e),t}function BCe(e,t){var r=e.l+t,a=cu(e),s=bE(e),i=Pn(e),l=Pn(e),o=Pn(e);e.l=r;var d={rfx:a,relId:s,loc:i,display:o};return l&&(d.Tooltip=l),d}function _Ce(e,t){var r=Oe(50+4*(e[1].Target.length+(e[1].Tooltip||"").length));s0({s:Zr(e[0]),e:Zr(e[0])},r),vE("rId"+t,r);var a=e[1].Target.indexOf("#"),s=a==-1?"":e[1].Target.slice(a+1);return rn(s||"",r),rn(e[1].Tooltip||"",r),rn("",r),r.slice(0,r.l)}function TCe(){}function ICe(e,t,r){var a=e.l+t,s=s9(e),i=e.read_shift(1),l=[s];if(l[2]=i,r.cellFormula){var o=rNe(e,a-e.l,r);l[1]=o}else e.l=a;return l}function FCe(e,t,r){var a=e.l+t,s=cu(e),i=[s];if(r.cellFormula){var l=nNe(e,a-e.l,r);i[1]=l,e.l=a}else e.l=a;return i}function DCe(e,t,r){r==null&&(r=Oe(18));var a=hv(e,t);r.write_shift(-4,e),r.write_shift(-4,e),r.write_shift(4,(a.width||10)*256),r.write_shift(4,0);var s=0;return t.hidden&&(s|=1),typeof a.width=="number"&&(s|=2),t.level&&(s|=t.level<<8),r.write_shift(2,s),r}var cH=["left","right","top","bottom","header","footer"];function UCe(e){var t={};return cH.forEach(function(r){t[r]=On(e)}),t}function MCe(e,t){return t==null&&(t=Oe(48)),Dd(e),cH.forEach(function(r){qd(e[r],t)}),t}function RCe(e){var t=e.read_shift(2);return e.l+=28,{RTL:t&32}}function OCe(e,t,r){r==null&&(r=Oe(30));var a=924;return(((t||{}).Views||[])[0]||{}).RTL&&(a|=32),r.write_shift(2,a),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(1,0),r.write_shift(1,0),r.write_shift(2,0),r.write_shift(2,100),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(2,0),r.write_shift(4,0),r}function PCe(e){var t=Oe(24);return t.write_shift(4,4),t.write_shift(4,1),s0(e,t),t}function LCe(e,t){return t==null&&(t=Oe(66)),t.write_shift(2,e.password?EE(e.password):0),t.write_shift(4,1),[["objects",!1],["scenarios",!1],["formatCells",!0],["formatColumns",!0],["formatRows",!0],["insertColumns",!0],["insertRows",!0],["insertHyperlinks",!0],["deleteColumns",!0],["deleteRows",!0],["selectLockedCells",!1],["sort",!0],["autoFilter",!0],["pivotTables",!0],["selectUnlockedCells",!1]].forEach(function(r){r[1]?t.write_shift(4,e[r[0]]!=null&&!e[r[0]]?1:0):t.write_shift(4,e[r[0]]!=null&&e[r[0]]?0:1)}),t}function QCe(){}function HCe(){}function zCe(e,t,r,a,s,i,l){if(!e)return e;var o=t||{};a||(a={"!id":{}});var d=o.dense?[]:{},u,f={s:{r:2e6,c:2e6},e:{r:0,c:0}},p=!1,h=!1,m,b,v,y,j,_,N,E,T,B=[];o.biff=12,o["!row"]=0;var F=0,R=!1,U=[],D={},L=o.supbooks||s.supbooks||[[]];if(L.sharedf=D,L.arrayf=U,L.SheetNames=s.SheetNames||s.Sheets.map(function(ee){return ee.name}),!o.supbooks&&(o.supbooks=L,s.Names))for(var P=0;P<s.Names.length;++P)L[0][P+1]=s.Names[P];var G=[],Q=[],H=!1;jp[16]={n:"BrtShortReal",f:oH};var X;if(Oo(e,function(W,Y,M){if(!h)switch(M){case 148:u=W;break;case 0:m=W,o.sheetRows&&o.sheetRows<=m.r&&(h=!0),E=ya(y=m.r),o["!row"]=m.r,(W.hidden||W.hpt||W.level!=null)&&(W.hpt&&(W.hpx=MA(W.hpt)),Q[W.r]=W);break;case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 13:case 14:case 15:case 16:case 17:case 18:case 62:switch(b={t:W[2]},W[2]){case"n":b.v=W[1];break;case"s":N=Of[W[1]],b.v=N.t,b.r=N.r;break;case"b":b.v=!!W[1];break;case"e":b.v=W[1],o.cellText!==!1&&(b.w=Po[b.v]);break;case"str":b.t="s",b.v=W[1];break;case"is":b.t="s",b.v=W[1].t;break}if((v=l.CellXf[W[0].iStyleRef])&&sH(b,v.numFmtId,null,o,i,l),j=W[0].c==-1?j+1:W[0].c,o.dense?(d[y]||(d[y]=[]),d[y][j]=b):d[Jr(j)+E]=b,o.cellFormula){for(R=!1,F=0;F<U.length;++F){var O=U[F];m.r>=O[0].s.r&&m.r<=O[0].e.r&&j>=O[0].s.c&&j<=O[0].e.c&&(b.F=Tt(O[0]),R=!0)}!R&&W.length>3&&(b.f=W[3])}if(f.s.r>m.r&&(f.s.r=m.r),f.s.c>j&&(f.s.c=j),f.e.r<m.r&&(f.e.r=m.r),f.e.c<j&&(f.e.c=j),o.cellDates&&v&&b.t=="n"&&r0(vt[v.numFmtId])){var q=kd(b.v);q&&(b.t="d",b.v=new Date(q.y,q.m-1,q.d,q.H,q.M,q.S,q.u))}X&&(X.type=="XLDAPR"&&(b.D=!0),X=void 0);break;case 1:case 12:if(!o.sheetStubs||p)break;b={t:"z",v:void 0},j=W[0].c==-1?j+1:W[0].c,o.dense?(d[y]||(d[y]=[]),d[y][j]=b):d[Jr(j)+E]=b,f.s.r>m.r&&(f.s.r=m.r),f.s.c>j&&(f.s.c=j),f.e.r<m.r&&(f.e.r=m.r),f.e.c<j&&(f.e.c=j),X&&(X.type=="XLDAPR"&&(b.D=!0),X=void 0);break;case 176:B.push(W);break;case 49:X=((o.xlmeta||{}).Cell||[])[W-1];break;case 494:var z=a["!id"][W.relId];for(z?(W.Target=z.Target,W.loc&&(W.Target+="#"+W.loc),W.Rel=z):W.relId==""&&(W.Target="#"+W.loc),y=W.rfx.s.r;y<=W.rfx.e.r;++y)for(j=W.rfx.s.c;j<=W.rfx.e.c;++j)o.dense?(d[y]||(d[y]=[]),d[y][j]||(d[y][j]={t:"z",v:void 0}),d[y][j].l=W):(_=yt({c:j,r:y}),d[_]||(d[_]={t:"z",v:void 0}),d[_].l=W);break;case 426:if(!o.cellFormula)break;U.push(W),T=o.dense?d[y][j]:d[Jr(j)+E],T.f=Dn(W[1],f,{r:m.r,c:j},L,o),T.F=Tt(W[0]);break;case 427:if(!o.cellFormula)break;D[yt(W[0].s)]=W[1],T=o.dense?d[y][j]:d[Jr(j)+E],T.f=Dn(W[1],f,{r:m.r,c:j},L,o);break;case 60:if(!o.cellStyles)break;for(;W.e>=W.s;)G[W.e--]={width:W.w/256,hidden:!!(W.flags&1),level:W.level},H||(H=!0,SE(W.w/256)),Uc(G[W.e+1]);break;case 161:d["!autofilter"]={ref:Tt(W)};break;case 476:d["!margins"]=W;break;case 147:s.Sheets[r]||(s.Sheets[r]={}),W.name&&(s.Sheets[r].CodeName=W.name),(W.above||W.left)&&(d["!outline"]={above:W.above,left:W.left});break;case 137:s.Views||(s.Views=[{}]),s.Views[0]||(s.Views[0]={}),W.RTL&&(s.Views[0].RTL=!0);break;case 485:break;case 64:case 1053:break;case 151:break;case 152:case 175:case 644:case 625:case 562:case 396:case 1112:case 1146:case 471:case 1050:case 649:case 1105:case 589:case 607:case 564:case 1055:case 168:case 174:case 1180:case 499:case 507:case 550:case 171:case 167:case 1177:case 169:case 1181:case 551:case 552:case 661:case 639:case 478:case 537:case 477:case 536:case 1103:case 680:case 1104:case 1024:case 663:case 535:case 678:case 504:case 1043:case 428:case 170:case 3072:case 50:case 2070:case 1045:break;case 35:p=!0;break;case 36:p=!1;break;case 37:p=!0;break;case 38:p=!1;break;default:if(!Y.T){if(!p||o.WTF)throw new Error("Unexpected record 0x"+M.toString(16))}}},o),delete o.supbooks,delete o["!row"],!d["!ref"]&&(f.s.r<2e6||u&&(u.e.r>0||u.e.c>0||u.s.r>0||u.s.c>0))&&(d["!ref"]=Tt(u||f)),o.sheetRows&&d["!ref"]){var K=Yt(d["!ref"]);o.sheetRows<=+K.e.r&&(K.e.r=o.sheetRows-1,K.e.r>f.e.r&&(K.e.r=f.e.r),K.e.r<K.s.r&&(K.s.r=K.e.r),K.e.c>f.e.c&&(K.e.c=f.e.c),K.e.c<K.s.c&&(K.s.c=K.e.c),d["!fullref"]=d["!ref"],d["!ref"]=Tt(K))}return B.length>0&&(d["!merges"]=B),G.length>0&&(d["!cols"]=G),Q.length>0&&(d["!rows"]=Q),d}function $Ce(e,t,r,a,s,i,l){if(t.v===void 0)return!1;var o="";switch(t.t){case"b":o=t.v?"1":"0";break;case"d":t=Pr(t),t.z=t.z||vt[14],t.v=$a(Or(t.v)),t.t="n";break;case"n":case"e":o=""+t.v;break;default:o=t.v;break}var d={r,c:a};switch(d.s=qc(s.cellXfs,t,s),t.l&&i["!links"].push([yt(d),t.l]),t.c&&i["!comments"].push([yt(d),t.c]),t.t){case"s":case"str":return s.bookSST?(o=FE(s.Strings,t.v,s.revStrings),d.t="s",d.v=o,l?He(e,18,cCe(t,d)):He(e,7,lCe(t,d))):(d.t="str",l?He(e,17,yCe(t,d)):He(e,6,bCe(t,d))),!0;case"n":return t.v==(t.v|0)&&t.v>-1e3&&t.v<1e3?l?He(e,13,hCe(t,d)):He(e,2,pCe(t,d)):l?He(e,16,ACe(t,d)):He(e,5,uCe(t,d)),!0;case"b":return d.t="b",l?He(e,15,tCe(t,d)):He(e,4,ZNe(t,d)),!0;case"e":return d.t="e",l?He(e,14,sCe(t,d)):He(e,3,aCe(t,d)),!0}return l?He(e,12,XNe(t,d)):He(e,1,WNe(t,d)),!0}function VCe(e,t,r,a){var s=Yt(t["!ref"]||"A1"),i,l="",o=[];He(e,145);var d=Array.isArray(t),u=s.e.r;t["!rows"]&&(u=Math.max(s.e.r,t["!rows"].length-1));for(var f=s.s.r;f<=u;++f){l=ya(f),HNe(e,t,s,f);var p=!1;if(f<=s.e.r)for(var h=s.s.c;h<=s.e.c;++h){f===s.s.r&&(o[h]=Jr(h)),i=o[h]+l;var m=d?(t[f]||[])[h]:t[i];if(!m){p=!1;continue}p=$Ce(e,m,f,h,a,t,p)}}He(e,146)}function GCe(e,t){!t||!t["!merges"]||(He(e,177,SCe(t["!merges"].length)),t["!merges"].forEach(function(r){He(e,176,ECe(r))}),He(e,178))}function KCe(e,t){!t||!t["!cols"]||(He(e,390),t["!cols"].forEach(function(r,a){r&&He(e,60,DCe(a,r))}),He(e,391))}function qCe(e,t){!t||!t["!ref"]||(He(e,648),He(e,649,PCe(Yt(t["!ref"]))),He(e,650))}function WCe(e,t,r){t["!links"].forEach(function(a){if(a[1].Target){var s=cr(r,-1,a[1].Target.replace(/#.*$/,""),Ot.HLINK);He(e,494,_Ce(a,s))}}),delete t["!links"]}function YCe(e,t,r,a){if(t["!comments"].length>0){var s=cr(a,-1,"../drawings/vmlDrawing"+(r+1)+".vml",Ot.VML);He(e,551,vE("rId"+s)),t["!legacy"]=s}}function XCe(e,t,r,a){if(t["!autofilter"]){var s=t["!autofilter"],i=typeof s.ref=="string"?s.ref:Tt(s.ref);r.Workbook||(r.Workbook={Sheets:[]}),r.Workbook.Names||(r.Workbook.Names=[]);var l=r.Workbook.Names,o=ys(i);o.s.r==o.e.r&&(o.e.r=ys(t["!ref"]).e.r,i=Tt(o));for(var d=0;d<l.length;++d){var u=l[d];if(u.Name=="_xlnm._FilterDatabase"&&u.Sheet==a){u.Ref="'"+r.SheetNames[a]+"'!"+i;break}}d==l.length&&l.push({Name:"_xlnm._FilterDatabase",Sheet:a,Ref:"'"+r.SheetNames[a]+"'!"+i}),He(e,161,s0(Yt(i))),He(e,162)}}function JCe(e,t,r){He(e,133),He(e,137,OCe(t,r)),He(e,138),He(e,134)}function ZCe(e,t){t["!protect"]&&He(e,535,LCe(t["!protect"]))}function eke(e,t,r,a){var s=ms(),i=r.SheetNames[e],l=r.Sheets[i]||{},o=i;try{r&&r.Workbook&&(o=r.Workbook.Sheets[e].CodeName||o)}catch{}var d=Yt(l["!ref"]||"A1");if(d.e.c>16383||d.e.r>1048575){if(t.WTF)throw new Error("Range "+(l["!ref"]||"A1")+" exceeds format limit A1:XFD1048576");d.e.c=Math.min(d.e.c,16383),d.e.r=Math.min(d.e.c,1048575)}return l["!links"]=[],l["!comments"]=[],He(s,129),(r.vbaraw||l["!outline"])&&He(s,147,KNe(o,l["!outline"])),He(s,148,$Ne(d)),JCe(s,l,r.Workbook),KCe(s,l),VCe(s,l,e,t),ZCe(s,l),XCe(s,l,r,e),GCe(s,l),WCe(s,l,a),l["!margins"]&&He(s,476,MCe(l["!margins"])),(!t||t.ignoreEC||t.ignoreEC==null)&&qCe(s,l),YCe(s,l,e,a),He(s,130),s.end()}function tke(e){var t=[],r=e.match(/^<c:numCache>/),a;(e.match(/<c:pt idx="(\d*)">(.*?)<\/c:pt>/mg)||[]).forEach(function(i){var l=i.match(/<c:pt idx="(\d*?)"><c:v>(.*)<\/c:v><\/c:pt>/);l&&(t[+l[1]]=r?+l[2]:l[2])});var s=Wt((e.match(/<c:formatCode>([\s\S]*?)<\/c:formatCode>/)||["","General"])[1]);return(e.match(/<c:f>(.*?)<\/c:f>/mg)||[]).forEach(function(i){a=i.replace(/<.*?>/g,"")}),[t,s,a]}function rke(e,t,r,a,s,i){var l=i||{"!type":"chart"};if(!e)return i;var o=0,d=0,u="A",f={s:{r:2e6,c:2e6},e:{r:0,c:0}};return(e.match(/<c:numCache>[\s\S]*?<\/c:numCache>/gm)||[]).forEach(function(p){var h=tke(p);f.s.r=f.s.c=0,f.e.c=o,u=Jr(o),h[0].forEach(function(m,b){l[u+ya(b)]={t:"n",v:m,z:h[1]},d=b}),f.e.r<d&&(f.e.r=d),++o}),o>0&&(l["!ref"]=Tt(f)),l}function ake(e,t,r,a,s){if(!e)return e;a||(a={"!id":{}});var i={"!type":"chart","!drawel":null,"!rel":""},l,o=e.match(iH);return o&&DE(o[0],i,s,r),(l=e.match(/drawing r:id="(.*?)"/))&&(i["!rel"]=l[1]),a["!id"][i["!rel"]]&&(i["!drawel"]=a["!id"][i["!rel"]]),i}function nke(e,t){e.l+=10;var r=Pn(e);return{name:r}}function ske(e,t,r,a,s){if(!e)return e;a||(a={"!id":{}});var i={"!type":"chart","!drawel":null,"!rel":""},l=!1;return Oo(e,function(d,u,f){switch(f){case 550:i["!rel"]=d;break;case 651:s.Sheets[r]||(s.Sheets[r]={}),d.name&&(s.Sheets[r].CodeName=d.name);break;case 562:case 652:case 669:case 679:case 551:case 552:case 476:case 3072:break;case 35:l=!0;break;case 36:l=!1;break;case 37:break;case 38:break;default:if(!(u.T>0)){if(!(u.T<0)){if(!l||t.WTF)throw new Error("Unexpected record 0x"+f.toString(16))}}}},t),a["!id"][i["!rel"]]&&(i["!drawel"]=a["!id"][i["!rel"]]),i}var UE=[["allowRefreshQuery",!1,"bool"],["autoCompressPictures",!0,"bool"],["backupFile",!1,"bool"],["checkCompatibility",!1,"bool"],["CodeName",""],["date1904",!1,"bool"],["defaultThemeVersion",0,"int"],["filterPrivacy",!1,"bool"],["hidePivotFieldList",!1,"bool"],["promptedSolutions",!1,"bool"],["publishItems",!1,"bool"],["refreshAllConnections",!1,"bool"],["saveExternalLinkValues",!0,"bool"],["showBorderUnselectedTables",!0,"bool"],["showInkAnnotation",!0,"bool"],["showObjects","all"],["showPivotChartFilter",!1,"bool"],["updateLinks","userSet"]],ike=[["activeTab",0,"int"],["autoFilterDateGrouping",!0,"bool"],["firstSheet",0,"int"],["minimized",!1,"bool"],["showHorizontalScroll",!0,"bool"],["showSheetTabs",!0,"bool"],["showVerticalScroll",!0,"bool"],["tabRatio",600,"int"],["visibility","visible"]],lke=[],oke=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function lU(e,t){for(var r=0;r!=e.length;++r)for(var a=e[r],s=0;s!=t.length;++s){var i=t[s];if(a[i[0]]==null)a[i[0]]=i[1];else switch(i[2]){case"bool":typeof a[i[0]]=="string"&&(a[i[0]]=Mr(a[i[0]]));break;case"int":typeof a[i[0]]=="string"&&(a[i[0]]=parseInt(a[i[0]],10));break}}}function oU(e,t){for(var r=0;r!=t.length;++r){var a=t[r];if(e[a[0]]==null)e[a[0]]=a[1];else switch(a[2]){case"bool":typeof e[a[0]]=="string"&&(e[a[0]]=Mr(e[a[0]]));break;case"int":typeof e[a[0]]=="string"&&(e[a[0]]=parseInt(e[a[0]],10));break}}}function dH(e){oU(e.WBProps,UE),oU(e.CalcPr,oke),lU(e.WBView,ike),lU(e.Sheets,lke),CA.date1904=Mr(e.WBProps.date1904)}function cke(e){return!e.Workbook||!e.Workbook.WBProps?"false":Mr(e.Workbook.WBProps.date1904)?"true":"false"}var dke="][*?/\\".split("");function uH(e,t){if(e.length>31)throw new Error("Sheet names cannot exceed 31 chars");var r=!0;return dke.forEach(function(a){if(e.indexOf(a)!=-1)throw new Error("Sheet name cannot contain : \\ / ? * [ ]")}),r}function uke(e,t,r){e.forEach(function(a,s){uH(a);for(var i=0;i<s;++i)if(a==e[i])throw new Error("Duplicate Sheet Name: "+a);if(r){var l=t&&t[s]&&t[s].CodeName||a;if(l.charCodeAt(0)==95&&l.length>22)throw new Error("Bad Code Name: Worksheet"+l)}})}function Ake(e){if(!e||!e.SheetNames||!e.Sheets)throw new Error("Invalid Workbook");if(!e.SheetNames.length)throw new Error("Workbook is empty");var t=e.Workbook&&e.Workbook.Sheets||[];uke(e.SheetNames,t,!!e.vbaraw);for(var r=0;r<e.SheetNames.length;++r)cNe(e.Sheets[e.SheetNames[r]],e.SheetNames[r],r)}var fke=/<\w+:workbook/;function pke(e,t){if(!e)throw new Error("Could not find file");var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},Names:[],xmlns:""},a=!1,s="xmlns",i={},l=0;if(e.replace(zn,function(d,u){var f=Nt(d);switch(Tl(f[0])){case"<?xml":break;case"<workbook":d.match(fke)&&(s="xmlns"+d.match(/<(\w+):/)[1]),r.xmlns=f[s];break;case"</workbook>":break;case"<fileVersion":delete f[0],r.AppVersion=f;break;case"<fileVersion/>":case"</fileVersion>":break;case"<fileSharing":break;case"<fileSharing/>":break;case"<workbookPr":case"<workbookPr/>":UE.forEach(function(p){if(f[p[0]]!=null)switch(p[2]){case"bool":r.WBProps[p[0]]=Mr(f[p[0]]);break;case"int":r.WBProps[p[0]]=parseInt(f[p[0]],10);break;default:r.WBProps[p[0]]=f[p[0]]}}),f.codeName&&(r.WBProps.CodeName=gr(f.codeName));break;case"</workbookPr>":break;case"<workbookProtection":break;case"<workbookProtection/>":break;case"<bookViews":case"<bookViews>":case"</bookViews>":break;case"<workbookView":case"<workbookView/>":delete f[0],r.WBView.push(f);break;case"</workbookView>":break;case"<sheets":case"<sheets>":case"</sheets>":break;case"<sheet":switch(f.state){case"hidden":f.Hidden=1;break;case"veryHidden":f.Hidden=2;break;default:f.Hidden=0}delete f.state,f.name=Wt(gr(f.name)),delete f[0],r.Sheets.push(f);break;case"</sheet>":break;case"<functionGroups":case"<functionGroups/>":break;case"<functionGroup":break;case"<externalReferences":case"</externalReferences>":case"<externalReferences>":break;case"<externalReference":break;case"<definedNames/>":break;case"<definedNames>":case"<definedNames":a=!0;break;case"</definedNames>":a=!1;break;case"<definedName":i={},i.Name=gr(f.name),f.comment&&(i.Comment=f.comment),f.localSheetId&&(i.Sheet=+f.localSheetId),Mr(f.hidden||"0")&&(i.Hidden=!0),l=u+d.length;break;case"</definedName>":i.Ref=Wt(gr(e.slice(l,u))),r.Names.push(i);break;case"<definedName/>":break;case"<calcPr":delete f[0],r.CalcPr=f;break;case"<calcPr/>":delete f[0],r.CalcPr=f;break;case"</calcPr>":break;case"<oleSize":break;case"<customWorkbookViews>":case"</customWorkbookViews>":case"<customWorkbookViews":break;case"<customWorkbookView":case"</customWorkbookView>":break;case"<pivotCaches>":case"</pivotCaches>":case"<pivotCaches":break;case"<pivotCache":break;case"<smartTagPr":case"<smartTagPr/>":break;case"<smartTagTypes":case"<smartTagTypes>":case"</smartTagTypes>":break;case"<smartTagType":break;case"<webPublishing":case"<webPublishing/>":break;case"<fileRecoveryPr":case"<fileRecoveryPr/>":break;case"<webPublishObjects>":case"<webPublishObjects":case"</webPublishObjects>":break;case"<webPublishObject":break;case"<extLst":case"<extLst>":case"</extLst>":case"<extLst/>":break;case"<ext":a=!0;break;case"</ext>":a=!1;break;case"<ArchID":break;case"<AlternateContent":case"<AlternateContent>":a=!0;break;case"</AlternateContent>":a=!1;break;case"<revisionPtr":break;default:if(!a&&t.WTF)throw new Error("unrecognized "+f[0]+" in workbook")}return d}),su.indexOf(r.xmlns)===-1)throw new Error("Unknown Namespace: "+r.xmlns);return dH(r),r}function AH(e){var t=[wa];t[t.length]=We("workbook",null,{xmlns:su[0],"xmlns:r":Qa.r});var r=e.Workbook&&(e.Workbook.Names||[]).length>0,a={codeName:"ThisWorkbook"};e.Workbook&&e.Workbook.WBProps&&(UE.forEach(function(o){e.Workbook.WBProps[o[0]]!=null&&e.Workbook.WBProps[o[0]]!=o[1]&&(a[o[0]]=e.Workbook.WBProps[o[0]])}),e.Workbook.WBProps.CodeName&&(a.codeName=e.Workbook.WBProps.CodeName,delete a.CodeName)),t[t.length]=We("workbookPr",null,a);var s=e.Workbook&&e.Workbook.Sheets||[],i=0;if(s&&s[0]&&s[0].Hidden){for(t[t.length]="<bookViews>",i=0;i!=e.SheetNames.length&&!(!s[i]||!s[i].Hidden);++i);i==e.SheetNames.length&&(i=0),t[t.length]='<workbookView firstSheet="'+i+'" activeTab="'+i+'"/>',t[t.length]="</bookViews>"}for(t[t.length]="<sheets>",i=0;i!=e.SheetNames.length;++i){var l={name:ur(e.SheetNames[i].slice(0,31))};if(l.sheetId=""+(i+1),l["r:id"]="rId"+(i+1),s[i])switch(s[i].Hidden){case 1:l.state="hidden";break;case 2:l.state="veryHidden";break}t[t.length]=We("sheet",null,l)}return t[t.length]="</sheets>",r&&(t[t.length]="<definedNames>",e.Workbook&&e.Workbook.Names&&e.Workbook.Names.forEach(function(o){var d={name:o.Name};o.Comment&&(d.comment=o.Comment),o.Sheet!=null&&(d.localSheetId=""+o.Sheet),o.Hidden&&(d.hidden="1"),o.Ref&&(t[t.length]=We("definedName",ur(o.Ref),d))}),t[t.length]="</definedNames>"),t.length>2&&(t[t.length]="</workbook>",t[1]=t[1].replace("/>",">")),t.join("")}function xke(e,t){var r={};return r.Hidden=e.read_shift(4),r.iTabID=e.read_shift(4),r.strRelID=CC(e),r.name=Pn(e),r}function hke(e,t){return t||(t=Oe(127)),t.write_shift(4,e.Hidden),t.write_shift(4,e.iTabID),vE(e.strRelID,t),rn(e.name.slice(0,31),t),t.length>t.l?t.slice(0,t.l):t}function mke(e,t){var r={},a=e.read_shift(4);r.defaultThemeVersion=e.read_shift(4);var s=t>8?Pn(e):"";return s.length>0&&(r.CodeName=s),r.autoCompressPictures=!!(a&65536),r.backupFile=!!(a&64),r.checkCompatibility=!!(a&4096),r.date1904=!!(a&1),r.filterPrivacy=!!(a&8),r.hidePivotFieldList=!!(a&1024),r.promptedSolutions=!!(a&16),r.publishItems=!!(a&2048),r.refreshAllConnections=!!(a&262144),r.saveExternalLinkValues=!!(a&128),r.showBorderUnselectedTables=!!(a&4),r.showInkAnnotation=!!(a&32),r.showObjects=["all","placeholders","none"][a>>13&3],r.showPivotChartFilter=!!(a&32768),r.updateLinks=["userSet","never","always"][a>>8&3],r}function gke(e,t){t||(t=Oe(72));var r=0;return e&&e.filterPrivacy&&(r|=8),t.write_shift(4,r),t.write_shift(4,0),a9(e&&e.CodeName||"ThisWorkbook",t),t.slice(0,t.l)}function bke(e,t){var r={};return e.read_shift(4),r.ArchID=e.read_shift(4),e.l+=t-8,r}function vke(e,t,r){var a=e.l+t;e.l+=4,e.l+=1;var s=e.read_shift(4),i=Yge(e),l=aNe(e,0,r),o=bE(e);e.l=a;var d={Name:i,Ptg:l};return s<268435455&&(d.Sheet=s),o&&(d.Comment=o),d}function yke(e,t){var r={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""},a=[],s=!1;t||(t={}),t.biff=12;var i=[],l=[[]];return l.SheetNames=[],l.XTI=[],jp[16]={n:"BrtFRTArchID$",f:bke},Oo(e,function(d,u,f){switch(f){case 156:l.SheetNames.push(d.name),r.Sheets.push(d);break;case 153:r.WBProps=d;break;case 39:d.Sheet!=null&&(t.SID=d.Sheet),d.Ref=Dn(d.Ptg,null,null,l,t),delete t.SID,delete d.Ptg,i.push(d);break;case 1036:break;case 357:case 358:case 355:case 667:l[0].length?l.push([f,d]):l[0]=[f,d],l[l.length-1].XTI=[];break;case 362:l.length===0&&(l[0]=[],l[0].XTI=[]),l[l.length-1].XTI=l[l.length-1].XTI.concat(d),l.XTI=l.XTI.concat(d);break;case 361:break;case 2071:case 158:case 143:case 664:case 353:break;case 3072:case 3073:case 534:case 677:case 157:case 610:case 2050:case 155:case 548:case 676:case 128:case 665:case 2128:case 2125:case 549:case 2053:case 596:case 2076:case 2075:case 2082:case 397:case 154:case 1117:case 553:case 2091:break;case 35:a.push(f),s=!0;break;case 36:a.pop(),s=!1;break;case 37:a.push(f),s=!0;break;case 38:a.pop(),s=!1;break;case 16:break;default:if(!u.T){if(!s||t.WTF&&a[a.length-1]!=37&&a[a.length-1]!=35)throw new Error("Unexpected record 0x"+f.toString(16))}}},t),dH(r),r.Names=i,r.supbooks=l,r}function wke(e,t){He(e,143);for(var r=0;r!=t.SheetNames.length;++r){var a=t.Workbook&&t.Workbook.Sheets&&t.Workbook.Sheets[r]&&t.Workbook.Sheets[r].Hidden||0,s={Hidden:a,iTabID:r+1,strRelID:"rId"+(r+1),name:t.SheetNames[r]};He(e,156,hke(s))}He(e,144)}function Nke(e,t){t||(t=Oe(127));for(var r=0;r!=4;++r)t.write_shift(4,0);return rn("SheetJS",t),rn(Qg.version,t),rn(Qg.version,t),rn("7262",t),t.length>t.l?t.slice(0,t.l):t}function Cke(e,t){t||(t=Oe(29)),t.write_shift(-4,0),t.write_shift(-4,460),t.write_shift(4,28800),t.write_shift(4,17600),t.write_shift(4,500),t.write_shift(4,e),t.write_shift(4,e);var r=120;return t.write_shift(1,r),t.length>t.l?t.slice(0,t.l):t}function kke(e,t){if(!(!t.Workbook||!t.Workbook.Sheets)){for(var r=t.Workbook.Sheets,a=0,s=-1,i=-1;a<r.length;++a)!r[a]||!r[a].Hidden&&s==-1?s=a:r[a].Hidden==1&&i==-1&&(i=a);i>s||(He(e,135),He(e,158,Cke(s)),He(e,136))}}function jke(e,t){var r=ms();return He(r,131),He(r,128,Nke()),He(r,153,gke(e.Workbook&&e.Workbook.WBProps||null)),kke(r,e),wke(r,e),He(r,132),r.end()}function Eke(e,t,r){return t.slice(-4)===".bin"?yke(e,r):pke(e,r)}function Ske(e,t,r,a,s,i,l,o){return t.slice(-4)===".bin"?zCe(e,a,r,s,i,l,o):vNe(e,a,r,s,i,l,o)}function Bke(e,t,r,a,s,i,l,o){return t.slice(-4)===".bin"?ske(e,a,r,s,i):ake(e,a,r,s,i)}function _ke(e,t,r,a,s,i,l,o){return t.slice(-4)===".bin"?Iwe():Fwe()}function Tke(e,t,r,a,s,i,l,o){return t.slice(-4)===".bin"?_we():Twe()}function Ike(e,t,r,a){return t.slice(-4)===".bin"?Eye(e,r,a):xye(e,r,a)}function Fke(e,t,r){return G9(e,r)}function Dke(e,t,r){return t.slice(-4)===".bin"?D1e(e,r):T1e(e,r)}function Uke(e,t,r){return t.slice(-4)===".bin"?kwe(e,r):hwe(e,r)}function Mke(e,t,r){return t.slice(-4)===".bin"?fwe(e):uwe(e)}function Rke(e,t,r,a){return r.slice(-4)===".bin"?pwe(e,t,r,a):void 0}function Oke(e,t,r){return t.slice(-4)===".bin"?owe(e,t,r):dwe(e,t,r)}function Pke(e,t,r){return(t.slice(-4)===".bin"?jke:AH)(e)}function Lke(e,t,r,a,s){return(t.slice(-4)===".bin"?eke:lH)(e,r,a,s)}function Qke(e,t,r){return(t.slice(-4)===".bin"?Rye:$9)(e,r)}function Hke(e,t,r){return(t.slice(-4)===".bin"?R1e:M9)(e,r)}function zke(e,t,r){return(t.slice(-4)===".bin"?jwe:W9)(e)}function $ke(e){return(e.slice(-4)===".bin"?cwe:K9)()}var fH=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g,pH=/([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/;function Di(e,t){var r=e.split(/\s+/),a=[];if(a[0]=r[0],r.length===1)return a;var s=e.match(fH),i,l,o,d;if(s)for(d=0;d!=s.length;++d)i=s[d].match(pH),(l=i[1].indexOf(":"))===-1?a[i[1]]=i[2].slice(1,i[2].length-1):(i[1].slice(0,6)==="xmlns:"?o="xmlns"+i[1].slice(6):o=i[1].slice(l+1),a[o]=i[2].slice(1,i[2].length-1));return a}function Vke(e){var t=e.split(/\s+/),r={};if(t.length===1)return r;var a=e.match(fH),s,i,l,o;if(a)for(o=0;o!=a.length;++o)s=a[o].match(pH),(i=s[1].indexOf(":"))===-1?r[s[1]]=s[2].slice(1,s[2].length-1):(s[1].slice(0,6)==="xmlns:"?l="xmlns"+s[1].slice(6):l=s[1].slice(i+1),r[l]=s[2].slice(1,s[2].length-1));return r}var Lf;function Gke(e,t){var r=Lf[e]||Wt(e);return r==="General"?Gd(t):ji(r,t)}function Kke(e,t,r,a){var s=a;switch((r[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":s=Mr(a);break;case"i2":case"int":s=parseInt(a,10);break;case"r4":case"float":s=parseFloat(a);break;case"date":case"dateTime.tz":s=Or(a);break;case"i8":case"string":case"fixed":case"uuid":case"bin.base64":break;default:throw new Error("bad custprop:"+r[0])}e[Wt(t)]=s}function qke(e,t,r){if(e.t!=="z"){if(!r||r.cellText!==!1)try{e.t==="e"?e.w=e.w||Po[e.v]:t==="General"?e.t==="n"?(e.v|0)===e.v?e.w=e.v.toString(10):e.w=mp(e.v):e.w=Gd(e.v):e.w=Gke(t||"General",e.v)}catch(i){if(r.WTF)throw i}try{var a=Lf[t]||t||"General";if(r.cellNF&&(e.z=a),r.cellDates&&e.t=="n"&&r0(a)){var s=kd(e.v);s&&(e.t="d",e.v=new Date(s.y,s.m-1,s.d,s.H,s.M,s.S,s.u))}}catch(i){if(r.WTF)throw i}}}function Wke(e,t,r){if(r.cellStyles&&t.Interior){var a=t.Interior;a.Pattern&&(a.patternType=lye[a.Pattern]||a.Pattern)}e[t.ID]=t}function Yke(e,t,r,a,s,i,l,o,d,u){var f="General",p=a.StyleID,h={};u=u||{};var m=[],b=0;for(p===void 0&&o&&(p=o.StyleID),p===void 0&&l&&(p=l.StyleID);i[p]!==void 0&&(i[p].nf&&(f=i[p].nf),i[p].Interior&&m.push(i[p].Interior),!!i[p].Parent);)p=i[p].Parent;switch(r.Type){case"Boolean":a.t="b",a.v=Mr(e);break;case"String":a.t="s",a.r=kD(Wt(e)),a.v=e.indexOf("<")>-1?Wt(t||e).replace(/<.*?>/g,""):a.r;break;case"DateTime":e.slice(-1)!="Z"&&(e+="Z"),a.v=(Or(e)-new Date(Date.UTC(1899,11,30)))/(1440*60*1e3),a.v!==a.v?a.v=Wt(e):a.v<60&&(a.v=a.v-1),(!f||f=="General")&&(f="yyyy-mm-dd");case"Number":a.v===void 0&&(a.v=+e),a.t||(a.t="n");break;case"Error":a.t="e",a.v=o9[e],u.cellText!==!1&&(a.w=e);break;default:e==""&&t==""?a.t="z":(a.t="s",a.v=kD(t||e));break}if(qke(a,f,u),u.cellFormula!==!1)if(a.Formula){var v=Wt(a.Formula);v.charCodeAt(0)==61&&(v=v.slice(1)),a.f=NA(v,s),delete a.Formula,a.ArrayRange=="RC"?a.F=NA("RC:RC",s):a.ArrayRange&&(a.F=NA(a.ArrayRange,s),d.push([Yt(a.F),a.F]))}else for(b=0;b<d.length;++b)s.r>=d[b][0].s.r&&s.r<=d[b][0].e.r&&s.c>=d[b][0].s.c&&s.c<=d[b][0].e.c&&(a.F=d[b][1]);u.cellStyles&&(m.forEach(function(y){!h.patternType&&y.patternType&&(h.patternType=y.patternType)}),a.s=h),a.StyleID!==void 0&&(a.ixfe=a.StyleID)}function Xke(e){e.t=e.v||"",e.t=e.t.replace(/\r\n/g,`
`).replace(/\r/g,`
`),e.v=e.w=e.ixfe=void 0}function U2(e,t){var r=t||{};a0();var a=wf(fE(e));(r.type=="binary"||r.type=="array"||r.type=="base64")&&(a=gr(a));var s=a.slice(0,1024).toLowerCase(),i=!1;if(s=s.replace(/".*?"/g,""),(s.indexOf(">")&1023)>Math.min(s.indexOf(",")&1023,s.indexOf(";")&1023)){var l=Pr(r);return l.type="string",UA.to_workbook(a,l)}if(s.indexOf("<?xml")==-1&&["html","table","head","meta","script","style","div"].forEach(function(Ue){s.indexOf("<"+Ue)>=0&&(i=!0)}),i)return Mje(a,r);Lf={"General Number":"General","General Date":vt[22],"Long Date":"dddd, mmmm dd, yyyy","Medium Date":vt[15],"Short Date":vt[14],"Long Time":vt[19],"Medium Time":vt[18],"Short Time":vt[20],Currency:'"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',Fixed:vt[2],Standard:vt[4],Percent:vt[10],Scientific:vt[11],"Yes/No":'"Yes";"Yes";"No";@',"True/False":'"True";"True";"False";@',"On/Off":'"Yes";"Yes";"No";@'};var o,d=[],u,f={},p=[],h=r.dense?[]:{},m="",b={},v={},y=Di('<Data ss:Type="String">'),j=0,_=0,N=0,E={s:{r:2e6,c:2e6},e:{r:0,c:0}},T={},B={},F="",R=0,U=[],D={},L={},P=0,G=[],Q=[],H={},X=[],K,ee=!1,W=[],Y=[],M={},O=0,q=0,z={Sheets:[],WBProps:{date1904:!1}},J={};vp.lastIndex=0,a=a.replace(/<!--([\s\S]*?)-->/mg,"");for(var re="";o=vp.exec(a);)switch(o[3]=(re=o[3]).toLowerCase()){case"data":if(re=="data"){if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else o[0].charAt(o[0].length-2)!=="/"&&d.push([o[3],!0]);break}if(d[d.length-1][1])break;o[1]==="/"?Yke(a.slice(j,o.index),F,y,d[d.length-1][0]=="comment"?H:b,{c:_,r:N},T,X[_],v,W,r):(F="",y=Di(o[0]),j=o.index+o[0].length);break;case"cell":if(o[1]==="/")if(Q.length>0&&(b.c=Q),(!r.sheetRows||r.sheetRows>N)&&b.v!==void 0&&(r.dense?(h[N]||(h[N]=[]),h[N][_]=b):h[Jr(_)+ya(N)]=b),b.HRef&&(b.l={Target:Wt(b.HRef)},b.HRefScreenTip&&(b.l.Tooltip=b.HRefScreenTip),delete b.HRef,delete b.HRefScreenTip),(b.MergeAcross||b.MergeDown)&&(O=_+(parseInt(b.MergeAcross,10)|0),q=N+(parseInt(b.MergeDown,10)|0),U.push({s:{c:_,r:N},e:{c:O,r:q}})),!r.sheetStubs)b.MergeAcross?_=O+1:++_;else if(b.MergeAcross||b.MergeDown){for(var le=_;le<=O;++le)for(var ne=N;ne<=q;++ne)(le>_||ne>N)&&(r.dense?(h[ne]||(h[ne]=[]),h[ne][le]={t:"z"}):h[Jr(le)+ya(ne)]={t:"z"});_=O+1}else++_;else b=Vke(o[0]),b.Index&&(_=+b.Index-1),_<E.s.c&&(E.s.c=_),_>E.e.c&&(E.e.c=_),o[0].slice(-2)==="/>"&&++_,Q=[];break;case"row":o[1]==="/"||o[0].slice(-2)==="/>"?(N<E.s.r&&(E.s.r=N),N>E.e.r&&(E.e.r=N),o[0].slice(-2)==="/>"&&(v=Di(o[0]),v.Index&&(N=+v.Index-1)),_=0,++N):(v=Di(o[0]),v.Index&&(N=+v.Index-1),M={},(v.AutoFitHeight=="0"||v.Height)&&(M.hpx=parseInt(v.Height,10),M.hpt=kp(M.hpx),Y[N]=M),v.Hidden=="1"&&(M.hidden=!0,Y[N]=M));break;case"worksheet":if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"));p.push(m),E.s.r<=E.e.r&&E.s.c<=E.e.c&&(h["!ref"]=Tt(E),r.sheetRows&&r.sheetRows<=E.e.r&&(h["!fullref"]=h["!ref"],E.e.r=r.sheetRows-1,h["!ref"]=Tt(E))),U.length&&(h["!merges"]=U),X.length>0&&(h["!cols"]=X),Y.length>0&&(h["!rows"]=Y),f[m]=h}else E={s:{r:2e6,c:2e6},e:{r:0,c:0}},N=_=0,d.push([o[3],!1]),u=Di(o[0]),m=Wt(u.Name),h=r.dense?[]:{},U=[],W=[],Y=[],J={name:m,Hidden:0},z.Sheets.push(J);break;case"table":if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else{if(o[0].slice(-2)=="/>")break;d.push([o[3],!1]),X=[],ee=!1}break;case"style":o[1]==="/"?Wke(T,B,r):B=Di(o[0]);break;case"numberformat":B.nf=Wt(Di(o[0]).Format||"General"),Lf[B.nf]&&(B.nf=Lf[B.nf]);for(var ae=0;ae!=392&&vt[ae]!=B.nf;++ae);if(ae==392){for(ae=57;ae!=392;++ae)if(vt[ae]==null){Ao(B.nf,ae);break}}break;case"column":if(d[d.length-1][0]!=="table")break;if(K=Di(o[0]),K.Hidden&&(K.hidden=!0,delete K.Hidden),K.Width&&(K.wpx=parseInt(K.Width,10)),!ee&&K.wpx>10){ee=!0,Rn=H9;for(var ie=0;ie<X.length;++ie)X[ie]&&Uc(X[ie])}ee&&Uc(K),X[K.Index-1||X.length]=K;for(var me=0;me<+K.Span;++me)X[X.length]=Pr(K);break;case"namedrange":if(o[1]==="/")break;z.Names||(z.Names=[]);var Z=Nt(o[0]),Me={Name:Z.Name,Ref:NA(Z.RefersTo.slice(1),{r:0,c:0})};z.Sheets.length>0&&(Me.Sheet=z.Sheets.length-1),z.Names.push(Me);break;case"namedcell":break;case"b":break;case"i":break;case"u":break;case"s":break;case"em":break;case"h2":break;case"h3":break;case"sub":break;case"sup":break;case"span":break;case"alignment":break;case"borders":break;case"border":break;case"font":if(o[0].slice(-2)==="/>")break;o[1]==="/"?F+=a.slice(R,o.index):R=o.index+o[0].length;break;case"interior":if(!r.cellStyles)break;B.Interior=Di(o[0]);break;case"protection":break;case"author":case"title":case"description":case"created":case"keywords":case"subject":case"category":case"company":case"lastauthor":case"lastsaved":case"lastprinted":case"version":case"revision":case"totaltime":case"hyperlinkbase":case"manager":case"contentstatus":case"identifier":case"language":case"appname":if(o[0].slice(-2)==="/>")break;o[1]==="/"?ybe(D,re,a.slice(P,o.index)):P=o.index+o[0].length;break;case"paragraphs":break;case"styles":case"workbook":if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else d.push([o[3],!1]);break;case"comment":if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"));Xke(H),Q.push(H)}else d.push([o[3],!1]),u=Di(o[0]),H={a:u.Author};break;case"autofilter":if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else if(o[0].charAt(o[0].length-2)!=="/"){var pe=Di(o[0]);h["!autofilter"]={ref:NA(pe.Range).replace(/\$/g,"")},d.push([o[3],!0])}break;case"name":break;case"datavalidation":if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else o[0].charAt(o[0].length-2)!=="/"&&d.push([o[3],!0]);break;case"pixelsperinch":break;case"componentoptions":case"documentproperties":case"customdocumentproperties":case"officedocumentsettings":case"pivottable":case"pivotcache":case"names":case"mapinfo":case"pagebreaks":case"querytable":case"sorting":case"schema":case"conditionalformatting":case"smarttagtype":case"smarttags":case"excelworkbook":case"workbookoptions":case"worksheetoptions":if(o[1]==="/"){if((u=d.pop())[0]!==o[3])throw new Error("Bad state: "+u.join("|"))}else o[0].charAt(o[0].length-2)!=="/"&&d.push([o[3],!0]);break;case"null":break;default:if(d.length==0&&o[3]=="document"||d.length==0&&o[3]=="uof")return fU(a,r);var he=!0;switch(d[d.length-1][0]){case"officedocumentsettings":switch(o[3]){case"allowpng":break;case"removepersonalinformation":break;case"downloadcomponents":break;case"locationofcomponents":break;case"colors":break;case"color":break;case"index":break;case"rgb":break;case"targetscreensize":break;case"readonlyrecommended":break;default:he=!1}break;case"componentoptions":switch(o[3]){case"toolbar":break;case"hideofficelogo":break;case"spreadsheetautofit":break;case"label":break;case"caption":break;case"maxheight":break;case"maxwidth":break;case"nextsheetnumber":break;default:he=!1}break;case"excelworkbook":switch(o[3]){case"date1904":z.WBProps.date1904=!0;break;case"windowheight":break;case"windowwidth":break;case"windowtopx":break;case"windowtopy":break;case"tabratio":break;case"protectstructure":break;case"protectwindow":break;case"protectwindows":break;case"activesheet":break;case"displayinknotes":break;case"firstvisiblesheet":break;case"supbook":break;case"sheetname":break;case"sheetindex":break;case"sheetindexfirst":break;case"sheetindexlast":break;case"dll":break;case"acceptlabelsinformulas":break;case"donotsavelinkvalues":break;case"iteration":break;case"maxiterations":break;case"maxchange":break;case"path":break;case"xct":break;case"count":break;case"selectedsheets":break;case"calculation":break;case"uncalced":break;case"startupprompt":break;case"crn":break;case"externname":break;case"formula":break;case"colfirst":break;case"collast":break;case"wantadvise":break;case"boolean":break;case"error":break;case"text":break;case"ole":break;case"noautorecover":break;case"publishobjects":break;case"donotcalculatebeforesave":break;case"number":break;case"refmoder1c1":break;case"embedsavesmarttags":break;default:he=!1}break;case"workbookoptions":switch(o[3]){case"owcversion":break;case"height":break;case"width":break;default:he=!1}break;case"worksheetoptions":switch(o[3]){case"visible":if(o[0].slice(-2)!=="/>")if(o[1]==="/")switch(a.slice(P,o.index)){case"SheetHidden":J.Hidden=1;break;case"SheetVeryHidden":J.Hidden=2;break}else P=o.index+o[0].length;break;case"header":h["!margins"]||Dd(h["!margins"]={},"xlml"),isNaN(+Nt(o[0]).Margin)||(h["!margins"].header=+Nt(o[0]).Margin);break;case"footer":h["!margins"]||Dd(h["!margins"]={},"xlml"),isNaN(+Nt(o[0]).Margin)||(h["!margins"].footer=+Nt(o[0]).Margin);break;case"pagemargins":var ye=Nt(o[0]);h["!margins"]||Dd(h["!margins"]={},"xlml"),isNaN(+ye.Top)||(h["!margins"].top=+ye.Top),isNaN(+ye.Left)||(h["!margins"].left=+ye.Left),isNaN(+ye.Right)||(h["!margins"].right=+ye.Right),isNaN(+ye.Bottom)||(h["!margins"].bottom=+ye.Bottom);break;case"displayrighttoleft":z.Views||(z.Views=[]),z.Views[0]||(z.Views[0]={}),z.Views[0].RTL=!0;break;case"freezepanes":break;case"frozennosplit":break;case"splithorizontal":case"splitvertical":break;case"donotdisplaygridlines":break;case"activerow":break;case"activecol":break;case"toprowbottompane":break;case"leftcolumnrightpane":break;case"unsynced":break;case"print":break;case"printerrors":break;case"panes":break;case"scale":break;case"pane":break;case"number":break;case"layout":break;case"pagesetup":break;case"selected":break;case"protectobjects":break;case"enableselection":break;case"protectscenarios":break;case"validprinterinfo":break;case"horizontalresolution":break;case"verticalresolution":break;case"numberofcopies":break;case"activepane":break;case"toprowvisible":break;case"leftcolumnvisible":break;case"fittopage":break;case"rangeselection":break;case"papersizeindex":break;case"pagelayoutzoom":break;case"pagebreakzoom":break;case"filteron":break;case"fitwidth":break;case"fitheight":break;case"commentslayout":break;case"zoom":break;case"lefttoright":break;case"gridlines":break;case"allowsort":break;case"allowfilter":break;case"allowinsertrows":break;case"allowdeleterows":break;case"allowinsertcols":break;case"allowdeletecols":break;case"allowinserthyperlinks":break;case"allowformatcells":break;case"allowsizecols":break;case"allowsizerows":break;case"nosummaryrowsbelowdetail":h["!outline"]||(h["!outline"]={}),h["!outline"].above=!0;break;case"tabcolorindex":break;case"donotdisplayheadings":break;case"showpagelayoutzoom":break;case"nosummarycolumnsrightdetail":h["!outline"]||(h["!outline"]={}),h["!outline"].left=!0;break;case"blackandwhite":break;case"donotdisplayzeros":break;case"displaypagebreak":break;case"rowcolheadings":break;case"donotdisplayoutline":break;case"noorientation":break;case"allowusepivottables":break;case"zeroheight":break;case"viewablerange":break;case"selection":break;case"protectcontents":break;default:he=!1}break;case"pivottable":case"pivotcache":switch(o[3]){case"immediateitemsondrop":break;case"showpagemultipleitemlabel":break;case"compactrowindent":break;case"location":break;case"pivotfield":break;case"orientation":break;case"layoutform":break;case"layoutsubtotallocation":break;case"layoutcompactrow":break;case"position":break;case"pivotitem":break;case"datatype":break;case"datafield":break;case"sourcename":break;case"parentfield":break;case"ptlineitems":break;case"ptlineitem":break;case"countofsameitems":break;case"item":break;case"itemtype":break;case"ptsource":break;case"cacheindex":break;case"consolidationreference":break;case"filename":break;case"reference":break;case"nocolumngrand":break;case"norowgrand":break;case"blanklineafteritems":break;case"hidden":break;case"subtotal":break;case"basefield":break;case"mapchilditems":break;case"function":break;case"refreshonfileopen":break;case"printsettitles":break;case"mergelabels":break;case"defaultversion":break;case"refreshname":break;case"refreshdate":break;case"refreshdatecopy":break;case"versionlastrefresh":break;case"versionlastupdate":break;case"versionupdateablemin":break;case"versionrefreshablemin":break;case"calculation":break;default:he=!1}break;case"pagebreaks":switch(o[3]){case"colbreaks":break;case"colbreak":break;case"rowbreaks":break;case"rowbreak":break;case"colstart":break;case"colend":break;case"rowend":break;default:he=!1}break;case"autofilter":switch(o[3]){case"autofiltercolumn":break;case"autofiltercondition":break;case"autofilterand":break;case"autofilteror":break;default:he=!1}break;case"querytable":switch(o[3]){case"id":break;case"autoformatfont":break;case"autoformatpattern":break;case"querysource":break;case"querytype":break;case"enableredirections":break;case"refreshedinxl9":break;case"urlstring":break;case"htmltables":break;case"connection":break;case"commandtext":break;case"refreshinfo":break;case"notitles":break;case"nextid":break;case"columninfo":break;case"overwritecells":break;case"donotpromptforfile":break;case"textwizardsettings":break;case"source":break;case"number":break;case"decimal":break;case"thousandseparator":break;case"trailingminusnumbers":break;case"formatsettings":break;case"fieldtype":break;case"delimiters":break;case"tab":break;case"comma":break;case"autoformatname":break;case"versionlastedit":break;case"versionlastrefresh":break;default:he=!1}break;case"datavalidation":switch(o[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;case"cellrangelist":break;default:he=!1}break;case"sorting":case"conditionalformatting":switch(o[3]){case"range":break;case"type":break;case"min":break;case"max":break;case"sort":break;case"descending":break;case"order":break;case"casesensitive":break;case"value":break;case"errorstyle":break;case"errormessage":break;case"errortitle":break;case"cellrangelist":break;case"inputmessage":break;case"inputtitle":break;case"combohide":break;case"inputhide":break;case"condition":break;case"qualifier":break;case"useblank":break;case"value1":break;case"value2":break;case"format":break;default:he=!1}break;case"mapinfo":case"schema":case"data":switch(o[3]){case"map":break;case"entry":break;case"range":break;case"xpath":break;case"field":break;case"xsdtype":break;case"filteron":break;case"aggregate":break;case"elementtype":break;case"attributetype":break;case"schema":case"element":case"complextype":case"datatype":case"all":case"attribute":case"extends":break;case"row":break;default:he=!1}break;case"smarttags":break;default:he=!1;break}if(he||o[3].match(/!\[CDATA/))break;if(!d[d.length-1][1])throw"Unrecognized tag: "+o[3]+"|"+d.join("|");if(d[d.length-1][0]==="customdocumentproperties"){if(o[0].slice(-2)==="/>")break;o[1]==="/"?Kke(L,re,G,a.slice(P,o.index)):(G=o,P=o.index+o[0].length);break}if(r.WTF)throw"Unrecognized tag: "+o[3]+"|"+d.join("|")}var fe={};return!r.bookSheets&&!r.bookProps&&(fe.Sheets=f),fe.SheetNames=p,fe.Workbook=z,fe.SSF=Pr(vt),fe.Props=D,fe.Custprops=L,fe}function TC(e,t){switch(RE(t=t||{}),t.type||"base64"){case"base64":return U2(Vs(e),t);case"binary":case"buffer":case"file":return U2(e,t);case"array":return U2(Gc(e),t)}}function Jke(e,t){var r=[];return e.Props&&r.push(wbe(e.Props,t)),e.Custprops&&r.push(Nbe(e.Props,e.Custprops)),r.join("")}function Zke(){return""}function eje(e,t){var r=['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];return t.cellXfs.forEach(function(a,s){var i=[];i.push(We("NumberFormat",null,{"ss:Format":ur(vt[a.numFmtId])}));var l={"ss:ID":"s"+(21+s)};r.push(We("Style",i.join(""),l))}),We("Styles",r.join(""))}function xH(e){return We("NamedRange",null,{"ss:Name":e.Name,"ss:RefersTo":"="+TE(e.Ref,{r:0,c:0})})}function tje(e){if(!((e||{}).Workbook||{}).Names)return"";for(var t=e.Workbook.Names,r=[],a=0;a<t.length;++a){var s=t[a];s.Sheet==null&&(s.Name.match(/^_xlfn\./)||r.push(xH(s)))}return We("Names",r.join(""))}function rje(e,t,r,a){if(!e||!((a||{}).Workbook||{}).Names)return"";for(var s=a.Workbook.Names,i=[],l=0;l<s.length;++l){var o=s[l];o.Sheet==r&&(o.Name.match(/^_xlfn\./)||i.push(xH(o)))}return i.join("")}function aje(e,t,r,a){if(!e)return"";var s=[];if(e["!margins"]&&(s.push("<PageSetup>"),e["!margins"].header&&s.push(We("Header",null,{"x:Margin":e["!margins"].header})),e["!margins"].footer&&s.push(We("Footer",null,{"x:Margin":e["!margins"].footer})),s.push(We("PageMargins",null,{"x:Bottom":e["!margins"].bottom||"0.75","x:Left":e["!margins"].left||"0.7","x:Right":e["!margins"].right||"0.7","x:Top":e["!margins"].top||"0.75"})),s.push("</PageSetup>")),a&&a.Workbook&&a.Workbook.Sheets&&a.Workbook.Sheets[r])if(a.Workbook.Sheets[r].Hidden)s.push(We("Visible",a.Workbook.Sheets[r].Hidden==1?"SheetHidden":"SheetVeryHidden",{}));else{for(var i=0;i<r&&!(a.Workbook.Sheets[i]&&!a.Workbook.Sheets[i].Hidden);++i);i==r&&s.push("<Selected/>")}return((((a||{}).Workbook||{}).Views||[])[0]||{}).RTL&&s.push("<DisplayRightToLeft/>"),e["!protect"]&&(s.push(yn("ProtectContents","True")),e["!protect"].objects&&s.push(yn("ProtectObjects","True")),e["!protect"].scenarios&&s.push(yn("ProtectScenarios","True")),e["!protect"].selectLockedCells!=null&&!e["!protect"].selectLockedCells?s.push(yn("EnableSelection","NoSelection")):e["!protect"].selectUnlockedCells!=null&&!e["!protect"].selectUnlockedCells&&s.push(yn("EnableSelection","UnlockedCells")),[["formatCells","AllowFormatCells"],["formatColumns","AllowSizeCols"],["formatRows","AllowSizeRows"],["insertColumns","AllowInsertCols"],["insertRows","AllowInsertRows"],["insertHyperlinks","AllowInsertHyperlinks"],["deleteColumns","AllowDeleteCols"],["deleteRows","AllowDeleteRows"],["sort","AllowSort"],["autoFilter","AllowFilter"],["pivotTables","AllowUsePivotTables"]].forEach(function(l){e["!protect"][l[0]]&&s.push("<"+l[1]+"/>")})),s.length==0?"":We("WorksheetOptions",s.join(""),{xmlns:Ds.x})}function nje(e){return e.map(function(t){var r=kge(t.t||""),a=We("ss:Data",r,{xmlns:"http://www.w3.org/TR/REC-html40"});return We("Comment",a,{"ss:Author":t.a})}).join("")}function sje(e,t,r,a,s,i,l){if(!e||e.v==null&&e.f==null)return"";var o={};if(e.f&&(o["ss:Formula"]="="+ur(TE(e.f,l))),e.F&&e.F.slice(0,t.length)==t){var d=Zr(e.F.slice(t.length+1));o["ss:ArrayRange"]="RC:R"+(d.r==l.r?"":"["+(d.r-l.r)+"]")+"C"+(d.c==l.c?"":"["+(d.c-l.c)+"]")}if(e.l&&e.l.Target&&(o["ss:HRef"]=ur(e.l.Target),e.l.Tooltip&&(o["x:HRefScreenTip"]=ur(e.l.Tooltip))),r["!merges"])for(var u=r["!merges"],f=0;f!=u.length;++f)u[f].s.c!=l.c||u[f].s.r!=l.r||(u[f].e.c>u[f].s.c&&(o["ss:MergeAcross"]=u[f].e.c-u[f].s.c),u[f].e.r>u[f].s.r&&(o["ss:MergeDown"]=u[f].e.r-u[f].s.r));var p="",h="";switch(e.t){case"z":if(!a.sheetStubs)return"";break;case"n":p="Number",h=String(e.v);break;case"b":p="Boolean",h=e.v?"1":"0";break;case"e":p="Error",h=Po[e.v];break;case"d":p="DateTime",h=new Date(e.v).toISOString(),e.z==null&&(e.z=e.z||vt[14]);break;case"s":p="String",h=Cge(e.v||"");break}var m=qc(a.cellXfs,e,a);o["ss:StyleID"]="s"+(21+m),o["ss:Index"]=l.c+1;var b=e.v!=null?h:"",v=e.t=="z"?"":'<Data ss:Type="'+p+'">'+b+"</Data>";return(e.c||[]).length>0&&(v+=nje(e.c)),We("Cell",v,o)}function ije(e,t){var r='<Row ss:Index="'+(e+1)+'"';return t&&(t.hpt&&!t.hpx&&(t.hpx=MA(t.hpt)),t.hpx&&(r+=' ss:AutoFitHeight="0" ss:Height="'+t.hpx+'"'),t.hidden&&(r+=' ss:Hidden="1"')),r+">"}function lje(e,t,r,a){if(!e["!ref"])return"";var s=Yt(e["!ref"]),i=e["!merges"]||[],l=0,o=[];e["!cols"]&&e["!cols"].forEach(function(y,j){Uc(y);var _=!!y.width,N=hv(j,y),E={"ss:Index":j+1};_&&(E["ss:Width"]=Np(N.width)),y.hidden&&(E["ss:Hidden"]="1"),o.push(We("Column",null,E))});for(var d=Array.isArray(e),u=s.s.r;u<=s.e.r;++u){for(var f=[ije(u,(e["!rows"]||[])[u])],p=s.s.c;p<=s.e.c;++p){var h=!1;for(l=0;l!=i.length;++l)if(!(i[l].s.c>p)&&!(i[l].s.r>u)&&!(i[l].e.c<p)&&!(i[l].e.r<u)){(i[l].s.c!=p||i[l].s.r!=u)&&(h=!0);break}if(!h){var m={r:u,c:p},b=yt(m),v=d?(e[u]||[])[p]:e[b];f.push(sje(v,b,e,t,r,a,m))}}f.push("</Row>"),f.length>2&&o.push(f.join(""))}return o.join("")}function oje(e,t,r){var a=[],s=r.SheetNames[e],i=r.Sheets[s],l=i?rje(i,t,e,r):"";return l.length>0&&a.push("<Names>"+l+"</Names>"),l=i?lje(i,t,e,r):"",l.length>0&&a.push("<Table>"+l+"</Table>"),a.push(aje(i,t,e,r)),a.join("")}function cje(e,t){t||(t={}),e.SSF||(e.SSF=Pr(vt)),e.SSF&&(a0(),cv(e.SSF),t.revssf=uv(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF,t.cellXfs=[],qc(t.cellXfs,{},{revssf:{General:0}}));var r=[];r.push(Jke(e,t)),r.push(Zke()),r.push(""),r.push("");for(var a=0;a<e.SheetNames.length;++a)r.push(We("Worksheet",oje(a,t,e),{"ss:Name":ur(e.SheetNames[a])}));return r[2]=eje(e,t),r[3]=tje(e),wa+We("Workbook",r.join(""),{xmlns:Ds.ss,"xmlns:o":Ds.o,"xmlns:x":Ds.x,"xmlns:ss":Ds.ss,"xmlns:dt":Ds.dt,"xmlns:html":Ds.html})}function dje(e){var t={},r=e.content;if(r.l=28,t.AnsiUserType=r.read_shift(0,"lpstr-ansi"),t.AnsiClipboardFormat=tbe(r),r.length-r.l<=4)return t;var a=r.read_shift(4);if(a==0||a>40||(r.l-=4,t.Reserved1=r.read_shift(0,"lpstr-ansi"),r.length-r.l<=4)||(a=r.read_shift(4),a!==1907505652)||(t.UnicodeClipboardFormat=rbe(r),a=r.read_shift(4),a==0||a>40))return t;r.l-=4,t.Reserved2=r.read_shift(0,"lpwstr")}var uje=[60,1084,2066,2165,2175];function Aje(e,t,r,a,s){var i=a,l=[],o=r.slice(r.l,r.l+i);if(s&&s.enc&&s.enc.insitu&&o.length>0)switch(e){case 9:case 521:case 1033:case 2057:case 47:case 405:case 225:case 406:case 312:case 404:case 10:break;case 133:break;default:s.enc.insitu(o)}l.push(o),r.l+=i;for(var d=lo(r,r.l),u=IC[d],f=0;u!=null&&uje.indexOf(d)>-1;)i=lo(r,r.l+2),f=r.l+4,d==2066?f+=4:(d==2165||d==2175)&&(f+=12),o=r.slice(f,r.l+4+i),l.push(o),r.l+=4+i,u=IC[d=lo(r,r.l)];var p=en(l);vn(p,0);var h=0;p.lens=[];for(var m=0;m<l.length;++m)p.lens.push(h),h+=l[m].length;if(p.length<a)throw"XLS Record 0x"+e.toString(16)+" Truncated: "+p.length+" < "+a;return t.f(p,p.length,s)}function cl(e,t,r){if(e.t!=="z"&&e.XF){var a=0;try{a=e.z||e.XF.numFmtId||0,t.cellNF&&(e.z=vt[a])}catch(i){if(t.WTF)throw i}if(!t||t.cellText!==!1)try{e.t==="e"?e.w=e.w||Po[e.v]:a===0||a=="General"?e.t==="n"?(e.v|0)===e.v?e.w=e.v.toString(10):e.w=mp(e.v):e.w=Gd(e.v):e.w=ji(a,e.v,{date1904:!!r,dateNF:t&&t.dateNF})}catch(i){if(t.WTF)throw i}if(t.cellDates&&a&&e.t=="n"&&r0(vt[a]||String(a))){var s=kd(e.v);s&&(e.t="d",e.v=new Date(s.y,s.m-1,s.d,s.H,s.M,s.S,s.u))}}}function Yh(e,t,r){return{v:e,ixfe:t,t:r}}function fje(e,t){var r={opts:{}},a={},s=t.dense?[]:{},i={},l={},o=null,d=[],u="",f={},p,h="",m,b,v,y,j={},_=[],N,E,T=[],B=[],F={Sheets:[],WBProps:{date1904:!1},Views:[{}]},R={},U=function(it){return it<8?Td[it]:it<64&&B[it-8]||Td[it]},D=function(it,Rt,Et){var jt=Rt.XF.data;if(!(!jt||!jt.patternType||!Et||!Et.cellStyles)){Rt.s={},Rt.s.patternType=jt.patternType;var Kt;(Kt=wp(U(jt.icvFore)))&&(Rt.s.fgColor={rgb:Kt}),(Kt=wp(U(jt.icvBack)))&&(Rt.s.bgColor={rgb:Kt})}},L=function(it,Rt,Et){if(!(M>1)&&!(Et.sheetRows&&it.r>=Et.sheetRows)){if(Et.cellStyles&&Rt.XF&&Rt.XF.data&&D(it,Rt,Et),delete Rt.ixfe,delete Rt.XF,p=it,h=yt(it),(!l||!l.s||!l.e)&&(l={s:{r:0,c:0},e:{r:0,c:0}}),it.r<l.s.r&&(l.s.r=it.r),it.c<l.s.c&&(l.s.c=it.c),it.r+1>l.e.r&&(l.e.r=it.r+1),it.c+1>l.e.c&&(l.e.c=it.c+1),Et.cellFormula&&Rt.f){for(var jt=0;jt<_.length;++jt)if(!(_[jt][0].s.c>it.c||_[jt][0].s.r>it.r)&&!(_[jt][0].e.c<it.c||_[jt][0].e.r<it.r)){Rt.F=Tt(_[jt][0]),(_[jt][0].s.c!=it.c||_[jt][0].s.r!=it.r)&&delete Rt.f,Rt.f&&(Rt.f=""+Dn(_[jt][1],l,it,W,P));break}}Et.dense?(s[it.r]||(s[it.r]=[]),s[it.r][it.c]=Rt):s[h]=Rt}},P={enc:!1,sbcch:0,snames:[],sharedf:j,arrayf:_,rrtabid:[],lastuser:"",biff:8,codepage:0,winlocked:0,cellStyles:!!t&&!!t.cellStyles,WTF:!!t&&!!t.wtf};t.password&&(P.password=t.password);var G,Q=[],H=[],X=[],K=[],ee=!1,W=[];W.SheetNames=P.snames,W.sharedf=P.sharedf,W.arrayf=P.arrayf,W.names=[],W.XTI=[];var Y=0,M=0,O=0,q=[],z=[],J;P.codepage=1200,Pi(1200);for(var re=!1;e.l<e.length-1;){var le=e.l,ne=e.read_shift(2);if(ne===0&&Y===10)break;var ae=e.l===e.length?0:e.read_shift(2),ie=IC[ne];if(ie&&ie.f){if(t.bookSheets&&Y===133&&ne!==133)break;if(Y=ne,ie.r===2||ie.r==12){var me=e.read_shift(2);if(ae-=2,!P.enc&&me!==ne&&((me&255)<<8|me>>8)!==ne)throw new Error("rt mismatch: "+me+"!="+ne);ie.r==12&&(e.l+=10,ae-=10)}var Z={};if(ne===10?Z=ie.f(e,ae,P):Z=Aje(ne,ie,e,ae,P),M==0&&[9,521,1033,2057].indexOf(Y)===-1)continue;switch(ne){case 34:r.opts.Date1904=F.WBProps.date1904=Z;break;case 134:r.opts.WriteProtect=!0;break;case 47:if(P.enc||(e.l=0),P.enc=Z,!t.password)throw new Error("File is password-protected");if(Z.valid==null)throw new Error("Encryption scheme unsupported");if(!Z.valid)throw new Error("Password is incorrect");break;case 92:P.lastuser=Z;break;case 66:var Me=Number(Z);switch(Me){case 21010:Me=1200;break;case 32768:Me=1e4;break;case 32769:Me=1252;break}Pi(P.codepage=Me),re=!0;break;case 317:P.rrtabid=Z;break;case 25:P.winlocked=Z;break;case 439:r.opts.RefreshAll=Z;break;case 12:r.opts.CalcCount=Z;break;case 16:r.opts.CalcDelta=Z;break;case 17:r.opts.CalcIter=Z;break;case 13:r.opts.CalcMode=Z;break;case 14:r.opts.CalcPrecision=Z;break;case 95:r.opts.CalcSaveRecalc=Z;break;case 15:P.CalcRefMode=Z;break;case 2211:r.opts.FullCalc=Z;break;case 129:Z.fDialog&&(s["!type"]="dialog"),Z.fBelow||((s["!outline"]||(s["!outline"]={})).above=!0),Z.fRight||((s["!outline"]||(s["!outline"]={})).left=!0);break;case 224:T.push(Z);break;case 430:W.push([Z]),W[W.length-1].XTI=[];break;case 35:case 547:W[W.length-1].push(Z);break;case 24:case 536:J={Name:Z.Name,Ref:Dn(Z.rgce,l,null,W,P)},Z.itab>0&&(J.Sheet=Z.itab-1),W.names.push(J),W[0]||(W[0]=[],W[0].XTI=[]),W[W.length-1].push(Z),Z.Name=="_xlnm._FilterDatabase"&&Z.itab>0&&Z.rgce&&Z.rgce[0]&&Z.rgce[0][0]&&Z.rgce[0][0][0]=="PtgArea3d"&&(z[Z.itab-1]={ref:Tt(Z.rgce[0][0][1][2])});break;case 22:P.ExternCount=Z;break;case 23:W.length==0&&(W[0]=[],W[0].XTI=[]),W[W.length-1].XTI=W[W.length-1].XTI.concat(Z),W.XTI=W.XTI.concat(Z);break;case 2196:if(P.biff<8)break;J!=null&&(J.Comment=Z[1]);break;case 18:s["!protect"]=Z;break;case 19:Z!==0&&P.WTF&&console.error("Password verifier: "+Z);break;case 133:i[Z.pos]=Z,P.snames.push(Z.name);break;case 10:{if(--M)break;if(l.e){if(l.e.r>0&&l.e.c>0){if(l.e.r--,l.e.c--,s["!ref"]=Tt(l),t.sheetRows&&t.sheetRows<=l.e.r){var pe=l.e.r;l.e.r=t.sheetRows-1,s["!fullref"]=s["!ref"],s["!ref"]=Tt(l),l.e.r=pe}l.e.r++,l.e.c++}Q.length>0&&(s["!merges"]=Q),H.length>0&&(s["!objects"]=H),X.length>0&&(s["!cols"]=X),K.length>0&&(s["!rows"]=K),F.Sheets.push(R)}u===""?f=s:a[u]=s,s=t.dense?[]:{}}break;case 9:case 521:case 1033:case 2057:{if(P.biff===8&&(P.biff={9:2,521:3,1033:4}[ne]||{512:2,768:3,1024:4,1280:5,1536:8,2:2,7:2}[Z.BIFFVer]||8),P.biffguess=Z.BIFFVer==0,Z.BIFFVer==0&&Z.dt==4096&&(P.biff=5,re=!0,Pi(P.codepage=28591)),P.biff==8&&Z.BIFFVer==0&&Z.dt==16&&(P.biff=2),M++)break;if(s=t.dense?[]:{},P.biff<8&&!re&&(re=!0,Pi(P.codepage=t.codepage||1252)),P.biff<5||Z.BIFFVer==0&&Z.dt==4096){u===""&&(u="Sheet1"),l={s:{r:0,c:0},e:{r:0,c:0}};var he={pos:e.l-ae,name:u};i[he.pos]=he,P.snames.push(u)}else u=(i[le]||{name:""}).name;Z.dt==32&&(s["!type"]="chart"),Z.dt==64&&(s["!type"]="macro"),Q=[],H=[],P.arrayf=_=[],X=[],K=[],ee=!1,R={Hidden:(i[le]||{hs:0}).hs,name:u}}break;case 515:case 3:case 2:s["!type"]=="chart"&&(t.dense?(s[Z.r]||[])[Z.c]:s[yt({c:Z.c,r:Z.r})])&&++Z.c,N={ixfe:Z.ixfe,XF:T[Z.ixfe]||{},v:Z.val,t:"n"},O>0&&(N.z=q[N.ixfe>>8&63]),cl(N,t,r.opts.Date1904),L({c:Z.c,r:Z.r},N,t);break;case 5:case 517:N={ixfe:Z.ixfe,XF:T[Z.ixfe],v:Z.val,t:Z.t},O>0&&(N.z=q[N.ixfe>>8&63]),cl(N,t,r.opts.Date1904),L({c:Z.c,r:Z.r},N,t);break;case 638:N={ixfe:Z.ixfe,XF:T[Z.ixfe],v:Z.rknum,t:"n"},O>0&&(N.z=q[N.ixfe>>8&63]),cl(N,t,r.opts.Date1904),L({c:Z.c,r:Z.r},N,t);break;case 189:for(var ye=Z.c;ye<=Z.C;++ye){var fe=Z.rkrec[ye-Z.c][0];N={ixfe:fe,XF:T[fe],v:Z.rkrec[ye-Z.c][1],t:"n"},O>0&&(N.z=q[N.ixfe>>8&63]),cl(N,t,r.opts.Date1904),L({c:ye,r:Z.r},N,t)}break;case 6:case 518:case 1030:{if(Z.val=="String"){o=Z;break}if(N=Yh(Z.val,Z.cell.ixfe,Z.tt),N.XF=T[N.ixfe],t.cellFormula){var Ue=Z.formula;if(Ue&&Ue[0]&&Ue[0][0]&&Ue[0][0][0]=="PtgExp"){var qe=Ue[0][0][1][0],at=Ue[0][0][1][1],nt=yt({r:qe,c:at});j[nt]?N.f=""+Dn(Z.formula,l,Z.cell,W,P):N.F=((t.dense?(s[qe]||[])[at]:s[nt])||{}).F}else N.f=""+Dn(Z.formula,l,Z.cell,W,P)}O>0&&(N.z=q[N.ixfe>>8&63]),cl(N,t,r.opts.Date1904),L(Z.cell,N,t),o=Z}break;case 7:case 519:if(o)o.val=Z,N=Yh(Z,o.cell.ixfe,"s"),N.XF=T[N.ixfe],t.cellFormula&&(N.f=""+Dn(o.formula,l,o.cell,W,P)),O>0&&(N.z=q[N.ixfe>>8&63]),cl(N,t,r.opts.Date1904),L(o.cell,N,t),o=null;else throw new Error("String record expects Formula");break;case 33:case 545:{_.push(Z);var Ct=yt(Z[0].s);if(m=t.dense?(s[Z[0].s.r]||[])[Z[0].s.c]:s[Ct],t.cellFormula&&m){if(!o||!Ct||!m)break;m.f=""+Dn(Z[1],l,Z[0],W,P),m.F=Tt(Z[0])}}break;case 1212:{if(!t.cellFormula)break;if(h){if(!o)break;j[yt(o.cell)]=Z[0],m=t.dense?(s[o.cell.r]||[])[o.cell.c]:s[yt(o.cell)],(m||{}).f=""+Dn(Z[0],l,p,W,P)}}break;case 253:N=Yh(d[Z.isst].t,Z.ixfe,"s"),d[Z.isst].h&&(N.h=d[Z.isst].h),N.XF=T[N.ixfe],O>0&&(N.z=q[N.ixfe>>8&63]),cl(N,t,r.opts.Date1904),L({c:Z.c,r:Z.r},N,t);break;case 513:t.sheetStubs&&(N={ixfe:Z.ixfe,XF:T[Z.ixfe],t:"z"},O>0&&(N.z=q[N.ixfe>>8&63]),cl(N,t,r.opts.Date1904),L({c:Z.c,r:Z.r},N,t));break;case 190:if(t.sheetStubs)for(var kt=Z.c;kt<=Z.C;++kt){var ft=Z.ixfe[kt-Z.c];N={ixfe:ft,XF:T[ft],t:"z"},O>0&&(N.z=q[N.ixfe>>8&63]),cl(N,t,r.opts.Date1904),L({c:kt,r:Z.r},N,t)}break;case 214:case 516:case 4:N=Yh(Z.val,Z.ixfe,"s"),N.XF=T[N.ixfe],O>0&&(N.z=q[N.ixfe>>8&63]),cl(N,t,r.opts.Date1904),L({c:Z.c,r:Z.r},N,t);break;case 0:case 512:M===1&&(l=Z);break;case 252:d=Z;break;case 1054:if(P.biff==4){q[O++]=Z[1];for(var _r=0;_r<O+163&&vt[_r]!=Z[1];++_r);_r>=163&&Ao(Z[1],O+163)}else Ao(Z[1],Z[0]);break;case 30:{q[O++]=Z;for(var Ar=0;Ar<O+163&&vt[Ar]!=Z;++Ar);Ar>=163&&Ao(Z,O+163)}break;case 229:Q=Q.concat(Z);break;case 93:H[Z.cmo[0]]=P.lastobj=Z;break;case 438:P.lastobj.TxO=Z;break;case 127:P.lastobj.ImData=Z;break;case 440:for(y=Z[0].s.r;y<=Z[0].e.r;++y)for(v=Z[0].s.c;v<=Z[0].e.c;++v)m=t.dense?(s[y]||[])[v]:s[yt({c:v,r:y})],m&&(m.l=Z[1]);break;case 2048:for(y=Z[0].s.r;y<=Z[0].e.r;++y)for(v=Z[0].s.c;v<=Z[0].e.c;++v)m=t.dense?(s[y]||[])[v]:s[yt({c:v,r:y})],m&&m.l&&(m.l.Tooltip=Z[1]);break;case 28:{if(P.biff<=5&&P.biff>=2)break;m=t.dense?(s[Z[0].r]||[])[Z[0].c]:s[yt(Z[0])];var pa=H[Z[2]];m||(t.dense?(s[Z[0].r]||(s[Z[0].r]=[]),m=s[Z[0].r][Z[0].c]={t:"z"}):m=s[yt(Z[0])]={t:"z"},l.e.r=Math.max(l.e.r,Z[0].r),l.s.r=Math.min(l.s.r,Z[0].r),l.e.c=Math.max(l.e.c,Z[0].c),l.s.c=Math.min(l.s.c,Z[0].c)),m.c||(m.c=[]),b={a:Z[1],t:pa.TxO.t},m.c.push(b)}break;case 2173:ewe(T[Z.ixfe],Z.ext);break;case 125:{if(!P.cellStyles)break;for(;Z.e>=Z.s;)X[Z.e--]={width:Z.w/256,level:Z.level||0,hidden:!!(Z.flags&1)},ee||(ee=!0,SE(Z.w/256)),Uc(X[Z.e+1])}break;case 520:{var Ut={};Z.level!=null&&(K[Z.r]=Ut,Ut.level=Z.level),Z.hidden&&(K[Z.r]=Ut,Ut.hidden=!0),Z.hpt&&(K[Z.r]=Ut,Ut.hpt=Z.hpt,Ut.hpx=MA(Z.hpt))}break;case 38:case 39:case 40:case 41:s["!margins"]||Dd(s["!margins"]={}),s["!margins"][{38:"left",39:"right",40:"top",41:"bottom"}[ne]]=Z;break;case 161:s["!margins"]||Dd(s["!margins"]={}),s["!margins"].header=Z.header,s["!margins"].footer=Z.footer;break;case 574:Z.RTL&&(F.Views[0].RTL=!0);break;case 146:B=Z;break;case 2198:G=Z;break;case 140:E=Z;break;case 442:u?R.CodeName=Z||R.name:F.WBProps.CodeName=Z||"ThisWorkbook";break}}else ie||console.error("Missing Info for XLS Record 0x"+ne.toString(16)),e.l+=ae}return r.SheetNames=fa(i).sort(function(Tr,it){return Number(Tr)-Number(it)}).map(function(Tr){return i[Tr].name}),t.bookSheets||(r.Sheets=a),!r.SheetNames.length&&f["!ref"]?(r.SheetNames.push("Sheet1"),r.Sheets&&(r.Sheets.Sheet1=f)):r.Preamble=f,r.Sheets&&z.forEach(function(Tr,it){r.Sheets[r.SheetNames[it]]["!autofilter"]=Tr}),r.Strings=d,r.SSF=Pr(vt),P.enc&&(r.Encryption=P.enc),G&&(r.Themes=G),r.Metadata={},E!==void 0&&(r.Metadata.Country=E),W.names.length>0&&(F.Names=W.names),r.Workbook=F,r}var Qf={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function pje(e,t,r){var a=xt.find(e,"/!DocumentSummaryInformation");if(a&&a.size>0)try{var s=zD(a,kC,Qf.DSI);for(var i in s)t[i]=s[i]}catch(u){if(r.WTF)throw u}var l=xt.find(e,"/!SummaryInformation");if(l&&l.size>0)try{var o=zD(l,jC,Qf.SI);for(var d in o)t[d]==null&&(t[d]=o[d])}catch(u){if(r.WTF)throw u}t.HeadingPairs&&t.TitlesOfParts&&(p9(t.HeadingPairs,t.TitlesOfParts,t,r),delete t.HeadingPairs,delete t.TitlesOfParts)}function xje(e,t){var r=[],a=[],s=[],i=0,l,o=bD(kC,"n"),d=bD(jC,"n");if(e.Props)for(l=fa(e.Props),i=0;i<l.length;++i)(Object.prototype.hasOwnProperty.call(o,l[i])?r:Object.prototype.hasOwnProperty.call(d,l[i])?a:s).push([l[i],e.Props[l[i]]]);if(e.Custprops)for(l=fa(e.Custprops),i=0;i<l.length;++i)Object.prototype.hasOwnProperty.call(e.Props||{},l[i])||(Object.prototype.hasOwnProperty.call(o,l[i])?r:Object.prototype.hasOwnProperty.call(d,l[i])?a:s).push([l[i],e.Custprops[l[i]]]);var u=[];for(i=0;i<s.length;++i)y9.indexOf(s[i][0])>-1||f9.indexOf(s[i][0])>-1||s[i][1]!=null&&u.push(s[i]);a.length&&xt.utils.cfb_add(t,"/SummaryInformation",$D(a,Qf.SI,d,jC)),(r.length||u.length)&&xt.utils.cfb_add(t,"/DocumentSummaryInformation",$D(r,Qf.DSI,o,kC,u.length?u:null,Qf.UDI))}function hH(e,t){t||(t={}),RE(t),nE(),t.codepage&&aE(t.codepage);var r,a;if(e.FullPaths){if(xt.find(e,"/encryption"))throw new Error("File is password-protected");r=xt.find(e,"!CompObj"),a=xt.find(e,"/Workbook")||xt.find(e,"/Book")}else{switch(t.type){case"base64":e=Rs(Vs(e));break;case"binary":e=Rs(e);break;case"buffer":break;case"array":Array.isArray(e)||(e=Array.prototype.slice.call(e));break}vn(e,0),a={content:e}}var s,i;if(r&&dje(r),t.bookProps&&!t.bookSheets)s={};else{var l=Mt?"buffer":"array";if(a&&a.content)s=fje(a.content,t);else if((i=xt.find(e,"PerfectOffice_MAIN"))&&i.content)s=Fd.to_workbook(i.content,(t.type=l,t));else if((i=xt.find(e,"NativeContent_MAIN"))&&i.content)s=Fd.to_workbook(i.content,(t.type=l,t));else throw(i=xt.find(e,"MN0"))&&i.content?new Error("Unsupported Works 4 for Mac file"):new Error("Cannot find Workbook stream");t.bookVBA&&e.FullPaths&&xt.find(e,"/_VBA_PROJECT_CUR/VBA/dir")&&(s.vbaraw=Swe(e))}var o={};return e.FullPaths&&pje(e,o,t),s.Props=s.Custprops=o,t.bookFiles&&(s.cfb=e),s}function hje(e,t){var r=t||{},a=xt.utils.cfb_new({root:"R"}),s="/Workbook";switch(r.bookType||"xls"){case"xls":r.bookType="biff8";case"xla":r.bookType||(r.bookType="xla");case"biff8":s="/Workbook",r.biff=8;break;case"biff5":s="/Book",r.biff=5;break;default:throw new Error("invalid type "+r.bookType+" for XLS CFB")}return xt.utils.cfb_add(a,s,mH(e,r)),r.biff==8&&(e.Props||e.Custprops)&&xje(e,a),r.biff==8&&e.vbaraw&&Bwe(a,xt.read(e.vbaraw,{type:typeof e.vbaraw=="string"?"binary":"buffer"})),a}var jp={0:{f:LNe},1:{f:qNe},2:{f:fCe},3:{f:rCe},4:{f:JNe},5:{f:dCe},6:{f:gCe},7:{f:iCe},8:{f:kCe},9:{f:CCe},10:{f:wCe},11:{f:NCe},12:{f:YNe},13:{f:xCe},14:{f:nCe},15:{f:eCe},16:{f:oH},17:{f:vCe},18:{f:oCe},19:{f:gE},20:{},21:{},22:{},23:{},24:{},25:{},26:{},27:{},28:{},29:{},30:{},31:{},32:{},33:{},34:{},35:{T:1},36:{T:-1},37:{T:1},38:{T:-1},39:{f:vke},40:{},42:{},43:{f:gye},44:{f:hye},45:{f:yye},46:{f:Nye},47:{f:wye},48:{},49:{f:zge},50:{},51:{f:awe},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:I9},62:{f:mCe},63:{f:Awe},64:{f:QCe},65:{},66:{},67:{},68:{},69:{},70:{},128:{},129:{T:1},130:{T:-1},131:{T:1,f:Hn,p:0},132:{T:-1},133:{T:1},134:{T:-1},135:{T:1},136:{T:-1},137:{T:1,f:RCe},138:{T:-1},139:{T:1},140:{T:-1},141:{T:1},142:{T:-1},143:{T:1},144:{T:-1},145:{T:1},146:{T:-1},147:{f:GNe},148:{f:zNe,p:16},151:{f:TCe},152:{},153:{f:mke},154:{},155:{},156:{f:xke},157:{},158:{},159:{T:1,f:F1e},160:{T:-1},161:{T:1,f:cu},162:{T:-1},163:{T:1},164:{T:-1},165:{T:1},166:{T:-1},167:{},168:{},169:{},170:{},171:{},172:{T:1},173:{T:-1},174:{},175:{},176:{f:jCe},177:{T:1},178:{T:-1},179:{T:1},180:{T:-1},181:{T:1},182:{T:-1},183:{T:1},184:{T:-1},185:{T:1},186:{T:-1},187:{T:1},188:{T:-1},189:{T:1},190:{T:-1},191:{T:1},192:{T:-1},193:{T:1},194:{T:-1},195:{T:1},196:{T:-1},197:{T:1},198:{T:-1},199:{T:1},200:{T:-1},201:{T:1},202:{T:-1},203:{T:1},204:{T:-1},205:{T:1},206:{T:-1},207:{T:1},208:{T:-1},209:{T:1},210:{T:-1},211:{T:1},212:{T:-1},213:{T:1},214:{T:-1},215:{T:1},216:{T:-1},217:{T:1},218:{T:-1},219:{T:1},220:{T:-1},221:{T:1},222:{T:-1},223:{T:1},224:{T:-1},225:{T:1},226:{T:-1},227:{T:1},228:{T:-1},229:{T:1},230:{T:-1},231:{T:1},232:{T:-1},233:{T:1},234:{T:-1},235:{T:1},236:{T:-1},237:{T:1},238:{T:-1},239:{T:1},240:{T:-1},241:{T:1},242:{T:-1},243:{T:1},244:{T:-1},245:{T:1},246:{T:-1},247:{T:1},248:{T:-1},249:{T:1},250:{T:-1},251:{T:1},252:{T:-1},253:{T:1},254:{T:-1},255:{T:1},256:{T:-1},257:{T:1},258:{T:-1},259:{T:1},260:{T:-1},261:{T:1},262:{T:-1},263:{T:1},264:{T:-1},265:{T:1},266:{T:-1},267:{T:1},268:{T:-1},269:{T:1},270:{T:-1},271:{T:1},272:{T:-1},273:{T:1},274:{T:-1},275:{T:1},276:{T:-1},277:{},278:{T:1},279:{T:-1},280:{T:1},281:{T:-1},282:{T:1},283:{T:1},284:{T:-1},285:{T:1},286:{T:-1},287:{T:1},288:{T:-1},289:{T:1},290:{T:-1},291:{T:1},292:{T:-1},293:{T:1},294:{T:-1},295:{T:1},296:{T:-1},297:{T:1},298:{T:-1},299:{T:1},300:{T:-1},301:{T:1},302:{T:-1},303:{T:1},304:{T:-1},305:{T:1},306:{T:-1},307:{T:1},308:{T:-1},309:{T:1},310:{T:-1},311:{T:1},312:{T:-1},313:{T:-1},314:{T:1},315:{T:-1},316:{T:1},317:{T:-1},318:{T:1},319:{T:-1},320:{T:1},321:{T:-1},322:{T:1},323:{T:-1},324:{T:1},325:{T:-1},326:{T:1},327:{T:-1},328:{T:1},329:{T:-1},330:{T:1},331:{T:-1},332:{T:1},333:{T:-1},334:{T:1},335:{f:twe},336:{T:-1},337:{f:iwe,T:1},338:{T:-1},339:{T:1},340:{T:-1},341:{T:1},342:{T:-1},343:{T:1},344:{T:-1},345:{T:1},346:{T:-1},347:{T:1},348:{T:-1},349:{T:1},350:{T:-1},351:{},352:{},353:{T:1},354:{T:-1},355:{f:CC},357:{},358:{},359:{},360:{T:1},361:{},362:{f:T9},363:{},364:{},366:{},367:{},368:{},369:{},370:{},371:{},372:{T:1},373:{T:-1},374:{T:1},375:{T:-1},376:{T:1},377:{T:-1},378:{T:1},379:{T:-1},380:{T:1},381:{T:-1},382:{T:1},383:{T:-1},384:{T:1},385:{T:-1},386:{T:1},387:{T:-1},388:{T:1},389:{T:-1},390:{T:1},391:{T:-1},392:{T:1},393:{T:-1},394:{T:1},395:{T:-1},396:{},397:{},398:{},399:{},400:{},401:{T:1},403:{},404:{},405:{},406:{},407:{},408:{},409:{},410:{},411:{},412:{},413:{},414:{},415:{},416:{},417:{},418:{},419:{},420:{},421:{},422:{T:1},423:{T:1},424:{T:-1},425:{T:-1},426:{f:ICe},427:{f:FCe},428:{},429:{T:1},430:{T:-1},431:{T:1},432:{T:-1},433:{T:1},434:{T:-1},435:{T:1},436:{T:-1},437:{T:1},438:{T:-1},439:{T:1},440:{T:-1},441:{T:1},442:{T:-1},443:{T:1},444:{T:-1},445:{T:1},446:{T:-1},447:{T:1},448:{T:-1},449:{T:1},450:{T:-1},451:{T:1},452:{T:-1},453:{T:1},454:{T:-1},455:{T:1},456:{T:-1},457:{T:1},458:{T:-1},459:{T:1},460:{T:-1},461:{T:1},462:{T:-1},463:{T:1},464:{T:-1},465:{T:1},466:{T:-1},467:{T:1},468:{T:-1},469:{T:1},470:{T:-1},471:{},472:{},473:{T:1},474:{T:-1},475:{},476:{f:UCe},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:VNe},486:{T:1},487:{T:-1},488:{T:1},489:{T:-1},490:{T:1},491:{T:-1},492:{T:1},493:{T:-1},494:{f:BCe},495:{T:1},496:{T:-1},497:{T:1},498:{T:-1},499:{},500:{T:1},501:{T:-1},502:{T:1},503:{T:-1},504:{},505:{T:1},506:{T:-1},507:{},508:{T:1},509:{T:-1},510:{T:1},511:{T:-1},512:{},513:{},514:{T:1},515:{T:-1},516:{T:1},517:{T:-1},518:{T:1},519:{T:-1},520:{T:1},521:{T:-1},522:{},523:{},524:{},525:{},526:{},527:{},528:{T:1},529:{T:-1},530:{T:1},531:{T:-1},532:{T:1},533:{T:-1},534:{},535:{},536:{},537:{},538:{T:1},539:{T:-1},540:{T:1},541:{T:-1},542:{T:1},548:{},549:{},550:{f:CC},551:{},552:{},553:{},554:{T:1},555:{T:-1},556:{T:1},557:{T:-1},558:{T:1},559:{T:-1},560:{T:1},561:{T:-1},562:{},564:{},565:{T:1},566:{T:-1},569:{T:1},570:{T:-1},572:{},573:{T:1},574:{T:-1},577:{},578:{},579:{},580:{},581:{},582:{},583:{},584:{},585:{},586:{},587:{},588:{T:-1},589:{},590:{T:1},591:{T:-1},592:{T:1},593:{T:-1},594:{T:1},595:{T:-1},596:{},597:{T:1},598:{T:-1},599:{T:1},600:{T:-1},601:{T:1},602:{T:-1},603:{T:1},604:{T:-1},605:{T:1},606:{T:-1},607:{},608:{T:1},609:{T:-1},610:{},611:{T:1},612:{T:-1},613:{T:1},614:{T:-1},615:{T:1},616:{T:-1},617:{T:1},618:{T:-1},619:{T:1},620:{T:-1},625:{},626:{T:1},627:{T:-1},628:{T:1},629:{T:-1},630:{T:1},631:{T:-1},632:{f:Nwe},633:{T:1},634:{T:-1},635:{T:1,f:ywe},636:{T:-1},637:{f:Kge},638:{T:1},639:{},640:{T:-1},641:{T:1},642:{T:-1},643:{T:1},644:{},645:{T:-1},646:{T:1},648:{T:1},649:{},650:{T:-1},651:{f:nke},652:{},653:{T:1},654:{T:-1},655:{T:1},656:{T:-1},657:{T:1},658:{T:-1},659:{},660:{T:1},661:{},662:{T:-1},663:{},664:{T:1},665:{},666:{T:-1},667:{},668:{},669:{},671:{T:1},672:{T:-1},673:{T:1},674:{T:-1},675:{},676:{},677:{},678:{},679:{},680:{},681:{},1024:{},1025:{},1026:{T:1},1027:{T:-1},1028:{T:1},1029:{T:-1},1030:{},1031:{T:1},1032:{T:-1},1033:{T:1},1034:{T:-1},1035:{},1036:{},1037:{},1038:{T:1},1039:{T:-1},1040:{},1041:{T:1},1042:{T:-1},1043:{},1044:{},1045:{},1046:{T:1},1047:{T:-1},1048:{T:1},1049:{T:-1},1050:{},1051:{T:1},1052:{T:1},1053:{f:HCe},1054:{T:1},1055:{},1056:{T:1},1057:{T:-1},1058:{T:1},1059:{T:-1},1061:{},1062:{T:1},1063:{T:-1},1064:{T:1},1065:{T:-1},1066:{T:1},1067:{T:-1},1068:{T:1},1069:{T:-1},1070:{T:1},1071:{T:-1},1072:{T:1},1073:{T:-1},1075:{T:1},1076:{T:-1},1077:{T:1},1078:{T:-1},1079:{T:1},1080:{T:-1},1081:{T:1},1082:{T:-1},1083:{T:1},1084:{T:-1},1085:{},1086:{T:1},1087:{T:-1},1088:{T:1},1089:{T:-1},1090:{T:1},1091:{T:-1},1092:{T:1},1093:{T:-1},1094:{T:1},1095:{T:-1},1096:{},1097:{T:1},1098:{},1099:{T:-1},1100:{T:1},1101:{T:-1},1102:{},1103:{},1104:{},1105:{},1111:{},1112:{},1113:{T:1},1114:{T:-1},1115:{T:1},1116:{T:-1},1117:{},1118:{T:1},1119:{T:-1},1120:{T:1},1121:{T:-1},1122:{T:1},1123:{T:-1},1124:{T:1},1125:{T:-1},1126:{},1128:{T:1},1129:{T:-1},1130:{},1131:{T:1},1132:{T:-1},1133:{T:1},1134:{T:-1},1135:{T:1},1136:{T:-1},1137:{T:1},1138:{T:-1},1139:{T:1},1140:{T:-1},1141:{},1142:{T:1},1143:{T:-1},1144:{T:1},1145:{T:-1},1146:{},1147:{T:1},1148:{T:-1},1149:{T:1},1150:{T:-1},1152:{T:1},1153:{T:-1},1154:{T:-1},1155:{T:-1},1156:{T:-1},1157:{T:1},1158:{T:-1},1159:{T:1},1160:{T:-1},1161:{T:1},1162:{T:-1},1163:{T:1},1164:{T:-1},1165:{T:1},1166:{T:-1},1167:{T:1},1168:{T:-1},1169:{T:1},1170:{T:-1},1171:{},1172:{T:1},1173:{T:-1},1177:{},1178:{T:1},1180:{},1181:{},1182:{},2048:{T:1},2049:{T:-1},2050:{},2051:{T:1},2052:{T:-1},2053:{},2054:{},2055:{T:1},2056:{T:-1},2057:{T:1},2058:{T:-1},2060:{},2067:{},2068:{T:1},2069:{T:-1},2070:{},2071:{},2072:{T:1},2073:{T:-1},2075:{},2076:{},2077:{T:1},2078:{T:-1},2079:{},2080:{T:1},2081:{T:-1},2082:{},2083:{T:1},2084:{T:-1},2085:{T:1},2086:{T:-1},2087:{T:1},2088:{T:-1},2089:{T:1},2090:{T:-1},2091:{},2092:{},2093:{T:1},2094:{T:-1},2095:{},2096:{T:1},2097:{T:-1},2098:{T:1},2099:{T:-1},2100:{T:1},2101:{T:-1},2102:{},2103:{T:1},2104:{T:-1},2105:{},2106:{T:1},2107:{T:-1},2108:{},2109:{T:1},2110:{T:-1},2111:{T:1},2112:{T:-1},2113:{T:1},2114:{T:-1},2115:{},2116:{},2117:{},2118:{T:1},2119:{T:-1},2120:{},2121:{T:1},2122:{T:-1},2123:{T:1},2124:{T:-1},2125:{},2126:{T:1},2127:{T:-1},2128:{},2129:{T:1},2130:{T:-1},2131:{T:1},2132:{T:-1},2133:{T:1},2134:{},2135:{},2136:{},2137:{T:1},2138:{T:-1},2139:{T:1},2140:{T:-1},2141:{},3072:{},3073:{},4096:{T:1},4097:{T:-1},5002:{T:1},5003:{T:-1},5081:{T:1},5082:{T:-1},5083:{},5084:{T:1},5085:{T:-1},5086:{T:1},5087:{T:-1},5088:{},5089:{},5090:{},5092:{T:1},5093:{T:-1},5094:{},5095:{T:1},5096:{T:-1},5097:{},5099:{},65535:{n:""}},IC={6:{f:F2},10:{f:uc},12:{f:_a},13:{f:_a},14:{f:ga},15:{f:ga},16:{f:On},17:{f:ga},18:{f:ga},19:{f:_a},20:{f:YD},21:{f:YD},23:{f:T9},24:{f:JD},25:{f:ga},26:{},27:{},28:{f:Hve},29:{},34:{f:ga},35:{f:XD},38:{f:On},39:{f:On},40:{f:On},41:{f:On},42:{f:ga},43:{f:ga},47:{f:eye},49:{f:xve},51:{f:_a},60:{},61:{f:dve},64:{f:ga},65:{f:pve},66:{f:_a},77:{},80:{},81:{},82:{},85:{f:_a},89:{},90:{},91:{},92:{f:Zbe},93:{f:Vve},94:{},95:{f:ga},96:{},97:{},99:{f:ga},125:{f:I9},128:{f:_ve},129:{f:tve},130:{f:_a},131:{f:ga},132:{f:ga},133:{f:rve},134:{},140:{f:Zve},141:{f:_a},144:{},146:{f:r1e},151:{},152:{},153:{},154:{},155:{},156:{f:_a},157:{},158:{},160:{f:c1e},161:{f:s1e},174:{},175:{},176:{},177:{},178:{},180:{},181:{},182:{},184:{},185:{},189:{f:jve},190:{f:Eve},193:{f:uc},197:{},198:{},199:{},200:{},201:{},202:{f:ga},203:{},204:{},205:{},206:{},207:{},208:{},209:{},210:{},211:{},213:{},215:{},216:{},217:{},218:{f:_a},220:{},221:{f:ga},222:{},224:{f:Bve},225:{f:Jbe},226:{f:uc},227:{},229:{f:zve},233:{},235:{},236:{},237:{},239:{},240:{},241:{},242:{},244:{},245:{},246:{},247:{},248:{},249:{},251:{},252:{f:nve},253:{f:mve},255:{f:ive},256:{},259:{},290:{},311:{},312:{},315:{},317:{f:w9},318:{},319:{},320:{},330:{},331:{},333:{},334:{},335:{},336:{},337:{},338:{},339:{},340:{},351:{},352:{f:ga},353:{f:uc},401:{},402:{},403:{},404:{},405:{},406:{},407:{},408:{},425:{},426:{},427:{},428:{},429:{},430:{f:Uve},431:{f:ga},432:{},433:{},434:{},437:{},438:{f:qve},439:{f:ga},440:{f:Wve},441:{},442:{f:rx},443:{},444:{f:_a},445:{},446:{},448:{f:uc},449:{f:cve,r:2},450:{f:uc},512:{f:KD},513:{f:o1e},515:{f:Fve},516:{f:bve},517:{f:WD},519:{f:d1e},520:{f:lve},523:{},545:{f:ZD},549:{f:GD},566:{},574:{f:Ave},638:{f:kve},659:{},1048:{},1054:{f:yve},1084:{},1212:{f:Pve},2048:{f:Xve},2049:{},2050:{},2051:{},2052:{},2053:{},2054:{},2055:{},2056:{},2057:{f:Kh},2058:{},2059:{},2060:{},2061:{},2062:{},2063:{},2064:{},2066:{},2067:{},2128:{},2129:{},2130:{},2131:{},2132:{},2133:{},2134:{},2135:{},2136:{},2137:{},2138:{},2146:{},2147:{r:12},2148:{},2149:{},2150:{},2151:{f:uc},2152:{},2154:{},2155:{},2156:{},2161:{},2162:{},2164:{},2165:{},2166:{},2167:{},2168:{},2169:{},2170:{},2171:{},2172:{f:a1e,r:12},2173:{f:Zye,r:12},2174:{},2175:{},2180:{},2181:{},2182:{},2183:{},2184:{},2185:{},2186:{},2187:{},2188:{f:ga,r:12},2189:{},2190:{r:12},2191:{},2192:{},2194:{},2195:{},2196:{f:Ove,r:12},2197:{},2198:{f:Kye,r:12},2199:{},2200:{},2201:{},2202:{f:Lve,r:12},2203:{f:uc},2204:{},2205:{},2206:{},2207:{},2211:{f:ove},2212:{},2213:{},2214:{},2215:{},4097:{},4098:{},4099:{},4102:{},4103:{},4105:{},4106:{},4107:{},4108:{},4109:{},4116:{},4117:{},4118:{},4119:{},4120:{},4121:{},4122:{},4123:{},4124:{},4125:{},4126:{},4127:{},4128:{},4129:{},4130:{},4132:{},4133:{},4134:{f:_a},4135:{},4146:{},4147:{},4148:{},4149:{},4154:{},4156:{},4157:{},4158:{},4159:{},4160:{},4161:{},4163:{},4164:{f:i1e},4165:{},4166:{},4168:{},4170:{},4171:{},4174:{},4175:{},4176:{},4177:{},4187:{},4188:{f:t1e},4189:{},4191:{},4192:{},4193:{},4194:{},4195:{},4196:{},4197:{},4198:{},4199:{},4200:{},0:{f:KD},1:{},2:{f:x1e},3:{f:f1e},4:{f:A1e},5:{f:WD},7:{f:m1e},8:{},9:{f:Kh},11:{},22:{f:_a},30:{f:Nve},31:{},32:{},33:{f:ZD},36:{},37:{f:GD},50:{f:g1e},62:{},52:{},67:{},68:{f:_a},69:{},86:{},126:{},127:{f:u1e},135:{},136:{},137:{},145:{},148:{},149:{},150:{},169:{},171:{},188:{},191:{},192:{},194:{},195:{},214:{f:b1e},223:{},234:{},354:{},421:{},518:{f:F2},521:{f:Kh},536:{f:JD},547:{f:XD},561:{},579:{},1030:{f:F2},1033:{f:Kh},1091:{},2157:{},2163:{},2177:{},2240:{},2241:{},2242:{},2243:{},2244:{},2245:{},2246:{},2247:{},2248:{},2249:{},2250:{},2251:{},2262:{r:12},29282:{}};function Xe(e,t,r,a){var s=t;if(!isNaN(s)){var i=a||(r||[]).length||0,l=e.next(4);l.write_shift(2,s),l.write_shift(2,i),i>0&&xE(r)&&e.push(r)}}function mje(e,t,r,a){var s=(r||[]).length||0;if(s<=8224)return Xe(e,t,r,s);var i=t;if(!isNaN(i)){for(var l=r.parts||[],o=0,d=0,u=0;u+(l[o]||8224)<=8224;)u+=l[o]||8224,o++;var f=e.next(4);for(f.write_shift(2,i),f.write_shift(2,u),e.push(r.slice(d,d+u)),d+=u;d<s;){for(f=e.next(4),f.write_shift(2,60),u=0;u+(l[o]||8224)<=8224;)u+=l[o]||8224,o++;f.write_shift(2,u),e.push(r.slice(d,d+u)),d+=u}}}function ix(e,t,r){return e||(e=Oe(7)),e.write_shift(2,t),e.write_shift(2,r),e.write_shift(2,0),e.write_shift(1,0),e}function gje(e,t,r,a){var s=Oe(9);return ix(s,e,t),N9(r,a||"b",s),s}function bje(e,t,r){var a=Oe(8+2*r.length);return ix(a,e,t),a.write_shift(1,r.length),a.write_shift(r.length,r,"sbcs"),a.l<a.length?a.slice(0,a.l):a}function vje(e,t,r,a){if(t.v!=null)switch(t.t){case"d":case"n":var s=t.t=="d"?$a(Or(t.v)):t.v;s==(s|0)&&s>=0&&s<65536?Xe(e,2,h1e(r,a,s)):Xe(e,3,p1e(r,a,s));return;case"b":case"e":Xe(e,5,gje(r,a,t.v,t.t));return;case"s":case"str":Xe(e,4,bje(r,a,(t.v||"").slice(0,255)));return}Xe(e,1,ix(null,r,a))}function yje(e,t,r,a){var s=Array.isArray(t),i=Yt(t["!ref"]||"A1"),l,o="",d=[];if(i.e.c>255||i.e.r>16383){if(a.WTF)throw new Error("Range "+(t["!ref"]||"A1")+" exceeds format limit A1:IV16384");i.e.c=Math.min(i.e.c,255),i.e.r=Math.min(i.e.c,16383),l=Tt(i)}for(var u=i.s.r;u<=i.e.r;++u){o=ya(u);for(var f=i.s.c;f<=i.e.c;++f){u===i.s.r&&(d[f]=Jr(f)),l=d[f]+o;var p=s?(t[u]||[])[f]:t[l];p&&vje(e,p,u,f)}}}function wje(e,t){for(var r=t||{},a=ms(),s=0,i=0;i<e.SheetNames.length;++i)e.SheetNames[i]==r.sheet&&(s=i);if(s==0&&r.sheet&&e.SheetNames[0]!=r.sheet)throw new Error("Sheet not found: "+r.sheet);return Xe(a,r.biff==4?1033:r.biff==3?521:9,kE(e,16,r)),yje(a,e.Sheets[e.SheetNames[s]],s,r),Xe(a,10),a.end()}function Nje(e,t,r){Xe(e,49,hve({sz:12,name:"Arial"},r))}function Cje(e,t,r){t&&[[5,8],[23,26],[41,44],[50,392]].forEach(function(a){for(var s=a[0];s<=a[1];++s)t[s]!=null&&Xe(e,1054,wve(s,t[s],r))})}function kje(e,t){var r=Oe(19);r.write_shift(4,2151),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(2,3),r.write_shift(1,1),r.write_shift(4,0),Xe(e,2151,r),r=Oe(39),r.write_shift(4,2152),r.write_shift(4,0),r.write_shift(4,0),r.write_shift(2,3),r.write_shift(1,0),r.write_shift(4,0),r.write_shift(2,1),r.write_shift(4,4),r.write_shift(2,0),S9(Yt(t["!ref"]||"A1"),r),r.write_shift(4,4),Xe(e,2152,r)}function jje(e,t){for(var r=0;r<16;++r)Xe(e,224,qD({numFmtId:0,style:!0},0,t));t.cellXfs.forEach(function(a){Xe(e,224,qD(a,0,t))})}function Eje(e,t){for(var r=0;r<t["!links"].length;++r){var a=t["!links"][r];Xe(e,440,Yve(a)),a[1].Tooltip&&Xe(e,2048,Jve(a))}delete t["!links"]}function Sje(e,t){if(t){var r=0;t.forEach(function(a,s){++r<=256&&a&&Xe(e,125,n1e(hv(s,a),s))})}}function Bje(e,t,r,a,s){var i=16+qc(s.cellXfs,t,s);if(t.v==null&&!t.bf){Xe(e,513,Yd(r,a,i));return}if(t.bf)Xe(e,6,tNe(t,r,a,s,i));else switch(t.t){case"d":case"n":var l=t.t=="d"?$a(Or(t.v)):t.v;Xe(e,515,Dve(r,a,l,i));break;case"b":case"e":Xe(e,517,Ive(r,a,t.v,i,s,t.t));break;case"s":case"str":if(s.bookSST){var o=FE(s.Strings,t.v,s.revStrings);Xe(e,253,gve(r,a,o,i))}else Xe(e,516,vve(r,a,(t.v||"").slice(0,255),i,s));break;default:Xe(e,513,Yd(r,a,i))}}function _je(e,t,r){var a=ms(),s=r.SheetNames[e],i=r.Sheets[s]||{},l=(r||{}).Workbook||{},o=(l.Sheets||[])[e]||{},d=Array.isArray(i),u=t.biff==8,f,p="",h=[],m=Yt(i["!ref"]||"A1"),b=u?65536:16384;if(m.e.c>255||m.e.r>=b){if(t.WTF)throw new Error("Range "+(i["!ref"]||"A1")+" exceeds format limit A1:IV16384");m.e.c=Math.min(m.e.c,255),m.e.r=Math.min(m.e.c,b-1)}Xe(a,2057,kE(r,16,t)),Xe(a,13,fi(1)),Xe(a,12,fi(100)),Xe(a,15,Wn(!0)),Xe(a,17,Wn(!1)),Xe(a,16,qd(.001)),Xe(a,95,Wn(!0)),Xe(a,42,Wn(!1)),Xe(a,43,Wn(!1)),Xe(a,130,fi(1)),Xe(a,128,Tve()),Xe(a,131,Wn(!1)),Xe(a,132,Wn(!1)),u&&Sje(a,i["!cols"]),Xe(a,512,Cve(m,t)),u&&(i["!links"]=[]);for(var v=m.s.r;v<=m.e.r;++v){p=ya(v);for(var y=m.s.c;y<=m.e.c;++y){v===m.s.r&&(h[y]=Jr(y)),f=h[y]+p;var j=d?(i[v]||[])[y]:i[f];j&&(Bje(a,j,v,y,t),u&&j.l&&i["!links"].push([f,j.l]))}}var _=o.CodeName||o.name||s;return u&&Xe(a,574,fve((l.Views||[])[0])),u&&(i["!merges"]||[]).length&&Xe(a,229,$ve(i["!merges"])),u&&Eje(a,i),Xe(a,442,C9(_)),u&&kje(a,i),Xe(a,10),a.end()}function Tje(e,t,r){var a=ms(),s=(e||{}).Workbook||{},i=s.Sheets||[],l=s.WBProps||{},o=r.biff==8,d=r.biff==5;if(Xe(a,2057,kE(e,5,r)),r.bookType=="xla"&&Xe(a,135),Xe(a,225,o?fi(1200):null),Xe(a,193,Ibe(2)),d&&Xe(a,191),d&&Xe(a,192),Xe(a,226),Xe(a,92,eve("SheetJS",r)),Xe(a,66,fi(o?1200:1252)),o&&Xe(a,353,fi(0)),o&&Xe(a,448),Xe(a,317,l1e(e.SheetNames.length)),o&&e.vbaraw&&Xe(a,211),o&&e.vbaraw){var u=l.CodeName||"ThisWorkbook";Xe(a,442,C9(u))}Xe(a,156,fi(17)),Xe(a,25,Wn(!1)),Xe(a,18,Wn(!1)),Xe(a,19,fi(0)),o&&Xe(a,431,Wn(!1)),o&&Xe(a,444,fi(0)),Xe(a,61,uve()),Xe(a,64,Wn(!1)),Xe(a,141,fi(0)),Xe(a,34,Wn(cke(e)=="true")),Xe(a,14,Wn(!0)),o&&Xe(a,439,Wn(!1)),Xe(a,218,fi(0)),Nje(a,e,r),Cje(a,e.SSF,r),jje(a,r),o&&Xe(a,352,Wn(!1));var f=a.end(),p=ms();o&&Xe(p,140,e1e()),o&&r.Strings&&mje(p,252,sve(r.Strings)),Xe(p,10);var h=p.end(),m=ms(),b=0,v=0;for(v=0;v<e.SheetNames.length;++v)b+=(o?12:11)+(o?2:1)*e.SheetNames[v].length;var y=f.length+b+h.length;for(v=0;v<e.SheetNames.length;++v){var j=i[v]||{};Xe(m,133,ave({pos:y,hs:j.Hidden||0,dt:0,name:e.SheetNames[v]},r)),y+=t[v].length}var _=m.end();if(b!=_.length)throw new Error("BS8 "+b+" != "+_.length);var N=[];return f.length&&N.push(f),_.length&&N.push(_),h.length&&N.push(h),en(N)}function Ije(e,t){var r=t||{},a=[];e&&!e.SSF&&(e.SSF=Pr(vt)),e&&e.SSF&&(a0(),cv(e.SSF),r.revssf=uv(e.SSF),r.revssf[e.SSF[65535]]=0,r.ssf=e.SSF),r.Strings=[],r.Strings.Count=0,r.Strings.Unique=0,OE(r),r.cellXfs=[],qc(r.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={});for(var s=0;s<e.SheetNames.length;++s)a[a.length]=_je(s,r,e);return a.unshift(Tje(e,a,r)),en(a)}function mH(e,t){for(var r=0;r<=e.SheetNames.length;++r){var a=e.Sheets[e.SheetNames[r]];if(!(!a||!a["!ref"])){var s=ys(a["!ref"]);s.e.c>255&&typeof console<"u"&&console.error&&console.error("Worksheet '"+e.SheetNames[r]+"' extends beyond column IV (255).  Data may be lost.")}}var i=t||{};switch(i.biff||2){case 8:case 5:return Ije(e,t);case 4:case 3:case 2:return wje(e,t)}throw new Error("invalid type "+i.bookType+" for BIFF")}function cU(e,t){var r=t||{},a=r.dense?[]:{};e=e.replace(/<!--.*?-->/g,"");var s=e.match(/<table/i);if(!s)throw new Error("Invalid HTML: could not find <table>");var i=e.match(/<\/table/i),l=s.index,o=i&&i.index||e.length,d=hge(e.slice(l,o),/(:?<tr[^>]*>)/i,"<tr>"),u=-1,f=0,p=0,h=0,m={s:{r:1e7,c:1e7},e:{r:0,c:0}},b=[];for(l=0;l<d.length;++l){var v=d[l].trim(),y=v.slice(0,3).toLowerCase();if(y=="<tr"){if(++u,r.sheetRows&&r.sheetRows<=u){--u;break}f=0;continue}if(!(y!="<td"&&y!="<th")){var j=v.split(/<\/t[dh]>/i);for(o=0;o<j.length;++o){var _=j[o].trim();if(_.match(/<t[dh]/i)){for(var N=_,E=0;N.charAt(0)=="<"&&(E=N.indexOf(">"))>-1;)N=N.slice(E+1);for(var T=0;T<b.length;++T){var B=b[T];B.s.c==f&&B.s.r<u&&u<=B.e.r&&(f=B.e.c+1,T=-1)}var F=Nt(_.slice(0,_.indexOf(">")));h=F.colspan?+F.colspan:1,((p=+F.rowspan)>1||h>1)&&b.push({s:{r:u,c:f},e:{r:u+(p||1)-1,c:f+h-1}});var R=F.t||F["data-t"]||"";if(!N.length){f+=h;continue}if(N=QQ(N),m.s.r>u&&(m.s.r=u),m.e.r<u&&(m.e.r=u),m.s.c>f&&(m.s.c=f),m.e.c<f&&(m.e.c=f),!N.length){f+=h;continue}var U={t:"s",v:N};r.raw||!N.trim().length||R=="s"||(N==="TRUE"?U={t:"b",v:!0}:N==="FALSE"?U={t:"b",v:!1}:isNaN(Vi(N))?isNaN(DA(N).getDate())||(U={t:"d",v:Or(N)},r.cellDates||(U={t:"n",v:$a(U.v)}),U.z=r.dateNF||vt[14]):U={t:"n",v:Vi(N)}),r.dense?(a[u]||(a[u]=[]),a[u][f]=U):a[yt({r:u,c:f})]=U,f+=h}}}}return a["!ref"]=Tt(m),b.length&&(a["!merges"]=b),a}function Fje(e,t,r,a){for(var s=e["!merges"]||[],i=[],l=t.s.c;l<=t.e.c;++l){for(var o=0,d=0,u=0;u<s.length;++u)if(!(s[u].s.r>r||s[u].s.c>l)&&!(s[u].e.r<r||s[u].e.c<l)){if(s[u].s.r<r||s[u].s.c<l){o=-1;break}o=s[u].e.r-s[u].s.r+1,d=s[u].e.c-s[u].s.c+1;break}if(!(o<0)){var f=yt({r,c:l}),p=a.dense?(e[r]||[])[l]:e[f],h=p&&p.v!=null&&(p.h||AE(p.w||(Co(p),p.w)||""))||"",m={};o>1&&(m.rowspan=o),d>1&&(m.colspan=d),a.editable?h='<span contenteditable="true">'+h+"</span>":p&&(m["data-t"]=p&&p.t||"z",p.v!=null&&(m["data-v"]=p.v),p.z!=null&&(m["data-z"]=p.z),p.l&&(p.l.Target||"#").charAt(0)!="#"&&(h='<a href="'+p.l.Target+'">'+h+"</a>")),m.id=(a.id||"sjs")+"-"+f,i.push(We("td",h,m))}}var b="<tr>";return b+i.join("")+"</tr>"}var Dje='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',Uje="</body></html>";function Mje(e,t){var r=e.match(/<table[\s\S]*?>[\s\S]*?<\/table>/gi);if(!r||r.length==0)throw new Error("Invalid HTML: could not find <table>");if(r.length==1)return Kc(cU(r[0],t),t);var a=HE();return r.forEach(function(s,i){zE(a,cU(s,t),"Sheet"+(i+1))}),a}function Rje(e,t,r){var a=[];return a.join("")+"<table"+(r&&r.id?' id="'+r.id+'"':"")+">"}function gH(e,t){var r=t||{},a=r.header!=null?r.header:Dje,s=r.footer!=null?r.footer:Uje,i=[a],l=ys(e["!ref"]);r.dense=Array.isArray(e),i.push(Rje(e,l,r));for(var o=l.s.r;o<=l.e.r;++o)i.push(Fje(e,l,o,r));return i.push("</table>"+s),i.join("")}function bH(e,t,r){var a=r||{},s=0,i=0;if(a.origin!=null)if(typeof a.origin=="number")s=a.origin;else{var l=typeof a.origin=="string"?Zr(a.origin):a.origin;s=l.r,i=l.c}var o=t.getElementsByTagName("tr"),d=Math.min(a.sheetRows||1e7,o.length),u={s:{r:0,c:0},e:{r:s,c:i}};if(e["!ref"]){var f=ys(e["!ref"]);u.s.r=Math.min(u.s.r,f.s.r),u.s.c=Math.min(u.s.c,f.s.c),u.e.r=Math.max(u.e.r,f.e.r),u.e.c=Math.max(u.e.c,f.e.c),s==-1&&(u.e.r=s=f.e.r+1)}var p=[],h=0,m=e["!rows"]||(e["!rows"]=[]),b=0,v=0,y=0,j=0,_=0,N=0;for(e["!cols"]||(e["!cols"]=[]);b<o.length&&v<d;++b){var E=o[b];if(dU(E)){if(a.display)continue;m[v]={hidden:!0}}var T=E.children;for(y=j=0;y<T.length;++y){var B=T[y];if(!(a.display&&dU(B))){var F=B.hasAttribute("data-v")?B.getAttribute("data-v"):B.hasAttribute("v")?B.getAttribute("v"):QQ(B.innerHTML),R=B.getAttribute("data-z")||B.getAttribute("z");for(h=0;h<p.length;++h){var U=p[h];U.s.c==j+i&&U.s.r<v+s&&v+s<=U.e.r&&(j=U.e.c+1-i,h=-1)}N=+B.getAttribute("colspan")||1,((_=+B.getAttribute("rowspan")||1)>1||N>1)&&p.push({s:{r:v+s,c:j+i},e:{r:v+s+(_||1)-1,c:j+i+(N||1)-1}});var D={t:"s",v:F},L=B.getAttribute("data-t")||B.getAttribute("t")||"";F!=null&&(F.length==0?D.t=L||"z":a.raw||F.trim().length==0||L=="s"||(F==="TRUE"?D={t:"b",v:!0}:F==="FALSE"?D={t:"b",v:!1}:isNaN(Vi(F))?isNaN(DA(F).getDate())||(D={t:"d",v:Or(F)},a.cellDates||(D={t:"n",v:$a(D.v)}),D.z=a.dateNF||vt[14]):D={t:"n",v:Vi(F)})),D.z===void 0&&R!=null&&(D.z=R);var P="",G=B.getElementsByTagName("A");if(G&&G.length)for(var Q=0;Q<G.length&&!(G[Q].hasAttribute("href")&&(P=G[Q].getAttribute("href"),P.charAt(0)!="#"));++Q);P&&P.charAt(0)!="#"&&(D.l={Target:P}),a.dense?(e[v+s]||(e[v+s]=[]),e[v+s][j+i]=D):e[yt({c:j+i,r:v+s})]=D,u.e.c<j+i&&(u.e.c=j+i),j+=N}}++v}return p.length&&(e["!merges"]=(e["!merges"]||[]).concat(p)),u.e.r=Math.max(u.e.r,v-1+s),e["!ref"]=Tt(u),v>=d&&(e["!fullref"]=Tt((u.e.r=o.length-b+v-1+s,u))),e}function vH(e,t){var r=t||{},a=r.dense?[]:{};return bH(a,e,t)}function Oje(e,t){return Kc(vH(e,t),t)}function dU(e){var t="",r=Pje(e);return r&&(t=r(e).getPropertyValue("display")),t||(t=e.style&&e.style.display),t==="none"}function Pje(e){return e.ownerDocument.defaultView&&typeof e.ownerDocument.defaultView.getComputedStyle=="function"?e.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}function Lje(e){var t=e.replace(/[\t\r\n]/g," ").trim().replace(/ +/g," ").replace(/<text:s\/>/g," ").replace(/<text:s text:c="(\d+)"\/>/g,function(a,s){return Array(parseInt(s,10)+1).join(" ")}).replace(/<text:tab[^>]*\/>/g,"	").replace(/<text:line-break\/>/g,`
`),r=Wt(t.replace(/<[^>]*>/g,""));return[r]}var uU={day:["d","dd"],month:["m","mm"],year:["y","yy"],hours:["h","hh"],minutes:["m","mm"],seconds:["s","ss"],"am-pm":["A/P","AM/PM"],"day-of-week":["ddd","dddd"],era:["e","ee"],quarter:["\\Qm",'m\\"th quarter"']};function yH(e,t){var r=t||{},a=fE(e),s=[],i,l,o={name:""},d="",u=0,f,p,h={},m=[],b=r.dense?[]:{},v,y,j={value:""},_="",N=0,E=[],T=-1,B=-1,F={s:{r:1e6,c:1e7},e:{r:0,c:0}},R=0,U={},D=[],L={},P=0,G=0,Q=[],H=1,X=1,K=[],ee={Names:[]},W={},Y=["",""],M=[],O={},q="",z=0,J=!1,re=!1,le=0;for(vp.lastIndex=0,a=a.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");v=vp.exec(a);)switch(v[3]=v[3].replace(/_.*$/,"")){case"table":case"工作表":v[1]==="/"?(F.e.c>=F.s.c&&F.e.r>=F.s.r?b["!ref"]=Tt(F):b["!ref"]="A1:A1",r.sheetRows>0&&r.sheetRows<=F.e.r&&(b["!fullref"]=b["!ref"],F.e.r=r.sheetRows-1,b["!ref"]=Tt(F)),D.length&&(b["!merges"]=D),Q.length&&(b["!rows"]=Q),f.name=f.名称||f.name,typeof JSON<"u"&&JSON.stringify(f),m.push(f.name),h[f.name]=b,re=!1):v[0].charAt(v[0].length-2)!=="/"&&(f=Nt(v[0],!1),T=B=-1,F.s.r=F.s.c=1e7,F.e.r=F.e.c=0,b=r.dense?[]:{},D=[],Q=[],re=!0);break;case"table-row-group":v[1]==="/"?--R:++R;break;case"table-row":case"行":if(v[1]==="/"){T+=H,H=1;break}if(p=Nt(v[0],!1),p.行号?T=p.行号-1:T==-1&&(T=0),H=+p["number-rows-repeated"]||1,H<10)for(le=0;le<H;++le)R>0&&(Q[T+le]={level:R});B=-1;break;case"covered-table-cell":v[1]!=="/"&&++B,r.sheetStubs&&(r.dense?(b[T]||(b[T]=[]),b[T][B]={t:"z"}):b[yt({r:T,c:B})]={t:"z"}),_="",E=[];break;case"table-cell":case"数据":if(v[0].charAt(v[0].length-2)==="/")++B,j=Nt(v[0],!1),X=parseInt(j["number-columns-repeated"]||"1",10),y={t:"z",v:null},j.formula&&r.cellFormula!=!1&&(y.f=iU(Wt(j.formula))),(j.数据类型||j["value-type"])=="string"&&(y.t="s",y.v=Wt(j["string-value"]||""),r.dense?(b[T]||(b[T]=[]),b[T][B]=y):b[yt({r:T,c:B})]=y),B+=X-1;else if(v[1]!=="/"){++B,_="",N=0,E=[],X=1;var ne=H?T+H-1:T;if(B>F.e.c&&(F.e.c=B),B<F.s.c&&(F.s.c=B),T<F.s.r&&(F.s.r=T),ne>F.e.r&&(F.e.r=ne),j=Nt(v[0],!1),M=[],O={},y={t:j.数据类型||j["value-type"],v:null},r.cellFormula)if(j.formula&&(j.formula=Wt(j.formula)),j["number-matrix-columns-spanned"]&&j["number-matrix-rows-spanned"]&&(P=parseInt(j["number-matrix-rows-spanned"],10)||0,G=parseInt(j["number-matrix-columns-spanned"],10)||0,L={s:{r:T,c:B},e:{r:T+P-1,c:B+G-1}},y.F=Tt(L),K.push([L,y.F])),j.formula)y.f=iU(j.formula);else for(le=0;le<K.length;++le)T>=K[le][0].s.r&&T<=K[le][0].e.r&&B>=K[le][0].s.c&&B<=K[le][0].e.c&&(y.F=K[le][1]);switch((j["number-columns-spanned"]||j["number-rows-spanned"])&&(P=parseInt(j["number-rows-spanned"],10)||0,G=parseInt(j["number-columns-spanned"],10)||0,L={s:{r:T,c:B},e:{r:T+P-1,c:B+G-1}},D.push(L)),j["number-columns-repeated"]&&(X=parseInt(j["number-columns-repeated"],10)),y.t){case"boolean":y.t="b",y.v=Mr(j["boolean-value"]);break;case"float":y.t="n",y.v=parseFloat(j.value);break;case"percentage":y.t="n",y.v=parseFloat(j.value);break;case"currency":y.t="n",y.v=parseFloat(j.value);break;case"date":y.t="d",y.v=Or(j["date-value"]),r.cellDates||(y.t="n",y.v=$a(y.v)),y.z="m/d/yy";break;case"time":y.t="n",y.v=fge(j["time-value"])/86400,r.cellDates&&(y.t="d",y.v=Av(y.v)),y.z="HH:MM:SS";break;case"number":y.t="n",y.v=parseFloat(j.数据数值);break;default:if(y.t==="string"||y.t==="text"||!y.t)y.t="s",j["string-value"]!=null&&(_=Wt(j["string-value"]),E=[]);else throw new Error("Unsupported value type "+y.t)}}else{if(J=!1,y.t==="s"&&(y.v=_||"",E.length&&(y.R=E),J=N==0),W.Target&&(y.l=W),M.length>0&&(y.c=M,M=[]),_&&r.cellText!==!1&&(y.w=_),J&&(y.t="z",delete y.v),(!J||r.sheetStubs)&&!(r.sheetRows&&r.sheetRows<=T))for(var ae=0;ae<H;++ae){if(X=parseInt(j["number-columns-repeated"]||"1",10),r.dense)for(b[T+ae]||(b[T+ae]=[]),b[T+ae][B]=ae==0?y:Pr(y);--X>0;)b[T+ae][B+X]=Pr(y);else for(b[yt({r:T+ae,c:B})]=y;--X>0;)b[yt({r:T+ae,c:B+X})]=Pr(y);F.e.c<=B&&(F.e.c=B)}X=parseInt(j["number-columns-repeated"]||"1",10),B+=X-1,X=0,y={},_="",E=[]}W={};break;case"document":case"document-content":case"电子表格文档":case"spreadsheet":case"主体":case"scripts":case"styles":case"font-face-decls":case"master-styles":if(v[1]==="/"){if((i=s.pop())[0]!==v[3])throw"Bad state: "+i}else v[0].charAt(v[0].length-2)!=="/"&&s.push([v[3],!0]);break;case"annotation":if(v[1]==="/"){if((i=s.pop())[0]!==v[3])throw"Bad state: "+i;O.t=_,E.length&&(O.R=E),O.a=q,M.push(O)}else v[0].charAt(v[0].length-2)!=="/"&&s.push([v[3],!1]);q="",z=0,_="",N=0,E=[];break;case"creator":v[1]==="/"?q=a.slice(z,v.index):z=v.index+v[0].length;break;case"meta":case"元数据":case"settings":case"config-item-set":case"config-item-map-indexed":case"config-item-map-entry":case"config-item-map-named":case"shapes":case"frame":case"text-box":case"image":case"data-pilot-tables":case"list-style":case"form":case"dde-links":case"event-listeners":case"chart":if(v[1]==="/"){if((i=s.pop())[0]!==v[3])throw"Bad state: "+i}else v[0].charAt(v[0].length-2)!=="/"&&s.push([v[3],!1]);_="",N=0,E=[];break;case"scientific-number":break;case"currency-symbol":break;case"currency-style":break;case"number-style":case"percentage-style":case"date-style":case"time-style":if(v[1]==="/"){if(U[o.name]=d,(i=s.pop())[0]!==v[3])throw"Bad state: "+i}else v[0].charAt(v[0].length-2)!=="/"&&(d="",o=Nt(v[0],!1),s.push([v[3],!0]));break;case"script":break;case"libraries":break;case"automatic-styles":break;case"default-style":case"page-layout":break;case"style":break;case"map":break;case"font-face":break;case"paragraph-properties":break;case"table-properties":break;case"table-column-properties":break;case"table-row-properties":break;case"table-cell-properties":break;case"number":switch(s[s.length-1][0]){case"time-style":case"date-style":l=Nt(v[0],!1),d+=uU[v[3]][l.style==="long"?1:0];break}break;case"fraction":break;case"day":case"month":case"year":case"era":case"day-of-week":case"week-of-year":case"quarter":case"hours":case"minutes":case"seconds":case"am-pm":switch(s[s.length-1][0]){case"time-style":case"date-style":l=Nt(v[0],!1),d+=uU[v[3]][l.style==="long"?1:0];break}break;case"boolean-style":break;case"boolean":break;case"text-style":break;case"text":if(v[0].slice(-2)==="/>")break;if(v[1]==="/")switch(s[s.length-1][0]){case"number-style":case"date-style":case"time-style":d+=a.slice(u,v.index);break}else u=v.index+v[0].length;break;case"named-range":l=Nt(v[0],!1),Y=D2(l["cell-range-address"]);var ie={Name:l.name,Ref:Y[0]+"!"+Y[1]};re&&(ie.Sheet=m.length),ee.Names.push(ie);break;case"text-content":break;case"text-properties":break;case"embedded-text":break;case"body":case"电子表格":break;case"forms":break;case"table-column":break;case"table-header-rows":break;case"table-rows":break;case"table-column-group":break;case"table-header-columns":break;case"table-columns":break;case"null-date":break;case"graphic-properties":break;case"calculation-settings":break;case"named-expressions":break;case"label-range":break;case"label-ranges":break;case"named-expression":break;case"sort":break;case"sort-by":break;case"sort-groups":break;case"tab":break;case"line-break":break;case"span":break;case"p":case"文本串":if(["master-styles"].indexOf(s[s.length-1][0])>-1)break;if(v[1]==="/"&&(!j||!j["string-value"])){var me=Lje(a.slice(N,v.index));_=(_.length>0?_+`
`:"")+me[0]}else Nt(v[0],!1),N=v.index+v[0].length;break;case"s":break;case"database-range":if(v[1]==="/")break;try{Y=D2(Nt(v[0])["target-range-address"]),h[Y[0]]["!autofilter"]={ref:Y[1]}}catch{}break;case"date":break;case"object":break;case"title":case"标题":break;case"desc":break;case"binary-data":break;case"table-source":break;case"scenario":break;case"iteration":break;case"content-validations":break;case"content-validation":break;case"help-message":break;case"error-message":break;case"database-ranges":break;case"filter":break;case"filter-and":break;case"filter-or":break;case"filter-condition":break;case"list-level-style-bullet":break;case"list-level-style-number":break;case"list-level-properties":break;case"sender-firstname":case"sender-lastname":case"sender-initials":case"sender-title":case"sender-position":case"sender-email":case"sender-phone-private":case"sender-fax":case"sender-company":case"sender-phone-work":case"sender-street":case"sender-city":case"sender-postal-code":case"sender-country":case"sender-state-or-province":case"author-name":case"author-initials":case"chapter":case"file-name":case"template-name":case"sheet-name":break;case"event-listener":break;case"initial-creator":case"creation-date":case"print-date":case"generator":case"document-statistic":case"user-defined":case"editing-duration":case"editing-cycles":break;case"config-item":break;case"page-number":break;case"page-count":break;case"time":break;case"cell-range-source":break;case"detective":break;case"operation":break;case"highlighted-range":break;case"data-pilot-table":case"source-cell-range":case"source-service":case"data-pilot-field":case"data-pilot-level":case"data-pilot-subtotals":case"data-pilot-subtotal":case"data-pilot-members":case"data-pilot-member":case"data-pilot-display-info":case"data-pilot-sort-info":case"data-pilot-layout-info":case"data-pilot-field-reference":case"data-pilot-groups":case"data-pilot-group":case"data-pilot-group-member":break;case"rect":break;case"dde-connection-decls":case"dde-connection-decl":case"dde-link":case"dde-source":break;case"properties":break;case"property":break;case"a":if(v[1]!=="/"){if(W=Nt(v[0],!1),!W.href)break;W.Target=Wt(W.href),delete W.href,W.Target.charAt(0)=="#"&&W.Target.indexOf(".")>-1?(Y=D2(W.Target.slice(1)),W.Target="#"+Y[0]+"!"+Y[1]):W.Target.match(/^\.\.[\\\/]/)&&(W.Target=W.Target.slice(3))}break;case"table-protection":break;case"data-pilot-grand-total":break;case"office-document-common-attrs":break;default:switch(v[2]){case"dc:":case"calcext:":case"loext:":case"ooo:":case"chartooo:":case"draw:":case"style:":case"chart:":case"form:":case"uof:":case"表:":case"字:":break;default:if(r.WTF)throw new Error(v)}}var Z={Sheets:h,SheetNames:m,Workbook:ee};return r.bookSheets&&delete Z.Sheets,Z}function AU(e,t){t=t||{},ui(e,"META-INF/manifest.xml")&&fbe(Ba(e,"META-INF/manifest.xml"),t);var r=Os(e,"content.xml");if(!r)throw new Error("Missing content.xml in ODS / UOF file");var a=yH(gr(r),t);return ui(e,"meta.xml")&&(a.Props=u9(Ba(e,"meta.xml"))),a}function fU(e,t){return yH(e,t)}var Qje=(function(){var e=["<office:master-styles>",'<style:master-page style:name="mp1" style:page-layout-name="mp1">',"<style:header/>",'<style:header-left style:display="false"/>',"<style:footer/>",'<style:footer-left style:display="false"/>',"</style:master-page>","</office:master-styles>"].join(""),t="<office:document-styles "+bp({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","office:version":"1.2"})+">"+e+"</office:document-styles>";return function(){return wa+t}})(),pU=(function(){var e=function(i){return ur(i).replace(/  +/g,function(l){return'<text:s text:c="'+l.length+'"/>'}).replace(/\t/g,"<text:tab/>").replace(/\n/g,"</text:p><text:p>").replace(/^ /,"<text:s/>").replace(/ $/,"<text:s/>")},t=`          <table:table-cell />
`,r=`          <table:covered-table-cell/>
`,a=function(i,l,o){var d=[];d.push('      <table:table table:name="'+ur(l.SheetNames[o])+`" table:style-name="ta1">
`);var u=0,f=0,p=ys(i["!ref"]||"A1"),h=i["!merges"]||[],m=0,b=Array.isArray(i);if(i["!cols"])for(f=0;f<=p.e.c;++f)d.push("        <table:table-column"+(i["!cols"][f]?' table:style-name="co'+i["!cols"][f].ods+'"':"")+`></table:table-column>
`);var v="",y=i["!rows"]||[];for(u=0;u<p.s.r;++u)v=y[u]?' table:style-name="ro'+y[u].ods+'"':"",d.push("        <table:table-row"+v+`></table:table-row>
`);for(;u<=p.e.r;++u){for(v=y[u]?' table:style-name="ro'+y[u].ods+'"':"",d.push("        <table:table-row"+v+`>
`),f=0;f<p.s.c;++f)d.push(t);for(;f<=p.e.c;++f){var j=!1,_={},N="";for(m=0;m!=h.length;++m)if(!(h[m].s.c>f)&&!(h[m].s.r>u)&&!(h[m].e.c<f)&&!(h[m].e.r<u)){(h[m].s.c!=f||h[m].s.r!=u)&&(j=!0),_["table:number-columns-spanned"]=h[m].e.c-h[m].s.c+1,_["table:number-rows-spanned"]=h[m].e.r-h[m].s.r+1;break}if(j){d.push(r);continue}var E=yt({r:u,c:f}),T=b?(i[u]||[])[f]:i[E];if(T&&T.f&&(_["table:formula"]=ur(lNe(T.f)),T.F&&T.F.slice(0,E.length)==E)){var B=ys(T.F);_["table:number-matrix-columns-spanned"]=B.e.c-B.s.c+1,_["table:number-matrix-rows-spanned"]=B.e.r-B.s.r+1}if(!T){d.push(t);continue}switch(T.t){case"b":N=T.v?"TRUE":"FALSE",_["office:value-type"]="boolean",_["office:boolean-value"]=T.v?"true":"false";break;case"n":N=T.w||String(T.v||0),_["office:value-type"]="float",_["office:value"]=T.v||0;break;case"s":case"str":N=T.v==null?"":T.v,_["office:value-type"]="string";break;case"d":N=T.w||Or(T.v).toISOString(),_["office:value-type"]="date",_["office:date-value"]=Or(T.v).toISOString(),_["table:style-name"]="ce1";break;default:d.push(t);continue}var F=e(N);if(T.l&&T.l.Target){var R=T.l.Target;R=R.charAt(0)=="#"?"#"+oNe(R.slice(1)):R,R.charAt(0)!="#"&&!R.match(/^\w+:/)&&(R="../"+R),F=We("text:a",F,{"xlink:href":R.replace(/&/g,"&amp;")})}d.push("          "+We("table:table-cell",We("text:p",F,{}),_)+`
`)}d.push(`        </table:table-row>
`)}return d.push(`      </table:table>
`),d.join("")},s=function(i,l){i.push(` <office:automatic-styles>
`),i.push(`  <number:date-style style:name="N37" number:automatic-order="true">
`),i.push(`   <number:month number:style="long"/>
`),i.push(`   <number:text>/</number:text>
`),i.push(`   <number:day number:style="long"/>
`),i.push(`   <number:text>/</number:text>
`),i.push(`   <number:year/>
`),i.push(`  </number:date-style>
`);var o=0;l.SheetNames.map(function(u){return l.Sheets[u]}).forEach(function(u){if(u&&u["!cols"]){for(var f=0;f<u["!cols"].length;++f)if(u["!cols"][f]){var p=u["!cols"][f];if(p.width==null&&p.wpx==null&&p.wch==null)continue;Uc(p),p.ods=o;var h=u["!cols"][f].wpx+"px";i.push('  <style:style style:name="co'+o+`" style:family="table-column">
`),i.push('   <style:table-column-properties fo:break-before="auto" style:column-width="'+h+`"/>
`),i.push(`  </style:style>
`),++o}}});var d=0;l.SheetNames.map(function(u){return l.Sheets[u]}).forEach(function(u){if(u&&u["!rows"]){for(var f=0;f<u["!rows"].length;++f)if(u["!rows"][f]){u["!rows"][f].ods=d;var p=u["!rows"][f].hpx+"px";i.push('  <style:style style:name="ro'+d+`" style:family="table-row">
`),i.push('   <style:table-row-properties fo:break-before="auto" style:row-height="'+p+`"/>
`),i.push(`  </style:style>
`),++d}}}),i.push(`  <style:style style:name="ta1" style:family="table" style:master-page-name="mp1">
`),i.push(`   <style:table-properties table:display="true" style:writing-mode="lr-tb"/>
`),i.push(`  </style:style>
`),i.push(`  <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/>
`),i.push(` </office:automatic-styles>
`)};return function(l,o){var d=[wa],u=bp({"xmlns:office":"urn:oasis:names:tc:opendocument:xmlns:office:1.0","xmlns:table":"urn:oasis:names:tc:opendocument:xmlns:table:1.0","xmlns:style":"urn:oasis:names:tc:opendocument:xmlns:style:1.0","xmlns:text":"urn:oasis:names:tc:opendocument:xmlns:text:1.0","xmlns:draw":"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0","xmlns:fo":"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0","xmlns:xlink":"http://www.w3.org/1999/xlink","xmlns:dc":"http://purl.org/dc/elements/1.1/","xmlns:meta":"urn:oasis:names:tc:opendocument:xmlns:meta:1.0","xmlns:number":"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0","xmlns:presentation":"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0","xmlns:svg":"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0","xmlns:chart":"urn:oasis:names:tc:opendocument:xmlns:chart:1.0","xmlns:dr3d":"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0","xmlns:math":"http://www.w3.org/1998/Math/MathML","xmlns:form":"urn:oasis:names:tc:opendocument:xmlns:form:1.0","xmlns:script":"urn:oasis:names:tc:opendocument:xmlns:script:1.0","xmlns:ooo":"http://openoffice.org/2004/office","xmlns:ooow":"http://openoffice.org/2004/writer","xmlns:oooc":"http://openoffice.org/2004/calc","xmlns:dom":"http://www.w3.org/2001/xml-events","xmlns:xforms":"http://www.w3.org/2002/xforms","xmlns:xsd":"http://www.w3.org/2001/XMLSchema","xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","xmlns:sheet":"urn:oasis:names:tc:opendocument:sh33tjs:1.0","xmlns:rpt":"http://openoffice.org/2005/report","xmlns:of":"urn:oasis:names:tc:opendocument:xmlns:of:1.2","xmlns:xhtml":"http://www.w3.org/1999/xhtml","xmlns:grddl":"http://www.w3.org/2003/g/data-view#","xmlns:tableooo":"http://openoffice.org/2009/table","xmlns:drawooo":"http://openoffice.org/2010/draw","xmlns:calcext":"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0","xmlns:loext":"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0","xmlns:field":"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0","xmlns:formx":"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0","xmlns:css3t":"http://www.w3.org/TR/css3-text/","office:version":"1.2"}),f=bp({"xmlns:config":"urn:oasis:names:tc:opendocument:xmlns:config:1.0","office:mimetype":"application/vnd.oasis.opendocument.spreadsheet"});o.bookType=="fods"?(d.push("<office:document"+u+f+`>
`),d.push(d9().replace(/office:document-meta/g,"office:meta"))):d.push("<office:document-content"+u+`>
`),s(d,l),d.push(`  <office:body>
`),d.push(`    <office:spreadsheet>
`);for(var p=0;p!=l.SheetNames.length;++p)d.push(a(l.Sheets[l.SheetNames[p]],l,p));return d.push(`    </office:spreadsheet>
`),d.push(`  </office:body>
`),o.bookType=="fods"?d.push("</office:document>"):d.push("</office:document-content>"),d.join("")}})();function wH(e,t){if(t.bookType=="fods")return pU(e,t);var r=cE(),a="",s=[],i=[];return a="mimetype",Dt(r,a,"application/vnd.oasis.opendocument.spreadsheet"),a="content.xml",Dt(r,a,pU(e,t)),s.push([a,"text/xml"]),i.push([a,"ContentFile"]),a="styles.xml",Dt(r,a,Qje(e,t)),s.push([a,"text/xml"]),i.push([a,"StylesFile"]),a="meta.xml",Dt(r,a,wa+d9()),s.push([a,"text/xml"]),i.push([a,"MetadataFile"]),a="manifest.rdf",Dt(r,a,hbe(i)),s.push([a,"application/rdf+xml"]),a="META-INF/manifest.xml",Dt(r,a,pbe(s)),r}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function Xd(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function FC(e){return typeof TextDecoder<"u"?new TextDecoder().decode(e):gr(Gc(e))}function Hje(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):Rs(ml(e))}function zje(e,t){e:for(var r=0;r<=e.length-t.length;++r){for(var a=0;a<t.length;++a)if(e[r+a]!=t[a])continue e;return!0}return!1}function Rc(e){var t=e.reduce(function(s,i){return s+i.length},0),r=new Uint8Array(t),a=0;return e.forEach(function(s){r.set(s,a),a+=s.length}),r}function xU(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>>24}function $je(e,t){for(var r=(e[t+15]&127)<<7|e[t+14]>>1,a=e[t+14]&1,s=t+13;s>=t;--s)a=a*256+e[s];return(e[t+15]&128?-a:a)*Math.pow(10,r-6176)}function Vje(e,t,r){var a=Math.floor(r==0?0:Math.LOG10E*Math.log(Math.abs(r)))+6176-20,s=r/Math.pow(10,a-6176);e[t+15]|=a>>7,e[t+14]|=(a&127)<<1;for(var i=0;s>=1;++i,s/=256)e[t+i]=s&255;e[t+15]|=r>=0?0:128}function Ep(e,t){var r=t?t[0]:0,a=e[r]&127;e:if(e[r++]>=128&&(a|=(e[r]&127)<<7,e[r++]<128||(a|=(e[r]&127)<<14,e[r++]<128)||(a|=(e[r]&127)<<21,e[r++]<128)||(a+=(e[r]&127)*Math.pow(2,28),++r,e[r++]<128)||(a+=(e[r]&127)*Math.pow(2,35),++r,e[r++]<128)||(a+=(e[r]&127)*Math.pow(2,42),++r,e[r++]<128)))break e;return t&&(t[0]=r),a}function or(e){var t=new Uint8Array(7);t[0]=e&127;var r=1;e:if(e>127){if(t[r-1]|=128,t[r]=e>>7&127,++r,e<=16383||(t[r-1]|=128,t[r]=e>>14&127,++r,e<=2097151)||(t[r-1]|=128,t[r]=e>>21&127,++r,e<=268435455)||(t[r-1]|=128,t[r]=e/256>>>21&127,++r,e<=34359738367)||(t[r-1]|=128,t[r]=e/65536>>>21&127,++r,e<=4398046511103))break e;t[r-1]|=128,t[r]=e/16777216>>>21&127,++r}return t.slice(0,r)}function ua(e){var t=0,r=e[t]&127;e:if(e[t++]>=128){if(r|=(e[t]&127)<<7,e[t++]<128||(r|=(e[t]&127)<<14,e[t++]<128)||(r|=(e[t]&127)<<21,e[t++]<128))break e;r|=(e[t]&127)<<28}return r}function Zt(e){for(var t=[],r=[0];r[0]<e.length;){var a=r[0],s=Ep(e,r),i=s&7;s=Math.floor(s/8);var l=0,o;if(s==0)break;switch(i){case 0:{for(var d=r[0];e[r[0]++]>=128;);o=e.slice(d,r[0])}break;case 5:l=4,o=e.slice(r[0],r[0]+l),r[0]+=l;break;case 1:l=8,o=e.slice(r[0],r[0]+l),r[0]+=l;break;case 2:l=Ep(e,r),o=e.slice(r[0],r[0]+l),r[0]+=l;break;case 3:case 4:default:throw new Error("PB Type ".concat(i," for Field ").concat(s," at offset ").concat(a))}var u={data:o,type:i};t[s]==null?t[s]=[u]:t[s].push(u)}return t}function xn(e){var t=[];return e.forEach(function(r,a){r.forEach(function(s){s.data&&(t.push(or(a*8+s.type)),s.type==2&&t.push(or(s.data.length)),t.push(s.data))})}),Rc(t)}function ME(e,t){return(e==null?void 0:e.map(function(r){return t(r.data)}))||[]}function ci(e){for(var t,r=[],a=[0];a[0]<e.length;){var s=Ep(e,a),i=Zt(e.slice(a[0],a[0]+s));a[0]+=s;var l={id:ua(i[1][0].data),messages:[]};i[2].forEach(function(o){var d=Zt(o.data),u=ua(d[3][0].data);l.messages.push({meta:d,data:e.slice(a[0],a[0]+u)}),a[0]+=u}),(t=i[3])!=null&&t[0]&&(l.merge=ua(i[3][0].data)>>>0>0),r.push(l)}return r}function Yu(e){var t=[];return e.forEach(function(r){var a=[];a[1]=[{data:or(r.id),type:0}],a[2]=[],r.merge!=null&&(a[3]=[{data:or(+!!r.merge),type:0}]);var s=[];r.messages.forEach(function(l){s.push(l.data),l.meta[3]=[{type:0,data:or(l.data.length)}],a[2].push({data:xn(l.meta),type:2})});var i=xn(a);t.push(or(i.length)),t.push(i),s.forEach(function(l){return t.push(l)})}),Rc(t)}function Gje(e,t){if(e!=0)throw new Error("Unexpected Snappy chunk type ".concat(e));for(var r=[0],a=Ep(t,r),s=[];r[0]<t.length;){var i=t[r[0]]&3;if(i==0){var l=t[r[0]++]>>2;if(l<60)++l;else{var o=l-59;l=t[r[0]],o>1&&(l|=t[r[0]+1]<<8),o>2&&(l|=t[r[0]+2]<<16),o>3&&(l|=t[r[0]+3]<<24),l>>>=0,l++,r[0]+=o}s.push(t.slice(r[0],r[0]+l)),r[0]+=l;continue}else{var d=0,u=0;if(i==1?(u=(t[r[0]]>>2&7)+4,d=(t[r[0]++]&224)<<3,d|=t[r[0]++]):(u=(t[r[0]++]>>2)+1,i==2?(d=t[r[0]]|t[r[0]+1]<<8,r[0]+=2):(d=(t[r[0]]|t[r[0]+1]<<8|t[r[0]+2]<<16|t[r[0]+3]<<24)>>>0,r[0]+=4)),s=[Rc(s)],d==0)throw new Error("Invalid offset 0");if(d>s[0].length)throw new Error("Invalid offset beyond length");if(u>=d)for(s.push(s[0].slice(-d)),u-=d;u>=s[s.length-1].length;)s.push(s[s.length-1]),u-=s[s.length-1].length;s.push(s[0].slice(-d,-d+u))}}var f=Rc(s);if(f.length!=a)throw new Error("Unexpected length: ".concat(f.length," != ").concat(a));return f}function di(e){for(var t=[],r=0;r<e.length;){var a=e[r++],s=e[r]|e[r+1]<<8|e[r+2]<<16;r+=3,t.push(Gje(a,e.slice(r,r+s))),r+=s}if(r!==e.length)throw new Error("data is not a valid framed stream!");return Rc(t)}function Xu(e){for(var t=[],r=0;r<e.length;){var a=Math.min(e.length-r,268435455),s=new Uint8Array(4);t.push(s);var i=or(a),l=i.length;t.push(i),a<=60?(l++,t.push(new Uint8Array([a-1<<2]))):a<=256?(l+=2,t.push(new Uint8Array([240,a-1&255]))):a<=65536?(l+=3,t.push(new Uint8Array([244,a-1&255,a-1>>8&255]))):a<=16777216?(l+=4,t.push(new Uint8Array([248,a-1&255,a-1>>8&255,a-1>>16&255]))):a<=4294967296&&(l+=5,t.push(new Uint8Array([252,a-1&255,a-1>>8&255,a-1>>16&255,a-1>>>24&255]))),t.push(e.slice(r,r+a)),l+=a,s[0]=0,s[1]=l&255,s[2]=l>>8&255,s[3]=l>>16&255,r+=a}return Rc(t)}function Kje(e,t,r,a){var s=Xd(e),i=s.getUint32(4,!0),l=(a>1?12:8)+xU(i&(a>1?3470:398))*4,o=-1,d=-1,u=NaN,f=new Date(2001,0,1);i&512&&(o=s.getUint32(l,!0),l+=4),l+=xU(i&(a>1?12288:4096))*4,i&16&&(d=s.getUint32(l,!0),l+=4),i&32&&(u=s.getFloat64(l,!0),l+=8),i&64&&(f.setTime(f.getTime()+s.getFloat64(l,!0)*1e3),l+=8);var p;switch(e[2]){case 0:break;case 2:p={t:"n",v:u};break;case 3:p={t:"s",v:t[d]};break;case 5:p={t:"d",v:f};break;case 6:p={t:"b",v:u>0};break;case 7:p={t:"n",v:u/86400};break;case 8:p={t:"e",v:0};break;case 9:if(o>-1)p={t:"s",v:r[o]};else if(d>-1)p={t:"s",v:t[d]};else if(!isNaN(u))p={t:"n",v:u};else throw new Error("Unsupported cell type ".concat(e.slice(0,4)));break;default:throw new Error("Unsupported cell type ".concat(e.slice(0,4)))}return p}function qje(e,t,r){var a=Xd(e),s=a.getUint32(8,!0),i=12,l=-1,o=-1,d=NaN,u=NaN,f=new Date(2001,0,1);s&1&&(d=$je(e,i),i+=16),s&2&&(u=a.getFloat64(i,!0),i+=8),s&4&&(f.setTime(f.getTime()+a.getFloat64(i,!0)*1e3),i+=8),s&8&&(o=a.getUint32(i,!0),i+=4),s&16&&(l=a.getUint32(i,!0),i+=4);var p;switch(e[1]){case 0:break;case 2:p={t:"n",v:d};break;case 3:p={t:"s",v:t[o]};break;case 5:p={t:"d",v:f};break;case 6:p={t:"b",v:u>0};break;case 7:p={t:"n",v:u/86400};break;case 8:p={t:"e",v:0};break;case 9:if(l>-1)p={t:"s",v:r[l]};else throw new Error("Unsupported cell type ".concat(e[1]," : ").concat(s&31," : ").concat(e.slice(0,4)));break;case 10:p={t:"n",v:d};break;default:throw new Error("Unsupported cell type ".concat(e[1]," : ").concat(s&31," : ").concat(e.slice(0,4)))}return p}function M2(e,t){var r=new Uint8Array(32),a=Xd(r),s=12,i=0;switch(r[0]=5,e.t){case"n":r[1]=2,Vje(r,s,e.v),i|=1,s+=16;break;case"b":r[1]=6,a.setFloat64(s,e.v?1:0,!0),i|=2,s+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[1]=3,a.setUint32(s,t.indexOf(e.v),!0),i|=8,s+=4;break;default:throw"unsupported cell type "+e.t}return a.setUint32(8,i,!0),r.slice(0,s)}function R2(e,t){var r=new Uint8Array(32),a=Xd(r),s=12,i=0;switch(r[0]=3,e.t){case"n":r[2]=2,a.setFloat64(s,e.v,!0),i|=32,s+=8;break;case"b":r[2]=6,a.setFloat64(s,e.v?1:0,!0),i|=32,s+=8;break;case"s":if(t.indexOf(e.v)==-1)throw new Error("Value ".concat(e.v," missing from SST!"));r[2]=3,a.setUint32(s,t.indexOf(e.v),!0),i|=16,s+=4;break;default:throw"unsupported cell type "+e.t}return a.setUint32(4,i,!0),r.slice(0,s)}function Wje(e,t,r){switch(e[0]){case 0:case 1:case 2:case 3:return Kje(e,t,r,e[0]);case 5:return qje(e,t,r);default:throw new Error("Unsupported payload version ".concat(e[0]))}}function Fn(e){var t=Zt(e);return Ep(t[1][0].data)}function hU(e,t){var r=Zt(t.data),a=ua(r[1][0].data),s=r[3],i=[];return(s||[]).forEach(function(l){var o=Zt(l.data),d=ua(o[1][0].data)>>>0;switch(a){case 1:i[d]=FC(o[3][0].data);break;case 8:{var u=e[Fn(o[9][0].data)][0],f=Zt(u.data),p=e[Fn(f[1][0].data)][0],h=ua(p.meta[1][0].data);if(h!=2001)throw new Error("2000 unexpected reference to ".concat(h));var m=Zt(p.data);i[d]=m[3].map(function(b){return FC(b.data)}).join("")}break}}),i}function Yje(e,t){var r,a,s,i,l,o,d,u,f,p,h,m,b,v,y=Zt(e),j=ua(y[1][0].data)>>>0,_=ua(y[2][0].data)>>>0,N=((a=(r=y[8])==null?void 0:r[0])==null?void 0:a.data)&&ua(y[8][0].data)>0||!1,E,T;if((i=(s=y[7])==null?void 0:s[0])!=null&&i.data&&t!=0)E=(o=(l=y[7])==null?void 0:l[0])==null?void 0:o.data,T=(u=(d=y[6])==null?void 0:d[0])==null?void 0:u.data;else if((p=(f=y[4])==null?void 0:f[0])!=null&&p.data&&t!=1)E=(m=(h=y[4])==null?void 0:h[0])==null?void 0:m.data,T=(v=(b=y[3])==null?void 0:b[0])==null?void 0:v.data;else throw"NUMBERS Tile missing ".concat(t," cell storage");for(var B=N?4:1,F=Xd(E),R=[],U=0;U<E.length/2;++U){var D=F.getUint16(U*2,!0);D<65535&&R.push([U,D])}if(R.length!=_)throw"Expected ".concat(_," cells, found ").concat(R.length);var L=[];for(U=0;U<R.length-1;++U)L[R[U][0]]=T.subarray(R[U][1]*B,R[U+1][1]*B);return R.length>=1&&(L[R[R.length-1][0]]=T.subarray(R[R.length-1][1]*B)),{R:j,cells:L}}function Xje(e,t){var r,a=Zt(t.data),s=(r=a==null?void 0:a[7])!=null&&r[0]?ua(a[7][0].data)>>>0>0?1:0:-1,i=ME(a[5],function(l){return Yje(l,s)});return{nrows:ua(a[4][0].data)>>>0,data:i.reduce(function(l,o){return l[o.R]||(l[o.R]=[]),o.cells.forEach(function(d,u){if(l[o.R][u])throw new Error("Duplicate cell r=".concat(o.R," c=").concat(u));l[o.R][u]=d}),l},[])}}function Jje(e,t,r){var a,s=Zt(t.data),i={s:{r:0,c:0},e:{r:0,c:0}};if(i.e.r=(ua(s[6][0].data)>>>0)-1,i.e.r<0)throw new Error("Invalid row varint ".concat(s[6][0].data));if(i.e.c=(ua(s[7][0].data)>>>0)-1,i.e.c<0)throw new Error("Invalid col varint ".concat(s[7][0].data));r["!ref"]=Tt(i);var l=Zt(s[4][0].data),o=hU(e,e[Fn(l[4][0].data)][0]),d=(a=l[17])!=null&&a[0]?hU(e,e[Fn(l[17][0].data)][0]):[],u=Zt(l[3][0].data),f=0;u[1].forEach(function(p){var h=Zt(p.data),m=e[Fn(h[2][0].data)][0],b=ua(m.meta[1][0].data);if(b!=6002)throw new Error("6001 unexpected reference to ".concat(b));var v=Xje(e,m);v.data.forEach(function(y,j){y.forEach(function(_,N){var E=yt({r:f+j,c:N}),T=Wje(_,o,d);T&&(r[E]=T)})}),f+=v.nrows})}function Zje(e,t){var r=Zt(t.data),a={"!ref":"A1"},s=e[Fn(r[2][0].data)],i=ua(s[0].meta[1][0].data);if(i!=6001)throw new Error("6000 unexpected reference to ".concat(i));return Jje(e,s[0],a),a}function eEe(e,t){var r,a=Zt(t.data),s={name:(r=a[1])!=null&&r[0]?FC(a[1][0].data):"",sheets:[]},i=ME(a[2],Fn);return i.forEach(function(l){e[l].forEach(function(o){var d=ua(o.meta[1][0].data);d==6e3&&s.sheets.push(Zje(e,o))})}),s}function tEe(e,t){var r=HE(),a=Zt(t.data),s=ME(a[1],Fn);if(s.forEach(function(i){e[i].forEach(function(l){var o=ua(l.meta[1][0].data);if(o==2){var d=eEe(e,l);d.sheets.forEach(function(u,f){zE(r,u,f==0?d.name:d.name+"_"+f,!0)})}})}),r.SheetNames.length==0)throw new Error("Empty NUMBERS file");return r}function O2(e){var t,r,a,s,i={},l=[];if(e.FullPaths.forEach(function(d){if(d.match(/\.iwpv2/))throw new Error("Unsupported password protection")}),e.FileIndex.forEach(function(d){if(d.name.match(/\.iwa$/)){var u;try{u=di(d.content)}catch(p){return console.log("?? "+d.content.length+" "+(p.message||p))}var f;try{f=ci(u)}catch(p){return console.log("## "+(p.message||p))}f.forEach(function(p){i[p.id]=p.messages,l.push(p.id)})}}),!l.length)throw new Error("File has no messages");var o=((s=(a=(r=(t=i==null?void 0:i[1])==null?void 0:t[0])==null?void 0:r.meta)==null?void 0:a[1])==null?void 0:s[0].data)&&ua(i[1][0].meta[1][0].data)==1&&i[1][0];if(o||l.forEach(function(d){i[d].forEach(function(u){var f=ua(u.meta[1][0].data)>>>0;if(f==1)if(!o)o=u;else throw new Error("Document has multiple roots")})}),!o)throw new Error("Cannot find Document root");return tEe(i,o)}function rEe(e,t,r){var a,s,i,l;if(!((a=e[6])!=null&&a[0])||!((s=e[7])!=null&&s[0]))throw"Mutation only works on post-BNC storages!";var o=((l=(i=e[8])==null?void 0:i[0])==null?void 0:l.data)&&ua(e[8][0].data)>0||!1;if(o)throw"Math only works with normal offsets";for(var d=0,u=Xd(e[7][0].data),f=0,p=[],h=Xd(e[4][0].data),m=0,b=[],v=0;v<t.length;++v){if(t[v]==null){u.setUint16(v*2,65535,!0),h.setUint16(v*2,65535);continue}u.setUint16(v*2,f,!0),h.setUint16(v*2,m,!0);var y,j;switch(typeof t[v]){case"string":y=M2({t:"s",v:t[v]},r),j=R2({t:"s",v:t[v]},r);break;case"number":y=M2({t:"n",v:t[v]},r),j=R2({t:"n",v:t[v]},r);break;case"boolean":y=M2({t:"b",v:t[v]},r),j=R2({t:"b",v:t[v]},r);break;default:throw new Error("Unsupported value "+t[v])}p.push(y),f+=y.length,b.push(j),m+=j.length,++d}for(e[2][0].data=or(d);v<e[7][0].data.length/2;++v)u.setUint16(v*2,65535,!0),h.setUint16(v*2,65535,!0);return e[6][0].data=Rc(p),e[3][0].data=Rc(b),d}function aEe(e,t){if(!t||!t.numbers)throw new Error("Must pass a `numbers` option -- check the README");var r=e.Sheets[e.SheetNames[0]];e.SheetNames.length>1&&console.error("The Numbers writer currently writes only the first table");var a=ys(r["!ref"]);a.s.r=a.s.c=0;var s=!1;a.e.c>9&&(s=!0,a.e.c=9),a.e.r>49&&(s=!0,a.e.r=49),s&&console.error("The Numbers writer is currently limited to ".concat(Tt(a)));var i=Zg(r,{range:a,header:1}),l=["~Sh33tJ5~"];i.forEach(function(q){return q.forEach(function(z){typeof z=="string"&&l.push(z)})});var o={},d=[],u=xt.read(t.numbers,{type:"base64"});u.FileIndex.map(function(q,z){return[q,u.FullPaths[z]]}).forEach(function(q){var z=q[0],J=q[1];if(z.type==2&&z.name.match(/\.iwa/)){var re=z.content,le=di(re),ne=ci(le);ne.forEach(function(ae){d.push(ae.id),o[ae.id]={deps:[],location:J,type:ua(ae.messages[0].meta[1][0].data)}})}}),d.sort(function(q,z){return q-z});var f=d.filter(function(q){return q>1}).map(function(q){return[q,or(q)]});u.FileIndex.map(function(q,z){return[q,u.FullPaths[z]]}).forEach(function(q){var z=q[0];if(q[1],!!z.name.match(/\.iwa/)){var J=ci(di(z.content));J.forEach(function(re){re.messages.forEach(function(le){f.forEach(function(ne){re.messages.some(function(ae){return ua(ae.meta[1][0].data)!=11006&&zje(ae.data,ne[1])})&&o[ne[0]].deps.push(re.id)})})})}});for(var p=xt.find(u,o[1].location),h=ci(di(p.content)),m,b=0;b<h.length;++b){var v=h[b];v.id==1&&(m=v)}var y=Fn(Zt(m.messages[0].data)[1][0].data);for(p=xt.find(u,o[y].location),h=ci(di(p.content)),b=0;b<h.length;++b)v=h[b],v.id==y&&(m=v);for(y=Fn(Zt(m.messages[0].data)[2][0].data),p=xt.find(u,o[y].location),h=ci(di(p.content)),b=0;b<h.length;++b)v=h[b],v.id==y&&(m=v);for(y=Fn(Zt(m.messages[0].data)[2][0].data),p=xt.find(u,o[y].location),h=ci(di(p.content)),b=0;b<h.length;++b)v=h[b],v.id==y&&(m=v);var j=Zt(m.messages[0].data);{j[6][0].data=or(a.e.r+1),j[7][0].data=or(a.e.c+1);var _=Fn(j[46][0].data),N=xt.find(u,o[_].location),E=ci(di(N.content));{for(var T=0;T<E.length&&E[T].id!=_;++T);if(E[T].id!=_)throw"Bad ColumnRowUIDMapArchive";var B=Zt(E[T].messages[0].data);B[1]=[],B[2]=[],B[3]=[];for(var F=0;F<=a.e.c;++F){var R=[];R[1]=R[2]=[{type:0,data:or(F+420690)}],B[1].push({type:2,data:xn(R)}),B[2].push({type:0,data:or(F)}),B[3].push({type:0,data:or(F)})}B[4]=[],B[5]=[],B[6]=[];for(var U=0;U<=a.e.r;++U)R=[],R[1]=R[2]=[{type:0,data:or(U+726270)}],B[4].push({type:2,data:xn(R)}),B[5].push({type:0,data:or(U)}),B[6].push({type:0,data:or(U)});E[T].messages[0].data=xn(B)}N.content=Xu(Yu(E)),N.size=N.content.length,delete j[46];var D=Zt(j[4][0].data);{D[7][0].data=or(a.e.r+1);var L=Zt(D[1][0].data),P=Fn(L[2][0].data);N=xt.find(u,o[P].location),E=ci(di(N.content));{if(E[0].id!=P)throw"Bad HeaderStorageBucket";var G=Zt(E[0].messages[0].data);for(U=0;U<i.length;++U){var Q=Zt(G[2][0].data);Q[1][0].data=or(U),Q[4][0].data=or(i[U].length),G[2][U]={type:G[2][0].type,data:xn(Q)}}E[0].messages[0].data=xn(G)}N.content=Xu(Yu(E)),N.size=N.content.length;var H=Fn(D[2][0].data);N=xt.find(u,o[H].location),E=ci(di(N.content));{if(E[0].id!=H)throw"Bad HeaderStorageBucket";for(G=Zt(E[0].messages[0].data),F=0;F<=a.e.c;++F)Q=Zt(G[2][0].data),Q[1][0].data=or(F),Q[4][0].data=or(a.e.r+1),G[2][F]={type:G[2][0].type,data:xn(Q)};E[0].messages[0].data=xn(G)}N.content=Xu(Yu(E)),N.size=N.content.length;var X=Fn(D[4][0].data);(function(){for(var q=xt.find(u,o[X].location),z=ci(di(q.content)),J,re=0;re<z.length;++re){var le=z[re];le.id==X&&(J=le)}var ne=Zt(J.messages[0].data);{ne[3]=[];var ae=[];l.forEach(function(Z,Me){ae[1]=[{type:0,data:or(Me)}],ae[2]=[{type:0,data:or(1)}],ae[3]=[{type:2,data:Hje(Z)}],ne[3].push({type:2,data:xn(ae)})})}J.messages[0].data=xn(ne);var ie=Yu(z),me=Xu(ie);q.content=me,q.size=q.content.length})();var K=Zt(D[3][0].data);{var ee=K[1][0];delete K[2];var W=Zt(ee.data);{var Y=Fn(W[2][0].data);(function(){for(var q=xt.find(u,o[Y].location),z=ci(di(q.content)),J,re=0;re<z.length;++re){var le=z[re];le.id==Y&&(J=le)}var ne=Zt(J.messages[0].data);{delete ne[6],delete K[7];var ae=new Uint8Array(ne[5][0].data);ne[5]=[];for(var ie=0,me=0;me<=a.e.r;++me){var Z=Zt(ae);ie+=rEe(Z,i[me],l),Z[1][0].data=or(me),ne[5].push({data:xn(Z),type:2})}ne[1]=[{type:0,data:or(a.e.c+1)}],ne[2]=[{type:0,data:or(a.e.r+1)}],ne[3]=[{type:0,data:or(ie)}],ne[4]=[{type:0,data:or(a.e.r+1)}]}J.messages[0].data=xn(ne);var Me=Yu(z),pe=Xu(Me);q.content=pe,q.size=q.content.length})()}ee.data=xn(W)}D[3][0].data=xn(K)}j[4][0].data=xn(D)}m.messages[0].data=xn(j);var M=Yu(h),O=Xu(M);return p.content=O,p.size=p.content.length,u}function NH(e){return function(r){for(var a=0;a!=e.length;++a){var s=e[a];r[s[0]]===void 0&&(r[s[0]]=s[1]),s[2]==="n"&&(r[s[0]]=Number(r[s[0]]))}}}function RE(e){NH([["cellNF",!1],["cellHTML",!0],["cellFormula",!0],["cellStyles",!1],["cellText",!0],["cellDates",!1],["sheetStubs",!1],["sheetRows",0,"n"],["bookDeps",!1],["bookSheets",!1],["bookProps",!1],["bookFiles",!1],["bookVBA",!1],["password",""],["WTF",!1]])(e)}function OE(e){NH([["cellDates",!1],["bookSST",!1],["bookType","xlsx"],["compression",!1],["WTF",!1]])(e)}function nEe(e){return Ot.WS.indexOf(e)>-1?"sheet":e==Ot.CS?"chart":e==Ot.DS?"dialog":e==Ot.MS?"macro":e&&e.length?e:"sheet"}function sEe(e,t){if(!e)return 0;try{e=t.map(function(a){return a.id||(a.id=a.strRelID),[a.name,e["!id"][a.id].Target,nEe(e["!id"][a.id].Type)]})}catch{return null}return!e||e.length===0?null:e}function iEe(e,t,r,a,s,i,l,o,d,u,f,p){try{i[a]=Rf(Os(e,r,!0),t);var h=Ba(e,t),m;switch(o){case"sheet":m=Ske(h,t,s,d,i[a],u,f,p);break;case"chart":if(m=Bke(h,t,s,d,i[a],u,f,p),!m||!m["!drawel"])break;var b=Cf(m["!drawel"].Target,t),v=yp(b),y=xwe(Os(e,b,!0),Rf(Os(e,v,!0),b)),j=Cf(y,b),_=yp(j);m=rke(Os(e,j,!0),j,d,Rf(Os(e,_,!0),j),u,m);break;case"macro":m=_ke(h,t,s,d,i[a],u,f,p);break;case"dialog":m=Tke(h,t,s,d,i[a],u,f,p);break;default:throw new Error("Unrecognized sheet type "+o)}l[a]=m;var N=[];i&&i[a]&&fa(i[a]).forEach(function(E){var T="";if(i[a][E].Type==Ot.CMNT){T=Cf(i[a][E].Target,t);var B=Uke(Ba(e,T,!0),T,d);if(!B||!B.length)return;tU(m,B,!1)}i[a][E].Type==Ot.TCMNT&&(T=Cf(i[a][E].Target,t),N=N.concat(mwe(Ba(e,T,!0),d)))}),N&&N.length&&tU(m,N,!0,d.people||[])}catch(E){if(d.WTF)throw E}}function si(e){return e.charAt(0)=="/"?e.slice(1):e}function lEe(e,t){if(a0(),t=t||{},RE(t),ui(e,"META-INF/manifest.xml")||ui(e,"objectdata.xml"))return AU(e,t);if(ui(e,"Index/Document.iwa")){if(typeof Uint8Array>"u")throw new Error("NUMBERS file parsing requires Uint8Array support");if(typeof O2<"u"){if(e.FileIndex)return O2(e);var r=xt.utils.cfb_new();return wD(e).forEach(function(Q){Dt(r,Q,gge(e,Q))}),O2(r)}throw new Error("Unsupported NUMBERS file")}if(!ui(e,"[Content_Types].xml"))throw ui(e,"index.xml.gz")?new Error("Unsupported NUMBERS 08 file"):ui(e,"index.xml")?new Error("Unsupported NUMBERS 09 file"):new Error("Unsupported ZIP file");var a=wD(e),s=ube(Os(e,"[Content_Types].xml")),i=!1,l,o;if(s.workbooks.length===0&&(o="xl/workbook.xml",Ba(e,o,!0)&&s.workbooks.push(o)),s.workbooks.length===0){if(o="xl/workbook.bin",!Ba(e,o,!0))throw new Error("Could not find workbook");s.workbooks.push(o),i=!0}s.workbooks[0].slice(-3)=="bin"&&(i=!0);var d={},u={};if(!t.bookSheets&&!t.bookProps){if(Of=[],s.sst)try{Of=Dke(Ba(e,si(s.sst)),s.sst,t)}catch(Q){if(t.WTF)throw Q}t.cellStyles&&s.themes.length&&(d=Fke(Os(e,s.themes[0].replace(/^\//,""),!0)||"",s.themes[0],t)),s.style&&(u=Ike(Ba(e,si(s.style)),s.style,d,t))}s.links.map(function(Q){try{var H=Rf(Os(e,yp(si(Q))),Q);return Rke(Ba(e,si(Q)),H,Q,t)}catch{}});var f=Eke(Ba(e,si(s.workbooks[0])),s.workbooks[0],t),p={},h="";s.coreprops.length&&(h=Ba(e,si(s.coreprops[0]),!0),h&&(p=u9(h)),s.extprops.length!==0&&(h=Ba(e,si(s.extprops[0]),!0),h&&gbe(h,p,t)));var m={};(!t.bookSheets||t.bookProps)&&s.custprops.length!==0&&(h=Os(e,si(s.custprops[0]),!0),h&&(m=vbe(h,t)));var b={};if((t.bookSheets||t.bookProps)&&(f.Sheets?l=f.Sheets.map(function(H){return H.name}):p.Worksheets&&p.SheetNames.length>0&&(l=p.SheetNames),t.bookProps&&(b.Props=p,b.Custprops=m),t.bookSheets&&typeof l<"u"&&(b.SheetNames=l),t.bookSheets?b.SheetNames:t.bookProps))return b;l={};var v={};t.bookDeps&&s.calcchain&&(v=Mke(Ba(e,si(s.calcchain)),s.calcchain));var y=0,j={},_,N;{var E=f.Sheets;p.Worksheets=E.length,p.SheetNames=[];for(var T=0;T!=E.length;++T)p.SheetNames[T]=E[T].name}var B=i?"bin":"xml",F=s.workbooks[0].lastIndexOf("/"),R=(s.workbooks[0].slice(0,F+1)+"_rels/"+s.workbooks[0].slice(F+1)+".rels").replace(/^\//,"");ui(e,R)||(R="xl/_rels/workbook."+B+".rels");var U=Rf(Os(e,R,!0),R.replace(/_rels.*/,"s5s"));(s.metadata||[]).length>=1&&(t.xlmeta=Oke(Ba(e,si(s.metadata[0])),s.metadata[0],t)),(s.people||[]).length>=1&&(t.people=bwe(Ba(e,si(s.people[0])),t)),U&&(U=sEe(U,f.Sheets));var D=Ba(e,"xl/worksheets/sheet.xml",!0)?1:0;e:for(y=0;y!=p.Worksheets;++y){var L="sheet";if(U&&U[y]?(_="xl/"+U[y][1].replace(/[\/]?xl\//,""),ui(e,_)||(_=U[y][1]),ui(e,_)||(_=R.replace(/_rels\/.*$/,"")+U[y][1]),L=U[y][2]):(_="xl/worksheets/sheet"+(y+1-D)+"."+B,_=_.replace(/sheet0\./,"sheet.")),N=_.replace(/^(.*)(\/)([^\/]*)$/,"$1/_rels/$3.rels"),t&&t.sheets!=null)switch(typeof t.sheets){case"number":if(y!=t.sheets)continue e;break;case"string":if(p.SheetNames[y].toLowerCase()!=t.sheets.toLowerCase())continue e;break;default:if(Array.isArray&&Array.isArray(t.sheets)){for(var P=!1,G=0;G!=t.sheets.length;++G)typeof t.sheets[G]=="number"&&t.sheets[G]==y&&(P=1),typeof t.sheets[G]=="string"&&t.sheets[G].toLowerCase()==p.SheetNames[y].toLowerCase()&&(P=1);if(!P)continue e}}iEe(e,_,N,p.SheetNames[y],y,j,l,L,t,f,d,u)}return b={Directory:s,Workbook:f,Props:p,Custprops:m,Deps:v,Sheets:l,SheetNames:p.SheetNames,Strings:Of,Styles:u,Themes:d,SSF:Pr(vt)},t&&t.bookFiles&&(e.files?(b.keys=a,b.files=e.files):(b.keys=[],b.files={},e.FullPaths.forEach(function(Q,H){Q=Q.replace(/^Root Entry[\/]/,""),b.keys.push(Q),b.files[Q]=e.FileIndex[H]}))),t&&t.bookVBA&&(s.vba.length>0?b.vbaraw=Ba(e,si(s.vba[0]),!0):s.defaults&&s.defaults.bin===Ewe&&(b.vbaraw=Ba(e,"xl/vbaProject.bin",!0))),b}function oEe(e,t){var r=t||{},a="Workbook",s=xt.find(e,a);try{if(a="/!DataSpaces/Version",s=xt.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);if(O1e(s.content),a="/!DataSpaces/DataSpaceMap",s=xt.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);var i=L1e(s.content);if(i.length!==1||i[0].comps.length!==1||i[0].comps[0].t!==0||i[0].name!=="StrongEncryptionDataSpace"||i[0].comps[0].v!=="EncryptedPackage")throw new Error("ECMA-376 Encrypted file bad "+a);if(a="/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace",s=xt.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);var l=Q1e(s.content);if(l.length!=1||l[0]!="StrongEncryptionTransform")throw new Error("ECMA-376 Encrypted file bad "+a);if(a="/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary",s=xt.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);z1e(s.content)}catch{}if(a="/EncryptionInfo",s=xt.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);var o=$1e(s.content);if(a="/EncryptedPackage",s=xt.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);if(o[0]==4&&typeof decrypt_agile<"u")return decrypt_agile(o[1],s.content,r.password||"",r);if(o[0]==2&&typeof decrypt_std76<"u")return decrypt_std76(o[1],s.content,r.password||"",r);throw new Error("File is password-protected")}function cEe(e,t){return t.bookType=="ods"?wH(e,t):t.bookType=="numbers"?aEe(e,t):t.bookType=="xlsb"?dEe(e,t):uEe(e,t)}function dEe(e,t){xA=1024,e&&!e.SSF&&(e.SSF=Pr(vt)),e&&e.SSF&&(a0(),cv(e.SSF),t.revssf=uv(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF),t.rels={},t.wbrels={},t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,Pf?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r=t.bookType=="xlsb"?"bin":"xml",a=Y9.indexOf(t.bookType)>-1,s=NE();OE(t=t||{});var i=cE(),l="",o=0;if(t.cellXfs=[],qc(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),l="docProps/core.xml",Dt(i,l,A9(e.Props,t)),s.coreprops.push(l),cr(t.rels,2,l,Ot.CORE_PROPS),l="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var d=[],u=0;u<e.SheetNames.length;++u)(e.Workbook.Sheets[u]||{}).Hidden!=2&&d.push(e.SheetNames[u]);e.Props.SheetNames=d}for(e.Props.Worksheets=e.Props.SheetNames.length,Dt(i,l,x9(e.Props)),s.extprops.push(l),cr(t.rels,3,l,Ot.EXT_PROPS),e.Custprops!==e.Props&&fa(e.Custprops||{}).length>0&&(l="docProps/custom.xml",Dt(i,l,h9(e.Custprops)),s.custprops.push(l),cr(t.rels,4,l,Ot.CUST_PROPS)),o=1;o<=e.SheetNames.length;++o){var f={"!id":{}},p=e.Sheets[e.SheetNames[o-1]],h=(p||{})["!type"]||"sheet";switch(h){case"chart":default:l="xl/worksheets/sheet"+o+"."+r,Dt(i,l,Lke(o-1,l,t,e,f)),s.sheets.push(l),cr(t.wbrels,-1,"worksheets/sheet"+o+"."+r,Ot.WS[0])}if(p){var m=p["!comments"],b=!1,v="";m&&m.length>0&&(v="xl/comments"+o+"."+r,Dt(i,v,zke(m,v)),s.comments.push(v),cr(f,-1,"../comments"+o+"."+r,Ot.CMNT),b=!0),p["!legacy"]&&b&&Dt(i,"xl/drawings/vmlDrawing"+o+".vml",q9(o,p["!comments"])),delete p["!comments"],delete p["!legacy"]}f["!id"].rId1&&Dt(i,yp(l),wA(f))}return t.Strings!=null&&t.Strings.length>0&&(l="xl/sharedStrings."+r,Dt(i,l,Hke(t.Strings,l,t)),s.strs.push(l),cr(t.wbrels,-1,"sharedStrings."+r,Ot.SST)),l="xl/workbook."+r,Dt(i,l,Pke(e,l)),s.workbooks.push(l),cr(t.rels,1,l,Ot.WB),l="xl/theme/theme1.xml",Dt(i,l,BE(e.Themes,t)),s.themes.push(l),cr(t.wbrels,-1,"theme/theme1.xml",Ot.THEME),l="xl/styles."+r,Dt(i,l,Qke(e,l,t)),s.styles.push(l),cr(t.wbrels,-1,"styles."+r,Ot.STY),e.vbaraw&&a&&(l="xl/vbaProject.bin",Dt(i,l,e.vbaraw),s.vba.push(l),cr(t.wbrels,-1,"vbaProject.bin",Ot.VBA)),l="xl/metadata."+r,Dt(i,l,$ke(l)),s.metadata.push(l),cr(t.wbrels,-1,"metadata."+r,Ot.XLMETA),Dt(i,"[Content_Types].xml",c9(s,t)),Dt(i,"_rels/.rels",wA(t.rels)),Dt(i,"xl/_rels/workbook."+r+".rels",wA(t.wbrels)),delete t.revssf,delete t.ssf,i}function uEe(e,t){xA=1024,e&&!e.SSF&&(e.SSF=Pr(vt)),e&&e.SSF&&(a0(),cv(e.SSF),t.revssf=uv(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF),t.rels={},t.wbrels={},t.Strings=[],t.Strings.Count=0,t.Strings.Unique=0,Pf?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r="xml",a=Y9.indexOf(t.bookType)>-1,s=NE();OE(t=t||{});var i=cE(),l="",o=0;if(t.cellXfs=[],qc(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),l="docProps/core.xml",Dt(i,l,A9(e.Props,t)),s.coreprops.push(l),cr(t.rels,2,l,Ot.CORE_PROPS),l="docProps/app.xml",!(e.Props&&e.Props.SheetNames))if(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{for(var d=[],u=0;u<e.SheetNames.length;++u)(e.Workbook.Sheets[u]||{}).Hidden!=2&&d.push(e.SheetNames[u]);e.Props.SheetNames=d}e.Props.Worksheets=e.Props.SheetNames.length,Dt(i,l,x9(e.Props)),s.extprops.push(l),cr(t.rels,3,l,Ot.EXT_PROPS),e.Custprops!==e.Props&&fa(e.Custprops||{}).length>0&&(l="docProps/custom.xml",Dt(i,l,h9(e.Custprops)),s.custprops.push(l),cr(t.rels,4,l,Ot.CUST_PROPS));var f=["SheetJ5"];for(t.tcid=0,o=1;o<=e.SheetNames.length;++o){var p={"!id":{}},h=e.Sheets[e.SheetNames[o-1]],m=(h||{})["!type"]||"sheet";switch(m){case"chart":default:l="xl/worksheets/sheet"+o+"."+r,Dt(i,l,lH(o-1,t,e,p)),s.sheets.push(l),cr(t.wbrels,-1,"worksheets/sheet"+o+"."+r,Ot.WS[0])}if(h){var b=h["!comments"],v=!1,y="";if(b&&b.length>0){var j=!1;b.forEach(function(_){_[1].forEach(function(N){N.T==!0&&(j=!0)})}),j&&(y="xl/threadedComments/threadedComment"+o+"."+r,Dt(i,y,gwe(b,f,t)),s.threadedcomments.push(y),cr(p,-1,"../threadedComments/threadedComment"+o+"."+r,Ot.TCMNT)),y="xl/comments"+o+"."+r,Dt(i,y,W9(b)),s.comments.push(y),cr(p,-1,"../comments"+o+"."+r,Ot.CMNT),v=!0}h["!legacy"]&&v&&Dt(i,"xl/drawings/vmlDrawing"+o+".vml",q9(o,h["!comments"])),delete h["!comments"],delete h["!legacy"]}p["!id"].rId1&&Dt(i,yp(l),wA(p))}return t.Strings!=null&&t.Strings.length>0&&(l="xl/sharedStrings."+r,Dt(i,l,M9(t.Strings,t)),s.strs.push(l),cr(t.wbrels,-1,"sharedStrings."+r,Ot.SST)),l="xl/workbook."+r,Dt(i,l,AH(e)),s.workbooks.push(l),cr(t.rels,1,l,Ot.WB),l="xl/theme/theme1.xml",Dt(i,l,BE(e.Themes,t)),s.themes.push(l),cr(t.wbrels,-1,"theme/theme1.xml",Ot.THEME),l="xl/styles."+r,Dt(i,l,$9(e,t)),s.styles.push(l),cr(t.wbrels,-1,"styles."+r,Ot.STY),e.vbaraw&&a&&(l="xl/vbaProject.bin",Dt(i,l,e.vbaraw),s.vba.push(l),cr(t.wbrels,-1,"vbaProject.bin",Ot.VBA)),l="xl/metadata."+r,Dt(i,l,K9()),s.metadata.push(l),cr(t.wbrels,-1,"metadata."+r,Ot.XLMETA),f.length>1&&(l="xl/persons/person.xml",Dt(i,l,vwe(f)),s.people.push(l),cr(t.wbrels,-1,"persons/person.xml",Ot.PEOPLE)),Dt(i,"[Content_Types].xml",c9(s,t)),Dt(i,"_rels/.rels",wA(t.rels)),Dt(i,"xl/_rels/workbook."+r+".rels",wA(t.wbrels)),delete t.revssf,delete t.ssf,i}function PE(e,t){var r="";switch((t||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":r=Vs(e.slice(0,12));break;case"binary":r=e;break;case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];default:throw new Error("Unrecognized type "+(t&&t.type||"undefined"))}return[r.charCodeAt(0),r.charCodeAt(1),r.charCodeAt(2),r.charCodeAt(3),r.charCodeAt(4),r.charCodeAt(5),r.charCodeAt(6),r.charCodeAt(7)]}function AEe(e,t){return xt.find(e,"EncryptedPackage")?oEe(e,t):hH(e,t)}function fEe(e,t){var r,a=e,s=t||{};return s.type||(s.type=Mt&&Buffer.isBuffer(e)?"buffer":"base64"),r=OQ(a,s),lEe(r,s)}function CH(e,t){var r=0;e:for(;r<e.length;)switch(e.charCodeAt(r)){case 10:case 13:case 32:++r;break;case 60:return TC(e.slice(r),t);default:break e}return UA.to_workbook(e,t)}function pEe(e,t){var r="",a=PE(e,t);switch(t.type){case"base64":r=Vs(e);break;case"binary":r=e;break;case"buffer":r=e.toString("binary");break;case"array":r=Kd(e);break;default:throw new Error("Unrecognized type "+t.type)}return a[0]==239&&a[1]==187&&a[2]==191&&(r=gr(r)),t.type="binary",CH(r,t)}function xEe(e,t){var r=e;return t.type=="base64"&&(r=Vs(r)),r=xp.utils.decode(1200,r.slice(2),"str"),t.type="binary",CH(r,t)}function hEe(e){return e.match(/[^\x00-\x7F]/)?ml(e):e}function P2(e,t,r,a){return a?(r.type="string",UA.to_workbook(e,r)):UA.to_workbook(t,r)}function DC(e,t){nE();var r=t||{};if(typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer)return DC(new Uint8Array(e),(r=Pr(r),r.type="array",r));typeof Uint8Array<"u"&&e instanceof Uint8Array&&!r.type&&(r.type=typeof Deno<"u"?"buffer":"array");var a=e,s=[0,0,0,0],i=!1;if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),CA={},r.dateNF&&(CA.dateNF=r.dateNF),r.type||(r.type=Mt&&Buffer.isBuffer(e)?"buffer":"base64"),r.type=="file"&&(r.type=Mt?"buffer":"binary",a=dge(e),typeof Uint8Array<"u"&&!Mt&&(r.type="array")),r.type=="string"&&(i=!0,r.type="binary",r.codepage=65001,a=hEe(e)),r.type=="array"&&typeof Uint8Array<"u"&&e instanceof Uint8Array&&typeof ArrayBuffer<"u"){var l=new ArrayBuffer(3),o=new Uint8Array(l);if(o.foo="bar",!o.foo)return r=Pr(r),r.type="array",DC(sE(a),r)}switch((s=PE(a,r))[0]){case 208:if(s[1]===207&&s[2]===17&&s[3]===224&&s[4]===161&&s[5]===177&&s[6]===26&&s[7]===225)return AEe(xt.read(a,r),r);break;case 9:if(s[1]<=8)return hH(a,r);break;case 60:return TC(a,r);case 73:if(s[1]===73&&s[2]===42&&s[3]===0)throw new Error("TIFF Image File is not a spreadsheet");if(s[1]===68)return y1e(a,r);break;case 84:if(s[1]===65&&s[2]===66&&s[3]===76)return D9.to_workbook(a,r);break;case 80:return s[1]===75&&s[2]<9&&s[3]<9?fEe(a,r):P2(e,a,r,i);case 239:return s[3]===60?TC(a,r):P2(e,a,r,i);case 255:if(s[1]===254)return xEe(a,r);if(s[1]===0&&s[2]===2&&s[3]===0)return Fd.to_workbook(a,r);break;case 0:if(s[1]===0&&(s[2]>=2&&s[3]===0||s[2]===0&&(s[3]===8||s[3]===9)))return Fd.to_workbook(a,r);break;case 3:case 131:case 139:case 140:return _C.to_workbook(a,r);case 123:if(s[1]===92&&s[2]===114&&s[3]===116)return Q9.to_workbook(a,r);break;case 10:case 13:case 32:return pEe(a,r);case 137:if(s[1]===80&&s[2]===78&&s[3]===71)throw new Error("PNG Image File is not a spreadsheet");break}return v1e.indexOf(s[0])>-1&&s[2]<=12&&s[3]<=31?_C.to_workbook(a,r):P2(e,a,r,i)}function kH(e,t){switch(t.type){case"base64":case"binary":break;case"buffer":case"array":t.type="";break;case"file":return Zp(t.file,xt.write(e,{type:Mt?"buffer":""}));case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");default:throw new Error("Unrecognized type "+t.type)}return xt.write(e,t)}function mEe(e,t){var r=Pr(t||{}),a=cEe(e,r);return gEe(a,r)}function gEe(e,t){var r={},a=Mt?"nodebuffer":typeof Uint8Array<"u"?"array":"string";if(t.compression&&(r.compression="DEFLATE"),t.password)r.type=a;else switch(t.type){case"base64":r.type="base64";break;case"binary":r.type="string";break;case"string":throw new Error("'string' output type invalid for '"+t.bookType+"' files");case"buffer":case"file":r.type=a;break;default:throw new Error("Unrecognized type "+t.type)}var s=e.FullPaths?xt.write(e,{fileType:"zip",type:{nodebuffer:"buffer",string:"binary"}[r.type]||r.type,compression:!!t.compression}):e.generate(r);if(typeof Deno<"u"&&typeof s=="string"){if(t.type=="binary"||t.type=="base64")return s;s=new Uint8Array(ov(s))}return t.password&&typeof encrypt_agile<"u"?kH(encrypt_agile(s,t.password),t):t.type==="file"?Zp(t.file,s):t.type=="string"?gr(s):s}function bEe(e,t){var r=t||{},a=hje(e,r);return kH(a,r)}function fl(e,t,r){r||(r="");var a=r+e;switch(t.type){case"base64":return hp(ml(a));case"binary":return ml(a);case"string":return e;case"file":return Zp(t.file,a,"utf8");case"buffer":return Mt?Ro(a,"utf8"):typeof TextEncoder<"u"?new TextEncoder().encode(a):fl(a,{type:"binary"}).split("").map(function(s){return s.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function vEe(e,t){switch(t.type){case"base64":return hp(e);case"binary":return e;case"string":return e;case"file":return Zp(t.file,e,"binary");case"buffer":return Mt?Ro(e,"binary"):e.split("").map(function(r){return r.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function Xh(e,t){switch(t.type){case"string":case"base64":case"binary":for(var r="",a=0;a<e.length;++a)r+=String.fromCharCode(e[a]);return t.type=="base64"?hp(r):t.type=="string"?gr(r):r;case"file":return Zp(t.file,e);case"buffer":return e;default:throw new Error("Unrecognized type "+t.type)}}function jH(e,t){nE(),Ake(e);var r=Pr(t||{});if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),r.type=="array"){r.type="binary";var a=jH(e,r);return r.type="array",ov(a)}var s=0;if(r.sheet&&(typeof r.sheet=="number"?s=r.sheet:s=e.SheetNames.indexOf(r.sheet),!e.SheetNames[s]))throw new Error("Sheet not found: "+r.sheet+" : "+typeof r.sheet);switch(r.bookType||"xlsb"){case"xml":case"xlml":return fl(cje(e,r),r);case"slk":case"sylk":return fl(F9.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"htm":case"html":return fl(gH(e.Sheets[e.SheetNames[s]],r),r);case"txt":return vEe(EH(e.Sheets[e.SheetNames[s]],r),r);case"csv":return fl(QE(e.Sheets[e.SheetNames[s]],r),r,"\uFEFF");case"dif":return fl(D9.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"dbf":return Xh(_C.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"prn":return fl(UA.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"rtf":return fl(Q9.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"eth":return fl(U9.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"fods":return fl(wH(e,r),r);case"wk1":return Xh(Fd.sheet_to_wk1(e.Sheets[e.SheetNames[s]],r),r);case"wk3":return Xh(Fd.book_to_wk3(e,r),r);case"biff2":r.biff||(r.biff=2);case"biff3":r.biff||(r.biff=3);case"biff4":return r.biff||(r.biff=4),Xh(mH(e,r),r);case"biff5":r.biff||(r.biff=5);case"biff8":case"xla":case"xls":return r.biff||(r.biff=8),bEe(e,r);case"xlsx":case"xlsm":case"xlam":case"xlsb":case"numbers":case"ods":return mEe(e,r);default:throw new Error("Unrecognized bookType |"+r.bookType+"|")}}function yEe(e){if(!e.bookType){var t={xls:"biff8",htm:"html",slk:"sylk",socialcalc:"eth",Sh33tJS:"WTF"},r=e.file.slice(e.file.lastIndexOf(".")).toLowerCase();r.match(/^\.[a-z]+$/)&&(e.bookType=r.slice(1)),e.bookType=t[e.bookType]||e.bookType}}function LE(e,t,r){var a={};return a.type="file",a.file=t,yEe(a),jH(e,a)}function wEe(e,t,r,a,s,i,l,o){var d=ya(r),u=o.defval,f=o.raw||!Object.prototype.hasOwnProperty.call(o,"raw"),p=!0,h=s===1?[]:{};if(s!==1)if(Object.defineProperty)try{Object.defineProperty(h,"__rowNum__",{value:r,enumerable:!1})}catch{h.__rowNum__=r}else h.__rowNum__=r;if(!l||e[r])for(var m=t.s.c;m<=t.e.c;++m){var b=l?e[r][m]:e[a[m]+d];if(b===void 0||b.t===void 0){if(u===void 0)continue;i[m]!=null&&(h[i[m]]=u);continue}var v=b.v;switch(b.t){case"z":if(v==null)break;continue;case"e":v=v==0?null:void 0;break;case"s":case"d":case"b":case"n":break;default:throw new Error("unrecognized type "+b.t)}if(i[m]!=null){if(v==null)if(b.t=="e"&&v===null)h[i[m]]=null;else if(u!==void 0)h[i[m]]=u;else if(f&&v===null)h[i[m]]=null;else continue;else h[i[m]]=f&&(b.t!=="n"||b.t==="n"&&o.rawNumbers!==!1)?v:Co(b,v,o);v!=null&&(p=!1)}}return{row:h,isempty:p}}function Zg(e,t){if(e==null||e["!ref"]==null)return[];var r={t:"n",v:0},a=0,s=1,i=[],l=0,o="",d={s:{r:0,c:0},e:{r:0,c:0}},u=t||{},f=u.range!=null?u.range:e["!ref"];switch(u.header===1?a=1:u.header==="A"?a=2:Array.isArray(u.header)?a=3:u.header==null&&(a=0),typeof f){case"string":d=Yt(f);break;case"number":d=Yt(e["!ref"]),d.s.r=f;break;default:d=f}a>0&&(s=0);var p=ya(d.s.r),h=[],m=[],b=0,v=0,y=Array.isArray(e),j=d.s.r,_=0,N={};y&&!e[j]&&(e[j]=[]);var E=u.skipHidden&&e["!cols"]||[],T=u.skipHidden&&e["!rows"]||[];for(_=d.s.c;_<=d.e.c;++_)if(!(E[_]||{}).hidden)switch(h[_]=Jr(_),r=y?e[j][_]:e[h[_]+p],a){case 1:i[_]=_-d.s.c;break;case 2:i[_]=h[_];break;case 3:i[_]=u.header[_-d.s.c];break;default:if(r==null&&(r={w:"__EMPTY",t:"s"}),o=l=Co(r,null,u),v=N[l]||0,!v)N[l]=1;else{do o=l+"_"+v++;while(N[o]);N[l]=v,N[o]=1}i[_]=o}for(j=d.s.r+s;j<=d.e.r;++j)if(!(T[j]||{}).hidden){var B=wEe(e,d,j,h,a,i,y,u);(B.isempty===!1||(a===1?u.blankrows!==!1:u.blankrows))&&(m[b++]=B.row)}return m.length=b,m}var mU=/"/g;function NEe(e,t,r,a,s,i,l,o){for(var d=!0,u=[],f="",p=ya(r),h=t.s.c;h<=t.e.c;++h)if(a[h]){var m=o.dense?(e[r]||[])[h]:e[a[h]+p];if(m==null)f="";else if(m.v!=null){d=!1,f=""+(o.rawNumbers&&m.t=="n"?m.v:Co(m,null,o));for(var b=0,v=0;b!==f.length;++b)if((v=f.charCodeAt(b))===s||v===i||v===34||o.forceQuotes){f='"'+f.replace(mU,'""')+'"';break}f=="ID"&&(f='"ID"')}else m.f!=null&&!m.F?(d=!1,f="="+m.f,f.indexOf(",")>=0&&(f='"'+f.replace(mU,'""')+'"')):f="";u.push(f)}return o.blankrows===!1&&d?null:u.join(l)}function QE(e,t){var r=[],a=t??{};if(e==null||e["!ref"]==null)return"";var s=Yt(e["!ref"]),i=a.FS!==void 0?a.FS:",",l=i.charCodeAt(0),o=a.RS!==void 0?a.RS:`
`,d=o.charCodeAt(0),u=new RegExp((i=="|"?"\\|":i)+"+$"),f="",p=[];a.dense=Array.isArray(e);for(var h=a.skipHidden&&e["!cols"]||[],m=a.skipHidden&&e["!rows"]||[],b=s.s.c;b<=s.e.c;++b)(h[b]||{}).hidden||(p[b]=Jr(b));for(var v=0,y=s.s.r;y<=s.e.r;++y)(m[y]||{}).hidden||(f=NEe(e,s,y,p,l,d,i,a),f!=null&&(a.strip&&(f=f.replace(u,"")),(f||a.blankrows!==!1)&&r.push((v++?o:"")+f)));return delete a.dense,r.join("")}function EH(e,t){t||(t={}),t.FS="	",t.RS=`
`;var r=QE(e,t);return r}function CEe(e){var t="",r,a="";if(e==null||e["!ref"]==null)return[];var s=Yt(e["!ref"]),i="",l=[],o,d=[],u=Array.isArray(e);for(o=s.s.c;o<=s.e.c;++o)l[o]=Jr(o);for(var f=s.s.r;f<=s.e.r;++f)for(i=ya(f),o=s.s.c;o<=s.e.c;++o)if(t=l[o]+i,r=u?(e[f]||[])[o]:e[t],a="",r!==void 0){if(r.F!=null){if(t=r.F,!r.f)continue;a=r.f,t.indexOf(":")==-1&&(t=t+":"+t)}if(r.f!=null)a=r.f;else{if(r.t=="z")continue;if(r.t=="n"&&r.v!=null)a=""+r.v;else if(r.t=="b")a=r.v?"TRUE":"FALSE";else if(r.w!==void 0)a="'"+r.w;else{if(r.v===void 0)continue;r.t=="s"?a="'"+r.v:a=""+r.v}}d[d.length]=t+"="+a}return d}function SH(e,t,r){var a=r||{},s=+!a.skipHeader,i=e||{},l=0,o=0;if(i&&a.origin!=null)if(typeof a.origin=="number")l=a.origin;else{var d=typeof a.origin=="string"?Zr(a.origin):a.origin;l=d.r,o=d.c}var u,f={s:{c:0,r:0},e:{c:o,r:l+t.length-1+s}};if(i["!ref"]){var p=Yt(i["!ref"]);f.e.c=Math.max(f.e.c,p.e.c),f.e.r=Math.max(f.e.r,p.e.r),l==-1&&(l=p.e.r+1,f.e.r=l+t.length-1+s)}else l==-1&&(l=0,f.e.r=t.length-1+s);var h=a.header||[],m=0;t.forEach(function(v,y){fa(v).forEach(function(j){(m=h.indexOf(j))==-1&&(h[m=h.length]=j);var _=v[j],N="z",E="",T=yt({c:o+m,r:l+y+s});u=Sp(i,T),_&&typeof _=="object"&&!(_ instanceof Date)?i[T]=_:(typeof _=="number"?N="n":typeof _=="boolean"?N="b":typeof _=="string"?N="s":_ instanceof Date?(N="d",a.cellDates||(N="n",_=$a(_)),E=a.dateNF||vt[14]):_===null&&a.nullError&&(N="e",_=0),u?(u.t=N,u.v=_,delete u.w,delete u.R,E&&(u.z=E)):i[T]=u={t:N,v:_},E&&(u.z=E))})}),f.e.c=Math.max(f.e.c,o+h.length-1);var b=ya(l);if(s)for(m=0;m<h.length;++m)i[Jr(m+o)+b]={t:"s",v:h[m]};return i["!ref"]=Tt(f),i}function kEe(e,t){return SH(null,e,t)}function Sp(e,t,r){if(typeof t=="string"){if(Array.isArray(e)){var a=Zr(t);return e[a.r]||(e[a.r]=[]),e[a.r][a.c]||(e[a.r][a.c]={t:"z"})}return e[t]||(e[t]={t:"z"})}return typeof t!="number"?Sp(e,yt(t)):Sp(e,yt({r:t,c:r||0}))}function jEe(e,t){if(typeof t=="number"){if(t>=0&&e.SheetNames.length>t)return t;throw new Error("Cannot find sheet # "+t)}else if(typeof t=="string"){var r=e.SheetNames.indexOf(t);if(r>-1)return r;throw new Error("Cannot find sheet name |"+t+"|")}else throw new Error("Cannot find sheet |"+t+"|")}function HE(){return{SheetNames:[],Sheets:{}}}function zE(e,t,r,a){var s=1;if(!r)for(;s<=65535&&e.SheetNames.indexOf(r="Sheet"+s)!=-1;++s,r=void 0);if(!r||e.SheetNames.length>=65535)throw new Error("Too many worksheets");if(a&&e.SheetNames.indexOf(r)>=0){var i=r.match(/(^.*?)(\d+)$/);s=i&&+i[2]||0;var l=i&&i[1]||r;for(++s;s<=65535&&e.SheetNames.indexOf(r=l+s)!=-1;++s);}if(uH(r),e.SheetNames.indexOf(r)>=0)throw new Error("Worksheet with name |"+r+"| already exists!");return e.SheetNames.push(r),e.Sheets[r]=t,r}function EEe(e,t,r){e.Workbook||(e.Workbook={}),e.Workbook.Sheets||(e.Workbook.Sheets=[]);var a=jEe(e,t);switch(e.Workbook.Sheets[a]||(e.Workbook.Sheets[a]={}),r){case 0:case 1:case 2:break;default:throw new Error("Bad sheet visibility setting "+r)}e.Workbook.Sheets[a].Hidden=r}function SEe(e,t){return e.z=t,e}function BH(e,t,r){return t?(e.l={Target:t},r&&(e.l.Tooltip=r)):delete e.l,e}function BEe(e,t,r){return BH(e,"#"+t,r)}function _Ee(e,t,r){e.c||(e.c=[]),e.c.push({t,a:r||"SheetJS"})}function TEe(e,t,r,a){for(var s=typeof t!="string"?t:Yt(t),i=typeof t=="string"?t:Tt(t),l=s.s.r;l<=s.e.r;++l)for(var o=s.s.c;o<=s.e.c;++o){var d=Sp(e,l,o);d.t="n",d.F=i,delete d.v,l==s.s.r&&o==s.s.c&&(d.f=r,a&&(d.D=!0))}return e}var mi={encode_col:Jr,encode_row:ya,encode_cell:yt,encode_range:Tt,decode_col:mE,decode_row:hE,split_cell:Hge,decode_cell:Zr,decode_range:ys,format_cell:Co,sheet_add_aoa:r9,sheet_add_json:SH,sheet_add_dom:bH,aoa_to_sheet:n0,json_to_sheet:kEe,table_to_sheet:vH,table_to_book:Oje,sheet_to_csv:QE,sheet_to_txt:EH,sheet_to_json:Zg,sheet_to_html:gH,sheet_to_formulae:CEe,sheet_to_row_object_array:Zg,sheet_get_cell:Sp,book_new:HE,book_append_sheet:zE,book_set_sheet_visibility:EEe,cell_set_number_format:SEe,cell_set_hyperlink:BH,cell_set_internal_link:BEe,cell_add_comment:_Ee,sheet_set_array_formula:TEe,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};const IEe=()=>{const{exchangeRateHistory:e,refreshData:t,loading:r}=ht(),[a,s]=k.useState(""),[i,l]=k.useState(""),[o,d]=k.useState(""),[u,f]=k.useState(Dr()),[p,h]=k.useState(!1),[m,b]=k.useState(null),[v,y]=k.useState(new Date().getMonth()),[j,_]=k.useState(new Date().getFullYear()),[N,E]=k.useState(null),[T,B]=k.useState({}),F=k.useRef(null),R=(H,X)=>{let K=H.trim().replace(/"/g,""),ee=X.trim().replace(/"/g,"").replace(",",".");if(!K||!ee)return null;let W="";const Y=K.match(/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/);if(Y)W=`${Y[3]}-${Y[2].padStart(2,"0")}-${Y[1].padStart(2,"0")}`;else{const O=K.match(/^(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2,4})$/);if(O){let[q,z,J,re]=O;re.length===2&&(re="20"+re),W=`${re}-${J.padStart(2,"0")}-${z.padStart(2,"0")}`}else W=K}const M=parseFloat(ee);return W.length===10&&!isNaN(M)?{date:W,val:M}:null},U=H=>{var ee;const X=(ee=H.target.files)==null?void 0:ee[0];if(!X)return;const K=new FileReader;K.onload=async W=>{var Y;try{const M=new Uint8Array((Y=W.target)==null?void 0:Y.result),O=DC(M,{type:"array"}),q=O.SheetNames[0],z=O.Sheets[q],J=mi.sheet_to_json(z,{header:1});if(J.length<2){alert("El archivo parece estar vacío o no tiene la estructura correcta.");return}const re=[],le=J[0].map(Z=>String(Z).toLowerCase().trim()),ne=le.findIndex(Z=>Z.includes("fec")||Z.includes("date")),ae=le.findIndex(Z=>Z.includes("am")||Z.includes("mañana")),ie=le.findIndex(Z=>Z.includes("pm")||Z.includes("tarde")||Z.includes("último")||Z.includes("last")||Z.includes("close")),me=le.findIndex(Z=>Z.includes("paralel")||Z.includes("blue"));for(let Z=1;Z<J.length;Z++){const Me=J[Z];if(!Me||Me.length<2)continue;const pe=String(Me[ne!==-1?ne:0]),he=String(Me[ae!==-1?ae:1]),ye=String(Me[ie!==-1?ie:ae!==-1?ae+1:2]),fe=me!==-1?String(Me[me]):null,Ue=R(pe,he);if(Ue){const qe=parseFloat(he.replace(",",".")),at=parseFloat(ye.replace(",",".")),nt=fe?parseFloat(fe.replace(",",".")):at;!isNaN(qe)&&!isNaN(at)&&re.push({date:Ue.date,amValue:qe,pmValue:at,parallelValue:isNaN(nt)?at:nt})}}re.length>0?(h(!0),b(null),await we.saveExchangeRateBatch(re),alert(`¡Importación Exitosa! ${re.length} registros cargados.`),await t()):alert("No se encontraron tasas válidas en el archivo. Verifique que las columnas 'Fecha' y 'Tasa' existan.")}catch(M){b(`Error procesando Excel: ${M.message}`)}finally{h(!1),F.current&&(F.current.value="")}},K.readAsArrayBuffer(X)},D=()=>{if(e.length===0)return;const H=`Fecha,Tasa AM,Tasa PM,Tasa Paralela
`,X=e.map(Y=>`${Y.date},${Number(Y.amValue).toFixed(2)},${Number(Y.pmValue).toFixed(2)},${Number(Y.parallelValue||Y.pmValue).toFixed(2)}`).join(`
`),K=new Blob([H+X],{type:"text/csv;charset=utf-8;"}),ee=URL.createObjectURL(K),W=document.createElement("a");W.href=ee,W.download="SAC_Historico_Tasas.csv",W.click()},L=async()=>{h(!0),b(null);try{await we.syncLiveRate(),await t(),alert("Sincronización completada exitosamente.")}catch(H){b(H.message||"Error al sincronizar tasas.")}finally{h(!1)}},P=k.useMemo(()=>e.filter(H=>{const[X,K]=H.date.split("-").map(Number);return X===j&&K-1===v}).sort((H,X)=>X.date.localeCompare(H.date)),[e,v,j]),G=async H=>{H.preventDefault();const X=parseFloat(a),K=parseFloat(i)||X,ee=parseFloat(o)||K;if(!(isNaN(X)||X<=0)){h(!0),b(null);try{const W=u;await we.saveExchangeRate({date:W,amValue:X,pmValue:K,parallelValue:ee});const[Y,M]=W.split("-").map(Number);y(M-1),_(Y),s(""),l(""),d(""),await t(),alert("Tasas registradas correctamente.")}catch{b("Fallo al registrar tasa manual.")}finally{h(!1)}}},Q=async()=>{var ee,W,Y;if(!N||!T.date)return;const H=parseFloat(((ee=T.amValue)==null?void 0:ee.toString().replace(",","."))||"0"),X=parseFloat(((W=T.pmValue)==null?void 0:W.toString().replace(",","."))||"0"),K=parseFloat(((Y=T.parallelValue)==null?void 0:Y.toString().replace(",","."))||X.toString());if(isNaN(H)||isNaN(X)||isNaN(K)){alert("Error: Valores numéricos inválidos.");return}h(!0);try{const O=await(await we.saveExchangeRate({...T,amValue:H,pmValue:X,parallelValue:K})).json();O.success?(E(null),await t()):alert(O.error||"Error al guardar edición.")}catch{alert("Error al guardar edición.")}finally{h(!1)}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[m&&n.jsxs("div",{className:"bg-red-50 border-l-4 border-red-500 p-6 rounded-2xl flex items-center gap-4 shadow-sm animate-in slide-in-from-top",children:[n.jsx(TK,{className:"text-red-500",size:24}),n.jsx("div",{className:"flex-1 text-red-700 text-sm font-medium",children:m}),n.jsx("button",{onClick:()=>b(null),className:"p-2 text-red-400 hover:bg-red-100 rounded-full",children:n.jsx(mt,{size:18})})]}),n.jsxs("div",{className:"bg-slate-900 text-white p-10 lg:p-14 rounded-[4rem] shadow-2xl relative overflow-hidden group border-b-8 border-blue-600/30",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-10",children:[n.jsxs("div",{className:"flex items-center gap-8",children:[n.jsx("div",{className:"w-24 h-24 bg-blue-600 rounded-[2.5rem] flex items-center justify-center shadow-2xl shadow-blue-500/40 group-hover:scale-110 transition-transform duration-500",children:n.jsx(za,{size:48})}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[11px] font-black uppercase tracking-[0.5em] text-blue-400 mb-2 block",children:"Base de Datos Monetaria SAC"}),n.jsx("h2",{className:"text-5xl font-black tracking-tighter leading-none text-white",children:"Gestión de Divisas"}),n.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[n.jsx("div",{className:`w-3 h-3 rounded-full ${p?"bg-amber-500 animate-ping":"bg-emerald-500 shadow-[0_0_10px_rgba(16,185,129,0.5)]"}`}),n.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest",children:p?"Sincronizando...":"Historial Permanente Activo"})]})]})]}),n.jsxs("div",{className:"flex flex-wrap justify-center gap-4",children:[n.jsx("input",{type:"file",ref:F,onChange:U,accept:".csv, .xlsx, .xls",className:"hidden"}),n.jsxs("button",{onClick:()=>{var H;return(H=F.current)==null?void 0:H.click()},className:"px-8 py-5 bg-emerald-600 hover:bg-emerald-700 rounded-2xl text-white flex items-center gap-3 font-black text-xs uppercase tracking-widest shadow-xl active:scale-95 transition-all",children:[n.jsx(LA,{size:20})," Cargar Excel/CSV"]}),n.jsxs("button",{onClick:D,className:"px-8 py-5 bg-white text-slate-900 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl hover:bg-slate-100 transition-all flex items-center gap-3",children:[n.jsx(Aa,{size:20})," Exportar Data"]}),n.jsxs("button",{onClick:L,disabled:p,className:"px-8 py-5 bg-blue-600 hover:bg-blue-700 text-white rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-500/20 active:scale-95 transition-all flex items-center gap-3 disabled:opacity-50",children:[p?n.jsx(ct,{size:20,className:"animate-spin"}):n.jsx(Kr,{size:20}),"ACTUALIZAR DATA"]})]})]}),n.jsx(da,{className:"absolute right-[-60px] top-[-60px] w-[500px] h-[500px] text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-4 gap-8",children:[n.jsxs("div",{className:"xl:col-span-1 space-y-8",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm",children:[n.jsxs("h3",{className:"text-sm font-black text-slate-800 mb-6 flex items-center gap-2 uppercase tracking-widest",children:[n.jsx(ok,{className:"text-blue-600",size:18})," Filtro de Periodo"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Mes"}),n.jsx("select",{value:v,onChange:H=>y(Number(H.target.value)),className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-500 mt-2 cursor-pointer",children:Te.map((H,X)=>n.jsx("option",{value:X,children:H},X))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Año"}),n.jsx("input",{type:"number",value:j,onChange:H=>_(Number(H.target.value)),className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-500 mt-2"})]})]})]}),n.jsxs("div",{id:"manual-form-section",className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm",children:[n.jsxs("h3",{className:"text-sm font-black text-slate-800 mb-6 flex items-center gap-2 uppercase tracking-widest",children:[n.jsx(yl,{className:"text-blue-600",size:18})," Ajuste Diario"]}),n.jsxs("form",{onSubmit:G,className:"space-y-6",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Fecha de la Tasa"}),n.jsx("input",{type:"date",required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-500 mt-1",value:u,onChange:H=>f(H.target.value)})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Tasa BCV AM (Mañana)"}),n.jsxs("div",{className:"relative mt-1",children:[n.jsx("span",{className:"absolute left-5 top-1/2 -translate-y-1/2 font-black text-slate-300 text-lg",children:"Bs."}),n.jsx("input",{type:"number",step:"0.0001",required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-14 py-4 text-2xl font-black text-slate-900 outline-none focus:ring-2 focus:ring-blue-600 transition-all font-mono",value:a,onChange:H=>s(H.target.value),placeholder:"00.00"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Tasa BCV PM (Tarde)"}),n.jsxs("div",{className:"relative mt-1",children:[n.jsx("span",{className:"absolute left-5 top-1/2 -translate-y-1/2 font-black text-slate-300 text-lg",children:"Bs."}),n.jsx("input",{type:"number",step:"0.0001",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-14 py-4 text-2xl font-black text-slate-900 outline-none focus:ring-2 focus:ring-blue-600 transition-all font-mono",value:i,onChange:H=>l(H.target.value),placeholder:"Igual a AM"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Tasa Paralela (Blue/Monitor)"}),n.jsxs("div",{className:"relative mt-1",children:[n.jsx("span",{className:"absolute left-5 top-1/2 -translate-y-1/2 font-black text-slate-300 text-lg",children:"Bs."}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-14 py-4 text-2xl font-black text-slate-900 outline-none focus:ring-2 focus:ring-indigo-600 transition-all font-mono",value:o,onChange:H=>d(H.target.value),placeholder:"Promedio"})]})]})]}),n.jsxs("button",{type:"submit",disabled:p||!a,className:"w-full bg-slate-900 text-white py-5 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl active:scale-95 transition-all flex items-center justify-center gap-3 disabled:opacity-50",children:[n.jsx(Zn,{size:18})," APLICAR TASAS DEL DÍA"]})]})]})]}),n.jsxs("div",{className:"xl:col-span-3 bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden flex flex-col min-h-[600px]",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex justify-between items-center bg-slate-50/50",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"p-3 bg-blue-600 rounded-xl text-white shadow-lg shadow-blue-100",children:n.jsx(Wr,{size:20})}),n.jsxs("h3",{className:"text-xl font-black text-slate-800 tracking-tight",children:[Te[v]," ",j]})]}),n.jsxs("button",{onClick:t,disabled:r,className:"text-xs font-black text-blue-600 uppercase tracking-widest hover:underline flex items-center gap-2",children:[n.jsx(ct,{size:14,className:r||p?"animate-spin":""})," Refrescar DB"]})]}),n.jsx("div",{className:"px-8 pb-6 flex gap-4 overflow-x-auto whitespace-nowrap",children:n.jsxs("button",{onClick:()=>{var H;return(H=document.getElementById("manual-form-section"))==null?void 0:H.scrollIntoView({behavior:"smooth"})},className:"px-6 py-3 bg-blue-600 text-white rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2 shadow-lg shadow-blue-100 active:scale-95 transition-all",children:[n.jsx(db,{size:16})," Crear Tasa Manual"]})}),n.jsx("div",{className:"overflow-x-auto flex-1",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/30",children:[n.jsx("th",{className:"px-10 py-6 text-[11px] font-black uppercase text-slate-400 tracking-[0.2em]",children:"Fecha del Registro"}),n.jsx("th",{className:"px-10 py-6 text-[11px] font-black uppercase text-slate-400 tracking-[0.2em] text-center",children:"BCV (AM)"}),n.jsx("th",{className:"px-10 py-6 text-[11px] font-black uppercase text-slate-400 tracking-[0.2em] text-center",children:"BCV (PM)"}),n.jsx("th",{className:"px-10 py-6 text-[11px] font-black uppercase text-slate-400 tracking-[0.2em] text-center",children:"Paralela"}),n.jsx("th",{className:"px-10 py-6 text-[11px] font-black uppercase text-slate-400 tracking-[0.2em] text-right",children:"Acción"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:P.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:4,className:"p-32 text-center text-slate-300 font-bold uppercase tracking-widest text-xs italic",children:"Sin datos para este periodo. Use los botones superiores para cargar historial."})}):P.map(H=>{const X=N===H.date;return n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-10 py-7",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-100 rounded-xl flex items-center justify-center text-slate-400 font-black text-[10px]",children:H.date.split("-")[2]}),n.jsx("span",{className:"font-black text-slate-900 text-lg tracking-tighter",children:H.date})]})}),n.jsx("td",{className:"px-10 py-7 text-center",children:X?n.jsx("input",{type:"number",step:"0.01",className:"w-28 bg-white border-2 border-blue-500 rounded-xl px-3 py-2 text-center font-mono font-black text-blue-600 outline-none",value:T.amValue,onChange:K=>B({...T,amValue:parseFloat(K.target.value)})}):n.jsx("div",{className:`inline-flex items-center gap-3 px-6 py-2.5 rounded-2xl font-mono text-lg font-black transition-all ${Number(H.amValue)>0?"bg-blue-50 text-blue-600 border border-blue-100":"bg-slate-100 text-slate-300"}`,children:Number(H.amValue)>0?Number(H.amValue).toFixed(2):"--.--"})}),n.jsx("td",{className:"px-10 py-7 text-center",children:X?n.jsx("input",{type:"number",step:"0.01",className:"w-28 bg-white border-2 border-indigo-500 rounded-xl px-3 py-2 text-center font-mono font-black text-indigo-600 outline-none",value:T.pmValue,onChange:K=>B({...T,pmValue:parseFloat(K.target.value)})}):n.jsx("div",{className:`inline-flex items-center gap-3 px-6 py-2.5 rounded-2xl font-mono text-lg font-black transition-all ${Number(H.pmValue)>0?"bg-indigo-50 text-indigo-600 border border-indigo-100":"bg-slate-100 text-slate-300"}`,children:Number(H.pmValue)>0?Number(H.pmValue).toFixed(2):"--.--"})}),n.jsx("td",{className:"px-10 py-7 text-center",children:X?n.jsx("input",{type:"number",step:"0.01",className:"w-28 bg-white border-2 border-amber-500 rounded-xl px-3 py-2 text-center font-mono font-black text-amber-600 outline-none",value:T.parallelValue,onChange:K=>B({...T,parallelValue:parseFloat(K.target.value)})}):n.jsx("div",{className:`inline-flex items-center gap-3 px-6 py-2.5 rounded-2xl font-mono text-lg font-black transition-all ${Number(H.parallelValue)>0?"bg-amber-50 text-amber-600 border border-amber-100":"bg-slate-100 text-slate-300"}`,children:Number(H.parallelValue)>0?Number(H.parallelValue).toFixed(2):"--.--"})}),n.jsx("td",{className:"px-10 py-7 text-right",children:n.jsx("div",{className:"flex justify-end gap-3",children:X?n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:Q,className:"p-3 bg-emerald-600 text-white rounded-xl shadow-lg active:scale-90 transition-all",children:n.jsx(Zn,{size:18})}),n.jsx("button",{onClick:()=>E(null),className:"p-3 bg-red-600 text-white rounded-xl shadow-lg active:scale-90 transition-all",children:n.jsx(mt,{size:18})})]}):n.jsx("button",{onClick:()=>{E(H.date),B(H)},className:"p-4 bg-slate-100 text-slate-400 rounded-2xl hover:bg-blue-600 hover:text-white transition-all opacity-0 group-hover:opacity-100 active:scale-95 shadow-sm",children:n.jsx(yl,{size:18})})})})]},H.date)})})]})})]})]})]})},FEe=({user:e})=>{const{residents:t,properties:r,fees:a,users:s}=ht(),[i,l]=k.useState(new Date().getMonth()),[o,d]=k.useState(new Date().getFullYear()),[u,f]=k.useState("fee"),[p,h]=k.useState(""),[m,b]=k.useState("Comunicado Importante SAC 2026"),[v,y]=k.useState(!1),[j,_]=k.useState([]),[N,E]=k.useState(0),[T,B]=k.useState(!1),R=(()=>{const P=a.find(G=>G.month===i&&G.year===o);return t.filter(G=>G.isOwner).map(G=>{const Q=r.find(W=>W.id===G.propertyId),H=s.find(W=>W.cedula===G.cedula),X=G.phone||(H==null?void 0:H.phone)||"";let K=0,ee="Pendiente";if(P){const W=P.debts.find(Y=>Y.propertyId===G.propertyId);W&&(K=Number(W.amountUsd),ee=W.status)}return{id:G.id,name:G.fullName,phone:X,email:H==null?void 0:H.email,telegramId:H==null?void 0:H.telegramChatId,propName:Q?`${Q.type} ${Q.number}`:"S/I",debtAmount:K,status:ee,isPaid:ee==="Pagado"}})})(),U=()=>{const P=R.filter(G=>G.phone.replace(/\D/g,"").length>=7);if(P.length===0){alert("SISTEMA: No hay propietarios con números de teléfono válidos.");return}_(P),E(0),B(!0)},D=()=>{const P=j[N];let G="";u==="fee"?(G=`🏢 *AVISO DE COBRO - SAC 2026*

`,G+=`Estimado(a) *${P.name}*,

`,G+=`Le saludamos desde la *Administración del Condominio El Tejar*. Le informamos que su recibo ya se encuentra disponible para gestión:

`,G+=`📌 *Inmueble:* ${P.propName}
`,G+=`📅 *Periodo:* ${Te[i]} ${o}
`,G+=`💰 *Monto a Pagar:* $${P.debtAmount.toFixed(2)} USD
`,G+=`✅ *Estatus:* ${P.status}

`,G+=`*¿Cómo reportar?*
`,G+=`Ingrese a nuestra plataforma digital, cargue su comprobante y obtenga su recibo sellado de inmediato.

`,G+=`🔗 *ACCEDER AL PORTAL:* ${Rr}

`,G+="_¡Gracias por su puntual compromiso!_"):(G=`📢 *COMUNICADO OFICIAL SAC 2026*

`,G+=`Hola *${P.name}*,

`,G+=`*Asunto:* ${m}

`,G+=`${p}

`,G+=`🔗 *ACCEDER AL PORTAL:* ${Rr}

`,G+="_Atentamente, Junta de Condominio El Tejar_");let Q=P.phone.trim(),H="";Q.startsWith("+")?H=Q.replace(/\D/g,""):Q.startsWith("0")?H="58"+Q.substring(1).replace(/\D/g,""):Q.length===10?H="58"+Q.replace(/\D/g,""):H=Q.replace(/\D/g,"");const X=`https://wa.me/${H}?text=${encodeURIComponent(G)}`;window.open(X,"_blank"),N<j.length-1?E(K=>K+1):(alert("¡Felicidades! Ha terminado de enviar toda la cola de WhatsApp."),B(!1))},L=async P=>{if(u==="custom"&&!p)return alert("Escriba un mensaje.");if(!confirm(`¿Enviar masivamente por ${P.toUpperCase()} a ${R.length} propietarios?`))return;y(!0);const G={channel:P,subject:u==="fee"?`Aviso de Cobro SAC 2026 - ${Te[i]} ${o}`:m,messageType:u,customMessage:p,recipients:R.map(Q=>({name:Q.name,email:Q.email,telegramChatId:Q.telegramId,amount:Q.debtAmount.toFixed(2),status:Q.status,propName:Q.propName})),monthName:Te[i],year:o};try{const Q=await fetch(`${Ne}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(G)});if(!Q.ok)throw new Error(`HTTP ${Q.status}`);const H=await Q.json();H.status==="success"?alert(`¡Proceso Completado!
Enviados con éxito: ${H.sent}
Fallidos: ${H.failed}`):alert("Error en el servidor de envío: "+(H.message||"Fallo desconocido."))}catch{alert("Error de conexión con el servidor o sesión expirada.")}finally{y(!1)}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Mensajería Masiva ",n.jsx("span",{className:"text-blue-600",children:"2026"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Difusión global multicanal para la comunidad."})]}),n.jsxs("div",{className:"bg-slate-900 text-white px-6 py-3 rounded-2xl flex items-center gap-4 shadow-xl",children:[n.jsx(Qi,{size:20,className:"text-blue-400"}),n.jsxs("span",{className:"text-sm font-black tracking-tight",children:[R.length," Destinatarios"]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[n.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"flex gap-4 mb-8",children:[n.jsxs("button",{onClick:()=>f("fee"),className:`flex-1 py-4 rounded-2xl font-black text-xs uppercase tracking-widest transition-all flex items-center justify-center gap-2 ${u==="fee"?"bg-blue-600 text-white shadow-lg":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:[n.jsx(yr,{size:18})," Aviso de Cobro"]}),n.jsxs("button",{onClick:()=>f("custom"),className:`flex-1 py-4 rounded-2xl font-black text-xs uppercase tracking-widest transition-all flex items-center justify-center gap-2 ${u==="custom"?"bg-indigo-600 text-white shadow-lg":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:[n.jsx(ck,{size:18})," Comunicado Libre"]})]}),u==="fee"?n.jsxs("div",{className:"grid grid-cols-2 gap-4 animate-in slide-in-from-top",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Mes de Cobro"}),n.jsx("select",{value:i,onChange:P=>l(Number(P.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl px-5 py-4 font-black text-slate-800 outline-none",children:Te.map((P,G)=>n.jsx("option",{value:G,children:P},G))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Año"}),n.jsx("input",{type:"number",value:o,onChange:P=>d(Number(P.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl px-5 py-4 font-black text-slate-800 outline-none"})]})]}):n.jsxs("div",{className:"space-y-4 animate-in slide-in-from-bottom",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Asunto del Comunicado"}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl px-5 py-4 font-black text-slate-800 outline-none",placeholder:"Asunto del Mensaje",value:m,onChange:P=>b(P.target.value)})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Mensaje"}),n.jsx("textarea",{className:"w-full bg-slate-50 border border-slate-100 rounded-3xl px-5 py-4 font-medium text-slate-800 outline-none min-h-[200px]",placeholder:"Escriba su mensaje aquí...",value:p,onChange:P=>h(P.target.value)})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[n.jsxs("button",{onClick:()=>L("email"),disabled:v,className:"p-8 rounded-[2.5rem] bg-blue-600 text-white flex flex-col items-center justify-center gap-4 shadow-xl shadow-blue-200 transition-all hover:scale-105 active:scale-95 disabled:opacity-50",children:[v?n.jsx($t,{className:"animate-spin",size:32}):n.jsx(Br,{size:32}),n.jsxs("div",{className:"text-center",children:[n.jsx("span",{className:"block font-black uppercase text-[10px] tracking-widest",children:"Enviar Emails"}),n.jsx("span",{className:"text-2xl font-black",children:R.filter(P=>P.email).length})]})]}),n.jsxs("button",{onClick:()=>L("telegram"),disabled:v,className:"p-8 rounded-[2.5rem] bg-sky-500 text-white flex flex-col items-center justify-center gap-4 shadow-xl shadow-sky-200 transition-all hover:scale-105 active:scale-95 disabled:opacity-50",children:[v?n.jsx($t,{className:"animate-spin",size:32}):n.jsx(Bl,{size:32}),n.jsxs("div",{className:"text-center",children:[n.jsx("span",{className:"block font-black uppercase text-[10px] tracking-widest",children:"Telegram Bot"}),n.jsx("span",{className:"text-2xl font-black",children:R.filter(P=>P.telegramId).length})]})]}),n.jsxs("button",{onClick:U,className:"p-8 rounded-[2.5rem] bg-emerald-600 text-white flex flex-col items-center justify-center gap-4 shadow-xl shadow-emerald-200 transition-all hover:scale-105 active:scale-95",children:[n.jsx(Ha,{size:32}),n.jsxs("div",{className:"text-center",children:[n.jsx("span",{className:"block font-black uppercase text-[10px] tracking-widest",children:"Cola WhatsApp"}),n.jsx("span",{className:"text-2xl font-black",children:R.filter(P=>P.phone&&P.phone.length>=7).length})]})]})]})]}),n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm h-fit",children:[n.jsxs("h3",{className:"text-xl font-black text-slate-800 mb-6 flex items-center gap-3",children:[n.jsx(Xi,{className:"text-emerald-500",size:24})," Estado de Datos"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-xs text-slate-500 font-medium leading-relaxed",children:"El motor SAC 2026 garantiza la entrega mediante túneles certificados (Resend API)."}),n.jsxs("div",{className:"p-4 bg-emerald-50 border border-emerald-100 rounded-2xl",children:[n.jsx("p",{className:"text-[10px] font-black text-emerald-700 uppercase tracking-widest mb-1",children:"Detección de Teléfono"}),n.jsx("p",{className:"text-[10px] text-emerald-600 leading-tight",children:"Para mejores resultados guarde los números con el signo +. (Ej: +58 412...)."})]})]})]})]}),T&&j.length>0&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/80 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsx("div",{className:"bg-emerald-100 text-emerald-600 p-3 rounded-2xl",children:n.jsx(Ha,{size:24})}),n.jsx("button",{onClick:()=>B(!1),className:"text-slate-400 hover:text-red-500",children:n.jsx(mt,{size:24})})]}),n.jsxs("div",{className:"text-center mb-10",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Procesando Cola"}),n.jsxs("p",{className:"text-slate-400 text-sm font-medium",children:["Unidad ",N+1," de ",j.length]})]}),n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[2rem] border border-slate-100 mb-8 relative group",children:[n.jsx("div",{className:"absolute -top-3 left-8 bg-emerald-600 text-white px-3 py-1 rounded-full text-[9px] font-black uppercase tracking-widest shadow-lg",children:"Siguiente Envío"}),n.jsx("p",{className:"text-xl font-black text-slate-800 mb-1 uppercase",children:j[N].name}),n.jsxs("p",{className:"text-xs font-bold text-blue-600 flex items-center gap-2",children:[n.jsx(_c,{size:12})," ",j[N].phone]}),n.jsxs("div",{className:"mt-8 pt-6 border-t border-slate-200",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Monto de Aviso:"}),n.jsxs("p",{className:"text-2xl font-black text-slate-900",children:["$$",j[N].debtAmount.toFixed(2)]})]}),n.jsx("div",{className:"w-full bg-slate-200 h-1.5 rounded-full mt-8 overflow-hidden",children:n.jsx("div",{className:"bg-emerald-500 h-full transition-all duration-500",style:{width:`${(N+1)/j.length*100}%`}})})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("button",{onClick:D,className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white py-6 rounded-2xl font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-emerald-200 transition-all flex items-center justify-center gap-3 active:scale-95",children:["LANZAR WHATSAPP ",n.jsx(BM,{size:18})]}),n.jsx("button",{onClick:()=>E(P=>Math.min(j.length-1,P+1)),className:"w-full py-4 text-slate-400 hover:text-slate-600 font-bold text-xs uppercase tracking-widest transition-colors",children:"Omitir Destinatario"})]})]})})]})},DEe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,markReceiptSent:i}=ht(),[l,o]=k.useState(new Date().getMonth()),[d,u]=k.useState(new Date().getFullYear()),[f,p]=k.useState(null),[h,m]=k.useState(""),[b,v]=k.useState("standard"),[y,j]=k.useState(`Estimado(a) [nombre], le saludamos desde el Condominio El Tejar. Le informamos que su unidad [unidad] presenta un estatus de pago: *[estatus]*. 

Puede consultar su balance detallado en nuestro portal SAC 2026:
🔗 *ACCEDER AL PORTAL:* ${Rr}`);if(!["programmer","admin","board"].includes(e.role))return n.jsxs("div",{className:"bg-red-50 border border-red-100 p-10 rounded-[3rem] text-center max-w-lg mx-auto shadow-xl",children:[n.jsx(vs,{className:"w-16 h-16 text-red-500 mx-auto mb-6"}),n.jsx("h3",{className:"text-2xl font-black text-red-800 tracking-tight",children:"Acceso Denegado"}),n.jsx("p",{className:"text-red-600 font-medium",children:"Solo personal administrativo puede acceder a la mensajería."})]});const N=(D,L)=>{let P=D;return P=P.replace(/\[nombre\]/g,L.fullName||""),P=P.replace(/\[unidad\]/g,L.propCode||""),P=P.replace(/\[deuda\]/g,L.amount||"0.00"),P=P.replace(/\[estatus\]/g,L.status||"Al día"),P=P.replace(/\[mes\]/g,Te[l]||""),P=P.replace(/\[telefono\]/g,L.phone||""),P},E=D=>{j(L=>L+`[${D}]`)},T=D=>{if(!D)return"";let L=D.trim();return L.startsWith("+")?L.replace(/\D/g,""):L.startsWith("0")?"58"+L.substring(1).replace(/\D/g,""):L.length===10?"58"+L.replace(/\D/g,""):L.replace(/\D/g,"")},B=t.find(D=>D.month===l&&D.year===d),F=k.useMemo(()=>a.filter(D=>D.isOwner).map(D=>{const L=r.find(Q=>Q.id===D.propertyId),P=s.find(Q=>Q.cedula===D.cedula),G=B==null?void 0:B.debts.find(Q=>Q.propertyId===D.propertyId);return{id:D.id,fullName:D.fullName||"Propietario",email:(P==null?void 0:P.email)||"",telegramId:(P==null?void 0:P.telegramChatId)||"",phone:D.phone||(P==null?void 0:P.phone)||"",propId:L==null?void 0:L.id,propCode:(L==null?void 0:L.code)||"S/I",propName:L?`${L.type} ${L.number}`:"Unidad S/I",amount:G?(Number(G.amountUsd)-Number(G.paidAmount)).toFixed(2):"0.00",status:G?G.status:"Sin Deuda",hasFee:!!G,receiptSent:(G==null?void 0:G.receiptSent)||{}}}).filter(D=>{const L=h.toLowerCase();return D.fullName.toLowerCase().includes(L)||D.propCode.toLowerCase().includes(L)}).sort((D,L)=>D.propCode.localeCompare(L.propCode,void 0,{numeric:!0})),[a,r,s,B,h]),R=async D=>{if(!D.email)return alert("Sin correo registrado.");p(D.id);const L={channel:"email",messageType:b==="standard"?"fee":"custom",customMessage:b==="standard"?null:N(y,D),subject:b==="standard"?`Aviso de Cobro SAC 2026 - ${Te[l]}`:"Comunicado Condominio El Tejar",recipients:[{name:D.fullName,email:D.email,amount:D.amount,status:D.status,propName:D.propName}],monthName:Te[l],year:d};try{const G=await(await fetch(`${Ne}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).json();G.status==="success"?(B&&await i(B.id,D.propId,"email"),alert("¡Éxito! Email entregado.")):alert("Error: "+G.message)}catch{alert("Fallo de red.")}finally{p(null)}},U=async D=>{if(!D.telegramId)return alert("Sin ID de Telegram.");p(D.id);const L={channel:"telegram",messageType:b==="standard"?"fee":"custom",customMessage:b==="standard"?null:N(y,D),recipients:[{name:D.fullName,telegramChatId:D.telegramId,amount:D.amount,status:D.status,propName:D.propName}],monthName:Te[l],year:d};try{const G=await(await fetch(`${Ne}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(L)})).json();G.status==="success"?(B&&await i(B.id,D.propId,"telegram"),alert("¡Éxito! Telegram enviado.")):alert("Error: "+G.message)}catch{alert("Fallo de red.")}finally{p(null)}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Comunicación Individual ",n.jsx("span",{className:"text-blue-600",children:"2026"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Gestión personalizada por unidad inmobiliaria."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:l,onChange:D=>o(Number(D.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Te.map((D,L)=>n.jsx("option",{value:L,children:D},L))}),n.jsx("input",{type:"number",value:d,onChange:D=>u(Number(D.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"flex border-b border-slate-100",children:[n.jsxs("button",{onClick:()=>v("standard"),className:`flex-1 py-5 font-black text-[10px] uppercase tracking-[0.2em] transition-all flex items-center justify-center gap-3 ${b==="standard"?"bg-blue-600 text-white shadow-inner":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:[n.jsx(Kr,{size:16})," Plantilla Aviso de Cobro"]}),n.jsxs("button",{onClick:()=>v("custom"),className:`flex-1 py-5 font-black text-[10px] uppercase tracking-[0.2em] transition-all flex items-center justify-center gap-3 ${b==="custom"?"bg-indigo-600 text-white shadow-inner":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:[n.jsx(ck,{size:16})," Mensaje Personalizado"]})]}),b==="custom"&&n.jsx("div",{className:"p-8 lg:p-10 bg-indigo-50/30 animate-in slide-in-from-top-2",children:n.jsxs("div",{className:"flex flex-col lg:flex-row gap-8",children:[n.jsxs("div",{className:"flex-1 space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-indigo-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(JG,{size:14})," Redactor de Plantilla"]}),n.jsx("textarea",{className:"w-full bg-white border border-indigo-100 rounded-[2rem] p-8 text-sm font-medium text-slate-700 outline-none focus:ring-4 focus:ring-indigo-500/10 min-h-[150px] shadow-sm",value:y,onChange:D=>j(D.target.value),placeholder:"..."})]}),n.jsxs("div",{className:"w-full lg:w-[350px] space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx($K,{size:14})," Etiquetas Dinámicas"]}),n.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{t:"nombre",l:"Nombre"},{t:"unidad",l:"Unidad"},{t:"deuda",l:"Monto $"},{t:"estatus",l:"Estatus"},{t:"mes",l:"Mes"},{t:"telefono",l:"Teléfono"}].map(D=>n.jsxs("button",{onClick:()=>E(D.t),className:"py-3 bg-white border border-indigo-100 rounded-xl text-[10px] font-black text-indigo-600 uppercase tracking-tighter hover:bg-indigo-600 hover:text-white transition-all shadow-sm flex items-center justify-center gap-2 active:scale-95",children:[n.jsx(En,{size:12})," ",D.l]},D.t))})]})]})}),n.jsx("div",{className:"p-8 border-t border-slate-100 flex flex-col md:flex-row items-center justify-between gap-6 bg-white",children:n.jsxs("div",{className:"relative w-full max-w-md",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Filtrar por unidad o propietario...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm focus:ring-2 focus:ring-blue-500 outline-none transition-all font-bold text-slate-800",value:h,onChange:D=>m(D.target.value)})]})}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Unidad"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Titular"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Estado"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Canal"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:F.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-20 text-center text-slate-300 italic",children:"Búsqueda sin resultados"})}):F.map(D=>{const L=b==="standard"?`🏢 *AVISO DE COBRO - SAC 2026*

Estimado(a) *${D.fullName}*,

Su recibo de *${Te[l]} ${d}* para la unidad *${D.propName}* ya está disponible.

💵 *Total a Pagar:* $${D.amount} USD
📌 *Estado:* ${D.status}

Por favor, gestione su reporte de pago en nuestro portal digital:
🔗 *ACCEDER AL PORTAL:* ${Rr}

¡Muchas gracias!`:N(y,D),P=T(D.phone);return n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-6 font-black text-slate-900",children:D.propCode}),n.jsxs("td",{className:"px-8 py-6",children:[n.jsx("p",{className:"text-sm font-black text-slate-700 uppercase",children:D.fullName}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 tracking-widest uppercase",children:D.phone||"Sin Teléfono"})]}),n.jsxs("td",{className:"px-8 py-6 text-right font-mono font-black text-slate-900",children:["$",D.amount]}),n.jsx("td",{className:"px-8 py-6 text-center",children:n.jsx("span",{className:`px-4 py-1.5 rounded-full text-[8px] font-black uppercase tracking-widest border ${D.status==="Pagado"?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-red-50 text-red-600 border-red-100"}`,children:D.status})}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex justify-center items-center gap-3",children:[P?n.jsx("a",{href:`https://wa.me/${P}?text=${encodeURIComponent(L)}`,target:"_blank",rel:"noreferrer",onClick:()=>B&&i(B.id,D.propId,"whatsapp"),className:"w-10 h-10 bg-emerald-500 hover:bg-emerald-600 text-white rounded-xl shadow-lg flex items-center justify-center transition-all active:scale-90",title:"Enviar WhatsApp",children:n.jsx(Ha,{size:18})}):n.jsx("div",{className:"w-10 h-10 bg-slate-100 text-slate-200 rounded-xl flex items-center justify-center",children:n.jsx(mt,{size:14})}),n.jsx("button",{onClick:()=>U(D),disabled:!D.telegramId,className:`w-10 h-10 rounded-xl flex items-center justify-center text-white transition-all ${D.telegramId?"bg-sky-500 hover:bg-sky-600":"bg-slate-100 text-slate-200"}`,title:"Enviar Telegram",children:f===D.id?n.jsx($t,{size:16,className:"animate-spin"}):n.jsx(Bl,{size:18})}),n.jsx("button",{onClick:()=>R(D),disabled:!D.email,className:`w-10 h-10 rounded-xl flex items-center justify-center text-white transition-all ${D.email?"bg-indigo-600 hover:bg-indigo-700":"bg-slate-100 text-slate-200"}`,title:"Enviar Email",children:f===D.id?n.jsx($t,{size:16,className:"animate-spin"}):n.jsx(Br,{size:18})})]})})]},D.id)})})]})})]})]})},_H=e=>{if(!e)return"S/F";const t=new Date(e.replace(" ","T"));return isNaN(t.getTime())?e:new Date(t.getTime()-14400*1e3).toLocaleString("es-VE",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0})},UEe=({user:e,onActionComplete:t})=>{const{polls:r,addPoll:a,closePoll:s,deletePoll:i,submitVote:l,properties:o,residents:d,loading:u,refreshData:f}=ht(),[p,h]=k.useState(null),[m,b]=k.useState(!1),[v,y]=k.useState(""),[j,_]=k.useState(""),[N,E]=k.useState([{id:1,text:"",type:"single",options:[{id:1,text:"Opción 1"},{id:2,text:"Opción 2"}]}]),T=["admin","programmer","board"].includes(e.role),B=o.length,F=()=>{N.length>=3||E([...N,{id:Date.now(),text:"",type:"single",options:[{id:1,text:"Opción 1"},{id:2,text:"Opción 2"}]}])},R=ee=>{E(N.filter(W=>W.id!==ee))},U=(ee,W,Y)=>{E(N.map(M=>M.id===ee?{...M,[W]:Y}:M))},D=ee=>{E(N.map(W=>W.id===ee?{...W,options:[...W.options,{id:Date.now(),text:`Opción ${W.options.length+1}`}]}:W))},L=(ee,W,Y)=>{E(N.map(M=>M.id===ee?{...M,options:M.options.map(O=>O.id===W?{...O,text:Y}:O)}:M))},P=(ee,W)=>{E(N.map(Y=>Y.id===ee?{...Y,options:Y.options.filter(M=>M.id!==W)}:Y))},G=ee=>{ee.preventDefault();const W={id:Date.now(),title:v,description:j,status:"Abierta",createdAt:new Date().toISOString(),questions:N,responses:[]};a(W),b(!1),Q()},Q=()=>{y(""),_(""),E([{id:1,text:"",type:"single",options:[{id:1,text:"Opción 1"},{id:2,text:"Opción 2"}]}])},H=async(ee,W)=>{await l(ee,W),t&&t(),f()},X=ee=>{const W=ee.responses||[],Y=B>0?(W.length/B*100).toFixed(1):"0",M=window.open("","","width=900,height=800");if(!M)return;let O=ee.questions.map(q=>{const z=q.options.map(J=>{const re=W.filter(ne=>ne.answers&&Array.isArray(ne.answers)&&ne.answers.some(ae=>ae.questionId===q.id&&ae.selectedOptionIds&&ae.selectedOptionIds.includes(J.id))).length,le=W.length>0?(re/W.length*100).toFixed(1):"0";return`<tr><td style="padding:8px">${J.text}</td><td style="text-align:right"><b>${re} votos</b></td><td style="text-align:right">${le}%</td></tr>`}).join("");return`
        <div style="margin-bottom:30px; border-bottom:1px solid #eee; padding-bottom:10px">
          <h3>P: ${q.text}</h3>
          <table style="width:100%; border-collapse:collapse">${z}</table>
        </div>
      `}).join("");M.document.write(`
      <html>
        <head><title>Acta: ${ee.title}</title><style>body{font-family:sans-serif;padding:40px;color:#1e293b} h1{border-bottom:3px solid #6366f1;padding-bottom:10px}</style></head>
        <body>
          <div style="text-align:center;margin-bottom:40px">
            <h1>CARTA CONSULTA - RESULTADOS</h1>
            <p>CONJUNTO RESIDENCIAL EL TEJAR - SAC 2026</p>
          </div>
          <div style="background:#f8fafc;padding:20px;border-radius:10px;margin-bottom:30px">
            <h2>${ee.title}</h2>
            <p>${ee.description}</p>
            <p><b>Fecha Oficial (VET):</b> ${_H(ee.createdAt)}</p>
            <p><b>Participación:</b> ${W.length} de ${B} Unidades Inmobiliarias (${Y}%)</p>
          </div>
          ${O}
          <div style="margin-top:80px;display:flex;justify-content:space-around">
            <div style="width:200px;border-top:1px solid #000;text-align:center;padding-top:10px">Administración</div>
            <div style="width:200px;border-top:1px solid #000;text-align:center;padding-top:10px">Junta de Condominio</div>
          </div>
          <p style="text-align:center;font-size:10px;color:#94a3b8;margin-top:50px">Certificado Digital Auditado • Zona Horaria: America/Caracas (VET)</p>
        </body>
      </html>
    `),M.document.close(),M.print()},K=async ee=>{if(confirm("¿Está seguro de eliminar permanentemente esta consulta?"))try{await i(ee),f()}catch{alert("Error al intentar eliminar la consulta.")}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 bg-white p-8 lg:p-12 rounded-[3.5rem] border border-slate-200 shadow-sm relative overflow-hidden group",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-indigo-50 w-fit px-4 py-1.5 rounded-full border border-indigo-100 flex items-center gap-2 mb-6",children:[n.jsx(Rd,{size:14,className:"text-indigo-600"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-indigo-600",children:"Democracia Digital"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter",children:["Cartas ",n.jsx("span",{className:"text-indigo-600 italic",children:"Consulta"})]}),n.jsxs("p",{className:"text-slate-400 mt-3 font-medium text-lg max-w-md",children:["Decisiones auditadas para sus ",B," unidades inmobiliarias."]})]}),n.jsxs("div",{className:"flex gap-3 relative z-10",children:[n.jsx("button",{onClick:f,className:"p-5 bg-slate-50 hover:bg-slate-100 rounded-3xl border border-slate-200 transition-all text-slate-500",children:n.jsx(ct,{size:24,className:u?"animate-spin":""})}),T&&n.jsxs("button",{onClick:()=>b(!0),className:"bg-indigo-600 hover:bg-indigo-700 text-white px-10 py-5 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl shadow-indigo-100 transition-all active:scale-95 flex items-center gap-3",children:[n.jsx(En,{size:20})," Nueva Consulta"]})]}),n.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-indigo-50/50 rounded-full blur-[100px] pointer-events-none -translate-y-1/2 translate-x-1/3"})]}),n.jsx("div",{className:"grid grid-cols-1 gap-8",children:r.length===0?n.jsxs("div",{className:"bg-white p-24 text-center rounded-[3rem] border border-dashed border-slate-200",children:[n.jsx("div",{className:"w-20 h-20 bg-slate-50 rounded-3xl flex items-center justify-center mx-auto mb-6",children:n.jsx(Rd,{size:40,className:"text-slate-300"})}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-sm",children:"No hay consultas activas."})]}):r.map(ee=>n.jsx(MEe,{poll:ee,user:e,totalUnits:B,isExpanded:p===ee.id,onExpand:()=>h(p===ee.id?null:ee.id),onPrint:()=>X(ee),onClose:()=>{confirm("¿Cerrar votación?")&&s(ee.id)},onDelete:()=>K(ee.id),onSubmitVote:W=>H(ee.id,W)},ee.id))}),m&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[200] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-3xl shadow-2xl overflow-y-auto max-h-[90vh] custom-scrollbar",children:[n.jsxs("div",{className:"flex justify-between items-center mb-12",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-16 h-16 bg-indigo-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-xl shadow-indigo-200",children:n.jsx(Jd,{size:32})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Nueva Carta Consulta"}),n.jsx("p",{className:"text-slate-400 font-medium",children:"Configure las opciones de votación para el Tejar."})]})]}),n.jsx("button",{onClick:()=>b(!1),className:"p-4 bg-slate-100 hover:bg-slate-200 rounded-full text-slate-500 transition-colors",children:n.jsx(mt,{size:24})})]}),n.jsxs("form",{onSubmit:G,className:"space-y-10",children:[n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Título de la Consulta"}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 focus:ring-2 focus:ring-indigo-600 outline-none text-slate-900 font-bold",value:v,onChange:ee=>y(ee.target.value),placeholder:"..."})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Descripción Detallada"}),n.jsx("textarea",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-[2rem] px-6 py-4 focus:ring-2 focus:ring-indigo-600 outline-none text-slate-900 font-medium min-h-[100px]",value:j,onChange:ee=>_(ee.target.value),placeholder:"..."})]})]}),n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-slate-100 pb-4",children:[n.jsxs("h4",{className:"font-black text-slate-800 text-sm uppercase tracking-tight flex items-center gap-2",children:[n.jsx($V,{className:"text-indigo-600",size:18})," Preguntas"]}),N.length<3&&n.jsx("button",{type:"button",onClick:F,className:"text-indigo-600 font-black text-[10px] uppercase tracking-widest hover:underline",children:"+ Añadir"})]}),N.map((ee,W)=>n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[2.5rem] border border-slate-200 space-y-6 relative",children:[N.length>1&&n.jsx("button",{type:"button",onClick:()=>R(ee.id),className:"absolute top-6 right-6 text-red-400 hover:text-red-600",children:n.jsx(Ua,{size:18})}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-white border border-slate-200 rounded-xl px-4 py-3 text-sm font-bold outline-none",value:ee.text,onChange:Y=>U(ee.id,"text",Y.target.value),placeholder:`Enunciado de Pregunta ${W+1}`}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[ee.options.map((Y,M)=>n.jsxs("div",{className:"flex gap-2",children:[n.jsx("input",{required:!0,type:"text",className:"flex-1 bg-white border border-slate-200 rounded-xl px-4 py-2 text-xs font-medium outline-none",value:Y.text,onChange:O=>L(ee.id,Y.id,O.target.value)}),ee.options.length>2&&n.jsx("button",{type:"button",onClick:()=>P(ee.id,Y.id),className:"p-2 text-slate-300 hover:text-red-500",children:n.jsx(mt,{size:14})})]},Y.id)),n.jsx("button",{type:"button",onClick:()=>D(ee.id),className:"flex items-center justify-center p-2 border border-dashed border-slate-300 rounded-xl text-[10px] font-bold text-slate-400 hover:text-indigo-600 transition-all uppercase",children:"+ Opción"})]})]},ee.id))]}),n.jsxs("div",{className:"flex gap-4 pt-6",children:[n.jsx("button",{type:"button",onClick:()=>b(!1),className:"flex-1 py-5 text-slate-400 font-bold uppercase text-xs",children:"Cancelar"}),n.jsxs("button",{type:"submit",className:"flex-[2] bg-indigo-600 text-white py-5 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl flex items-center justify-center gap-3 active:scale-95 transition-all",children:[n.jsx(Zn,{size:18})," PUBLICAR CONSULTA"]})]})]})]})})]})},MEe=({poll:e,user:t,totalUnits:r,isExpanded:a,onExpand:s,onPrint:i,onClose:l,onDelete:o,onSubmitVote:d})=>{var N,E;const u=["admin","programmer","board"].includes(t.role),f=t.role==="owner",p=(e==null?void 0:e.responses)||[],h=p.length,m=r>0?Math.round(h/r*100):0,b=p.some(T=>T.propertyId===(t==null?void 0:t.propertyId)),[v,y]=k.useState([]),j=async()=>{var T;if(v.length<(((T=e==null?void 0:e.questions)==null?void 0:T.length)||0))return alert("Responda todo el cuestionario.");await d(v),y([])},_=(T,B,F)=>{let R=[...v];const U=R.find(D=>D.questionId===T);U?F==="single"?U.selectedOptionIds=[B]:U.selectedOptionIds.includes(B)?U.selectedOptionIds=U.selectedOptionIds.filter(D=>D!==B):U.selectedOptionIds.push(B):R.push({questionId:T,selectedOptionIds:[B]}),y(R)};return n.jsxs("div",{className:`bg-white rounded-[3rem] border border-slate-200 overflow-hidden transition-all shadow-sm ${a?"ring-2 ring-indigo-500/20":""}`,children:[n.jsxs("div",{className:"p-8 lg:p-10 flex flex-col md:flex-row justify-between items-center gap-6 cursor-pointer",onClick:s,children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:`w-16 h-16 rounded-[1.5rem] flex items-center justify-center ${e.status==="Abierta"?"bg-indigo-50 text-indigo-600 shadow-lg":"bg-slate-100 text-slate-400"}`,children:n.jsx(Rd,{size:28})}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tighter",children:e.title}),n.jsx("span",{className:`px-3 py-1 rounded-full text-[9px] font-black uppercase tracking-widest ${e.status==="Abierta"?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-red-50 text-red-600 border-red-100"}`,children:e.status})]}),n.jsxs("div",{className:"flex items-center gap-4 text-xs font-bold text-slate-400 uppercase tracking-widest",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(Qi,{size:14})," ",h," / ",r," Unidades"]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(Gt,{size:14})," ",m,"% Escrutado"]}),n.jsxs("span",{className:"text-slate-300",children:["Publicado: ",_H(e.createdAt)]})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[u&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:T=>{T.stopPropagation(),i()},className:"p-3 bg-slate-50 hover:bg-blue-50 text-slate-400 hover:text-blue-600 rounded-xl transition-all shadow-sm",children:n.jsx(wt,{size:18})}),e.status==="Abierta"&&n.jsx("button",{onClick:T=>{T.stopPropagation(),l()},className:"p-3 bg-slate-50 hover:bg-amber-50 text-slate-400 hover:text-amber-600 rounded-xl shadow-sm",children:n.jsx(Od,{size:18})}),n.jsx("button",{onClick:T=>{T.stopPropagation(),o()},className:"p-3 bg-slate-100 text-slate-400 hover:bg-red-600 hover:text-white rounded-xl shadow-sm",children:n.jsx(Ua,{size:18})})]}),n.jsx("div",{className:`ml-2 p-3 rounded-xl transition-all ${a?"bg-indigo-600 text-white shadow-lg":"bg-slate-100 text-slate-600"}`,children:a?n.jsx(lk,{size:20}):n.jsx(ik,{size:20})})]})]}),a&&n.jsx("div",{className:"border-t border-slate-100 bg-slate-50/50 p-8 lg:p-12 animate-in slide-in-from-top-4 duration-300",children:n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-10",children:[n.jsxs("div",{className:"lg:col-span-2 space-y-10",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[2.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("h4",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-3 flex items-center gap-2",children:[n.jsx(jn,{size:14})," Motivo"]}),n.jsx("p",{className:"text-slate-600 font-medium",children:e.description})]}),f&&!b&&e.status==="Abierta"?n.jsxs("div",{className:"space-y-8",children:[(N=e.questions)==null?void 0:N.map((T,B)=>{var F;return n.jsxs("div",{className:"bg-white p-8 rounded-[2.5rem] border border-slate-200 shadow-sm space-y-6",children:[n.jsxs("h5",{className:"text-lg font-black text-slate-800 tracking-tight flex items-center gap-4",children:[n.jsx("span",{className:"w-8 h-8 bg-indigo-600 text-white rounded-full flex items-center justify-center text-xs",children:B+1}),T.text]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:(F=T.options)==null?void 0:F.map(R=>{var D,L;const U=(L=(D=v.find(P=>P.questionId===T.id))==null?void 0:D.selectedOptionIds)==null?void 0:L.includes(R.id);return n.jsxs("button",{onClick:()=>_(T.id,R.id,T.type),className:`p-6 rounded-2xl border text-left transition-all flex items-center justify-between ${U?"bg-indigo-600 border-indigo-600 text-white shadow-xl":"bg-slate-50 border-slate-100 text-slate-600 hover:bg-white hover:border-indigo-300"}`,children:[n.jsx("span",{className:"font-bold text-sm",children:R.text}),n.jsx("div",{className:`w-5 h-5 rounded-full border-2 flex items-center justify-center ${U?"bg-white border-white":"border-slate-300"}`,children:U&&n.jsx("div",{className:"w-2.5 h-2.5 bg-indigo-600 rounded-full"})})]},R.id)})})]},T.id)}),n.jsx("button",{onClick:j,className:"w-full bg-indigo-600 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-2xl active:scale-95 transition-all",children:"ENVIAR MI VOTO (ZONA VET)"})]}):n.jsx("div",{className:"space-y-8",children:(E=e.questions)==null?void 0:E.map(T=>{var B;return n.jsxs("div",{className:"bg-white p-8 rounded-[2.5rem] border border-slate-200 shadow-sm space-y-6",children:[n.jsx("h5",{className:"text-lg font-black text-slate-800 tracking-tight",children:T.text}),n.jsx("div",{className:"space-y-4",children:(B=T.options)==null?void 0:B.map(F=>{const R=p.filter(D=>D.answers&&Array.isArray(D.answers)&&D.answers.some(L=>L.questionId===T.id&&L.selectedOptionIds&&L.selectedOptionIds.includes(F.id))).length,U=p.length>0?Math.round(R/p.length*100):0;return n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex justify-between text-xs font-black uppercase tracking-widest text-slate-500",children:[n.jsx("span",{children:F.text}),n.jsxs("span",{className:"text-indigo-600",children:[U,"% (",R," votos)"]})]}),n.jsx("div",{className:"w-full h-3 bg-slate-100 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-indigo-600",style:{width:`${U}%`}})})]},F.id)})})]},T.id)})})]}),n.jsx("div",{className:"space-y-8",children:n.jsxs("div",{className:"bg-indigo-600 p-8 rounded-[3rem] text-white shadow-2xl relative overflow-hidden",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest opacity-60",children:"Quórum Nominal"}),n.jsxs("h4",{className:"text-5xl font-black tracking-tighter mt-2",children:[m,"%"]}),n.jsxs("p",{className:"text-indigo-100 text-xs font-bold mt-4 uppercase tracking-widest",children:[h," de ",r," Unidades"]})]})})]})})]})},TH=e=>{if(!e)return"S/F";const t=new Date(e.replace(" ","T"));return isNaN(t.getTime())?e:new Date(t.getTime()-14400*1e3).toLocaleString("es-VE",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0})},REe=({user:e,onActionComplete:t})=>{const{dataForms:r,addDataForm:a,deleteDataForm:s,toggleDataFormStatus:i,submitDataForm:l,properties:o,residents:d,users:u,loading:f,refreshData:p}=ht(),[h,m]=k.useState(!1),[b,v]=k.useState(null),[y,j]=k.useState(null),[_,N]=k.useState(null),[E,T]=k.useState(""),[B,F]=k.useState(""),[R,U]=k.useState([{id:"f1",label:"",type:"text",required:!0}]),D=["admin","programmer","board"].includes(e.role.toLowerCase()),L=o.length||90;k.useEffect(()=>{const ee=e.propertyId;if(!ee)return;const W=r.find(Y=>Y.status==="Activo"&&!(Y.responses||[]).some(M=>M.propertyId===ee));W&&!D&&(j(W.id),v(W.id))},[r,e.propertyId,D]);const P=()=>{R.length>=20||U([...R,{id:`f${Date.now()}`,label:"",type:"text",required:!0}])},G=(ee,W,Y)=>{U(R.map(M=>M.id===ee?{...M,[W]:Y}:M))},Q=ee=>{U(R.filter(W=>W.id!==ee))},H=async ee=>{if(ee.preventDefault(),!E||R.some(Y=>!Y.label)){alert("Complete el título y las etiquetas de todos los campos.");return}const W={title:E,description:B,fields:R};try{await a(W),m(!1),X()}catch{alert("Error al publicar censo. Verifique sus permisos.")}},X=()=>{T(""),F(""),U([{id:"f1",label:"",type:"text",required:!0}])},K=async ee=>{try{await l(y,ee),j(null),t&&t()}catch{alert("Error al enviar respuesta.")}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 bg-white p-8 lg:p-12 rounded-[3.5rem] border border-slate-200 shadow-sm relative overflow-hidden group",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-blue-50 w-fit px-4 py-1.5 rounded-full border border-blue-100 flex items-center gap-2 mb-6",children:[n.jsx(Jd,{size:14,className:"text-blue-600"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-blue-600",children:"Censos SAC 2026"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter",children:["Gestión de ",n.jsx("span",{className:"text-blue-600 italic",children:"Datos"})]}),n.jsxs("p",{className:"text-slate-400 mt-3 font-medium text-lg max-w-md",children:["Estandarización nominal para las ",L," unidades inmobiliarias."]})]}),n.jsxs("div",{className:"flex gap-3 relative z-10",children:[n.jsx("button",{onClick:()=>p(),className:"p-5 bg-slate-50 hover:bg-slate-100 rounded-3xl border border-slate-200 transition-all text-slate-500",children:n.jsx(ct,{size:24,className:f?"animate-spin":""})}),D&&n.jsxs("button",{onClick:()=>m(!0),className:"bg-blue-600 hover:bg-blue-700 text-white px-10 py-5 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-100 transition-all active:scale-95 flex items-center justify-center gap-3",children:[n.jsx(En,{size:20})," Crear Censo"]})]})]}),n.jsx("div",{className:"grid grid-cols-1 gap-8",children:r.length===0?n.jsxs("div",{className:"bg-white p-24 text-center rounded-[3rem] border border-dashed border-slate-200",children:[n.jsx(ck,{size:40,className:"text-slate-300 mx-auto mb-6"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-sm",children:"Sin formularios activos."})]}):r.map(ee=>n.jsx(OEe,{form:ee,user:e,totalUnits:L,isExpanded:b===ee.id,onExpand:()=>v(b===ee.id?null:ee.id),onFill:()=>j(ee.id),onViewResponses:()=>N(ee.id),onToggleStatus:()=>i(ee.id),onDelete:()=>{confirm("¿Eliminar?")&&s(ee.id)}},ee.id))}),h&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3.5rem] p-10 lg:p-14 w-full max-w-4xl shadow-2xl overflow-y-auto max-h-[90vh] custom-scrollbar animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-12",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-xl shadow-blue-200",children:n.jsx(En,{size:32})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Diseño de Censo"}),n.jsx("p",{className:"text-slate-400 font-medium",children:"Configure los campos requeridos para la consulta."})]})]}),n.jsx("button",{onClick:()=>m(!1),className:"p-4 bg-slate-100 hover:bg-slate-200 rounded-full text-slate-500 transition-colors",children:n.jsx(mt,{size:24})})]}),n.jsxs("form",{onSubmit:H,className:"space-y-12",children:[n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-10",children:[n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Título del Censo"}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 focus:ring-2 focus:ring-blue-600 outline-none text-slate-900 font-bold",value:E,onChange:ee=>T(ee.target.value.toUpperCase()),placeholder:"EJ: REGISTRO DE VEHÍCULOS 2026"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Descripción / Justificación"}),n.jsx("textarea",{className:"w-full bg-slate-50 border border-slate-200 rounded-[2rem] px-6 py-4 focus:ring-2 focus:ring-blue-600 outline-none text-slate-900 font-medium min-h-[120px]",value:B,onChange:ee=>F(ee.target.value),placeholder:"Indique a los vecinos el propósito de esta recolección..."})]})]}),n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[3rem] border border-slate-200 space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-slate-200 pb-4",children:[n.jsxs("h4",{className:"text-sm font-black text-slate-800 uppercase flex items-center gap-2",children:[n.jsx(jn,{size:16,className:"text-blue-600"})," Definición de Campos"]}),n.jsx("button",{type:"button",onClick:P,className:"text-blue-600 font-black text-[10px] uppercase tracking-widest hover:underline",children:"+ Añadir Campo"})]}),n.jsx("div",{className:"space-y-4 max-h-[400px] overflow-y-auto pr-2 custom-scrollbar",children:R.map((ee,W)=>n.jsxs("div",{className:"bg-white p-5 rounded-2xl border border-slate-200 shadow-sm space-y-4 relative group animate-in slide-in-from-right-4",children:[n.jsxs("div",{className:"flex gap-3",children:[n.jsx("div",{className:"flex-1",children:n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-100 rounded-xl px-4 py-2 text-xs font-bold outline-none focus:bg-white",value:ee.label,onChange:Y=>G(ee.id,"label",Y.target.value),placeholder:`Etiqueta del Campo ${W+1}`})}),n.jsxs("select",{className:"bg-slate-900 text-white text-[10px] font-black rounded-xl px-3 outline-none",value:ee.type,onChange:Y=>G(ee.id,"type",Y.target.value),children:[n.jsx("option",{value:"text",children:"Texto"}),n.jsx("option",{value:"number",children:"Número"}),n.jsx("option",{value:"date",children:"Fecha"}),n.jsx("option",{value:"boolean",children:"Si/No"})]}),R.length>1&&n.jsx("button",{type:"button",onClick:()=>Q(ee.id),className:"text-red-400 hover:text-red-600 p-1",children:n.jsx(Ua,{size:16})})]}),n.jsxs("div",{className:"flex items-center gap-2 px-1",children:[n.jsx("input",{type:"checkbox",id:`req-${ee.id}`,checked:ee.required,onChange:Y=>G(ee.id,"required",Y.target.checked),className:"rounded text-blue-600"}),n.jsx("label",{htmlFor:`req-${ee.id}`,className:"text-[9px] font-black text-slate-400 uppercase",children:"Respuesta Obligatoria"})]})]},ee.id))})]})]}),n.jsxs("div",{className:"flex gap-4 pt-6",children:[n.jsx("button",{type:"button",onClick:()=>m(!1),className:"flex-1 py-5 text-slate-400 font-black uppercase text-xs tracking-widest",children:"Descartar"}),n.jsxs("button",{type:"submit",className:"flex-[2] bg-blue-600 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-200 flex items-center justify-center gap-3 active:scale-95 transition-all",children:[n.jsx(Zn,{size:18})," PUBLICAR CENSO EN CARTELERA"]})]})]})]})}),y&&n.jsx(LEe,{formId:y,user:e,onClose:()=>j(null),onSubmit:K}),_&&n.jsx(PEe,{formId:_,user:e,properties:o,onClose:()=>N(null)})]})},OEe=({form:e,user:t,totalUnits:r,isExpanded:a,onExpand:s,onFill:i,onViewResponses:l,onToggleStatus:o,onDelete:d})=>{const u=["admin","programmer","board"].includes(t.role.toLowerCase()),f=(e.responses||[]).length,p=r>0?Math.round(f/r*100):0,h=(e.responses||[]).some(m=>m.propertyId===t.propertyId);return n.jsxs("div",{className:`bg-white rounded-[3rem] border border-slate-200 overflow-hidden transition-all shadow-sm ${a?"ring-2 ring-blue-500/20":""}`,children:[n.jsxs("div",{className:"p-8 lg:p-10 flex flex-col md:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:`w-16 h-16 rounded-[1.5rem] flex items-center justify-center ${e.status==="Activo"?"bg-blue-50 text-blue-600 shadow-lg":"bg-slate-100 text-slate-400"}`,children:n.jsx(Jd,{size:28})}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tighter",children:e.title}),n.jsx("span",{className:`px-3 py-1 rounded-full text-[9px] font-black uppercase tracking-widest ${e.status==="Activo"?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-red-50 text-red-600 border-red-100"}`,children:e.status})]}),n.jsxs("div",{className:"flex items-center gap-4 text-xs font-bold text-slate-400 uppercase tracking-widest",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(Qi,{size:14})," ",f," / ",r," Unidades"]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(Gt,{size:14})," ",p,"% Escrutado"]}),n.jsxs("span",{className:"text-slate-300",children:["Emisión: ",TH(e.createdAt)]})]})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[u?n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:l,className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm",children:n.jsx(Tc,{size:18})}),n.jsx("button",{onClick:o,className:"p-3 rounded-xl bg-slate-50 text-slate-500",children:e.status==="Activo"?n.jsx(Od,{size:18}):n.jsx(TM,{size:18})}),n.jsx("button",{onClick:d,className:"p-3 bg-red-50 text-red-600 rounded-xl hover:bg-red-600 hover:text-white transition-all shadow-sm",children:n.jsx(Ua,{size:18})})]}):!h&&e.status==="Activo"&&n.jsxs("button",{onClick:i,className:"bg-blue-600 text-white px-8 py-3 rounded-xl font-black text-[10px] uppercase shadow-xl transition-all flex items-center gap-2 active:scale-95",children:["LLENAR AHORA ",n.jsx(_c,{size:14})]}),h&&!u&&n.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-emerald-50 text-emerald-600 rounded-xl border border-emerald-100",children:[n.jsx(Gt,{size:16}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Enviado"})]}),n.jsx("button",{onClick:s,className:`ml-2 p-3 rounded-xl transition-all ${a?"bg-blue-600 text-white":"bg-slate-100 text-slate-600"}`,children:a?n.jsx(lk,{size:20}):n.jsx(ik,{size:20})})]})]}),a&&e.description&&n.jsx("div",{className:"px-8 pb-8 lg:px-10 lg:pb-10 border-t border-slate-100 pt-6 animate-in slide-in-from-top-2",children:n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:[n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-2 flex items-center gap-2",children:[n.jsx(jn,{size:12,className:"text-blue-600"})," Descripción / Justificación"]}),n.jsx("p",{className:"text-slate-600 text-sm font-medium leading-relaxed whitespace-pre-wrap",children:e.description})]})})]})},PEe=({formId:e,user:t,properties:r,onClose:a})=>{const{dataForms:s}=ht(),i=s.find(l=>l.id===e);return i?n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[400] p-4 no-print",children:n.jsxs("div",{className:"bg-white rounded-[3.5rem] w-full max-w-6xl h-[85vh] shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95",children:[n.jsxs("div",{className:"p-8 border-b flex justify-between items-center bg-white z-10",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-14 h-14 bg-blue-600 rounded-2xl flex items-center justify-center text-white",children:n.jsx(xo,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Bitácora de Censo (VET)"}),n.jsx("p",{className:"text-blue-600 font-black text-[10px] uppercase tracking-[0.2em]",children:i.title})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-50 border rounded-xl",children:n.jsx(wt,{size:20})}),n.jsx("button",{onClick:a,className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(mt,{size:24})})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto p-10 bg-slate-50 custom-scrollbar",children:n.jsx("div",{className:"bg-white rounded-[2.5rem] border overflow-hidden",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Inmueble"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha Envío (VET)"}),i.fields.map(l=>n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:l.label},l.id))]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:(i.responses||[]).map((l,o)=>{const d=r.find(u=>u.id===l.propertyId);return n.jsxs("tr",{className:"hover:bg-slate-50 transition-colors",children:[n.jsx("td",{className:"px-8 py-6 font-black text-slate-900",children:(d==null?void 0:d.code)||"N/A"}),n.jsx("td",{className:"px-8 py-6 text-[11px] font-bold text-slate-400",children:TH(l.submittedAt)}),i.fields.map(u=>{const f=l.data&&l.data[u.id]!==void 0?l.data[u.id]:"-";return n.jsx("td",{className:"px-8 py-6 text-sm font-medium text-slate-600",children:typeof f=="string"&&(f.toUpperCase()==="SI"||f==="true")?n.jsx("span",{className:"text-emerald-600 font-black",children:"SÍ"}):typeof f=="string"&&(f.toUpperCase()==="NO"||f==="false")?n.jsx("span",{className:"text-rose-600 font-black",children:"NO"}):f||"-"},u.id)})]},o)})})]})})})]})}):null},LEe=({formId:e,user:t,onClose:r,onSubmit:a})=>{const{dataForms:s}=ht(),i=s.find(p=>p.id===e),[l,o]=k.useState({}),[d,u]=k.useState(!1);if(!i)return null;const f=async p=>{if(p.preventDefault(),u(!0),!t.propertyId)return alert("Error: Unidad no vinculada.");const h={propertyId:t.propertyId,userId:t.id,submittedAt:new Date().toISOString(),data:l};await a(h),u(!1)};return n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-3xl shadow-2xl animate-in zoom-in-95 h-full sm:h-auto overflow-y-auto",children:[n.jsxs("div",{className:"flex justify-between items-start mb-10",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:i.title}),n.jsxs("p",{className:"text-slate-400 mt-1 font-medium italic",children:["Unidad Registrante: ",t.propertyCode]})]}),n.jsx("button",{onClick:r,className:"p-3 bg-slate-100 rounded-full hover:text-red-500 transition-all",children:n.jsx(mt,{size:24})})]}),i.description&&n.jsxs("div",{className:"mb-10 bg-blue-50/50 p-8 rounded-[2rem] border border-blue-100",children:[n.jsxs("p",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest mb-3 flex items-center gap-2",children:[n.jsx(jn,{size:14})," Instrucciones / Justificación"]}),n.jsx("p",{className:"text-slate-700 text-sm font-medium leading-relaxed whitespace-pre-wrap",children:i.description})]}),n.jsxs("form",{onSubmit:f,className:"space-y-6",children:[n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:i.fields.map(p=>n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-200",children:[n.jsxs("label",{className:"block text-sm font-black text-slate-800 mb-4 ml-1",children:[p.label," ",p.required&&"*"]}),p.type==="boolean"?n.jsxs("div",{className:"flex gap-4",children:[n.jsx("button",{type:"button",onClick:()=>o({...l,[p.id]:"Si"}),className:`flex-1 py-4 rounded-xl font-black text-xs transition-all border ${l[p.id]==="Si"?"bg-emerald-600 text-white":"bg-white text-slate-400"}`,children:"SÍ"}),n.jsx("button",{type:"button",onClick:()=>o({...l,[p.id]:"No"}),className:`flex-1 py-4 rounded-xl font-black text-xs transition-all border ${l[p.id]==="No"?"bg-red-600 text-white":"bg-white text-slate-400"}`,children:"NO"})]}):n.jsx("input",{required:p.required,type:p.type,className:"w-full bg-white border border-slate-200 rounded-2xl px-6 py-4 font-black focus:ring-2 focus:ring-blue-600 outline-none",value:l[p.id]||"",onChange:h=>o({...l,[p.id]:h.target.value})})]},p.id))}),n.jsx("button",{disabled:d,type:"submit",className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-2xl active:scale-95 transition-all",children:d?"ENVIANDO...":"REPORTE SEGURO VET"})]})]})})},L2=e=>{if(!e)return"S/F";const t=new Date(e.replace(" ","T"));return isNaN(t.getTime())?e:new Date(t.getTime()-14400*1e3).toLocaleString("es-VE",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0})},$E=e=>{const t=e.responses||[],r={};return e.options.forEach(a=>r[a.id]=0),t.forEach(a=>{r[a.optionId]!==void 0&&r[a.optionId]++}),{total:t.length,counts:r}},QEe=({user:e,onActionComplete:t})=>{const{liveVotes:r,addLiveVote:a,updateLiveVoteStatus:s,castLiveVote:i,deleteLiveVote:l,refreshData:o,properties:d,residents:u,users:f,loading:p}=ht(),[h,m]=k.useState(!1),[b,v]=k.useState(!1),[y,j]=k.useState(null),[_,N]=k.useState(""),[E,T]=k.useState(["A favor","En contra","Abstención"]),B=["admin","programmer","board"].includes(e.role),F=r.find(H=>H.status==="Activa"),R=d.length;k.useEffect(()=>{let H;return F?(v(!0),H=setInterval(()=>{o()},4e3)):v(!1),()=>clearInterval(H)},[F,o]);const U=()=>{E.length<5&&T([...E,`Opción ${E.length+1}`])},D=H=>{E.length>2&&T(E.filter((X,K)=>K!==H))},L=async H=>{H.preventDefault();const X={question:_,options:E.map((K,ee)=>({id:ee+1,text:K})),status:"Borrador"};await a(X),m(!1),P(),o()},P=()=>{N(""),T(["A favor","En contra","Abstención"])},G=async H=>{if(confirm("¿Borrar esta votación?"))try{await l(H),o()}catch(X){alert(X.message)}},Q=H=>{const X=$E(H),K=window.open("","","width=850,height=900");if(!K)return;const ee=H.responses||[],W=R>0?Math.round(ee.length/R*100):0;let Y=ee.map(M=>{const O=f.find(re=>re.id===M.userId),q=H.options.find(re=>re.id===M.optionId),z=u.find(re=>re.cedula===(O==null?void 0:O.cedula)),J=d.find(re=>re.id===(z==null?void 0:z.propertyId));return{usr:O,opt:q,prop:J,date:M.date}}).sort((M,O)=>{var q,z;return(((q=M.prop)==null?void 0:q.code)||"").localeCompare(((z=O.prop)==null?void 0:z.code)||"",void 0,{numeric:!0,sensitivity:"base"})}).map(M=>{var O,q;return`<tr>
            <td style="border:1px solid #e2e8f0;padding:10px">${M.prop?`${M.prop.type} ${M.prop.number} (${M.prop.code})`:"N/A"}</td>
            <td style="border:1px solid #e2e8f0;padding:10px">${(O=M.usr)==null?void 0:O.fullName}</td>
            <td style="border:1px solid #e2e8f0;padding:10px;text-align:center"><b>${(q=M.opt)==null?void 0:q.text}</b></td>
            <td style="border:1px solid #e2e8f0;padding:10px;text-align:right;font-size:8pt">${L2(M.date)}</td>
          </tr>`}).join("");K.document.write(`
          <html><head><title>Acta: ${H.question}</title>
          <style>body{font-family:sans-serif;padding:50px;color:#1e293b} h1{color:#2563eb;border-bottom:2px solid #2563eb;padding-bottom:10px} .box{background:#f8fafc;padding:20px;border-radius:10px;margin-bottom:30px} table{width:100%;border-collapse:collapse}</style>
          </head><body>
              <div style="text-align:center">
                <h1>ACTA DE ASAMBLEA DIGITAL (VET)</h1>
                <p><b>Condominio El Tejar - SAC 2026</b></p>
              </div>
              <div class="box">
                <p><b>Pregunta:</b> ${H.question}</p>
                <p><b>Inicio de Sesión (VET):</b> ${L2(H.createdAt)}</p>
                <p><b>Quórum:</b> ${ee.length} de ${R} Unidades (${W}%)</p>
              </div>
              <h3>RESULTADO DEL ESCRUTINIO:</h3>
              <ul>${H.options.map(M=>{const O=X.counts[M.id]||0,q=X.total>0?Math.round(O/X.total*100):0;return`<li><b>${M.text}:</b> ${O} votos (${q}%)</li>`}).join("")}</ul>
              <hr style="margin:40px 0"/>
              <h3>AUDITORÍA NOMINAL DE EMISIÓN:</h3>
              <table style="font-size:10pt"><thead><tr style="background:#f1f5f9"><th>Inmueble</th><th>Titular</th><th>Estatus Voto</th><th>Timestamp (VET)</th></tr></thead><tbody>${Y}</tbody></table>
              <div style="margin-top:100px;display:flex;justify-content:space-around">
                <div style="width:200px;border-top:1px solid #000;text-align:center;padding-top:10px">Administración</div>
                <div style="width:200px;border-top:1px solid #000;text-align:center;padding-top:10px">Junta de Condominio</div>
              </div>
              <p style="text-align:center;font-size:9px;color:#94a3b8;margin-top:50px">Generado mediante protocolo seguro de asamblea SAC 2026</p>
          </body></html>
      `),K.document.close(),K.print()};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 bg-white p-8 lg:p-12 rounded-[3.5rem] border border-slate-200 shadow-sm relative overflow-hidden group",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-red-50 w-fit px-4 py-1.5 rounded-full border border-red-100 flex items-center gap-2 mb-6",children:[n.jsx(Yf,{size:14,className:b?"text-red-600 animate-pulse":"text-slate-400"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-red-600",children:"Sala Live VET"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter",children:["Asamblea ",n.jsx("span",{className:"text-blue-600 italic",children:"En Vivo"})]}),n.jsxs("p",{className:"text-slate-400 mt-3 font-medium text-lg max-w-md",children:["Escrutinio inmediato para las ",R," unidades del Tejar."]})]}),n.jsxs("div",{className:"flex gap-3 relative z-10",children:[n.jsx("button",{onClick:()=>o(),className:"p-5 bg-slate-50 hover:bg-slate-100 rounded-3xl border border-slate-200 transition-all text-slate-500",children:n.jsx(ct,{size:24,className:p?"animate-spin":""})}),B&&n.jsxs("button",{onClick:()=>m(!0),className:"bg-blue-600 hover:bg-blue-700 text-white px-10 py-5 rounded-[2rem] font-black text-xs uppercase shadow-xl transition-all active:scale-95 flex items-center justify-center gap-3",children:[n.jsx(En,{size:20})," Iniciar Asamblea"]})]})]}),F?n.jsx(HEe,{vote:F,user:e,properties:d,totalUnits:R,onCast:async H=>{await i(F.id,H),t&&t()},onClose:()=>{confirm("¿Cerrar?")&&s(F.id,"Finalizada")}}):n.jsx("div",{className:"grid grid-cols-1 gap-6",children:r.filter(H=>H.status!=="Activa").map(H=>n.jsxs("div",{className:"bg-white p-8 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col md:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-14 h-14 bg-slate-50 text-slate-400 rounded-2xl flex items-center justify-center",children:n.jsx(Yf,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black text-slate-800",children:H.question}),n.jsxs("div",{className:"flex items-center gap-4 mt-1",children:[n.jsx("span",{className:`px-3 py-0.5 rounded-full text-[9px] font-black uppercase tracking-widest ${H.status==="Finalizada"?"bg-slate-100":"bg-amber-50 text-amber-600"}`,children:H.status}),n.jsxs("span",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:["Iniciada: ",L2(H.createdAt)]})]})]})]}),n.jsxs("div",{className:"flex gap-2",children:[B&&H.status==="Borrador"&&n.jsxs("button",{onClick:()=>s(H.id,"Activa"),className:"px-6 py-3 bg-emerald-600 text-white rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2",children:[n.jsx(QV,{size:16})," Activar"]}),n.jsx("button",{onClick:()=>j(H.id),className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm",children:n.jsx(Tc,{size:18})}),n.jsx("button",{onClick:()=>Q(H),className:"p-3 bg-slate-100 text-slate-500 rounded-xl hover:bg-slate-200 transition-all",children:n.jsx(wt,{size:18})}),B&&n.jsx("button",{onClick:()=>G(H.id),className:"p-3 bg-red-50 text-red-600 rounded-xl hover:bg-red-600 hover:text-white transition-all shadow-sm",children:n.jsx(Ua,{size:18})})]})]},H.id))}),h&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[200] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-xl shadow-2xl animate-in zoom-in-95 h-full sm:h-auto overflow-y-auto",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Nueva Sesión Live"}),n.jsx("button",{onClick:()=>m(!1),className:"p-3 bg-slate-100 rounded-full hover:text-red-500 transition-all",children:n.jsx(mt,{size:24})})]}),n.jsxs("form",{onSubmit:L,className:"space-y-8",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Punto a Tratar"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold outline-none focus:ring-2 focus:ring-blue-600",value:_,onChange:H=>N(H.target.value)})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest",children:"Opciones de Respuesta"}),n.jsx("button",{type:"button",onClick:U,className:"text-blue-600 font-black text-[10px] uppercase",children:"+ Añadir"})]}),n.jsx("div",{className:"space-y-2",children:E.map((H,X)=>n.jsxs("div",{className:"flex gap-2 group",children:[n.jsx("input",{required:!0,className:"flex-1 bg-slate-50 border border-slate-200 rounded-xl px-4 py-2 text-sm font-bold outline-none focus:bg-white",value:H,onChange:K=>{const ee=[...E];ee[X]=K.target.value,T(ee)}}),E.length>2&&n.jsx("button",{type:"button",onClick:()=>D(X),className:"p-2 text-slate-300 hover:text-red-500",children:n.jsx(mt,{size:16})})]},X))})]}),n.jsx("button",{type:"submit",className:"w-full bg-blue-600 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl active:scale-95 transition-all",children:"ABRIR SALA DE ASAMBLEA"})]})]})}),y&&n.jsx(zEe,{vote:r.find(H=>H.id===y),properties:d,onClose:()=>j(null)})]})},HEe=({vote:e,user:t,properties:r,totalUnits:a,onCast:s,onClose:i})=>{const l=k.useMemo(()=>$E(e),[e]),o=["admin","programmer","board"].includes(t.role),d=t.role==="owner",u=(e.responses||[]).some(h=>h.propertyId===t.propertyId),f=a>0?Math.round(l.total/a*100):0,p=k.useMemo(()=>[...r].sort((h,m)=>h.code.localeCompare(m.code,void 0,{numeric:!0,sensitivity:"base"})),[r]);return n.jsx("div",{className:"space-y-10 animate-in slide-in-from-bottom-4",children:n.jsx("div",{className:"bg-white p-10 lg:p-14 rounded-[4rem] border-2 border-red-100 shadow-2xl relative overflow-hidden",children:n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-16 relative z-10",children:[n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{children:[n.jsx("span",{className:"bg-red-600 text-white px-4 py-1 rounded-full text-[10px] font-black uppercase tracking-widest animate-pulse",children:"En Vivo - Zona VET"}),n.jsx("h2",{className:"text-4xl font-black text-slate-900 tracking-tighter mt-6 leading-tight",children:e.question})]}),n.jsx("div",{className:"space-y-4",children:e.options.map(h=>{const m=l.total>0?Math.round(l.counts[h.id]/l.total*100):0;return n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("span",{className:"text-sm font-black text-slate-700 uppercase",children:h.text}),n.jsxs("span",{className:"text-sm font-black text-blue-600",children:[l.counts[h.id]," Votos (",m,"%)"]})]}),n.jsx("div",{className:"w-full bg-slate-100 h-4 rounded-full overflow-hidden border",children:n.jsx("div",{className:"h-full bg-blue-600 transition-all duration-1000",style:{width:`${m}%`}})})]},h.id)})}),d&&!u?n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[3rem] border border-slate-200 mt-10",children:[n.jsx("h4",{className:"text-center text-[10px] font-black uppercase tracking-widest text-slate-400 mb-8",children:"Ejerza su derecho al voto"}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:e.options.map(h=>n.jsx("button",{onClick:()=>{confirm(`¿Confirmar voto: ${h.text}?`)&&s(h.id)},className:"bg-white border-2 border-slate-200 hover:border-blue-600 p-6 rounded-2xl text-center font-black text-xs uppercase text-slate-600 hover:text-blue-600 transition-all active:scale-95 shadow-sm",children:h.text},h.id))})]}):u&&d&&n.jsxs("div",{className:"bg-emerald-50 border-emerald-100 p-8 rounded-[3rem] flex items-center gap-6 text-emerald-700 mt-10 shadow-lg shadow-emerald-100/50",children:[n.jsx("div",{className:"w-16 h-16 bg-emerald-600 text-white rounded-[1.5rem] flex items-center justify-center shadow-lg",children:n.jsx(Gt,{size:32})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-lg font-black tracking-tight",children:"Voto Registrado"}),n.jsx("p",{className:"text-sm font-medium opacity-80 uppercase tracking-widest",children:"Gracias por participar."})]})]}),o&&n.jsxs("div",{className:"bg-slate-900 p-8 rounded-[3rem] text-white mt-10 shadow-2xl relative group overflow-hidden",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest opacity-60 mb-2",children:"Administración de Asamblea"}),n.jsx("button",{onClick:i,className:"bg-red-600 hover:bg-red-700 text-white px-10 py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl transition-all",children:"FINALIZAR Y CERRAR SALA"})]}),n.jsx(Yf,{size:120,className:"absolute right-[-20px] bottom-[-20px] text-white/5"})]})]}),n.jsx("div",{className:"space-y-8",children:n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-100 shadow-xl",children:[n.jsx("h4",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-6",children:"Monitor de Presencia Live"}),n.jsx("div",{className:"grid grid-cols-5 sm:grid-cols-8 md:grid-cols-10 gap-2 max-h-[400px] overflow-y-auto custom-scrollbar pr-2",children:p.map(h=>{const m=(e.responses||[]).some(b=>b.propertyId===h.id);return n.jsx("div",{title:h.code,className:`h-8 flex items-center justify-center rounded-lg text-[9px] font-black border transition-all ${m?"bg-emerald-50 border-emerald-600 text-white shadow-lg":"bg-slate-50 border-slate-100 text-slate-300"}`,children:h.code.split("-")[1]||h.code},h.id)})}),n.jsxs("div",{className:"mt-10 border-t border-slate-100 pt-8 flex justify-between items-center",children:[n.jsxs("div",{children:[n.jsxs("p",{className:"text-3xl font-black text-slate-800 tracking-tighter",children:[f,"%"]}),n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Quórum Alcanzado"})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-3xl font-black text-blue-600 tracking-tighter",children:l.total}),n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Unidades en Sala"})]})]})]})})]})})})},zEe=({vote:e,properties:t,onClose:r})=>{const a=$E(e),s=[...t].sort((i,l)=>i.code.localeCompare(l.code,void 0,{numeric:!0,sensitivity:"base"}));return n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3.5rem] w-full max-w-4xl h-[85vh] shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95",children:[n.jsxs("div",{className:"p-10 border-b border-slate-100 flex justify-between items-center bg-white z-10",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-14 h-14 bg-blue-600 rounded-2xl flex items-center justify-center text-white shadow-xl",children:n.jsx(Rd,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:e.question}),n.jsx("p",{className:"text-blue-600 font-black text-[10px] uppercase tracking-widest",children:"Resultados Auditados - Zona VET"})]})]}),n.jsx("button",{onClick:r,className:"p-3 bg-slate-100 rounded-full",children:n.jsx(mt,{})})]}),n.jsx("div",{className:"flex-1 overflow-y-auto p-10 bg-slate-50 custom-scrollbar",children:n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-10",children:[n.jsxs("div",{className:"space-y-6",children:[n.jsx("h4",{className:"text-sm font-black text-slate-400 uppercase tracking-widest border-b pb-2",children:"Escrutinio Global"}),e.options.map(i=>{const l=a.total>0?Math.round(a.counts[i.id]/a.total*100):0;return n.jsxs("div",{className:"bg-white p-6 rounded-[2rem] border border-slate-200 shadow-sm space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"font-black text-slate-800",children:i.text}),n.jsxs("span",{className:"text-2xl font-black text-blue-600",children:[l,"%"]})]}),n.jsx("div",{className:"w-full bg-slate-100 h-3 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-blue-500",style:{width:`${l}%`}})}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 text-right uppercase tracking-widest",children:[a.counts[i.id]," Votos"]})]},i.id)})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsx("h4",{className:"text-sm font-black text-slate-400 uppercase tracking-widest border-b pb-2",children:"Listado de Transparencia"}),n.jsx("div",{className:"bg-white rounded-[2rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50",children:[n.jsx("th",{className:"px-6 py-4 text-[9px] font-black uppercase text-slate-500 tracking-widest",children:"Unidad"}),n.jsx("th",{className:"px-6 py-4 text-[9px] font-black uppercase text-slate-500 tracking-widest",children:"Estatus"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:s.map(i=>{const l=(e.responses||[]).find(d=>d.propertyId===i.id),o=l?e.options.find(d=>d.id===l.optionId):null;return n.jsxs("tr",{className:"hover:bg-slate-50 transition-colors",children:[n.jsx("td",{className:"px-6 py-3 font-black text-slate-700 text-xs",children:i.code}),n.jsx("td",{className:"px-6 py-3",children:o?n.jsx("span",{className:"px-3 py-1 bg-emerald-50 text-emerald-600 rounded-full text-[9px] font-black uppercase tracking-widest border border-emerald-100",children:o.text}):n.jsx("span",{className:"text-[9px] font-bold text-slate-300 uppercase tracking-widest",children:"Inasistencia"})})]},i.id)})})]})})]})]})})]})})},$Ee=()=>{const{exchangeRateHistory:e}=ht(),[t,r]=k.useState(!0),[a,s]=k.useState(""),[i,l]=k.useState([]),[o,d]=k.useState([]),[u,f]=k.useState(!1),[p,h]=k.useState(!1),[m,b]=k.useState(""),v=k.useRef(null),y=k.useMemo(()=>{if(!e||e.length===0)return 45;const D=e[0];return(Number(D.pmValue)>0?Number(D.pmValue):Number(D.amValue))||45},[e]);k.useEffect(()=>{const D=setTimeout(()=>r(!1),600),L=localStorage.getItem("sac_calc_vars");return L&&d(JSON.parse(L)),()=>clearTimeout(D)},[]),k.useEffect(()=>{v.current&&v.current.scrollIntoView({behavior:"smooth"})},[i,a]);const j=D=>{s(a==="Error"?D:L=>L+D)},_=()=>s(""),N=()=>s(D=>D.length>0?D.slice(0,-1):""),E=()=>{if(a)try{let D=a.replace(/x/g,"*").replace(/÷/g,"/").replace(/%/g,"/100");const L=new Function("return "+D)();if(L===void 0||isNaN(L))throw new Error;const P=String(Number(L.toFixed(4)));l([...i,`${a} = ${P}`]),s(P)}catch{s("Error"),setTimeout(()=>s(""),1e3)}},T=()=>{const D=parseFloat(a);if(isNaN(D))return;const P=(D*1.16).toFixed(2);l([...i,`${a} + 16% IVA = ${P}`]),s(P)},B=()=>{const D=parseFloat(a);if(isNaN(D))return;const P=(D*y).toFixed(2);l([...i,`$${a} @ ${y} = Bs.${P}`]),s(P)},F=()=>{const D=prompt("Ingrese % Alícuota:");if(!D||isNaN(Number(D))||!a)return;const P=(Number(a)*Number(D)/100).toFixed(2);l([...i,`${a} * ${D}% = ${P}`]),s(P)},R=()=>{!a||a==="Error"||(b(""),h(!0))},U=D=>{if(D.preventDefault(),!m.trim())return;const L=[...o,{id:Date.now(),name:m.toUpperCase().substring(0,15),value:a}];d(L),localStorage.setItem("sac_calc_vars",JSON.stringify(L)),h(!1)};return t?n.jsx("div",{className:"flex items-center justify-center min-h-[60vh] bg-white rounded-[3rem] border border-slate-200 shadow-sm animate-in zoom-in duration-300",children:n.jsxs("div",{className:"text-center",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-2xl flex items-center justify-center mx-auto mb-4 shadow-xl shadow-blue-100 animate-pulse",children:n.jsx(vi,{size:32,className:"text-white"})}),n.jsxs("h1",{className:"text-2xl font-black text-slate-900 tracking-tighter uppercase",children:["TecnoMath ",n.jsx("span",{className:"text-blue-600",children:"Calc 2026"})]}),n.jsx("p",{className:"text-slate-400 font-bold tracking-[0.2em] text-[8px] uppercase",children:"By Andres Mathison"})]})}):n.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 h-[calc(100dvh-160px)] max-h-[850px] animate-in fade-in duration-500 overflow-hidden",children:[n.jsxs("div",{className:"flex-1 bg-white p-4 sm:p-6 rounded-[2.5rem] shadow-xl border border-slate-200 flex flex-col h-full overflow-hidden",children:[n.jsxs("div",{className:"flex justify-between items-center mb-3 shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-7 h-7 bg-blue-600 rounded-lg flex items-center justify-center text-white",children:n.jsx(da,{size:14})}),n.jsx("span",{className:"text-slate-900 font-black tracking-widest text-[8px] uppercase",children:"Engine v4.0 • By Andres Mathison"})]}),n.jsx("button",{onClick:()=>f(!u),className:`p-2 rounded-lg transition-all ${u?"bg-blue-600 text-white shadow-md":"bg-slate-50 text-slate-400"}`,children:n.jsx(q_,{size:16})})]}),n.jsxs("div",{className:"bg-slate-50 rounded-[1.5rem] p-4 mb-4 flex-1 flex flex-col justify-end overflow-hidden border border-slate-100 shadow-inner relative min-h-[100px]",children:[n.jsx("div",{className:"absolute top-3 left-4 text-[7px] font-black text-slate-300 uppercase tracking-widest",children:"Financial Display"}),n.jsxs("div",{className:"overflow-y-auto flex-1 flex flex-col justify-end scrollbar-hide",children:[i.slice(-3).map((D,L)=>n.jsx("div",{className:"text-right text-slate-400 text-[10px] mb-0.5 font-bold truncate opacity-60 italic",children:D},L)),n.jsx("div",{className:"text-right text-4xl sm:text-5xl text-slate-900 font-black tracking-tighter break-all leading-tight",children:a||"0"}),n.jsx("div",{ref:v})]})]}),n.jsxs("div",{className:"grid grid-cols-4 gap-1.5 sm:gap-2 shrink-0",children:[n.jsx("button",{onClick:B,className:"bg-emerald-50 text-emerald-600 hover:bg-emerald-600 hover:text-white p-3 rounded-xl font-black text-[10px] transition-all border border-emerald-100 active:scale-90 uppercase tracking-widest",children:"BCV"}),n.jsx("button",{onClick:F,className:"bg-blue-50 text-blue-600 hover:bg-blue-600 hover:text-white p-3 rounded-xl font-black text-[10px] transition-all border border-blue-100 active:scale-90 uppercase tracking-widest",children:"Aliq"}),n.jsx("button",{onClick:T,className:"bg-indigo-50 text-indigo-600 hover:bg-indigo-600 hover:text-white p-3 rounded-xl font-black text-[10px] transition-all border border-indigo-100 active:scale-90 uppercase tracking-widest",children:"IVA"}),n.jsx("button",{onClick:_,className:"bg-red-50 text-red-600 hover:bg-red-600 hover:text-white p-3 rounded-xl font-black text-[10px] transition-all border border-red-100 active:scale-90 uppercase tracking-widest",children:"AC"}),[7,8,9,"÷",4,5,6,"x",1,2,3,"-",0,".","DEL","+"].map((D,L)=>{const P=typeof D=="string"&&["÷","x","-","+"].includes(D),G=D==="DEL";return n.jsx("button",{onClick:()=>{G?N():j(String(D))},className:`
                                    ${P?"bg-slate-900 text-white shadow-md":G?"bg-slate-200 text-slate-600":"bg-slate-50 text-slate-900 border border-slate-100 shadow-sm"}
                                    p-3 sm:p-4 rounded-xl font-black text-xl transition-all active:scale-90 flex items-center justify-center
                                `,children:G?n.jsxs("div",{className:"flex flex-col items-center leading-none",children:[n.jsx(sG,{size:14}),n.jsx("span",{className:"text-[8px] mt-0.5",children:"BORRAR"})]}):D},L)})]}),n.jsxs("div",{className:"mt-3 flex gap-2 shrink-0",children:[n.jsxs("button",{onClick:R,className:"flex-1 bg-blue-50 text-blue-600 hover:bg-blue-600 hover:text-white py-3.5 rounded-xl font-black text-[9px] uppercase tracking-widest border border-blue-100 active:scale-95 transition-all flex items-center justify-center gap-2",children:[n.jsx(Zn,{size:14})," MEMORIZAR"]}),n.jsx("button",{onClick:E,className:"flex-[1.5] bg-blue-600 hover:bg-blue-700 text-white py-3.5 rounded-xl font-black text-2xl shadow-lg shadow-blue-100 active:scale-95 transition-all",children:"="})]})]}),n.jsxs("div",{className:`w-full lg:w-[300px] flex flex-col gap-4 transition-all duration-300 ${u?"fixed inset-0 z-[200] bg-white p-6 lg:relative lg:p-0":"lg:flex hidden"}`,children:[u&&n.jsx("button",{onClick:()=>f(!1),className:"lg:hidden absolute top-4 right-4 p-3 bg-slate-100 rounded-full text-slate-500",children:n.jsx(mt,{})}),n.jsxs("div",{className:"bg-white rounded-[2rem] shadow-lg border border-slate-200 shadow-sm flex flex-col h-full overflow-hidden",children:[n.jsx("div",{className:"p-5 bg-slate-50 border-b border-slate-100 flex justify-between items-center",children:n.jsxs("h3",{className:"font-black text-[9px] uppercase tracking-widest flex items-center gap-2 text-slate-500",children:[n.jsx(q_,{size:14,className:"text-blue-600"})," Memoria Local"]})}),n.jsx("div",{className:"p-4 flex-1 overflow-y-auto custom-scrollbar space-y-2",children:o.length===0?n.jsxs("div",{className:"text-center py-10 opacity-20",children:[n.jsx(MG,{size:32,className:"mx-auto mb-2"}),n.jsx("p",{className:"text-[8px] font-black uppercase tracking-widest",children:"Memoria vacía"})]}):o.map(D=>n.jsxs("div",{className:"bg-slate-50 p-3 rounded-xl border border-slate-100 flex justify-between items-center group hover:border-blue-300 transition-all",children:[n.jsxs("div",{className:"overflow-hidden",children:[n.jsx("div",{className:"font-black text-blue-600 text-[8px] truncate uppercase mb-0.5",children:D.name}),n.jsx("div",{className:"text-slate-800 font-mono text-xs font-black",children:D.value})]}),n.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-all",children:[n.jsx("button",{onClick:()=>j(D.value),className:"p-1.5 bg-blue-600 text-white rounded-md shadow-sm",children:n.jsx(AK,{size:10,fill:"currentColor"})}),n.jsx("button",{onClick:()=>{const L=o.filter(P=>P.id!==D.id);d(L),localStorage.setItem("sac_calc_vars",JSON.stringify(L))},className:"p-1.5 bg-white text-red-500 rounded-md border border-red-50",children:n.jsx(Ua,{size:10})})]})]},D.id))})]})]}),p&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm flex items-center justify-center z-[300] p-4",children:n.jsxs("div",{className:"bg-white rounded-[2.5rem] p-8 w-full max-w-xs shadow-2xl animate-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex justify-between items-center mb-6",children:[n.jsx("h3",{className:"text-lg font-black text-slate-900 tracking-tight",children:"Etiquetar"}),n.jsx("button",{onClick:()=>h(!1),className:"p-1 text-slate-300",children:n.jsx(mt,{size:20})})]}),n.jsxs("form",{onSubmit:U,children:[n.jsxs("div",{className:"mb-4",children:[n.jsx("label",{className:"block text-[8px] font-black text-slate-400 uppercase tracking-widest mb-2 ml-1",children:"Valor"}),n.jsx("div",{className:"text-xl font-black text-blue-600 bg-slate-50 border border-slate-100 p-3 rounded-xl text-center",children:a})]}),n.jsxs("div",{className:"mb-6",children:[n.jsx("label",{className:"block text-[8px] font-black text-slate-400 uppercase tracking-widest mb-2 ml-1",children:"Nombre"}),n.jsx("input",{autoFocus:!0,type:"text",required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-xl px-4 py-3 outline-none font-black text-slate-800 uppercase text-xs",placeholder:"EJ: TOTAL_MARZO",value:m,onChange:D=>b(D.target.value.replace(/\s+/g,"_"))})]}),n.jsx("button",{type:"submit",className:"w-full bg-blue-600 text-white py-4 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-lg shadow-blue-100 active:scale-95 transition-all",children:"GUARDAR"})]})]})})]})},VEe=()=>{const{fees:e,financialTotals:t,exchangeRateHistory:r}=ht(),[a,s]=k.useState(!1);k.useEffect(()=>{const o=setTimeout(()=>s(!0),300);return()=>clearTimeout(o)},[]);const i=k.useMemo(()=>{if(!r||r.length===0)return 45.5;const o=r[0];return Number(o==null?void 0:o.pmValue)>0?Number(o==null?void 0:o.pmValue):Number(o==null?void 0:o.amValue)||45.5},[r]),l=k.useMemo(()=>{const d=((t==null?void 0:t.cashBalanceBs)||0)/i,u=(t==null?void 0:t.initialCashUsd)||0,f=d+u,p=(t==null?void 0:t.accountsPayableUsd)||0,h=(t==null?void 0:t.receivablesUsd)||0,m=(t==null?void 0:t.totalBilledUsd)||0,b=(t==null?void 0:t.totalCollectedUsd)||0,v=f+h-p,j=[...e||[]].sort((D,L)=>L.year*12+L.month-(D.year*12+D.month)).slice(0,6).reverse().map(D=>{var G,Q;const L=D.globalStats?D.globalStats.totalBilled:((G=D.debts)==null?void 0:G.reduce((H,X)=>H+Number(X.amountUsd||0),0))||0,P=D.globalStats?D.globalStats.totalCollected:((Q=D.debts)==null?void 0:Q.reduce((H,X)=>H+Number(X.paidAmount||0),0))||0;return{name:Te[D.month].substring(0,3),proyectado:L,cobrado:P}}),_=j.length>0?j.reduce((D,L)=>D+L.cobrado,0)/j.length:1e3,E=h*i*.0033,T=E*30,B=m>0?b/m*100:0,F=h/(m||1)*100,R=p>0?f/p*100:100,U=f/(m||1)*100;return{receivablesUsd:h,cashUsd:f,payablesUsd:p,netPosition:v,historyData:j,lossTodayBs:E,lossMonthBs:T,collectionIndex:B,debtIndex:F,solvencyIndex:R,reserveIndex:U,avgCollection:_}},[e,t,i]);return n.jsxs("div",{className:"space-y-8 sm:space-y-12 animate-in fade-in duration-1000 pb-24 w-full overflow-x-hidden px-1",children:[n.jsx("div",{className:"bg-slate-900 border-y border-slate-800 h-12 sm:h-14 flex items-center overflow-hidden relative shadow-2xl rounded-xl sm:rounded-2xl mx-1",children:n.jsxs("div",{className:"flex items-center gap-8 sm:gap-20 whitespace-nowrap animate-marquee font-mono text-xs sm:text-sm lg:text-base font-bold text-white",children:[n.jsx(Ju,{label:"NAV (VALOR NETO)",value:`$${l.netPosition.toLocaleString(void 0,{minimumFractionDigits:2})}`,trend:l.netPosition>=0?"up":"down"}),n.jsx(Ju,{label:"TASA SELLO",value:`${i.toFixed(2)} VES`,color:"text-blue-400"}),n.jsx(Ju,{label:"CASH TOTAL (BANCO+CASH)",value:`$${l.cashUsd.toLocaleString()}`}),n.jsx(Ju,{label:"ÍNDICE RECAUDACIÓN",value:`${l.collectionIndex.toFixed(1)}%`,trend:"up"}),n.jsx(Ju,{label:"MOROSIDAD ACUMULADA",value:`$${l.receivablesUsd.toLocaleString()}`,color:"text-rose-400"}),n.jsx(Ju,{label:"ESTADO SISTEMA",value:"K. V4.0.80 ONLINE",color:"text-emerald-400"})]})}),n.jsxs("div",{className:"text-left px-2 sm:px-4",children:[n.jsxs("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter uppercase leading-none",children:["TERMINAL ",n.jsx("span",{className:"text-blue-600",children:"FINANCIERO PRO"})]}),n.jsx("p",{className:"text-[9px] sm:text-xs lg:text-sm font-black text-slate-400 uppercase tracking-[0.3em] mt-3 sm:mt-4",children:"INTELIGENCIA DE DATOS SAC 2026 • RENDIMIENTO MULTIPLATAFORMA"})]}),n.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 sm:gap-8 lg:gap-10 px-1",children:[n.jsx(Jh,{label:"CARTERA POR COBRAR",valUsd:l.receivablesUsd,sub:"Total Morosidad Global",icon:da,color:"emerald"}),n.jsx(Jh,{label:"EGRESOS PENDIENTES",valUsd:l.payablesUsd,sub:"Compromisos Cuentas Pagar",icon:fb,color:"rose"}),n.jsx(Jh,{label:"LIQUIDEZ TOTAL",valUsd:l.cashUsd,sub:"Suma Banco + Cash USD",icon:za,color:"blue"}),n.jsx(Jh,{label:"POSICIÓN NETA",valUsd:l.netPosition,sub:"Patrimonio Común Activo",icon:Up,color:"amber"})]}),n.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 sm:gap-10 lg:gap-12 w-full px-1",children:[n.jsxs("div",{className:"w-full lg:flex-[2] bg-white p-6 sm:p-10 lg:p-14 rounded-[2rem] sm:rounded-[4rem] border border-slate-200 shadow-sm flex flex-col",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-10 lg:mb-14 gap-6",children:[n.jsxs("h3",{className:"text-sm sm:text-xl lg:text-2xl font-black text-slate-800 flex items-center gap-4 uppercase tracking-tight",children:[n.jsx(xo,{className:"text-blue-600",size:24})," HISTORIAL DE CONVERGENCIA (6M)"]}),n.jsxs("div",{className:"flex gap-6 text-[10px] sm:text-xs lg:text-sm font-black uppercase text-slate-400",children:[n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-2 h-2 bg-slate-200 rounded-full"})," Facturación"]}),n.jsxs("span",{className:"flex items-center gap-2 text-blue-600",children:[n.jsx("div",{className:"w-2 h-2 bg-blue-600 rounded-full"})," Recaudación"]})]})]}),n.jsx("div",{className:"h-[300px] sm:h-[400px] lg:h-[500px] w-full min-h-[300px]",children:a&&n.jsx(_k,{width:"100%",height:"100%",minWidth:0,children:n.jsxs(Vj,{data:l.historyData,margin:{top:10,right:10,left:-20,bottom:0},children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:"c",x1:"0",y1:"0",x2:"0",y2:"1",children:[n.jsx("stop",{offset:"5%",stopColor:"#2563eb",stopOpacity:.1}),n.jsx("stop",{offset:"95%",stopColor:"#2563eb",stopOpacity:0})]})}),n.jsx(ev,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),n.jsx(tv,{dataKey:"name",fontSize:12,fontWeight:"bold",axisLine:!1,tickLine:!1,dy:10}),n.jsx(rv,{fontSize:12,fontWeight:"bold",axisLine:!1,tickLine:!1}),n.jsx(Fj,{contentStyle:{borderRadius:"16px",border:"none",boxShadow:"0 20px 25px -5px rgba(0,0,0,0.1)",fontSize:"14px",fontWeight:"bold"}}),n.jsx(FA,{type:"monotone",dataKey:"proyectado",stroke:"#cbd5e1",strokeWidth:1,fill:"transparent",strokeDasharray:"5 5"}),n.jsx(FA,{type:"monotone",dataKey:"cobrado",stroke:"#2563eb",strokeWidth:4,fill:"url(#c)"})]})})})]}),n.jsxs("div",{className:"w-full lg:flex-1 bg-white p-6 sm:p-10 lg:p-14 rounded-[2rem] sm:rounded-[4rem] border border-slate-200 shadow-sm flex flex-col",children:[n.jsxs("h3",{className:"text-sm sm:text-xl lg:text-2xl font-black text-slate-800 flex items-center gap-4 mb-10 lg:mb-14 uppercase tracking-tight",children:[n.jsx(wr,{className:"text-amber-500",size:24})," PROYECCIÓN TEMPORAL"]}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-1 gap-4 sm:gap-6 lg:gap-8 overflow-y-auto pr-1",children:[30,90,180].map(o=>n.jsxs("div",{className:"bg-slate-50 p-6 sm:p-8 lg:p-10 rounded-[2rem] sm:rounded-[3rem] border border-slate-100 space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-center text-[10px] sm:text-xs lg:text-sm font-black text-amber-500 uppercase tracking-widest",children:[n.jsxs("span",{children:["Horizonte ",o," Días"]}),n.jsx(nk,{size:16,className:"text-slate-200"})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[8px] sm:text-[10px] lg:text-xs font-black text-slate-400 uppercase tracking-widest block mb-1",children:"Deuda Residual Proyectada"}),n.jsxs("p",{className:"text-xl sm:text-3xl lg:text-4xl font-black text-slate-900 tracking-tighter leading-none font-mono",children:["$",Math.max(0,Math.round(l.receivablesUsd-l.avgCollection*(o/30))).toLocaleString()]})]}),n.jsx("p",{className:"text-[8px] sm:text-[9px] font-bold text-slate-400 uppercase",children:"Basado en promedio móvil de recaudación"})]},o))}),n.jsxs("div",{className:"mt-8 lg:mt-12 p-6 sm:p-8 bg-blue-50 border border-blue-100 rounded-[2rem] flex gap-5 items-center",children:[n.jsx(vs,{className:"text-blue-600 shrink-0",size:24}),n.jsx("p",{className:"text-[8px] sm:text-xs text-blue-800 font-bold uppercase leading-relaxed tracking-tight italic",children:"Algoritmo predictivo Kernel V4.0.80."})]})]})]}),n.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 sm:gap-10 lg:gap-12 px-1",children:[n.jsxs("div",{className:"w-full lg:flex-1 bg-slate-900 p-10 sm:p-16 lg:p-20 rounded-[2.5rem] sm:rounded-[4rem] text-white shadow-2xl overflow-hidden relative min-h-[450px]",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsx("div",{className:"w-16 h-16 sm:w-20 sm:h-20 bg-blue-600 rounded-3xl flex items-center justify-center text-white shadow-xl mb-10 lg:mb-14 border border-blue-400/30",children:n.jsx(Kr,{size:32})}),n.jsxs("h3",{className:"text-2xl sm:text-4xl lg:text-5xl font-black tracking-tighter uppercase leading-none",children:["Laboratorio de ",n.jsx("br",{})," ",n.jsx("span",{className:"text-blue-500",children:"Pérdida Cambiaria"})]}),n.jsx("p",{className:"text-[10px] sm:text-sm lg:text-base font-black text-red-500 uppercase tracking-widest mt-6",children:"Erosión del capital por morosidad acumulada"}),n.jsxs("div",{className:"mt-12 sm:mt-16 space-y-10 lg:space-y-14",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-[9px] sm:text-xs font-black text-slate-500 uppercase tracking-widest block mb-2",children:"Erosión Diaria Estimada"}),n.jsxs("p",{className:"text-3xl sm:text-5xl lg:text-6xl font-black text-red-500 tracking-tighter leading-none font-mono italic",children:["Bs. ",l.lossTodayBs.toLocaleString(void 0,{minimumFractionDigits:2})]})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[9px] sm:text-xs font-black text-slate-500 uppercase tracking-widest block mb-2",children:"Erosión Mensual Proyectada"}),n.jsxs("p",{className:"text-3xl sm:text-5xl lg:text-6xl font-black text-red-600 tracking-tighter leading-none font-mono",children:["Bs. ",l.lossMonthBs.toLocaleString(void 0,{minimumFractionDigits:2})]})]})]})]}),n.jsx(br,{className:"absolute bottom-[-50px] right-[-50px] w-80 h-80 lg:w-[450px] lg:h-[450px] text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"w-full lg:flex-1 bg-white p-10 sm:p-16 lg:p-20 rounded-[2.5rem] sm:rounded-[4rem] border border-slate-200 shadow-sm flex flex-col items-center",children:[n.jsxs("h3",{className:"text-xl sm:text-2xl lg:text-3xl font-black text-slate-900 tracking-tighter uppercase mb-12 sm:mb-16 flex items-center gap-6",children:[n.jsx(uk,{className:"text-blue-600",size:32})," Índices de Liquidez"]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:gap-6 lg:gap-8 mb-12 sm:mb-16 w-full",children:[n.jsx(Zh,{label:"COBRANZA",val:`${l.collectionIndex.toFixed(1)}%`,color:"emerald"}),n.jsx(Zh,{label:"DEUDA",val:`${l.debtIndex.toFixed(1)}%`,color:"rose"}),n.jsx(Zh,{label:"SOLVENCIA",val:`${l.solvencyIndex.toFixed(0)}%`,color:"blue"}),n.jsx(Zh,{label:"RESERVA",val:`${l.reserveIndex.toFixed(1)}%`,color:"indigo"})]}),n.jsxs("div",{className:"w-full max-w-[450px] aspect-square bg-slate-900 rounded-[3rem] sm:rounded-[5rem] p-10 lg:p-14 flex flex-col items-center justify-center text-center shadow-2xl relative overflow-hidden group",children:[n.jsx("div",{className:"w-16 h-16 sm:w-20 sm:h-20 bg-blue-600 rounded-3xl flex items-center justify-center text-white mb-8 shadow-2xl relative z-10",children:n.jsx(Rd,{size:32,className:"lg:w-10 lg:h-10"})}),n.jsx("h4",{className:"text-white text-lg sm:text-xl font-black tracking-widest mb-3 relative z-10 uppercase",children:"Net Asset Value (NAV)"}),n.jsxs("div",{className:"text-5xl sm:text-7xl lg:text-8xl font-black text-blue-500 drop-shadow-[0_0_30px_rgba(59,130,246,0.5)] relative z-10 tracking-tighter font-mono italic",children:["$",Math.round(l.netPosition).toLocaleString()]}),n.jsx(wr,{className:"absolute right-[-40px] bottom-[-40px] w-80 h-80 lg:w-[500px] lg:h-[500px] text-white/5 pointer-events-none group-hover:scale-110 transition-transform duration-[10s]"})]})]})]}),n.jsx("div",{className:"pt-14 sm:pt-20 text-center",children:n.jsx("p",{className:"text-[8px] sm:text-xs lg:text-sm font-black text-slate-300 uppercase tracking-[0.4em] leading-relaxed px-6 sm:px-12 italic",children:"TECNOMATH FINANCIAL ANALYTICS • KERNEL V4.0.80 • AUDITORÍA DE DATOS VERIFICADA • PROCESAMIENTO DISTRIBUIDO"})}),n.jsx("style",{children:`
          @keyframes marquee {
              0% { transform: translateX(0); }
              100% { transform: translateX(-50%); }
          }
          .animate-marquee {
              display: inline-block;
              padding-left: 100%;
              animation: marquee 40s linear infinite;
          }
      `})]})},Ju=({label:e,value:t,trend:r,color:a})=>n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-slate-500 uppercase tracking-widest text-[9px] font-black",children:[e,":"]}),n.jsx("span",{className:`${a||"text-white"} font-black font-mono`,children:t}),r&&n.jsx("div",{className:`p-1 rounded-full ${r==="up"?"bg-emerald-500/20 text-emerald-400":"bg-rose-500/20 text-rose-400"}`,children:r==="up"?n.jsx(nk,{size:10}):n.jsx(dV,{size:10})})]}),Jh=({label:e,valUsd:t,sub:r,icon:a,color:s})=>{const i={emerald:"bg-emerald-50 text-emerald-600 border-emerald-100 shadow-emerald-50",rose:"bg-rose-50 text-rose-600 border-rose-100 shadow-rose-50",blue:"bg-blue-50 text-blue-600 border-blue-100 shadow-blue-50",amber:"bg-amber-50 text-amber-600 border-amber-100 shadow-amber-50"},l={emerald:"text-emerald-600",rose:"text-rose-600",blue:"text-blue-600",amber:"text-amber-600"},o=i[s],d=l[s];return n.jsxs("div",{className:"w-full bg-white p-6 sm:p-10 lg:p-12 rounded-[2rem] sm:rounded-[3.5rem] border border-slate-200 shadow-sm flex flex-col overflow-hidden group hover:border-blue-400 transition-all cursor-default",children:[n.jsxs("div",{className:"flex justify-between items-start",children:[n.jsx("div",{className:`w-12 h-12 sm:w-16 sm:h-16 lg:w-20 lg:h-20 rounded-2xl sm:rounded-3xl flex items-center justify-center flex-shrink-0 border shadow-lg ${o} group-hover:scale-110 transition-transform`,children:n.jsx(a,{size:24})}),n.jsx("span",{className:"text-[8px] sm:text-xs lg:text-sm font-black text-slate-400 uppercase tracking-widest text-right leading-none mt-2 max-w-[80px] sm:max-w-none",children:e})]}),n.jsxs("div",{className:"mt-10 sm:mt-16 lg:mt-20",children:[n.jsxs("h4",{className:`text-xl sm:text-3xl lg:text-4xl xl:text-5xl font-black ${d} tracking-tighter leading-none font-mono italic`,children:["$",t.toLocaleString(void 0,{minimumFractionDigits:2})]}),n.jsx("p",{className:"text-[8px] sm:text-xs lg:text-sm font-bold text-slate-400 uppercase mt-6 tracking-tighter truncate opacity-70",children:r})]})]})},Zh=({label:e,val:t,color:r})=>{const a=r==="emerald"?"text-emerald-600":r==="rose"?"text-rose-600":r==="indigo"?"text-indigo-600":"text-blue-600",s=r==="emerald"?"bg-emerald-50":r==="rose"?"bg-rose-50":r==="indigo"?"bg-indigo-50":"bg-blue-50",i=r==="emerald"?"border-emerald-100":r==="rose"?"border-rose-100":r==="indigo"?"border-indigo-100":"border-blue-100";return n.jsxs("div",{className:`${s} ${i} border rounded-2xl sm:rounded-3xl flex flex-col items-center justify-center text-center p-4 sm:p-8 lg:p-10 transition-transform hover:scale-105 shadow-sm`,children:[n.jsx("span",{className:"text-[7px] sm:text-[10px] lg:text-xs font-black text-slate-400 uppercase tracking-widest mb-3 sm:mb-4",children:e}),n.jsx("span",{className:`text-[10px] sm:text-lg lg:text-xl xl:text-2xl font-black leading-none ${a} font-mono`,children:t})]})},GEe=({user:e})=>{const{reservations:t,addReservation:r,updateReservationStatus:a,deleteReservation:s,isPoolEnabled:i,togglePoolAvailability:l,properties:o,residents:d,loading:u,refreshData:f}=ht(),[p,h]=k.useState(!1),[m,b]=k.useState({facility:"Caney",whatsapp:e.phone||""}),v=e.role==="programmer",y=["admin","board","programmer"].includes(e.role),j=e.propertyCode||"S/I",_=e.propertyId,N=k.useMemo(()=>{const B=["Caney","Piñatero","Salón de Fiesta","Salón Extra"];return i&&B.push("Piscina"),B},[i]),E=async B=>{B.preventDefault();const F=y?m.propertyId:_;if(!F)return alert("ERROR: Su cuenta no tiene una unidad inmobiliaria asignada. Contacte a soporte.");const R={facility:m.facility,date:m.date,propertyId:F,residentName:e.fullName,whatsapp:m.whatsapp,status:y?"Aprobada":"Pendiente"};try{await r(R),h(!1),b({facility:"Caney",whatsapp:e.phone||""})}catch{alert("Error al procesar reserva.")}},T=async B=>{confirm("¿Eliminar reserva permanentemente de la pizarra?")&&await s(B)};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[v&&n.jsxs("div",{className:"bg-slate-900 p-6 rounded-[2rem] border border-slate-800 shadow-xl flex items-center justify-between group overflow-hidden relative",children:[n.jsx("div",{className:"relative z-10",children:n.jsxs("h4",{className:"text-white font-black text-xs uppercase tracking-widest flex items-center gap-2",children:[n.jsx(Od,{className:"text-blue-500",size:14})," Facility Master Switch"]})}),n.jsxs("button",{onClick:()=>l(!i),className:`relative z-10 px-6 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest transition-all flex items-center gap-3 ${i?"bg-emerald-600 text-white":"bg-red-600 text-white"}`,children:[i?n.jsx(Z_,{size:16}):n.jsx(mt,{size:16})," Piscina: ",i?"DISPONIBLE":"BLOQUEADA"]}),n.jsx(Z_,{className:"absolute right-[-20px] bottom-[-20px] w-32 h-32 text-blue-500/5 pointer-events-none group-hover:scale-110 transition-transform"})]}),y&&t.filter(B=>B.status==="Pendiente").length>0&&n.jsxs("div",{className:"bg-amber-50 border border-amber-100 p-8 rounded-[3rem] shadow-sm animate-in slide-in-from-top",children:[n.jsxs("h3",{className:"text-xl font-black text-amber-800 flex items-center gap-3 mb-6",children:[n.jsx(Ia,{size:24})," Solicitudes Entrantes (",t.filter(B=>B.status==="Pendiente").length,")"]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.filter(B=>B.status==="Pendiente").map(B=>n.jsxs("div",{className:"bg-white p-6 rounded-2xl border border-amber-200 shadow-sm space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-start",children:[n.jsx("span",{className:"bg-blue-50 text-blue-600 px-3 py-1 rounded-full text-[10px] font-black uppercase tracking-widest",children:B.facility}),n.jsx("span",{className:"text-xs font-black text-slate-900",children:B.date})]}),n.jsxs("p",{className:"font-black text-slate-800 text-sm uppercase tracking-tight truncate",children:[B.propertyCode||"N/A"," - ",B.residentName]}),n.jsxs("div",{className:"flex gap-2 pt-2",children:[n.jsx("button",{onClick:()=>a(B.id,"Aprobada"),className:"flex-1 bg-emerald-600 text-white py-2.5 rounded-xl font-black text-[10px] uppercase",children:"Aprobar"}),n.jsx("button",{onClick:()=>a(B.id,"Rechazada"),className:"flex-1 bg-red-50 text-red-600 py-2.5 rounded-xl font-black text-[10px] uppercase",children:"Rechazar"})]})]},B.id))})]}),n.jsxs("div",{className:"bg-white p-8 lg:p-12 rounded-[3.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center gap-6 mb-12",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-3xl flex items-center justify-center text-white shadow-xl shadow-blue-500/20",children:n.jsx(Y_,{size:32})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Agenda de Áreas Comunes"}),n.jsx("p",{className:"text-slate-400 font-medium",children:"Cronograma global de uso de instalaciones."})]})]}),n.jsxs("div",{className:"flex gap-3 w-full md:w-auto",children:[n.jsx("button",{onClick:()=>f(),className:"p-5 bg-slate-50 hover:bg-slate-100 rounded-3xl border border-slate-200 transition-all text-slate-500",children:n.jsx(ct,{size:24,className:u?"animate-spin":""})}),n.jsxs("button",{onClick:()=>h(!0),className:"flex-1 md:flex-none bg-blue-600 hover:bg-blue-700 text-white px-10 py-5 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-200 transition-all flex items-center justify-center gap-3 active:scale-95",children:[n.jsx(En,{size:20})," Reservar"]})]})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.length===0?n.jsxs("div",{className:"col-span-full py-24 text-center border border-dashed border-slate-200 rounded-[3rem]",children:[n.jsx(Y_,{size:48,className:"mx-auto mb-4 text-slate-200"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-sm",children:"Sin eventos registrados"})]}):[...t].sort((B,F)=>new Date(B.date).getTime()-new Date(F.date).getTime()).map(B=>n.jsxs("div",{className:`p-8 rounded-[2.5rem] border relative overflow-hidden transition-all group ${B.status==="Rechazada"?"opacity-40 grayscale":"hover:border-blue-400 hover:shadow-xl"}`,children:[n.jsxs("div",{className:"flex justify-between items-start mb-6",children:[n.jsx("div",{className:"p-3 rounded-2xl bg-slate-50 text-slate-400 group-hover:bg-blue-600 group-hover:text-white transition-all",children:n.jsx(ea,{size:24})}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("span",{className:`px-4 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest border ${B.status==="Aprobada"?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-amber-50 text-amber-600 border-amber-100"}`,children:B.status}),y&&n.jsx("button",{onClick:()=>T(B.id),className:"p-1.5 bg-red-50 text-red-600 rounded-lg opacity-0 group-hover:opacity-100 transition-all hover:bg-red-600 hover:text-white shadow-sm",children:n.jsx(Ua,{size:14})})]})]}),n.jsx("h3",{className:"text-xl font-black text-slate-900 mb-1",children:B.facility}),n.jsxs("p",{className:"text-blue-600 font-black text-sm mb-6 flex items-center gap-2",children:[n.jsx(IM,{size:14})," ",B.date]}),n.jsxs("div",{className:"pt-5 border-t border-slate-100 space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Residente Titular:"}),n.jsx("span",{className:"text-[10px] font-black text-blue-600 bg-blue-50 px-2 py-0.5 rounded-full",children:B.propertyCode||"UN-X"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-slate-100 flex items-center justify-center text-[10px] font-black text-slate-600 uppercase",children:(B.residentName||"?")[0]}),n.jsx("span",{className:"text-xs font-black text-slate-800 uppercase truncate",children:B.residentName})]})]})]},B.id))})]}),p&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[200] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-2xl flex items-center justify-center text-white",children:n.jsx(En,{size:24})}),n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Nueva Reserva"})]}),n.jsx("button",{onClick:()=>h(!1),className:"p-3 bg-slate-100 rounded-full hover:bg-slate-200 transition-colors",children:n.jsx(mt,{})})]}),n.jsxs("form",{onSubmit:E,className:"space-y-6",children:[y?n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Vincular a Unidad"}),n.jsxs("select",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 outline-none",value:m.propertyId,onChange:B=>b({...m,propertyId:Number(B.target.value)}),children:[n.jsx("option",{value:"",children:"-- Seleccione Unidad --"}),o.map(B=>{const F=d.find(R=>R.propertyId===B.id&&R.isOwner);return n.jsxs("option",{value:B.id,children:[B.code," - ",(F==null?void 0:F.fullName)||"Sin Propietario"]},B.id)})]})]}):n.jsxs("div",{className:"bg-blue-50 border border-blue-100 p-6 rounded-[2rem] space-y-2",children:[n.jsx("p",{className:"text-[9px] font-black text-blue-400 uppercase tracking-widest",children:"Solicitante"}),n.jsxs("p",{className:"font-black text-blue-900 text-lg uppercase tracking-tighter",children:[j," - ",e.fullName]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Instalación Destino"}),n.jsx("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 outline-none",value:m.facility,onChange:B=>b({...m,facility:B.target.value}),children:N.map(B=>n.jsx("option",{value:B,children:B},B))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Fecha"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 outline-none",value:m.date,onChange:B=>b({...m,date:B.target.value})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"WhatsApp"}),n.jsx("input",{required:!0,type:"tel",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold text-slate-900 outline-none",value:m.whatsapp,onChange:B=>b({...m,whatsapp:B.target.value}),placeholder:"Ej: 04120000000"})]}),n.jsx("button",{type:"submit",className:"w-full bg-blue-600 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl active:scale-95 transition-all",children:y?"CONFIRMAR REGISTRO":"ENVIAR SOLICITUD"})]})]})})]})},KEe=({user:e})=>{const{announcements:t,addAnnouncement:r,updateAnnouncementStatus:a,deleteAnnouncement:s,refreshData:i,loading:l}=ht(),[o,d]=k.useState(""),[u,f]=k.useState(""),[p,h]=k.useState("Media"),m=["admin","programmer","board"].includes(e.role),b=e.role==="family";k.useEffect(()=>{i()},[]);const v=async N=>{N.preventDefault();const E={title:o,content:u,priority:p,authorId:e.id,status:m?"Publicado":"Pendiente"};try{await r(E),d(""),f(""),await i(),alert(m?"Comunicado publicado exitosamente.":"Comunicado enviado a moderación.")}catch{alert("Error al guardar comunicado.")}},y=async N=>{confirm("¿ELIMINAR PERMANENTEMENTE? Esta acción borrará el registro de la base de datos de forma irreversible.")&&await s(N)},j=t.filter(N=>N.status==="Publicado"),_=t.filter(N=>N.status==="Pendiente");return n.jsxs("div",{className:"space-y-10 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-3xl font-black text-slate-800 tracking-tight",children:"Comunicados"}),n.jsx("p",{className:"text-slate-400 font-medium",children:"Gestión de la cartelera informativa oficial."})]}),n.jsx("button",{onClick:()=>i(),disabled:l,className:"p-4 bg-white border border-slate-200 rounded-2xl text-slate-500 hover:bg-slate-50 transition-all shadow-sm active:scale-95",children:n.jsx(ct,{size:20,className:l?"animate-spin":""})})]}),m&&_.length>0&&n.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 p-8 rounded-[3rem] shadow-sm animate-in slide-in-from-top duration-500",children:[n.jsxs("h3",{className:"text-xl font-black text-indigo-800 flex items-center gap-3 mb-8",children:[n.jsx(ho,{size:24})," Pendientes de Aprobación (",_.length,")"]}),n.jsx("div",{className:"grid grid-cols-1 gap-4",children:_.map(N=>n.jsxs("div",{className:"bg-white p-8 rounded-[2rem] border border-indigo-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[n.jsx("h4",{className:"text-lg font-black text-slate-800",children:N.title}),n.jsx("span",{className:"bg-slate-100 text-slate-400 px-3 py-1 rounded-full text-[9px] font-black uppercase tracking-widest",children:N.date})]}),n.jsx("p",{className:"text-slate-500 text-sm font-medium leading-relaxed",children:N.content}),n.jsxs("p",{className:"text-[10px] font-black text-indigo-600 mt-4 uppercase tracking-widest",children:["Autor original: ",N.author]})]}),n.jsxs("div",{className:"flex gap-2 w-full lg:w-auto",children:[n.jsx("button",{onClick:()=>a(N.id,"Publicado"),className:"flex-1 lg:flex-none px-8 py-3 bg-emerald-600 text-white rounded-xl font-black text-[10px] uppercase shadow-lg shadow-emerald-200 active:scale-95 transition-all",children:"Aprobar"}),n.jsx("button",{onClick:()=>y(N.id),className:"flex-1 lg:flex-none px-8 py-3 bg-red-50 text-red-600 rounded-xl font-black text-[10px] uppercase hover:bg-red-600 hover:text-white transition-all",children:"Eliminar"})]})]},N.id))})]}),n.jsxs("div",{className:"bg-slate-900 rounded-[4rem] p-8 lg:p-14 shadow-2xl relative overflow-hidden group border-b-8 border-slate-800",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"flex items-center gap-6 mb-12",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-xl",children:n.jsx(bl,{size:32,className:j.length>0?"animate-pulse":""})}),n.jsxs("h2",{className:"text-4xl font-black text-white tracking-tighter",children:["Cartelera ",n.jsx("span",{className:"text-blue-500",children:"Digital"})]})]}),n.jsx("div",{className:"space-y-8 max-h-[600px] overflow-y-auto custom-scrollbar pr-4",children:j.length===0?n.jsxs("div",{className:"py-32 text-center text-slate-600",children:[n.jsx(jn,{size:48,className:"mx-auto mb-4 opacity-20"}),n.jsx("p",{className:"font-black uppercase tracking-widest text-sm italic",children:"Sin comunicados publicados recientemente"})]}):j.map(N=>n.jsxs("div",{className:"bg-white/5 border border-white/5 p-10 rounded-[3rem] hover:bg-white/[0.08] transition-all relative overflow-hidden group",children:[n.jsxs("div",{className:"flex justify-between items-start mb-6",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("span",{className:"text-[10px] font-black text-blue-500 uppercase tracking-widest",children:["[",N.date,"]"]}),n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:N.author})]}),N.priority==="Alta"&&n.jsx(Qc,{size:16,className:"text-amber-400 fill-amber-400 animate-flicker"})]}),n.jsxs("h3",{className:"text-2xl font-black text-blue-100 tracking-tight mb-4",children:["» ",N.title]}),n.jsx("p",{className:"text-slate-300 text-lg leading-relaxed font-medium",children:N.content}),m&&n.jsx("button",{onClick:()=>y(N.id),className:"absolute top-8 right-8 p-3 bg-red-500/10 text-red-500 rounded-xl opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-500 hover:text-white",children:n.jsx(Ua,{size:18})})]},N.id))})]}),n.jsx(bl,{className:"absolute right-[-40px] top-[-40px] w-96 h-96 text-white/5 pointer-events-none"})]}),!b&&n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[4rem] border border-slate-200 shadow-sm relative overflow-hidden",children:[n.jsxs("div",{className:"flex items-center gap-4 mb-10",children:[n.jsx("div",{className:"w-12 h-12 bg-slate-900 rounded-2xl flex items-center justify-center text-white shadow-lg",children:n.jsx(zs,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tight",children:"Emitir Nuevo Comunicado"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Redacte la información para la comunidad."})]})]}),n.jsxs("form",{onSubmit:v,className:"grid grid-cols-1 lg:grid-cols-2 gap-10",children:[n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Título del Comunicado"}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-600 transition-all",value:o,onChange:N=>d(N.target.value),placeholder:"Ej: Mantenimiento de Ascensores"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Prioridad Visual"}),n.jsx("div",{className:"flex gap-3",children:["Baja","Media","Alta"].map(N=>n.jsx("button",{type:"button",onClick:()=>h(N),className:`flex-1 py-3 rounded-xl text-[10px] font-black uppercase tracking-widest border transition-all ${p===N?"bg-slate-900 text-white border-slate-900 shadow-lg":"bg-white text-slate-400 border-slate-200 hover:bg-slate-50"}`,children:N},N))})]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Mensaje Completo"}),n.jsx("textarea",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-[2rem] px-6 py-4 font-medium text-slate-800 outline-none min-h-[160px] focus:ring-2 focus:ring-blue-600 transition-all",value:u,onChange:N=>f(N.target.value),placeholder:"Escriba aquí los detalles..."})]}),n.jsx("button",{type:"submit",className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 flex items-center justify-center gap-3 active:scale-95 transition-all",children:m?"PUBLICAR GLOBALMENTE":"ENVIAR A REVISIÓN"})]})]})]})]})},qEe=({user:e})=>{const{maintenance:t,addMaintenance:r,updateMaintenanceStatus:a,deleteMaintenance:s,properties:i,residents:l}=ht(),[o,d]=k.useState(!1),[u,f]=k.useState({type:"Servicio",description:""}),p=["admin","programmer","board"].includes(e.role),h=e.role==="family",m=e.propertyCode||"S/I",b=e.propertyId,v=async N=>{N.preventDefault();const E=p?u.propertyId:b,T={type:u.type,description:u.description,propertyId:E,requestedById:e.id,requestDate:new Date().toISOString().split("T")[0],status:p?"Pendiente":"Por Aprobar"};try{await r(T),d(!1),f({type:"Servicio",description:""})}catch{alert("Error al registrar reporte.")}},y=async N=>{confirm("¿Borrar ticket de falla permanentemente del historial?")&&await s(N)},j=t.filter(N=>N.status==="Por Aprobar"),_=t.filter(N=>N.status!=="Por Aprobar"&&N.status!=="Rechazada");return n.jsxs("div",{className:"space-y-10 animate-in fade-in duration-500 pb-20",children:[p&&j.length>0&&n.jsxs("div",{className:"bg-orange-50 border border-orange-100 p-8 rounded-[3rem] shadow-sm",children:[n.jsxs("h3",{className:"text-xl font-black text-orange-800 flex items-center gap-3 mb-8",children:[n.jsx(Ia,{size:24})," Validación de Tickets (",j.length,")"]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:j.map(N=>n.jsxs("div",{className:"bg-white p-8 rounded-[2rem] border border-orange-200 shadow-sm space-y-6",children:[n.jsxs("div",{className:"flex justify-between items-start",children:[n.jsxs("div",{children:[n.jsx("h4",{className:"text-xl font-black text-slate-800",children:N.type}),n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx(ea,{size:12,className:"text-orange-500"}),n.jsxs("span",{className:"text-[10px] font-black text-orange-600 uppercase tracking-widest",children:["Unidad: ",N.propertyCode||"General"]})]})]}),n.jsx("span",{className:"bg-orange-100 text-orange-600 px-3 py-1 rounded-full text-[9px] font-black uppercase tracking-widest",children:"Por Validar"})]}),n.jsx("div",{className:"p-4 bg-slate-50 rounded-xl border border-slate-100",children:n.jsxs("p",{className:"text-slate-500 text-sm font-medium leading-relaxed italic",children:['"',N.description,'"']})}),n.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-slate-50",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"w-6 h-6 rounded-full bg-slate-200 flex items-center justify-center text-[8px] font-black uppercase",children:(N.requestedBy||"?")[0]}),n.jsxs("span",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-tight",children:["Reportado por: ",N.requestedBy]})]}),n.jsx("span",{className:"text-[9px] font-black text-slate-300 uppercase",children:N.requestDate})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>a(N.id,"Pendiente"),className:"flex-1 bg-emerald-600 text-white py-3 rounded-xl font-black text-[10px] uppercase shadow-lg shadow-emerald-200 transition-all active:scale-95",children:"Aceptar"}),n.jsx("button",{onClick:()=>a(N.id,"Rechazada"),className:"flex-1 bg-red-50 text-red-600 py-3 rounded-xl font-black text-[10px] uppercase hover:bg-red-600 hover:text-white transition-all",children:"Denegar"})]})]},N.id))})]}),n.jsxs("div",{className:"bg-white p-8 lg:p-12 rounded-[3.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center gap-6 mb-12",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-16 h-16 bg-slate-900 rounded-[1.5rem] flex items-center justify-center text-white shadow-xl",children:n.jsx(Xf,{size:32})}),n.jsxs("div",{children:[n.jsx("h2",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Centro de Servicios"}),n.jsx("p",{className:"text-slate-400 font-medium",children:"Control de averías y mantenimiento preventivo."})]})]}),!h&&n.jsxs("button",{onClick:()=>d(!0),className:"w-full md:w-auto bg-blue-600 hover:bg-blue-700 text-white px-10 py-5 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3",children:[n.jsx(En,{size:20})," Reportar Incidencia"]})]}),n.jsx("div",{className:"space-y-4",children:_.length===0?n.jsxs("div",{className:"py-24 text-center border border-dashed border-slate-200 rounded-[3rem]",children:[n.jsx(za,{size:48,className:"mx-auto mb-4 text-slate-200 opacity-20"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-sm italic",children:"Sin reportes de averías activos"})]}):_.map(N=>n.jsxs("div",{className:"bg-slate-50 border border-slate-200 p-8 rounded-[2.5rem] flex flex-col lg:flex-row justify-between items-center gap-8 hover:bg-white hover:border-blue-300 transition-all group shadow-sm",children:[n.jsxs("div",{className:"flex items-center gap-6 flex-1",children:[n.jsx("div",{className:"w-14 h-14 bg-white border border-slate-200 rounded-2xl flex items-center justify-center text-slate-400 group-hover:bg-blue-600 group-hover:text-white transition-all shadow-sm",children:n.jsx(Xf,{size:24})}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("h4",{className:"text-xl font-black text-slate-800",children:N.type}),n.jsx("span",{className:`px-4 py-1 rounded-full text-[9px] font-black uppercase tracking-widest border ${N.status==="Completado"?"bg-emerald-50 text-emerald-600 border-emerald-100":N.status==="En Proceso"?"bg-blue-50 text-blue-600 border-blue-100":"bg-amber-50 text-amber-600 border-amber-100"}`,children:N.status}),n.jsxs("span",{className:"text-[9px] font-black text-blue-600 bg-blue-50 px-2.5 py-1 rounded-lg uppercase tracking-tighter",children:["UNIDAD: ",N.propertyCode||"GRAL"]}),p&&n.jsx("button",{onClick:()=>y(N.id),className:"p-1.5 bg-red-50 text-red-600 rounded-lg opacity-0 group-hover:opacity-100 transition-all hover:bg-red-600 hover:text-white shadow-sm",children:n.jsx(Ua,{size:14})})]}),n.jsx("p",{className:"text-slate-500 font-medium leading-relaxed max-w-2xl",children:N.description}),n.jsxs("div",{className:"flex flex-wrap items-center gap-y-2 gap-x-4 pt-4 mt-2 border-t border-slate-100",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"w-2 h-2 rounded-full bg-slate-300"}),n.jsxs("span",{className:"text-[9px] font-black text-slate-400 uppercase",children:["Solicitud: ",N.requestDate]})]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(tu,{size:10,className:"text-slate-300"}),n.jsxs("span",{className:"text-[9px] font-black text-slate-400 uppercase",children:["Emisor: ",N.requestedBy]})]}),N.attendedAt&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(_c,{size:10,className:"text-blue-300"}),n.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-500"}),n.jsxs("span",{className:"text-[9px] font-black text-blue-500 uppercase tracking-tighter",children:["Atención: ",N.attendedAt]})]}),N.closedAt&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(_c,{size:10,className:"text-emerald-300"}),n.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-500"}),n.jsxs("span",{className:"text-[9px] font-black text-emerald-600 uppercase tracking-tighter",children:["Cierre: ",N.closedAt]})]})]})]})]}),p&&N.status!=="Completado"&&n.jsxs("div",{className:"flex gap-2 w-full lg:w-auto",children:[N.status==="Pendiente"&&n.jsx("button",{onClick:()=>a(N.id,"En Proceso"),className:"flex-1 lg:flex-none px-8 py-3 bg-blue-600 text-white rounded-xl font-black text-[10px] uppercase shadow-lg shadow-blue-200 transition-all",children:"Atender"}),n.jsx("button",{onClick:()=>a(N.id,"Completado"),className:"flex-1 lg:flex-none px-8 py-3 bg-slate-900 text-white rounded-xl font-black text-[10px] uppercase transition-all",children:"Cerrar Ticket"})]}),N.status==="Completado"&&n.jsx("div",{className:"p-4 bg-emerald-50 text-emerald-600 rounded-full border border-emerald-100",children:n.jsx(Xi,{size:28})})]},N.id))})]}),o&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[200] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-xl shadow-2xl animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Ticket de Falla"}),n.jsx("button",{onClick:()=>d(!1),className:"p-3 bg-slate-100 rounded-full",children:n.jsx(mt,{})})]}),n.jsxs("form",{onSubmit:v,className:"space-y-8",children:[p?n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Vincular Unidad"}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 outline-none",value:u.propertyId,onChange:N=>f({...u,propertyId:Number(N.target.value)}),children:[n.jsx("option",{value:"",children:"-- Mantenimiento General --"}),i.map(N=>n.jsx("option",{value:N.id,children:N.code},N.id))]})]}):n.jsxs("div",{className:"p-4 bg-blue-50 rounded-2xl text-[10px] font-black text-blue-600 uppercase tracking-widest",children:["Reporte desde unidad: ",m]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Categoría"}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 outline-none",value:u.type,onChange:N=>f({...u,type:N.target.value}),children:[n.jsx("option",{value:"Servicio",children:"Servicio General"}),n.jsx("option",{value:"Daño",children:"Reporte de Daño"}),n.jsx("option",{value:"Jardinería",children:"Jardinería"}),n.jsx("option",{value:"Piscina",children:"Piscina"}),n.jsx("option",{value:"Otro",children:"Otro"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Descripción"}),n.jsx("textarea",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-[2.5rem] px-6 py-4 font-medium text-slate-900 outline-none min-h-[160px]",value:u.description,onChange:N=>f({...u,description:N.target.value}),placeholder:"Detalle el problema..."})]}),n.jsx("button",{type:"submit",className:"w-full bg-blue-600 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl active:scale-95 transition-all",children:"EMITIR TICKET"})]})]})})]})},WEe=({user:e})=>{const{assemblies:t,addAssembly:r,deleteAssembly:a,properties:s,refreshData:i}=ht(),[l,o]=k.useState(new Date().getFullYear()),[d,u]=k.useState(new Date().getMonth()),[f,p]=k.useState(!1),[h,m]=k.useState(!1),[b,v]=k.useState(""),[y,j]=k.useState(""),[_,N]=k.useState(""),[E,T]=k.useState([]),[B,F]=k.useState(null),[R,U]=k.useState(""),D=["programmer","admin","board"].includes(e.role);k.useEffect(()=>{(async()=>{const Y=await we.getSystemSettings();v(Y.next_assembly_date||"")})()},[]);const L=async()=>{try{await we.updateSystemSetting("next_assembly_date",b),alert("Fecha actualizada. Se reflejará en el Dashboard principal."),m(!1),i()}catch{alert("Error al actualizar configuración.")}},P=t.filter(W=>W.year===l&&W.month===d),G=s.length,Q=async W=>{if(W.preventDefault(),!y||!_)return;const Y=G>0?Math.round(E.length/G*100):0,M={title:y,content:_,date:Dr(),month:d,year:l,attendancePropertyIds:E,quorumPercent:Y};try{await r(M),p(!1),H(),alert("Acta guardada exitosamente en el Libro de Asambleas.")}catch{alert("Error al guardar el acta.")}},H=()=>{j(""),N(""),T([]),U("")},X=W=>{T(Y=>Y.includes(W)?Y.filter(M=>M!==W):[...Y,W])},K=(W,Y)=>{W.stopPropagation();const M=window.open("","","width=900,height=900");if(!M)return;const O=s.filter(q=>Y.attendancePropertyIds.includes(q.id));M.document.write(`
          <html>
          <head>
              <title>Acta de Asamblea: ${Y.title}</title>
              <style>
                  body { font-family: 'Times New Roman', Times, serif; padding: 60px; font-size: 12pt; line-height: 1.7; color: #000; }
                  .header { text-align: center; border-bottom: 2px solid #000; margin-bottom: 30px; padding-bottom: 10px; }
                  h1 { text-transform: uppercase; font-size: 18pt; margin: 0; }
                  .meta { text-align: center; margin-bottom: 40px; font-style: italic; border-bottom: 1px solid #eee; padding-bottom: 20px; }
                  .content { text-align: justify; white-space: pre-wrap; margin-bottom: 50px; }
                  .attendance-box { background: #fdfdfd; border: 1px solid #eee; padding: 20px; margin-top: 40px; }
                  .attendance-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; font-size: 10pt; }
                  .footer { margin-top: 100px; display: flex; justify-content: space-around; }
                  .sign-line { width: 35%; border-top: 1px solid black; text-align: center; padding-top: 10px; font-weight: bold; }
              </style>
          </head>
          <body>
              <div class="header">
                  <h1>Libro de Actas de Asamblea</h1>
                  <p>Condominio Residencial SAC 2025</p>
              </div>
              
              <div class="meta">
                  <b>Sesión:</b> ${Y.title} <br>
                  <b>Fecha:</b> ${Y.date} | <b>Periodo:</b> ${Te[Y.month]} ${Y.year} <br>
                  <b>Quórum Registrado:</b> ${Y.quorumPercent}% (${Y.attendancePropertyIds.length} de ${G} Unidades)
              </div>
              
              <div class="content">${Y.content}</div>

              <div class="attendance-box">
                  <h3 style="text-decoration: underline">ANEXO: REGISTRO DE ASISTENCIA NOMINAL</h3>
                  <div class="attendance-grid">
                      ${O.map(q=>`<span>[x] Unidad: ${q.code}</span>`).join("")}
                  </div>
              </div>

              <div class="footer">
                  <div class="sign-line">Firma Presidente Junta</div>
                  <div class="sign-line">Firma Secretario / Adm.</div>
              </div>
          </body>
          </html>
      `),M.document.close(),M.print()},ee=s.filter(W=>W.code.toLowerCase().includes(R.toLowerCase())||W.number.toLowerCase().includes(R.toLowerCase()));return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 bg-white p-8 lg:p-12 rounded-[3.5rem] border border-slate-200 shadow-sm relative overflow-hidden group",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-blue-50 w-fit px-4 py-1.5 rounded-full border border-blue-100 flex items-center gap-2 mb-6",children:[n.jsx(yr,{size:14,className:"text-blue-600"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-blue-600",children:"Registros Jurídicos"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter",children:["Libro de ",n.jsx("span",{className:"text-blue-600 italic",children:"Asambleas"})]}),n.jsx("p",{className:"text-slate-400 mt-3 font-medium text-lg max-w-md",children:"Historial formal y legal de todas las decisiones comunitarias."})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-4 relative z-10",children:[n.jsxs("div",{className:"bg-slate-100 p-2 rounded-2xl flex gap-2 border border-slate-200 shadow-inner",children:[n.jsx("select",{value:d,onChange:W=>u(Number(W.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Te.map((W,Y)=>n.jsx("option",{value:Y,children:W},Y))}),n.jsx("input",{type:"number",value:l,onChange:W=>o(Number(W.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20"})]}),D&&n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>m(!0),className:"p-5 bg-white border border-slate-200 rounded-3xl text-slate-500 hover:bg-slate-50 shadow-sm transition-all",title:"Configurar Próxima Asamblea",children:n.jsx(PA,{size:24})}),n.jsxs("button",{onClick:()=>p(!0),className:"bg-blue-600 hover:bg-blue-700 text-white px-8 py-5 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-100 transition-all active:scale-95 flex items-center gap-3",children:[n.jsx(En,{size:20})," Registrar Acta"]})]})]}),n.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-blue-50/50 rounded-full blur-[100px] pointer-events-none -translate-y-1/2 translate-x-1/3"})]}),n.jsx("div",{className:"space-y-4",children:P.length===0?n.jsxs("div",{className:"text-center text-slate-400 py-24 bg-white rounded-[3rem] border border-dashed border-slate-200",children:[n.jsx(Wr,{className:"w-16 h-16 mx-auto mb-4 opacity-20"}),n.jsx("p",{className:"font-black uppercase tracking-widest text-sm",children:"Sin asambleas registradas en este periodo."})]}):P.map(W=>n.jsxs("div",{className:`bg-white rounded-[2.5rem] border border-slate-200 overflow-hidden transition-all duration-300 shadow-sm ${B===W.id?"ring-2 ring-blue-500/20 shadow-lg":""}`,children:[n.jsxs("div",{className:"p-8 flex flex-col md:flex-row justify-between items-center cursor-pointer hover:bg-slate-50/50 transition-colors",onClick:()=>F(B===W.id?null:W.id),children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"bg-blue-50 w-16 h-16 rounded-2xl flex items-center justify-center text-blue-600 shadow-lg shadow-blue-100/50",children:n.jsx(yr,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"font-black text-xl text-slate-800 tracking-tight",children:W.title}),n.jsxs("div",{className:"flex items-center gap-4 mt-1",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:W.date}),n.jsx("span",{className:"w-1 h-1 rounded-full bg-slate-300"}),n.jsxs("span",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest flex items-center gap-1.5",children:[n.jsx(MM,{size:12})," Quórum: ",W.quorumPercent,"%"]})]})]})]}),n.jsxs("div",{className:"flex items-center gap-3 mt-6 md:mt-0",children:[n.jsx("button",{onClick:Y=>K(Y,W),className:"p-3 bg-slate-100 text-slate-500 hover:bg-blue-600 hover:text-white rounded-xl transition-all shadow-sm",title:"Imprimir Acta Oficial",children:n.jsx(wt,{size:20})}),D&&n.jsx("button",{onClick:Y=>{Y.stopPropagation(),confirm("¿Eliminar este acta permanentemente?")&&a(W.id)},className:"p-3 bg-red-50 text-red-500 rounded-xl hover:bg-red-600 hover:text-white transition-all shadow-sm",children:n.jsx(Ua,{size:20})}),n.jsx("div",{className:"ml-4 p-2 text-slate-300",children:B===W.id?n.jsx(lk,{size:24}):n.jsx(ik,{size:24})})]})]}),B===W.id&&n.jsx("div",{className:"p-10 border-t border-slate-100 bg-slate-50/50 animate-in slide-in-from-top-4 duration-300",children:n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-10",children:[n.jsxs("div",{className:"lg:col-span-2 bg-white p-10 rounded-[3rem] shadow-sm border border-slate-200",children:[n.jsxs("h4",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-6 flex items-center gap-2",children:[n.jsx(jn,{size:14})," Transcripción Legal de Acta"]}),n.jsx("div",{className:"prose prose-slate max-w-none text-slate-700 whitespace-pre-wrap font-serif leading-relaxed text-lg border-l-4 border-slate-100 pl-8",children:W.content})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"bg-slate-900 p-8 rounded-[3rem] text-white shadow-xl relative overflow-hidden",children:[n.jsx(Qi,{className:"absolute right-[-20px] bottom-[-20px] w-48 h-48 text-white/5 pointer-events-none"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.4em] opacity-60",children:"Control de Asistencia"}),n.jsx("h4",{className:"text-5xl font-black tracking-tighter mt-2",children:W.attendancePropertyIds.length}),n.jsxs("p",{className:"text-xs font-bold text-slate-400 mt-4 uppercase tracking-widest",children:["Unidades de ",G," totales"]}),n.jsx("div",{className:"mt-8 h-2 w-full bg-slate-800 rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-blue-500 shadow-lg shadow-blue-500/40 transition-all duration-1000",style:{width:`${W.quorumPercent}%`}})})]}),n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm",children:[n.jsx("h4",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-6",children:"Listado de Presencia Nominal"}),n.jsx("div",{className:"grid grid-cols-3 gap-2",children:s.filter(Y=>W.attendancePropertyIds.includes(Y.id)).map(Y=>n.jsx("div",{className:"text-[10px] font-black bg-blue-50 text-blue-600 py-2 rounded-lg text-center border border-blue-100",children:Y.code},Y.id))})]})]})]})})]},W.id))}),h&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[2.5rem] p-10 w-full max-w-sm shadow-2xl animate-in zoom-in-95",children:[n.jsxs("div",{className:"flex justify-between items-center mb-6",children:[n.jsx("h3",{className:"text-xl font-black text-slate-900",children:"Agenda de Asamblea"}),n.jsx("button",{onClick:()=>m(!1),children:n.jsx(mt,{})})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest mb-2 block",children:"Fecha de Próxima Sesión"}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-bold text-slate-900 focus:ring-2 focus:ring-blue-600 outline-none",value:b,onChange:W=>v(W.target.value),placeholder:"Ej: 15 Jun / Por Definir"})]}),n.jsx("button",{onClick:L,className:"w-full bg-blue-600 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-100 active:scale-95 transition-all",children:"Sellar Fecha en Dashboard"})]})]})}),f&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[200] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3.5rem] p-10 lg:p-14 w-full max-w-6xl shadow-2xl overflow-y-auto h-[90vh] custom-scrollbar animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-12",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-xl",children:n.jsx(En,{size:32})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Registro de Asamblea"}),n.jsxs("p",{className:"text-slate-400 font-medium",children:["Asigne el periodo: ",Te[d]," ",l]})]})]}),n.jsx("button",{onClick:()=>p(!1),className:"p-4 bg-slate-100 rounded-full hover:bg-slate-200 transition-colors",children:n.jsx(mt,{size:24})})]}),n.jsxs("form",{onSubmit:Q,className:"space-y-10",children:[n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-10",children:[n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Título / Carácter de la Sesión"}),n.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 text-slate-900 font-bold focus:ring-2 focus:ring-blue-600 outline-none",value:y,onChange:W=>j(W.target.value),placeholder:"Ej: Asamblea Extraordinaria - Renovación de Pintura"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Puntos Tratados y Resoluciones (Transcripción)"}),n.jsx("textarea",{required:!0,rows:15,className:"w-full bg-slate-50 border border-slate-200 rounded-[2.5rem] p-8 font-serif text-slate-800 text-lg leading-relaxed focus:ring-2 focus:ring-blue-600 outline-none custom-scrollbar",value:_,onChange:W=>N(W.target.value),placeholder:"Redacte aquí el acta completa de la sesión..."}),n.jsxs("div",{className:"flex items-center gap-3 p-4 bg-blue-50 border border-blue-100 rounded-2xl mt-4",children:[n.jsx(jn,{size:18,className:"text-blue-600"}),n.jsx("p",{className:"text-[9px] text-blue-800 font-black uppercase tracking-widest",children:"Sugerencia: El sistema soporta transcripciones extensas. Puede pegar el borrador directamente."})]})]})]}),n.jsxs("div",{className:"bg-slate-50 p-8 lg:p-10 rounded-[3rem] border border-slate-200 flex flex-col h-full",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-8",children:[n.jsxs("div",{children:[n.jsxs("h4",{className:"text-xl font-black text-slate-800 tracking-tight flex items-center gap-3",children:[n.jsx(Qi,{className:"text-blue-600"})," Lista de Participación"]}),n.jsx("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest mt-1",children:"Marque las unidades presentes en sala"})]}),n.jsxs("div",{className:"relative w-full sm:w-auto",children:[n.jsx(er,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400",size:14}),n.jsx("input",{type:"text",placeholder:"Filtrar unidad...",className:"bg-white border border-slate-200 rounded-xl pl-9 pr-4 py-2.5 text-xs font-bold w-full outline-none focus:border-blue-400",value:R,onChange:W=>U(W.target.value)})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto bg-white rounded-[2.5rem] p-6 border border-slate-200 space-y-2 custom-scrollbar min-h-[400px]",children:n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:ee.map(W=>n.jsxs("button",{type:"button",onClick:()=>X(W.id),className:`flex items-center justify-between p-4 rounded-2xl border transition-all text-left ${E.includes(W.id)?"bg-blue-600 border-blue-600 text-white shadow-lg shadow-blue-200 scale-[1.02]":"bg-slate-50 border-slate-100 text-slate-500 hover:bg-white hover:border-blue-200"}`,children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ea,{size:12,className:E.includes(W.id)?"text-blue-200":"text-slate-300"}),n.jsx("span",{className:"text-[11px] font-black uppercase tracking-tighter",children:W.code})]}),E.includes(W.id)?n.jsx(Gt,{size:16}):n.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-slate-300"})]},W.id))})}),n.jsxs("div",{className:"mt-8 p-8 bg-slate-900 rounded-[2.5rem] text-white flex justify-between items-center shadow-2xl relative overflow-hidden",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsx("p",{className:"text-[9px] font-black uppercase tracking-[0.3em] text-blue-400",children:"Quórum Nominal"}),n.jsxs("div",{className:"flex items-baseline gap-1 mt-1",children:[n.jsx("span",{className:"text-4xl font-black",children:E.length}),n.jsxs("span",{className:"text-slate-500 text-xs font-bold uppercase",children:["/ ",G," Unidades"]})]})]}),n.jsxs("div",{className:"text-right relative z-10",children:[n.jsx("p",{className:"text-[9px] font-black uppercase tracking-[0.3em] text-emerald-400",children:"Porcentaje de Sesión"}),n.jsxs("p",{className:"text-4xl font-black text-emerald-400",children:[G>0?Math.round(E.length/G*100):0,"%"]})]}),n.jsx(Qi,{className:"absolute right-[-20px] bottom-[-20px] w-32 h-32 text-white/5 pointer-events-none"})]})]})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 pt-6 border-t border-slate-100",children:[n.jsx("button",{type:"button",onClick:()=>p(!1),className:"flex-1 py-6 bg-slate-100 text-slate-500 font-black rounded-2xl uppercase tracking-widest text-xs hover:bg-slate-200 transition-all",children:"Descartar Registro"}),n.jsxs("button",{type:"submit",className:"flex-[2] bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2.5rem] font-black text-xs uppercase tracking-[0.3em] shadow-2xl shadow-blue-100 flex items-center justify-center gap-4 transition-all active:scale-95",children:[n.jsx(Zn,{size:20})," SELLAR Y GUARDAR EN LIBRO DIGITAL"]})]})]})]})})]})},YEe=({user:e})=>{const{refreshData:t}=ht(),[r,a]=k.useState("db"),[s,i]=k.useState(!1),[l,o]=k.useState(null),[d,u]=k.useState("andresmathison@gmail.com"),[f,p]=k.useState([]),[h,m]=k.useState(""),[b,v]=k.useState(""),[y,j]=k.useState(""),[_,N]=k.useState(""),[E,T]=k.useState(""),[B,F]=k.useState(""),[R,U]=k.useState(""),[D,L]=k.useState(""),[P,G]=k.useState(""),[Q,H]=k.useState(""),[X,K]=k.useState("0"),[ee,W]=k.useState("0"),[Y,M]=k.useState(!1),[O,q]=k.useState(!1);if(k.useEffect(()=>{(async()=>{const ae=await we.getSystemSettings();L(ae.board_president||""),G(ae.board_secretary||""),H(ae.board_treasurer||""),K(ae.initial_reserve_bs||"0"),W(ae.initial_cash_usd||"0"),M(ae.system_maintenance_mode==="true"),q(ae.electrical_failure_mode==="true"),m(ae.payment_bank_name||""),v(ae.payment_account_type||""),j(ae.payment_account_number||""),N(ae.payment_rif||""),T(ae.payment_mobile_phone||""),F(ae.payment_emails||""),U(ae.payment_whatsapp||"")})()},[]),e.role!=="programmer"&&e.role!=="admin")return n.jsx("div",{className:"flex flex-col items-center justify-center min-h-[60vh]",children:n.jsxs("div",{className:"bg-red-50 p-12 rounded-[3rem] text-center border border-red-100 shadow-xl max-w-lg",children:[n.jsx(vs,{size:64,className:"text-red-500 mx-auto mb-6"}),n.jsx("h3",{className:"text-2xl font-black text-red-800 tracking-tight mb-2",children:"Acceso Restringido"}),n.jsx("p",{className:"text-red-600 font-medium",children:"Solo administradores y programadores pueden realizar mantenimiento."})]})});const z=()=>{confirm("¿Generar respaldo SQL completo?")&&we.exportDatabaseSQL()},J=async()=>{i(!0);try{const ae=await(await fetch(`${Ne}/test_mail.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:d})})).json();alert(ae.message)}catch{alert("Error al conectar con el servidor de correos.")}finally{i(!1)}},re=async()=>{i(!0),p(["[SYSTEM] Iniciando secuencia de pulso de base de datos...","[KERNEL] Contactando MariaDB Engine..."]);try{const ne=await we.runDiagnostics("db_pulse");o(ne),p(ae=>[...ae,"[DB] Prueba de Escritura: OK","[DB] Prueba de Lectura: OK (Handshake Verificado)",`[CORE] Latencia de transacción: ${ne.latency_ms}ms`,`[CORE] Entorno: ${ne.os} / PHP ${ne.php_version}`,"[SYSTEM] DIAGNÓSTICO FINALIZADO CON ÉXITO."])}catch{p(ae=>[...ae,"[ERROR] Fallo crítico de integridad o latencia excedida."])}finally{i(!1)}},le=async()=>{i(!0);try{await we.updateSystemSetting("board_president",D),await we.updateSystemSetting("board_secretary",P),await we.updateSystemSetting("board_treasurer",Q),await we.updateSystemSetting("initial_reserve_bs",X),await we.updateSystemSetting("initial_cash_usd",ee),await we.updateSystemSetting("payment_bank_name",h),await we.updateSystemSetting("payment_account_type",b),await we.updateSystemSetting("payment_account_number",y),await we.updateSystemSetting("payment_rif",_),await we.updateSystemSetting("payment_mobile_phone",E),await we.updateSystemSetting("payment_emails",B),await we.updateSystemSetting("payment_whatsapp",R),alert("Estructura de junta, parámetros fiscales y datos de pago actualizados."),await t()}catch{alert("Error al guardar.")}finally{i(!1)}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 bg-slate-900 p-10 lg:p-14 rounded-[4rem] text-white relative overflow-hidden shadow-2xl border-b-8 border-blue-600/20",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-blue-600/20 w-fit px-4 py-1.5 rounded-full border border-blue-600/30 flex items-center gap-2 mb-6",children:[n.jsx(Qy,{size:16,className:"text-blue-400"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-blue-400",children:"Kernel V4.2.01 MC/MB"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black tracking-tighter leading-none",children:["Mantenimiento ",n.jsx("span",{className:"text-blue-500 italic",children:"Global"})]}),n.jsx("p",{className:"text-slate-400 mt-3 font-medium text-lg max-w-md italic",children:"Optimización de bajo nivel y auditoría de Kernel V4.2.01."})]}),n.jsx(Ak,{size:220,className:"absolute right-[-40px] top-[-40px] text-white/5 pointer-events-none"})]}),n.jsxs("div",{className:"flex flex-wrap p-2 bg-slate-100 rounded-[2rem] w-fit gap-2 shadow-inner",children:[n.jsx("button",{onClick:()=>a("db"),className:`px-8 py-3 rounded-full text-xs font-black uppercase tracking-widest transition-all ${r==="db"?"bg-white text-blue-600 shadow-lg":"text-slate-500 hover:bg-slate-200"}`,children:"Base de Datos"}),n.jsx("button",{onClick:()=>a("junta"),className:`px-8 py-3 rounded-full text-xs font-black uppercase tracking-widest transition-all ${r==="junta"?"bg-white text-indigo-600 shadow-lg":"text-slate-500 hover:bg-slate-200"}`,children:"Junta & Pagos"}),n.jsx("button",{onClick:()=>a("mail"),className:`px-8 py-3 rounded-full text-xs font-black uppercase tracking-widest transition-all ${r==="mail"?"bg-white text-emerald-600 shadow-lg":"text-slate-500 hover:bg-slate-200"}`,children:"Canales"}),n.jsx("button",{onClick:()=>a("system"),className:`px-8 py-3 rounded-full text-xs font-black uppercase tracking-widest transition-all ${r==="system"?"bg-slate-900 text-white shadow-xl":"text-slate-500 hover:bg-slate-200"}`,children:"SISTEMA CORE"}),e.role==="programmer"&&n.jsx("button",{onClick:()=>a("electricity"),className:`px-8 py-3 rounded-full text-xs font-black uppercase tracking-widest transition-all ${r==="electricity"?"bg-orange-600 text-white shadow-lg animate-pulse":"text-slate-500 hover:bg-slate-200"}`,children:"Electricidad"})]}),n.jsxs("div",{className:"grid grid-cols-1 gap-8",children:[r==="db"&&n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm space-y-10 animate-in slide-in-from-left",children:[n.jsxs("div",{className:"flex items-center gap-4 border-b border-slate-100 pb-6",children:[n.jsx("div",{className:"w-14 h-14 bg-emerald-50 text-emerald-600 rounded-2xl flex items-center justify-center shadow-lg",children:n.jsx(jo,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tight",children:"Respaldos Críticos"}),n.jsx("p",{className:"text-slate-400 font-medium",children:"Exportación estructurada de toda la inteligencia de datos."})]})]}),n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[2.5rem] border border-slate-100 space-y-4",children:[n.jsxs("h4",{className:"font-black text-slate-800 uppercase text-xs tracking-widest flex items-center gap-2",children:[n.jsx(Gs,{size:16})," Volcado SQL Completo"]}),n.jsx("p",{className:"text-slate-500 text-sm max-w-lg",children:"Genera un script de recuperación total incluyendo esquemas de tablas, triggers y registros de auditoría."}),n.jsx("button",{onClick:z,className:"bg-blue-600 hover:bg-blue-700 text-white px-8 py-4 rounded-xl font-black text-[10px] uppercase shadow-lg active:scale-95 transition-all",children:"INICIAR DESCARGA SEGURA"})]})]}),r==="mail"&&n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm space-y-10 animate-in zoom-in",children:[n.jsxs("div",{className:"flex items-center gap-4 border-b border-slate-100 pb-6",children:[n.jsx("div",{className:"w-14 h-14 bg-emerald-50 text-emerald-600 rounded-2xl flex items-center justify-center shadow-lg",children:n.jsx(Br,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tight",children:"Diagnóstico de Salida"}),n.jsx("p",{className:"text-slate-400 font-medium",children:"Verifique la capacidad de entrega de notificaciones."})]})]}),n.jsxs("div",{className:"max-w-md space-y-6",children:[n.jsxs("div",{className:"p-6 bg-blue-50 border border-blue-100 rounded-2xl flex items-start gap-4",children:[n.jsx(jn,{size:20,className:"text-blue-500 mt-1"}),n.jsx("p",{className:"text-[11px] text-blue-800 font-bold uppercase tracking-tight leading-relaxed",children:"Prueba de conexión con el Relay SMTP local del servidor."})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Email Destino para Test"}),n.jsx("input",{type:"email",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold",value:d,onChange:ne=>u(ne.target.value)})]}),n.jsxs("button",{disabled:s,onClick:J,className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl flex items-center justify-center gap-3 active:scale-95 transition-all",children:[s?n.jsx(Qy,{className:"animate-spin"}):n.jsx(zs,{size:18}),"EJECUTAR TEST DE ENTREGA"]})]})]}),r==="junta"&&n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm space-y-12 animate-in slide-in-from-bottom",children:[n.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[n.jsx("div",{className:"w-12 h-12 bg-indigo-50 text-indigo-600 rounded-xl flex items-center justify-center shadow-sm",children:n.jsx(Qi,{size:24})}),n.jsx("h3",{className:"text-2xl font-black text-slate-900",children:"Configuración de Junta y Pagos"})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Presidente"}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-indigo-500 outline-none",value:D,onChange:ne=>L(ne.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Secretario(a)"}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-indigo-500 outline-none",value:P,onChange:ne=>G(ne.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Tesorero(a)"}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-indigo-500 outline-none",value:Q,onChange:ne=>H(ne.target.value)})]})]}),n.jsxs("div",{className:"pt-8 border-t border-slate-100 space-y-8",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-blue-50 text-blue-600 rounded-xl flex items-center justify-center shadow-sm",children:n.jsx(br,{size:20})}),n.jsx("h4",{className:"text-lg font-black text-slate-800",children:"Datos para Recepción de Pagos"})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Banco"}),n.jsx("input",{type:"text",placeholder:"Ej: BanPlus",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-blue-500 outline-none",value:h,onChange:ne=>m(ne.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Tipo de Cuenta"}),n.jsx("input",{type:"text",placeholder:"Ej: Cta Cte",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-blue-500 outline-none",value:b,onChange:ne=>v(ne.target.value)})]}),n.jsxs("div",{className:"lg:col-span-2 space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Número de Cuenta"}),n.jsx("input",{type:"text",placeholder:"0000-0000-00-0000000000",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-blue-500 outline-none",value:y,onChange:ne=>j(ne.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"RIF"}),n.jsx("input",{type:"text",placeholder:"J-000000000",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-blue-500 outline-none",value:_,onChange:ne=>N(ne.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Teléfono Pago Móvil"}),n.jsx("input",{type:"text",placeholder:"0424-0000000",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-blue-500 outline-none",value:E,onChange:ne=>T(ne.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"WhatsApp de Contacto"}),n.jsx("input",{type:"text",placeholder:"0412-0000000",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-blue-500 outline-none",value:R,onChange:ne=>U(ne.target.value)})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Correos (Separados por coma)"}),n.jsx("input",{type:"text",placeholder:"correo1@mail.com, correo2@mail.com",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold focus:ring-2 focus:ring-blue-500 outline-none",value:B,onChange:ne=>F(ne.target.value)})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 pt-8",children:[n.jsxs("div",{className:"bg-emerald-50 p-8 rounded-[2.5rem] border border-emerald-100 flex flex-col md:flex-row items-center gap-8 shadow-inner",children:[n.jsxs("div",{className:"flex-1 space-y-2",children:[n.jsxs("h4",{className:"font-black text-emerald-900 uppercase text-xs tracking-widest flex items-center gap-2",children:[n.jsx(br,{size:20})," Saldo Inicial Fondo Reserva"]}),n.jsx("p",{className:"text-emerald-800/70 text-[10px] font-bold leading-relaxed uppercase",children:"DECLARE EL MONTO EN DÓLARES QUE EL CONDOMINIO POSEE EN RESERVA AL INICIAR GESTIÓN."})]}),n.jsxs("div",{className:"w-full md:w-48 space-y-2",children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-emerald-400 ml-1",children:"Capital Inicial (USD)"}),n.jsxs("div",{className:"relative",children:[n.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 font-black text-emerald-300",children:"$"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-white border border-emerald-200 rounded-2xl pl-12 pr-4 py-4 font-black text-emerald-600 outline-none focus:ring-2 focus:ring-emerald-500",value:X,onChange:ne=>K(ne.target.value)})]})]})]}),n.jsxs("div",{className:"bg-blue-50 p-8 rounded-[2.5rem] border border-blue-100 flex flex-col md:flex-row items-center gap-8 shadow-inner",children:[n.jsxs("div",{className:"flex-1 space-y-2",children:[n.jsxs("h4",{className:"font-black text-blue-900 uppercase text-xs tracking-widest flex items-center gap-2",children:[n.jsx(kn,{size:20})," Efectivo Inicial Gestión"]}),n.jsx("p",{className:"text-blue-800/70 text-[10px] font-bold leading-relaxed uppercase",children:"DECLARE LA CANTIDAD DE DÓLARES DISPONIBLES EN EFECTIVO PARA EL INICIO DE LA GESTIÓN."})]}),n.jsxs("div",{className:"w-full md:w-48 space-y-2",children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-blue-400 ml-1",children:"Efectivo (USD)"}),n.jsxs("div",{className:"relative",children:[n.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 font-black text-blue-300",children:"$"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-white border border-blue-200 rounded-2xl pl-12 pr-4 py-4 font-black text-blue-600 outline-none focus:ring-2 focus:ring-blue-500",value:ee,onChange:ne=>W(ne.target.value)})]})]})]})]}),n.jsx("button",{onClick:le,className:"bg-indigo-600 text-white px-10 py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-indigo-100 active:scale-95 transition-all",children:"Sellar Configuración Kernel V4.1.61"})]}),r==="system"&&n.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-8 animate-in zoom-in-95 duration-500",children:[n.jsxs("div",{className:"bg-slate-900 rounded-[3.5rem] p-10 text-white shadow-2xl relative overflow-hidden flex flex-col border border-slate-800",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-600 rounded-3xl flex items-center justify-center mb-8 shadow-xl shadow-blue-500/20",children:n.jsx(XV,{size:40})}),n.jsx("h3",{className:"text-[10px] font-black text-blue-400 uppercase tracking-[0.4em] mb-2",children:"Lead Systems Architect"}),n.jsx("h2",{className:"text-3xl font-black tracking-tight mb-6",children:"Andres Mathison"}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"p-6 bg-red-600/10 border border-red-500/20 rounded-[2rem] space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("h4",{className:"text-[10px] font-black text-red-500 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(vs,{size:14})," MODO MANTENIMIENTO"]}),n.jsxs("button",{onClick:async()=>{if(confirm("¿Activar/Desactivar bloqueo global?")){const ne=!Y;await we.toggleMaintenanceMode(ne),M(ne),alert("Estado de mantenimiento actualizado."),window.location.reload()}},className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none ${Y?"bg-red-600":"bg-slate-700"}`,children:[n.jsx("span",{className:"sr-only",children:"Toggle Maintenance Mode"}),n.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${Y?"translate-x-6":"translate-x-1"}`})]})]}),n.jsx("p",{className:"text-[9px] text-slate-500 uppercase font-black leading-tight italic",children:"Bloquea el acceso a todos los niveles de usuario (Excepto Programador)."})]}),n.jsx("p",{className:"text-slate-400 text-sm font-medium leading-relaxed italic",children:'"Ingeniería aplicada a la resolución de problemas complejos. Especialista en arquitecturas híbridas que integran computación de alto nivel con entornos físicos."'}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-white/5 p-4 rounded-2xl border border-white/10 flex items-center gap-3",children:[n.jsx(rK,{size:18,className:"text-amber-500"}),n.jsx("span",{className:"text-[10px] font-black uppercase",children:"IoT / Hardware"})]}),n.jsxs("div",{className:"bg-white/5 p-4 rounded-2xl border border-white/10 flex items-center gap-3",children:[n.jsx(Qy,{size:18,className:"text-emerald-500"}),n.jsx("span",{className:"text-[10px] font-black uppercase",children:"Micro-Robotics"})]}),n.jsxs("div",{className:"bg-white/5 p-4 rounded-2xl border border-white/10 flex items-center gap-3",children:[n.jsx(KV,{size:18,className:"text-indigo-500"}),n.jsx("span",{className:"text-[10px] font-black uppercase",children:"Digital Electronics"})]}),n.jsxs("div",{className:"bg-white/5 p-4 rounded-2xl border border-white/10 flex items-center gap-3",children:[n.jsx(cG,{size:18,className:"text-blue-500"}),n.jsx("span",{className:"text-[10px] font-black uppercase",children:"Fullstack Pro"})]})]})]}),n.jsxs("div",{className:"mt-12 pt-8 border-t border-white/10",children:[n.jsx("p",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:"Corporación de Desarrollo"}),n.jsx("a",{href:"https://tecnomath.com",target:"_blank",className:"text-xl font-black text-blue-400 hover:text-white transition-colors tracking-tight",children:"TecnoMath.com"})]})]}),n.jsx(Kr,{className:"absolute right-[-40px] bottom-[-40px] w-80 h-80 text-blue-600/5 pointer-events-none"})]}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] p-10 border border-slate-200 shadow-sm flex flex-col",children:[n.jsxs("div",{className:"flex items-center gap-4 mb-10",children:[n.jsx("div",{className:"w-12 h-12 bg-slate-100 rounded-2xl flex items-center justify-center text-slate-900",children:n.jsx(FK,{size:24})}),n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Infraestructura"})]}),n.jsxs("div",{className:"space-y-6 flex-1",children:[n.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-2xl border border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"OS Distribution"}),n.jsx("span",{className:"text-xs font-black text-slate-800",children:"Ubuntu Server 24.04 LTS"})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-2xl border border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Control Console"}),n.jsx("span",{className:"text-xs font-black text-slate-800",children:"aaPanel (VET PRO)"})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-2xl border border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Data Engine"}),n.jsx("span",{className:"text-xs font-black text-slate-800",children:"MariaDB 10.11 / PHP 8.3"})]}),n.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-50 rounded-2xl border border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"System Build"}),n.jsx("span",{className:"text-xs font-black text-blue-600 uppercase",children:"Kernel V4.1.61 MC/MB"})]})]}),n.jsxs("div",{className:"mt-8 p-6 bg-blue-50 border border-blue-100 rounded-3xl flex items-start gap-4",children:[n.jsx(CG,{className:"text-blue-600 shrink-0",size:20}),n.jsx("p",{className:"text-[10px] text-blue-800 font-bold uppercase leading-relaxed tracking-tight",children:"El sistema opera bajo un cluster de alta disponibilidad con backups incrementales automáticos cada 24 horas."})]})]}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] p-10 border border-slate-200 shadow-sm flex flex-col",children:[n.jsx("div",{className:"flex items-center justify-between mb-8",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-emerald-50 text-emerald-600 rounded-2xl flex items-center justify-center",children:n.jsx(za,{size:24})}),n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Diagnostics"})]})}),n.jsx("div",{className:"bg-slate-950 rounded-2xl p-6 font-mono text-[10px] flex-1 mb-6 border border-slate-800 shadow-inner overflow-y-auto max-h-[250px] custom-scrollbar",children:f.length===0?n.jsx("p",{className:"text-slate-600 italic",children:"// Esperando orden de ejecución..."}):f.map((ne,ae)=>n.jsx("p",{className:`mb-1 ${ne.includes("ERROR")?"text-red-400":ne.includes("OK")?"text-emerald-400":"text-blue-400"}`,children:ne},ae))}),n.jsx("div",{className:"space-y-4",children:n.jsxs("button",{disabled:s,onClick:re,className:"w-full bg-slate-900 hover:bg-black text-white py-5 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl active:scale-95 transition-all flex items-center justify-center gap-3",children:[s?n.jsx(ct,{className:"animate-spin",size:18}):n.jsx(Kr,{size:18}),"DATABASE PULSE TEST"]})})]})]}),r==="electricity"&&e.role==="programmer"&&n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm space-y-10 animate-in zoom-in",children:[n.jsxs("div",{className:"flex items-center gap-4 border-b border-slate-100 pb-6",children:[n.jsx("div",{className:"w-14 h-14 bg-orange-50 text-orange-600 rounded-2xl flex items-center justify-center shadow-lg",children:n.jsx(Kr,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tight",children:"Control Eléctrico Local"}),n.jsx("p",{className:"text-slate-400 font-medium",children:"Fuerce la adquisición de unidades UPS limitando el acceso por caída del fluido eléctrico."})]})]}),n.jsxs("div",{className:"bg-orange-50/50 p-8 rounded-[2.5rem] border border-orange-100 space-y-6 animate-pulse",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("h4",{className:"font-black text-orange-950 uppercase text-xs tracking-widest flex items-center gap-2",children:[n.jsx(Xr,{size:16})," SIMULAR FALLO ELÉCTRICO LOCAL"]}),n.jsx("p",{className:"text-slate-500 text-xs font-bold uppercase leading-relaxed max-w-xl",children:"Al activarse, los usuarios sin rol Programador verán un mensaje persistente de fallo de conexión y retención de acceso a la base de datos local."})]}),n.jsxs("button",{onClick:async()=>{if(confirm(`¿${O?"DESACTIVAR":"ACTIVAR"} la simulación de fallo eléctrico?`)){const ne=!O;await we.updateSystemSetting("electrical_failure_mode",ne?"true":"false"),q(ne),alert("Estado de fluido eléctrico actualizado con éxito."),window.location.reload()}},className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none ${O?"bg-orange-600":"bg-slate-300"}`,children:[n.jsx("span",{className:"sr-only",children:"Toggle Electrical Failure"}),n.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${O?"translate-x-6":"translate-x-1"}`})]})]}),n.jsx("div",{className:"border-t border-orange-200/50 pt-4 flex items-center gap-3",children:n.jsxs("span",{className:"text-xs font-black uppercase text-orange-700 tracking-wider",children:["Estatus Actual: ",O?"🔴 CORTE DE FLUIDO ELÉCTRICO ACTIVADO (ACCESO BLOQUEADO)":"🟢 ENERGÍA ESTABLE (SISTEMA INTEGRAL EN LÍNEA)"]})})]}),n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[2.5rem] border border-slate-200",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-3",children:"DIAGNÓSTICO DEL UPS RECOMENDADO"}),n.jsx("p",{className:"text-slate-600 text-xs leading-relaxed font-semibold",children:"Este bloqueo del kernel simula una caída total de suministro para forzar la toma de conciencia sobre la necesidad de UPS de gran capacidad. El acceso regular a la base de datos se restablecerá de inmediato al desactivar este parámetro."})]})]})]})]})},XEe=({user:e})=>{const[t,r]=k.useState([]),[a,s]=k.useState({size_kb:0,count:0}),[i,l]=k.useState(!0),[o,d]=k.useState(null),[u,f]=k.useState(""),[p,h]=k.useState(null),m=async()=>{l(!0),d(null);try{const E=await we.getAuditLogs();r(E.logs||[]),s(E.stats||{size_kb:0,count:0})}catch(E){console.error("Error en telemetría:",E),d(E.message||"No se pudo conectar con el motor de auditoría.")}finally{l(!1)}};k.useEffect(()=>{e.role==="programmer"&&m()},[e.role]);const b=k.useMemo(()=>t.filter(E=>{var T,B,F;return(((T=E.username)==null?void 0:T.toLowerCase())||"").includes(u.toLowerCase())||(((B=E.action)==null?void 0:B.toLowerCase())||"").includes(u.toLowerCase())||(E.ip_address||"").includes(u)||(((F=E.module)==null?void 0:F.toLowerCase())||"").includes(u.toLowerCase())}),[t,u]),v=()=>{if(b.length===0)return;const E=["ID","Fecha/Hora","Usuario","Rol","Accion","Modulo","IP Origen","Payload (Data)","User Agent"],T=b.map(P=>[P.id,`"${P.created_at}"`,`"${P.username}"`,`"${P.user_role}"`,`"${P.action}"`,`"${P.module}"`,`"${P.ip_address}"`,`"${(P.payload||"").replace(/"/g,'""')}"`,`"${(P.user_agent||"").replace(/"/g,'""')}"`]),B=[E.join(","),...T.map(P=>P.join(","))].join(`
`),F="\uFEFF",R=new Blob([F+B],{type:"text/csv;charset=utf-8;"}),U=URL.createObjectURL(R),D=document.createElement("a"),L=new Date().toISOString().split("T")[0];D.setAttribute("href",U),D.setAttribute("download",`SAC_DataLogger_Export_${L}.csv`),document.body.appendChild(D),D.click(),document.body.removeChild(D)},y=async()=>{if(confirm("ATENCIÓN: Se vaciará la tabla de auditoría. Esto liberará espacio en la base de datos pero perderá el rastro histórico. ¿Proceder?"))try{await we.clearAuditLogs(),m()}catch(E){alert("Error al limpiar: "+E.message)}},j=(a.size_kb/1024).toFixed(2),_=200,N=Math.min(100,parseFloat(j)/_*100);return e.role!=="programmer"&&e.role!=="admin"?n.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:n.jsxs("div",{className:"bg-red-50 p-12 rounded-[3rem] border border-red-100 text-center max-w-lg shadow-2xl",children:[n.jsx(vs,{size:64,className:"text-red-500 mx-auto mb-6"}),n.jsx("h3",{className:"text-2xl font-black text-red-800 tracking-tight",children:"Acceso Denegado"}),n.jsx("p",{className:"text-red-600 font-medium",children:"Este módulo de ciberseguridad es exclusivo para el arquitecto del sistema."})]})}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"bg-slate-900 p-10 lg:p-14 rounded-[4rem] text-white relative overflow-hidden shadow-2xl border-b-8 border-blue-600/30",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-10",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-600 rounded-3xl flex items-center justify-center shadow-xl shadow-blue-500/20",children:n.jsx(Ak,{size:40,className:"text-white"})}),n.jsxs("div",{children:[n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black tracking-tighter leading-none",children:["Data ",n.jsx("span",{className:"text-blue-500 italic",children:"Logger"})]}),n.jsxs("div",{className:"flex items-center gap-2 mt-4 text-blue-400",children:[n.jsx(wr,{size:16}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em]",children:"Monitoreo de Tráfico Global VET (GMT-4)"})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 w-full lg:w-auto",children:[n.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 rounded-[2.5rem] backdrop-blur-md",children:[n.jsxs("div",{className:"flex justify-between items-center mb-3",children:[n.jsx(jo,{size:18,className:"text-blue-400"}),n.jsx("span",{className:"text-[10px] font-black text-slate-500 uppercase",children:"Almacenamiento"})]}),n.jsxs("div",{className:"text-3xl font-black",children:[j," ",n.jsx("span",{className:"text-sm font-bold text-slate-500",children:"MB"})]}),n.jsx("div",{className:"mt-4 w-full h-1.5 bg-white/10 rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full transition-all duration-1000 ${N>80?"bg-red-500":"bg-blue-500"}`,style:{width:`${N}%`}})}),n.jsxs("p",{className:"text-[8px] font-bold text-slate-500 uppercase mt-2",children:["Límite de Alerta: ",_," MB"]})]}),n.jsxs("div",{className:"bg-white/5 border border-white/10 p-6 rounded-[2.5rem] backdrop-blur-md",children:[n.jsxs("div",{className:"flex justify-between items-center mb-3",children:[n.jsx(za,{size:18,className:"text-emerald-400"}),n.jsx("span",{className:"text-[10px] font-black text-slate-500 uppercase",children:"Total Movimientos"})]}),n.jsx("div",{className:"text-3xl font-black",children:a.count.toLocaleString()}),n.jsx("p",{className:"text-[8px] font-bold text-emerald-400 uppercase mt-2",children:"Logs en tiempo real"})]})]})]}),n.jsx(za,{className:"absolute right-[-40px] top-[-40px] w-96 h-96 text-white/5 pointer-events-none"})]}),o&&n.jsxs("div",{className:"bg-red-50 border border-red-200 p-8 rounded-[2.5rem] flex items-center gap-6 shadow-xl animate-in slide-in-from-top",children:[n.jsx("div",{className:"w-12 h-12 bg-red-100 rounded-2xl flex items-center justify-center text-red-600",children:n.jsx(Xr,{size:24})}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-black text-red-800 uppercase text-xs tracking-widest",children:"Error de Sincronización"}),n.jsx("p",{className:"text-red-600 font-medium text-sm",children:o})]}),n.jsx("button",{onClick:m,className:"ml-auto px-6 py-3 bg-red-600 text-white rounded-xl font-black text-[10px] uppercase tracking-widest active:scale-95 transition-all",children:"Reintentar"})]}),N>80&&n.jsxs("div",{className:"bg-red-600 text-white p-6 rounded-[2.5rem] flex items-center justify-between shadow-xl animate-pulse",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx(Xr,{size:32}),n.jsxs("div",{children:[n.jsxs("p",{className:"font-black uppercase text-sm tracking-widest",children:["Alerta de Almacenamiento Crítico (",j,"MB)"]}),n.jsx("p",{className:"text-xs font-medium opacity-80",children:"La base de datos está superando el 80% de los 200MB permitidos. Descargue el backup y vacíe los logs."})]})]}),n.jsxs("div",{className:"flex items-center gap-2 bg-white/20 px-4 py-2 rounded-xl",children:[n.jsx(Br,{size:16}),n.jsx("span",{className:"text-[10px] font-black uppercase",children:"andresmathison@gmail.com"})]})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Filtrar por IP, Usuario, Módulo o Acción...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-blue-500",value:u,onChange:E=>f(E.target.value)})]}),n.jsxs("div",{className:"flex gap-3 w-full lg:w-auto",children:[n.jsx("button",{onClick:m,className:"p-4 bg-slate-100 text-slate-500 rounded-2xl hover:bg-blue-600 hover:text-white transition-all shadow-sm",children:n.jsx(ct,{size:24,className:i?"animate-spin":""})}),n.jsxs("button",{onClick:v,className:"px-8 py-4 bg-emerald-50 text-emerald-600 rounded-2xl font-black text-[10px] uppercase tracking-widest border border-emerald-100 transition-all hover:bg-emerald-600 hover:text-white active:scale-95 flex items-center gap-2 shadow-sm",title:"Exportar registros a CSV (UTF-8)",children:[n.jsx(Gs,{size:18})," Exportar Data"]}),n.jsxs("button",{onClick:y,className:"px-8 py-4 bg-red-50 text-red-600 rounded-2xl font-black text-[10px] uppercase tracking-widest border border-red-100 transition-all hover:bg-red-600 hover:text-white active:scale-95 flex items-center gap-2 shadow-sm",children:[n.jsx(Ua,{size:18})," Vaciar Log"]})]})]}),n.jsx("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha/Hora"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Actor"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Acción"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Módulo"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"IP Origen"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Detalle"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:b.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"py-20 text-center",children:i?n.jsxs("div",{className:"flex flex-col items-center gap-3",children:[n.jsx(ct,{size:32,className:"text-blue-500 animate-spin"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:"Cargando bitácora..."})]}):n.jsxs("div",{className:"flex flex-col items-center gap-3 opacity-20",children:[n.jsx(rG,{size:48}),n.jsx("p",{className:"text-slate-900 font-black uppercase tracking-widest text-xs",children:"Sin registros que mostrar"})]})})}):b.map(E=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-5",children:n.jsxs("div",{className:"flex items-center gap-2 text-slate-400",children:[n.jsx(Pc,{size:12}),n.jsx("span",{className:"text-[11px] font-black tracking-tight",children:E.created_at})]})}),n.jsx("td",{className:"px-8 py-5",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"font-black text-slate-800 text-sm",children:E.username||"N/A"}),n.jsx("span",{className:`text-[9px] font-black uppercase ${E.user_role==="programmer"?"text-blue-500":E.user_role==="admin"?"text-emerald-500":"text-slate-400"}`,children:E.user_role||"guest"})]})}),n.jsx("td",{className:"px-8 py-5",children:n.jsx("span",{className:"text-xs font-bold text-slate-700",children:E.action||"Movimiento Pasivo"})}),n.jsx("td",{className:"px-8 py-5",children:n.jsx("span",{className:"px-3 py-1 bg-slate-100 text-slate-500 rounded-full text-[9px] font-black uppercase tracking-widest",children:E.module||"System"})}),n.jsx("td",{className:"px-8 py-5",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(wr,{size:12,className:"text-slate-300"}),n.jsx("span",{className:"text-[11px] font-mono text-slate-500",children:E.ip_address})]})}),n.jsx("td",{className:"px-8 py-5 text-right",children:n.jsx("button",{onClick:()=>h(E),className:"p-2.5 bg-slate-100 text-slate-400 hover:bg-slate-900 hover:text-white rounded-xl transition-all shadow-sm opacity-0 group-hover:opacity-100",children:n.jsx(Tc,{size:16})})})]},E.id))})]})})}),p&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3.5rem] w-full max-w-2xl shadow-2xl animate-in zoom-in-95 duration-300 overflow-hidden flex flex-col max-h-[80vh]",children:[n.jsxs("div",{className:"p-8 lg:p-10 border-b border-slate-100 flex justify-between items-center bg-white",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-slate-900 text-white rounded-2xl flex items-center justify-center shadow-xl",children:n.jsx(Ia,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black text-slate-900 tracking-tight",children:"Análisis de Movimiento"}),n.jsxs("p",{className:"text-[10px] text-blue-600 font-black uppercase tracking-widest",children:["ID Registro: ",p.id," • IP: ",p.ip_address]})]})]}),n.jsx("button",{onClick:()=>h(null),className:"p-3 bg-slate-100 text-slate-500 rounded-full hover:bg-red-50 hover:text-red-500 transition-all",children:n.jsx(mt,{size:20})})]}),n.jsx("div",{className:"flex-1 overflow-y-auto p-10 bg-slate-50 custom-scrollbar",children:n.jsxs("div",{className:"bg-white border border-slate-200 rounded-[2.5rem] p-8 shadow-inner",children:[n.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-4",children:"Payload Inyectado / Metadatos:"}),n.jsx("div",{className:"bg-slate-50 p-4 rounded-xl border border-slate-100",children:n.jsx("pre",{className:"font-mono text-xs text-slate-700 whitespace-pre-wrap break-all leading-relaxed",children:(()=>{if(!p.payload)return"// Navegación pasiva o consulta GET sin envío de datos.";try{const E=JSON.parse(p.payload);return JSON.stringify(E,null,4)}catch{return p.payload}})()})}),n.jsxs("div",{className:"mt-8 pt-8 border-t border-slate-100",children:[n.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-2",children:"User Agent:"}),n.jsx("p",{className:"text-[10px] font-medium text-slate-500 italic",children:p.user_agent||"Desconocido"})]})]})}),n.jsx("div",{className:"p-6 bg-slate-50 border-t border-slate-100 text-center",children:n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-[0.4em]",children:"Audit Trail Senior SAC 2025"})})]})})]})},JEe=e=>{const t=window.AudioContext||window.webkitAudioContext;if(!t)return;const r=new t,a=r.currentTime,s=(i,l,o,d,u)=>{const f=r.createOscillator(),p=r.createGain();f.type=l,f.frequency.setValueAtTime(i,o),p.gain.setValueAtTime(0,o),p.gain.linearRampToValueAtTime(u,o+.05),p.gain.exponentialRampToValueAtTime(.001,o+d),f.connect(p),p.connect(r.destination),f.start(o),f.stop(o+d)};e==="notification"?(s(800,"sine",a,.6,.1),s(1200,"sine",a+.05,.4,.05)):e==="doorbell"?(s(600,"triangle",a,.8,.1),s(450,"triangle",a+.6,1.2,.1)):e==="coin"?(s(1500,"sine",a,.1,.05),s(2e3,"square",a+.05,.2,.03),s(2500,"sine",a+.1,.4,.05)):e==="alert"?(s(300,"sawtooth",a,.3,.1),s(300,"sawtooth",a+.4,.3,.1)):e==="mechanic"?(s(150,"square",a,.1,.2),s(100,"sawtooth",a+.1,.2,.1)):e==="severe"&&[0,.3,.6].forEach(i=>{s(800,"sawtooth",a+i,.2,.2),s(600,"square",a+i,.2,.2)})},ZEe=({user:e})=>{const{fees:t,announcements:r,reservations:a,assemblies:s,maintenance:i}=ht(),[l,o]=k.useState([]),d=k.useRef(r.length),u=k.useRef(t.length),f=k.useRef(a.length),p=k.useRef(s.length),h=k.useRef(i.length),m=k.useRef(!0),b=(v,y,j,_)=>{const N=Date.now();o(E=>[...E,{id:N,title:v,message:y,type:j}]),JEe(_),setTimeout(()=>o(E=>E.filter(T=>T.id!==N)),8e3)};return k.useEffect(()=>{if(m.current){m.current=!1,d.current=r.length,u.current=t.length,f.current=a.length,p.current=s.length,h.current=i.length;return}if(r.length>d.current){const v=r[0];v&&v.status==="Publicado"&&b("Nuevo Comunicado",v.title,"info","notification")}if(s.length>p.current&&b("Nueva Asamblea","Se ha publicado una nueva acta.","info","doorbell"),e.role==="owner"){if(t.length>u.current&&b("Nueva Cuota","Recibo del mes disponible.","money","coin"),i.length>h.current){const v=i[i.length-1];v&&v.requestedById===e.id&&b("Solicitud Recibida","Tu reporte de servicio fue registrado.","success","mechanic")}if(a.length>f.current){const v=a[a.length-1];v&&v.residentName===e.fullName&&v.status==="Aprobada"&&b("Reserva Aprobada",`Tu reserva para ${v.facility} está lista.`,"success","doorbell")}}d.current=r.length,u.current=t.length,f.current=a.length,p.current=s.length,h.current=i.length},[t,r,a,s,i,e.role,e.fullName,e.id]),n.jsx("div",{className:"fixed top-20 right-4 z-[500] flex flex-col gap-3 pointer-events-none",children:l.map(v=>n.jsxs("div",{className:`pointer-events-auto w-80 bg-white rounded-lg shadow-2xl border-l-4 p-4 transform transition-all duration-500 hover:scale-105 cursor-pointer animate-in slide-in-from-right-10 flex items-start ${v.type==="alert"?"border-red-500":v.type==="warning"?"border-orange-500":v.type==="success"?"border-green-500":v.type==="money"?"border-yellow-500":"border-blue-500"}`,children:[n.jsxs("div",{className:"mr-3 mt-1",children:[v.type==="alert"&&n.jsx(Xr,{className:"w-5 h-5 text-red-500 animate-bounce"}),v.type==="warning"&&n.jsx(Xr,{className:"w-5 h-5 text-orange-500"}),v.type==="success"&&n.jsx(Xi,{className:"w-5 h-5 text-green-500"}),v.type==="money"&&n.jsx(Fp,{className:"w-5 h-5 text-yellow-600"}),v.type==="info"&&n.jsx(bl,{className:"w-5 h-5 text-blue-500"})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("h4",{className:"font-bold text-gray-800 text-sm",children:v.title}),n.jsx("p",{className:"text-xs text-gray-600 mt-1",children:v.message})]}),n.jsx("button",{onClick:()=>o(y=>y.filter(j=>j.id!==v.id)),className:"ml-2 text-gray-400 hover:text-gray-600",children:n.jsx(mt,{className:"w-4 h-4"})})]},v.id))})},eSe=({user:e})=>{const[t,r]=k.useState([]),[a,s]=k.useState(!0),[i,l]=k.useState(""),[o,d]=k.useState(null),u=async()=>{s(!0);try{const h=await we.getUsers();r(h)}catch(h){console.error(h)}finally{s(!1)}};k.useEffect(()=>{e.role==="programmer"&&u()},[e.role]);const f=async h=>{if(!h.cedula)return alert("Este usuario no tiene cédula registrada.");if(confirm(`¿Resetear la clave de ${h.fullName} a su cédula (${h.cedula}) en formato HASH?`)){d(h.id);try{(await fetch(`${Ne}/save_user.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...h,password:h.cedula,status:h.status==="Activo"||h.status==="active"?"active":"inactive"})})).ok?(alert("¡Clave actualizada y hasheada correctamente!"),u()):alert("Error al procesar el cambio en el servidor.")}catch{alert("Error de red.")}finally{d(null)}}},p=t.filter(h=>h.fullName.toLowerCase().includes(i.toLowerCase())||(h.cedula||"").toLowerCase().includes(i.toLowerCase()));return e.role!=="programmer"?n.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:n.jsxs("div",{className:"bg-red-50 p-12 rounded-[3rem] border border-red-100 text-center max-w-lg shadow-2xl",children:[n.jsx(vs,{size:64,className:"text-red-500 mx-auto mb-6"}),n.jsx("h3",{className:"text-2xl font-black text-red-800 tracking-tight",children:"Acceso Bloqueado"}),n.jsx("p",{className:"text-red-600 font-medium",children:"Solo el desarrollador maestro puede gestionar hashes de seguridad."})]})}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-6 bg-slate-900 p-8 lg:p-10 rounded-[3rem] text-white relative overflow-hidden shadow-2xl border-b-8 border-emerald-500/20",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-emerald-500/20 w-fit px-4 py-1.5 rounded-full border border-emerald-500/30 flex items-center gap-2 mb-4",children:[n.jsx(mG,{size:14,className:"text-emerald-400"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-[0.2em] text-emerald-400",children:"Security Core v6.0"})]}),n.jsxs("h1",{className:"text-3xl lg:text-4xl font-black tracking-tighter",children:["Control Maestro de ",n.jsx("span",{className:"text-emerald-500 italic",children:"Hashes"})]}),n.jsx("p",{className:"text-slate-400 mt-2 font-medium text-sm max-w-md",children:"Gestión centralizada de credenciales irreversibles (BCRYPT)."})]}),n.jsx(EA,{size:150,className:"absolute right-[-20px] top-[-20px] text-white/5 pointer-events-none"})]}),n.jsxs("div",{className:"bg-white p-5 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col md:flex-row items-center gap-4",children:[n.jsxs("div",{className:"relative flex-1 w-full",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por nombre o cédula...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold outline-none focus:ring-2 focus:ring-emerald-500 transition-all",value:i,onChange:h=>l(h.target.value)})]}),n.jsx("button",{onClick:u,className:"p-4 bg-slate-100 text-slate-500 rounded-2xl hover:bg-emerald-600 hover:text-white transition-all shadow-sm",children:n.jsx(ct,{size:24,className:a?"animate-spin":""})})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Usuario / Propietario"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Documento (Login)"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Rol"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Estado"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acción Crítica"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:a?Array(5).fill(0).map((h,m)=>n.jsx("tr",{className:"animate-pulse",children:n.jsx("td",{colSpan:5,className:"px-8 py-6",children:n.jsx("div",{className:"h-4 bg-slate-100 rounded-full w-full"})})},m)):p.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"px-8 py-20 text-center text-slate-400 font-bold uppercase tracking-widest text-xs italic",children:"No se encontraron usuarios"})}):p.map(h=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-5",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-slate-100 flex items-center justify-center text-slate-400 group-hover:bg-emerald-50 group-hover:text-emerald-600 transition-all font-black text-xs",children:h.fullName[0]}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-800 text-sm uppercase leading-tight",children:h.fullName}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest mt-0.5",children:h.email||"Sin Email"})]})]})}),n.jsx("td",{className:"px-8 py-5",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"font-mono font-black text-slate-600 text-xs",children:h.cedula||h.username}),n.jsx("span",{className:"text-[8px] font-black text-blue-500 uppercase tracking-tighter",children:"Validación de Identidad"})]})}),n.jsx("td",{className:"px-8 py-5 text-center",children:n.jsx("span",{className:`px-3 py-1 rounded-lg text-[9px] font-black uppercase tracking-widest border ${h.role==="programmer"?"bg-blue-50 text-blue-600 border-blue-100":"bg-slate-100 text-slate-500 border-slate-200"}`,children:h.role})}),n.jsx("td",{className:"px-8 py-5 text-center",children:n.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[n.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${h.status==="Activo"||h.status==="active"?"bg-emerald-500 animate-pulse":"bg-slate-300"}`}),n.jsx("span",{className:"text-[10px] font-black text-slate-600 uppercase",children:h.status==="active"?"Activo":h.status})]})}),n.jsx("td",{className:"px-8 py-5 text-right",children:n.jsxs("button",{disabled:o===h.id||!h.cedula,onClick:()=>f(h),className:"inline-flex items-center gap-2 px-6 py-2.5 bg-slate-900 hover:bg-emerald-600 text-white rounded-xl font-black text-[9px] uppercase tracking-widest shadow-lg transition-all active:scale-95 disabled:opacity-30",children:[o===h.id?n.jsx(qi,{className:"animate-spin",size:12}):n.jsx(ct,{size:12}),"Reset a Cédula"]})})]},h.id))})]})})}),n.jsxs("div",{className:"p-8 bg-blue-50 border border-blue-100 rounded-[3rem] flex items-start gap-6 shadow-sm",children:[n.jsx(vs,{className:"text-blue-600 shrink-0",size:32}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"font-black text-blue-900 uppercase text-xs tracking-widest",children:"Información de Seguridad Maestra"}),n.jsx("p",{className:"text-blue-800/70 text-[11px] font-medium leading-relaxed italic uppercase",children:"El proceso de reseteo aplica una función de derivación de claves (Key Derivation Function) de 10 rondas. Este cambio es automático y global. Se recomienda al usuario cambiar su clave personal una vez recupere el acceso. Nadie puede visualizar la clave previa una vez ejecutado este comando."})]})]})]})},tSe=({user:e})=>{const[t,r]=k.useState([]),[a,s]=k.useState(!0),[i,l]=k.useState(""),[o,d]=k.useState(!1),[u,f]=k.useState(null),[p,h]=k.useState([]),[m,b]=k.useState(!1),[v,y]=k.useState(null),[j,_]=k.useState({rif:"",name:"",contactPerson:"",email:"",phonePrimary:"",phoneOffice:"",country:"Venezuela",serviceType:"Mantenimiento",taxAddress:""}),[N,E]=k.useState({year:new Date().getFullYear(),month:-1,search:""}),T=["admin","programmer","board"].includes(e.role),B=async()=>{s(!0);try{const Q=await we.getProviders();r(Q)}catch(Q){console.error(Q)}finally{s(!1)}};k.useEffect(()=>{B()},[]);const F=Q=>{Q?(y(Q.rif),_(Q)):(y(null),_({rif:"",name:"",contactPerson:"",email:"",phonePrimary:"",phoneOffice:"",country:"Venezuela",serviceType:"Mantenimiento",taxAddress:""})),d(!0)},R=async Q=>{if(Q.preventDefault(),!/^[A-Z][0-9]{1,9}$/.test(j.rif)){alert("RIF Inválido: Debe iniciar con letra mayúscula seguida de números, sin guiones (Máx 10 carac).");return}try{await we.saveProvider(j),d(!1),B()}catch(X){alert(X.message)}},U=async Q=>{if(confirm(`¿Eliminar al proveedor con RIF ${Q}? Se perderá el rastro en el listado desplegable.`))try{await we.deleteProvider(Q),B()}catch{alert("Error al eliminar")}},D=async Q=>{f(Q),b(!0);try{const H=await we.getProviderHistory(Q.rif);h(H)}catch(H){console.error(H)}finally{b(!1)}},L=()=>{if(t.length===0)return;const Q=window.open("","","width=1000,height=900");if(!Q)return;const H=t.map((X,K)=>`
            <tr style="border-bottom: 1px solid #e2e8f0;">
                <td style="padding: 12px; font-size: 10px; font-weight: bold; text-align:center;">${K+1}</td>
                <td style="padding: 12px; font-size: 11px; font-weight: 900; color: #1e293b;">${X.name}</td>
                <td style="padding: 12px; font-size: 11px; font-weight: bold; color: #2563eb;">${X.rif}</td>
                <td style="padding: 12px; font-size: 11px; color: #475569;">${X.contactPerson||"-"}</td>
                <td style="padding: 12px; font-size: 11px; color: #475569;">${X.phonePrimary}</td>
                <td style="padding: 12px; font-size: 10px; font-weight: 900; text-transform: uppercase; color: #64748b;">${X.serviceType}</td>
                <td style="padding: 12px; font-size: 10px; color: #94a3b8;">${X.email||"-"}</td>
            </tr>
        `).join("");Q.document.write(`
            <html>
            <head>
                <title>Reporte Maestro de Proveedores - SAC 2026</title>
                <style>
                    body { font-family: 'Inter', system-ui, sans-serif; padding: 40px; color: #0f172a; line-height: 1.5; }
                    .header { text-align: center; border-bottom: 4px solid #0f172a; padding-bottom: 20px; margin-bottom: 30px; position: relative; }
                    .logo-placeholder { position: absolute; left: 0; top: 0; font-weight: 900; font-size: 24px; color: #2563eb; }
                    h1 { margin: 0; font-size: 28px; text-transform: uppercase; letter-spacing: -1px; }
                    .sub { margin: 5px 0; font-size: 12px; color: #64748b; font-weight: bold; text-transform: uppercase; letter-spacing: 2px; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; border: 1px solid #e2e8f0; }
                    th { background: #f8fafc; text-align: left; padding: 14px; font-size: 10px; font-weight: 900; text-transform: uppercase; color: #64748b; border-bottom: 2px solid #0f172a; }
                    .footer { margin-top: 50px; text-align: center; font-size: 9px; color: #94a3b8; border-top: 1px solid #f1f5f9; padding-top: 20px; }
                    .timestamp { font-size: 9px; color: #2563eb; margin-top: 10px; text-align: right; font-weight: bold; }
                    @media print {
                        body { padding: 20px; }
                        .no-print { display: none; }
                    }
                </style>
            </head>
            <body>
                <div class="header">
                    <div class="logo-placeholder">SAC 2026</div>
                    <h1>Listado Maestro de Proveedores</h1>
                    <div class="sub">Gestión Administrativa Condominio El Tejar</div>
                </div>
                <div class="timestamp">Generado el: ${new Date().toLocaleDateString("es-VE")} - ${new Date().toLocaleTimeString("es-VE")}</div>
                <table>
                    <thead>
                        <tr>
                            <th style="text-align:center;">#</th>
                            <th>Razón Social / Empresa</th>
                            <th>RIF / C.I.</th>
                            <th>Contacto</th>
                            <th>Teléfono</th>
                            <th>Servicio</th>
                            <th>Correo Electrónico</th>
                        </tr>
                    </thead>
                    <tbody>${H}</tbody>
                </table>
                <div style="margin-top: 40px; display: flex; justify-content: space-between;">
                    <div style="border-top: 1px solid #ccc; width: 200px; text-align: center; padding-top: 10px; font-size: 10px; font-weight: bold;">Administración</div>
                    <div style="border-top: 1px solid #ccc; width: 200px; text-align: center; padding-top: 10px; font-size: 10px; font-weight: bold;">Junta de Condominio</div>
                </div>
                <div class="footer">
                    Este documento es una emisión oficial del Kernel V4.0.57 • Powered by TecnoMath • All Rights Reserved &copy; 2026
                </div>
            </body>
            </html>
        `),Q.document.close(),Q.focus(),setTimeout(()=>{Q.print()},500)},P=k.useMemo(()=>t.filter(Q=>Q.name.toLowerCase().includes(i.toLowerCase())||Q.rif.toLowerCase().includes(i.toLowerCase())||Q.serviceType.toLowerCase().includes(i.toLowerCase())),[t,i]),G=k.useMemo(()=>p.filter(Q=>{const H=new Date(Q.date),X=H.getFullYear()===N.year,K=N.month===-1||H.getMonth()===N.month,ee=Q.description.toLowerCase().includes(N.search.toLowerCase())||(Q.reference||"").includes(N.search);return X&&K&&ee}),[p,N]);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Directorio de Proveedores"}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Empresas y servicios técnicos vinculados al condominio."})]}),T&&n.jsxs("div",{className:"flex gap-3 w-full md:w-auto",children:[n.jsxs("button",{onClick:L,className:"flex-1 md:flex-none bg-slate-900 hover:bg-black text-white px-6 py-4 rounded-2xl flex items-center justify-center font-black shadow-xl transition-all active:scale-95 gap-2 text-[10px] uppercase tracking-widest",children:[n.jsx(wt,{size:18})," Listado Maestría"]}),n.jsxs("button",{onClick:()=>F(),className:"flex-[2] md:flex-none bg-blue-600 hover:bg-blue-700 text-white px-8 py-4 rounded-2xl flex items-center justify-center font-black shadow-xl shadow-blue-500/20 transition-all active:scale-95",children:[n.jsx(En,{className:"w-5 h-5 mr-2"}),"Nuevo Proveedor"]})]})]}),n.jsxs("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-6 lg:p-8 border-b border-slate-100 flex flex-col md:flex-row items-center justify-between gap-6",children:[n.jsxs("div",{className:"relative w-full max-w-md",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por nombre, RIF o servicio...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm focus:ring-2 focus:ring-blue-500 outline-none font-bold",value:i,onChange:Q=>l(Q.target.value)})]}),n.jsx("button",{onClick:B,className:"p-4 bg-slate-50 rounded-2xl text-slate-400 hover:text-blue-600 transition-colors",children:n.jsx(ct,{size:20,className:a?"animate-spin":""})})]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Proveedor / RIF"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Contacto"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Teléfonos"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Tipo de Servicio"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:a?n.jsx("tr",{children:n.jsxs("td",{colSpan:5,className:"py-20 text-center",children:[n.jsx(qi,{className:"w-10 h-10 text-blue-600 animate-spin mx-auto mb-4"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase text-[10px]",children:"Cargando empresas..."})]})}):P.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-20 text-center text-slate-300 italic",children:"No hay proveedores registrados."})}):P.map(Q=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-100 rounded-xl flex items-center justify-center text-slate-400 group-hover:bg-blue-600 group-hover:text-white transition-all",children:n.jsx(ea,{size:20})}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-900 uppercase leading-none",children:Q.name}),n.jsx("p",{className:"text-[10px] font-bold text-blue-500 mt-1 uppercase tracking-widest",children:Q.rif})]})]})}),n.jsxs("td",{className:"px-8 py-6",children:[n.jsx("p",{className:"text-sm font-bold text-slate-700",children:Q.contactPerson}),n.jsx("p",{className:"text-[10px] text-slate-400 truncate max-w-[150px]",children:Q.email})]}),n.jsxs("td",{className:"px-8 py-6",children:[n.jsx("p",{className:"text-xs font-black text-slate-600",children:Q.phonePrimary}),Q.phoneOffice&&n.jsxs("p",{className:"text-[10px] text-slate-400",children:["Ofic: ",Q.phoneOffice]})]}),n.jsx("td",{className:"px-8 py-6",children:n.jsx("span",{className:"px-3 py-1 bg-blue-50 text-blue-600 rounded-lg text-[10px] font-black uppercase tracking-widest border border-blue-100",children:Q.serviceType})}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:()=>D(Q),className:"p-2.5 bg-emerald-50 text-emerald-600 hover:bg-emerald-600 hover:text-white rounded-xl transition-all shadow-sm",title:"Historial de Egresos",children:n.jsx(xo,{size:18})}),n.jsx("button",{onClick:()=>F(Q),className:"p-2.5 bg-blue-50 text-blue-600 hover:bg-blue-600 hover:text-white rounded-xl transition-all shadow-sm",children:n.jsx(yl,{size:18})}),n.jsx("button",{onClick:()=>U(Q.rif),className:"p-2.5 bg-red-50 text-red-600 hover:bg-red-600 hover:text-white rounded-xl transition-all shadow-sm",children:n.jsx(Ua,{size:18})})]})})]},Q.rif))})]})})]}),o&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-2xl shadow-2xl overflow-y-auto max-h-[95vh] custom-scrollbar animate-in zoom-in-95",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-14 h-14 bg-blue-600 rounded-2xl flex items-center justify-center text-white shadow-xl",children:n.jsx(pb,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:v?"Editar Proveedor":"Nuevo Proveedor"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Vincule empresas de confianza al sistema."})]})]}),n.jsx("button",{onClick:()=>d(!1),className:"p-3 bg-slate-100 rounded-full text-slate-500 hover:bg-slate-200 transition-colors",children:n.jsx(mt,{size:24})})]}),n.jsxs("form",{onSubmit:R,className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block ml-1",children:"C.I / R.I.F. (PK)"}),n.jsx("input",{required:!0,disabled:!!v,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-blue-600 outline-none focus:ring-2 focus:ring-blue-500 uppercase disabled:opacity-50",value:j.rif,onChange:Q=>_({...j,rif:Q.target.value.replace(/\s+/g,"")}),placeholder:"EJ: J31234567"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block ml-1",children:"Razón Social"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold text-slate-900 outline-none focus:ring-2 focus:ring-blue-500",value:j.name,onChange:Q=>_({...j,name:Q.target.value.toUpperCase()}),placeholder:"Nombre de la empresa"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block ml-1",children:"Persona de Contacto"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold text-slate-800 outline-none",value:j.contactPerson,onChange:Q=>_({...j,contactPerson:Q.target.value}),placeholder:"Nombre del enlace"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block ml-1",children:"Tipo de Servicio"}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-800 outline-none cursor-pointer",value:j.serviceType,onChange:Q=>_({...j,serviceType:Q.target.value}),children:[n.jsx("option",{value:"Mantenimiento",children:"Mantenimiento"}),n.jsx("option",{value:"Servicios Públicos",children:"Servicios Públicos"}),n.jsx("option",{value:"Seguridad",children:"Seguridad"}),n.jsx("option",{value:"Suministros",children:"Suministros"}),n.jsx("option",{value:"Legal / Contable",children:"Legal / Contable"}),n.jsx("option",{value:"Otro",children:"Otro"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block ml-1",children:"Email Corporativo"}),n.jsx("input",{required:!0,type:"email",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold outline-none",value:j.email,onChange:Q=>_({...j,email:Q.target.value}),placeholder:"empresa@ejemplo.com"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block ml-1",children:"Teléfono Principal"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black outline-none",value:j.phonePrimary,onChange:Q=>_({...j,phonePrimary:Q.target.value}),placeholder:"Ej: 0412..."})]}),n.jsxs("div",{className:"md:col-span-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 mb-2 block ml-1",children:"Dirección Fiscal"}),n.jsx("textarea",{className:"w-full bg-slate-50 border border-slate-200 rounded-[2rem] px-6 py-4 font-medium outline-none min-h-[100px]",value:j.taxAddress,onChange:Q=>_({...j,taxAddress:Q.target.value}),placeholder:"Ubicación administrativa..."})]})]}),n.jsxs("button",{type:"submit",className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl transition-all active:scale-95 flex items-center justify-center gap-3",children:[n.jsx(Zn,{size:20})," ",v?"ACTUALIZAR DATOS":"CREAR PROVEEDOR"]})]})]})}),u&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-0 sm:p-4",children:n.jsxs("div",{className:"bg-white rounded-none sm:rounded-[3.5rem] w-full max-w-5xl h-full sm:h-[90vh] shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex flex-col md:flex-row justify-between items-start md:items-center gap-6 bg-white shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"w-16 h-16 bg-emerald-50 text-emerald-600 rounded-[1.5rem] flex items-center justify-center shadow-lg shadow-emerald-100",children:n.jsx(xo,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight leading-none uppercase",children:u.name}),n.jsx("p",{className:"text-emerald-600 font-black text-[10px] uppercase tracking-[0.2em] mt-2",children:"Bitácora Financiera Histórica"})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-4 bg-slate-50 text-slate-400 hover:text-blue-600 rounded-2xl transition-all",children:n.jsx(yr,{size:20})}),n.jsx("button",{onClick:()=>f(null),className:"p-4 bg-slate-100 text-slate-500 rounded-2xl hover:bg-red-50 hover:text-red-500 transition-all",children:n.jsx(mt,{size:24})})]})]}),n.jsxs("div",{className:"bg-slate-50 px-8 py-5 border-b border-slate-200 flex flex-wrap items-center gap-4 shrink-0",children:[n.jsxs("div",{className:"bg-white border border-slate-200 rounded-xl px-4 py-2 flex items-center gap-3",children:[n.jsx(Wr,{size:14,className:"text-slate-400"}),n.jsx("select",{className:"text-xs font-black uppercase text-slate-700 outline-none bg-transparent",value:N.year,onChange:Q=>E({...N,year:parseInt(Q.target.value)}),children:[2023,2024,2025].map(Q=>n.jsx("option",{value:Q,children:Q},Q))})]}),n.jsxs("div",{className:"bg-white border border-slate-200 rounded-xl px-4 py-2 flex items-center gap-3",children:[n.jsx(ok,{size:14,className:"text-slate-400"}),n.jsxs("select",{className:"text-xs font-black uppercase text-slate-700 outline-none bg-transparent",value:N.month,onChange:Q=>E({...N,month:parseInt(Q.target.value)}),children:[n.jsx("option",{value:-1,children:"Todos los Meses"}),Te.map((Q,H)=>n.jsx("option",{value:H,children:Q},H))]})]}),n.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[n.jsx(er,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),n.jsx("input",{type:"text",placeholder:"Filtrar por monto o concepto...",className:"w-full bg-white border border-slate-200 rounded-xl pl-9 pr-4 py-2 text-xs font-bold outline-none focus:ring-2 focus:ring-emerald-500",value:N.search,onChange:Q=>E({...N,search:Q.target.value})})]})]}),n.jsx("div",{className:"flex-1 overflow-y-auto p-8 bg-slate-50 custom-scrollbar",children:m?n.jsxs("div",{className:"flex flex-col items-center justify-center py-20 gap-4",children:[n.jsx(ct,{className:"animate-spin text-emerald-500",size:32}),n.jsx("p",{className:"text-[10px] font-black uppercase text-slate-400",children:"Escaneando transacciones..."})]}):G.length===0?n.jsxs("div",{className:"py-32 text-center",children:[n.jsx("div",{className:"w-20 h-20 bg-white border border-dashed border-slate-200 rounded-full flex items-center justify-center mx-auto mb-6",children:n.jsx(br,{size:32,className:"text-slate-200"})}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-xs italic",children:"Sin egresos registrados para los filtros seleccionados"})]}):n.jsx("div",{className:"space-y-4",children:G.map(Q=>n.jsxs("div",{className:"bg-white p-6 rounded-[2rem] border border-slate-100 shadow-sm flex flex-col md:flex-row justify-between items-center gap-6 group hover:border-emerald-200 transition-all",children:[n.jsxs("div",{className:"flex items-center gap-5 flex-1",children:[n.jsx("div",{className:"w-12 h-12 bg-slate-50 rounded-2xl flex items-center justify-center text-slate-400 group-hover:bg-emerald-50 group-hover:text-emerald-600 transition-all",children:n.jsx(kn,{size:20})}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-800 text-sm leading-tight uppercase mb-1",children:Q.description}),n.jsxs("div",{className:"flex items-center gap-4 text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(Wr,{size:12})," ",Q.date]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(yr,{size:12})," REF: ",Q.reference||"S/R"]}),n.jsx("span",{className:"px-2 py-0.5 bg-slate-100 rounded text-[9px]",children:Q.type})]})]})]}),n.jsxs("div",{className:"text-right shrink-0",children:[n.jsxs("p",{className:"text-xl font-black text-rose-600 tracking-tighter",children:["Bs. ",Q.amountBs.toLocaleString("es-VE",{minimumFractionDigits:2})]}),n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-tight",children:["Equiv: $",Q.amountUsd.toFixed(2)," USD"]})]})]},Q.id))})}),n.jsxs("div",{className:"p-8 bg-white border-t border-slate-100 flex flex-col sm:flex-row justify-between items-center gap-6 shrink-0",children:[n.jsxs("div",{className:"flex gap-8",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Gasto Acumulado (Filtro)"}),n.jsxs("p",{className:"text-2xl font-black text-slate-800 tracking-tighter",children:["$",G.reduce((Q,H)=>Q+H.amountUsd,0).toLocaleString(void 0,{minimumFractionDigits:2})]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Operaciones"}),n.jsx("p",{className:"text-2xl font-black text-blue-600 tracking-tighter",children:G.length})]})]}),n.jsx("div",{className:"text-right",children:n.jsx("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.4em]",children:"Resumen de Gestión Proveedores 2025"})})]})]})})]})},rSe=({user:e})=>{const{transactions:t,refreshData:r,loading:a}=ht(),[s,i]=k.useState(new Date().getMonth()),[l,o]=k.useState(new Date().getFullYear()),[d,u]=k.useState(""),[f,p]=k.useState(!1);k.useEffect(()=>{r()},[]);const h=k.useMemo(()=>t.filter(j=>{var B;if(j.category!=="Comisiones"||j.type!=="Egreso")return!1;const[_,N]=j.date.split("-").map(Number),E=_===l&&N-1===s,T=!d||j.description.toLowerCase().includes(d.toLowerCase())||((B=j.reference)==null?void 0:B.toLowerCase().includes(d.toLowerCase()));return E&&T}).sort((j,_)=>j.date.localeCompare(_.date)),[t,s,l,d]),m=k.useMemo(()=>h.reduce((j,_)=>j+(Number(_.amount)||0),0),[h]),b=k.useMemo(()=>h.reduce((j,_)=>j+(Number(_.amountBs)||0),0),[h]),v=async()=>{if(m<=0){alert("No hay comisiones acumuladas para facturar en este periodo.");return}const j=(s+1)%12,_=s===11?l+1:l;if(confirm(`¿Generar un gasto automático de $${m.toFixed(2)} por comisiones para ser cobrado en ${Te[j]} ${_}?`)){p(!0);try{const E=await(await fetch(`${Ne}/auto_apply_commissions.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({month:s,year:l,amountUsd:m,amountBs:b,targetMonth:j,targetYear:_})})).json();E.success?(alert("¡Éxito! Las comisiones han sido enviadas al Balance como 'Pendiente' para la próxima cuota."),r()):alert("Error: "+E.error)}catch{alert("Error de conexión con el motor contable.")}finally{p(!1)}}},y=()=>{const j=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Reporte de Comisiones - ${Te[s]} ${l}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; background-color: #f8fafc; }
        .container { max-width: 1000px; margin: 0 auto; background: white; padding: 50px; border-radius: 24px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
        .header { text-align: center; margin-bottom: 30px; }
        .title { font-size: 20px; font-weight: 900; text-transform: uppercase; color: #0f172a; letter-spacing: 2px; }
        table { width: 100%; border-collapse: collapse; margin-top: 20px; }
        th { text-align: left; font-size: 10px; text-transform: uppercase; color: #64748b; padding: 12px; border-bottom: 2px solid #f1f5f9; }
        td { padding: 12px; font-size: 12px; border-bottom: 1px solid #f1f5f9; }
        .total-row { background: #0f172a; color: white; font-weight: 900; }
        .footer { text-align: center; font-size: 10px; color: #94a3b8; margin-top: 30px; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="title">Reporte de Comisiones Bancarias</div>
            <div style="font-size: 11px; color: #64748b; font-weight: 700; margin-top: 4px;">SAC 2026 - ${Te[s]} ${l}</div>
        </div>
        
        <table>
            <thead>
                <tr>
                    <th>Fecha</th>
                    <th>Descripción</th>
                    <th>Referencia</th>
                    <th style="text-align: right;">Monto ($)</th>
                </tr>
            </thead>
            <tbody>
                ${h.map(T=>`
                    <tr>
                        <td>${T.date}</td>
                        <td>${T.description}</td>
                        <td>${T.reference||"S/R"}</td>
                        <td style="text-align: right;">$ ${Number(T.amount).toFixed(2)}</td>
                    </tr>
                `).join("")}
                <tr class="total-row">
                    <td colspan="3" style="text-align: right; padding: 15px;">TOTAL ACUMULADO</td>
                    <td style="text-align: right; padding: 15px;">$ ${m.toFixed(2)}</td>
                </tr>
            </tbody>
        </table>
        
        <div class="footer">
            Generado por SAC 2026 • ${new Date().toLocaleString()}
        </div>
    </div>
</body>
</html>`,_=new Blob([j],{type:"text/html"}),N=URL.createObjectURL(_),E=document.createElement("a");E.href=N,E.download=`Comisiones_${Te[s]}_${l}.html`,E.click(),URL.revokeObjectURL(N)};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-gradient-to-br from-indigo-600 to-blue-800 text-white shadow-2xl relative overflow-hidden",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-white/10 w-fit px-5 py-2 rounded-full backdrop-blur-md border border-white/20 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(bs,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Auditoría de Gastos Bancarios"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Recuperación de ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-300",children:"Comisiones"})]})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest mb-4 px-5 py-2 rounded-full border text-indigo-600 border-indigo-100 bg-indigo-50",children:"TOTAL ACUMULADO DEL MES"}),n.jsxs("div",{className:"flex items-start gap-1",children:[n.jsx("span",{className:"text-2xl font-black mt-2 text-indigo-600",children:"$"}),n.jsx("span",{className:"text-7xl lg:text-8xl font-black tracking-tighter text-slate-900",children:m.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})})]}),n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase mt-2",children:["Bs. ",b.toLocaleString("es-VE",{minimumFractionDigits:2})]}),n.jsx("div",{className:"w-full h-px bg-slate-100 my-8"}),n.jsxs("button",{disabled:f||m<=0,onClick:v,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white font-black py-5 rounded-2xl shadow-xl shadow-indigo-200 transition-all flex items-center justify-center gap-3 text-xs uppercase tracking-widest active:scale-95 disabled:opacity-50",children:[f?n.jsx(ct,{className:"animate-spin"}):n.jsx(Kr,{size:18}),"AUTO-FACTURAR PRÓXIMO MES"]})]})]}),n.jsx(br,{className:"absolute right-[-40px] bottom-[-40px] w-80 h-80 text-white/5 pointer-events-none"})]}),n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-center gap-6 bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4 w-full lg:w-auto",children:[n.jsxs("div",{className:"bg-slate-50 p-2 rounded-2xl border border-slate-100 flex gap-2 w-full sm:w-auto shadow-inner",children:[n.jsx("select",{value:s,onChange:j=>i(Number(j.target.value)),className:"bg-transparent border-none text-[10px] font-black uppercase tracking-widest text-slate-500 outline-none px-4 py-2 cursor-pointer",children:Te.map((j,_)=>n.jsx("option",{value:_,children:j},_))}),n.jsx("input",{type:"number",value:l,onChange:j=>o(Number(j.target.value)),className:"bg-transparent border-none text-[10px] font-black text-blue-600 outline-none w-20 text-center py-2"})]}),n.jsxs("div",{className:"relative w-full sm:w-72",children:[n.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",children:n.jsx(er,{size:16})}),n.jsx("input",{type:"text",placeholder:"Buscar por referencia o voucher...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-3.5 text-xs focus:ring-2 focus:ring-indigo-500 outline-none transition-all font-bold",value:d,onChange:j=>u(j.target.value)})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-4 bg-slate-50 text-slate-400 hover:bg-slate-100 rounded-2xl transition-all shadow-sm",children:n.jsx(wt,{size:20})}),n.jsx("button",{onClick:y,className:"p-4 bg-slate-50 text-slate-400 hover:bg-blue-600 hover:text-white rounded-2xl transition-all shadow-sm",title:"Exportar HTML",children:n.jsx(wr,{size:20})}),n.jsx("button",{onClick:r,className:"p-4 bg-slate-50 text-slate-400 hover:bg-indigo-600 hover:text-white rounded-2xl transition-all shadow-sm",children:n.jsx(ct,{size:20,className:a?"animate-spin":""})})]})]}),n.jsx("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Concepto Bancario / Referencia"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto USD"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto VES"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:h.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:4,className:"py-24 text-center",children:[n.jsx(jn,{size:48,className:"mx-auto mb-4 text-slate-100"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-xs",children:"Sin comisiones detectadas en este mes"})]})}):n.jsx(n.Fragment,{children:h.map((j,_)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Wr,{size:14,className:"text-slate-300"}),n.jsx("span",{className:"font-black text-slate-700 text-sm",children:j.date})]})}),n.jsxs("td",{className:"px-10 py-6",children:[n.jsx("p",{className:"font-black text-slate-900 text-sm uppercase leading-none",children:j.description}),n.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[n.jsxs("span",{className:"px-2 py-0.5 bg-slate-100 text-slate-500 rounded text-[8px] font-black uppercase tracking-tighter",children:["REF: ",j.reference||"S/R"]}),n.jsxs("span",{className:"text-[8px] font-bold text-slate-300 uppercase",children:["AUDIT-ID: ",j.id]})]})]}),n.jsxs("td",{className:"px-10 py-6 text-right font-black text-rose-600",children:["$",Number(j.amount).toFixed(2)]}),n.jsx("td",{className:"px-10 py-6 text-right font-bold text-slate-400",children:Number(j.amountBs).toLocaleString("es-VE",{minimumFractionDigits:2})})]},_))})}),h.length>0&&n.jsx("tfoot",{children:n.jsxs("tr",{className:"bg-slate-900 text-white",children:[n.jsx("td",{colSpan:2,className:"px-10 py-8 text-xs font-black uppercase tracking-[0.3em]",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-white/10 rounded-xl flex items-center justify-center",children:n.jsx(br,{size:20,className:"text-blue-400"})}),"Total Consolidado del Periodo"]})}),n.jsxs("td",{className:"px-10 py-8 text-right",children:[n.jsx("p",{className:"text-[9px] font-black text-blue-400 uppercase tracking-widest mb-1",children:"TOTAL USD"}),n.jsxs("p",{className:"text-2xl font-black tracking-tighter text-white",children:["$",m.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]})]}),n.jsxs("td",{className:"px-10 py-8 text-right",children:[n.jsx("p",{className:"text-[9px] font-black text-blue-400 uppercase tracking-widest mb-1",children:"TOTAL VES"}),n.jsxs("p",{className:"text-2xl font-black tracking-tighter text-blue-300",children:["Bs. ",b.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})]})]})]})})]})})}),n.jsxs("div",{className:"p-10 bg-indigo-50 border border-indigo-100 rounded-[3rem] flex items-start gap-6",children:[n.jsx("div",{className:"w-12 h-12 bg-indigo-600 rounded-2xl flex items-center justify-center text-white shrink-0 shadow-lg",children:n.jsx(vi,{size:24})}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"font-black text-indigo-900 uppercase text-xs tracking-widest",children:"Protocolo de Cobranza de Comisiones"}),n.jsx("p",{className:"text-indigo-800/70 text-sm font-medium leading-relaxed italic",children:'Este módulo extrae automáticamente todas las comisiones bancarias descontadas de los pagos de propietarios. Al usar "Auto-Facturar", el monto se agregará como un gasto administrativo al recibo de condominio del mes entrante, garantizando que el condominio no asuma la erosión financiera de los costos transaccionales.'})]})]})]})},aSe=({user:e})=>{const{properties:t,fees:r,exchangeRateHistory:a,registerPayment:s,refreshData:i}=ht(),[l,o]=k.useState(null),[d,u]=k.useState([]),[f,p]=k.useState([]),[h,m]=k.useState(!1),[b,v]=k.useState(""),[y,j]=k.useState("TODOS"),_=k.useRef(null),[N,E]=k.useState(null),[T,B]=k.useState(null),[F,R]=k.useState(""),[U,D]=k.useState(""),[L,P]=k.useState("pm"),[G,Q]=k.useState(!1),[H,X]=k.useState(!1),[K,ee]=k.useState(null),[W,Y]=k.useState(!1),M=async ne=>{if(!(!ne||ne==="S/R"||ne.length<3))try{const ie=await(await fetch(`${Ne}/check_duplicate_reference.php?reference=${ne}`,{credentials:"include"})).json();ie.duplicate?ee(ie):ee(null)}catch(ae){console.error("Error checking duplicate",ae)}},O=ne=>{var me;const ae=(me=ne.target.files)==null?void 0:me[0];if(!ae)return;m(!0);const ie=new FormData;ie.append("file",ae),fetch(`${Ne}/process_banplus_statement.php`,{method:"POST",body:ie,credentials:"include"}).then(Z=>Z.json()).then(Z=>{if(Z.success){o(Z.metadata);const Me=(Z.movements||[]).map(pe=>{if(!(pe.category==="INGRESOS"||pe.category==="EGRESOS"))return pe;const ye=Z.movements.some(fe=>fe.reference===pe.reference&&fe!==pe&&(fe.category==="COMISIONES"||fe.description.includes("COMISION")));return{...pe,hasMissingCommission:!ye}});u(Me),p(Z.summary)}else alert(Z.error)}).catch(()=>alert("Error de conexión con el motor de análisis.")).finally(()=>m(!1))},q=k.useMemo(()=>d.filter(ne=>{const ae=ne.description.includes(b.toUpperCase())||ne.reference.includes(b)||ne.debit.toString().includes(b)||ne.credit.toString().includes(b),ie=y==="TODOS"||ne.category===y;return ae&&ie}),[d,b,y]),z=(ne,ae)=>{if(!ne)return 45;const ie=a.find(Me=>Me.date===ne);if(ie)return ae==="parallel"&&ie.parallelValue?Number(ie.parallelValue):ae==="am"&&ie.amValue?Number(ie.amValue):Number(ie.pmValue)||Number(ie.amValue);const Z=[...a].sort((Me,pe)=>pe.date.localeCompare(Me.date)).find(Me=>Me.date<ne);return Z?ae==="parallel"&&Z.parallelValue?Number(Z.parallelValue):ae==="am"&&Z.amValue?Number(Z.amValue):Number(Z.pmValue)||Number(Z.amValue):45},J=async()=>{if(!(!N||!T||!F)){if(K&&!W){alert("ALERTA DE SEGURIDAD: Este código de transferencia ya ha sido utilizado. Verifique la información mostrada en el recuadro de alerta. Para proceder, debe marcar la casilla de autorización del programador/administrador.");return}X(!0);try{const ne=z(U||N.date,L),ae=Number((N.credit/ne).toFixed(2)),ie=await fetch(`${Ne}/register_payment.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:F,propertyId:T,amount:ae,method:"Transferencia Bancaria",reference:N.reference,date:U||N.date,slot:L,amount_bs:N.credit,skip_commission:G})});if(!ie.ok){const me=await ie.json();throw new Error(me.error||"Fallo crítico en motor de pagos")}alert(`¡VINCULACIÓN EXITOSA!
Inmueble acreditado con $${ae} USD.`),E(null),await i()}catch(ne){alert("Error al vincular: "+ne.message)}finally{X(!1)}}},re=k.useMemo(()=>[...t].sort((ne,ae)=>ne.code.localeCompare(ae.code,void 0,{numeric:!0})),[t]),le=k.useMemo(()=>{if(!F||!T)return null;const ne=r.find(ie=>ie.id===F),ae=ne==null?void 0:ne.debts.find(ie=>ie.propertyId===T);return ae?{billed:Number(ae.amountUsd),paid:Number(ae.paidAmount),pending:Number(ae.amountUsd)-Number(ae.paidAmount)}:null},[F,T,r]);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-24 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-blue-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-blue-600 w-fit px-5 py-2 rounded-full border border-blue-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(jo,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Master Analyzer v2.0 Pro"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Analizador ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-500 italic",children:"Banplus Estandar"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Kernel V4.0.63: Auditoría automática de comisiones y vinculación contable de precisión."'})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsx("input",{type:"file",accept:".csv",ref:_,onChange:O,className:"hidden"}),n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-3xl flex items-center justify-center mb-8 border-2 border-blue-100",children:h?n.jsx(ct,{className:"animate-spin",size:40}):n.jsx(LA,{size:40})}),n.jsx("button",{onClick:()=>{var ne;return(ne=_.current)==null?void 0:ne.click()},disabled:h,className:"w-full bg-blue-600 hover:bg-blue-700 text-white font-black py-5 rounded-2xl shadow-xl active:scale-95 transition-all text-xs uppercase tracking-widest",children:h?"ANALIZANDO PATRONES...":"PROCESAR ESTADO CSV"}),n.jsxs("p",{className:"text-[9px] font-black text-slate-400 uppercase mt-6 tracking-widest flex items-center gap-2",children:[n.jsx(jn,{size:12})," Banplus Online Detailed Format"]})]})]}),n.jsx(za,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),l&&n.jsxs("div",{className:"space-y-8 animate-in slide-in-from-bottom-6 duration-700",children:[n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:f.map((ne,ae)=>n.jsxs("div",{className:"bg-white p-6 rounded-[2rem] border border-slate-100 shadow-sm flex flex-col items-center text-center group hover:border-blue-500 transition-all",children:[n.jsx("span",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest mb-2",children:ne.label}),n.jsxs("span",{className:"text-lg font-black text-slate-900 leading-none",children:["Bs. ",ne.total.toLocaleString("es-VE",{maximumFractionDigits:0})]}),n.jsxs("span",{className:"text-[9px] font-bold text-blue-500 mt-2 bg-blue-50 px-2 py-0.5 rounded-full",children:[ne.count," Ops"]})]},ae))}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex justify-between items-center bg-slate-50/30",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"p-3 bg-slate-900 rounded-xl text-white shadow-lg",children:n.jsx(wl,{size:20})}),n.jsx("h3",{className:"text-xl font-black text-slate-800 tracking-tight uppercase",children:"Libro Maestro de Auditoría V4.0.63"})]}),n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-white border rounded-xl hover:bg-slate-50 transition-all text-slate-400",children:n.jsx(wt,{size:20})})]}),n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Descripción Bancaria"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Bs."}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Vincular"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100 font-mono",children:q.map((ne,ae)=>n.jsxs("tr",{className:`hover:bg-slate-50/50 transition-all group ${ne.hasMissingCommission?"border-l-4 border-amber-400 bg-amber-50/10":""}`,children:[n.jsx("td",{className:"px-8 py-6 text-[11px] font-black text-slate-500",children:ne.date}),n.jsx("td",{className:"px-8 py-6 text-center",children:n.jsxs("span",{className:"text-[10px] font-black bg-slate-100 px-3 py-1 rounded-lg border border-slate-200 text-blue-600",children:["#",ne.reference]})}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-900 text-[11px] uppercase leading-tight truncate max-w-[280px]",children:ne.description}),n.jsx("span",{className:"text-[8px] font-bold text-slate-400 uppercase tracking-tighter",children:ne.subCategory})]}),ne.hasMissingCommission&&n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-0.5 bg-amber-100 text-amber-700 rounded-full border border-amber-200 shadow-sm",title:"No se detectó el par de comisión en este extracto",children:[n.jsx(Xr,{size:10}),n.jsx("span",{className:"text-[7px] font-black uppercase",children:"Sin Comisión"})]})]})}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("span",{className:`text-sm font-black ${ne.credit>0?"text-emerald-600":"text-rose-600"}`,children:[ne.credit>0?"+":"-"," ",(ne.credit||ne.debit).toLocaleString("es-VE",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-8 py-6 text-right",children:ne.credit>0&&ne.category==="INGRESOS"?n.jsx("button",{onClick:()=>{E(ne),B(null),R(""),D(ne.date),Q(ne.hasMissingCommission||!1),ee(null),Y(!1),M(ne.reference)},className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm active:scale-90",title:"Vincular pago a cuota",children:n.jsx(qf,{size:16})}):n.jsx("div",{className:"w-10"})})]},ae))})]})})]})]}),N&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[300] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-8 lg:p-12 w-full max-w-2xl shadow-2xl animate-in zoom-in-95 duration-300 relative overflow-y-auto max-h-[90vh] custom-scrollbar border-2 border-indigo-100",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-14 h-14 bg-indigo-600 rounded-2xl flex items-center justify-center text-white shadow-xl shadow-indigo-100",children:n.jsx(qf,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase leading-none",children:"Asignación Directa"}),n.jsxs("p",{className:"text-[10px] font-bold text-indigo-600 uppercase tracking-widest mt-2",children:["Voucher: #",N.reference]})]})]}),n.jsx("button",{onClick:()=>E(null),className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(mt,{size:24})})]}),n.jsxs("div",{className:"space-y-6",children:[N.hasMissingCommission&&n.jsxs("div",{className:"p-5 bg-amber-50 border border-amber-200 rounded-3xl flex items-start gap-4 animate-pulse",children:[n.jsx(Xr,{className:"text-amber-600 shrink-0",size:24}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-black text-amber-800 uppercase tracking-tight",children:"Advertencia de Conciliación"}),n.jsxs("p",{className:"text-[10px] text-amber-700 font-medium leading-relaxed",children:["El analizador no encontró una comisión bancaria para esta referencia en el extracto. El sistema sugiere ",n.jsx("b",{children:"NO cargar comisión"})," automáticamente para mantener el balance exacto con el banco."]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-100 space-y-4 shadow-inner",children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:"Ajuste de Fecha y Tasa"}),n.jsxs("div",{className:"flex items-center gap-3 bg-white p-3 rounded-xl border border-slate-200",children:[n.jsx(Wr,{size:16,className:"text-blue-600"}),n.jsx("input",{type:"date",className:"bg-transparent font-black text-slate-800 outline-none w-full text-xs",value:U||N.date,onChange:ne=>D(ne.target.value)})]}),n.jsxs("div",{className:"flex items-center gap-3 bg-white p-3 rounded-xl border border-slate-200",children:[n.jsx(Pc,{size:16,className:"text-indigo-600"}),n.jsxs("select",{className:"bg-transparent font-black text-slate-800 outline-none w-full text-[10px] uppercase tracking-widest",value:L,onChange:ne=>P(ne.target.value),children:[n.jsx("option",{value:"am",children:"Tasa AM (BCV)"}),n.jsx("option",{value:"pm",children:"Tasa PM (BCV)"}),n.jsx("option",{value:"parallel",children:"Tasa Paralelo"})]})]}),n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Tasa aplicada:"}),n.jsxs("span",{className:"text-xs font-black text-blue-600",children:[z(U||N.date,L).toFixed(2)," Bs/$"]})]})]}),n.jsxs("div",{className:"bg-blue-600 p-6 rounded-[2rem] text-white shadow-lg flex flex-col justify-center text-center",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest opacity-60",children:"Abono Estimado"}),n.jsxs("h4",{className:"text-4xl font-black tracking-tighter mt-1",children:["$",(N.credit/z(U||N.date,L)).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),n.jsxs("p",{className:"text-[8px] font-bold uppercase mt-2 opacity-50",children:["Bs. ",N.credit.toLocaleString("es-VE")]})]})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-100 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:`p-2 rounded-lg ${G?"bg-amber-100 text-amber-600":"bg-blue-100 text-blue-600"}`,children:n.jsx(bs,{size:16})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-800 uppercase tracking-tight",children:"Gasto de Comisión en Banco"}),n.jsx("p",{className:"text-[9px] text-slate-400 font-bold uppercase",children:G?"NO SE REGISTRARÁ GASTO":"CALCULAR 1.5% AUTOMÁTICAMENTE"})]})]}),n.jsx("button",{type:"button",onClick:()=>Q(!G),className:`w-14 h-7 rounded-full transition-all relative ${G?"bg-slate-300":"bg-blue-600"}`,children:n.jsx("div",{className:`absolute top-1 w-5 h-5 bg-white rounded-full transition-all shadow-md ${G?"left-1":"left-8"}`})})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 block",children:"1. Unidad Inmobiliaria"}),n.jsxs("div",{className:"relative",children:[n.jsx(ea,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:18}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-4 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-600 appearance-none text-xs",value:T||"",onChange:ne=>B(Number(ne.target.value)),children:[n.jsx("option",{value:"",children:"-- Seleccionar --"}),re.map(ne=>n.jsxs("option",{value:ne.id,children:[ne.code," - ",ne.type," ",ne.number]},ne.id))]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 block",children:"2. Periodo de Gestión"}),n.jsxs("div",{className:"relative",children:[n.jsx(wl,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:18}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-4 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-600 appearance-none text-xs",value:F,onChange:ne=>R(ne.target.value),children:[n.jsx("option",{value:"",children:"-- Seleccionar --"}),r.map(ne=>n.jsxs("option",{value:ne.id,children:[new Intl.DateTimeFormat("es-ES",{month:"long"}).format(new Date(0,ne.month)).toUpperCase()," ",ne.year]},ne.id))]})]})]})]}),le&&n.jsxs("div",{className:"bg-slate-900 rounded-[2rem] p-6 text-white animate-in slide-in-from-top-4",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-4 border-b border-white/10 pb-3",children:[n.jsx(Xr,{size:18,className:"text-amber-400"}),n.jsx("h4",{className:"text-xs font-black uppercase tracking-widest",children:"Monitor de Deuda del Periodo"})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-500 mb-1",children:"Billed (Cuota)"}),n.jsxs("p",{className:"text-sm font-black",children:["$",le.billed.toFixed(2)]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-500 mb-1",children:"Abonado"}),n.jsxs("p",{className:"text-sm font-black text-emerald-400",children:["$",le.paid.toFixed(2)]})]}),n.jsxs("div",{className:"bg-white/10 rounded-xl p-2",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-blue-400 mb-1",children:"Saldo Pendiente"}),n.jsxs("p",{className:`text-sm font-black ${le.pending<=0?"text-emerald-400":"text-rose-400"}`,children:["$",le.pending.toFixed(2)]})]})]})]}),K&&n.jsxs("div",{className:"p-6 bg-rose-50 border-2 border-rose-200 rounded-[2rem] space-y-4 animate-in shake duration-500",children:[n.jsxs("div",{className:"flex items-center gap-3 text-rose-600",children:[n.jsx(Xr,{size:24}),n.jsx("h4",{className:"text-sm font-black uppercase tracking-widest",children:"Referencia Duplicada Detectada"})]}),n.jsx("p",{className:"text-[10px] text-rose-700 font-bold leading-relaxed",children:"Esta referencia ya existe en el sistema. Por favor, verifique si este pago ya fue procesado anteriormente para evitar duplicidad contable."}),K.matches&&K.matches.length>0&&n.jsx("div",{className:"bg-white/50 rounded-xl p-3 space-y-2",children:K.matches.map((ne,ae)=>n.jsxs("div",{className:"text-[9px] font-mono text-rose-900 flex justify-between border-b border-rose-100 pb-1 last:border-0",children:[n.jsx("span",{children:ne.date}),n.jsxs("span",{className:"font-black",children:["Bs. ",Number(ne.amount_bs||ne.amount).toLocaleString()]}),n.jsx("span",{children:ne.source_table})]},ae))}),["admin","programmer"].includes(e.role)&&n.jsxs("label",{className:"flex items-center gap-3 p-3 bg-white rounded-xl border border-rose-200 cursor-pointer hover:bg-rose-100 transition-colors",children:[n.jsx("input",{type:"checkbox",checked:W,onChange:ne=>Y(ne.target.checked),className:"w-5 h-5 rounded border-rose-300 text-rose-600 focus:ring-rose-500"}),n.jsx("span",{className:"text-[10px] font-black text-rose-900 uppercase tracking-tight",children:"Autorizar carga de referencia duplicada"})]})]}),n.jsxs("button",{disabled:H||!T||!F,onClick:J,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white py-6 rounded-[2.5rem] font-black text-xs uppercase tracking-[0.2em] shadow-2xl active:scale-95 transition-all flex items-center justify-center gap-3 disabled:opacity-50",children:[H?n.jsx(ct,{className:"animate-spin"}):n.jsx(Xi,{size:20}),H?"SELLANDO LIBROS...":"CONFIRMAR VINCULACIÓN"]}),n.jsxs("div",{className:"p-4 bg-blue-50 border border-blue-100 rounded-2xl flex items-start gap-4",children:[n.jsx(jn,{className:"text-blue-500 shrink-0 mt-0.5",size:18}),n.jsxs("p",{className:"text-[10px] text-blue-800 font-bold uppercase leading-relaxed tracking-tight",children:["Esta acción registrará el pago en el recibo y creará el asiento en el Libro de Banco ",G?"(SIN COMISIÓN)":"(CON COMISIÓN)",", sincronizando los balances."]})]})]})]})})]})},nSe=({user:e})=>{const{properties:t,fees:r,exchangeRateHistory:a,refreshData:s}=ht(),[i,l]=k.useState([]),[o,d]=k.useState(!1),[u,f]=k.useState(""),[p,h]=k.useState("TODOS"),m=k.useRef(null),[b,v]=k.useState(null),[y,j]=k.useState(null),[_,N]=k.useState(""),[E,T]=k.useState(""),[B,F]=k.useState("pm"),[R,U]=k.useState(!1),[D,L]=k.useState(null),[P,G]=k.useState(!1),Q=async O=>{if(!(!O||O==="S/R"||O.length<3))try{const z=await(await fetch(`${Ne}/check_duplicate_reference.php?reference=${O}`,{credentials:"include"})).json();z.duplicate?L(z):L(null)}catch(q){console.error("Error checking duplicate",q)}},H=O=>{const q=O.split(`
`),z=q.findIndex(le=>le.includes("Fecha	Hora	Referencia"));if(z===-1)return[];const re=q.slice(z+1).map(le=>{const ne=le.split("	");if(ne.length<10)return null;const[ae,ie,me,Z,Me,pe,he,ye,fe,Ue,qe]=ne,at=nt=>{if(!nt||nt.trim()===""||nt.trim()==="0")return 0;const Ct=nt.replace(/\./g,"").replace(",",".").trim();return parseFloat(Ct)};return{date:ae.trim(),time:ie.trim(),reference:me.trim(),cod:Z.trim(),type:Me.trim(),operation:pe.trim(),description:he.trim(),debit:Math.abs(at(ye)),credit:at(fe),balance:at(Ue),reference2:qe?qe.trim():""}}).filter(le=>le!==null&&le.date);return re.map((le,ne)=>{if(le.credit===0&&le.debit===0)return le;if(le.description.toUpperCase().includes("COMISIÓN")||le.description.toUpperCase().includes("COMISION")||le.operation.toUpperCase().includes("COMISIÓN"))return{...le,isCommission:!0};const ie=le.credit||le.debit,me=Number((ie*.015).toFixed(2)),Z=Number((ie*.003).toFixed(2)),Me=re.find((pe,he)=>{if(he===ne||!(pe.description.toUpperCase().includes("COMISIÓN")||pe.description.toUpperCase().includes("COMISION")||pe.operation.toUpperCase().includes("COMISIÓN"))||!(pe.reference===le.reference||le.reference.length>=8&&pe.reference.endsWith(le.reference.slice(-8))||pe.reference.length>=8&&le.reference.endsWith(pe.reference.slice(-8))))return!1;const Ue=pe.debit||pe.credit;return Math.abs(Ue-me)<.1||Math.abs(Ue-Z)<.1});return{...le,hasCommission:!!Me,commissionPair:Me}})},X=O=>{var J;const q=(J=O.target.files)==null?void 0:J[0];if(!q)return;d(!0);const z=new FileReader;z.onload=re=>{var ae;const le=(ae=re.target)==null?void 0:ae.result,ne=H(le);ne&&ne.length>0?l(ne):alert("No se detectaron movimientos válidos en el archivo BNC."),d(!1)},z.onerror=()=>{alert("Error al leer el archivo."),d(!1)},z.readAsText(q)},K=k.useMemo(()=>i.filter(O=>{const q=u.toUpperCase(),z=O.description.toUpperCase().includes(q)||O.reference.includes(q)||O.reference2.includes(q)||O.debit.toString().includes(q)||O.credit.toString().includes(q);let J=!0;return p==="INGRESOS"&&(J=O.credit>0&&!O.isCommission),p==="EGRESOS"&&(J=O.debit>0&&!O.isCommission),p==="COMISIONES"&&(J=O.isCommission===!0),z&&J}),[i,u,p]),ee=(O,q)=>{const z=O.split("/");if(z.length!==3)return 45;const J=`${z[2]}-${z[1]}-${z[0]}`,re=a.find(ae=>ae.date===J);if(re)return q==="parallel"&&re.parallelValue?Number(re.parallelValue):q==="am"&&re.amValue?Number(re.amValue):Number(re.pmValue)||Number(re.amValue);const ne=[...a].sort((ae,ie)=>ie.date.localeCompare(ae.date)).find(ae=>ae.date<J);return ne?q==="parallel"&&ne.parallelValue?Number(ne.parallelValue):q==="am"&&ne.amValue?Number(ne.amValue):Number(ne.pmValue)||Number(ne.amValue):45},W=async()=>{if(!(!b||!y||!_)){if(D&&!P){alert("ALERTA DE SEGURIDAD: Este código de transferencia ya ha sido utilizado. Verifique la información mostrada en el recuadro de alerta. Para proceder, debe marcar la casilla de autorización del programador/administrador.");return}U(!0);try{const O=ee(E||b.date,B),q=Number((b.credit/O).toFixed(2)),z=(E||b.date).split("/"),J=z.length===3?`${z[2]}-${z[1]}-${z[0]}`:E,re=await fetch(`${Ne}/register_payment.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:_,propertyId:y,amount:q,method:"Transferencia BNC",reference:b.reference,date:J,slot:B,amount_bs:b.credit,skip_commission:!b.hasCommission})});if(!re.ok){const le=await re.json();throw new Error(le.error||"Fallo crítico en motor de pagos")}alert(`¡VINCULACIÓN EXITOSA!
Inmueble acreditado con $${q} USD.`),v(null),await s()}catch(O){alert("Error al vincular: "+O.message)}finally{U(!1)}}},Y=k.useMemo(()=>[...t].sort((O,q)=>O.code.localeCompare(q.code,void 0,{numeric:!0})),[t]),M=k.useMemo(()=>{if(!_||!y)return null;const O=r.find(z=>z.id===_),q=O==null?void 0:O.debts.find(z=>z.propertyId===y);return q?{billed:Number(q.amountUsd),paid:Number(q.paidAmount),pending:Number(q.amountUsd)-Number(q.paidAmount)}:null},[_,y,r]);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-24 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-orange-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-orange-600 w-fit px-5 py-2 rounded-full border border-orange-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(br,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"BNC Intelligence Core v4.1"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Analizador ",n.jsx("br",{}),n.jsx("span",{className:"text-orange-500 italic",children:"Estados BNC"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Motor forense para estados de cuenta BNC en formato TXT. Detección de comisiones y vinculación automatizada."'})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsx("input",{type:"file",accept:".txt",ref:m,onChange:X,className:"hidden"}),n.jsx("div",{className:"w-20 h-20 bg-orange-50 text-orange-600 rounded-3xl flex items-center justify-center mb-8 border-2 border-orange-100",children:o?n.jsx(ct,{className:"animate-spin",size:40}):n.jsx(LA,{size:40})}),n.jsx("button",{onClick:()=>{var O;return(O=m.current)==null?void 0:O.click()},disabled:o,className:"w-full bg-orange-600 hover:bg-orange-700 text-white font-black py-5 rounded-2xl shadow-xl active:scale-95 transition-all text-xs uppercase tracking-widest",children:o?"PROCESANDO TXT...":"CARGAR ESTADO BNC"}),n.jsxs("p",{className:"text-[9px] font-black text-slate-400 uppercase mt-6 tracking-widest flex items-center gap-2",children:[n.jsx(jn,{size:12})," Formato TXT Tabulado BNC"]})]})]}),n.jsx(za,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),i.length>0&&n.jsxs("div",{className:"space-y-8 animate-in slide-in-from-bottom-6 duration-700",children:[n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por referencia, descripción o monto...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold outline-none focus:ring-2 focus:ring-orange-500",value:u,onChange:O=>f(O.target.value)})]}),n.jsx("div",{className:"flex gap-2 w-full lg:w-auto overflow-x-auto pb-2 lg:pb-0",children:["TODOS","INGRESOS","EGRESOS","COMISIONES"].map(O=>n.jsx("button",{onClick:()=>h(O),className:`px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all whitespace-nowrap ${p===O?"bg-slate-900 text-white shadow-lg":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:O},O))})]}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex justify-between items-center bg-slate-50/30",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"p-3 bg-orange-600 rounded-xl text-white shadow-lg",children:n.jsx(wl,{size:20})}),n.jsx("h3",{className:"text-xl font-black text-slate-800 tracking-tight uppercase",children:"Movimientos Detectados BNC"})]}),n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-white border rounded-xl hover:bg-slate-50 transition-all text-slate-400",children:n.jsx(wt,{size:20})})]}),n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha / Hora"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Descripción / Operación"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Bs."}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Acción"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100 font-mono",children:K.map((O,q)=>n.jsxs("tr",{className:`hover:bg-slate-50/50 transition-all group ${O.isCommission?"bg-slate-50/30 opacity-70":""}`,children:[n.jsxs("td",{className:"px-8 py-6",children:[n.jsx("p",{className:"text-[11px] font-black text-slate-700",children:O.date}),n.jsx("p",{className:"text-[9px] text-slate-400",children:O.time})]}),n.jsxs("td",{className:"px-8 py-6 text-center",children:[n.jsxs("span",{className:"text-[10px] font-black bg-slate-100 px-3 py-1 rounded-lg border border-slate-200 text-orange-600",children:["#",O.reference]}),O.reference2&&O.reference2!=="0"&&n.jsxs("p",{className:"text-[8px] text-slate-400 mt-1",children:["Ref2: ",O.reference2]})]}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("p",{className:"font-black text-slate-900 text-[11px] uppercase leading-tight",children:O.description}),O.hasCommission&&n.jsxs("div",{className:"flex items-center gap-1 px-2 py-0.5 bg-emerald-100 text-emerald-700 rounded-full border border-emerald-200",title:`Comisión detectada: Bs. ${O.commissionPair.debit}`,children:[n.jsx(bs,{size:8}),n.jsx("span",{className:"text-[7px] font-black uppercase",children:"Con Comisión"})]})]}),n.jsxs("span",{className:"text-[8px] font-bold text-slate-400 uppercase tracking-tighter mt-1",children:[O.operation," | ",O.type]})]})}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("span",{className:`text-sm font-black ${O.credit>0?"text-emerald-600":"text-rose-600"}`,children:[O.credit>0?"+":"-"," ",(O.credit||O.debit).toLocaleString("es-VE",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-8 py-6 text-center",children:O.credit>0&&!O.isCommission?n.jsx("button",{onClick:()=>{v(O),j(null),N(""),T(O.date),L(null),G(!1),Q(O.reference)},className:"p-3 bg-orange-50 text-orange-600 rounded-xl hover:bg-orange-600 hover:text-white transition-all shadow-sm active:scale-90",title:"Asignar a Propietario",children:n.jsx(qf,{size:16})}):n.jsx("div",{className:"w-10 mx-auto"})})]},q))})]})})]})]}),b&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[300] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-8 lg:p-12 w-full max-w-2xl shadow-2xl animate-in zoom-in-95 duration-300 relative overflow-y-auto max-h-[90vh] custom-scrollbar border-2 border-orange-100",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-14 h-14 bg-orange-600 rounded-2xl flex items-center justify-center text-white shadow-xl shadow-orange-100",children:n.jsx(tu,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase leading-none",children:"Asignación de Pago"}),n.jsxs("p",{className:"text-[10px] font-bold text-orange-600 uppercase tracking-widest mt-2",children:["BNC Ref: #",b.reference]})]})]}),n.jsx("button",{onClick:()=>v(null),className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(mt,{size:24})})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-100 space-y-4 shadow-inner",children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:"Fecha y Tasa Aplicada"}),n.jsxs("div",{className:"flex items-center gap-3 bg-white p-3 rounded-xl border border-slate-200",children:[n.jsx(Wr,{size:16,className:"text-orange-600"}),n.jsx("input",{type:"text",placeholder:"DD/MM/YYYY",className:"bg-transparent font-black text-slate-800 outline-none w-full text-xs",value:E,onChange:O=>T(O.target.value)})]}),n.jsxs("div",{className:"flex items-center gap-3 bg-white p-3 rounded-xl border border-slate-200",children:[n.jsx(Pc,{size:16,className:"text-indigo-600"}),n.jsxs("select",{className:"bg-transparent font-black text-slate-800 outline-none w-full text-[10px] uppercase tracking-widest",value:B,onChange:O=>F(O.target.value),children:[n.jsx("option",{value:"am",children:"Tasa AM (BCV)"}),n.jsx("option",{value:"pm",children:"Tasa PM (BCV)"}),n.jsx("option",{value:"parallel",children:"Tasa Paralelo"})]})]}),n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Tasa aplicada:"}),n.jsxs("span",{className:"text-xs font-black text-orange-600",children:[ee(E,B).toFixed(2)," Bs/$"]})]})]}),n.jsxs("div",{className:"bg-orange-600 p-6 rounded-[2rem] text-white shadow-lg flex flex-col justify-center text-center",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest opacity-60",children:"Equivalente USD"}),n.jsxs("h4",{className:"text-4xl font-black tracking-tighter mt-1",children:["$",(b.credit/ee(E,B)).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),n.jsxs("p",{className:"text-[8px] font-bold uppercase mt-2 opacity-50",children:["Monto Original: Bs. ",b.credit.toLocaleString("es-VE")]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 block",children:"1. Seleccionar Propiedad"}),n.jsxs("div",{className:"relative",children:[n.jsx(ea,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:18}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-4 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-orange-600 appearance-none text-xs",value:y||"",onChange:O=>j(Number(O.target.value)),children:[n.jsx("option",{value:"",children:"-- Buscar Inmueble --"}),Y.map(O=>n.jsxs("option",{value:O.id,children:[O.code," - ",O.type," ",O.number]},O.id))]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 block",children:"2. Mes a Pagar"}),n.jsxs("div",{className:"relative",children:[n.jsx(wl,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:18}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-4 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-orange-600 appearance-none text-xs",value:_,onChange:O=>N(O.target.value),children:[n.jsx("option",{value:"",children:"-- Seleccionar Mes --"}),r.map(O=>n.jsxs("option",{value:O.id,children:[new Intl.DateTimeFormat("es-ES",{month:"long"}).format(new Date(0,O.month)).toUpperCase()," ",O.year]},O.id))]})]})]})]}),M&&n.jsxs("div",{className:"bg-slate-900 rounded-[2rem] p-6 text-white animate-in slide-in-from-top-4",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-4 border-b border-white/10 pb-3",children:[n.jsx(Kr,{size:18,className:"text-orange-400"}),n.jsx("h4",{className:"text-xs font-black uppercase tracking-widest",children:"Estado de Cuenta en Sistema"})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-500 mb-1",children:"Total Facturado"}),n.jsxs("p",{className:"text-sm font-black",children:["$",M.billed.toFixed(2)]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-500 mb-1",children:"Pagado"}),n.jsxs("p",{className:"text-sm font-black text-emerald-400",children:["$",M.paid.toFixed(2)]})]}),n.jsxs("div",{className:"bg-white/10 rounded-xl p-2",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-orange-400 mb-1",children:"Pendiente"}),n.jsxs("p",{className:`text-sm font-black ${M.pending<=0?"text-emerald-400":"text-rose-400"}`,children:["$",M.pending.toFixed(2)]})]})]})]}),D&&n.jsxs("div",{className:"p-6 bg-rose-50 border-2 border-rose-200 rounded-[2rem] space-y-4 animate-in shake duration-500",children:[n.jsxs("div",{className:"flex items-center gap-3 text-rose-600",children:[n.jsx(Xr,{size:24}),n.jsx("h4",{className:"text-sm font-black uppercase tracking-widest",children:"Referencia Duplicada Detectada"})]}),n.jsx("p",{className:"text-[10px] text-rose-700 font-bold leading-relaxed",children:"Esta referencia ya existe en el sistema. Por favor, verifique si este pago ya fue procesado anteriormente para evitar duplicidad contable."}),D.matches&&D.matches.length>0&&n.jsx("div",{className:"bg-white/50 rounded-xl p-3 space-y-2",children:D.matches.map((O,q)=>n.jsxs("div",{className:"text-[9px] font-mono text-rose-900 flex justify-between border-b border-rose-100 pb-1 last:border-0",children:[n.jsx("span",{children:O.date}),n.jsxs("span",{className:"font-black",children:["Bs. ",Number(O.amount_bs||O.amount).toLocaleString()]}),n.jsx("span",{children:O.source_table})]},q))}),["admin","programmer"].includes(e.role)&&n.jsxs("label",{className:"flex items-center gap-3 p-3 bg-white rounded-xl border border-rose-200 cursor-pointer hover:bg-rose-100 transition-colors",children:[n.jsx("input",{type:"checkbox",checked:P,onChange:O=>G(O.target.checked),className:"w-5 h-5 rounded border-rose-300 text-rose-600 focus:ring-rose-500"}),n.jsx("span",{className:"text-[10px] font-black text-rose-900 uppercase tracking-tight",children:"Autorizar carga de referencia duplicada"})]})]}),n.jsxs("button",{disabled:R||!y||!_,onClick:W,className:"w-full bg-orange-600 hover:bg-orange-700 text-white py-6 rounded-[2.5rem] font-black text-xs uppercase tracking-[0.2em] shadow-2xl active:scale-95 transition-all flex items-center justify-center gap-3 disabled:opacity-50",children:[R?n.jsx(ct,{className:"animate-spin"}):n.jsx(Xi,{size:20}),R?"PROCESANDO...":"CONFIRMAR Y ACREDITAR"]}),n.jsxs("div",{className:"p-4 bg-orange-50 border border-orange-100 rounded-2xl flex items-start gap-4",children:[n.jsx(Ia,{className:"text-orange-500 shrink-0 mt-0.5",size:18}),n.jsxs("p",{className:"text-[10px] text-orange-800 font-bold uppercase leading-relaxed tracking-tight",children:["El sistema validará automáticamente la tasa del día ",E," para asegurar que el abono en USD coincida con el registro contable."]})]})]})]})})]})},sSe=({user:e})=>{const{properties:t,fees:r,exchangeRateHistory:a,refreshData:s}=ht(),[i,l]=k.useState(null),[o,d]=k.useState(!1),[u,f]=k.useState(""),[p,h]=k.useState("TODOS"),m=k.useRef(null),[b,v]=k.useState(null),[y,j]=k.useState(null),[_,N]=k.useState(""),[E,T]=k.useState(""),[B,F]=k.useState(!1),[R,U]=k.useState(!1),[D,L]=k.useState(null),[P,G]=k.useState(!1),Q=async M=>{if(!(!M||M==="S/R"||M.length<3))try{const q=await(await fetch(`${Ne}/check_duplicate_reference.php?reference=${M}`,{credentials:"include"})).json();q.duplicate?L(q):L(null)}catch(O){console.error("Error checking duplicate",O)}},H=M=>{var z;const O=(z=M.target.files)==null?void 0:z[0];if(!O)return;d(!0);const q=new FormData;q.append("file",O),fetch(`${Ne}/process_banplus_detailed.php`,{method:"POST",body:q,credentials:"include"}).then(J=>J.json()).then(J=>{J.success?l(J):alert(J.error||"Fallo en el protocolo de lectura.")}).catch(()=>alert("Error crítico en el Kernel de Auditoría.")).finally(()=>d(!1))},X=M=>{if(!M)return 45;const O=a.find(J=>J.date===M);if(O)return Number(O.pmValue)||Number(O.amValue);const z=[...a].sort((J,re)=>re.date.localeCompare(J.date)).find(J=>J.date<M);return z?Number(z.pmValue)||Number(z.amValue):45},K=async()=>{if(!(!b||!y||!_)){if(D&&!P){alert("ALERTA DE SEGURIDAD: Este código de transferencia ya ha sido utilizado. Verifique la información mostrada en el recuadro de alerta. Para proceder, debe marcar la casilla de autorización del programador/administrador.");return}U(!0);try{const M=X(E||b.date),O=Number((b.credit/M).toFixed(2)),q=await fetch(`${Ne}/register_payment.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:_,propertyId:y,amount:O,method:"Transferencia Bancaria",reference:b.ref,date:E||b.date,slot:"pm",amount_bs:b.credit,skip_commission:B})});if(!q.ok){const z=await q.json();throw new Error(z.error||"Fallo crítico en motor de pagos")}alert(`¡VINCULACIÓN EXITOSA!
Unidad acreditada satisfactoriamente.`),v(null),await s()}catch(M){alert("Error al vincular: "+M.message)}finally{U(!1)}}},ee=k.useMemo(()=>{if(!_||!y)return null;const M=r.find(q=>q.id===_),O=M==null?void 0:M.debts.find(q=>q.propertyId===y);return O?{billed:Number(O.amountUsd),paid:Number(O.paidAmount),pending:Number(O.amountUsd)-Number(O.paidAmount)}:null},[_,y,r]),W=k.useMemo(()=>[...t].sort((M,O)=>M.code.localeCompare(O.code,void 0,{numeric:!0})),[t]),Y=k.useMemo(()=>i?i.movements.filter(M=>{const O=(M.credit||M.debit).toString(),q=M.desc.includes(u.toUpperCase())||M.ref.includes(u)||O.includes(u),z=p==="TODOS"||M.category===p;return q&&z}):[],[i,u,p]);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-24 no-print",children:[n.jsx("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-blue-600",children:n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-blue-600 w-fit px-5 py-2 rounded-full border border-blue-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(Lc,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Protocolo Kernel V4.0.64 Online"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Analizador ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-500 italic",children:"Banplus Detallado"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Auditoría integrada: vinculación automática de pagos, detección de comisiones y monitor de deuda."'})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsx("input",{type:"file",accept:".csv",ref:m,onChange:H,className:"hidden"}),n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-3xl flex items-center justify-center mb-8 border-2 border-blue-100 shadow-inner",children:o?n.jsx(ct,{className:"animate-spin",size:40}):n.jsx(LA,{size:40})}),n.jsx("button",{onClick:()=>{var M;return(M=m.current)==null?void 0:M.click()},disabled:o,className:"w-full bg-blue-600 hover:bg-blue-700 text-white font-black py-5 rounded-2xl shadow-xl active:scale-95 transition-all text-xs uppercase tracking-widest",children:o?"HASHEANDO EXTRACTO...":"CARGAR CSV DETALLADO"})]})]})}),i&&n.jsxs("div",{className:"space-y-8 animate-in slide-in-from-bottom duration-700",children:[n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Filtrar por glosa, referencia o monto...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-blue-500",value:u,onChange:M=>f(M.target.value)})]}),n.jsx("div",{className:"flex gap-2 w-full lg:w-auto",children:["TODOS","INGRESOS_OPERATIVOS","COMISION_BANCARIA"].map(M=>n.jsx("button",{onClick:()=>h(M),className:`flex-1 lg:flex-none px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${p===M?"bg-slate-900 text-white shadow-lg":"bg-slate-50 text-slate-400"}`,children:M.replace("_"," ")},M))})]}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 bg-slate-50/30 flex justify-between items-center",children:[n.jsx("h3",{className:"text-xl font-black text-slate-800 tracking-tight uppercase",children:"Libro Maestro Banplus Online v4.0.64"}),n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-white border rounded-xl hover:bg-slate-50 transition-all text-slate-400",children:n.jsx(wt,{size:20})})]}),n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Descripción / Comisión"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Bs."}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Vincular"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100 font-mono",children:Y.map((M,O)=>n.jsxs("tr",{className:`hover:bg-slate-50 transition-all group ${M.hasMissingCommission?"border-l-4 border-amber-400 bg-amber-50/10":""}`,children:[n.jsx("td",{className:"px-10 py-6 text-[11px] font-black text-slate-500",children:M.date}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"text-[10px] font-black bg-slate-100 px-3 py-1 rounded-lg border border-slate-200 text-blue-600",children:["#",M.ref]})}),n.jsx("td",{className:"px-10 py-6",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-900 text-[11px] uppercase leading-tight truncate max-w-[280px]",children:M.desc}),n.jsxs("span",{className:"text-[8px] font-bold text-slate-400 uppercase tracking-tighter",children:["Canal: ",M.channel]})]}),M.hasMissingCommission&&n.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-0.5 bg-amber-100 text-amber-700 rounded-full border border-amber-200 shadow-sm",title:"No se detectó el par de comisión en este extracto",children:[n.jsx(Xr,{size:10}),n.jsx("span",{className:"text-[7px] font-black uppercase",children:"Sin Comisión"})]})]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("span",{className:`text-sm font-black ${M.type==="INGRESO"?"text-emerald-600":"text-rose-600"}`,children:[M.type==="INGRESO"?"+":"-"," ",(M.credit||M.debit).toLocaleString("es-VE",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:M.credit>0&&M.category==="INGRESOS_OPERATIVOS"?n.jsx("button",{onClick:()=>{v(M),j(null),N(""),T(M.date),F(M.hasMissingCommission||!1),L(null),G(!1),Q(M.ref)},className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm active:scale-90",children:n.jsx(qf,{size:16})}):n.jsx("div",{className:"w-10"})})]},O))})]})})]})]}),b&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[300] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-8 lg:p-12 w-full max-w-2xl shadow-2xl animate-in zoom-in-95 duration-300 relative overflow-y-auto max-h-[90vh] custom-scrollbar border-2 border-indigo-100",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-14 h-14 bg-indigo-600 rounded-2xl flex items-center justify-center text-white shadow-xl shadow-indigo-100",children:n.jsx(qf,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase leading-none",children:"Asignación Directa"}),n.jsxs("p",{className:"text-[10px] font-bold text-indigo-600 uppercase tracking-widest mt-2",children:["Voucher: #",b.ref]})]})]}),n.jsx("button",{onClick:()=>v(null),className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(mt,{size:24})})]}),n.jsxs("div",{className:"space-y-6",children:[b.hasMissingCommission&&n.jsxs("div",{className:"p-5 bg-amber-50 border border-amber-200 rounded-3xl flex items-start gap-4",children:[n.jsx(Xr,{className:"text-amber-600 shrink-0",size:24}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-black text-amber-800 uppercase tracking-tight",children:"Advertencia de Comisión"}),n.jsxs("p",{className:"text-[10px] text-amber-700 font-medium leading-relaxed",children:["El analizador no encontró comisión bancaria para esta referencia. El sistema sugiere ",n.jsx("b",{children:"no cargar"})," el gasto administrativo."]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-100 space-y-4 shadow-inner",children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest block",children:"Fecha Contable"}),n.jsxs("div",{className:"flex items-center gap-3 bg-white p-3 rounded-xl border border-slate-200",children:[n.jsx(Wr,{size:16,className:"text-blue-600"}),n.jsx("input",{type:"date",className:"bg-transparent font-black text-slate-800 outline-none w-full text-xs",value:E,onChange:M=>T(M.target.value)})]}),n.jsxs("div",{className:"flex justify-between items-center px-1",children:[n.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"Tasa aplicada:"}),n.jsxs("span",{className:"text-xs font-black text-blue-600",children:[X(E).toFixed(2)," Bs/$"]})]})]}),n.jsxs("div",{className:"bg-blue-600 p-6 rounded-[2rem] text-white shadow-lg flex flex-col justify-center text-center",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest opacity-60",children:"Abono Proyectado"}),n.jsxs("h4",{className:"text-4xl font-black tracking-tighter mt-1",children:["$",(b.credit/X(E)).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),n.jsxs("p",{className:"text-[8px] font-bold uppercase mt-2 opacity-50",children:["Bs. ",b.credit.toLocaleString("es-VE")]})]})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-100 flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:`p-2 rounded-lg ${B?"bg-amber-100 text-amber-600":"bg-blue-100 text-blue-600"}`,children:n.jsx(bs,{size:16})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-800 uppercase tracking-tight",children:"Comisión en Banco"}),n.jsx("p",{className:"text-[9px] text-slate-400 font-bold uppercase",children:B?"NO SE REGISTRARÁ GASTO":"CALCULAR 1.5% AUTOMÁTICAMENTE"})]})]}),n.jsx("button",{type:"button",onClick:()=>F(!B),className:`w-14 h-7 rounded-full transition-all relative ${B?"bg-slate-300":"bg-blue-600"}`,children:n.jsx("div",{className:`absolute top-1 w-5 h-5 bg-white rounded-full transition-all shadow-md ${B?"left-1":"left-8"}`})})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 block",children:"1. Unidad Inmobiliaria"}),n.jsxs("div",{className:"relative",children:[n.jsx(ea,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:18}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-4 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-600 appearance-none text-xs",value:y||"",onChange:M=>j(Number(M.target.value)),children:[n.jsx("option",{value:"",children:"-- Seleccionar --"}),W.map(M=>n.jsxs("option",{value:M.id,children:[M.code," - ",M.type," ",M.number]},M.id))]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 block",children:"2. Periodo"}),n.jsxs("div",{className:"relative",children:[n.jsx(wl,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-300",size:18}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl pl-12 pr-4 py-4 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-600 appearance-none text-xs",value:_,onChange:M=>N(M.target.value),children:[n.jsx("option",{value:"",children:"-- Seleccionar --"}),r.map(M=>n.jsxs("option",{value:M.id,children:[Te[M.month].toUpperCase()," ",M.year]},M.id))]})]})]})]}),ee&&n.jsxs("div",{className:"bg-slate-900 rounded-[2rem] p-6 text-white animate-in slide-in-from-top-4",children:[n.jsxs("div",{className:"flex items-center gap-3 mb-4 border-b border-white/10 pb-3",children:[n.jsx(Xr,{size:18,className:"text-amber-400"}),n.jsx("h4",{className:"text-xs font-black uppercase tracking-widest",children:"Monitor de Deuda"})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-500 mb-1",children:"Facturado"}),n.jsxs("p",{className:"text-sm font-black",children:["$",ee.billed.toFixed(2)]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-500 mb-1",children:"Abonado"}),n.jsxs("p",{className:"text-sm font-black text-emerald-400",children:["$",ee.paid.toFixed(2)]})]}),n.jsxs("div",{className:"bg-white/10 rounded-xl p-2",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-blue-400 mb-1",children:"Saldo Pendiente"}),n.jsxs("p",{className:`text-sm font-black ${ee.pending<=0?"text-emerald-400":"text-rose-400"}`,children:["$",ee.pending.toFixed(2)]})]})]})]}),D&&n.jsxs("div",{className:"p-6 bg-rose-50 border-2 border-rose-200 rounded-[2rem] space-y-4 animate-in shake duration-500",children:[n.jsxs("div",{className:"flex items-center gap-3 text-rose-600",children:[n.jsx(Xr,{size:24}),n.jsx("h4",{className:"text-sm font-black uppercase tracking-widest",children:"Referencia Duplicada Detectada"})]}),n.jsx("p",{className:"text-[10px] text-rose-700 font-bold leading-relaxed",children:"Esta referencia ya existe en el sistema. Por favor, verifique si este pago ya fue procesado anteriormente para evitar duplicidad contable."}),D.matches&&D.matches.length>0&&n.jsx("div",{className:"bg-white/50 rounded-xl p-3 space-y-2",children:D.matches.map((M,O)=>n.jsxs("div",{className:"text-[9px] font-mono text-rose-900 flex justify-between border-b border-rose-100 pb-1 last:border-0",children:[n.jsx("span",{children:M.date}),n.jsxs("span",{className:"font-black",children:["Bs. ",Number(M.amount_bs||M.amount).toLocaleString()]}),n.jsx("span",{children:M.source_table})]},O))}),["admin","programmer"].includes(e.role)&&n.jsxs("label",{className:"flex items-center gap-3 p-3 bg-white rounded-xl border border-rose-200 cursor-pointer hover:bg-rose-100 transition-colors",children:[n.jsx("input",{type:"checkbox",checked:P,onChange:M=>G(M.target.checked),className:"w-5 h-5 rounded border-rose-300 text-rose-600 focus:ring-rose-500"}),n.jsx("span",{className:"text-[10px] font-black text-rose-900 uppercase tracking-tight",children:"Autorizar carga de referencia duplicada"})]})]}),n.jsxs("button",{disabled:R||!y||!_,onClick:K,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white py-6 rounded-[2.5rem] font-black text-xs uppercase tracking-[0.2em] shadow-2xl active:scale-95 transition-all flex items-center justify-center gap-3 disabled:opacity-50",children:[R?n.jsx(ct,{className:"animate-spin"}):n.jsx(Xi,{size:20}),R?"SELLANDO LIBROS...":"CONFIRMAR VINCULACIÓN"]})]})]})})]})},iSe=({user:e})=>{const[t,r]=k.useState(null),[a,s]=k.useState(!1),[i,l]=k.useState(""),[o,d]=k.useState("TODOS"),u=k.useRef(null),[f,p]=k.useState(new Date().getMonth()+1),[h,m]=k.useState(new Date().getFullYear()),[b,v]=k.useState(null),y=T=>{s(!0);const B=new FormData;B.append("file",T),B.append("month",f.toString()),B.append("year",h.toString()),fetch(`${Ne}/process_bank_vs_bank.php`,{method:"POST",body:B,credentials:"include"}).then(F=>F.json()).then(F=>{F.success?r(F):alert(F.error||"Fallo en el protocolo de cruce.")}).catch(()=>alert("Error crítico en el motor de conciliación.")).finally(()=>s(!1))},j=T=>{var F;const B=(F=T.target.files)==null?void 0:F[0];B&&(v(B),y(B))},_=k.useMemo(()=>t?t.missing.filter(T=>{const B=T.desc.includes(i.toUpperCase())||T.ref.includes(i)||T.amount.toString().includes(i.replace(",",".")),F=o==="TODOS"||T.type===o;return B&&F}):[],[t,i,o]),N=[{v:1,n:"Enero"},{v:2,n:"Febrero"},{v:3,n:"Marzo"},{v:4,n:"Abril"},{v:5,n:"Mayo"},{v:6,n:"Junio"},{v:7,n:"Julio"},{v:8,n:"Agosto"},{v:9,n:"Septiembre"},{v:10,n:"Octubre"},{v:11,n:"Noviembre"},{v:12,n:"Diciembre"}],E=Array.from({length:5},(T,B)=>new Date().getFullYear()-2+B);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-24 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-indigo-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-indigo-600 w-fit px-5 py-2 rounded-full border border-indigo-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(jA,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Cotejo Inteligente SAC 2026"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Banco ",n.jsx("span",{className:"text-indigo-500 italic",children:"vs"})," Banco"]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Validación forense de rastro bancario. Detecta automáticamente operaciones procesadas por el banco pero omitidas en el sistema administrativo."'})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsxs("div",{className:"flex gap-4 mb-8 w-full",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mb-2 block ml-1",children:"Mes de Cruce"}),n.jsx("select",{value:f,onChange:T=>{const B=parseInt(T.target.value);if(p(B),b){const F=new FormData;F.append("file",b),F.append("month",B.toString()),F.append("year",h.toString()),s(!0),fetch(`${Ne}/process_bank_vs_bank.php`,{method:"POST",body:F,credentials:"include"}).then(R=>R.json()).then(R=>{R.success&&r(R)}).finally(()=>s(!1))}},className:"w-full bg-slate-50 border border-slate-100 rounded-xl px-4 py-3 text-xs font-black text-slate-700 outline-none focus:ring-2 focus:ring-indigo-500",children:N.map(T=>n.jsx("option",{value:T.v,children:T.n},T.v))})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mb-2 block ml-1",children:"Año"}),n.jsx("select",{value:h,onChange:T=>{const B=parseInt(T.target.value);if(m(B),b){const F=new FormData;F.append("file",b),F.append("month",f.toString()),F.append("year",B.toString()),s(!0),fetch(`${Ne}/process_bank_vs_bank.php`,{method:"POST",body:F,credentials:"include"}).then(R=>R.json()).then(R=>{R.success&&r(R)}).finally(()=>s(!1))}},className:"w-full bg-slate-50 border border-slate-100 rounded-xl px-4 py-3 text-xs font-black text-slate-700 outline-none focus:ring-2 focus:ring-indigo-500",children:E.map(T=>n.jsx("option",{value:T,children:T},T))})]})]}),n.jsx("input",{type:"file",accept:".csv",ref:u,onChange:j,className:"hidden"}),n.jsx("div",{className:"w-20 h-20 bg-indigo-50 text-indigo-600 rounded-3xl flex items-center justify-center mb-8 border-2 border-indigo-100 shadow-inner",children:a?n.jsx(ct,{className:"animate-spin",size:40}):n.jsx(jo,{size:40})}),n.jsx("button",{onClick:()=>{var T;return(T=u.current)==null?void 0:T.click()},disabled:a,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white font-black py-5 rounded-2xl shadow-xl active:scale-95 transition-all text-xs uppercase tracking-widest",children:a?"REALIZANDO CRUCE...":"SUBIR ESTADO PARA COTEJAR"}),n.jsxs("p",{className:"text-[9px] font-black text-slate-400 uppercase mt-6 tracking-widest flex items-center gap-2",children:[n.jsx(Ia,{size:12})," Auditoría de Integridad Bancaria"]})]})]}),n.jsx(za,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),t?n.jsxs("div",{className:"space-y-8 animate-in slide-in-from-bottom duration-700",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm text-center flex flex-col items-center justify-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-4",children:"Operaciones en Banco"}),n.jsx("h4",{className:"text-4xl font-black text-slate-900",children:t.summary.total_processed})]}),n.jsxs("div",{className:"bg-emerald-50 p-8 rounded-[3rem] border border-emerald-100 shadow-sm text-center flex flex-col items-center justify-center",children:[n.jsx("span",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest mb-4",children:"Coinciden con Sistema"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Gt,{className:"text-emerald-500",size:28}),n.jsx("h4",{className:"text-4xl font-black text-emerald-600",children:t.summary.matched})]})]}),n.jsxs("div",{className:"bg-rose-50 p-8 rounded-[3rem] border border-rose-100 shadow-sm text-center flex flex-col items-center justify-center animate-pulse-subtle",children:[n.jsx("span",{className:"text-[10px] font-black text-rose-600 uppercase tracking-widest mb-4",children:"OMISIONES DETECTADAS"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Xr,{className:"text-rose-500",size:28}),n.jsx("h4",{className:"text-4xl font-black text-rose-600",children:t.summary.unmatched})]})]})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar omisión por referencia o descripción...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-indigo-500",value:i,onChange:T=>l(T.target.value)})]}),n.jsxs("div",{className:"flex gap-2 w-full lg:w-auto",children:[n.jsx("button",{onClick:()=>d("TODOS"),className:`flex-1 lg:flex-none px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${o==="TODOS"?"bg-slate-900 text-white shadow-lg":"bg-slate-50 text-slate-400"}`,children:"Todos"}),n.jsx("button",{onClick:()=>d("INGRESO"),className:`flex-1 lg:flex-none px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${o==="INGRESO"?"bg-emerald-600 text-white shadow-lg":"bg-slate-50 text-slate-400"}`,children:"Ingresos"}),n.jsx("button",{onClick:()=>d("EGRESO"),className:`flex-1 lg:flex-none px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${o==="EGRESO"?"bg-rose-600 text-white shadow-lg":"bg-slate-50 text-slate-400"}`,children:"Egresos"})]})]}),n.jsxs("div",{className:"bg-white rounded-[4rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-10 border-b border-slate-100 flex flex-col md:flex-row justify-between items-center bg-slate-50/30 gap-6",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"p-4 bg-rose-600 rounded-2xl text-white shadow-lg",children:n.jsx(Lc,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tight uppercase leading-none",children:"Operaciones No Registradas"}),n.jsx("p",{className:"text-[10px] font-bold text-rose-500 uppercase tracking-widest mt-2",children:"Acciones pendientes de regularización contable"})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>{const T=["Fecha","Referencia","Descripción","Monto Banco","Monto Sistema","Diferencia"],B=_.map(F=>[F.date,F.ref,F.desc,`$${Number(F.amount).toFixed(2)}`,F.type]);$c("Conciliación Banco vs Banco",T,B)},className:"p-4 bg-white border border-slate-200 rounded-2xl text-slate-500 hover:bg-indigo-600 hover:text-white transition-all shadow-sm",title:"Exportar a HTML",children:n.jsx(yr,{size:24})}),n.jsx("button",{onClick:()=>window.print(),className:"p-4 bg-white border border-slate-200 rounded-2xl text-slate-500 hover:bg-indigo-600 hover:text-white transition-all shadow-sm",children:n.jsx(wt,{size:24})})]})]}),n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha Banco"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Concepto Bancario (Glosa)"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Nominal (Bs)"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Estatus"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100 font-mono",children:_.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-20 text-center text-slate-300 italic",children:"No se detectaron omisiones para estos filtros."})}):_.map((T,B)=>n.jsxs("tr",{className:"hover:bg-slate-50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6 text-slate-500 font-bold text-xs",children:T.date}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"bg-slate-100 text-slate-800 px-4 py-2 rounded-xl text-xs font-black border border-slate-200 shadow-sm",children:["#",T.ref]})}),n.jsx("td",{className:"px-10 py-6",children:n.jsx("p",{className:"font-black text-slate-700 text-[11px] uppercase leading-tight truncate max-w-[320px]",children:T.desc})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("span",{className:`text-sm font-black ${T.type==="INGRESO"?"text-emerald-600":"text-rose-600"}`,children:[T.type==="INGRESO"?"+":"-"," ",T.amount.toLocaleString("es-VE",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"px-3 py-1 bg-red-50 text-red-600 rounded-full text-[8px] font-black uppercase tracking-widest border border-red-100 flex items-center justify-center gap-1.5 w-fit mx-auto animate-pulse",children:[n.jsx(Kr,{size:10})," FALTANTE"]})})]},B))})]})}),n.jsxs("div",{className:"p-10 bg-slate-50 border-t border-slate-100 flex flex-col md:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex items-center gap-5 p-6 bg-white border border-slate-200 rounded-[2.5rem] shadow-sm",children:[n.jsx(vs,{className:"text-rose-600",size:32}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-black text-slate-900 uppercase tracking-widest",children:"Protocolo de Conciliación Activo"}),n.jsx("p",{className:"text-[9px] text-slate-400 font-bold uppercase italic",children:'Las omisiones detectadas deben ser regularizadas mediante "Registrar Movimiento" o "Reporte de Pago".'})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-[0.4em]",children:"Arquitectura SAC 2026"}),n.jsx("p",{className:"text-[10px] font-black text-indigo-600 uppercase",children:"TecnoMath Reconciliation Core"})]})]})]})]}):n.jsxs("div",{className:"py-32 text-center bg-white rounded-[4rem] border-2 border-dashed border-slate-200",children:[n.jsx("div",{className:"w-24 h-24 bg-slate-50 rounded-[2rem] flex items-center justify-center mx-auto mb-6 shadow-inner",children:n.jsx(er,{size:48,className:"text-slate-200"})}),n.jsx("h3",{className:"text-xl font-black text-slate-400 uppercase tracking-widest",children:"Protocolo de Conciliación Listo"}),n.jsx("p",{className:"text-slate-300 text-sm mt-2 font-medium",children:"Suba el CSV del banco para identificar operaciones faltantes en SAC 2026."})]}),n.jsx("style",{children:`
          @keyframes pulse-subtle {
              0%, 100% { transform: scale(1); }
              50% { transform: scale(1.02); }
          }
          .animate-pulse-subtle {
              animation: pulse-subtle 4s infinite ease-in-out;
          }
      `})]})},lSe=({user:e})=>{const[t,r]=k.useState(null),[a,s]=k.useState(!1),[i,l]=k.useState(""),[o,d]=k.useState("TODOS"),u=k.useRef(null),[f,p]=k.useState(new Date().getMonth()+1),[h,m]=k.useState(new Date().getFullYear()),b=E=>{const T=E.split(`
`),B=T.findIndex(R=>R.includes("Fecha	Hora	Referencia"));return B===-1?[]:T.slice(B+1).map(R=>{const U=R.split("	");if(U.length<10)return null;const[D,L,P,G,Q,H,X,K,ee,W,Y]=U,M=O=>{if(!O||O.trim()===""||O.trim()==="0")return 0;const q=O.replace(/\./g,"").replace(",",".").trim();return parseFloat(q)};return{date:D.trim(),reference:P.trim(),description:X.trim(),amount:M(ee)||-Math.abs(M(K)),type:M(ee)>0?"INGRESO":"EGRESO"}}).filter(R=>R!==null&&R.date)},v=async E=>{s(!0);try{const T=await E.text(),B=b(T),R=await(await fetch(`${Ne}/get_system_bank_movements.php?month=${f}&year=${h}`,{credentials:"include"})).json();if(!R.success)throw new Error(R.error);const U=R.movements,D=[];let L=0;B.forEach(P=>{if(P.amount===0)return;U.find(Q=>Q.reference===P.reference||P.reference.length>=8&&Q.reference.endsWith(P.reference.slice(-8))||Q.reference.length>=8&&P.reference.endsWith(Q.reference.slice(-8)))?L++:D.push({date:P.date,ref:P.reference,desc:P.description,amount:Math.abs(P.amount),type:P.type})}),r({summary:{total_processed:B.filter(P=>P.amount!==0).length,matched:L,unmatched:D.length},missing:D})}catch(T){alert("Error en el cruce de datos: "+T.message)}finally{s(!1)}},y=E=>{var B;const T=(B=E.target.files)==null?void 0:B[0];T&&v(T)},j=k.useMemo(()=>t?t.missing.filter(E=>{const T=E.desc.toUpperCase().includes(i.toUpperCase())||E.ref.includes(i)||E.amount.toString().includes(i.replace(",",".")),B=o==="TODOS"||E.type===o;return T&&B}):[],[t,i,o]),_=[{v:1,n:"Enero"},{v:2,n:"Febrero"},{v:3,n:"Marzo"},{v:4,n:"Abril"},{v:5,n:"Mayo"},{v:6,n:"Junio"},{v:7,n:"Julio"},{v:8,n:"Agosto"},{v:9,n:"Septiembre"},{v:10,n:"Octubre"},{v:11,n:"Noviembre"},{v:12,n:"Diciembre"}],N=Array.from({length:5},(E,T)=>new Date().getFullYear()-2+T);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-24 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-orange-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-orange-600 w-fit px-5 py-2 rounded-full border border-orange-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(jA,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Cotejo BNC SAC 2026"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Banco ",n.jsx("span",{className:"text-orange-500 italic",children:"vs"})," Banco BNC"]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Validación forense de rastro bancario BNC. Cruce automático de referencias de 8 dígitos y montos nominales."'})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsxs("div",{className:"flex gap-4 mb-8 w-full",children:[n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mb-2 block ml-1",children:"Mes de Cruce"}),n.jsx("select",{value:f,onChange:E=>p(parseInt(E.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl px-4 py-3 text-xs font-black text-slate-700 outline-none focus:ring-2 focus:ring-orange-500",children:_.map(E=>n.jsx("option",{value:E.v,children:E.n},E.v))})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("label",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mb-2 block ml-1",children:"Año"}),n.jsx("select",{value:h,onChange:E=>m(parseInt(E.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl px-4 py-3 text-xs font-black text-slate-700 outline-none focus:ring-2 focus:ring-orange-500",children:N.map(E=>n.jsx("option",{value:E,children:E},E))})]})]}),n.jsx("input",{type:"file",accept:".txt",ref:u,onChange:y,className:"hidden"}),n.jsx("div",{className:"w-20 h-20 bg-orange-50 text-orange-600 rounded-3xl flex items-center justify-center mb-8 border-2 border-orange-100 shadow-inner",children:a?n.jsx(ct,{className:"animate-spin",size:40}):n.jsx(jo,{size:40})}),n.jsx("button",{onClick:()=>{var E;return(E=u.current)==null?void 0:E.click()},disabled:a,className:"w-full bg-orange-600 hover:bg-orange-700 text-white font-black py-5 rounded-2xl shadow-xl active:scale-95 transition-all text-xs uppercase tracking-widest",children:a?"REALIZANDO CRUCE...":"SUBIR TXT BNC"}),n.jsxs("p",{className:"text-[9px] font-black text-slate-400 uppercase mt-6 tracking-widest flex items-center gap-2",children:[n.jsx(Ia,{size:12})," Auditoría de Integridad BNC"]})]})]}),n.jsx(za,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),t?n.jsxs("div",{className:"space-y-8 animate-in slide-in-from-bottom duration-700",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm text-center flex flex-col items-center justify-center",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-4",children:"Operaciones en BNC"}),n.jsx("h4",{className:"text-4xl font-black text-slate-900",children:t.summary.total_processed})]}),n.jsxs("div",{className:"bg-emerald-50 p-8 rounded-[3rem] border border-emerald-100 shadow-sm text-center flex flex-col items-center justify-center",children:[n.jsx("span",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest mb-4",children:"Coinciden con Sistema"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Gt,{className:"text-emerald-500",size:28}),n.jsx("h4",{className:"text-4xl font-black text-emerald-600",children:t.summary.matched})]})]}),n.jsxs("div",{className:"bg-orange-50 p-8 rounded-[3rem] border border-orange-100 shadow-sm text-center flex flex-col items-center justify-center",children:[n.jsx("span",{className:"text-[10px] font-black text-orange-600 uppercase tracking-widest mb-4",children:"OMISIONES DETECTADAS"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Xr,{className:"text-orange-500",size:28}),n.jsx("h4",{className:"text-4xl font-black text-orange-600",children:t.summary.unmatched})]})]})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar omisión por referencia o descripción...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold outline-none focus:ring-2 focus:ring-orange-500",value:i,onChange:E=>l(E.target.value)})]}),n.jsxs("div",{className:"flex gap-2 w-full lg:w-auto",children:[n.jsx("button",{onClick:()=>d("TODOS"),className:`flex-1 lg:flex-none px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${o==="TODOS"?"bg-slate-900 text-white shadow-lg":"bg-slate-50 text-slate-400"}`,children:"Todos"}),n.jsx("button",{onClick:()=>d("INGRESO"),className:`flex-1 lg:flex-none px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${o==="INGRESO"?"bg-emerald-600 text-white shadow-lg":"bg-slate-50 text-slate-400"}`,children:"Ingresos"}),n.jsx("button",{onClick:()=>d("EGRESO"),className:`flex-1 lg:flex-none px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${o==="EGRESO"?"bg-orange-600 text-white shadow-lg":"bg-slate-50 text-slate-400"}`,children:"Egresos"})]})]}),n.jsxs("div",{className:"bg-white rounded-[4rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-10 border-b border-slate-100 flex flex-col md:flex-row justify-between items-center bg-slate-50/30 gap-6",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"p-4 bg-orange-600 rounded-2xl text-white shadow-lg",children:n.jsx(Lc,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tight uppercase leading-none",children:"Operaciones No Registradas (BNC)"}),n.jsx("p",{className:"text-[10px] font-bold text-orange-500 uppercase tracking-widest mt-2",children:"Acciones pendientes de regularización contable"})]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>{const E=["Fecha","Referencia","Descripción","Monto Banco","Monto Sistema","Diferencia"],T=j.map(B=>[B.date,B.ref,B.desc,`$${Number(B.amount).toFixed(2)}`,B.type]);$c("Conciliación Banco vs Banco BNC",E,T)},className:"p-4 bg-white border border-slate-200 rounded-2xl text-slate-500 hover:bg-orange-600 hover:text-white transition-all shadow-sm",title:"Exportar a HTML",children:n.jsx(yr,{size:24})}),n.jsx("button",{onClick:()=>window.print(),className:"p-4 bg-white border border-slate-200 rounded-2xl text-slate-500 hover:bg-orange-600 hover:text-white transition-all shadow-sm",children:n.jsx(wt,{size:24})})]})]}),n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha Banco"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Concepto Bancario (Glosa)"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Nominal (Bs)"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Estatus"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100 font-mono",children:j.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-20 text-center text-slate-300 italic",children:"No se detectaron omisiones para estos filtros."})}):j.map((E,T)=>n.jsxs("tr",{className:"hover:bg-slate-50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6 text-slate-500 font-bold text-xs",children:E.date}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"bg-slate-100 text-slate-800 px-4 py-2 rounded-xl text-xs font-black border border-slate-200 shadow-sm",children:["#",E.ref]})}),n.jsx("td",{className:"px-10 py-6",children:n.jsx("p",{className:"font-black text-slate-700 text-[11px] uppercase leading-tight truncate max-w-[320px]",children:E.desc})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("span",{className:`text-sm font-black ${E.type==="INGRESO"?"text-emerald-600":"text-orange-600"}`,children:[E.type==="INGRESO"?"+":"-"," ",E.amount.toLocaleString("es-VE",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"px-3 py-1 bg-red-50 text-red-600 rounded-full text-[8px] font-black uppercase tracking-widest border border-red-100 flex items-center justify-center gap-1.5 w-fit mx-auto animate-pulse",children:[n.jsx(Kr,{size:10})," FALTANTE"]})})]},T))})]})}),n.jsxs("div",{className:"p-10 bg-slate-50 border-t border-slate-100 flex flex-col md:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex items-center gap-5 p-6 bg-white border border-slate-200 rounded-[2.5rem] shadow-sm",children:[n.jsx(vs,{className:"text-orange-600",size:32}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-black text-slate-900 uppercase tracking-widest",children:"Protocolo de Conciliación BNC"}),n.jsx("p",{className:"text-[9px] text-slate-400 font-bold uppercase italic",children:'Las omisiones detectadas deben ser regularizadas mediante "Registrar Movimiento" o "Reporte de Pago".'})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-[0.4em]",children:"Arquitectura SAC 2026"}),n.jsx("p",{className:"text-[10px] font-black text-orange-600 uppercase",children:"TecnoMath Reconciliation Core BNC"})]})]})]})]}):n.jsxs("div",{className:"py-32 text-center bg-white rounded-[4rem] border-2 border-dashed border-slate-200",children:[n.jsx("div",{className:"w-24 h-24 bg-slate-50 rounded-[2rem] flex items-center justify-center mx-auto mb-6 shadow-inner",children:n.jsx(er,{size:48,className:"text-slate-200"})}),n.jsx("h3",{className:"text-xl font-black text-slate-400 uppercase tracking-widest",children:"Protocolo de Conciliación Listo"}),n.jsx("p",{className:"text-slate-300 text-sm mt-2 font-medium",children:"Suba el TXT del BNC para identificar operaciones faltantes en SAC 2026."})]})]})},oSe=({user:e})=>{const[t,r]=k.useState(null),[a,s]=k.useState(!0),[i,l]=k.useState(""),[o,d]=k.useState(""),[u,f]=k.useState(!1),[p,h]=k.useState({amount:"",currency:"USD",reference:"",date:Dr(),months:"1"}),m=async()=>{s(!0);try{const y=await(await fetch(`${Ne}/get_license_status.php`)).json();r(y),l(y.expiration_date),d(y.monthly_rate)}catch(v){console.error(v)}finally{s(!1)}};k.useEffect(()=>{m()},[]);const b=async(v,y)=>{if(confirm(`¿Ejecutar acción: ${v.toUpperCase()}?`)){f(!0);try{(await fetch(`${Ne}/update_license.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:v,...y})})).ok&&(alert("Motor de Licencias Actualizado."),m(),v==="add_payment"&&h({amount:"",currency:"USD",reference:"",date:Dr(),months:"1"}))}catch{alert("Error de conexión")}finally{f(!1)}}};return e.role!=="programmer"?n.jsxs("div",{className:"p-10 text-center",children:[n.jsx(vs,{size:64,className:"text-red-500 mx-auto mb-6"}),n.jsx("h2",{className:"text-2xl font-black text-slate-800",children:"ACCESO RESTRINGIDO AL NÚCLEO"}),n.jsx("p",{className:"text-slate-400 mt-2",children:"Esta sección es de uso exclusivo del Arquitecto de Sistemas de TecnoMath."})]}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"bg-slate-900 p-10 lg:p-14 rounded-[4rem] text-white relative overflow-hidden shadow-2xl border-b-8 border-blue-600",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-blue-500/20 w-fit px-4 py-1.5 rounded-full border border-blue-500/30 flex items-center gap-2 mb-6",children:[n.jsx(Od,{size:16,className:"text-blue-400"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-blue-400",children:"Master License Control (SaaS)"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black tracking-tighter leading-none",children:["Gestión de ",n.jsx("span",{className:"text-blue-500 italic",children:"Suscripción"})]}),n.jsx("p",{className:"text-slate-400 mt-4 text-lg font-medium italic",children:"Control de accesos y recaudación de renta TecnoMath."})]}),n.jsx(Ak,{size:200,className:"absolute right-[-40px] top-[-40px] text-white/5 pointer-events-none"})]}),n.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-8",children:[n.jsx("div",{className:"xl:col-span-2 space-y-8",children:n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm space-y-8",children:[n.jsxs("div",{className:"flex justify-between items-start",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-800 tracking-tight",children:"Estatus del Arrendatario"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase text-[10px] tracking-widest",children:(t==null?void 0:t.customer)||"Cargando..."})]}),n.jsx("div",{className:`px-6 py-2 rounded-full font-black text-xs uppercase tracking-widest ${(t==null?void 0:t.status)==="active"?"bg-emerald-50 text-emerald-600 border border-emerald-100":"bg-red-50 text-red-600 border border-red-100 animate-pulse"}`,children:(t==null?void 0:t.status)==="active"?"SISTEMA OPERATIVO":"SISTEMA BLOQUEADO"})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:[n.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-2",children:"Próxima Expiración"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Wr,{className:"text-blue-600",size:24}),n.jsx("span",{className:"text-2xl font-black text-slate-800",children:t==null?void 0:t.expiration_date})]})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:[n.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-2",children:"Canon Mensual Actual"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(kn,{className:"text-emerald-600",size:24}),n.jsxs("span",{className:"text-2xl font-black text-slate-800",children:["$",parseFloat((t==null?void 0:t.monthly_rate)||0).toFixed(2)]})]})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:[n.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest block mb-2",children:"Recaudación Total"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Ki,{className:"text-blue-500",size:24}),n.jsxs("span",{className:"text-2xl font-black text-slate-800",children:["$",parseFloat((t==null?void 0:t.total_paid)||0).toFixed(2)]})]})]})]}),n.jsxs("div",{className:"bg-amber-50 p-8 rounded-[2.5rem] border border-amber-100 space-y-6",children:[n.jsx("div",{className:"flex justify-between items-center",children:n.jsxs("h4",{className:"font-black text-amber-800 uppercase text-xs tracking-widest flex items-center gap-2",children:[n.jsx(PA,{size:18})," Ajuste de Tarifa SaaS"]})}),n.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-end",children:[n.jsxs("div",{className:"flex-1 w-full",children:[n.jsx("label",{className:"text-[9px] font-black text-amber-600 uppercase ml-1 block mb-1",children:"Monto de Renta Mensual (USD)"}),n.jsxs("div",{className:"relative",children:[n.jsx(kn,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-amber-400",size:18}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-white border border-amber-200 rounded-xl pl-12 pr-4 py-3 font-black text-slate-800 outline-none focus:ring-2 focus:ring-amber-500",value:o,onChange:v=>d(v.target.value),placeholder:"0.00"})]})]}),n.jsxs("button",{disabled:u||!o,onClick:()=>b("update_rate",{rate:parseFloat(o)}),className:"w-full md:w-auto bg-amber-600 hover:bg-amber-700 text-white px-8 py-3.5 rounded-xl font-black text-xs uppercase tracking-widest shadow-lg active:scale-95 transition-all flex items-center justify-center gap-2",children:[u?n.jsx(ct,{className:"animate-spin",size:14}):n.jsx(Zn,{size:14})," ACTUALIZAR CANON"]})]})]}),n.jsxs("div",{className:"bg-blue-50 p-8 rounded-[2.5rem] border border-blue-100 space-y-6",children:[n.jsxs("h4",{className:"font-black text-blue-800 uppercase text-xs tracking-widest flex items-center gap-2",children:[n.jsx(Fp,{size:18})," Registrar Pago de Renta"]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black text-blue-400 uppercase ml-1 block mb-1",children:"Monto Pagado"}),n.jsx("input",{type:"number",step:"0.01",className:"w-full bg-white border border-blue-200 rounded-xl px-4 py-3 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-500",value:p.amount,onChange:v=>h({...p,amount:v.target.value}),placeholder:"0.00"})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black text-blue-400 uppercase ml-1 block mb-1",children:"Moneda"}),n.jsxs("select",{className:"w-full bg-white border border-blue-200 rounded-xl px-4 py-3 font-black text-slate-800 outline-none",value:p.currency,onChange:v=>h({...p,currency:v.target.value}),children:[n.jsx("option",{value:"USD",children:"Dólares (USD)"}),n.jsx("option",{value:"VES",children:"Bolívares (VES)"})]})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black text-blue-400 uppercase ml-1 block mb-1",children:"Meses a Extender"}),n.jsx("select",{className:"w-full bg-white border border-blue-200 rounded-xl px-4 py-3 font-black text-slate-800 outline-none",value:p.months,onChange:v=>h({...p,months:v.target.value}),children:[1,2,3,4,5,6,12].map(v=>n.jsxs("option",{value:v,children:[v," Mes",v>1?"es":""]},v))})]}),n.jsxs("div",{className:"md:col-span-2",children:[n.jsx("label",{className:"text-[9px] font-black text-blue-400 uppercase ml-1 block mb-1",children:"Referencia / Observación"}),n.jsx("input",{className:"w-full bg-white border border-blue-200 rounded-xl px-4 py-3 font-black text-slate-800 outline-none focus:ring-2 focus:ring-blue-500 uppercase",value:p.reference,onChange:v=>h({...p,reference:v.target.value}),placeholder:"VOUCHER - BANCO - CASH"})]}),n.jsx("div",{className:"flex items-end",children:n.jsxs("button",{disabled:u||!p.amount||!p.reference,onClick:()=>b("add_payment",{amount:parseFloat(p.amount),currency:p.currency,reference:p.reference,payment_date:p.date,months_extended:parseInt(p.months)}),className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-3.5 rounded-xl font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-200 flex items-center justify-center gap-2 active:scale-95 disabled:opacity-50",children:[u?n.jsx(ct,{className:"animate-spin",size:14}):n.jsx(En,{size:14})," REGISTRAR Y EXTENDER"]})})]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("h4",{className:"font-black text-slate-800 uppercase text-xs tracking-widest flex items-center gap-2 px-1",children:[n.jsx(Da,{size:18,className:"text-blue-600"})," Historial de Cobranza TecnoMath"]}),n.jsx("div",{className:"bg-slate-50 rounded-3xl border border-slate-100 overflow-hidden",children:n.jsxs("table",{className:"w-full text-left text-sm",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-100 border-b border-slate-200",children:[n.jsx("th",{className:"px-6 py-4 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha"}),n.jsx("th",{className:"px-6 py-4 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Referencia"}),n.jsx("th",{className:"px-6 py-4 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Extensión"}),n.jsx("th",{className:"px-6 py-4 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-200",children:((t==null?void 0:t.payment_history)||[]).length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:4,className:"px-6 py-10 text-center text-slate-400 italic",children:"No hay registros de renta aún."})}):t.payment_history.map(v=>n.jsxs("tr",{className:"hover:bg-white transition-colors group",children:[n.jsx("td",{className:"px-6 py-4 font-bold text-slate-600",children:v.payment_date}),n.jsx("td",{className:"px-6 py-4",children:n.jsx("span",{className:"font-black text-slate-800 uppercase text-xs",children:v.reference})}),n.jsx("td",{className:"px-6 py-4 text-center",children:n.jsxs("span",{className:"bg-blue-50 text-blue-600 px-3 py-1 rounded-lg text-[10px] font-black uppercase border border-blue-100",children:["+",v.months_extended," M"]})}),n.jsxs("td",{className:"px-6 py-4 text-right font-black text-emerald-600",children:[v.currency==="USD"?"$":"Bs."," ",parseFloat(v.amount).toFixed(2)]})]},v.id))})]})})]})]})}),n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm flex flex-col items-center justify-center text-center space-y-8",children:[n.jsx("div",{className:`w-24 h-24 rounded-[2rem] flex items-center justify-center shadow-2xl transition-all duration-500 ${t!=null&&t.is_manual_block?"bg-red-600 text-white scale-110 shadow-red-200":"bg-slate-100 text-slate-400"}`,children:t!=null&&t.is_manual_block?n.jsx(Od,{size:48}):n.jsx(TM,{size:48})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black text-slate-800 tracking-tight",children:"Manual Kill-Switch"}),n.jsx("p",{className:"text-slate-400 text-sm mt-2 font-medium leading-relaxed",children:"Bloqueo inmediato de la interfaz por incumplimiento administrativo grave."})]}),t!=null&&t.is_manual_block?n.jsx("button",{onClick:()=>b("unblock"),className:"w-full bg-emerald-600 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest active:scale-95 transition-all shadow-xl shadow-emerald-100",children:"DESBLOQUEAR NÚCLEO"}):n.jsx("button",{onClick:()=>b("block"),className:"w-full bg-slate-900 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest active:scale-95 transition-all shadow-xl shadow-slate-300",children:"BLOQUEAR SISTEMA"}),n.jsxs("div",{className:"flex items-center gap-2 p-4 bg-blue-50 border border-blue-100 rounded-2xl w-full",children:[n.jsx(Ia,{size:20,className:"text-blue-500 shrink-0"}),n.jsx("p",{className:"text-[9px] text-blue-800 font-bold uppercase text-left leading-tight",children:"TecnoMath SaaS Protocol. El bloqueo manual ignora la fecha de expiración cronológica."})]})]}),n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm space-y-6",children:[n.jsxs("h4",{className:"font-black text-slate-800 uppercase text-xs tracking-widest flex items-center gap-2",children:[n.jsx(Kr,{className:"text-amber-500",size:16})," Override de Fecha"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("input",{type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 outline-none focus:ring-2 focus:ring-blue-500",value:i,onChange:v=>l(v.target.value)}),n.jsx("button",{onClick:()=>b("extend",{new_date:i}),disabled:u,className:"w-full bg-slate-100 hover:bg-slate-200 text-slate-600 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all",children:"ACTUALIZAR EXPIRACIÓN SIN PAGO"})]})]})]})]})]})},cSe=({user:e})=>{const[t,r]=k.useState(!1),[a,s]=k.useState(null),i=k.useRef(null),l=d=>{var p;const u=(p=d.target.files)==null?void 0:p[0];if(!u)return;r(!0);const f=new FileReader;f.onload=async h=>{var m;try{const b=(m=h.target)==null?void 0:m.result,v=o(b);if(v.length===0)throw new Error("El archivo está vacío.");const j=await(await fetch(`${Ne}/bulk_load_properties.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rows:v})})).json();s(j)}catch(b){alert("Error: "+b.message)}finally{r(!1),i.current&&(i.current.value="")}},f.readAsText(u)},o=d=>{const u=d.split(/\r?\n/);if(u.length<2)return[];const f=u[0].toLowerCase().split(",").map(h=>h.trim().replace(/"/g,"")),p=[];for(let h=1;h<u.length;h++){if(!u[h].trim())continue;const m=u[h].split(",").map(v=>v.trim().replace(/"/g,"")),b={};f.forEach((v,y)=>{b[v]=m[y]}),p.push(b)}return p};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsx("div",{className:"bg-white p-10 lg:p-14 rounded-[4rem] border border-slate-200 shadow-sm relative overflow-hidden",children:n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-10",children:[n.jsxs("div",{className:"flex-1 space-y-4",children:[n.jsxs("div",{className:"bg-emerald-50 w-fit px-4 py-1.5 rounded-full border border-emerald-100 flex items-center gap-2",children:[n.jsx(gl,{size:14,className:"text-emerald-600"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-emerald-600",children:"Nuclear Data Import"})]}),n.jsxs("h1",{className:"text-4xl font-black text-slate-900 tracking-tighter",children:["Carga Excel ",n.jsx("span",{className:"text-emerald-600 italic",children:"Propiedades"})]}),n.jsx("p",{className:"text-slate-500 font-medium max-w-lg",children:"Sincronización masiva de unidades, alícuotas y saldos migrados."})]}),n.jsxs("div",{className:"bg-slate-50 p-10 rounded-[3rem] border border-slate-200 flex flex-col items-center w-full lg:w-80 text-center",children:[n.jsx("div",{className:"w-16 h-16 bg-white rounded-2xl flex items-center justify-center shadow-sm mb-6",children:n.jsx(LA,{size:32,className:t?"animate-bounce text-emerald-500":"text-slate-300"})}),n.jsx("input",{type:"file",accept:".csv",className:"hidden",ref:i,onChange:l}),n.jsx("button",{disabled:t,onClick:()=>{var d;return(d=i.current)==null?void 0:d.click()},className:"w-full bg-slate-900 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl active:scale-95 transition-all disabled:opacity-50",children:t?"PROCESANDO...":"CARGAR CSV PROPIEDADES"})]})]})}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("h3",{className:"text-xl font-black text-slate-800 mb-8 flex items-center gap-3",children:[n.jsx(wl,{className:"text-blue-600"})," Guía de Estructura Excel"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-xs text-slate-500 font-medium leading-relaxed italic",children:"Columnas requeridas en minúsculas (Fila 1):"}),n.jsx("div",{className:"bg-slate-50 rounded-3xl p-6 border border-slate-100 overflow-x-auto",children:n.jsxs("table",{className:"w-full text-[10px] font-black uppercase text-slate-500 tracking-tighter",children:[n.jsx("thead",{className:"border-b border-slate-200",children:n.jsxs("tr",{children:[n.jsx("th",{className:"py-2 text-left pr-4",children:"Columna"}),n.jsx("th",{className:"py-2 text-left",children:"Ejemplo"})]})}),n.jsxs("tbody",{className:"divide-y divide-slate-100",children:[n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"codigo"}),n.jsx("td",{children:"PH-101"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"tipo"}),n.jsx("td",{children:"Casa / Apartamento"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"numero"}),n.jsx("td",{children:"101"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"alicuota"}),n.jsx("td",{children:"1.2500"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"es_gnc"}),n.jsx("td",{children:"1 (Sí) / 0 (No)"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"deuda_inicial"}),n.jsx("td",{children:"0.00"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"saldo_favor"}),n.jsx("td",{children:"0.00"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600",children:"estatus"}),n.jsx("td",{children:"Ocupada / Vacía"})]})]})]})}),n.jsxs("div",{className:"p-4 bg-blue-50 border border-blue-100 rounded-2xl flex items-start gap-3",children:[n.jsx(jn,{size:16,className:"text-blue-600 shrink-0 mt-0.5"}),n.jsx("p",{className:"text-[10px] text-blue-800 font-bold uppercase leading-tight",children:"Al terminar el Excel, seleccione: 'Guardar como' -> 'CSV (delimitado por comas)'."})]})]})]}),n.jsx("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm flex flex-col justify-center items-center text-center",children:a?n.jsxs("div",{className:"animate-in zoom-in duration-300 space-y-6",children:[n.jsx("div",{className:"w-20 h-20 bg-emerald-50 text-emerald-600 rounded-full flex items-center justify-center mx-auto shadow-inner",children:n.jsx(Xi,{size:40})}),n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Sincronización Exitosa"}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Nuevos"}),n.jsx("p",{className:"text-3xl font-black text-emerald-600",children:a.inserted})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Actualizados"}),n.jsx("p",{className:"text-3xl font-black text-blue-600",children:a.updated})]})]})]}):n.jsxs("div",{className:"opacity-20 flex flex-col items-center",children:[n.jsx(ct,{size:80,className:"mb-6"}),n.jsx("p",{className:"font-black text-sm uppercase tracking-widest",children:"Esperando archivo..."})]})})]})]})},dSe=({user:e})=>{const[t,r]=k.useState(!1),[a,s]=k.useState(null),i=k.useRef(null),l=d=>{var p;const u=(p=d.target.files)==null?void 0:p[0];if(!u)return;r(!0);const f=new FileReader;f.onload=async h=>{var m;try{const b=(m=h.target)==null?void 0:m.result,v=o(b);if(v.length===0)throw new Error("Archivo inválido.");const j=await(await fetch(`${Ne}/bulk_load_users.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rows:v})})).json();s(j)}catch(b){alert("Error: "+b.message)}finally{r(!1),i.current&&(i.current.value="")}},f.readAsText(u)},o=d=>{const u=d.split(/\r?\n/);if(u.length<2)return[];const f=u[0].toLowerCase().split(",").map(h=>h.trim().replace(/"/g,"")),p=[];for(let h=1;h<u.length;h++){if(!u[h].trim())continue;const m=u[h].split(",").map(v=>v.trim().replace(/"/g,"")),b={};f.forEach((v,y)=>{b[v]=m[y]}),p.push(b)}return p};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsx("div",{className:"bg-slate-900 p-10 lg:p-14 rounded-[4rem] text-white relative overflow-hidden shadow-2xl border-b-8 border-blue-600",children:n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-10",children:[n.jsxs("div",{className:"flex-1 space-y-4",children:[n.jsxs("div",{className:"bg-blue-600/20 w-fit px-4 py-1.5 rounded-full border border-blue-600/30 flex items-center gap-2",children:[n.jsx(EA,{size:14,className:"text-blue-400"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-blue-400",children:"Security Mass Control"})]}),n.jsxs("h1",{className:"text-4xl font-black tracking-tighter",children:["Carga Excel ",n.jsx("span",{className:"text-blue-500 italic",children:"Usuarios"})]}),n.jsx("p",{className:"text-slate-400 font-medium max-w-lg",children:"Creación masiva de credenciales y perfiles de propietarios."})]}),n.jsxs("div",{className:"bg-white/5 p-10 rounded-[3rem] border border-white/10 flex flex-col items-center w-full lg:w-80 text-center",children:[n.jsx("div",{className:"w-16 h-16 bg-white/10 rounded-2xl flex items-center justify-center mb-6",children:n.jsx(LA,{size:32,className:t?"animate-bounce text-blue-400":"text-slate-500"})}),n.jsx("input",{type:"file",accept:".csv",className:"hidden",ref:i,onChange:l}),n.jsx("button",{disabled:t,onClick:()=>{var d;return(d=i.current)==null?void 0:d.click()},className:"w-full bg-blue-600 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl active:scale-95 transition-all disabled:opacity-50",children:t?"HASHEANDO...":"CARGAR CSV USUARIOS"})]})]})}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("h3",{className:"text-xl font-black text-slate-800 mb-8 flex items-center gap-3",children:[n.jsx(wl,{className:"text-indigo-600"})," Estructura Excel Usuarios"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-xs text-slate-500 font-medium leading-relaxed italic",children:"Columnas obligatorias (Minúsculas):"}),n.jsx("div",{className:"bg-slate-50 rounded-3xl p-6 border border-slate-100 overflow-x-auto",children:n.jsxs("table",{className:"w-full text-[10px] font-black uppercase text-slate-500 tracking-tighter",children:[n.jsx("thead",{className:"border-b border-slate-200",children:n.jsxs("tr",{children:[n.jsx("th",{className:"py-2 text-left pr-4",children:"Columna"}),n.jsx("th",{className:"py-2 text-left",children:"Valor Esperado"})]})}),n.jsxs("tbody",{className:"divide-y divide-slate-100",children:[n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-indigo-600",children:"cedula"}),n.jsx("td",{children:"V12345678"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-indigo-600",children:"nombre_completo"}),n.jsx("td",{children:"JUAN PEREZ"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-indigo-600",children:"correo"}),n.jsx("td",{children:"juan@gmail.com"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-indigo-600",children:"telefono"}),n.jsx("td",{children:"04121234567"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-indigo-600",children:"rol"}),n.jsx("td",{children:"owner / resident"})]}),n.jsxs("tr",{children:[n.jsx("td",{className:"py-2 text-blue-600 font-black",children:"telegram_id"}),n.jsx("td",{children:"123456789 (Opcional)"})]})]})]})}),n.jsxs("div",{className:"p-5 bg-amber-50 border border-amber-100 rounded-2xl flex items-start gap-3",children:[n.jsx(EA,{size:18,className:"text-amber-600 shrink-0 mt-0.5"}),n.jsx("p",{className:"text-[10px] text-amber-800 font-bold uppercase leading-tight",children:"La cédula se asignará como contraseña inicial. Si incluye el telegram_id, se habilitará el botón de inmediato."})]})]})]}),n.jsx("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-sm flex flex-col justify-center items-center text-center",children:a?n.jsxs("div",{className:"animate-in zoom-in duration-300 space-y-6",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-full flex items-center justify-center mx-auto shadow-inner",children:n.jsx(Xi,{size:40})}),n.jsx("h3",{className:"text-3xl font-black text-slate-900 tracking-tight",children:"Usuarios Listos"}),n.jsxs("div",{className:"bg-slate-50 p-8 rounded-3xl border border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Total Procesados"}),n.jsx("p",{className:"text-5xl font-black text-blue-600 mt-2",children:a.total})]})]}):n.jsxs("div",{className:"opacity-20 flex flex-col items-center",children:[n.jsx(gl,{size:80,className:"mb-6"}),n.jsx("p",{className:"font-black text-sm uppercase tracking-widest",children:"Sincronización Masiva"})]})})]})]})},uSe=({user:e})=>{const{exchangeRateHistory:t}=ht(),[r,a]=k.useState(new Date().getMonth()),[s,i]=k.useState(new Date().getFullYear()),[l,o]=k.useState(!1),[d,u]=k.useState([]),[f,p]=k.useState(10),h=()=>{if(!t||t.length===0)return 45.5;const E=t[0];return Number(E.pmValue)>0?Number(E.pmValue):Number(E.amValue)},[m,b]=k.useState(h()),v=async()=>{o(!0);try{const T=await(await fetch(`${Ne}/get_prefill_expenses.php?month=${r}&year=${s}`,{credentials:"include"})).json();Array.isArray(T)&&u(T.map((B,F)=>({...B,included:!0,id:`sim-${F}`})))}catch(E){console.error("Error al simular:",E)}finally{o(!1)}},y=E=>{u(T=>T.map(B=>B.id===E?{...B,included:!B.included}:B))},j=()=>{const E=d.filter(U=>U.included),T=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Simulación de Cuota - ${Te[r]} ${s}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&family=JetBrains+Mono:wght@400;700&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; line-height: 1.5; background: #f8fafc; }
        .container { max-width: 800px; margin: 0 auto; background: white; padding: 40px; border-radius: 24px; shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
        .header { text-align: center; margin-bottom: 40px; border-bottom: 4px solid #2563eb; padding-bottom: 20px; }
        .header h1 { margin: 0; color: #0f172a; font-size: 28px; font-weight: 900; text-transform: uppercase; letter-spacing: -0.05em; }
        .header p { margin: 5px 0; color: #64748b; font-size: 14px; font-weight: 700; }
        .badge { background: #2563eb; color: white; padding: 4px 12px; rounded: 20px; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; display: inline-block; margin-bottom: 10px; }
        table { width: 100%; border-collapse: collapse; margin-bottom: 30px; }
        th { background: #f1f5f9; text-align: left; padding: 12px; border-bottom: 2px solid #e2e8f0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 900; color: #475569; }
        td { padding: 12px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
        .category { font-size: 10px; font-weight: 900; color: #2563eb; text-transform: uppercase; background: #eff6ff; padding: 2px 8px; border-radius: 4px; }
        .amount { font-family: 'JetBrains Mono', monospace; text-align: right; font-weight: 700; }
        .totals { background: #0f172a; padding: 30px; border-radius: 20px; margin-top: 20px; color: white; }
        .total-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-weight: 700; font-size: 14px; }
        .grand-total { font-size: 24px; color: #60a5fa; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 15px; margin-top: 15px; font-weight: 900; }
        .footer { margin-top: 50px; text-align: center; font-size: 10px; color: #94a3b8; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="badge">Simulación SAC 2026</div>
            <h1>Simulación de Cuota Mensual</h1>
            <p>${va}</p>
            <p>Periodo: ${Te[r]} ${s}</p>
            <p>Tasa de Cambio: ${m.toFixed(2)} Bs/$</p>
        </div>
        <table>
            <thead>
                <tr>
                    <th>Descripción</th>
                    <th>Categoría</th>
                    <th style="text-align: right">Monto ($)</th>
                </tr>
            </thead>
            <tbody>
                ${E.map(U=>`
                    <tr>
                        <td style="font-weight: 700">${U.description}</td>
                        <td><span class="category">${U.category}</span></td>
                        <td class="amount">$${U.amountUsd.toFixed(2)}</td>
                    </tr>
                `).join("")}
            </tbody>
        </table>
        <div class="totals">
            <div class="total-row" style="color: #94a3b8"><span>Subtotal Gastos:</span> <span>$${N.subtotal.toFixed(2)}</span></div>
            <div class="total-row" style="color: #94a3b8"><span>Fondo de Reserva (${f}%):</span> <span>$${N.reserve.toFixed(2)}</span></div>
            <div class="total-row grand-total"><span>TOTAL PROYECTADO:</span> <span>$${N.totalUsd.toFixed(2)}</span></div>
            <div class="total-row" style="color: #60a5fa; font-size: 16px; margin-top: 10px;"><span>Equivalente en Bolívares:</span> <span>Bs. ${N.totalBs.toLocaleString("es-VE",{minimumFractionDigits:2})}</span></div>
        </div>
        <div class="footer">
            <p>Generado por SAC 2026 - ${Ln}</p>
            <p>Este documento es una simulación informativa no vinculante.</p>
        </div>
    </div>
</body>
</html>`,B=new Blob([T],{type:"text/html"}),F=URL.createObjectURL(B),R=document.createElement("a");R.href=F,R.download=`Simulacion_${Te[r]}_${s}.html`,document.body.appendChild(R),R.click(),document.body.removeChild(R),URL.revokeObjectURL(F)},_=async()=>{const E=`Simulación de Cuota ${Te[r]} ${s} - ${va}
Total Proyectado: $${N.totalUsd.toFixed(2)} (Bs. ${N.totalBs.toLocaleString("es-VE",{minimumFractionDigits:2})})`;if(navigator.share)try{await navigator.share({title:"Simulación de Cuota",text:E,url:window.location.href})}catch(T){console.log("Share failed",T)}else try{await navigator.clipboard.writeText(E)}catch(T){console.error("Clipboard failed",T)}},N=k.useMemo(()=>{const E=d.filter(P=>P.included),T=E.filter(P=>P.category==="fixed").reduce((P,G)=>P+G.amountUsd,0),B=E.filter(P=>P.category==="variable").reduce((P,G)=>P+G.amountUsd,0),F=E.filter(P=>P.category==="other").reduce((P,G)=>P+G.amountUsd,0),R=T+B+F,U=R*(f/100),D=R+U,L=D*m;return{subFixed:T,subVariable:B,subOther:F,subtotal:R,reserve:U,totalUsd:D,totalBs:L}},[d,f,m]);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-24",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-blue-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-blue-600 w-fit px-5 py-2 rounded-full border border-blue-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(Kr,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Ambiente de Simulación SAC 2026"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Pre-fill ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-500 italic",children:"Simulador Mensual"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Proyecte la cuota del mes seleccionando egresos específicos. Cálculo dinámico no persistente."'})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsxs("div",{className:"w-full grid grid-cols-2 gap-3 mb-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest block mb-1",children:"Periodo"}),n.jsx("select",{value:r,onChange:E=>a(Number(E.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl px-4 py-2 font-black text-slate-800 text-xs",children:Te.map((E,T)=>n.jsx("option",{value:T,children:E},T))})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest block mb-1",children:"Año"}),n.jsx("input",{type:"number",value:s,onChange:E=>i(Number(E.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl px-4 py-2 font-black text-slate-800 text-xs"})]})]}),n.jsxs("button",{onClick:v,disabled:l,className:"w-full bg-blue-600 hover:bg-blue-700 text-white font-black py-5 rounded-2xl shadow-xl shadow-blue-500/20 transition-all flex items-center justify-center gap-3 text-xs uppercase tracking-widest active:scale-95 disabled:opacity-50",children:[l?n.jsx(ct,{className:"animate-spin",size:18}):n.jsx(Kf,{size:18}),l?"ANALIZANDO EGRESOS...":"SIMULAR ESCENARIO"]})]})]}),n.jsx(da,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),d.length===0&&!l?n.jsxs("div",{className:"py-32 text-center bg-white rounded-[4rem] border border-dashed border-slate-200",children:[n.jsx(Kr,{size:48,className:"mx-auto mb-4 text-slate-200 opacity-20"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-sm",children:"Seleccione un periodo y ejecute la simulación."})]}):n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-10",children:[n.jsx("div",{className:"lg:col-span-2 space-y-12 animate-in slide-in-from-bottom duration-700",children:n.jsxs("div",{className:"bg-white p-8 lg:p-12 rounded-[3.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("h3",{className:"text-xl font-black text-slate-900 uppercase tracking-tighter mb-8 flex items-center gap-3",children:[n.jsx(Lc,{className:"text-blue-600",size:24})," Estructura de Gastos del Periodo"]}),n.jsxs("div",{className:"mb-12",children:[n.jsxs("div",{className:"flex justify-between items-center border-b-2 border-slate-50 pb-3 mb-6",children:[n.jsx("h4",{className:"text-sm font-black text-slate-400 uppercase tracking-widest",children:"Gastos Fijos Proyectados"}),n.jsxs("span",{className:"font-black text-slate-900 font-mono text-sm",children:["$",N.subFixed.toFixed(2)]})]}),n.jsxs("div",{className:"space-y-3",children:[d.filter(E=>E.category==="fixed").map(E=>n.jsx(Q2,{item:E,onToggle:()=>y(E.id)},E.id)),d.filter(E=>E.category==="fixed").length===0&&n.jsx("p",{className:"text-xs italic text-slate-300",children:"No hay egresos fijos para este mes."})]})]}),n.jsxs("div",{className:"mb-12",children:[n.jsxs("div",{className:"flex justify-between items-center border-b-2 border-slate-50 pb-3 mb-6",children:[n.jsx("h4",{className:"text-sm font-black text-slate-400 uppercase tracking-widest",children:"Gastos Variables Proyectados"}),n.jsxs("span",{className:"font-black text-slate-900 font-mono text-sm",children:["$",N.subVariable.toFixed(2)]})]}),n.jsxs("div",{className:"space-y-3",children:[d.filter(E=>E.category==="variable").map(E=>n.jsx(Q2,{item:E,onToggle:()=>y(E.id)},E.id)),d.filter(E=>E.category==="variable").length===0&&n.jsx("p",{className:"text-xs italic text-slate-300",children:"No hay egresos variables para este mes."})]})]}),n.jsxs("div",{children:[n.jsxs("div",{className:"flex justify-between items-center border-b-2 border-slate-50 pb-3 mb-6",children:[n.jsx("h4",{className:"text-sm font-black text-slate-400 uppercase tracking-widest",children:"Otros Gastos Proyectados"}),n.jsxs("span",{className:"font-black text-slate-900 font-mono text-sm",children:["$",N.subOther.toFixed(2)]})]}),n.jsxs("div",{className:"space-y-3",children:[d.filter(E=>E.category==="other").map(E=>n.jsx(Q2,{item:E,onToggle:()=>y(E.id)},E.id)),d.filter(E=>E.category==="other").length===0&&n.jsx("p",{className:"text-xs italic text-slate-300",children:"No hay otros egresos para este mes."})]})]})]})}),n.jsx("div",{className:"space-y-8 animate-in slide-in-from-right duration-700",children:n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] border border-slate-200 shadow-xl sticky top-24",children:[n.jsxs("h3",{className:"text-2xl font-black text-slate-900 tracking-tight mb-8 flex items-center gap-3",children:[n.jsx(vi,{className:"text-blue-600"})," Resultados Proyectados"]}),n.jsxs("div",{className:"flex items-center gap-2 mb-8 no-print",children:[n.jsxs("button",{onClick:j,className:"flex-1 bg-slate-100 hover:bg-slate-200 text-slate-600 p-3 rounded-xl transition-all flex items-center justify-center gap-2 group",title:"Exportar a HTML",children:[n.jsx(Zd,{size:16,className:"group-hover:scale-110 transition-transform"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest",children:"HTML"})]}),n.jsxs("button",{onClick:()=>window.print(),className:"flex-1 bg-slate-100 hover:bg-slate-200 text-slate-600 p-3 rounded-xl transition-all flex items-center justify-center gap-2 group",title:"Imprimir",children:[n.jsx(wt,{size:16,className:"group-hover:scale-110 transition-transform"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest",children:"Imprimir"})]}),n.jsxs("button",{onClick:_,className:"flex-1 bg-slate-100 hover:bg-slate-200 text-slate-600 p-3 rounded-xl transition-all flex items-center justify-center gap-2 group",title:"Compartir",children:[n.jsx(Aa,{size:16,className:"group-hover:scale-110 transition-transform"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-widest",children:"Compartir"})]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex justify-between items-center py-4 border-b border-slate-100",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Subtotal Gastos ($)"}),n.jsxs("span",{className:"text-xl font-black text-slate-800 tracking-tighter",children:["$",N.subtotal.toLocaleString(void 0,{minimumFractionDigits:2})]})]}),n.jsxs("div",{className:"space-y-4 py-4",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("label",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest",children:"Fondo Reserva (%)"}),n.jsx("input",{type:"number",className:"w-16 bg-slate-50 border border-slate-200 rounded-lg px-2 py-1 text-right font-black text-blue-600 text-xs",value:f,onChange:E=>p(Number(E.target.value))})]}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[9px] font-bold text-slate-400 uppercase",children:"Impacto Reserva ($)"}),n.jsxs("span",{className:"text-sm font-black text-blue-600",children:["+$",N.reserve.toLocaleString(void 0,{minimumFractionDigits:2})]})]})]}),n.jsxs("div",{className:"bg-slate-900 rounded-[2.5rem] p-8 text-white relative overflow-hidden shadow-2xl",children:[n.jsx("p",{className:"text-[10px] font-black uppercase text-blue-400 tracking-[0.3em] mb-4 relative z-10 text-center",children:"GRAN TOTAL PROYECTADO"}),n.jsxs("div",{className:"flex justify-center items-start gap-1 relative z-10",children:[n.jsx("span",{className:"text-2xl font-black mt-2 text-blue-400",children:"$"}),n.jsx("h4",{className:"text-6xl font-black tracking-tighter",children:N.totalUsd.toLocaleString(void 0,{minimumFractionDigits:2})})]}),n.jsxs("div",{className:"mt-8 pt-6 border-t border-white/10 flex justify-between items-center relative z-10",children:[n.jsxs("div",{children:[n.jsxs("span",{className:"text-[9px] font-black uppercase text-slate-500 block",children:["Equiv. VES (@",m.toFixed(2),")"]}),n.jsxs("p",{className:"text-xl font-black text-blue-300 tracking-tight",children:["Bs. ",N.totalBs.toLocaleString("es-VE",{minimumFractionDigits:2})]})]}),n.jsx(Ki,{className:"text-blue-500/20",size:40})]}),n.jsx(za,{className:"absolute right-[-20px] bottom-[-20px] w-48 h-48 text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"p-6 bg-blue-50 border border-blue-100 rounded-[2rem] flex items-start gap-4",children:[n.jsx(jn,{className:"text-blue-600 shrink-0 mt-0.5",size:20}),n.jsx("p",{className:"text-[10px] text-blue-800 font-bold uppercase leading-relaxed tracking-tight",children:'Esta simulación es local. Para confirmar estos gastos, deberá cargarlos formalmente en el módulo "Generar Cuotas".'})]})]})]})})]})]})},Q2=({item:e,onToggle:t})=>n.jsxs("div",{onClick:t,className:`p-5 rounded-[1.8rem] border transition-all cursor-pointer flex items-center justify-between group ${e.included?"bg-white border-blue-200 shadow-md scale-[1.02]":"bg-slate-50 border-slate-100 opacity-40 hover:opacity-70"}`,children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center transition-all ${e.included?"bg-blue-600 text-white":"bg-slate-200 text-slate-400"}`,children:e.included?n.jsx(Gt,{size:18}):n.jsx(SM,{size:18})}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-800 text-xs uppercase leading-none truncate max-w-[180px]",children:e.description}),n.jsx("p",{className:"text-[8px] font-bold text-slate-400 uppercase mt-1 tracking-widest",children:e.category})]})]}),n.jsx("div",{className:"text-right",children:n.jsxs("span",{className:"font-black text-slate-900 font-mono text-sm",children:["$",e.amountUsd.toFixed(2)]})})]}),ASe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,financialTotals:i,markReceiptSent:l,latestRate:o}=ht(),[d,u]=k.useState(new Date().getMonth()),[f,p]=k.useState(new Date().getFullYear()),[h,m]=k.useState(null),[b,v]=k.useState("selection"),[y,j]=k.useState(null),[_,N]=k.useState({});k.useEffect(()=>{(async()=>{try{const H=await we.getSystemSettings();N(H||{})}catch(H){console.error("Error fetching settings",H)}})()},[]);const E=k.useMemo(()=>t.find(Q=>Q.month===d&&Q.year===f),[t,d,f]),T=k.useMemo(()=>r.find(Q=>Q.id===h),[r,h]),B=k.useMemo(()=>{if(!T)return null;const Q=a.find(X=>X.propertyId===T.id&&X.isOwner),H=s.find(X=>X.cedula===(Q==null?void 0:Q.cedula));return{fullName:(Q==null?void 0:Q.fullName)||"Propietario",email:(H==null?void 0:H.email)||"",phone:(Q==null?void 0:Q.phone)||(H==null?void 0:H.phone)||"",telegramId:(H==null?void 0:H.telegramChatId)||"",propertyCode:T.code,propertyId:T.id,role:"owner"}},[T,a,s]),F=Q=>Number(Q).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),R=Q=>Number(Q).toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2}),U=Q=>{if(!Q)return"";let H=Q.trim();return H.startsWith("+")?H.replace(/\D/g,""):H.startsWith("0")?"58"+H.substring(1).replace(/\D/g,""):H.length===10?"58"+H.replace(/\D/g,""):H.replace(/\D/g,"")},D=async()=>{if(!(B!=null&&B.email)||!E)return alert("Datos insuficientes.");j("email");const Q=E.debts.find(K=>K.propertyId===h),H=Q?(Number(Q.amountUsd)-Number(Q.paidAmount)).toFixed(2):"0.00",X={channel:"email",messageType:"fee",subject:`Aviso de Cobro SAC 2026 - ${Te[d]}`,recipients:[{name:B.fullName,email:B.email,amount:H,status:(Q==null?void 0:Q.status)||"Pendiente",propName:`${T==null?void 0:T.type} ${T==null?void 0:T.number}`}],monthName:Te[d],year:f};try{const ee=await(await fetch(`${Ne}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(X)})).json();ee.status==="success"?(await l(E.id,h,"email"),alert("¡Éxito! Email entregado.")):alert("Error: "+ee.message)}catch{alert("Fallo de red.")}finally{j(null)}},L=async()=>{if(!(B!=null&&B.telegramId)||!E)return alert("Datos insuficientes.");j("telegram");const Q=E.debts.find(K=>K.propertyId===h),H=Q?(Number(Q.amountUsd)-Number(Q.paidAmount)).toFixed(2):"0.00",X={channel:"telegram",messageType:"fee",recipients:[{name:B.fullName,telegramChatId:B.telegramId,amount:H,status:(Q==null?void 0:Q.status)||"Pendiente",propName:`${T==null?void 0:T.type} ${T==null?void 0:T.number}`}],monthName:Te[d],year:f};try{const ee=await(await fetch(`${Ne}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(X)})).json();ee.status==="success"?(await l(E.id,h,"telegram"),alert("¡Éxito! Telegram enviado.")):alert("Error: "+ee.message)}catch{alert("Fallo de red.")}finally{j(null)}},P=()=>{if(G(),B&&E){const Q=U(B.phone);if(Q){const H=E.debts.find(ee=>ee.propertyId===h),X=H?(Number(H.amountUsd)-Number(H.paidAmount)).toFixed(2):"0.00",K=`🏢 *AVISO DE COBRO - SAC 2026*

Estimado(a) *${B.fullName}*,

Le adjuntamos su aviso de cobro en formato HTML para la unidad *${T==null?void 0:T.type} ${T==null?void 0:T.number}* (${T==null?void 0:T.code}) correspondiente al periodo *${Te[d]} ${f}*.

💵 *Total a Pagar:* $${X} USD
📌 *Estado:* ${(H==null?void 0:H.status)||"Pendiente"}

Por favor, descargue y abra el archivo HTML adjunto para ver la relación detallada.

🔗 *ACCEDER AL PORTAL:* ${Rr}

¡Muchas gracias!`;window.open(`https://wa.me/${Q}?text=${encodeURIComponent(K)}`,"_blank"),l(E.id,h,"whatsapp")}else alert("El usuario no tiene un teléfono registrado para WhatsApp.")}},G=()=>{if(!T||!B||!E)return;const Q=E.debts.find(ie=>ie.propertyId===h),H=Number(T.aliquot)||0,X=!!T.hasUncommonExpense,K=r.filter(ie=>ie.hasUncommonExpense).length,ee=ie=>{var pe,he;const me=Number(ie.amountUsd)||0;let Z=0,Me="";if(ie.isSpecial){const ye=((pe=ie.specialPropertyIds)==null?void 0:pe.length)||1,fe=(he=ie.specialPropertyIds)==null?void 0:he.includes(h);Z=fe?me/ye:0,Me=fe?`ESP (1/${ye})`:"Exento"}else ie.isUncommon?(Z=X&&K>0?me/K:0,Me=X&&K>0?`GNC (1/${K})`:"Exento"):(Z=me*(H/100),Me=`ALIQ (${H.toFixed(4)}%)`);return{...ie,global:me,myPortion:Z,basisDesc:Me}},W=[{title:"Gastos Fijos",items:E.fixedExpenses.map(ee)},{title:"Gastos Variables",items:E.variableExpenses.map(ee)},{title:"Otros Gastos",items:E.otherExpenses.map(ee)}],Y=W.reduce((ie,me)=>ie+me.items.reduce((Z,Me)=>Z+Me.myPortion,0),0);W.reduce((ie,me)=>ie+me.items.reduce((Z,Me)=>Z+Me.global,0),0);const M=Number(E.reserveFundPercent)||10,O=Y*(M/100),z=(Y+O-(Q?Number(Q.paidAmount):0)).toFixed(2),J=ie=>ie.map(me=>`
                <tr>
                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-transform: uppercase;">${me.description}</td>
                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 10px; text-align: center; color: #64748b;">${me.basisDesc}</td>
                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-align: right;">$ ${F(me.global)}</td>
                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-align: right; font-weight: 700; background: #f8fafc;">$ ${F(me.myPortion)}</td>
                </tr>
            `).join(""),re=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Aviso de Cobro - ${T.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 20px; color: #1e293b; background-color: #f8fafc; }
        .container { max-width: 900px; margin: 0 auto; background: white; padding: 40px; border-radius: 20px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); border: 1px solid #e2e8f0; }
        .header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; border-bottom: 2px solid #f1f5f9; padding-bottom: 20px; }
        .logo-area { text-align: left; }
        .logo-title { font-size: 28px; font-weight: 900; color: #0f172a; letter-spacing: -1px; }
        .logo-subtitle { font-size: 10px; font-weight: 900; color: #2563eb; text-transform: uppercase; letter-spacing: 2px; }
        .property-info { text-align: right; }
        .prop-label { font-size: 9px; font-weight: 900; color: #64748b; text-transform: uppercase; }
        .prop-value { font-size: 14px; font-weight: 700; color: #1e293b; }
        .section-title { font-size: 12px; font-weight: 900; text-transform: uppercase; color: #0f172a; background: #f1f5f9; padding: 8px 15px; border-radius: 8px; margin: 20px 0 10px 0; display: flex; align-items: center; gap: 10px; }
        .section-title::before { content: ""; display: block; width: 4px; height: 12px; background: #2563eb; border-radius: 2px; }
        table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
        th { font-size: 9px; font-weight: 900; color: #64748b; text-transform: uppercase; text-align: left; padding: 8px; border-bottom: 2px solid #f1f5f9; }
        .summary-box { background: #0f172a; color: white; padding: 30px; border-radius: 20px; margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
        .total-label { font-size: 10px; font-weight: 900; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
        .total-value { font-size: 36px; font-weight: 900; color: #60a5fa; letter-spacing: -1px; }
        .ves-value { font-size: 18px; font-weight: 700; color: #cbd5e1; }
        .payment-info { margin-top: 30px; display: grid; grid-cols: 2; gap: 20px; border-top: 1px solid #f1f5f9; padding-top: 20px; }
        .payment-column { font-size: 11px; line-height: 1.5; }
        .payment-title { font-size: 10px; font-weight: 900; color: #2563eb; text-transform: uppercase; margin-bottom: 8px; }
        .footer { text-align: center; font-size: 9px; color: #94a3b8; margin-top: 40px; border-top: 1px solid #f1f5f9; padding-top: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
        @media print {
            body { background: white; padding: 0; }
            .container { box-shadow: none; border: none; padding: 0; }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="logo-area">
                <div class="logo-title">SAC <span style="color: #2563eb;">2026</span></div>
                <div class="logo-subtitle">${va}</div>
                <div style="font-size: 12px; font-weight: 700; color: #64748b; margin-top: 5px;">AVISO DE COBRO INDIVIDUAL</div>
            </div>
            <div class="property-info">
                <div style="margin-bottom: 10px;">
                    <div class="prop-label">Propietario</div>
                    <div class="prop-value">${B.fullName}</div>
                </div>
                <div>
                    <div class="prop-label">Unidad / Alícuota</div>
                    <div class="prop-value">${T.code} (${T.type} ${T.number}) / ${H.toFixed(4)}%</div>
                </div>
            </div>
        </div>

        <div style="display: flex; justify-content: space-between; margin-bottom: 20px; font-size: 11px; font-weight: 700; color: #64748b;">
            <div>PERIODO: ${Te[d].toUpperCase()} ${f}</div>
            <div>TASA: Bs. ${o.toFixed(2)}</div>
        </div>

        ${W.map(ie=>ie.items.length>0?`
            <div class="section-title">${ie.title}</div>
            <table>
                <thead>
                    <tr>
                        <th style="width: 50%;">Concepto</th>
                        <th style="text-align: center;">Base</th>
                        <th style="text-align: right;">Global ($)</th>
                        <th style="text-align: right; background: #f8fafc;">Su Cuota ($)</th>
                    </tr>
                </thead>
                <tbody>
                    ${J(ie.items)}
                </tbody>
            </table>
        `:"").join("")}

        <div class="summary-box">
            <div>
                <div style="margin-bottom: 15px;">
                    <div class="total-label">Subtotal Gastos</div>
                    <div style="font-size: 18px; font-weight: 700;">$ ${F(Y)}</div>
                </div>
                <div>
                    <div class="total-label">Fondo Reserva (${M}%)</div>
                    <div style="font-size: 18px; font-weight: 700;">$ ${F(O)}</div>
                </div>
            </div>
            <div style="text-align: right; border-left: 1px solid rgba(255,255,255,0.1); padding-left: 20px;">
                <div class="total-label">Total a Pagar</div>
                <div class="total-value">$ ${z}</div>
                <div class="ves-value">Bs. ${R(Number(z)*o)}</div>
            </div>
        </div>

        <div class="payment-info" style="display: flex; justify-content: space-between;">
            <div class="payment-column">
                <div class="payment-title">Datos para el Pago</div>
                <div style="font-weight: 700;">${_.payment_bank_name||"BanPlus"} ${_.payment_account_type||"Cta Cte"}</div>
                <div style="font-weight: 900; color: #2563eb;"># ${_.payment_account_number||"0174-0124-6812-4414-5759"}</div>
                <div>RIF: ${_.payment_rif||"J-313266507"}</div>
                <div>Pago Móvil: ${_.payment_mobile_phone||"0424-4910040"}</div>
            </div>
            <div class="payment-column" style="text-align: right;">
                <div class="payment-title">Reportar Pago</div>
                <div>Enviar comprobante a:</div>
                <div style="font-weight: 700;">${_.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com"}</div>
                <div style="font-weight: 700;">WhatsApp: ${_.payment_whatsapp||"0412-8213310"}</div>
                <div style="font-size: 9px; color: #f59e0b; font-weight: 900; margin-top: 5px;">INDICAR #CASA Y NOMBRE PARA IDENTIFICAR</div>
            </div>
        </div>

        <div style="margin-top: 30px; font-size: 11px; color: #64748b; line-height: 1.6; font-style: italic; text-align: center;">
            Este documento es una relación detallada de sus compromisos para con la comunidad. 
            El pago oportuno garantiza la continuidad de los servicios y el mantenimiento de nuestro patrimonio común.
        </div>

        <div class="footer">
            SISTEMA ADMINISTRATIVO PARA CONDOMINIOS SAC 2026 • Kernel V4.1.85 MC/MB • ${T.code} • ${B.fullName} • GENERADO EL ${new Date().toLocaleString()}
        </div>
    </div>
</body>
</html>`,le=new Blob([re],{type:"text/html"}),ne=URL.createObjectURL(le),ae=document.createElement("a");ae.href=ne,ae.download=`Cuota_${T.code}_${Te[d]}.html`,ae.click(),URL.revokeObjectURL(ne)};if(b==="breakdown"&&E&&T&&B){const Q=async ae=>{{if(navigator.share)try{await navigator.share({title:`Aviso de Cobro - ${T.code}`,text:le.replace(/\*/g,""),url:Rr})}catch(ie){console.warn("Share failed",ie)}else alert("La función de compartir no está disponible en este navegador.");return}},H=Number(T.aliquot)||0,X=!!T.hasUncommonExpense,K=r.filter(ae=>ae.hasUncommonExpense).length,ee=ae=>{var Me,pe;const ie=Number(ae.amountUsd)||0;let me=0,Z="";if(ae.isSpecial){const he=((Me=ae.specialPropertyIds)==null?void 0:Me.length)||1,ye=(pe=ae.specialPropertyIds)==null?void 0:pe.includes(h);me=ye?ie/he:0,Z=ye?`ESP (1/${he})`:"Exento"}else ae.isUncommon?(me=X&&K>0?ie/K:0,Z=X&&K>0?`GNC (1/${K})`:"Exento"):(me=ie*(H/100),Z=`ALIQ (${H.toFixed(4)}%)`);return{...ae,global:ie,myPortion:me,basisDesc:Z}},W=[{title:"Gastos Fijos",items:E.fixedExpenses.map(ee)},{title:"Gastos Variables",items:E.variableExpenses.map(ee)},{title:"Otros Gastos",items:E.otherExpenses.map(ee)}],Y=W.reduce((ae,ie)=>ae+ie.items.reduce((me,Z)=>me+Z.myPortion,0),0),M=W.reduce((ae,ie)=>ae+ie.items.reduce((me,Z)=>me+Z.global,0),0),O=Number(E.reserveFundPercent)||10,q=Y*(O/100),z=Y+q,J=E.debts.find(ae=>ae.propertyId===h),re=(z-(J?Number(J.paidAmount):0)).toFixed(2),le=`🏢 *AVISO DE COBRO - SAC 2026*

Estimado(a) *${B.fullName}*,

Su recibo de *${Te[d]} ${f}* para la unidad *${T.type} ${T.number}* ya está disponible.

💵 *Total a Pagar:* $${re} USD
📌 *Estado:* ${(J==null?void 0:J.status)||"Pendiente"}

Por favor, gestione su reporte de pago en nuestro portal digital:
🔗 *ACCEDER AL PORTAL:* ${Rr}

¡Muchas gracias!`,ne=U(B.phone);return n.jsxs("div",{className:"max-w-7xl mx-auto space-y-10 animate-in fade-in duration-500 pb-24 px-1 print:p-0 print:space-y-2 print-compact",children:[n.jsx("style",{children:`
                    @media print {
                        @page { margin: 0.5cm; size: auto; }
                        .print-compact { font-size: 8pt !important; width: 100% !important; overflow: visible !important; }
                        .print-compact table td, .print-compact table th { padding-top: 2px !important; padding-bottom: 2px !important; line-height: 1.1 !important; font-size: 8pt !important; }
                        .print-compact h2 { font-size: 14pt !important; margin-bottom: 4px !important; }
                        .print-compact h3 { font-size: 10pt !important; margin-bottom: 6px !important; margin-top: 6px !important; border-bottom-width: 1px !important; padding-bottom: 2px !important; }
                        .print-compact .p-10, .print-compact .p-14, .print-compact .p-8 { padding: 12px !important; }
                        .print-compact .mt-8, .print-compact .mt-10, .print-compact .mt-6 { margin-top: 6px !important; }
                        .print-compact .mb-8, .print-compact .mb-10, .print-compact .mb-4, .print-compact .mb-2 { margin-bottom: 4px !important; }
                        .print-compact .rounded-[3rem], .print-compact .rounded-2xl, .print-compact .rounded-[2.5rem] { border-radius: 8px !important; }
                        .print-compact .shadow-xl, .print-compact .shadow-2xl, .print-compact .shadow-lg { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
                        .print-compact .bg-slate-900 { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .print-header { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .print-header h2 { color: white !important; }
                        .print-header p, .print-header span { color: inherit; }
                        .print-header .text-blue-400 { color: #60a5fa !important; }
                        .print-header .text-blue-300 { color: #93c5fd !important; }
                        .print-header .text-emerald-400 { color: #34d399 !important; }
                        .print-header .text-amber-400 { color: #fbbf24 !important; }
                        .print-header .text-slate-400 { color: #94a3b8 !important; }
                        .print-header .bg-white/10 { background-color: rgba(255,255,255,0.15) !important; border: 1px solid rgba(255,255,255,0.3) !important; -webkit-print-color-adjust: exact; }
                        .print-header .bg-indigo-600/20 { background-color: rgba(79, 70, 229, 0.2) !important; border: 1px solid rgba(129, 140, 248, 0.3) !important; -webkit-print-color-adjust: exact; }
                        .print-header .backdrop-blur-md, .print-header .backdrop-blur-sm { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
                        .print-compact .bg-slate-50 { background-color: #f8fafc !important; -webkit-print-color-adjust: exact; }
                        .print-compact .bg-blue-600 { background-color: #2563eb !important; -webkit-print-color-adjust: exact; }
                        .print-compact .bg-indigo-600 { background-color: #4f46e5 !important; -webkit-print-color-adjust: exact; }
                        .print-compact table { page-break-inside: auto !important; }
                        .print-compact tr { page-break-inside: avoid !important; page-break-after: auto !important; }
                    }
                `}),n.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-4 no-print",children:[n.jsxs("button",{onClick:()=>v("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(gs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Imprimir",children:n.jsx(wt,{size:20})}),n.jsx("button",{onClick:G,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Exportar HTML",children:n.jsx(wr,{size:20})}),ne&&n.jsx("a",{href:`https://wa.me/${ne}?text=${encodeURIComponent(le)}`,target:"_blank",rel:"noreferrer",onClick:()=>l(E.id,h,"whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Enviar WhatsApp",children:n.jsx(Ha,{size:20})}),ne&&n.jsxs("button",{onClick:P,className:"p-3 bg-emerald-600 text-white rounded-xl shadow-lg active:scale-95 transition-all flex items-center gap-1",title:"Exportar HTML y Enviar por WhatsApp",children:[n.jsx(wr,{size:20}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-wider",children:"HTML/WA"})]}),n.jsx("button",{onClick:L,disabled:!B.telegramId||!!y,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${B.telegramId?"bg-sky-500":"bg-slate-200"}`,title:"Enviar Telegram",children:y==="telegram"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Bl,{size:20})}),n.jsx("button",{onClick:D,disabled:!B.email||!!y,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${B.email?"bg-indigo-600":"bg-slate-200"}`,title:"Enviar Email",children:y==="email"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Br,{size:20})}),n.jsx("button",{onClick:()=>Q(),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir",children:n.jsx(Aa,{size:20})})]})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] shadow-xl border border-slate-200 overflow-hidden print:overflow-visible print:border-none print:shadow-none",children:[n.jsxs("div",{className:"p-10 lg:p-14 bg-slate-900 text-white text-center relative overflow-hidden print:p-6 print-header",children:[n.jsx("h2",{className:"text-2xl lg:text-3xl font-black uppercase tracking-[0.2em] mb-2 print:text-xl",children:"Aviso de Cobro Individual"}),n.jsxs("p",{className:"text-blue-400 font-black uppercase tracking-widest text-xs",children:[Te[E.month]," ",E.year]}),n.jsx("div",{className:"mt-8 mb-4 max-w-md mx-auto print:mt-4 print:mb-2",children:n.jsxs("div",{className:"bg-indigo-600/20 border border-indigo-400/30 p-4 rounded-2xl backdrop-blur-sm flex items-center justify-between print:p-2 print:border-none",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(ho,{className:"text-blue-400",size:24}),n.jsxs("div",{className:"text-left",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-blue-300 tracking-widest",children:"Disponibilidad Fondo de Reserva"}),n.jsxs("p",{className:"text-lg font-black text-white",children:["$ ",F((i==null?void 0:i.reserveFundUsd)||0)]})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[7px] font-black uppercase text-indigo-300",children:"Equiv. VES"}),n.jsxs("p",{className:"text-xs font-black text-blue-200",children:["Bs. ",R((i==null?void 0:i.reserveFundBs)||0)]})]})]})}),n.jsxs("div",{className:"mt-6 flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8 print:mt-2 print:gap-4",children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Inmueble"}),n.jsxs("p",{className:"text-lg font-black text-blue-300 print:text-sm",children:[T.type," ",T.number]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Alícuota"}),n.jsxs("p",{className:"text-lg font-black text-emerald-400 print:text-sm",children:[H.toFixed(4),"%"]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Tasa del Día"}),n.jsxs("p",{className:"text-lg font-black text-amber-400 print:text-sm",children:[o.toFixed(2)," Bs/$"]})]})]})]}),n.jsx("div",{className:"p-8 lg:p-14 space-y-12 bg-white print:p-4 print:space-y-4",children:W.map((ae,ie)=>ae.items.length===0?null:n.jsxs("div",{className:"print:break-inside-auto",children:[n.jsxs("h3",{className:"text-lg font-black text-slate-900 uppercase tracking-tighter mb-6 flex items-center gap-3 print:text-sm print:mb-2",children:[n.jsx("div",{className:"w-2 h-6 bg-blue-600 rounded-full print:h-4"})," ",ae.title]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b-2 border-slate-100",children:[n.jsx("th",{className:"py-4 text-[9px] font-black uppercase text-slate-400 tracking-widest print:py-1",children:"Concepto"}),n.jsx("th",{className:"py-4 text-[9px] font-black uppercase text-slate-400 text-center print:py-1",children:"Base"}),n.jsx("th",{className:"py-4 text-[9px] font-black uppercase text-slate-400 text-right print:py-1",children:"Gasto Global ($)"}),n.jsx("th",{className:"py-4 text-[9px] font-black uppercase text-blue-600 text-right bg-blue-50/30 px-4 print:py-1",children:"Su Cuota ($)"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-50",children:ae.items.map((me,Z)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors",children:[n.jsxs("td",{className:"py-4 text-xs font-bold text-slate-600 uppercase flex items-center gap-3 print:py-0.5 print:text-[7pt]",children:[me.isSpecial?n.jsx(Ab,{size:12,className:"text-amber-500 no-print"}):me.isUncommon?n.jsx(Qc,{size:12,className:"text-indigo-500 no-print",fill:"currentColor"}):n.jsx("div",{className:"w-3 no-print"}),me.description]}),n.jsx("td",{className:"py-4 text-center print:py-0.5",children:n.jsx("span",{className:"px-3 py-1 rounded-lg text-[8px] font-black uppercase tracking-tighter border bg-slate-50 text-slate-500 print:text-[6pt] print:px-1",children:me.basisDesc})}),n.jsxs("td",{className:"py-4 text-xs font-black text-right text-slate-400 print:py-0.5",children:["$",F(me.global)]}),n.jsxs("td",{className:"py-4 text-sm font-black text-blue-900 text-right bg-blue-50/10 px-4 print:py-0.5 print:text-[8pt]",children:["$",F(me.myPortion)]})]},Z))})]})})]},ie))}),n.jsx("div",{className:"bg-slate-50 p-10 lg:p-14 border-t border-slate-100 space-y-12 print:p-6 print:space-y-6",children:n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 print:gap-4 print:grid-cols-2",children:[n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"space-y-4 print:space-y-1",children:[n.jsxs("div",{className:"flex items-center gap-3 text-amber-600 print:gap-1",children:[n.jsx(Sr,{size:20,className:"print:w-4 print:h-4"}),n.jsx("h4",{className:"text-sm font-black uppercase tracking-widest print:text-[8pt]",children:"Resumen"})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-2 pt-4 print:pt-1",children:[n.jsxs("div",{className:"p-3 bg-white border border-slate-200 rounded-xl text-center print:p-1",children:[n.jsx("span",{className:"block text-[8px] font-black text-slate-400 uppercase print:text-[6pt]",children:"Subtotal"}),n.jsxs("span",{className:"font-black text-slate-800 text-xs print:text-[8pt]",children:["$",F(Y)]})]}),n.jsxs("div",{className:"p-3 bg-white border border-slate-200 rounded-xl text-center print:p-1",children:[n.jsxs("span",{className:"block text-[8px] font-black text-blue-400 uppercase print:text-[6pt]",children:["Reserva (",O,"%)"]}),n.jsxs("span",{className:"font-black text-blue-600 text-xs print:text-[8pt]",children:["$",F(q)]})]}),n.jsxs("div",{className:"p-3 bg-white border border-slate-200 rounded-xl text-center print:p-1",children:[n.jsx("span",{className:"block text-[8px] font-black text-amber-400 uppercase print:text-[6pt]",children:"Gasto Global"}),n.jsxs("span",{className:"font-black text-amber-600 text-xs print:text-[8pt]",children:["$",F(M)]})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 text-left pt-4 border-t border-slate-200 print:pt-2 print:gap-2",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(br,{size:14})," Datos para el Pago"]}),n.jsxs("div",{className:"bg-white p-4 rounded-2xl border border-slate-100 shadow-sm space-y-1 print:p-2",children:[n.jsxs("p",{className:"text-[11px] font-bold text-slate-700 uppercase print:text-[7pt]",children:[_.payment_bank_name||"BanPlus"," ",_.payment_account_type||"Cta Cte"]}),n.jsxs("p",{className:"text-[11px] font-black text-blue-900 tracking-wider print:text-[7pt]",children:["# ",_.payment_account_number||"0174-0124-6812-4414-5759"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase print:text-[7pt]",children:["RIF: ",_.payment_rif||"J-313266507"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase print:text-[7pt]",children:["Pago Móvil: ",_.payment_mobile_phone||"0424-4910040"]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(Br,{size:14})," Reportar Pago"]}),n.jsxs("div",{className:"bg-white p-4 rounded-2xl border border-slate-100 shadow-sm space-y-1 print:p-2",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase print:text-[6pt]",children:"Enviar comprobante a:"}),(_.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map((ae,ie)=>n.jsx("p",{className:"text-[11px] font-bold text-slate-700 print:text-[7pt]",children:ae.trim()},ie)),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase mt-1 print:text-[7pt]",children:["WhatsApp: ",_.payment_whatsapp||"0412-8213310"]}),n.jsx("p",{className:"text-[9px] font-black text-amber-600 uppercase italic mt-2 print:text-[6pt]",children:"Indicar #casa y nombre para identificar"})]})]})]})]}),n.jsxs("div",{className:"bg-slate-900 rounded-[2.5rem] p-10 text-white shadow-2xl relative overflow-hidden flex flex-col justify-center print:p-4",children:[n.jsxs("div",{className:"relative z-10 flex flex-col gap-6 print:gap-2",children:[n.jsxs("div",{className:"flex justify-between items-center border-b border-white/10 pb-4 print:pb-1",children:[n.jsx("span",{className:"text-[10px] font-black uppercase text-blue-400 print:text-[7pt]",children:"Total a Pagar"}),n.jsxs("span",{className:"text-4xl font-black tracking-tighter print:text-xl",children:["$",F(re)]})]}),n.jsxs("div",{className:"flex justify-between items-center bg-blue-600/20 p-5 rounded-2xl border border-blue-500/20 print:p-2",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-[9px] font-black uppercase text-blue-300 block print:text-[6pt]",children:"Equivalente VES"}),n.jsxs("p",{className:"text-2xl font-black tracking-tight mt-1 print:text-sm print:mt-0",children:["Bs. ",R(Number(re)*o)]})]}),n.jsx(Ki,{size:32,className:"text-blue-400 opacity-50 print:w-6 print:h-6"})]})]}),n.jsx(Up,{className:"absolute right-[-20px] bottom-[-20px] w-48 h-48 text-white/[0.05] pointer-events-none no-print"})]})]})})]}),n.jsx("div",{className:"hidden print:block text-center mt-4 border-t pt-4",children:n.jsx("p",{className:"text-[8pt] font-black uppercase text-slate-300 tracking-[0.4em]",children:"Certificado Digital de Gestión • SAC 2026 • Kernel V4.1.85 MC/MB • By Andres Mathison"})})]})}return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Cuota por ",n.jsx("span",{className:"text-blue-600",children:"Usuario Individual"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Visualización y envío de avisos de cobro personalizados."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:d,onChange:Q=>u(Number(Q.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Te.map((Q,H)=>n.jsx("option",{value:H,children:Q},H))}),n.jsx("input",{type:"number",value:f,onChange:Q=>p(Number(Q.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(QA,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Seleccione una Propiedad"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Elija la unidad para generar la vista previa del aviso de cobro."})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(ea,{size:14})," Unidad Inmobiliaria"]}),n.jsxs("select",{value:h||"",onChange:Q=>m(Number(Q.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),r.sort((Q,H)=>Q.code.localeCompare(H.code,void 0,{numeric:!0})).map(Q=>n.jsxs("option",{value:Q.id,children:[Q.code," - ",Q.type," ",Q.number]},Q.id))]})]}),n.jsx("button",{disabled:!h||!E,onClick:()=>v("breakdown"),className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:E?n.jsxs(n.Fragment,{children:["GENERAR VISTA PREVIA ",n.jsx(Hs,{size:18})]}):n.jsx(n.Fragment,{children:"CUOTA NO GENERADA PARA ESTE MES"})}),!E&&n.jsxs("div",{className:"bg-amber-50 border border-amber-100 p-6 rounded-2xl flex items-center gap-4 text-amber-700",children:[n.jsx(Sr,{size:24,className:"shrink-0"}),n.jsx("p",{className:"text-xs font-bold leading-relaxed uppercase tracking-tight",children:'Debe generar primero la relación de gastos global para este periodo en el módulo de "Generar Cuotas".'})]})]})})]})};/*!
 * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
 * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
 * Released under MIT License
 *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var UC=function(e,t){return UC=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,a){r.__proto__=a}||function(r,a){for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(r[s]=a[s])},UC(e,t)};function Zi(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");UC(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var MC=function(){return MC=Object.assign||function(t){for(var r,a=1,s=arguments.length;a<s;a++){r=arguments[a];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},MC.apply(this,arguments)};function Kn(e,t,r,a){function s(i){return i instanceof r?i:new r(function(l){l(i)})}return new(r||(r=Promise))(function(i,l){function o(f){try{u(a.next(f))}catch(p){l(p)}}function d(f){try{u(a.throw(f))}catch(p){l(p)}}function u(f){f.done?i(f.value):s(f.value).then(o,d)}u((a=a.apply(e,[])).next())})}function Tn(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,s,i,l;return l={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function o(u){return function(f){return d([u,f])}}function d(u){if(a)throw new TypeError("Generator is already executing.");for(;r;)try{if(a=1,s&&(i=u[0]&2?s.return:u[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,u[1])).done)return i;switch(s=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,s=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(f){u=[6,f],s=0}finally{a=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function em(e,t,r){if(arguments.length===2)for(var a=0,s=t.length,i;a<s;a++)(i||!(a in t))&&(i||(i=Array.prototype.slice.call(t,0,a)),i[a]=t[a]);return e.concat(i||t)}var ko=(function(){function e(t,r,a,s){this.left=t,this.top=r,this.width=a,this.height=s}return e.prototype.add=function(t,r,a,s){return new e(this.left+t,this.top+r,this.width+a,this.height+s)},e.fromClientRect=function(t,r){return new e(r.left+t.windowBounds.left,r.top+t.windowBounds.top,r.width,r.height)},e.fromDOMRectList=function(t,r){var a=Array.from(r).find(function(s){return s.width!==0});return a?new e(a.left+t.windowBounds.left,a.top+t.windowBounds.top,a.width,a.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e})(),mv=function(e,t){return ko.fromClientRect(e,t.getBoundingClientRect())},fSe=function(e){var t=e.body,r=e.documentElement;if(!t||!r)throw new Error("Unable to get document size");var a=Math.max(Math.max(t.scrollWidth,r.scrollWidth),Math.max(t.offsetWidth,r.offsetWidth),Math.max(t.clientWidth,r.clientWidth)),s=Math.max(Math.max(t.scrollHeight,r.scrollHeight),Math.max(t.offsetHeight,r.offsetHeight),Math.max(t.clientHeight,r.clientHeight));return new ko(0,0,a,s)},gv=function(e){for(var t=[],r=0,a=e.length;r<a;){var s=e.charCodeAt(r++);if(s>=55296&&s<=56319&&r<a){var i=e.charCodeAt(r++);(i&64512)===56320?t.push(((s&1023)<<10)+(i&1023)+65536):(t.push(s),r--)}else t.push(s)}return t},ba=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var r=e.length;if(!r)return"";for(var a=[],s=-1,i="";++s<r;){var l=e[s];l<=65535?a.push(l):(l-=65536,a.push((l>>10)+55296,l%1024+56320)),(s+1===r||a.length>16384)&&(i+=String.fromCharCode.apply(String,a),a.length=0)}return i},gU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pSe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var tm=0;tm<gU.length;tm++)pSe[gU.charCodeAt(tm)]=tm;var bU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",kf=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var rm=0;rm<bU.length;rm++)kf[bU.charCodeAt(rm)]=rm;var xSe=function(e){var t=e.length*.75,r=e.length,a,s=0,i,l,o,d;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var u=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(t):new Array(t),f=Array.isArray(u)?u:new Uint8Array(u);for(a=0;a<r;a+=4)i=kf[e.charCodeAt(a)],l=kf[e.charCodeAt(a+1)],o=kf[e.charCodeAt(a+2)],d=kf[e.charCodeAt(a+3)],f[s++]=i<<2|l>>4,f[s++]=(l&15)<<4|o>>2,f[s++]=(o&3)<<6|d&63;return u},hSe=function(e){for(var t=e.length,r=[],a=0;a<t;a+=2)r.push(e[a+1]<<8|e[a]);return r},mSe=function(e){for(var t=e.length,r=[],a=0;a<t;a+=4)r.push(e[a+3]<<24|e[a+2]<<16|e[a+1]<<8|e[a]);return r},Ud=5,VE=11,H2=2,gSe=VE-Ud,IH=65536>>Ud,bSe=1<<Ud,z2=bSe-1,vSe=1024>>Ud,ySe=IH+vSe,wSe=ySe,NSe=32,CSe=wSe+NSe,kSe=65536>>VE,jSe=1<<gSe,ESe=jSe-1,vU=function(e,t,r){return e.slice?e.slice(t,r):new Uint16Array(Array.prototype.slice.call(e,t,r))},SSe=function(e,t,r){return e.slice?e.slice(t,r):new Uint32Array(Array.prototype.slice.call(e,t,r))},BSe=function(e,t){var r=xSe(e),a=Array.isArray(r)?mSe(r):new Uint32Array(r),s=Array.isArray(r)?hSe(r):new Uint16Array(r),i=24,l=vU(s,i/2,a[4]/2),o=a[5]===2?vU(s,(i+a[4])/2):SSe(a,Math.ceil((i+a[4])/4));return new _Se(a[0],a[1],a[2],a[3],l,o)},_Se=(function(){function e(t,r,a,s,i,l){this.initialValue=t,this.errorValue=r,this.highStart=a,this.highValueIndex=s,this.index=i,this.data=l}return e.prototype.get=function(t){var r;if(t>=0){if(t<55296||t>56319&&t<=65535)return r=this.index[t>>Ud],r=(r<<H2)+(t&z2),this.data[r];if(t<=65535)return r=this.index[IH+(t-55296>>Ud)],r=(r<<H2)+(t&z2),this.data[r];if(t<this.highStart)return r=CSe-kSe+(t>>VE),r=this.index[r],r+=t>>Ud&ESe,r=this.index[r],r=(r<<H2)+(t&z2),this.data[r];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e})(),yU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",TSe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var am=0;am<yU.length;am++)TSe[yU.charCodeAt(am)]=am;var ISe=" ",wU=50,FSe=1,FH=2,DH=3,DSe=4,USe=5,NU=7,UH=8,CU=9,Nc=10,RC=11,kU=12,OC=13,MSe=14,jf=15,PC=16,nm=17,uf=18,RSe=19,jU=20,LC=21,Af=22,$2=23,Zu=24,Fs=25,Ef=26,Sf=27,eA=28,OSe=29,vd=30,PSe=31,sm=32,im=33,QC=34,HC=35,zC=36,Bp=37,$C=38,Mm=39,Rm=40,V2=41,MH=42,LSe=43,QSe=[9001,65288],RH="!",zt="×",lm="÷",VC=BSe(ISe),eo=[vd,zC],GC=[FSe,FH,DH,USe],OH=[Nc,UH],EU=[Sf,Ef],HSe=GC.concat(OH),SU=[$C,Mm,Rm,QC,HC],zSe=[jf,OC],$Se=function(e,t){t===void 0&&(t="strict");var r=[],a=[],s=[];return e.forEach(function(i,l){var o=VC.get(i);if(o>wU?(s.push(!0),o-=wU):s.push(!1),["normal","auto","loose"].indexOf(t)!==-1&&[8208,8211,12316,12448].indexOf(i)!==-1)return a.push(l),r.push(PC);if(o===DSe||o===RC){if(l===0)return a.push(l),r.push(vd);var d=r[l-1];return HSe.indexOf(d)===-1?(a.push(a[l-1]),r.push(d)):(a.push(l),r.push(vd))}if(a.push(l),o===PSe)return r.push(t==="strict"?LC:Bp);if(o===MH||o===OSe)return r.push(vd);if(o===LSe)return i>=131072&&i<=196605||i>=196608&&i<=262141?r.push(Bp):r.push(vd);r.push(o)}),[a,r,s]},G2=function(e,t,r,a){var s=a[r];if(Array.isArray(e)?e.indexOf(s)!==-1:e===s)for(var i=r;i<=a.length;){i++;var l=a[i];if(l===t)return!0;if(l!==Nc)break}if(s===Nc)for(var i=r;i>0;){i--;var o=a[i];if(Array.isArray(e)?e.indexOf(o)!==-1:e===o)for(var d=r;d<=a.length;){d++;var l=a[d];if(l===t)return!0;if(l!==Nc)break}if(o!==Nc)break}return!1},BU=function(e,t){for(var r=e;r>=0;){var a=t[r];if(a===Nc)r--;else return a}return 0},VSe=function(e,t,r,a,s){if(r[a]===0)return zt;var i=a-1;if(Array.isArray(s)&&s[i]===!0)return zt;var l=i-1,o=i+1,d=t[i],u=l>=0?t[l]:0,f=t[o];if(d===FH&&f===DH)return zt;if(GC.indexOf(d)!==-1)return RH;if(GC.indexOf(f)!==-1||OH.indexOf(f)!==-1)return zt;if(BU(i,t)===UH)return lm;if(VC.get(e[i])===RC||(d===sm||d===im)&&VC.get(e[o])===RC||d===NU||f===NU||d===CU||[Nc,OC,jf].indexOf(d)===-1&&f===CU||[nm,uf,RSe,Zu,eA].indexOf(f)!==-1||BU(i,t)===Af||G2($2,Af,i,t)||G2([nm,uf],LC,i,t)||G2(kU,kU,i,t))return zt;if(d===Nc)return lm;if(d===$2||f===$2)return zt;if(f===PC||d===PC)return lm;if([OC,jf,LC].indexOf(f)!==-1||d===MSe||u===zC&&zSe.indexOf(d)!==-1||d===eA&&f===zC||f===jU||eo.indexOf(f)!==-1&&d===Fs||eo.indexOf(d)!==-1&&f===Fs||d===Sf&&[Bp,sm,im].indexOf(f)!==-1||[Bp,sm,im].indexOf(d)!==-1&&f===Ef||eo.indexOf(d)!==-1&&EU.indexOf(f)!==-1||EU.indexOf(d)!==-1&&eo.indexOf(f)!==-1||[Sf,Ef].indexOf(d)!==-1&&(f===Fs||[Af,jf].indexOf(f)!==-1&&t[o+1]===Fs)||[Af,jf].indexOf(d)!==-1&&f===Fs||d===Fs&&[Fs,eA,Zu].indexOf(f)!==-1)return zt;if([Fs,eA,Zu,nm,uf].indexOf(f)!==-1)for(var p=i;p>=0;){var h=t[p];if(h===Fs)return zt;if([eA,Zu].indexOf(h)!==-1)p--;else break}if([Sf,Ef].indexOf(f)!==-1)for(var p=[nm,uf].indexOf(d)!==-1?l:i;p>=0;){var h=t[p];if(h===Fs)return zt;if([eA,Zu].indexOf(h)!==-1)p--;else break}if($C===d&&[$C,Mm,QC,HC].indexOf(f)!==-1||[Mm,QC].indexOf(d)!==-1&&[Mm,Rm].indexOf(f)!==-1||[Rm,HC].indexOf(d)!==-1&&f===Rm||SU.indexOf(d)!==-1&&[jU,Ef].indexOf(f)!==-1||SU.indexOf(f)!==-1&&d===Sf||eo.indexOf(d)!==-1&&eo.indexOf(f)!==-1||d===Zu&&eo.indexOf(f)!==-1||eo.concat(Fs).indexOf(d)!==-1&&f===Af&&QSe.indexOf(e[o])===-1||eo.concat(Fs).indexOf(f)!==-1&&d===uf)return zt;if(d===V2&&f===V2){for(var m=r[i],b=1;m>0&&(m--,t[m]===V2);)b++;if(b%2!==0)return zt}return d===sm&&f===im?zt:lm},GSe=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var r=$Se(e,t.lineBreak),a=r[0],s=r[1],i=r[2];(t.wordBreak==="break-all"||t.wordBreak==="break-word")&&(s=s.map(function(o){return[Fs,vd,MH].indexOf(o)!==-1?Bp:o}));var l=t.wordBreak==="keep-all"?i.map(function(o,d){return o&&e[d]>=19968&&e[d]<=40959}):void 0;return[a,s,l]},KSe=(function(){function e(t,r,a,s){this.codePoints=t,this.required=r===RH,this.start=a,this.end=s}return e.prototype.slice=function(){return ba.apply(void 0,this.codePoints.slice(this.start,this.end))},e})(),qSe=function(e,t){var r=gv(e),a=GSe(r,t),s=a[0],i=a[1],l=a[2],o=r.length,d=0,u=0;return{next:function(){if(u>=o)return{done:!0,value:null};for(var f=zt;u<o&&(f=VSe(r,i,s,++u,l))===zt;);if(f!==zt||u===o){var p=new KSe(r,f,d,u);return d=u,{value:p,done:!1}}return{done:!0,value:null}}}},WSe=1,YSe=2,lx=4,_U=8,eb=10,TU=47,Hf=92,XSe=9,JSe=32,om=34,ff=61,ZSe=35,e4e=36,t4e=37,cm=39,dm=40,pf=41,r4e=95,ps=45,a4e=33,n4e=60,s4e=62,i4e=64,l4e=91,o4e=93,c4e=61,d4e=123,um=63,u4e=125,IU=124,A4e=126,f4e=128,FU=65533,K2=42,jd=43,p4e=44,x4e=58,h4e=59,_p=46,m4e=0,g4e=8,b4e=11,v4e=14,y4e=31,w4e=127,dl=-1,PH=48,LH=97,QH=101,N4e=102,C4e=117,k4e=122,HH=65,zH=69,$H=70,j4e=85,E4e=90,Un=function(e){return e>=PH&&e<=57},S4e=function(e){return e>=55296&&e<=57343},tA=function(e){return Un(e)||e>=HH&&e<=$H||e>=LH&&e<=N4e},B4e=function(e){return e>=LH&&e<=k4e},_4e=function(e){return e>=HH&&e<=E4e},T4e=function(e){return B4e(e)||_4e(e)},I4e=function(e){return e>=f4e},Am=function(e){return e===eb||e===XSe||e===JSe},tb=function(e){return T4e(e)||I4e(e)||e===r4e},DU=function(e){return tb(e)||Un(e)||e===ps},F4e=function(e){return e>=m4e&&e<=g4e||e===b4e||e>=v4e&&e<=y4e||e===w4e},mc=function(e,t){return e!==Hf?!1:t!==eb},fm=function(e,t,r){return e===ps?tb(t)||mc(t,r):tb(e)?!0:!!(e===Hf&&mc(e,t))},q2=function(e,t,r){return e===jd||e===ps?Un(t)?!0:t===_p&&Un(r):Un(e===_p?t:e)},D4e=function(e){var t=0,r=1;(e[t]===jd||e[t]===ps)&&(e[t]===ps&&(r=-1),t++);for(var a=[];Un(e[t]);)a.push(e[t++]);var s=a.length?parseInt(ba.apply(void 0,a),10):0;e[t]===_p&&t++;for(var i=[];Un(e[t]);)i.push(e[t++]);var l=i.length,o=l?parseInt(ba.apply(void 0,i),10):0;(e[t]===zH||e[t]===QH)&&t++;var d=1;(e[t]===jd||e[t]===ps)&&(e[t]===ps&&(d=-1),t++);for(var u=[];Un(e[t]);)u.push(e[t++]);var f=u.length?parseInt(ba.apply(void 0,u),10):0;return r*(s+o*Math.pow(10,-l))*Math.pow(10,d*f)},U4e={type:2},M4e={type:3},R4e={type:4},O4e={type:13},P4e={type:8},L4e={type:21},Q4e={type:9},H4e={type:10},z4e={type:11},$4e={type:12},V4e={type:14},pm={type:23},G4e={type:1},K4e={type:25},q4e={type:24},W4e={type:26},Y4e={type:27},X4e={type:28},J4e={type:29},Z4e={type:31},KC={type:32},VH=(function(){function e(){this._value=[]}return e.prototype.write=function(t){this._value=this._value.concat(gv(t))},e.prototype.read=function(){for(var t=[],r=this.consumeToken();r!==KC;)t.push(r),r=this.consumeToken();return t},e.prototype.consumeToken=function(){var t=this.consumeCodePoint();switch(t){case om:return this.consumeStringToken(om);case ZSe:var r=this.peekCodePoint(0),a=this.peekCodePoint(1),s=this.peekCodePoint(2);if(DU(r)||mc(a,s)){var i=fm(r,a,s)?YSe:WSe,l=this.consumeName();return{type:5,value:l,flags:i}}break;case e4e:if(this.peekCodePoint(0)===ff)return this.consumeCodePoint(),O4e;break;case cm:return this.consumeStringToken(cm);case dm:return U4e;case pf:return M4e;case K2:if(this.peekCodePoint(0)===ff)return this.consumeCodePoint(),V4e;break;case jd:if(q2(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case p4e:return R4e;case ps:var o=t,d=this.peekCodePoint(0),u=this.peekCodePoint(1);if(q2(o,d,u))return this.reconsumeCodePoint(t),this.consumeNumericToken();if(fm(o,d,u))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();if(d===ps&&u===s4e)return this.consumeCodePoint(),this.consumeCodePoint(),q4e;break;case _p:if(q2(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case TU:if(this.peekCodePoint(0)===K2)for(this.consumeCodePoint();;){var f=this.consumeCodePoint();if(f===K2&&(f=this.consumeCodePoint(),f===TU))return this.consumeToken();if(f===dl)return this.consumeToken()}break;case x4e:return W4e;case h4e:return Y4e;case n4e:if(this.peekCodePoint(0)===a4e&&this.peekCodePoint(1)===ps&&this.peekCodePoint(2)===ps)return this.consumeCodePoint(),this.consumeCodePoint(),K4e;break;case i4e:var p=this.peekCodePoint(0),h=this.peekCodePoint(1),m=this.peekCodePoint(2);if(fm(p,h,m)){var l=this.consumeName();return{type:7,value:l}}break;case l4e:return X4e;case Hf:if(mc(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();break;case o4e:return J4e;case c4e:if(this.peekCodePoint(0)===ff)return this.consumeCodePoint(),P4e;break;case d4e:return z4e;case u4e:return $4e;case C4e:case j4e:var b=this.peekCodePoint(0),v=this.peekCodePoint(1);return b===jd&&(tA(v)||v===um)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(t),this.consumeIdentLikeToken();case IU:if(this.peekCodePoint(0)===ff)return this.consumeCodePoint(),Q4e;if(this.peekCodePoint(0)===IU)return this.consumeCodePoint(),L4e;break;case A4e:if(this.peekCodePoint(0)===ff)return this.consumeCodePoint(),H4e;break;case dl:return KC}return Am(t)?(this.consumeWhiteSpace(),Z4e):Un(t)?(this.reconsumeCodePoint(t),this.consumeNumericToken()):tb(t)?(this.reconsumeCodePoint(t),this.consumeIdentLikeToken()):{type:6,value:ba(t)}},e.prototype.consumeCodePoint=function(){var t=this._value.shift();return typeof t>"u"?-1:t},e.prototype.reconsumeCodePoint=function(t){this._value.unshift(t)},e.prototype.peekCodePoint=function(t){return t>=this._value.length?-1:this._value[t]},e.prototype.consumeUnicodeRangeToken=function(){for(var t=[],r=this.consumeCodePoint();tA(r)&&t.length<6;)t.push(r),r=this.consumeCodePoint();for(var a=!1;r===um&&t.length<6;)t.push(r),r=this.consumeCodePoint(),a=!0;if(a){var s=parseInt(ba.apply(void 0,t.map(function(d){return d===um?PH:d})),16),i=parseInt(ba.apply(void 0,t.map(function(d){return d===um?$H:d})),16);return{type:30,start:s,end:i}}var l=parseInt(ba.apply(void 0,t),16);if(this.peekCodePoint(0)===ps&&tA(this.peekCodePoint(1))){this.consumeCodePoint(),r=this.consumeCodePoint();for(var o=[];tA(r)&&o.length<6;)o.push(r),r=this.consumeCodePoint();var i=parseInt(ba.apply(void 0,o),16);return{type:30,start:l,end:i}}else return{type:30,start:l,end:l}},e.prototype.consumeIdentLikeToken=function(){var t=this.consumeName();return t.toLowerCase()==="url"&&this.peekCodePoint(0)===dm?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===dm?(this.consumeCodePoint(),{type:19,value:t}):{type:20,value:t}},e.prototype.consumeUrlToken=function(){var t=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===dl)return{type:22,value:""};var r=this.peekCodePoint(0);if(r===cm||r===om){var a=this.consumeStringToken(this.consumeCodePoint());return a.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===dl||this.peekCodePoint(0)===pf)?(this.consumeCodePoint(),{type:22,value:a.value}):(this.consumeBadUrlRemnants(),pm)}for(;;){var s=this.consumeCodePoint();if(s===dl||s===pf)return{type:22,value:ba.apply(void 0,t)};if(Am(s))return this.consumeWhiteSpace(),this.peekCodePoint(0)===dl||this.peekCodePoint(0)===pf?(this.consumeCodePoint(),{type:22,value:ba.apply(void 0,t)}):(this.consumeBadUrlRemnants(),pm);if(s===om||s===cm||s===dm||F4e(s))return this.consumeBadUrlRemnants(),pm;if(s===Hf)if(mc(s,this.peekCodePoint(0)))t.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),pm;else t.push(s)}},e.prototype.consumeWhiteSpace=function(){for(;Am(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var t=this.consumeCodePoint();if(t===pf||t===dl)return;mc(t,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(t){for(var r=5e4,a="";t>0;){var s=Math.min(r,t);a+=ba.apply(void 0,this._value.splice(0,s)),t-=s}return this._value.shift(),a},e.prototype.consumeStringToken=function(t){var r="",a=0;do{var s=this._value[a];if(s===dl||s===void 0||s===t)return r+=this.consumeStringSlice(a),{type:0,value:r};if(s===eb)return this._value.splice(0,a),G4e;if(s===Hf){var i=this._value[a+1];i!==dl&&i!==void 0&&(i===eb?(r+=this.consumeStringSlice(a),a=-1,this._value.shift()):mc(s,i)&&(r+=this.consumeStringSlice(a),r+=ba(this.consumeEscapedCodePoint()),a=-1))}a++}while(!0)},e.prototype.consumeNumber=function(){var t=[],r=lx,a=this.peekCodePoint(0);for((a===jd||a===ps)&&t.push(this.consumeCodePoint());Un(this.peekCodePoint(0));)t.push(this.consumeCodePoint());a=this.peekCodePoint(0);var s=this.peekCodePoint(1);if(a===_p&&Un(s))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),r=_U;Un(this.peekCodePoint(0));)t.push(this.consumeCodePoint());a=this.peekCodePoint(0),s=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((a===zH||a===QH)&&((s===jd||s===ps)&&Un(i)||Un(s)))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),r=_U;Un(this.peekCodePoint(0));)t.push(this.consumeCodePoint());return[D4e(t),r]},e.prototype.consumeNumericToken=function(){var t=this.consumeNumber(),r=t[0],a=t[1],s=this.peekCodePoint(0),i=this.peekCodePoint(1),l=this.peekCodePoint(2);if(fm(s,i,l)){var o=this.consumeName();return{type:15,number:r,flags:a,unit:o}}return s===t4e?(this.consumeCodePoint(),{type:16,number:r,flags:a}):{type:17,number:r,flags:a}},e.prototype.consumeEscapedCodePoint=function(){var t=this.consumeCodePoint();if(tA(t)){for(var r=ba(t);tA(this.peekCodePoint(0))&&r.length<6;)r+=ba(this.consumeCodePoint());Am(this.peekCodePoint(0))&&this.consumeCodePoint();var a=parseInt(r,16);return a===0||S4e(a)||a>1114111?FU:a}return t===dl?FU:t},e.prototype.consumeName=function(){for(var t="";;){var r=this.consumeCodePoint();if(DU(r))t+=ba(r);else if(mc(r,this.peekCodePoint(0)))t+=ba(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(r),t}},e})(),GH=(function(){function e(t){this._tokens=t}return e.create=function(t){var r=new VH;return r.write(t),new e(r.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var t=this.consumeToken();t.type===31;)t=this.consumeToken();if(t.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(t);var r=this.consumeComponentValue();do t=this.consumeToken();while(t.type===31);if(t.type===32)return r;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var t=[];;){var r=this.consumeComponentValue();if(r.type===32)return t;t.push(r),t.push()}},e.prototype.consumeComponentValue=function(){var t=this.consumeToken();switch(t.type){case 11:case 28:case 2:return this.consumeSimpleBlock(t.type);case 19:return this.consumeFunction(t)}return t},e.prototype.consumeSimpleBlock=function(t){for(var r={type:t,values:[]},a=this.consumeToken();;){if(a.type===32||tBe(a,t))return r;this.reconsumeToken(a),r.values.push(this.consumeComponentValue()),a=this.consumeToken()}},e.prototype.consumeFunction=function(t){for(var r={name:t.value,values:[],type:18};;){var a=this.consumeToken();if(a.type===32||a.type===3)return r;this.reconsumeToken(a),r.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var t=this._tokens.shift();return typeof t>"u"?KC:t},e.prototype.reconsumeToken=function(t){this._tokens.unshift(t)},e})(),ox=function(e){return e.type===15},i0=function(e){return e.type===17},mr=function(e){return e.type===20},eBe=function(e){return e.type===0},qC=function(e,t){return mr(e)&&e.value===t},KH=function(e){return e.type!==31},RA=function(e){return e.type!==31&&e.type!==4},Fl=function(e){var t=[],r=[];return e.forEach(function(a){if(a.type===4){if(r.length===0)throw new Error("Error parsing function args, zero tokens for arg");t.push(r),r=[];return}a.type!==31&&r.push(a)}),r.length&&t.push(r),t},tBe=function(e,t){return t===11&&e.type===12||t===28&&e.type===29?!0:t===2&&e.type===3},Oc=function(e){return e.type===17||e.type===15},Ta=function(e){return e.type===16||Oc(e)},qH=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},Nn={type:17,number:0,flags:lx},GE={type:16,number:50,flags:lx},Cc={type:16,number:100,flags:lx},Bf=function(e,t,r){var a=e[0],s=e[1];return[Er(a,t),Er(typeof s<"u"?s:a,r)]},Er=function(e,t){if(e.type===16)return e.number/100*t;if(ox(e))switch(e.unit){case"rem":case"em":return 16*e.number;case"px":default:return e.number}return e.number},WH="deg",YH="grad",XH="rad",JH="turn",bv={name:"angle",parse:function(e,t){if(t.type===15)switch(t.unit){case WH:return Math.PI*t.number/180;case YH:return Math.PI/200*t.number;case XH:return t.number;case JH:return Math.PI*2*t.number}throw new Error("Unsupported angle type")}},ZH=function(e){return e.type===15&&(e.unit===WH||e.unit===YH||e.unit===XH||e.unit===JH)},ez=function(e){var t=e.filter(mr).map(function(r){return r.value}).join(" ");switch(t){case"to bottom right":case"to right bottom":case"left top":case"top left":return[Nn,Nn];case"to top":case"bottom":return gi(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[Nn,Cc];case"to right":case"left":return gi(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Cc,Cc];case"to bottom":case"top":return gi(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Cc,Nn];case"to left":case"right":return gi(270)}return 0},gi=function(e){return Math.PI*e/180},Sc={name:"color",parse:function(e,t){if(t.type===18){var r=rBe[t.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return r(e,t.values)}if(t.type===5){if(t.value.length===3){var a=t.value.substring(0,1),s=t.value.substring(1,2),i=t.value.substring(2,3);return kc(parseInt(a+a,16),parseInt(s+s,16),parseInt(i+i,16),1)}if(t.value.length===4){var a=t.value.substring(0,1),s=t.value.substring(1,2),i=t.value.substring(2,3),l=t.value.substring(3,4);return kc(parseInt(a+a,16),parseInt(s+s,16),parseInt(i+i,16),parseInt(l+l,16)/255)}if(t.value.length===6){var a=t.value.substring(0,2),s=t.value.substring(2,4),i=t.value.substring(4,6);return kc(parseInt(a,16),parseInt(s,16),parseInt(i,16),1)}if(t.value.length===8){var a=t.value.substring(0,2),s=t.value.substring(2,4),i=t.value.substring(4,6),l=t.value.substring(6,8);return kc(parseInt(a,16),parseInt(s,16),parseInt(i,16),parseInt(l,16)/255)}}if(t.type===20){var o=po[t.value.toUpperCase()];if(typeof o<"u")return o}return po.TRANSPARENT}},Bc=function(e){return(255&e)===0},Wa=function(e){var t=255&e,r=255&e>>8,a=255&e>>16,s=255&e>>24;return t<255?"rgba("+s+","+a+","+r+","+t/255+")":"rgb("+s+","+a+","+r+")"},kc=function(e,t,r,a){return(e<<24|t<<16|r<<8|Math.round(a*255)<<0)>>>0},UU=function(e,t){if(e.type===17)return e.number;if(e.type===16){var r=t===3?1:255;return t===3?e.number/100*r:Math.round(e.number/100*r)}return 0},MU=function(e,t){var r=t.filter(RA);if(r.length===3){var a=r.map(UU),s=a[0],i=a[1],l=a[2];return kc(s,i,l,1)}if(r.length===4){var o=r.map(UU),s=o[0],i=o[1],l=o[2],d=o[3];return kc(s,i,l,d)}return 0};function W2(e,t,r){return r<0&&(r+=1),r>=1&&(r-=1),r<1/6?(t-e)*r*6+e:r<1/2?t:r<2/3?(t-e)*6*(2/3-r)+e:e}var RU=function(e,t){var r=t.filter(RA),a=r[0],s=r[1],i=r[2],l=r[3],o=(a.type===17?gi(a.number):bv.parse(e,a))/(Math.PI*2),d=Ta(s)?s.number/100:0,u=Ta(i)?i.number/100:0,f=typeof l<"u"&&Ta(l)?Er(l,1):1;if(d===0)return kc(u*255,u*255,u*255,1);var p=u<=.5?u*(d+1):u+d-u*d,h=u*2-p,m=W2(h,p,o+1/3),b=W2(h,p,o),v=W2(h,p,o-1/3);return kc(m*255,b*255,v*255,f)},rBe={hsl:RU,hsla:RU,rgb:MU,rgba:MU},zf=function(e,t){return Sc.parse(e,GH.create(t).parseComponentValue())},po={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},aBe={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(r){if(mr(r))switch(r.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},nBe={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},vv=function(e,t){var r=Sc.parse(e,t[0]),a=t[1];return a&&Ta(a)?{color:r,stop:a}:{color:r,stop:null}},OU=function(e,t){var r=e[0],a=e[e.length-1];r.stop===null&&(r.stop=Nn),a.stop===null&&(a.stop=Cc);for(var s=[],i=0,l=0;l<e.length;l++){var o=e[l].stop;if(o!==null){var d=Er(o,t);d>i?s.push(d):s.push(i),i=d}else s.push(null)}for(var u=null,l=0;l<s.length;l++){var f=s[l];if(f===null)u===null&&(u=l);else if(u!==null){for(var p=l-u,h=s[u-1],m=(f-h)/(p+1),b=1;b<=p;b++)s[u+b-1]=m*b;u=null}}return e.map(function(v,y){var j=v.color;return{color:j,stop:Math.max(Math.min(1,s[y]/t),0)}})},sBe=function(e,t,r){var a=t/2,s=r/2,i=Er(e[0],t)-a,l=s-Er(e[1],r);return(Math.atan2(l,i)+Math.PI*2)%(Math.PI*2)},iBe=function(e,t,r){var a=typeof e=="number"?e:sBe(e,t,r),s=Math.abs(t*Math.sin(a))+Math.abs(r*Math.cos(a)),i=t/2,l=r/2,o=s/2,d=Math.sin(a-Math.PI/2)*o,u=Math.cos(a-Math.PI/2)*o;return[s,i-u,i+u,l-d,l+d]},Ui=function(e,t){return Math.sqrt(e*e+t*t)},PU=function(e,t,r,a,s){var i=[[0,0],[0,t],[e,0],[e,t]];return i.reduce(function(l,o){var d=o[0],u=o[1],f=Ui(r-d,a-u);return(s?f<l.optimumDistance:f>l.optimumDistance)?{optimumCorner:o,optimumDistance:f}:l},{optimumDistance:s?1/0:-1/0,optimumCorner:null}).optimumCorner},lBe=function(e,t,r,a,s){var i=0,l=0;switch(e.size){case 0:e.shape===0?i=l=Math.min(Math.abs(t),Math.abs(t-a),Math.abs(r),Math.abs(r-s)):e.shape===1&&(i=Math.min(Math.abs(t),Math.abs(t-a)),l=Math.min(Math.abs(r),Math.abs(r-s)));break;case 2:if(e.shape===0)i=l=Math.min(Ui(t,r),Ui(t,r-s),Ui(t-a,r),Ui(t-a,r-s));else if(e.shape===1){var o=Math.min(Math.abs(r),Math.abs(r-s))/Math.min(Math.abs(t),Math.abs(t-a)),d=PU(a,s,t,r,!0),u=d[0],f=d[1];i=Ui(u-t,(f-r)/o),l=o*i}break;case 1:e.shape===0?i=l=Math.max(Math.abs(t),Math.abs(t-a),Math.abs(r),Math.abs(r-s)):e.shape===1&&(i=Math.max(Math.abs(t),Math.abs(t-a)),l=Math.max(Math.abs(r),Math.abs(r-s)));break;case 3:if(e.shape===0)i=l=Math.max(Ui(t,r),Ui(t,r-s),Ui(t-a,r),Ui(t-a,r-s));else if(e.shape===1){var o=Math.max(Math.abs(r),Math.abs(r-s))/Math.max(Math.abs(t),Math.abs(t-a)),p=PU(a,s,t,r,!1),u=p[0],f=p[1];i=Ui(u-t,(f-r)/o),l=o*i}break}return Array.isArray(e.size)&&(i=Er(e.size[0],a),l=e.size.length===2?Er(e.size[1],s):i),[i,l]},oBe=function(e,t){var r=gi(180),a=[];return Fl(t).forEach(function(s,i){if(i===0){var l=s[0];if(l.type===20&&l.value==="to"){r=ez(s);return}else if(ZH(l)){r=bv.parse(e,l);return}}var o=vv(e,s);a.push(o)}),{angle:r,stops:a,type:1}},xm=function(e,t){var r=gi(180),a=[];return Fl(t).forEach(function(s,i){if(i===0){var l=s[0];if(l.type===20&&["top","left","right","bottom"].indexOf(l.value)!==-1){r=ez(s);return}else if(ZH(l)){r=(bv.parse(e,l)+gi(270))%gi(360);return}}var o=vv(e,s);a.push(o)}),{angle:r,stops:a,type:1}},cBe=function(e,t){var r=gi(180),a=[],s=1,i=0,l=3,o=[];return Fl(t).forEach(function(d,u){var f=d[0];if(u===0){if(mr(f)&&f.value==="linear"){s=1;return}else if(mr(f)&&f.value==="radial"){s=2;return}}if(f.type===18){if(f.name==="from"){var p=Sc.parse(e,f.values[0]);a.push({stop:Nn,color:p})}else if(f.name==="to"){var p=Sc.parse(e,f.values[0]);a.push({stop:Cc,color:p})}else if(f.name==="color-stop"){var h=f.values.filter(RA);if(h.length===2){var p=Sc.parse(e,h[1]),m=h[0];i0(m)&&a.push({stop:{type:16,number:m.number*100,flags:m.flags},color:p})}}}}),s===1?{angle:(r+gi(180))%gi(360),stops:a,type:s}:{size:l,shape:i,stops:a,position:o,type:s}},tz="closest-side",rz="farthest-side",az="closest-corner",nz="farthest-corner",sz="circle",iz="ellipse",lz="cover",oz="contain",dBe=function(e,t){var r=0,a=3,s=[],i=[];return Fl(t).forEach(function(l,o){var d=!0;if(o===0){var u=!1;d=l.reduce(function(p,h){if(u)if(mr(h))switch(h.value){case"center":return i.push(GE),p;case"top":case"left":return i.push(Nn),p;case"right":case"bottom":return i.push(Cc),p}else(Ta(h)||Oc(h))&&i.push(h);else if(mr(h))switch(h.value){case sz:return r=0,!1;case iz:return r=1,!1;case"at":return u=!0,!1;case tz:return a=0,!1;case lz:case rz:return a=1,!1;case oz:case az:return a=2,!1;case nz:return a=3,!1}else if(Oc(h)||Ta(h))return Array.isArray(a)||(a=[]),a.push(h),!1;return p},d)}if(d){var f=vv(e,l);s.push(f)}}),{size:a,shape:r,stops:s,position:i,type:2}},hm=function(e,t){var r=0,a=3,s=[],i=[];return Fl(t).forEach(function(l,o){var d=!0;if(o===0?d=l.reduce(function(f,p){if(mr(p))switch(p.value){case"center":return i.push(GE),!1;case"top":case"left":return i.push(Nn),!1;case"right":case"bottom":return i.push(Cc),!1}else if(Ta(p)||Oc(p))return i.push(p),!1;return f},d):o===1&&(d=l.reduce(function(f,p){if(mr(p))switch(p.value){case sz:return r=0,!1;case iz:return r=1,!1;case oz:case tz:return a=0,!1;case rz:return a=1,!1;case az:return a=2,!1;case lz:case nz:return a=3,!1}else if(Oc(p)||Ta(p))return Array.isArray(a)||(a=[]),a.push(p),!1;return f},d)),d){var u=vv(e,l);s.push(u)}}),{size:a,shape:r,stops:s,position:i,type:2}},uBe=function(e){return e.type===1},ABe=function(e){return e.type===2},KE={name:"image",parse:function(e,t){if(t.type===22){var r={url:t.value,type:0};return e.cache.addImage(t.value),r}if(t.type===18){var a=cz[t.name];if(typeof a>"u")throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return a(e,t.values)}throw new Error("Unsupported image type "+t.type)}};function fBe(e){return!(e.type===20&&e.value==="none")&&(e.type!==18||!!cz[e.name])}var cz={"linear-gradient":oBe,"-moz-linear-gradient":xm,"-ms-linear-gradient":xm,"-o-linear-gradient":xm,"-webkit-linear-gradient":xm,"radial-gradient":dBe,"-moz-radial-gradient":hm,"-ms-radial-gradient":hm,"-o-radial-gradient":hm,"-webkit-radial-gradient":hm,"-webkit-gradient":cBe},pBe={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(t.length===0)return[];var r=t[0];return r.type===20&&r.value==="none"?[]:t.filter(function(a){return RA(a)&&fBe(a)}).map(function(a){return KE.parse(e,a)})}},xBe={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(r){if(mr(r))switch(r.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},hBe={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return Fl(t).map(function(r){return r.filter(Ta)}).map(qH)}},mBe={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return Fl(t).map(function(r){return r.filter(mr).map(function(a){return a.value}).join(" ")}).map(gBe)}},gBe=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},kA;(function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"})(kA||(kA={}));var bBe={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return Fl(t).map(function(r){return r.filter(vBe)})}},vBe=function(e){return mr(e)||Ta(e)},yv=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},yBe=yv("top"),wBe=yv("right"),NBe=yv("bottom"),CBe=yv("left"),wv=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(t,r){return qH(r.filter(Ta))}}},kBe=wv("top-left"),jBe=wv("top-right"),EBe=wv("bottom-right"),SBe=wv("bottom-left"),Nv=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(t,r){switch(r){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},BBe=Nv("top"),_Be=Nv("right"),TBe=Nv("bottom"),IBe=Nv("left"),Cv=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(t,r){return ox(r)?r.number:0}}},FBe=Cv("top"),DBe=Cv("right"),UBe=Cv("bottom"),MBe=Cv("left"),RBe={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},OBe={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){switch(t){case"rtl":return 1;case"ltr":default:return 0}}},PBe={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(mr).reduce(function(r,a){return r|LBe(a.value)},0)}},LBe=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},QBe={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},HBe={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return t.type===20&&t.value==="normal"?0:t.type===17||t.type===15?t.number:0}},rb;(function(e){e.NORMAL="normal",e.STRICT="strict"})(rb||(rb={}));var zBe={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"strict":return rb.STRICT;case"normal":default:return rb.NORMAL}}},$Be={name:"line-height",initialValue:"normal",prefix:!1,type:4},LU=function(e,t){return mr(e)&&e.value==="normal"?1.2*t:e.type===17?t*e.number:Ta(e)?Er(e,t):t},VBe={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return t.type===20&&t.value==="none"?null:KE.parse(e,t)}},GBe={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){switch(t){case"inside":return 0;case"outside":default:return 1}}},WC={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},kv=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},KBe=kv("top"),qBe=kv("right"),WBe=kv("bottom"),YBe=kv("left"),XBe={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(mr).map(function(r){switch(r.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},JBe={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-word":return"break-word";case"normal":default:return"normal"}}},jv=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},ZBe=jv("top"),e_e=jv("right"),t_e=jv("bottom"),r_e=jv("left"),a_e={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},n_e={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},s_e={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.length===1&&qC(t[0],"none")?[]:Fl(t).map(function(r){for(var a={color:po.TRANSPARENT,offsetX:Nn,offsetY:Nn,blur:Nn},s=0,i=0;i<r.length;i++){var l=r[i];Oc(l)?(s===0?a.offsetX=l:s===1?a.offsetY=l:a.blur=l,s++):a.color=Sc.parse(e,l)}return a})}},i_e={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},l_e={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,t){if(t.type===20&&t.value==="none")return null;if(t.type===18){var r=d_e[t.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return r(t.values)}return null}},o_e=function(e){var t=e.filter(function(r){return r.type===17}).map(function(r){return r.number});return t.length===6?t:null},c_e=function(e){var t=e.filter(function(d){return d.type===17}).map(function(d){return d.number}),r=t[0],a=t[1];t[2],t[3];var s=t[4],i=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var l=t[12],o=t[13];return t[14],t[15],t.length===16?[r,a,s,i,l,o]:null},d_e={matrix:o_e,matrix3d:c_e},QU={type:16,number:50,flags:lx},u_e=[QU,QU],A_e={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var r=t.filter(Ta);return r.length!==2?u_e:[r[0],r[1]]}},f_e={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},$f;(function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"})($f||($f={}));var p_e={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return $f.BREAK_ALL;case"keep-all":return $f.KEEP_ALL;case"normal":default:return $f.NORMAL}}},x_e={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(t.type===20)return{auto:!0,order:0};if(i0(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},dz={name:"time",parse:function(e,t){if(t.type===15)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")}},h_e={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return i0(t)?t.number:1}},m_e={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},g_e={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter(mr).map(function(r){switch(r.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(r){return r!==0})}},b_e={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,t){var r=[],a=[];return t.forEach(function(s){switch(s.type){case 20:case 0:r.push(s.value);break;case 17:r.push(s.number.toString());break;case 4:a.push(r.join(" ")),r.length=0;break}}),r.length&&a.push(r.join(" ")),a.map(function(s){return s.indexOf(" ")===-1?s:"'"+s+"'"})}},v_e={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},y_e={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){if(i0(t))return t.number;if(mr(t))switch(t.value){case"bold":return 700;case"normal":default:return 400}return 400}},w_e={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(mr).map(function(r){return r.value})}},N_e={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},La=function(e,t){return(e&t)!==0},C_e={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(t.length===0)return[];var r=t[0];return r.type===20&&r.value==="none"?[]:t}},k_e={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(t.length===0)return null;var r=t[0];if(r.type===20&&r.value==="none")return null;for(var a=[],s=t.filter(KH),i=0;i<s.length;i++){var l=s[i],o=s[i+1];if(l.type===20){var d=o&&i0(o)?o.number:1;a.push({counter:l.value,increment:d})}}return a}},j_e={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(t.length===0)return[];for(var r=[],a=t.filter(KH),s=0;s<a.length;s++){var i=a[s],l=a[s+1];if(mr(i)&&i.value!=="none"){var o=l&&i0(l)?l.number:0;r.push({counter:i.value,reset:o})}}return r}},E_e={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(ox).map(function(r){return dz.parse(e,r)})}},S_e={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(t.length===0)return null;var r=t[0];if(r.type===20&&r.value==="none")return null;var a=[],s=t.filter(eBe);if(s.length%2!==0)return null;for(var i=0;i<s.length;i+=2){var l=s[i].value,o=s[i+1].value;a.push({open:l,close:o})}return a}},HU=function(e,t,r){if(!e)return"";var a=e[Math.min(t,e.length-1)];return a?r?a.open:a.close:""},B_e={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.length===1&&qC(t[0],"none")?[]:Fl(t).map(function(r){for(var a={color:255,offsetX:Nn,offsetY:Nn,blur:Nn,spread:Nn,inset:!1},s=0,i=0;i<r.length;i++){var l=r[i];qC(l,"inset")?a.inset=!0:Oc(l)?(s===0?a.offsetX=l:s===1?a.offsetY=l:s===2?a.blur=l:a.spread=l,s++):a.color=Sc.parse(e,l)}return a})}},__e={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,t){var r=[0,1,2],a=[];return t.filter(mr).forEach(function(s){switch(s.value){case"stroke":a.push(1);break;case"fill":a.push(0);break;case"markers":a.push(2);break}}),r.forEach(function(s){a.indexOf(s)===-1&&a.push(s)}),a}},T_e={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},I_e={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return ox(t)?t.number:0}},F_e=(function(){function e(t,r){var a,s;this.animationDuration=st(t,E_e,r.animationDuration),this.backgroundClip=st(t,aBe,r.backgroundClip),this.backgroundColor=st(t,nBe,r.backgroundColor),this.backgroundImage=st(t,pBe,r.backgroundImage),this.backgroundOrigin=st(t,xBe,r.backgroundOrigin),this.backgroundPosition=st(t,hBe,r.backgroundPosition),this.backgroundRepeat=st(t,mBe,r.backgroundRepeat),this.backgroundSize=st(t,bBe,r.backgroundSize),this.borderTopColor=st(t,yBe,r.borderTopColor),this.borderRightColor=st(t,wBe,r.borderRightColor),this.borderBottomColor=st(t,NBe,r.borderBottomColor),this.borderLeftColor=st(t,CBe,r.borderLeftColor),this.borderTopLeftRadius=st(t,kBe,r.borderTopLeftRadius),this.borderTopRightRadius=st(t,jBe,r.borderTopRightRadius),this.borderBottomRightRadius=st(t,EBe,r.borderBottomRightRadius),this.borderBottomLeftRadius=st(t,SBe,r.borderBottomLeftRadius),this.borderTopStyle=st(t,BBe,r.borderTopStyle),this.borderRightStyle=st(t,_Be,r.borderRightStyle),this.borderBottomStyle=st(t,TBe,r.borderBottomStyle),this.borderLeftStyle=st(t,IBe,r.borderLeftStyle),this.borderTopWidth=st(t,FBe,r.borderTopWidth),this.borderRightWidth=st(t,DBe,r.borderRightWidth),this.borderBottomWidth=st(t,UBe,r.borderBottomWidth),this.borderLeftWidth=st(t,MBe,r.borderLeftWidth),this.boxShadow=st(t,B_e,r.boxShadow),this.color=st(t,RBe,r.color),this.direction=st(t,OBe,r.direction),this.display=st(t,PBe,r.display),this.float=st(t,QBe,r.cssFloat),this.fontFamily=st(t,b_e,r.fontFamily),this.fontSize=st(t,v_e,r.fontSize),this.fontStyle=st(t,N_e,r.fontStyle),this.fontVariant=st(t,w_e,r.fontVariant),this.fontWeight=st(t,y_e,r.fontWeight),this.letterSpacing=st(t,HBe,r.letterSpacing),this.lineBreak=st(t,zBe,r.lineBreak),this.lineHeight=st(t,$Be,r.lineHeight),this.listStyleImage=st(t,VBe,r.listStyleImage),this.listStylePosition=st(t,GBe,r.listStylePosition),this.listStyleType=st(t,WC,r.listStyleType),this.marginTop=st(t,KBe,r.marginTop),this.marginRight=st(t,qBe,r.marginRight),this.marginBottom=st(t,WBe,r.marginBottom),this.marginLeft=st(t,YBe,r.marginLeft),this.opacity=st(t,h_e,r.opacity);var i=st(t,XBe,r.overflow);this.overflowX=i[0],this.overflowY=i[i.length>1?1:0],this.overflowWrap=st(t,JBe,r.overflowWrap),this.paddingTop=st(t,ZBe,r.paddingTop),this.paddingRight=st(t,e_e,r.paddingRight),this.paddingBottom=st(t,t_e,r.paddingBottom),this.paddingLeft=st(t,r_e,r.paddingLeft),this.paintOrder=st(t,__e,r.paintOrder),this.position=st(t,n_e,r.position),this.textAlign=st(t,a_e,r.textAlign),this.textDecorationColor=st(t,m_e,(a=r.textDecorationColor)!==null&&a!==void 0?a:r.color),this.textDecorationLine=st(t,g_e,(s=r.textDecorationLine)!==null&&s!==void 0?s:r.textDecoration),this.textShadow=st(t,s_e,r.textShadow),this.textTransform=st(t,i_e,r.textTransform),this.transform=st(t,l_e,r.transform),this.transformOrigin=st(t,A_e,r.transformOrigin),this.visibility=st(t,f_e,r.visibility),this.webkitTextStrokeColor=st(t,T_e,r.webkitTextStrokeColor),this.webkitTextStrokeWidth=st(t,I_e,r.webkitTextStrokeWidth),this.wordBreak=st(t,p_e,r.wordBreak),this.zIndex=st(t,x_e,r.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},e.prototype.isTransparent=function(){return Bc(this.backgroundColor)},e.prototype.isTransformed=function(){return this.transform!==null},e.prototype.isPositioned=function(){return this.position!==0},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return this.float!==0},e.prototype.isInlineLevel=function(){return La(this.display,4)||La(this.display,33554432)||La(this.display,268435456)||La(this.display,536870912)||La(this.display,67108864)||La(this.display,134217728)},e})(),D_e=(function(){function e(t,r){this.content=st(t,C_e,r.content),this.quotes=st(t,S_e,r.quotes)}return e})(),zU=(function(){function e(t,r){this.counterIncrement=st(t,k_e,r.counterIncrement),this.counterReset=st(t,j_e,r.counterReset)}return e})(),st=function(e,t,r){var a=new VH,s=r!==null&&typeof r<"u"?r.toString():t.initialValue;a.write(s);var i=new GH(a.read());switch(t.type){case 2:var l=i.parseComponentValue();return t.parse(e,mr(l)?l.value:t.initialValue);case 0:return t.parse(e,i.parseComponentValue());case 1:return t.parse(e,i.parseComponentValues());case 4:return i.parseComponentValue();case 3:switch(t.format){case"angle":return bv.parse(e,i.parseComponentValue());case"color":return Sc.parse(e,i.parseComponentValue());case"image":return KE.parse(e,i.parseComponentValue());case"length":var o=i.parseComponentValue();return Oc(o)?o:Nn;case"length-percentage":var d=i.parseComponentValue();return Ta(d)?d:Nn;case"time":return dz.parse(e,i.parseComponentValue())}break}},U_e="data-html2canvas-debug",M_e=function(e){var t=e.getAttribute(U_e);switch(t){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},YC=function(e,t){var r=M_e(e);return r===1||t===r},Dl=(function(){function e(t,r){if(this.context=t,this.textNodes=[],this.elements=[],this.flags=0,YC(r,3))debugger;this.styles=new F_e(t,window.getComputedStyle(r,null)),ZC(r)&&(this.styles.animationDuration.some(function(a){return a>0})&&(r.style.animationDuration="0s"),this.styles.transform!==null&&(r.style.transform="none")),this.bounds=mv(this.context,r),YC(r,4)&&(this.flags|=16)}return e})(),R_e=" ",$U="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_f=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var mm=0;mm<$U.length;mm++)_f[$U.charCodeAt(mm)]=mm;var O_e=function(e){var t=e.length*.75,r=e.length,a,s=0,i,l,o,d;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var u=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(t):new Array(t),f=Array.isArray(u)?u:new Uint8Array(u);for(a=0;a<r;a+=4)i=_f[e.charCodeAt(a)],l=_f[e.charCodeAt(a+1)],o=_f[e.charCodeAt(a+2)],d=_f[e.charCodeAt(a+3)],f[s++]=i<<2|l>>4,f[s++]=(l&15)<<4|o>>2,f[s++]=(o&3)<<6|d&63;return u},P_e=function(e){for(var t=e.length,r=[],a=0;a<t;a+=2)r.push(e[a+1]<<8|e[a]);return r},L_e=function(e){for(var t=e.length,r=[],a=0;a<t;a+=4)r.push(e[a+3]<<24|e[a+2]<<16|e[a+1]<<8|e[a]);return r},Md=5,qE=11,Y2=2,Q_e=qE-Md,uz=65536>>Md,H_e=1<<Md,X2=H_e-1,z_e=1024>>Md,$_e=uz+z_e,V_e=$_e,G_e=32,K_e=V_e+G_e,q_e=65536>>qE,W_e=1<<Q_e,Y_e=W_e-1,VU=function(e,t,r){return e.slice?e.slice(t,r):new Uint16Array(Array.prototype.slice.call(e,t,r))},X_e=function(e,t,r){return e.slice?e.slice(t,r):new Uint32Array(Array.prototype.slice.call(e,t,r))},J_e=function(e,t){var r=O_e(e),a=Array.isArray(r)?L_e(r):new Uint32Array(r),s=Array.isArray(r)?P_e(r):new Uint16Array(r),i=24,l=VU(s,i/2,a[4]/2),o=a[5]===2?VU(s,(i+a[4])/2):X_e(a,Math.ceil((i+a[4])/4));return new Z_e(a[0],a[1],a[2],a[3],l,o)},Z_e=(function(){function e(t,r,a,s,i,l){this.initialValue=t,this.errorValue=r,this.highStart=a,this.highValueIndex=s,this.index=i,this.data=l}return e.prototype.get=function(t){var r;if(t>=0){if(t<55296||t>56319&&t<=65535)return r=this.index[t>>Md],r=(r<<Y2)+(t&X2),this.data[r];if(t<=65535)return r=this.index[uz+(t-55296>>Md)],r=(r<<Y2)+(t&X2),this.data[r];if(t<this.highStart)return r=K_e-q_e+(t>>qE),r=this.index[r],r+=t>>Md&Y_e,r=this.index[r],r=(r<<Y2)+(t&X2),this.data[r];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e})(),GU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",eTe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var gm=0;gm<GU.length;gm++)eTe[GU.charCodeAt(gm)]=gm;var tTe=1,J2=2,Z2=3,KU=4,qU=5,rTe=7,WU=8,eN=9,tN=10,YU=11,XU=12,JU=13,ZU=14,rN=15,aTe=function(e){for(var t=[],r=0,a=e.length;r<a;){var s=e.charCodeAt(r++);if(s>=55296&&s<=56319&&r<a){var i=e.charCodeAt(r++);(i&64512)===56320?t.push(((s&1023)<<10)+(i&1023)+65536):(t.push(s),r--)}else t.push(s)}return t},nTe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var r=e.length;if(!r)return"";for(var a=[],s=-1,i="";++s<r;){var l=e[s];l<=65535?a.push(l):(l-=65536,a.push((l>>10)+55296,l%1024+56320)),(s+1===r||a.length>16384)&&(i+=String.fromCharCode.apply(String,a),a.length=0)}return i},sTe=J_e(R_e),Ai="×",aN="÷",iTe=function(e){return sTe.get(e)},lTe=function(e,t,r){var a=r-2,s=t[a],i=t[r-1],l=t[r];if(i===J2&&l===Z2)return Ai;if(i===J2||i===Z2||i===KU||l===J2||l===Z2||l===KU)return aN;if(i===WU&&[WU,eN,YU,XU].indexOf(l)!==-1||(i===YU||i===eN)&&(l===eN||l===tN)||(i===XU||i===tN)&&l===tN||l===JU||l===qU||l===rTe||i===tTe)return Ai;if(i===JU&&l===ZU){for(;s===qU;)s=t[--a];if(s===ZU)return Ai}if(i===rN&&l===rN){for(var o=0;s===rN;)o++,s=t[--a];if(o%2===0)return Ai}return aN},oTe=function(e){var t=aTe(e),r=t.length,a=0,s=0,i=t.map(iTe);return{next:function(){if(a>=r)return{done:!0,value:null};for(var l=Ai;a<r&&(l=lTe(t,i,++a))===Ai;);if(l!==Ai||a===r){var o=nTe.apply(null,t.slice(s,a));return s=a,{value:o,done:!1}}return{done:!0,value:null}}}},cTe=function(e){for(var t=oTe(e),r=[],a;!(a=t.next()).done;)a.value&&r.push(a.value.slice());return r},dTe=function(e){var t=123;if(e.createRange){var r=e.createRange();if(r.getBoundingClientRect){var a=e.createElement("boundtest");a.style.height=t+"px",a.style.display="block",e.body.appendChild(a),r.selectNode(a);var s=r.getBoundingClientRect(),i=Math.round(s.height);if(e.body.removeChild(a),i===t)return!0}}return!1},uTe=function(e){var t=e.createElement("boundtest");t.style.width="50px",t.style.display="block",t.style.fontSize="12px",t.style.letterSpacing="0px",t.style.wordSpacing="0px",e.body.appendChild(t);var r=e.createRange();t.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";var a=t.firstChild,s=gv(a.data).map(function(d){return ba(d)}),i=0,l={},o=s.every(function(d,u){r.setStart(a,i),r.setEnd(a,i+d.length);var f=r.getBoundingClientRect();i+=d.length;var p=f.x>l.x||f.y>l.y;return l=f,u===0?!0:p});return e.body.removeChild(t),o},ATe=function(){return typeof new Image().crossOrigin<"u"},fTe=function(){return typeof new XMLHttpRequest().responseType=="string"},pTe=function(e){var t=new Image,r=e.createElement("canvas"),a=r.getContext("2d");if(!a)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{a.drawImage(t,0,0),r.toDataURL()}catch{return!1}return!0},eM=function(e){return e[0]===0&&e[1]===255&&e[2]===0&&e[3]===255},xTe=function(e){var t=e.createElement("canvas"),r=100;t.width=r,t.height=r;var a=t.getContext("2d");if(!a)return Promise.reject(!1);a.fillStyle="rgb(0, 255, 0)",a.fillRect(0,0,r,r);var s=new Image,i=t.toDataURL();s.src=i;var l=XC(r,r,0,0,s);return a.fillStyle="red",a.fillRect(0,0,r,r),tM(l).then(function(o){a.drawImage(o,0,0);var d=a.getImageData(0,0,r,r).data;a.fillStyle="red",a.fillRect(0,0,r,r);var u=e.createElement("div");return u.style.backgroundImage="url("+i+")",u.style.height=r+"px",eM(d)?tM(XC(r,r,0,0,u)):Promise.reject(!1)}).then(function(o){return a.drawImage(o,0,0),eM(a.getImageData(0,0,r,r).data)}).catch(function(){return!1})},XC=function(e,t,r,a,s){var i="http://www.w3.org/2000/svg",l=document.createElementNS(i,"svg"),o=document.createElementNS(i,"foreignObject");return l.setAttributeNS(null,"width",e.toString()),l.setAttributeNS(null,"height",t.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",r.toString()),o.setAttributeNS(null,"y",a.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),l.appendChild(o),o.appendChild(s),l},tM=function(e){return new Promise(function(t,r){var a=new Image;a.onload=function(){return t(a)},a.onerror=r,a.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},bn={get SUPPORT_RANGE_BOUNDS(){var e=dTe(document);return Object.defineProperty(bn,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=bn.SUPPORT_RANGE_BOUNDS&&uTe(document);return Object.defineProperty(bn,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=pTe(document);return Object.defineProperty(bn,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e=typeof Array.from=="function"&&typeof window.fetch=="function"?xTe(document):Promise.resolve(!1);return Object.defineProperty(bn,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=ATe();return Object.defineProperty(bn,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=fTe();return Object.defineProperty(bn,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(bn,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(bn,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},Vf=(function(){function e(t,r){this.text=t,this.bounds=r}return e})(),hTe=function(e,t,r,a){var s=bTe(t,r),i=[],l=0;return s.forEach(function(o){if(r.textDecorationLine.length||o.trim().length>0)if(bn.SUPPORT_RANGE_BOUNDS){var d=rM(a,l,o.length).getClientRects();if(d.length>1){var u=WE(o),f=0;u.forEach(function(h){i.push(new Vf(h,ko.fromDOMRectList(e,rM(a,f+l,h.length).getClientRects()))),f+=h.length})}else i.push(new Vf(o,ko.fromDOMRectList(e,d)))}else{var p=a.splitText(o.length);i.push(new Vf(o,mTe(e,a))),a=p}else bn.SUPPORT_RANGE_BOUNDS||(a=a.splitText(o.length));l+=o.length}),i},mTe=function(e,t){var r=t.ownerDocument;if(r){var a=r.createElement("html2canvaswrapper");a.appendChild(t.cloneNode(!0));var s=t.parentNode;if(s){s.replaceChild(a,t);var i=mv(e,a);return a.firstChild&&s.replaceChild(a.firstChild,a),i}}return ko.EMPTY},rM=function(e,t,r){var a=e.ownerDocument;if(!a)throw new Error("Node has no owner document");var s=a.createRange();return s.setStart(e,t),s.setEnd(e,t+r),s},WE=function(e){if(bn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map(function(r){return r.segment})}return cTe(e)},gTe=function(e,t){if(bn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var r=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(r.segment(e)).map(function(a){return a.segment})}return yTe(e,t)},bTe=function(e,t){return t.letterSpacing!==0?WE(e):gTe(e,t)},vTe=[32,160,4961,65792,65793,4153,4241],yTe=function(e,t){for(var r=qSe(e,{lineBreak:t.lineBreak,wordBreak:t.overflowWrap==="break-word"?"break-word":t.wordBreak}),a=[],s,i=function(){if(s.value){var l=s.value.slice(),o=gv(l),d="";o.forEach(function(u){vTe.indexOf(u)===-1?d+=ba(u):(d.length&&a.push(d),a.push(ba(u)),d="")}),d.length&&a.push(d)}};!(s=r.next()).done;)i();return a},wTe=(function(){function e(t,r,a){this.text=NTe(r.data,a.textTransform),this.textBounds=hTe(t,this.text,a,r)}return e})(),NTe=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(CTe,kTe);case 2:return e.toUpperCase();default:return e}},CTe=/(^|\s|:|-|\(|\))([a-z])/g,kTe=function(e,t,r){return e.length>0?t+r.toUpperCase():e},Az=(function(e){Zi(t,e);function t(r,a){var s=e.call(this,r,a)||this;return s.src=a.currentSrc||a.src,s.intrinsicWidth=a.naturalWidth,s.intrinsicHeight=a.naturalHeight,s.context.cache.addImage(s.src),s}return t})(Dl),fz=(function(e){Zi(t,e);function t(r,a){var s=e.call(this,r,a)||this;return s.canvas=a,s.intrinsicWidth=a.width,s.intrinsicHeight=a.height,s}return t})(Dl),pz=(function(e){Zi(t,e);function t(r,a){var s=e.call(this,r,a)||this,i=new XMLSerializer,l=mv(r,a);return a.setAttribute("width",l.width+"px"),a.setAttribute("height",l.height+"px"),s.svg="data:image/svg+xml,"+encodeURIComponent(i.serializeToString(a)),s.intrinsicWidth=a.width.baseVal.value,s.intrinsicHeight=a.height.baseVal.value,s.context.cache.addImage(s.svg),s}return t})(Dl),xz=(function(e){Zi(t,e);function t(r,a){var s=e.call(this,r,a)||this;return s.value=a.value,s}return t})(Dl),JC=(function(e){Zi(t,e);function t(r,a){var s=e.call(this,r,a)||this;return s.start=a.start,s.reversed=typeof a.reversed=="boolean"&&a.reversed===!0,s}return t})(Dl),jTe=[{type:15,flags:0,unit:"px",number:3}],ETe=[{type:16,flags:0,number:50}],STe=function(e){return e.width>e.height?new ko(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new ko(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e},BTe=function(e){var t=e.type===_Te?new Array(e.value.length+1).join("•"):e.value;return t.length===0?e.placeholder||"":t},ab="checkbox",nb="radio",_Te="password",aM=707406591,YE=(function(e){Zi(t,e);function t(r,a){var s=e.call(this,r,a)||this;switch(s.type=a.type.toLowerCase(),s.checked=a.checked,s.value=BTe(a),(s.type===ab||s.type===nb)&&(s.styles.backgroundColor=3739148031,s.styles.borderTopColor=s.styles.borderRightColor=s.styles.borderBottomColor=s.styles.borderLeftColor=2779096575,s.styles.borderTopWidth=s.styles.borderRightWidth=s.styles.borderBottomWidth=s.styles.borderLeftWidth=1,s.styles.borderTopStyle=s.styles.borderRightStyle=s.styles.borderBottomStyle=s.styles.borderLeftStyle=1,s.styles.backgroundClip=[0],s.styles.backgroundOrigin=[0],s.bounds=STe(s.bounds)),s.type){case ab:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=jTe;break;case nb:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=ETe;break}return s}return t})(Dl),hz=(function(e){Zi(t,e);function t(r,a){var s=e.call(this,r,a)||this,i=a.options[a.selectedIndex||0];return s.value=i&&i.text||"",s}return t})(Dl),mz=(function(e){Zi(t,e);function t(r,a){var s=e.call(this,r,a)||this;return s.value=a.value,s}return t})(Dl),gz=(function(e){Zi(t,e);function t(r,a){var s=e.call(this,r,a)||this;s.src=a.src,s.width=parseInt(a.width,10)||0,s.height=parseInt(a.height,10)||0,s.backgroundColor=s.styles.backgroundColor;try{if(a.contentWindow&&a.contentWindow.document&&a.contentWindow.document.documentElement){s.tree=vz(r,a.contentWindow.document.documentElement);var i=a.contentWindow.document.documentElement?zf(r,getComputedStyle(a.contentWindow.document.documentElement).backgroundColor):po.TRANSPARENT,l=a.contentWindow.document.body?zf(r,getComputedStyle(a.contentWindow.document.body).backgroundColor):po.TRANSPARENT;s.backgroundColor=Bc(i)?Bc(l)?s.styles.backgroundColor:l:i}}catch{}return s}return t})(Dl),TTe=["OL","UL","MENU"],Om=function(e,t,r,a){for(var s=t.firstChild,i=void 0;s;s=i)if(i=s.nextSibling,yz(s)&&s.data.trim().length>0)r.textNodes.push(new wTe(e,s,r.styles));else if(hA(s))if(kz(s)&&s.assignedNodes)s.assignedNodes().forEach(function(o){return Om(e,o,r,a)});else{var l=bz(e,s);l.styles.isVisible()&&(ITe(s,l,a)?l.flags|=4:FTe(l.styles)&&(l.flags|=2),TTe.indexOf(s.tagName)!==-1&&(l.flags|=8),r.elements.push(l),s.slot,s.shadowRoot?Om(e,s.shadowRoot,l,a):!sb(s)&&!wz(s)&&!ib(s)&&Om(e,s,l,a))}},bz=function(e,t){return ek(t)?new Az(e,t):Nz(t)?new fz(e,t):wz(t)?new pz(e,t):DTe(t)?new xz(e,t):UTe(t)?new JC(e,t):MTe(t)?new YE(e,t):ib(t)?new hz(e,t):sb(t)?new mz(e,t):Cz(t)?new gz(e,t):new Dl(e,t)},vz=function(e,t){var r=bz(e,t);return r.flags|=4,Om(e,t,r,r),r},ITe=function(e,t,r){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||XE(e)&&r.styles.isTransparent()},FTe=function(e){return e.isPositioned()||e.isFloating()},yz=function(e){return e.nodeType===Node.TEXT_NODE},hA=function(e){return e.nodeType===Node.ELEMENT_NODE},ZC=function(e){return hA(e)&&typeof e.style<"u"&&!Pm(e)},Pm=function(e){return typeof e.className=="object"},DTe=function(e){return e.tagName==="LI"},UTe=function(e){return e.tagName==="OL"},MTe=function(e){return e.tagName==="INPUT"},RTe=function(e){return e.tagName==="HTML"},wz=function(e){return e.tagName==="svg"},XE=function(e){return e.tagName==="BODY"},Nz=function(e){return e.tagName==="CANVAS"},nM=function(e){return e.tagName==="VIDEO"},ek=function(e){return e.tagName==="IMG"},Cz=function(e){return e.tagName==="IFRAME"},sM=function(e){return e.tagName==="STYLE"},OTe=function(e){return e.tagName==="SCRIPT"},sb=function(e){return e.tagName==="TEXTAREA"},ib=function(e){return e.tagName==="SELECT"},kz=function(e){return e.tagName==="SLOT"},iM=function(e){return e.tagName.indexOf("-")>0},PTe=(function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(t){var r=this.counters[t];return r&&r.length?r[r.length-1]:1},e.prototype.getCounterValues=function(t){var r=this.counters[t];return r||[]},e.prototype.pop=function(t){var r=this;t.forEach(function(a){return r.counters[a].pop()})},e.prototype.parse=function(t){var r=this,a=t.counterIncrement,s=t.counterReset,i=!0;a!==null&&a.forEach(function(o){var d=r.counters[o.counter];d&&o.increment!==0&&(i=!1,d.length||d.push(1),d[Math.max(0,d.length-1)]+=o.increment)});var l=[];return i&&s.forEach(function(o){var d=r.counters[o.counter];l.push(o.counter),d||(d=r.counters[o.counter]=[]),d.push(o.reset)}),l},e})(),lM={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},oM={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},LTe={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},QTe={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},rA=function(e,t,r,a,s,i){return e<t||e>r?Tp(e,s,i.length>0):a.integers.reduce(function(l,o,d){for(;e>=o;)e-=o,l+=a.values[d];return l},"")+i},jz=function(e,t,r,a){var s="";do r||e--,s=a(e)+s,e/=t;while(e*t>=t);return s},ma=function(e,t,r,a,s){var i=r-t+1;return(e<0?"-":"")+(jz(Math.abs(e),i,a,function(l){return ba(Math.floor(l%i)+t)})+s)},pd=function(e,t,r){r===void 0&&(r=". ");var a=t.length;return jz(Math.abs(e),a,!1,function(s){return t[Math.floor(s%a)]})+r},oA=1,fc=2,pc=4,Tf=8,to=function(e,t,r,a,s,i){if(e<-9999||e>9999)return Tp(e,4,s.length>0);var l=Math.abs(e),o=s;if(l===0)return t[0]+o;for(var d=0;l>0&&d<=4;d++){var u=l%10;u===0&&La(i,oA)&&o!==""?o=t[u]+o:u>1||u===1&&d===0||u===1&&d===1&&La(i,fc)||u===1&&d===1&&La(i,pc)&&e>100||u===1&&d>1&&La(i,Tf)?o=t[u]+(d>0?r[d-1]:"")+o:u===1&&d>0&&(o=r[d-1]+o),l=Math.floor(l/10)}return(e<0?a:"")+o},cM="十百千萬",dM="拾佰仟萬",uM="マイナス",nN="마이너스",Tp=function(e,t,r){var a=r?". ":"",s=r?"、":"",i=r?", ":"",l=r?" ":"";switch(t){case 0:return"•"+l;case 1:return"◦"+l;case 2:return"◾"+l;case 5:var o=ma(e,48,57,!0,a);return o.length<4?"0"+o:o;case 4:return pd(e,"〇一二三四五六七八九",s);case 6:return rA(e,1,3999,lM,3,a).toLowerCase();case 7:return rA(e,1,3999,lM,3,a);case 8:return ma(e,945,969,!1,a);case 9:return ma(e,97,122,!1,a);case 10:return ma(e,65,90,!1,a);case 11:return ma(e,1632,1641,!0,a);case 12:case 49:return rA(e,1,9999,oM,3,a);case 35:return rA(e,1,9999,oM,3,a).toLowerCase();case 13:return ma(e,2534,2543,!0,a);case 14:case 30:return ma(e,6112,6121,!0,a);case 15:return pd(e,"子丑寅卯辰巳午未申酉戌亥",s);case 16:return pd(e,"甲乙丙丁戊己庚辛壬癸",s);case 17:case 48:return to(e,"零一二三四五六七八九",cM,"負",s,fc|pc|Tf);case 47:return to(e,"零壹貳參肆伍陸柒捌玖",dM,"負",s,oA|fc|pc|Tf);case 42:return to(e,"零一二三四五六七八九",cM,"负",s,fc|pc|Tf);case 41:return to(e,"零壹贰叁肆伍陆柒捌玖",dM,"负",s,oA|fc|pc|Tf);case 26:return to(e,"〇一二三四五六七八九","十百千万",uM,s,0);case 25:return to(e,"零壱弐参四伍六七八九","拾百千万",uM,s,oA|fc|pc);case 31:return to(e,"영일이삼사오육칠팔구","십백천만",nN,i,oA|fc|pc);case 33:return to(e,"零一二三四五六七八九","十百千萬",nN,i,0);case 32:return to(e,"零壹貳參四五六七八九","拾百千",nN,i,oA|fc|pc);case 18:return ma(e,2406,2415,!0,a);case 20:return rA(e,1,19999,QTe,3,a);case 21:return ma(e,2790,2799,!0,a);case 22:return ma(e,2662,2671,!0,a);case 22:return rA(e,1,10999,LTe,3,a);case 23:return pd(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return pd(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return ma(e,3302,3311,!0,a);case 28:return pd(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",s);case 29:return pd(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",s);case 34:return ma(e,3792,3801,!0,a);case 37:return ma(e,6160,6169,!0,a);case 38:return ma(e,4160,4169,!0,a);case 39:return ma(e,2918,2927,!0,a);case 40:return ma(e,1776,1785,!0,a);case 43:return ma(e,3046,3055,!0,a);case 44:return ma(e,3174,3183,!0,a);case 45:return ma(e,3664,3673,!0,a);case 46:return ma(e,3872,3881,!0,a);case 3:default:return ma(e,48,57,!0,a)}},Ez="data-html2canvas-ignore",AM=(function(){function e(t,r,a){if(this.context=t,this.options=a,this.scrolledElements=[],this.referenceElement=r,this.counters=new PTe,this.quoteDepth=0,!r.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(r.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(t,r){var a=this,s=HTe(t,r);if(!s.contentWindow)return Promise.reject("Unable to find iframe window");var i=t.defaultView.pageXOffset,l=t.defaultView.pageYOffset,o=s.contentWindow,d=o.document,u=VTe(s).then(function(){return Kn(a,void 0,void 0,function(){var f,p;return Tn(this,function(h){switch(h.label){case 0:return this.scrolledElements.forEach(WTe),o&&(o.scrollTo(r.left,r.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(o.scrollY!==r.top||o.scrollX!==r.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-r.left,o.scrollY-r.top,0,0))),f=this.options.onclone,p=this.clonedReferenceElement,typeof p>"u"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:d.fonts&&d.fonts.ready?[4,d.fonts.ready]:[3,2];case 1:h.sent(),h.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,$Te(d)]:[3,4];case 3:h.sent(),h.label=4;case 4:return typeof f=="function"?[2,Promise.resolve().then(function(){return f(d,p)}).then(function(){return s})]:[2,s]}})})});return d.open(),d.write(KTe(document.doctype)+"<html></html>"),qTe(this.referenceElement.ownerDocument,i,l),d.replaceChild(d.adoptNode(this.documentElement),d.documentElement),d.close(),u},e.prototype.createElementClone=function(t){if(YC(t,2))debugger;if(Nz(t))return this.createCanvasClone(t);if(nM(t))return this.createVideoClone(t);if(sM(t))return this.createStyleClone(t);var r=t.cloneNode(!1);return ek(r)&&(ek(t)&&t.currentSrc&&t.currentSrc!==t.src&&(r.src=t.currentSrc,r.srcset=""),r.loading==="lazy"&&(r.loading="eager")),iM(r)?this.createCustomElementClone(r):r},e.prototype.createCustomElementClone=function(t){var r=document.createElement("html2canvascustomelement");return sN(t.style,r),r},e.prototype.createStyleClone=function(t){try{var r=t.sheet;if(r&&r.cssRules){var a=[].slice.call(r.cssRules,0).reduce(function(i,l){return l&&typeof l.cssText=="string"?i+l.cssText:i},""),s=t.cloneNode(!1);return s.textContent=a,s}}catch(i){if(this.context.logger.error("Unable to access cssRules property",i),i.name!=="SecurityError")throw i}return t.cloneNode(!1)},e.prototype.createCanvasClone=function(t){var r;if(this.options.inlineImages&&t.ownerDocument){var a=t.ownerDocument.createElement("img");try{return a.src=t.toDataURL(),a}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",t)}}var s=t.cloneNode(!1);try{s.width=t.width,s.height=t.height;var i=t.getContext("2d"),l=s.getContext("2d");if(l)if(!this.options.allowTaint&&i)l.putImageData(i.getImageData(0,0,t.width,t.height),0,0);else{var o=(r=t.getContext("webgl2"))!==null&&r!==void 0?r:t.getContext("webgl");if(o){var d=o.getContextAttributes();(d==null?void 0:d.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",t)}l.drawImage(t,0,0)}return s}catch{this.context.logger.info("Unable to clone canvas as it is tainted",t)}return s},e.prototype.createVideoClone=function(t){var r=t.ownerDocument.createElement("canvas");r.width=t.offsetWidth,r.height=t.offsetHeight;var a=r.getContext("2d");try{return a&&(a.drawImage(t,0,0,r.width,r.height),this.options.allowTaint||a.getImageData(0,0,r.width,r.height)),r}catch{this.context.logger.info("Unable to clone video as it is tainted",t)}var s=t.ownerDocument.createElement("canvas");return s.width=t.offsetWidth,s.height=t.offsetHeight,s},e.prototype.appendChildNode=function(t,r,a){(!hA(r)||!OTe(r)&&!r.hasAttribute(Ez)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(r)))&&(!this.options.copyStyles||!hA(r)||!sM(r))&&t.appendChild(this.cloneNode(r,a))},e.prototype.cloneChildNodes=function(t,r,a){for(var s=this,i=t.shadowRoot?t.shadowRoot.firstChild:t.firstChild;i;i=i.nextSibling)if(hA(i)&&kz(i)&&typeof i.assignedNodes=="function"){var l=i.assignedNodes();l.length&&l.forEach(function(o){return s.appendChildNode(r,o,a)})}else this.appendChildNode(r,i,a)},e.prototype.cloneNode=function(t,r){if(yz(t))return document.createTextNode(t.data);if(!t.ownerDocument)return t.cloneNode(!1);var a=t.ownerDocument.defaultView;if(a&&hA(t)&&(ZC(t)||Pm(t))){var s=this.createElementClone(t);s.style.transitionProperty="none";var i=a.getComputedStyle(t),l=a.getComputedStyle(t,":before"),o=a.getComputedStyle(t,":after");this.referenceElement===t&&ZC(s)&&(this.clonedReferenceElement=s),XE(s)&&JTe(s);var d=this.counters.parse(new zU(this.context,i)),u=this.resolvePseudoContent(t,s,l,Gf.BEFORE);iM(t)&&(r=!0),nM(t)||this.cloneChildNodes(t,s,r),u&&s.insertBefore(u,s.firstChild);var f=this.resolvePseudoContent(t,s,o,Gf.AFTER);return f&&s.appendChild(f),this.counters.pop(d),(i&&(this.options.copyStyles||Pm(t))&&!Cz(t)||r)&&sN(i,s),(t.scrollTop!==0||t.scrollLeft!==0)&&this.scrolledElements.push([s,t.scrollLeft,t.scrollTop]),(sb(t)||ib(t))&&(sb(s)||ib(s))&&(s.value=t.value),s}return t.cloneNode(!1)},e.prototype.resolvePseudoContent=function(t,r,a,s){var i=this;if(a){var l=a.content,o=r.ownerDocument;if(!(!o||!l||l==="none"||l==="-moz-alt-content"||a.display==="none")){this.counters.parse(new zU(this.context,a));var d=new D_e(this.context,a),u=o.createElement("html2canvaspseudoelement");sN(a,u),d.content.forEach(function(p){if(p.type===0)u.appendChild(o.createTextNode(p.value));else if(p.type===22){var h=o.createElement("img");h.src=p.value,h.style.opacity="1",u.appendChild(h)}else if(p.type===18){if(p.name==="attr"){var m=p.values.filter(mr);m.length&&u.appendChild(o.createTextNode(t.getAttribute(m[0].value)||""))}else if(p.name==="counter"){var b=p.values.filter(RA),v=b[0],y=b[1];if(v&&mr(v)){var j=i.counters.getCounterValue(v.value),_=y&&mr(y)?WC.parse(i.context,y.value):3;u.appendChild(o.createTextNode(Tp(j,_,!1)))}}else if(p.name==="counters"){var N=p.values.filter(RA),v=N[0],E=N[1],y=N[2];if(v&&mr(v)){var T=i.counters.getCounterValues(v.value),B=y&&mr(y)?WC.parse(i.context,y.value):3,F=E&&E.type===0?E.value:"",R=T.map(function(L){return Tp(L,B,!1)}).join(F);u.appendChild(o.createTextNode(R))}}}else if(p.type===20)switch(p.value){case"open-quote":u.appendChild(o.createTextNode(HU(d.quotes,i.quoteDepth++,!0)));break;case"close-quote":u.appendChild(o.createTextNode(HU(d.quotes,--i.quoteDepth,!1)));break;default:u.appendChild(o.createTextNode(p.value))}}),u.className=tk+" "+rk;var f=s===Gf.BEFORE?" "+tk:" "+rk;return Pm(r)?r.className.baseValue+=f:r.className+=f,u}}},e.destroy=function(t){return t.parentNode?(t.parentNode.removeChild(t),!0):!1},e})(),Gf;(function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"})(Gf||(Gf={}));var HTe=function(e,t){var r=e.createElement("iframe");return r.className="html2canvas-container",r.style.visibility="hidden",r.style.position="fixed",r.style.left="-10000px",r.style.top="0px",r.style.border="0",r.width=t.width.toString(),r.height=t.height.toString(),r.scrolling="no",r.setAttribute(Ez,"true"),e.body.appendChild(r),r},zTe=function(e){return new Promise(function(t){if(e.complete){t();return}if(!e.src){t();return}e.onload=t,e.onerror=t})},$Te=function(e){return Promise.all([].slice.call(e.images,0).map(zTe))},VTe=function(e){return new Promise(function(t,r){var a=e.contentWindow;if(!a)return r("No window assigned for iframe");var s=a.document;a.onload=e.onload=function(){a.onload=e.onload=null;var i=setInterval(function(){s.body.childNodes.length>0&&s.readyState==="complete"&&(clearInterval(i),t(e))},50)}})},GTe=["all","d","content"],sN=function(e,t){for(var r=e.length-1;r>=0;r--){var a=e.item(r);GTe.indexOf(a)===-1&&t.style.setProperty(a,e.getPropertyValue(a))}return t},KTe=function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t},qTe=function(e,t,r){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||r!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,r)},WTe=function(e){var t=e[0],r=e[1],a=e[2];t.scrollLeft=r,t.scrollTop=a},YTe=":before",XTe=":after",tk="___html2canvas___pseudoelement_before",rk="___html2canvas___pseudoelement_after",fM=`{
    content: "" !important;
    display: none !important;
}`,JTe=function(e){ZTe(e,"."+tk+YTe+fM+`
         .`+rk+XTe+fM)},ZTe=function(e,t){var r=e.ownerDocument;if(r){var a=r.createElement("style");a.textContent=t,e.appendChild(a)}},Sz=(function(){function e(){}return e.getOrigin=function(t){var r=e._link;return r?(r.href=t,r.href=r.href,r.protocol+r.hostname+r.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e})(),eIe=(function(){function e(t,r){this.context=t,this._options=r,this._cache={}}return e.prototype.addImage=function(t){var r=Promise.resolve();return this.has(t)||(lN(t)||nIe(t))&&(this._cache[t]=this.loadImage(t)).catch(function(){}),r},e.prototype.match=function(t){return this._cache[t]},e.prototype.loadImage=function(t){return Kn(this,void 0,void 0,function(){var r,a,s,i,l=this;return Tn(this,function(o){switch(o.label){case 0:return r=Sz.isSameOrigin(t),a=!iN(t)&&this._options.useCORS===!0&&bn.SUPPORT_CORS_IMAGES&&!r,s=!iN(t)&&!r&&!lN(t)&&typeof this._options.proxy=="string"&&bn.SUPPORT_CORS_XHR&&!a,!r&&this._options.allowTaint===!1&&!iN(t)&&!lN(t)&&!s&&!a?[2]:(i=t,s?[4,this.proxy(i)]:[3,2]);case 1:i=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+t.substring(0,256)),[4,new Promise(function(d,u){var f=new Image;f.onload=function(){return d(f)},f.onerror=u,(sIe(i)||a)&&(f.crossOrigin="anonymous"),f.src=i,f.complete===!0&&setTimeout(function(){return d(f)},500),l._options.imageTimeout>0&&setTimeout(function(){return u("Timed out ("+l._options.imageTimeout+"ms) loading image")},l._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},e.prototype.has=function(t){return typeof this._cache[t]<"u"},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(t){var r=this,a=this._options.proxy;if(!a)throw new Error("No proxy defined");var s=t.substring(0,256);return new Promise(function(i,l){var o=bn.SUPPORT_RESPONSE_TYPE?"blob":"text",d=new XMLHttpRequest;d.onload=function(){if(d.status===200)if(o==="text")i(d.response);else{var p=new FileReader;p.addEventListener("load",function(){return i(p.result)},!1),p.addEventListener("error",function(h){return l(h)},!1),p.readAsDataURL(d.response)}else l("Failed to proxy resource "+s+" with status code "+d.status)},d.onerror=l;var u=a.indexOf("?")>-1?"&":"?";if(d.open("GET",""+a+u+"url="+encodeURIComponent(t)+"&responseType="+o),o!=="text"&&d instanceof XMLHttpRequest&&(d.responseType=o),r._options.imageTimeout){var f=r._options.imageTimeout;d.timeout=f,d.ontimeout=function(){return l("Timed out ("+f+"ms) proxying "+s)}}d.send()})},e})(),tIe=/^data:image\/svg\+xml/i,rIe=/^data:image\/.*;base64,/i,aIe=/^data:image\/.*/i,nIe=function(e){return bn.SUPPORT_SVG_DRAWING||!iIe(e)},iN=function(e){return aIe.test(e)},sIe=function(e){return rIe.test(e)},lN=function(e){return e.substr(0,4)==="blob"},iIe=function(e){return e.substr(-3).toLowerCase()==="svg"||tIe.test(e)},rt=(function(){function e(t,r){this.type=0,this.x=t,this.y=r}return e.prototype.add=function(t,r){return new e(this.x+t,this.y+r)},e})(),aA=function(e,t,r){return new rt(e.x+(t.x-e.x)*r,e.y+(t.y-e.y)*r)},bm=(function(){function e(t,r,a,s){this.type=1,this.start=t,this.startControl=r,this.endControl=a,this.end=s}return e.prototype.subdivide=function(t,r){var a=aA(this.start,this.startControl,t),s=aA(this.startControl,this.endControl,t),i=aA(this.endControl,this.end,t),l=aA(a,s,t),o=aA(s,i,t),d=aA(l,o,t);return r?new e(this.start,a,l,d):new e(d,o,i,this.end)},e.prototype.add=function(t,r){return new e(this.start.add(t,r),this.startControl.add(t,r),this.endControl.add(t,r),this.end.add(t,r))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e})(),pi=function(e){return e.type===1},lIe=(function(){function e(t){var r=t.styles,a=t.bounds,s=Bf(r.borderTopLeftRadius,a.width,a.height),i=s[0],l=s[1],o=Bf(r.borderTopRightRadius,a.width,a.height),d=o[0],u=o[1],f=Bf(r.borderBottomRightRadius,a.width,a.height),p=f[0],h=f[1],m=Bf(r.borderBottomLeftRadius,a.width,a.height),b=m[0],v=m[1],y=[];y.push((i+d)/a.width),y.push((b+p)/a.width),y.push((l+v)/a.height),y.push((u+h)/a.height);var j=Math.max.apply(Math,y);j>1&&(i/=j,l/=j,d/=j,u/=j,p/=j,h/=j,b/=j,v/=j);var _=a.width-d,N=a.height-h,E=a.width-p,T=a.height-v,B=r.borderTopWidth,F=r.borderRightWidth,R=r.borderBottomWidth,U=r.borderLeftWidth,D=Er(r.paddingTop,t.bounds.width),L=Er(r.paddingRight,t.bounds.width),P=Er(r.paddingBottom,t.bounds.width),G=Er(r.paddingLeft,t.bounds.width);this.topLeftBorderDoubleOuterBox=i>0||l>0?zr(a.left+U/3,a.top+B/3,i-U/3,l-B/3,nr.TOP_LEFT):new rt(a.left+U/3,a.top+B/3),this.topRightBorderDoubleOuterBox=i>0||l>0?zr(a.left+_,a.top+B/3,d-F/3,u-B/3,nr.TOP_RIGHT):new rt(a.left+a.width-F/3,a.top+B/3),this.bottomRightBorderDoubleOuterBox=p>0||h>0?zr(a.left+E,a.top+N,p-F/3,h-R/3,nr.BOTTOM_RIGHT):new rt(a.left+a.width-F/3,a.top+a.height-R/3),this.bottomLeftBorderDoubleOuterBox=b>0||v>0?zr(a.left+U/3,a.top+T,b-U/3,v-R/3,nr.BOTTOM_LEFT):new rt(a.left+U/3,a.top+a.height-R/3),this.topLeftBorderDoubleInnerBox=i>0||l>0?zr(a.left+U*2/3,a.top+B*2/3,i-U*2/3,l-B*2/3,nr.TOP_LEFT):new rt(a.left+U*2/3,a.top+B*2/3),this.topRightBorderDoubleInnerBox=i>0||l>0?zr(a.left+_,a.top+B*2/3,d-F*2/3,u-B*2/3,nr.TOP_RIGHT):new rt(a.left+a.width-F*2/3,a.top+B*2/3),this.bottomRightBorderDoubleInnerBox=p>0||h>0?zr(a.left+E,a.top+N,p-F*2/3,h-R*2/3,nr.BOTTOM_RIGHT):new rt(a.left+a.width-F*2/3,a.top+a.height-R*2/3),this.bottomLeftBorderDoubleInnerBox=b>0||v>0?zr(a.left+U*2/3,a.top+T,b-U*2/3,v-R*2/3,nr.BOTTOM_LEFT):new rt(a.left+U*2/3,a.top+a.height-R*2/3),this.topLeftBorderStroke=i>0||l>0?zr(a.left+U/2,a.top+B/2,i-U/2,l-B/2,nr.TOP_LEFT):new rt(a.left+U/2,a.top+B/2),this.topRightBorderStroke=i>0||l>0?zr(a.left+_,a.top+B/2,d-F/2,u-B/2,nr.TOP_RIGHT):new rt(a.left+a.width-F/2,a.top+B/2),this.bottomRightBorderStroke=p>0||h>0?zr(a.left+E,a.top+N,p-F/2,h-R/2,nr.BOTTOM_RIGHT):new rt(a.left+a.width-F/2,a.top+a.height-R/2),this.bottomLeftBorderStroke=b>0||v>0?zr(a.left+U/2,a.top+T,b-U/2,v-R/2,nr.BOTTOM_LEFT):new rt(a.left+U/2,a.top+a.height-R/2),this.topLeftBorderBox=i>0||l>0?zr(a.left,a.top,i,l,nr.TOP_LEFT):new rt(a.left,a.top),this.topRightBorderBox=d>0||u>0?zr(a.left+_,a.top,d,u,nr.TOP_RIGHT):new rt(a.left+a.width,a.top),this.bottomRightBorderBox=p>0||h>0?zr(a.left+E,a.top+N,p,h,nr.BOTTOM_RIGHT):new rt(a.left+a.width,a.top+a.height),this.bottomLeftBorderBox=b>0||v>0?zr(a.left,a.top+T,b,v,nr.BOTTOM_LEFT):new rt(a.left,a.top+a.height),this.topLeftPaddingBox=i>0||l>0?zr(a.left+U,a.top+B,Math.max(0,i-U),Math.max(0,l-B),nr.TOP_LEFT):new rt(a.left+U,a.top+B),this.topRightPaddingBox=d>0||u>0?zr(a.left+Math.min(_,a.width-F),a.top+B,_>a.width+F?0:Math.max(0,d-F),Math.max(0,u-B),nr.TOP_RIGHT):new rt(a.left+a.width-F,a.top+B),this.bottomRightPaddingBox=p>0||h>0?zr(a.left+Math.min(E,a.width-U),a.top+Math.min(N,a.height-R),Math.max(0,p-F),Math.max(0,h-R),nr.BOTTOM_RIGHT):new rt(a.left+a.width-F,a.top+a.height-R),this.bottomLeftPaddingBox=b>0||v>0?zr(a.left+U,a.top+Math.min(T,a.height-R),Math.max(0,b-U),Math.max(0,v-R),nr.BOTTOM_LEFT):new rt(a.left+U,a.top+a.height-R),this.topLeftContentBox=i>0||l>0?zr(a.left+U+G,a.top+B+D,Math.max(0,i-(U+G)),Math.max(0,l-(B+D)),nr.TOP_LEFT):new rt(a.left+U+G,a.top+B+D),this.topRightContentBox=d>0||u>0?zr(a.left+Math.min(_,a.width+U+G),a.top+B+D,_>a.width+U+G?0:d-U+G,u-(B+D),nr.TOP_RIGHT):new rt(a.left+a.width-(F+L),a.top+B+D),this.bottomRightContentBox=p>0||h>0?zr(a.left+Math.min(E,a.width-(U+G)),a.top+Math.min(N,a.height+B+D),Math.max(0,p-(F+L)),h-(R+P),nr.BOTTOM_RIGHT):new rt(a.left+a.width-(F+L),a.top+a.height-(R+P)),this.bottomLeftContentBox=b>0||v>0?zr(a.left+U+G,a.top+T,Math.max(0,b-(U+G)),v-(R+P),nr.BOTTOM_LEFT):new rt(a.left+U+G,a.top+a.height-(R+P))}return e})(),nr;(function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(nr||(nr={}));var zr=function(e,t,r,a,s){var i=4*((Math.sqrt(2)-1)/3),l=r*i,o=a*i,d=e+r,u=t+a;switch(s){case nr.TOP_LEFT:return new bm(new rt(e,u),new rt(e,u-o),new rt(d-l,t),new rt(d,t));case nr.TOP_RIGHT:return new bm(new rt(e,t),new rt(e+l,t),new rt(d,u-o),new rt(d,u));case nr.BOTTOM_RIGHT:return new bm(new rt(d,t),new rt(d,t+o),new rt(e+l,u),new rt(e,u));case nr.BOTTOM_LEFT:default:return new bm(new rt(d,u),new rt(d-l,u),new rt(e,t+o),new rt(e,t))}},lb=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},oIe=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},ob=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},cIe=(function(){function e(t,r,a){this.offsetX=t,this.offsetY=r,this.matrix=a,this.type=0,this.target=6}return e})(),vm=(function(){function e(t,r){this.path=t,this.target=r,this.type=1}return e})(),dIe=(function(){function e(t){this.opacity=t,this.type=2,this.target=6}return e})(),uIe=function(e){return e.type===0},Bz=function(e){return e.type===1},AIe=function(e){return e.type===2},pM=function(e,t){return e.length===t.length?e.some(function(r,a){return r===t[a]}):!1},fIe=function(e,t,r,a,s){return e.map(function(i,l){switch(l){case 0:return i.add(t,r);case 1:return i.add(t+a,r);case 2:return i.add(t+a,r+s);case 3:return i.add(t,r+s)}return i})},_z=(function(){function e(t){this.element=t,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e})(),Tz=(function(){function e(t,r){if(this.container=t,this.parent=r,this.effects=[],this.curves=new lIe(this.container),this.container.styles.opacity<1&&this.effects.push(new dIe(this.container.styles.opacity)),this.container.styles.transform!==null){var a=this.container.bounds.left+this.container.styles.transformOrigin[0].number,s=this.container.bounds.top+this.container.styles.transformOrigin[1].number,i=this.container.styles.transform;this.effects.push(new cIe(a,s,i))}if(this.container.styles.overflowX!==0){var l=lb(this.curves),o=ob(this.curves);pM(l,o)?this.effects.push(new vm(l,6)):(this.effects.push(new vm(l,2)),this.effects.push(new vm(o,4)))}}return e.prototype.getEffects=function(t){for(var r=[2,3].indexOf(this.container.styles.position)===-1,a=this.parent,s=this.effects.slice(0);a;){var i=a.effects.filter(function(d){return!Bz(d)});if(r||a.container.styles.position!==0||!a.parent){if(s.unshift.apply(s,i),r=[2,3].indexOf(a.container.styles.position)===-1,a.container.styles.overflowX!==0){var l=lb(a.curves),o=ob(a.curves);pM(l,o)||s.unshift(new vm(o,6))}}else s.unshift.apply(s,i);a=a.parent}return s.filter(function(d){return La(d.target,t)})},e})(),ak=function(e,t,r,a){e.container.elements.forEach(function(s){var i=La(s.flags,4),l=La(s.flags,2),o=new Tz(s,e);La(s.styles.display,2048)&&a.push(o);var d=La(s.flags,8)?[]:a;if(i||l){var u=i||s.styles.isPositioned()?r:t,f=new _z(o);if(s.styles.isPositioned()||s.styles.opacity<1||s.styles.isTransformed()){var p=s.styles.zIndex.order;if(p<0){var h=0;u.negativeZIndex.some(function(b,v){return p>b.element.container.styles.zIndex.order?(h=v,!1):h>0}),u.negativeZIndex.splice(h,0,f)}else if(p>0){var m=0;u.positiveZIndex.some(function(b,v){return p>=b.element.container.styles.zIndex.order?(m=v+1,!1):m>0}),u.positiveZIndex.splice(m,0,f)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(f)}else s.styles.isFloating()?u.nonPositionedFloats.push(f):u.nonPositionedInlineLevel.push(f);ak(o,f,i?f:r,d)}else s.styles.isInlineLevel()?t.inlineLevel.push(o):t.nonInlineLevel.push(o),ak(o,t,r,d);La(s.flags,8)&&Iz(s,d)})},Iz=function(e,t){for(var r=e instanceof JC?e.start:1,a=e instanceof JC?e.reversed:!1,s=0;s<t.length;s++){var i=t[s];i.container instanceof xz&&typeof i.container.value=="number"&&i.container.value!==0&&(r=i.container.value),i.listValue=Tp(r,i.container.styles.listStyleType,!0),r+=a?-1:1}},pIe=function(e){var t=new Tz(e,null),r=new _z(t),a=[];return ak(t,r,r,a),Iz(t.container,a),r},xM=function(e,t){switch(t){case 0:return bi(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return bi(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return bi(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);case 3:default:return bi(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},xIe=function(e,t){switch(t){case 0:return bi(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return bi(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return bi(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);case 3:default:return bi(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},hIe=function(e,t){switch(t){case 0:return bi(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return bi(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return bi(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);case 3:default:return bi(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},mIe=function(e,t){switch(t){case 0:return ym(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return ym(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return ym(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);case 3:default:return ym(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},ym=function(e,t){var r=[];return pi(e)?r.push(e.subdivide(.5,!1)):r.push(e),pi(t)?r.push(t.subdivide(.5,!0)):r.push(t),r},bi=function(e,t,r,a){var s=[];return pi(e)?s.push(e.subdivide(.5,!1)):s.push(e),pi(r)?s.push(r.subdivide(.5,!0)):s.push(r),pi(a)?s.push(a.subdivide(.5,!0).reverse()):s.push(a),pi(t)?s.push(t.subdivide(.5,!1).reverse()):s.push(t),s},Fz=function(e){var t=e.bounds,r=e.styles;return t.add(r.borderLeftWidth,r.borderTopWidth,-(r.borderRightWidth+r.borderLeftWidth),-(r.borderTopWidth+r.borderBottomWidth))},cb=function(e){var t=e.styles,r=e.bounds,a=Er(t.paddingLeft,r.width),s=Er(t.paddingRight,r.width),i=Er(t.paddingTop,r.width),l=Er(t.paddingBottom,r.width);return r.add(a+t.borderLeftWidth,i+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+a+s),-(t.borderTopWidth+t.borderBottomWidth+i+l))},gIe=function(e,t){return e===0?t.bounds:e===2?cb(t):Fz(t)},bIe=function(e,t){return e===0?t.bounds:e===2?cb(t):Fz(t)},oN=function(e,t,r){var a=gIe(cA(e.styles.backgroundOrigin,t),e),s=bIe(cA(e.styles.backgroundClip,t),e),i=vIe(cA(e.styles.backgroundSize,t),r,a),l=i[0],o=i[1],d=Bf(cA(e.styles.backgroundPosition,t),a.width-l,a.height-o),u=yIe(cA(e.styles.backgroundRepeat,t),d,i,a,s),f=Math.round(a.left+d[0]),p=Math.round(a.top+d[1]);return[u,f,p,l,o]},nA=function(e){return mr(e)&&e.value===kA.AUTO},wm=function(e){return typeof e=="number"},vIe=function(e,t,r){var a=t[0],s=t[1],i=t[2],l=e[0],o=e[1];if(!l)return[0,0];if(Ta(l)&&o&&Ta(o))return[Er(l,r.width),Er(o,r.height)];var d=wm(i);if(mr(l)&&(l.value===kA.CONTAIN||l.value===kA.COVER)){if(wm(i)){var u=r.width/r.height;return u<i!=(l.value===kA.COVER)?[r.width,r.width/i]:[r.height*i,r.height]}return[r.width,r.height]}var f=wm(a),p=wm(s),h=f||p;if(nA(l)&&(!o||nA(o))){if(f&&p)return[a,s];if(!d&&!h)return[r.width,r.height];if(h&&d){var m=f?a:s*i,b=p?s:a/i;return[m,b]}var v=f?a:r.width,y=p?s:r.height;return[v,y]}if(d){var j=0,_=0;return Ta(l)?j=Er(l,r.width):Ta(o)&&(_=Er(o,r.height)),nA(l)?j=_*i:(!o||nA(o))&&(_=j/i),[j,_]}var N=null,E=null;if(Ta(l)?N=Er(l,r.width):o&&Ta(o)&&(E=Er(o,r.height)),N!==null&&(!o||nA(o))&&(E=f&&p?N/a*s:r.height),E!==null&&nA(l)&&(N=f&&p?E/s*a:r.width),N!==null&&E!==null)return[N,E];throw new Error("Unable to calculate background-size for element")},cA=function(e,t){var r=e[t];return typeof r>"u"?e[0]:r},yIe=function(e,t,r,a,s){var i=t[0],l=t[1],o=r[0],d=r[1];switch(e){case 2:return[new rt(Math.round(a.left),Math.round(a.top+l)),new rt(Math.round(a.left+a.width),Math.round(a.top+l)),new rt(Math.round(a.left+a.width),Math.round(d+a.top+l)),new rt(Math.round(a.left),Math.round(d+a.top+l))];case 3:return[new rt(Math.round(a.left+i),Math.round(a.top)),new rt(Math.round(a.left+i+o),Math.round(a.top)),new rt(Math.round(a.left+i+o),Math.round(a.height+a.top)),new rt(Math.round(a.left+i),Math.round(a.height+a.top))];case 1:return[new rt(Math.round(a.left+i),Math.round(a.top+l)),new rt(Math.round(a.left+i+o),Math.round(a.top+l)),new rt(Math.round(a.left+i+o),Math.round(a.top+l+d)),new rt(Math.round(a.left+i),Math.round(a.top+l+d))];default:return[new rt(Math.round(s.left),Math.round(s.top)),new rt(Math.round(s.left+s.width),Math.round(s.top)),new rt(Math.round(s.left+s.width),Math.round(s.height+s.top)),new rt(Math.round(s.left),Math.round(s.height+s.top))]}},wIe="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",hM="Hidden Text",NIe=(function(){function e(t){this._data={},this._document=t}return e.prototype.parseMetrics=function(t,r){var a=this._document.createElement("div"),s=this._document.createElement("img"),i=this._document.createElement("span"),l=this._document.body;a.style.visibility="hidden",a.style.fontFamily=t,a.style.fontSize=r,a.style.margin="0",a.style.padding="0",a.style.whiteSpace="nowrap",l.appendChild(a),s.src=wIe,s.width=1,s.height=1,s.style.margin="0",s.style.padding="0",s.style.verticalAlign="baseline",i.style.fontFamily=t,i.style.fontSize=r,i.style.margin="0",i.style.padding="0",i.appendChild(this._document.createTextNode(hM)),a.appendChild(i),a.appendChild(s);var o=s.offsetTop-i.offsetTop+2;a.removeChild(i),a.appendChild(this._document.createTextNode(hM)),a.style.lineHeight="normal",s.style.verticalAlign="super";var d=s.offsetTop-a.offsetTop+2;return l.removeChild(a),{baseline:o,middle:d}},e.prototype.getMetrics=function(t,r){var a=t+" "+r;return typeof this._data[a]>"u"&&(this._data[a]=this.parseMetrics(t,r)),this._data[a]},e})(),Dz=(function(){function e(t,r){this.context=t,this.options=r}return e})(),CIe=1e4,kIe=(function(e){Zi(t,e);function t(r,a){var s=e.call(this,r,a)||this;return s._activeEffects=[],s.canvas=a.canvas?a.canvas:document.createElement("canvas"),s.ctx=s.canvas.getContext("2d"),a.canvas||(s.canvas.width=Math.floor(a.width*a.scale),s.canvas.height=Math.floor(a.height*a.scale),s.canvas.style.width=a.width+"px",s.canvas.style.height=a.height+"px"),s.fontMetrics=new NIe(document),s.ctx.scale(s.options.scale,s.options.scale),s.ctx.translate(-a.x,-a.y),s.ctx.textBaseline="bottom",s._activeEffects=[],s.context.logger.debug("Canvas renderer initialized ("+a.width+"x"+a.height+") with scale "+a.scale),s}return t.prototype.applyEffects=function(r){for(var a=this;this._activeEffects.length;)this.popEffect();r.forEach(function(s){return a.applyEffect(s)})},t.prototype.applyEffect=function(r){this.ctx.save(),AIe(r)&&(this.ctx.globalAlpha=r.opacity),uIe(r)&&(this.ctx.translate(r.offsetX,r.offsetY),this.ctx.transform(r.matrix[0],r.matrix[1],r.matrix[2],r.matrix[3],r.matrix[4],r.matrix[5]),this.ctx.translate(-r.offsetX,-r.offsetY)),Bz(r)&&(this.path(r.path),this.ctx.clip()),this._activeEffects.push(r)},t.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},t.prototype.renderStack=function(r){return Kn(this,void 0,void 0,function(){var a;return Tn(this,function(s){switch(s.label){case 0:return a=r.element.container.styles,a.isVisible()?[4,this.renderStackContent(r)]:[3,2];case 1:s.sent(),s.label=2;case 2:return[2]}})})},t.prototype.renderNode=function(r){return Kn(this,void 0,void 0,function(){return Tn(this,function(a){switch(a.label){case 0:if(La(r.container.flags,16))debugger;return r.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(r)]:[3,3];case 1:return a.sent(),[4,this.renderNodeContent(r)];case 2:a.sent(),a.label=3;case 3:return[2]}})})},t.prototype.renderTextWithLetterSpacing=function(r,a,s){var i=this;if(a===0)this.ctx.fillText(r.text,r.bounds.left,r.bounds.top+s);else{var l=WE(r.text);l.reduce(function(o,d){return i.ctx.fillText(d,o,r.bounds.top+s),o+i.ctx.measureText(d).width},r.bounds.left)}},t.prototype.createFontStyle=function(r){var a=r.fontVariant.filter(function(l){return l==="normal"||l==="small-caps"}).join(""),s=_Ie(r.fontFamily).join(", "),i=ox(r.fontSize)?""+r.fontSize.number+r.fontSize.unit:r.fontSize.number+"px";return[[r.fontStyle,a,r.fontWeight,i,s].join(" "),s,i]},t.prototype.renderTextNode=function(r,a){return Kn(this,void 0,void 0,function(){var s,i,l,o,d,u,f,p,h=this;return Tn(this,function(m){return s=this.createFontStyle(a),i=s[0],l=s[1],o=s[2],this.ctx.font=i,this.ctx.direction=a.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",d=this.fontMetrics.getMetrics(l,o),u=d.baseline,f=d.middle,p=a.paintOrder,r.textBounds.forEach(function(b){p.forEach(function(v){switch(v){case 0:h.ctx.fillStyle=Wa(a.color),h.renderTextWithLetterSpacing(b,a.letterSpacing,u);var y=a.textShadow;y.length&&b.text.trim().length&&(y.slice(0).reverse().forEach(function(j){h.ctx.shadowColor=Wa(j.color),h.ctx.shadowOffsetX=j.offsetX.number*h.options.scale,h.ctx.shadowOffsetY=j.offsetY.number*h.options.scale,h.ctx.shadowBlur=j.blur.number,h.renderTextWithLetterSpacing(b,a.letterSpacing,u)}),h.ctx.shadowColor="",h.ctx.shadowOffsetX=0,h.ctx.shadowOffsetY=0,h.ctx.shadowBlur=0),a.textDecorationLine.length&&(h.ctx.fillStyle=Wa(a.textDecorationColor||a.color),a.textDecorationLine.forEach(function(j){switch(j){case 1:h.ctx.fillRect(b.bounds.left,Math.round(b.bounds.top+u),b.bounds.width,1);break;case 2:h.ctx.fillRect(b.bounds.left,Math.round(b.bounds.top),b.bounds.width,1);break;case 3:h.ctx.fillRect(b.bounds.left,Math.ceil(b.bounds.top+f),b.bounds.width,1);break}}));break;case 1:a.webkitTextStrokeWidth&&b.text.trim().length&&(h.ctx.strokeStyle=Wa(a.webkitTextStrokeColor),h.ctx.lineWidth=a.webkitTextStrokeWidth,h.ctx.lineJoin=window.chrome?"miter":"round",h.ctx.strokeText(b.text,b.bounds.left,b.bounds.top+u)),h.ctx.strokeStyle="",h.ctx.lineWidth=0,h.ctx.lineJoin="miter";break}})}),[2]})})},t.prototype.renderReplacedElement=function(r,a,s){if(s&&r.intrinsicWidth>0&&r.intrinsicHeight>0){var i=cb(r),l=ob(a);this.path(l),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(s,0,0,r.intrinsicWidth,r.intrinsicHeight,i.left,i.top,i.width,i.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(r){return Kn(this,void 0,void 0,function(){var a,s,i,l,o,d,_,_,u,f,p,h,E,m,b,T,v,y,j,_,N,E,T;return Tn(this,function(B){switch(B.label){case 0:this.applyEffects(r.getEffects(4)),a=r.container,s=r.curves,i=a.styles,l=0,o=a.textNodes,B.label=1;case 1:return l<o.length?(d=o[l],[4,this.renderTextNode(d,i)]):[3,4];case 2:B.sent(),B.label=3;case 3:return l++,[3,1];case 4:if(!(a instanceof Az))return[3,8];B.label=5;case 5:return B.trys.push([5,7,,8]),[4,this.context.cache.match(a.src)];case 6:return _=B.sent(),this.renderReplacedElement(a,s,_),[3,8];case 7:return B.sent(),this.context.logger.error("Error loading image "+a.src),[3,8];case 8:if(a instanceof fz&&this.renderReplacedElement(a,s,a.canvas),!(a instanceof pz))return[3,12];B.label=9;case 9:return B.trys.push([9,11,,12]),[4,this.context.cache.match(a.svg)];case 10:return _=B.sent(),this.renderReplacedElement(a,s,_),[3,12];case 11:return B.sent(),this.context.logger.error("Error loading svg "+a.svg.substring(0,255)),[3,12];case 12:return a instanceof gz&&a.tree?(u=new t(this.context,{scale:this.options.scale,backgroundColor:a.backgroundColor,x:0,y:0,width:a.width,height:a.height}),[4,u.render(a.tree)]):[3,14];case 13:f=B.sent(),a.width&&a.height&&this.ctx.drawImage(f,0,0,a.width,a.height,a.bounds.left,a.bounds.top,a.bounds.width,a.bounds.height),B.label=14;case 14:if(a instanceof YE&&(p=Math.min(a.bounds.width,a.bounds.height),a.type===ab?a.checked&&(this.ctx.save(),this.path([new rt(a.bounds.left+p*.39363,a.bounds.top+p*.79),new rt(a.bounds.left+p*.16,a.bounds.top+p*.5549),new rt(a.bounds.left+p*.27347,a.bounds.top+p*.44071),new rt(a.bounds.left+p*.39694,a.bounds.top+p*.5649),new rt(a.bounds.left+p*.72983,a.bounds.top+p*.23),new rt(a.bounds.left+p*.84,a.bounds.top+p*.34085),new rt(a.bounds.left+p*.39363,a.bounds.top+p*.79)]),this.ctx.fillStyle=Wa(aM),this.ctx.fill(),this.ctx.restore()):a.type===nb&&a.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(a.bounds.left+p/2,a.bounds.top+p/2,p/4,0,Math.PI*2,!0),this.ctx.fillStyle=Wa(aM),this.ctx.fill(),this.ctx.restore())),jIe(a)&&a.value.length){switch(h=this.createFontStyle(i),E=h[0],m=h[1],b=this.fontMetrics.getMetrics(E,m).baseline,this.ctx.font=E,this.ctx.fillStyle=Wa(i.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=SIe(a.styles.textAlign),T=cb(a),v=0,a.styles.textAlign){case 1:v+=T.width/2;break;case 2:v+=T.width;break}y=T.add(v,0,0,-T.height/2+1),this.ctx.save(),this.path([new rt(T.left,T.top),new rt(T.left+T.width,T.top),new rt(T.left+T.width,T.top+T.height),new rt(T.left,T.top+T.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Vf(a.value,y),i.letterSpacing,b),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!La(a.styles.display,2048))return[3,20];if(a.styles.listStyleImage===null)return[3,19];if(j=a.styles.listStyleImage,j.type!==0)return[3,18];_=void 0,N=j.url,B.label=15;case 15:return B.trys.push([15,17,,18]),[4,this.context.cache.match(N)];case 16:return _=B.sent(),this.ctx.drawImage(_,a.bounds.left-(_.width+10),a.bounds.top),[3,18];case 17:return B.sent(),this.context.logger.error("Error loading list-style-image "+N),[3,18];case 18:return[3,20];case 19:r.listValue&&a.styles.listStyleType!==-1&&(E=this.createFontStyle(i)[0],this.ctx.font=E,this.ctx.fillStyle=Wa(i.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",T=new ko(a.bounds.left,a.bounds.top+Er(a.styles.paddingTop,a.bounds.width),a.bounds.width,LU(i.lineHeight,i.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Vf(r.listValue,T),i.letterSpacing,LU(i.lineHeight,i.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),B.label=20;case 20:return[2]}})})},t.prototype.renderStackContent=function(r){return Kn(this,void 0,void 0,function(){var a,s,j,i,l,j,o,d,j,u,f,j,p,h,j,m,b,j,v,y,j;return Tn(this,function(_){switch(_.label){case 0:if(La(r.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(r.element)];case 1:_.sent(),a=0,s=r.negativeZIndex,_.label=2;case 2:return a<s.length?(j=s[a],[4,this.renderStack(j)]):[3,5];case 3:_.sent(),_.label=4;case 4:return a++,[3,2];case 5:return[4,this.renderNodeContent(r.element)];case 6:_.sent(),i=0,l=r.nonInlineLevel,_.label=7;case 7:return i<l.length?(j=l[i],[4,this.renderNode(j)]):[3,10];case 8:_.sent(),_.label=9;case 9:return i++,[3,7];case 10:o=0,d=r.nonPositionedFloats,_.label=11;case 11:return o<d.length?(j=d[o],[4,this.renderStack(j)]):[3,14];case 12:_.sent(),_.label=13;case 13:return o++,[3,11];case 14:u=0,f=r.nonPositionedInlineLevel,_.label=15;case 15:return u<f.length?(j=f[u],[4,this.renderStack(j)]):[3,18];case 16:_.sent(),_.label=17;case 17:return u++,[3,15];case 18:p=0,h=r.inlineLevel,_.label=19;case 19:return p<h.length?(j=h[p],[4,this.renderNode(j)]):[3,22];case 20:_.sent(),_.label=21;case 21:return p++,[3,19];case 22:m=0,b=r.zeroOrAutoZIndexOrTransformedOrOpacity,_.label=23;case 23:return m<b.length?(j=b[m],[4,this.renderStack(j)]):[3,26];case 24:_.sent(),_.label=25;case 25:return m++,[3,23];case 26:v=0,y=r.positiveZIndex,_.label=27;case 27:return v<y.length?(j=y[v],[4,this.renderStack(j)]):[3,30];case 28:_.sent(),_.label=29;case 29:return v++,[3,27];case 30:return[2]}})})},t.prototype.mask=function(r){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(r.slice(0).reverse()),this.ctx.closePath()},t.prototype.path=function(r){this.ctx.beginPath(),this.formatPath(r),this.ctx.closePath()},t.prototype.formatPath=function(r){var a=this;r.forEach(function(s,i){var l=pi(s)?s.start:s;i===0?a.ctx.moveTo(l.x,l.y):a.ctx.lineTo(l.x,l.y),pi(s)&&a.ctx.bezierCurveTo(s.startControl.x,s.startControl.y,s.endControl.x,s.endControl.y,s.end.x,s.end.y)})},t.prototype.renderRepeat=function(r,a,s,i){this.path(r),this.ctx.fillStyle=a,this.ctx.translate(s,i),this.ctx.fill(),this.ctx.translate(-s,-i)},t.prototype.resizeImage=function(r,a,s){var i;if(r.width===a&&r.height===s)return r;var l=(i=this.canvas.ownerDocument)!==null&&i!==void 0?i:document,o=l.createElement("canvas");o.width=Math.max(1,a),o.height=Math.max(1,s);var d=o.getContext("2d");return d.drawImage(r,0,0,r.width,r.height,0,0,a,s),o},t.prototype.renderBackgroundImage=function(r){return Kn(this,void 0,void 0,function(){var a,s,i,l,o,d;return Tn(this,function(u){switch(u.label){case 0:a=r.styles.backgroundImage.length-1,s=function(f){var p,h,m,D,X,K,G,Q,R,b,D,X,K,G,Q,v,y,j,_,N,E,T,B,F,R,U,D,L,P,G,Q,H,X,K,ee,W,Y,M,O,q,z,J;return Tn(this,function(re){switch(re.label){case 0:if(f.type!==0)return[3,5];p=void 0,h=f.url,re.label=1;case 1:return re.trys.push([1,3,,4]),[4,i.context.cache.match(h)];case 2:return p=re.sent(),[3,4];case 3:return re.sent(),i.context.logger.error("Error loading background-image "+h),[3,4];case 4:return p&&(m=oN(r,a,[p.width,p.height,p.width/p.height]),D=m[0],X=m[1],K=m[2],G=m[3],Q=m[4],R=i.ctx.createPattern(i.resizeImage(p,G,Q),"repeat"),i.renderRepeat(D,R,X,K)),[3,6];case 5:uBe(f)?(b=oN(r,a,[null,null,null]),D=b[0],X=b[1],K=b[2],G=b[3],Q=b[4],v=iBe(f.angle,G,Q),y=v[0],j=v[1],_=v[2],N=v[3],E=v[4],T=document.createElement("canvas"),T.width=G,T.height=Q,B=T.getContext("2d"),F=B.createLinearGradient(j,N,_,E),OU(f.stops,y).forEach(function(le){return F.addColorStop(le.stop,Wa(le.color))}),B.fillStyle=F,B.fillRect(0,0,G,Q),G>0&&Q>0&&(R=i.ctx.createPattern(T,"repeat"),i.renderRepeat(D,R,X,K))):ABe(f)&&(U=oN(r,a,[null,null,null]),D=U[0],L=U[1],P=U[2],G=U[3],Q=U[4],H=f.position.length===0?[GE]:f.position,X=Er(H[0],G),K=Er(H[H.length-1],Q),ee=lBe(f,X,K,G,Q),W=ee[0],Y=ee[1],W>0&&Y>0&&(M=i.ctx.createRadialGradient(L+X,P+K,0,L+X,P+K,W),OU(f.stops,W*2).forEach(function(le){return M.addColorStop(le.stop,Wa(le.color))}),i.path(D),i.ctx.fillStyle=M,W!==Y?(O=r.bounds.left+.5*r.bounds.width,q=r.bounds.top+.5*r.bounds.height,z=Y/W,J=1/z,i.ctx.save(),i.ctx.translate(O,q),i.ctx.transform(1,0,0,z,0,0),i.ctx.translate(-O,-q),i.ctx.fillRect(L,J*(P-q)+q,G,Q*J),i.ctx.restore()):i.ctx.fill())),re.label=6;case 6:return a--,[2]}})},i=this,l=0,o=r.styles.backgroundImage.slice(0).reverse(),u.label=1;case 1:return l<o.length?(d=o[l],[5,s(d)]):[3,4];case 2:u.sent(),u.label=3;case 3:return l++,[3,1];case 4:return[2]}})})},t.prototype.renderSolidBorder=function(r,a,s){return Kn(this,void 0,void 0,function(){return Tn(this,function(i){return this.path(xM(s,a)),this.ctx.fillStyle=Wa(r),this.ctx.fill(),[2]})})},t.prototype.renderDoubleBorder=function(r,a,s,i){return Kn(this,void 0,void 0,function(){var l,o;return Tn(this,function(d){switch(d.label){case 0:return a<3?[4,this.renderSolidBorder(r,s,i)]:[3,2];case 1:return d.sent(),[2];case 2:return l=xIe(i,s),this.path(l),this.ctx.fillStyle=Wa(r),this.ctx.fill(),o=hIe(i,s),this.path(o),this.ctx.fill(),[2]}})})},t.prototype.renderNodeBackgroundAndBorders=function(r){return Kn(this,void 0,void 0,function(){var a,s,i,l,o,d,u,f,p=this;return Tn(this,function(h){switch(h.label){case 0:return this.applyEffects(r.getEffects(2)),a=r.container.styles,s=!Bc(a.backgroundColor)||a.backgroundImage.length,i=[{style:a.borderTopStyle,color:a.borderTopColor,width:a.borderTopWidth},{style:a.borderRightStyle,color:a.borderRightColor,width:a.borderRightWidth},{style:a.borderBottomStyle,color:a.borderBottomColor,width:a.borderBottomWidth},{style:a.borderLeftStyle,color:a.borderLeftColor,width:a.borderLeftWidth}],l=EIe(cA(a.backgroundClip,0),r.curves),s||a.boxShadow.length?(this.ctx.save(),this.path(l),this.ctx.clip(),Bc(a.backgroundColor)||(this.ctx.fillStyle=Wa(a.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(r.container)]):[3,2];case 1:h.sent(),this.ctx.restore(),a.boxShadow.slice(0).reverse().forEach(function(m){p.ctx.save();var b=lb(r.curves),v=m.inset?0:CIe,y=fIe(b,-v+(m.inset?1:-1)*m.spread.number,(m.inset?1:-1)*m.spread.number,m.spread.number*(m.inset?-2:2),m.spread.number*(m.inset?-2:2));m.inset?(p.path(b),p.ctx.clip(),p.mask(y)):(p.mask(b),p.ctx.clip(),p.path(y)),p.ctx.shadowOffsetX=m.offsetX.number+v,p.ctx.shadowOffsetY=m.offsetY.number,p.ctx.shadowColor=Wa(m.color),p.ctx.shadowBlur=m.blur.number,p.ctx.fillStyle=m.inset?Wa(m.color):"rgba(0,0,0,1)",p.ctx.fill(),p.ctx.restore()}),h.label=2;case 2:o=0,d=0,u=i,h.label=3;case 3:return d<u.length?(f=u[d],f.style!==0&&!Bc(f.color)&&f.width>0?f.style!==2?[3,5]:[4,this.renderDashedDottedBorder(f.color,f.width,o,r.curves,2)]:[3,11]):[3,13];case 4:return h.sent(),[3,11];case 5:return f.style!==3?[3,7]:[4,this.renderDashedDottedBorder(f.color,f.width,o,r.curves,3)];case 6:return h.sent(),[3,11];case 7:return f.style!==4?[3,9]:[4,this.renderDoubleBorder(f.color,f.width,o,r.curves)];case 8:return h.sent(),[3,11];case 9:return[4,this.renderSolidBorder(f.color,o,r.curves)];case 10:h.sent(),h.label=11;case 11:o++,h.label=12;case 12:return d++,[3,3];case 13:return[2]}})})},t.prototype.renderDashedDottedBorder=function(r,a,s,i,l){return Kn(this,void 0,void 0,function(){var o,d,u,f,p,h,m,b,v,y,j,_,N,E,T,B,T,B;return Tn(this,function(F){return this.ctx.save(),o=mIe(i,s),d=xM(i,s),l===2&&(this.path(d),this.ctx.clip()),pi(d[0])?(u=d[0].start.x,f=d[0].start.y):(u=d[0].x,f=d[0].y),pi(d[1])?(p=d[1].end.x,h=d[1].end.y):(p=d[1].x,h=d[1].y),s===0||s===2?m=Math.abs(u-p):m=Math.abs(f-h),this.ctx.beginPath(),l===3?this.formatPath(o):this.formatPath(d.slice(0,2)),b=a<3?a*3:a*2,v=a<3?a*2:a,l===3&&(b=a,v=a),y=!0,m<=b*2?y=!1:m<=b*2+v?(j=m/(2*b+v),b*=j,v*=j):(_=Math.floor((m+v)/(b+v)),N=(m-_*b)/(_-1),E=(m-(_+1)*b)/_,v=E<=0||Math.abs(v-N)<Math.abs(v-E)?N:E),y&&(l===3?this.ctx.setLineDash([0,b+v]):this.ctx.setLineDash([b,v])),l===3?(this.ctx.lineCap="round",this.ctx.lineWidth=a):this.ctx.lineWidth=a*2+1.1,this.ctx.strokeStyle=Wa(r),this.ctx.stroke(),this.ctx.setLineDash([]),l===2&&(pi(d[0])&&(T=d[3],B=d[0],this.ctx.beginPath(),this.formatPath([new rt(T.end.x,T.end.y),new rt(B.start.x,B.start.y)]),this.ctx.stroke()),pi(d[1])&&(T=d[1],B=d[2],this.ctx.beginPath(),this.formatPath([new rt(T.end.x,T.end.y),new rt(B.start.x,B.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},t.prototype.render=function(r){return Kn(this,void 0,void 0,function(){var a;return Tn(this,function(s){switch(s.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Wa(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),a=pIe(r),[4,this.renderStack(a)];case 1:return s.sent(),this.applyEffects([]),[2,this.canvas]}})})},t})(Dz),jIe=function(e){return e instanceof mz||e instanceof hz?!0:e instanceof YE&&e.type!==nb&&e.type!==ab},EIe=function(e,t){switch(e){case 0:return lb(t);case 2:return oIe(t);case 1:default:return ob(t)}},SIe=function(e){switch(e){case 1:return"center";case 2:return"right";case 0:default:return"left"}},BIe=["-apple-system","system-ui"],_Ie=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(t){return BIe.indexOf(t)===-1}):e},TIe=(function(e){Zi(t,e);function t(r,a){var s=e.call(this,r,a)||this;return s.canvas=a.canvas?a.canvas:document.createElement("canvas"),s.ctx=s.canvas.getContext("2d"),s.options=a,s.canvas.width=Math.floor(a.width*a.scale),s.canvas.height=Math.floor(a.height*a.scale),s.canvas.style.width=a.width+"px",s.canvas.style.height=a.height+"px",s.ctx.scale(s.options.scale,s.options.scale),s.ctx.translate(-a.x,-a.y),s.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+a.width+"x"+a.height+" at "+a.x+","+a.y+") with scale "+a.scale),s}return t.prototype.render=function(r){return Kn(this,void 0,void 0,function(){var a,s;return Tn(this,function(i){switch(i.label){case 0:return a=XC(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,r),[4,IIe(a)];case 1:return s=i.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Wa(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(s,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},t})(Dz),IIe=function(e){return new Promise(function(t,r){var a=new Image;a.onload=function(){t(a)},a.onerror=r,a.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},FIe=(function(){function e(t){var r=t.id,a=t.enabled;this.id=r,this.enabled=a,this.start=Date.now()}return e.prototype.debug=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,em([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,em([this.id,this.getTime()+"ms"],t))},e.prototype.warn=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,em([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},e.prototype.error=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,em([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},e.instances={},e})(),DIe=(function(){function e(t,r){var a;this.windowBounds=r,this.instanceName="#"+e.instanceCount++,this.logger=new FIe({id:this.instanceName,enabled:t.logging}),this.cache=(a=t.cache)!==null&&a!==void 0?a:new eIe(this,t)}return e.instanceCount=1,e})(),rs=function(e,t){return t===void 0&&(t={}),UIe(e,t)};typeof window<"u"&&Sz.setContext(window);var UIe=function(e,t){return Kn(void 0,void 0,void 0,function(){var r,a,s,i,l,o,d,u,f,p,h,m,b,v,y,j,_,N,E,T,F,B,F,R,U,D,L,P,G,Q,H,X,K,ee,W,Y,M,O,q,z;return Tn(this,function(J){switch(J.label){case 0:if(!e||typeof e!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(r=e.ownerDocument,!r)throw new Error("Element is not attached to a Document");if(a=r.defaultView,!a)throw new Error("Document is not attached to a Window");return s={allowTaint:(R=t.allowTaint)!==null&&R!==void 0?R:!1,imageTimeout:(U=t.imageTimeout)!==null&&U!==void 0?U:15e3,proxy:t.proxy,useCORS:(D=t.useCORS)!==null&&D!==void 0?D:!1},i=MC({logging:(L=t.logging)!==null&&L!==void 0?L:!0,cache:t.cache},s),l={windowWidth:(P=t.windowWidth)!==null&&P!==void 0?P:a.innerWidth,windowHeight:(G=t.windowHeight)!==null&&G!==void 0?G:a.innerHeight,scrollX:(Q=t.scrollX)!==null&&Q!==void 0?Q:a.pageXOffset,scrollY:(H=t.scrollY)!==null&&H!==void 0?H:a.pageYOffset},o=new ko(l.scrollX,l.scrollY,l.windowWidth,l.windowHeight),d=new DIe(i,o),u=(X=t.foreignObjectRendering)!==null&&X!==void 0?X:!1,f={allowTaint:(K=t.allowTaint)!==null&&K!==void 0?K:!1,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:u,copyStyles:u},d.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),p=new AM(d,e,f),h=p.clonedReferenceElement,h?[4,p.toIFrame(r,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return m=J.sent(),b=XE(h)||RTe(h)?fSe(h.ownerDocument):mv(d,h),v=b.width,y=b.height,j=b.left,_=b.top,N=MIe(d,h,t.backgroundColor),E={canvas:t.canvas,backgroundColor:N,scale:(W=(ee=t.scale)!==null&&ee!==void 0?ee:a.devicePixelRatio)!==null&&W!==void 0?W:1,x:((Y=t.x)!==null&&Y!==void 0?Y:0)+j,y:((M=t.y)!==null&&M!==void 0?M:0)+_,width:(O=t.width)!==null&&O!==void 0?O:Math.ceil(v),height:(q=t.height)!==null&&q!==void 0?q:Math.ceil(y)},u?(d.logger.debug("Document cloned, using foreign object rendering"),F=new TIe(d,E),[4,F.render(h)]):[3,3];case 2:return T=J.sent(),[3,5];case 3:return d.logger.debug("Document cloned, element located at "+j+","+_+" with size "+v+"x"+y+" using computed rendering"),d.logger.debug("Starting DOM parsing"),B=vz(d,h),N===B.styles.backgroundColor&&(B.styles.backgroundColor=po.TRANSPARENT),d.logger.debug("Starting renderer for element at "+E.x+","+E.y+" with size "+E.width+"x"+E.height),F=new kIe(d,E),[4,F.render(B)];case 4:T=J.sent(),J.label=5;case 5:return(!((z=t.removeContainer)!==null&&z!==void 0)||z)&&(AM.destroy(m)||d.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),d.logger.debug("Finished rendering"),[2,T]}})})},MIe=function(e,t,r){var a=t.ownerDocument,s=a.documentElement?zf(e,getComputedStyle(a.documentElement).backgroundColor):po.TRANSPARENT,i=a.body?zf(e,getComputedStyle(a.body).backgroundColor):po.TRANSPARENT,l=typeof r=="string"?zf(e,r):r===null?po.TRANSPARENT:4294967295;return t===a.documentElement?Bc(s)?Bc(i)?l:i:s:l};const $r=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},mM=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},RIe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,financialTotals:i,markReceiptSent:l,latestRate:o}=ht(),[d,u]=k.useState(new Date().getMonth()),[f,p]=k.useState(new Date().getFullYear()),[h,m]=k.useState("selection"),[b,v]=k.useState("fee"),[y,j]=k.useState(null),[_,N]=k.useState(null),[E,T]=k.useState(null),[B,F]=k.useState([]),[R,U]=k.useState(0),[D,L]=k.useState(null),[P,G]=k.useState(!1),[Q,H]=k.useState([]),[X,K]=k.useState(!1),[ee,W]=k.useState({}),Y=k.useRef(null);k.useEffect(()=>{(async()=>{K(!0);try{const[ye,fe]=await Promise.all([we.getInitialDebtData(),we.getSystemSettings()]);Array.isArray(ye)?H(ye):ye&&ye.success&&H(ye.data||[]),W(fe||{})}catch(ye){console.error("Error fetching data",ye)}finally{K(!1)}})()},[]);const M=k.useMemo(()=>t.find(he=>he.month===d&&he.year===f),[t,d,f]),O=k.useMemo(()=>[...r].sort((he,ye)=>he.code.localeCompare(ye.code,void 0,{numeric:!0})),[r]),q=k.useMemo(()=>h==="report"?r.find(he=>he.id===y):h==="bulk"?B[R]:null,[h,r,y,B,R]),z=k.useMemo(()=>Q.find(he=>he.id===(q==null?void 0:q.id)),[Q,q]),J=k.useMemo(()=>{if(!q)return null;const he=a.find(fe=>fe.propertyId===q.id&&fe.isOwner),ye=s.find(fe=>fe.cedula===(he==null?void 0:he.cedula));return{fullName:(he==null?void 0:he.fullName)||"Propietario",email:(ye==null?void 0:ye.email)||"",phone:(he==null?void 0:he.phone)||(ye==null?void 0:ye.phone)||"",telegramId:(ye==null?void 0:ye.telegramChatId)||"",propertyCode:q.code,propertyId:q.id}},[q,a,s]),re=he=>{if(!he)return"";let ye=he.trim();return ye.startsWith("+")?ye.replace(/\D/g,""):ye.startsWith("0")?"58"+ye.substring(1).replace(/\D/g,""):ye.length===10?"58"+ye.replace(/\D/g,""):ye.replace(/\D/g,"")},le=async()=>{if(Y.current){G(!0);try{const ye=(await rs(Y.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"})).toDataURL("image/png"),fe=document.createElement("a");fe.href=ye,fe.download=`Aviso_${q==null?void 0:q.code}_${Te[d]}.png`,fe.click()}catch(he){console.error("Capture failed",he),alert("Error al capturar imagen.")}finally{G(!1)}}},ne=async()=>{if(Y.current){G(!0);try{const he=await rs(Y.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"}),ye=await new Promise(qe=>he.toBlob(qe,"image/png"));if(!ye)throw new Error("Blob creation failed");const fe=`Aviso_${q==null?void 0:q.code}_${Te[d]}.png`,Ue=new File([ye],fe,{type:"image/png"});if(navigator.share&&navigator.canShare&&navigator.canShare({files:[Ue]}))await navigator.share({files:[Ue],title:`Aviso de Cobro - ${q==null?void 0:q.code}`,text:`Aviso de Cobro de ${Te[d]} ${f} para la unidad ${q==null?void 0:q.code}`});else{const qe=he.toDataURL("image/png"),at=document.createElement("a");at.href=qe,at.download=fe,at.click(),alert("La función de compartir archivos no es compatible con este navegador. La imagen se ha descargado.")}}catch(he){console.error("Share failed",he),alert("Error al compartir imagen.")}finally{G(!1)}}},ae=async he=>{if(!J||!q||!M)return;const ye=M.debts.find(nt=>nt.propertyId===q.id),fe=ye?Number(ye.amountUsd)-Number(ye.paidAmount):0,Ue=(z==null?void 0:z.current_debt)||0,qe=fe+Ue,at=`🏢 *AVISO DE COBRO - SAC 2026*

Estimado(a) *${J.fullName}*,
Unidad: *${q.type} ${q.number}* (${q.code})

📅 *Periodo:* ${Te[d]} ${f}
------------------------------------------
💵 *Cuota del Mes:* $${$r(fe)}
🤝 *Convenio de Pago:* $${$r(Ue)}
------------------------------------------
🔥 *TOTAL PENDIENTE:* $${$r(qe)}

Por favor, gestione su pago en nuestro portal digital:
🔗 *ACCEDER AL PORTAL:* ${Rr}

¡Gracias!`;if(he==="whatsapp"){const nt=re(J.phone);if(!nt)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${nt}?text=${encodeURIComponent(at)}`,"_blank"),h==="bulk"&&await l(M.id,q.id,"whatsapp");return}if(he==="share"){if(navigator.share)try{await navigator.share({title:`Aviso de Cobro - ${q.code}`,text:at.replace(/\*/g,""),url:Rr})}catch(nt){console.warn("Share failed",nt)}else alert("La función de compartir no está disponible en este navegador.");return}L(he);try{const nt={channel:he,messageType:"custom",subject:`Aviso de Cobro SAC 2026 - ${q.code}`,recipients:[{name:J.fullName,email:J.email,telegramChatId:J.telegramId,customMessage:at.replace(/\*/g,"")}]},kt=await(await fetch(`${Ne}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(nt)})).json();kt.status==="success"?(await l(M.id,q.id,he),alert(`¡Éxito! Mensaje enviado por ${he}.`)):alert("Error: "+kt.message)}catch{alert("Error de red al enviar.")}finally{L(null)}},ie=()=>{if(!q||!J||!M||!pe)return;const he=b==="statement",ye=()=>he?`
                    <div class="section-title">Resumen de Cuenta</div>
                    <table>
                        <thead>
                            <tr>
                                <th style="width: 40%; text-align: left;">Periodo</th>
                                <th style="text-align: right;">Monto ($)</th>
                                <th style="text-align: right;">Pagado ($)</th>
                                <th style="text-align: right; background: #f8fafc;">Pendiente ($)</th>
                            </tr>
                        </thead>
                        <tbody>
                            ${t.filter(nt=>nt.year===f||nt.year===f-1).sort((nt,Ct)=>Ct.year*12+Ct.month-(nt.year*12+nt.month)).slice(0,12).map(nt=>{const Ct=nt.debts.find(ft=>ft.propertyId===q.id);if(!Ct)return"";const kt=Number(Ct.amountUsd)-Number(Ct.paidAmount);return kt<=0?"":`
                                        <tr>
                                            <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-transform: uppercase; font-weight: 700;">${Te[nt.month]} ${nt.year}</td>
                                            <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-align: right; color: #64748b;">$ ${$r(Ct.amountUsd)}</td>
                                            <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-align: right; color: #10b981;">$ ${$r(Ct.paidAmount)}</td>
                                            <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-align: right; font-weight: 700; background: #f8fafc; color: #1e3a8a;">$ ${$r(kt)}</td>
                                        </tr>
                                    `}).join("")}
                            ${z&&z.current_debt>0?`
                                <tr style="background-color: #fef3c7;">
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; font-weight: 700; color: #b45309; text-transform: uppercase;">CONVENIO DE PAGO</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-align: right; color: #64748b;">-</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-align: right; color: #10b981;">-</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-align: right; font-weight: 800; color: #b45309; background: #fffbeb;">$ ${$r(z.current_debt)}</td>
                                </tr>
                            `:""}
                        </tbody>
                    </table>
                `:pe.sections.map(nt=>nt.items.length>0?`
                    <div class="section-title">${nt.title}</div>
                    <table>
                        <thead>
                            <tr>
                                <th style="width: 50%; text-align: left;">Concepto</th>
                                <th style="text-align: center;">Base</th>
                                <th style="text-align: right;">Global ($)</th>
                                <th style="text-align: right; background: #f8fafc;">Su Cuota ($)</th>
                            </tr>
                        </thead>
                        <tbody>
                            ${nt.items.map(Ct=>`
                                <tr>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-transform: uppercase;">${Ct.description}</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 10px; text-align: center; color: #64748b;">${Ct.basisDesc}</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-align: right; color: #64748b;">$ ${$r(Ct.global)}</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-align: right; font-weight: 700; background: #f8fafc; color: #1e3a8a;">$ ${$r(Ct.myPortion)}</td>
                                </tr>
                            `).join("")}
                        </tbody>
                    </table>
                `:"").join(""),fe=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>${he?"Estado de Cuenta":"Aviso de Cobro"} - ${q.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 20px; color: #1e293b; background-color: #f8fafc; }
        .container { max-width: 900px; margin: 0 auto; background: white; padding: 40px; border-radius: 20px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); border: 1px solid #e2e8f0; }
        .header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; border-bottom: 2px solid #f1f5f9; padding-bottom: 20px; }
        .logo-area { text-align: left; }
        .logo-title { font-size: 28px; font-weight: 900; color: #0f172a; letter-spacing: -1px; }
        .logo-subtitle { font-size: 10px; font-weight: 900; color: #2563eb; text-transform: uppercase; letter-spacing: 2px; }
        .property-info { text-align: right; }
        .prop-label { font-size: 9px; font-weight: 900; color: #64748b; text-transform: uppercase; }
        .prop-value { font-size: 14px; font-weight: 700; color: #1e293b; }
        .section-title { font-size: 12px; font-weight: 900; text-transform: uppercase; color: #0f172a; background: #f1f5f9; padding: 8px 15px; border-radius: 8px; margin: 20px 0 10px 0; display: flex; align-items: center; gap: 10px; }
        .section-title::before { content: ""; display: block; width: 4px; height: 12px; background: #2563eb; border-radius: 2px; }
        table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
        th { font-size: 9px; font-weight: 900; color: #64748b; text-transform: uppercase; text-align: left; padding: 8px; border-bottom: 2px solid #f1f5f9; }
        .summary-box { background: #0f172a; color: white; padding: 30px; border-radius: 20px; margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
        .total-label { font-size: 10px; font-weight: 900; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
        .total-value { font-size: 30px; font-weight: 900; color: #60a5fa; letter-spacing: -1px; }
        .ves-value { font-size: 16px; font-weight: 700; color: #cbd5e1; }
        .payment-info { margin-top: 30px; display: flex; justify-content: space-between; border-top: 1px solid #f1f5f9; padding-top: 20px; }
        .payment-column { font-size: 11px; line-height: 1.5; }
        .payment-title { font-size: 10px; font-weight: 900; color: #2563eb; text-transform: uppercase; margin-bottom: 8px; }
        .footer { text-align: center; font-size: 9px; color: #94a3b8; margin-top: 40px; border-top: 1px solid #f1f5f9; padding-top: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
        @media print {
            body { background: white; padding: 0; }
            .container { box-shadow: none; border: none; padding: 0; }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="logo-area">
                <div class="logo-title">SAC <span style="color: #2563eb;">2026</span></div>
                <div class="logo-subtitle">${va}</div>
                <div style="font-size: 12px; font-weight: 700; color: #64748b; margin-top: 5px;">${he?"ESTADO DE CUENTA INDIVIDUAL":"AVISO DE COBRO INDIVIDUAL"}</div>
            </div>
            <div class="property-info">
                <div style="margin-bottom: 10px;">
                    <div class="prop-label">Propietario</div>
                    <div class="prop-value">${(J==null?void 0:J.fullName)||"Propietario"}</div>
                </div>
                <div>
                    <div class="prop-label">Unidad / Alícuota</div>
                    <div class="prop-value">${q.code} (${q.type} ${q.number}) / ${(Number(q.aliquot)||0).toFixed(4)}%</div>
                </div>
            </div>
        </div>

        <div style="display: flex; justify-content: space-between; margin-bottom: 20px; font-size: 11px; font-weight: 700; color: #64748b;">
            <div>PERIODO: ${Te[d].toUpperCase()} ${f}</div>
            <div>TASA: Bs. ${o.toFixed(2)}</div>
        </div>

        ${ye()}

        <div class="summary-box">
            <div>
                <div style="margin-bottom: 15px;">
                    <div class="total-label">Subtotal Mes</div>
                    <div style="font-size: 16px; font-weight: 700;">$ ${$r(pe.totalIndividualSubtotal)}</div>
                </div>
                <div style="display: flex; gap: 20px;">
                    <div>
                        <div class="total-label">Reserva (${pe.reserveFundPct}%)</div>
                        <div style="font-size: 14px; font-weight: 700;">$ ${$r(pe.individualReserve)}</div>
                    </div>
                    <div>
                        <div class="total-label">Convenio</div>
                        <div style="font-size: 14px; font-weight: 700;">$ ${$r(pe.agreementPending)}</div>
                    </div>
                </div>
            </div>
            <div style="text-align: right; border-left: 1px solid rgba(255,255,255,0.1); padding-left: 20px;">
                <div class="total-label">Total Pendiente</div>
                <div class="total-value">$ ${$r(pe.finalTotal)}</div>
                <div class="ves-value">Bs. ${mM(pe.finalTotal*o)}</div>
            </div>
        </div>

        <div class="payment-info">
            <div class="payment-column">
                <div class="payment-title">Datos para el Pago</div>
                <div style="font-weight: 700;">${ee.payment_bank_name||"BanPlus"} ${ee.payment_account_type||"Cta Cte"}</div>
                <div style="font-weight: 900; color: #2563eb;"># ${ee.payment_account_number||"0174-0124-6812-4414-5759"}</div>
                <div>RIF: ${ee.payment_rif||"J-313266507"}</div>
                <div>Pago Móvil: ${ee.payment_mobile_phone||"0424-4910040"}</div>
            </div>
            <div class="payment-column" style="text-align: right;">
                <div class="payment-title">Reportar Pago</div>
                <div>Enviar comprobante a:</div>
                <div style="font-weight: 700;">${ee.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com"}</div>
                <div style="font-weight: 700;">WhatsApp: ${ee.payment_whatsapp||"0412-8213310"}</div>
                <div style="font-size: 9px; color: #f59e0b; font-weight: 900; margin-top: 5px;">INDICAR #CASA Y NOMBRE PARA IDENTIFICAR</div>
            </div>
        </div>

        <div style="margin-top: 30px; font-size: 11px; color: #64748b; line-height: 1.6; font-style: italic; text-align: center;">
            Este documento es un estado oficial de sus compromisos para con la comunidad. 
            El pago oportuno garantiza la continuidad de los servicios y la valorización de nuestro patrimonio.
        </div>

        <div class="footer">
            SISTEMA ADMINISTRATIVO PARA CONDOMINIOS SAC 2026 • Kernel V4.2.08 MC/MB • ${q.code} • GENERADO EL ${new Date().toLocaleString()}
        </div>
    </div>
</body>
</html>`,Ue=new Blob([fe],{type:"text/html"}),qe=URL.createObjectURL(Ue),at=document.createElement("a");at.href=qe,at.download=`${he?"Estado":"Cuota"}_${q.code}_${Te[d]}.html`,at.click(),URL.revokeObjectURL(qe)},me=()=>{if(ie(),J&&q&&pe){const he=re(J.phone);if(he){const ye=b==="statement",fe=`🏢 *AVISO DE COBRO - SAC 2026*

Estimado(a) *${J.fullName}*,

Le adjuntamos su ${ye?"estado de cuenta":"aviso de cobro"} en formato HTML para la unidad *${q.code}* correspondiente al periodo *${Te[d]} ${f}*.

💵 *Total a Pagar/Pendiente:* $${$r(pe.finalTotal)} USD

Por favor, descargue y abra el archivo HTML adjunto para ver la relación detallada.

🔗 *ACCEDER AL PORTAL:* ${Rr}

¡Muchas gracias!`;window.open(`https://wa.me/${he}?text=${encodeURIComponent(fe)}`,"_blank"),h==="bulk"&&l(M.id,q.id,"whatsapp")}else alert("El usuario no tiene un teléfono registrado para WhatsApp.")}},Z=()=>{if(!_||!E)return;const he=O.findIndex(Ue=>Ue.id===_),ye=O.findIndex(Ue=>Ue.id===E);if(he===-1||ye===-1||he>ye)return alert("Rango inválido.");const fe=O.slice(he,ye+1);F(fe),U(0),m("bulk")},Me=he=>{if(!M)return null;const ye=Number(he.aliquot)||0,fe=!!he.hasUncommonExpense,Ue=r.filter(it=>it.hasUncommonExpense).length,qe=it=>{var Kt,fr;const Rt=Number(it.amountUsd)||0;let Et=0,jt="";if(it.isSpecial){const Cr=((Kt=it.specialPropertyIds)==null?void 0:Kt.length)||1,cn=(fr=it.specialPropertyIds)==null?void 0:fr.includes(he.id);Et=cn?Rt/Cr:0,jt=cn?`ESP (1/${Cr})`:"Exento"}else it.isUncommon?(Et=fe&&Ue>0?Rt/Ue:0,jt=fe&&Ue>0?`GNC (1/${Ue})`:"Exento"):(Et=Rt*(ye/100),jt=`ALIQ (${ye.toFixed(4)}%)`);return{...it,global:Rt,myPortion:Et,basisDesc:jt}},at=[{title:"Gastos Fijos",items:M.fixedExpenses.map(qe)},{title:"Gastos Variables",items:M.variableExpenses.map(qe)},{title:"Otros Gastos",items:M.otherExpenses.map(qe)}],nt=at.reduce((it,Rt)=>it+Rt.items.reduce((Et,jt)=>Et+jt.myPortion,0),0),Ct=Number(M.reserveFundPercent)||10,kt=nt*(Ct/100),ft=nt+kt,_r=M.debts.find(it=>it.propertyId===he.id),Ar=ft-(_r?Number(_r.paidAmount):0),pa=Q.find(it=>it.id===he.id),Ut=(pa==null?void 0:pa.current_debt)||0,Tr=Ar+Ut;return{sections:at,totalIndividualSubtotal:nt,individualReserve:kt,totalOwnerUsd:ft,amountToPay:Ar,agreementPending:Ut,finalTotal:Tr,reserveFundPct:Ct}},pe=k.useMemo(()=>q?Me(q):null,[q,M,Q]);return h!=="selection"&&q&&pe?n.jsxs("div",{className:"max-w-5xl mx-auto space-y-8 animate-in fade-in duration-500 pb-24 px-1",children:[n.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-4 no-print",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:()=>m("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(gs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex bg-slate-100 p-1 rounded-2xl border border-slate-200",children:[n.jsx("button",{onClick:()=>v("fee"),className:`px-4 py-2 rounded-xl text-[9px] font-black uppercase tracking-widest transition-all ${b==="fee"?"bg-white text-blue-600 shadow-sm":"text-slate-400 hover:text-slate-600"}`,children:"Aviso"}),n.jsx("button",{onClick:()=>v("statement"),className:`px-4 py-2 rounded-xl text-[9px] font-black uppercase tracking-widest transition-all ${b==="statement"?"bg-white text-blue-600 shadow-sm":"text-slate-400 hover:text-slate-600"}`,children:"Estado"})]})]}),n.jsxs("div",{className:"flex items-center gap-2",children:[h==="bulk"&&n.jsxs("div",{className:"flex items-center gap-2 mr-4 bg-slate-100 px-4 py-2 rounded-xl border border-slate-200",children:[n.jsxs("span",{className:"text-[10px] font-black text-slate-500 uppercase tracking-widest",children:["Lote: ",R+1," / ",B.length]}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx("button",{disabled:R===0,onClick:()=>U(he=>he-1),className:"p-1 text-slate-400 hover:text-blue-600 disabled:opacity-30",children:n.jsx(gs,{size:16})}),n.jsx("button",{disabled:R===B.length-1,onClick:()=>U(he=>he+1),className:"p-1 text-slate-400 hover:text-blue-600 disabled:opacity-30",children:n.jsx(_c,{size:16})})]})]}),n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Imprimir",children:n.jsx(wt,{size:20})}),n.jsx("button",{onClick:le,disabled:P,className:"p-3 bg-indigo-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Capturar como Imagen",children:P?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Dp,{size:20})}),n.jsx("button",{onClick:ne,disabled:P,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir Imagen Directamente",children:P?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Aa,{size:20})}),n.jsx("button",{onClick:()=>ae("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Enviar WhatsApp (Texto)",children:n.jsx(Ha,{size:20})}),n.jsx("button",{onClick:ie,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Exportar HTML",children:n.jsx(wr,{size:20})}),n.jsxs("button",{onClick:me,className:"p-3 bg-emerald-600 text-white rounded-xl shadow-lg active:scale-95 transition-all flex items-center gap-1",title:"Exportar HTML y Enviar por WhatsApp",children:[n.jsx(wr,{size:20}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-wider",children:"HTML/WA"})]}),n.jsx("button",{onClick:()=>ae("telegram"),disabled:!(J!=null&&J.telegramId)||!!D,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${J!=null&&J.telegramId?"bg-sky-500":"bg-slate-200"}`,title:"Enviar Telegram",children:D==="telegram"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Bl,{size:20})}),n.jsx("button",{onClick:()=>ae("email"),disabled:!(J!=null&&J.email)||!!D,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${J!=null&&J.email?"bg-indigo-600":"bg-slate-200"}`,title:"Enviar Email",children:D==="email"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Br,{size:20})})]})]}),n.jsxs("div",{ref:Y,className:"bg-white rounded-[3rem] shadow-2xl border border-slate-200 overflow-hidden print:shadow-none print:border-slate-300",children:[n.jsxs("div",{className:"p-10 bg-slate-900 text-white text-center relative",children:[n.jsx("h2",{className:"text-2xl font-black uppercase tracking-[0.2em] mb-2",children:b==="fee"?"Aviso de Cobro Individual":"Estado de Cuenta Individual"}),n.jsxs("p",{className:"text-blue-400 font-black uppercase tracking-widest text-[10px] mb-6",children:[Te[d]," ",f]}),n.jsxs("div",{className:"flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8",children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Inmueble"}),n.jsxs("p",{className:"text-lg font-black text-blue-300",children:[q.type," ",q.number]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Alícuota"}),n.jsxs("p",{className:"text-lg font-black text-emerald-400",children:[(Number(q.aliquot)||0).toFixed(4),"%"]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Tasa del Día"}),n.jsxs("p",{className:"text-lg font-black text-amber-400",children:[o.toFixed(2)," Bs/$"]})]})]})]}),n.jsxs("div",{className:"p-10 space-y-10",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-8 border-b border-slate-100 pb-8",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Propietario"}),n.jsx("p",{className:"text-lg font-black text-slate-900 uppercase",children:J==null?void 0:J.fullName})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Unidad"}),n.jsx("p",{className:"text-lg font-black text-blue-600 uppercase",children:q.code})]})]}),b==="fee"?n.jsx(n.Fragment,{children:pe.sections.map((he,ye)=>he.items.length===0?null:n.jsxs("div",{children:[n.jsxs("h3",{className:"text-sm font-black text-slate-900 uppercase tracking-tighter mb-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-1.5 h-4 bg-blue-600 rounded-full"})," ",he.title]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-slate-100",children:[n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-slate-400 tracking-widest",children:"Concepto"}),n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-slate-400 text-center",children:"Base"}),n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-slate-400 text-right",children:"Gasto Global ($)"}),n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-blue-600 text-right px-4",children:"Su Cuota ($)"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-50",children:he.items.map((fe,Ue)=>n.jsxs("tr",{children:[n.jsx("td",{className:"py-3 text-[11px] font-bold text-slate-600 uppercase",children:fe.description}),n.jsx("td",{className:"py-3 text-center",children:n.jsx("span",{className:"px-2 py-0.5 rounded-lg text-[8px] font-black uppercase border bg-slate-50 text-slate-500",children:fe.basisDesc})}),n.jsxs("td",{className:"py-3 text-[11px] font-black text-right text-slate-400",children:["$",$r(fe.global)]}),n.jsxs("td",{className:"py-3 text-xs font-black text-blue-900 text-right px-4",children:["$",$r(fe.myPortion)]})]},Ue))})]})})]},ye))}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("h3",{className:"text-sm font-black text-slate-900 uppercase tracking-tighter mb-4 flex items-center gap-3",children:[n.jsx("div",{className:"w-1.5 h-4 bg-amber-600 rounded-full"})," Resumen de Cuenta"]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-slate-100",children:[n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-slate-400 tracking-widest",children:"Periodo"}),n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-slate-400 text-right",children:"Monto ($)"}),n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-slate-400 text-right",children:"Pagado ($)"}),n.jsx("th",{className:"py-3 text-[9px] font-black uppercase text-blue-600 text-right px-4",children:"Pendiente ($)"})]})}),n.jsxs("tbody",{className:"divide-y divide-slate-50",children:[t.filter(he=>he.year===f||he.year===f-1).sort((he,ye)=>ye.year*12+ye.month-(he.year*12+he.month)).slice(0,12).map((he,ye)=>{const fe=he.debts.find(qe=>qe.propertyId===q.id);if(!fe)return null;const Ue=Number(fe.amountUsd)-Number(fe.paidAmount);return Ue<=0?null:n.jsxs("tr",{children:[n.jsxs("td",{className:"py-3 text-[11px] font-bold text-slate-600 uppercase",children:[Te[he.month]," ",he.year]}),n.jsxs("td",{className:"py-3 text-[11px] font-black text-right text-slate-400",children:["$",$r(fe.amountUsd)]}),n.jsxs("td",{className:"py-3 text-[11px] font-black text-right text-emerald-500",children:["$",$r(fe.paidAmount)]}),n.jsxs("td",{className:"py-3 text-xs font-black text-blue-900 text-right px-4",children:["$",$r(Ue)]})]},ye)}),z&&z.current_debt>0&&n.jsxs("tr",{className:"bg-amber-50/50",children:[n.jsx("td",{className:"py-3 text-[11px] font-black text-amber-600 uppercase px-2",children:"CONVENIO DE PAGO"}),n.jsx("td",{className:"py-3 text-[11px] font-black text-right text-slate-400",children:"-"}),n.jsx("td",{className:"py-3 text-[11px] font-black text-right text-emerald-500",children:"-"}),n.jsxs("td",{className:"py-3 text-xs font-black text-amber-700 text-right px-4",children:["$",$r(z.current_debt)]})]})]})]})})]}),n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[2.5rem] border border-slate-100 space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[n.jsxs("div",{className:"p-4 bg-white rounded-2xl border border-slate-100 text-center",children:[n.jsx("span",{className:"block text-[8px] font-black text-slate-400 uppercase mb-1",children:"Subtotal Mes"}),n.jsxs("span",{className:"text-sm font-black text-slate-800",children:["$",$r(pe.totalIndividualSubtotal)]})]}),n.jsxs("div",{className:"p-4 bg-white rounded-2xl border border-slate-100 text-center",children:[n.jsxs("span",{className:"block text-[8px] font-black text-blue-400 uppercase mb-1",children:["Reserva (",pe.reserveFundPct,"%)"]}),n.jsxs("span",{className:"text-sm font-black text-blue-600",children:["$",$r(pe.individualReserve)]})]}),n.jsxs("div",{className:"p-4 bg-white rounded-2xl border border-slate-100 text-center",children:[n.jsx("span",{className:"block text-[8px] font-black text-amber-400 uppercase mb-1",children:"Convenio"}),n.jsxs("span",{className:"text-sm font-black text-amber-600",children:["$",$r(pe.agreementPending)]})]}),n.jsxs("div",{className:"p-4 bg-slate-900 rounded-2xl text-center",children:[n.jsx("span",{className:"block text-[8px] font-black text-blue-300 uppercase mb-1",children:"Total a Pagar"}),n.jsxs("span",{className:"text-sm font-black text-white",children:["$",$r(pe.finalTotal)]})]})]}),n.jsxs("div",{className:"flex justify-between items-center bg-blue-600 p-6 rounded-3xl text-white shadow-lg",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black uppercase text-blue-200 tracking-widest mb-1",children:"Equivalente en Bolívares"}),n.jsxs("p",{className:"text-3xl font-black tracking-tighter",children:["Bs. ",mM(pe.finalTotal*o)]})]}),n.jsx(Ki,{size:40,className:"opacity-40"})]})]}),n.jsxs("div",{className:"pt-8 border-t border-slate-100 space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 text-left",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(br,{size:14})," Datos para el Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsxs("p",{className:"text-[11px] font-bold text-slate-700 uppercase",children:[ee.payment_bank_name||"BanPlus"," ",ee.payment_account_type||"Cta Cte"]}),n.jsxs("p",{className:"text-[11px] font-black text-blue-900 tracking-wider",children:["# ",ee.payment_account_number||"0174-0124-6812-4414-5759"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase",children:["RIF: ",ee.payment_rif||"J-313266507"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase",children:["Pago Móvil: ",ee.payment_mobile_phone||"0424-4910040"]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(Br,{size:14})," Reportar Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Enviar comprobante a:"}),(ee.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map((he,ye)=>n.jsx("p",{className:"text-[11px] font-bold text-slate-700",children:he.trim()},ye)),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase mt-1",children:["WhatsApp: ",ee.payment_whatsapp||"0412-8213310"]}),n.jsx("p",{className:"text-[9px] font-black text-amber-600 uppercase italic mt-2",children:"Indicar #casa y nombre para identificar"})]})]})]}),n.jsx("div",{className:"pt-8 border-t border-slate-100 text-center",children:n.jsx("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.5em]",children:"SAC 2026 • Kernel V4.1.85 MC/MB • Generado Digitalmente"})})]})]})]})]}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Cuota Individual ",n.jsx("span",{className:"text-blue-600",children:"HTML Pro"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Envío de avisos de cobro y estados de cuenta en formato HTML/Imagen."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:d,onChange:he=>u(Number(he.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Te.map((he,ye)=>n.jsx("option",{value:ye,children:he},ye))}),n.jsx("input",{type:"number",value:f,onChange:he=>p(Number(he.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12 space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-50 text-blue-600 rounded-2xl flex items-center justify-center mx-auto shadow-inner",children:n.jsx(QA,{size:32})}),n.jsx("h2",{className:"text-xl font-black text-slate-900 tracking-tight uppercase",children:"Envío Individual"}),n.jsx("p",{className:"text-slate-400 text-xs font-medium",children:"Seleccione una propiedad específica para procesar."})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(ea,{size:14})," Unidad Inmobiliaria"]}),n.jsxs("select",{value:y||"",onChange:he=>j(Number(he.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),O.map(he=>n.jsxs("option",{value:he.id,children:[he.code," - ",he.type," ",he.number]},he.id))]})]}),n.jsx("button",{disabled:!y||!M,onClick:()=>m("report"),className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-5 rounded-2xl font-black text-[10px] uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:M?n.jsxs(n.Fragment,{children:["PROCESAR INDIVIDUAL ",n.jsx(Hs,{size:16})]}):n.jsx(n.Fragment,{children:"CUOTA NO GENERADA"})})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12 space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-16 h-16 bg-indigo-50 text-indigo-600 rounded-2xl flex items-center justify-center mx-auto shadow-inner",children:n.jsx(_M,{size:32})}),n.jsx("h2",{className:"text-xl font-black text-slate-900 tracking-tight uppercase",children:"Envío por Lote (Rango)"}),n.jsx("p",{className:"text-slate-400 text-xs font-medium",children:"Procese múltiples unidades en secuencia."})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Desde"}),n.jsxs("select",{value:_||"",onChange:he=>N(Number(he.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl p-4 text-xs font-black text-slate-700 outline-none",children:[n.jsx("option",{value:"",children:"Inicio..."}),O.map(he=>n.jsx("option",{value:he.id,children:he.code},he.id))]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Hasta"}),n.jsxs("select",{value:E||"",onChange:he=>T(Number(he.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl p-4 text-xs font-black text-slate-700 outline-none",children:[n.jsx("option",{value:"",children:"Fin..."}),O.map(he=>n.jsx("option",{value:he.id,children:he.code},he.id))]})]})]}),n.jsx("button",{disabled:!_||!E||!M,onClick:Z,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white py-5 rounded-2xl font-black text-[10px] uppercase tracking-[0.2em] shadow-xl shadow-indigo-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:M?n.jsxs(n.Fragment,{children:["INICIAR PROCESO POR LOTE ",n.jsx(Hs,{size:16})]}):n.jsx(n.Fragment,{children:"CUOTA NO GENERADA"})})]})]}),!M&&n.jsxs("div",{className:"bg-amber-50 border border-amber-100 p-6 rounded-[2rem] flex items-center gap-4 text-amber-700 max-w-2xl mx-auto",children:[n.jsx(Sr,{size:24,className:"shrink-0"}),n.jsx("p",{className:"text-xs font-bold leading-relaxed uppercase tracking-tight",children:'Debe generar primero la relación de gastos global para este periodo en el módulo de "Generar Cuotas".'})]})]})},Vr=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},gM=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},OIe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,financialTotals:i,markReceiptSent:l,latestRate:o}=ht(),[d,u]=k.useState(new Date().getMonth()),[f,p]=k.useState(new Date().getFullYear()),[h,m]=k.useState("selection"),[b,v]=k.useState("fee"),[y,j]=k.useState(null),[_,N]=k.useState(null),[E,T]=k.useState(null),[B,F]=k.useState([]),[R,U]=k.useState(0),[D,L]=k.useState(null),[P,G]=k.useState(!1),[Q,H]=k.useState([]),[X,K]=k.useState(!1),[ee,W]=k.useState({}),[Y,M]=k.useState(16),O=k.useRef(null);k.useEffect(()=>{(async()=>{K(!0);try{const[Ue,qe]=await Promise.all([we.getInitialDebtData(),we.getSystemSettings()]);Array.isArray(Ue)?H(Ue):Ue&&Ue.success&&H(Ue.data||[]),W(qe||{})}catch(Ue){console.error("Error fetching data",Ue)}finally{K(!1)}})()},[]);const q=k.useMemo(()=>t.find(fe=>fe.month===d&&fe.year===f),[t,d,f]),z=k.useMemo(()=>[...r].sort((fe,Ue)=>fe.code.localeCompare(Ue.code,void 0,{numeric:!0})),[r]),J=k.useMemo(()=>h==="report"?r.find(fe=>fe.id===y):h==="bulk"?B[R]:null,[h,r,y,B,R]),re=k.useMemo(()=>Q.find(fe=>fe.id===(J==null?void 0:J.id)),[Q,J]),le=k.useMemo(()=>{if(!J)return null;const fe=a.find(qe=>qe.propertyId===J.id&&qe.isOwner),Ue=s.find(qe=>qe.cedula===(fe==null?void 0:fe.cedula));return{fullName:(fe==null?void 0:fe.fullName)||"Propietario",email:(Ue==null?void 0:Ue.email)||"",phone:(fe==null?void 0:fe.phone)||(Ue==null?void 0:Ue.phone)||"",telegramId:(Ue==null?void 0:Ue.telegramChatId)||"",propertyCode:J.code,propertyId:J.id}},[J,a,s]),ne=fe=>{if(!fe)return"";let Ue=fe.trim();return Ue.startsWith("+")?Ue.replace(/\D/g,""):Ue.startsWith("0")?"58"+Ue.substring(1).replace(/\D/g,""):Ue.length===10?"58"+Ue.replace(/\D/g,""):Ue.replace(/\D/g,"")},ae=async()=>{if(O.current){G(!0);try{const Ue=(await rs(O.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"})).toDataURL("image/png"),qe=document.createElement("a");qe.href=Ue,qe.download=`Aviso_Grande_${J==null?void 0:J.code}_${Te[d]}.png`,qe.click()}catch(fe){console.error("Capture failed",fe),alert("Error al capturar imagen.")}finally{G(!1)}}},ie=async()=>{if(O.current){G(!0);try{const fe=await rs(O.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"}),Ue=await new Promise(nt=>fe.toBlob(nt,"image/png"));if(!Ue)throw new Error("Blob creation failed");const qe=`Aviso_Grande_${J==null?void 0:J.code}_${Te[d]}.png`,at=new File([Ue],qe,{type:"image/png"});if(navigator.share&&navigator.canShare&&navigator.canShare({files:[at]}))await navigator.share({files:[at],title:`Aviso de Cobro - ${J==null?void 0:J.code}`,text:`Aviso de Cobro de ${Te[d]} ${f} para la unidad ${J==null?void 0:J.code}`});else{const nt=fe.toDataURL("image/png"),Ct=document.createElement("a");Ct.href=nt,Ct.download=qe,Ct.click(),alert("La función de compartir archivos no es compatible con este navegador. La imagen se ha descargado.")}}catch(fe){console.error("Share failed",fe),alert("Error al compartir imagen.")}finally{G(!1)}}},me=async fe=>{if(!le||!J||!q)return;const Ue=q.debts.find(kt=>kt.propertyId===J.id),qe=Ue?Number(Ue.amountUsd)-Number(Ue.paidAmount):0,at=(re==null?void 0:re.current_debt)||0,nt=qe+at,Ct=`🏢 *AVISO DE COBRO - SAC 2026*

Estimado(a) *${le.fullName}*,
Unidad: *${J.type} ${J.number}* (${J.code})

📅 *Periodo:* ${Te[d]} ${f}
------------------------------------------
💵 *Cuota del Mes:* $${Vr(qe)}
🤝 *Convenio de Pago:* $${Vr(at)}
------------------------------------------
🔥 *TOTAL PENDIENTE:* $${Vr(nt)}

Por favor, gestione su pago en nuestro portal digital:
🔗 *ACCEDER AL PORTAL:* ${Rr}

¡Gracias!`;{const kt=ne(le.phone);if(!kt)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${kt}?text=${encodeURIComponent(Ct)}`,"_blank"),h==="bulk"&&await l(q.id,J.id,"whatsapp");return}},Z=()=>{if(!J||!le||!q||!ye)return;const fe=b==="statement",Ue=()=>fe?`
                    <div class="section-title">Resumen de Cuenta</div>
                    <table>
                        <thead>
                            <tr>
                                <th style="width: 40%; text-align: left; font-size: ${Y*.6}px;">Periodo</th>
                                <th style="text-align: right; font-size: ${Y*.6}px;">Monto ($)</th>
                                <th style="text-align: right; font-size: ${Y*.6}px;">Pagado ($)</th>
                                <th style="text-align: right; background: #f8fafc; font-size: ${Y*.6}px;">Pendiente ($)</th>
                            </tr>
                        </thead>
                        <tbody>
                            ${t.filter(kt=>kt.year===f||kt.year===f-1).sort((kt,ft)=>ft.year*12+ft.month-(kt.year*12+kt.month)).slice(0,12).map(kt=>{const ft=kt.debts.find(Ar=>Ar.propertyId===J.id);if(!ft)return"";const _r=Number(ft.amountUsd)-Number(ft.paidAmount);return _r<=0?"":`
                                        <tr>
                                            <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${Y*.7}px; text-transform: uppercase; font-weight: 700;">${Te[kt.month]} ${kt.year}</td>
                                            <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${Y*.7}px; text-align: right; color: #64748b;">$ ${Vr(ft.amountUsd)}</td>
                                            <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${Y*.7}px; text-align: right; color: #10b981;">$ ${Vr(ft.paidAmount)}</td>
                                            <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${Y*.8}px; text-align: right; font-weight: 700; background: #f8fafc; color: #1e3a8a;">$ ${Vr(_r)}</td>
                                        </tr>
                                    `}).join("")}
                            ${re&&re.current_debt>0?`
                                <tr style="background-color: #fef3c7;">
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${Y*.7}px; font-weight: 700; color: #b45309; text-transform: uppercase;">CONVENIO DE PAGO</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${Y*.7}px; text-align: right; color: #64748b;">-</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${Y*.7}px; text-align: right; color: #10b981;">-</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${Y*.8}px; text-align: right; font-weight: 800; color: #b45309; background: #fffbeb;">$ ${Vr(re.current_debt)}</td>
                                </tr>
                            `:""}
                        </tbody>
                    </table>
                `:ye.sections.map(kt=>kt.items.length>0?`
                    <div class="section-title">${kt.title}</div>
                    <table>
                        <thead>
                            <tr>
                                <th style="width: 50%; text-align: left; font-size: ${Y*.6}px;">Concepto</th>
                                <th style="text-align: center; font-size: ${Y*.6}px;">Base</th>
                                <th style="text-align: right; font-size: ${Y*.6}px;">Global ($)</th>
                                <th style="text-align: right; background: #f8fafc; font-size: ${Y*.6}px;">Su Cuota ($)</th>
                            </tr>
                        </thead>
                        <tbody>
                            ${kt.items.map(ft=>`
                                <tr>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${Y*.7}px; text-transform: uppercase;">${ft.description}</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${Y*.5}px; text-align: center; color: #64748b;">${ft.basisDesc}</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${Y*.7}px; text-align: right; color: #64748b;">$ ${Vr(ft.global)}</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${Y*.8}px; text-align: right; font-weight: 700; background: #f8fafc; color: #1e3a8a;">$ ${Vr(ft.myPortion)}</td>
                                </tr>
                            `).join("")}
                        </tbody>
                    </table>
                `:"").join(""),qe=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>${fe?"Estado de Cuenta":"Aviso de Cobro"} - ${J.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 20px; color: #1e293b; background-color: #f8fafc; font-size: ${Y}px; }
        .container { max-width: 900px; margin: 0 auto; background: white; padding: 40px; border-radius: 20px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); border: 1px solid #e2e8f0; }
        .header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; border-bottom: 2px solid #f1f5f9; padding-bottom: 20px; }
        .logo-area { text-align: left; }
        .logo-title { font-size: ${Y*1.5}px; font-weight: 900; color: #0f172a; letter-spacing: -1px; }
        .logo-subtitle { font-size: ${Y*.6}px; font-weight: 900; color: #2563eb; text-transform: uppercase; letter-spacing: 2px; }
        .property-info { text-align: right; }
        .prop-label { font-size: ${Y*.5}px; font-weight: 900; color: #64748b; text-transform: uppercase; }
        .prop-value { font-size: ${Y*.8}px; font-weight: 700; color: #1e293b; }
        .section-title { font-size: ${Y*.8}px; font-weight: 900; text-transform: uppercase; color: #0f172a; background: #f1f5f9; padding: 8px 15px; border-radius: 8px; margin: 20px 0 10px 0; display: flex; align-items: center; gap: 10px; }
        .section-title::before { content: ""; display: block; width: 4px; height: 12px; background: #2563eb; border-radius: 2px; }
        table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
        th { font-size: ${Y*.5}px; font-weight: 900; color: #64748b; text-transform: uppercase; text-align: left; padding: 8px; border-bottom: 2px solid #f1f5f9; }
        .summary-box { background: #0f172a; color: white; padding: 30px; border-radius: 20px; margin-top: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
        .total-label { font-size: ${Y*.6}px; font-weight: 900; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
        .total-value { font-size: ${Y*1.8}px; font-weight: 900; color: #60a5fa; letter-spacing: -1px; }
        .ves-value { font-size: ${Y}px; font-weight: 700; color: #cbd5e1; }
        .payment-info { margin-top: 30px; display: flex; justify-content: space-between; border-top: 1px solid #f1f5f9; padding-top: 20px; }
        .payment-column { font-size: ${Y*.7}px; line-height: 1.5; }
        .payment-title { font-size: ${Y*.6}px; font-weight: 900; color: #2563eb; text-transform: uppercase; margin-bottom: 8px; }
        .footer { text-align: center; font-size: ${Y*.5}px; color: #94a3b8; margin-top: 40px; border-top: 1px solid #f1f5f9; padding-top: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
        @media print {
            body { background: white; padding: 0; }
            .container { box-shadow: none; border: none; padding: 0; }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="logo-area">
                <div class="logo-title">SAC <span style="color: #2563eb;">2026</span></div>
                <div class="logo-subtitle">${va}</div>
                <div style="font-size: ${Y*.8}px; font-weight: 700; color: #64748b; margin-top: 5px;">${fe?"ESTADO DE CUENTA INDIVIDUAL (GRANDE)":"AVISO DE COBRO INDIVIDUAL (GRANDE)"}</div>
            </div>
            <div class="property-info">
                <div style="margin-bottom: 10px;">
                    <div class="prop-label">Propietario</div>
                    <div class="prop-value">${(le==null?void 0:le.fullName)||"Propietario"}</div>
                </div>
                <div>
                    <div class="prop-label">Unidad / Alícuota</div>
                    <div class="prop-value">${J.code} (${J.type} ${J.number}) / ${(Number(J.aliquot)||0).toFixed(4)}%</div>
                </div>
            </div>
        </div>

        <div style="display: flex; justify-content: space-between; margin-bottom: 20px; font-size: ${Y*.7}px; font-weight: 700; color: #64748b;">
            <div>PERIODO: ${Te[d].toUpperCase()} ${f}</div>
            <div>TASA: Bs. ${o.toFixed(2)}</div>
        </div>

        ${Ue()}

        <div class="summary-box">
            <div>
                <div style="margin-bottom: 15px;">
                    <div class="total-label">Subtotal Mes</div>
                    <div style="font-size: ${Y}px; font-weight: 700;">$ ${Vr(ye.totalIndividualSubtotal)}</div>
                </div>
                <div style="display: flex; gap: 20px;">
                    <div>
                        <div class="total-label">Reserva (${ye.reserveFundPct}%)</div>
                        <div style="font-size: ${Y*.8}px; font-weight: 700;">$ ${Vr(ye.individualReserve)}</div>
                    </div>
                    <div>
                        <div class="total-label">Convenio</div>
                        <div style="font-size: ${Y*.8}px; font-weight: 700;">$ ${Vr(ye.agreementPending)}</div>
                    </div>
                </div>
            </div>
            <div style="text-align: right; border-left: 1px solid rgba(255,255,255,0.1); padding-left: 20px;">
                <div class="total-label">Total Grande Pendiente</div>
                <div class="total-value">$ ${Vr(ye.finalTotal)}</div>
                <div class="ves-value">Bs. ${gM(ye.finalTotal*o)}</div>
            </div>
        </div>

        <div class="payment-info">
            <div class="payment-column">
                <div class="payment-title">Datos para el Pago</div>
                <div style="font-weight: 700;">${ee.payment_bank_name||"BanPlus"} ${ee.payment_account_type||"Cta Cte"}</div>
                <div style="font-weight: 900; color: #2563eb;"># ${ee.payment_account_number||"0174-0124-6812-4414-5759"}</div>
                <div>RIF: ${ee.payment_rif||"J-313266507"}</div>
                <div>Pago Móvil: ${ee.payment_mobile_phone||"0424-4910040"}</div>
            </div>
            <div class="payment-column" style="text-align: right;">
                <div class="payment-title">Reportar Pago</div>
                <div>Enviar comprobante a:</div>
                <div style="font-weight: 700;">${ee.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com"}</div>
                <div style="font-weight: 700;">WhatsApp: ${ee.payment_whatsapp||"0412-8213310"}</div>
                <div style="font-size: ${Y*.5}px; color: #f59e0b; font-weight: 900; margin-top: 5px;">INDICAR #CASA Y NOMBRE PARA IDENTIFICAR</div>
            </div>
        </div>

        <div style="margin-top: 30px; font-size: ${Y*.7}px; color: #64748b; line-height: 1.6; font-style: italic; text-align: center;">
            Este documento es un estado oficial grande de sus compromisos para con la comunidad. 
            El pago oportuno garantiza la continuidad de los servicios y la valorización de nuestro patrimonio.
        </div>

        <div class="footer">
            SISTEMA ADMINISTRATIVO PARA CONDOMINIOS SAC 2026 • Kernel V4.2.08 MC/MB • ${J.code} • GENERADO EL ${new Date().toLocaleString()}
        </div>
    </div>
</body>
</html>`,at=new Blob([qe],{type:"text/html"}),nt=URL.createObjectURL(at),Ct=document.createElement("a");Ct.href=nt,Ct.download=`${fe?"Estado":"Cuota"}_Grande_${J.code}_${Te[d]}.html`,Ct.click(),URL.revokeObjectURL(nt)},Me=()=>{if(Z(),le&&J&&ye){const fe=ne(le.phone);if(fe){const Ue=b==="statement",qe=`🏢 *AVISO DE COBRO - SAC 2026*

Estimado(a) *${le.fullName}*,

Le adjuntamos su ${Ue?"estado de cuenta":"aviso de cobro"} en formato HTML para la unidad *${J.code}* correspondiente al periodo *${Te[d]} ${f}*.

💵 *Total a Pagar/Pendiente:* $${Vr(ye.finalTotal)} USD

Por favor, descargue y abra el archivo HTML adjunto para ver la relación detallada.

🔗 *ACCEDER AL PORTAL:* ${Rr}

¡Muchas gracias!`;window.open(`https://wa.me/${fe}?text=${encodeURIComponent(qe)}`,"_blank"),h==="bulk"&&l(q.id,J.id,"whatsapp")}else alert("El usuario no tiene un teléfono registrado para WhatsApp.")}},pe=()=>{if(!_||!E)return;const fe=z.findIndex(at=>at.id===_),Ue=z.findIndex(at=>at.id===E);if(fe===-1||Ue===-1||fe>Ue)return alert("Rango inválido.");const qe=z.slice(fe,Ue+1);F(qe),U(0),m("bulk")},he=fe=>{if(!q)return null;const Ue=Number(fe.aliquot)||0,qe=!!fe.hasUncommonExpense,at=r.filter(Et=>Et.hasUncommonExpense).length,nt=Et=>{var Cr,cn;const jt=Number(Et.amountUsd)||0;let Kt=0,fr="";if(Et.isSpecial){const $n=((Cr=Et.specialPropertyIds)==null?void 0:Cr.length)||1,Cs=(cn=Et.specialPropertyIds)==null?void 0:cn.includes(fe.id);Kt=Cs?jt/$n:0,fr=Cs?`ESP (1/${$n})`:"Exento"}else Et.isUncommon?(Kt=qe&&at>0?jt/at:0,fr=qe&&at>0?`GNC (1/${at})`:"Exento"):(Kt=jt*(Ue/100),fr=`ALIQ (${Ue.toFixed(4)}%)`);return{...Et,global:jt,myPortion:Kt,basisDesc:fr}},Ct=[{title:"Gastos Fijos",items:q.fixedExpenses.map(nt)},{title:"Gastos Variables",items:q.variableExpenses.map(nt)},{title:"Otros Gastos",items:q.otherExpenses.map(nt)}],kt=Ct.reduce((Et,jt)=>Et+jt.items.reduce((Kt,fr)=>Kt+fr.myPortion,0),0),ft=Number(q.reserveFundPercent)||10,_r=kt*(ft/100),Ar=kt+_r,pa=q.debts.find(Et=>Et.propertyId===fe.id),Ut=pa?Number(pa.amountUsd)-Number(pa.paidAmount):Ar,Tr=Q.find(Et=>Et.id===fe.id),it=(Tr==null?void 0:Tr.current_debt)||0,Rt=Ut+it;return{sections:Ct,totalIndividualSubtotal:kt,individualReserve:_r,totalOwnerUsd:Ar,amountToPay:Ut,agreementPending:it,finalTotal:Rt,reserveFundPct:ft}},ye=k.useMemo(()=>J?he(J):null,[J,q,Q]);return h!=="selection"&&J&&ye?n.jsxs("div",{className:"max-w-5xl mx-auto space-y-8 animate-in fade-in duration-500 pb-24 px-1",children:[n.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-4 no-print",children:[n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:()=>m("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(gs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex bg-slate-100 p-1 rounded-2xl border border-slate-200",children:[n.jsx("button",{onClick:()=>v("fee"),className:`px-4 py-2 rounded-xl text-[9px] font-black uppercase tracking-widest transition-all ${b==="fee"?"bg-white text-blue-600 shadow-sm":"text-slate-400 hover:text-slate-600"}`,children:"Aviso"}),n.jsx("button",{onClick:()=>v("statement"),className:`px-4 py-2 rounded-xl text-[9px] font-black uppercase tracking-widest transition-all ${b==="statement"?"bg-white text-blue-600 shadow-sm":"text-slate-400 hover:text-slate-600"}`,children:"Estado"})]})]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsxs("div",{className:"flex items-center gap-2 bg-white px-4 py-2 rounded-2xl border border-slate-200 shadow-sm",children:[n.jsx(tq,{size:16,className:"text-slate-400"}),n.jsx("button",{onClick:()=>M(fe=>Math.max(12,fe-2)),className:"p-1 text-slate-500 hover:text-blue-600 font-black",children:"-"}),n.jsxs("span",{className:"text-[10px] font-black w-8 text-center",children:[Y,"px"]}),n.jsx("button",{onClick:()=>M(fe=>Math.min(32,fe+2)),className:"p-1 text-slate-500 hover:text-blue-600 font-black",children:"+"})]}),h==="bulk"&&n.jsxs("div",{className:"flex items-center gap-2 bg-slate-100 px-4 py-2 rounded-xl border border-slate-200",children:[n.jsxs("span",{className:"text-[10px] font-black text-slate-500 uppercase tracking-widest",children:["Lote: ",R+1," / ",B.length]}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx("button",{disabled:R===0,onClick:()=>U(fe=>fe-1),className:"p-1 text-slate-400 hover:text-blue-600 disabled:opacity-30",children:n.jsx(gs,{size:16})}),n.jsx("button",{disabled:R===B.length-1,onClick:()=>U(fe=>fe+1),className:"p-1 text-slate-400 hover:text-blue-600 disabled:opacity-30",children:n.jsx(_c,{size:16})})]})]}),n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Imprimir",children:n.jsx(wt,{size:20})}),n.jsx("button",{onClick:ae,disabled:P,className:"p-3 bg-indigo-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Capturar como Imagen",children:P?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Dp,{size:20})}),n.jsx("button",{onClick:ie,disabled:P,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir Imagen Directamente",children:P?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Aa,{size:20})}),n.jsx("button",{onClick:()=>me(),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Enviar WhatsApp (Texto)",children:n.jsx(Ha,{size:20})}),n.jsx("button",{onClick:Z,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Exportar HTML",children:n.jsx(wr,{size:20})}),n.jsxs("button",{onClick:Me,className:"p-3 bg-emerald-600 text-white rounded-xl shadow-lg active:scale-95 transition-all flex items-center gap-1",title:"Exportar HTML y Enviar por WhatsApp",children:[n.jsx(wr,{size:20}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-wider",children:"HTML/WA"})]})]})]}),n.jsxs("div",{ref:O,className:"bg-white rounded-[3rem] shadow-2xl border border-slate-200 overflow-hidden print:shadow-none print:border-slate-300",style:{fontSize:`${Y}px`},children:[n.jsxs("div",{className:"p-10 bg-slate-900 text-white text-center relative",children:[n.jsx("h2",{className:"text-2xl font-black uppercase tracking-[0.2em] mb-2",style:{fontSize:`${Y*1.5}px`},children:b==="fee"?"Aviso de Cobro Individual":"Estado de Cuenta Individual"}),n.jsxs("p",{className:"text-blue-400 font-black uppercase tracking-widest text-[10px] mb-6",style:{fontSize:`${Y*.7}px`},children:[Te[d]," ",f]}),n.jsxs("div",{className:"flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8",children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",style:{fontSize:`${Y*.5}px`},children:"Inmueble"}),n.jsxs("p",{className:"font-black text-blue-300",style:{fontSize:`${Y*1.2}px`},children:[J.type," ",J.number]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",style:{fontSize:`${Y*.5}px`},children:"Alícuota"}),n.jsxs("p",{className:"font-black text-emerald-400",style:{fontSize:`${Y*1.2}px`},children:[(Number(J.aliquot)||0).toFixed(4),"%"]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",style:{fontSize:`${Y*.5}px`},children:"Tasa del Día"}),n.jsxs("p",{className:"font-black text-amber-400",style:{fontSize:`${Y*1.2}px`},children:[o.toFixed(2)," Bs/$"]})]})]})]}),n.jsxs("div",{className:"p-10 space-y-10",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-8 border-b border-slate-100 pb-8",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",style:{fontSize:`${Y*.6}px`},children:"Propietario"}),n.jsx("p",{className:"font-black text-slate-900 uppercase",style:{fontSize:`${Y*1.2}px`},children:le==null?void 0:le.fullName})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",style:{fontSize:`${Y*.6}px`},children:"Unidad"}),n.jsx("p",{className:"font-black text-blue-600 uppercase",style:{fontSize:`${Y*1.2}px`},children:J.code})]})]}),b==="fee"?n.jsx(n.Fragment,{children:ye.sections.map((fe,Ue)=>fe.items.length===0?null:n.jsxs("div",{children:[n.jsxs("h3",{className:"font-black text-slate-900 uppercase tracking-tighter mb-4 flex items-center gap-3",style:{fontSize:`${Y*.9}px`},children:[n.jsx("div",{className:"w-1.5 h-4 bg-blue-600 rounded-full"})," ",fe.title]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-slate-100",children:[n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 tracking-widest",style:{fontSize:`${Y*.6}px`},children:"Concepto"}),n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 text-center",style:{fontSize:`${Y*.6}px`},children:"Base"}),n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 text-right",style:{fontSize:`${Y*.6}px`},children:"Gasto Global ($)"}),n.jsx("th",{className:"py-3 font-black uppercase text-blue-600 text-right px-4",style:{fontSize:`${Y*.6}px`},children:"Su Cuota ($)"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-50",children:fe.items.map((qe,at)=>n.jsxs("tr",{children:[n.jsx("td",{className:"py-3 font-bold text-slate-600 uppercase",style:{fontSize:`${Y*.7}px`},children:qe.description}),n.jsx("td",{className:"py-3 text-center",children:n.jsx("span",{className:"px-2 py-0.5 rounded-lg font-black uppercase border bg-slate-50 text-slate-500",style:{fontSize:`${Y*.5}px`},children:qe.basisDesc})}),n.jsxs("td",{className:"py-3 font-black text-right text-slate-400",style:{fontSize:`${Y*.7}px`},children:["$",Vr(qe.global)]}),n.jsxs("td",{className:"py-3 font-black text-blue-900 text-right px-4",style:{fontSize:`${Y*.8}px`},children:["$",Vr(qe.myPortion)]})]},at))})]})})]},Ue))}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("h3",{className:"font-black text-slate-900 uppercase tracking-tighter mb-4 flex items-center gap-3",style:{fontSize:`${Y*.9}px`},children:[n.jsx("div",{className:"w-1.5 h-4 bg-amber-600 rounded-full"})," Resumen de Cuenta"]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"border-b border-slate-100",children:[n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 tracking-widest",style:{fontSize:`${Y*.6}px`},children:"Periodo"}),n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 text-right",style:{fontSize:`${Y*.6}px`},children:"Monto ($)"}),n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 text-right",style:{fontSize:`${Y*.6}px`},children:"Pagado ($)"}),n.jsx("th",{className:"py-3 font-black uppercase text-blue-600 text-right px-4",style:{fontSize:`${Y*.6}px`},children:"Pendiente ($)"})]})}),n.jsxs("tbody",{className:"divide-y divide-slate-50",children:[t.filter(fe=>fe.year===f||fe.year===f-1).sort((fe,Ue)=>Ue.year*12+Ue.month-(fe.year*12+fe.month)).slice(0,12).map((fe,Ue)=>{const qe=fe.debts.find(nt=>nt.propertyId===J.id);if(!qe)return null;const at=Number(qe.amountUsd)-Number(qe.paidAmount);return at<=0?null:n.jsxs("tr",{children:[n.jsxs("td",{className:"py-3 font-bold text-slate-600 uppercase",style:{fontSize:`${Y*.7}px`},children:[Te[fe.month]," ",fe.year]}),n.jsxs("td",{className:"py-3 font-black text-right text-slate-400",style:{fontSize:`${Y*.7}px`},children:["$",Vr(qe.amountUsd)]}),n.jsxs("td",{className:"py-3 font-black text-right text-emerald-500",style:{fontSize:`${Y*.7}px`},children:["$",Vr(qe.paidAmount)]}),n.jsxs("td",{className:"py-3 font-black text-blue-900 text-right px-4",style:{fontSize:`${Y*.8}px`},children:["$",Vr(at)]})]},Ue)}),re&&re.current_debt>0&&n.jsxs("tr",{className:"bg-amber-50/50",children:[n.jsx("td",{className:"py-3 font-black text-amber-600 uppercase px-2",style:{fontSize:`${Y*.7}px`},children:"CONVENIO DE PAGO"}),n.jsx("td",{className:"py-3 font-black text-right text-slate-400",style:{fontSize:`${Y*.7}px`},children:"-"}),n.jsx("td",{className:"py-3 font-black text-right text-emerald-500",style:{fontSize:`${Y*.7}px`},children:"-"}),n.jsxs("td",{className:"py-3 font-black text-amber-700 text-right px-4",style:{fontSize:`${Y*.8}px`},children:["$",Vr(re.current_debt)]})]})]})]})})]}),n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[2.5rem] border border-slate-100 space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[n.jsxs("div",{className:"p-4 bg-white rounded-2xl border border-slate-100 text-center",children:[n.jsx("span",{className:"block font-black text-slate-400 uppercase mb-1",style:{fontSize:`${Y*.5}px`},children:"Subtotal Mes"}),n.jsxs("span",{className:"font-black text-slate-800",style:{fontSize:`${Y*.9}px`},children:["$",Vr(ye.totalIndividualSubtotal)]})]}),n.jsxs("div",{className:"p-4 bg-white rounded-2xl border border-slate-100 text-center",children:[n.jsxs("span",{className:"block font-black text-blue-400 uppercase mb-1",style:{fontSize:`${Y*.5}px`},children:["Reserva (",ye.reserveFundPct,"%)"]}),n.jsxs("span",{className:"font-black text-blue-600",style:{fontSize:`${Y*.9}px`},children:["$",Vr(ye.individualReserve)]})]}),n.jsxs("div",{className:"p-4 bg-white rounded-2xl border border-slate-100 text-center",children:[n.jsx("span",{className:"block font-black text-amber-400 uppercase mb-1",style:{fontSize:`${Y*.5}px`},children:"Convenio"}),n.jsxs("span",{className:"font-black text-amber-600",style:{fontSize:`${Y*.9}px`},children:["$",Vr(ye.agreementPending)]})]}),n.jsxs("div",{className:"p-4 bg-slate-900 rounded-2xl text-center",children:[n.jsx("span",{className:"block font-black text-blue-300 uppercase mb-1",style:{fontSize:`${Y*.5}px`},children:"Total a Pagar"}),n.jsxs("span",{className:"font-black text-white",style:{fontSize:`${Y*.9}px`},children:["$",Vr(ye.finalTotal)]})]})]}),n.jsxs("div",{className:"flex justify-between items-center bg-blue-600 p-6 rounded-3xl text-white shadow-lg",children:[n.jsxs("div",{children:[n.jsx("p",{className:"font-black uppercase text-blue-200 tracking-widest mb-1",style:{fontSize:`${Y*.6}px`},children:"Equivalente en Bolívares"}),n.jsxs("p",{className:"font-black tracking-tighter",style:{fontSize:`${Y*1.8}px`},children:["Bs. ",gM(ye.finalTotal*o)]})]}),n.jsx(Ki,{size:40,className:"opacity-40"})]})]}),n.jsxs("div",{className:"pt-8 border-t border-slate-100 space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 text-left",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"font-black text-blue-600 uppercase tracking-widest flex items-center gap-2",style:{fontSize:`${Y*.6}px`},children:[n.jsx(br,{size:14})," Datos para el Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsxs("p",{className:"font-bold text-slate-700 uppercase",style:{fontSize:`${Y*.7}px`},children:[ee.payment_bank_name||"BanPlus"," ",ee.payment_account_type||"Cta Cte"]}),n.jsxs("p",{className:"font-black text-blue-900 tracking-wider",style:{fontSize:`${Y*.7}px`},children:["# ",ee.payment_account_number||"0174-0124-6812-4414-5759"]}),n.jsxs("p",{className:"font-bold text-slate-600 uppercase",style:{fontSize:`${Y*.7}px`},children:["RIF: ",ee.payment_rif||"J-313266507"]}),n.jsxs("p",{className:"font-bold text-slate-600 uppercase",style:{fontSize:`${Y*.7}px`},children:["Pago Móvil: ",ee.payment_mobile_phone||"0424-4910040"]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"font-black text-emerald-600 uppercase tracking-widest flex items-center gap-2",style:{fontSize:`${Y*.6}px`},children:[n.jsx(Br,{size:14})," Reportar Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsx("p",{className:"font-black text-slate-400 uppercase",style:{fontSize:`${Y*.6}px`},children:"Enviar comprobante a:"}),(ee.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map((fe,Ue)=>n.jsx("p",{className:"font-bold text-slate-700",style:{fontSize:`${Y*.7}px`},children:fe.trim()},Ue)),n.jsxs("p",{className:"font-bold text-slate-600 uppercase mt-1",style:{fontSize:`${Y*.7}px`},children:["WhatsApp: ",ee.payment_whatsapp||"0412-8213310"]}),n.jsx("p",{className:"font-black text-amber-600 uppercase italic mt-2",style:{fontSize:`${Y*.6}px`},children:"Indicar #casa y nombre para identificar"})]})]})]}),n.jsx("div",{className:"pt-8 border-t border-slate-100 text-center",children:n.jsx("p",{className:"font-black text-slate-300 uppercase tracking-[0.5em]",style:{fontSize:`${Y*.5}px`},children:"SAC 2026 • Kernel V4.1.85 MC/MB • Generado Digitalmente"})})]})]})]})]}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Cuota Individual ",n.jsx("span",{className:"text-blue-600",children:"HTML Grande"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Versión con tamaño de letra ajustable para mejor legibilidad."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:d,onChange:fe=>u(Number(fe.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Te.map((fe,Ue)=>n.jsx("option",{value:Ue,children:fe},Ue))}),n.jsx("input",{type:"number",value:f,onChange:fe=>p(Number(fe.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12 space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-50 text-blue-600 rounded-2xl flex items-center justify-center mx-auto shadow-inner",children:n.jsx(QA,{size:32})}),n.jsx("h2",{className:"text-xl font-black text-slate-900 tracking-tight uppercase",children:"Envío Individual"}),n.jsx("p",{className:"text-slate-400 text-xs font-medium",children:"Seleccione una propiedad específica para procesar."})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(ea,{size:14})," Unidad Inmobiliaria"]}),n.jsxs("select",{value:y||"",onChange:fe=>j(Number(fe.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),z.map(fe=>n.jsxs("option",{value:fe.id,children:[fe.code," - ",fe.type," ",fe.number]},fe.id))]})]}),n.jsx("button",{disabled:!y||!q,onClick:()=>m("report"),className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-5 rounded-2xl font-black text-[10px] uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:q?n.jsxs(n.Fragment,{children:["PROCESAR INDIVIDUAL ",n.jsx(Hs,{size:16})]}):n.jsx(n.Fragment,{children:"CUOTA NO GENERADA"})})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12 space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-16 h-16 bg-indigo-50 text-indigo-600 rounded-2xl flex items-center justify-center mx-auto shadow-inner",children:n.jsx(_M,{size:32})}),n.jsx("h2",{className:"text-xl font-black text-slate-900 tracking-tight uppercase",children:"Envío por Lote (Rango)"}),n.jsx("p",{className:"text-slate-400 text-xs font-medium",children:"Procese múltiples unidades en secuencia."})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Desde"}),n.jsxs("select",{value:_||"",onChange:fe=>N(Number(fe.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl p-4 text-xs font-black text-slate-700 outline-none",children:[n.jsx("option",{value:"",children:"Inicio..."}),z.map(fe=>n.jsx("option",{value:fe.id,children:fe.code},fe.id))]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Hasta"}),n.jsxs("select",{value:E||"",onChange:fe=>T(Number(fe.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-xl p-4 text-xs font-black text-slate-700 outline-none",children:[n.jsx("option",{value:"",children:"Fin..."}),z.map(fe=>n.jsx("option",{value:fe.id,children:fe.code},fe.id))]})]})]}),n.jsx("button",{disabled:!_||!E||!q,onClick:pe,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white py-5 rounded-2xl font-black text-[10px] uppercase tracking-[0.2em] shadow-xl shadow-indigo-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:q?n.jsxs(n.Fragment,{children:["INICIAR PROCESO POR LOTE ",n.jsx(Hs,{size:16})]}):n.jsx(n.Fragment,{children:"CUOTA NO GENERADA"})})]})]}),!q&&n.jsxs("div",{className:"bg-amber-50 border border-amber-100 p-6 rounded-[2rem] flex items-center gap-4 text-amber-700 max-w-2xl mx-auto",children:[n.jsx(Sr,{size:24,className:"shrink-0"}),n.jsx("p",{className:"text-xs font-bold leading-relaxed uppercase tracking-tight",children:'Debe generar primero la relación de gastos global para este periodo en el módulo de "Generar Cuotas".'})]})]})},PIe=({user:e})=>{const{moduleStatus:t,updateModuleStatus:r,loading:a}=ht(),[s,i]=k.useState(null),l=async(o,d)=>{if(!(s||a)){i(o);try{await r(o,!d)}catch(u){console.error("Kernel Sync Error:",u);const f=u.message||"Error desconocido de red.";alert(`ALERTA DE SISTEMA (Kernel V4.1.51)

Fallo en la sincronización del módulo: ${o}

Detalle: ${f}

Si el error persiste, verifique que los archivos .md se subieron correctamente como .php al servidor.`)}finally{i(null)}}};return e.role!=="programmer"?n.jsx("div",{className:"flex flex-col items-center justify-center min-h-[60vh] animate-in fade-in duration-500",children:n.jsxs("div",{className:"bg-red-50 p-12 rounded-[3rem] border border-red-100 text-center shadow-2xl max-w-lg",children:[n.jsx(FM,{size:64,className:"text-red-500 mx-auto mb-6"}),n.jsx("h3",{className:"text-2xl font-black text-red-800 tracking-tight",children:"Acceso Bloqueado"}),n.jsx("p",{className:"text-red-600 font-medium",children:"Este módulo de configuración SaaS es de uso exclusivo para el Arquitecto de Sistemas."})]})}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"bg-slate-900 p-10 lg:p-14 rounded-[3.5rem] text-white relative overflow-hidden shadow-2xl border-b-8 border-indigo-600",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("div",{className:"bg-indigo-500/20 w-fit px-4 py-1.5 rounded-full border border-indigo-500/30 flex items-center gap-2 mb-4",children:[n.jsx(Qm,{size:14,className:"text-indigo-400"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-[0.2em] text-indigo-400",children:"SaaS Package Manager v4.1.67"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black tracking-tighter leading-none",children:["Configuración de ",n.jsx("span",{className:"text-indigo-500 italic",children:"Módulos"})]}),n.jsx("p",{className:"text-slate-400 mt-4 text-lg font-medium max-w-lg",children:"Kernel V4.1.67: Active o desactive funciones para ajustar la versión de renta del cliente."})]}),n.jsx(Qm,{size:220,className:"absolute right-[-40px] top-[-40px] text-white/5 pointer-events-none"})]}),t.length===0?n.jsxs("div",{className:"bg-white p-20 rounded-[3rem] text-center border-2 border-dashed border-slate-200",children:[n.jsx(ct,{className:"animate-spin mx-auto mb-4 text-slate-300",size:40}),n.jsx("p",{className:"text-slate-400 font-black uppercase tracking-widest text-[10px]",children:"Consultando registros del sistema..."})]}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.map(o=>n.jsxs("div",{className:`p-8 rounded-[2.5rem] border-2 transition-all duration-300 flex flex-col justify-between group ${o.isActive?"bg-white border-indigo-100 shadow-xl":"bg-slate-50 border-slate-200 opacity-60 grayscale"}`,children:[n.jsxs("div",{className:"flex justify-between items-start mb-8",children:[n.jsx("div",{className:`p-4 rounded-2xl transition-all ${o.isActive?"bg-indigo-600 text-white shadow-lg shadow-indigo-200":"bg-slate-200 text-slate-400"}`,children:LIe(o.id)}),n.jsxs("button",{disabled:s===o.id||a,onClick:()=>l(o.id,o.isActive),className:`w-16 h-8 rounded-full transition-all relative flex items-center ${o.isActive?"bg-indigo-600":"bg-slate-300"}`,children:[n.jsx("div",{className:`absolute w-6 h-6 bg-white rounded-full transition-all shadow-md ${o.isActive?"right-1":"left-1"}`}),s===o.id&&n.jsx(ct,{size:10,className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 animate-spin text-indigo-600"})]})]}),n.jsxs("div",{children:[n.jsx("h3",{className:"font-black text-slate-900 uppercase tracking-tight text-lg mb-1",children:o.label}),n.jsx("p",{className:`text-[10px] font-black uppercase tracking-widest ${o.isActive?"text-indigo-600":"text-slate-400"}`,children:o.isActive?"ESTADO: ACTIVO (ON)":"ESTADO: RESTRINGIDO (OFF)"})]})]},o.id))}),n.jsxs("div",{className:"p-10 bg-blue-50 border border-blue-100 rounded-[3.5rem] flex items-start gap-8 shadow-sm",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-lg shrink-0",children:n.jsx(Ia,{size:32})}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("h4",{className:"font-black text-blue-900 uppercase text-sm tracking-widest",children:"Protocolo de Integridad SaaS 2026"}),n.jsx("p",{className:"text-blue-800/70 text-sm font-medium leading-relaxed italic uppercase",children:"Cualquier cambio realizado en este panel se propaga instantáneamente a todos los usuarios del sistema. Al desactivar un módulo, este dejará de ser visible en el menú lateral y sus rutas de acceso quedarán inhabilitadas preventivamente."})]})]})]})},LIe=e=>({"prefill-simulator":n.jsx(Kr,{size:24}),"bank-reconciliation":n.jsx(jA,{size:24}),"bank-reconciliation-bnc":n.jsx(jA,{size:24}),"statement-analyzer":n.jsx(Kf,{size:24}),"statement-analyzer-bnc":n.jsx(br,{size:24}),"statement-detailed":n.jsx(Lc,{size:24}),"banplus-commissions":n.jsx(bs,{size:24}),commissions:n.jsx(bs,{size:24}),audit:n.jsx(xo,{size:24}),currency:n.jsx(za,{size:24}),messages:n.jsx(zs,{size:24}),polls:n.jsx(Rd,{size:24}),"data-forms":n.jsx(Jd,{size:24}),"live-voting":n.jsx(Yf,{size:24}),reservations:n.jsx(jM,{size:24}),announcements:n.jsx(bl,{size:24}),services:n.jsx(Xf,{size:24}),assemblies:n.jsx(kM,{size:24}),"recaudacion-detallada":n.jsx(br,{size:24}),"historial-pagos-egresos":n.jsx(ca,{size:24}),"expediente-digital":n.jsx(Lm,{size:24}),"payment-agreements":n.jsx(eu,{size:24}),"history-agreements":n.jsx(Da,{size:24}),"excel-reports":n.jsx(gl,{size:24}),"detailed-excel-reports":n.jsx(gl,{size:24}),"html-reports":n.jsx(yr,{size:24}),calculator:n.jsx(vi,{size:24}),statistics:n.jsx(EM,{size:24}),"payment-status":n.jsx(Gt,{size:24}),"payment-receipt":n.jsx(ca,{size:24}),"individual-fee-view":n.jsx(QA,{size:24}),"individual-fee-html":n.jsx(wr,{size:24}),"individual-fee-html-large":n.jsx(wr,{size:24}),"individual-account-status":n.jsx(ca,{size:24}),"detailed-account-status":n.jsx(Da,{size:24}),"monthly-debt-status":n.jsx(ca,{size:24}),"monthly-debt-status-massive":n.jsx(zs,{size:24}),"credit-balances":n.jsx(kn,{size:24}),"monthly-collection":n.jsx(da,{size:24}),"debt-list":n.jsx(yr,{size:24}),"solvent-list":n.jsx(Gt,{size:24}),"payment-report":n.jsx(ca,{size:24}),"bank-precise":n.jsx(Gt,{size:24}),"saldo-desglosado":n.jsx(ca,{size:24}),"saldo-desglosado-avanzado":n.jsx(wl,{size:24}),"congratulate-owner":n.jsx(If,{size:24}),"owner-reminder":n.jsx(bl,{size:24})})[e]||n.jsx(Ab,{size:24}),qa=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},QIe=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},HIe=({user:e})=>{const{properties:t,residents:r,refreshData:a}=ht(),[s,i]=k.useState(!0),[l,o]=k.useState(""),[d,u]=k.useState([]),[f,p]=k.useState(null);["admin","programmer","board"].includes(e.role);const h=async()=>{i(!0);try{const j=await we.getInitialDebtData();Array.isArray(j)?u(j):j&&j.success?u(j.data||[]):console.error("Kernel Response Error:",j)}catch(j){console.error("Kernel Sync Failed:",j)}finally{i(!1)}};k.useEffect(()=>{h()},[]);const m=k.useMemo(()=>d.filter(j=>(j.code||"").toLowerCase().includes(l.toLowerCase())||(j.ownerName||"").toLowerCase().includes(l.toLowerCase())),[d,l]),b=j=>{const _=window.open("","","width=900,height=900");if(!_)return;const N=(j.history||[]).map(E=>`
            <tr>
                <td style="padding:10px; border-bottom:1px solid #eee;">${E.date}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; font-size:10px;">${E.description}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; font-family:monospace;">${E.reference}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${qa(E.amount_usd)}</td>
            </tr>
        `).join("");_.document.write(`
            <html>
            <head>
                <title>Convenio de Pago - ${j.code}</title>
                <style>
                    body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; line-height: 1.6; }
                    .header { text-align: center; border-bottom: 5px solid #0f172a; padding-bottom: 20px; margin-bottom: 30px; }
                    h1 { margin: 0; font-size: 24px; text-transform: uppercase; }
                    .stats { display: flex; justify-content: space-between; margin: 30px 0; background: #f8fafc; padding: 20px; border-radius: 15px; border: 1px solid #e2e8f0; }
                    .stat-box { text-align: center; }
                    .stat-label { font-size: 10px; font-weight: 900; text-transform: uppercase; color: #64748b; }
                    .stat-val { font-size: 20px; font-weight: 900; color: #0f172a; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th { text-align: left; padding: 10px; background: #0f172a; color: white; font-size: 11px; text-transform: uppercase; }
                    .footer { margin-top: 50px; font-size: 10px; text-align: center; color: #94a3b8; border-top: 1px solid #eee; padding-top: 20px; }
                </style>
            </head>
            <body>
                <div class="header">
                    <h1>ESTADO DE CUENTA - DEUDA HISTÓRICA</h1>
                    <p>Condominio Residencial El Tejar | SAC 2026</p>
                </div>
                <div style="margin-bottom: 20px;">
                    <p><b>UNIDAD:</b> ${j.code}</p>
                    <p><b>TITULAR:</b> ${j.ownerName}</p>
                    <p><b>FECHA DE EMISIÓN:</b> ${new Date().toLocaleDateString()}</p>
                </div>
                <div class="stats">
                    <div class="stat-box"><div class="stat-label">Deuda Original</div><div class="stat-val">$${qa(j.original_debt)}</div></div>
                    <div class="stat-box"><div class="stat-label">Total Abonado</div><div class="stat-val" style="color: #10b981;">$${qa(j.total_paid)}</div></div>
                    <div class="stat-box"><div class="stat-label">Saldo Pendiente</div><div class="stat-val" style="color: #ef4444;">$${qa(j.current_debt)}</div></div>
                </div>
                <h3>DETALLE DE ABONOS REGISTRADOS</h3>
                <table>
                    <thead><tr><th>Fecha</th><th>Concepto Bancario</th><th>Referencia</th><th>Monto USD</th></tr></thead>
                    <tbody>${N||'<tr><td colspan="4" style="text-align:center; padding:30px;">No se registran abonos a la deuda histórica aún.</td></tr>'}</tbody>
                </table>
                <div class="footer">Este documento es una certificación digital del Kernel V4.1.12 • Powered by TecnoMath</div>
            </body>
            </html>
        `),_.document.close(),_.print()},v=()=>{const j=window.open("","","width=900,height=900");if(!j)return;const _=m.map(N=>`
            <tr>
                <td style="padding:10px; border-bottom:1px solid #eee;">${N.code}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${N.ownerName}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${qa(N.original_debt)}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${qa(N.total_paid)}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right; font-weight:bold;">$${qa(N.current_debt)}</td>
            </tr>
        `).join("");j.document.write(`
            <html>
            <head>
                <title>Listado de Convenios de Pago</title>
                <style>
                    body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; }
                    .header { text-align: center; border-bottom: 4px solid #2563eb; padding-bottom: 20px; margin-bottom: 30px; }
                    h1 { margin: 0; font-size: 24px; text-transform: uppercase; color: #1e3a8a; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th { text-align: left; padding: 12px; background: #1e3a8a; color: white; font-size: 11px; text-transform: uppercase; }
                    .footer { margin-top: 50px; font-size: 10px; text-align: center; color: #94a3b8; border-top: 1px solid #eee; padding-top: 20px; }
                </style>
            </head>
            <body>
                <div class="header">
                    <h1>MONITOR DE CONVENIOS DE PAGO</h1>
                    <p>Condominio Residencial El Tejar | SAC 2026</p>
                </div>
                <table>
                    <thead>
                        <tr>
                            <th>Unidad</th>
                            <th>Propietario</th>
                            <th>Deuda Original</th>
                            <th>Total Abonado</th>
                            <th>Saldo Pendiente</th>
                        </tr>
                    </thead>
                    <tbody>${_}</tbody>
                </table>
                <div class="footer">Reporte generado el ${new Date().toLocaleString()} • SAC Kernel V4.1.12</div>
            </body>
            </html>
        `),j.document.close(),j.print()},y=()=>{const j=m.map(B=>`
            <tr>
                <td>${B.code}</td>
                <td>${B.ownerName}</td>
                <td>$${qa(B.original_debt)}</td>
                <td>$${qa(B.total_paid)}</td>
                <td>$${qa(B.current_debt)}</td>
            </tr>
        `).join(""),_=`
            <!DOCTYPE html>
            <html lang="es">
            <head>
                <meta charset="UTF-8">
                <title>Convenios de Pago - Exportación</title>
                <style>
                    body { font-family: Arial, sans-serif; padding: 30px; line-height: 1.6; }
                    h1 { color: #1e3a8a; border-bottom: 2px solid #2563eb; padding-bottom: 10px; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                    th { background-color: #f8fafc; font-size: 12px; text-transform: uppercase; color: #64748b; }
                    tr:nth-child(even) { background-color: #f9fafb; }
                </style>
            </head>
            <body>
                <h1>Listado de Convenios de Pago</h1>
                <p>Fecha de generación: ${new Date().toLocaleString()}</p>
                <table>
                    <thead>
                        <tr>
                            <th>Unidad</th>
                            <th>Propietario</th>
                            <th>Deuda Original</th>
                            <th>Total Abonado</th>
                            <th>Saldo Pendiente</th>
                        </tr>
                    </thead>
                    <tbody>${j}</tbody>
                </table>
            </body>
            </html>
        `,N=new Blob([_],{type:"text/html"}),E=URL.createObjectURL(N),T=document.createElement("a");T.href=E,T.download=`Convenios_Pago_${new Date().toISOString().split("T")[0]}.html`,T.click(),URL.revokeObjectURL(E)};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-blue-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-blue-600 w-fit px-5 py-2 rounded-full border border-blue-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(eu,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Protocolo de Recuperación V4.1.12"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Convenios ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-500 italic",children:"de Pago"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:"Monitor de rastro histórico para deudas migradas al inicio de gestión."})]}),n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px] text-slate-900",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-3xl flex items-center justify-center mb-6 shadow-inner",children:n.jsx(da,{size:40})}),n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Recuperación Total"}),n.jsxs("h4",{className:"text-4xl font-black tracking-tighter",children:["$",qa(d.reduce((j,_)=>j+(_.total_paid||0),0))]}),n.jsx("div",{className:"w-full h-px bg-slate-100 my-6"}),n.jsxs("button",{onClick:h,className:"w-full bg-slate-900 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-black transition-all flex items-center justify-center gap-2",children:[n.jsx(ct,{size:14,className:s?"animate-spin":""})," Sincronizar Kernel"]})]})]}),n.jsx(za,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex flex-col md:flex-row justify-between items-center bg-slate-50/30 gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full max-w-md",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar unidad o propietario...",className:"w-full bg-white border border-slate-200 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-blue-600",value:l,onChange:j=>o(j.target.value)})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:v,className:"flex items-center gap-3 px-6 py-4 bg-slate-800 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-900 transition-all shadow-xl active:scale-95",children:[n.jsx(wt,{size:18})," Imprimir Lista"]}),n.jsxs("button",{onClick:y,className:"flex items-center gap-3 px-6 py-4 bg-blue-600 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-blue-700 transition-all shadow-xl shadow-blue-200 active:scale-95",children:[n.jsx(Zd,{size:18})," HTML"]})]})]}),n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Inmueble"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Titular / Convenio"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Deuda Original"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Abonado"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Saldo Restante"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acción"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:s?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"py-20 text-center",children:n.jsx(ct,{className:"animate-spin mx-auto text-blue-600",size:32})})}):m.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"py-20 text-center text-slate-300 italic",children:"No se detectaron convenios históricos."})}):m.map((j,_)=>{const N=j.original_debt>0?j.total_paid/j.original_debt*100:0;return n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6",children:n.jsx("span",{className:"font-black text-slate-900 text-lg",children:j.code})}),n.jsxs("td",{className:"px-10 py-6",children:[n.jsx("p",{className:"font-black text-slate-700 text-xs uppercase leading-tight",children:j.ownerName}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-tighter mt-1 italic",children:"Convenio Permanente"})]}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"text-sm font-black text-slate-400 font-mono",children:["$ ",qa(j.original_debt)]})}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("span",{className:"text-sm font-black text-emerald-600 font-mono",children:["$ ",qa(j.total_paid)]}),n.jsx("div",{className:"w-24 h-1.5 bg-slate-100 rounded-full overflow-hidden mx-auto border border-slate-200",children:n.jsx("div",{className:"h-full bg-emerald-500 transition-all duration-1000",style:{width:`${N}%`}})})]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("span",{className:`text-lg font-black tracking-tighter ${j.current_debt>0?"text-rose-600":"text-emerald-500"}`,children:["$ ",qa(j.current_debt)]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:()=>p(j),className:"p-3 bg-blue-50 text-blue-600 rounded-xl hover:bg-blue-600 hover:text-white transition-all shadow-sm",title:"Ver Línea de Tiempo",children:n.jsx(Da,{size:18})}),n.jsx("button",{onClick:()=>b(j),className:"p-3 bg-slate-100 text-slate-500 rounded-xl hover:bg-slate-900 hover:text-white transition-all shadow-sm",children:n.jsx(wt,{size:18})})]})})]},_)})})]})})]}),f&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[400] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] w-full max-w-4xl max-h-[85vh] shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"p-8 lg:p-10 border-b border-slate-100 flex justify-between items-center bg-white shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"w-16 h-16 bg-blue-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-xl shadow-blue-100",children:n.jsx(Da,{size:28})}),"tube ",f.code,n.jsxs("div",{children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase leading-none",children:f.code}),n.jsx("p",{className:"text-blue-600 font-black text-[10px] uppercase tracking-[0.2em] mt-2",children:"Línea de Tiempo de Recuperación"})]})]}),n.jsx("button",{onClick:()=>p(null),className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(mt,{size:24})})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-8 lg:p-12 bg-slate-50 custom-scrollbar",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-10",children:[n.jsxs("div",{className:"bg-white p-6 rounded-3xl border border-slate-200 shadow-sm text-center",children:[n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase mb-2",children:"Original"}),n.jsxs("p",{className:"text-2xl font-black text-slate-800",children:["$ ",qa(f.original_debt)]})]}),n.jsxs("div",{className:"bg-emerald-50 p-6 rounded-3xl border border-emerald-100 shadow-sm text-center",children:[n.jsx("p",{className:"text-[9px] font-black text-emerald-600 uppercase mb-2",children:"Total Pagado"}),n.jsxs("p",{className:"text-2xl font-black text-emerald-700",children:["$ ",qa(f.total_paid)]})]}),n.jsxs("div",{className:"bg-rose-50 p-6 rounded-3xl border border-rose-100 shadow-sm text-center",children:[n.jsx("p",{className:"text-[9px] font-black text-rose-600 uppercase mb-2",children:"Restante"}),n.jsxs("p",{className:"text-2xl font-black text-rose-700",children:["$ ",qa(f.current_debt)]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest px-2 mb-4",children:"Registro Cronológico de Operaciones"}),(f.history||[]).length===0?n.jsxs("div",{className:"py-16 text-center bg-white rounded-3xl border-2 border-dashed border-slate-200",children:[n.jsx(Sr,{className:"mx-auto mb-4 text-slate-300",size:32}),n.jsx("p",{className:"text-slate-400 font-bold uppercase text-xs",children:"Sin abonos registrados en el sistema"})]}):f.history.map((j,_)=>n.jsxs("div",{className:"bg-white p-6 rounded-2xl border border-slate-100 shadow-sm flex items-center justify-between group hover:border-blue-300 transition-all",children:[n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-50 text-blue-600 flex items-center justify-center font-black text-[10px]",children:j.date.split("-")[2]}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-800 text-xs uppercase leading-tight",children:j.description}),n.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[n.jsxs("span",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["REF: ",j.reference]}),n.jsx("span",{className:"text-[9px] font-black text-blue-500 bg-blue-50 px-2 rounded",children:"CONTABLE"})]})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("p",{className:"text-lg font-black text-emerald-600 tracking-tighter",children:["$ ",qa(j.amount_usd)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:["Bs. ",QIe(j.amount_bs)]})]})]},_))]})]}),n.jsxs("div",{className:"p-8 bg-white border-t border-slate-100 flex justify-between items-center shrink-0",children:[n.jsxs("button",{onClick:()=>b(f),className:"bg-slate-900 text-white px-8 py-4 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-xl flex items-center gap-2 active:scale-95",children:[n.jsx(wt,{size:16})," IMPRIMIR CERTIFICADO DE PAGO"]}),n.jsx("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.4em]",children:"Audit Trail Kernel V4.1.12"})]})]})})]})},Ac=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},zIe=({user:e})=>{const[t,r]=k.useState(!0),[a,s]=k.useState(""),[i,l]=k.useState([]),[o,d]=k.useState(null),u=async()=>{r(!0);try{const v=await(await fetch(`${Ne}/get_archived_agreements.php`,{credentials:"include"})).json();v.success&&l(v.data||[])}catch(b){console.error("Archive Sync Failed:",b)}finally{r(!1)}};k.useEffect(()=>{u()},[]);const f=k.useMemo(()=>i.filter(b=>(b.code||"").toLowerCase().includes(a.toLowerCase())||(b.owner_name||"").toLowerCase().includes(a.toLowerCase())),[i,a]),p=b=>{const v=window.open("","","width=900,height=900");if(!v)return;const _=JSON.parse(b.payment_history_json||"[]").filter(N=>{const E=N.description||"";return new RegExp(`RECUPERACIÓN DEUDA (HISTÓRICA|ANTERIOR): ${b.code}([^0-9]|$)`,"i").test(E)}).map(N=>`
            <tr>
                <td style="padding:10px; border-bottom:1px solid #eee;">${N.date}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; font-size:10px;">${N.description}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; font-family:monospace;">${N.reference}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${Ac(N.amount_usd)}</td>
            </tr>
        `).join("");v.document.write(`
            <html>
            <head>
                <title>Acta de Solvencia Histórica - ${b.code}</title>
                <style>
                    body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; line-height: 1.6; }
                    .header { text-align: center; border-bottom: 5px solid #10b981; padding-bottom: 20px; margin-bottom: 30px; }
                    h1 { margin: 0; font-size: 24px; text-transform: uppercase; color: #065f46; }
                    .stats { display: flex; justify-content: space-between; margin: 30px 0; background: #ecfdf5; padding: 20px; border-radius: 15px; border: 1px solid #d1fae5; }
                    .stat-box { text-align: center; }
                    .stat-label { font-size: 10px; font-weight: 900; text-transform: uppercase; color: #059669; }
                    .stat-val { font-size: 20px; font-weight: 900; color: #065f46; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th { text-align: left; padding: 10px; background: #065f46; color: white; font-size: 11px; text-transform: uppercase; }
                    .footer { margin-top: 50px; font-size: 10px; text-align: center; color: #94a3b8; border-top: 1px solid #eee; padding-top: 20px; }
                </style>
            </head>
            <body>
                <div class="header">
                    <h1>CERTIFICACIÓN DE SOLVENCIA HISTÓRICA</h1>
                    <p>Condominio Residencial El Tejar | SAC 2026</p>
                </div>
                <div style="margin-bottom: 20px;">
                    <p><b>UNIDAD:</b> ${b.code}</p>
                    <p><b>TITULAR AL CIERRE:</b> ${b.owner_name}</p>
                    <p><b>FECHA DE LIQUIDACIÓN:</b> ${b.completion_date}</p>
                    <p><b>ID SESIÓN:</b> ARC-${b.id}</p>
                </div>
                <div class="stats">
                    <div class="stat-box"><div class="stat-label">Deuda Recuperada</div><div class="stat-val">$${Ac(b.original_amount)}</div></div>
                    <div class="stat-box"><div class="stat-label">Estatus Final</div><div class="stat-val">SOLVENTE</div></div>
                </div>
                <h3>DESGLOSE DE OPERACIONES QUE SALDARON EL COMPROMISO</h3>
                <table>
                    <thead><tr><th>Fecha</th><th>Concepto</th><th>Referencia</th><th>Monto USD</th></tr></thead>
                    <tbody>${_}</tbody>
                </table>
                <div class="footer">Este documento es una certificación digital del Kernel V4.1.12 • Powered by TecnoMath</div>
            </body>
            </html>
        `),v.document.close(),v.print()},h=()=>{const b=window.open("","","width=900,height=900");if(!b)return;const v=f.map(y=>`
            <tr>
                <td style="padding:10px; border-bottom:1px solid #eee;">${y.code}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${y.owner_name}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${Ac(y.original_amount)}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:center;">${y.completion_date}</td>
            </tr>
        `).join("");b.document.write(`
            <html>
            <head>
                <title>Histórico de Convenios Finalizados</title>
                <style>
                    body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; }
                    .header { text-align: center; border-bottom: 4px solid #059669; padding-bottom: 20px; margin-bottom: 30px; }
                    h1 { margin: 0; font-size: 24px; text-transform: uppercase; color: #064e3b; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th { text-align: left; padding: 12px; background: #064e3b; color: white; font-size: 11px; text-transform: uppercase; }
                    .footer { margin-top: 50px; font-size: 10px; text-align: center; color: #94a3b8; border-top: 1px solid #eee; padding-top: 20px; }
                </style>
            </head>
            <body>
                <div class="header">
                    <h1>ARCHIVO HISTÓRICO DE CONVENIOS FINALIZADOS</h1>
                    <p>Condominio Residencial El Tejar | SAC 2026</p>
                </div>
                <table>
                    <thead>
                        <tr>
                            <th>Unidad</th>
                            <th>Propietario al Cierre</th>
                            <th>Monto Liquidado</th>
                            <th>Fecha de Cierre</th>
                        </tr>
                    </thead>
                    <tbody>${v}</tbody>
                </table>
                <div class="footer">Reporte generado el ${new Date().toLocaleString()} • SAC Kernel V4.1.12</div>
            </body>
            </html>
        `),b.document.close(),b.print()},m=()=>{const b=f.map(N=>`
            <tr>
                <td>${N.code}</td>
                <td>${N.owner_name}</td>
                <td>$${Ac(N.original_amount)}</td>
                <td>${N.completion_date}</td>
            </tr>
        `).join(""),v=`
            <!DOCTYPE html>
            <html lang="es">
            <head>
                <meta charset="UTF-8">
                <title>Histórico de Convenios - Exportación</title>
                <style>
                    body { font-family: Arial, sans-serif; padding: 30px; line-height: 1.6; }
                    h1 { color: #064e3b; border-bottom: 2px solid #059669; padding-bottom: 10px; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                    th { background-color: #f8fafc; font-size: 12px; text-transform: uppercase; color: #64748b; }
                    tr:nth-child(even) { background-color: #f9fafb; }
                </style>
            </head>
            <body>
                <h1>Histórico de Convenios Finalizados</h1>
                <p>Fecha de generación: ${new Date().toLocaleString()}</p>
                <table>
                    <thead>
                        <tr>
                            <th>Unidad</th>
                            <th>Propietario al Cierre</th>
                            <th>Monto Liquidado</th>
                            <th>Fecha de Cierre</th>
                        </tr>
                    </thead>
                    <tbody>${b}</tbody>
                </table>
            </body>
            </html>
        `,y=new Blob([v],{type:"text/html"}),j=URL.createObjectURL(y),_=document.createElement("a");_.href=j,_.download=`Historico_Convenios_${new Date().toISOString().split("T")[0]}.html`,_.click(),URL.revokeObjectURL(j)};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-emerald-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-emerald-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-emerald-600 w-fit px-5 py-2 rounded-full border border-emerald-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(Da,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Archivo Histórico de Solvencias"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Histórico ",n.jsx("br",{}),n.jsx("span",{className:"text-emerald-400 italic",children:"de Convenios"})]}),n.jsx("p",{className:"text-emerald-100/60 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Memoria institucional de deudas recuperadas exitosamente. El rastro de la buena gestión."'})]}),n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px] text-slate-900",children:[n.jsx("div",{className:"w-20 h-20 bg-emerald-50 text-emerald-600 rounded-3xl flex items-center justify-center mb-6 shadow-inner",children:n.jsx(Gt,{size:40})}),n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Total Recuperado Archivado"}),n.jsxs("h4",{className:"text-4xl font-black tracking-tighter text-emerald-600",children:["$",Ac(i.reduce((b,v)=>b+Number(v.original_amount),0))]}),n.jsx("div",{className:"w-full h-px bg-slate-100 my-6"}),n.jsxs("button",{onClick:u,className:"w-full bg-emerald-900 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-black transition-all flex items-center justify-center gap-2",children:[n.jsx(ct,{size:14,className:t?"animate-spin":""})," Sincronizar Archivo"]})]})]}),n.jsx(za,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full max-w-md",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por inmueble o propietario...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-emerald-600",value:a,onChange:b=>s(b.target.value)})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:h,className:"flex items-center gap-3 px-6 py-4 bg-slate-800 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-900 transition-all shadow-xl active:scale-95",children:[n.jsx(wt,{size:18})," Imprimir Lista"]}),n.jsxs("button",{onClick:m,className:"flex items-center gap-3 px-6 py-4 bg-emerald-600 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-emerald-700 transition-all shadow-xl shadow-emerald-200 active:scale-95",children:[n.jsx(Zd,{size:18})," HTML"]})]})]}),n.jsx("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Inmueble"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Propietario al Cierre"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Monto Liquidado"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Fecha Cierre"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Detalle"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:t?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-20 text-center",children:n.jsx(ct,{className:"animate-spin mx-auto text-emerald-600",size:32})})}):f.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-20 text-center text-slate-300 italic uppercase font-black text-xs",children:"Sin registros históricos archivados"})}):f.map((b,v)=>n.jsxs("tr",{className:"hover:bg-emerald-50/20 transition-all group",children:[n.jsx("td",{className:"px-10 py-6",children:n.jsx("span",{className:"font-black text-slate-900 text-lg",children:b.code})}),n.jsxs("td",{className:"px-10 py-6",children:[n.jsx("p",{className:"font-black text-slate-700 text-xs uppercase",children:b.owner_name}),n.jsx("p",{className:"text-[9px] font-bold text-emerald-600 uppercase tracking-tighter mt-1 italic",children:"Convenio Finalizado"})]}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"text-sm font-black text-emerald-600 font-mono",children:["$ ",Ac(b.original_amount)]})}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsx("span",{className:"text-xs font-black text-slate-400",children:b.completion_date})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:()=>d(b),className:"p-3 bg-emerald-50 text-emerald-600 rounded-xl hover:bg-emerald-600 hover:text-white transition-all shadow-sm",children:n.jsx(Tc,{size:18})}),n.jsx("button",{onClick:()=>p(b),className:"p-3 bg-slate-100 text-slate-500 rounded-xl hover:bg-slate-900 hover:text-white transition-all shadow-sm",children:n.jsx(wt,{size:18})})]})})]},v))})]})})}),o&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[400] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] w-full max-w-4xl max-h-[85vh] shadow-2xl flex flex-col overflow-hidden animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"p-8 lg:p-10 border-b border-emerald-100 flex justify-between items-center bg-white shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"w-16 h-16 bg-emerald-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-xl",children:n.jsx(Da,{size:28})}),n.jsxs("div",{children:[n.jsxs("h3",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase leading-none",children:["Rastro de Solvencia: ",o.code]}),n.jsx("p",{className:"text-emerald-600 font-black text-[10px] uppercase tracking-[0.2em] mt-2",children:"Archivo Digital Permanente"})]})]}),n.jsx("button",{onClick:()=>d(null),className:"p-3 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(mt,{size:24})})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-8 lg:p-12 bg-slate-50 custom-scrollbar",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-10",children:[n.jsxs("div",{className:"bg-white p-6 rounded-3xl border border-slate-200 shadow-sm",children:[n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase mb-2",children:"Total Recuperado"}),n.jsxs("p",{className:"text-3xl font-black text-emerald-600",children:["$ ",Ac(o.original_amount)]})]}),n.jsxs("div",{className:"bg-white p-6 rounded-3xl border border-slate-200 shadow-sm",children:[n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase mb-2",children:"Fecha de Finalización"}),n.jsx("p",{className:"text-xl font-black text-slate-800",children:o.completion_date})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest px-2 mb-4",children:"Abonos que consolidaron la deuda"}),JSON.parse(o.payment_history_json||"[]").filter(y=>{const j=y.description||"";return new RegExp(`RECUPERACIÓN DEUDA (HISTÓRICA|ANTERIOR): ${o.code}([^0-9]|$)`,"i").test(j)}).map((y,j)=>n.jsxs("div",{className:"bg-white p-6 rounded-2xl border border-slate-100 shadow-sm flex items-center justify-between group hover:border-emerald-300 transition-all",children:[n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-50 text-emerald-600 flex items-center justify-center font-black text-[10px]",children:y.date.split("-")[2]}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-800 text-xs uppercase leading-tight",children:y.description}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase mt-1",children:["REF: ",y.reference," • BANPLUS VET"]})]})]}),n.jsx("div",{className:"text-right",children:n.jsxs("p",{className:"text-lg font-black text-emerald-600 tracking-tighter",children:["$ ",Ac(y.amount_usd)]})})]},j))]})]}),n.jsxs("div",{className:"p-8 bg-white border-t border-slate-100 flex justify-between items-center shrink-0",children:[n.jsxs("button",{onClick:()=>p(o),className:"bg-emerald-900 text-white px-8 py-4 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-xl flex items-center gap-2 active:scale-95",children:[n.jsx(wt,{size:16})," IMPRIMIR CERTIFICADO HISTÓRICO"]}),n.jsx("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.4em]",children:"Permanent Audit V4.1.12"})]})]})})]})},$Ie=({user:e})=>{const[t,r]=k.useState([]),[a,s]=k.useState(null),[i,l]=k.useState([]),[o,d]=k.useState(!0),[u,f]=k.useState(""),[p,h]=k.useState(null),[m,b]=k.useState(1),[v,y]=k.useState(0),j=async()=>{d(!0);try{const U=await(await fetch(`${Ne}/get_vault_files.php`,{credentials:"include"})).json();U.success&&r(U.folders||[])}catch(R){console.error("Vault Sync Error",R)}finally{d(!1)}};k.useEffect(()=>{j()},[]);const _=async R=>{d(!0),s(R);try{const D=await(await fetch(`${Ne}/get_vault_files.php?folder=${R}`,{credentials:"include"})).json();D.success&&l(D.files||[])}catch(U){console.error("Folder Fetch Error",U)}finally{d(!1)}},N=k.useMemo(()=>{if(!u)return i;const R=u.toLowerCase();return i.filter(U=>U.name.toLowerCase().includes(R)||U.provider&&U.provider.toLowerCase().includes(R)||U.ref&&U.ref.toLowerCase().includes(R))},[i,u]),E=()=>{s(null),l([]),f("")},T=()=>{b(1),y(0)},B=()=>{if(!a)return;const R=window.open("","","width=900,height=900");if(!R)return;const U=N.map(D=>`
            <tr>
                <td style="padding:10px; border-bottom:1px solid #eee;">${D.name}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${D.provider||"S/I"}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${D.ref||"S/R"}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${D.id||"?"}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${D.amount||"0.00"}</td>
            </tr>
        `).join("");R.document.write(`
            <html>
            <head>
                <title>Listado de Facturas - ${a}</title>
                <style>
                    body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; }
                    .header { text-align: center; border-bottom: 4px solid #4f46e5; padding-bottom: 20px; margin-bottom: 30px; }
                    h1 { margin: 0; font-size: 24px; text-transform: uppercase; color: #3730a3; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th { text-align: left; padding: 12px; background: #3730a3; color: white; font-size: 11px; text-transform: uppercase; }
                    .footer { margin-top: 50px; font-size: 10px; text-align: center; color: #94a3b8; border-top: 1px solid #eee; padding-top: 20px; }
                </style>
            </head>
            <body>
                <div class="header">
                    <h1>EXPEDIENTE DIGITAL - LISTADO DE FACTURAS</h1>
                    <p>Periodo: ${a.replace("_"," / ")}</p>
                    <p>Condominio Residencial El Tejar | SAC 2026</p>
                </div>
                <table>
                    <thead>
                        <tr>
                            <th>Archivo</th>
                            <th>Proveedor</th>
                            <th>Referencia</th>
                            <th>ID Sistema</th>
                            <th>Monto USD</th>
                        </tr>
                    </thead>
                    <tbody>${U}</tbody>
                </table>
                <div class="footer">Reporte generado el ${new Date().toLocaleString()} • SAC Kernel V1.0</div>
            </body>
            </html>
        `),R.document.close(),R.print()},F=()=>{if(!a)return;const R=N.map(G=>`
            <tr>
                <td>${G.name}</td>
                <td>${G.provider||"S/I"}</td>
                <td>${G.ref||"S/R"}</td>
                <td>${G.id||"?"}</td>
                <td>$${G.amount||"0.00"}</td>
                <td>${G.size}</td>
            </tr>
        `).join(""),U=`
            <!DOCTYPE html>
            <html lang="es">
            <head>
                <meta charset="UTF-8">
                <title>Expediente Digital - ${a}</title>
                <style>
                    body { font-family: Arial, sans-serif; padding: 30px; line-height: 1.6; }
                    h1 { color: #3730a3; border-bottom: 2px solid #4f46e5; padding-bottom: 10px; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                    th { background-color: #f8fafc; font-size: 12px; text-transform: uppercase; color: #64748b; }
                    tr:nth-child(even) { background-color: #f9fafb; }
                </style>
            </head>
            <body>
                <h1>Listado de Facturas Digitalizadas</h1>
                <p>Periodo: ${a.replace("_"," / ")}</p>
                <p>Fecha de generación: ${new Date().toLocaleString()}</p>
                <table>
                    <thead>
                        <tr>
                            <th>Archivo</th>
                            <th>Proveedor</th>
                            <th>Referencia</th>
                            <th>ID Sistema</th>
                            <th>Monto USD</th>
                            <th>Tamaño</th>
                        </tr>
                    </thead>
                    <tbody>${R}</tbody>
                </table>
            </body>
            </html>
        `,D=new Blob([U],{type:"text/html"}),L=URL.createObjectURL(D),P=document.createElement("a");P.href=L,P.download=`Expediente_${a}.html`,P.click(),URL.revokeObjectURL(L)};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-indigo-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-indigo-600 w-fit px-5 py-2 rounded-full border border-indigo-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(Lm,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Expediente Digital v1.0"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Archivo de ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-500 italic",children:"Comprobantes"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Kernel V4.0.81: Transparencia total. Visualización de facturas digitalizadas de proveedores."'})]}),n.jsxs("div",{className:"bg-white p-10 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px] text-slate-900",children:[n.jsx("div",{className:"w-20 h-20 bg-indigo-50 text-indigo-600 rounded-3xl flex items-center justify-center mb-6 shadow-inner",children:n.jsx(yr,{size:40})}),n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Estatus del Repositorio"}),n.jsx("h4",{className:"text-3xl font-black tracking-tighter text-indigo-600",children:a?a.replace("_"," / "):`${t.length} Periodos`}),n.jsx("div",{className:"w-full h-px bg-slate-100 my-6"}),n.jsxs("button",{onClick:j,className:"w-full bg-slate-900 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-black transition-all flex items-center justify-center gap-2",children:[n.jsx(ct,{size:14,className:o?"animate-spin":""})," Sincronizar Archivo"]})]})]}),n.jsx(Lm,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),a?n.jsxs("div",{className:"space-y-8 animate-in slide-in-from-bottom duration-500",children:[n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("button",{onClick:E,className:"flex items-center gap-3 px-6 py-3.5 bg-slate-100 text-slate-600 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-200 transition-all",children:[n.jsx(gs,{size:16})," Volver al Archivo"]}),n.jsxs("div",{className:"relative flex-1 w-full max-w-md",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por Proveedor, Ref o ID...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-indigo-600",value:u,onChange:R=>f(R.target.value)})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:B,className:"flex items-center gap-3 px-6 py-3.5 bg-slate-800 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-900 transition-all",children:[n.jsx(wt,{size:16})," Imprimir Lista"]}),n.jsxs("button",{onClick:F,className:"flex items-center gap-3 px-6 py-3.5 bg-blue-600 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-blue-700 transition-all",children:[n.jsx(Zd,{size:16})," HTML"]})]})]}),o?n.jsx("div",{className:"py-20 text-center",children:n.jsx(ct,{className:"animate-spin text-indigo-500 mx-auto",size:40})}):N.length===0?n.jsxs("div",{className:"py-32 text-center bg-white rounded-[4rem] border-2 border-dashed border-slate-200",children:[n.jsx(Sr,{size:48,className:"mx-auto mb-4 text-slate-200"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-sm",children:"No se encontraron archivos indexados."}),n.jsx("p",{className:"text-[10px] text-slate-300 mt-2 uppercase",children:"Asegúrese de subir archivos .JPG o .PNG a la carpeta."})]}):n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:N.map((R,U)=>n.jsxs("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 shadow-sm overflow-hidden group hover:border-indigo-500 transition-all",children:[n.jsxs("div",{className:"aspect-[4/3] bg-slate-100 relative overflow-hidden flex items-center justify-center",children:[n.jsx("img",{src:R.path,alt:R.name,className:"w-full h-full object-cover opacity-60 group-hover:opacity-100 group-hover:scale-110 transition-all duration-700 cursor-zoom-in",onClick:()=>{h(R),T()}}),n.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end p-6 pointer-events-none",children:n.jsxs("div",{className:"text-white",children:[n.jsxs("p",{className:"text-[10px] font-black uppercase tracking-widest text-blue-400",children:["Ref: ",R.ref||"S/R"]}),n.jsx("p",{className:"font-black uppercase truncate",children:R.provider||"S/I"})]})})]}),n.jsxs("div",{className:"p-6 space-y-4",children:[n.jsxs("div",{className:"flex justify-between items-start",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-tighter truncate max-w-[120px]",children:R.name}),n.jsxs("p",{className:"text-[10px] font-bold text-indigo-600 mt-1 uppercase",children:["ID SISTEMA: ",R.id||"?"]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>{h(R),T()},className:"p-2 bg-slate-50 hover:bg-indigo-600 hover:text-white rounded-lg transition-all text-slate-400",children:n.jsx(Tc,{size:16})}),n.jsx("a",{href:R.path,download:!0,className:"p-2 bg-slate-50 hover:bg-emerald-600 hover:text-white rounded-lg transition-all text-slate-400",children:n.jsx(Gs,{size:16})})]})]}),n.jsxs("div",{className:"pt-4 border-t border-slate-50 flex justify-between items-center",children:[n.jsx("span",{className:"text-[9px] font-black text-slate-300 uppercase tracking-widest",children:R.size}),n.jsxs("span",{className:"text-sm font-black text-slate-900",children:["$",R.amount||"0.00"]})]})]})]},U))})]}):n.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-6",children:o?Array(6).fill(0).map((R,U)=>n.jsx("div",{className:"bg-white p-8 rounded-[2.5rem] border border-slate-200 animate-pulse h-48"},U)):t.length===0?n.jsxs("div",{className:"col-span-full py-32 text-center bg-white rounded-[4rem] border-2 border-dashed border-slate-200",children:[n.jsx(J_,{size:64,className:"mx-auto mb-6 text-slate-100"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-sm",children:"No hay carpetas de facturación configuradas."}),n.jsx("p",{className:"text-[10px] text-slate-300 mt-2",children:"Cree directorios tipo MM_YYYY dentro de /facturas/ en su servidor."})]}):t.map(R=>n.jsxs("button",{onClick:()=>_(R),className:"bg-white p-8 rounded-[3rem] border border-slate-200 shadow-sm hover:border-indigo-500 hover:shadow-xl hover:-translate-y-2 transition-all flex flex-col items-center group text-center",children:[n.jsx("div",{className:"w-16 h-16 bg-slate-50 text-slate-400 group-hover:bg-indigo-600 group-hover:text-white rounded-3xl flex items-center justify-center mb-6 transition-all shadow-inner",children:n.jsx(J_,{size:32})}),n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-[0.2em] mb-1",children:"Periodo"}),n.jsx("span",{className:"font-black text-slate-900 uppercase tracking-tighter text-lg",children:R.replace("_"," / ")})]},R))}),p&&n.jsxs("div",{className:"fixed inset-0 bg-slate-900/95 backdrop-blur-xl flex items-center justify-center z-[500] p-4",children:[n.jsx("button",{onClick:()=>h(null),className:"absolute top-8 right-8 p-3 bg-white/10 hover:bg-white/20 text-white rounded-full transition-all z-[510]",children:n.jsx(mt,{size:32})}),n.jsxs("div",{className:"absolute top-8 left-8 flex gap-4 z-[510]",children:[n.jsxs("div",{className:"bg-white/10 backdrop-blur-md px-6 py-3 rounded-2xl border border-white/10 text-white",children:[n.jsx("p",{className:"text-[8px] font-black uppercase tracking-[0.2em] text-blue-400 mb-1",children:"Expediente Digital"}),n.jsx("h3",{className:"text-xl font-black uppercase tracking-tight",children:p.provider||"Sin Datos"}),n.jsxs("p",{className:"text-[10px] font-bold opacity-60",children:["ID Ref: ",p.ref," • ",p.name]})]}),n.jsxs("div",{className:"flex gap-2 items-center bg-white/10 backdrop-blur-md px-4 rounded-2xl border border-white/10",children:[n.jsx("button",{onClick:()=>b(R=>Math.max(.5,R-.2)),className:"p-2 text-white hover:bg-white/10 rounded-lg",children:n.jsx(bq,{size:20})}),n.jsxs("span",{className:"text-xs font-black text-white w-12 text-center",children:[Math.round(m*100),"%"]}),n.jsx("button",{onClick:()=>b(R=>Math.min(3,R+.2)),className:"p-2 text-white hover:bg-white/10 rounded-lg",children:n.jsx(mq,{size:20})}),n.jsx("div",{className:"w-px h-6 bg-white/10 mx-2"}),n.jsx("button",{onClick:()=>y(R=>R+90),className:"p-2 text-white hover:bg-white/10 rounded-lg",children:n.jsx(yK,{size:20})})]})]}),n.jsx("div",{className:"w-full h-full flex items-center justify-center overflow-hidden cursor-move p-20",children:n.jsx("img",{src:p.path,alt:"Preview",style:{transform:`scale(${m}) rotate(${v}deg)`,transition:"transform 0.3s cubic-bezier(0.4, 0, 0.2, 1)"},className:"max-w-[90vw] max-h-[90vh] object-contain shadow-2xl rounded-sm"})}),n.jsx("div",{className:"absolute bottom-8 left-1/2 -translate-x-1/2 flex gap-4 z-[510]",children:n.jsxs("button",{onClick:()=>window.print(),className:"bg-white text-slate-900 px-8 py-4 rounded-2xl font-black text-xs uppercase tracking-widest flex items-center gap-3 shadow-2xl active:scale-95",children:[n.jsx(wt,{size:18})," Imprimir Comprobante"]})})]})]})},VIe=({user:e})=>{const[t,r]=k.useState([]),[a,s]=k.useState(!0),[i,l]=k.useState("banco"),[o,d]=k.useState(""),[u,f]=k.useState({month:new Date().getMonth(),year:new Date().getFullYear()}),p=async()=>{s(!0);try{const v=await(await fetch(`${Ne}/get_recaudacion_detallada.php`,{credentials:"include"})).json();v.success&&r(v.data||[])}catch(b){console.error("Fetch Recaudacion Error",b)}finally{s(!1)}};k.useEffect(()=>{p()},[]);const h=k.useMemo(()=>t.filter(b=>{const v=b.metodo.toLowerCase().includes("efectivo")||b.metodo.toLowerCase().includes("divisa"),y=i==="efectivo"?v:!v,j=o.toLowerCase(),_=!o||b.prop_code.toLowerCase().includes(j)||b.owner_name.toLowerCase().includes(j)||b.referencia.toLowerCase().includes(j),[N,E]=b.fecha.split("-").map(Number),T=N===u.year&&E-1===u.month;return y&&_&&T}),[t,i,o,u]),m=k.useMemo(()=>{const b=t.filter(j=>{const[_,N]=j.fecha.split("-").map(Number);return _===u.year&&N-1===u.month}),v=b.filter(j=>!(j.metodo.toLowerCase().includes("efectivo")||j.metodo.toLowerCase().includes("divisa"))),y=b.filter(j=>j.metodo.toLowerCase().includes("efectivo")||j.metodo.toLowerCase().includes("divisa"));return{total_banco:v.reduce((j,_)=>j+Number(_.monto_usd),0),total_efectivo:y.reduce((j,_)=>j+Number(_.monto_usd),0),count_banco:v.length,count_efectivo:y.length}},[t,u]);return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-indigo-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-indigo-600 w-fit px-5 py-2 rounded-full border border-indigo-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(br,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Auditoría de Recaudación Digital"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Monitor de ",n.jsx("br",{}),n.jsx("span",{className:"text-indigo-500 italic",children:"Vouchers"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Visualización detallada de todos los abonos certificados por la administración."'})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 w-full lg:w-auto",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] shadow-xl flex flex-col items-center text-slate-900 min-w-[200px]",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Recaudado Banco"}),n.jsxs("h4",{className:"text-3xl font-black text-blue-600 tracking-tighter",children:["$ ",m.total_banco.toFixed(2)]}),n.jsxs("span",{className:"text-[9px] font-bold text-slate-300 mt-2",children:[m.count_banco," Ops"]})]}),n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] shadow-xl flex flex-col items-center text-slate-900 min-w-[200px]",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Recaudado Cash"}),n.jsxs("h4",{className:"text-3xl font-black text-emerald-600 tracking-tighter",children:["$ ",m.total_efectivo.toFixed(2)]}),n.jsxs("span",{className:"text-[9px] font-bold text-slate-300 mt-2",children:[m.count_efectivo," Ops"]})]})]})]}),n.jsx(da,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex p-1.5 bg-slate-100 rounded-3xl w-full lg:w-auto",children:[n.jsx("button",{onClick:()=>l("banco"),className:`flex-1 lg:flex-none px-8 py-3.5 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all ${i==="banco"?"bg-white text-blue-600 shadow-lg":"text-slate-400 hover:text-slate-600"}`,children:"Depósitos / Transf"}),n.jsx("button",{onClick:()=>l("efectivo"),className:`flex-1 lg:flex-none px-8 py-3.5 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all ${i==="efectivo"?"bg-white text-emerald-600 shadow-lg":"text-slate-400 hover:text-slate-600"}`,children:"Caja Física (USD)"})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-4 w-full lg:w-auto justify-center",children:[n.jsxs("div",{className:"flex gap-2 bg-slate-50 p-2 rounded-2xl border",children:[n.jsx("select",{className:"bg-transparent border-none text-[10px] font-black uppercase text-slate-500 outline-none px-4",value:u.month,onChange:b=>f({...u,month:parseInt(b.target.value)}),children:Te.map((b,v)=>n.jsx("option",{value:v,children:b},v))}),n.jsx("input",{type:"number",className:"bg-transparent border-none text-[10px] font-black text-blue-600 outline-none w-16 text-center",value:u.year,onChange:b=>f({...u,year:parseInt(b.target.value)})})]}),n.jsxs("div",{className:"relative flex-1 lg:w-64",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:16}),n.jsx("input",{type:"text",placeholder:"Buscar voucher...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-3 text-xs font-bold focus:ring-2 focus:ring-indigo-600 outline-none",value:o,onChange:b=>d(b.target.value)})]}),n.jsx("button",{onClick:p,className:"p-3.5 bg-slate-50 rounded-2xl text-slate-400 hover:text-indigo-600 transition-all border border-slate-200",children:n.jsx(ct,{size:20,className:a?"animate-spin":""})})]})]}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha Operación"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Unidad / Inmueble"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Propietario / Titular"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia / Seriales"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto $"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Método"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:a?n.jsx("tr",{children:n.jsx("td",{colSpan:6,className:"py-32 text-center",children:n.jsx(ct,{className:"animate-spin text-blue-600 mx-auto",size:40})})}):h.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:6,className:"py-32 text-center",children:[n.jsx(Da,{size:48,className:"mx-auto mb-4 text-slate-100"}),n.jsx("p",{className:"text-slate-300 font-black uppercase tracking-widest text-xs italic",children:"No hay rastro contable para este periodo o criterio"})]})}):h.map((b,v)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6",children:n.jsx("span",{className:"font-black text-slate-400 text-xs",children:b.fecha})}),n.jsx("td",{className:"px-10 py-6",children:n.jsx("span",{className:"font-black text-slate-900 text-lg uppercase",children:b.prop_code})}),n.jsxs("td",{className:"px-10 py-6",children:[n.jsx("p",{className:"font-black text-slate-700 text-xs uppercase truncate max-w-[180px]",children:b.owner_name}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest mt-1",children:["Vía: ",b.is_historical?"Abono Histórico":"Cuota Mes"]})]}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"px-4 py-1.5 bg-slate-100 rounded-xl text-[11px] font-mono font-black text-indigo-600 border border-slate-200",children:["#",b.referencia]})}),n.jsxs("td",{className:"px-10 py-6 text-right",children:[n.jsxs("span",{className:`text-xl font-black tracking-tighter ${i==="efectivo"?"text-emerald-600":"text-blue-600"}`,children:["$ ",Number(b.monto_usd).toFixed(2)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-300 uppercase mt-0.5",children:["Bs. ",Number(b.monto_bs).toLocaleString("es-VE")]})]}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsx("span",{className:`px-4 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest border ${i==="efectivo"?"bg-emerald-50 text-emerald-600 border-emerald-100":"bg-blue-50 text-blue-600 border-blue-100"}`,children:b.metodo})})]},v))})]})}),n.jsxs("div",{className:"p-10 bg-slate-50 border-t border-slate-100 flex flex-col md:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"p-3 bg-white rounded-2xl shadow-sm border border-slate-200",children:n.jsx(Ia,{className:"text-emerald-500",size:24})}),n.jsxs("div",{children:[n.jsxs("p",{className:"text-[11px] font-black text-slate-900 uppercase tracking-widest",children:["Protocolo de Integridad ",Ln]}),n.jsx("p",{className:"text-[9px] text-slate-400 font-bold uppercase",children:"Datos verificados contra Libro Diario y Caja Física"})]})]}),n.jsxs("div",{className:"flex gap-4",children:[n.jsxs("button",{onClick:()=>{const b=["Fecha","Unidad","Propietario","Referencia","Monto $","Método"],v=h.map(y=>[y.fecha,y.prop_code,y.owner_name,y.referencia,`$ ${Number(y.monto_usd).toFixed(2)}`,y.metodo]);$c(`Recaudación Digital - ${Te[u.month]} ${u.year}`,b,v)},className:"px-8 py-3 bg-indigo-600 text-white hover:bg-indigo-700 transition-all border border-indigo-500 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2",children:[n.jsx(yr,{size:16})," Exportar HTML"]}),n.jsxs("button",{onClick:()=>window.print(),className:"px-8 py-3 bg-white hover:bg-slate-900 hover:text-white transition-all border border-slate-200 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2",children:[n.jsx(wt,{size:16})," Imprimir Reporte"]})]})]})]})]})},GIe=({user:e})=>{const{exchangeRateHistory:t,refreshData:r}=ht(),[a,s]=k.useState([]),[i,l]=k.useState(!0),[o,d]=k.useState(""),[u,f]=k.useState({month:new Date().getMonth(),year:new Date().getFullYear()}),[p,h]=k.useState(null),[m,b]=k.useState(!1),v=async()=>{l(!0);try{const E=await(await fetch(`${Ne}/get_bill_payments_history.php`,{credentials:"include"})).json();E.success&&s(E.data||[])}catch(N){console.error("Fetch Bill Payments Error",N)}finally{l(!1)}};k.useEffect(()=>{v()},[]);const y=k.useMemo(()=>a.filter(N=>{const E=o.toLowerCase(),T=!o||N.provider.toLowerCase().includes(E)||N.reference.toLowerCase().includes(E)||N.bill_desc.toLowerCase().includes(E),[B,F]=N.payment_date.split("-").map(Number),R=B===u.year&&F-1===u.month;return T&&R}),[a,o,u]),j=async N=>{N.preventDefault(),b(!0);try{const T=await(await fetch(`${Ne}/update_bill_payment.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)})).json();T.success?(alert("¡Pago actualizado y sincronizado en Banco y Balance!"),h(null),v(),r()):alert("Error: "+T.error)}catch{alert("Error de conexión con el Kernel.")}finally{b(!1)}},_=async N=>{if(confirm(`¿ANULAR ABONO? Esta acción eliminará el rastro en el Libro Diario de Banco y devolverá la deuda a la factura de ${N.provider}. ¿Proceder?`)){b(!0);try{const T=await(await fetch(`${Ne}/delete_bill_payment.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:N.id,bill_id:N.bill_id})})).json();T.success?(alert("¡Abono revertido con éxito!"),v(),r()):alert("Error: "+T.error)}catch{alert("Error de red al intentar anular egreso.")}finally{b(!1)}}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-rose-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-rose-600 w-fit px-5 py-2 rounded-full border border-rose-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(ca,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Auditoría Maestra de Egresos"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Historial ",n.jsx("br",{}),n.jsx("span",{className:"text-rose-500 italic",children:"de Abonos"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Visualización, corrección y anulación de pagos realizados a proveedores. Trazabilidad Kernel V4.0.91."'})]}),n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] shadow-xl flex flex-col items-center text-slate-900 min-w-[340px]",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Pagado en el Periodo"}),n.jsxs("h4",{className:"text-4xl font-black text-rose-600 tracking-tighter",children:["$ ",y.reduce((N,E)=>N+Number(E.amount_usd),0).toFixed(2)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-300 mt-2",children:["Bs. ",y.reduce((N,E)=>N+Number(E.amount_bs),0).toLocaleString("es-VE")]}),n.jsx("div",{className:"w-full h-px bg-slate-100 my-6"}),n.jsxs("button",{onClick:v,className:"w-full bg-slate-900 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-black transition-all flex items-center justify-center gap-2 active:scale-95",children:[n.jsx(ct,{size:16,className:i?"animate-spin":""})," Sincronizar Auditoría"]})]})]}),n.jsx(ca,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex gap-2 bg-slate-50 p-2 rounded-2xl border",children:[n.jsx("select",{className:"bg-transparent border-none text-[10px] font-black uppercase text-slate-500 outline-none px-4",value:u.month,onChange:N=>f({...u,month:parseInt(N.target.value)}),children:Te.map((N,E)=>n.jsx("option",{value:E,children:N},E))}),n.jsx("input",{type:"number",className:"bg-transparent border-none text-[10px] font-black text-blue-600 outline-none w-16 text-center",value:u.year,onChange:N=>f({...u,year:parseInt(N.target.value)})})]}),n.jsxs("div",{className:"relative flex-1 w-full max-w-md",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por proveedor o referencia...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-rose-600",value:o,onChange:N=>d(N.target.value)})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>{const N=["Fecha","Proveedor","Concepto","Referencia","Monto USD","Monto VES"],E=y.map(T=>[T.payment_date,T.provider,T.bill_desc,T.reference,`$${Number(T.amount_usd).toFixed(2)}`,`Bs. ${Number(T.amount_bs).toLocaleString("es-VE",{minimumFractionDigits:2})}`]);$c("Auditoría de Egresos",N,E)},className:"p-4 bg-slate-100 text-slate-400 hover:text-indigo-600 rounded-2xl transition-all shadow-sm",title:"Exportar a HTML",children:n.jsx(yr,{size:20})}),n.jsx("button",{onClick:()=>window.print(),className:"p-4 bg-slate-100 text-slate-400 hover:text-indigo-600 rounded-2xl transition-all shadow-sm",children:n.jsx(wt,{size:20})})]})]}),n.jsx("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha Pago"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Proveedor / Concepto"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia / Vía"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Importe Abono"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:i?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"py-24 text-center",children:n.jsx(ct,{className:"animate-spin text-rose-600 mx-auto",size:40})})}):y.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:5,className:"py-32 text-center",children:[n.jsx(Da,{size:48,className:"mx-auto mb-4 text-slate-100"}),n.jsx("p",{className:"text-slate-300 font-black uppercase tracking-widest text-xs italic",children:"No hay rastro de abonos en este periodo"})]})}):y.map((N,E)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6",children:n.jsx("span",{className:"font-black text-slate-400 text-xs",children:N.payment_date})}),n.jsx("td",{className:"px-10 py-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-50 text-slate-400 rounded-xl flex items-center justify-center group-hover:bg-rose-50 group-hover:text-rose-600 transition-all",children:n.jsx(pb,{size:20})}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-900 text-[13px] uppercase leading-none",children:N.provider}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase mt-1 truncate max-w-[200px]",children:N.bill_desc})]})]})}),n.jsxs("td",{className:"px-10 py-6 text-center",children:[n.jsxs("span",{className:"px-4 py-1.5 bg-slate-100 rounded-xl text-[11px] font-mono font-black text-rose-600 border border-slate-200",children:["#",N.reference]}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase mt-1",children:N.source})]}),n.jsxs("td",{className:"px-10 py-6 text-right",children:[n.jsxs("span",{className:"text-xl font-black tracking-tighter text-slate-900",children:["$ ",Number(N.amount_usd).toFixed(2)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-300 uppercase mt-0.5",children:["Bs. ",Number(N.amount_bs).toLocaleString("es-VE")]})]}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[n.jsx("button",{onClick:()=>h(N),className:"p-3 bg-slate-50 text-slate-400 hover:bg-rose-600 hover:text-white rounded-xl shadow-sm transition-all",title:"Editar",children:n.jsx(yl,{size:18})}),n.jsx("button",{disabled:m,onClick:()=>_(N),className:"p-3 bg-slate-50 text-slate-400 hover:bg-red-600 hover:text-white rounded-xl shadow-sm transition-all disabled:opacity-30",title:"Eliminar / Revertir",children:m?n.jsx(ct,{size:18,className:"animate-spin"}):n.jsx(Ua,{size:18})})]})})]},E))})]})})}),p&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300 relative",children:[n.jsx("button",{onClick:()=>h(null),className:"absolute top-8 right-8 p-3 bg-slate-100 rounded-full text-slate-400 hover:bg-red-50 hover:text-white transition-all",children:n.jsx(mt,{size:24})}),n.jsxs("div",{className:"mb-10",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Editar Abono"}),n.jsxs("p",{className:"text-[10px] font-black text-rose-600 uppercase tracking-widest mt-1",children:["Proveedor: ",p.provider]})]}),n.jsxs("form",{onSubmit:j,className:"space-y-6",children:[n.jsxs("div",{className:"bg-slate-50 p-6 rounded-[2rem] border border-slate-200 shadow-inner",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 block mb-4 ml-1",children:"Importe del Pago (Bolívares)"}),n.jsxs("div",{className:"flex items-center gap-3 bg-white border border-slate-200 p-5 rounded-2xl",children:[n.jsx("span",{className:"font-black text-slate-300 text-2xl",children:"Bs."}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full text-3xl font-black text-slate-900 outline-none",value:p.amount_bs,onChange:N=>h({...p,amount_bs:parseFloat(N.target.value)})})]}),n.jsxs("div",{className:"mt-6 flex justify-between items-center bg-slate-800 text-white p-4 rounded-xl shadow-lg",children:[n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Ajuste USD Proyectado:"}),n.jsxs("span",{className:"text-xl font-black",children:["$",(p.amount_bs/45).toFixed(2)]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 ml-1 mb-1 block",children:"Referencia"}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 text-sm",value:p.reference,onChange:N=>h({...p,reference:N.target.value})})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 ml-1 mb-1 block",children:"Fecha de Pago"}),n.jsx("input",{required:!0,type:"date",className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-black text-slate-900 text-sm",value:p.payment_date,onChange:N=>h({...p,payment_date:N.target.value})})]})]}),n.jsxs("div",{className:"p-4 bg-amber-50 border border-amber-100 rounded-2xl flex items-start gap-4",children:[n.jsx(Sr,{className:"text-amber-600 shrink-0 mt-0.5",size:18}),n.jsx("p",{className:"text-[10px] text-amber-800 font-bold uppercase leading-relaxed tracking-tight",children:"Esta edición actualizará el Libro de Banco y el balance de la factura automáticamente."})]}),n.jsxs("button",{disabled:m,type:"submit",className:"w-full bg-rose-600 hover:bg-rose-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-widest shadow-xl flex items-center justify-center gap-3 transition-all active:scale-95",children:[m?n.jsx(ct,{className:"animate-spin"}):n.jsx(Zn,{size:24})," GUARDAR CAMBIOS"]})]})]})})]})},KIe=({user:e})=>{const[t,r]=k.useState(!1),[a,s]=k.useState({start:"",end:""}),[i,l]=k.useState([]),[o,d]=k.useState(!1),[u,f]=k.useState({type:null,message:""}),[p,h]=k.useState([]);Ip.useEffect(()=>{i.includes("fondo-reserva")&&we.getReserveFundHistory(a.start,a.end).then(y=>h(y.history)).catch(y=>console.error("Error fetching reserve history",y))},[i,a]);const m=[{id:"banco",label:"Libro de Banco / Movimientos",icon:br,description:"Todos los movimientos bancarios registrados."},{id:"balance",label:"Balance General",icon:vi,description:"Estado actual de cuentas y fondos."},{id:"recaudacion",label:"Recaudación Digital",icon:Ic,description:"Detalle de cobros y pagos de propietarios."},{id:"egresos",label:"Auditoría de Egresos",icon:ca,description:"Pagos realizados a proveedores y gastos."},{id:"convenios",label:"Convenios de Pago Activos",icon:eu,description:"Estatus de convenios vigentes."},{id:"historico-convenios",label:"Histórico de Convenios",icon:Da,description:"Registro de convenios finalizados."},{id:"comisiones",label:"Cálculo de Comisiones",icon:bs,description:"Reporte de comisiones por gestión."},{id:"cobro-propietario",label:"Control Cobro Propietario",icon:Qi,description:"Detalle de pagos por cada propietario."},{id:"auditoria",label:"Informes y Auditoría",icon:xo,description:"Resumen ejecutivo para auditoría."},{id:"fondo-reserva",label:"Fondo de Reserva (Histórico)",icon:da,description:"Resumen de acumulación mensual del fondo."},{id:"efectivo-recibido",label:"Efectivo Recibido (Oficina)",icon:kn,description:"Control de ingresos en efectivo."},{id:"efectivo-pagado",label:"Efectivo Pagado (Proveedores)",icon:kn,description:"Control de egresos en efectivo."}],b=y=>{l(j=>j.includes(y)?j.filter(_=>_!==y):[...j,y])},v=async()=>{if(i.length===0){f({type:"error",message:"Seleccione al menos un reporte para generar."});return}r(!0),f({type:null,message:""});try{const y=mi.book_new();for(const j of i){let _=[],N="";switch(j){case"banco":_=(await we.getBankTransactions()).map(K=>({Fecha:K.date,Descripción:K.description,Tipo:K.type,Categoría:K.category,Referencia:K.reference||"","Monto ($)":K.amount,"Monto (Bs)":K.amountBs||0})),N="Banco";break;case"balance":const T=await we.getFinancialTotals();_=[{Concepto:"Saldo Caja (Bs)",Valor:T.cashBalanceBs},{Concepto:"Cuentas por Pagar (USD)",Valor:T.accountsPayableUsd},{Concepto:"Cuentas por Cobrar (USD)",Valor:T.receivablesUsd},{Concepto:"Total Facturado (USD)",Valor:T.totalBilledUsd},{Concepto:"Total Recaudado (USD)",Valor:T.totalCollectedUsd},{Concepto:"Fondo de Reserva (USD)",Valor:T.reserveFundUsd},{Concepto:"Fondo de Reserva (Bs)",Valor:T.reserveFundBs},{Concepto:"Fondo en Divisa (USD)",Valor:T.initialCashUsd||0}],N="Balance General";break;case"recaudacion":_=(await we.getFees()).flatMap(K=>K.debts.flatMap(ee=>ee.payments.map(W=>({Mes:`${K.month}/${K.year}`,Propiedad:ee.propertyId,Fecha:W.date,Referencia:W.reference,Método:W.method,"Monto ($)":W.amount,Turno:W.slot||""})))),N="Recaudación";break;case"egresos":_=(await we.getPendingBills()).map(K=>({Fecha:K.creationDate,Proveedor:K.provider,Descripción:K.description,"Monto ($)":K.amount,"Monto (Bs)":K.amountBs,Estatus:K.status,"Fecha Pago":K.paidDate||"","Fuente Pago":K.paymentSource||"",Referencia:K.paymentReference||""})),N="Auditoría Egresos";break;case"convenios":_=(await we.getInitialDebtData()).map(K=>({Propiedad:K.code,Propietario:K.ownerName,"Deuda Original ($)":K.original_debt,"Total Pagado ($)":K.total_paid,"Deuda Pendiente ($)":K.current_debt,"Cant. Pagos":K.history?K.history.length:0})),N="Convenios Activos";break;case"historico-convenios":_=(await we.getArchivedAgreements()).map(K=>({Propiedad:K.code,Propietario:K.owner_name,"Monto Original ($)":K.original_amount,"Fecha Finalización":K.completion_date,Estatus:"Finalizado"})),N="Histórico Convenios";break;case"efectivo-recibido":_=(await we.getFees()).flatMap(K=>K.debts.flatMap(ee=>ee.payments.filter(W=>W.method.toLowerCase().includes("efectivo")).map(W=>({Fecha:W.date,Propiedad:ee.propertyId,Referencia:W.reference,"Monto ($)":W.amount,Concepto:`Pago Cuota ${K.month}/${K.year}`})))),N="Efectivo Recibido";break;case"efectivo-pagado":_=(await we.getPendingBills()).filter(K=>K.paymentSource==="Efectivo").map(K=>({Fecha:K.paidDate||K.creationDate,Proveedor:K.provider,Descripción:K.description,"Monto ($)":K.amount,Referencia:K.paymentReference||""})),N="Efectivo Pagado";break;case"comisiones":_=(await we.getBankTransactions()).filter(K=>K.category==="Comisiones"&&K.type==="Egreso").map(K=>({Fecha:K.date,Descripción:K.description,Referencia:K.reference||"","Monto ($)":K.amount,"Monto (Bs)":K.amountBs||0})),N="Comisiones";break;case"cobro-propietario":const G=await we.getProperties();_=(await we.getFees()).flatMap(K=>K.debts.flatMap(ee=>{const W=G.find(Y=>Y.id===ee.propertyId);return ee.payments.map(Y=>({Mes:`${K.month}/${K.year}`,Propiedad:W?W.code:ee.propertyId,Propietario:W?W.number:"",Fecha:Y.date,Referencia:Y.reference,Método:Y.method,"Monto ($)":Y.amount}))})),N="Cobro Propietario";break;case"auditoria":_=(await we.getAuditLogs()).logs.map(K=>({Fecha:K.created_at,Usuario:K.username,Rol:K.user_role,Acción:K.action,Módulo:K.module,IP:K.ip_address})),N="Auditoría Sistema";break;case"fondo-reserva":_=(await we.getReserveFundHistory(a.start,a.end)).history.map(K=>({Periodo:K.period,"Aporte Mensual (Bs)":K.monthly_bs,"Aporte Mensual ($)":K.monthly_usd,"Acumulado (Bs)":K.accumulated_bs,"Acumulado ($)":K.accumulated_usd})),N="Fondo de Reserva";break}if(_.length>0){a.start&&a.end&&(_=_.filter(T=>{const B=T.Fecha||T["Fecha Pago"]||T["Fecha Inicio"];return B?B>=a.start&&B<=a.end:!0}));const E=mi.json_to_sheet(_);mi.book_append_sheet(y,E,N)}}if(y.SheetNames.length===0)f({type:"error",message:"No se encontraron datos para los criterios seleccionados."});else if(o){for(const j of y.SheetNames){const _=y.Sheets[j],N=mi.sheet_to_csv(_),E=new Blob([N],{type:"text/csv;charset=utf-8;"}),T=URL.createObjectURL(E),B=document.createElement("a");B.href=T,B.setAttribute("download",`Reporte_${j.replace(/\s+/g,"_")}_${new Date().toISOString().split("T")[0]}.csv`),document.body.appendChild(B),B.click(),document.body.removeChild(B)}f({type:"success",message:"Archivos CSV generados exitosamente."})}else LE(y,`Reporte_SAC_2026_${new Date().toISOString().split("T")[0]}.xlsx`),f({type:"success",message:"Reporte generado exitosamente."})}catch(y){console.error("Excel Generation Error",y),f({type:"error",message:`Error al generar Excel: ${y.message}`})}finally{r(!1)}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-4xl font-black text-slate-900 tracking-tighter flex items-center gap-3",children:[n.jsx(gl,{className:"text-blue-600",size:40}),"Informes en ",n.jsx("span",{className:"text-blue-600 italic",children:"Excel"})]}),n.jsx("p",{className:"text-slate-500 font-medium mt-1",children:"Generación de reportes detallados para auditoría y gestión."})]}),n.jsxs("div",{className:"flex items-center gap-3 bg-white p-2 rounded-2xl shadow-sm border border-slate-100",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-slate-50 rounded-xl border border-slate-200",children:[n.jsx(Wr,{size:16,className:"text-slate-400"}),n.jsx("input",{type:"date",className:"bg-transparent text-xs font-bold outline-none text-slate-700",value:a.start,onChange:y=>s(j=>({...j,start:y.target.value}))})]}),n.jsx("span",{className:"text-slate-300 font-bold",children:"al"}),n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-slate-50 rounded-xl border border-slate-200",children:[n.jsx(Wr,{size:16,className:"text-slate-400"}),n.jsx("input",{type:"date",className:"bg-transparent text-xs font-bold outline-none text-slate-700",value:a.end,onChange:y=>s(j=>({...j,end:y.target.value}))})]})]})]}),u.type&&n.jsxs("div",{className:`p-4 rounded-2xl flex items-center gap-3 animate-in slide-in-from-top duration-300 ${u.type==="success"?"bg-emerald-50 text-emerald-600 border border-emerald-100":"bg-red-50 text-red-600 border border-red-100"}`,children:[u.type==="success"?n.jsx(Gt,{size:20}):n.jsx(Sr,{size:20}),n.jsx("p",{className:"text-xs font-black uppercase tracking-widest",children:u.message})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:m.map(y=>{const j=i.includes(y.id),_=y.icon;return n.jsxs("button",{onClick:()=>b(y.id),className:`flex flex-col p-6 rounded-[2.5rem] border-2 transition-all text-left relative overflow-hidden group ${j?"bg-blue-600 border-blue-600 shadow-xl shadow-blue-200":"bg-white border-slate-100 hover:border-blue-200 hover:shadow-lg"}`,children:[n.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center mb-4 transition-colors ${j?"bg-white/20 text-white":"bg-blue-50 text-blue-600"}`,children:n.jsx(_,{size:24})}),n.jsx("h3",{className:`font-black text-sm uppercase tracking-widest mb-2 ${j?"text-white":"text-slate-900"}`,children:y.label}),n.jsx("p",{className:`text-[10px] font-medium leading-relaxed ${j?"text-blue-100":"text-slate-500"}`,children:y.description}),j&&n.jsx("div",{className:"absolute top-4 right-4",children:n.jsx(Gt,{className:"text-white",size:20})}),n.jsx("div",{className:`absolute -right-4 -bottom-4 opacity-10 transition-transform group-hover:scale-110 ${j?"text-white":"text-blue-600"}`,children:n.jsx(_,{size:80})})]},y.id)})}),i.includes("fondo-reserva")&&n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] border border-slate-100 shadow-xl animate-in zoom-in duration-500",children:[n.jsxs("div",{className:"flex items-center justify-between mb-8",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black text-slate-900 tracking-tighter uppercase",children:"Crecimiento del Fondo de Reserva"}),n.jsx("p",{className:"text-slate-500 text-xs font-bold uppercase tracking-widest mt-1",children:"Proyección y Acumulación Histórica (Bs)"})]}),n.jsx("div",{className:"bg-blue-50 text-blue-600 px-4 py-2 rounded-xl text-[10px] font-black uppercase tracking-widest border border-blue-100",children:"Vista Previa del Reporte"})]}),n.jsx("div",{className:"h-[300px] w-full",children:n.jsx(_k,{width:"100%",height:"100%",children:n.jsxs(Vj,{data:p,children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:"colorAcc",x1:"0",y1:"0",x2:"0",y2:"1",children:[n.jsx("stop",{offset:"5%",stopColor:"#2563eb",stopOpacity:.3}),n.jsx("stop",{offset:"95%",stopColor:"#2563eb",stopOpacity:0})]})}),n.jsx(ev,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),n.jsx(tv,{dataKey:"period",hide:!0}),n.jsx(rv,{hide:!0}),n.jsx(Fj,{contentStyle:{borderRadius:"1rem",border:"none",boxShadow:"0 10px 15px -3px rgb(0 0 0 / 0.1)",fontSize:"10px",fontWeight:"bold"}}),n.jsx(FA,{type:"monotone",dataKey:"accumulated_bs",stroke:"#2563eb",strokeWidth:4,fillOpacity:1,fill:"url(#colorAcc)"})]})})}),n.jsxs("div",{className:"mt-6 p-4 bg-slate-50 rounded-2xl border border-slate-100 flex items-center gap-3",children:[n.jsx(Sr,{size:16,className:"text-blue-600"}),n.jsx("p",{className:"text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"La gráfica anterior es una representación visual. El archivo Excel contendrá la tabla de datos completa para su análisis detallado."})]})]}),n.jsxs("div",{className:"flex flex-col items-center gap-6 pt-8",children:[n.jsxs("label",{className:"flex items-center gap-3 cursor-pointer group bg-white px-6 py-3 rounded-2xl border border-slate-100 shadow-sm hover:border-blue-200 transition-all",children:[n.jsx("div",{className:`w-5 h-5 rounded-lg border-2 flex items-center justify-center transition-all ${o?"bg-blue-600 border-blue-600":"bg-slate-50 border-slate-200 group-hover:border-blue-400"}`,children:o&&n.jsx(Gt,{size:12,className:"text-white"})}),n.jsx("input",{type:"checkbox",className:"hidden",checked:o,onChange:y=>d(y.target.checked)}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest text-slate-500 group-hover:text-blue-600 transition-colors",children:"Exportar como archivos CSV"})]}),n.jsx("button",{onClick:v,disabled:t||i.length===0,className:"bg-slate-900 hover:bg-slate-800 text-white px-12 py-5 rounded-[2rem] font-black text-xs uppercase tracking-[0.3em] shadow-2xl shadow-slate-200 transition-all active:scale-95 flex items-center gap-4 disabled:opacity-50 disabled:cursor-not-allowed",children:t?n.jsxs(n.Fragment,{children:[n.jsx(qi,{className:"animate-spin",size:20}),"Procesando Datos..."]}):n.jsxs(n.Fragment,{children:[n.jsx(Gs,{size:20}),o?"Generar Reportes CSV":"Generar Reporte Excel"]})})]}),n.jsx("div",{className:"bg-blue-50 border border-blue-100 p-8 rounded-[3rem] mt-12",children:n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-blue-600 text-white rounded-xl flex items-center justify-center shrink-0",children:n.jsx(jo,{size:20})}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-blue-900 font-black text-sm uppercase tracking-widest mb-2",children:"Nota de Auditoría"}),n.jsx("p",{className:"text-blue-700 text-xs font-medium leading-relaxed",children:"Los archivos generados contienen la data oficial asentada en el sistema hasta el momento de la descarga. Puede seleccionar múltiples reportes para generar un único archivo Excel con varias hojas de cálculo, facilitando la visualización integral de la gestión del condominio."})]})]})})]})},qIe=({user:e})=>{const[t,r]=k.useState(!1),[a,s]=k.useState("receivable"),[i,l]=k.useState(new Date().getMonth()+1),[o,d]=k.useState(new Date().getFullYear()),[u,f]=k.useState(!1),[p,h]=k.useState({type:null,message:""}),m=[{value:1,label:"Enero"},{value:2,label:"Febrero"},{value:3,label:"Marzo"},{value:4,label:"Abril"},{value:5,label:"Mayo"},{value:6,label:"Junio"},{value:7,label:"Julio"},{value:8,label:"Agosto"},{value:9,label:"Septiembre"},{value:10,label:"Octubre"},{value:11,label:"Noviembre"},{value:12,label:"Diciembre"}],b=Array.from({length:5},(y,j)=>new Date().getFullYear()-j),v=async()=>{r(!0),h({type:null,message:""});try{const y=await we.getDetailedExcelReport(i,o,a);if(y.length===0){h({type:"error",message:"No se encontraron registros para el periodo seleccionado."}),r(!1);return}const j=mi.book_new(),_=mi.json_to_sheet(y),N=a==="receivable"?"Cuentas por Cobrar":"Cuentas por Pagar";mi.book_append_sheet(j,_,N);const E=`Reporte_Detallado_${N.replace(/\s+/g,"_")}_${i}_${o}`;if(u){const T=mi.sheet_to_csv(_),B=new Blob([T],{type:"text/csv;charset=utf-8;"}),F=URL.createObjectURL(B),R=document.createElement("a");R.href=F,R.setAttribute("download",`${E}.csv`),document.body.appendChild(R),R.click(),document.body.removeChild(R),h({type:"success",message:"Archivo CSV generado exitosamente."})}else LE(j,`${E}.xlsx`),h({type:"success",message:"Reporte Excel generado exitosamente."})}catch(y){console.error("Detailed Report Error",y),h({type:"error",message:`Error al generar reporte: ${y.message}`})}finally{r(!1)}};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500",children:[n.jsx("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:n.jsxs("div",{children:[n.jsxs("h1",{className:"text-4xl font-black text-slate-900 tracking-tighter flex items-center gap-3",children:[n.jsx(gl,{className:"text-indigo-600",size:40}),"Informes ",n.jsx("span",{className:"text-indigo-600 italic",children:"Detallados"})," Excel"]}),n.jsx("p",{className:"text-slate-500 font-medium mt-1",children:"Detalle completo de transacciones, liquidaciones y estatus por periodo."})]})}),p.type&&n.jsxs("div",{className:`p-4 rounded-2xl flex items-center gap-3 animate-in slide-in-from-top duration-300 ${p.type==="success"?"bg-emerald-50 text-emerald-600 border border-emerald-100":"bg-red-50 text-red-600 border border-red-100"}`,children:[p.type==="success"?n.jsx(Gt,{size:20}):n.jsx(Sr,{size:20}),n.jsx("p",{className:"text-xs font-black uppercase tracking-widest",children:p.message})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[n.jsx("div",{className:"lg:col-span-1 space-y-6",children:n.jsxs("div",{className:"bg-white p-8 rounded-[2.5rem] border border-slate-100 shadow-xl",children:[n.jsxs("h3",{className:"text-sm font-black text-slate-900 uppercase tracking-widest mb-6 flex items-center gap-2",children:[n.jsx(ok,{size:16,className:"text-indigo-600"}),"Parámetros del Reporte"]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Tipo de Información"}),n.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[n.jsxs("button",{onClick:()=>s("receivable"),className:`px-4 py-3 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all flex items-center justify-center gap-2 ${a==="receivable"?"bg-indigo-600 text-white shadow-lg shadow-indigo-200":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:[n.jsx(br,{size:14}),"CxC (Ingresos)"]}),n.jsxs("button",{onClick:()=>s("payable"),className:`px-4 py-3 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all flex items-center justify-center gap-2 ${a==="payable"?"bg-indigo-600 text-white shadow-lg shadow-indigo-200":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:[n.jsx(ca,{size:14}),"CxP (Egresos)"]})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Mes"}),n.jsx("select",{value:i,onChange:y=>l(parseInt(y.target.value)),className:"w-full bg-slate-50 border border-slate-200 rounded-xl px-4 py-3 text-xs font-bold text-slate-700 outline-none focus:ring-2 focus:ring-indigo-500",children:m.map(y=>n.jsx("option",{value:y.value,children:y.label},y.value))})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("label",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-1",children:"Año"}),n.jsx("select",{value:o,onChange:y=>d(parseInt(y.target.value)),className:"w-full bg-slate-50 border border-slate-200 rounded-xl px-4 py-3 text-xs font-bold text-slate-700 outline-none focus:ring-2 focus:ring-indigo-500",children:b.map(y=>n.jsx("option",{value:y,children:y},y))})]})]}),n.jsx("div",{className:"pt-4 border-t border-slate-100",children:n.jsxs("label",{className:"flex items-center gap-3 cursor-pointer group",children:[n.jsx("div",{className:`w-5 h-5 rounded-lg border-2 flex items-center justify-center transition-all ${u?"bg-indigo-600 border-indigo-600":"bg-slate-50 border-slate-200 group-hover:border-indigo-400"}`,children:u&&n.jsx(Gt,{size:12,className:"text-white"})}),n.jsx("input",{type:"checkbox",className:"hidden",checked:u,onChange:y=>f(y.target.checked)}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest text-slate-500 group-hover:text-indigo-600 transition-colors",children:"Exportar como CSV"})]})}),n.jsxs("button",{onClick:v,disabled:t,className:"w-full bg-slate-900 hover:bg-slate-800 text-white py-4 rounded-2xl font-black text-[10px] uppercase tracking-[0.2em] shadow-xl transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:[t?n.jsx(qi,{className:"animate-spin",size:16}):n.jsx(Gs,{size:16}),t?"Procesando...":"Generar Informe"]})]})]})}),n.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[n.jsxs("div",{className:"bg-indigo-600 p-10 rounded-[3rem] text-white relative overflow-hidden shadow-2xl",children:[n.jsxs("div",{className:"relative z-10",children:[n.jsxs("h2",{className:"text-3xl font-black tracking-tighter leading-tight mb-4",children:["Reporte de ",n.jsx("br",{}),n.jsx("span",{className:"text-indigo-200 italic",children:"Trazabilidad Total"})]}),n.jsx("p",{className:"text-indigo-100 font-medium text-sm leading-relaxed max-w-md",children:"Este informe extrae cada registro de pago asociado a las deudas o facturas del periodo seleccionado, permitiendo ver la conciliación exacta entre lo facturado y lo liquidado."}),n.jsxs("div",{className:"mt-8 grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-white/10 backdrop-blur-md border border-white/20 p-4 rounded-2xl",children:[n.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-indigo-200 mb-1",children:"Detalle Incluido"}),n.jsx("p",{className:"text-xs font-bold",children:"Referencias, Tasas, Fechas y Métodos de Pago."})]}),n.jsxs("div",{className:"bg-white/10 backdrop-blur-md border border-white/20 p-4 rounded-2xl",children:[n.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest text-indigo-200 mb-1",children:"Compatibilidad"}),n.jsx("p",{className:"text-xs font-bold",children:"Formato Excel (XLSX) y CSV para sistemas contables."})]})]})]}),n.jsx(er,{size:200,className:"absolute right-[-40px] top-[-40px] text-white/10 pointer-events-none"})]}),n.jsx("div",{className:"bg-white p-8 rounded-[2.5rem] border border-slate-100 shadow-sm",children:n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-amber-50 text-amber-600 rounded-xl flex items-center justify-center shrink-0",children:n.jsx(Sr,{size:24})}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-slate-900 font-black text-sm uppercase tracking-widest mb-2",children:"Instrucciones de Uso"}),n.jsxs("ul",{className:"text-slate-500 text-xs font-medium space-y-2 list-disc ml-4",children:[n.jsxs("li",{children:["Seleccione el tipo de reporte: ",n.jsx("b",{children:"CxC"})," para ingresos de propietarios o ",n.jsx("b",{children:"CxP"})," para egresos a proveedores."]}),n.jsx("li",{children:"Elija el mes y año que desea auditar."}),n.jsx("li",{children:"El sistema buscará todas las liquidaciones (pagos) registradas en ese periodo específico."}),n.jsxs("li",{children:["Si una deuda no tiene pagos, aparecerá como ",n.jsx("b",{children:"PENDIENTE"})," con sus montos originales."]})]})]})]})})]})]})]})},WIe=({user:e})=>{const[t,r]=k.useState(!1),[a,s]=k.useState({start:"",end:""}),[i,l]=k.useState(null),[o,d]=k.useState(null),[u,f]=k.useState({type:null,message:""}),p=[{id:"banco",label:"Libro de Banco / Movimientos",icon:br,description:"Todos los movimientos bancarios registrados."},{id:"balance",label:"Balance General",icon:vi,description:"Estado actual de cuentas y fondos."},{id:"recaudacion",label:"Recaudación Digital",icon:Ic,description:"Detalle de cobros y pagos de propietarios."},{id:"egresos",label:"Auditoría de Egresos",icon:ca,description:"Pagos realizados a proveedores y gastos."},{id:"convenios",label:"Convenios de Pago Activos",icon:eu,description:"Estatus de convenios vigentes."},{id:"historico-convenios",label:"Histórico de Convenios",icon:Da,description:"Registro de convenios finalizados."},{id:"comisiones",label:"Cálculo de Comisiones",icon:bs,description:"Reporte de comisiones por gestión."},{id:"cobro-propietario",label:"Control Cobro Propietario",icon:Qi,description:"Detalle de pagos por cada propietario."},{id:"auditoria",label:"Informes y Auditoría",icon:xo,description:"Resumen ejecutivo para auditoría."},{id:"fondo-reserva",label:"Fondo de Reserva (Histórico)",icon:da,description:"Resumen de acumulación mensual del fondo."},{id:"efectivo-recibido",label:"Efectivo Recibido (Oficina)",icon:kn,description:"Control de ingresos en efectivo."},{id:"efectivo-pagado",label:"Efectivo Pagado (Proveedores)",icon:kn,description:"Control de egresos en efectivo."}],h=async b=>{r(!0),f({type:null,message:""}),l(b);try{let v=[],y="",j=[];switch(b){case"banco":const _=await we.getBankTransactions();y="Libro de Banco / Movimientos",j=["Fecha","Descripción","Tipo","Categoría","Referencia","Monto ($)","Monto (Bs)"],v=_.map(H=>[H.date,H.description,H.type,H.category,H.reference||"",H.amount,H.amountBs||0]);break;case"balance":const N=await we.getFinancialTotals();y="Balance General",j=["Concepto","Valor"],v=[["Saldo Caja (Bs)",N.cashBalanceBs],["Cuentas por Pagar (USD)",N.accountsPayableUsd],["Cuentas por Cobrar (USD)",N.receivablesUsd],["Total Facturado (USD)",N.totalBilledUsd],["Total Recaudado (USD)",N.totalCollectedUsd],["Fondo de Reserva (USD)",N.reserveFundUsd],["Fondo de Reserva (Bs)",N.reserveFundBs],["Fondo en Divisa (USD)",N.initialCashUsd||0]];break;case"recaudacion":const E=await we.getFees();y="Recaudación Digital",j=["Mes","Propiedad","Fecha","Referencia","Método","Monto ($)","Turno"],v=E.flatMap(H=>H.debts.flatMap(X=>X.payments.map(K=>[`${H.month}/${H.year}`,X.propertyId,K.date,K.reference,K.method,K.amount,K.slot||""])));break;case"egresos":const T=await we.getPendingBills();y="Auditoría de Egresos",j=["Fecha","Proveedor","Descripción","Monto ($)","Monto (Bs)","Estatus","Fecha Pago","Fuente Pago","Referencia"],v=T.map(H=>[H.creationDate,H.provider,H.description,H.amount,H.amountBs,H.status,H.paidDate||"",H.paymentSource||"",H.paymentReference||""]);break;case"convenios":const B=await we.getInitialDebtData();y="Convenios de Pago Activos",j=["Propiedad","Propietario","Deuda Original ($)","Total Pagado ($)","Deuda Pendiente ($)","Cant. Pagos"],v=B.map(H=>[H.code,H.ownerName,H.original_debt,H.total_paid,H.current_debt,H.history?H.history.length:0]);break;case"historico-convenios":const F=await we.getArchivedAgreements();y="Histórico de Convenios",j=["Propiedad","Propietario","Monto Original ($)","Fecha Finalización","Estatus"],v=F.map(H=>[H.code,H.owner_name,H.original_amount,H.completion_date,"Finalizado"]);break;case"efectivo-recibido":const R=await we.getFees();y="Efectivo Recibido (Oficina)",j=["Fecha","Propiedad","Referencia","Monto ($)","Concepto"],v=R.flatMap(H=>H.debts.flatMap(X=>X.payments.filter(K=>K.method.toLowerCase().includes("efectivo")).map(K=>[K.date,X.propertyId,K.reference,K.amount,`Pago Cuota ${H.month}/${H.year}`])));break;case"efectivo-pagado":const U=await we.getPendingBills();y="Efectivo Pagado (Proveedores)",j=["Fecha","Proveedor","Descripción","Monto ($)","Referencia"],v=U.filter(H=>H.paymentSource==="Efectivo").map(H=>[H.paidDate||H.creationDate,H.provider,H.description,H.amount,H.paymentReference||""]);break;case"comisiones":const D=await we.getBankTransactions();y="Cálculo de Comisiones",j=["Fecha","Descripción","Referencia","Monto ($)","Monto (Bs)"],v=D.filter(H=>H.category==="Comisiones"&&H.type==="Egreso").map(H=>[H.date,H.description,H.reference||"",H.amount,H.amountBs||0]);break;case"cobro-propietario":const L=await we.getProperties(),P=await we.getFees();y="Control Cobro Propietario",j=["Mes","Propiedad","Propietario","Fecha","Referencia","Método","Monto ($)"],v=P.flatMap(H=>H.debts.flatMap(X=>{const K=L.find(ee=>ee.id===X.propertyId);return X.payments.map(ee=>[`${H.month}/${H.year}`,K?K.code:X.propertyId,K?K.number:"",ee.date,ee.reference,ee.method,ee.amount])}));break;case"auditoria":const G=await we.getAuditLogs();y="Informes y Auditoría",j=["Fecha","Usuario","Rol","Acción","Módulo","IP"],v=G.logs.map(H=>[H.created_at,H.username,H.user_role,H.action,H.module,H.ip_address]);break;case"fondo-reserva":const Q=await we.getReserveFundHistory(a.start,a.end);y="Fondo de Reserva (Histórico)",j=["Periodo","Aporte Mensual (Bs)","Aporte Mensual ($)","Acumulado (Bs)","Acumulado ($)"],v=Q.history.map(H=>[H.period,H.monthly_bs,H.monthly_usd,H.accumulated_bs,H.accumulated_usd]);break}a.start&&a.end&&(v=v.filter(_=>{const N=_[0];return typeof N=="string"&&N.match(/^\d{4}-\d{2}-\d{2}/)?N>=a.start&&N<=a.end:!0})),v.length===0?f({type:"error",message:"No se encontraron datos para los criterios seleccionados."}):d({title:y,headers:j,rows:v})}catch(v){console.error("HTML Report Generation Error",v),f({type:"error",message:`Error al generar reporte: ${v.message}`})}finally{r(!1)}},m=()=>{window.print()};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-4xl font-black text-slate-900 tracking-tighter flex items-center gap-3",children:[n.jsx(yr,{className:"text-indigo-600",size:40}),"Informes en ",n.jsx("span",{className:"text-indigo-600 italic",children:"HTML"})]}),n.jsx("p",{className:"text-slate-500 font-medium mt-1",children:"Visualización y exportación de reportes en formato web de alta fidelidad."})]}),n.jsxs("div",{className:"flex items-center gap-3 bg-white p-2 rounded-2xl shadow-sm border border-slate-100",children:[n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-slate-50 rounded-xl border border-slate-200",children:[n.jsx(Wr,{size:16,className:"text-slate-400"}),n.jsx("input",{type:"date",className:"bg-transparent text-xs font-bold outline-none text-slate-700",value:a.start,onChange:b=>s(v=>({...v,start:b.target.value}))})]}),n.jsx("span",{className:"text-slate-300 font-bold",children:"al"}),n.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-slate-50 rounded-xl border border-slate-200",children:[n.jsx(Wr,{size:16,className:"text-slate-400"}),n.jsx("input",{type:"date",className:"bg-transparent text-xs font-bold outline-none text-slate-700",value:a.end,onChange:b=>s(v=>({...v,end:b.target.value}))})]})]})]}),u.type&&n.jsxs("div",{className:`p-4 rounded-2xl flex items-center gap-3 animate-in slide-in-from-top duration-300 ${u.type==="success"?"bg-emerald-50 text-emerald-600 border border-emerald-100":"bg-red-50 text-red-600 border border-red-100"}`,children:[u.type==="success"?n.jsx(Gt,{size:20}):n.jsx(Sr,{size:20}),n.jsx("p",{className:"text-xs font-black uppercase tracking-widest",children:u.message})]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:p.map(b=>{const v=i===b.id,y=b.icon;return n.jsxs("button",{onClick:()=>h(b.id),className:`flex flex-col p-6 rounded-[2.5rem] border-2 transition-all text-left relative overflow-hidden group ${v?"bg-indigo-600 border-indigo-600 shadow-xl shadow-indigo-200":"bg-white border-slate-100 hover:border-indigo-200 hover:shadow-lg"}`,children:[n.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center mb-4 transition-colors ${v?"bg-white/20 text-white":"bg-indigo-50 text-indigo-600"}`,children:n.jsx(y,{size:24})}),n.jsx("h3",{className:`font-black text-sm uppercase tracking-widest mb-2 ${v?"text-white":"text-slate-900"}`,children:b.label}),n.jsx("p",{className:`text-[10px] font-medium leading-relaxed ${v?"text-indigo-100":"text-slate-500"}`,children:b.description}),v&&n.jsx("div",{className:"absolute top-4 right-4",children:n.jsx(Tc,{className:"text-white",size:20})}),n.jsx("div",{className:`absolute -right-4 -bottom-4 opacity-10 transition-transform group-hover:scale-110 ${v?"text-white":"text-indigo-600"}`,children:n.jsx(y,{size:80})})]},b.id)})}),o&&n.jsx("div",{className:"fixed inset-0 z-[100] bg-slate-900/80 backdrop-blur-sm flex items-center justify-center p-4 lg:p-12 no-print",children:n.jsxs("div",{className:"bg-white w-full max-w-7xl h-full rounded-[3rem] overflow-hidden flex flex-col shadow-2xl animate-in zoom-in duration-300",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex items-center justify-between",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tighter uppercase",children:o.title}),n.jsx("p",{className:"text-slate-500 text-[10px] font-black uppercase tracking-widest mt-1",children:"Vista Previa del Reporte HTML"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("button",{onClick:m,className:"bg-indigo-600 hover:bg-indigo-700 text-white px-6 py-3 rounded-2xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2 transition-all",children:[n.jsx(wt,{size:16})," Imprimir / PDF"]}),n.jsx("button",{onClick:()=>d(null),className:"bg-slate-100 hover:bg-slate-200 text-slate-500 p-3 rounded-2xl transition-all",children:n.jsx(mt,{size:24})})]})]}),n.jsx("div",{className:"flex-1 overflow-auto p-8 custom-scrollbar",children:n.jsx("div",{className:"bg-white border border-slate-200 rounded-3xl overflow-hidden",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsx("tr",{className:"bg-slate-50 border-b border-slate-200",children:o.headers.map((b,v)=>n.jsx("th",{className:"p-4 text-[10px] font-black text-slate-400 uppercase tracking-widest",children:b},v))})}),n.jsx("tbody",{children:o.rows.map((b,v)=>n.jsx("tr",{className:"border-b border-slate-100 hover:bg-slate-50/50 transition-colors",children:b.map((y,j)=>n.jsx("td",{className:"p-4 text-xs font-bold text-slate-700",children:typeof y=="number"?y.toLocaleString("en-US",{minimumFractionDigits:2}):y},j))},v))})]})})}),n.jsxs("div",{className:"p-8 border-t border-slate-100 bg-slate-50 flex items-center justify-between",children:[n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:["Generado por SAC 2026 Kernel V4.1.51 MC/MB - ",new Date().toLocaleString()]}),n.jsxs("div",{className:"flex items-center gap-2 text-indigo-600 font-black text-[10px] uppercase tracking-widest",children:[n.jsx(jo,{size:14}),"Data Certificada"]})]})]})}),o&&n.jsxs("div",{className:"hidden print:block print-visible p-0 m-0",children:[n.jsxs("div",{className:"mb-8 text-center",children:[n.jsx("h1",{className:"text-3xl font-black uppercase tracking-tighter",children:o.title}),n.jsx("p",{className:"text-sm font-bold uppercase tracking-widest text-slate-500 mt-2",children:"Condominio El Tejar - Reporte Oficial de Gestión"}),n.jsx("div",{className:"w-24 h-1 bg-indigo-600 mx-auto mt-4"})]}),n.jsxs("table",{className:"w-full border-collapse border border-slate-300",children:[n.jsx("thead",{children:n.jsx("tr",{className:"bg-slate-100",children:o.headers.map((b,v)=>n.jsx("th",{className:"border border-slate-300 p-2 text-[10px] font-black uppercase tracking-widest text-slate-600",children:b},v))})}),n.jsx("tbody",{children:o.rows.map((b,v)=>n.jsx("tr",{children:b.map((y,j)=>n.jsx("td",{className:"border border-slate-300 p-2 text-[10px] font-medium text-slate-800",children:typeof y=="number"?y.toLocaleString("en-US",{minimumFractionDigits:2}):y},j))},v))})]}),n.jsxs("div",{className:"mt-12 pt-8 border-t border-slate-200 flex justify-between items-end",children:[n.jsxs("div",{className:"text-[8px] font-bold text-slate-400 uppercase tracking-[0.2em]",children:["SAC 2026 Kernel V4.1.51 MC/MB",n.jsx("br",{}),"ID Auditoría: ",Math.random().toString(36).substring(2,15).toUpperCase()]}),n.jsxs("div",{className:"text-right",children:[n.jsx("div",{className:"w-48 h-px bg-slate-300 mb-2 mx-auto"}),n.jsx("p",{className:"text-[8px] font-black uppercase tracking-widest text-slate-400",children:"Firma Autorizada / Sello"})]})]})]}),n.jsx("div",{className:"bg-indigo-50 border border-indigo-100 p-8 rounded-[3rem] mt-12",children:n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-indigo-600 text-white rounded-xl flex items-center justify-center shrink-0",children:n.jsx(Tc,{size:20})}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-indigo-900 font-black text-sm uppercase tracking-widest mb-2",children:"Visualización Interactiva"}),n.jsx("p",{className:"text-indigo-700 text-xs font-medium leading-relaxed",children:"Los reportes HTML permiten una visualización rápida sin necesidad de descargar archivos. Utilice el botón de impresión para generar un PDF profesional o imprimir directamente con el formato optimizado para auditoría."})]})]})})]})},ro=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},Nm=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},YIe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,financialTotals:i,latestRate:l}=ht(),[o,d]=k.useState(new Date().getMonth()),[u,f]=k.useState(new Date().getFullYear()),[p,h]=k.useState(e.role==="owner"&&e.propertyId||null),[m,b]=k.useState("selection"),[v,y]=k.useState([]),[j,_]=k.useState(!1),[N,E]=k.useState(null),[T,B]=k.useState({});k.useEffect(()=>{(async()=>{_(!0);try{const[H,X]=await Promise.all([we.getInitialDebtData(),we.getSystemSettings()]);Array.isArray(H)?y(H):H&&H.success&&y(H.data||[]),B(X||{})}catch(H){console.error("Error fetching data",H)}finally{_(!1)}})()},[]);const F=k.useMemo(()=>t.find(Q=>Q.month===o&&Q.year===u),[t,o,u]),R=k.useMemo(()=>r.find(Q=>Q.id===p),[r,p]),U=k.useMemo(()=>v.find(Q=>Q.id===p),[v,p]),D=k.useMemo(()=>{if(!R)return null;const Q=a.find(X=>X.propertyId===R.id&&X.isOwner),H=s.find(X=>X.cedula===(Q==null?void 0:Q.cedula));return{fullName:(Q==null?void 0:Q.fullName)||"Propietario",email:(H==null?void 0:H.email)||"",phone:(Q==null?void 0:Q.phone)||(H==null?void 0:H.phone)||"",telegramId:(H==null?void 0:H.telegramChatId)||"",propertyCode:R.code,propertyId:R.id}},[R,a,s]),L=Q=>{if(!Q)return"";let H=Q.trim();return H.startsWith("+")?H.replace(/\D/g,""):H.startsWith("0")?"58"+H.substring(1).replace(/\D/g,""):H.length===10?"58"+H.replace(/\D/g,""):H.replace(/\D/g,"")},P=async Q=>{if(!D||!R)return;const H=F==null?void 0:F.debts.find(Y=>Y.propertyId===p),X=H?Number(H.amountUsd)-Number(H.paidAmount):0,K=(U==null?void 0:U.current_debt)||0,ee=X+K,W=`🏢 *ESTADO DE CUENTA INDIVIDUAL - SAC 2026*

Estimado(a) *${D.fullName}*,
Unidad: *${R.type} ${R.number}* (${R.code})

📅 *Periodo:* ${Te[o]} ${u}
------------------------------------------
💵 *Cuota del Mes:* $${ro(X)}
🤝 *Convenio de Pago:* $${ro(K)}
------------------------------------------
🔥 *TOTAL PENDIENTE:* $${ro(ee)}

Por favor, gestione su pago en nuestro portal digital:
🌐 ${Rr}

¡Gracias!`;if(Q==="whatsapp"){const Y=L(D.phone);if(!Y)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${Y}?text=${encodeURIComponent(W)}`,"_blank");return}if(Q==="share"){if(navigator.share)try{await navigator.share({title:`Estado de Cuenta Individual - ${R.code}`,text:W.replace(/\*/g,""),url:Rr})}catch(Y){console.warn("Share failed",Y)}else alert("La función de compartir no está disponible en este navegador.");return}E(Q);try{const Y={channel:Q,messageType:"custom",subject:`Estado de Cuenta SAC 2026 - ${R.code}`,recipients:[{name:D.fullName,email:D.email,telegramChatId:D.telegramId,customMessage:W.replace(/\*/g,"")}]},O=await(await fetch(`${Ne}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(Y)})).json();O.status==="success"?alert(`¡Éxito! Mensaje enviado por ${Q}.`):alert("Error: "+O.message)}catch{alert("Error de red al enviar.")}finally{E(null)}},G=()=>{if(!R||!D)return;const Q=F==null?void 0:F.debts.find(O=>O.propertyId===p),H=Q?Number(Q.amountUsd)-Number(Q.paidAmount):0,X=(U==null?void 0:U.current_debt)||0,K=H+X,ee=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Estado de Cuenta - ${R.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; background-color: #f1f5f9; }
        .container { max-width: 800px; margin: 0 auto; background: white; padding: 60px; border-radius: 30px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
        .header { text-align: center; margin-bottom: 40px; border-bottom: 2px solid #f1f5f9; padding-bottom: 20px; }
        .title { font-size: 24px; font-weight: 900; text-transform: uppercase; color: #0f172a; }
        .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 40px; }
        .label { font-size: 10px; font-weight: 900; color: #64748b; text-transform: uppercase; }
        .value { font-size: 16px; font-weight: 700; color: #1e293b; }
        .amount-box { background: #0f172a; padding: 30px; border-radius: 20px; text-align: center; margin-bottom: 40px; color: white; }
        .amount-label { font-size: 12px; font-weight: 900; color: #94a3b8; text-transform: uppercase; }
        .amount-value { font-size: 48px; font-weight: 900; color: #38bdf8; }
        .detail-row { display: flex; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid #f1f5f9; }
        .detail-label { font-weight: 700; color: #475569; }
        .detail-value { font-weight: 900; color: #0f172a; }
        .payment-info { margin-top: 40px; padding-top: 20px; border-top: 2px solid #f1f5f9; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
        .payment-title { font-size: 10px; font-weight: 900; color: #2563eb; text-transform: uppercase; margin-bottom: 10px; }
        .payment-card { background: #f8fafc; padding: 15px; border-radius: 15px; font-size: 11px; }
        .footer { text-align: center; font-size: 10px; color: #94a3b8; margin-top: 40px; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="title">Estado de Cuenta Individual</div>
            <div style="font-size: 12px; color: #64748b; font-weight: 700; margin-top: 5px;">SAC 2026 - ${Te[o]} ${u}</div>
        </div>
        <div class="info-grid">
            <div>
                <div class="label">Propietario</div>
                <div class="value">${D.fullName}</div>
            </div>
            <div style="text-align: right;">
                <div class="label">Unidad</div>
                <div class="value">${R.code} (${R.type} ${R.number})</div>
            </div>
        </div>
        <div class="detail-row">
            <span class="detail-label">Cuota del Mes</span>
            <span class="detail-value">$ ${ro(H)}</span>
        </div>
        <div class="detail-row">
            <span class="detail-label">Convenio de Pago</span>
            <span class="detail-value">$ ${ro(X)}</span>
        </div>
        <div class="amount-box">
            <div class="amount-label">Total Pendiente</div>
            <div class="amount-value">$ ${ro(K)}</div>
            <div style="font-size: 18px; font-weight: 700; color: #94a3b8; margin-top: 10px;">Bs. ${Nm(K*l)}</div>
        </div>

        <div class="payment-info">
            <div>
                <div class="payment-title">Datos para el Pago</div>
                <div class="payment-card">
                    <div style="font-weight: 700; color: #334155; text-transform: uppercase;">${T.payment_bank_name||"BanPlus"} ${T.payment_account_type||"Cta Cte"}</div>
                    <div style="font-weight: 900; color: #1e3a8a; margin: 2px 0;"># ${T.payment_account_number||"0174-0124-6812-4414-5759"}</div>
                    <div style="color: #475569;">RIF: ${T.payment_rif||"J-313266507"}</div>
                    <div style="color: #475569;">Pago Móvil: ${T.payment_mobile_phone||"0424-4910040"}</div>
                </div>
            </div>
            <div>
                <div class="payment-title" style="color: #059669;">Reportar Pago</div>
                <div class="payment-card">
                    <div style="font-size: 9px; font-weight: 900; color: #94a3b8; text-transform: uppercase; margin-bottom: 4px;">Enviar comprobante a:</div>
                    ${(T.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map(O=>`<div style="font-weight: 700; color: #334155;">${O.trim()}</div>`).join("")}
                    <div style="font-weight: 700; color: #475569; margin-top: 4px;">WhatsApp: ${T.payment_whatsapp||"0412-8213310"}</div>
                    <div style="font-size: 9px; font-weight: 900; color: #d97706; font-style: italic; margin-top: 8px;">Indicar #casa y nombre para identificar</div>
                </div>
            </div>
        </div>

        <div class="footer">
            Generado digitalmente por SAC 2026 • ${Ln} • ${new Date().toLocaleString()}
        </div>
    </div>
</body>
</html>`,W=new Blob([ee],{type:"text/html"}),Y=URL.createObjectURL(W),M=document.createElement("a");M.href=Y,M.download=`EstadoCuenta_${R.code}.html`,M.click(),URL.revokeObjectURL(Y)};if(m==="report"&&R&&D){const Q=F==null?void 0:F.debts.find(ee=>ee.propertyId===p),H=Q?Number(Q.amountUsd)-Number(Q.paidAmount):0,X=(U==null?void 0:U.current_debt)||0,K=H+X;return n.jsxs("div",{className:"max-w-4xl mx-auto space-y-8 animate-in fade-in duration-500 pb-24 px-1 print:p-0",children:[n.jsx("style",{children:`
                    @media print {
                        .print-header { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .print-header h2 { color: white !important; }
                        .print-header p, .print-header span { color: inherit; }
                        .print-header .text-blue-400 { color: #60a5fa !important; }
                        .print-header .text-blue-300 { color: #93c5fd !important; }
                        .print-header .text-emerald-400 { color: #34d399 !important; }
                        .print-header .text-amber-400 { color: #fbbf24 !important; }
                        .print-header .text-slate-400 { color: #94a3b8 !important; }
                        .print-header .bg-white/10 { background-color: rgba(255,255,255,0.15) !important; border: 1px solid rgba(255,255,255,0.3) !important; -webkit-print-color-adjust: exact; }
                        .print-header .backdrop-blur-md { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
                        .bg-slate-900 { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .bg-slate-50 { background-color: #f8fafc !important; -webkit-print-color-adjust: exact; }
                        .bg-blue-600 { background-color: #2563eb !important; -webkit-print-color-adjust: exact; }
                    }
                `}),n.jsxs("div",{className:"flex justify-between items-center no-print",children:[n.jsxs("button",{onClick:()=>b("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(gs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",children:n.jsx(wt,{size:20})}),n.jsx("button",{onClick:G,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Exportar HTML",children:n.jsx(wr,{size:20})}),n.jsx("button",{onClick:()=>P("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",children:n.jsx(Ha,{size:20})}),n.jsx("button",{onClick:()=>P("telegram"),disabled:!D.telegramId||!!N,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${D.telegramId?"bg-sky-500":"bg-slate-200"}`,children:N==="telegram"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Bl,{size:20})}),n.jsx("button",{onClick:()=>P("email"),disabled:!D.email||!!N,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${D.email?"bg-indigo-600":"bg-slate-200"}`,children:N==="email"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Br,{size:20})}),n.jsx("button",{onClick:()=>P("share"),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir",children:n.jsx(Aa,{size:20})})]})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] shadow-2xl border border-slate-200 overflow-hidden print:shadow-none print:border-slate-300",children:[n.jsxs("div",{className:"p-10 bg-slate-900 text-white text-center relative print-header",children:[n.jsx("h2",{className:"text-2xl font-black uppercase tracking-[0.2em] mb-2",children:"Estado de Cuenta Individual"}),n.jsx("p",{className:"text-blue-400 font-black uppercase tracking-widest text-[10px] mb-6",children:"SAC 2026"}),n.jsxs("div",{className:"flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8 print:mt-2 print:gap-4 print:flex",children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Inmueble"}),n.jsxs("p",{className:"text-lg font-black text-blue-300 print:text-sm",children:[R.type," ",R.number]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Alícuota"}),n.jsxs("p",{className:"text-lg font-black text-emerald-400 print:text-sm",children:[(Number(R.aliquot)||0).toFixed(4),"%"]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Tasa del Día"}),n.jsxs("p",{className:"text-lg font-black text-amber-400 print:text-sm",children:[l.toFixed(2)," Bs/$"]})]})]})]}),n.jsxs("div",{className:"p-10 space-y-8",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-8 border-b border-slate-100 pb-8",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Propietario"}),n.jsx("p",{className:"text-lg font-black text-slate-900 uppercase",children:D.fullName})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Unidad"}),n.jsxs("p",{className:"text-lg font-black text-blue-600 uppercase",children:[R.type," ",R.number," (",R.code,")"]})]})]}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex justify-between items-center p-6 bg-slate-50 rounded-3xl border border-slate-100",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-white rounded-2xl flex items-center justify-center text-blue-600 shadow-sm",children:n.jsx(Wr,{size:24})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-black text-slate-900 uppercase",children:"Cuota del Mes"}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:[Te[o]," ",u]})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("p",{className:"text-xl font-black text-slate-900",children:["$ ",ro(H)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["Bs. ",Nm(H*l)]})]})]}),n.jsxs("div",{className:"flex justify-between items-center p-6 bg-slate-50 rounded-3xl border border-slate-100",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-white rounded-2xl flex items-center justify-center text-amber-600 shadow-sm",children:n.jsx(eu,{size:24})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-black text-slate-900 uppercase",children:"Convenio de Pago"}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"Saldo Histórico Pendiente"})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("p",{className:"text-xl font-black text-slate-900",children:["$ ",ro(X)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["Bs. ",Nm(X*l)]})]})]})]}),n.jsxs("div",{className:"bg-slate-900 rounded-[2.5rem] p-10 text-white shadow-xl flex justify-between items-center",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-blue-400 uppercase tracking-[0.3em] mb-2",children:"Total Pendiente de Pago"}),n.jsxs("h3",{className:"text-5xl font-black tracking-tighter",children:["$ ",ro(K)]})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Equivalente en Bolívares"}),n.jsxs("p",{className:"text-2xl font-black text-blue-300 tracking-tight",children:["Bs. ",Nm(K*l)]})]})]}),n.jsxs("div",{className:"pt-8 border-t border-slate-100 space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 text-left",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(Ki,{size:14})," Datos para el Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsxs("p",{className:"text-[11px] font-bold text-slate-700 uppercase",children:[T.payment_bank_name||"BanPlus"," ",T.payment_account_type||"Cta Cte"]}),n.jsxs("p",{className:"text-[11px] font-black text-blue-900 tracking-wider",children:["# ",T.payment_account_number||"0174-0124-6812-4414-5759"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase",children:["RIF: ",T.payment_rif||"J-313266507"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase",children:["Pago Móvil: ",T.payment_mobile_phone||"0424-4910040"]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(Br,{size:14})," Reportar Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Enviar comprobante a:"}),(T.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map((ee,W)=>n.jsx("p",{className:"text-[11px] font-bold text-slate-700",children:ee.trim()},W)),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase mt-1",children:["WhatsApp: ",T.payment_whatsapp||"0412-8213310"]}),n.jsx("p",{className:"text-[9px] font-black text-amber-600 uppercase italic mt-2",children:"Indicar #casa y nombre para identificar"})]})]})]}),n.jsx("div",{className:"pt-8 border-t border-slate-100 text-center",children:n.jsxs("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.5em]",children:["SAC 2026 • ",Ln," • Generado Digitalmente"]})})]})]})]})]})}return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Estado de Cuenta ",n.jsx("span",{className:"text-blue-600",children:"Individual"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Consolidado de cuota mensual y convenios de pago."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:o,onChange:Q=>d(Number(Q.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Te.map((Q,H)=>n.jsx("option",{value:H,children:Q},H))}),n.jsx("input",{type:"number",value:u,onChange:Q=>f(Number(Q.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(QA,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Seleccione Propiedad"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Visualice el saldo total pendiente incluyendo convenios."})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(ea,{size:14})," Unidad Inmobiliaria"]}),n.jsxs("select",{value:p||"",onChange:Q=>h(Number(Q.target.value)),disabled:e.role==="owner",className:`w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer ${e.role==="owner"?"opacity-75 cursor-not-allowed":""}`,children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),r.filter(Q=>e.role!=="owner"||Q.id===e.propertyId).sort((Q,H)=>Q.code.localeCompare(H.code,void 0,{numeric:!0})).map(Q=>n.jsxs("option",{value:Q.id,children:[Q.code," - ",Q.type," ",Q.number]},Q.id))]})]}),n.jsxs("button",{disabled:!p,onClick:()=>b("report"),className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:["GENERAR ESTADO DE CUENTA ",n.jsx(Hs,{size:18})]}),j&&n.jsx("div",{className:"flex justify-center py-4",children:n.jsx($t,{className:"animate-spin text-blue-600",size:24})})]})})]})},ul=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},Cm=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},XIe=({user:e})=>{var L,P;const{properties:t,residents:r,users:a,latestRate:s}=ht(),[i,l]=k.useState(new Date().getMonth()),[o,d]=k.useState(new Date().getFullYear()),[u,f]=k.useState(null),[p,h]=k.useState("selection"),[m,b]=k.useState(!1),[v,y]=k.useState(null),[j,_]=k.useState(null),[N,E]=k.useState({});k.useEffect(()=>{(async()=>{try{const Q=await we.getSystemSettings();E(Q||{})}catch(Q){console.error("Error fetching settings",Q)}})()},[]);const T=k.useMemo(()=>t.find(G=>G.id===u),[t,u]),B=k.useMemo(()=>{if(!T)return null;const G=r.find(H=>H.propertyId===T.id&&H.isOwner),Q=a.find(H=>H.cedula===(G==null?void 0:G.cedula));return{fullName:(G==null?void 0:G.fullName)||"Propietario",email:(Q==null?void 0:Q.email)||"",phone:(G==null?void 0:G.phone)||(Q==null?void 0:Q.phone)||"",telegramId:(Q==null?void 0:Q.telegramChatId)||"",propertyCode:T.code,propertyId:T.id}},[T,r,a]),F=async()=>{if(u){b(!0);try{const Q=await(await fetch(`${Ne}/get_detailed_account_status.php?propertyId=${u}&month=${i}&year=${o}`,{credentials:"include"})).json();Q.success?(y(Q),h("report")):alert("Error: "+Q.error)}catch{alert("Error de red al obtener el reporte.")}finally{b(!1)}}},R=G=>{if(!G)return"";let Q=G.trim();return Q.startsWith("+")?Q.replace(/\D/g,""):Q.startsWith("0")?"58"+Q.substring(1).replace(/\D/g,""):Q.length===10?"58"+Q.replace(/\D/g,""):Q.replace(/\D/g,"")},U=async G=>{var K;if(!B||!T||!v)return;const Q=Te[i],H=v.movements.reduce((ee,W)=>ee+W.amount,0);let X=`🏢 *ESTADO DE CUENTA DETALLADO - SAC 2026*

Estimado(a) *${B.fullName}*,
Unidad: *${T.type} ${T.number}* (${T.code})

📅 *Periodo:* ${Q} ${o}
------------------------------------------
💵 *Cuota del Mes:* $${ul(((K=v.currentMonthFee)==null?void 0:K.billed)||0)}
✅ *Pagado en el Mes:* $${ul(H)}
------------------------------------------
🔥 *TOTAL DEUDA ACTUAL:* $${ul(v.totalDebt)}

*DETALLE DE MOVIMIENTOS:* 
`;if(v.movements.forEach(ee=>{X+=`• ${ee.date}: $${ul(ee.amount)} (${ee.description})
`}),X+=`
Consulte más detalles en:
🌐 ${Rr}

¡Gracias!`,G==="whatsapp"){const ee=R(B.phone);if(!ee)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${ee}?text=${encodeURIComponent(X)}`,"_blank");return}if(G==="share"){if(navigator.share)try{await navigator.share({title:`Estado de Cuenta Detallado - ${T.code}`,text:X.replace(/\*/g,""),url:Rr})}catch(ee){console.warn("Share failed",ee)}else alert("La función de compartir no está disponible en este navegador.");return}_(G);try{const ee={channel:G,messageType:"custom",subject:`Estado de Cuenta Detallado SAC 2026 - ${T.code}`,recipients:[{name:B.fullName,email:B.email,telegramChatId:B.telegramId,customMessage:X.replace(/\*/g,"")}]},Y=await(await fetch(`${Ne}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})).json();Y.status==="success"?alert(`¡Éxito! Mensaje enviado por ${G}.`):alert("Error: "+Y.message)}catch{alert("Error de red al enviar.")}finally{_(null)}},D=()=>{if(!T||!B||!v)return;v.movements.reduce((K,ee)=>K+ee.amount,0);const G=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Estado Detallado - ${T.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; background-color: #f8fafc; }
        .container { max-width: 900px; margin: 0 auto; background: white; padding: 50px; border-radius: 24px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
        .header { text-align: center; margin-bottom: 30px; }
        .title { font-size: 20px; font-weight: 900; text-transform: uppercase; color: #0f172a; letter-spacing: 2px; }
        table { width: 100%; border-collapse: collapse; margin-top: 20px; }
        th { text-align: left; font-size: 10px; text-transform: uppercase; color: #64748b; padding: 12px; border-bottom: 2px solid #f1f5f9; }
        td { padding: 12px; font-size: 13px; border-bottom: 1px solid #f1f5f9; }
        .total-box { margin-top: 30px; padding: 20px; background: #0f172a; color: white; border-radius: 16px; display: flex; justify-content: space-between; align-items: center; }
        .payment-info { margin-top: 40px; padding-top: 20px; border-top: 2px solid #f1f5f9; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; text-align: left; }
        .payment-title { font-size: 10px; font-weight: 900; color: #2563eb; text-transform: uppercase; margin-bottom: 10px; }
        .payment-card { background: #f8fafc; padding: 15px; border-radius: 15px; font-size: 11px; }
        .footer { text-align: center; font-size: 10px; color: #94a3b8; margin-top: 30px; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="title">Estado de Cuenta Detallado</div>
            <div style="font-size: 11px; color: #64748b; font-weight: 700; margin-top: 4px;">SAC 2026 - ${Te[i]} ${o}</div>
        </div>
        <div style="display: flex; justify-content: space-between; margin-bottom: 30px; font-size: 13px;">
            <div><strong>Propietario:</strong> ${B.fullName}</div>
            <div><strong>Unidad:</strong> ${T.code}</div>
        </div>
        
        <div style="font-size: 12px; font-weight: 900; color: #2563eb; text-transform: uppercase; margin-bottom: 10px;">Movimientos del Mes</div>
        <table>
            <thead>
                <tr>
                    <th>Fecha</th>
                    <th>Descripción</th>
                    <th style="text-align: right;">Monto ($)</th>
                </tr>
            </thead>
            <tbody>
                ${v.movements.map(K=>`
                    <tr>
                        <td>${K.date}</td>
                        <td>${K.description}</td>
                        <td style="text-align: right;">$ ${ul(K.amount)}</td>
                    </tr>
                `).join("")}
                ${v.movements.length===0?'<tr><td colspan="3" style="text-align: center; color: #94a3b8;">No hay abonos registrados</td></tr>':""}
            </tbody>
        </table>

        <div class="total-box">
            <div>
                <div style="font-size: 10px; text-transform: uppercase; color: #94a3b8;">Saldo Total Pendiente</div>
                <div style="font-size: 24px; font-weight: 900;">$ ${ul(v.totalDebt)}</div>
            </div>
            <div style="text-align: right;">
                <div style="font-size: 10px; text-transform: uppercase; color: #94a3b8;">Equivalente VES</div>
                <div style="font-size: 18px; font-weight: 700;">Bs. ${Cm(v.totalDebt*s)}</div>
            </div>
        </div>

        <div class="payment-info">
            <div>
                <div class="payment-title">Datos para el Pago</div>
                <div class="payment-card">
                    <div style="font-weight: 700; color: #334155; text-transform: uppercase;">${N.payment_bank_name||"BanPlus"} ${N.payment_account_type||"Cta Cte"}</div>
                    <div style="font-weight: 900; color: #1e3a8a; margin: 2px 0;"># ${N.payment_account_number||"0174-0124-6812-4414-5759"}</div>
                    <div style="color: #475569;">RIF: ${N.payment_rif||"J-313266507"}</div>
                    <div style="color: #475569;">Pago Móvil: ${N.payment_mobile_phone||"0424-4910040"}</div>
                </div>
            </div>
            <div>
                <div class="payment-title" style="color: #059669;">Reportar Pago</div>
                <div class="payment-card">
                    <div style="font-size: 9px; font-weight: 900; color: #94a3b8; text-transform: uppercase; margin-bottom: 4px;">Enviar comprobante a:</div>
                    ${(N.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map(K=>`<div style="font-weight: 700; color: #334155;">${K.trim()}</div>`).join("")}
                    <div style="font-weight: 700; color: #475569; margin-top: 4px;">WhatsApp: ${N.payment_whatsapp||"0412-8213310"}</div>
                    <div style="font-size: 9px; font-weight: 900; color: #d97706; font-style: italic; margin-top: 8px;">Indicar #casa y nombre para identificar</div>
                </div>
            </div>
        </div>
        
        <div class="footer">
            Generado por SAC 2026 • Kernel V4.1.61 MC/MB • ${new Date().toLocaleString()}
        </div>
    </div>
</body>
</html>`,Q=new Blob([G],{type:"text/html"}),H=URL.createObjectURL(Q),X=document.createElement("a");X.href=H,X.download=`DetalleCuenta_${T.code}.html`,X.click(),URL.revokeObjectURL(H)};if(p==="report"&&T&&B&&v){const G=v.movements.reduce((Q,H)=>Q+H.amount,0);return n.jsxs("div",{className:"max-w-4xl mx-auto space-y-8 animate-in fade-in duration-500 pb-24 px-1 print:p-0",children:[n.jsx("style",{children:`
                    @media print {
                        .print-header { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .print-header h2 { color: white !important; }
                        .print-header p, .print-header span { color: inherit; }
                        .print-header .text-blue-400 { color: #60a5fa !important; }
                        .print-header .text-blue-300 { color: #93c5fd !important; }
                        .print-header .text-emerald-400 { color: #34d399 !important; }
                        .print-header .text-amber-400 { color: #fbbf24 !important; }
                        .print-header .text-slate-400 { color: #94a3b8 !important; }
                        .print-header .bg-white/10 { background-color: rgba(255,255,255,0.15) !important; border: 1px solid rgba(255,255,255,0.3) !important; -webkit-print-color-adjust: exact; }
                        .print-header .backdrop-blur-md { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
                        .bg-slate-900 { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .bg-slate-50 { background-color: #f8fafc !important; -webkit-print-color-adjust: exact; }
                        .bg-blue-600 { background-color: #2563eb !important; -webkit-print-color-adjust: exact; }
                    }
                `}),n.jsxs("div",{className:"flex justify-between items-center no-print",children:[n.jsxs("button",{onClick:()=>h("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(gs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",children:n.jsx(wt,{size:20})}),n.jsx("button",{onClick:D,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Exportar HTML",children:n.jsx(wr,{size:20})}),n.jsx("button",{onClick:()=>U("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",children:n.jsx(Ha,{size:20})}),n.jsx("button",{onClick:()=>U("telegram"),disabled:!B.telegramId||!!j,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${B.telegramId?"bg-sky-500":"bg-slate-200"}`,children:j==="telegram"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Bl,{size:20})}),n.jsx("button",{onClick:()=>U("email"),disabled:!B.email||!!j,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${B.email?"bg-indigo-600":"bg-slate-200"}`,children:j==="email"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Br,{size:20})}),n.jsx("button",{onClick:()=>U("share"),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",children:n.jsx(Aa,{size:20})})]})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] shadow-2xl border border-slate-200 overflow-hidden print:shadow-none print:border-slate-300",children:[n.jsxs("div",{className:"p-10 bg-slate-900 text-white text-center relative print-header",children:[n.jsx("h2",{className:"text-2xl font-black uppercase tracking-[0.2em] mb-2",children:"Estado de Cuenta Detallado"}),n.jsx("p",{className:"text-blue-400 font-black uppercase tracking-widest text-[10px] mb-6",children:"SAC 2026"}),n.jsxs("div",{className:"flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8 print:mt-2 print:gap-4 print:flex",children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Inmueble"}),n.jsxs("p",{className:"text-lg font-black text-blue-300 print:text-sm",children:[T.type," ",T.number]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Alícuota"}),n.jsxs("p",{className:"text-lg font-black text-emerald-400 print:text-sm",children:[(Number(T.aliquot)||0).toFixed(4),"%"]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Tasa del Día"}),n.jsxs("p",{className:"text-lg font-black text-amber-400 print:text-sm",children:[s.toFixed(2)," Bs/$"]})]})]})]}),n.jsxs("div",{className:"p-10 space-y-10",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-8 border-b border-slate-100 pb-8",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Propietario"}),n.jsx("p",{className:"text-lg font-black text-slate-900 uppercase",children:B.fullName})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Unidad"}),n.jsxs("p",{className:"text-lg font-black text-blue-600 uppercase",children:[T.type," ",T.number," (",T.code,")"]})]})]}),n.jsxs("section",{className:"space-y-4",children:[n.jsxs("h3",{className:"text-xs font-black uppercase tracking-widest text-slate-400 flex items-center gap-2",children:[n.jsx(yr,{size:14,className:"text-blue-600"})," Cargos del Periodo (",Te[i]," ",o,")"]}),n.jsxs("div",{className:"p-6 bg-slate-50 rounded-3xl border border-slate-100 flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-white rounded-2xl flex items-center justify-center text-blue-600 shadow-sm",children:n.jsx(ca,{size:24})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-black text-slate-900 uppercase",children:"Cuota Mensual de Condominio"}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"Facturación del Mes"})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("p",{className:"text-xl font-black text-slate-900",children:["$ ",ul(((L=v.currentMonthFee)==null?void 0:L.billed)||0)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["Bs. ",Cm((((P=v.currentMonthFee)==null?void 0:P.billed)||0)*s)]})]})]})]}),n.jsxs("section",{className:"space-y-4",children:[n.jsxs("h3",{className:"text-xs font-black uppercase tracking-widest text-slate-400 flex items-center gap-2",children:[n.jsx(Gt,{size:14,className:"text-emerald-600"})," Abonos Registrados en el Mes"]}),v.movements.length>0?n.jsxs("div",{className:"space-y-3",children:[v.movements.map((Q,H)=>n.jsxs("div",{className:"p-5 bg-white border border-slate-100 rounded-2xl flex justify-between items-center shadow-sm",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-emerald-50 text-emerald-600 rounded-xl flex items-center justify-center",children:n.jsx(Ki,{size:20})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-xs font-black text-slate-900 uppercase",children:Q.description}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest",children:[Q.date," • Ref: ",Q.reference]})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("p",{className:"text-sm font-black text-emerald-600",children:["+ $ ",ul(Q.amount)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:["Bs. ",Cm(Q.amount*s)]})]})]},H)),n.jsxs("div",{className:"p-5 bg-emerald-50 border border-emerald-100 rounded-2xl flex justify-between items-center",children:[n.jsx("p",{className:"text-xs font-black text-emerald-700 uppercase",children:"Total Abonos del Mes"}),n.jsxs("p",{className:"text-lg font-black text-emerald-700",children:["$ ",ul(G)]})]})]}):n.jsxs("div",{className:"p-10 bg-slate-50 rounded-3xl border border-dashed border-slate-200 text-center",children:[n.jsx(Pc,{size:32,className:"text-slate-300 mx-auto mb-3"}),n.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest",children:"No se detectaron abonos en este periodo"})]})]}),n.jsxs("div",{className:"bg-slate-900 rounded-[2.5rem] p-10 text-white shadow-xl flex flex-col md:flex-row justify-between items-center gap-8",children:[n.jsxs("div",{className:"text-center md:text-left",children:[n.jsx("p",{className:"text-[10px] font-black text-blue-400 uppercase tracking-[0.3em] mb-2",children:"Estatus de Cuenta"}),n.jsx("div",{className:"flex items-center gap-3 justify-center md:justify-start",children:v.totalDebt<=0?n.jsx("div",{className:"px-4 py-2 bg-emerald-500 text-white rounded-full text-[10px] font-black uppercase tracking-widest",children:"SOLVENTE"}):n.jsx("div",{className:"px-4 py-2 bg-red-500 text-white rounded-full text-[10px] font-black uppercase tracking-widest",children:"DEUDA PENDIENTE"})})]}),n.jsxs("div",{className:"text-center md:text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Saldo Total a la Fecha"}),n.jsxs("h3",{className:"text-5xl font-black tracking-tighter",children:["$ ",ul(v.totalDebt)]}),n.jsxs("p",{className:"text-xl font-black text-blue-300 tracking-tight mt-1",children:["Bs. ",Cm(v.totalDebt*s)]})]})]}),n.jsxs("div",{className:"pt-8 border-t border-slate-100 space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 text-left",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(Ki,{size:14})," Datos para el Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsxs("p",{className:"text-[11px] font-bold text-slate-700 uppercase",children:[N.payment_bank_name||"BanPlus"," ",N.payment_account_type||"Cta Cte"]}),n.jsxs("p",{className:"text-[11px] font-black text-blue-900 tracking-wider",children:["# ",N.payment_account_number||"0174-0124-6812-4414-5759"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase",children:["RIF: ",N.payment_rif||"J-313266507"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase",children:["Pago Móvil: ",N.payment_mobile_phone||"0424-4910040"]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("h4",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(Br,{size:14})," Reportar Pago"]}),n.jsxs("div",{className:"bg-slate-50 p-4 rounded-2xl border border-slate-100 space-y-1",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase",children:"Enviar comprobante a:"}),(N.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map((Q,H)=>n.jsx("p",{className:"text-[11px] font-bold text-slate-700",children:Q.trim()},H)),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase mt-1",children:["WhatsApp: ",N.payment_whatsapp||"0412-8213310"]}),n.jsx("p",{className:"text-[9px] font-black text-amber-600 uppercase italic mt-2",children:"Indicar #casa y nombre para identificar"})]})]})]}),n.jsx("div",{className:"pt-8 border-t border-slate-100 text-center",children:n.jsx("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.5em]",children:"SAC 2026 • Kernel V4.1.62 MC/MB • Generado Digitalmente"})})]})]})]})]})}return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Estado de Cuenta ",n.jsx("span",{className:"text-blue-600",children:"Detallado"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Desglose exhaustivo de movimientos y abonos mensuales."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:i,onChange:G=>l(Number(G.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Te.map((G,Q)=>n.jsx("option",{value:Q,children:G},Q))}),n.jsx("input",{type:"number",value:o,onChange:G=>d(Number(G.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-emerald-50 text-emerald-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(Da,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Auditoría de Movimientos"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Seleccione la unidad para detallar todos los pagos y cargos del mes."})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(ea,{size:14})," Unidad Inmobiliaria"]}),n.jsxs("select",{value:u||"",onChange:G=>f(Number(G.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),t.sort((G,Q)=>G.code.localeCompare(Q.code,void 0,{numeric:!0})).map(G=>n.jsxs("option",{value:G.id,children:[G.code," - ",G.type," ",G.number]},G.id))]})]}),n.jsxs("button",{disabled:!u||m,onClick:F,className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:[m?n.jsx($t,{className:"animate-spin",size:20}):n.jsx(Hs,{size:18}),"GENERAR REPORTE DETALLADO"]})]})})]})},us=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},cN=({user:e,initialMode:t,onNavigate:r})=>{const{fees:a,properties:s,residents:i,users:l,latestRate:o}=ht(),[d,u]=k.useState(new Date().getMonth()),[f,p]=k.useState(new Date().getFullYear()),[h,m]=k.useState(null),[b,v]=k.useState("selection"),[y,j]=k.useState(null),[_,N]=k.useState(!1),[E,T]=k.useState([]),[B,F]=k.useState(!1),R=k.useRef(null);k.useEffect(()=>{(async()=>{F(!0);try{const me=await we.getInitialDebtData();T(Array.isArray(me)?me:[])}catch(me){console.error("Error fetching agreements:",me)}finally{F(!1)}})()},[]);const U=k.useMemo(()=>a.find(ie=>ie.month===d&&ie.year===f),[a,d,f]),D=k.useMemo(()=>s.find(ie=>ie.id===h),[s,h]),L=k.useMemo(()=>{if(!D)return null;const ie=i.find(Z=>Z.propertyId===D.id&&Z.isOwner),me=l.find(Z=>Z.cedula===(ie==null?void 0:ie.cedula));return{fullName:(ie==null?void 0:ie.fullName)||"Propietario",email:(me==null?void 0:me.email)||"",phone:(ie==null?void 0:ie.phone)||(me==null?void 0:me.phone)||"",telegramId:(me==null?void 0:me.telegramChatId)||"",propertyCode:D.code}},[D,i,l]),P=k.useMemo(()=>!U||!h?null:U.debts.find(ie=>ie.propertyId===h),[U,h]),G=k.useMemo(()=>{if(!h)return{totalDebt:0,isFullySolvent:!0};let ie=0;return a.forEach(me=>{const Z=me.debts.find(Me=>Me.propertyId===h);Z&&(ie+=Number(Z.amountUsd)-Number(Z.paidAmount))}),{totalDebt:ie,isFullySolvent:ie<=0}},[a,h]),[Q,H]=k.useState(!1),[X,K]=k.useState({date:new Date().toLocaleDateString("es-ES",{day:"numeric",month:"long",year:"numeric"}),city:"San Diego",recipientName:"",recipientId:"",mode:"html"}),[ee,W]=k.useState(null);k.useEffect(()=>{t&&h&&b==="receipt"&&(K(ie=>({...ie,mode:t})),H(!0))},[t,h,b]),k.useEffect(()=>{!["admin","programmer"].includes(e.role)&&e.propertyId&&m(e.propertyId)},[e]),k.useEffect(()=>{(async()=>{try{const me=await we.getSystemSettings();W(me)}catch(me){console.error("Error fetching settings",me)}})()},[]);const Y=k.useMemo(()=>D?E.find(ie=>ie.code===D.code):null,[E,D]),M=k.useMemo(()=>P?Number(P.paidAmount)>=Number(P.amountUsd):!1,[P]),O=()=>{if(!D||!L)return;const ie=Math.random().toString(36).substring(2,10).toUpperCase(),me=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Solvencia de Condominio - ${D.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; line-height: 1.6; background-color: #f1f5f9; }
        .container { max-width: 800px; margin: 0 auto; background: white; border: 1px solid #e2e8f0; padding: 80px; border-radius: 40px; position: relative; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1); overflow: hidden; }
        .container::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 15px; background: linear-gradient(to right, #2563eb, #3b82f6); }
        .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 60px; border-bottom: 1px solid #f1f5f9; padding-bottom: 30px; }
        .logo { font-size: 32px; font-weight: 900; letter-spacing: -1.5px; margin-bottom: 5px; color: #0f172a; }
        .logo span { color: #2563eb; }
        .condo-name { text-transform: uppercase; font-weight: 900; color: #ea580c; font-size: 11px; letter-spacing: 3px; }
        .doc-meta { text-align: right; }
        .doc-id { font-size: 10px; font-weight: 900; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
        .title { text-align: center; font-size: 32px; font-weight: 900; text-transform: uppercase; margin: 60px 0; letter-spacing: 4px; color: #0f172a; }
        .content { font-size: 17px; text-align: justify; margin-bottom: 80px; color: #334155; }
        .content strong { color: #0f172a; font-weight: 900; }
        .info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 50px; background: #f8fafc; padding: 30px; border-radius: 25px; border: 1px solid #f1f5f9; }
        .info-item { font-size: 10px; font-weight: 900; text-transform: uppercase; color: #64748b; margin-bottom: 5px; letter-spacing: 1px; }
        .info-value { font-size: 18px; font-weight: 900; color: #0f172a; }
        .signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-top: 120px; text-align: center; }
        .sig-line { width: 100%; border-top: 2px solid #0f172a; padding-top: 15px; font-weight: 900; font-size: 13px; text-transform: uppercase; color: #0f172a; }
        .sig-label { font-size: 10px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 2px; margin-top: 5px; }
        .footer { margin-top: 100px; text-align: center; font-size: 10px; color: #94a3b8; border-top: 1px solid #f1f5f9; padding-top: 30px; font-weight: 500; }
        .watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-30deg); font-size: 150px; font-weight: 900; color: rgba(37, 99, 235, 0.04); pointer-events: none; white-space: nowrap; z-index: 0; text-transform: uppercase; }
        .stamp { position: absolute; bottom: 150px; right: 80px; width: 120px; height: 120px; border: 4px double #2563eb; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-align: center; color: #2563eb; font-size: 10px; font-weight: 900; transform: rotate(-15deg); opacity: 0.2; padding: 10px; text-transform: uppercase; }
        @media print { .no-print { display: none; } body { padding: 0; background: white; } .container { border: none; box-shadow: none; padding: 40px; } }
        .btn-print { background: #0f172a; color: white; border: none; padding: 15px 30px; border-radius: 15px; cursor: pointer; font-weight: 900; font-size: 12px; text-transform: uppercase; letter-spacing: 2px; transition: all 0.3s ease; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
        .btn-print:hover { transform: translateY(-2px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); background: #1e293b; }
    </style>
</head>
<body>
    <div class="container">
        <div class="watermark">SOLVENTE</div>
        <div class="stamp">Certificación Digital<br>SAC 2026</div>
        <div class="header">
            <div class="logo-section">
                <div class="logo">SAC <span>2026</span></div>
                <div class="condo-name">CONDOMINIO EL TEJAR</div>
            </div>
            <div class="doc-meta">
                <div class="doc-id">Documento: SOLV-2026-${D.code}</div>
                <div class="doc-id">Verificación: ${ie}</div>
            </div>
        </div>
        <div class="info-grid">
            <div>
                <div class="info-item">Ciudad y Fecha de Emisión</div>
                <div class="info-value">${X.city}, ${X.date}</div>
            </div>
            <div style="text-align: right;">
                <div class="info-item">Unidad Inmobiliaria</div>
                <div class="info-value">${D.code}</div>
            </div>
        </div>
        <div class="title">Solvencia de Condominio</div>
        <div class="content">
            Por medio de la presente se hace constar que el ciudadano(a) <strong>${X.recipientName.toUpperCase()||L.fullName.toUpperCase()}</strong>, 
            titular de la Cédula de Identidad N° <strong>${X.recipientId.toUpperCase()||"S/D"}</strong>, se encuentra 
            <strong>SOLVENTE</strong> con sus obligaciones de condominio correspondientes a la Unidad Inmobiliaria N° 
            <strong>${D.code}</strong> (${D.type} ${D.number}), 
            hasta el periodo de <strong>${Te[d].toUpperCase()} ${f}</strong>.
            <br><br>
            Se expide la presente a petición de la parte interesada, en la ciudad de ${X.city}, a los ${X.date}.
        </div>
        <div class="signatures">
            <div class="sig-box">
                <div class="sig-line">${(ee==null?void 0:ee.board_president)||"PRESIDENTE"}</div>
                <div class="sig-label">Presidente de la Junta</div>
            </div>
            <div class="sig-box">
                <div class="sig-line">${(ee==null?void 0:ee.board_secretary)||"SECRETARIO(A)"}</div>
                <div class="sig-label">Secretario(a) de la Junta</div>
            </div>
        </div>
        <div class="footer">
            Urb. Valle de Oro, C.R. El Tejar, ${X.city}, Correo: tejarcondominio@gmail.com<br>
            ESTE DOCUMENTO ES UNA CERTIFICACIÓN DIGITAL EMITIDA POR EL SISTEMA DE ADMINISTRACIÓN DE CONDOMINIOS (SAC 2026)
        </div>
    </div>
    <div style="text-align: center; margin-top: 40px;" class="no-print">
        <button onclick="window.print()" class="btn-print">Imprimir Documento Oficial</button>
    </div>
</body>
</html>
        `,Z=window.open("","_blank");Z&&(Z.document.write(me),Z.document.close())},q=()=>{if(!D||!L)return;const ie=`
URBANIZACION VALLE DE ORO
CONJUNTO RESIDENCIAL EL TEJAR
SOLVENCIA DE CONDOMINIO
SAC 2026 - KERNEL V4.1.60

CIUDAD: ${X.city.toUpperCase()}
FECHA: ${X.date.toUpperCase()}

A QUIEN PUEDA INTERESAR:

Por medio de la presente se hace constar que el ciudadano(a) ${X.recipientName.toUpperCase()||L.fullName.toUpperCase()}, titular de la Cédula de Identidad N° ${X.recipientId.toUpperCase()||"S/D"}, se encuentra SOLVENTE con sus obligaciones de condominio correspondientes a la Unidad Inmobiliaria N° ${D.code} (${D.type} ${D.number}), hasta el periodo de ${Te[d].toUpperCase()} ${f}.

Se expide la presente a petición de la parte interesada.

Atentamente,

__________________________          __________________________
${((ee==null?void 0:ee.board_president)||"PRESIDENTE").toUpperCase()}          ${((ee==null?void 0:ee.board_secretary)||"SECRETARIO(A)").toUpperCase()}
PRESIDENTE                          SECRETARIO(A)

Urb. Valle de Oro, C.R. El Tejar, ${X.city.toUpperCase()}, ${X.date.toUpperCase()}, correo: tejarcondominio@gmail.com
----------------------------------------------------------
ESTE DOCUMENTO ES UNA CERTIFICACIÓN DIGITAL EMITIDA POR EL
SISTEMA DE ADMINISTRACIÓN DE CONDOMINIOS (SAC 2026).
VERIFIQUE LA AUTENTICIDAD MEDIANTE EL CÓDIGO DE PROPIEDAD.
----------------------------------------------------------
        `,me=new Blob([ie],{type:"text/plain"}),Z=URL.createObjectURL(me),Me=document.createElement("a");Me.href=Z,Me.download=`Solvencia_${D.code}_${Te[d]}.txt`,Me.click(),URL.revokeObjectURL(Z)},z=ie=>{if(!ie)return"";let me=ie.trim();return me.startsWith("+")?me.replace(/\D/g,""):me.startsWith("0")?"58"+me.substring(1).replace(/\D/g,""):me.length===10?"58"+me.replace(/\D/g,""):me.replace(/\D/g,"")},J=()=>{if(!L||!D||!P)return"";const ie=M?"✅ SOLVENTE":"⚠️ PENDIENTE",me=Number(P.paidAmount),Z=Number(P.amountUsd),Me=Z-me;return`📄 *ACUSE DE RECIBO - SAC 2026*

Unidad: *${D.code}* (${D.type} ${D.number})
Propietario: *${L.fullName}*
------------------------------------------
📅 *Periodo:* ${Te[d]} ${f}
💰 *Monto Cuota:* $${us(Z)}
💵 *Monto Pagado:* $${us(me)}
------------------------------------------
📊 *ESTATUS:* ${ie}
`+(Me>0?`📉 *Deuda Restante:* $${us(Me)}
`:`✨ *PROPIEDAD AL DÍA*
`)+`------------------------------------------
🌍 *SOLVENCIA GLOBAL:* ${G.isFullySolvent?"✅ TOTALMENTE AL DÍA":`⚠️ DEUDA TOTAL: $${us(G.totalDebt)}`}
------------------------------------------
Fecha de Emisión: ${new Date().toLocaleDateString()}

🔗 *ACCEDER AL PORTAL:* ${Rr}

¡Gracias por su compromiso!`},re=async ie=>{if(!L||!D||!P)return;const me=J();if(ie==="whatsapp"){const Z=z(L.phone);if(!Z)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${Z}?text=${encodeURIComponent(me)}`,"_blank");return}if(ie==="share"){if(navigator.share)try{await navigator.share({title:`Acuse de Recibo - ${D.code}`,text:me.replace(/\*/g,""),url:Rr})}catch(Z){console.warn("Share failed",Z)}else alert("La función de compartir no está disponible en este navegador.");return}j(ie);try{const Z=Number(P.paidAmount),Me=Number(P.amountUsd),pe=Me-Z,he={channel:ie,messageType:"receipt",monthName:Te[d],year:f,recipients:[{name:L.fullName,email:L.email,telegramChatId:L.telegramId,propName:`${D.code} (${D.type} ${D.number})`,amount:us(Me),paid:us(Z),status:M?"Solvente":"Pendiente",balance:us(pe)}]},fe=await(await fetch(`${Ne}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(he)})).json();fe.status==="success"?alert(`¡Éxito! Recibo enviado por ${ie}.`):alert("Error: "+fe.message)}catch{alert("Error de red al enviar.")}finally{j(null)}},le=()=>{const ie=J();navigator.clipboard.writeText(ie),alert("Copiado al portapapeles")},ne=async()=>{if(R.current){N(!0);try{const me=(await rs(R.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"})).toDataURL("image/png"),Z=document.createElement("a");Z.href=me,Z.download=`Recibo_${D==null?void 0:D.code}_${Te[d]}.png`,Z.click()}catch(ie){console.error("Capture failed",ie),alert("Error al capturar imagen.")}finally{N(!1)}}},ae=async()=>{if(R.current){N(!0);try{const ie=await rs(R.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"}),me=await new Promise(pe=>ie.toBlob(pe,"image/png"));if(!me)throw new Error("Blob creation failed");const Z=`Recibo_${D==null?void 0:D.code}_${Te[d]}.png`,Me=new File([me],Z,{type:"image/png"});if(navigator.share&&navigator.canShare&&navigator.canShare({files:[Me]}))await navigator.share({files:[Me],title:`Acuse de Recibo - ${D==null?void 0:D.code}`,text:`Acuse de Recibo de ${Te[d]} ${f} para la unidad ${D==null?void 0:D.code}`});else{const pe=ie.toDataURL("image/png"),he=document.createElement("a");he.href=pe,he.download=Z,he.click(),alert("La función de compartir archivos no es compatible con este navegador. La imagen se ha descargado.")}}catch(ie){console.error("Share failed",ie),alert("Error al compartir imagen.")}finally{N(!1)}}};if(b==="receipt"&&D&&L&&P){const ie=Number(P.paidAmount),me=Number(P.amountUsd),Z=me-ie;return n.jsxs("div",{className:"max-w-4xl mx-auto space-y-8 animate-in fade-in duration-500 pb-24 px-1 print:p-0",children:[n.jsx("style",{children:`
                    @media print {
                        .print-header { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .print-header h2 { color: white !important; }
                        .print-header p, .print-header span { color: inherit; }
                        .print-header .text-blue-400 { color: #60a5fa !important; }
                        .print-header .text-blue-300 { color: #93c5fd !important; }
                        .print-header .text-emerald-400 { color: #34d399 !important; }
                        .print-header .text-amber-400 { color: #fbbf24 !important; }
                        .print-header .text-slate-400 { color: #94a3b8 !important; }
                        .print-header .bg-white/10 { background-color: rgba(255,255,255,0.15) !important; border: 1px solid rgba(255,255,255,0.3) !important; -webkit-print-color-adjust: exact; }
                        .print-header .backdrop-blur-md { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
                        .bg-slate-900 { background-color: #1e293b !important; color: white !important; -webkit-print-color-adjust: exact; }
                        .bg-slate-50 { background-color: #f8fafc !important; -webkit-print-color-adjust: exact; }
                        .bg-emerald-600 { background-color: #059669 !important; -webkit-print-color-adjust: exact; }
                        .bg-emerald-50 { background-color: #ecfdf5 !important; -webkit-print-color-adjust: exact; }
                        .bg-blue-50 { background-color: #eff6ff !important; -webkit-print-color-adjust: exact; }
                        .bg-red-50 { background-color: #fef2f2 !important; -webkit-print-color-adjust: exact; }
                    }
                `}),n.jsxs("div",{className:"flex justify-between items-center no-print",children:[n.jsxs("button",{onClick:()=>v("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(gs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Imprimir",children:n.jsx(wt,{size:20})}),n.jsx("button",{onClick:ne,disabled:_,className:"p-3 bg-indigo-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Capturar como Imagen",children:_?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Dp,{size:20})}),n.jsx("button",{onClick:ae,disabled:_,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir Imagen Directamente",children:_?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Aa,{size:20})}),n.jsx("button",{onClick:()=>re("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"WhatsApp",children:n.jsx(Ha,{size:20})}),n.jsx("button",{onClick:()=>re("telegram"),disabled:!L.telegramId||!!y,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${L.telegramId?"bg-sky-500":"bg-slate-200"}`,title:"Telegram",children:y==="telegram"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Bl,{size:20})}),n.jsx("button",{onClick:()=>re("email"),disabled:!L.email||!!y,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${L.email?"bg-indigo-600":"bg-slate-200"}`,title:"Email",children:y==="email"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Br,{size:20})}),n.jsx("button",{onClick:()=>re("share"),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir",children:n.jsx(Aa,{size:20})}),n.jsx("button",{onClick:le,className:"p-3 bg-slate-200 text-slate-600 rounded-xl shadow-lg active:scale-95 transition-all",title:"Copiar Formato",children:n.jsx(ub,{size:20})})]})]}),n.jsxs("div",{ref:R,className:"bg-white rounded-[3rem] shadow-2xl border border-slate-200 overflow-hidden print:shadow-none print:border-slate-300",children:[n.jsxs("div",{className:"p-10 bg-slate-900 text-white text-center relative overflow-hidden print-header",children:[n.jsx("div",{className:"absolute top-0 right-0 p-4 opacity-10 no-print",children:n.jsx(Gt,{size:120})}),n.jsx("h2",{className:"text-2xl font-black uppercase tracking-[0.2em] mb-2",children:"Acuse de Recibo de Pago"}),n.jsx("p",{className:"text-blue-400 font-black uppercase tracking-widest text-[10px] mb-6",children:"SAC 2026"}),n.jsxs("div",{className:"flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8 print:mt-2 print:gap-4 print:flex",children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Inmueble"}),n.jsxs("p",{className:"text-lg font-black text-blue-300 print:text-sm",children:[D.type," ",D.number]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Alícuota"}),n.jsxs("p",{className:"text-lg font-black text-emerald-400 print:text-sm",children:[(Number(D.aliquot)||0).toFixed(4),"%"]})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md print:py-1 print:px-4",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Tasa del Día"}),n.jsxs("p",{className:"text-lg font-black text-amber-400 print:text-sm",children:[o.toFixed(2)," Bs/$"]})]})]})]}),n.jsxs("div",{className:"p-10 space-y-8",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-8 border-b border-slate-100 pb-8",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Unidad Inmobiliaria"}),n.jsx("p",{className:"text-xl font-black text-blue-600 uppercase",children:D.code}),n.jsxs("p",{className:"text-xs font-bold text-slate-500 uppercase",children:[D.type," ",D.number]})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Propietario"}),n.jsx("p",{className:"text-xl font-black text-slate-900 uppercase",children:L.fullName}),n.jsxs("p",{className:"text-xs font-bold text-slate-500 uppercase",children:["Emisión: ",new Date().toLocaleDateString()]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"p-6 bg-slate-50 rounded-3xl border border-slate-100 text-center",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-2",children:"Monto Cuota"}),n.jsxs("p",{className:"text-2xl font-black text-slate-900",children:["$ ",us(me)]})]}),n.jsxs("div",{className:"p-6 bg-emerald-50 rounded-3xl border border-emerald-100 text-center",children:[n.jsx("p",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest mb-2",children:"Monto Pagado"}),n.jsxs("p",{className:"text-2xl font-black text-emerald-700",children:["$ ",us(ie)]})]}),n.jsxs("div",{className:`p-6 rounded-3xl border text-center ${Z<=0?"bg-blue-50 border-blue-100":"bg-red-50 border-red-100"}`,children:[n.jsx("p",{className:`text-[10px] font-black uppercase tracking-widest mb-2 ${Z<=0?"text-blue-600":"text-red-600"}`,children:Z<=0?"Saldo a Favor":"Deuda Pendiente"}),n.jsxs("p",{className:`text-2xl font-black ${Z<=0?"text-blue-700":"text-red-700"}`,children:["$ ",us(Math.abs(Z))]})]})]}),n.jsxs("div",{className:`rounded-[2.5rem] p-10 text-white shadow-xl flex flex-col md:flex-row justify-between items-center gap-6 ${M?"bg-emerald-600":"bg-slate-800"}`,children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-16 h-16 bg-white/20 rounded-2xl flex items-center justify-center",children:M?n.jsx(Gt,{size:40}):n.jsx(Sr,{size:40})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-white/60 uppercase tracking-[0.3em] mb-1",children:"Estatus del Periodo"}),n.jsx("h3",{className:"text-4xl font-black tracking-tighter uppercase",children:M?"Solvente":"Pendiente"})]})]}),n.jsxs("div",{className:"flex flex-col items-center md:items-end gap-4",children:[n.jsxs("div",{className:"text-center md:text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-white/60 uppercase tracking-widest mb-1",children:"Periodo Correspondiente"}),n.jsxs("p",{className:"text-2xl font-black text-white tracking-tight uppercase",children:[Te[d]," ",f]})]}),M&&n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsxs("button",{onClick:()=>{K(Me=>({...Me,mode:"html"})),H(!0)},className:"bg-blue-600 text-white px-6 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-lg hover:bg-blue-700 transition-all flex items-center gap-2 active:scale-95",children:[n.jsx(wr,{size:16}),"Solvencia HTML Pro"]}),n.jsxs("button",{onClick:()=>{K(Me=>({...Me,mode:"txt"})),H(!0)},className:"bg-white text-emerald-600 px-6 py-3 rounded-xl font-black text-[10px] uppercase tracking-widest shadow-lg hover:bg-emerald-50 transition-all flex items-center gap-2 active:scale-95",children:[n.jsx(yr,{size:16}),"Generar Solvencia .TXT"]})]})]})]}),n.jsxs("div",{className:"p-8 bg-slate-50 rounded-[2rem] border border-slate-100 flex flex-col md:flex-row justify-between items-center gap-4",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:`w-10 h-10 rounded-xl flex items-center justify-center ${G.isFullySolvent?"bg-emerald-100 text-emerald-600":"bg-red-100 text-red-600"}`,children:n.jsx(Ia,{size:20})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Solvencia Global de la Propiedad"}),n.jsx("p",{className:`text-sm font-black uppercase ${G.isFullySolvent?"text-emerald-600":"text-red-600"}`,children:G.isFullySolvent?"Completamente Solvente":`Deuda Total Acumulada: $ ${us(G.totalDebt)}`}),Y&&Y.current_debt>0&&n.jsxs("div",{className:"mt-2 pt-2 border-t border-slate-200",children:[n.jsxs("p",{className:"text-[9px] font-bold text-rose-500 uppercase leading-tight",children:["Deuda Anterior (Convenio): ",n.jsxs("span",{className:"font-black",children:["$",us(Y.current_debt)]})]}),n.jsx("button",{onClick:()=>r==null?void 0:r("individual-account-status"),className:"text-[8px] font-black text-blue-600 uppercase tracking-tighter hover:underline mt-1 block",children:"Ver en Estado de Cuenta Individual"})]})]})]}),!G.isFullySolvent&&n.jsx("div",{className:"px-4 py-2 bg-red-600 text-white text-[9px] font-black uppercase tracking-widest rounded-lg",children:"Acción Requerida"})]}),P.payments&&P.payments.length>0&&n.jsxs("div",{className:"space-y-4",children:[n.jsx("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest ml-2",children:"Detalle de Pagos Registrados"}),n.jsx("div",{className:"space-y-3",children:P.payments.map((Me,pe)=>n.jsxs("div",{className:"flex justify-between items-center p-4 bg-slate-50 border border-slate-100 rounded-2xl",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-white rounded-xl flex items-center justify-center text-blue-600 shadow-sm",children:n.jsx(br,{size:18})}),n.jsxs("div",{children:[n.jsxs("p",{className:"text-xs font-black text-slate-900 uppercase",children:[Me.method," - Ref: ",Me.reference]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest",children:[Me.date," • ",Me.slot]})]})]}),n.jsxs("p",{className:"text-sm font-black text-slate-900",children:["$ ",us(Me.amount)]})]},pe))})]}),n.jsx("div",{className:"pt-8 border-t border-slate-100 text-center",children:n.jsx("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.5em]",children:"SAC 2026 • Kernel V4.1.85 MC/MB • Certificación Digital"})})]})]}),Q&&D&&n.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-slate-900/60 backdrop-blur-sm animate-in fade-in duration-300",children:n.jsxs("div",{className:"bg-white w-full max-w-2xl rounded-[3rem] shadow-2xl overflow-hidden border border-slate-200 animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"p-8 bg-slate-900 text-white flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-2xl flex items-center justify-center shadow-lg shadow-blue-500/20",children:n.jsx(yr,{size:24})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black tracking-tight uppercase",children:"Generar Solvencia"}),n.jsx("p",{className:"text-slate-400 text-[10px] font-bold uppercase tracking-widest",children:"Complete los datos del documento"})]})]}),n.jsx("button",{onClick:()=>H(!1),className:"p-3 hover:bg-white/10 rounded-2xl transition-colors",children:n.jsx(mt,{size:24})})]}),n.jsxs("div",{className:"p-10 space-y-8",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(Wr,{size:14})," Fecha del Documento"]}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl px-6 py-4 font-bold outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:X.date,onChange:Me=>K({...X,date:Me.target.value}),placeholder:"Ej: 20 de Marzo de 2026"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(IM,{size:14})," Ciudad"]}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl px-6 py-4 font-bold outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:X.city,onChange:Me=>K({...X,city:Me.target.value}),placeholder:"Ej: San Diego"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(tu,{size:14})," Dirigido a (Nombre)"]}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl px-6 py-4 font-bold outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:X.recipientName,onChange:Me=>K({...X,recipientName:Me.target.value}),placeholder:"Nombre completo"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(Fp,{size:14})," Cédula de Identidad"]}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl px-6 py-4 font-bold outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:X.recipientId,onChange:Me=>K({...X,recipientId:Me.target.value}),placeholder:"V-00.000.000"})]})]}),n.jsxs("div",{className:"p-6 bg-blue-50 border border-blue-100 rounded-3xl space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Ia,{size:20,className:"text-blue-600"}),n.jsx("h4",{className:"text-xs font-black text-blue-900 uppercase tracking-widest",children:"Datos Automáticos del Sistema"})]}),n.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[n.jsxs("div",{className:"bg-white/50 p-3 rounded-xl border border-blue-100",children:[n.jsx("p",{className:"text-[8px] font-black text-blue-400 uppercase mb-1",children:"Inmueble"}),n.jsx("p",{className:"text-[10px] font-black text-blue-900",children:D.code})]}),n.jsxs("div",{className:"bg-white/50 p-3 rounded-xl border border-blue-100",children:[n.jsx("p",{className:"text-[8px] font-black text-blue-400 uppercase mb-1",children:"Presidente"}),n.jsx("p",{className:"text-[10px] font-black text-blue-900",children:(ee==null?void 0:ee.board_president)||"No configurado"})]}),n.jsxs("div",{className:"bg-white/50 p-3 rounded-xl border border-blue-100",children:[n.jsx("p",{className:"text-[8px] font-black text-blue-400 uppercase mb-1",children:"Secretario(a)"}),n.jsx("p",{className:"text-[10px] font-black text-blue-900",children:(ee==null?void 0:ee.board_secretary)||"No configurado"})]})]})]}),n.jsxs("div",{className:"flex gap-4",children:[n.jsx("button",{onClick:()=>H(!1),className:"flex-1 bg-slate-100 text-slate-500 py-5 rounded-2xl font-black text-xs uppercase tracking-widest hover:bg-slate-200 transition-all active:scale-95",children:"Cancelar"}),X.mode==="html"?n.jsxs("button",{onClick:()=>{O(),H(!1)},className:"flex-1 bg-blue-600 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-blue-100 hover:bg-blue-700 transition-all active:scale-95 flex items-center justify-center gap-3",children:[n.jsx(wr,{size:18}),"GENERAR SOLVENCIA HTML"]}):n.jsxs("button",{onClick:()=>{q(),H(!1)},className:"flex-1 bg-emerald-600 text-white py-5 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl shadow-emerald-100 hover:bg-emerald-700 transition-all active:scale-95 flex items-center justify-center gap-3",children:[n.jsx(Gs,{size:18}),"DESCARGAR SOLVENCIA .TXT"]})]})]})]})})]})}return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Estatus de ",n.jsx("span",{className:"text-blue-600",children:"Pago y Solvencia"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Consulte la solvencia de cualquier unidad y genere acuses de recibo."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:d,onChange:ie=>u(Number(ie.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Te.map((ie,me)=>n.jsx("option",{value:me,children:ie},me))}),n.jsx("input",{type:"number",value:f,onChange:ie=>p(Number(ie.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-emerald-50 text-emerald-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(Ia,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Consultar Unidad"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Seleccione la propiedad para verificar su estatus de pago."})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(ea,{size:14})," Unidad Inmobiliaria"]}),n.jsxs("select",{value:h||"",onChange:ie=>m(Number(ie.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),s.filter(ie=>["admin","programmer"].includes(e.role)?!0:ie.id===e.propertyId).sort((ie,me)=>ie.code.localeCompare(me.code,void 0,{numeric:!0})).map(ie=>n.jsxs("option",{value:ie.id,children:[ie.code," - ",ie.type," ",ie.number]},ie.id))]})]}),h&&Y&&Y.current_debt>0&&n.jsxs("div",{className:"p-6 bg-rose-50 border border-rose-100 rounded-3xl animate-in zoom-in",children:[n.jsxs("div",{className:"flex items-center gap-3 text-rose-600 mb-2",children:[n.jsx(Sr,{size:18}),n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"Atención: Deuda Anterior Detectada"})]}),n.jsxs("p",{className:"text-sm font-black text-rose-700 uppercase tracking-tight",children:["Esta unidad presenta un convenio de pago activo por: ",n.jsxs("span",{className:"text-lg tracking-tighter",children:["$",us(Y.current_debt)]})]}),n.jsxs("button",{onClick:()=>r==null?void 0:r("individual-account-status"),className:"mt-3 text-[9px] font-black text-blue-600 uppercase tracking-widest hover:underline flex items-center gap-2",children:[n.jsx(gs,{size:12,className:"rotate-180"}),' Diríjase al menú "Estado de Cuenta Individual" para más detalles']})]}),n.jsxs("button",{disabled:!h||!U,onClick:()=>v("receipt"),className:"w-full bg-slate-900 hover:bg-slate-800 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-slate-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:["VER ESTATUS Y RECIBO ",n.jsx(Hs,{size:18})]}),!U&&h&&n.jsxs("div",{className:"p-4 bg-amber-50 border border-amber-100 rounded-2xl flex items-center gap-3 text-amber-600 animate-in fade-in",children:[n.jsx(Sr,{size:18,className:"shrink-0"}),n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"No se encontraron cuotas generadas para este periodo."})]})]})})]})},km=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},jm=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},JIe=({user:e})=>{const{properties:t,latestRate:r}=ht(),[a,s]=k.useState(!1),[i,l]=k.useState([]),[o,d]=k.useState(""),[u,f]=k.useState(null),p=async()=>{s(!0);try{const j=await we.getCreditBalances();l(j)}catch(j){console.error("Error fetching credit balances",j)}finally{s(!1)}};k.useEffect(()=>{p()},[]);const h=k.useMemo(()=>i.filter(j=>j.propertyCode.toLowerCase().includes(o.toLowerCase())||j.ownerName.toLowerCase().includes(o.toLowerCase())),[i,o]),m=k.useMemo(()=>u?i.find(j=>j.propertyId===u):null,[i,u]),b=()=>{const j=i.map(E=>({Código:E.propertyCode,Propietario:E.ownerName,"Saldo Favor (USD)":E.amountUsd,"Saldo Favor (Bs)":E.amountBs,"Última Actualización":E.lastUpdate,Observaciones:E.observations||""})),_=mi.json_to_sheet(j),N=mi.book_new();mi.book_append_sheet(N,_,"Saldos a Favor"),LE(N,`Saldos_a_Favor_${new Date().toISOString().split("T")[0]}.xlsx`)},v=()=>{const j=window.open("","","width=900,height=900");if(!j)return;const _=h.map(N=>`
            <tr>
                <td style="padding:10px; border-bottom:1px solid #eee;">${N.propertyCode}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${N.ownerName}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${km(N.amountUsd)}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">Bs. ${jm(N.amountBs)}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${N.lastUpdate}</td>
            </tr>
        `).join("");j.document.write(`
            <html>
            <head>
                <title>Saldos a Favor - Reporte</title>
                <style>
                    body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; }
                    .header { text-align: center; border-bottom: 4px solid #10b981; padding-bottom: 20px; margin-bottom: 30px; }
                    h1 { margin: 0; font-size: 24px; text-transform: uppercase; color: #065f46; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th { text-align: left; padding: 12px; background: #065f46; color: white; font-size: 11px; text-transform: uppercase; }
                    .footer { margin-top: 50px; font-size: 10px; text-align: center; color: #94a3b8; border-top: 1px solid #eee; padding-top: 20px; }
                </style>
            </head>
            <body>
                <div class="header">
                    <h1>SALDOS A FAVOR / EXCEDENTES</h1>
                    <p>Condominio Residencial El Tejar | SAC 2026</p>
                </div>
                <table>
                    <thead>
                        <tr>
                            <th>Unidad</th>
                            <th>Propietario</th>
                            <th>Monto USD</th>
                            <th>Monto Bs</th>
                            <th>Actualización</th>
                        </tr>
                    </thead>
                    <tbody>${_}</tbody>
                </table>
                <div class="footer">Reporte generado el ${new Date().toLocaleString()} • SAC Kernel V4.1.19</div>
            </body>
            </html>
        `),j.document.close(),j.print()},y=()=>{const j=h.map(B=>`
            <tr>
                <td>${B.propertyCode}</td>
                <td>${B.ownerName}</td>
                <td>$${km(B.amountUsd)}</td>
                <td>Bs. ${jm(B.amountBs)}</td>
                <td>${B.lastUpdate}</td>
                <td>${B.observations||""}</td>
            </tr>
        `).join(""),_=`
            <!DOCTYPE html>
            <html lang="es">
            <head>
                <meta charset="UTF-8">
                <title>Saldos a Favor - Exportación</title>
                <style>
                    body { font-family: Arial, sans-serif; padding: 30px; line-height: 1.6; }
                    h1 { color: #065f46; border-bottom: 2px solid #10b981; padding-bottom: 10px; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                    th { background-color: #f8fafc; font-size: 12px; text-transform: uppercase; color: #64748b; }
                    tr:nth-child(even) { background-color: #f9fafb; }
                </style>
            </head>
            <body>
                <h1>Listado de Saldos a Favor</h1>
                <p>Fecha de generación: ${new Date().toLocaleString()}</p>
                <table>
                    <thead>
                        <tr>
                            <th>Unidad</th>
                            <th>Propietario</th>
                            <th>Monto USD</th>
                            <th>Monto Bs</th>
                            <th>Última Actualización</th>
                            <th>Observaciones</th>
                        </tr>
                    </thead>
                    <tbody>${j}</tbody>
                </table>
            </body>
            </html>
        `,N=new Blob([_],{type:"text/html"}),E=URL.createObjectURL(N),T=document.createElement("a");T.href=E,T.download=`Saldos_a_Favor_${new Date().toISOString().split("T")[0]}.html`,T.click(),URL.revokeObjectURL(E)};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Saldos a ",n.jsx("span",{className:"text-emerald-600",children:"Favor"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Gestión de excedentes y pagos anticipados para el próximo mes."})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("button",{onClick:v,className:"flex items-center gap-3 px-6 py-4 bg-slate-800 hover:bg-slate-900 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all shadow-xl active:scale-95",children:[n.jsx(wt,{size:18})," Imprimir"]}),n.jsxs("button",{onClick:y,className:"flex items-center gap-3 px-6 py-4 bg-blue-600 hover:bg-blue-700 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all shadow-xl shadow-blue-200 active:scale-95",children:[n.jsx(Zd,{size:18})," Exportar HTML"]}),n.jsxs("button",{onClick:b,className:"flex items-center gap-3 px-6 py-4 bg-emerald-600 hover:bg-emerald-700 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all shadow-xl shadow-emerald-200 active:scale-95",children:[n.jsx(gl,{size:18})," Exportar Excel"]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[n.jsxs("div",{className:"lg:col-span-1 space-y-6",children:[n.jsxs("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 shadow-sm p-8",children:[n.jsxs("h3",{className:"text-xs font-black uppercase tracking-widest text-slate-400 mb-6 flex items-center gap-2",children:[n.jsx(ea,{size:14,className:"text-blue-600"})," Consultar Unidad"]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("select",{value:u||"",onChange:j=>f(Number(j.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),t.sort((j,_)=>j.code.localeCompare(_.code,void 0,{numeric:!0})).map(j=>n.jsxs("option",{value:j.id,children:[j.code," - ",j.type," ",j.number]},j.id))]}),m?n.jsxs("div",{className:"p-6 bg-emerald-50 rounded-3xl border border-emerald-100 animate-in zoom-in",children:[n.jsx("p",{className:"text-[10px] font-black text-emerald-600 uppercase tracking-widest mb-4",children:"Estatus de Excedente"}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsxs("p",{className:"text-3xl font-black text-emerald-700 tracking-tighter",children:["$ ",km(m.amountUsd)]}),n.jsxs("p",{className:"text-sm font-bold text-emerald-600 uppercase",children:["Bs. ",jm(m.amountBs)]})]}),n.jsxs("div",{className:"pt-4 border-t border-emerald-200/50",children:[n.jsx("p",{className:"text-[9px] font-bold text-emerald-600 uppercase tracking-widest",children:"Última Actualización"}),n.jsx("p",{className:"text-xs font-black text-emerald-800",children:m.lastUpdate})]})]})]}):u?n.jsxs("div",{className:"p-6 bg-slate-50 rounded-3xl border border-dashed border-slate-200 text-center",children:[n.jsx(Gt,{size:24,className:"text-slate-300 mx-auto mb-2"}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"Sin saldo a favor registrado"})]}):null]})]}),n.jsxs("div",{className:"bg-blue-600 rounded-[2.5rem] p-8 text-white shadow-xl shadow-blue-200",children:[n.jsx("div",{className:"w-12 h-12 bg-white/20 rounded-2xl flex items-center justify-center mb-6",children:n.jsx(Sr,{size:24})}),n.jsx("h4",{className:"text-lg font-black tracking-tight mb-2 uppercase",children:"Nota Importante"}),n.jsx("p",{className:"text-blue-100 text-xs font-medium leading-relaxed",children:"Los saldos a favor se aplican automáticamente en la siguiente facturación. Si el monto no se refleja, debe cargarse manualmente en el módulo de cuotas."})]})]}),n.jsxs("div",{className:"lg:col-span-2 bg-white rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden flex flex-col",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 flex flex-col md:flex-row justify-between items-center gap-4",children:[n.jsxs("h3",{className:"text-xs font-black uppercase tracking-widest text-slate-400 flex items-center gap-2",children:[n.jsx(Da,{size:14,className:"text-blue-600"})," Listado de Excedentes"]}),n.jsxs("div",{className:"relative w-full md:w-64",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:16}),n.jsx("input",{type:"text",placeholder:"Buscar unidad o nombre...",className:"w-full bg-slate-50 border border-slate-100 rounded-xl pl-11 pr-4 py-3 text-xs font-bold outline-none focus:ring-2 focus:ring-blue-500/20",value:o,onChange:j=>d(j.target.value)})]})]}),n.jsx("div",{className:"flex-1 overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50/50",children:[n.jsx("th",{className:"px-8 py-5 text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100",children:"Unidad"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100",children:"Propietario"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100 text-right",children:"Monto (USD)"}),n.jsx("th",{className:"px-8 py-5 text-[10px] font-black text-slate-400 uppercase tracking-widest border-b border-slate-100 text-right",children:"Monto (Bs)"})]})}),n.jsx("tbody",{children:a?n.jsx("tr",{children:n.jsxs("td",{colSpan:4,className:"px-8 py-20 text-center",children:[n.jsx($t,{className:"animate-spin text-blue-600 mx-auto mb-4",size:32}),n.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest",children:"Cargando saldos..."})]})}):h.length>0?h.map(j=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-6 border-b border-slate-50",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-blue-50 text-blue-600 rounded-lg flex items-center justify-center font-black text-[10px]",children:j.propertyCode}),n.jsxs("span",{className:"text-xs font-black text-slate-900 uppercase tracking-tighter",children:["Unidad ",j.propertyCode]})]})}),n.jsxs("td",{className:"px-8 py-6 border-b border-slate-50",children:[n.jsx("p",{className:"text-xs font-bold text-slate-700 uppercase",children:j.ownerName}),n.jsxs("p",{className:"text-[9px] font-medium text-slate-400 uppercase tracking-widest",children:["Act: ",j.lastUpdate]})]}),n.jsx("td",{className:"px-8 py-6 border-b border-slate-50 text-right",children:n.jsxs("span",{className:"text-sm font-black text-emerald-600",children:["$ ",km(j.amountUsd)]})}),n.jsx("td",{className:"px-8 py-6 border-b border-slate-50 text-right",children:n.jsxs("span",{className:"text-xs font-bold text-slate-400",children:["Bs. ",jm(j.amountBs)]})})]},j.id)):n.jsx("tr",{children:n.jsxs("td",{colSpan:4,className:"px-8 py-20 text-center",children:[n.jsx("div",{className:"w-16 h-16 bg-slate-50 rounded-2xl flex items-center justify-center mx-auto mb-4 text-slate-200",children:n.jsx(er,{size:32})}),n.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest",children:"No se encontraron saldos a favor"})]})})})]})})]})]})]})},ZIe=({user:e})=>{const[t,r]=k.useState([]),[a,s]=k.useState(!0),[i,l]=k.useState(!1),[o,d]=k.useState(null),u=async()=>{s(!0);try{const m=await we.getMonthlyCollectionHistory();r(m)}catch(m){console.error("Fetch Monthly Collection Error",m)}finally{s(!1)}};k.useEffect(()=>{u()},[]);const f=async()=>{l(!0);try{const m=await we.syncMonthlyCollection();m.success?u():alert(m.message||"Error al sincronizar")}catch(m){console.error("Sync Error",m),alert("Error de conexión al sincronizar")}finally{l(!1)}},p=async m=>{try{(await we.deleteMonthlyCollection(m)).success&&(r(v=>v.filter(y=>y.id!==m)),d(null))}catch(b){console.error("Delete Error",b)}},h=async()=>{if(navigator.share)try{await navigator.share({title:"Recaudación Mensual - SAC 2026",text:"Consulta el histórico de recaudación mensual del condominio.",url:window.location.href})}catch(m){console.log("Error sharing",m)}else alert("La función de compartir no está disponible en este navegador.")};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-20 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-blue-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-blue-600 w-fit px-5 py-2 rounded-full border border-blue-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(da,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Histórico de Gestión Financiera"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Recaudación ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-500 italic",children:"Mensual"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Registro histórico comparativo entre lo facturado y lo efectivamente recaudado mes a mes."'})]}),n.jsxs("div",{className:"bg-white/5 backdrop-blur-xl p-8 rounded-[3rem] border border-white/10 flex flex-col items-center text-center min-w-[280px]",children:[n.jsx(br,{size:48,className:"text-blue-400 mb-4"}),n.jsx("p",{className:"text-[10px] font-black text-blue-300 uppercase tracking-widest mb-1",children:"Transparencia Total"}),n.jsx("p",{className:"text-sm text-slate-300 font-medium leading-relaxed",children:"Visualización de eficiencia en la cobranza para la junta de condominio y propietarios."})]})]}),n.jsx(xo,{className:"absolute right-[-40px] bottom-[-40px] w-96 h-96 text-white/[0.03] pointer-events-none"})]}),n.jsxs("div",{className:"flex justify-end gap-4",children:[["admin","programmer"].includes(e.role)&&n.jsxs("button",{onClick:f,disabled:i,className:"px-6 py-4 bg-blue-600 text-white rounded-2xl hover:bg-blue-700 transition-all border border-blue-500 shadow-lg flex items-center gap-3 font-black text-[10px] uppercase tracking-widest disabled:opacity-50",children:[n.jsx(Kr,{size:18,className:i?"animate-pulse":""}),i?"Sincronizando...":"Sincronizar Histórico"]}),n.jsx("button",{onClick:u,className:"p-4 bg-white rounded-2xl text-slate-400 hover:text-blue-600 transition-all border border-slate-200 shadow-sm",children:n.jsx(ct,{size:20,className:a?"animate-spin":""})})]}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Mes / Año"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Facturado ($)"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Recaudado ($)"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Eficiencia"}),["admin","programmer"].includes(e.role)&&n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:a?n.jsx("tr",{children:n.jsx("td",{colSpan:4,className:"py-32 text-center",children:n.jsx(ct,{className:"animate-spin text-blue-600 mx-auto",size:40})})}):t.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:4,className:"py-32 text-center",children:[n.jsx(Wr,{size:48,className:"mx-auto mb-4 text-slate-100"}),n.jsx("p",{className:"text-slate-300 font-black uppercase tracking-widest text-xs italic",children:"No hay registros históricos de recaudación aún"})]})}):t.map((m,b)=>{const v=m.amountBilled>0?m.amountCollected/m.amountBilled*100:0;return n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-100 rounded-xl flex items-center justify-center text-slate-400 group-hover:bg-blue-50 group-hover:text-blue-600 transition-colors",children:n.jsx(Wr,{size:18})}),n.jsxs("span",{className:"font-black text-slate-900 text-lg uppercase",children:[Te[m.month]," ",m.year]})]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("span",{className:"text-xl font-black tracking-tighter text-slate-700",children:["$ ",Number(m.amountBilled).toLocaleString("en-US",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("span",{className:"text-xl font-black tracking-tighter text-emerald-600",children:["$ ",Number(m.amountCollected).toLocaleString("en-US",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("div",{className:"flex flex-col items-center gap-1",children:[n.jsxs("span",{className:`px-4 py-1.5 rounded-full text-[10px] font-black uppercase tracking-widest border ${v>=90?"bg-emerald-50 text-emerald-600 border-emerald-100":v>=70?"bg-blue-50 text-blue-600 border-blue-100":"bg-amber-50 text-amber-600 border-amber-100"}`,children:[v.toFixed(1),"%"]}),n.jsx("div",{className:"w-24 h-1 bg-slate-100 rounded-full overflow-hidden",children:n.jsx("div",{className:`h-full transition-all duration-1000 ${v>=90?"bg-emerald-500":v>=70?"bg-blue-500":"bg-amber-500"}`,style:{width:`${Math.min(v,100)}%`}})})]})}),["admin","programmer"].includes(e.role)&&n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsx("button",{onClick:()=>d(m.id),className:"p-3 text-slate-400 hover:text-red-600 hover:bg-red-50 rounded-xl transition-all",title:"Eliminar registro",children:n.jsx(Ua,{size:18})})})]},b)})})]})}),n.jsxs("div",{className:"p-10 bg-slate-50 border-t border-slate-100 flex flex-col md:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"p-3 bg-white rounded-2xl shadow-sm border border-slate-200",children:n.jsx(da,{className:"text-blue-500",size:24})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[11px] font-black text-slate-900 uppercase tracking-widest",children:"Reporte de Recaudación Mensual"}),n.jsx("p",{className:"text-[9px] text-slate-400 font-bold uppercase tracking-widest",children:Ln})]})]}),n.jsxs("div",{className:"flex flex-wrap justify-center gap-4",children:[n.jsxs("button",{onClick:()=>{const m=["Mes / Año","Monto Facturado ($)","Monto Recaudado ($)","Eficiencia (%)"],b=t.map(v=>[`${Te[v.month]} ${v.year}`,`$ ${Number(v.amountBilled).toLocaleString("en-US",{minimumFractionDigits:2})}`,`$ ${Number(v.amountCollected).toLocaleString("en-US",{minimumFractionDigits:2})}`,`${(v.amountCollected/v.amountBilled*100).toFixed(1)}%`]);$c("Recaudación Mensual Histórica",m,b)},className:"px-8 py-3 bg-blue-600 text-white hover:bg-blue-700 transition-all border border-blue-500 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2",children:[n.jsx(yr,{size:16})," Exportar HTML"]}),n.jsxs("button",{onClick:h,className:"px-8 py-3 bg-white hover:bg-slate-100 text-slate-600 transition-all border border-slate-200 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2",children:[n.jsx(Aa,{size:16})," Compartir"]}),n.jsxs("button",{onClick:()=>window.print(),className:"px-8 py-3 bg-white hover:bg-slate-900 hover:text-white transition-all border border-slate-200 rounded-xl font-black text-[10px] uppercase tracking-widest flex items-center gap-2",children:[n.jsx(wt,{size:16})," Imprimir"]})]})]})]}),o!==null&&n.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-6 backdrop-blur-md bg-slate-900/40 animate-in fade-in duration-300",children:n.jsx("div",{className:"bg-white rounded-[3rem] w-full max-w-md p-10 shadow-2xl border border-slate-100 animate-in zoom-in-95 duration-300",children:n.jsxs("div",{className:"flex flex-col items-center text-center",children:[n.jsx("div",{className:"w-20 h-20 bg-red-50 rounded-full flex items-center justify-center text-red-600 mb-6",children:n.jsx(Xr,{size:40})}),n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tighter mb-2",children:"¿Eliminar Registro?"}),n.jsx("p",{className:"text-slate-500 text-sm font-medium leading-relaxed mb-8",children:"Esta acción eliminará el histórico de este mes. Podrás volver a generarlo usando el botón de sincronización."}),n.jsxs("div",{className:"flex w-full gap-4",children:[n.jsx("button",{onClick:()=>d(null),className:"flex-1 py-4 bg-slate-100 text-slate-600 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-200 transition-all",children:"Cancelar"}),n.jsx("button",{onClick:()=>p(o),className:"flex-1 py-4 bg-red-600 text-white rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-red-700 transition-all shadow-lg shadow-red-200",children:"Eliminar"})]})]})})})]})},xf=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},dN=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},eFe=({user:e})=>{const{properties:t,residents:r,latestRate:a,fees:s}=ht(),[i,l]=k.useState([]),[o,d]=k.useState(!0),[u,f]=k.useState(!1),[p,h]=k.useState(null),[m,b]=k.useState(!1),v=async Y=>{if(!(!Y||Y==="S/R"||Y.length<3))try{const O=await(await fetch(`${Ne}/check_duplicate_reference.php?reference=${Y}`,{credentials:"include"})).json();O.duplicate?h(O):h(null)}catch(M){console.error("Error checking duplicate",M)}},[y,j]=k.useState((e.role==="owner","list")),[_,N]=k.useState([]),[E,T]=k.useState({amountUsd:"",amountBs:"",paymentDate:new Date().toISOString().split("T")[0],reference:"",bankName:"",method:"Transferencia",observations:""}),[B,F]=k.useState(""),[R,U]=k.useState("Pendiente"),[D,L]=k.useState(null),[P,G]=k.useState({status:"",observations:"",assignedTo:"",targetId:""}),Q=["admin","programmer","board"].includes(e.role),H=async()=>{d(!0);try{const[Y,M]=await Promise.all([we.getPaymentReports(e.role==="owner"?e.propertyId:void 0),we.getInitialDebtData()]);l(Y),N(Array.isArray(M)?M:M.data||[])}catch(Y){console.error("Error loading reports",Y)}finally{d(!1)}};k.useEffect(()=>{H()},[e.propertyId,e.role]);const X=async Y=>{if(Y.preventDefault(),p&&!m)if(e.role==="owner"){alert("ATENCIÓN: Este número de transferencia ya existe en el sistema. Por favor, verifique nuevamente. Si el código es correcto y el problema persiste, debe enviar el pago directamente a la administración para su procesamiento manual.");return}else{alert("ALERTA DE SEGURIDAD: Este código de transferencia ya ha sido utilizado. Verifique la información mostrada en el recuadro de alerta. Para proceder, debe marcar la casilla de autorización del programador/administrador.");return}if(!e.propertyId)return;const M=t.find(q=>q.id===e.propertyId),O=r.find(q=>q.propertyId===e.propertyId&&q.isOwner);f(!0);try{const q={...E,propertyId:e.propertyId,propertyCode:(M==null?void 0:M.code)||"",ownerName:(O==null?void 0:O.fullName)||e.fullName,exchangeRate:a,amountUsd:Number(E.amountUsd)||Number(E.amountBs)/a,amountBs:Number(E.amountBs)||Number(E.amountUsd)*a};await we.savePaymentReport(q),alert("Reporte enviado exitosamente. Será revisado por la administración."),T({amountUsd:"",amountBs:"",paymentDate:new Date().toISOString().split("T")[0],reference:"",bankName:"",method:"Transferencia",observations:""}),j("list"),H()}catch{alert("Error al enviar el reporte.")}finally{f(!1)}},K=async()=>{if(D){f(!0);try{await we.updatePaymentReportStatus(D.id,P.status,P.observations,P.assignedTo,P.targetId),alert("Estatus actualizado."),L(null),H()}catch{alert("Error al actualizar.")}finally{f(!1)}}},ee=k.useMemo(()=>i.filter(Y=>{const M=Y.propertyCode.toLowerCase().includes(B.toLowerCase())||Y.ownerName.toLowerCase().includes(B.toLowerCase()),O=R==="Todos"||Y.status===R;return M&&O}),[i,B,R]),W=k.useMemo(()=>{if(e.role!=="owner"||!e.propertyId)return null;let Y=0;s.forEach(q=>{const z=q.debts.find(J=>J.propertyId===e.propertyId);z&&z.status!=="Pagado"&&(Y+=Number(z.amountUsd)-Number(z.paidAmount||0))});const M=_.find(q=>q.id===e.propertyId),O=(M==null?void 0:M.current_debt)||0;return{totalFees:Y,agreementDebt:O,total:Y+O}},[e.propertyId,e.role,s,_]);return o?n.jsxs("div",{className:"flex flex-col items-center justify-center py-20 gap-4",children:[n.jsx($t,{className:"animate-spin text-blue-600",size:40}),n.jsx("p",{className:"text-slate-400 font-black text-[10px] uppercase tracking-widest",children:"Cargando Reportes..."})]}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Reporte de ",n.jsx("span",{className:"text-blue-600",children:"Pago"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Almacén de información de pagos para revisión administrativa."})]}),e.role==="owner"&&y==="list"&&n.jsxs("button",{onClick:()=>j("form"),className:"bg-blue-600 hover:bg-blue-700 text-white px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center gap-2",children:[n.jsx(zs,{size:16})," Reportar Nuevo Pago"]}),e.role==="owner"&&y==="form"&&n.jsxs("button",{onClick:()=>j("list"),className:"bg-white border border-slate-200 text-slate-500 px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-sm hover:bg-slate-50 transition-all flex items-center gap-2",children:[n.jsx(Da,{size:16})," Ver Mis Reportes"]})]}),e.role==="owner"&&y==="form"&&n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[n.jsx("div",{className:"lg:col-span-2",children:n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("form",{onSubmit:X,className:"space-y-8",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Monto en Divisa ($)"}),n.jsxs("div",{className:"relative",children:[n.jsx(kn,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"number",step:"0.01",required:!0,placeholder:"0.00",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm font-black text-slate-800 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:E.amountUsd,onChange:Y=>{const M=Y.target.value;T({...E,amountUsd:M,amountBs:M?(Number(M)*a).toFixed(2):""})}})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Monto en Bolívares (Bs)"}),n.jsxs("div",{className:"relative",children:[n.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 font-bold text-xs",children:"Bs"}),n.jsx("input",{type:"number",step:"0.01",required:!0,placeholder:"0.00",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm font-black text-slate-800 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:E.amountBs,onChange:Y=>{const M=Y.target.value;T({...E,amountBs:M,amountUsd:M?(Number(M)/a).toFixed(2):""})}})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Fecha del Pago"}),n.jsxs("div",{className:"relative",children:[n.jsx(Wr,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"date",required:!0,className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm font-black text-slate-800 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:E.paymentDate,onChange:Y=>T({...E,paymentDate:Y.target.value})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Referencia / Comprobante"}),n.jsxs("div",{className:"relative",children:[n.jsx(ca,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",required:!0,placeholder:"Últimos 4-6 dígitos",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm font-black text-slate-800 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:E.reference,onChange:Y=>{const M=Y.target.value;T({...E,reference:M}),M.length>=3&&v(M)}})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Banco Emisor"}),n.jsxs("div",{className:"relative",children:[n.jsx(br,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",required:!0,placeholder:"Ej: Banesco, Mercantil...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm font-black text-slate-800 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:E.bankName,onChange:Y=>T({...E,bankName:Y.target.value})})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Método de Pago"}),n.jsxs("div",{className:"relative",children:[n.jsx(Fp,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-4 py-4 text-sm font-black text-slate-800 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none",value:E.method,onChange:Y=>T({...E,method:Y.target.value}),children:[n.jsx("option",{value:"Transferencia",children:"Transferencia"}),n.jsx("option",{value:"Pago Móvil",children:"Pago Móvil"}),n.jsx("option",{value:"Zelle",children:"Zelle"}),n.jsx("option",{value:"Efectivo",children:"Efectivo"}),n.jsx("option",{value:"Depósito",children:"Depósito"})]})]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Observaciones Adicionales"}),n.jsx("textarea",{rows:3,placeholder:"Indique cualquier detalle relevante...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-medium text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all resize-none",value:E.observations,onChange:Y=>T({...E,observations:Y.target.value})})]}),p&&n.jsx("div",{className:"p-6 bg-red-50 border-2 border-red-200 rounded-[2rem] animate-in slide-in-from-top duration-500",children:n.jsxs("div",{className:"flex items-start gap-4",children:[n.jsx(Sr,{className:"text-red-600 shrink-0 mt-1",size:24}),n.jsxs("div",{children:[n.jsx("h4",{className:"text-red-900 font-black text-sm uppercase tracking-tight",children:"¡ALERTA: REFERENCIA DUPLICADA!"}),n.jsx("p",{className:"text-red-700 text-[11px] font-bold mt-1 leading-relaxed",children:e.role==="owner"?"Este número de transferencia ya ha sido utilizado en el sistema. Por favor, verifique su comprobante. Si está seguro de que es correcto, contacte a la administración.":"Este código ya existe en los registros del sistema SAC 2026."}),e.role!=="owner"&&p.matches&&n.jsxs("div",{className:"mt-3 space-y-2",children:[n.jsx("p",{className:"text-[10px] font-black text-red-900 uppercase tracking-widest underline",children:"Rastro Encontrado:"}),p.matches.map((Y,M)=>n.jsxs("div",{className:"bg-white/50 p-2 rounded-lg border border-red-100 text-[10px] font-mono",children:[n.jsxs("span",{className:"font-black text-red-600",children:["[",Y.source,"]"]})," ",Y.detail," - ",Y.date]},M)),n.jsxs("div",{className:"mt-4 flex items-center gap-3 bg-red-600 text-white p-3 rounded-xl shadow-lg",children:[n.jsx("input",{type:"checkbox",id:"auth_dup",className:"w-5 h-5 accent-white cursor-pointer",checked:m,onChange:Y=>b(Y.target.checked)}),n.jsx("label",{htmlFor:"auth_dup",className:"text-[9px] font-black uppercase tracking-widest cursor-pointer",children:"AUTORIZAR CARGA DE REFERENCIA DUPLICADA"})]})]})]})]})}),n.jsxs("button",{disabled:u,type:"submit",className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:[u?n.jsx($t,{className:"animate-spin",size:20}):n.jsx(zs,{size:20}),"ENVIAR REPORTE A ADMINISTRACIÓN"]})]})})}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"bg-slate-900 rounded-[2.5rem] p-8 text-white shadow-xl",children:[n.jsx("p",{className:"text-[10px] font-black text-blue-400 uppercase tracking-[0.3em] mb-4",children:"Estado de Cuenta"}),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest mb-1",children:"Cuotas Pendientes"}),n.jsxs("h3",{className:"text-2xl font-black tracking-tighter text-white",children:["$ ",xf((W==null?void 0:W.totalFees)||0)]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest mb-1",children:"Convenio de Pago"}),n.jsxs("h3",{className:"text-2xl font-black tracking-tighter text-white",children:["$ ",xf((W==null?void 0:W.agreementDebt)||0)]})]}),n.jsxs("div",{className:"pt-6 border-t border-white/10",children:[n.jsx("p",{className:"text-[10px] font-black text-blue-400 uppercase tracking-[0.3em] mb-2",children:"Total Pendiente"}),n.jsxs("h3",{className:"text-4xl font-black tracking-tighter text-white",children:["$ ",xf((W==null?void 0:W.total)||0)]}),n.jsxs("p",{className:"text-xl font-black text-blue-300 tracking-tight mt-2",children:["Bs. ",dN(((W==null?void 0:W.total)||0)*a)]})]})]}),n.jsxs("div",{className:"mt-8 p-4 bg-white/5 rounded-2xl border border-white/10 flex items-start gap-3",children:[n.jsx(jn,{size:16,className:"text-blue-400 shrink-0 mt-0.5"}),n.jsx("p",{className:"text-[9px] font-medium text-slate-300 leading-relaxed",children:"Este reporte no se aplica automáticamente. La administración debe verificarlo y asignarlo a su cuenta."})]})]}),n.jsxs("div",{className:"bg-white rounded-[2.5rem] border border-slate-200 p-8 shadow-sm",children:[n.jsxs("h4",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-6 flex items-center gap-2",children:[n.jsx(Sr,{size:14,className:"text-blue-600"})," Recordatorio"]}),n.jsxs("ul",{className:"space-y-4",children:[n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-1.5 h-1.5 bg-blue-600 rounded-full mt-1.5 shrink-0"}),n.jsx("p",{className:"text-xs font-bold text-slate-600 leading-relaxed",children:"Use la tasa del día indicada en el sistema."})]}),n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-1.5 h-1.5 bg-blue-600 rounded-full mt-1.5 shrink-0"}),n.jsx("p",{className:"text-xs font-bold text-slate-600 leading-relaxed",children:"Indique el número de referencia exacto."})]}),n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx("div",{className:"w-1.5 h-1.5 bg-blue-600 rounded-full mt-1.5 shrink-0"}),n.jsx("p",{className:"text-xs font-bold text-slate-600 leading-relaxed",children:"Conserve su comprobante físico o digital."})]})]})]})]})]}),y==="list"&&n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col md:flex-row gap-4 bg-white p-4 rounded-[2rem] border border-slate-200 shadow-sm",children:[n.jsxs("div",{className:"flex-1 relative",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por propiedad o nombre...",className:"w-full bg-slate-50 border border-slate-100 rounded-xl pl-12 pr-4 py-3 text-sm font-bold text-slate-700 outline-none focus:ring-2 focus:ring-blue-500/20 transition-all",value:B,onChange:Y=>F(Y.target.value)})]}),n.jsx("div",{className:"flex gap-2",children:["Todos","Pendiente","Asignado","Rechazado"].map(Y=>n.jsx("button",{onClick:()=>U(Y),className:`px-6 py-3 rounded-xl font-black text-[9px] uppercase tracking-widest transition-all ${R===Y?"bg-slate-900 text-white shadow-lg":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:Y},Y))})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Propiedad"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Fecha / Ref"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black text-slate-400 uppercase tracking-widest text-right",children:"Monto"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black text-slate-400 uppercase tracking-widest text-center",children:"Estatus"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black text-slate-400 uppercase tracking-widest text-right",children:"Acciones"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-50",children:ee.length===0?n.jsx("tr",{children:n.jsx("td",{colSpan:5,className:"px-8 py-20 text-center",children:n.jsxs("div",{className:"flex flex-col items-center gap-4 opacity-20",children:[n.jsx(ca,{size:64}),n.jsx("p",{className:"font-black text-xs uppercase tracking-widest",children:"No se encontraron reportes"})]})})}):ee.map(Y=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"px-8 py-6",children:n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-blue-50 text-blue-600 rounded-xl flex items-center justify-center font-black text-xs",children:Y.propertyCode}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-black text-slate-900 uppercase",children:Y.ownerName}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:[Y.bankName," • ",Y.method]})]})]})}),n.jsxs("td",{className:"px-8 py-6",children:[n.jsx("p",{className:"text-sm font-black text-slate-700",children:Y.paymentDate}),n.jsxs("p",{className:"text-[10px] font-bold text-blue-600 uppercase tracking-widest",children:["REF: ",Y.reference]})]}),n.jsxs("td",{className:"px-8 py-6 text-right",children:[n.jsxs("p",{className:"text-sm font-black text-slate-900",children:["$ ",xf(Y.amountUsd)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["Bs. ",dN(Y.amountBs)]})]}),n.jsx("td",{className:"px-8 py-6",children:n.jsx("div",{className:"flex justify-center",children:n.jsxs("span",{className:`px-4 py-1.5 rounded-full text-[9px] font-black uppercase tracking-widest flex items-center gap-2 ${Y.status==="Asignado"?"bg-emerald-50 text-emerald-600":Y.status==="Rechazado"?"bg-red-50 text-red-600":"bg-amber-50 text-amber-600"}`,children:[Y.status==="Asignado"?n.jsx(Gt,{size:12}):Y.status==="Rechazado"?n.jsx(SM,{size:12}):n.jsx(Pc,{size:12}),Y.status]})})}),n.jsx("td",{className:"px-8 py-6 text-right",children:Q?n.jsx("button",{onClick:()=>{L(Y),G({status:Y.status,observations:Y.observations||"",assignedTo:Y.assignedTo||"",targetId:Y.targetId||""})},className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg hover:bg-blue-600 transition-all active:scale-95",children:n.jsx(tFe,{size:18})}):n.jsx("button",{onClick:()=>L(Y),className:"p-3 bg-slate-100 text-slate-400 rounded-xl hover:bg-slate-200 transition-all",children:n.jsx(yr,{size:18})})})]},Y.id))})]})})})]}),D&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-sm z-[200] flex items-center justify-center p-4 animate-in fade-in duration-300",children:n.jsxs("div",{className:"bg-white w-full max-w-2xl rounded-[3rem] shadow-2xl overflow-hidden animate-in zoom-in duration-300",children:[n.jsxs("div",{className:"p-8 bg-slate-900 text-white flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-2xl flex items-center justify-center font-black text-lg",children:D.propertyCode}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black uppercase tracking-tighter",children:"Detalle de Reporte"}),n.jsxs("p",{className:"text-blue-400 text-[10px] font-black uppercase tracking-widest",children:["ID: #",D.id]})]})]}),n.jsx("button",{onClick:()=>L(null),className:"p-2 hover:bg-white/10 rounded-xl transition-all",children:n.jsx(rFe,{size:24})})]}),n.jsxs("div",{className:"p-10 space-y-8 max-h-[70vh] overflow-y-auto custom-scrollbar",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Propietario"}),n.jsx("p",{className:"text-sm font-black text-slate-900 uppercase",children:D.ownerName})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Fecha de Pago"}),n.jsx("p",{className:"text-sm font-black text-slate-900",children:D.paymentDate})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Referencia"}),n.jsx("p",{className:"text-sm font-black text-blue-600 uppercase",children:D.reference})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Monto Reportado"}),n.jsxs("p",{className:"text-xl font-black text-slate-900",children:["$ ",xf(D.amountUsd)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["Bs. ",dN(D.amountBs)]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Banco / Método"}),n.jsxs("p",{className:"text-sm font-black text-slate-700 uppercase",children:[D.bankName," • ",D.method]})]})]})]}),D.observations&&n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100",children:[n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-2 flex items-center gap-2",children:[n.jsx(jn,{size:14})," Observaciones del Propietario"]}),n.jsxs("p",{className:"text-sm font-medium text-slate-600 italic",children:['"',D.observations,'"']})]}),Q&&n.jsxs("div",{className:"pt-8 border-t border-slate-100 space-y-6",children:[n.jsxs("h4",{className:"text-[10px] font-black text-blue-600 uppercase tracking-widest flex items-center gap-2",children:[n.jsx(Ia,{size:16})," Acciones Administrativas"]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Cambiar Estatus"}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl p-4 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:P.status,onChange:Y=>G({...P,status:Y.target.value}),children:[n.jsx("option",{value:"Pendiente",children:"Pendiente"}),n.jsx("option",{value:"Asignado",children:"Asignado (Ya usado)"}),n.jsx("option",{value:"Rechazado",children:"Rechazado"})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Asignado a (Opcional)"}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl p-4 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all",value:P.assignedTo,onChange:Y=>G({...P,assignedTo:Y.target.value}),children:[n.jsx("option",{value:"",children:"No Asignado"}),n.jsx("option",{value:"Cuota",children:"Cuota Mensual"}),n.jsx("option",{value:"Convenio",children:"Convenio de Pago"}),n.jsx("option",{value:"Otro",children:"Otro"})]})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Nota Administrativa / Motivo Rechazo"}),n.jsx("textarea",{rows:2,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl p-4 text-sm font-medium text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all resize-none",value:P.observations,onChange:Y=>G({...P,observations:Y.target.value})})]}),n.jsxs("button",{disabled:u,onClick:K,className:"w-full bg-slate-900 hover:bg-blue-600 text-white py-5 rounded-2xl font-black text-[10px] uppercase tracking-[0.2em] shadow-xl transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:[u?n.jsx($t,{className:"animate-spin",size:16}):n.jsx(Gt,{size:16}),"GUARDAR CAMBIOS ADMINISTRATIVOS"]})]}),!Q&&D.status!=="Pendiente"&&n.jsxs("div",{className:`p-6 rounded-3xl border ${D.status==="Asignado"?"bg-emerald-50 border-emerald-100 text-emerald-700":"bg-red-50 border-red-100 text-red-700"}`,children:[n.jsxs("p",{className:"text-[10px] font-black uppercase tracking-widest mb-2 flex items-center gap-2",children:[n.jsx(Sr,{size:14})," Respuesta Administrativa"]}),n.jsx("p",{className:"text-sm font-bold",children:D.observations||"Sin observaciones adicionales."})]})]})]})})]})},tFe=({size:e})=>n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M20 7h-9"}),n.jsx("path",{d:"M14 17H5"}),n.jsx("circle",{cx:"17",cy:"17",r:"3"}),n.jsx("circle",{cx:"7",cy:"7",r:"3"})]}),rFe=({size:e})=>n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M18 6 6 18"}),n.jsx("path",{d:"m6 6 12 12"})]}),aFe=()=>{const[e,t]=k.useState(!1),[r,a]=k.useState([]),[s,i]=k.useState(""),[l,o]=k.useState(new Date().getMonth()+1),[d,u]=k.useState(new Date().getFullYear()),f=async()=>{t(!0);try{const y=await we.getDebtList(l,d);a(Array.isArray(y)?y:[])}catch(y){console.error("Error fetching debt list:",y)}finally{t(!1)}};k.useEffect(()=>{f()},[l,d]);const p=r.filter(y=>y.propertyNumber.toLowerCase().includes(s.toLowerCase())||y.ownerName.toLowerCase().includes(s.toLowerCase())),h=p.reduce((y,j)=>y+j.totalDebt,0),m=()=>{window.print()},b=()=>{const y=`*LISTADO DE DEUDORES - ${va}*
Corte: ${Te[l-1]} ${d}

`+p.map(_=>`Prop: ${_.propertyNumber} - ${_.ownerName}
Deuda Mes: $${_.currentDebt.toFixed(2)}
Convenio/Anterior: $${_.agreementDebt.toFixed(2)}
*Total: $${_.totalDebt.toFixed(2)}*`).join(`

`)+`

*Total General: $${h.toFixed(2)}*`,j=`https://wa.me/?text=${encodeURIComponent(y)}`;window.open(j,"_blank")},v=()=>{const y=`
            <!DOCTYPE html>
            <html>
            <head>
                <title>Listado de Deudores - ${va}</title>
                <style>
                    body { font-family: sans-serif; padding: 20px; color: #333; }
                    h1 { color: #1e293b; text-align: center; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                    th { background-color: #f8fafc; font-weight: bold; }
                    .total { font-weight: bold; background-color: #f1f5f9; }
                    .footer { margin-top: 30px; font-size: 12px; color: #64748b; text-align: center; }
                </style>
            </head>
            <body>
                <h1>Listado de Propiedades con Deuda</h1>
                <p><strong>Condominio:</strong> ${va}</p>
                <p><strong>Corte:</strong> ${Te[l-1]} ${d}</p>
                <table>
                    <thead>
                        <tr>
                            <th>Propiedad</th>
                            <th>Propietario</th>
                            <th>Deuda ($)</th>
                            <th>WhatsApp</th>
                            <th>Correo</th>
                        </tr>
                    </thead>
                    <tbody>
                        ${p.map(E=>`
                            <tr>
                                <td>${E.propertyNumber}</td>
                                <td>${E.ownerName}</td>
                                <td>
                                    $${E.totalDebt.toFixed(2)}<br/>
                                    <small style="color: #64748b">Mes: $${E.currentDebt.toFixed(2)}</small><br/>
                                    <small style="color: #2563eb">Conv: $${E.agreementDebt.toFixed(2)}</small>
                                </td>
                                <td>${E.whatsapp}</td>
                                <td>${E.email}</td>
                            </tr>
                        `).join("")}
                    </tbody>
                    <tfoot>
                        <tr class="total">
                            <td colspan="2">TOTAL GENERAL</td>
                            <td colspan="3">$${h.toFixed(2)}</td>
                        </tr>
                    </tfoot>
                </table>
                <div class="footer">
                    Generado por SAC 2026 - ${Ln}
                </div>
            </body>
            </html>
        `,j=new Blob([y],{type:"text/html"}),_=URL.createObjectURL(j),N=document.createElement("a");N.href=_,N.download=`Deudores_${Te[l-1]}_${d}.html`,document.body.appendChild(N),N.click(),document.body.removeChild(N),URL.revokeObjectURL(_)};return n.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500 pb-20 no-print",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] shadow-xl border border-slate-100 flex flex-col md:flex-row md:items-center justify-between gap-6",children:[n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"w-16 h-16 bg-red-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-lg shadow-red-200",children:n.jsx(yr,{size:32})}),n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tighter",children:["Listado de ",n.jsx("span",{className:"text-red-600 italic",children:"Deudores"})]}),n.jsxs("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:["Corte: ",Te[l-1]," ",d]})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[n.jsxs("button",{onClick:m,className:"flex items-center gap-2 px-6 py-3 bg-slate-900 text-white rounded-2xl font-bold text-xs uppercase tracking-widest hover:bg-slate-800 transition-all shadow-lg",children:[n.jsx(wt,{size:16})," Imprimir"]}),n.jsxs("button",{onClick:b,className:"flex items-center gap-2 px-6 py-3 bg-emerald-600 text-white rounded-2xl font-bold text-xs uppercase tracking-widest hover:bg-emerald-700 transition-all shadow-lg",children:[n.jsx(Aa,{size:16})," Compartir"]}),n.jsxs("button",{onClick:v,className:"flex items-center gap-2 px-6 py-3 bg-blue-600 text-white rounded-2xl font-bold text-xs uppercase tracking-widest hover:bg-blue-700 transition-all shadow-lg",children:[n.jsx(Gs,{size:16})," Exportar HTML"]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"lg:col-span-2 bg-white p-6 rounded-[2.5rem] shadow-lg border border-slate-100 flex items-center gap-4",children:[n.jsx(er,{className:"text-slate-400",size:20}),n.jsx("input",{type:"text",placeholder:"Buscar por propiedad o propietario...",className:"w-full bg-transparent border-none focus:ring-0 font-medium text-slate-600",value:s,onChange:y=>i(y.target.value)})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] shadow-lg border border-slate-100 flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Wr,{className:"text-slate-400",size:20}),n.jsx("select",{value:l,onChange:y=>o(parseInt(y.target.value)),className:"bg-transparent border-none focus:ring-0 font-bold text-slate-700 text-sm uppercase",children:Te.map((y,j)=>n.jsx("option",{value:j+1,children:y},j))}),n.jsx("select",{value:d,onChange:y=>u(parseInt(y.target.value)),className:"bg-transparent border-none focus:ring-0 font-bold text-slate-700 text-sm",children:[2024,2025,2026].map(y=>n.jsx("option",{value:y,children:y},y))})]}),n.jsx("button",{onClick:f,className:`p-3 rounded-xl transition-all ${e?"bg-slate-100 text-slate-400":"bg-red-50 text-red-600 hover:bg-red-100"}`,disabled:e,children:n.jsx(ct,{size:18,className:e?"animate-spin":""})})]})]}),n.jsx("div",{className:"bg-white rounded-[3rem] shadow-2xl border border-slate-100 overflow-hidden",children:n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Propiedad"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Propietario"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Deuda Acumulada"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Contacto WhatsApp"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Correo Electrónico"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-50",children:e?n.jsx("tr",{children:n.jsxs("td",{colSpan:5,className:"p-20 text-center",children:[n.jsx(ct,{className:"animate-spin mx-auto mb-4 text-slate-300",size:40}),n.jsx("p",{className:"text-slate-400 font-black uppercase tracking-widest text-[10px]",children:"Sincronizando con el Kernel..."})]})}):p.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:5,className:"p-20 text-center",children:[n.jsx(Sr,{className:"mx-auto mb-4 text-slate-200",size:48}),n.jsx("p",{className:"text-slate-400 font-bold",children:"No se encontraron deudas para el periodo seleccionado."})]})}):p.map((y,j)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-100 rounded-xl flex items-center justify-center text-slate-500 font-bold text-xs group-hover:bg-red-600 group-hover:text-white transition-all",children:y.propertyNumber}),n.jsx("span",{className:"font-black text-slate-900 tracking-tight uppercase",children:y.propertyCode})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-blue-50 rounded-full flex items-center justify-center text-blue-600",children:n.jsx(tu,{size:14})}),n.jsx("span",{className:"font-bold text-slate-700",children:y.ownerName})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(kn,{size:16,className:"text-red-600"}),n.jsx("span",{className:"text-xl font-black text-red-600 tracking-tighter",children:y.totalDebt.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})})]}),n.jsxs("div",{className:"flex flex-col mt-1 pl-6",children:[n.jsxs("span",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest",children:["Mes Actual: $",y.currentDebt.toFixed(2)]}),y.agreementDebt>0&&n.jsxs("span",{className:"text-[9px] font-black text-blue-600 uppercase tracking-widest",children:["Convenio/Anterior: $",y.agreementDebt.toFixed(2)]})]})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-emerald-50 rounded-full flex items-center justify-center text-emerald-600",children:n.jsx(dk,{size:14})}),n.jsx("span",{className:"font-mono text-xs font-bold text-slate-500",children:y.whatsapp})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-indigo-50 rounded-full flex items-center justify-center text-indigo-600",children:n.jsx(Br,{size:14})}),n.jsx("span",{className:"text-xs font-medium text-slate-500",children:y.email})]})})]},j))}),!e&&p.length>0&&n.jsx("tfoot",{children:n.jsxs("tr",{className:"bg-slate-900 text-white",children:[n.jsx("td",{colSpan:2,className:"p-8 font-black uppercase tracking-widest text-xs text-right",children:"Total General Adeudado:"}),n.jsx("td",{colSpan:3,className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(kn,{size:20,className:"text-emerald-400"}),n.jsx("span",{className:"text-3xl font-black text-emerald-400 tracking-tighter",children:h.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})})]})})]})})]})})}),n.jsxs("div",{className:"hidden print:block bg-white p-10",children:[n.jsxs("div",{className:"text-center mb-10 border-b-4 border-slate-900 pb-8",children:[n.jsx("h1",{className:"text-4xl font-black uppercase tracking-tighter",children:va}),n.jsx("h2",{className:"text-2xl font-bold text-slate-600 uppercase tracking-widest mt-2",children:"Listado de Propiedades con Deuda"}),n.jsxs("p",{className:"text-slate-400 font-bold mt-4",children:["CORTE: ",Te[l-1]," ",d]})]}),n.jsxs("table",{className:"w-full border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-100",children:[n.jsx("th",{className:"border p-4 text-xs font-black uppercase",children:"Propiedad"}),n.jsx("th",{className:"border p-4 text-xs font-black uppercase",children:"Propietario"}),n.jsx("th",{className:"border p-4 text-xs font-black uppercase",children:"Deuda ($)"}),n.jsx("th",{className:"border p-4 text-xs font-black uppercase",children:"WhatsApp"}),n.jsx("th",{className:"border p-4 text-xs font-black uppercase",children:"Correo"})]})}),n.jsx("tbody",{children:p.map((y,j)=>n.jsxs("tr",{children:[n.jsxs("td",{className:"border p-4 text-sm font-bold",children:[y.propertyNumber," (",y.propertyCode,")"]}),n.jsx("td",{className:"border p-4 text-sm",children:y.ownerName}),n.jsxs("td",{className:"border p-4 text-sm",children:[n.jsxs("div",{className:"font-black text-red-600",children:["$",y.totalDebt.toFixed(2)]}),n.jsxs("div",{className:"text-[8px] text-slate-400 uppercase",children:["Mes: $",y.currentDebt.toFixed(2)]}),n.jsxs("div",{className:"text-[8px] text-blue-600 uppercase font-bold",children:["Conv: $",y.agreementDebt.toFixed(2)]})]}),n.jsx("td",{className:"border p-4 text-xs font-mono",children:y.whatsapp}),n.jsx("td",{className:"border p-4 text-xs",children:y.email})]},j))}),n.jsx("tfoot",{children:n.jsxs("tr",{className:"bg-slate-50 font-black",children:[n.jsx("td",{colspan:"2",className:"border p-4 text-right uppercase",children:"Total General:"}),n.jsxs("td",{colspan:"3",className:"border p-4 text-xl",children:["$ ",h.toFixed(2)]})]})})]}),n.jsxs("div",{className:"mt-20 flex justify-between items-end border-t border-slate-200 pt-8",children:[n.jsxs("div",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest",children:["Generado por SAC 2026 - ",Ln]}),n.jsxs("div",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest",children:["Fecha de Impresión: ",new Date().toLocaleString()]})]})]})]})},nFe=()=>{const[e,t]=k.useState(!1),[r,a]=k.useState([]),[s,i]=k.useState(""),[l,o]=k.useState(new Date().getMonth()+1),[d,u]=k.useState(new Date().getFullYear()),f=k.useRef(null),p=async()=>{t(!0);try{const T=await we.getSolventList(l,d);a(Array.isArray(T)?T:[])}catch(T){console.error("Error fetching solvent list:",T)}finally{t(!1)}};k.useEffect(()=>{p()},[l,d]);const h=r.filter(T=>T.propertyNumber.toLowerCase().includes(s.toLowerCase())||T.ownerName.toLowerCase().includes(s.toLowerCase())),m=()=>{window.print()},b=async()=>{if(f.current){t(!0);try{const B=(await rs(f.current,{backgroundColor:"#ffffff",scale:2,logging:!1,useCORS:!0})).toDataURL("image/png"),F=document.createElement("a");F.href=B,F.download=`Solventes_${Te[l-1]}_${d}.png`,F.click()}catch(T){console.error("Capture failed:",T)}finally{t(!1)}}},v=()=>`*LISTADO DE SOLVENTES - ${va}*
Periodo: ${Te[l-1]} ${d}

`+h.map(T=>`✅ Prop: ${T.propertyNumber} - ${T.ownerName}`).join(`
`)+`

*Total Solventes: ${h.length}*`,y=()=>{const T=`https://wa.me/?text=${encodeURIComponent(v())}`;window.open(T,"_blank")},j=()=>{const T=encodeURIComponent(`Listado de Solventes - ${va}`),B=encodeURIComponent(v());window.open(`mailto:?subject=${T}&body=${B}`)},_=()=>{navigator.clipboard.writeText(v()),alert("Formato copiado al portapapeles")},N=async()=>{if(navigator.share)try{await navigator.share({title:`Solventes ${va}`,text:v()})}catch{console.log("Share cancelled")}else _()},E=()=>{const T=`
            <!DOCTYPE html>
            <html>
            <head>
                <title>Listado de Solventes - ${va}</title>
                <style>
                    body { font-family: sans-serif; padding: 20px; color: #333; }
                    h1 { color: #1e293b; text-align: center; }
                    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
                    th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                    th { background-color: #f8fafc; font-weight: bold; }
                    .solvent { color: #059669; font-weight: bold; }
                    .footer { margin-top: 30px; font-size: 12px; color: #64748b; text-align: center; }
                </style>
            </head>
            <body>
                <h1>Listado de Propiedades Solventes</h1>
                <p><strong>Condominio:</strong> ${va}</p>
                <p><strong>Periodo:</strong> ${Te[l-1]} ${d}</p>
                <table>
                    <thead>
                        <tr>
                            <th>Propiedad</th>
                            <th>Propietario</th>
                            <th>Estatus</th>
                            <th>WhatsApp</th>
                            <th>Correo</th>
                        </tr>
                    </thead>
                    <tbody>
                        ${h.map(U=>`
                            <tr>
                                <td>${U.propertyNumber}</td>
                                <td>${U.ownerName}</td>
                                <td class="solvent">SOLVENTE</td>
                                <td>${U.whatsapp}</td>
                                <td>${U.email}</td>
                            </tr>
                        `).join("")}
                    </tbody>
                </table>
                <p><strong>Total Solventes:</strong> ${h.length}</p>
                <div class="footer">
                    Generado por SAC 2026 - ${Ln}
                </div>
            </body>
            </html>
        `,B=new Blob([T],{type:"text/html"}),F=URL.createObjectURL(B),R=document.createElement("a");R.href=F,R.download=`Solventes_${Te[l-1]}_${d}.html`,document.body.appendChild(R),R.click(),document.body.removeChild(R),URL.revokeObjectURL(F)};return n.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500 pb-20 no-print",children:[n.jsxs("div",{className:"bg-white p-8 rounded-[3rem] shadow-xl border border-slate-100 flex flex-col xl:flex-row xl:items-center justify-between gap-6",children:[n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsx("div",{className:"w-16 h-16 bg-emerald-600 rounded-[1.5rem] flex items-center justify-center text-white shadow-lg shadow-emerald-200",children:n.jsx(Gt,{size:32})}),n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tighter",children:["Listado de ",n.jsx("span",{className:"text-emerald-600 italic",children:"Solventes"})]}),n.jsxs("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-[10px]",children:["Periodo: ",Te[l-1]," ",d]})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n.jsxs("button",{onClick:m,className:"flex items-center gap-2 px-4 py-2.5 bg-slate-900 text-white rounded-xl font-bold text-[10px] uppercase tracking-widest hover:bg-slate-800 transition-all",children:[n.jsx(wt,{size:14})," Imprimir"]}),n.jsxs("button",{onClick:b,className:"flex items-center gap-2 px-4 py-2.5 bg-indigo-600 text-white rounded-xl font-bold text-[10px] uppercase tracking-widest hover:bg-indigo-700 transition-all",children:[n.jsx(Dp,{size:14})," Capturar"]}),n.jsxs("button",{onClick:N,className:"flex items-center gap-2 px-4 py-2.5 bg-blue-500 text-white rounded-xl font-bold text-[10px] uppercase tracking-widest hover:bg-blue-600 transition-all",children:[n.jsx(Aa,{size:14})," Compartir"]}),n.jsxs("button",{onClick:y,className:"flex items-center gap-2 px-4 py-2.5 bg-emerald-600 text-white rounded-xl font-bold text-[10px] uppercase tracking-widest hover:bg-emerald-700 transition-all",children:[n.jsx(zs,{size:14})," WhatsApp"]}),n.jsxs("button",{onClick:j,className:"flex items-center gap-2 px-4 py-2.5 bg-orange-500 text-white rounded-xl font-bold text-[10px] uppercase tracking-widest hover:bg-orange-600 transition-all",children:[n.jsx(Br,{size:14})," Email"]}),n.jsxs("button",{onClick:_,className:"flex items-center gap-2 px-4 py-2.5 bg-slate-600 text-white rounded-xl font-bold text-[10px] uppercase tracking-widest hover:bg-slate-700 transition-all",children:[n.jsx(ub,{size:14})," Copiar"]}),n.jsxs("button",{onClick:E,className:"flex items-center gap-2 px-4 py-2.5 bg-blue-600 text-white rounded-xl font-bold text-[10px] uppercase tracking-widest hover:bg-blue-700 transition-all",children:[n.jsx(wr,{size:14})," HTML"]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"lg:col-span-2 bg-white p-6 rounded-[2.5rem] shadow-lg border border-slate-100 flex items-center gap-4",children:[n.jsx(er,{className:"text-slate-400",size:20}),n.jsx("input",{type:"text",placeholder:"Buscar por propiedad o propietario...",className:"w-full bg-transparent border-none focus:ring-0 font-medium text-slate-600",value:s,onChange:T=>i(T.target.value)})]}),n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] shadow-lg border border-slate-100 flex items-center justify-between gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Wr,{className:"text-slate-400",size:20}),n.jsx("select",{value:l,onChange:T=>o(parseInt(T.target.value)),className:"bg-transparent border-none focus:ring-0 font-bold text-slate-700 text-sm uppercase",children:Te.map((T,B)=>n.jsx("option",{value:B+1,children:T},B))}),n.jsx("select",{value:d,onChange:T=>u(parseInt(T.target.value)),className:"bg-transparent border-none focus:ring-0 font-bold text-slate-700 text-sm",children:[2024,2025,2026].map(T=>n.jsx("option",{value:T,children:T},T))})]}),n.jsx("button",{onClick:p,className:`p-3 rounded-xl transition-all ${e?"bg-slate-100 text-slate-400":"bg-emerald-50 text-emerald-600 hover:bg-emerald-100"}`,disabled:e,children:n.jsx(ct,{size:18,className:e?"animate-spin":""})})]})]}),n.jsxs("div",{ref:f,className:"bg-white rounded-[3rem] shadow-2xl border border-slate-100 overflow-hidden",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 hidden print:block",children:[n.jsx("h2",{className:"text-2xl font-black text-slate-900 uppercase tracking-tighter",children:va}),n.jsxs("p",{className:"text-slate-500 font-bold text-xs uppercase tracking-widest",children:["Listado de Solventes - ",Te[l-1]," ",d]})]}),n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Propiedad"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Propietario"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Estatus"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Contacto WhatsApp"}),n.jsx("th",{className:"p-8 font-black text-slate-400 uppercase tracking-widest text-[10px]",children:"Correo Electrónico"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-50",children:e?n.jsx("tr",{children:n.jsxs("td",{colSpan:5,className:"p-20 text-center",children:[n.jsx(ct,{className:"animate-spin mx-auto mb-4 text-slate-300",size:40}),n.jsx("p",{className:"text-slate-400 font-black uppercase tracking-widest text-[10px]",children:"Sincronizando con el Kernel..."})]})}):h.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:5,className:"p-20 text-center",children:[n.jsx(Gt,{className:"mx-auto mb-4 text-slate-200",size:48}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-xs",children:"No se encontraron registros solventes."})]})}):h.map((T,B)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors group",children:[n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-100 rounded-xl flex items-center justify-center text-slate-500 font-bold text-xs group-hover:bg-emerald-600 group-hover:text-white transition-all",children:T.propertyNumber}),n.jsx("span",{className:"font-black text-slate-900 tracking-tight uppercase",children:T.propertyCode})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-blue-50 rounded-full flex items-center justify-center text-blue-600",children:n.jsx(tu,{size:14})}),n.jsx("span",{className:"font-bold text-slate-700",children:T.ownerName})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-2 text-emerald-600",children:[n.jsx(Gt,{size:16}),n.jsx("span",{className:"font-black text-xs uppercase tracking-widest",children:"Solvente"})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-emerald-50 rounded-full flex items-center justify-center text-emerald-600",children:n.jsx(dk,{size:14})}),n.jsx("span",{className:"font-mono text-xs font-bold text-slate-500",children:T.whatsapp})]})}),n.jsx("td",{className:"p-8",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 bg-indigo-50 rounded-full flex items-center justify-center text-indigo-600",children:n.jsx(Br,{size:14})}),n.jsx("span",{className:"text-xs font-medium text-slate-500",children:T.email})]})})]},B))}),!e&&h.length>0&&n.jsx("tfoot",{children:n.jsxs("tr",{className:"bg-slate-900 text-white",children:[n.jsx("td",{colSpan:2,className:"p-8 font-black uppercase tracking-widest text-xs text-right",children:"Total Propiedades Solventes:"}),n.jsx("td",{colSpan:3,className:"p-8",children:n.jsx("span",{className:"text-3xl font-black text-emerald-400 tracking-tighter",children:h.length})})]})})]})}),n.jsxs("div",{className:"p-8 bg-slate-50 border-t border-slate-100 hidden print:flex justify-between items-center",children:[n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:["Generado por SAC 2026 - ",Ln]}),n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:new Date().toLocaleString()})]})]})]})},hf=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},sFe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,latestRate:i}=ht(),[l,o]=k.useState(new Date().getMonth()),[d,u]=k.useState(new Date().getFullYear()),[f,p]=k.useState(null),[h,m]=k.useState("selection"),[b,v]=k.useState(!1),[y,j]=k.useState(null),[_,N]=k.useState(null),E=k.useRef(null);k.useEffect(()=>{(async()=>{try{const ee=await we.getSystemSettings();N(ee)}catch(ee){console.error("Error fetching settings",ee)}})()},[]),k.useEffect(()=>{e.role==="owner"&&e.propertyId&&p(e.propertyId)},[e]);const T=k.useMemo(()=>t.find(K=>K.month===l&&K.year===d),[t,l,d]),B=k.useMemo(()=>r.find(K=>K.id===f),[r,f]),F=k.useMemo(()=>{if(!B)return null;const K=a.find(W=>W.propertyId===B.id&&W.isOwner),ee=s.find(W=>W.cedula===(K==null?void 0:K.cedula));return{fullName:(K==null?void 0:K.fullName)||"Propietario",email:(ee==null?void 0:ee.email)||"",phone:(K==null?void 0:K.phone)||(ee==null?void 0:ee.phone)||"",telegramId:(ee==null?void 0:ee.telegramChatId)||"",propertyCode:B.code}},[B,a,s]),R=k.useMemo(()=>!T||!f?null:T.debts.find(K=>K.propertyId===f),[T,f]),U=k.useMemo(()=>R?Number(R.paidAmount)>=Number(R.amountUsd):!1,[R]),D=()=>{window.print()},L=async()=>{if(E.current){v(!0);try{const ee=(await rs(E.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"})).toDataURL("image/png"),W=document.createElement("a");W.href=ee,W.download=`Recibo_Pago_${B==null?void 0:B.code}_${Te[l]}.png`,W.click()}catch{alert("Error al capturar imagen.")}finally{v(!1)}}},P=async()=>{if(E.current){v(!0);try{const K=await rs(E.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"}),ee=await new Promise(M=>K.toBlob(M,"image/png"));if(!ee)throw new Error("Blob creation failed");const W=`Recibo_Pago_${B==null?void 0:B.code}_${Te[l]}.png`,Y=new File([ee],W,{type:"image/png"});if(navigator.share&&navigator.canShare&&navigator.canShare({files:[Y]}))await navigator.share({files:[Y],title:`Recibo de Pago - ${B==null?void 0:B.code}`,text:`Recibo de Pago de ${Te[l]} ${d} para la unidad ${B==null?void 0:B.code}`});else{const M=K.toDataURL("image/png"),O=document.createElement("a");O.href=M,O.download=W,O.click(),alert("La función de compartir archivos no es compatible. La imagen se ha descargado.")}}catch{alert("Error al compartir imagen.")}finally{v(!1)}}},G=K=>{if(!K)return"";let ee=K.trim();return ee.startsWith("+")?ee.replace(/\D/g,""):ee.startsWith("0")?"58"+ee.substring(1).replace(/\D/g,""):ee.length===10?"58"+ee.replace(/\D/g,""):ee.replace(/\D/g,"")},Q=()=>!F||!B||!R?"":`📄 *RECIBO DE PAGO - SAC 2026*

Unidad: *${B.code}*
Propietario: *${F.fullName}*
------------------------------------------
📅 *Periodo:* ${Te[l]} ${d}
💰 *Monto Pagado:* $${hf(R.paidAmount||0)}
------------------------------------------
✨ *ESTATUS: PAGADO / SOLVENTE*
------------------------------------------
Fecha: ${new Date().toLocaleDateString()}

🔗 *Portal:* ${Rr}`,H=async K=>{if(!F||!B||!R)return;const ee=Q();if(K==="whatsapp"){const W=G(F.phone);if(!W)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${W}?text=${encodeURIComponent(ee)}`,"_blank");return}if(K==="share"){if(navigator.share)try{await navigator.share({title:`Recibo de Pago - ${B.code}`,text:ee.replace(/\*/g,""),url:Rr})}catch{}else alert("Compartir no disponible.");return}j(K);try{const W={channel:K,messageType:"receipt",monthName:Te[l],year:d,recipients:[{name:F.fullName,email:F.email,telegramChatId:F.telegramId,propName:`${B.code}`,amount:hf(R.amountUsd),paid:hf(R.paidAmount||0),status:"Pagado",balance:"0.00"}]},M=await(await fetch(`${Ne}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)})).json();M.status==="success"?alert(`Enviado por ${K}.`):alert("Error: "+M.message)}catch{alert("Error de red.")}finally{j(null)}},X=()=>{const K=Q();navigator.clipboard.writeText(K),alert("Copiado al portapapeles")};return h==="receipt"&&B&&F&&R?n.jsxs("div",{className:"max-w-4xl mx-auto space-y-8 animate-in fade-in duration-500 pb-24 px-1 print:p-0",children:[n.jsxs("div",{className:"flex justify-between items-center no-print",children:[n.jsxs("button",{onClick:()=>m("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(gs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:D,className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Imprimir",children:n.jsx(wt,{size:20})}),n.jsx("button",{onClick:L,disabled:b,className:"p-3 bg-indigo-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Capturar como Imagen",children:b?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Dp,{size:20})}),n.jsx("button",{onClick:P,disabled:b,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir Imagen",children:b?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Aa,{size:20})}),n.jsx("button",{onClick:()=>H("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"WhatsApp",children:n.jsx(Ha,{size:20})}),n.jsx("button",{onClick:()=>H("telegram"),disabled:!F.telegramId||!!y,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${F.telegramId?"bg-sky-500":"bg-slate-200"}`,title:"Telegram",children:y==="telegram"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Bl,{size:20})}),n.jsx("button",{onClick:()=>H("email"),disabled:!F.email||!!y,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${F.email?"bg-indigo-600":"bg-slate-200"}`,title:"Email",children:y==="email"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Br,{size:20})}),n.jsx("button",{onClick:()=>H("share"),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir",children:n.jsx(Aa,{size:20})}),n.jsx("button",{onClick:X,className:"p-3 bg-slate-200 text-slate-600 rounded-xl shadow-lg active:scale-95 transition-all",title:"Copiar Formato",children:n.jsx(ub,{size:20})})]})]}),n.jsxs("div",{ref:E,className:"bg-white border border-slate-300 shadow-xl mx-auto print:shadow-none print:border-slate-400 print:w-full print:max-w-none print:m-0",style:{width:"100%",maxWidth:"21.59cm",minHeight:"27.94cm",padding:"2cm"},children:[n.jsxs("div",{className:"flex justify-between items-start border-b-2 border-slate-900 pb-6 mb-8",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-16 h-16 bg-slate-900 rounded-2xl flex items-center justify-center text-white shadow-lg",children:n.jsx(da,{size:32})}),n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black tracking-tighter text-slate-900",children:["SAC ",n.jsx("span",{className:"text-blue-600",children:"2026"})]}),n.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.4em] text-slate-400",children:"Conjunto Residencial El Tejar"})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("h2",{className:"text-xl font-black uppercase tracking-widest text-slate-900",children:"Recibo de Pago"}),n.jsxs("p",{className:"text-xs font-bold text-slate-500 uppercase mt-1",children:["N° REC-",B.code,"-",d,l+1]}),n.jsx("p",{className:"text-[10px] font-black text-blue-600 uppercase mt-1",children:Ln})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-12 mb-10",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Propietario / Unidad"}),n.jsx("p",{className:"text-lg font-black text-slate-900 uppercase",children:F.fullName}),n.jsxs("p",{className:"text-sm font-bold text-slate-600 uppercase",children:[B.code," - ",B.type," ",B.number]})]}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Periodo Cancelado"}),n.jsxs("p",{className:"text-lg font-black text-blue-600 uppercase",children:[Te[l]," ",d]})]})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-3xl border border-slate-100 flex flex-col justify-center items-center",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-2",children:"Monto Total Pagado"}),n.jsxs("p",{className:"text-4xl font-black text-slate-900",children:["$ ",hf(R.paidAmount||0)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-500 mt-2 uppercase",children:["Equivalente en Bs: ",hf((R.paidAmount||0)*i)]})]})]}),n.jsxs("div",{className:"bg-emerald-50 border-2 border-emerald-500/20 rounded-[2.5rem] p-10 mb-12 relative overflow-hidden",children:[n.jsx("div",{className:"absolute top-0 right-0 p-4 opacity-5",children:n.jsx(Gt,{size:150})}),n.jsxs("div",{className:"flex items-center gap-8",children:[n.jsx("div",{className:"w-20 h-20 bg-emerald-600 text-white rounded-3xl flex items-center justify-center shadow-lg shadow-emerald-200",children:n.jsx(Ia,{size:48})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-5xl font-black text-emerald-700 tracking-tighter uppercase mb-1",children:"Pagado"}),n.jsx("p",{className:"text-emerald-600 font-black uppercase tracking-[0.3em] text-xs",children:"Estatus: Solvente con el periodo"})]})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-12 mt-24",children:[n.jsx("div",{className:"text-center space-y-2",children:n.jsxs("div",{className:"border-t-2 border-slate-900 pt-4",children:[n.jsx("p",{className:"text-sm font-black text-slate-900 uppercase",children:(_==null?void 0:_.board_president)||"Presidente"}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"Presidente de la Junta"})]})}),n.jsx("div",{className:"text-center space-y-2",children:n.jsxs("div",{className:"border-t-2 border-slate-900 pt-4",children:[n.jsx("p",{className:"text-sm font-black text-slate-900 uppercase",children:(_==null?void 0:_.board_secretary)||"Secretario(a)"}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:"Secretario(a) de la Junta"})]})})]}),n.jsx("div",{className:"mt-20 flex justify-center",children:n.jsxs("div",{className:"w-48 h-48 border-4 border-blue-600/20 rounded-full flex flex-col items-center justify-center text-center p-4 rotate-[-15deg] transform",children:[n.jsxs("p",{className:"text-[10px] font-black text-blue-600 uppercase leading-tight",children:["Conj. Resid.",n.jsx("br",{}),"El Tejar"]}),n.jsx("div",{className:"w-full h-px bg-blue-600/20 my-2"}),n.jsx("p",{className:"text-[12px] font-black text-blue-700 uppercase tracking-widest",children:"Mes Solvente"}),n.jsx("p",{className:"text-[8px] font-bold text-blue-400 mt-1 uppercase tracking-tighter",children:"Certificación SAC 2026"})]})}),n.jsx("div",{className:"mt-auto pt-12 text-center border-t border-slate-100",children:n.jsx("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.5em]",children:"Este documento es un comprobante digital generado por el sistema administrativo SAC 2026"})})]})]}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Recibo de ",n.jsx("span",{className:"text-blue-600",children:"Pago Cancelado"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Genere el recibo oficial de los meses solventes."})]}),n.jsxs("div",{className:"flex gap-2 bg-slate-100 p-2 rounded-2xl border border-slate-200 shadow-inner",children:[n.jsx("select",{value:l,onChange:K=>o(Number(K.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:Te.map((K,ee)=>n.jsx("option",{value:ee,children:K},ee))}),n.jsx("input",{type:"number",value:d,onChange:K=>u(Number(K.target.value)),className:"bg-transparent border-none text-xs font-black text-blue-600 outline-none w-20 text-center"})]})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(ca,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Selección de Propiedad"}),n.jsx("p",{className:"text-slate-500 font-medium",children:"Seleccione la unidad para generar su recibo de pago del mes."})]}),n.jsxs("div",{className:"space-y-4",children:[["admin","programmer","board"].includes(e.role)?n.jsxs("div",{className:"relative group",children:[n.jsx(er,{className:"absolute left-6 top-1/2 -translate-y-1/2 text-slate-400 group-focus-within:text-blue-600 transition-colors",size:20}),n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-[2rem] pl-16 pr-8 py-6 font-black text-slate-900 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",value:f||"",onChange:K=>p(Number(K.target.value)),children:[n.jsx("option",{value:"",children:"Seleccione una propiedad..."}),r.sort((K,ee)=>K.code.localeCompare(ee.code)).map(K=>n.jsxs("option",{value:K.id,children:[K.code," - ",K.type," ",K.number]},K.id))]}),n.jsx(Hs,{className:"absolute right-6 top-1/2 -translate-y-1/2 text-slate-400 pointer-events-none",size:20})]}):n.jsxs("div",{className:"p-8 bg-blue-50 border border-blue-100 rounded-[2.5rem] flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-6",children:[n.jsx("div",{className:"w-14 h-14 bg-white rounded-2xl flex items-center justify-center text-blue-600 shadow-sm",children:n.jsx(ea,{size:28})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-blue-400 uppercase tracking-widest mb-1",children:"Su Propiedad"}),n.jsx("p",{className:"text-xl font-black text-blue-900 uppercase",children:(B==null?void 0:B.code)||"Cargando..."})]})]}),n.jsx(Ia,{className:"text-blue-600/20",size:40})]}),n.jsxs("button",{disabled:!f||!T,onClick:()=>{U?m("receipt"):alert("Esta propiedad no se encuentra solvente en el mes seleccionado.")},className:"w-full bg-slate-900 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.3em] shadow-xl shadow-slate-200 hover:bg-slate-800 transition-all active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-3",children:[T?"Generar Recibo de Pago":"Mes no generado",n.jsx(_c,{size:18})]})]}),!U&&f&&T&&n.jsxs("div",{className:"p-6 bg-amber-50 border border-amber-100 rounded-3xl flex items-center gap-4 animate-in slide-in-from-top-4",children:[n.jsx(Sr,{className:"text-amber-600 shrink-0",size:24}),n.jsx("p",{className:"text-[10px] font-black text-amber-700 uppercase tracking-widest leading-relaxed",children:"La propiedad seleccionada tiene una deuda pendiente para este periodo. El recibo solo puede generarse para meses solventes."})]})]})})]})},iFe=({user:e})=>{const[t,r]=k.useState(null),[a,s]=k.useState(!1),[i,l]=k.useState(""),o=k.useRef(null),d=m=>{var y;const b=(y=m.target.files)==null?void 0:y[0];if(!b)return;s(!0);const v=new FormData;v.append("file",b),fetch(`${Ne}/process_banplus_commissions.php`,{method:"POST",body:v,credentials:"include"}).then(async j=>{if(!j.ok){const _=await j.text();throw new Error(`Error ${j.status}: ${_.substring(0,100)}`)}return j.json()}).then(j=>{j.success?r(j):alert(j.error||"Error al procesar el estado de cuenta.")}).catch(j=>alert("Error crítico en el servidor: "+j.message)).finally(()=>s(!1))},u=k.useMemo(()=>t?t.commissions.filter(m=>m.desc.toUpperCase().includes(i.toUpperCase())||m.ref.includes(i)||m.reason.toUpperCase().includes(i.toUpperCase())):[],[t,i]),f=k.useMemo(()=>u.reduce((m,b)=>m+b.amount,0),[u]),p=()=>{if(!t)return;const m=window.open("","_blank");if(!m)return;const b=`
      <html>
        <head>
          <title>Reporte de Comisiones Banplus</title>
          <style>
            body { font-family: sans-serif; padding: 40px; color: #333; }
            table { width: 100%; border-collapse: collapse; margin-top: 20px; }
            th, td { border: 1px solid #ddd; padding: 12px; text-align: left; font-size: 12px; }
            th { background-color: #f8f9fa; font-weight: bold; text-transform: uppercase; }
            .header { text-align: center; margin-bottom: 30px; }
            .total { margin-top: 30px; text-align: right; font-size: 18px; font-weight: bold; }
            .footer { margin-top: 50px; font-size: 10px; color: #999; text-align: center; }
          </style>
        </head>
        <body>
          <div class="header">
            <h1>Reporte de Comisiones Bancarias</h1>
            <p>Banplus - Estado de Cuenta</p>
            <p>Generado el: ${new Date().toLocaleString()}</p>
          </div>
          <table>
            <thead>
              <tr>
                <th>Fecha</th>
                <th>Referencia</th>
                <th>Descripción</th>
                <th>Motivo</th>
                <th>Monto Bs.</th>
              </tr>
            </thead>
            <tbody>
              ${u.map(v=>`
                <tr>
                  <td>${v.date}</td>
                  <td>${v.ref}</td>
                  <td>${v.desc}</td>
                  <td>${v.reason}</td>
                  <td>${v.amount.toLocaleString("es-VE",{minimumFractionDigits:2})}</td>
                </tr>
              `).join("")}
            </tbody>
          </table>
          <div class="total">
            Total Comisiones: Bs. ${f.toLocaleString("es-VE",{minimumFractionDigits:2})}
          </div>
          <div class="footer">
            SAC 2026 Kernel V4.1.94 MC/MB - Sistema Administrativo para Condominios
          </div>
        </body>
      </html>
    `;m.document.write(b),m.document.close()},h=()=>{navigator.share?navigator.share({title:"Reporte de Comisiones Banplus",text:`Total Comisiones: Bs. ${f.toLocaleString("es-VE",{minimumFractionDigits:2})}`,url:window.location.href}).catch(console.error):alert("La función de compartir no está disponible en este navegador.")};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 pb-24 no-print",children:[n.jsxs("div",{className:"p-10 lg:p-14 rounded-[4rem] bg-slate-900 text-white shadow-2xl relative overflow-hidden group border-b-8 border-indigo-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col lg:flex-row justify-between items-center gap-12",children:[n.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[n.jsxs("div",{className:"bg-indigo-600 w-fit px-5 py-2 rounded-full border border-indigo-400/30 mb-8 mx-auto lg:mx-0 flex items-center gap-3",children:[n.jsx(bs,{size:18,className:"text-white"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em]",children:"Protocolo Kernel V4.1.94 MC/MB"})]}),n.jsxs("h1",{className:"text-5xl lg:text-7xl font-black tracking-tighter leading-tight",children:["Comisiones ",n.jsx("br",{}),n.jsx("span",{className:"text-indigo-500 italic",children:"Banplus Extracto"})]}),n.jsx("p",{className:"text-slate-400 mt-6 text-lg font-medium max-w-lg leading-relaxed italic",children:'"Detección automática de cargos bancarios, servicios y comisiones desde el estado de cuenta CSV."'})]}),n.jsxs("div",{className:"bg-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl flex flex-col items-center min-w-[340px]",children:[n.jsx("input",{type:"file",accept:".csv",ref:o,onChange:d,className:"hidden"}),n.jsx("div",{className:"w-20 h-20 bg-indigo-50 text-indigo-600 rounded-3xl flex items-center justify-center mb-8 border-2 border-indigo-100 shadow-inner",children:a?n.jsx(ct,{className:"animate-spin",size:40}):n.jsx(br,{size:40})}),n.jsx("button",{onClick:()=>{var m;return(m=o.current)==null?void 0:m.click()},disabled:a,className:"w-full bg-indigo-600 hover:bg-indigo-700 text-white font-black py-5 rounded-2xl shadow-xl active:scale-95 transition-all text-xs uppercase tracking-widest",children:a?"PROCESANDO...":"CARGAR ESTADO CUENTA"})]})]}),n.jsx(bs,{size:220,className:"absolute right-[-40px] top-[-40px] text-white/5 pointer-events-none"})]}),t&&n.jsxs("div",{className:"space-y-8 animate-in slide-in-from-bottom duration-700",children:[n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200 shadow-sm flex flex-col lg:flex-row justify-between items-center gap-6",children:[n.jsxs("div",{className:"relative flex-1 w-full",children:[n.jsx(er,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:18}),n.jsx("input",{type:"text",placeholder:"Buscar por descripción, referencia o motivo...",className:"w-full bg-slate-50 border border-slate-100 rounded-2xl pl-12 pr-6 py-4 text-sm font-bold w-full outline-none focus:ring-2 focus:ring-indigo-500",value:i,onChange:m=>l(m.target.value)})]}),n.jsxs("div",{className:"flex gap-3 w-full lg:w-auto",children:[n.jsxs("button",{onClick:p,className:"flex-1 lg:flex-none p-4 bg-white border border-slate-200 rounded-2xl text-slate-600 hover:bg-slate-50 transition-all flex items-center justify-center gap-2 shadow-sm",children:[n.jsx(Gs,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Exportar"})]}),n.jsxs("button",{onClick:()=>window.print(),className:"flex-1 lg:flex-none p-4 bg-white border border-slate-200 rounded-2xl text-slate-600 hover:bg-slate-50 transition-all flex items-center justify-center gap-2 shadow-sm",children:[n.jsx(wt,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Imprimir"})]}),n.jsxs("button",{onClick:h,className:"flex-1 lg:flex-none p-4 bg-indigo-600 text-white rounded-2xl hover:bg-indigo-700 transition-all flex items-center justify-center gap-2 shadow-lg",children:[n.jsx(Aa,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Compartir"})]})]})]}),n.jsxs("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden",children:[n.jsxs("div",{className:"p-8 border-b border-slate-100 bg-slate-50/30 flex justify-between items-center",children:[n.jsx("h3",{className:"text-xl font-black text-slate-800 tracking-tight uppercase",children:"Detalle de Comisiones Detectadas"}),n.jsxs("div",{className:"flex items-center gap-2 bg-indigo-100 px-4 py-2 rounded-full border border-indigo-200",children:[n.jsx(vi,{size:14,className:"text-indigo-600"}),n.jsxs("span",{className:"text-[10px] font-black text-indigo-600 uppercase tracking-widest",children:[u.length," Registros"]})]})]}),n.jsx("div",{className:"overflow-x-auto custom-scrollbar",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-center",children:"Referencia"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Descripción / Motivo"}),n.jsx("th",{className:"px-10 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Monto Bs."})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100 font-mono",children:u.map((m,b)=>n.jsxs("tr",{className:"hover:bg-slate-50 transition-all group",children:[n.jsx("td",{className:"px-10 py-6 text-[11px] font-black text-slate-500",children:m.date}),n.jsx("td",{className:"px-10 py-6 text-center",children:n.jsxs("span",{className:"text-[10px] font-black bg-slate-100 px-3 py-1 rounded-lg border border-slate-200 text-indigo-600",children:["#",m.ref]})}),n.jsx("td",{className:"px-10 py-6",children:n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-900 text-[11px] uppercase leading-tight",children:m.desc}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-tighter mt-1",children:m.reason})]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("span",{className:"text-sm font-black text-rose-600",children:["- ",m.amount.toLocaleString("es-VE",{minimumFractionDigits:2})]})})]},b))}),n.jsx("tfoot",{children:n.jsxs("tr",{className:"bg-slate-900 text-white",children:[n.jsx("td",{colSpan:3,className:"px-10 py-8 text-right",children:n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.3em] opacity-60",children:"Totalización Mensual"})}),n.jsx("td",{className:"px-10 py-8 text-right",children:n.jsxs("span",{className:"text-2xl font-black tracking-tighter",children:["Bs. ",f.toLocaleString("es-VE",{minimumFractionDigits:2})]})})]})})]})})]})]})]})},lFe=({user:e})=>{const{exchangeRateHistory:t,loading:r,financialTotals:a,properties:s}=ht(),[i,l]=k.useState(new Date().getMonth()),[o,d]=k.useState(new Date().getFullYear()),[u,f]=k.useState(""),[p,h]=k.useState([]),[m,b]=k.useState(!1),[v,y]=k.useState(!1),[j,_]=k.useState(null),[N,E]=k.useState({type:"Ingreso",category:"Ingresos",date:new Date().toISOString().split("T")[0],amountBs:0,description:"",reference:""}),T=async()=>{b(!0);try{const L=await we.getBankPreciseTransactions(i+1,o);h(L)}catch(L){console.error("Error al cargar banco preciso",L)}finally{b(!1)}};k.useEffect(()=>{T()},[i,o]);const B=k.useMemo(()=>{if(!t||t.length===0)return 45;const L=t[0],P=Number(L.pmValue)>0?Number(L.pmValue):Number(L.amValue)>0?Number(L.amValue):45;return Number(P)},[t]),F=k.useMemo(()=>p.reduce((L,P)=>{if(P.category==="Cierre/Apertura")return L;const G=Number(P.amountBs)||0;return P.type==="Ingreso"?L+G:L-G},0),[p]),R=k.useMemo(()=>p.filter(L=>{var G;return!u||L.description.toLowerCase().includes(u.toLowerCase())||((G=L.reference)==null?void 0:G.toLowerCase().includes(u.toLowerCase()))}),[p,u]),U=async L=>{L.preventDefault(),b(!0);try{const P=await fetch(`${Ne}/save_bank_transaction.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(N)});if(P.ok)await T(),y(!1),E({type:"Ingreso",category:"Ingresos",date:new Date().toISOString().split("T")[0],amountBs:0,description:"",reference:""});else{const G=await P.json();alert(`Error: ${G.error||"No se pudo guardar"}`)}}catch{alert("Error de conexión al registrar movimiento.")}finally{b(!1)}},D=async()=>{const L=`Estado de Cuenta Bancario Preciso - ${Te[i]} ${o}
Saldo: Bs. ${F.toLocaleString("es-VE")}
Generado por SAC 2026 ${Ln}`;if(navigator.share)try{await navigator.share({title:"Banco Preciso V4",text:L,url:window.location.href})}catch(P){console.log("Share failed",P)}else alert("Compartir no soportado en este navegador. Use Imprimir para generar PDF.")};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-24 no-print",children:[n.jsxs("div",{className:"bg-gradient-to-br from-indigo-900 via-slate-900 to-black text-white p-10 lg:p-14 rounded-[3.5rem] shadow-2xl relative overflow-hidden group border-b-8 border-indigo-600",children:[n.jsxs("div",{className:"relative z-10 flex flex-col md:flex-row justify-between items-start gap-10",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[n.jsx("div",{className:"w-10 h-10 bg-indigo-600 rounded-xl flex items-center justify-center shadow-lg shadow-indigo-500/20",children:n.jsx(Xi,{size:22,className:"animate-pulse"})}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.4em] text-indigo-400",children:"Banco Preciso V4.0 - Conciliación Real"})]}),n.jsxs("h3",{className:"text-6xl lg:text-7xl font-black tracking-tighter",children:["Bs. ",Number(F).toLocaleString("es-VE",{minimumFractionDigits:2})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-8",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500 animate-pulse"}),n.jsxs("p",{className:"text-sm font-bold text-slate-400 uppercase tracking-widest",children:["Ref USD: ",n.jsxs("span",{className:"text-blue-400 font-black",children:["$",(Number(F)/B).toLocaleString(void 0,{minimumFractionDigits:2})]})]})]}),n.jsx("div",{className:"px-4 py-1.5 bg-slate-800/50 rounded-full border border-slate-700/50",children:n.jsxs("span",{className:"text-[9px] font-black text-slate-500 uppercase tracking-widest",children:["Registros Consolidados: ",p.length," movimientos"]})})]})]}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 w-full md:w-auto self-center md:self-auto",children:[n.jsxs("button",{onClick:D,className:"flex-1 bg-indigo-600 hover:bg-indigo-500 text-white px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all shadow-xl flex items-center justify-center gap-2",children:[n.jsx(Aa,{size:16})," Compartir"]}),n.jsxs("button",{onClick:()=>window.print(),className:"flex-1 bg-white text-slate-900 px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:scale-105 transition-all shadow-xl flex items-center justify-center gap-2",children:[n.jsx(wt,{size:16})," Imprimir"]})]})]}),n.jsx(br,{className:"absolute right-[-40px] top-[-40px] w-96 h-96 text-white/[0.02] pointer-events-none group-hover:rotate-12 transition-transform duration-[20s]"})]}),n.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-end gap-6 bg-white p-8 rounded-[2.5rem] border border-slate-200 shadow-sm",children:[n.jsxs("div",{className:"w-full lg:w-auto space-y-4",children:[n.jsxs("h2",{className:"text-2xl font-black text-slate-900 tracking-tight flex items-center gap-3",children:[n.jsx(za,{className:"text-indigo-600"})," Movimientos Consolidados (Sin División)"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsxs("div",{className:"bg-slate-100 p-1.5 rounded-xl flex gap-1 border border-slate-200",children:[n.jsx("select",{value:i,onChange:L=>l(Number(L.target.value)),className:"bg-transparent border-none text-[10px] font-black uppercase tracking-widest text-slate-500 outline-none px-3 py-1 cursor-pointer",children:Te.map((L,P)=>n.jsx("option",{value:P,children:L},P))}),n.jsx("div",{className:"w-px h-4 bg-slate-300 self-center"}),n.jsx("input",{type:"number",value:o,onChange:L=>d(Number(L.target.value)),className:"bg-transparent border-none text-[10px] font-black text-indigo-600 outline-none w-16 text-center"})]}),n.jsxs("div",{className:"relative flex-1 sm:w-64",children:[n.jsx(er,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400",size:14}),n.jsx("input",{type:"text",placeholder:"Buscar referencia o concepto...",className:"w-full bg-slate-50 border border-slate-100 rounded-xl pl-9 pr-4 py-2 text-xs font-bold text-slate-800 focus:ring-2 focus:ring-indigo-100 transition-all",value:u,onChange:L=>f(L.target.value)})]})]})]}),n.jsxs("div",{className:"flex gap-3 w-full lg:w-auto",children:[n.jsxs("button",{onClick:()=>{const L=["Fecha","Ref","Descripción Consolidada","Tipo","Bs Total","USD Total"],P=R.map(G=>[G.date,G.reference||"S/R",G.description,G.type,`Bs. ${Number(G.amountBs).toLocaleString("es-VE",{minimumFractionDigits:2})}`,`$${Number(G.amount).toFixed(2)}`]);$c("AUDITORÍA BANCO PRECISO V4",L,P)},className:"flex-1 lg:flex-none bg-slate-100 text-slate-500 px-6 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest hover:bg-slate-200 transition-all flex items-center justify-center gap-2 text-center",children:[n.jsx(yr,{size:18})," Exportar HTML"]}),n.jsxs("button",{onClick:()=>y(!0),className:"flex-[2] lg:flex-none bg-slate-900 text-white px-8 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest shadow-xl transition-all active:scale-95 flex items-center justify-center gap-2",children:[n.jsx(En,{size:18})," Nuevo Asiento"]})]})]}),n.jsx("div",{className:"bg-white rounded-[3.5rem] border border-slate-200 shadow-sm overflow-hidden min-h-[400px]",children:m?n.jsxs("div",{className:"flex flex-col items-center justify-center py-32 gap-4",children:[n.jsx(ct,{className:"animate-spin text-indigo-600",size:40}),n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest animate-pulse",children:"Consolidando estados de cuenta..."})]}):n.jsx("div",{className:"overflow-x-auto",children:n.jsxs("table",{className:"w-full text-left border-collapse",children:[n.jsx("thead",{children:n.jsxs("tr",{className:"bg-slate-50 border-b border-slate-100",children:[n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Fecha"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Referencia"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest",children:"Explicación Consolidada"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"Bs. Estado Cuenta"}),n.jsx("th",{className:"px-8 py-6 text-[10px] font-black uppercase text-slate-500 tracking-widest text-right",children:"USD Ref"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-100",children:R.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:5,className:"py-24 text-center",children:[n.jsx(Ic,{size:48,className:"mx-auto mb-4 text-slate-100"}),n.jsx("p",{className:"text-slate-400 font-bold uppercase tracking-widest text-xs",children:"No se encontraron movimientos conciliados"})]})}):R.map(L=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-all group",children:[n.jsx("td",{className:"px-8 py-6 text-xs font-black text-slate-400",children:L.date}),n.jsx("td",{className:"px-8 py-6",children:n.jsx("span",{className:"font-mono text-xs font-black bg-indigo-50 text-indigo-600 px-3 py-1 rounded-lg border border-indigo-100",children:L.reference||"S/R"})}),n.jsx("td",{className:"px-8 py-6 max-w-md",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0 ${L.type==="Ingreso"?"bg-emerald-50 text-emerald-600":"bg-red-50 text-red-600"}`,children:L.type==="Ingreso"?n.jsx(da,{size:14}):n.jsx(fb,{size:14})}),n.jsx("p",{className:"text-xs font-bold text-slate-700 leading-relaxed truncate group-hover:whitespace-normal group-hover:overflow-visible group-hover:z-50 transition-all",children:L.description})]})}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:`font-black text-base tracking-tighter ${L.type==="Ingreso"?"text-emerald-600":"text-rose-600"}`,children:[L.type==="Ingreso"?"+":"-"," Bs. ",Number(L.amountBs).toLocaleString("es-VE",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-8 py-6 text-right",children:n.jsxs("div",{className:"font-black text-sm text-slate-400 tracking-tighter",children:["$ ",Number(L.amount).toLocaleString(void 0,{minimumFractionDigits:2})]})})]},L.id))})]})})}),n.jsxs("div",{className:"bg-indigo-50 border border-indigo-100 p-8 rounded-[2.5rem] flex items-center gap-6",children:[n.jsx("div",{className:"bg-indigo-600 p-4 rounded-2xl text-white",children:n.jsx(Ia,{size:28})}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-black text-indigo-900 uppercase text-xs tracking-widest mb-1",children:"Cálculo de Banco Preciso V4"}),n.jsx("p",{className:"text-indigo-800/70 text-[10px] font-medium uppercase tracking-tighter leading-relaxed",children:"Este módulo ignora la distribución administrativa (cuota mes / deuda histórica) y muestra los montos agrupados por referencia bancaria exacta, facilitando el cotejo directo con el estado de cuenta físico."})]})]}),v&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/60 backdrop-blur-md flex items-center justify-center z-[250] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 lg:p-14 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-10",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Nuevo Movimiento"}),n.jsx("button",{onClick:()=>y(!1),className:"p-3 bg-slate-100 rounded-full text-slate-400 hover:text-red-500 transition-colors",children:n.jsx(mt,{size:24})})]}),n.jsxs("form",{onSubmit:U,className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 mb-2 block",children:"Tipo de Operación"}),n.jsxs("div",{className:"flex gap-3",children:[n.jsx("button",{type:"button",onClick:()=>E({...N,type:"Ingreso",category:"Ingresos"}),className:`flex-1 py-4 rounded-2xl font-black text-xs uppercase tracking-widest border transition-all ${N.type==="Ingreso"?"bg-emerald-600 text-white border-emerald-600":"bg-slate-50 text-slate-400 border-slate-200"}`,children:"Ingreso"}),n.jsx("button",{type:"button",onClick:()=>E({...N,type:"Egreso",category:"Gastos"}),className:`flex-1 py-4 rounded-2xl font-black text-xs uppercase tracking-widest border transition-all ${N.type==="Egreso"?"bg-rose-600 text-white border-rose-600":"bg-slate-50 text-slate-400 border-slate-200"}`,children:"Egreso"})]})]}),n.jsx("input",{required:!0,className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-6 py-4 font-bold text-slate-900 outline-none",value:N.description,onChange:L=>E({...N,description:L.target.value.toUpperCase()}),placeholder:"DESCRIPCIÓN"}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsx("input",{required:!0,type:"date",className:"bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-xs",value:N.date,onChange:L=>E({...N,date:L.target.value})}),n.jsx("input",{required:!0,className:"bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 font-black text-xs",value:N.reference,onChange:L=>E({...N,reference:L.target.value}),placeholder:"REFERENCIA"})]}),n.jsxs("div",{className:"bg-blue-50 border border-blue-100 p-8 rounded-[2.5rem] space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-blue-600 tracking-widest text-center block",children:"Monto Bs."}),n.jsx("input",{required:!0,type:"number",step:"0.01",className:"w-full bg-white rounded-2xl px-6 py-5 text-3xl font-black text-slate-900 outline-none text-center",value:N.amountBs||"",onChange:L=>E({...N,amountBs:parseFloat(L.target.value)}),placeholder:"0,00"})]}),n.jsxs("button",{disabled:m,type:"submit",className:"w-full bg-slate-900 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.3em] active:scale-95 transition-all flex items-center justify-center gap-3",children:[m?n.jsx(ct,{className:"animate-spin"}):n.jsx(Zn,{size:18}),"PROCESAR"]})]})]})})]})},ii=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},bM=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},oFe=({user:e})=>{const{properties:t,residents:r,users:a,latestRate:s}=ht(),[i,l]=k.useState(null),o=k.useMemo(()=>["admin","programmer"].includes(e.role)?t:t.filter(D=>D.id===e.propertyId),[t,e]);k.useEffect(()=>{!["admin","programmer"].includes(e.role)&&e.propertyId&&l(e.propertyId)},[e]);const[d,u]=k.useState("selection"),[f,p]=k.useState(!1),[h,m]=k.useState(null),[b,v]=k.useState(null),[y,j]=k.useState({}),_=k.useRef(null);k.useEffect(()=>{(async()=>{try{const L=await we.getSystemSettings();j(L||{})}catch(L){console.error("Error fetching settings",L)}})()},[]);const N=k.useMemo(()=>t.find(D=>D.id===i),[t,i]),E=k.useMemo(()=>{if(!N)return null;const D=r.find(P=>P.propertyId===N.id&&P.isOwner),L=a.find(P=>P.cedula===(D==null?void 0:D.cedula));return{fullName:(D==null?void 0:D.fullName)||"Propietario",email:(L==null?void 0:L.email)||"",phone:(D==null?void 0:D.phone)||(L==null?void 0:L.phone)||"",telegramId:(L==null?void 0:L.telegramChatId)||"",propertyCode:N.code,propertyId:N.id}},[N,r,a]),T=async()=>{if(i){p(!0);try{const L=await(await fetch(`${Ne}/get_monthly_debt_status.php?propertyId=${i}`,{credentials:"include"})).json();L.success?(m(L),u("report")):alert("Error: "+L.error)}catch{alert("Error de red al obtener el reporte.")}finally{p(!1)}}},B=D=>{if(!D)return"";let L=D.trim();return L.startsWith("+")?L.replace(/\D/g,""):L.startsWith("0")?"58"+L.substring(1).replace(/\D/g,""):L.length===10?"58"+L.replace(/\D/g,""):L.replace(/\D/g,"")},F=async D=>{if(!E||!N||!h)return;let L=`🏢 *ESTADO DE CUENTA - DEUDA MESES*

Estimado(a) *${E.fullName}*,
Unidad: *${N.type} ${N.number}* (${N.code})

------------------------------------------
`;h.property.initialDebt>0&&(L+=`🤝 *Convenio de Pago:* $${ii(h.property.initialDebt)}
`),h.pendingMonths.length>0?(L+=`📅 *Meses Pendientes:*
`,h.pendingMonths.forEach(G=>{L+=`• ${Te[G.month]} ${G.year}: $${ii(G.pending_amount)}
`})):L+=`✅ No tiene meses pendientes.
`,h.property.creditBalance>0&&(L+=`💰 *Saldo a Favor:* $${ii(h.property.creditBalance)}
`);const P=h.property.initialDebt+h.pendingMonths.reduce((G,Q)=>G+Number(Q.pending_amount),0)-h.property.creditBalance;if(L+=`------------------------------------------
🔥 *TOTAL DEUDA NETA:* $${ii(Math.max(0,P))}

Consulte más detalles en:
🌐 ${Rr}

¡Gracias!`,D==="whatsapp"){const G=B(E.phone);if(!G)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${G}?text=${encodeURIComponent(L)}`,"_blank");return}if(D==="share"){if(navigator.share)try{await navigator.share({title:`Deuda Meses - ${N.code}`,text:L.replace(/\*/g,""),url:Rr})}catch(G){console.warn("Share failed",G)}else alert("La función de compartir no está disponible en este navegador.");return}v(D);try{const G={channel:D,messageType:"custom",subject:`Deuda Meses SAC 2026 - ${N.code}`,recipients:[{name:E.fullName,email:E.email,telegramChatId:E.telegramId,customMessage:L.replace(/\*/g,"")}]},H=await(await fetch(`${Ne}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(G)})).json();H.status==="success"?alert(`¡Éxito! Mensaje enviado por ${D}.`):alert("Error: "+H.message)}catch{alert("Error de red al enviar.")}finally{v(null)}},R=async()=>{if(_.current){p(!0);try{const L=(await rs(_.current,{scale:2,useCORS:!0,backgroundColor:"#f8fafc"})).toDataURL("image/png"),P=document.createElement("a");P.href=L,P.download=`DeudaMeses_${N==null?void 0:N.code}.png`,P.click()}catch{alert("Error al capturar imagen.")}finally{p(!1)}}},U=()=>{if(!N||!E||!h)return;const D=h.property.initialDebt+h.pendingMonths.reduce((H,X)=>H+Number(X.pending_amount),0)-h.property.creditBalance,L=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Deuda Meses - ${N.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');
        body { font-family: 'Inter', sans-serif; padding: 40px; color: #1e293b; background-color: #f8fafc; }
        .container { max-width: 800px; margin: 0 auto; background: white; padding: 50px; border-radius: 24px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
        .header { text-align: center; margin-bottom: 30px; }
        .title { font-size: 20px; font-weight: 900; text-transform: uppercase; color: #0f172a; letter-spacing: 2px; }
        .item-row { display: flex; justify-content: space-between; padding: 15px; border-bottom: 1px solid #f1f5f9; align-items: center; }
        .item-label { font-size: 13px; font-weight: 700; color: #475569; text-transform: uppercase; }
        .item-value { font-size: 15px; font-weight: 900; color: #0f172a; }
        .total-box { margin-top: 30px; padding: 25px; background: #0f172a; color: white; border-radius: 20px; display: flex; justify-content: space-between; align-items: center; }
        .footer { text-align: center; font-size: 10px; color: #94a3b8; margin-top: 30px; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <div class="title">Estado de Cuenta - Deuda Meses</div>
            <div style="font-size: 11px; color: #64748b; font-weight: 700; margin-top: 4px;">SAC 2026 - ${N.code}</div>
        </div>
        <div style="display: flex; justify-content: space-between; margin-bottom: 30px; font-size: 13px;">
            <div><strong>Propietario:</strong> ${E.fullName}</div>
            <div><strong>Unidad:</strong> ${N.type} ${N.number}</div>
        </div>
        
        <div style="border: 1px solid #f1f5f9; border-radius: 16px; overflow: hidden;">
            ${h.property.initialDebt>0?`
            <div class="item-row" style="background: #f8fafc;">
                <div class="item-label">Convenio de Pago</div>
                <div class="item-value">$ ${ii(h.property.initialDebt)}</div>
            </div>`:""}

            ${h.pendingMonths.map(H=>`
            <div class="item-row">
                <div class="item-label">${Te[H.month]} ${H.year}</div>
                <div class="item-value">$ ${ii(H.pending_amount)}</div>
            </div>`).join("")}

            ${h.property.creditBalance>0?`
            <div class="item-row" style="background: #f0fdf4; border-bottom: none;">
                <div class="item-label" style="color: #166534;">Saldo a Favor</div>
                <div class="item-value" style="color: #166534;">- $ ${ii(h.property.creditBalance)}</div>
            </div>`:""}
        </div>

        <div class="total-box">
            <div>
                <div style="font-size: 10px; text-transform: uppercase; color: #94a3b8;">Total Deuda Neta</div>
                <div style="font-size: 28px; font-weight: 900;">$ ${ii(Math.max(0,D))}</div>
            </div>
            <div style="text-align: right;">
                <div style="font-size: 10px; text-transform: uppercase; color: #94a3b8;">Equivalente VES</div>
                <div style="font-size: 20px; font-weight: 700;">Bs. ${bM(Math.max(0,D)*s)}</div>
            </div>
        </div>
        
        <div class="footer">
            Generado por SAC 2026 • ${Ln} • ${new Date().toLocaleString()}
        </div>
    </div>
</body>
</html>`,P=new Blob([L],{type:"text/html"}),G=URL.createObjectURL(P),Q=document.createElement("a");Q.href=G,Q.download=`DeudaMeses_${N.code}.html`,Q.click(),URL.revokeObjectURL(G)};if(d==="report"&&N&&E&&h){const D=h.property.initialDebt+h.pendingMonths.reduce((L,P)=>L+Number(P.pending_amount),0)-h.property.creditBalance;return n.jsxs("div",{className:"max-w-3xl mx-auto space-y-8 animate-in fade-in duration-500 pb-24 px-1 print:p-0",children:[n.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-4 no-print",children:[n.jsxs("button",{onClick:()=>u("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(gs,{size:16})," Volver"]}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Imprimir",children:n.jsx(wt,{size:20})}),n.jsx("button",{onClick:U,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Exportar HTML",children:n.jsx(wr,{size:20})}),n.jsx("button",{onClick:R,className:"p-3 bg-orange-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Capturar Imagen",children:n.jsx(sk,{size:20})}),n.jsx("button",{onClick:()=>F("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"WhatsApp",children:n.jsx(Ha,{size:20})}),n.jsx("button",{onClick:()=>F("telegram"),disabled:!E.telegramId||!!b,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${E.telegramId?"bg-sky-500":"bg-slate-200"}`,title:"Telegram",children:b==="telegram"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Bl,{size:20})}),n.jsx("button",{onClick:()=>F("email"),disabled:!E.email||!!b,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${E.email?"bg-indigo-600":"bg-slate-200"}`,title:"Correo",children:b==="email"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Br,{size:20})}),n.jsx("button",{onClick:()=>F("share"),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir",children:n.jsx(Aa,{size:20})})]})]}),n.jsxs("div",{ref:_,className:"bg-white rounded-[3rem] shadow-2xl border border-slate-200 overflow-hidden print:shadow-none print:border-slate-300",children:[n.jsxs("div",{className:"p-10 bg-slate-900 text-white text-center relative",children:[n.jsx("h2",{className:"text-2xl font-black uppercase tracking-[0.2em] mb-2",children:"Estado de Cuenta"}),n.jsx("p",{className:"text-blue-400 font-black uppercase tracking-widest text-[10px] mb-6",children:"Deuda por Meses • SAC 2026"}),n.jsxs("div",{className:"flex flex-col md:flex-row justify-center items-center gap-4 lg:gap-8",children:[n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Unidad"}),n.jsx("p",{className:"text-lg font-black text-blue-300",children:N.code})]}),n.jsxs("div",{className:"bg-white/10 px-6 py-3 rounded-2xl border border-white/10 backdrop-blur-md",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Tasa del Día"}),n.jsxs("p",{className:"text-lg font-black text-amber-400",children:[s.toFixed(2)," Bs/$"]})]})]})]}),n.jsxs("div",{className:"p-10 space-y-8",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-8 border-b border-slate-100 pb-8",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Propietario"}),n.jsx("p",{className:"text-lg font-black text-slate-900 uppercase",children:E.fullName})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Unidad"}),n.jsxs("p",{className:"text-lg font-black text-blue-600 uppercase",children:[N.type," ",N.number]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("h3",{className:"text-xs font-black uppercase tracking-widest text-slate-400 flex items-center gap-2",children:[n.jsx(Jd,{size:14,className:"text-blue-600"})," Desglose de Deuda"]}),n.jsxs("div",{className:"border border-slate-100 rounded-[2rem] overflow-hidden shadow-sm",children:[h.property.initialDebt>0&&n.jsxs("div",{className:"p-6 bg-slate-50 border-b border-slate-100 flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-white rounded-xl flex items-center justify-center text-blue-600 shadow-sm",children:n.jsx(eu,{size:20})}),n.jsx("p",{className:"text-sm font-black text-slate-700 uppercase tracking-tight",children:"Convenio de Pago"})]}),n.jsxs("p",{className:"text-lg font-black text-slate-900",children:["$ ",ii(h.property.initialDebt)]})]}),h.pendingMonths.map((L,P)=>n.jsxs("div",{className:"p-6 bg-white border-b border-slate-50 flex justify-between items-center last:border-b-0",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-50 rounded-xl flex items-center justify-center text-slate-400",children:n.jsx(Wr,{size:20})}),n.jsxs("p",{className:"text-sm font-black text-slate-700 uppercase tracking-tight",children:[Te[L.month]," ",L.year]})]}),n.jsxs("p",{className:"text-lg font-black text-slate-900",children:["$ ",ii(L.pending_amount)]})]},P)),h.pendingMonths.length===0&&h.property.initialDebt<=0&&n.jsxs("div",{className:"p-12 text-center bg-slate-50",children:[n.jsx(Gt,{size:40,className:"text-emerald-500 mx-auto mb-4"}),n.jsx("p",{className:"text-sm font-black text-slate-400 uppercase tracking-widest",children:"No hay meses pendientes"})]}),h.property.creditBalance>0&&n.jsxs("div",{className:"p-6 bg-emerald-50 flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 bg-white rounded-xl flex items-center justify-center text-emerald-600 shadow-sm",children:n.jsx(kn,{size:20})}),n.jsx("p",{className:"text-sm font-black text-emerald-700 uppercase tracking-tight",children:"Saldo a Favor"})]}),n.jsxs("p",{className:"text-lg font-black text-emerald-700",children:["- $ ",ii(h.property.creditBalance)]})]})]})]}),n.jsxs("div",{className:"bg-slate-900 rounded-[2.5rem] p-10 text-white shadow-xl flex flex-col md:flex-row justify-between items-center gap-8",children:[n.jsxs("div",{className:"text-center md:text-left",children:[n.jsx("p",{className:"text-[10px] font-black text-blue-400 uppercase tracking-[0.3em] mb-2",children:"Total Deuda Neta"}),n.jsx("div",{className:"flex items-center gap-3 justify-center md:justify-start",children:D<=0?n.jsx("div",{className:"px-4 py-2 bg-emerald-500 text-white rounded-full text-[10px] font-black uppercase tracking-widest",children:"SOLVENTE"}):n.jsx("div",{className:"px-4 py-2 bg-red-500 text-white rounded-full text-[10px] font-black uppercase tracking-widest",children:"PENDIENTE"})})]}),n.jsxs("div",{className:"text-center md:text-right",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Monto a Cancelar"}),n.jsxs("h3",{className:"text-5xl font-black tracking-tighter",children:["$ ",ii(Math.max(0,D))]}),n.jsxs("p",{className:"text-xl font-black text-blue-300 tracking-tight mt-1",children:["Bs. ",bM(Math.max(0,D)*s)]})]})]}),n.jsx("div",{className:"pt-8 border-t border-slate-100 text-center",children:n.jsxs("p",{className:"text-[9px] font-black text-slate-300 uppercase tracking-[0.5em]",children:[Ln," • Generado Digitalmente"]})})]})]})]})}return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsx("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Estado Cuenta - ",n.jsx("span",{className:"text-blue-600",children:"Deuda Meses"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Resumen simplificado de meses pendientes y convenios."})]})}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(ca,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Consulta de Deuda"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Seleccione la unidad para visualizar el resumen de deuda por meses."})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(ea,{size:14})," Unidad Inmobiliaria"]}),n.jsxs("select",{value:i||"",onChange:D=>l(Number(D.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),o.sort((D,L)=>D.code.localeCompare(L.code,void 0,{numeric:!0})).map(D=>n.jsxs("option",{value:D.id,children:[D.code," - ",D.type," ",D.number]},D.id))]})]}),n.jsxs("button",{disabled:!i||f,onClick:T,className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:[f?n.jsx($t,{className:"animate-spin",size:20}):n.jsx(Hs,{size:18}),"CONSULTAR DEUDA POR MESES"]})]})})]})},mf=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},cFe=({user:e})=>{const{properties:t,residents:r,users:a}=ht(),[s,i]=k.useState([]),[l,o]=k.useState(0),[d,u]=k.useState(!1),[f,p]=k.useState(null),[h,m]=k.useState(!1),v=(()=>{const T=[],B=[...t].sort((R,U)=>R.code.localeCompare(U.code,void 0,{numeric:!0})),F=["admin","programmer"].includes(e.role);return B.forEach(R=>{if(F){const U=r.filter(D=>D.propertyId===R.id);U.length===0?T.push({propertyId:R.id,propertyCode:R.code,propertyName:`${R.type} ${R.number}`,ownerName:"Propietario",phone:"",email:"",telegramId:""}):U.forEach(D=>{const L=a.find(G=>G.cedula===D.cedula),P=D.phone||(L==null?void 0:L.phone)||"";T.push({propertyId:R.id,propertyCode:R.code,propertyName:`${R.type} ${R.number}`,ownerName:D.fullName||"Propietario",phone:P,email:(L==null?void 0:L.email)||"",telegramId:(L==null?void 0:L.telegramChatId)||""})})}else{const U=r.find(P=>P.propertyId===R.id&&P.isOwner),D=a.find(P=>P.cedula===(U==null?void 0:U.cedula)),L=(U==null?void 0:U.phone)||(D==null?void 0:D.phone)||"";T.push({propertyId:R.id,propertyCode:R.code,propertyName:`${R.type} ${R.number}`,ownerName:(U==null?void 0:U.fullName)||"Propietario",phone:L,email:(D==null?void 0:D.email)||"",telegramId:(D==null?void 0:D.telegramChatId)||""})}}),T})(),y=()=>{const T=v.filter(B=>B.phone.replace(/\D/g,"").length>=7);if(T.length===0){alert("SISTEMA: No hay propietarios con números de teléfono válidos.");return}i(T),o(0),u(!0),j(T[0].propertyId)},j=async T=>{m(!0),p(null);try{const F=await(await fetch(`${Ne}/get_monthly_debt_status.php?propertyId=${T}`,{credentials:"include"})).json();F.success?p(F):console.error("Error fetching debt",F.error)}catch(B){console.error("Network error fetching debt",B)}finally{m(!1)}},_=T=>{if(!T)return"";let B=T.trim();return B.startsWith("+")?B.replace(/\D/g,""):B.startsWith("0")?"58"+B.substring(1).replace(/\D/g,""):B.length===10?"58"+B.replace(/\D/g,""):B.replace(/\D/g,"")},N=()=>{if(!f)return alert("Cargando datos de deuda...");const T=s[l];let B=`🏢 *ESTADO DE CUENTA - DEUDA MESES*

Estimado(a) *${T.ownerName}*,
Unidad: *${T.propertyName}* (${T.propertyCode})

------------------------------------------
`;f.property.initialDebt>0&&(B+=`🤝 *Convenio de Pago:* $${mf(f.property.initialDebt)}
`),f.pendingMonths.length>0?(B+=`📅 *Meses Pendientes:*
`,f.pendingMonths.forEach(U=>{B+=`• ${Te[U.month]} ${U.year}: $${mf(U.pending_amount)}
`})):B+=`✅ No tiene meses pendientes.
`,f.property.creditBalance>0&&(B+=`💰 *Saldo a Favor:* $${mf(f.property.creditBalance)}
`);const F=f.property.initialDebt+f.pendingMonths.reduce((U,D)=>U+Number(D.pending_amount),0)-f.property.creditBalance;B+=`------------------------------------------
🔥 *TOTAL DEUDA NETA:* $${mf(Math.max(0,F))}

Consulte más detalles en:
🌐 ${Rr}

¡Gracias!`;const R=_(T.phone);if(!R)return alert("No hay teléfono registrado.");if(window.open(`https://wa.me/${R}?text=${encodeURIComponent(B)}`,"_blank"),l<s.length-1){const U=l+1;o(U),j(s[U].propertyId)}else alert("¡Felicidades! Ha terminado de enviar toda la cola de WhatsApp."),u(!1)},E=()=>{if(l<s.length-1){const T=l+1;o(T),j(s[T].propertyId)}else u(!1)};return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Estado Cuenta - ",n.jsx("span",{className:"text-blue-600",children:"Deuda Meses Masivo"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium",children:"Envío masivo de estados de cuenta vía WhatsApp."})]}),n.jsxs("div",{className:"bg-slate-900 text-white px-6 py-3 rounded-2xl flex items-center gap-4 shadow-xl",children:[n.jsx(ea,{size:20,className:"text-blue-400"}),n.jsxs("span",{className:"text-sm font-black tracking-tight",children:[v.length," Unidades"]})]})]}),n.jsx("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12",children:n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-emerald-50 text-emerald-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(Ha,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Envío Automático"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Inicie la cola de envío para notificar a todos los propietarios sobre su deuda por meses."})]}),n.jsxs("div",{className:"bg-slate-50 p-6 rounded-2xl border border-slate-100",children:[n.jsxs("h3",{className:"text-xs font-black text-slate-400 uppercase tracking-widest mb-4 flex items-center gap-2",children:[n.jsx(Xi,{size:14,className:"text-emerald-500"})," Resumen de Alcance"]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"bg-white p-4 rounded-xl shadow-sm border border-slate-100",children:[n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Con Teléfono"}),n.jsx("p",{className:"text-xl font-black text-slate-900",children:v.filter(T=>T.phone&&T.phone.length>=7).length})]}),n.jsxs("div",{className:"bg-white p-4 rounded-xl shadow-sm border border-slate-100",children:[n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Sin Teléfono"}),n.jsx("p",{className:"text-xl font-black text-red-500",children:v.filter(T=>!T.phone||T.phone.length<7).length})]})]})]}),n.jsxs("button",{onClick:y,className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white py-6 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-emerald-200 transition-all active:scale-95 flex items-center justify-center gap-3",children:[n.jsx(Ha,{size:20}),"INICIAR COLA DE WHATSAPP"]})]})}),d&&s.length>0&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/80 backdrop-blur-md flex items-center justify-center z-[500] p-4",children:n.jsxs("div",{className:"bg-white rounded-[3rem] p-10 w-full max-w-md shadow-2xl animate-in zoom-in-95 duration-300",children:[n.jsxs("div",{className:"flex justify-between items-center mb-8",children:[n.jsx("div",{className:"bg-emerald-100 text-emerald-600 p-3 rounded-2xl",children:n.jsx(Ha,{size:24})}),n.jsx("button",{onClick:()=>u(!1),className:"text-slate-400 hover:text-red-500",children:n.jsx(mt,{size:24})})]}),n.jsxs("div",{className:"text-center mb-10",children:[n.jsx("h3",{className:"text-2xl font-black text-slate-900 tracking-tight",children:"Procesando Cola"}),n.jsxs("p",{className:"text-slate-400 text-sm font-medium",children:["Unidad ",l+1," de ",s.length]})]}),n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[2rem] border border-slate-100 mb-8 relative group",children:[n.jsx("div",{className:"absolute -top-3 left-8 bg-emerald-600 text-white px-3 py-1 rounded-full text-[9px] font-black uppercase tracking-widest shadow-lg",children:"Siguiente Envío"}),n.jsx("p",{className:"text-xl font-black text-slate-800 mb-1 uppercase",children:s[l].ownerName}),n.jsxs("p",{className:"text-xs font-bold text-blue-600 flex items-center gap-2",children:[n.jsx(_c,{size:12})," ",s[l].propertyCode," - ",s[l].phone]}),n.jsxs("div",{className:"mt-8 pt-6 border-t border-slate-200",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Estado de Deuda:"}),h?n.jsxs("div",{className:"flex items-center gap-2 text-blue-600 font-black text-sm",children:[n.jsx($t,{className:"animate-spin",size:14})," Cargando datos..."]}):f?n.jsxs("p",{className:"text-2xl font-black text-slate-900",children:["$ ",mf(f.property.initialDebt+f.pendingMonths.reduce((T,B)=>T+Number(B.pending_amount),0)-f.property.creditBalance)]}):n.jsx("p",{className:"text-red-500 font-black text-sm",children:"Error al cargar datos"})]}),n.jsx("div",{className:"w-full bg-slate-200 h-1.5 rounded-full mt-8 overflow-hidden",children:n.jsx("div",{className:"bg-emerald-500 h-full transition-all duration-500",style:{width:`${(l+1)/s.length*100}%`}})})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("button",{onClick:N,disabled:h||!f,className:"w-full bg-emerald-600 hover:bg-emerald-700 text-white py-6 rounded-2xl font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-emerald-200 transition-all flex items-center justify-center gap-3 active:scale-95 disabled:opacity-50",children:["LANZAR WHATSAPP ",n.jsx(BM,{size:18})]}),n.jsx("button",{onClick:E,className:"w-full py-4 text-slate-400 hover:text-slate-600 font-bold text-xs uppercase tracking-widest transition-colors",children:"Omitir Destinatario"})]})]})})]})},As=e=>Number(e).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),vM=e=>Number(e).toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2}),dFe=({user:e})=>{const{properties:t,moduleStatus:r,refreshData:a}=ht(),[s,i]=k.useState(new Date().getMonth()),[l,o]=k.useState(new Date().getFullYear()),[d,u]=k.useState(null),[f,p]=k.useState("selection"),[h,m]=k.useState(!1),[b,v]=k.useState(null),[y,j]=k.useState(!1),_=k.useRef(null),N=k.useMemo(()=>{const U=r.find(D=>D.id==="saldo-desglosado");return U?U.isActive:!1},[r]);k.useEffect(()=>{e.role==="owner"&&(t.find(U=>!0),t.length===1&&u(t[0].id))},[e,t]);const E=async()=>{j(!0);try{await we.saveSaldoDesglosadoVisibility(!N),await a()}catch{alert("Error al cambiar visibilidad")}finally{j(!1)}},T=async()=>{if(d){m(!0);try{const U=await we.getSaldoDesglosado(d,s,l);if(U.success&&U.data){const D=U.data;(l<2026||l===2026&&s<2)&&(D.current_fee=0),v(D),p("report"),window.scrollTo({top:0,behavior:"smooth"})}else alert("Atención: "+(U.error||"No se encontraron datos para el periodo seleccionado"))}catch{alert("Error al obtener el reporte.")}finally{m(!1)}}},B=async()=>{if(!_.current)return;const D=(await rs(_.current,{scale:2})).toDataURL("image/png"),L=document.createElement("a");L.href=D,L.download=`Saldo_Desglosado_${b.property.code}.png`,L.click()},F=async U=>{const D=`📊 *SALDO DESGLOSADO - ${va}*
Unidad: ${b.property.code}
Mes: ${Te[s]} ${l}
Saldo Inicial: $${As(b.initial_debt)}
Cuota Mes: $${As(b.current_fee)}
Abonos: $${As(b.payments.reduce((L,P)=>L+P.amount_usd,0))}
*SALDO FINAL: $${As(b.final_balance)}*`;U==="whatsapp"?window.open(`https://wa.me/?text=${encodeURIComponent(D)}`,"_blank"):U==="telegram"?window.open(`https://t.me/share/url?url=${encodeURIComponent(D)}`,"_blank"):U==="email"?window.open(`mailto:?subject=Saldo Desglosado ${b.property.code}&body=${encodeURIComponent(D)}`,"_blank"):U==="share"&&navigator.share&&navigator.share({title:"Saldo Desglosado",text:D})},R=()=>{const U=`<html><head><title>Saldo Desglosado</title><style>body{font-family:sans-serif;padding:20px;}table{width:100%;border-collapse:collapse;}th,td{border:1px solid #ddd;padding:12px;text-align:left;}th{background:#f4f4f4;}</style></head><body><h1>Saldo Desglosado - ${b.property.code}</h1><p><b>Mes:</b> ${Te[s]} ${l}</p><table><tr><th>Fecha</th><th>Ref</th><th>Bs.</th><th>Tasa</th><th>$.</th><th>Amort. Deuda</th><th>Amort. Mes</th></tr>`+b.payments.map(G=>`<tr><td>${G.date}</td><td>${G.reference}</td><td>${vM(G.amount_bs)}</td><td>${G.rate}</td><td>${As(G.amount_usd)}</td><td>${As(G.applied_to_old)}</td><td>${As(G.applied_to_current)}</td></tr>`).join("")+"</table></body></html>",D=new Blob([U],{type:"text/html"}),L=URL.createObjectURL(D),P=document.createElement("a");P.href=L,P.download=`Saldo_Desglosado_${b.property.code}.html`,P.click()};return f==="report"&&b?n.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-4 no-print",children:[n.jsxs("button",{onClick:()=>p("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(Hs,{className:"rotate-180",size:16})," Volver"]}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg hover:bg-slate-800 transition-all",title:"Imprimir",children:n.jsx(wt,{size:20})}),n.jsx("button",{onClick:R,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg hover:bg-blue-500 transition-all",title:"Exportar HTML",children:n.jsx(wr,{size:20})}),n.jsx("button",{onClick:B,className:"p-3 bg-purple-600 text-white rounded-xl shadow-lg hover:bg-purple-500 transition-all",title:"Capturar Imagen",children:n.jsx(sk,{size:20})}),n.jsx("button",{onClick:()=>F("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg hover:bg-emerald-400 transition-all",title:"WhatsApp",children:n.jsx(Ha,{size:20})}),n.jsx("button",{onClick:()=>F("telegram"),className:"p-3 bg-sky-500 text-white rounded-xl shadow-lg hover:bg-sky-400 transition-all",title:"Telegram",children:n.jsx(zs,{size:20})}),n.jsx("button",{onClick:()=>F("share"),className:"p-3 bg-indigo-600 text-white rounded-xl shadow-lg hover:bg-indigo-500 transition-all",title:"Compatir",children:n.jsx(Aa,{size:20})})]})]}),n.jsxs("div",{ref:_,className:"bg-white rounded-[2.5rem] shadow-2xl border border-slate-200 overflow-hidden bg-white",children:[n.jsxs("div",{className:"p-10 bg-slate-900 text-white text-center relative",children:[n.jsx("h2",{className:"text-2xl font-black uppercase tracking-[0.2em] mb-2",children:"Saldo Desglosado Mensual"}),n.jsx("p",{className:"text-blue-400 font-black uppercase tracking-widest text-[10px]",children:"Gestión Transparente • Kernel V4.2.04"}),n.jsxs("div",{className:"mt-8 grid grid-cols-1 md:grid-cols-3 gap-6",children:[n.jsxs("div",{className:"bg-white/10 p-5 rounded-3xl border border-white/10",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Propiedad"}),n.jsx("p",{className:"text-xl font-black text-blue-300",children:b.property.code}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:[b.property.type," ",b.property.number]})]}),n.jsxs("div",{className:"bg-white/10 p-5 rounded-3xl border border-white/10",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Periodo Revisado"}),n.jsx("p",{className:"text-xl font-black text-emerald-400 uppercase",children:Te[s]}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:l})]}),n.jsxs("div",{className:"bg-white/10 p-5 rounded-3xl border border-white/10",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Pagos en el Mes"}),n.jsx("p",{className:"text-2xl font-black text-amber-400",children:b.payments_count}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:"Transacciones registradas"})]})]})]}),n.jsxs("div",{className:"p-8 lg:p-12 space-y-10",children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[n.jsxs("div",{className:"p-6 bg-slate-50 border border-slate-100 rounded-3xl",children:[n.jsx("p",{className:"text-[9px] font-black uppercase text-slate-400 tracking-widest mb-2",children:"Saldo Inicial ($)"}),n.jsxs("p",{className:"text-2xl font-black text-slate-900",children:["$ ",As(b.initial_debt)]})]}),n.jsxs("div",{className:"p-6 bg-blue-50 border border-blue-100 rounded-3xl",children:[n.jsx("p",{className:"text-[9px] font-black uppercase text-blue-400 tracking-widest mb-2",children:"Convenio Activo ($)"}),n.jsxs("p",{className:"text-2xl font-black text-blue-600",children:["$ ",As(b.agreement_balance)]})]}),n.jsxs("div",{className:"p-6 bg-slate-900 border border-slate-800 rounded-3xl",children:[n.jsx("p",{className:"text-[9px] font-black uppercase text-slate-500 tracking-widest mb-2 text-white/50",children:"Cuota Mes Actual ($)"}),n.jsxs("p",{className:"text-2xl font-black text-white",children:["$ ",As(b.current_fee)]})]}),n.jsxs("div",{className:"p-6 bg-emerald-50 border border-emerald-100 rounded-3xl",children:[n.jsx("p",{className:"text-[9px] font-black uppercase text-emerald-600 tracking-widest mb-2",children:"Saldo Final ($)"}),n.jsxs("p",{className:"text-2xl font-black text-emerald-600 font-bold",children:["$ ",As(b.final_balance)]})]})]}),n.jsx("div",{className:"overflow-x-auto rounded-3xl border border-slate-100 shadow-sm",children:n.jsxs("table",{className:"w-full text-left",children:[n.jsx("thead",{className:"bg-slate-50",children:n.jsxs("tr",{className:"border-b border-slate-100 text-[9px] font-black uppercase text-slate-400 tracking-widest",children:[n.jsx("th",{className:"px-6 py-5",children:"Fecha Contable"}),n.jsx("th",{className:"px-6 py-5",children:"Referencia"}),n.jsx("th",{className:"px-6 py-5 text-right",children:"Depósito Bs."}),n.jsx("th",{className:"px-6 py-5 text-center",children:"Tasa $"}),n.jsx("th",{className:"px-6 py-5 text-right",children:"Equivalente $"}),n.jsx("th",{className:"px-6 py-5 text-right text-blue-600",children:"Amort. Deuda"}),n.jsx("th",{className:"px-6 py-5 text-right text-emerald-600",children:"Amort. Mes"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-50",children:b.payments.length>0?b.payments.map((U,D)=>n.jsxs("tr",{className:"hover:bg-slate-50/50 transition-colors",children:[n.jsx("td",{className:"px-6 py-4 font-bold text-slate-600 text-xs",children:U.date}),n.jsx("td",{className:"px-6 py-4 font-mono text-[10px] text-slate-400",children:U.reference}),n.jsx("td",{className:"px-6 py-4 text-right font-black text-slate-900 text-xs underline decoration-slate-100 underline-offset-4",children:vM(U.amount_bs)}),n.jsx("td",{className:"px-6 py-4 text-center font-bold text-blue-500 text-xs",children:U.rate}),n.jsxs("td",{className:"px-6 py-4 text-right font-black text-slate-900 text-xs",children:["$ ",As(U.amount_usd)]}),n.jsxs("td",{className:"px-6 py-4 text-right font-bold text-blue-600 text-xs",children:["$ ",As(U.applied_to_old)]}),n.jsxs("td",{className:"px-6 py-4 text-right font-bold text-emerald-600 text-xs",children:["$ ",As(U.applied_to_current)]})]},D)):n.jsx("tr",{children:n.jsx("td",{colSpan:7,className:"px-6 py-12 text-center text-slate-400 uppercase font-black text-[10px] tracking-widest",children:"No hay pagos registrados para este periodo"})})})]})}),n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center bg-slate-50 p-8 rounded-[2rem] gap-6",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-12 h-12 bg-white rounded-2xl flex items-center justify-center text-blue-600 shadow-sm",children:n.jsx(ho,{size:24})}),n.jsxs("div",{children:[n.jsx("p",{className:"text-xs font-black text-slate-900 uppercase",children:"Certificación de Saldo"}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest",children:"Información validada por el sistema central"})]})]}),n.jsxs("div",{className:"text-center md:text-right",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest mb-1",children:"Última Actualización"}),n.jsx("p",{className:"text-xs font-black text-slate-600",children:new Date().toLocaleString()})]})]})]})]})]}):n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-black text-slate-900 tracking-tight",children:["Saldo ",n.jsx("span",{className:"text-blue-600",children:"Desglosado"})]}),n.jsx("p",{className:"text-slate-400 mt-1 font-medium italic",children:"Visión detallada y transparente de su cuenta mes a mes."})]}),["programmer","admin"].includes(e.role)&&n.jsxs("button",{onClick:E,disabled:y,className:`flex items-center gap-3 px-6 py-3 rounded-2xl border transition-all ${N?"bg-emerald-50 border-emerald-100 text-emerald-600":"bg-slate-100 border-slate-200 text-slate-400"}`,children:[y?n.jsx(qi,{className:"animate-spin",size:18}):N?n.jsx(UM,{size:20}):n.jsx(DM,{size:20}),n.jsxs("div",{className:"text-left",children:[n.jsx("p",{className:"text-[8px] font-black uppercase tracking-widest",children:"Visibilidad Propietarios"}),n.jsx("p",{className:"text-[10px] font-black uppercase",children:N?"Activado (ON)":"Desactivado (OFF)"})]})]})]}),n.jsxs("div",{className:"bg-white rounded-[3rem] border border-slate-200 shadow-sm p-8 lg:p-12 overflow-hidden relative",children:[n.jsx(Qm,{className:"absolute right-[-40px] top-[-40px] text-slate-50 w-80 h-80 pointer-events-none"}),n.jsxs("div",{className:"max-w-2xl mx-auto space-y-8 relative z-10",children:[n.jsxs("div",{className:"text-center space-y-4",children:[n.jsx("div",{className:"w-20 h-20 bg-blue-50 text-blue-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-inner",children:n.jsx(Da,{size:40})}),n.jsx("h2",{className:"text-2xl font-black text-slate-900 tracking-tight uppercase",children:"Historial de Gestión"}),n.jsx("p",{className:"text-slate-400 text-sm font-medium",children:"Consulte el desglose de su cuenta seleccionando el periodo de interés."})]}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Mes"}),n.jsx("select",{value:s,onChange:U=>i(Number(U.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:Te.map((U,D)=>n.jsx("option",{value:D,children:U},D))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1",children:"Año"}),n.jsx("input",{type:"number",value:l,onChange:U=>o(Number(U.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all"})]})]}),["programmer","admin","board"].includes(e.role)&&n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 flex items-center gap-2",children:[n.jsx(ea,{size:14})," Seleccionar Propiedad"]}),n.jsxs("select",{value:d||"",onChange:U=>u(Number(U.target.value)),className:"w-full bg-slate-50 border border-slate-100 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:ring-4 focus:ring-blue-500/10 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Unidad..."}),t.sort((U,D)=>U.code.localeCompare(D.code,void 0,{numeric:!0})).map(U=>n.jsxs("option",{value:U.id,children:[U.code," - ",U.type," ",U.number]},U.id))]})]}),n.jsxs("button",{disabled:!d||h,onClick:T,className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 rounded-[2.5rem] font-black text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:[h?n.jsx(qi,{className:"animate-spin",size:20}):n.jsx(Hs,{size:18}),"CONSULTAR SALDO DETALLADO"]}),n.jsxs("div",{className:"flex items-center gap-4 py-4 px-6 bg-amber-50 rounded-2xl border border-amber-100",children:[n.jsx(ho,{className:"text-amber-600 shrink-0",size:18}),n.jsx("p",{className:"text-[10px] font-bold text-amber-800 uppercase tracking-tight",children:"Este reporte incluye amortización sobre deudas previas y cuotas actuales."})]})]})]})]})},sa=e=>Number(e).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),uFe=({user:e})=>{const{properties:t,moduleStatus:r,refreshData:a}=ht(),[s,i]=k.useState(new Date().getMonth()),[l,o]=k.useState(new Date().getFullYear()),[d,u]=k.useState(null),[f,p]=k.useState("selection"),[h,m]=k.useState(!1),[b,v]=k.useState(null),[y,j]=k.useState(!1),_=k.useRef(null),N=k.useMemo(()=>{const D=r.find(L=>L.id==="saldo-desglosado-avanzado");return D?D.isActive:!1},[r]),E=async()=>{j(!0);try{await we.saveModuleStatus("saldo-desglosado-avanzado",!N),await a()}catch{alert("Error al cambiar visibilidad")}finally{j(!1)}},T=async()=>{if(d){m(!0);try{const D=await we.getSaldoDesglosado(d,s,l);if(D.success&&D.data){const L=D.data;(l<2026||l===2026&&s<2)&&(L.current_fee=0),v(L),p("report"),window.scrollTo({top:0,behavior:"smooth"})}else alert("Atención: "+(D.error||"No se encontraron datos para el periodo seleccionado"))}catch{alert("Error al obtener el reporte.")}finally{m(!1)}}},B=async()=>{if(_.current)try{const L=(await rs(_.current,{scale:2})).toDataURL("image/png"),P=document.createElement("a");P.href=L,P.download=`Amortizacion_${b.property.code}.png`,P.click();const G=`*SALDO AVANZADO:* Adjunto imagen de amortización para la unidad ${b.property.code}.`;window.open(`https://wa.me/?text=${encodeURIComponent(G)}`,"_blank")}catch{alert("Error al capturar imagen")}},F=async()=>{if(!_.current)return;const L=(await rs(_.current,{scale:2})).toDataURL("image/png"),P=document.createElement("a");P.href=L,P.download=`Saldo_Avanzado_${b.property.code}.png`,P.click()},R=async D=>{const L=`📊 *TRAZABILIDAD CONTABLE AVANZADA - ${va}*
Unidad: ${b.property.code}
Balance: ${Te[s]} ${l}
--------------------------
Deuda Inicial: $${sa(b.initial_debt)}
Cuota mes: $${sa(b.current_fee)}
Pagos: $${sa(b.payments.reduce((P,G)=>P+G.amount_usd,0))}
*SALDO RESTANTE: $${sa(b.final_balance)}*`;D==="whatsapp"?window.open(`https://wa.me/?text=${encodeURIComponent(L)}`,"_blank"):D==="telegram"?window.open(`https://t.me/share/url?url=${encodeURIComponent(L)}`,"_blank"):D==="email"?window.open(`mailto:?subject=Saldo Avanzado ${b.property.code}&body=${encodeURIComponent(L)}`,"_blank"):D==="share"&&navigator.share&&navigator.share({title:"Saldo Avanzado",text:L})},U=()=>{const D=`
        <html>
        <head>
            <title>Saldo Avanzado - ${b.property.code}</title>
            <style>
                body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; padding: 40px; color: #333; background: #f9f9f9; }
                .container { max-width: 1000px; margin: auto; background: white; padding: 40px; border: 1px solid #eee; box-shadow: 0 0 20px rgba(0,0,0,0.05); }
                h1 { color: #1e293b; border-bottom: 2px solid #3b82f6; padding-bottom: 10px; }
                .header-info { display: flex; justify-content: space-between; margin-bottom: 30px; }
                table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 13px; }
                th, td { border: 1px solid #e2e8f0; padding: 12px; text-align: left; }
                th { background: #f8fafc; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 800; }
                .text-right { text-align: right; }
                .font-bold { font-weight: bold; }
                .bg-blue { background: #eff6ff; }
                .bg-green { background: #f0fdf4; }
                .footer { margin-top: 40px; font-size: 10px; color: #94a3b8; text-align: center; border-top: 1px solid #eee; padding-top: 20px; }
            </style>
        </head>
        <body>
            <div class="container">
                <h1>Reporte de Amortización Contable</h1>
                <div class="header-info">
                    <div>
                        <p><b>PROPIEDAD:</b> ${b.property.code}</p>
                        <p><b>PERIODO:</b> ${Te[s]} ${l}</p>
                    </div>
                    <div>
                        <p><b>CONDOMINIO:</b> ${va}</p>
                        <p><b>SALDO FINAL:</b> $ ${sa(b.final_balance)}</p>
                    </div>
                </div>
                <table>
                    <thead>
                        <tr>
                            <th>Fecha</th>
                            <th>Descripción / Ref</th>
                            <th class="text-right">Debe ($)</th>
                            <th class="text-right">Haber ($)</th>
                            <th class="text-right">Saldo Amortizado ($)</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>--</td>
                            <td><b>SALDO INICIAL ACUMULADO</b></td>
                            <td class="text-right">${sa(b.initial_debt)}</td>
                            <td class="text-right">0.00</td>
                            <td class="text-right font-bold">${sa(b.initial_debt)}</td>
                        </tr>
                        ${b.payments.map(Q=>`
                        <tr>
                            <td>${Q.date}</td>
                            <td>PAGO RECIBIDO - REF: ${Q.reference}</td>
                            <td class="text-right">0.00</td>
                            <td class="text-right">${sa(Q.amount_usd)}</td>
                            <td class="text-right italic font-bold" style="color: #059669">- ${sa(Q.amount_usd)}</td>
                        </tr>
                        `).join("")}
                        <tr class="bg-blue">
                            <td>${new Date().toLocaleDateString()}</td>
                            <td><b>CUOTA DEL MES</b></td>
                            <td class="text-right">${sa(b.current_fee)}</td>
                            <td class="text-right">0.00</td>
                            <td class="text-right font-bold">+ ${sa(b.current_fee)}</td>
                        </tr>
                        <tr class="bg-green">
                            <td colspan="4" class="text-right font-black"><b>TOTAL SALDO PENDIENTE A LA FECHA</b></td>
                            <td class="text-right font-black" style="font-size: 16px;"><b>$ ${sa(b.final_balance)}</b></td>
                        </tr>
                    </tbody>
                </table>
                <div class="footer">
                    SAC 2026 Kernel V4.2.04 MC/MB • TecnoMath Solutions
                </div>
            </div>
        </body>
        </html>`,L=new Blob([D],{type:"text/html"}),P=URL.createObjectURL(L),G=document.createElement("a");G.href=P,G.download=`Amortizacion_${b.property.code}.html`,G.click()};if(f==="report"&&b){let D=Number(b.initial_debt);return n.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-4 no-print",children:[n.jsxs("button",{onClick:()=>p("selection"),className:"flex items-center gap-2 px-6 py-3 bg-white border border-slate-200 rounded-2xl font-black text-[10px] uppercase tracking-widest text-slate-500 hover:bg-slate-50 transition-all shadow-sm",children:[n.jsx(Hs,{className:"rotate-180",size:16})," Volver a Selección"]}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.jsx("button",{onClick:()=>window.print(),className:"p-3 bg-slate-900 text-white rounded-xl shadow-lg hover:bg-slate-800 transition-all",title:"Imprimir",children:n.jsx(wt,{size:20})}),n.jsx("button",{onClick:U,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg hover:bg-blue-500 transition-all",title:"Exportar HTML",children:n.jsx(wr,{size:20})}),n.jsx("button",{onClick:F,className:"p-3 bg-indigo-600 text-white rounded-xl shadow-lg hover:bg-indigo-500 transition-all",title:"Capturar Imagen",children:n.jsx(Gs,{size:20})}),n.jsx("button",{onClick:B,className:"p-3 bg-emerald-600 text-white rounded-xl shadow-lg hover:bg-emerald-500 transition-all",title:"WhatsApp imagen",children:n.jsx(sk,{size:20})}),n.jsx("button",{onClick:()=>R("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg hover:bg-emerald-400 transition-all",title:"WhatsApp",children:n.jsx(Ha,{size:20})}),n.jsx("button",{onClick:()=>R("telegram"),className:"p-3 bg-sky-500 text-white rounded-xl shadow-lg hover:bg-sky-400 transition-all",title:"Telegram",children:n.jsx(zs,{size:20})}),n.jsx("button",{onClick:()=>R("email"),className:"p-3 bg-slate-500 text-white rounded-xl shadow-lg hover:bg-slate-400 transition-all",title:"Email",children:n.jsx(Br,{size:20})}),n.jsx("button",{onClick:()=>R("share"),className:"p-3 bg-violet-600 text-white rounded-xl shadow-lg hover:bg-violet-500 transition-all",title:"Compatir",children:n.jsx(Aa,{size:20})})]})]}),n.jsxs("div",{ref:_,className:"bg-white rounded-[1rem] border-2 border-slate-900 overflow-hidden shadow-2xl",children:[n.jsxs("div",{className:"p-8 bg-slate-900 text-white border-b-4 border-blue-600",children:[n.jsxs("div",{className:"flex justify-between items-start",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h1",{className:"text-3xl font-black tracking-tighter uppercase italic leading-none",children:"Hoja de Amortización"}),n.jsx("p",{className:"text-blue-400 font-bold text-[10px] tracking-[0.3em] uppercase",children:"Trazabilidad Contable Avanzada"})]}),n.jsxs("div",{className:"text-right",children:[n.jsx("p",{className:"text-[10px] font-black uppercase text-slate-400",children:va}),n.jsx("p",{className:"text-xs font-bold text-slate-300 tracking-widest mt-1",children:"Kernel V4.2.04 MC/MB"})]})]}),n.jsxs("div",{className:"mt-8 grid grid-cols-2 md:grid-cols-4 gap-4",children:[n.jsxs("div",{className:"bg-white/5 p-4 rounded-xl border border-white/10",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-white/40 mb-1",children:"Propiedad"}),n.jsx("p",{className:"text-xl font-black text-white",children:b.property.code})]}),n.jsxs("div",{className:"bg-white/5 p-4 rounded-xl border border-white/10",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-white/40 mb-1",children:"Mes Auditoría"}),n.jsx("p",{className:"text-xl font-black text-blue-400 uppercase",children:Te[s]})]}),n.jsxs("div",{className:"bg-white/5 p-4 rounded-xl border border-white/10",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-white/40 mb-1",children:"Déficit Inicial ($)"}),n.jsxs("p",{className:"text-xl font-black text-red-400 italic underline",children:["$ ",sa(b.initial_debt)]})]}),n.jsxs("div",{className:"bg-white/5 p-4 rounded-xl border border-white/10",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-white/40 mb-1",children:"Balance Actual ($)"}),n.jsxs("p",{className:"text-xl font-black text-emerald-400",children:["$ ",sa(b.final_balance)]})]})]})]}),n.jsxs("div",{className:"p-4 sm:p-8",children:[n.jsx("div",{className:"overflow-x-auto border-2 border-slate-200 rounded-xl",children:n.jsxs("table",{className:"w-full border-collapse",children:[n.jsx("thead",{className:"bg-slate-100 divide-x-2 divide-slate-200",children:n.jsxs("tr",{className:"text-[10px] font-black uppercase text-slate-600 tracking-widest",children:[n.jsx("th",{className:"px-4 py-4 text-center border-r-2 border-slate-200 w-16",children:"Item"}),n.jsx("th",{className:"px-4 py-4 border-r-2 border-slate-200",children:"Fecha"}),n.jsx("th",{className:"px-4 py-4 border-r-2 border-slate-200",children:"Descripción del Movimiento"}),n.jsx("th",{className:"px-4 py-4 text-right border-r-2 border-slate-200",children:"Cargo (+)"}),n.jsx("th",{className:"px-4 py-4 text-right border-r-2 border-slate-200",children:"Abono (-)"}),n.jsx("th",{className:"px-4 py-4 text-right bg-blue-50 text-blue-800",children:"Saldo Restante ($)"})]})}),n.jsxs("tbody",{className:"divide-y-2 divide-slate-100 font-mono text-[11px] sm:text-xs",children:[n.jsxs("tr",{className:"bg-slate-50 divide-x-2 divide-slate-100",children:[n.jsx("td",{className:"px-4 py-4 text-center font-bold",children:"001"}),n.jsx("td",{className:"px-4 py-4 text-slate-400 italic",children:"Pre-gestión"}),n.jsx("td",{className:"px-4 py-4 font-black uppercase tracking-tight",children:"SALDO INICIAL / CARGO ACUMULADO"}),n.jsx("td",{className:"px-4 py-4 text-right font-black text-red-600 underline underline-offset-4 decoration-red-200",children:sa(b.initial_debt)}),n.jsx("td",{className:"px-4 py-4 text-right text-slate-300",children:"0.00"}),n.jsx("td",{className:"px-4 py-4 text-right font-black bg-blue-50/50",children:sa(D)})]}),b.payments.map((L,P)=>(D-=Number(L.amount_usd),n.jsxs("tr",{className:"divide-x-2 divide-slate-100 hover:bg-slate-50 transition-colors",children:[n.jsx("td",{className:"px-4 py-4 text-center text-slate-300 font-bold",children:String(P+2).padStart(3,"0")}),n.jsx("td",{className:"px-4 py-4 font-bold text-slate-800",children:L.date}),n.jsx("td",{className:"px-4 py-4 uppercase",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(UV,{size:12,className:"text-emerald-500"}),n.jsxs("span",{children:["ABONO RECIBIDO - REF: ",n.jsx("span",{className:"font-black text-blue-600",children:L.reference})]})]})}),n.jsx("td",{className:"px-4 py-4 text-right text-slate-300",children:"0.00"}),n.jsxs("td",{className:"px-4 py-4 text-right font-black text-emerald-600 italic",children:["-",sa(L.amount_usd)]}),n.jsx("td",{className:"px-4 py-4 text-right font-black bg-blue-50/50",children:sa(D)})]},P))),(D+=Number(b.current_fee),n.jsxs("tr",{className:"bg-blue-600 text-white divide-x-2 divide-blue-500",children:[n.jsx("td",{className:"px-4 py-4 text-center font-bold",children:"---"}),n.jsx("td",{className:"px-4 py-4 font-bold",children:new Date().toLocaleDateString()}),n.jsx("td",{className:"px-4 py-4 uppercase font-black",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(RV,{size:12,className:"text-blue-200"}),n.jsxs("span",{children:["CUOTA MES ACTUAL - GESTIÓN ",Te[s]]})]})}),n.jsxs("td",{className:"px-4 py-4 text-right font-black italic",children:["+",sa(b.current_fee)]}),n.jsx("td",{className:"px-4 py-4 text-right text-blue-400",children:"0.00"}),n.jsx("td",{className:"px-4 py-4 text-right font-black bg-slate-900 border-l-4 border-l-blue-400",style:{fontSize:"14px"},children:sa(D)})]}))]})]})}),n.jsxs("div",{className:"mt-10 grid grid-cols-1 md:grid-cols-2 gap-8 items-end border-t-2 border-slate-900 pt-8 no-break",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 bg-slate-900 text-white rounded-lg flex items-center justify-center shadow-lg",children:n.jsx(vi,{size:20})}),n.jsx("h4",{className:"text-xs font-black uppercase tracking-widest text-slate-900",children:"Resumen de Amortización"})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"p-4 bg-slate-50 border border-slate-200 rounded-xl",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Total Abonos ($)"}),n.jsxs("p",{className:"text-sm font-black text-emerald-600",children:["-$ ",sa(b.payments.reduce((L,P)=>L+Number(P.amount_usd),0))]})]}),n.jsxs("div",{className:"p-4 bg-slate-50 border border-slate-200 rounded-xl",children:[n.jsx("p",{className:"text-[8px] font-black uppercase text-slate-400 mb-1",children:"Total Cargos ($)"}),n.jsxs("p",{className:"text-sm font-black text-red-600",children:["+$ ",sa(Number(b.initial_debt)+Number(b.current_fee))]})]})]})]}),n.jsxs("div",{className:"text-center p-6 border-2 border-dashed border-slate-200 rounded-2xl relative overflow-hidden",children:[n.jsx(ho,{className:"absolute left-[-20px] bottom-[-20px] w-24 h-24 text-slate-50 -rotate-12"}),n.jsxs("div",{className:"relative z-10",children:[n.jsx("p",{className:"text-[8px] font-black text-slate-400 uppercase tracking-widest mb-4",children:"Validación de Gestión Contable"}),n.jsx("div",{className:"w-32 h-32 border-4 border-blue-600/20 rounded-full flex items-center justify-center mx-auto mb-4",children:n.jsx(Gt,{size:48,className:"text-blue-600"})}),n.jsx("p",{className:"text-[10px] font-black text-slate-900 uppercase",children:"Certificado por TecnoMath"}),n.jsxs("p",{className:"text-[8px] font-bold text-slate-400 mt-1 uppercase italic underline",children:[b.property.code," • ",new Date().toLocaleDateString()]})]})]})]})]})]}),n.jsxs("div",{className:"flex items-center gap-3 p-6 bg-blue-600 text-white rounded-3xl shadow-xl shadow-blue-200 no-print",children:[n.jsx(Da,{size:24}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black uppercase tracking-widest",children:"Información de Auditoría"}),n.jsx("p",{className:"text-xs font-medium",children:"Este documento refleja la resta aritmética de abonos sobre cargos acumulados desde el inicio de la gestión administrativa."})]})]})]})}return n.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 pb-20",children:[n.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-4xl font-black text-slate-900 tracking-tighter leading-none uppercase italic",children:["Saldo ",n.jsx("span",{className:"text-blue-600 underline decoration-blue-200 underline-offset-8",children:"Avanzado"})]}),n.jsx("p",{className:"text-slate-400 mt-4 font-bold text-[11px] uppercase tracking-[0.2em]",children:"Trazabilidad Contable & Amortización • V4.2.04"})]}),["programmer","admin"].includes(e.role)&&n.jsxs("button",{onClick:E,disabled:y,className:`flex items-center gap-3 px-8 py-4 rounded-[2rem] border-2 transition-all shadow-lg ${N?"bg-emerald-50 border-emerald-500 text-emerald-600 shadow-emerald-100":"bg-white border-slate-200 text-slate-400 shadow-slate-100"}`,children:[y?n.jsx(qi,{className:"animate-spin",size:20}):N?n.jsx(UM,{size:24}):n.jsx(DM,{size:24}),n.jsxs("div",{className:"text-left",children:[n.jsx("p",{className:"text-[9px] font-black uppercase tracking-widest",children:"Estado para Propietarios"}),n.jsx("p",{className:"text-xs font-black uppercase",children:N?"VISIBLE (ON)":"OCULTO (OFF)"})]})]})]}),n.jsxs("div",{className:"bg-white rounded-[4rem] border-2 border-slate-900 shadow-2xl p-10 lg:p-16 overflow-hidden relative",children:[n.jsx(wl,{className:"absolute right-[-60px] top-[-60px] text-slate-50 w-96 h-96 pointer-events-none -rotate-12"}),n.jsxs("div",{className:"max-w-2xl mx-auto space-y-12 relative z-10",children:[n.jsxs("div",{className:"text-center space-y-6",children:[n.jsxs("div",{className:"w-24 h-24 bg-slate-900 text-white rounded-[2.5rem] flex items-center justify-center mx-auto shadow-2xl relative",children:[n.jsx(Da,{size:48,className:"animate-pulse"}),n.jsx("div",{className:"absolute -bottom-2 -right-2 w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center border-4 border-white",children:n.jsx(vi,{size:18})})]}),n.jsx("h2",{className:"text-3xl font-black text-slate-900 tracking-tighter uppercase italic leading-none",children:"Módulo de Amortización"}),n.jsx("p",{className:"text-slate-500 text-sm font-medium leading-relaxed",children:"Visualice el descuento progresivo de la deuda a medida que se procesan los abonos en la cuenta del inmueble."})]}),n.jsxs("div",{className:"p-8 bg-slate-50 rounded-[3rem] border border-slate-200 space-y-6",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-[0.2em] ml-2",children:"Auditado en el Mes"}),n.jsx("select",{value:s,onChange:D=>i(Number(D.target.value)),className:"w-full bg-white border-2 border-slate-200 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:border-blue-600 transition-all appearance-none cursor-pointer text-center",children:Te.map((D,L)=>n.jsx("option",{value:L,children:D},L))})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-[0.2em] ml-2",children:"Año Fiscal"}),n.jsx("input",{type:"number",value:l,onChange:D=>o(Number(D.target.value)),className:"w-full bg-white border-2 border-slate-200 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:border-blue-600 text-center transition-all"})]})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-[0.2em] ml-2 flex items-center gap-2 italic",children:[n.jsx(ea,{size:14,className:"text-blue-600"})," Unidad a Verificar"]}),n.jsxs("select",{value:d||"",onChange:D=>u(Number(D.target.value)),className:"w-full bg-white border-2 border-slate-200 rounded-2xl p-5 text-sm font-black text-slate-700 outline-none focus:border-blue-600 transition-all appearance-none cursor-pointer",children:[n.jsx("option",{value:"",children:"Seleccione Propiedad..."}),t.sort((D,L)=>D.code.localeCompare(L.code,void 0,{numeric:!0})).map(D=>n.jsxs("option",{value:D.id,children:[D.code," - ",D.type," ",D.number]},D.id))]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("button",{disabled:!d||h,onClick:T,className:"w-full bg-slate-900 border-b-4 border-slate-950 text-white py-8 rounded-[3rem] font-black text-xs uppercase tracking-[0.3em] shadow-2xl hover:bg-slate-800 active:scale-95 transition-all flex items-center justify-center gap-4 disabled:opacity-50 group",children:[h?n.jsx(qi,{className:"animate-spin",size:24}):n.jsx(vi,{size:20,className:"group-hover:rotate-12 transition-transform"}),"GENERAR HOJA DE CÁLCULO"]}),n.jsxs("p",{className:"text-center text-[10px] font-black text-slate-400 uppercase tracking-widest italic flex items-center justify-center gap-2",children:[n.jsx(ho,{size:10})," Auditoría Contable Integrada • SAC Kernel V4"]})]})]})]})]})},uN=[{id:"cream",name:"Crema Imperial",bg:"bg-[#FDFBF7]",text:"text-[#1e293b]",border:"border-amber-200/80 border-dashed",primary:"text-[#854d0e]",accent:"bg-[#fef3c7]",textAccent:"text-[#d97706]"},{id:"blue",name:"Azul Sereno",bg:"bg-[#F0F7FF]",text:"text-[#1e293b]",border:"border-blue-200 border-dashed",primary:"text-[#1e40af]",accent:"bg-[#dbeafe]",textAccent:"text-[#2563eb]"},{id:"teal",name:"Menta Fresca",bg:"bg-[#F4FBF7]",text:"text-[#1e293b]",border:"border-emerald-200 border-dashed",primary:"text-[#065f46]",accent:"bg-[#d1fae5]",textAccent:"text-[#059669]"},{id:"rose",name:"Rosa Durazno",bg:"bg-[#FFF5F5]",text:"text-[#1e293b]",border:"border-rose-200/80 border-dashed",primary:"text-[#9f1239]",accent:"bg-[#ffe4e6]",textAccent:"text-[#e11d48]"}],yM=[{id:"emotivo",title:"DIPLOMA DE RECONOCIMIENTO Y FELICITACIÓN",body:"Por mantener su solvencia administrativa al día. Nos sentimos sumamente orgullosos de contar con copropietarios comprometidos como usted, cuyo cumplimiento ejemplar es el motor fundamental que impulsa la excelencia de nuestros servicios comunes y mantiene en óptimo funcionamiento a toda la comunidad. Su responsabilidad fortalece la convivencia armónica e inspira a toda nuestra vecindad a seguir contribuyendo activamente con el bienestar colectivo."},{id:"cooperacion",title:"HONOR A LA CONSTANCIA Y CORRESPONSABILIDAD",body:"Por su intachable compromiso comunitario y solvencia puntual. Su constancia en el aporte administrativo representa un pilar indiscutible para preservar el valor de nuestro patrimonio y garantizar que cada servicio del condominio funcione de manera idónea. Su valiosa contribución diaria es un testimonio de ciudadanía y amor por su hogar, sembrando el camino de la convivencia que todos merecemos."},{id:"breve",title:"ACREDITACIÓN DE COMPROMISO CIUDADANO",body:"Por demostrar un alto nivel de responsabilidad y estar completamente al día con sus obligaciones. Su puntualidad nos llena de orgullo y nos brinda las herramientas para seguir ofreciendo servicios de calidad en beneficio colectivo. Felicitamos su esfuerzo continuo por ser un propietario ejemplar."}],AFe=({user:e})=>{const{properties:t,residents:r,fees:a}=ht(),[s,i]=k.useState(null),[l,o]=k.useState(new Date().getMonth()),[d,u]=k.useState(new Date().getFullYear()),[f,p]=k.useState("cream"),[h,m]=k.useState("emotivo"),[b,v]=k.useState("CONSEJO DE ADMINISTRACIÓN"),[y,j]=k.useState("COMITÉ DE CONVIVENCIA"),[_,N]=k.useState("C. R. EL TEJAR"),[E,T]=k.useState(""),[B,F]=k.useState(""),[R,U]=k.useState(!1),[D,L]=k.useState(!1),P=k.useRef(null);k.useEffect(()=>{(async()=>{L(!0);try{const le=await we.getSystemSettings();le.board_president&&v(le.board_president),le.board_secretary&&j(le.board_secretary),le.condominium_name&&N(le.condominium_name)}catch{console.warn("No se pudieron cargar nombres reales del presidente y secretario, usando placeholders")}finally{L(!1)}})()},[]),k.useEffect(()=>{const re=yM.find(le=>le.id===h);re&&(T(re.title),F(re.body))},[h]),k.useEffect(()=>{!["admin","programmer","board"].includes(e.role)&&e.propertyId?i(e.propertyId):t.length>0&&s===null&&i(t[0].id)},[e,t]);const G=k.useMemo(()=>t.find(re=>re.id===s)||null,[t,s]),Q=k.useMemo(()=>{if(!G)return"Copropietario";const re=r.find(le=>le.propertyId===G.id&&le.isOwner);return(re==null?void 0:re.fullName)||"Propietario"},[r,G]),H=k.useMemo(()=>uN.find(re=>re.id===f)||uN[0],[f]),X=k.useMemo(()=>{const re={day:"numeric",month:"long",year:"numeric"};return new Date().toLocaleDateString("es-ES",re)},[]),K=async()=>{!P.current||!G||(U(!0),setTimeout(async()=>{try{const le=(await rs(P.current,{scale:2,backgroundColor:null,useCORS:!0,logging:!1})).toDataURL("image/png"),ne=document.createElement("a");ne.download=`Felicitacion_${G.code}_${Te[l]}.png`,ne.href=le,ne.click()}catch(re){console.error("Fallo al capturar imagen:",re),alert("Ocurrió un error al capturar la imagen. Inténtelo nuevamente.")}finally{U(!1)}},400))},ee=()=>{if(!G)return;const re=Math.random().toString(36).substring(2,10).toUpperCase(),le=E.toUpperCase(),ne=B,ae=`<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Felicitaciones Condominio - ${G.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700&family=Playfair+Display:ital,wght@0,700;1,400;1,700&family=Montserrat:wght@400;600;800;900&display=swap');
        
        body {
            font-family: 'Montserrat', sans-serif;
            background-color: #f1f5f9;
            margin: 0;
            padding: 40px 10px;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }

        .outer-wrapper {
            max-width: 850px;
            width: 100%;
            background: #ffffff;
            box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
            border-radius: 24px;
            overflow: hidden;
            padding: 3px;
        }

        .cert-card {
            background-color: ${f==="cream"?"#fcf9f2":f==="blue"?"#f0f6ff":f==="teal"?"#f4fbf7":"#fff5f5"};
            border: 14px double ${f==="cream"?"#d97706":f==="blue"?"#2563eb":f==="teal"?"#059669":"#e11d48"};
            padding: 50px 40px;
            border-radius: 22px;
            position: relative;
            text-align: center;
        }

        /* Ambient subtle pattern background */
        .cert-card::before {
            content: "";
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background-image: radial-gradient(#00000005 1px, transparent 0);
            background-size: 24px 24px;
            pointer-events: none;
            z-index: 1;
        }

        .inner-content {
            position: relative;
            z-index: 2;
        }

        .top-badge {
            display: inline-flex;
            justify-content: center;
            align-items: center;
            background-color: ${f==="cream"?"#fef3c7":f==="blue"?"#dbeafe":f==="teal"?"#d1fae5":"#ffe4e6"};
            color: ${f==="cream"?"#b45309":f==="blue"?"#1d4ed8":f==="teal"?"#047857":"#be123c"};
            font-size: 11px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 4px;
            padding: 10px 24px;
            border-radius: 9999px;
            margin-bottom: 30px;
            border: 1px solid ${f==="cream"?"#f59e0b50":f==="blue"?"#3b82f650":f==="teal"?"#10b98150":"#f43f5e50"};
        }

        .condo-header {
            font-size: 15px;
            font-weight: 950;
            color: #0f172a;
            letter-spacing: 6px;
            text-transform: uppercase;
            margin: 0 0 10px 0;
        }

        .kernel-stamp {
            font-size: 9px;
            font-weight: 800;
            color: #64748b;
            letter-spacing: 2px;
            margin-bottom: 35px;
            text-transform: uppercase;
        }

        .divider-bar {
            width: 100px;
            height: 3px;
            background: ${f==="cream"?"#d97706":f==="blue"?"#2563eb":f==="teal"?"#059669":"#e11d48"};
            margin: 0 auto 35px auto;
            border-radius: 999px;
        }

        .cert-title {
            font-family: 'Cinzel Decorative', Georgia, serif;
            font-size: 26px;
            font-weight: 900;
            color: ${f==="cream"?"#78350f":f==="blue"?"#1e3a8a":f==="teal"?"#064e3b":"#881337"};
            letter-spacing: 1px;
            margin-bottom: 40px;
            text-transform: uppercase;
            line-height: 1.3;
        }

        .present-text {
            font-size: 14px;
            color: #475569;
            font-weight: 600;
            letter-spacing: 3px;
            text-transform: uppercase;
            margin-bottom: 25px;
        }

        .owner-name {
            font-family: 'Playfair Display', Georgia, serif;
            font-size: 38px;
            font-weight: 900;
            color: #0f172a;
            margin: 10px 0;
            text-decoration: underline;
            text-decoration-color: ${f==="cream"?"#f59e0b50":f==="blue"?"#3b82f650":f==="teal"?"#10b98150":"#f43f5e50"};
            text-underline-offset: 8px;
        }

        .property-meta {
            font-size: 15px;
            font-weight: 850;
            color: ${f==="cream"?"#b45309":f==="blue"?"#1d4ed8":f==="teal"?"#047857":"#be123c"};
            letter-spacing: 2px;
            text-transform: uppercase;
            margin: 15px 0 45px 0;
        }

        .cert-body {
            font-size: 16px;
            color: #334155;
            line-height: 1.8;
            max-width: 680px;
            margin: 0 auto 50px auto;
            text-align: justify;
            font-weight: 500;
        }

        .issue-date {
            font-size: 11px;
            font-weight: 800;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 3px;
            margin-bottom: 60px;
        }

        .signatures-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 40px;
            margin-top: 50px;
            padding: 0 20px;
        }

        .sig-box {
            text-align: center;
        }

        .sig-line {
            width: 100%;
            border-top: 2px solid #0f172a;
            padding-top: 12px;
            font-weight: 800;
            font-size: 12px;
            text-transform: uppercase;
            color: #0f172a;
            letter-spacing: 1px;
        }

        .sig-label {
            font-size: 9px;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-top: 4px;
        }

        /* Circular wet stamp overlay */
        .wet-stamp {
            position: absolute;
            bottom: 60px;
            left: 50%;
            transform: translateX(-50%) rotate(-12deg);
            width: 125px;
            height: 125px;
            border: 4px dashed rgba(37, 99, 235, 0.45);
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: rgba(37, 99, 235, 0.85);
            background-color: rgba(255, 255, 255, 0.7);
            box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
            font-family: 'Montserrat', sans-serif;
            pointer-events: none;
        }

        .stamp-txt {
            font-size: 9px;
            font-weight: 900;
            letter-spacing: 1px;
            text-transform: uppercase;
            line-height: 1.2;
            padding: 0 4px;
        }

        .stamp-center {
            font-size: 10px;
            font-weight: 950;
            color: #2563eb;
            border-top: 1px dashed #2563eb60;
            border-bottom: 1px dashed #2563eb60;
            margin: 4px 0;
            padding: 2px 8px;
            letter-spacing: 1.5px;
        }

        .no-print-area {
            text-align: center;
            margin-top: 30px;
        }

        .btn-action {
            background-color: #0f172a;
            color: #ffffff;
            border: none;
            padding: 14px 28px;
            border-radius: 12px;
            cursor: pointer;
            font-size: 11px;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 2px;
            transition: all 0.2s ease;
            box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
        }

        .btn-action:hover {
            background-color: #1e293b;
            transform: translateY(-2px);
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }

        @media (max-width: 600px) {
            .cert-card { padding: 30px 20px; border-width: 8px; }
            .owner-name { font-size: 26px; }
            .signatures-grid { grid-template-columns: 1fr; gap: 35px; }
            .wet-stamp { bottom: 120px; width: 105px; height: 105px; }
            .stamp-txt { font-size: 8px; }
        }

        @media print {
            .no-print-area { display: none !important; }
            body { padding: 0; background: white; }
            .outer-wrapper { box-shadow: none; border-radius: 0; }
            .cert-card { border-radius: 0; }
        }
    </style>
</head>
<body>
    <div class="outer-wrapper">
        <div class="cert-card">
            <div class="wet-stamp">
                <span class="stamp-txt">${_}</span>
                <span class="stamp-center">SOLVENTE</span>
                <span class="stamp-txt">EMISION GANADORA</span>
            </div>
            
            <div class="inner-content">
                <div class="top-badge">Felicidad & Reconocimiento</div>
                <h2 class="condo-header">${_}</h2>
                <div class="kernel-stamp">SAC 2026 • COD. VERIF.: ${re}</div>
                <div class="divider-bar"></div>
                
                <div class="cert-title">${le}</div>
                
                <div class="present-text">Se otorga con orgullo a:</div>
                <div class="owner-name">${Q}</div>
                <div class="property-meta">Propietario de la Unidad: ${G.code}</div>
                
                <div class="cert-body">
                    ${ne.replace("con su solvencia",`con su solvencia para el período de <strong>${Te[l].toUpperCase()} ${d}</strong>`)}
                </div>
                
                <div class="issue-date">Emitido en San Diego, Carabobo el ${X}</div>
                
                <div class="signatures-grid">
                    <div class="sig-box">
                        <div class="sig-line" style="border-top-color: ${f==="cream"?"#78350f":"#0f172a"}">${b}</div>
                        <div class="sig-label">Presidente de la Junta</div>
                    </div>
                    <div class="sig-box">
                        <div class="sig-line" style="border-top-color: ${f==="cream"?"#78350f":"#0f172a"}">${y}</div>
                        <div class="sig-label">Secretaria de la Junta</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="no-print-area">
        <button class="btn-action" onclick="window.print()">Imprimir Diploma de Honor</button>
    </div>
</body>
</html>`,ie=new Blob([ae],{type:"text/html;charset=utf-8"}),me=document.createElement("a");me.href=URL.createObjectURL(ie),me.download=`Felicitacion_${G.code}_${Te[l]}.html`,me.click()},W=()=>{if(!G)return;Math.random().toString(36).substring(2,10).toUpperCase();const re=E.toUpperCase(),le=B,ne=`<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Imprimir Felicitaciones - ${G.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,700&family=Montserrat:wght@400;600;800;900&display=swap');
        
        body {
            font-family: 'Montserrat', sans-serif;
            background-color: #ffffff;
            margin: 0;
            padding: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }

        .outer-wrapper {
            max-width: 800px;
            width: 100%;
            border: 1px solid #ddd;
        }

        .cert-card {
            background-color: ${f==="cream"?"#fcf9f2":f==="blue"?"#f0f6ff":f==="teal"?"#f4fbf7":"#fff5f5"};
            border: 12px double ${f==="cream"?"#d97706":f==="blue"?"#2563eb":f==="teal"?"#059669":"#e11d48"};
            padding: 50px 40px;
            text-align: center;
            position: relative;
        }

        .cert-title {
            font-family: Georgia, serif;
            font-size: 24px;
            font-weight: 900;
            color: ${f==="cream"?"#78350f":f==="blue"?"#1e3a8a":f==="teal"?"#064e3b":"#881337"};
            text-transform: uppercase;
            margin-bottom: 30px;
        }

        .owner-name {
            font-family: 'Playfair Display', Georgia, serif;
            font-size: 34px;
            font-weight: 900;
            color: #0f172a;
            margin: 10px 0;
            text-decoration: underline;
            text-underline-offset: 6px;
        }

        .property-meta {
            font-size: 15px;
            font-weight: 850;
            color: ${f==="cream"?"#b45309":f==="blue"?"#1d4ed8":f==="teal"?"#047857":"#be123c"};
            letter-spacing: 2px;
            text-transform: uppercase;
            margin-bottom: 30px;
        }

        .cert-body {
            font-size: 15px;
            color: #334155;
            line-height: 1.8;
            max-width: 650px;
            margin: 0 auto 40px auto;
            text-align: justify;
        }

        .issue-date {
            font-size: 11px;
            font-weight: 800;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-bottom: 50px;
        }

        .signatures-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 40px;
            margin-top: 40px;
        }

        .sig-line {
            border-top: 2px solid #0f172a;
            padding-top: 10px;
            font-weight: 800;
            font-size: 12px;
            text-transform: uppercase;
        }

        .sig-label {
            font-size: 9px;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .wet-stamp {
            position: absolute;
            bottom: 60px;
            left: 50%;
            transform: translateX(-50%) rotate(-12deg);
            width: 120px;
            height: 120px;
            border: 4px dashed rgba(37, 99, 235, 0.4);
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: rgba(37, 99, 235, 0.8);
            background-color: rgba(255, 255, 255, 0.6);
            font-weight: bold;
        }

        .stamp-txt { font-size: 9px; text-transform: uppercase; }
        .stamp-center { font-size: 10px; border-top: 1px dashed #2563eb; border-bottom: 1px dashed #2563eb; margin: 3px 0; padding: 1px 6px; }

        @media print {
            body { padding: 0; }
            .outer-wrapper { border: none; }
        }
    </style>
</head>
<body>
    <div class="outer-wrapper">
        <div class="cert-card">
            <div class="wet-stamp">
                <span class="stamp-txt">${_}</span>
                <span class="stamp-center">SOLVENTE</span>
                <span class="stamp-txt">PROPIA HUELLA</span>
            </div>
            
            <div class="top-badge" style="font-size: 9px; letter-spacing: 3px; font-weight: 900; color: #64748b; margin-bottom: 20px; text-transform: uppercase;">Acreditación por Cumplimiento</div>
            <div style="font-size: 14px; font-weight: 900; letter-spacing: 4px; uppercase; margin-bottom: 20px; color: #000;">${_}</div>
            
            <div class="cert-title">${re}</div>
            
            <div style="font-size: 12px; font-weight: 700; text-transform: uppercase; color: #64748b;">Nuestra Comunidad Agradece a:</div>
            <div class="owner-name">${Q}</div>
            <div class="property-meta">Unidad Inmobiliaria: ${G.code}</div>
            
            <div class="cert-body">
                ${le}
            </div>
            
            <div class="issue-date">Emitido en la ciudad de San Diego, Carabobo el ${X}</div>
            
            <div class="signatures-grid">
                <div>
                    <div class="sig-line">${b}</div>
                    <div class="sig-label">Presidente de la Junta</div>
                </div>
                <div>
                    <div class="sig-line">${y}</div>
                    <div class="sig-label">Secretaria de la Junta</div>
                </div>
            </div>
        </div>
    </div>
    <script>
        window.onload = function() {
            window.print();
            setTimeout(function() { window.close(); }, 500);
        }
    <\/script>
</body>
</html>`,ae=window.open("","_blank");ae&&(ae.document.write(ne),ae.document.close())},Y=k.useMemo(()=>G?`🌟 *RECONOCIMIENTO DE SOLVENCIA Y AGRADECIMIENTO* 🌟
Condominio *${_}*

Estimado(a) copropietario(a) *${Q}*,
Propietario de la Unidad *${G.code}*

Nos complace felicitarle por encontrarse completamente *SOLVENTE* en el mes de *${Te[l]} ${d}*. 

"${B}"

Su puntualidad contribuye a sostener y mejorar todos los servicios comunes para beneficio de cada hogar en nuestra comunidad. ¡Mil gracias por su compromiso constante!

Atentamente,
✍️ *${b}*
✍️ *${y}*`:"",[G,_,Q,l,d,B,b,y]),M=()=>{const re=encodeURIComponent(Y);window.open(`https://api.whatsapp.com/send?text=${re}`,"_blank")},O=()=>{const re=encodeURIComponent(Y);window.open(`https://t.me/share/url?url=${encodeURIComponent("https://el-tejar-condominio.com")}&text=${re}`,"_blank")},q=()=>{const re=encodeURIComponent(`RECONOCIMIENTO DE SOLVENCIA - ${(G==null?void 0:G.code)||""}`),le=encodeURIComponent(Y);window.location.href=`mailto:?subject=${re}&body=${le}`},z=async()=>{if(navigator.share)try{await navigator.share({title:`Felicitación Solvencia - ${(G==null?void 0:G.code)||""}`,text:Y})}catch{console.warn("Share API falló o fue cancelado, copiando al portapapeles..."),J()}else J()},J=()=>{navigator.clipboard.writeText(Y),alert(`Copied to Clipboard:
El mensaje de reconocimiento ha sido copiado al portapapeles de su dispositivo de forma exitosa.`)};return n.jsxs("div",{className:"space-y-8 pb-16 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"bg-gradient-to-r from-orange-50 to-amber-100 p-10 lg:p-14 rounded-[3.5rem] relative overflow-hidden shadow-xl border border-amber-200",children:[n.jsxs("div",{className:"relative z-10 max-w-2xl space-y-4",children:[n.jsxs("div",{className:"bg-amber-600/10 w-fit px-4 py-1.5 rounded-full border border-amber-600/20 flex items-center gap-2",children:[n.jsx(If,{size:14,className:"text-amber-700"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-[0.2em] text-amber-800",children:"Módulo de Reconocimiento"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black tracking-tighter leading-none text-slate-800",children:["Felicitar al ",n.jsx("span",{className:"text-amber-700 italic",children:"Propietario"})]}),n.jsx("p",{className:"text-slate-600 mt-2 text-md font-medium",children:"Genera de manera automática y ágil un diploma de congratulación, emotivo y distinguido, para motivar y celebrar la solvencia administrativa del propietario en su condominio."})]}),n.jsx(If,{size:180,className:"absolute right-[-20px] bottom-[-20px] text-amber-600/10 pointer-events-none -rotate-12"})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8 items-start",children:[n.jsx("div",{className:"lg:col-span-5 space-y-6",children:n.jsxs("div",{className:"bg-white p-6 sm:p-8 rounded-[3rem] border border-slate-200/60 shadow-xl space-y-6",children:[n.jsxs("div",{className:"flex items-center gap-3 pb-4 border-b border-slate-100",children:[n.jsx(PA,{className:"text-amber-700 animate-[spin_8s_linear_infinite]",size:20}),n.jsx("h3",{className:"font-black text-slate-800 text-sm uppercase tracking-widest",children:"Ajustes del Diploma"})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest flex items-center gap-2",children:[n.jsx(MM,{size:14,className:"text-slate-400"}),"Unidad Inmobiliaria (Propiedad)"]}),n.jsx("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-4 py-3 text-sm font-bold text-slate-800 outline-none focus:ring-2 focus:ring-amber-500",value:s||"",onChange:re=>i(Number(re.target.value)),disabled:!["admin","programmer","board"].includes(e.role),children:t.map(re=>{const le=r.find(ae=>ae.propertyId===re.id&&ae.isOwner),ne=(le==null?void 0:le.fullName)||"S/D (Propietario)";return n.jsxs("option",{value:re.id,children:[re.code," - ",ne," (",re.type,")"]},re.id)})})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest block",children:"Mes Solvente"}),n.jsx("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-4 py-3 text-sm font-bold text-slate-800 outline-none focus:ring-2 focus:ring-amber-500",value:l,onChange:re=>o(Number(re.target.value)),children:Te.map((re,le)=>n.jsx("option",{value:le,children:re},le))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest block",children:"Año"}),n.jsx("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-4 py-3 text-sm font-bold text-slate-800 outline-none focus:ring-2 focus:ring-amber-500",value:d,onChange:re=>u(Number(re.target.value)),children:[2023,2024,2025,2026,2027,2028,2029,2030].map(re=>n.jsx("option",{value:re,children:re},re))})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest block",children:"Paleta de Colores Pasteles"}),n.jsx("div",{className:"grid grid-cols-2 gap-3",children:uN.map(re=>n.jsxs("button",{onClick:()=>p(re.id),className:`flex items-center gap-2 p-3 rounded-2xl border-2 transition-all ${f===re.id?"border-indigo-600 bg-indigo-50/20":"border-slate-200/70 hover:border-slate-300 bg-white"}`,children:[n.jsx("span",{className:`w-4 h-4 rounded-full ${re.bg} border border-[#00000020]`}),n.jsx("span",{className:"text-xs font-black text-slate-700",children:re.name})]},re.id))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest block",children:"Tono del Mensaje"}),n.jsx("div",{className:"flex gap-2",children:yM.map(re=>n.jsx("button",{onClick:()=>m(re.id),className:`flex-1 text-center py-2 px-3 rounded-xl border text-[10px] font-black uppercase tracking-wider transition-all ${h===re.id?"bg-amber-100 text-amber-800 border-amber-300":"bg-slate-50 text-slate-500 border-slate-200 hover:bg-slate-100"}`,children:re.id==="emotivo"?"Emotivo":re.id==="cooperacion"?"Costancia":"Brevísimo"},re.id))})]}),n.jsxs("div",{className:"space-y-3 pt-2",children:[n.jsxs("div",{children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest flex items-center gap-1.5 mb-1",children:[n.jsx(Hm,{size:11})," Título Principal Editable"]}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-xl px-4 py-2 text-xs font-bold text-slate-800 outline-none focus:ring-1 focus:ring-amber-500",value:E,onChange:re=>T(re.target.value)})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest flex items-center gap-1.5 mb-1",children:[n.jsx(Hm,{size:11})," Mensaje Emotivo Ajustable"]}),n.jsx("textarea",{rows:4,className:"w-full bg-slate-50 border border-slate-200 rounded-xl px-4 py-2 text-xs font-bold text-slate-800 outline-none focus:ring-1 focus:ring-amber-500 resize-none leading-relaxed",value:B,onChange:re=>F(re.target.value)})]})]}),n.jsxs("div",{className:"space-y-3 pt-2 bg-slate-50/50 p-4 rounded-2xl border border-slate-100",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-slate-400 tracking-widest block mb-1",children:"Firma Presidente Junta"}),n.jsx("input",{type:"text",className:"w-full bg-white border border-slate-200 rounded-xl px-4 py-2 text-xs font-bold text-slate-800 outline-none",value:b,onChange:re=>v(re.target.value)})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-slate-400 tracking-widest block mb-1",children:"Firma Secretario(a) Junta"}),n.jsx("input",{type:"text",className:"w-full bg-white border border-slate-200 rounded-xl px-4 py-2 text-xs font-bold text-slate-800 outline-none",value:y,onChange:re=>j(re.target.value)})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-slate-400 tracking-widest block mb-1",children:"Nombre del Conjunto"}),n.jsx("input",{type:"text",className:"w-full bg-white border border-slate-200 rounded-xl px-4 py-2 text-xs font-bold text-slate-800 outline-none",value:_,onChange:re=>N(re.target.value)})]})]})]})}),n.jsxs("div",{className:"lg:col-span-7 flex flex-col space-y-6",children:[n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200/60 shadow-xl",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-4",children:"Acciones y Canales de Envíos"}),n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[n.jsxs("button",{onClick:W,className:"flex items-center justify-center gap-2 py-3 px-4 bg-slate-900 border border-slate-800 text-white rounded-xl font-black text-[10px] uppercase tracking-wider hover:bg-slate-800 transition",children:[n.jsx(wt,{size:14}),"Imprimir"]}),n.jsxs("button",{onClick:ee,className:"flex items-center justify-center gap-2 py-3 px-4 bg-blue-600 text-white rounded-xl font-black text-[10px] uppercase tracking-wider hover:bg-blue-700 transition",children:[n.jsx(wr,{size:14}),"HTML"]}),n.jsxs("button",{onClick:K,disabled:R,className:"flex items-center justify-center gap-2 py-3 px-4 bg-emerald-600 text-white rounded-xl font-black text-[10px] uppercase tracking-wider hover:bg-emerald-700 transition disabled:opacity-50",children:[R?n.jsx(ct,{className:"animate-spin",size:14}):n.jsx(Gs,{size:14}),"Capturar"]}),n.jsxs("button",{onClick:z,className:"flex items-center justify-center gap-2 py-3 px-4 bg-indigo-600 text-white rounded-xl font-black text-[10px] uppercase tracking-wider hover:bg-indigo-700 transition",children:[n.jsx(Aa,{size:14}),"Compartir"]})]}),n.jsx("div",{className:"w-full h-px bg-slate-100 my-4"}),n.jsxs("div",{className:"flex flex-wrap gap-2 justify-center",children:[n.jsxs("button",{onClick:M,className:"flex items-center gap-1.5 py-2 px-3 bg-emerald-50 text-emerald-700 hover:bg-emerald-100/80 rounded-xl text-[10px] font-black uppercase tracking-wider transition",children:[n.jsx(Ha,{size:12})," WhatsApp"]}),n.jsxs("button",{onClick:O,className:"flex items-center gap-1.5 py-2 px-3 bg-sky-50 text-sky-700 hover:bg-sky-100/80 rounded-xl text-[10px] font-black uppercase tracking-wider transition",children:[n.jsx(zs,{size:12})," Telegram"]}),n.jsxs("button",{onClick:q,className:"flex items-center gap-1.5 py-2 px-3 bg-indigo-50 text-indigo-700 hover:bg-indigo-100/80 rounded-xl text-[10px] font-black uppercase tracking-wider transition",children:[n.jsx(Br,{size:12})," Correo"]})]})]}),G?n.jsx("div",{className:"w-full bg-white rounded-[3rem] p-4 sm:p-6 border border-slate-200/50 shadow-2xl relative overflow-hidden",children:n.jsxs("div",{id:"congratulation-diploma-card",ref:P,className:`p-8 sm:p-14 ${H.bg} border-8 sm:border-[16px] double border-solid rounded-[2rem] relative text-center`,style:{borderStyle:"double",borderColor:f==="cream"?"#b45309":f==="blue"?"#3b82f6":f==="teal"?"#10b981":"#f43f5e"},children:[n.jsxs("div",{className:"absolute bottom-28 left-1/2 -translate-x-1/2 md:left-20 md:translate-x-0 w-[110px] h-[110px] border-4 border-dashed border-blue-500/40 text-blue-500/70 rounded-full flex flex-col items-center justify-center text-center rotate-[-12deg] bg-white/50 backdrop-blur-sm pointer-events-none z-[10]",style:{transform:"rotate(-12deg)"},children:[n.jsx("span",{className:"text-[7px] font-black tracking-widest",children:_.toUpperCase()}),n.jsx("div",{className:"my-1 border-t border-b border-dashed border-blue-400 text-[10px] font-black text-blue-600/80 tracking-tight py-0.5 px-2",children:"SOLVENTE"}),n.jsx("span",{className:"text-[7px] font-bold",children:"CONDOMINIO AL DÍA"})]}),n.jsxs("div",{className:"relative z-[2] space-y-6",children:[n.jsx("div",{className:"flex justify-center",children:n.jsx("div",{className:`p-4 rounded-full ${H.accent} border border-amber-500/20 shadow-md`,children:n.jsx(If,{size:32,className:H.primary})})}),n.jsxs("div",{children:[n.jsx("h2",{className:"font-extrabold text-base tracking-[0.25em] text-slate-800 uppercase",children:_}),n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mt-1",children:"SISTEMA INTEGRAL DE ADMINISTRACIÓN DE CONDOMINIOS (SAC 2026)"})]}),n.jsx("div",{className:"w-24 h-0.5 bg-slate-300/60 mx-auto"}),n.jsx("h3",{className:"font-serif font-black text-2xl tracking-wide sm:text-3xl text-slate-800 leading-tight",children:E.toUpperCase()}),n.jsxs("div",{className:"space-y-4",children:[n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-[0.3em]",children:"Se otorga con aprecio y felicitaciones al ciudadano(a):"}),n.jsx("h4",{className:"font-serif font-black text-3xl text-slate-900 border-b-2 border-dashed border-slate-300/80 w-fit mx-auto pb-1 italic",children:Q.toUpperCase()}),n.jsxs("p",{className:`text-xs font-black uppercase tracking-wider ${H.textAccent}`,children:["Como Propietario ejemplar de la distinguida ",G.type," ",n.jsx("span",{className:"underline",children:G.code})]})]}),n.jsx("p",{className:"text-slate-600 text-sm leading-relaxed text-justify max-w-[580px] mx-auto font-medium indent-4",children:B.replace("con su solvencia",`con su solvencia para el período de ${Te[l].toUpperCase()} de ${d}`)}),n.jsxs("div",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest pt-4",children:["San Diego, Carabobo — Emitido con orgullo el ",X]}),n.jsxs("div",{className:"grid grid-cols-2 gap-8 pt-10 border-t border-slate-200/50",children:[n.jsx("div",{className:"flex flex-col items-center",children:n.jsxs("div",{className:"w-full max-w-[200px] border-t-2 border-slate-900/80 pt-2",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-800 uppercase tracking-tight line-clamp-1",children:b.toUpperCase()}),n.jsx("p",{className:"text-[8px] font-bold text-slate-400 uppercase tracking-widest mt-0.5",children:"Presidente de la Junta"})]})}),n.jsx("div",{className:"flex flex-col items-center",children:n.jsxs("div",{className:"w-full max-w-[200px] border-t-2 border-slate-900/80 pt-2",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-800 uppercase tracking-tight line-clamp-1",children:y.toUpperCase()}),n.jsx("p",{className:"text-[8px] font-bold text-slate-400 uppercase tracking-widest mt-0.5",children:"Secretario(a) de la Junta"})]})})]})]})]})}):n.jsxs("div",{className:"bg-white p-20 rounded-[3rem] text-center border-2 border-dashed border-slate-200",children:[n.jsx(ct,{className:"animate-spin mx-auto mb-4 text-slate-300",size:40}),n.jsx("p",{className:"text-slate-400 font-black uppercase tracking-widest text-[10px]",children:"Cargando copropiedades..."})]})]})]})]})},AN=[{id:"cream",name:"Alerta Crema",bg:"bg-[#FDFBF7]",text:"text-slate-800",primary:"text-amber-800",accent:"bg-amber-50 text-amber-800",border:"border-amber-100",stampColor:"rgba(217, 119, 6, 0.7)",banner:"bg-amber-500/10 border-amber-500/20 text-amber-800"},{id:"coral",name:"Alerta Coral",bg:"bg-[#FFF8F8]",text:"text-slate-800",primary:"text-rose-800",accent:"bg-rose-50 text-rose-800",border:"border-rose-100",stampColor:"rgba(190, 18, 60, 0.7)",banner:"bg-rose-500/10 border-rose-500/20 text-rose-800"},{id:"slate",name:"Gris Administrativo",bg:"bg-[#F8FAFC]",text:"text-slate-800",primary:"text-indigo-950",accent:"bg-indigo-50 text-indigo-900",border:"border-indigo-100/50",stampColor:"rgba(55, 48, 163, 0.7)",banner:"bg-indigo-500/10 border-indigo-500/20 text-indigo-900"},{id:"mint",name:"Menta Conciliadora",bg:"bg-[#F3FAF6]",text:"text-slate-800",primary:"text-emerald-800",accent:"bg-emerald-50 text-emerald-800",border:"border-emerald-100",stampColor:"rgba(4, 120, 87, 0.7)",banner:"bg-emerald-500/10 border-emerald-500/20 text-emerald-800"}],wM=[{id:"consciencia",title:"NOTIFICACIÓN DE CONTRALORÍA Y COMPROMISO COOPERATIVO",body:"Por medio de la presente, nos dirigimos a usted con la cordial estima de siempre para hacer un respetuoso recordatorio relativo al saldo deudor pendiente de su unidad. Nuestra solvencia administrativa no es un concepto aislado: representa el motor esencial y único soporte financiero con el cual su condominio garantiza la operatividad diaria de cada servicio de áreas comunes. Su valioso compromiso y aporte puntual es lo que nos capacita para sostener la seguridad, conservación, iluminación, salubridad y armonía residencial. Le animamos formalmente a regularizar sus cuotas en beneficio colectivo y de su propio patrimonio."},{id:"preservacion",title:"COMUNICADO DE CORRESPONSABILIDAD Y PAGO DE CUOTAS",body:"El adecuado funcionamiento de nuestra urbanidad se sostiene sobre el principio de corresponsabilidad. La oportuna contribución económica de cada copropietario es vital para saldar deudas con proveedores de servicios críticos, personal operacional y de mantenimiento preventivo de nuestros espacios compartidos. Evitar la morosidad individual asegura la viabilidad financiera y evita el deterioro irreparable de nuestros servicios comunes. Por ello, le exhortamos fraternalmente a ponerse al día con sus compromisos vigentes, reafirmando su espíritu de buen ciudadano y promoviendo el bienestar de su honorable familia."},{id:"invitacion",title:"INVITACIÓN ADMINISTRATIVA PARA REGULARIZACIÓN DE CUENTA",body:"Extendemos un afectuoso pero urgente recordatorio sobre el estado adeudado que registra su propiedad. Las cuentas claras y la corresponsabilidad financiera son los pilares fundamentales para proteger y valorizar su patrimonio inmobiliario. El buen funcionamiento del condominio es tarea de todos los vecinos. Le invitamos de la manera más atenta a canalizar su respectiva regularización administrativa o bien a comunicarse con la junta para coordinar alternativas de pago concertadas que se ajusten a su solvencia. Su contribución es la garantía para seguir edificando el confort urbano que todos merecemos."}],fFe=({user:e})=>{const{properties:t,residents:r}=ht(),[a,s]=k.useState(new Date().getMonth()+1),[i,l]=k.useState(new Date().getFullYear()),[o,d]=k.useState(!1),[u,f]=k.useState([]),[p,h]=k.useState(!1),[m,b]=k.useState(null),[v,y]=k.useState("cream"),[j,_]=k.useState("consciencia"),[N,E]=k.useState("CONSEJO DE ADMINISTRACIÓN"),[T,B]=k.useState("COMITÉ DE CONVIVENCIA"),[F,R]=k.useState("C. R. EL TEJAR"),[U,D]=k.useState(""),[L,P]=k.useState(""),[G,Q]=k.useState(!1),[H,X]=k.useState(!1),K=k.useRef(null);k.useEffect(()=>{(async()=>{X(!0);try{const he=await we.getSystemSettings();he.board_president&&E(he.board_president),he.board_secretary&&B(he.board_secretary),he.condominium_name&&R(he.condominium_name)}catch{console.warn("No se pudieron cargar nombres reales del presidente y secretario, usando placeholders")}finally{X(!1)}})()},[]);const ee=async()=>{h(!0);try{const pe=await we.getDebtList(a,i),he=Array.isArray(pe)?pe:[];if(f(he),he.length>0&&!o){const ye=he[0],fe=t.find(Ue=>Ue.code===ye.propertyCode||Ue.number===ye.propertyNumber);b(fe?fe.id:null)}}catch(pe){console.error("Error al cargar deudores:",pe)}finally{h(!1)}};k.useEffect(()=>{ee()},[a,i,t]),k.useEffect(()=>{const pe=wM.find(he=>he.id===j);pe&&(D(pe.title),P(pe.body))},[j]);const W=k.useMemo(()=>o?t.find(pe=>pe.id===m)||null:m&&t.find(pe=>pe.id===m)||null,[t,m,o]),Y=k.useMemo(()=>{if(!W)return{currentDebt:0,agreementDebt:0,totalDebt:0};const pe=u.find(he=>he.propertyCode===W.code||he.propertyNumber===W.number);return pe?{currentDebt:pe.currentDebt||0,agreementDebt:pe.agreementDebt||0,totalDebt:pe.totalDebt||0}:{currentDebt:0,agreementDebt:0,totalDebt:0}},[u,W]),M=k.useMemo(()=>o?t.map(pe=>{const he=r.find(fe=>fe.propertyId===pe.id&&fe.isOwner),ye=(he==null?void 0:he.fullName)||"Propietario";return{id:pe.id,code:pe.code,label:`${pe.code} - ${ye} (${pe.type})`}}):u.map(pe=>{const he=t.find(ye=>ye.code===pe.propertyCode||ye.number===pe.propertyNumber);return{id:he?he.id:0,code:pe.propertyCode,label:`${pe.propertyNumber} - ${pe.ownerName} (Parat: $${pe.totalDebt.toFixed(2)})`}}).filter(pe=>pe.id!==0),[t,r,u,o]);k.useEffect(()=>{M.length>0?b(M[0].id):b(null)},[o,M]);const O=k.useMemo(()=>{if(!W)return"Copropietario";const pe=r.find(ye=>ye.propertyId===W.id&&ye.isOwner);if(pe)return pe.fullName;const he=u.find(ye=>ye.propertyCode===W.code||ye.propertyNumber===W.number);return(he==null?void 0:he.ownerName)||"Propietario de la Unidad"},[r,W,u]),q=k.useMemo(()=>AN.find(pe=>pe.id===v)||AN[0],[v]),z=k.useMemo(()=>{const pe={day:"numeric",month:"long",year:"numeric"};return new Date().toLocaleDateString("es-ES",pe)},[]),J=async()=>{!K.current||!W||(Q(!0),setTimeout(async()=>{try{const he=(await rs(K.current,{scale:2,backgroundColor:null,useCORS:!0,logging:!1})).toDataURL("image/png"),ye=document.createElement("a");ye.download=`Recordatorio_Deuda_${W.code}_${Te[a-1]||"Mes"}.png`,ye.href=he,ye.click()}catch(pe){console.error("Fallo al capturar imagen:",pe),alert("Ocurrió un error al capturar la imagen. Inténtelo nuevamente.")}finally{Q(!1)}},450))},re=()=>{if(!W)return;const pe=Math.random().toString(36).substring(2,10).toUpperCase(),he=U.toUpperCase(),ye=L,fe=(Te[a-1]||"").toUpperCase(),Ue=`<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Soporte de Compromiso de Pago - ${W.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');
        
        body {
            font-family: 'Montserrat', sans-serif;
            background-color: #f1f5f9;
            margin: 0;
            padding: 40px 10px;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }

        .outer-wrapper {
            max-width: 850px;
            width: 100%;
            background: #ffffff;
            box-shadow: 0 25px 50px -12px rgba(0,0,0,0.12);
            border-radius: 28px;
            overflow: hidden;
            padding: 30px;
        }

        .cert-card {
            background-color: ${v==="cream"?"#fcf9f2":v==="coral"?"#fff8f8":v==="slate"?"#f8fafc":"#f3faf6"};
            border-top: 10px solid ${v==="cream"?"#d97706":v==="coral"?"#e11d48":v==="slate"?"#1e1b4b":"#059669"};
            padding: 40px;
            position: relative;
        }

        .inner-content {
            position: relative;
            z-index: 2;
        }

        .top-badge {
            display: inline-flex;
            justify-content: center;
            align-items: center;
            background-color: ${v==="cream"?"#fef3c7":v==="coral"?"#ffe4e6":v==="slate"?"#e0e7ff":"#d1fae5"};
            color: ${v==="cream"?"#b45309":v==="coral"?"#be123c":v==="slate"?"#1e1b4b":"#047857"};
            font-size: 11px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 4px;
            padding: 8px 18px;
            border-radius: 9999px;
            margin-bottom: 25px;
        }

        .condo-header {
            font-size: 15px;
            font-weight: 900;
            color: #0f172a;
            letter-spacing: 6px;
            text-transform: uppercase;
            margin: 0 0 10px 0;
        }

        .kernel-stamp {
            font-size: 9px;
            font-weight: 800;
            color: #64748b;
            letter-spacing: 2px;
            margin-bottom: 25px;
            text-transform: uppercase;
        }

        .divider-bar {
            width: 100px;
            height: 3px;
            background: ${v==="cream"?"#d97706":v==="coral"?"#e11d48":v==="slate"?"#4f46e5":"#059669"};
            margin: 0 auto 30px auto;
            border-radius: 99px;
        }

        .cert-title {
            font-size: 22px;
            font-weight: 900;
            color: ${v==="cream"?"#78350f":v==="coral"?"#881337":v==="slate"?"#1e1b4b":"#064e3b"};
            letter-spacing: 0.5px;
            margin-bottom: 35px;
            text-transform: uppercase;
            line-height: 1.4;
        }

        .owner-section {
            background-color: rgba(255, 255, 255, 0.4);
            border: 1px solid rgba(0, 0, 0, 0.04);
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 35px;
            text-align: left;
        }

        .owner-title {
            font-size: 11px;
            color: #64748b;
            text-transform: uppercase;
            font-weight: 850;
            letter-spacing: 2px;
            margin-bottom: 6px;
        }

        .owner-name {
            font-size: 22px;
            font-weight: 900;
            color: #0c1222;
            margin-bottom: 4px;
        }

        .owner-property {
            font-size: 13px;
            font-weight: 700;
            color: ${v==="cream"?"#b45309":v==="coral"?"#be123c":v==="slate"?"#4f46e5":"#047857"};
            text-transform: uppercase;
            letter-spacing: 1.5px;
        }

        .cert-body {
            font-size: 15px;
            color: #334155;
            line-height: 1.8;
            max-width: 680px;
            margin: 0 auto 40px auto;
            text-align: justify;
            font-weight: 500;
        }

        .debt-breakdown {
            background-color: rgba(0, 0, 0, 0.03);
            border-radius: 16px;
            padding: 24px;
            margin: 30px 0;
            text-align: left;
        }

        .breakdown-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            margin-top: 15px;
        }

        .breakdown-item {
            display: flex;
            flex-direction: column;
        }

        .breakdown-label {
            font-size: 10px;
            font-weight: 800;
            text-transform: uppercase;
            color: #64748b;
            letter-spacing: 1px;
        }

        .breakdown-value {
            font-size: 20px;
            font-weight: 900;
            color: #0f172a;
        }

        .total-value-highlight {
            color: #dc2626;
            font-size: 24px;
        }

        .issue-date {
            font-size: 11px;
            font-weight: 800;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 3px;
            margin-bottom: 50px;
        }

        .signatures-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 40px;
            margin-top: 40px;
        }

        .sig-box {
            text-align: center;
        }

        .sig-line {
            width: 100%;
            border-top: 2px solid #0f172a;
            padding-top: 12px;
            font-weight: 800;
            font-size: 12px;
            text-transform: uppercase;
            color: #0f172a;
            letter-spacing: 1px;
        }

        .sig-label {
            font-size: 9px;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-top: 4px;
        }

        .wet-stamp {
            position: absolute;
            bottom: 40px;
            left: 50px;
            transform: rotate(-10deg);
            width: 130px;
            height: 130px;
            border: 4px dashed rgba(220, 38, 38, 0.45);
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: rgba(220, 38, 38, 0.85);
            background-color: rgba(255, 255, 255, 0.6);
            backdrop-filter: blur(1px);
            pointer-events: none;
        }

        .stamp-txt { font-size: 8px; font-weight: 950; letter-spacing: 1px; text-transform: uppercase; }
        .stamp-center { font-size: 11px; font-weight: 950; color: #dc2626; border-top: 1px dashed #dc2626; border-bottom: 1px dashed #dc2626; margin: 4px 0; padding: 2px 6px; letter-spacing: 1px; }

        .no-print-area {
            text-align: center;
            margin-top: 30px;
        }

        .btn-action {
            background-color: #0f172a;
            color: #ffffff;
            border: none;
            padding: 14px 28px;
            border-radius: 12px;
            cursor: pointer;
            font-size: 11px;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 2px;
            transition: all 0.2s ease;
        }

        .btn-action:hover {
            background-color: #1e293b;
            transform: translateY(-2px);
        }

        @media (max-width: 600px) {
            .signatures-grid { grid-template-columns: 1fr; gap: 35px; }
            .wet-stamp { position: static; margin: 0 auto 30px auto; }
        }

        @media print {
            .no-print-area { display: none !important; }
            body { padding: 0; background: white; }
            .outer-wrapper { box-shadow: none; border-radius: 0; padding: 0; }
            .cert-card { border-radius: 0; border-top-width: 6px; }
        }
    </style>
</head>
<body>
    <div class="outer-wrapper">
        <div class="cert-card">
            <div class="wet-stamp">
                <span class="stamp-txt">${F}</span>
                <span class="stamp-center">RECONCILIACIÓN</span>
                <span class="stamp-txt">REQUERIDO - MORA</span>
            </div>
            
            <div class="inner-content">
                <div class="top-badge">Recordatorio Administrativo</div>
                <h2 class="condo-header">${F}</h2>
                <div class="kernel-stamp">SAC 2026 • COD. SEGUIMIENTO: ${pe}</div>
                <div class="divider-bar"></div>
                
                <div class="cert-title">${he}</div>
                
                <div class="owner-section">
                    <div class="owner-title font-bold">Unidad Inmobiliaria y Responsable:</div>
                    <div class="owner-name">${O}</div>
                    <div class="owner-property">Código de Inmueble: ${W.code} (N° ${W.number})</div>
                </div>
                
                <div class="cert-body">
                    ${ye.replace("Regularizar sus cuotas",`Regularizar su saldo para el período de deudor correspondiente al corte de <strong>${fe} ${i}</strong>`)}
                </div>

                <div class="debt-breakdown">
                    <div class="owner-title" style="margin-bottom: 12px; font-weight: 900; color: #1e293b;">Resumen Consolidado de Cuenta:</div>
                    <div style="width: 100%; h-px; background-color: rgba(0,0,0,0.06); margin-bottom: 15px;"></div>
                    <div class="breakdown-grid">
                        <div class="breakdown-item">
                            <span class="breakdown-label">Cuota del Mes de Corte</span>
                            <span class="breakdown-value">$${Y.currentDebt.toLocaleString("en-US",{minimumFractionDigits:2})}</span>
                        </div>
                        <div class="breakdown-item">
                            <span class="breakdown-label">Convenio / Historial Anterior</span>
                            <span class="breakdown-value" style="color: #4f46e5;">$${Y.agreementDebt.toLocaleString("en-US",{minimumFractionDigits:2})}</span>
                        </div>
                    </div>
                    <div class="breakdown-grid" style="margin-top: 15px; border-t: 1px solid rgba(0,0,0,0.06); padding-top: 15px;">
                        <div class="breakdown-item" style="grid-column: span 2;">
                            <span class="breakdown-label" style="color: #dc2626; font-weight: 900;">Monto de Compromiso Acumulado</span>
                            <span class="breakdown-value total-value-highlight">$${Y.totalDebt.toLocaleString("en-US",{minimumFractionDigits:2})}</span>
                        </div>
                    </div>
                </div>
                
                <div class="issue-date">Emitido en San Diego, Carabobo el ${z}</div>
                
                <div class="signatures-grid">
                    <div class="sig-box">
                        <div class="sig-line">${N}</div>
                        <div class="sig-label">Presidente de la Junta</div>
                    </div>
                    <div class="sig-box">
                        <div class="sig-line">${T}</div>
                        <div class="sig-label">Secretaria de la Junta</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="no-print-area">
        <button class="btn-action" onclick="window.print()">Imprimir Recordatorio</button>
    </div>
</body>
</html>`,qe=new Blob([Ue],{type:"text/html;charset=utf-8"}),at=document.createElement("a");at.href=URL.createObjectURL(qe),at.download=`Recordatorio_Deuda_${W.code}_${Te[a-1]||"Mes"}.html`,at.click()},le=()=>{if(!W)return;const pe=Math.random().toString(36).substring(2,10).toUpperCase(),he=U.toUpperCase(),ye=L,fe=(Te[a-1]||"").toUpperCase(),Ue=`<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Imprimir Recordatorio de Compromiso - ${W.code}</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');
        
        body {
            font-family: 'Montserrat', sans-serif;
            background-color: #ffffff;
            margin: 0;
            padding: 20px;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }

        .cert-card {
            max-width: 800px;
            width: 100%;
            background-color: #ffffff;
            border-top: 12px solid ${v==="cream"?"#d97706":v==="coral"?"#e11d48":v==="slate"?"#1e1b4b":"#059669"};
            padding: 40px;
            text-align: center;
            position: relative;
        }

        .cert-title {
            font-size: 20px;
            font-weight: 900;
            color: #0c1222;
            text-transform: uppercase;
            margin-bottom: 30px;
        }

        .owner-section {
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 18px;
            margin-bottom: 30px;
            text-align: left;
        }

        .owner-name {
            font-size: 20px;
            font-weight: 900;
            color: #0f172a;
        }

        .owner-property {
            font-size: 12px;
            font-weight: 700;
            text-transform: uppercase;
            color: #64748b;
        }

        .cert-body {
            font-size: 14.5px;
            color: #334155;
            line-height: 1.8;
            max-width: 650px;
            margin: 0 auto 30px auto;
            text-align: justify;
        }

        .debt-breakdown {
            background-color: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 20px;
            margin: 25px 0;
            text-align: left;
        }

        .breakdown-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
        }

        .breakdown-label {
            font-size: 9px;
            font-weight: 800;
            text-transform: uppercase;
            color: #64748b;
        }

        .breakdown-value {
            font-size: 18px;
            font-weight: 900;
            color: #0f172a;
        }

        .issue-date {
            font-size: 11px;
            font-weight: 850;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-bottom: 40px;
        }

        .signatures-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 40px;
            margin-top: 40px;
        }

        .sig-line {
            border-top: 2px solid #0f172a;
            padding-top: 10px;
            font-weight: 800;
            font-size: 11px;
            text-transform: uppercase;
        }

        .sig-label {
            font-size: 9px;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
        }

        .wet-stamp {
            position: absolute;
            bottom: 40px;
            left: 40px;
            transform: rotate(-10deg);
            width: 120px;
            height: 120px;
            border: 4px dashed rgba(220, 38, 38, 0.4);
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: rgba(220, 38, 38, 0.8);
            background-color: #ffffff;
            font-weight: bold;
        }

        .stamp-txt { font-size: 8px; text-transform: uppercase; }
        .stamp-center { font-size: 10px; color: #dc2626; border-top: 1px dashed #dc2626; border-bottom: 1px dashed #dc2626; margin: 3px 0; padding: 1px 6px; }

        @media print {
            body { padding: 0; }
            .cert-card { border: none; }
        }
    </style>
</head>
<body>
    <div class="cert-card">
        <div class="wet-stamp">
            <span class="stamp-txt">${F}</span>
            <span class="stamp-center">COMPROMISO</span>
            <span class="stamp-txt">CARTERA ACTIVA</span>
        </div>
        
        <div style="font-size: 12px; font-weight: 900; letter-spacing: 4px; uppercase; margin-bottom: 12px; color: #000;">${F}</div>
        <div style="font-size: 9px; font-weight: 800; color: #64748b; letter-spacing: 2px; margin-bottom: 25px; text-transform: uppercase;">Notificación Preventiva • Ref: ${pe}</div>
        
        <div class="cert-title">${he}</div>
        
        <div class="owner-section">
            <div class="owner-name">${O}</div>
            <div class="owner-property">Unidad: ${W.code} (N° ${W.number})</div>
        </div>
        
        <div class="cert-body">
            ${ye.replace("Regularizar sus cuotas",`Regularizar su estado de deudor correspondiente al corte de <strong>${fe} ${i}</strong>`)}
        </div>

        <div class="debt-breakdown">
            <div class="breakdown-grid">
                <div>
                    <span class="breakdown-label">Cuota Pendiente del Mes</span>
                    <div class="breakdown-value">$${Y.currentDebt.toFixed(2)}</div>
                </div>
                <div>
                    <span class="breakdown-label">Convenio / Mora Histórica</span>
                    <div class="breakdown-value" style="color: #4f46e5;">$${Y.agreementDebt.toFixed(2)}</div>
                </div>
            </div>
            <div class="breakdown-grid" style="margin-top: 15px; border-top: 1px solid #e2e8f0; padding-top: 12px;">
                <div style="grid-column: span 2;">
                    <span class="breakdown-label" style="color: #dc2626;">Total General Adeudado</span>
                    <div class="breakdown-value" style="color: #dc2626; font-size: 22px;">$${Y.totalDebt.toFixed(2)}</div>
                </div>
            </div>
        </div>
        
        <div class="issue-date">Emitido en San Diego, Carabobo el ${z}</div>
        
        <div class="signatures-grid">
            <div>
                <div class="sig-line">${N}</div>
                <div class="sig-label">Presidente de la Junta</div>
            </div>
            <div>
                <div class="sig-line">${T}</div>
                <div class="sig-label">Secretaria de la Junta</div>
            </div>
        </div>
    </div>
    <script>
        window.onload = function() {
            window.print();
            setTimeout(function() { window.close(); }, 500);
        }
    <\/script>
</body>
</html>`,qe=window.open("","_blank");qe&&(qe.document.write(Ue),qe.document.close())},ne=k.useMemo(()=>{if(!W)return"";const pe=Te[a-1]||"Mes";return`⚠️ *RECORDATORIO DE COMPROMISO ADMINISTRATIVO* ⚠️
Condominio *${F}*

Estimado(a) co-propietario(a) *${O}*
Unidad de Vivienda: *${W.code}*

Nuestra administración informa sobre el compromiso de regularización de sus cuotas condominales correspondientes al corte de *${pe} ${i}*.

"${L}"

*Detalle Técnico de Cuenta:*
• Cuota del Mes Pendiente: *$${Y.currentDebt.toFixed(2)}*
• Convenio / Saldo Histórico anterior: *$${Y.agreementDebt.toFixed(2)}*
• *Total General Consolidado: $${Y.totalDebt.toFixed(2)}*

Su contribución mensual es el único sustento que garantiza que sigamos contando con todos los servicios activos (mantenimiento, agua, aseo, luz de pasillos, vigilancia y salubridad). ¡Invitamos a ponerse al día!

Atentamente,
✍️ *${N}*
✍️ *${T}*`},[W,F,O,a,i,L,N,T,Y]),ae=()=>{const pe=encodeURIComponent(ne);window.open(`https://api.whatsapp.com/send?text=${pe}`,"_blank")},ie=()=>{const pe=encodeURIComponent(ne),he=encodeURIComponent("https://tejar-condominio.com");window.open(`https://t.me/share/url?url=${he}&text=${pe}`,"_blank")},me=()=>{const pe=encodeURIComponent(`RECORDATORIO DE COMPROMISO DE PAGO CONDOMINIO - ${(W==null?void 0:W.code)||""}`),he=encodeURIComponent(ne);window.location.href=`mailto:?subject=${pe}&body=${he}`},Z=async()=>{if(navigator.share)try{await navigator.share({title:`Compromiso de Pago - ${(W==null?void 0:W.code)||""}`,text:ne})}catch{Me()}else Me()},Me=()=>{navigator.clipboard.writeText(ne),alert(`Copiado al Portapapeles:
El estado de cuenta y mensaje recordatorio han sido copiados de forma exitosa.`)};return n.jsxs("div",{className:"space-y-8 pb-16 animate-in fade-in duration-500",children:[n.jsxs("div",{className:"bg-gradient-to-r from-teal-50 to-indigo-50 p-10 lg:p-14 rounded-[3.5rem] relative overflow-hidden shadow-xl border border-indigo-100",children:[n.jsxs("div",{className:"relative z-10 max-w-2xl space-y-4",children:[n.jsxs("div",{className:"bg-indigo-600/10 w-fit px-4 py-1.5 rounded-full border border-indigo-600/20 flex items-center gap-2",children:[n.jsx(bl,{size:14,className:"text-indigo-700"}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-[0.2em] text-indigo-800",children:"Compromiso Administrativo"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black tracking-tighter leading-none text-slate-800",children:["Recordatorio al ",n.jsx("span",{className:"text-indigo-700 italic",children:"Propietario"})]}),n.jsx("p",{className:"text-slate-600 mt-2 text-md font-medium",children:"Genera comunicados personalizados, respetuosos y altamente aleccionadores para impulsar el saneamiento financiero del conjunto y motivar a los propietarios a regularizar su saldo deudor."})]}),n.jsx(bl,{size:180,className:"absolute right-[-20px] bottom-[-20px] text-indigo-600/10 pointer-events-none -rotate-12"})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8 items-start",children:[n.jsx("div",{className:"lg:col-span-5 space-y-6",children:n.jsxs("div",{className:"bg-white p-6 sm:p-8 rounded-[3.5rem] border border-slate-200/60 shadow-xl space-y-6",children:[n.jsxs("div",{className:"flex items-center justify-between pb-4 border-b border-slate-100",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(PA,{className:"text-indigo-700 animate-[spin_8s_linear_infinite]",size:20}),n.jsx("h3",{className:"font-black text-slate-800 text-sm uppercase tracking-widest",children:"Ajustes de Notificación"})]}),n.jsx("button",{type:"button",onClick:()=>d(!o),className:`py-1 px-3 text-[10px] font-black uppercase tracking-widest rounded-full border transition-all ${o?"bg-amber-50 text-amber-700 border-amber-200":"bg-indigo-50 text-indigo-700 border-indigo-200"}`,children:o?"Filtrar Deudores":"Ver Todos"})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest block",children:"Mes Deuda"}),n.jsx("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-4 py-3 text-sm font-bold text-slate-800 outline-none focus:ring-2 focus:ring-indigo-500",value:a,onChange:pe=>s(Number(pe.target.value)),children:Te.map((pe,he)=>n.jsx("option",{value:he+1,children:pe},he))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest block",children:"Año"}),n.jsx("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-4 py-3 text-sm font-bold text-slate-800 outline-none focus:ring-2 focus:ring-indigo-500",value:i,onChange:pe=>l(Number(pe.target.value)),children:[2024,2025,2026,2027,2028].map(pe=>n.jsx("option",{value:pe,children:pe},pe))})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest flex items-center justify-between",children:[n.jsx("span",{children:"Unidad Habitacional con Saldo"}),p&&n.jsx(ct,{size:10,className:"animate-spin text-slate-400"})]}),M.length===0?n.jsxs("div",{className:"p-4 bg-slate-50 border border-slate-200 rounded-2xl text-center",children:[n.jsx("p",{className:"text-xs font-bold text-slate-400 italic",children:"No se detectaron deudores para este corte."}),n.jsx("button",{onClick:()=>d(!0),className:"text-indigo-600 font-extrabold text-[10px] uppercase tracking-wider block mt-2 hover:underline mx-auto",children:"Mostrar todas las propiedades (Prueba)"})]}):n.jsxs("select",{className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-4 py-3 text-sm font-bold text-slate-800 outline-none focus:ring-2 focus:ring-indigo-500",value:m||"",onChange:pe=>b(Number(pe.target.value)),children:[n.jsx("option",{value:"",children:"-- Seleccionar Unidad --"}),M.map(pe=>n.jsx("option",{value:pe.id,children:pe.label},pe.id))]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest block",children:"Estilo del Comunicado (Colores Pasteles)"}),n.jsx("div",{className:"grid grid-cols-2 gap-3",children:AN.map(pe=>n.jsxs("button",{onClick:()=>y(pe.id),className:`flex items-center gap-2 p-3 rounded-2xl border-2 transition-all ${v===pe.id?"border-indigo-600 bg-indigo-50/25":"border-slate-200/70 hover:border-slate-300 bg-white"}`,children:[n.jsx("span",{className:`w-4 h-4 rounded-full ${pe.bg} border border-[#00000015]`}),n.jsx("span",{className:"text-xs font-black text-slate-700",children:pe.name})]},pe.id))})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest block",children:"Tono del Mensaje"}),n.jsx("div",{className:"flex gap-2",children:wM.map(pe=>n.jsx("button",{onClick:()=>_(pe.id),className:`flex-1 text-center py-2 px-3 rounded-xl border text-[9px] font-black uppercase tracking-wider transition-all ${j===pe.id?"bg-indigo-100 text-indigo-800 border-indigo-300":"bg-slate-50 text-slate-500 border-slate-200 hover:bg-slate-100"}`,children:pe.id==="consciencia"?"Consciencia":pe.id==="preservacion"?"Servicios":"Sugerido"},pe.id))})]}),n.jsxs("div",{className:"space-y-3 pt-2",children:[n.jsxs("div",{children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest flex items-center gap-1.5 mb-1",children:[n.jsx(Hm,{size:11})," Título Principal"]}),n.jsx("input",{type:"text",className:"w-full bg-slate-50 border border-slate-200 rounded-xl px-4 py-2.5 text-xs font-bold text-slate-800 outline-none focus:ring-1 focus:ring-indigo-500 shadow-inner",value:U,onChange:pe=>D(pe.target.value)})]}),n.jsxs("div",{children:[n.jsxs("label",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest flex items-center gap-1.5 mb-1",children:[n.jsx(Hm,{size:11})," Mensaje Aleccionador"]}),n.jsx("textarea",{rows:5,className:"w-full bg-slate-50 border border-slate-200 rounded-xl px-4 py-2.5 text-xs font-bold text-slate-800 outline-none focus:ring-1 focus:ring-indigo-500 resize-none leading-relaxed shadow-inner",value:L,onChange:pe=>P(pe.target.value)})]})]}),n.jsxs("div",{className:"space-y-3 pt-2 bg-slate-50/55 p-4 rounded-2xl border border-slate-150",children:[n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-slate-400 tracking-widest block mb-1",children:"Firma Presidente Junta"}),n.jsx("input",{type:"text",className:"w-full bg-white border border-slate-200 rounded-xl px-3 py-1.5 text-xs font-bold text-slate-850 outline-none",value:N,onChange:pe=>E(pe.target.value)})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-slate-400 tracking-widest block mb-1",children:"Firma Secretario(a) Junta"}),n.jsx("input",{type:"text",className:"w-full bg-white border border-slate-200 rounded-xl px-3 py-1.5 text-xs font-bold text-slate-850 outline-none",value:T,onChange:pe=>B(pe.target.value)})]}),n.jsxs("div",{children:[n.jsx("label",{className:"text-[9px] font-black uppercase text-slate-400 tracking-widest block mb-1",children:"Nombre del Condominio"}),n.jsx("input",{type:"text",className:"w-full bg-white border border-slate-200 rounded-xl px-3 py-1.5 text-xs font-bold text-slate-850 outline-none",value:F,onChange:pe=>R(pe.target.value)})]})]})]})}),n.jsxs("div",{className:"lg:col-span-7 flex flex-col space-y-6",children:[n.jsxs("div",{className:"bg-white p-6 rounded-[2.5rem] border border-slate-200/60 shadow-xl space-y-4",children:[n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-indigo-900 uppercase tracking-widest mb-1.5",children:"Descarga Directa y Soporte"}),n.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[n.jsxs("button",{onClick:le,className:"flex items-center justify-center gap-2 py-3 px-4 bg-slate-900 border border-slate-800 text-white rounded-xl font-black text-[10px] uppercase tracking-wider hover:bg-slate-800 transition shadow-md",children:[n.jsx(wt,{size:13}),"Imprimir"]}),n.jsxs("button",{onClick:re,className:"flex items-center justify-center gap-2 py-3 px-4 bg-blue-600 text-white rounded-xl font-black text-[10px] uppercase tracking-wider hover:bg-blue-750 transition shadow-md",children:[n.jsx(wr,{size:13}),"HTML"]}),n.jsxs("button",{onClick:J,disabled:G,className:"flex items-center justify-center gap-2 py-3 px-4 bg-emerald-600 text-white rounded-xl font-black text-[10px] uppercase tracking-wider hover:bg-emerald-700 transition disabled:opacity-50 shadow-md",children:[G?n.jsx(ct,{className:"animate-spin",size:13}):n.jsx(Gs,{size:13}),"Capturar"]}),n.jsxs("button",{onClick:Z,className:"flex items-center justify-center gap-2 py-3 px-4 bg-indigo-600 text-white rounded-xl font-black text-[10px] uppercase tracking-wider hover:bg-indigo-750 transition shadow-md",children:[n.jsx(Aa,{size:13}),"Compartir"]})]})]}),n.jsx("div",{className:"w-full h-px bg-slate-100"}),n.jsxs("div",{children:[n.jsx("p",{className:"text-[10px] font-black text-indigo-900 uppercase tracking-widest mb-1.5",children:"Envió de Texto en Redes Sociales"}),n.jsxs("div",{className:"flex flex-wrap gap-2",children:[n.jsxs("button",{onClick:ae,className:"flex items-center gap-1.5 py-2 px-3 bg-emerald-50 text-emerald-700 hover:bg-emerald-100/80 rounded-xl text-[10px] font-black uppercase tracking-wider transition",children:[n.jsx(Ha,{size:12})," WhatsApp"]}),n.jsxs("button",{onClick:ie,className:"flex items-center gap-1.5 py-2 px-3 bg-sky-50 text-sky-700 hover:bg-sky-100/80 rounded-xl text-[10px] font-black uppercase tracking-wider transition",children:[n.jsx(zs,{size:12})," Telegram"]}),n.jsxs("button",{onClick:me,className:"flex items-center gap-1.5 py-2 px-3 bg-indigo-50 text-indigo-700 hover:bg-indigo-100/80 rounded-xl text-[10px] font-black uppercase tracking-wider transition",children:[n.jsx(Br,{size:12})," Correo Electrónico"]})]})]})]}),W?n.jsx("div",{className:"w-full bg-white rounded-[3rem] p-5 sm:p-8 border border-slate-200/50 shadow-2xl relative overflow-hidden",children:n.jsxs("div",{id:"reminder-invoice-card",ref:K,className:`p-8 sm:p-14 ${q.bg} rounded-[2rem] relative border border-slate-100 shadow-inner`,children:[n.jsxs("div",{className:"absolute bottom-16 left-12 w-[125px] h-[125px] border-4 border-dashed border-red-500/40 text-red-500/85 rounded-full flex flex-col items-center justify-center text-center rotate-[-12deg] bg-white/70 backdrop-blur-sm pointer-events-none z-10 shadow-sm",style:{transform:"rotate(-12deg)"},children:[n.jsx("span",{className:"text-[7px] font-black tracking-widest text-red-600/80 truncate max-w-[100px]",children:F.toUpperCase()}),n.jsx("div",{className:"my-1.5 border-t border-b border-dashed border-red-500 text-[10px] font-black text-red-600 tracking-[0.1em] py-0.5 px-3",children:"RECORDATORIO"}),n.jsx("span",{className:"text-[7.5px] font-black tracking-wider text-red-700",children:"COMPROMISO ACTIVO"})]}),n.jsxs("div",{className:"relative z-[2] space-y-8",children:[n.jsx("div",{className:"flex justify-center",children:n.jsx("div",{className:"p-4 rounded-full bg-slate-900/5 border border-slate-900/10 shadow-sm",children:n.jsx(bl,{size:32,className:q.primary})})}),n.jsxs("div",{className:"text-center",children:[n.jsx("h2",{className:"font-black text-base tracking-[0.25em] text-slate-800 uppercase",children:F}),n.jsx("p",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest mt-1",children:"SISTEMA ADMINISTRATIVO PARA CONDOMINIOS (SAC 2026)"})]}),n.jsx("div",{className:"w-24 h-0.5 bg-slate-300/40 mx-auto"}),n.jsx("h3",{className:"font-sans font-black text-xl tracking-tight sm:text-2xl text-slate-900 leading-tight text-center max-w-lg mx-auto",children:U.toUpperCase()}),n.jsxs("div",{className:"p-6 bg-slate-900/5 rounded-2xl border border-slate-200/40 text-left space-y-1",children:[n.jsx("p",{className:"text-[9px] font-black uppercase text-slate-400 tracking-widest",children:"Unidad Habitacional y Copropietario Destinatario:"}),n.jsx("p",{className:"font-black text-slate-850 text-xl tracking-tight leading-normal uppercase",children:O}),n.jsxs("div",{className:"flex flex-wrap items-center gap-y-1 gap-x-4 pt-1",children:[n.jsxs("span",{className:`text-[10px] font-black uppercase tracking-wider ${q.primary}`,children:["CÓDIGO: ",W.code]}),n.jsx("span",{className:"text-slate-300",children:"•"}),n.jsxs("span",{className:"text-[10px] font-bold text-slate-500 uppercase tracking-wider",children:["NÚMERO DE UNIDAD: ",W.number," (TIPO: ",W.type,")"]})]})]}),n.jsx("div",{className:"text-slate-650 text-sm leading-relaxed text-justify space-y-4 font-normal max-w-2xl mx-auto px-1",children:n.jsx("p",{children:L})}),n.jsxs("div",{className:"bg-slate-950/5 rounded-2xl border border-slate-200/40 p-6 text-left space-y-4",children:[n.jsxs("span",{className:"text-[10px] font-black uppercase text-slate-400 tracking-widest block mb-2",children:["Desglose Analítico de Cuenta del Mes de ",Te[a-1],":"]}),n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between gap-4 border-b border-slate-200/40 pb-4",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"A. Cuota de Periodo"}),n.jsxs("p",{className:"text-xl font-black text-slate-800 tracking-tighter",children:["$ ",Y.currentDebt.toLocaleString("en-US",{minimumFractionDigits:2})]})]}),n.jsx("div",{className:"hidden sm:block w-px bg-slate-200"}),n.jsxs("div",{children:[n.jsx("span",{className:"text-[9px] font-black text-slate-400 uppercase tracking-widest",children:"B. Convenio / Saldo Historial anterior"}),n.jsxs("p",{className:"text-xl font-black text-indigo-800 tracking-tighter",children:["$ ",Y.agreementDebt.toLocaleString("en-US",{minimumFractionDigits:2})]})]})]}),n.jsxs("div",{className:"pt-2",children:[n.jsx("span",{className:"text-[9px] font-black text-red-600 uppercase tracking-widest",children:"C. Monto Total Consolidado en Estado Mora"}),n.jsxs("p",{className:"text-3xl font-black text-red-650 tracking-tighter mt-1",children:["$ ",Y.totalDebt.toLocaleString("en-US",{minimumFractionDigits:2})]})]})]}),n.jsx("div",{className:"text-center pt-4",children:n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-[0.2em] leading-relaxed",children:["Soporte Preventivo Emitido Electrónicamente en",n.jsx("br",{}),"San Diego, Carabobo, República de Venezuela el ",z]})}),n.jsxs("div",{className:"grid grid-cols-2 gap-8 pt-8 border-t border-slate-200/30",children:[n.jsx("div",{className:"text-center",children:n.jsxs("div",{className:"w-11/12 mx-auto border-t-2 border-slate-900/60 pt-3",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-800 uppercase tracking-wider block",children:N}),n.jsx("span",{className:"text-[8px] font-bold text-slate-400 uppercase tracking-widest mt-1 block",children:"Presidencia del Condominio"})]})}),n.jsx("div",{className:"text-center",children:n.jsxs("div",{className:"w-11/12 mx-auto border-t-2 border-slate-900/60 pt-3",children:[n.jsx("span",{className:"text-[10px] font-black text-slate-800 uppercase tracking-wider block",children:T}),n.jsx("span",{className:"text-[8px] font-bold text-slate-400 uppercase tracking-widest mt-1 block",children:"Administración de Convivencia"})]})})]})]})]})}):n.jsxs("div",{className:"flex-1 bg-white rounded-[3rem] p-16 border border-slate-200/50 shadow-xl flex flex-col items-center justify-center text-center",children:[n.jsx(RM,{size:48,className:"text-slate-300 mb-4 animate-bounce"}),n.jsx("h4",{className:"text-lg font-black text-slate-800 uppercase tracking-tight",children:"Sin Inmueble Seleccionado"}),n.jsx("p",{className:"text-sm font-medium text-slate-400 mt-1 max-w-sm",children:"Por favor, seleccione una propiedad con saldo pendiente en los controles laterales para generar el recordatorio."})]})]})]})]})},pFe=()=>{const[e,t]=k.useState(null),[r,a]=k.useState(!0),[s,i]=k.useState("dashboard"),[l,o]=k.useState(!1),[d,u]=k.useState(null),[f,p]=k.useState(!1),[h,m]=k.useState(!1),[b,v]=k.useState(!1),[y,j]=k.useState(null),[_,N]=k.useState(null),E=k.useRef(!1),{refreshData:T,moduleStatus:B,financialTotals:F,latestRate:R,exchangeRateHistory:U,setUserRole:D}=ht(),L=k.useRef(!1);k.useEffect(()=>{L.current=!0},[]);const P=async()=>{try{const Y=await(await fetch(`${Ne}/get_license_status.php`)).json();j(Y),Y.status==="locked"&&(e==null?void 0:e.role)!=="programmer"?p(!0):p(!1);const M=await we.getSystemSettings();M.system_maintenance_mode==="true"?m(!0):m(!1);const O=M.electrical_failure_mode==="true";v(O),we.setElectricalFailure(O)}catch{console.warn("License/Maintenance Check Failed")}},G=k.useCallback(async W=>{if(!["admin","programmer","board"].includes(W.role))try{const M=await(await fetch(`${Ne}/get_blocking_status.php`,{credentials:"include"})).json();M.blocking&&M.target_tab?(N(M),(!E.current||_&&_.item_id!==M.item_id)&&(i(M.target_tab),E.current=!0)):N(null)}catch(Y){console.error("Blocking Engine Error",Y)}},[_]),Q=()=>{N(null),E.current=!1};k.useEffect(()=>{(async()=>{try{const Y=await we.checkSession();Y&&(t(Y),D(Y.role),we.setUserRole(Y.role),await P(),await G(Y),T(Y.role))}catch{console.warn("Sesión no iniciada.")}finally{a(!1)}})()},[T,G,D]),k.useEffect(()=>{e&&we.logNavigation(s)},[s,e]);const H=async W=>{a(!0),u(null);try{const Y=await we.login(W);t(Y),D(Y.role),we.setUserRole(Y.role),await P(),E.current=!1,await G(Y),await T(Y.role)}catch(Y){u(Y.message)}finally{a(!1)}},X=async()=>{await we.logout(),t(null),D(null),we.setUserRole(null),i("dashboard"),N(null),p(!1),v(!1),we.setElectricalFailure(!1),E.current=!1,L.current=!1};if(r)return n.jsxs("div",{className:"h-screen w-screen flex flex-col items-center justify-center bg-slate-50 gap-6",children:[n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"w-20 h-20 border-[6px] border-blue-50 border-t-blue-600 rounded-full animate-spin"}),n.jsx(da,{size:32,className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-blue-600 animate-pulse"})]}),n.jsxs("div",{className:"text-center",children:[n.jsx("p",{className:"text-blue-600 font-black tracking-[0.3em] text-xs uppercase mb-2",children:"SAC 2026"}),n.jsx("p",{className:"text-slate-400 font-black text-[9px] uppercase tracking-widest",children:Ln})]})]});if(!e)return n.jsx(hFe,{onLogin:H,isLoading:r,error:d,latestRate:R});if(h&&e.role!=="programmer")return n.jsx(xFe,{logout:X});if(b&&e.role!=="programmer")return n.jsx(mFe,{logout:X});if(f)return n.jsx("div",{className:"h-screen w-screen bg-slate-900 flex items-center justify-center p-6",children:n.jsxs("div",{className:"bg-white rounded-[4rem] p-10 lg:p-16 max-w-2xl w-full shadow-2xl text-center relative overflow-hidden animate-in zoom-in duration-500",children:[n.jsx("div",{className:"w-24 h-24 bg-red-100 text-red-600 rounded-[2rem] flex items-center justify-center mx-auto mb-10 shadow-xl shadow-red-200",children:n.jsx(FM,{size:56})}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter leading-tight mb-6",children:["Servicio ",n.jsx("br",{}),n.jsx("span",{className:"text-red-600 italic",children:"Temporalmente Suspendido"})]}),n.jsxs("p",{className:"text-slate-500 font-medium text-lg leading-relaxed mb-10",children:["Detectamos una inconsistencia en el estatus de renta de este condominio. El acceso al sistema ha sido bloqueado preventivamente por el motor de licencias de ",n.jsx("b",{children:"TecnoMath"}),"."]}),n.jsxs("div",{className:"bg-slate-50 border border-slate-200 p-8 rounded-[2.5rem] mb-10",children:[n.jsx("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest mb-4",children:"MOTIVO DETECTADO"}),n.jsxs("div",{className:"flex items-center justify-center gap-3 text-red-600 font-black text-xl uppercase tracking-tighter",children:[n.jsx(Xr,{size:24}),y!=null&&y.is_expired?"RENTA VENCIDA":"BLOQUEO ADMINISTRATIVO"]}),n.jsx("div",{className:"w-full h-px bg-slate-200 my-6"}),n.jsx("p",{className:"text-sm font-bold text-slate-700 uppercase",children:"Por favor contacte soporte para la reactivación inmediata:"}),n.jsx("a",{href:"https://tecnomath.com",target:"_blank",className:"text-blue-600 font-black text-2xl tracking-tight hover:underline block mt-2",children:"TecnoMath.com"})]}),n.jsx("div",{className:"flex justify-center gap-6",children:n.jsxs("button",{onClick:X,className:"text-slate-400 font-black text-xs uppercase tracking-widest hover:text-slate-600 flex items-center gap-2",children:[n.jsx(Wf,{size:16})," Salir del Portal"]})}),n.jsx(wr,{className:"absolute right-[-40px] bottom-[-40px] w-64 h-64 text-slate-100 pointer-events-none"})]})});const K=()=>{const W=["admin","programmer","board"].includes(e.role);switch(s){case"dashboard":return n.jsx(C6,{user:e,onNavigate:i});case"monthly-collection":return n.jsx(ZIe,{user:e});case"debt-list":return n.jsx(aFe,{});case"solvent-list":return n.jsx(nFe,{});case"payment-report":return n.jsx(eFe,{user:e});case"properties":return W?n.jsx(Sme,{user:e}):n.jsx(qde,{user:e});case"bulk-load-properties":return n.jsx(cSe,{user:e});case"residents":return n.jsx(Bme,{user:e});case"users":return n.jsx(_me,{user:e});case"bulk-load-users":return n.jsx(dSe,{user:e});case"providers":return n.jsx(tSe,{user:e});case"prefill-simulator":return n.jsx(uSe,{user:e});case"recaudacion-detallada":return n.jsx(VIe,{user:e});case"generate-fees":return n.jsx(j6,{user:e,viewMode:"generate",onTabChange:i});case"view-fees":return n.jsx(j6,{user:e,viewMode:"list",onTabChange:i});case"balance":return n.jsx(Tme,{user:e,onNavigate:i});case"historial-pagos-egresos":return n.jsx(GIe,{user:e});case"expediente-digital":return n.jsx($Ie,{user:e});case"payment-agreements":return n.jsx(HIe,{user:e});case"history-agreements":return n.jsx(zIe,{user:e});case"banks":return n.jsx(Wde,{user:e});case"bank-precise":return n.jsx(lFe,{user:e});case"bank-reconciliation":return n.jsx(iSe,{user:e});case"bank-reconciliation-bnc":return n.jsx(lSe,{user:e});case"statement-analyzer":return n.jsx(aSe,{user:e});case"statement-analyzer-bnc":return n.jsx(nSe,{user:e});case"statement-detailed":return n.jsx(sSe,{user:e});case"banplus-commissions":return n.jsx(iFe,{user:e});case"commissions":return n.jsx(rSe,{user:e});case"currency":return n.jsx(IEe,{});case"audit":return n.jsx(Eme,{user:e});case"bulk-messages":return n.jsx(FEe,{user:e});case"messages":return n.jsx(DEe,{user:e});case"polls":return n.jsx(UEe,{user:e,onActionComplete:Q});case"data-forms":return n.jsx(REe,{user:e,onActionComplete:Q});case"live-voting":return n.jsx(QEe,{user:e,onActionComplete:Q});case"calculator":return n.jsx($Ee,{});case"statistics":return n.jsx(VEe,{});case"reservations":return n.jsx(GEe,{user:e});case"announcements":return n.jsx(KEe,{user:e});case"services":return n.jsx(qEe,{user:e});case"assemblies":return n.jsx(WEe,{user:e});case"maintenance":return n.jsx(YEe,{user:e});case"license-control":return n.jsx(oSe,{user:e});case"menu-selection":return n.jsx(PIe,{user:e});case"system-audit":return n.jsx(XEe,{user:e});case"excel-reports":return n.jsx(KIe,{user:e});case"detailed-excel-reports":return n.jsx(qIe,{user:e});case"html-reports":return n.jsx(WIe,{user:e});case"individual-account-status":return n.jsx(YIe,{user:e});case"detailed-account-status":return n.jsx(XIe,{user:e});case"monthly-debt-status":return n.jsx(oFe,{user:e});case"monthly-debt-status-massive":return n.jsx(cFe,{user:e});case"credit-balances":return n.jsx(JIe,{user:e});case"saldo-desglosado":return n.jsx(dFe,{user:e});case"saldo-desglosado-avanzado":return n.jsx(uFe,{user:e});case"congratulate-owner":return n.jsx(AFe,{user:e});case"owner-reminder":return n.jsx(fFe,{user:e});case"payment-status":return n.jsx(cN,{user:e,onNavigate:i});case"payment-receipt":return n.jsx(sFe,{user:e});case"solvencia-html":return n.jsx(cN,{user:e,initialMode:"html",onNavigate:i});case"solvencia-txt":return n.jsx(cN,{user:e,initialMode:"txt",onNavigate:i});case"password-manager":return n.jsx(eSe,{user:e});case"individual-fee-view":return n.jsx(ASe,{user:e});case"individual-fee-html":return n.jsx(RIe,{user:e});case"individual-fee-html-large":return n.jsx(OIe,{user:e});default:return n.jsx(C6,{user:e,onNavigate:i})}},ee=[{id:"dashboard",label:"DashBoard",icon:DG,roles:["admin","owner","manager","board","programmer"],core:!0},{id:"properties",label:["admin","board","programmer"].includes(e.role)?"Propiedades":"Mi Inmueble",icon:ea,roles:["admin","owner","resident","board","programmer"],core:!0},{id:"bulk-load-properties",label:"Carga Excel Prop.",icon:gl,roles:["admin","programmer"],core:!0},{id:"residents",label:"Residentes",icon:Ia,roles:["admin","programmer","board"],core:!0},{id:"users",label:"Usuarios",icon:Qi,roles:["programmer"],core:!0},{id:"bulk-load-users",label:"Carga Excel Usua.",icon:jo,roles:["programmer"],core:!0},{id:"providers",label:"Proveedores",icon:pb,roles:["admin","programmer","board"],core:!0},{id:"prefill-simulator",label:"Pre-fill Cuota Mes",icon:Kr,roles:["admin","board","programmer"]},{id:"generate-fees",label:"Generar Cuotas",icon:db,roles:["admin","board","programmer"],core:!0},{id:"view-fees",label:"Ver Cuotas y Pagos",icon:yr,roles:["admin","owner","board","programmer"],core:!0},{id:"payment-report",label:"Reporte de Pago",icon:ca,roles:["admin","owner","board","programmer"],core:!1},{id:"monthly-collection",label:"Recaudación Mensual",icon:da,roles:["admin","programmer"],core:!1},{id:"debt-list",label:"Listado de Deudores",icon:yr,roles:["admin","board","programmer"],core:!1},{id:"solvent-list",label:"Listado de Solventes",icon:Gt,roles:["admin","programmer"],core:!1},{id:"congratulate-owner",label:"Felicitar al Propietario",icon:If,roles:["admin","board","programmer"]},{id:"owner-reminder",label:"Recordatorio al Propietario",icon:bl,roles:["admin","board","programmer"]},{id:"recaudacion-detallada",label:"Recaudación Digital",icon:br,roles:["admin","board","programmer"]},{id:"payment-status",label:"Estatus de Pago",icon:Gt,roles:["admin","owner","board","programmer"]},{id:"payment-receipt",label:"Recibo de Pago",icon:ca,roles:["admin","owner","board","programmer"]},{id:"solvencia-html",label:"Solvencia HTML Pro",icon:wr,roles:["programmer"]},{id:"solvencia-txt",label:".TXT Solvencia",icon:yr,roles:["programmer"]},{id:"individual-fee-view",label:"Cuota por Usuario Individual",icon:QA,roles:["admin","board","programmer"]},{id:"individual-fee-html",label:"Cuota por Usuario Individual HTML",icon:wr,roles:["admin","board","programmer"],core:!0},{id:"individual-fee-html-large",label:"Cuota por Usuario Individual HTML Grande",icon:wr,roles:["admin","board","programmer"]},{id:"individual-account-status",label:"Estado de Cuenta Individual",icon:ca,roles:["admin","board","programmer","owner"]},{id:"detailed-account-status",label:"Estado de Cuenta Detallado",icon:Da,roles:["admin","board","programmer"]},{id:"saldo-desglosado",label:"Saldo Desglosado",icon:ca,roles:["admin","board","programmer","owner"]},{id:"saldo-desglosado-avanzado",label:"Saldo Desglosado Avanzado",icon:wl,roles:["admin","programmer"]},{id:"monthly-debt-status",label:"Estado Cuenta - Deuda Meses",icon:ca,roles:["admin","board","programmer","owner"]},{id:"monthly-debt-status-massive",label:"Estado Cuenta - Deuda Meses Masivo",icon:zs,roles:["admin","board","programmer"]},{id:"credit-balances",label:"Saldos a Favor",icon:kn,roles:["admin","board","programmer"],core:!0},{id:"balance",label:"Balance General",icon:Up,roles:["admin","board","programmer"],core:!0},{id:"historial-pagos-egresos",label:"Auditoría Egresos",icon:ca,roles:["admin","board","programmer"]},{id:"expediente-digital",label:"Expediente Digital",icon:Lm,roles:["admin","owner","board","programmer"]},{id:"payment-agreements",label:"Convenios de Pago",icon:eu,roles:["admin","board","programmer"]},{id:"history-agreements",label:"Histórico Convenios",icon:Da,roles:["admin","board","programmer"]},{id:"banks",label:"Banco",icon:Ic,roles:["admin","board","programmer"],core:!0},{id:"bank-precise",label:"Banco Preciso (V4)",icon:Gt,roles:["admin","board","programmer"],core:!1},{id:"bank-reconciliation",label:"Banco VS Banco BanPlus",icon:jA,roles:["admin","board","programmer"]},{id:"bank-reconciliation-bnc",label:"Banco VS Banco BNC",icon:jA,roles:["admin","board","programmer"]},{id:"statement-analyzer",label:"Analizador Estados BanPlus",icon:Kf,roles:["admin","board","programmer"]},{id:"statement-analyzer-bnc",label:"Analizador Estados BNC",icon:br,roles:["admin","board","programmer"]},{id:"statement-detailed",label:"Analizador Detallado BanPlus",icon:Lc,roles:["admin","board","programmer"]},{id:"banplus-commissions",label:"Comisiones Banplus desde Estado Cuenta",icon:bs,roles:["admin","board","programmer"]},{id:"commissions",label:"Cálculo Comisiones",icon:bs,roles:["admin","board","programmer"]},{id:"excel-reports",label:"Informes en Excel",icon:gl,roles:["admin","board","programmer"]},{id:"detailed-excel-reports",label:"Informes Detallados Excel",icon:gl,roles:["admin","board","programmer"]},{id:"html-reports",label:"Informes en HTML",icon:yr,roles:["admin","board","programmer"]},{id:"audit",label:"Informes y Auditoría",icon:xo,roles:["admin","board","programmer"]},{id:"currency",label:"Tasas",icon:za,roles:["admin","board","programmer"]},{id:"bulk-messages",label:"Mensajería Masiva",icon:Br,roles:["admin","board","programmer"],core:!0},{id:"messages",label:"Mensajería Individual",icon:zs,roles:["admin","board","programmer"]},{id:"polls",label:"Carta Consulta",icon:Rd,roles:["admin","owner","board","programmer","family"]},{id:"data-forms",label:"Censos",icon:Jd,roles:["admin","owner","board","programmer","family"]},{id:"live-voting",label:"Asamblea Live",icon:Yf,roles:["admin","owner","board","programmer","family","guest"]},{id:"calculator",label:"Calculadora Pro",icon:vi,roles:["admin","owner","board","programmer","family","guest"]},{id:"statistics",label:"Estadísticas Pro",icon:EM,roles:["admin","owner","board","programmer","family","guest"]},{id:"reservations",label:"Reservas",icon:jM,roles:["admin","owner","board","programmer","family"]},{id:"announcements",label:"Comunicados",icon:bl,roles:["admin","owner","board","programmer","family"]},{id:"services",label:"Servicios",icon:Xf,roles:["admin","owner","board","programmer","family"]},{id:"assemblies",label:"Asambleas",icon:kM,roles:["admin","owner","board","programmer","family"]},{id:"maintenance",label:"Mantenimiento",icon:PA,roles:["programmer"],core:!0},{id:"menu-selection",label:"Selección de Menú",icon:Qm,roles:["programmer"],core:!0},{id:"license-control",label:"Control SaaS",icon:Od,roles:["programmer"],core:!0},{id:"password-manager",label:"Password Usuarios",icon:EA,roles:["programmer"],core:!0},{id:"system-audit",label:"DataLogger (ip)",icon:vs,roles:["programmer"],core:!0}].filter(W=>{if(!W.roles.includes(e.role))return!1;if(W.core||["admin","programmer"].includes(e.role))return!0;const M=B.find(O=>O.id===W.id);return M?M.isActive:!1});return n.jsxs("div",{className:"flex min-h-[100dvh] w-full bg-slate-50 text-slate-900 font-['Inter'] relative overflow-x-hidden",children:[n.jsx(ZEe,{user:e}),l&&n.jsx("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm z-[100] lg:hidden",onClick:()=>o(!1)}),n.jsxs("aside",{className:`fixed inset-y-0 left-0 transform ${l?"translate-x-0":"-translate-x-full"} lg:relative lg:translate-x-0 transition-transform duration-300 ease-in-out w-64 sm:w-72 bg-slate-900 flex flex-col z-[110] shadow-2xl h-screen no-print`,children:[n.jsxs("div",{className:"p-6 sm:p-8 flex items-center justify-between shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-9 h-9 sm:w-10 sm:h-10 bg-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-blue-500/30",children:n.jsx(da,{className:"text-white",size:20})}),n.jsxs("div",{className:"flex flex-col",children:[n.jsxs("span",{className:"font-black text-xl sm:text-2xl tracking-tighter text-white leading-none",children:["SAC ",n.jsx("span",{className:"text-blue-400",children:"2026"})]}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-[0.5em] text-orange-600 mt-1",children:va.toLowerCase()}),n.jsx("span",{className:"text-[7px] font-black text-blue-400 uppercase tracking-[0.2em] mt-1",children:Ln})]})]}),n.jsx("button",{onClick:()=>o(!1),className:"lg:hidden p-2 text-slate-400 hover:text-white transition-colors",children:n.jsx(mt,{size:20})})]}),e.role==="programmer"&&F&&n.jsxs("div",{className:"px-6 py-4 mx-4 mb-2 bg-blue-600/10 border border-blue-500/20 rounded-2xl animate-in zoom-in",children:[n.jsx("p",{className:"text-[8px] font-black text-blue-400 uppercase tracking-widest mb-1",children:"Fondo en Divisa"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(kn,{size:14,className:"text-emerald-400"}),n.jsxs("span",{className:"text-base font-black text-white tracking-tighter",children:["$ ",Number(F.initialCashUsd).toLocaleString("en-US",{minimumFractionDigits:2})]})]})]}),n.jsx("nav",{className:"flex-1 overflow-y-auto px-3 sm:px-4 py-4 space-y-1.5 sm:space-y-2 custom-scrollbar",children:ee.map(W=>{const Y=W.icon,M=s===W.id;return n.jsxs("button",{onClick:()=>{i(W.id),o(!1),window.scrollTo(0,0)},className:`w-full flex items-center gap-3 sm:gap-4 px-4 sm:px-6 py-3.5 sm:py-4 rounded-xl sm:rounded-2xl font-black text-[10px] sm:text-xs uppercase tracking-widest transition-all ${M?"bg-blue-600 text-white shadow-xl shadow-blue-500/20":"text-slate-400 hover:bg-slate-800 hover:text-white"}`,children:[n.jsx(Y,{size:18}),W.label]},W.id)})}),n.jsx("div",{className:"p-4 mt-auto border-t border-slate-800/50 shrink-0",children:n.jsxs("button",{onClick:X,className:"w-full flex items-center gap-4 px-6 py-4 rounded-2xl font-black text-[10px] sm:text-xs uppercase tracking-widest text-red-400 hover:bg-red-50/10 transition-all",children:[n.jsx(Wf,{size:20})," Cerrar Sesión"]})})]}),n.jsxs("div",{className:"flex-1 flex flex-col min-w-0 min-h-[100dvh]",children:[n.jsxs("header",{className:"sticky top-0 h-16 sm:h-20 bg-white/80 backdrop-blur-md border-b border-slate-200 flex items-center justify-between px-4 sm:px-8 z-[30] shrink-0 no-print",children:[n.jsx("button",{onClick:()=>o(!0),className:"lg:hidden p-2 text-slate-500 hover:bg-slate-100 rounded-xl transition-all",children:n.jsx(WG,{size:24})}),n.jsx("div",{className:"flex-1 lg:flex items-center gap-3 px-2 sm:px-4",children:_?n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 sm:px-4 sm:py-2 bg-amber-50 text-amber-600 rounded-full border border-amber-100 scale-90 sm:scale-100",children:[n.jsx(Xr,{size:12,className:"shrink-0"}),n.jsx("span",{className:"text-[9px] sm:text-[10px] font-black uppercase tracking-widest truncate max-w-[140px] sm:max-w-none",children:"Consulta pendiente por su unidad"})]}):n.jsxs("div",{className:"hidden lg:flex items-center gap-3",children:[n.jsx("div",{className:"w-2 h-2 bg-emerald-500 rounded-full animate-pulse"}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400",children:"Terminal Activa"})]})}),n.jsxs("div",{className:"flex items-center gap-3 sm:gap-4",children:[n.jsxs("div",{className:"text-right hidden sm:block",children:[n.jsx("p",{className:"text-xs font-black text-slate-900 leading-none",children:e==null?void 0:e.fullName}),n.jsx("p",{className:"text-[9px] font-bold text-blue-600 uppercase tracking-widest mt-1",children:e==null?void 0:e.role})]}),n.jsx("div",{className:"w-9 h-9 sm:w-10 sm:h-10 bg-slate-100 rounded-xl flex items-center justify-center text-slate-400",children:n.jsx(tu,{size:18})})]})]}),n.jsx("main",{className:"flex-1 p-3 sm:p-6 lg:p-8 bg-slate-50",children:n.jsx("div",{className:"max-w-7xl mx-auto",children:K()})})]})]})},xFe=({logout:e})=>n.jsxs("div",{className:"h-screen w-screen bg-[#0f172a] flex items-center justify-center p-6 relative overflow-hidden font-['Inter']",children:[n.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none",children:n.jsx("div",{className:"absolute top-0 left-0 w-full h-full",style:{backgroundImage:"radial-gradient(circle at 2px 2px, #3b82f6 1px, transparent 0)",backgroundSize:"40px 40px"}})}),n.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-blue-600/20 blur-[120px] rounded-full animate-pulse pointer-events-none"}),n.jsxs("div",{className:"bg-white rounded-[4rem] p-10 lg:p-16 max-w-3xl w-full shadow-2xl text-center relative z-10 border border-slate-800/10 animate-in zoom-in duration-700",children:[n.jsxs("div",{className:"relative mb-12",children:[n.jsx("div",{className:"w-24 h-24 bg-blue-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-2xl shadow-blue-500/40 relative z-10 animate-flicker",children:n.jsx(PA,{className:"text-white animate-[spin_4s_linear_infinite]",size:48})}),n.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-24 h-24 bg-blue-400 blur-xl opacity-50 animate-pulse"})]}),n.jsxs("h1",{className:"text-4xl lg:text-5xl font-black text-slate-900 tracking-tighter leading-tight mb-6",children:["Sistema en ",n.jsx("br",{}),n.jsx("span",{className:"text-blue-600 font-black italic uppercase",children:"Modo Mantenimiento"})]}),n.jsxs("div",{className:"bg-slate-50 border border-slate-200 p-8 rounded-[3rem] space-y-6 mb-10 group hover:border-blue-200 transition-colors",children:[n.jsx("p",{className:"text-slate-500 font-bold text-base leading-relaxed",children:"Estamos actualizando los núcleos del SAC 2026 para ofrecerte una experiencia superior. Los módulos de administración se encuentran en modo de solo lectura o suspendidos temporalmente."}),n.jsx("div",{className:"flex flex-col items-center gap-4 py-4",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(t=>n.jsx("div",{className:"w-1.5 h-6 bg-blue-600 rounded-full animate-bounce",style:{animationDelay:`${t*.1}s`}},t))}),n.jsx("span",{className:"text-[10px] font-black text-blue-600 uppercase tracking-[0.3em] ml-4",children:"Procesando Kernel V4.2.07"})]})}),n.jsxs("div",{className:"pt-6 border-t border-slate-200 flex flex-col sm:flex-row items-center justify-center gap-6",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-emerald-100 flex items-center justify-center text-emerald-600",children:n.jsx(za,{size:16})}),n.jsxs("span",{className:"text-[9px] font-black uppercase text-slate-400 tracking-widest text-left",children:["Integridad de Datos",n.jsx("br",{}),n.jsx("span",{className:"text-emerald-600",children:"Verificada OK"})]})]}),n.jsx("div",{className:"hidden sm:block w-px h-8 bg-slate-200"}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center text-blue-600",children:n.jsx(jo,{size:16})}),n.jsxs("span",{className:"text-[9px] font-black uppercase text-slate-400 tracking-widest text-left",children:["Respaldo Automático",n.jsx("br",{}),n.jsx("span",{className:"text-blue-600",children:"Sincronizado"})]})]})]})]}),n.jsx("div",{className:"flex flex-col sm:flex-row justify-center items-center gap-8",children:n.jsxs("button",{onClick:e,className:"text-slate-400 font-black text-xs uppercase tracking-widest hover:text-slate-900 transition-colors flex items-center gap-2",children:[n.jsx(Wf,{size:16})," Salir del Sistema"]})}),n.jsx(Kr,{className:"absolute left-[-20px] top-[-20px] w-48 h-48 text-slate-100/50 pointer-events-none -rotate-12"}),n.jsxs("div",{className:"absolute bottom-6 right-10 flex items-center gap-2",children:[n.jsx("span",{className:"text-[8px] font-black text-slate-300 uppercase tracking-widest",children:"TecnoMath SAC Core"}),n.jsx("div",{className:"w-1 h-1 bg-blue-400 rounded-full animate-ping"})]})]})]}),hFe=({onLogin:e,isLoading:t,error:r,latestRate:a})=>{const[s,i]=k.useState(""),[l,o]=k.useState("");return n.jsx("div",{className:"min-h-[100dvh] w-full flex items-center justify-center bg-slate-50 p-4 font-['Inter']",children:n.jsxs("div",{className:"w-full max-w-md bg-white rounded-[2rem] sm:rounded-[3rem] shadow-2xl p-8 sm:p-12 border border-slate-100 animate-in fade-in zoom-in duration-500",children:[n.jsxs("div",{className:"flex flex-col items-center mb-8 sm:mb-10",children:[n.jsx("div",{className:"w-14 h-14 sm:w-16 sm:h-16 bg-blue-600 rounded-2xl flex items-center justify-center shadow-xl shadow-blue-200 mb-6",children:n.jsx(da,{size:28,className:"text-white"})}),n.jsxs("div",{className:"text-center",children:[n.jsxs("h1",{className:"text-2xl sm:text-3xl font-black text-slate-900 tracking-tighter leading-none",children:["SAC ",n.jsx("span",{className:"text-blue-600",children:"2026"})]}),n.jsx("p",{className:"text-[9px] font-black uppercase tracking-[0.5em] text-orange-600 mt-2",children:va.toLowerCase()}),n.jsx("p",{className:"text-[7px] font-black text-blue-600 uppercase tracking-widest mt-1",children:Ln})]}),n.jsx("p",{className:"text-slate-400 font-bold uppercase text-[9px] sm:text-[10px] tracking-[0.2em] sm:tracking-[0.3em] mt-6 text-center leading-relaxed",children:"Gestión Integral"})]}),r&&n.jsxs("div",{className:"mb-6 sm:mb-8 bg-red-50 border border-red-100 p-4 rounded-2xl flex items-center gap-3 text-red-600 animate-in shake duration-300",children:[n.jsx(Sr,{size:18,className:"shrink-0"}),n.jsx("p",{className:"text-[9px] sm:text-[10px] font-black uppercase tracking-widest leading-relaxed",children:r})]}),n.jsxs("form",{onSubmit:d=>{d.preventDefault(),e({username:s,password:l})},className:"space-y-5 sm:space-y-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[9px] sm:text-[10px] font-black uppercase text-slate-400 tracking-widest block px-1",children:"Usuario / Teléfono"}),n.jsxs("div",{className:"relative",children:[n.jsx(tu,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:16}),n.jsx("input",{required:!0,autoFocus:!0,type:"text",placeholder:"Ej: 04121234567",className:"w-full bg-slate-50 border border-slate-200 rounded-xl sm:rounded-2xl pl-11 sm:pl-12 pr-4 py-3.5 sm:py-4 text-sm focus:ring-2 focus:ring-blue-500 outline-none font-black text-slate-800 tracking-widest",value:s,onChange:d=>i(d.target.value)})]})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("label",{className:"text-[9px] sm:text-[10px] font-black uppercase text-slate-400 tracking-widest ml-1 block",children:"Contraseña (Cédula)"}),n.jsxs("div",{className:"relative",children:[n.jsx(Od,{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400",size:16}),n.jsx("input",{required:!0,type:"password",placeholder:"Mismo número de C.I.",className:"w-full bg-slate-50 border border-slate-100 rounded-xl sm:rounded-2xl pl-11 sm:pl-12 pr-4 py-3.5 sm:py-4 text-sm focus:ring-2 focus:ring-blue-500 outline-none font-bold text-slate-800",value:l,onChange:d=>o(d.target.value)})]})]}),n.jsxs("button",{disabled:t,type:"submit",className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-4.5 sm:py-5 rounded-2xl sm:rounded-[2rem] font-black text-[10px] sm:text-xs uppercase tracking-[0.2em] shadow-xl shadow-blue-200 transition-all active:scale-95 flex items-center justify-center gap-3 disabled:opacity-50",children:[t?n.jsx("div",{className:"w-4 h-4 sm:w-5 sm:h-5 border-2 border-white/30 border-t-white rounded-full animate-spin"}):n.jsx(Wf,{size:16,className:"rotate-180"}),"ACCESO SEGURO"]})]}),n.jsx("div",{className:"mt-10 sm:mt-12 pt-8 border-t border-slate-100 text-center",children:n.jsxs("p",{className:"text-xs sm:text-sm text-slate-700 font-black uppercase tracking-[0.2em]",children:["Powered by TecnoMath • ",n.jsx("span",{className:"text-blue-600",children:"By Andres Mathison"})," © 2026"]})})]})})},mFe=({logout:e})=>n.jsxs("div",{className:"h-screen w-screen bg-slate-900 flex items-center justify-center p-6 relative overflow-hidden font-['Inter'] animate-in fade-in duration-700",children:[n.jsx("div",{className:"absolute inset-0 opacity-10 pointer-events-none",children:n.jsx("div",{className:"absolute top-0 left-0 w-full h-full",style:{backgroundImage:"radial-gradient(circle at 2px 2px, #f97316 1px, transparent 0)",backgroundSize:"40px 40px"}})}),n.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-orange-600/20 blur-[120px] rounded-full animate-pulse pointer-events-none"}),n.jsxs("div",{className:"bg-white rounded-[4rem] p-10 lg:p-16 max-w-2xl w-full shadow-2xl text-center relative z-10 border border-slate-800/10 animate-in zoom-in duration-500",children:[n.jsx("div",{className:"relative mb-10",children:n.jsx("div",{className:"w-24 h-24 bg-orange-100 text-orange-600 rounded-[2rem] flex items-center justify-center mx-auto shadow-xl shadow-orange-200 relative z-10",children:n.jsx(Kr,{className:"text-orange-600 animate-[pulse_2s_infinite]",size:48})})}),n.jsxs("h1",{className:"text-3xl lg:text-4xl font-black text-slate-900 tracking-tighter leading-tight mb-6",children:["Fallo Eléctrico ",n.jsx("br",{}),n.jsx("span",{className:"text-orange-600 font-black italic uppercase",children:"Modo de Emergencia"})]}),n.jsxs("div",{className:"bg-orange-50/55 border border-orange-100 p-8 rounded-[3rem] space-y-4 mb-10 text-center",children:[n.jsx("p",{className:"text-orange-950 font-black text-lg leading-relaxed uppercase tracking-tight",children:"Sin conexión a la base de datos por fallo eléctrico local"}),n.jsx("p",{className:"text-slate-500 font-semibold text-xs leading-relaxed uppercase",children:"El suministro de fluido eléctrico en la estación central de datos ha sido suspendido temporalmente. Por seguridad e integridad de la información, el acceso se encuentra retenido."})]}),n.jsx("div",{className:"flex flex-col sm:flex-row justify-center items-center gap-8",children:n.jsxs("button",{onClick:e,className:"text-slate-400 font-extrabold text-[11px] uppercase tracking-widest hover:text-slate-950 transition-colors flex items-center gap-2",children:[n.jsx(Wf,{size:16})," Salir del Portal"]})}),n.jsxs("div",{className:"absolute bottom-6 right-10 flex items-center gap-2 pointer-events-none",children:[n.jsx("span",{className:"text-[8px] font-black text-slate-300 uppercase tracking-widest",children:"SAC KERNEL V4.2.11 Emergency Mode"}),n.jsx("div",{className:"w-1.5 h-1.5 bg-orange-500 rounded-full animate-ping"})]})]})]}),Uz=document.getElementById("root");if(!Uz)throw new Error("Could not find root element to mount to");const gFe=rV.createRoot(Uz);gFe.render(n.jsx(Ip.StrictMode,{children:n.jsx(wq,{children:n.jsx(pFe,{})})}));
