var L7=Object.defineProperty;var Q7=(e,t,r)=>t in e?L7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Fy=(e,t,r)=>Q7(e,typeof t!="symbol"?t+"":t,r);function H7(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 El(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dy={exports:{}},K0={};/**
 * @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 U_;function z7(){if(U_)return K0;U_=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 K0.Fragment=t,K0.jsx=r,K0.jsxs=r,K0}var M_;function $7(){return M_||(M_=1,Dy.exports=z7()),Dy.exports}var n=$7(),Uy={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 R_;function V7(){if(R_)return Bt;R_=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"),x=Symbol.iterator;function m(R){return R===null||typeof R!="object"?null:(R=x&&R[x]||R["@@iterator"],typeof R=="function"?R:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,y={};function k(R,O,q){this.props=R,this.context=O,this.refs=y,this.updater=q||b}k.prototype.isReactComponent={},k.prototype.setState=function(R,O){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,O,"setState")},k.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function _(){}_.prototype=k.prototype;function C(R,O,q){this.props=R,this.context=O,this.refs=y,this.updater=q||b}var E=C.prototype=new _;E.constructor=C,v(E,k.prototype),E.isPureReactComponent=!0;var T=Array.isArray;function B(){}var F={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function U(R,O,q){var z=q.ref;return{$$typeof:e,type:R,key:O,ref:z!==void 0?z:null,props:q}}function D(R,O){return U(R.type,O,R.props)}function L(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function P(R){var O={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(q){return O[q]})}var G=/\/+/g;function H(R,O){return typeof R=="object"&&R!==null&&R.key!=null?P(""+R.key):O.toString(36)}function Q(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(B,B):(R.status="pending",R.then(function(O){R.status==="pending"&&(R.status="fulfilled",R.value=O)},function(O){R.status==="pending"&&(R.status="rejected",R.reason=O)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function Y(R,O,q,z,X){var re=typeof R;(re==="undefined"||re==="boolean")&&(R=null);var le=!1;if(R===null)le=!0;else switch(re){case"bigint":case"string":case"number":le=!0;break;case"object":switch(R.$$typeof){case e:case t:le=!0;break;case f:return le=R._init,Y(le(R._payload),O,q,z,X)}}if(le)return X=X(R),le=z===""?"."+H(R,0):z,T(X)?(q="",le!=null&&(q=le.replace(G,"$&/")+"/"),Y(X,O,q,"",function(ie){return ie})):X!=null&&(L(X)&&(X=D(X,q+(X.key==null||R&&R.key===X.key?"":(""+X.key).replace(G,"$&/")+"/")+le)),O.push(X)),1;le=0;var ne=z===""?".":z+":";if(T(R))for(var ae=0;ae<R.length;ae++)z=R[ae],re=ne+H(z,ae),le+=Y(z,O,q,re,X);else if(ae=m(R),typeof ae=="function")for(R=ae.call(R),ae=0;!(z=R.next()).done;)z=z.value,re=ne+H(z,ae++),le+=Y(z,O,q,re,X);else if(re==="object"){if(typeof R.then=="function")return Y(Q(R),O,q,z,X);throw O=String(R),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return le}function K(R,O,q){if(R==null)return R;var z=[],X=0;return Y(R,z,"","",function(re){return O.call(q,re,X++)}),z}function ee(R){if(R._status===-1){var O=R._result;O=O(),O.then(function(q){(R._status===0||R._status===-1)&&(R._status=1,R._result=q)},function(q){(R._status===0||R._status===-1)&&(R._status=2,R._result=q)}),R._status===-1&&(R._status=0,R._result=O)}if(R._status===1)return R._result.default;throw R._result}var J=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},W={map:K,forEach:function(R,O,q){K(R,function(){O.apply(this,arguments)},q)},count:function(R){var O=0;return K(R,function(){O++}),O},toArray:function(R){return K(R,function(O){return O})||[]},only:function(R){if(!L(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Bt.Activity=p,Bt.Children=W,Bt.Component=k,Bt.Fragment=r,Bt.Profiler=s,Bt.PureComponent=C,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(R){return F.H.useMemoCache(R)}},Bt.cache=function(R){return function(){return R.apply(null,arguments)}},Bt.cacheSignal=function(){return null},Bt.cloneElement=function(R,O,q){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var z=v({},R.props),X=R.key;if(O!=null)for(re in O.key!==void 0&&(X=""+O.key),O)!M.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(R.type,X,z)},Bt.createContext=function(R){return R={$$typeof:l,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:i,_context:R},R},Bt.createElement=function(R,O,q){var z,X={},re=null;if(O!=null)for(z in O.key!==void 0&&(re=""+O.key),O)M.call(O,z)&&z!=="key"&&z!=="__self"&&z!=="__source"&&(X[z]=O[z]);var le=arguments.length-2;if(le===1)X.children=q;else if(1<le){for(var ne=Array(le),ae=0;ae<le;ae++)ne[ae]=arguments[ae+2];X.children=ne}if(R&&R.defaultProps)for(z in le=R.defaultProps,le)X[z]===void 0&&(X[z]=le[z]);return U(R,re,X)},Bt.createRef=function(){return{current:null}},Bt.forwardRef=function(R){return{$$typeof:o,render:R}},Bt.isValidElement=L,Bt.lazy=function(R){return{$$typeof:f,_payload:{_status:-1,_result:R},_init:ee}},Bt.memo=function(R,O){return{$$typeof:u,type:R,compare:O===void 0?null:O}},Bt.startTransition=function(R){var O=F.T,q={};F.T=q;try{var z=R(),X=F.S;X!==null&&X(q,z),typeof z=="object"&&z!==null&&typeof z.then=="function"&&z.then(B,J)}catch(re){J(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(R){return F.H.use(R)},Bt.useActionState=function(R,O,q){return F.H.useActionState(R,O,q)},Bt.useCallback=function(R,O){return F.H.useCallback(R,O)},Bt.useContext=function(R){return F.H.useContext(R)},Bt.useDebugValue=function(){},Bt.useDeferredValue=function(R,O){return F.H.useDeferredValue(R,O)},Bt.useEffect=function(R,O){return F.H.useEffect(R,O)},Bt.useEffectEvent=function(R){return F.H.useEffectEvent(R)},Bt.useId=function(){return F.H.useId()},Bt.useImperativeHandle=function(R,O,q){return F.H.useImperativeHandle(R,O,q)},Bt.useInsertionEffect=function(R,O){return F.H.useInsertionEffect(R,O)},Bt.useLayoutEffect=function(R,O){return F.H.useLayoutEffect(R,O)},Bt.useMemo=function(R,O){return F.H.useMemo(R,O)},Bt.useOptimistic=function(R,O){return F.H.useOptimistic(R,O)},Bt.useReducer=function(R,O,q){return F.H.useReducer(R,O,q)},Bt.useRef=function(R){return F.H.useRef(R)},Bt.useState=function(R){return F.H.useState(R)},Bt.useSyncExternalStore=function(R,O,q){return F.H.useSyncExternalStore(R,O,q)},Bt.useTransition=function(){return F.H.useTransition()},Bt.version="19.2.4",Bt}var O_;function RA(){return O_||(O_=1,Uy.exports=V7()),Uy.exports}var j=RA();const Tp=El(j),G7=H7({__proto__:null,default:Tp},[j]);var My={exports:{}},q0={},Ry={exports:{}},Oy={};/**
 * @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 P_;function K7(){return P_||(P_=1,(function(e){function t(Y,K){var ee=Y.length;Y.push(K);e:for(;0<ee;){var J=ee-1>>>1,W=Y[J];if(0<s(W,K))Y[J]=K,Y[ee]=W,ee=J;else break e}}function r(Y){return Y.length===0?null:Y[0]}function a(Y){if(Y.length===0)return null;var K=Y[0],ee=Y.pop();if(ee!==K){Y[0]=ee;e:for(var J=0,W=Y.length,R=W>>>1;J<R;){var O=2*(J+1)-1,q=Y[O],z=O+1,X=Y[z];if(0>s(q,ee))z<W&&0>s(X,q)?(Y[J]=X,Y[z]=ee,J=z):(Y[J]=q,Y[O]=ee,J=O);else if(z<W&&0>s(X,ee))Y[J]=X,Y[z]=ee,J=z;else break e}}return K}function s(Y,K){var ee=Y.sortIndex-K.sortIndex;return ee!==0?ee:Y.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,x=3,m=!1,b=!1,v=!1,y=!1,k=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function E(Y){for(var K=r(u);K!==null;){if(K.callback===null)a(u);else if(K.startTime<=Y)a(u),K.sortIndex=K.expirationTime,t(d,K);else break;K=r(u)}}function T(Y){if(v=!1,E(Y),!b)if(r(d)!==null)b=!0,B||(B=!0,P());else{var K=r(u);K!==null&&Q(T,K.startTime-Y)}}var B=!1,F=-1,M=5,U=-1;function D(){return y?!0:!(e.unstable_now()-U<M)}function L(){if(y=!1,B){var Y=e.unstable_now();U=Y;var K=!0;try{e:{b=!1,v&&(v=!1,_(F),F=-1),m=!0;var ee=x;try{t:{for(E(Y),p=r(d);p!==null&&!(p.expirationTime>Y&&D());){var J=p.callback;if(typeof J=="function"){p.callback=null,x=p.priorityLevel;var W=J(p.expirationTime<=Y);if(Y=e.unstable_now(),typeof W=="function"){p.callback=W,E(Y),K=!0;break t}p===r(d)&&a(d),E(Y)}else a(d);p=r(d)}if(p!==null)K=!0;else{var R=r(u);R!==null&&Q(T,R.startTime-Y),K=!1}}break e}finally{p=null,x=ee,m=!1}K=void 0}}finally{K?P():B=!1}}}var P;if(typeof C=="function")P=function(){C(L)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,H=G.port2;G.port1.onmessage=L,P=function(){H.postMessage(null)}}else P=function(){k(L,0)};function Q(Y,K){F=k(function(){Y(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(Y){Y.callback=null},e.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<Y?Math.floor(1e3/Y):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(Y){switch(x){case 1:case 2:case 3:var K=3;break;default:K=x}var ee=x;x=K;try{return Y()}finally{x=ee}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(Y,K){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var ee=x;x=Y;try{return K()}finally{x=ee}},e.unstable_scheduleCallback=function(Y,K,ee){var J=e.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?J+ee:J):ee=J,Y){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=ee+W,Y={id:f++,callback:K,priorityLevel:Y,startTime:ee,expirationTime:W,sortIndex:-1},ee>J?(Y.sortIndex=ee,t(u,Y),r(d)===null&&Y===r(u)&&(v?(_(F),F=-1):v=!0,Q(T,ee-J))):(Y.sortIndex=W,t(d,Y),b||m||(b=!0,B||(B=!0,P()))),Y},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(Y){var K=x;return function(){var ee=x;x=K;try{return Y.apply(this,arguments)}finally{x=ee}}}})(Oy)),Oy}var L_;function q7(){return L_||(L_=1,Ry.exports=K7()),Ry.exports}var Py={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 Q_;function W7(){if(Q_)return Bn;Q_=1;var e=RA();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),x=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:x,fetchPriority:m}):f==="script"&&a.d.X(d,{crossOrigin:p,integrity:x,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 H_;function yM(){if(H_)return Py.exports;H_=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(),Py.exports=W7(),Py.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 z_;function Y7(){if(z_)return q0;z_=1;var e=q7(),t=RA(),r=yM();function a(c){var A="https://react.dev/errors/"+c;if(1<arguments.length){A+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)A+="&args[]="+encodeURIComponent(arguments[h])}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,h=c;if(c.alternate)for(;A.return;)A=A.return;else{c=A;do A=c,(A.flags&4098)!==0&&(h=A.return),c=A.return;while(c)}return A.tag===3?h: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 h=c,g=A;;){var S=h.return;if(S===null)break;var I=S.alternate;if(I===null){if(g=S.return,g!==null){h=g;continue}break}if(S.child===I.child){for(I=S.child;I;){if(I===h)return d(S),c;if(I===g)return d(S),A;I=I.sibling}throw Error(a(188))}if(h.return!==g.return)h=S,g=I;else{for(var V=!1,se=S.child;se;){if(se===h){V=!0,h=S,g=I;break}if(se===g){V=!0,g=S,h=I;break}se=se.sibling}if(!V){for(se=I.child;se;){if(se===h){V=!0,h=I,g=S;break}if(se===g){V=!0,g=I,h=S;break}se=se.sibling}if(!V)throw Error(a(189))}}if(h.alternate!==g)throw Error(a(190))}if(h.tag!==3)throw Error(a(188));return h.stateNode.current===h?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,x=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"),k=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),C=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"),M=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 H(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 k: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 C: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:H(c.type)||"Memo";case M:A=c._payload,c=c._init;try{return H(c(A))}catch{}}return null}var Q=Array.isArray,Y=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},J=[],W=-1;function R(c){return{current:c}}function O(c){0>W||(c.current=J[W],J[W]=null,W--)}function q(c,A){W++,J[W]=c.current,c.current=A}var z=R(null),X=R(null),re=R(null),le=R(null);function ne(c,A){switch(q(re,A),q(X,c),q(z,null),A.nodeType){case 9:case 11:c=(c=A.documentElement)&&(c=c.namespaceURI)?n_(c):0;break;default:if(c=A.tagName,A=A.namespaceURI)A=n_(A),c=s_(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(X),O(re)}function ie(c){c.memoizedState!==null&&q(le,c);var A=z.current,h=s_(A,c.type);A!==h&&(q(X,c),q(z,h))}function he(c){X.current===c&&(O(z),O(X)),le.current===c&&(O(le),z0._currentValue=ee)}var Z,Ue;function Ie(c){if(Z===void 0)try{throw Error()}catch(h){var A=h.stack.trim().match(/\n( *(at )?)/);Z=A&&A[1]||"",Ue=-1<h.stack.indexOf(`
    at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Z+c+Ue}var be=!1;function je(c,A){if(!c||be)return"";be=!0;var h=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 Be=Fe}Reflect.construct(c,[],Qe)}else{try{Qe.call()}catch(Fe){Be=Fe}c.call(Qe.prototype)}}else{try{throw Error()}catch(Fe){Be=Fe}(Qe=c())&&typeof Qe.catch=="function"&&Qe.catch(function(){})}}catch(Fe){if(Fe&&Be&&typeof Fe.stack=="string")return[Fe.stack,Be.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 pe=V.split(`
`),ke=se.split(`
`);for(S=g=0;g<pe.length&&!pe[g].includes("DetermineComponentFrameRoot");)g++;for(;S<ke.length&&!ke[S].includes("DetermineComponentFrameRoot");)S++;if(g===pe.length||S===ke.length)for(g=pe.length-1,S=ke.length-1;1<=g&&0<=S&&pe[g]!==ke[S];)S--;for(;1<=g&&0<=S;g--,S--)if(pe[g]!==ke[S]){if(g!==1||S!==1)do if(g--,S--,0>S||pe[g]!==ke[S]){var Pe=`
`+pe[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{be=!1,Error.prepareStackTrace=h}return(h=c?c.displayName||c.name:"")?Ie(h):""}function fe(c,A){switch(c.tag){case 26:case 27:case 5:return Ie(c.type);case 16:return Ie("Lazy");case 13:return c.child!==A&&A!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return je(c.type,!1);case 11:return je(c.type.render,!1);case 1:return je(c.type,!0);case 31:return Ie("Activity");default:return""}}function Me(c){try{var A="",h=null;do A+=fe(c,h),h=c,c=c.return;while(c);return A}catch(g){return`
Error generating stack: `+g.message+`
`+g.stack}}var Xe=Object.prototype.hasOwnProperty,it=e.unstable_scheduleCallback,at=e.unstable_cancelCallback,Ct=e.unstable_shouldYield,kt=e.unstable_requestPaint,ft=e.unstable_now,Br=e.unstable_getCurrentPriorityLevel,Ar=e.unstable_ImmediatePriority,fa=e.unstable_UserBlockingPriority,Ut=e.unstable_NormalPriority,_r=e.unstable_LowPriority,st=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 Nr=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,h){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):h||(h=se&~c,h!==0&&(S=dn(h))))):(se=g&~I,se!==0?S=dn(se):V!==0?S=dn(V):h||(h=g&~c,h!==0&&(S=dn(h)))),S===0?0:A!==0&&A!==S&&(A&I)===0&&(I=S&-S,h=A&-A,I>=h||I===32&&(h&4194048)!==0)?A:S}function _i(c,A){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&A)===0}function qc(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 Po(){var c=ta;return ta<<=1,(ta&62914560)===0&&(ta=4194304),c}function Dl(c){for(var A=[],h=0;31>h;h++)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,h,g,S,I){var V=c.pendingLanes;c.pendingLanes=h,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=h,c.entangledLanes&=h,c.errorRecoveryDisabledLanes&=h,c.shellSuspendCounter=0;var se=c.entanglements,pe=c.expirationTimes,ke=c.hiddenUpdates;for(h=V&~h;0<h;){var Pe=31-Nr(h),Qe=1<<Pe;se[Pe]=0,pe[Pe]=-1;var Be=ke[Pe];if(Be!==null)for(ke[Pe]=null,Pe=0;Pe<Be.length;Pe++){var Fe=Be[Pe];Fe!==null&&(Fe.lane&=-536870913)}h&=~Qe}g!==0&&ra(c,g,0),I!==0&&S===0&&c.tag!==0&&(c.suspendedLanes|=I&~(V&~A))}function ra(c,A,h){c.pendingLanes|=A,c.suspendedLanes&=~A;var g=31-Nr(A);c.entangledLanes|=A,c.entanglements[g]=c.entanglements[g]|1073741824|h&261930}function Ma(c,A){var h=c.entangledLanes|=A;for(c=c.entanglements;h;){var g=31-Nr(h),S=1<<g;S&A|c[g]&A&&(c[g]|=A),h&=~S}}function me(c,A){var h=A&-A;return h=(h&42)!==0?1:We(h),(h&(c.suspendedLanes|A))!==0?0:h}function We(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:S_(c.type))}function de(c,A){var h=K.p;try{return K.p=c,A()}finally{K.p=h}}var oe=Math.random().toString(36).slice(2),ce="__reactFiber$"+oe,ue="__reactProps$"+oe,Ae="__reactContainer$"+oe,we="__reactEvents$"+oe,Re="__reactListeners$"+oe,Ne="__reactHandles$"+oe,Ee="__reactResources$"+oe,Se="__reactMarker$"+oe;function ze(c){delete c[ce],delete c[ue],delete c[we],delete c[Re],delete c[Ne]}function Ke(c){var A=c[ce];if(A)return A;for(var h=c.parentNode;h;){if(A=h[Ae]||h[ce]){if(h=A.alternate,A.child!==null||h!==null&&h.child!==null)for(c=A_(c);c!==null;){if(h=c[ce])return h;c=A_(c)}return A}c=h,h=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[Ee];return A||(A=c[Ee]={hoistableStyles:new Map,hoistableScripts:new Map}),A}function dt(c){c[Se]=!0}var Cr=new Set,kr={};function Qr(c,A){Gs(c,A),Gs(c+"Capture",A)}function Gs(c,A){for(kr[c]=A,c=0;c<A.length;c++)Cr.add(A[c])}var Wc=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]*$"),Lo={},tl={};function s0(c){return Xe.call(tl,c)?!0:Xe.call(Lo,c)?!1:Wc.test(c)?tl[c]=!0:(Lo[c]=!0,!1)}function as(c,A,h){if(s0(A))if(h===null)c.removeAttribute(A);else{switch(typeof h){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,""+h)}}function ch(c,A,h){if(h===null)c.removeAttribute(A);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(A);return}c.setAttribute(A,""+h)}}function Ul(c,A,h,g){if(g===null)c.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(h);return}c.setAttributeNS(A,h,""+g)}}function Ks(c){switch(typeof c){case"bigint":case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function YE(c){var A=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(A==="checkbox"||A==="radio")}function Fz(c,A,h){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){h=""+V,I.call(this,V)}}),Object.defineProperty(c,A,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(V){h=""+V},stopTracking:function(){c._valueTracker=null,delete c[A]}}}}function jv(c){if(!c._valueTracker){var A=YE(c)?"checked":"value";c._valueTracker=Fz(c,A,""+c[A])}}function XE(c){if(!c)return!1;var A=c._valueTracker;if(!A)return!0;var h=A.getValue(),g="";return c&&(g=YE(c)?c.checked?"true":"false":c.value),c=g,c!==h?(A.setValue(c),!0):!1}function dh(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 Dz=/[\n"\\]/g;function qs(c){return c.replace(Dz,function(A){return"\\"+A.charCodeAt(0).toString(16)+" "})}function Ev(c,A,h,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=""+Ks(A)):c.value!==""+Ks(A)&&(c.value=""+Ks(A)):V!=="submit"&&V!=="reset"||c.removeAttribute("value"),A!=null?Sv(c,V,Ks(A)):h!=null?Sv(c,V,Ks(h)):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=""+Ks(se):c.removeAttribute("name")}function JE(c,A,h,g,S,I,V,se){if(I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(c.type=I),A!=null||h!=null){if(!(I!=="submit"&&I!=="reset"||A!=null)){jv(c);return}h=h!=null?""+Ks(h):"",A=A!=null?""+Ks(A):h,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),jv(c)}function Sv(c,A,h){A==="number"&&dh(c.ownerDocument)===c||c.defaultValue===""+h||(c.defaultValue=""+h)}function du(c,A,h,g){if(c=c.options,A){A={};for(var S=0;S<h.length;S++)A["$"+h[S]]=!0;for(h=0;h<c.length;h++)S=A.hasOwnProperty("$"+c[h].value),c[h].selected!==S&&(c[h].selected=S),S&&g&&(c[h].defaultSelected=!0)}else{for(h=""+Ks(h),A=null,S=0;S<c.length;S++){if(c[S].value===h){c[S].selected=!0,g&&(c[S].defaultSelected=!0);return}A!==null||c[S].disabled||(A=c[S])}A!==null&&(A.selected=!0)}}function ZE(c,A,h){if(A!=null&&(A=""+Ks(A),A!==c.value&&(c.value=A),h==null)){c.defaultValue!==A&&(c.defaultValue=A);return}c.defaultValue=h!=null?""+Ks(h):""}function eS(c,A,h,g){if(A==null){if(g!=null){if(h!=null)throw Error(a(92));if(Q(g)){if(1<g.length)throw Error(a(93));g=g[0]}h=g}h==null&&(h=""),A=h}h=Ks(A),c.defaultValue=h,g=c.textContent,g===h&&g!==""&&g!==null&&(c.value=g),jv(c)}function uu(c,A){if(A){var h=c.firstChild;if(h&&h===c.lastChild&&h.nodeType===3){h.nodeValue=A;return}}c.textContent=A}var Uz=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 tS(c,A,h){var g=A.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?c.setProperty(A,""):A==="float"?c.cssFloat="":c[A]="":g?c.setProperty(A,h):typeof h!="number"||h===0||Uz.has(A)?A==="float"?c.cssFloat=h:c[A]=(""+h).trim():c[A]=h+"px"}function rS(c,A,h){if(A!=null&&typeof A!="object")throw Error(a(62));if(c=c.style,h!=null){for(var g in h)!h.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)&&h[S]!==g&&tS(c,S,g)}else for(var I in A)A.hasOwnProperty(I)&&tS(c,I,A[I])}function Bv(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 Mz=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"]]),Rz=/^[\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 uh(c){return Rz.test(""+c)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":c}function Ml(){}var _v=null;function Tv(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var Au=null,fu=null;function aS(c){var A=Ze(c);if(A&&(c=A.stateNode)){var h=c[ue]||null;e:switch(c=A.stateNode,A.type){case"input":if(Ev(c,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),A=h.name,h.type==="radio"&&A!=null){for(h=c;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+qs(""+A)+'"][type="radio"]'),A=0;A<h.length;A++){var g=h[A];if(g!==c&&g.form===c.form){var S=g[ue]||null;if(!S)throw Error(a(90));Ev(g,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(A=0;A<h.length;A++)g=h[A],g.form===c.form&&XE(g)}break e;case"textarea":ZE(c,h.value,h.defaultValue);break e;case"select":A=h.value,A!=null&&du(c,!!h.multiple,A,!1)}}}var Iv=!1;function nS(c,A,h){if(Iv)return c(A,h);Iv=!0;try{var g=c(A);return g}finally{if(Iv=!1,(Au!==null||fu!==null)&&(Jh(),Au&&(A=Au,c=fu,fu=Au=null,aS(A),c)))for(A=0;A<c.length;A++)aS(c[A])}}function i0(c,A){var h=c.stateNode;if(h===null)return null;var g=h[ue]||null;if(g===null)return null;h=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(h&&typeof h!="function")throw Error(a(231,A,typeof h));return h}var Rl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fv=!1;if(Rl)try{var l0={};Object.defineProperty(l0,"passive",{get:function(){Fv=!0}}),window.addEventListener("test",l0,l0),window.removeEventListener("test",l0,l0)}catch{Fv=!1}var Qo=null,Dv=null,Ah=null;function sS(){if(Ah)return Ah;var c,A=Dv,h=A.length,g,S="value"in Qo?Qo.value:Qo.textContent,I=S.length;for(c=0;c<h&&A[c]===S[c];c++);var V=h-c;for(g=1;g<=V&&A[h-g]===S[I-g];g++);return Ah=S.slice(c,1<g?1-g:void 0)}function fh(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 ph(){return!0}function iS(){return!1}function ns(c){function A(h,g,S,I,V){this._reactName=h,this._targetInst=S,this.type=g,this.nativeEvent=I,this.target=V,this.currentTarget=null;for(var se in c)c.hasOwnProperty(se)&&(h=c[se],this[se]=h?h(I):I[se]);return this.isDefaultPrevented=(I.defaultPrevented!=null?I.defaultPrevented:I.returnValue===!1)?ph:iS,this.isPropagationStopped=iS,this}return p(A.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=ph)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=ph)},persist:function(){},isPersistent:ph}),A}var Yc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hh=ns(Yc),o0=p({},Yc,{view:0,detail:0}),Oz=ns(o0),Uv,Mv,c0,xh=p({},o0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ov,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!==c0&&(c0&&c.type==="mousemove"?(Uv=c.screenX-c0.screenX,Mv=c.screenY-c0.screenY):Mv=Uv=0,c0=c),Uv)},movementY:function(c){return"movementY"in c?c.movementY:Mv}}),lS=ns(xh),Pz=p({},xh,{dataTransfer:0}),Lz=ns(Pz),Qz=p({},o0,{relatedTarget:0}),Rv=ns(Qz),Hz=p({},Yc,{animationName:0,elapsedTime:0,pseudoElement:0}),zz=ns(Hz),$z=p({},Yc,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),Vz=ns($z),Gz=p({},Yc,{data:0}),oS=ns(Gz),Kz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qz={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"},Wz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yz(c){var A=this.nativeEvent;return A.getModifierState?A.getModifierState(c):(c=Wz[c])?!!A[c]:!1}function Ov(){return Yz}var Xz=p({},o0,{key:function(c){if(c.key){var A=Kz[c.key]||c.key;if(A!=="Unidentified")return A}return c.type==="keypress"?(c=fh(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?qz[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ov,charCode:function(c){return c.type==="keypress"?fh(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?fh(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),Jz=ns(Xz),Zz=p({},xh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cS=ns(Zz),e$=p({},o0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ov}),t$=ns(e$),r$=p({},Yc,{propertyName:0,elapsedTime:0,pseudoElement:0}),a$=ns(r$),n$=p({},xh,{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}),s$=ns(n$),i$=p({},Yc,{newState:0,oldState:0}),l$=ns(i$),o$=[9,13,27,32],Pv=Rl&&"CompositionEvent"in window,d0=null;Rl&&"documentMode"in document&&(d0=document.documentMode);var c$=Rl&&"TextEvent"in window&&!d0,dS=Rl&&(!Pv||d0&&8<d0&&11>=d0),uS=" ",AS=!1;function fS(c,A){switch(c){case"keyup":return o$.indexOf(A.keyCode)!==-1;case"keydown":return A.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pS(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var pu=!1;function d$(c,A){switch(c){case"compositionend":return pS(A);case"keypress":return A.which!==32?null:(AS=!0,uS);case"textInput":return c=A.data,c===uS&&AS?null:c;default:return null}}function u$(c,A){if(pu)return c==="compositionend"||!Pv&&fS(c,A)?(c=sS(),Ah=Dv=Qo=null,pu=!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 dS&&A.locale!=="ko"?null:A.data;default:return null}}var A$={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 hS(c){var A=c&&c.nodeName&&c.nodeName.toLowerCase();return A==="input"?!!A$[c.type]:A==="textarea"}function xS(c,A,h,g){Au?fu?fu.push(g):fu=[g]:Au=g,A=sx(A,"onChange"),0<A.length&&(h=new hh("onChange","change",null,h,g),c.push({event:h,listeners:A}))}var u0=null,A0=null;function f$(c){JB(c,0)}function mh(c){var A=$e(c);if(XE(A))return c}function mS(c,A){if(c==="change")return A}var gS=!1;if(Rl){var Lv;if(Rl){var Qv="oninput"in document;if(!Qv){var bS=document.createElement("div");bS.setAttribute("oninput","return;"),Qv=typeof bS.oninput=="function"}Lv=Qv}else Lv=!1;gS=Lv&&(!document.documentMode||9<document.documentMode)}function vS(){u0&&(u0.detachEvent("onpropertychange",yS),A0=u0=null)}function yS(c){if(c.propertyName==="value"&&mh(A0)){var A=[];xS(A,A0,c,Tv(c)),nS(f$,A)}}function p$(c,A,h){c==="focusin"?(vS(),u0=A,A0=h,u0.attachEvent("onpropertychange",yS)):c==="focusout"&&vS()}function h$(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return mh(A0)}function x$(c,A){if(c==="click")return mh(A)}function m$(c,A){if(c==="input"||c==="change")return mh(A)}function g$(c,A){return c===A&&(c!==0||1/c===1/A)||c!==c&&A!==A}var js=typeof Object.is=="function"?Object.is:g$;function f0(c,A){if(js(c,A))return!0;if(typeof c!="object"||c===null||typeof A!="object"||A===null)return!1;var h=Object.keys(c),g=Object.keys(A);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var S=h[g];if(!Xe.call(A,S)||!js(c[S],A[S]))return!1}return!0}function wS(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function NS(c,A){var h=wS(c);c=0;for(var g;h;){if(h.nodeType===3){if(g=c+h.textContent.length,c<=A&&g>=A)return{node:h,offset:A-c};c=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=wS(h)}}function CS(c,A){return c&&A?c===A?!0:c&&c.nodeType===3?!1:A&&A.nodeType===3?CS(c,A.parentNode):"contains"in c?c.contains(A):c.compareDocumentPosition?!!(c.compareDocumentPosition(A)&16):!1:!1}function kS(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var A=dh(c.document);A instanceof c.HTMLIFrameElement;){try{var h=typeof A.contentWindow.location.href=="string"}catch{h=!1}if(h)c=A.contentWindow;else break;A=dh(c.document)}return A}function Hv(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 b$=Rl&&"documentMode"in document&&11>=document.documentMode,hu=null,zv=null,p0=null,$v=!1;function jS(c,A,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;$v||hu==null||hu!==dh(g)||(g=hu,"selectionStart"in g&&Hv(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}),p0&&f0(p0,g)||(p0=g,g=sx(zv,"onSelect"),0<g.length&&(A=new hh("onSelect","select",null,A,h),c.push({event:A,listeners:g}),A.target=hu)))}function Xc(c,A){var h={};return h[c.toLowerCase()]=A.toLowerCase(),h["Webkit"+c]="webkit"+A,h["Moz"+c]="moz"+A,h}var xu={animationend:Xc("Animation","AnimationEnd"),animationiteration:Xc("Animation","AnimationIteration"),animationstart:Xc("Animation","AnimationStart"),transitionrun:Xc("Transition","TransitionRun"),transitionstart:Xc("Transition","TransitionStart"),transitioncancel:Xc("Transition","TransitionCancel"),transitionend:Xc("Transition","TransitionEnd")},Vv={},ES={};Rl&&(ES=document.createElement("div").style,"AnimationEvent"in window||(delete xu.animationend.animation,delete xu.animationiteration.animation,delete xu.animationstart.animation),"TransitionEvent"in window||delete xu.transitionend.transition);function Jc(c){if(Vv[c])return Vv[c];if(!xu[c])return c;var A=xu[c],h;for(h in A)if(A.hasOwnProperty(h)&&h in ES)return Vv[c]=A[h];return c}var SS=Jc("animationend"),BS=Jc("animationiteration"),_S=Jc("animationstart"),v$=Jc("transitionrun"),y$=Jc("transitionstart"),w$=Jc("transitioncancel"),TS=Jc("transitionend"),IS=new Map,Gv="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(" ");Gv.push("scrollEnd");function Ti(c,A){IS.set(c,A),Qr(A,[c])}var gh=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)},Ws=[],mu=0,Kv=0;function bh(){for(var c=mu,A=Kv=mu=0;A<c;){var h=Ws[A];Ws[A++]=null;var g=Ws[A];Ws[A++]=null;var S=Ws[A];Ws[A++]=null;var I=Ws[A];if(Ws[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&&FS(h,S,I)}}function vh(c,A,h,g){Ws[mu++]=c,Ws[mu++]=A,Ws[mu++]=h,Ws[mu++]=g,Kv|=g,c.lanes|=g,c=c.alternate,c!==null&&(c.lanes|=g)}function qv(c,A,h,g){return vh(c,A,h,g),yh(c)}function Zc(c,A){return vh(c,null,null,A),yh(c)}function FS(c,A,h){c.lanes|=h;var g=c.alternate;g!==null&&(g.lanes|=h);for(var S=!1,I=c.return;I!==null;)I.childLanes|=h,g=I.alternate,g!==null&&(g.childLanes|=h),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-Nr(h),c=I.hiddenUpdates,g=c[S],g===null?c[S]=[A]:g.push(A),A.lane=h|536870912),I):null}function yh(c){if(50<M0)throw M0=0,ay=null,Error(a(185));for(var A=c.return;A!==null;)c=A,A=c.return;return c.tag===3?c.stateNode:null}var gu={};function N$(c,A,h,g){this.tag=c,this.key=h,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,h,g){return new N$(c,A,h,g)}function Wv(c){return c=c.prototype,!(!c||!c.isReactComponent)}function Ol(c,A){var h=c.alternate;return h===null?(h=Es(c.tag,A,c.key,c.mode),h.elementType=c.elementType,h.type=c.type,h.stateNode=c.stateNode,h.alternate=c,c.alternate=h):(h.pendingProps=A,h.type=c.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=c.flags&65011712,h.childLanes=c.childLanes,h.lanes=c.lanes,h.child=c.child,h.memoizedProps=c.memoizedProps,h.memoizedState=c.memoizedState,h.updateQueue=c.updateQueue,A=c.dependencies,h.dependencies=A===null?null:{lanes:A.lanes,firstContext:A.firstContext},h.sibling=c.sibling,h.index=c.index,h.ref=c.ref,h.refCleanup=c.refCleanup,h}function DS(c,A){c.flags&=65011714;var h=c.alternate;return h===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=h.childLanes,c.lanes=h.lanes,c.child=h.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=h.memoizedProps,c.memoizedState=h.memoizedState,c.updateQueue=h.updateQueue,c.type=h.type,A=h.dependencies,c.dependencies=A===null?null:{lanes:A.lanes,firstContext:A.firstContext}),c}function wh(c,A,h,g,S,I){var V=0;if(g=c,typeof c=="function")Wv(c)&&(V=1);else if(typeof c=="string")V=S7(c,h,z.current)?26:c==="html"||c==="head"||c==="body"?27:5;else e:switch(c){case U:return c=Es(31,h,A,S),c.elementType=U,c.lanes=I,c;case v:return ed(h.children,S,I,A);case y:V=8,S|=24;break;case k:return c=Es(12,h,A,S|2),c.elementType=k,c.lanes=I,c;case T:return c=Es(13,h,A,S),c.elementType=T,c.lanes=I,c;case B:return c=Es(19,h,A,S),c.elementType=B,c.lanes=I,c;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case C:V=10;break e;case _:V=9;break e;case E:V=11;break e;case F:V=14;break e;case M:V=16,g=null;break e}V=29,h=Error(a(130,c===null?"null":typeof c,"")),g=null}return A=Es(V,h,A,S),A.elementType=c,A.type=g,A.lanes=I,A}function ed(c,A,h,g){return c=Es(7,c,g,A),c.lanes=h,c}function Yv(c,A,h){return c=Es(6,c,null,A),c.lanes=h,c}function US(c){var A=Es(18,null,null,0);return A.stateNode=c,A}function Xv(c,A,h){return A=Es(4,c.children!==null?c.children:[],c.key,A),A.lanes=h,A.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},A}var MS=new WeakMap;function Ys(c,A){if(typeof c=="object"&&c!==null){var h=MS.get(c);return h!==void 0?h:(A={value:c,source:A,stack:Me(A)},MS.set(c,A),A)}return{value:c,source:A,stack:Me(A)}}var bu=[],vu=0,Nh=null,h0=0,Xs=[],Js=0,Ho=null,rl=1,al="";function Pl(c,A){bu[vu++]=h0,bu[vu++]=Nh,Nh=c,h0=A}function RS(c,A,h){Xs[Js++]=rl,Xs[Js++]=al,Xs[Js++]=Ho,Ho=c;var g=rl;c=al;var S=32-Nr(g)-1;g&=~(1<<S),h+=1;var I=32-Nr(A)+S;if(30<I){var V=S-S%5;I=(g&(1<<V)-1).toString(32),g>>=V,S-=V,rl=1<<32-Nr(A)+S|h<<S|g,al=I+c}else rl=1<<I|h<<S|g,al=c}function Jv(c){c.return!==null&&(Pl(c,1),RS(c,1,0))}function Zv(c){for(;c===Nh;)Nh=bu[--vu],bu[vu]=null,h0=bu[--vu],bu[vu]=null;for(;c===Ho;)Ho=Xs[--Js],Xs[Js]=null,al=Xs[--Js],Xs[Js]=null,rl=Xs[--Js],Xs[Js]=null}function OS(c,A){Xs[Js++]=rl,Xs[Js++]=al,Xs[Js++]=Ho,rl=A.id,al=A.overflow,Ho=c}var un=null,Tr=null,qt=!1,zo=null,Zs=!1,e1=Error(a(519));function $o(c){var A=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw x0(Ys(A,c)),e1}function PS(c){var A=c.stateNode,h=c.type,g=c.memoizedProps;switch(A[ce]=c,A[ue]=g,h){case"dialog":Lt("cancel",A),Lt("close",A);break;case"iframe":case"object":case"embed":Lt("load",A);break;case"video":case"audio":for(h=0;h<O0.length;h++)Lt(O0[h],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),JE(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),eS(A,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||A.textContent===""+h||g.suppressHydrationWarning===!0||r_(A.textContent,h)?(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=Ml),A=!0):A=!1,A||$o(c,!0)}function LS(c){for(un=c.return;un;)switch(un.tag){case 5:case 31:case 13:Zs=!1;return;case 27:case 3:Zs=!0;return;default:un=un.return}}function yu(c){if(c!==un)return!1;if(!qt)return LS(c),qt=!0,!1;var A=c.tag,h;if((h=A!==3&&A!==27)&&((h=A===5)&&(h=c.type,h=!(h!=="form"&&h!=="button")||gy(c.type,c.memoizedProps)),h=!h),h&&Tr&&$o(c),LS(c),A===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));Tr=u_(c)}else if(A===31){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(a(317));Tr=u_(c)}else A===27?(A=Tr,nc(c.type)?(c=Ny,Ny=null,Tr=c):Tr=A):Tr=un?ti(c.stateNode.nextSibling):null;return!0}function td(){Tr=un=null,qt=!1}function t1(){var c=zo;return c!==null&&(os===null?os=c:os.push.apply(os,c),zo=null),c}function x0(c){zo===null?zo=[c]:zo.push(c)}var r1=R(null),rd=null,Ll=null;function Vo(c,A,h){q(r1,A._currentValue),A._currentValue=h}function Ql(c){c._currentValue=r1.current,O(r1)}function a1(c,A,h){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===h)break;c=c.return}}function n1(c,A,h,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 pe=0;pe<A.length;pe++)if(se.context===A[pe]){I.lanes|=h,se=I.alternate,se!==null&&(se.lanes|=h),a1(I.return,h,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|=h,I=V.alternate,I!==null&&(I.lanes|=h),a1(V,h,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 wu(c,A,h,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(z0):c=[z0])}S=S.return}c!==null&&n1(A,c,h,g),A.flags|=262144}function Ch(c){for(c=c.firstContext;c!==null;){if(!js(c.context._currentValue,c.memoizedValue))return!0;c=c.next}return!1}function ad(c){rd=c,Ll=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function An(c){return QS(rd,c)}function kh(c,A){return rd===null&&ad(c),QS(c,A)}function QS(c,A){var h=A._currentValue;if(A={context:A,memoizedValue:h,next:null},Ll===null){if(c===null)throw Error(a(308));Ll=A,c.dependencies={lanes:0,firstContext:A},c.flags|=524288}else Ll=Ll.next=A;return h}var C$=typeof AbortController<"u"?AbortController:function(){var c=[],A=this.signal={aborted:!1,addEventListener:function(h,g){c.push(g)}};this.abort=function(){A.aborted=!0,c.forEach(function(h){return h()})}},k$=e.unstable_scheduleCallback,j$=e.unstable_NormalPriority,Na={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function s1(){return{controller:new C$,data:new Map,refCount:0}}function m0(c){c.refCount--,c.refCount===0&&k$(j$,function(){c.controller.abort()})}var g0=null,i1=0,Nu=0,Cu=null;function E$(c,A){if(g0===null){var h=g0=[];i1=0,Nu=cy(),Cu={status:"pending",value:void 0,then:function(g){h.push(g)}}}return i1++,A.then(HS,HS),A}function HS(){if(--i1===0&&g0!==null){Cu!==null&&(Cu.status="fulfilled");var c=g0;g0=null,Nu=0,Cu=null;for(var A=0;A<c.length;A++)(0,c[A])()}}function S$(c,A){var h=[],g={status:"pending",value:null,reason:null,then:function(S){h.push(S)}};return c.then(function(){g.status="fulfilled",g.value=A;for(var S=0;S<h.length;S++)(0,h[S])(A)},function(S){for(g.status="rejected",g.reason=S,S=0;S<h.length;S++)(0,h[S])(void 0)}),g}var zS=Y.S;Y.S=function(c,A){jB=ft(),typeof A=="object"&&A!==null&&typeof A.then=="function"&&E$(c,A),zS!==null&&zS(c,A)};var nd=R(null);function l1(){var c=nd.current;return c!==null?c:vr.pooledCache}function jh(c,A){A===null?q(nd,nd.current):q(nd,A.pool)}function $S(){var c=l1();return c===null?null:{parent:Na._currentValue,pool:c}}var ku=Error(a(460)),o1=Error(a(474)),Eh=Error(a(542)),Sh={then:function(){}};function VS(c){return c=c.status,c==="fulfilled"||c==="rejected"}function GS(c,A,h){switch(h=c[h],h===void 0?c.push(A):h!==A&&(A.then(Ml,Ml),A=h),A.status){case"fulfilled":return A.value;case"rejected":throw c=A.reason,qS(c),c;default:if(typeof A.status=="string")A.then(Ml,Ml);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,qS(c),c}throw id=A,ku}}function sd(c){try{var A=c._init;return A(c._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(id=h,ku):h}}var id=null;function KS(){if(id===null)throw Error(a(459));var c=id;return id=null,c}function qS(c){if(c===ku||c===Eh)throw Error(a(483))}var ju=null,b0=0;function Bh(c){var A=b0;return b0+=1,ju===null&&(ju=[]),GS(ju,c,A)}function v0(c,A){A=A.props.ref,c.ref=A!==void 0?A:null}function _h(c,A){throw A.$$typeof===x?Error(a(525)):(c=Object.prototype.toString.call(A),Error(a(31,c==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":c)))}function WS(c){function A(ge,xe){if(c){var Ce=ge.deletions;Ce===null?(ge.deletions=[xe],ge.flags|=16):Ce.push(xe)}}function h(ge,xe){if(!c)return null;for(;xe!==null;)A(ge,xe),xe=xe.sibling;return null}function g(ge){for(var xe=new Map;ge!==null;)ge.key!==null?xe.set(ge.key,ge):xe.set(ge.index,ge),ge=ge.sibling;return xe}function S(ge,xe){return ge=Ol(ge,xe),ge.index=0,ge.sibling=null,ge}function I(ge,xe,Ce){return ge.index=Ce,c?(Ce=ge.alternate,Ce!==null?(Ce=Ce.index,Ce<xe?(ge.flags|=67108866,xe):Ce):(ge.flags|=67108866,xe)):(ge.flags|=1048576,xe)}function V(ge){return c&&ge.alternate===null&&(ge.flags|=67108866),ge}function se(ge,xe,Ce,Le){return xe===null||xe.tag!==6?(xe=Yv(Ce,ge.mode,Le),xe.return=ge,xe):(xe=S(xe,Ce),xe.return=ge,xe)}function pe(ge,xe,Ce,Le){var pt=Ce.type;return pt===v?Pe(ge,xe,Ce.props.children,Le,Ce.key):xe!==null&&(xe.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===M&&sd(pt)===xe.type)?(xe=S(xe,Ce.props),v0(xe,Ce),xe.return=ge,xe):(xe=wh(Ce.type,Ce.key,Ce.props,null,ge.mode,Le),v0(xe,Ce),xe.return=ge,xe)}function ke(ge,xe,Ce,Le){return xe===null||xe.tag!==4||xe.stateNode.containerInfo!==Ce.containerInfo||xe.stateNode.implementation!==Ce.implementation?(xe=Xv(Ce,ge.mode,Le),xe.return=ge,xe):(xe=S(xe,Ce.children||[]),xe.return=ge,xe)}function Pe(ge,xe,Ce,Le,pt){return xe===null||xe.tag!==7?(xe=ed(Ce,ge.mode,Le,pt),xe.return=ge,xe):(xe=S(xe,Ce),xe.return=ge,xe)}function Qe(ge,xe,Ce){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return xe=Yv(""+xe,ge.mode,Ce),xe.return=ge,xe;if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case m:return Ce=wh(xe.type,xe.key,xe.props,null,ge.mode,Ce),v0(Ce,xe),Ce.return=ge,Ce;case b:return xe=Xv(xe,ge.mode,Ce),xe.return=ge,xe;case M:return xe=sd(xe),Qe(ge,xe,Ce)}if(Q(xe)||P(xe))return xe=ed(xe,ge.mode,Ce,null),xe.return=ge,xe;if(typeof xe.then=="function")return Qe(ge,Bh(xe),Ce);if(xe.$$typeof===C)return Qe(ge,kh(ge,xe),Ce);_h(ge,xe)}return null}function Be(ge,xe,Ce,Le){var pt=xe!==null?xe.key:null;if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return pt!==null?null:se(ge,xe,""+Ce,Le);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case m:return Ce.key===pt?pe(ge,xe,Ce,Le):null;case b:return Ce.key===pt?ke(ge,xe,Ce,Le):null;case M:return Ce=sd(Ce),Be(ge,xe,Ce,Le)}if(Q(Ce)||P(Ce))return pt!==null?null:Pe(ge,xe,Ce,Le,null);if(typeof Ce.then=="function")return Be(ge,xe,Bh(Ce),Le);if(Ce.$$typeof===C)return Be(ge,xe,kh(ge,Ce),Le);_h(ge,Ce)}return null}function Fe(ge,xe,Ce,Le,pt){if(typeof Le=="string"&&Le!==""||typeof Le=="number"||typeof Le=="bigint")return ge=ge.get(Ce)||null,se(xe,ge,""+Le,pt);if(typeof Le=="object"&&Le!==null){switch(Le.$$typeof){case m:return ge=ge.get(Le.key===null?Ce:Le.key)||null,pe(xe,ge,Le,pt);case b:return ge=ge.get(Le.key===null?Ce:Le.key)||null,ke(xe,ge,Le,pt);case M:return Le=sd(Le),Fe(ge,xe,Ce,Le,pt)}if(Q(Le)||P(Le))return ge=ge.get(Ce)||null,Pe(xe,ge,Le,pt,null);if(typeof Le.then=="function")return Fe(ge,xe,Ce,Bh(Le),pt);if(Le.$$typeof===C)return Fe(ge,xe,Ce,kh(xe,Le),pt);_h(xe,Le)}return null}function ot(ge,xe,Ce,Le){for(var pt=null,Xt=null,ut=xe,Ft=xe=0,Ht=null;ut!==null&&Ft<Ce.length;Ft++){ut.index>Ft?(Ht=ut,ut=null):Ht=ut.sibling;var Jt=Be(ge,ut,Ce[Ft],Le);if(Jt===null){ut===null&&(ut=Ht);break}c&&ut&&Jt.alternate===null&&A(ge,ut),xe=I(Jt,xe,Ft),Xt===null?pt=Jt:Xt.sibling=Jt,Xt=Jt,ut=Ht}if(Ft===Ce.length)return h(ge,ut),qt&&Pl(ge,Ft),pt;if(ut===null){for(;Ft<Ce.length;Ft++)ut=Qe(ge,Ce[Ft],Le),ut!==null&&(xe=I(ut,xe,Ft),Xt===null?pt=ut:Xt.sibling=ut,Xt=ut);return qt&&Pl(ge,Ft),pt}for(ut=g(ut);Ft<Ce.length;Ft++)Ht=Fe(ut,ge,Ft,Ce[Ft],Le),Ht!==null&&(c&&Ht.alternate!==null&&ut.delete(Ht.key===null?Ft:Ht.key),xe=I(Ht,xe,Ft),Xt===null?pt=Ht:Xt.sibling=Ht,Xt=Ht);return c&&ut.forEach(function(cc){return A(ge,cc)}),qt&&Pl(ge,Ft),pt}function bt(ge,xe,Ce,Le){if(Ce==null)throw Error(a(151));for(var pt=null,Xt=null,ut=xe,Ft=xe=0,Ht=null,Jt=Ce.next();ut!==null&&!Jt.done;Ft++,Jt=Ce.next()){ut.index>Ft?(Ht=ut,ut=null):Ht=ut.sibling;var cc=Be(ge,ut,Jt.value,Le);if(cc===null){ut===null&&(ut=Ht);break}c&&ut&&cc.alternate===null&&A(ge,ut),xe=I(cc,xe,Ft),Xt===null?pt=cc:Xt.sibling=cc,Xt=cc,ut=Ht}if(Jt.done)return h(ge,ut),qt&&Pl(ge,Ft),pt;if(ut===null){for(;!Jt.done;Ft++,Jt=Ce.next())Jt=Qe(ge,Jt.value,Le),Jt!==null&&(xe=I(Jt,xe,Ft),Xt===null?pt=Jt:Xt.sibling=Jt,Xt=Jt);return qt&&Pl(ge,Ft),pt}for(ut=g(ut);!Jt.done;Ft++,Jt=Ce.next())Jt=Fe(ut,ge,Ft,Jt.value,Le),Jt!==null&&(c&&Jt.alternate!==null&&ut.delete(Jt.key===null?Ft:Jt.key),xe=I(Jt,xe,Ft),Xt===null?pt=Jt:Xt.sibling=Jt,Xt=Jt);return c&&ut.forEach(function(P7){return A(ge,P7)}),qt&&Pl(ge,Ft),pt}function xr(ge,xe,Ce,Le){if(typeof Ce=="object"&&Ce!==null&&Ce.type===v&&Ce.key===null&&(Ce=Ce.props.children),typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case m:e:{for(var pt=Ce.key;xe!==null;){if(xe.key===pt){if(pt=Ce.type,pt===v){if(xe.tag===7){h(ge,xe.sibling),Le=S(xe,Ce.props.children),Le.return=ge,ge=Le;break e}}else if(xe.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===M&&sd(pt)===xe.type){h(ge,xe.sibling),Le=S(xe,Ce.props),v0(Le,Ce),Le.return=ge,ge=Le;break e}h(ge,xe);break}else A(ge,xe);xe=xe.sibling}Ce.type===v?(Le=ed(Ce.props.children,ge.mode,Le,Ce.key),Le.return=ge,ge=Le):(Le=wh(Ce.type,Ce.key,Ce.props,null,ge.mode,Le),v0(Le,Ce),Le.return=ge,ge=Le)}return V(ge);case b:e:{for(pt=Ce.key;xe!==null;){if(xe.key===pt)if(xe.tag===4&&xe.stateNode.containerInfo===Ce.containerInfo&&xe.stateNode.implementation===Ce.implementation){h(ge,xe.sibling),Le=S(xe,Ce.children||[]),Le.return=ge,ge=Le;break e}else{h(ge,xe);break}else A(ge,xe);xe=xe.sibling}Le=Xv(Ce,ge.mode,Le),Le.return=ge,ge=Le}return V(ge);case M:return Ce=sd(Ce),xr(ge,xe,Ce,Le)}if(Q(Ce))return ot(ge,xe,Ce,Le);if(P(Ce)){if(pt=P(Ce),typeof pt!="function")throw Error(a(150));return Ce=pt.call(Ce),bt(ge,xe,Ce,Le)}if(typeof Ce.then=="function")return xr(ge,xe,Bh(Ce),Le);if(Ce.$$typeof===C)return xr(ge,xe,kh(ge,Ce),Le);_h(ge,Ce)}return typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint"?(Ce=""+Ce,xe!==null&&xe.tag===6?(h(ge,xe.sibling),Le=S(xe,Ce),Le.return=ge,ge=Le):(h(ge,xe),Le=Yv(Ce,ge.mode,Le),Le.return=ge,ge=Le),V(ge)):h(ge,xe)}return function(ge,xe,Ce,Le){try{b0=0;var pt=xr(ge,xe,Ce,Le);return ju=null,pt}catch(ut){if(ut===ku||ut===Eh)throw ut;var Xt=Es(29,ut,null,ge.mode);return Xt.lanes=Le,Xt.return=ge,Xt}finally{}}}var ld=WS(!0),YS=WS(!1),Go=!1;function c1(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function d1(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 Ko(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function qo(c,A,h){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=yh(c),FS(c,null,h),A}return vh(c,g,A,h),yh(c)}function y0(c,A,h){if(A=A.updateQueue,A!==null&&(A=A.shared,(h&4194048)!==0)){var g=A.lanes;g&=c.pendingLanes,h|=g,A.lanes=h,Ma(c,h)}}function u1(c,A){var h=c.updateQueue,g=c.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var S=null,I=null;if(h=h.firstBaseUpdate,h!==null){do{var V={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};I===null?S=I=V:I=I.next=V,h=h.next}while(h!==null);I===null?S=I=A:I=I.next=A}else S=I=A;h={baseState:g.baseState,firstBaseUpdate:S,lastBaseUpdate:I,shared:g.shared,callbacks:g.callbacks},c.updateQueue=h;return}c=h.lastBaseUpdate,c===null?h.firstBaseUpdate=A:c.next=A,h.lastBaseUpdate=A}var A1=!1;function w0(){if(A1){var c=Cu;if(c!==null)throw c}}function N0(c,A,h,g){A1=!1;var S=c.updateQueue;Go=!1;var I=S.firstBaseUpdate,V=S.lastBaseUpdate,se=S.shared.pending;if(se!==null){S.shared.pending=null;var pe=se,ke=pe.next;pe.next=null,V===null?I=ke:V.next=ke,V=pe;var Pe=c.alternate;Pe!==null&&(Pe=Pe.updateQueue,se=Pe.lastBaseUpdate,se!==V&&(se===null?Pe.firstBaseUpdate=ke:se.next=ke,Pe.lastBaseUpdate=pe))}if(I!==null){var Qe=S.baseState;V=0,Pe=ke=pe=null,se=I;do{var Be=se.lane&-536870913,Fe=Be!==se.lane;if(Fe?(Qt&Be)===Be:(g&Be)===Be){Be!==0&&Be===Nu&&(A1=!0),Pe!==null&&(Pe=Pe.next={lane:0,tag:se.tag,payload:se.payload,callback:null,next:null});e:{var ot=c,bt=se;Be=A;var xr=h;switch(bt.tag){case 1:if(ot=bt.payload,typeof ot=="function"){Qe=ot.call(xr,Qe,Be);break e}Qe=ot;break e;case 3:ot.flags=ot.flags&-65537|128;case 0:if(ot=bt.payload,Be=typeof ot=="function"?ot.call(xr,Qe,Be):ot,Be==null)break e;Qe=p({},Qe,Be);break e;case 2:Go=!0}}Be=se.callback,Be!==null&&(c.flags|=64,Fe&&(c.flags|=8192),Fe=S.callbacks,Fe===null?S.callbacks=[Be]:Fe.push(Be))}else Fe={lane:Be,tag:se.tag,payload:se.payload,callback:se.callback,next:null},Pe===null?(ke=Pe=Fe,pe=Qe):Pe=Pe.next=Fe,V|=Be;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&&(pe=Qe),S.baseState=pe,S.firstBaseUpdate=ke,S.lastBaseUpdate=Pe,I===null&&(S.shared.lanes=0),Zo|=V,c.lanes=V,c.memoizedState=Qe}}function XS(c,A){if(typeof c!="function")throw Error(a(191,c));c.call(A)}function JS(c,A){var h=c.callbacks;if(h!==null)for(c.callbacks=null,c=0;c<h.length;c++)XS(h[c],A)}var Eu=R(null),Th=R(0);function ZS(c,A){c=Yl,q(Th,c),q(Eu,A),Yl=c|A.baseLanes}function f1(){q(Th,Yl),q(Eu,Eu.current)}function p1(){Yl=Th.current,O(Eu),O(Th)}var Ss=R(null),ei=null;function Wo(c){var A=c.alternate;q(pa,pa.current&1),q(Ss,c),ei===null&&(A===null||Eu.current!==null||A.memoizedState!==null)&&(ei=c)}function h1(c){q(pa,pa.current),q(Ss,c),ei===null&&(ei=c)}function e4(c){c.tag===22?(q(pa,pa.current),q(Ss,c),ei===null&&(ei=c)):Yo()}function Yo(){q(pa,pa.current),q(Ss,Ss.current)}function Bs(c){O(Ss),ei===c&&(ei=null),O(pa)}var pa=R(0);function Ih(c){for(var A=c;A!==null;){if(A.tag===13){var h=A.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||yy(h)||wy(h)))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 Hl=0,_t=null,pr=null,Ca=null,Fh=!1,Su=!1,od=!1,Dh=0,C0=0,Bu=null,B$=0;function aa(){throw Error(a(321))}function x1(c,A){if(A===null)return!1;for(var h=0;h<A.length&&h<c.length;h++)if(!js(c[h],A[h]))return!1;return!0}function m1(c,A,h,g,S,I){return Hl=I,_t=A,A.memoizedState=null,A.updateQueue=null,A.lanes=0,Y.H=c===null||c.memoizedState===null?R4:I1,od=!1,I=h(g,S),od=!1,Su&&(I=r4(A,h,g,S)),t4(c),I}function t4(c){Y.H=E0;var A=pr!==null&&pr.next!==null;if(Hl=0,Ca=pr=_t=null,Fh=!1,C0=0,Bu=null,A)throw Error(a(300));c===null||ka||(c=c.dependencies,c!==null&&Ch(c)&&(ka=!0))}function r4(c,A,h,g){_t=c;var S=0;do{if(Su&&(Bu=null),C0=0,Su=!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)}Y.H=O4,I=A(h,g)}while(Su);return I}function _$(){var c=Y.H,A=c.useState()[0];return A=typeof A.then=="function"?k0(A):A,c=c.useState()[0],(pr!==null?pr.memoizedState:null)!==c&&(_t.flags|=1024),A}function g1(){var c=Dh!==0;return Dh=0,c}function b1(c,A,h){A.updateQueue=c.updateQueue,A.flags&=-2053,c.lanes&=~h}function v1(c){if(Fh){for(c=c.memoizedState;c!==null;){var A=c.queue;A!==null&&(A.pending=null),c=c.next}Fh=!1}Hl=0,Ca=pr=_t=null,Su=!1,C0=Dh=0,Bu=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 Uh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function k0(c){var A=C0;return C0+=1,Bu===null&&(Bu=[]),c=GS(Bu,c,A),A=_t,(Ca===null?A.memoizedState:Ca.next)===null&&(A=A.alternate,Y.H=A===null||A.memoizedState===null?R4:I1),c}function Mh(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return k0(c);if(c.$$typeof===C)return An(c)}throw Error(a(438,String(c)))}function y1(c){var A=null,h=_t.updateQueue;if(h!==null&&(A=h.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}),h===null&&(h=Uh(),_t.updateQueue=h),h.memoCache=A,h=A.data[A.index],h===void 0)for(h=A.data[A.index]=Array(c),g=0;g<c;g++)h[g]=D;return A.index++,h}function zl(c,A){return typeof A=="function"?A(c):A}function Rh(c){var A=ha();return w1(A,pr,c)}function w1(c,A,h){var g=c.queue;if(g===null)throw Error(a(311));g.lastRenderedReducer=h;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,pe=null,ke=A,Pe=!1;do{var Qe=ke.lane&-536870913;if(Qe!==ke.lane?(Qt&Qe)===Qe:(Hl&Qe)===Qe){var Be=ke.revertLane;if(Be===0)pe!==null&&(pe=pe.next={lane:0,revertLane:0,gesture:null,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null}),Qe===Nu&&(Pe=!0);else if((Hl&Be)===Be){ke=ke.next,Be===Nu&&(Pe=!0);continue}else Qe={lane:0,revertLane:ke.revertLane,gesture:null,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null},pe===null?(se=pe=Qe,V=I):pe=pe.next=Qe,_t.lanes|=Be,Zo|=Be;Qe=ke.action,od&&h(I,Qe),I=ke.hasEagerState?ke.eagerState:h(I,Qe)}else Be={lane:Qe,revertLane:ke.revertLane,gesture:ke.gesture,action:ke.action,hasEagerState:ke.hasEagerState,eagerState:ke.eagerState,next:null},pe===null?(se=pe=Be,V=I):pe=pe.next=Be,_t.lanes|=Qe,Zo|=Qe;ke=ke.next}while(ke!==null&&ke!==A);if(pe===null?V=I:pe.next=se,!js(I,c.memoizedState)&&(ka=!0,Pe&&(h=Cu,h!==null)))throw h;c.memoizedState=I,c.baseState=V,c.baseQueue=pe,g.lastRenderedState=I}return S===null&&(g.lanes=0),[c.memoizedState,g.dispatch]}function N1(c){var A=ha(),h=A.queue;if(h===null)throw Error(a(311));h.lastRenderedReducer=c;var g=h.dispatch,S=h.pending,I=A.memoizedState;if(S!==null){h.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),h.lastRenderedState=I}return[I,g]}function a4(c,A,h){var g=_t,S=ha(),I=qt;if(I){if(h===void 0)throw Error(a(407));h=h()}else h=A();var V=!js((pr||S).memoizedState,h);if(V&&(S.memoizedState=h,ka=!0),S=S.queue,j1(i4.bind(null,g,S,c),[c]),S.getSnapshot!==A||V||Ca!==null&&Ca.memoizedState.tag&1){if(g.flags|=2048,_u(9,{destroy:void 0},s4.bind(null,g,S,h,A),null),vr===null)throw Error(a(349));I||(Hl&127)!==0||n4(g,A,h)}return h}function n4(c,A,h){c.flags|=16384,c={getSnapshot:A,value:h},A=_t.updateQueue,A===null?(A=Uh(),_t.updateQueue=A,A.stores=[c]):(h=A.stores,h===null?A.stores=[c]:h.push(c))}function s4(c,A,h,g){A.value=h,A.getSnapshot=g,l4(A)&&o4(c)}function i4(c,A,h){return h(function(){l4(A)&&o4(c)})}function l4(c){var A=c.getSnapshot;c=c.value;try{var h=A();return!js(c,h)}catch{return!0}}function o4(c){var A=Zc(c,2);A!==null&&cs(A,c,2)}function C1(c){var A=Vn();if(typeof c=="function"){var h=c;if(c=h(),od){fr(!0);try{h()}finally{fr(!1)}}}return A.memoizedState=A.baseState=c,A.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:c},A}function c4(c,A,h,g){return c.baseState=h,w1(c,pr,typeof g=="function"?g:zl)}function T$(c,A,h,g,S){if(Lh(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)}};Y.T!==null?h(!0):I.isTransition=!1,g(I),h=A.pending,h===null?(I.next=A.pending=I,d4(A,I)):(I.next=h.next,A.pending=h.next=I)}}function d4(c,A){var h=A.action,g=A.payload,S=c.state;if(A.isTransition){var I=Y.T,V={};Y.T=V;try{var se=h(S,g),pe=Y.S;pe!==null&&pe(V,se),u4(c,A,se)}catch(ke){k1(c,A,ke)}finally{I!==null&&V.types!==null&&(I.types=V.types),Y.T=I}}else try{I=h(S,g),u4(c,A,I)}catch(ke){k1(c,A,ke)}}function u4(c,A,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){A4(c,A,g)},function(g){return k1(c,A,g)}):A4(c,A,h)}function A4(c,A,h){A.status="fulfilled",A.value=h,f4(A),c.state=h,A=c.pending,A!==null&&(h=A.next,h===A?c.pending=null:(h=h.next,A.next=h,d4(c,h)))}function k1(c,A,h){var g=c.pending;if(c.pending=null,g!==null){g=g.next;do A.status="rejected",A.reason=h,f4(A),A=A.next;while(A!==g)}c.action=null}function f4(c){c=c.listeners;for(var A=0;A<c.length;A++)(0,c[A])()}function p4(c,A){return A}function h4(c,A){if(qt){var h=vr.formState;if(h!==null){e:{var g=_t;if(qt){if(Tr){t:{for(var S=Tr,I=Zs;S.nodeType!==8;){if(!I){S=null;break t}if(S=ti(S.nextSibling),S===null){S=null;break t}}I=S.data,S=I==="F!"||I==="F"?S:null}if(S){Tr=ti(S.nextSibling),g=S.data==="F!";break e}}$o(g)}g=!1}g&&(A=h[0])}}return h=Vn(),h.memoizedState=h.baseState=A,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:p4,lastRenderedState:A},h.queue=g,h=D4.bind(null,_t,g),g.dispatch=h,g=C1(!1),I=T1.bind(null,_t,!1,g.queue),g=Vn(),S={state:A,dispatch:null,action:c,pending:null},g.queue=S,h=T$.bind(null,_t,S,I,h),S.dispatch=h,g.memoizedState=c,[A,h,!1]}function x4(c){var A=ha();return m4(A,pr,c)}function m4(c,A,h){if(A=w1(c,A,p4)[0],c=Rh(zl)[0],typeof A=="object"&&A!==null&&typeof A.then=="function")try{var g=k0(A)}catch(V){throw V===ku?Eh:V}else g=A;A=ha();var S=A.queue,I=S.dispatch;return h!==A.memoizedState&&(_t.flags|=2048,_u(9,{destroy:void 0},I$.bind(null,S,h),null)),[g,I,c]}function I$(c,A){c.action=A}function g4(c){var A=ha(),h=pr;if(h!==null)return m4(A,h,c);ha(),A=A.memoizedState,h=ha();var g=h.queue.dispatch;return h.memoizedState=c,[A,g,!1]}function _u(c,A,h,g){return c={tag:c,create:h,deps:g,inst:A,next:null},A=_t.updateQueue,A===null&&(A=Uh(),_t.updateQueue=A),h=A.lastEffect,h===null?A.lastEffect=c.next=c:(g=h.next,h.next=c,c.next=g,A.lastEffect=c),c}function b4(){return ha().memoizedState}function Oh(c,A,h,g){var S=Vn();_t.flags|=c,S.memoizedState=_u(1|A,{destroy:void 0},h,g===void 0?null:g)}function Ph(c,A,h,g){var S=ha();g=g===void 0?null:g;var I=S.memoizedState.inst;pr!==null&&g!==null&&x1(g,pr.memoizedState.deps)?S.memoizedState=_u(A,I,h,g):(_t.flags|=c,S.memoizedState=_u(1|A,I,h,g))}function v4(c,A){Oh(8390656,8,c,A)}function j1(c,A){Ph(2048,8,c,A)}function F$(c){_t.flags|=4;var A=_t.updateQueue;if(A===null)A=Uh(),_t.updateQueue=A,A.events=[c];else{var h=A.events;h===null?A.events=[c]:h.push(c)}}function y4(c){var A=ha().memoizedState;return F$({ref:A,nextImpl:c}),function(){if((ar&2)!==0)throw Error(a(440));return A.impl.apply(void 0,arguments)}}function w4(c,A){return Ph(4,2,c,A)}function N4(c,A){return Ph(4,4,c,A)}function C4(c,A){if(typeof A=="function"){c=c();var h=A(c);return function(){typeof h=="function"?h():A(null)}}if(A!=null)return c=c(),A.current=c,function(){A.current=null}}function k4(c,A,h){h=h!=null?h.concat([c]):null,Ph(4,4,C4.bind(null,A,c),h)}function E1(){}function j4(c,A){var h=ha();A=A===void 0?null:A;var g=h.memoizedState;return A!==null&&x1(A,g[1])?g[0]:(h.memoizedState=[c,A],c)}function E4(c,A){var h=ha();A=A===void 0?null:A;var g=h.memoizedState;if(A!==null&&x1(A,g[1]))return g[0];if(g=c(),od){fr(!0);try{c()}finally{fr(!1)}}return h.memoizedState=[g,A],g}function S1(c,A,h){return h===void 0||(Hl&1073741824)!==0&&(Qt&261930)===0?c.memoizedState=A:(c.memoizedState=h,c=SB(),_t.lanes|=c,Zo|=c,h)}function S4(c,A,h,g){return js(h,A)?h:Eu.current!==null?(c=S1(c,h,g),js(c,A)||(ka=!0),c):(Hl&42)===0||(Hl&1073741824)!==0&&(Qt&261930)===0?(ka=!0,c.memoizedState=h):(c=SB(),_t.lanes|=c,Zo|=c,A)}function B4(c,A,h,g,S){var I=K.p;K.p=I!==0&&8>I?I:8;var V=Y.T,se={};Y.T=se,T1(c,!1,A,h);try{var pe=S(),ke=Y.S;if(ke!==null&&ke(se,pe),pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Pe=S$(pe,g);j0(c,A,Pe,Is(c))}else j0(c,A,g,Is(c))}catch(Qe){j0(c,A,{then:function(){},status:"rejected",reason:Qe},Is())}finally{K.p=I,V!==null&&se.types!==null&&(V.types=se.types),Y.T=V}}function D$(){}function B1(c,A,h,g){if(c.tag!==5)throw Error(a(476));var S=_4(c).queue;B4(c,S,A,ee,h===null?D$:function(){return T4(c),h(g)})}function _4(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:zl,lastRenderedState:ee},next:null};var h={};return A.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zl,lastRenderedState:h},next:null},c.memoizedState=A,c=c.alternate,c!==null&&(c.memoizedState=A),A}function T4(c){var A=_4(c);A.next===null&&(A=c.alternate.memoizedState),j0(c,A.next.queue,{},Is())}function _1(){return An(z0)}function I4(){return ha().memoizedState}function F4(){return ha().memoizedState}function U$(c){for(var A=c.return;A!==null;){switch(A.tag){case 24:case 3:var h=Is();c=Ko(h);var g=qo(A,c,h);g!==null&&(cs(g,A,h),y0(g,A,h)),A={cache:s1()},c.payload=A;return}A=A.return}}function M$(c,A,h){var g=Is();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Lh(c)?U4(A,h):(h=qv(c,A,h,g),h!==null&&(cs(h,c,g),M4(h,A,g)))}function D4(c,A,h){var g=Is();j0(c,A,h,g)}function j0(c,A,h,g){var S={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Lh(c))U4(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,h);if(S.hasEagerState=!0,S.eagerState=se,js(se,V))return vh(c,A,S,0),vr===null&&bh(),!1}catch{}finally{}if(h=qv(c,A,S,g),h!==null)return cs(h,c,g),M4(h,A,g),!0}return!1}function T1(c,A,h,g){if(g={lane:2,revertLane:cy(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Lh(c)){if(A)throw Error(a(479))}else A=qv(c,h,g,2),A!==null&&cs(A,c,2)}function Lh(c){var A=c.alternate;return c===_t||A!==null&&A===_t}function U4(c,A){Su=Fh=!0;var h=c.pending;h===null?A.next=A:(A.next=h.next,h.next=A),c.pending=A}function M4(c,A,h){if((h&4194048)!==0){var g=A.lanes;g&=c.pendingLanes,h|=g,A.lanes=h,Ma(c,h)}}var E0={readContext:An,use:Mh,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};E0.useEffectEvent=aa;var R4={readContext:An,use:Mh,useCallback:function(c,A){return Vn().memoizedState=[c,A===void 0?null:A],c},useContext:An,useEffect:v4,useImperativeHandle:function(c,A,h){h=h!=null?h.concat([c]):null,Oh(4194308,4,C4.bind(null,A,c),h)},useLayoutEffect:function(c,A){return Oh(4194308,4,c,A)},useInsertionEffect:function(c,A){Oh(4,2,c,A)},useMemo:function(c,A){var h=Vn();A=A===void 0?null:A;var g=c();if(od){fr(!0);try{c()}finally{fr(!1)}}return h.memoizedState=[g,A],g},useReducer:function(c,A,h){var g=Vn();if(h!==void 0){var S=h(A);if(od){fr(!0);try{h(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=M$.bind(null,_t,c),[g.memoizedState,c]},useRef:function(c){var A=Vn();return c={current:c},A.memoizedState=c},useState:function(c){c=C1(c);var A=c.queue,h=D4.bind(null,_t,A);return A.dispatch=h,[c.memoizedState,h]},useDebugValue:E1,useDeferredValue:function(c,A){var h=Vn();return S1(h,c,A)},useTransition:function(){var c=C1(!1);return c=B4.bind(null,_t,c.queue,!0,!1),Vn().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,A,h){var g=_t,S=Vn();if(qt){if(h===void 0)throw Error(a(407));h=h()}else{if(h=A(),vr===null)throw Error(a(349));(Qt&127)!==0||n4(g,A,h)}S.memoizedState=h;var I={value:h,getSnapshot:A};return S.queue=I,v4(i4.bind(null,g,I,c),[c]),g.flags|=2048,_u(9,{destroy:void 0},s4.bind(null,g,I,h,A),null),h},useId:function(){var c=Vn(),A=vr.identifierPrefix;if(qt){var h=al,g=rl;h=(g&~(1<<32-Nr(g)-1)).toString(32)+h,A="_"+A+"R_"+h,h=Dh++,0<h&&(A+="H"+h.toString(32)),A+="_"}else h=B$++,A="_"+A+"r_"+h.toString(32)+"_";return c.memoizedState=A},useHostTransitionStatus:_1,useFormState:h4,useActionState:h4,useOptimistic:function(c){var A=Vn();A.memoizedState=A.baseState=c;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return A.queue=h,A=T1.bind(null,_t,!0,h),h.dispatch=A,[c,A]},useMemoCache:y1,useCacheRefresh:function(){return Vn().memoizedState=U$.bind(null,_t)},useEffectEvent:function(c){var A=Vn(),h={impl:c};return A.memoizedState=h,function(){if((ar&2)!==0)throw Error(a(440));return h.impl.apply(void 0,arguments)}}},I1={readContext:An,use:Mh,useCallback:j4,useContext:An,useEffect:j1,useImperativeHandle:k4,useInsertionEffect:w4,useLayoutEffect:N4,useMemo:E4,useReducer:Rh,useRef:b4,useState:function(){return Rh(zl)},useDebugValue:E1,useDeferredValue:function(c,A){var h=ha();return S4(h,pr.memoizedState,c,A)},useTransition:function(){var c=Rh(zl)[0],A=ha().memoizedState;return[typeof c=="boolean"?c:k0(c),A]},useSyncExternalStore:a4,useId:I4,useHostTransitionStatus:_1,useFormState:x4,useActionState:x4,useOptimistic:function(c,A){var h=ha();return c4(h,pr,c,A)},useMemoCache:y1,useCacheRefresh:F4};I1.useEffectEvent=y4;var O4={readContext:An,use:Mh,useCallback:j4,useContext:An,useEffect:j1,useImperativeHandle:k4,useInsertionEffect:w4,useLayoutEffect:N4,useMemo:E4,useReducer:N1,useRef:b4,useState:function(){return N1(zl)},useDebugValue:E1,useDeferredValue:function(c,A){var h=ha();return pr===null?S1(h,c,A):S4(h,pr.memoizedState,c,A)},useTransition:function(){var c=N1(zl)[0],A=ha().memoizedState;return[typeof c=="boolean"?c:k0(c),A]},useSyncExternalStore:a4,useId:I4,useHostTransitionStatus:_1,useFormState:g4,useActionState:g4,useOptimistic:function(c,A){var h=ha();return pr!==null?c4(h,pr,c,A):(h.baseState=c,[c,h.queue.dispatch])},useMemoCache:y1,useCacheRefresh:F4};O4.useEffectEvent=y4;function F1(c,A,h,g){A=c.memoizedState,h=h(g,A),h=h==null?A:p({},A,h),c.memoizedState=h,c.lanes===0&&(c.updateQueue.baseState=h)}var D1={enqueueSetState:function(c,A,h){c=c._reactInternals;var g=Is(),S=Ko(g);S.payload=A,h!=null&&(S.callback=h),A=qo(c,S,g),A!==null&&(cs(A,c,g),y0(A,c,g))},enqueueReplaceState:function(c,A,h){c=c._reactInternals;var g=Is(),S=Ko(g);S.tag=1,S.payload=A,h!=null&&(S.callback=h),A=qo(c,S,g),A!==null&&(cs(A,c,g),y0(A,c,g))},enqueueForceUpdate:function(c,A){c=c._reactInternals;var h=Is(),g=Ko(h);g.tag=2,A!=null&&(g.callback=A),A=qo(c,g,h),A!==null&&(cs(A,c,h),y0(A,c,h))}};function P4(c,A,h,g,S,I,V){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(g,I,V):A.prototype&&A.prototype.isPureReactComponent?!f0(h,g)||!f0(S,I):!0}function L4(c,A,h,g){c=A.state,typeof A.componentWillReceiveProps=="function"&&A.componentWillReceiveProps(h,g),typeof A.UNSAFE_componentWillReceiveProps=="function"&&A.UNSAFE_componentWillReceiveProps(h,g),A.state!==c&&D1.enqueueReplaceState(A,A.state,null)}function cd(c,A){var h=A;if("ref"in A){h={};for(var g in A)g!=="ref"&&(h[g]=A[g])}if(c=c.defaultProps){h===A&&(h=p({},h));for(var S in c)h[S]===void 0&&(h[S]=c[S])}return h}function Q4(c){gh(c)}function H4(c){console.error(c)}function z4(c){gh(c)}function Qh(c,A){try{var h=c.onUncaughtError;h(A.value,{componentStack:A.stack})}catch(g){setTimeout(function(){throw g})}}function $4(c,A,h){try{var g=c.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:A.tag===1?A.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function U1(c,A,h){return h=Ko(h),h.tag=3,h.payload={element:null},h.callback=function(){Qh(c,A)},h}function V4(c){return c=Ko(c),c.tag=3,c}function G4(c,A,h,g){var S=h.type.getDerivedStateFromError;if(typeof S=="function"){var I=g.value;c.payload=function(){return S(I)},c.callback=function(){$4(A,h,g)}}var V=h.stateNode;V!==null&&typeof V.componentDidCatch=="function"&&(c.callback=function(){$4(A,h,g),typeof S!="function"&&(ec===null?ec=new Set([this]):ec.add(this));var se=g.stack;this.componentDidCatch(g.value,{componentStack:se!==null?se:""})})}function R$(c,A,h,g,S){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(A=h.alternate,A!==null&&wu(A,h,S,!0),h=Ss.current,h!==null){switch(h.tag){case 31:case 13:return ei===null?Zh():h.alternate===null&&na===0&&(na=3),h.flags&=-257,h.flags|=65536,h.lanes=S,g===Sh?h.flags|=16384:(A=h.updateQueue,A===null?h.updateQueue=new Set([g]):A.add(g),iy(c,g,S)),!1;case 22:return h.flags|=65536,g===Sh?h.flags|=16384:(A=h.updateQueue,A===null?(A={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=A):(h=A.retryQueue,h===null?A.retryQueue=new Set([g]):h.add(g)),iy(c,g,S)),!1}throw Error(a(435,h.tag))}return iy(c,g,S),Zh(),!1}if(qt)return A=Ss.current,A!==null?((A.flags&65536)===0&&(A.flags|=256),A.flags|=65536,A.lanes=S,g!==e1&&(c=Error(a(422),{cause:g}),x0(Ys(c,h)))):(g!==e1&&(A=Error(a(423),{cause:g}),x0(Ys(A,h))),c=c.current.alternate,c.flags|=65536,S&=-S,c.lanes|=S,g=Ys(g,h),S=U1(c.stateNode,g,S),u1(c,S),na!==4&&(na=2)),!1;var I=Error(a(520),{cause:g});if(I=Ys(I,h),U0===null?U0=[I]:U0.push(I),na!==4&&(na=2),A===null)return!0;g=Ys(g,h),h=A;do{switch(h.tag){case 3:return h.flags|=65536,c=S&-S,h.lanes|=c,c=U1(h.stateNode,g,c),u1(h,c),!1;case 1:if(A=h.type,I=h.stateNode,(h.flags&128)===0&&(typeof A.getDerivedStateFromError=="function"||I!==null&&typeof I.componentDidCatch=="function"&&(ec===null||!ec.has(I))))return h.flags|=65536,S&=-S,h.lanes|=S,S=V4(S),G4(S,c,h,g),u1(h,S),!1}h=h.return}while(h!==null);return!1}var M1=Error(a(461)),ka=!1;function fn(c,A,h,g){A.child=c===null?YS(A,null,h,g):ld(A,c.child,h,g)}function K4(c,A,h,g,S){h=h.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 ad(A),g=m1(c,A,h,V,I,S),se=g1(),c!==null&&!ka?(b1(c,A,S),$l(c,A,S)):(qt&&se&&Jv(A),A.flags|=1,fn(c,A,g,S),A.child)}function q4(c,A,h,g,S){if(c===null){var I=h.type;return typeof I=="function"&&!Wv(I)&&I.defaultProps===void 0&&h.compare===null?(A.tag=15,A.type=I,W4(c,A,I,g,S)):(c=wh(h.type,null,g,A,A.mode,S),c.ref=A.ref,c.return=A,A.child=c)}if(I=c.child,!$1(c,S)){var V=I.memoizedProps;if(h=h.compare,h=h!==null?h:f0,h(V,g)&&c.ref===A.ref)return $l(c,A,S)}return A.flags|=1,c=Ol(I,g),c.ref=A.ref,c.return=A,A.child=c}function W4(c,A,h,g,S){if(c!==null){var I=c.memoizedProps;if(f0(I,g)&&c.ref===A.ref)if(ka=!1,A.pendingProps=g=I,$1(c,S))(c.flags&131072)!==0&&(ka=!0);else return A.lanes=c.lanes,$l(c,A,S)}return R1(c,A,h,g,S)}function Y4(c,A,h,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|h:h,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 X4(c,A,I,h,g)}if((h&536870912)!==0)A.memoizedState={baseLanes:0,cachePool:null},c!==null&&jh(A,I!==null?I.cachePool:null),I!==null?ZS(A,I):f1(),e4(A);else return g=A.lanes=536870912,X4(c,A,I!==null?I.baseLanes|h:h,h,g)}else I!==null?(jh(A,I.cachePool),ZS(A,I),Yo(),A.memoizedState=null):(c!==null&&jh(A,null),f1(),Yo());return fn(c,A,S,h),A.child}function S0(c,A){return c!==null&&c.tag===22||A.stateNode!==null||(A.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),A.sibling}function X4(c,A,h,g,S){var I=l1();return I=I===null?null:{parent:Na._currentValue,pool:I},A.memoizedState={baseLanes:h,cachePool:I},c!==null&&jh(A,null),f1(),e4(A),c!==null&&wu(c,A,g,!0),A.childLanes=S,null}function Hh(c,A){return A=$h({mode:A.mode,children:A.children},c.mode),A.ref=c.ref,c.child=A,A.return=c,A}function J4(c,A,h){return ld(A,c.child,null,h),c=Hh(A,A.pendingProps),c.flags|=2,Bs(A),A.memoizedState=null,c}function O$(c,A,h){var g=A.pendingProps,S=(A.flags&128)!==0;if(A.flags&=-129,c===null){if(qt){if(g.mode==="hidden")return c=Hh(A,g),A.lanes=536870912,S0(null,c);if(h1(A),(c=Tr)?(c=d_(c,Zs),c=c!==null&&c.data==="&"?c:null,c!==null&&(A.memoizedState={dehydrated:c,treeContext:Ho!==null?{id:rl,overflow:al}:null,retryLane:536870912,hydrationErrors:null},h=US(c),h.return=A,A.child=h,un=A,Tr=null)):c=null,c===null)throw $o(A);return A.lanes=536870912,null}return Hh(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=J4(c,A,h);else if(A.memoizedState!==null)A.child=c.child,A.flags|=128,A=null;else throw Error(a(558));else if(ka||wu(c,A,h,!1),S=(h&c.childLanes)!==0,ka||S){if(g=vr,g!==null&&(V=me(g,h),V!==0&&V!==I.retryLane))throw I.retryLane=V,Zc(c,V),cs(g,c,V),M1;Zh(),A=J4(c,A,h)}else c=I.treeContext,Tr=ti(V.nextSibling),un=A,qt=!0,zo=null,Zs=!1,c!==null&&OS(A,c),A=Hh(A,g),A.flags|=4096;return A}return c=Ol(c.child,{mode:g.mode,children:g.children}),c.ref=A.ref,A.child=c,c.return=A,c}function zh(c,A){var h=A.ref;if(h===null)c!==null&&c.ref!==null&&(A.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(a(284));(c===null||c.ref!==h)&&(A.flags|=4194816)}}function R1(c,A,h,g,S){return ad(A),h=m1(c,A,h,g,void 0,S),g=g1(),c!==null&&!ka?(b1(c,A,S),$l(c,A,S)):(qt&&g&&Jv(A),A.flags|=1,fn(c,A,h,S),A.child)}function Z4(c,A,h,g,S,I){return ad(A),A.updateQueue=null,h=r4(A,g,h,S),t4(c),g=g1(),c!==null&&!ka?(b1(c,A,I),$l(c,A,I)):(qt&&g&&Jv(A),A.flags|=1,fn(c,A,h,I),A.child)}function eB(c,A,h,g,S){if(ad(A),A.stateNode===null){var I=gu,V=h.contextType;typeof V=="object"&&V!==null&&(I=An(V)),I=new h(g,I),A.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,I.updater=D1,A.stateNode=I,I._reactInternals=A,I=A.stateNode,I.props=g,I.state=A.memoizedState,I.refs={},c1(A),V=h.contextType,I.context=typeof V=="object"&&V!==null?An(V):gu,I.state=A.memoizedState,V=h.getDerivedStateFromProps,typeof V=="function"&&(F1(A,h,V,g),I.state=A.memoizedState),typeof h.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&&D1.enqueueReplaceState(I,I.state,null),N0(A,g,I,S),w0(),I.state=A.memoizedState),typeof I.componentDidMount=="function"&&(A.flags|=4194308),g=!0}else if(c===null){I=A.stateNode;var se=A.memoizedProps,pe=cd(h,se);I.props=pe;var ke=I.context,Pe=h.contextType;V=gu,typeof Pe=="object"&&Pe!==null&&(V=An(Pe));var Qe=h.getDerivedStateFromProps;Pe=typeof Qe=="function"||typeof I.getSnapshotBeforeUpdate=="function",se=A.pendingProps!==se,Pe||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(se||ke!==V)&&L4(A,I,g,V),Go=!1;var Be=A.memoizedState;I.state=Be,N0(A,g,I,S),w0(),ke=A.memoizedState,se||Be!==ke||Go?(typeof Qe=="function"&&(F1(A,h,Qe,g),ke=A.memoizedState),(pe=Go||P4(A,h,pe,g,Be,ke,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=ke),I.props=g,I.state=ke,I.context=V,g=pe):(typeof I.componentDidMount=="function"&&(A.flags|=4194308),g=!1)}else{I=A.stateNode,d1(c,A),V=A.memoizedProps,Pe=cd(h,V),I.props=Pe,Qe=A.pendingProps,Be=I.context,ke=h.contextType,pe=gu,typeof ke=="object"&&ke!==null&&(pe=An(ke)),se=h.getDerivedStateFromProps,(ke=typeof se=="function"||typeof I.getSnapshotBeforeUpdate=="function")||typeof I.UNSAFE_componentWillReceiveProps!="function"&&typeof I.componentWillReceiveProps!="function"||(V!==Qe||Be!==pe)&&L4(A,I,g,pe),Go=!1,Be=A.memoizedState,I.state=Be,N0(A,g,I,S),w0();var Fe=A.memoizedState;V!==Qe||Be!==Fe||Go||c!==null&&c.dependencies!==null&&Ch(c.dependencies)?(typeof se=="function"&&(F1(A,h,se,g),Fe=A.memoizedState),(Pe=Go||P4(A,h,Pe,g,Be,Fe,pe)||c!==null&&c.dependencies!==null&&Ch(c.dependencies))?(ke||typeof I.UNSAFE_componentWillUpdate!="function"&&typeof I.componentWillUpdate!="function"||(typeof I.componentWillUpdate=="function"&&I.componentWillUpdate(g,Fe,pe),typeof I.UNSAFE_componentWillUpdate=="function"&&I.UNSAFE_componentWillUpdate(g,Fe,pe)),typeof I.componentDidUpdate=="function"&&(A.flags|=4),typeof I.getSnapshotBeforeUpdate=="function"&&(A.flags|=1024)):(typeof I.componentDidUpdate!="function"||V===c.memoizedProps&&Be===c.memoizedState||(A.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||V===c.memoizedProps&&Be===c.memoizedState||(A.flags|=1024),A.memoizedProps=g,A.memoizedState=Fe),I.props=g,I.state=Fe,I.context=pe,g=Pe):(typeof I.componentDidUpdate!="function"||V===c.memoizedProps&&Be===c.memoizedState||(A.flags|=4),typeof I.getSnapshotBeforeUpdate!="function"||V===c.memoizedProps&&Be===c.memoizedState||(A.flags|=1024),g=!1)}return I=g,zh(c,A),g=(A.flags&128)!==0,I||g?(I=A.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:I.render(),A.flags|=1,c!==null&&g?(A.child=ld(A,c.child,null,S),A.child=ld(A,null,h,S)):fn(c,A,h,S),A.memoizedState=I.state,c=A.child):c=$l(c,A,S),c}function tB(c,A,h,g){return td(),A.flags|=256,fn(c,A,h,g),A.child}var O1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function P1(c){return{baseLanes:c,cachePool:$S()}}function L1(c,A,h){return c=c!==null?c.childLanes&~h:0,A&&(c|=Ts),c}function rB(c,A,h){var g=A.pendingProps,S=!1,I=(A.flags&128)!==0,V;if((V=I)||(V=c!==null&&c.memoizedState===null?!1:(pa.current&2)!==0),V&&(S=!0,A.flags&=-129),V=(A.flags&32)!==0,A.flags&=-33,c===null){if(qt){if(S?Wo(A):Yo(),(c=Tr)?(c=d_(c,Zs),c=c!==null&&c.data!=="&"?c:null,c!==null&&(A.memoizedState={dehydrated:c,treeContext:Ho!==null?{id:rl,overflow:al}:null,retryLane:536870912,hydrationErrors:null},h=US(c),h.return=A,A.child=h,un=A,Tr=null)):c=null,c===null)throw $o(A);return wy(c)?A.lanes=32:A.lanes=536870912,null}var se=g.children;return g=g.fallback,S?(Yo(),S=A.mode,se=$h({mode:"hidden",children:se},S),g=ed(g,S,h,null),se.return=A,g.return=A,se.sibling=g,A.child=se,g=A.child,g.memoizedState=P1(h),g.childLanes=L1(c,V,h),A.memoizedState=O1,S0(null,g)):(Wo(A),Q1(A,se))}var pe=c.memoizedState;if(pe!==null&&(se=pe.dehydrated,se!==null)){if(I)A.flags&256?(Wo(A),A.flags&=-257,A=H1(c,A,h)):A.memoizedState!==null?(Yo(),A.child=c.child,A.flags|=128,A=null):(Yo(),se=g.fallback,S=A.mode,g=$h({mode:"visible",children:g.children},S),se=ed(se,S,h,null),se.flags|=2,g.return=A,se.return=A,g.sibling=se,A.child=g,ld(A,c.child,null,h),g=A.child,g.memoizedState=P1(h),g.childLanes=L1(c,V,h),A.memoizedState=O1,A=S0(null,g));else if(Wo(A),wy(se)){if(V=se.nextSibling&&se.nextSibling.dataset,V)var ke=V.dgst;V=ke,g=Error(a(419)),g.stack="",g.digest=V,x0({value:g,source:null,stack:null}),A=H1(c,A,h)}else if(ka||wu(c,A,h,!1),V=(h&c.childLanes)!==0,ka||V){if(V=vr,V!==null&&(g=me(V,h),g!==0&&g!==pe.retryLane))throw pe.retryLane=g,Zc(c,g),cs(V,c,g),M1;yy(se)||Zh(),A=H1(c,A,h)}else yy(se)?(A.flags|=192,A.child=c.child,A=null):(c=pe.treeContext,Tr=ti(se.nextSibling),un=A,qt=!0,zo=null,Zs=!1,c!==null&&OS(A,c),A=Q1(A,g.children),A.flags|=4096);return A}return S?(Yo(),se=g.fallback,S=A.mode,pe=c.child,ke=pe.sibling,g=Ol(pe,{mode:"hidden",children:g.children}),g.subtreeFlags=pe.subtreeFlags&65011712,ke!==null?se=Ol(ke,se):(se=ed(se,S,h,null),se.flags|=2),se.return=A,g.return=A,g.sibling=se,A.child=g,S0(null,g),g=A.child,se=c.child.memoizedState,se===null?se=P1(h):(S=se.cachePool,S!==null?(pe=Na._currentValue,S=S.parent!==pe?{parent:pe,pool:pe}:S):S=$S(),se={baseLanes:se.baseLanes|h,cachePool:S}),g.memoizedState=se,g.childLanes=L1(c,V,h),A.memoizedState=O1,S0(c.child,g)):(Wo(A),h=c.child,c=h.sibling,h=Ol(h,{mode:"visible",children:g.children}),h.return=A,h.sibling=null,c!==null&&(V=A.deletions,V===null?(A.deletions=[c],A.flags|=16):V.push(c)),A.child=h,A.memoizedState=null,h)}function Q1(c,A){return A=$h({mode:"visible",children:A},c.mode),A.return=c,c.child=A}function $h(c,A){return c=Es(22,c,null,A),c.lanes=0,c}function H1(c,A,h){return ld(A,c.child,null,h),c=Q1(A,A.pendingProps.children),c.flags|=2,A.memoizedState=null,c}function aB(c,A,h){c.lanes|=A;var g=c.alternate;g!==null&&(g.lanes|=A),a1(c.return,A,h)}function z1(c,A,h,g,S,I){var V=c.memoizedState;V===null?c.memoizedState={isBackwards:A,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:S,treeForkCount:I}:(V.isBackwards=A,V.rendering=null,V.renderingStartTime=0,V.last=g,V.tail=h,V.tailMode=S,V.treeForkCount=I)}function nB(c,A,h){var g=A.pendingProps,S=g.revealOrder,I=g.tail;g=g.children;var V=pa.current,se=(V&2)!==0;if(se?(V=V&1|2,A.flags|=128):V&=1,q(pa,V),fn(c,A,g,h),g=qt?h0:0,!se&&c!==null&&(c.flags&128)!==0)e:for(c=A.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&aB(c,h,A);else if(c.tag===19)aB(c,h,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(h=A.child,S=null;h!==null;)c=h.alternate,c!==null&&Ih(c)===null&&(S=h),h=h.sibling;h=S,h===null?(S=A.child,A.child=null):(S=h.sibling,h.sibling=null),z1(A,!1,S,h,I,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,S=A.child,A.child=null;S!==null;){if(c=S.alternate,c!==null&&Ih(c)===null){A.child=S;break}c=S.sibling,S.sibling=h,h=S,S=c}z1(A,!0,h,null,I,g);break;case"together":z1(A,!1,null,null,void 0,g);break;default:A.memoizedState=null}return A.child}function $l(c,A,h){if(c!==null&&(A.dependencies=c.dependencies),Zo|=A.lanes,(h&A.childLanes)===0)if(c!==null){if(wu(c,A,h,!1),(h&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,h=Ol(c,c.pendingProps),A.child=h,h.return=A;c.sibling!==null;)c=c.sibling,h=h.sibling=Ol(c,c.pendingProps),h.return=A;h.sibling=null}return A.child}function $1(c,A){return(c.lanes&A)!==0?!0:(c=c.dependencies,!!(c!==null&&Ch(c)))}function P$(c,A,h){switch(A.tag){case 3:ne(A,A.stateNode.containerInfo),Vo(A,Na,c.memoizedState.cache),td();break;case 27:case 5:ie(A);break;case 4:ne(A,A.stateNode.containerInfo);break;case 10:Vo(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?(Wo(A),A.flags|=128,null):(h&A.child.childLanes)!==0?rB(c,A,h):(Wo(A),c=$l(c,A,h),c!==null?c.sibling:null);Wo(A);break;case 19:var S=(c.flags&128)!==0;if(g=(h&A.childLanes)!==0,g||(wu(c,A,h,!1),g=(h&A.childLanes)!==0),S){if(g)return nB(c,A,h);A.flags|=128}if(S=A.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),q(pa,pa.current),g)break;return null;case 22:return A.lanes=0,Y4(c,A,h,A.pendingProps);case 24:Vo(A,Na,c.memoizedState.cache)}return $l(c,A,h)}function sB(c,A,h){if(c!==null)if(c.memoizedProps!==A.pendingProps)ka=!0;else{if(!$1(c,h)&&(A.flags&128)===0)return ka=!1,P$(c,A,h);ka=(c.flags&131072)!==0}else ka=!1,qt&&(A.flags&1048576)!==0&&RS(A,h0,A.index);switch(A.lanes=0,A.tag){case 16:e:{var g=A.pendingProps;if(c=sd(A.elementType),A.type=c,typeof c=="function")Wv(c)?(g=cd(c,g),A.tag=1,A=eB(null,A,c,g,h)):(A.tag=0,A=R1(null,A,c,g,h));else{if(c!=null){var S=c.$$typeof;if(S===E){A.tag=11,A=K4(null,A,c,g,h);break e}else if(S===F){A.tag=14,A=q4(null,A,c,g,h);break e}}throw A=H(c)||c,Error(a(306,A,""))}}return A;case 0:return R1(c,A,A.type,A.pendingProps,h);case 1:return g=A.type,S=cd(g,A.pendingProps),eB(c,A,g,S,h);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,d1(c,A),N0(A,g,null,h);var V=A.memoizedState;if(g=V.cache,Vo(A,Na,g),g!==I.cache&&n1(A,[Na],h,!0),w0(),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=tB(c,A,g,h);break e}else if(g!==S){S=Ys(Error(a(424)),A),x0(S),A=tB(c,A,g,h);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(Tr=ti(c.firstChild),un=A,qt=!0,zo=null,Zs=!0,h=YS(A,null,g,h),A.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling}else{if(td(),g===S){A=$l(c,A,h);break e}fn(c,A,g,h)}A=A.child}return A;case 26:return zh(c,A),c===null?(h=x_(A.type,null,A.pendingProps,null))?A.memoizedState=h:qt||(h=A.type,c=A.pendingProps,g=ix(re.current).createElement(h),g[ce]=A,g[ue]=c,pn(g,h,c),dt(g),A.stateNode=g):A.memoizedState=x_(A.type,c.memoizedProps,A.pendingProps,c.memoizedState),null;case 27:return ie(A),c===null&&qt&&(g=A.stateNode=f_(A.type,A.pendingProps,re.current),un=A,Zs=!0,S=Tr,nc(A.type)?(Ny=S,Tr=ti(g.firstChild)):Tr=S),fn(c,A,A.pendingProps.children,h),zh(c,A),c===null&&(A.flags|=4194304),A.child;case 5:return c===null&&qt&&((S=g=Tr)&&(g=h7(g,A.type,A.pendingProps,Zs),g!==null?(A.stateNode=g,un=A,Tr=ti(g.firstChild),Zs=!1,S=!0):S=!1),S||$o(A)),ie(A),S=A.type,I=A.pendingProps,V=c!==null?c.memoizedProps:null,g=I.children,gy(S,I)?g=null:V!==null&&gy(S,V)&&(A.flags|=32),A.memoizedState!==null&&(S=m1(c,A,_$,null,null,h),z0._currentValue=S),zh(c,A),fn(c,A,g,h),A.child;case 6:return c===null&&qt&&((c=h=Tr)&&(h=x7(h,A.pendingProps,Zs),h!==null?(A.stateNode=h,un=A,Tr=null,c=!0):c=!1),c||$o(A)),null;case 13:return rB(c,A,h);case 4:return ne(A,A.stateNode.containerInfo),g=A.pendingProps,c===null?A.child=ld(A,null,g,h):fn(c,A,g,h),A.child;case 11:return K4(c,A,A.type,A.pendingProps,h);case 7:return fn(c,A,A.pendingProps,h),A.child;case 8:return fn(c,A,A.pendingProps.children,h),A.child;case 12:return fn(c,A,A.pendingProps.children,h),A.child;case 10:return g=A.pendingProps,Vo(A,A.type,g.value),fn(c,A,g.children,h),A.child;case 9:return S=A.type._context,g=A.pendingProps.children,ad(A),S=An(S),g=g(S),A.flags|=1,fn(c,A,g,h),A.child;case 14:return q4(c,A,A.type,A.pendingProps,h);case 15:return W4(c,A,A.type,A.pendingProps,h);case 19:return nB(c,A,h);case 31:return O$(c,A,h);case 22:return Y4(c,A,h,A.pendingProps);case 24:return ad(A),g=An(Na),c===null?(S=l1(),S===null&&(S=vr,I=s1(),S.pooledCache=I,I.refCount++,I!==null&&(S.pooledCacheLanes|=h),S=I),A.memoizedState={parent:g,cache:S},c1(A),Vo(A,Na,S)):((c.lanes&h)!==0&&(d1(c,A),N0(A,null,null,h),w0()),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),Vo(A,Na,g)):(g=I.cache,Vo(A,Na,g),g!==S.cache&&n1(A,[Na],h,!0))),fn(c,A,A.pendingProps.children,h),A.child;case 29:throw A.pendingProps}throw Error(a(156,A.tag))}function Vl(c){c.flags|=4}function V1(c,A,h,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(IB())c.flags|=8192;else throw id=Sh,o1}else c.flags&=-16777217}function iB(c,A){if(A.type!=="stylesheet"||(A.state.loading&4)!==0)c.flags&=-16777217;else if(c.flags|=16777216,!y_(A))if(IB())c.flags|=8192;else throw id=Sh,o1}function Vh(c,A){A!==null&&(c.flags|=4),c.flags&16384&&(A=c.tag!==22?Po():536870912,c.lanes|=A,Du|=A)}function B0(c,A){if(!qt)switch(c.tailMode){case"hidden":A=c.tail;for(var h=null;A!==null;)A.alternate!==null&&(h=A),A=A.sibling;h===null?c.tail=null:h.sibling=null;break;case"collapsed":h=c.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?A||c.tail===null?c.tail=null:c.tail.sibling=null:g.sibling=null}}function Ir(c){var A=c.alternate!==null&&c.alternate.child===c.child,h=0,g=0;if(A)for(var S=c.child;S!==null;)h|=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;)h|=S.lanes|S.childLanes,g|=S.subtreeFlags,g|=S.flags,S.return=c,S=S.sibling;return c.subtreeFlags|=g,c.childLanes=h,A}function L$(c,A,h){var g=A.pendingProps;switch(Zv(A),A.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ir(A),null;case 1:return Ir(A),null;case 3:return h=A.stateNode,g=null,c!==null&&(g=c.memoizedState.cache),A.memoizedState.cache!==g&&(A.flags|=2048),Ql(Na),ae(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(c===null||c.child===null)&&(yu(A)?Vl(A):c===null||c.memoizedState.isDehydrated&&(A.flags&256)===0||(A.flags|=1024,t1())),Ir(A),null;case 26:var S=A.type,I=A.memoizedState;return c===null?(Vl(A),I!==null?(Ir(A),iB(A,I)):(Ir(A),V1(A,S,null,g,h))):I?I!==c.memoizedState?(Vl(A),Ir(A),iB(A,I)):(Ir(A),A.flags&=-16777217):(c=c.memoizedProps,c!==g&&Vl(A),Ir(A),V1(A,S,c,g,h)),null;case 27:if(he(A),h=re.current,S=A.type,c!==null&&A.stateNode!=null)c.memoizedProps!==g&&Vl(A);else{if(!g){if(A.stateNode===null)throw Error(a(166));return Ir(A),null}c=z.current,yu(A)?PS(A):(c=f_(S,g,h),A.stateNode=c,Vl(A))}return Ir(A),null;case 5:if(he(A),S=A.type,c!==null&&A.stateNode!=null)c.memoizedProps!==g&&Vl(A);else{if(!g){if(A.stateNode===null)throw Error(a(166));return Ir(A),null}if(I=z.current,yu(A))PS(A);else{var V=ix(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&&Vl(A)}}return Ir(A),V1(A,A.type,c===null?null:c.memoizedProps,A.pendingProps,h),null;case 6:if(c&&A.stateNode!=null)c.memoizedProps!==g&&Vl(A);else{if(typeof g!="string"&&A.stateNode===null)throw Error(a(166));if(c=re.current,yu(A)){if(c=A.stateNode,h=A.memoizedProps,g=null,S=un,S!==null)switch(S.tag){case 27:case 5:g=S.memoizedProps}c[ce]=A,c=!!(c.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||r_(c.nodeValue,h)),c||$o(A,!0)}else c=ix(c).createTextNode(g),c[ce]=A,A.stateNode=c}return Ir(A),null;case 31:if(h=A.memoizedState,c===null||c.memoizedState!==null){if(g=yu(A),h!==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 td(),(A.flags&128)===0&&(A.memoizedState=null),A.flags|=4;Ir(A),c=!1}else h=t1(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=h),c=!0;if(!c)return A.flags&256?(Bs(A),A):(Bs(A),null);if((A.flags&128)!==0)throw Error(a(558))}return Ir(A),null;case 13:if(g=A.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(S=yu(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 td(),(A.flags&128)===0&&(A.memoizedState=null),A.flags|=4;Ir(A),S=!1}else S=t1(),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=h,A):(h=g!==null,c=c!==null&&c.memoizedState!==null,h&&(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)),h!==c&&h&&(A.child.flags|=8192),Vh(A,A.updateQueue),Ir(A),null);case 4:return ae(),c===null&&fy(A.stateNode.containerInfo),Ir(A),null;case 10:return Ql(A.type),Ir(A),null;case 19:if(O(pa),g=A.memoizedState,g===null)return Ir(A),null;if(S=(A.flags&128)!==0,I=g.rendering,I===null)if(S)B0(g,!1);else{if(na!==0||c!==null&&(c.flags&128)!==0)for(c=A.child;c!==null;){if(I=Ih(c),I!==null){for(A.flags|=128,B0(g,!1),c=I.updateQueue,A.updateQueue=c,Vh(A,c),A.subtreeFlags=0,c=h,h=A.child;h!==null;)DS(h,c),h=h.sibling;return q(pa,pa.current&1|2),qt&&Pl(A,g.treeForkCount),A.child}c=c.sibling}g.tail!==null&&ft()>Yh&&(A.flags|=128,S=!0,B0(g,!1),A.lanes=4194304)}else{if(!S)if(c=Ih(I),c!==null){if(A.flags|=128,S=!0,c=c.updateQueue,A.updateQueue=c,Vh(A,c),B0(g,!0),g.tail===null&&g.tailMode==="hidden"&&!I.alternate&&!qt)return Ir(A),null}else 2*ft()-g.renderingStartTime>Yh&&h!==536870912&&(A.flags|=128,S=!0,B0(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,h=pa.current,q(pa,S?h&1|2:h&1),qt&&Pl(A,g.treeForkCount),c):(Ir(A),null);case 22:case 23:return Bs(A),p1(),g=A.memoizedState!==null,c!==null?c.memoizedState!==null!==g&&(A.flags|=8192):g&&(A.flags|=8192),g?(h&536870912)!==0&&(A.flags&128)===0&&(Ir(A),A.subtreeFlags&6&&(A.flags|=8192)):Ir(A),h=A.updateQueue,h!==null&&Vh(A,h.retryQueue),h=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(h=c.memoizedState.cachePool.pool),g=null,A.memoizedState!==null&&A.memoizedState.cachePool!==null&&(g=A.memoizedState.cachePool.pool),g!==h&&(A.flags|=2048),c!==null&&O(nd),null;case 24:return h=null,c!==null&&(h=c.memoizedState.cache),A.memoizedState.cache!==h&&(A.flags|=2048),Ql(Na),Ir(A),null;case 25:return null;case 30:return null}throw Error(a(156,A.tag))}function Q$(c,A){switch(Zv(A),A.tag){case 1:return c=A.flags,c&65536?(A.flags=c&-65537|128,A):null;case 3:return Ql(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 he(A),null;case 31:if(A.memoizedState!==null){if(Bs(A),A.alternate===null)throw Error(a(340));td()}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));td()}return c=A.flags,c&65536?(A.flags=c&-65537|128,A):null;case 19:return O(pa),null;case 4:return ae(),null;case 10:return Ql(A.type),null;case 22:case 23:return Bs(A),p1(),c!==null&&O(nd),c=A.flags,c&65536?(A.flags=c&-65537|128,A):null;case 24:return Ql(Na),null;case 25:return null;default:return null}}function lB(c,A){switch(Zv(A),A.tag){case 3:Ql(Na),ae();break;case 26:case 27:case 5:he(A);break;case 4:ae();break;case 31:A.memoizedState!==null&&Bs(A);break;case 13:Bs(A);break;case 19:O(pa);break;case 10:Ql(A.type);break;case 22:case 23:Bs(A),p1(),c!==null&&O(nd);break;case 24:Ql(Na)}}function _0(c,A){try{var h=A.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var S=g.next;h=S;do{if((h.tag&c)===c){g=void 0;var I=h.create,V=h.inst;g=I(),V.destroy=g}h=h.next}while(h!==S)}}catch(se){lr(A,A.return,se)}}function Xo(c,A,h){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 pe=h,ke=se;try{ke()}catch(Pe){lr(S,pe,Pe)}}}g=g.next}while(g!==I)}}catch(Pe){lr(A,A.return,Pe)}}function oB(c){var A=c.updateQueue;if(A!==null){var h=c.stateNode;try{JS(A,h)}catch(g){lr(c,c.return,g)}}}function cB(c,A,h){h.props=cd(c.type,c.memoizedProps),h.state=c.memoizedState;try{h.componentWillUnmount()}catch(g){lr(c,A,g)}}function T0(c,A){try{var h=c.ref;if(h!==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 h=="function"?c.refCleanup=h(g):h.current=g}}catch(S){lr(c,A,S)}}function nl(c,A){var h=c.ref,g=c.refCleanup;if(h!==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 h=="function")try{h(null)}catch(S){lr(c,A,S)}else h.current=null}function dB(c){var A=c.type,h=c.memoizedProps,g=c.stateNode;try{e:switch(A){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(S){lr(c,c.return,S)}}function G1(c,A,h){try{var g=c.stateNode;c7(g,c.type,h,A),g[ue]=A}catch(S){lr(c,c.return,S)}}function uB(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&nc(c.type)||c.tag===4}function K1(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||uB(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&&nc(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 q1(c,A,h){var g=c.tag;if(g===5||g===6)c=c.stateNode,A?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(c,A):(A=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,A.appendChild(c),h=h._reactRootContainer,h!=null||A.onclick!==null||(A.onclick=Ml));else if(g!==4&&(g===27&&nc(c.type)&&(h=c.stateNode,A=null),c=c.child,c!==null))for(q1(c,A,h),c=c.sibling;c!==null;)q1(c,A,h),c=c.sibling}function Gh(c,A,h){var g=c.tag;if(g===5||g===6)c=c.stateNode,A?h.insertBefore(c,A):h.appendChild(c);else if(g!==4&&(g===27&&nc(c.type)&&(h=c.stateNode),c=c.child,c!==null))for(Gh(c,A,h),c=c.sibling;c!==null;)Gh(c,A,h),c=c.sibling}function AB(c){var A=c.stateNode,h=c.memoizedProps;try{for(var g=c.type,S=A.attributes;S.length;)A.removeAttributeNode(S[0]);pn(A,g,h),A[ce]=c,A[ue]=h}catch(I){lr(c,c.return,I)}}var Gl=!1,ja=!1,W1=!1,fB=typeof WeakSet=="function"?WeakSet:Set,Ga=null;function H$(c,A){if(c=c.containerInfo,xy=fx,c=kS(c),Hv(c)){if("selectionStart"in c)var h={start:c.selectionStart,end:c.selectionEnd};else e:{h=(h=c.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var S=g.anchorOffset,I=g.focusNode;g=g.focusOffset;try{h.nodeType,I.nodeType}catch{h=null;break e}var V=0,se=-1,pe=-1,ke=0,Pe=0,Qe=c,Be=null;t:for(;;){for(var Fe;Qe!==h||S!==0&&Qe.nodeType!==3||(se=V+S),Qe!==I||g!==0&&Qe.nodeType!==3||(pe=V+g),Qe.nodeType===3&&(V+=Qe.nodeValue.length),(Fe=Qe.firstChild)!==null;)Be=Qe,Qe=Fe;for(;;){if(Qe===c)break t;if(Be===h&&++ke===S&&(se=V),Be===I&&++Pe===g&&(pe=V),(Fe=Qe.nextSibling)!==null)break;Qe=Be,Be=Qe.parentNode}Qe=Fe}h=se===-1||pe===-1?null:{start:se,end:pe}}else h=null}h=h||{start:0,end:0}}else h=null;for(my={focusedElem:c,selectionRange:h},fx=!1,Ga=A;Ga!==null;)if(A=Ga,c=A.child,(A.subtreeFlags&1028)!==0&&c!==null)c.return=A,Ga=c;else for(;Ga!==null;){switch(A=Ga,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(h=0;h<c.length;h++)S=c[h],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((c&1024)!==0&&I!==null){c=void 0,h=A,S=I.memoizedProps,I=I.memoizedState,g=h.stateNode;try{var ot=cd(h.type,S);c=g.getSnapshotBeforeUpdate(ot,I),g.__reactInternalSnapshotBeforeUpdate=c}catch(bt){lr(h,h.return,bt)}}break;case 3:if((c&1024)!==0){if(c=A.stateNode.containerInfo,h=c.nodeType,h===9)vy(c);else if(h===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":vy(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,Ga=c;break}Ga=A.return}}function pB(c,A,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:ql(c,h),g&4&&_0(5,h);break;case 1:if(ql(c,h),g&4)if(c=h.stateNode,A===null)try{c.componentDidMount()}catch(V){lr(h,h.return,V)}else{var S=cd(h.type,A.memoizedProps);A=A.memoizedState;try{c.componentDidUpdate(S,A,c.__reactInternalSnapshotBeforeUpdate)}catch(V){lr(h,h.return,V)}}g&64&&oB(h),g&512&&T0(h,h.return);break;case 3:if(ql(c,h),g&64&&(c=h.updateQueue,c!==null)){if(A=null,h.child!==null)switch(h.child.tag){case 27:case 5:A=h.child.stateNode;break;case 1:A=h.child.stateNode}try{JS(c,A)}catch(V){lr(h,h.return,V)}}break;case 27:A===null&&g&4&&AB(h);case 26:case 5:ql(c,h),A===null&&g&4&&dB(h),g&512&&T0(h,h.return);break;case 12:ql(c,h);break;case 31:ql(c,h),g&4&&mB(c,h);break;case 13:ql(c,h),g&4&&gB(c,h),g&64&&(c=h.memoizedState,c!==null&&(c=c.dehydrated,c!==null&&(h=X$.bind(null,h),m7(c,h))));break;case 22:if(g=h.memoizedState!==null||Gl,!g){A=A!==null&&A.memoizedState!==null||ja,S=Gl;var I=ja;Gl=g,(ja=A)&&!I?Wl(c,h,(h.subtreeFlags&8772)!==0):ql(c,h),Gl=S,ja=I}break;case 30:break;default:ql(c,h)}}function hB(c){var A=c.alternate;A!==null&&(c.alternate=null,hB(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,ss=!1;function Kl(c,A,h){for(h=h.child;h!==null;)xB(c,A,h),h=h.sibling}function xB(c,A,h){if(Kt&&typeof Kt.onCommitFiberUnmount=="function")try{Kt.onCommitFiberUnmount(jt,h)}catch{}switch(h.tag){case 26:ja||nl(h,A),Kl(c,A,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:ja||nl(h,A);var g=Hr,S=ss;nc(h.type)&&(Hr=h.stateNode,ss=!1),Kl(c,A,h),L0(h.stateNode),Hr=g,ss=S;break;case 5:ja||nl(h,A);case 6:if(g=Hr,S=ss,Hr=null,Kl(c,A,h),Hr=g,ss=S,Hr!==null)if(ss)try{(Hr.nodeType===9?Hr.body:Hr.nodeName==="HTML"?Hr.ownerDocument.body:Hr).removeChild(h.stateNode)}catch(I){lr(h,A,I)}else try{Hr.removeChild(h.stateNode)}catch(I){lr(h,A,I)}break;case 18:Hr!==null&&(ss?(c=Hr,o_(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,h.stateNode),Hu(c)):o_(Hr,h.stateNode));break;case 4:g=Hr,S=ss,Hr=h.stateNode.containerInfo,ss=!0,Kl(c,A,h),Hr=g,ss=S;break;case 0:case 11:case 14:case 15:Xo(2,h,A),ja||Xo(4,h,A),Kl(c,A,h);break;case 1:ja||(nl(h,A),g=h.stateNode,typeof g.componentWillUnmount=="function"&&cB(h,A,g)),Kl(c,A,h);break;case 21:Kl(c,A,h);break;case 22:ja=(g=ja)||h.memoizedState!==null,Kl(c,A,h),ja=g;break;default:Kl(c,A,h)}}function mB(c,A){if(A.memoizedState===null&&(c=A.alternate,c!==null&&(c=c.memoizedState,c!==null))){c=c.dehydrated;try{Hu(c)}catch(h){lr(A,A.return,h)}}}function gB(c,A){if(A.memoizedState===null&&(c=A.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{Hu(c)}catch(h){lr(A,A.return,h)}}function z$(c){switch(c.tag){case 31:case 13:case 19:var A=c.stateNode;return A===null&&(A=c.stateNode=new fB),A;case 22:return c=c.stateNode,A=c._retryCache,A===null&&(A=c._retryCache=new fB),A;default:throw Error(a(435,c.tag))}}function Kh(c,A){var h=z$(c);A.forEach(function(g){if(!h.has(g)){h.add(g);var S=J$.bind(null,c,g);g.then(S,S)}})}function is(c,A){var h=A.deletions;if(h!==null)for(var g=0;g<h.length;g++){var S=h[g],I=c,V=A,se=V;e:for(;se!==null;){switch(se.tag){case 27:if(nc(se.type)){Hr=se.stateNode,ss=!1;break e}break;case 5:Hr=se.stateNode,ss=!1;break e;case 3:case 4:Hr=se.stateNode.containerInfo,ss=!0;break e}se=se.return}if(Hr===null)throw Error(a(160));xB(I,V,S),Hr=null,ss=!1,I=S.alternate,I!==null&&(I.return=null),S.return=null}if(A.subtreeFlags&13886)for(A=A.child;A!==null;)bB(A,c),A=A.sibling}var Ii=null;function bB(c,A){var h=c.alternate,g=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:is(A,c),ls(c),g&4&&(Xo(3,c,c.return),_0(3,c),Xo(5,c,c.return));break;case 1:is(A,c),ls(c),g&512&&(ja||h===null||nl(h,h.return)),g&64&&Gl&&(c=c.updateQueue,c!==null&&(g=c.callbacks,g!==null&&(h=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var S=Ii;if(is(A,c),ls(c),g&512&&(ja||h===null||nl(h,h.return)),g&4){var I=h!==null?h.memoizedState:null;if(g=c.memoizedState,h===null)if(g===null)if(c.stateNode===null){e:{g=c.type,h=c.memoizedProps,S=S.ownerDocument||S;t:switch(g){case"title":I=S.getElementsByTagName("title")[0],(!I||I[Se]||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,h),I[ce]=c,dt(I),g=I;break e;case"link":var V=b_("link","href",S).get(g+(h.href||""));if(V){for(var se=0;se<V.length;se++)if(I=V[se],I.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&I.getAttribute("rel")===(h.rel==null?null:h.rel)&&I.getAttribute("title")===(h.title==null?null:h.title)&&I.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){V.splice(se,1);break t}}I=S.createElement(g),pn(I,g,h),S.head.appendChild(I);break;case"meta":if(V=b_("meta","content",S).get(g+(h.content||""))){for(se=0;se<V.length;se++)if(I=V[se],I.getAttribute("content")===(h.content==null?null:""+h.content)&&I.getAttribute("name")===(h.name==null?null:h.name)&&I.getAttribute("property")===(h.property==null?null:h.property)&&I.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&I.getAttribute("charset")===(h.charSet==null?null:h.charSet)){V.splice(se,1);break t}}I=S.createElement(g),pn(I,g,h),S.head.appendChild(I);break;default:throw Error(a(468,g))}I[ce]=c,dt(I),g=I}c.stateNode=g}else v_(S,c.type,c.stateNode);else c.stateNode=g_(S,g,c.memoizedProps);else I!==g?(I===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):I.count--,g===null?v_(S,c.type,c.stateNode):g_(S,g,c.memoizedProps)):g===null&&c.stateNode!==null&&G1(c,c.memoizedProps,h.memoizedProps)}break;case 27:is(A,c),ls(c),g&512&&(ja||h===null||nl(h,h.return)),h!==null&&g&4&&G1(c,c.memoizedProps,h.memoizedProps);break;case 5:if(is(A,c),ls(c),g&512&&(ja||h===null||nl(h,h.return)),c.flags&32){S=c.stateNode;try{uu(S,"")}catch(ot){lr(c,c.return,ot)}}g&4&&c.stateNode!=null&&(S=c.memoizedProps,G1(c,S,h!==null?h.memoizedProps:S)),g&1024&&(W1=!0);break;case 6:if(is(A,c),ls(c),g&4){if(c.stateNode===null)throw Error(a(162));g=c.memoizedProps,h=c.stateNode;try{h.nodeValue=g}catch(ot){lr(c,c.return,ot)}}break;case 3:if(cx=null,S=Ii,Ii=lx(A.containerInfo),is(A,c),Ii=S,ls(c),g&4&&h!==null&&h.memoizedState.isDehydrated)try{Hu(A.containerInfo)}catch(ot){lr(c,c.return,ot)}W1&&(W1=!1,vB(c));break;case 4:g=Ii,Ii=lx(c.stateNode.containerInfo),is(A,c),ls(c),Ii=g;break;case 12:is(A,c),ls(c);break;case 31:is(A,c),ls(c),g&4&&(g=c.updateQueue,g!==null&&(c.updateQueue=null,Kh(c,g)));break;case 13:is(A,c),ls(c),c.child.flags&8192&&c.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(Wh=ft()),g&4&&(g=c.updateQueue,g!==null&&(c.updateQueue=null,Kh(c,g)));break;case 22:S=c.memoizedState!==null;var pe=h!==null&&h.memoizedState!==null,ke=Gl,Pe=ja;if(Gl=ke||S,ja=Pe||pe,is(A,c),ja=Pe,Gl=ke,ls(c),g&8192)e:for(A=c.stateNode,A._visibility=S?A._visibility&-2:A._visibility|1,S&&(h===null||pe||Gl||ja||dd(c)),h=null,A=c;;){if(A.tag===5||A.tag===26){if(h===null){pe=h=A;try{if(I=pe.stateNode,S)V=I.style,typeof V.setProperty=="function"?V.setProperty("display","none","important"):V.display="none";else{se=pe.stateNode;var Qe=pe.memoizedProps.style,Be=Qe!=null&&Qe.hasOwnProperty("display")?Qe.display:null;se.style.display=Be==null||typeof Be=="boolean"?"":(""+Be).trim()}}catch(ot){lr(pe,pe.return,ot)}}}else if(A.tag===6){if(h===null){pe=A;try{pe.stateNode.nodeValue=S?"":pe.memoizedProps}catch(ot){lr(pe,pe.return,ot)}}}else if(A.tag===18){if(h===null){pe=A;try{var Fe=pe.stateNode;S?c_(Fe,!0):c_(pe.stateNode,!1)}catch(ot){lr(pe,pe.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;h===A&&(h=null),A=A.return}h===A&&(h=null),A.sibling.return=A.return,A=A.sibling}g&4&&(g=c.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,Kh(c,h))));break;case 19:is(A,c),ls(c),g&4&&(g=c.updateQueue,g!==null&&(c.updateQueue=null,Kh(c,g)));break;case 30:break;case 21:break;default:is(A,c),ls(c)}}function ls(c){var A=c.flags;if(A&2){try{for(var h,g=c.return;g!==null;){if(uB(g)){h=g;break}g=g.return}if(h==null)throw Error(a(160));switch(h.tag){case 27:var S=h.stateNode,I=K1(c);Gh(c,I,S);break;case 5:var V=h.stateNode;h.flags&32&&(uu(V,""),h.flags&=-33);var se=K1(c);Gh(c,se,V);break;case 3:case 4:var pe=h.stateNode.containerInfo,ke=K1(c);q1(c,ke,pe);break;default:throw Error(a(161))}}catch(Pe){lr(c,c.return,Pe)}c.flags&=-3}A&4096&&(c.flags&=-4097)}function vB(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var A=c;vB(A),A.tag===5&&A.flags&1024&&A.stateNode.reset(),c=c.sibling}}function ql(c,A){if(A.subtreeFlags&8772)for(A=A.child;A!==null;)pB(c,A.alternate,A),A=A.sibling}function dd(c){for(c=c.child;c!==null;){var A=c;switch(A.tag){case 0:case 11:case 14:case 15:Xo(4,A,A.return),dd(A);break;case 1:nl(A,A.return);var h=A.stateNode;typeof h.componentWillUnmount=="function"&&cB(A,A.return,h),dd(A);break;case 27:L0(A.stateNode);case 26:case 5:nl(A,A.return),dd(A);break;case 22:A.memoizedState===null&&dd(A);break;case 30:dd(A);break;default:dd(A)}c=c.sibling}}function Wl(c,A,h){for(h=h&&(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:Wl(S,I,h),_0(4,I);break;case 1:if(Wl(S,I,h),g=I,S=g.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(ke){lr(g,g.return,ke)}if(g=I,S=g.updateQueue,S!==null){var se=g.stateNode;try{var pe=S.shared.hiddenCallbacks;if(pe!==null)for(S.shared.hiddenCallbacks=null,S=0;S<pe.length;S++)XS(pe[S],se)}catch(ke){lr(g,g.return,ke)}}h&&V&64&&oB(I),T0(I,I.return);break;case 27:AB(I);case 26:case 5:Wl(S,I,h),h&&g===null&&V&4&&dB(I),T0(I,I.return);break;case 12:Wl(S,I,h);break;case 31:Wl(S,I,h),h&&V&4&&mB(S,I);break;case 13:Wl(S,I,h),h&&V&4&&gB(S,I);break;case 22:I.memoizedState===null&&Wl(S,I,h),T0(I,I.return);break;case 30:break;default:Wl(S,I,h)}A=A.sibling}}function Y1(c,A){var h=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(h=c.memoizedState.cachePool.pool),c=null,A.memoizedState!==null&&A.memoizedState.cachePool!==null&&(c=A.memoizedState.cachePool.pool),c!==h&&(c!=null&&c.refCount++,h!=null&&m0(h))}function X1(c,A){c=null,A.alternate!==null&&(c=A.alternate.memoizedState.cache),A=A.memoizedState.cache,A!==c&&(A.refCount++,c!=null&&m0(c))}function Fi(c,A,h,g){if(A.subtreeFlags&10256)for(A=A.child;A!==null;)yB(c,A,h,g),A=A.sibling}function yB(c,A,h,g){var S=A.flags;switch(A.tag){case 0:case 11:case 15:Fi(c,A,h,g),S&2048&&_0(9,A);break;case 1:Fi(c,A,h,g);break;case 3:Fi(c,A,h,g),S&2048&&(c=null,A.alternate!==null&&(c=A.alternate.memoizedState.cache),A=A.memoizedState.cache,A!==c&&(A.refCount++,c!=null&&m0(c)));break;case 12:if(S&2048){Fi(c,A,h,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(pe){lr(A,A.return,pe)}}else Fi(c,A,h,g);break;case 31:Fi(c,A,h,g);break;case 13:Fi(c,A,h,g);break;case 23:break;case 22:I=A.stateNode,V=A.alternate,A.memoizedState!==null?I._visibility&2?Fi(c,A,h,g):I0(c,A):I._visibility&2?Fi(c,A,h,g):(I._visibility|=2,Tu(c,A,h,g,(A.subtreeFlags&10256)!==0||!1)),S&2048&&Y1(V,A);break;case 24:Fi(c,A,h,g),S&2048&&X1(A.alternate,A);break;default:Fi(c,A,h,g)}}function Tu(c,A,h,g,S){for(S=S&&((A.subtreeFlags&10256)!==0||!1),A=A.child;A!==null;){var I=c,V=A,se=h,pe=g,ke=V.flags;switch(V.tag){case 0:case 11:case 15:Tu(I,V,se,pe,S),_0(8,V);break;case 23:break;case 22:var Pe=V.stateNode;V.memoizedState!==null?Pe._visibility&2?Tu(I,V,se,pe,S):I0(I,V):(Pe._visibility|=2,Tu(I,V,se,pe,S)),S&&ke&2048&&Y1(V.alternate,V);break;case 24:Tu(I,V,se,pe,S),S&&ke&2048&&X1(V.alternate,V);break;default:Tu(I,V,se,pe,S)}A=A.sibling}}function I0(c,A){if(A.subtreeFlags&10256)for(A=A.child;A!==null;){var h=c,g=A,S=g.flags;switch(g.tag){case 22:I0(h,g),S&2048&&Y1(g.alternate,g);break;case 24:I0(h,g),S&2048&&X1(g.alternate,g);break;default:I0(h,g)}A=A.sibling}}var F0=8192;function Iu(c,A,h){if(c.subtreeFlags&F0)for(c=c.child;c!==null;)wB(c,A,h),c=c.sibling}function wB(c,A,h){switch(c.tag){case 26:Iu(c,A,h),c.flags&F0&&c.memoizedState!==null&&B7(h,Ii,c.memoizedState,c.memoizedProps);break;case 5:Iu(c,A,h);break;case 3:case 4:var g=Ii;Ii=lx(c.stateNode.containerInfo),Iu(c,A,h),Ii=g;break;case 22:c.memoizedState===null&&(g=c.alternate,g!==null&&g.memoizedState!==null?(g=F0,F0=16777216,Iu(c,A,h),F0=g):Iu(c,A,h));break;default:Iu(c,A,h)}}function NB(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 D0(c){var A=c.deletions;if((c.flags&16)!==0){if(A!==null)for(var h=0;h<A.length;h++){var g=A[h];Ga=g,kB(g,c)}NB(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)CB(c),c=c.sibling}function CB(c){switch(c.tag){case 0:case 11:case 15:D0(c),c.flags&2048&&Xo(9,c,c.return);break;case 3:D0(c);break;case 12:D0(c);break;case 22:var A=c.stateNode;c.memoizedState!==null&&A._visibility&2&&(c.return===null||c.return.tag!==13)?(A._visibility&=-3,qh(c)):D0(c);break;default:D0(c)}}function qh(c){var A=c.deletions;if((c.flags&16)!==0){if(A!==null)for(var h=0;h<A.length;h++){var g=A[h];Ga=g,kB(g,c)}NB(c)}for(c=c.child;c!==null;){switch(A=c,A.tag){case 0:case 11:case 15:Xo(8,A,A.return),qh(A);break;case 22:h=A.stateNode,h._visibility&2&&(h._visibility&=-3,qh(A));break;default:qh(A)}c=c.sibling}}function kB(c,A){for(;Ga!==null;){var h=Ga;switch(h.tag){case 0:case 11:case 15:Xo(8,h,A);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:m0(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Ga=g;else e:for(h=c;Ga!==null;){g=Ga;var S=g.sibling,I=g.return;if(hB(g),g===h){Ga=null;break e}if(S!==null){S.return=I,Ga=S;break e}Ga=I}}}var $$={getCacheForType:function(c){var A=An(Na),h=A.data.get(c);return h===void 0&&(h=c(),A.data.set(c,h)),h},cacheSignal:function(){return An(Na).controller.signal}},V$=typeof WeakMap=="function"?WeakMap:Map,ar=0,vr=null,Pt=null,Qt=0,ir=0,_s=null,Jo=!1,Fu=!1,J1=!1,Yl=0,na=0,Zo=0,ud=0,Z1=0,Ts=0,Du=0,U0=null,os=null,ey=!1,Wh=0,jB=0,Yh=1/0,Xh=null,ec=null,Ra=0,tc=null,Uu=null,Xl=0,ty=0,ry=null,EB=null,M0=0,ay=null;function Is(){return(ar&2)!==0&&Qt!==0?Qt&-Qt:Y.T!==null?cy():te()}function SB(){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 cs(c,A,h){(c===vr&&(ir===2||ir===9)||c.cancelPendingCommit!==null)&&(Mu(c,0),rc(c,Qt,Ts,!1)),Ve(c,h),((ar&2)===0||c!==vr)&&(c===vr&&((ar&2)===0&&(ud|=h),na===4&&rc(c,Qt,Ts,!1)),sl(c))}function BB(c,A,h){if((ar&6)!==0)throw Error(a(327));var g=!h&&(A&127)===0&&(A&c.expiredLanes)===0||_i(c,A),S=g?q$(c,A):sy(c,A,!0),I=g;do{if(S===0){Fu&&!g&&rc(c,A,0,!1);break}else{if(h=c.current.alternate,I&&!G$(h)){S=sy(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=U0;var pe=se.current.memoizedState.isDehydrated;if(pe&&(Mu(se,V).flags|=256),V=sy(se,V,!1),V!==2){if(J1&&!pe){se.errorRecoveryDisabledLanes|=I,ud|=I,S=4;break e}I=os,os=S,I!==null&&(os===null?os=I:os.push.apply(os,I))}S=V}if(I=!1,S!==2)continue}}if(S===1){Mu(c,0),rc(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:rc(g,A,Ts,!Jo);break e;case 2:os=null;break;case 3:case 5:break;default:throw Error(a(329))}if((A&62914560)===A&&(S=Wh+300-ft(),10<S)){if(rc(g,A,Ts,!Jo),el(g,0,!0)!==0)break e;Xl=A,g.timeoutHandle=i_(_B.bind(null,g,h,os,Xh,ey,A,Ts,ud,Du,Jo,I,"Throttled",-0,0),S);break e}_B(g,h,os,Xh,ey,A,Ts,ud,Du,Jo,I,null,-0,0)}}break}while(!0);sl(c)}function _B(c,A,h,g,S,I,V,se,pe,ke,Pe,Qe,Be,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:Ml},wB(A,I,Qe);var ot=(I&62914560)===I?Wh-ft():(I&4194048)===I?jB-ft():0;if(ot=_7(Qe,ot),ot!==null){Xl=I,c.cancelPendingCommit=ot(OB.bind(null,c,A,I,h,g,S,V,se,pe,Pe,Qe,null,Be,Fe)),rc(c,I,V,!ke);return}}OB(c,A,I,h,g,S,V,se,pe)}function G$(c){for(var A=c;;){var h=A.tag;if((h===0||h===11||h===15)&&A.flags&16384&&(h=A.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var S=h[g],I=S.getSnapshot;S=S.value;try{if(!js(I(),S))return!1}catch{return!1}}if(h=A.child,A.subtreeFlags&16384&&h!==null)h.return=A,A=h;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 rc(c,A,h,g){A&=~Z1,A&=~ud,c.suspendedLanes|=A,c.pingedLanes&=~A,g&&(c.warmLanes|=A),g=c.expirationTimes;for(var S=A;0<S;){var I=31-Nr(S),V=1<<I;g[I]=-1,S&=~V}h!==0&&ra(c,h,A)}function Jh(){return(ar&6)===0?(R0(0),!1):!0}function ny(){if(Pt!==null){if(ir===0)var c=Pt.return;else c=Pt,Ll=rd=null,v1(c),ju=null,b0=0,c=Pt;for(;c!==null;)lB(c.alternate,c),c=c.return;Pt=null}}function Mu(c,A){var h=c.timeoutHandle;h!==-1&&(c.timeoutHandle=-1,A7(h)),h=c.cancelPendingCommit,h!==null&&(c.cancelPendingCommit=null,h()),Xl=0,ny(),vr=c,Pt=h=Ol(c.current,null),Qt=A,ir=0,_s=null,Jo=!1,Fu=_i(c,A),J1=!1,Du=Ts=Z1=ud=Zo=na=0,os=U0=null,ey=!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-Nr(g),I=1<<S;A|=c[S],g&=~I}return Yl=A,bh(),h}function TB(c,A){_t=null,Y.H=E0,A===ku||A===Eh?(A=KS(),ir=3):A===o1?(A=KS(),ir=4):ir=A===M1?8:A!==null&&typeof A=="object"&&typeof A.then=="function"?6:1,_s=A,Pt===null&&(na=1,Qh(c,Ys(A,c.current)))}function IB(){var c=Ss.current;return c===null?!0:(Qt&4194048)===Qt?ei===null:(Qt&62914560)===Qt||(Qt&536870912)!==0?c===ei:!1}function FB(){var c=Y.H;return Y.H=E0,c===null?E0:c}function DB(){var c=Y.A;return Y.A=$$,c}function Zh(){na=4,Jo||(Qt&4194048)!==Qt&&Ss.current!==null||(Fu=!0),(Zo&134217727)===0&&(ud&134217727)===0||vr===null||rc(vr,Qt,Ts,!1)}function sy(c,A,h){var g=ar;ar|=2;var S=FB(),I=DB();(vr!==c||Qt!==A)&&(Xh=null,Mu(c,A)),A=!1;var V=na;e:do try{if(ir!==0&&Pt!==null){var se=Pt,pe=_s;switch(ir){case 8:ny(),V=6;break e;case 3:case 2:case 9:case 6:Ss.current===null&&(A=!0);var ke=ir;if(ir=0,_s=null,Ru(c,se,pe,ke),h&&Fu){V=0;break e}break;default:ke=ir,ir=0,_s=null,Ru(c,se,pe,ke)}}K$(),V=na;break}catch(Pe){TB(c,Pe)}while(!0);return A&&c.shellSuspendCounter++,Ll=rd=null,ar=g,Y.H=S,Y.A=I,Pt===null&&(vr=null,Qt=0,bh()),V}function K$(){for(;Pt!==null;)UB(Pt)}function q$(c,A){var h=ar;ar|=2;var g=FB(),S=DB();vr!==c||Qt!==A?(Xh=null,Yh=ft()+500,Mu(c,A)):Fu=_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,Ru(c,A,I,1);break;case 2:case 9:if(VS(I)){ir=0,_s=null,MB(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:VS(I)?(ir=0,_s=null,MB(A)):(ir=0,_s=null,Ru(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?y_(V):se.stateNode.complete){ir=0,_s=null;var pe=se.sibling;if(pe!==null)Pt=pe;else{var ke=se.return;ke!==null?(Pt=ke,ex(ke)):Pt=null}break t}}ir=0,_s=null,Ru(c,A,I,5);break;case 6:ir=0,_s=null,Ru(c,A,I,6);break;case 8:ny(),na=6;break e;default:throw Error(a(462))}}W$();break}catch(Pe){TB(c,Pe)}while(!0);return Ll=rd=null,Y.H=g,Y.A=S,ar=h,Pt!==null?0:(vr=null,Qt=0,bh(),na)}function W$(){for(;Pt!==null&&!Ct();)UB(Pt)}function UB(c){var A=sB(c.alternate,c,Yl);c.memoizedProps=c.pendingProps,A===null?ex(c):Pt=A}function MB(c){var A=c,h=A.alternate;switch(A.tag){case 15:case 0:A=Z4(h,A,A.pendingProps,A.type,void 0,Qt);break;case 11:A=Z4(h,A,A.pendingProps,A.type.render,A.ref,Qt);break;case 5:v1(A);default:lB(h,A),A=Pt=DS(A,Yl),A=sB(h,A,Yl)}c.memoizedProps=c.pendingProps,A===null?ex(c):Pt=A}function Ru(c,A,h,g){Ll=rd=null,v1(A),ju=null,b0=0;var S=A.return;try{if(R$(c,S,A,h,Qt)){na=1,Qh(c,Ys(h,c.current)),Pt=null;return}}catch(I){if(S!==null)throw Pt=S,I;na=1,Qh(c,Ys(h,c.current)),Pt=null;return}A.flags&32768?(qt||g===1?c=!0:Fu||(Qt&536870912)!==0?c=!1:(Jo=c=!0,(g===2||g===9||g===3||g===6)&&(g=Ss.current,g!==null&&g.tag===13&&(g.flags|=16384))),RB(A,c)):ex(A)}function ex(c){var A=c;do{if((A.flags&32768)!==0){RB(A,Jo);return}c=A.return;var h=L$(A.alternate,A,Yl);if(h!==null){Pt=h;return}if(A=A.sibling,A!==null){Pt=A;return}Pt=A=c}while(A!==null);na===0&&(na=5)}function RB(c,A){do{var h=Q$(c.alternate,c);if(h!==null){h.flags&=32767,Pt=h;return}if(h=c.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!A&&(c=c.sibling,c!==null)){Pt=c;return}Pt=c=h}while(c!==null);na=6,Pt=null}function OB(c,A,h,g,S,I,V,se,pe){c.cancelPendingCommit=null;do tx();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|=Kv,It(c,h,I,V,se,pe),c===vr&&(Pt=vr=null,Qt=0),Uu=A,tc=c,Xl=h,ty=I,ry=S,EB=g,(A.subtreeFlags&10256)!==0||(A.flags&10256)!==0?(c.callbackNode=null,c.callbackPriority=0,Z$(Ut,function(){return zB(),null})):(c.callbackNode=null,c.callbackPriority=0),g=(A.flags&13878)!==0,(A.subtreeFlags&13878)!==0||g){g=Y.T,Y.T=null,S=K.p,K.p=2,V=ar,ar|=4;try{H$(c,A,h)}finally{ar=V,K.p=S,Y.T=g}}Ra=1,PB(),LB(),QB()}}function PB(){if(Ra===1){Ra=0;var c=tc,A=Uu,h=(A.flags&13878)!==0;if((A.subtreeFlags&13878)!==0||h){h=Y.T,Y.T=null;var g=K.p;K.p=2;var S=ar;ar|=4;try{bB(A,c);var I=my,V=kS(c.containerInfo),se=I.focusedElem,pe=I.selectionRange;if(V!==se&&se&&se.ownerDocument&&CS(se.ownerDocument.documentElement,se)){if(pe!==null&&Hv(se)){var ke=pe.start,Pe=pe.end;if(Pe===void 0&&(Pe=ke),"selectionStart"in se)se.selectionStart=ke,se.selectionEnd=Math.min(Pe,se.value.length);else{var Qe=se.ownerDocument||document,Be=Qe&&Qe.defaultView||window;if(Be.getSelection){var Fe=Be.getSelection(),ot=se.textContent.length,bt=Math.min(pe.start,ot),xr=pe.end===void 0?bt:Math.min(pe.end,ot);!Fe.extend&&bt>xr&&(V=xr,xr=bt,bt=V);var ge=NS(se,bt),xe=NS(se,xr);if(ge&&xe&&(Fe.rangeCount!==1||Fe.anchorNode!==ge.node||Fe.anchorOffset!==ge.offset||Fe.focusNode!==xe.node||Fe.focusOffset!==xe.offset)){var Ce=Qe.createRange();Ce.setStart(ge.node,ge.offset),Fe.removeAllRanges(),bt>xr?(Fe.addRange(Ce),Fe.extend(xe.node,xe.offset)):(Ce.setEnd(xe.node,xe.offset),Fe.addRange(Ce))}}}}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}}fx=!!xy,my=xy=null}finally{ar=S,K.p=g,Y.T=h}}c.current=A,Ra=2}}function LB(){if(Ra===2){Ra=0;var c=tc,A=Uu,h=(A.flags&8772)!==0;if((A.subtreeFlags&8772)!==0||h){h=Y.T,Y.T=null;var g=K.p;K.p=2;var S=ar;ar|=4;try{pB(c,A.alternate,A)}finally{ar=S,K.p=g,Y.T=h}}Ra=3}}function QB(){if(Ra===4||Ra===3){Ra=0,kt();var c=tc,A=Uu,h=Xl,g=EB;(A.subtreeFlags&10256)!==0||(A.flags&10256)!==0?Ra=5:(Ra=0,Uu=tc=null,HB(c,c.pendingLanes));var S=c.pendingLanes;if(S===0&&(ec=null),tt(h),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=Y.T,S=K.p,K.p=2,Y.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{Y.T=A,K.p=S}}(Xl&3)!==0&&tx(),sl(c),S=c.pendingLanes,(h&261930)!==0&&(S&42)!==0?c===ay?M0++:(M0=0,ay=c):M0=0,R0(0)}}function HB(c,A){(c.pooledCacheLanes&=A)===0&&(A=c.pooledCache,A!=null&&(c.pooledCache=null,m0(A)))}function tx(){return PB(),LB(),QB(),zB()}function zB(){if(Ra!==5)return!1;var c=tc,A=ty;ty=0;var h=tt(Xl),g=Y.T,S=K.p;try{K.p=32>h?32:h,Y.T=null,h=ry,ry=null;var I=tc,V=Xl;if(Ra=0,Uu=tc=null,Xl=0,(ar&6)!==0)throw Error(a(331));var se=ar;if(ar|=4,CB(I.current),yB(I,I.current,V,h),ar=se,R0(0,!1),Kt&&typeof Kt.onPostCommitFiberRoot=="function")try{Kt.onPostCommitFiberRoot(jt,I)}catch{}return!0}finally{K.p=S,Y.T=g,HB(c,A)}}function $B(c,A,h){A=Ys(h,A),A=U1(c.stateNode,A,2),c=qo(c,A,2),c!==null&&(Ve(c,2),sl(c))}function lr(c,A,h){if(c.tag===3)$B(c,c,h);else for(;A!==null;){if(A.tag===3){$B(A,c,h);break}else if(A.tag===1){var g=A.stateNode;if(typeof A.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(ec===null||!ec.has(g))){c=Ys(h,c),h=V4(2),g=qo(A,h,2),g!==null&&(G4(h,g,A,c),Ve(g,2),sl(g));break}}A=A.return}}function iy(c,A,h){var g=c.pingCache;if(g===null){g=c.pingCache=new V$;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(h)||(J1=!0,S.add(h),c=Y$.bind(null,c,A,h),A.then(c,c))}function Y$(c,A,h){var g=c.pingCache;g!==null&&g.delete(A),c.pingedLanes|=c.suspendedLanes&h,c.warmLanes&=~h,vr===c&&(Qt&h)===h&&(na===4||na===3&&(Qt&62914560)===Qt&&300>ft()-Wh?(ar&2)===0&&Mu(c,0):Z1|=h,Du===Qt&&(Du=0)),sl(c)}function VB(c,A){A===0&&(A=Po()),c=Zc(c,A),c!==null&&(Ve(c,A),sl(c))}function X$(c){var A=c.memoizedState,h=0;A!==null&&(h=A.retryLane),VB(c,h)}function J$(c,A){var h=0;switch(c.tag){case 31:case 13:var g=c.stateNode,S=c.memoizedState;S!==null&&(h=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),VB(c,h)}function Z$(c,A){return it(c,A)}var rx=null,Ou=null,ly=!1,ax=!1,oy=!1,ac=0;function sl(c){c!==Ou&&c.next===null&&(Ou===null?rx=Ou=c:Ou=Ou.next=c),ax=!0,ly||(ly=!0,t7())}function R0(c,A){if(!oy&&ax){oy=!0;do for(var h=!1,g=rx;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-Nr(42|c)+1)-1,I&=S&~(V&~se),I=I&201326741?I&201326741|1:I?I|2:0}I!==0&&(h=!0,WB(g,I))}else I=Qt,I=el(g,g===vr?I:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(I&3)===0||_i(g,I)||(h=!0,WB(g,I));g=g.next}while(h);oy=!1}}function e7(){GB()}function GB(){ax=ly=!1;var c=0;ac!==0&&u7()&&(c=ac);for(var A=ft(),h=null,g=rx;g!==null;){var S=g.next,I=KB(g,A);I===0?(g.next=null,h===null?rx=S:h.next=S,S===null&&(Ou=h)):(h=g,(c!==0||(I&3)!==0)&&(ax=!0)),g=S}Ra!==0&&Ra!==5||R0(c),ac!==0&&(ac=0)}function KB(c,A){for(var h=c.suspendedLanes,g=c.pingedLanes,S=c.expirationTimes,I=c.pendingLanes&-62914561;0<I;){var V=31-Nr(I),se=1<<V,pe=S[V];pe===-1?((se&h)===0||(se&g)!==0)&&(S[V]=qc(se,A)):pe<=A&&(c.expiredLanes|=se),I&=~se}if(A=vr,h=Qt,h=el(c,c===A?h:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),g=c.callbackNode,h===0||c===A&&(ir===2||ir===9)||c.cancelPendingCommit!==null)return g!==null&&g!==null&&at(g),c.callbackNode=null,c.callbackPriority=0;if((h&3)===0||_i(c,h)){if(A=h&-h,A===c.callbackPriority)return A;switch(g!==null&&at(g),tt(h)){case 2:case 8:h=fa;break;case 32:h=Ut;break;case 268435456:h=st;break;default:h=Ut}return g=qB.bind(null,c),h=it(h,g),c.callbackPriority=A,c.callbackNode=h,A}return g!==null&&g!==null&&at(g),c.callbackPriority=2,c.callbackNode=null,2}function qB(c,A){if(Ra!==0&&Ra!==5)return c.callbackNode=null,c.callbackPriority=0,null;var h=c.callbackNode;if(tx()&&c.callbackNode!==h)return null;var g=Qt;return g=el(c,c===vr?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),g===0?null:(BB(c,g,A),KB(c,ft()),c.callbackNode!=null&&c.callbackNode===h?qB.bind(null,c):null)}function WB(c,A){if(tx())return null;BB(c,A,!0)}function t7(){f7(function(){(ar&6)!==0?it(Ar,e7):GB()})}function cy(){if(ac===0){var c=Nu;c===0&&(c=ks,ks<<=1,(ks&261888)===0&&(ks=256)),ac=c}return ac}function YB(c){return c==null||typeof c=="symbol"||typeof c=="boolean"?null:typeof c=="function"?c:uh(""+c)}function XB(c,A){var h=A.ownerDocument.createElement("input");return h.name=A.name,h.value=A.value,c.id&&h.setAttribute("form",c.id),A.parentNode.insertBefore(h,A),c=new FormData(c),h.parentNode.removeChild(h),c}function r7(c,A,h,g,S){if(A==="submit"&&h&&h.stateNode===S){var I=YB((S[ue]||null).action),V=g.submitter;V&&(A=(A=V[ue]||null)?YB(A.formAction):V.getAttribute("formAction"),A!==null&&(I=A,V=null));var se=new hh("action","action",null,g,S);c.push({event:se,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(ac!==0){var pe=V?XB(S,V):new FormData(S);B1(h,{pending:!0,data:pe,method:S.method,action:I},null,pe)}}else typeof I=="function"&&(se.preventDefault(),pe=V?XB(S,V):new FormData(S),B1(h,{pending:!0,data:pe,method:S.method,action:I},I,pe))},currentTarget:S}]})}}for(var dy=0;dy<Gv.length;dy++){var uy=Gv[dy],a7=uy.toLowerCase(),n7=uy[0].toUpperCase()+uy.slice(1);Ti(a7,"on"+n7)}Ti(SS,"onAnimationEnd"),Ti(BS,"onAnimationIteration"),Ti(_S,"onAnimationStart"),Ti("dblclick","onDoubleClick"),Ti("focusin","onFocus"),Ti("focusout","onBlur"),Ti(v$,"onTransitionRun"),Ti(y$,"onTransitionStart"),Ti(w$,"onTransitionCancel"),Ti(TS,"onTransitionEnd"),Gs("onMouseEnter",["mouseout","mouseover"]),Gs("onMouseLeave",["mouseout","mouseover"]),Gs("onPointerEnter",["pointerout","pointerover"]),Gs("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 O0="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(" "),s7=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(O0));function JB(c,A){A=(A&4)!==0;for(var h=0;h<c.length;h++){var g=c[h],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],pe=se.instance,ke=se.currentTarget;if(se=se.listener,pe!==I&&S.isPropagationStopped())break e;I=se,S.currentTarget=ke;try{I(S)}catch(Pe){gh(Pe)}S.currentTarget=null,I=pe}else for(V=0;V<g.length;V++){if(se=g[V],pe=se.instance,ke=se.currentTarget,se=se.listener,pe!==I&&S.isPropagationStopped())break e;I=se,S.currentTarget=ke;try{I(S)}catch(Pe){gh(Pe)}S.currentTarget=null,I=pe}}}}function Lt(c,A){var h=A[we];h===void 0&&(h=A[we]=new Set);var g=c+"__bubble";h.has(g)||(ZB(A,c,2,!1),h.add(g))}function Ay(c,A,h){var g=0;A&&(g|=4),ZB(h,c,g,A)}var nx="_reactListening"+Math.random().toString(36).slice(2);function fy(c){if(!c[nx]){c[nx]=!0,Cr.forEach(function(h){h!=="selectionchange"&&(s7.has(h)||Ay(h,!1,c),Ay(h,!0,c))});var A=c.nodeType===9?c:c.ownerDocument;A===null||A[nx]||(A[nx]=!0,Ay("selectionchange",!1,A))}}function ZB(c,A,h,g){switch(S_(A)){case 2:var S=F7;break;case 8:S=D7;break;default:S=Sy}h=S.bind(null,A,h,c),S=void 0,!Fv||A!=="touchstart"&&A!=="touchmove"&&A!=="wheel"||(S=!0),g?S!==void 0?c.addEventListener(A,h,{capture:!0,passive:S}):c.addEventListener(A,h,!0):S!==void 0?c.addEventListener(A,h,{passive:S}):c.addEventListener(A,h,!1)}function py(c,A,h,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 pe=V.tag;if((pe===3||pe===4)&&V.stateNode.containerInfo===S)return;V=V.return}for(;se!==null;){if(V=Ke(se),V===null)return;if(pe=V.tag,pe===5||pe===6||pe===26||pe===27){g=I=V;continue e}se=se.parentNode}}g=g.return}nS(function(){var ke=I,Pe=Tv(h),Qe=[];e:{var Be=IS.get(c);if(Be!==void 0){var Fe=hh,ot=c;switch(c){case"keypress":if(fh(h)===0)break e;case"keydown":case"keyup":Fe=Jz;break;case"focusin":ot="focus",Fe=Rv;break;case"focusout":ot="blur",Fe=Rv;break;case"beforeblur":case"afterblur":Fe=Rv;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Fe=lS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Fe=Lz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Fe=t$;break;case SS:case BS:case _S:Fe=zz;break;case TS:Fe=a$;break;case"scroll":case"scrollend":Fe=Oz;break;case"wheel":Fe=s$;break;case"copy":case"cut":case"paste":Fe=Vz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Fe=cS;break;case"toggle":case"beforetoggle":Fe=l$}var bt=(A&4)!==0,xr=!bt&&(c==="scroll"||c==="scrollend"),ge=bt?Be!==null?Be+"Capture":null:Be;bt=[];for(var xe=ke,Ce;xe!==null;){var Le=xe;if(Ce=Le.stateNode,Le=Le.tag,Le!==5&&Le!==26&&Le!==27||Ce===null||ge===null||(Le=i0(xe,ge),Le!=null&&bt.push(P0(xe,Le,Ce))),xr)break;xe=xe.return}0<bt.length&&(Be=new Fe(Be,ot,null,h,Pe),Qe.push({event:Be,listeners:bt}))}}if((A&7)===0){e:{if(Be=c==="mouseover"||c==="pointerover",Fe=c==="mouseout"||c==="pointerout",Be&&h!==_v&&(ot=h.relatedTarget||h.fromElement)&&(Ke(ot)||ot[Ae]))break e;if((Fe||Be)&&(Be=Pe.window===Pe?Pe:(Be=Pe.ownerDocument)?Be.defaultView||Be.parentWindow:window,Fe?(ot=h.relatedTarget||h.toElement,Fe=ke,ot=ot?Ke(ot):null,ot!==null&&(xr=i(ot),bt=ot.tag,ot!==xr||bt!==5&&bt!==27&&bt!==6)&&(ot=null)):(Fe=null,ot=ke),Fe!==ot)){if(bt=lS,Le="onMouseLeave",ge="onMouseEnter",xe="mouse",(c==="pointerout"||c==="pointerover")&&(bt=cS,Le="onPointerLeave",ge="onPointerEnter",xe="pointer"),xr=Fe==null?Be:$e(Fe),Ce=ot==null?Be:$e(ot),Be=new bt(Le,xe+"leave",Fe,h,Pe),Be.target=xr,Be.relatedTarget=Ce,Le=null,Ke(Pe)===ke&&(bt=new bt(ge,xe+"enter",ot,h,Pe),bt.target=Ce,bt.relatedTarget=xr,Le=bt),xr=Le,Fe&&ot)t:{for(bt=i7,ge=Fe,xe=ot,Ce=0,Le=ge;Le;Le=bt(Le))Ce++;Le=0;for(var pt=xe;pt;pt=bt(pt))Le++;for(;0<Ce-Le;)ge=bt(ge),Ce--;for(;0<Le-Ce;)xe=bt(xe),Le--;for(;Ce--;){if(ge===xe||xe!==null&&ge===xe.alternate){bt=ge;break t}ge=bt(ge),xe=bt(xe)}bt=null}else bt=null;Fe!==null&&e_(Qe,Be,Fe,bt,!1),ot!==null&&xr!==null&&e_(Qe,xr,ot,bt,!0)}}e:{if(Be=ke?$e(ke):window,Fe=Be.nodeName&&Be.nodeName.toLowerCase(),Fe==="select"||Fe==="input"&&Be.type==="file")var Xt=mS;else if(hS(Be))if(gS)Xt=m$;else{Xt=h$;var ut=p$}else Fe=Be.nodeName,!Fe||Fe.toLowerCase()!=="input"||Be.type!=="checkbox"&&Be.type!=="radio"?ke&&Bv(ke.elementType)&&(Xt=mS):Xt=x$;if(Xt&&(Xt=Xt(c,ke))){xS(Qe,Xt,h,Pe);break e}ut&&ut(c,Be,ke),c==="focusout"&&ke&&Be.type==="number"&&ke.memoizedProps.value!=null&&Sv(Be,"number",Be.value)}switch(ut=ke?$e(ke):window,c){case"focusin":(hS(ut)||ut.contentEditable==="true")&&(hu=ut,zv=ke,p0=null);break;case"focusout":p0=zv=hu=null;break;case"mousedown":$v=!0;break;case"contextmenu":case"mouseup":case"dragend":$v=!1,jS(Qe,h,Pe);break;case"selectionchange":if(b$)break;case"keydown":case"keyup":jS(Qe,h,Pe)}var Ft;if(Pv)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 pu?fS(c,h)&&(Ht="onCompositionEnd"):c==="keydown"&&h.keyCode===229&&(Ht="onCompositionStart");Ht&&(dS&&h.locale!=="ko"&&(pu||Ht!=="onCompositionStart"?Ht==="onCompositionEnd"&&pu&&(Ft=sS()):(Qo=Pe,Dv="value"in Qo?Qo.value:Qo.textContent,pu=!0)),ut=sx(ke,Ht),0<ut.length&&(Ht=new oS(Ht,c,null,h,Pe),Qe.push({event:Ht,listeners:ut}),Ft?Ht.data=Ft:(Ft=pS(h),Ft!==null&&(Ht.data=Ft)))),(Ft=c$?d$(c,h):u$(c,h))&&(Ht=sx(ke,"onBeforeInput"),0<Ht.length&&(ut=new oS("onBeforeInput","beforeinput",null,h,Pe),Qe.push({event:ut,listeners:Ht}),ut.data=Ft)),r7(Qe,c,ke,h,Pe)}JB(Qe,A)})}function P0(c,A,h){return{instance:c,listener:A,currentTarget:h}}function sx(c,A){for(var h=A+"Capture",g=[];c!==null;){var S=c,I=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||I===null||(S=i0(c,h),S!=null&&g.unshift(P0(c,S,I)),S=i0(c,A),S!=null&&g.push(P0(c,S,I))),c.tag===3)return g;c=c.return}return[]}function i7(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5&&c.tag!==27);return c||null}function e_(c,A,h,g,S){for(var I=A._reactName,V=[];h!==null&&h!==g;){var se=h,pe=se.alternate,ke=se.stateNode;if(se=se.tag,pe!==null&&pe===g)break;se!==5&&se!==26&&se!==27||ke===null||(pe=ke,S?(ke=i0(h,I),ke!=null&&V.unshift(P0(h,ke,pe))):S||(ke=i0(h,I),ke!=null&&V.push(P0(h,ke,pe)))),h=h.return}V.length!==0&&c.push({event:A,listeners:V})}var l7=/\r\n?/g,o7=/\u0000|\uFFFD/g;function t_(c){return(typeof c=="string"?c:""+c).replace(l7,`
`).replace(o7,"")}function r_(c,A){return A=t_(A),t_(c)===A}function hr(c,A,h,g,S,I){switch(h){case"children":typeof g=="string"?A==="body"||A==="textarea"&&g===""||uu(c,g):(typeof g=="number"||typeof g=="bigint")&&A!=="body"&&uu(c,""+g);break;case"className":ch(c,"class",g);break;case"tabIndex":ch(c,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":ch(c,h,g);break;case"style":rS(c,g,I);break;case"data":if(A!=="object"){ch(c,"data",g);break}case"src":case"href":if(g===""&&(A!=="a"||h!=="href")){c.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){c.removeAttribute(h);break}g=uh(""+g),c.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){c.setAttribute(h,"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"&&(h==="formAction"?(A!=="input"&&hr(c,A,"name",S.name,S,null),hr(c,A,"formEncType",S.formEncType,S,null),hr(c,A,"formMethod",S.formMethod,S,null),hr(c,A,"formTarget",S.formTarget,S,null)):(hr(c,A,"encType",S.encType,S,null),hr(c,A,"method",S.method,S,null),hr(c,A,"target",S.target,S,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){c.removeAttribute(h);break}g=uh(""+g),c.setAttribute(h,g);break;case"onClick":g!=null&&(c.onclick=Ml);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(h=g.__html,h!=null){if(S.children!=null)throw Error(a(60));c.innerHTML=h}}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}h=uh(""+g),c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);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(h,""+g):c.removeAttribute(h);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(h,""):c.removeAttribute(h);break;case"capture":case"download":g===!0?c.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?c.setAttribute(h,g):c.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?c.setAttribute(h,g):c.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?c.removeAttribute(h):c.setAttribute(h,g);break;case"popover":Lt("beforetoggle",c),Lt("toggle",c),as(c,"popover",g);break;case"xlinkActuate":Ul(c,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Ul(c,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Ul(c,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Ul(c,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Ul(c,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Ul(c,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Ul(c,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Ul(c,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Ul(c,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":as(c,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=Mz.get(h)||h,as(c,h,g))}}function hy(c,A,h,g,S,I){switch(h){case"style":rS(c,g,I);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(a(61));if(h=g.__html,h!=null){if(S.children!=null)throw Error(a(60));c.innerHTML=h}}break;case"children":typeof g=="string"?uu(c,g):(typeof g=="number"||typeof g=="bigint")&&uu(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=Ml);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!kr.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(S=h.endsWith("Capture"),A=h.slice(2,S?h.length-7:void 0),I=c[ue]||null,I=I!=null?I[h]:null,typeof I=="function"&&c.removeEventListener(A,I,S),typeof g=="function")){typeof I!="function"&&I!==null&&(h in c?c[h]=null:c.hasAttribute(h)&&c.removeAttribute(h)),c.addEventListener(A,g,S);break e}h in c?c[h]=g:g===!0?c.setAttribute(h,""):as(c,h,g)}}}function pn(c,A,h){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 h)if(h.hasOwnProperty(I)){var V=h[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:hr(c,A,I,V,h,null)}}S&&hr(c,A,"srcSet",h.srcSet,h,null),g&&hr(c,A,"src",h.src,h,null);return;case"input":Lt("invalid",c);var se=I=V=S=null,pe=null,ke=null;for(g in h)if(h.hasOwnProperty(g)){var Pe=h[g];if(Pe!=null)switch(g){case"name":S=Pe;break;case"type":V=Pe;break;case"checked":pe=Pe;break;case"defaultChecked":ke=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:hr(c,A,g,Pe,h,null)}}JE(c,I,se,pe,ke,V,S,!1);return;case"select":Lt("invalid",c),g=V=I=null;for(S in h)if(h.hasOwnProperty(S)&&(se=h[S],se!=null))switch(S){case"value":I=se;break;case"defaultValue":V=se;break;case"multiple":g=se;default:hr(c,A,S,se,h,null)}A=I,h=V,c.multiple=!!g,A!=null?du(c,!!g,A,!1):h!=null&&du(c,!!g,h,!0);return;case"textarea":Lt("invalid",c),I=S=g=null;for(V in h)if(h.hasOwnProperty(V)&&(se=h[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:hr(c,A,V,se,h,null)}eS(c,g,S,I);return;case"option":for(pe in h)if(h.hasOwnProperty(pe)&&(g=h[pe],g!=null))switch(pe){case"selected":c.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:hr(c,A,pe,g,h,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<O0.length;g++)Lt(O0[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(ke in h)if(h.hasOwnProperty(ke)&&(g=h[ke],g!=null))switch(ke){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,A));default:hr(c,A,ke,g,h,null)}return;default:if(Bv(A)){for(Pe in h)h.hasOwnProperty(Pe)&&(g=h[Pe],g!==void 0&&hy(c,A,Pe,g,h,void 0));return}}for(se in h)h.hasOwnProperty(se)&&(g=h[se],g!=null&&hr(c,A,se,g,h,null))}function c7(c,A,h,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,pe=null,ke=null,Pe=null;for(Fe in h){var Qe=h[Fe];if(h.hasOwnProperty(Fe)&&Qe!=null)switch(Fe){case"checked":break;case"value":break;case"defaultValue":pe=Qe;default:g.hasOwnProperty(Fe)||hr(c,A,Fe,null,g,Qe)}}for(var Be in g){var Fe=g[Be];if(Qe=h[Be],g.hasOwnProperty(Be)&&(Fe!=null||Qe!=null))switch(Be){case"type":I=Fe;break;case"name":S=Fe;break;case"checked":ke=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&&hr(c,A,Be,Fe,g,Qe)}}Ev(c,V,se,pe,ke,Pe,I,S);return;case"select":Fe=V=se=Be=null;for(I in h)if(pe=h[I],h.hasOwnProperty(I)&&pe!=null)switch(I){case"value":break;case"multiple":Fe=pe;default:g.hasOwnProperty(I)||hr(c,A,I,null,g,pe)}for(S in g)if(I=g[S],pe=h[S],g.hasOwnProperty(S)&&(I!=null||pe!=null))switch(S){case"value":Be=I;break;case"defaultValue":se=I;break;case"multiple":V=I;default:I!==pe&&hr(c,A,S,I,g,pe)}A=se,h=V,g=Fe,Be!=null?du(c,!!h,Be,!1):!!g!=!!h&&(A!=null?du(c,!!h,A,!0):du(c,!!h,h?[]:"",!1));return;case"textarea":Fe=Be=null;for(se in h)if(S=h[se],h.hasOwnProperty(se)&&S!=null&&!g.hasOwnProperty(se))switch(se){case"value":break;case"children":break;default:hr(c,A,se,null,g,S)}for(V in g)if(S=g[V],I=h[V],g.hasOwnProperty(V)&&(S!=null||I!=null))switch(V){case"value":Be=S;break;case"defaultValue":Fe=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(a(91));break;default:S!==I&&hr(c,A,V,S,g,I)}ZE(c,Be,Fe);return;case"option":for(var ot in h)if(Be=h[ot],h.hasOwnProperty(ot)&&Be!=null&&!g.hasOwnProperty(ot))switch(ot){case"selected":c.selected=!1;break;default:hr(c,A,ot,null,g,Be)}for(pe in g)if(Be=g[pe],Fe=h[pe],g.hasOwnProperty(pe)&&Be!==Fe&&(Be!=null||Fe!=null))switch(pe){case"selected":c.selected=Be&&typeof Be!="function"&&typeof Be!="symbol";break;default:hr(c,A,pe,Be,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 h)Be=h[bt],h.hasOwnProperty(bt)&&Be!=null&&!g.hasOwnProperty(bt)&&hr(c,A,bt,null,g,Be);for(ke in g)if(Be=g[ke],Fe=h[ke],g.hasOwnProperty(ke)&&Be!==Fe&&(Be!=null||Fe!=null))switch(ke){case"children":case"dangerouslySetInnerHTML":if(Be!=null)throw Error(a(137,A));break;default:hr(c,A,ke,Be,g,Fe)}return;default:if(Bv(A)){for(var xr in h)Be=h[xr],h.hasOwnProperty(xr)&&Be!==void 0&&!g.hasOwnProperty(xr)&&hy(c,A,xr,void 0,g,Be);for(Pe in g)Be=g[Pe],Fe=h[Pe],!g.hasOwnProperty(Pe)||Be===Fe||Be===void 0&&Fe===void 0||hy(c,A,Pe,Be,g,Fe);return}}for(var ge in h)Be=h[ge],h.hasOwnProperty(ge)&&Be!=null&&!g.hasOwnProperty(ge)&&hr(c,A,ge,null,g,Be);for(Qe in g)Be=g[Qe],Fe=h[Qe],!g.hasOwnProperty(Qe)||Be===Fe||Be==null&&Fe==null||hr(c,A,Qe,Be,g,Fe)}function a_(c){switch(c){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function d7(){if(typeof performance.getEntriesByType=="function"){for(var c=0,A=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var S=h[g],I=S.transferSize,V=S.initiatorType,se=S.duration;if(I&&se&&a_(V)){for(V=0,se=S.responseEnd,g+=1;g<h.length;g++){var pe=h[g],ke=pe.startTime;if(ke>se)break;var Pe=pe.transferSize,Qe=pe.initiatorType;Pe&&a_(Qe)&&(pe=pe.responseEnd,V+=Pe*(pe<se?1:(se-ke)/(pe-ke)))}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 xy=null,my=null;function ix(c){return c.nodeType===9?c:c.ownerDocument}function n_(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 s_(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 gy(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 by=null;function u7(){var c=window.event;return c&&c.type==="popstate"?c===by?!1:(by=c,!0):(by=null,!1)}var i_=typeof setTimeout=="function"?setTimeout:void 0,A7=typeof clearTimeout=="function"?clearTimeout:void 0,l_=typeof Promise=="function"?Promise:void 0,f7=typeof queueMicrotask=="function"?queueMicrotask:typeof l_<"u"?function(c){return l_.resolve(null).then(c).catch(p7)}:i_;function p7(c){setTimeout(function(){throw c})}function nc(c){return c==="head"}function o_(c,A){var h=A,g=0;do{var S=h.nextSibling;if(c.removeChild(h),S&&S.nodeType===8)if(h=S.data,h==="/$"||h==="/&"){if(g===0){c.removeChild(S),Hu(A);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")L0(c.ownerDocument.documentElement);else if(h==="head"){h=c.ownerDocument.head,L0(h);for(var I=h.firstChild;I;){var V=I.nextSibling,se=I.nodeName;I[Se]||se==="SCRIPT"||se==="STYLE"||se==="LINK"&&I.rel.toLowerCase()==="stylesheet"||h.removeChild(I),I=V}}else h==="body"&&L0(c.ownerDocument.body);h=S}while(h);Hu(A)}function c_(c,A){var h=c;c=0;do{var g=h.nextSibling;if(h.nodeType===1?A?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(A?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(c===0)break;c--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||c++;h=g}while(h)}function vy(c){var A=c.firstChild;for(A&&A.nodeType===10&&(A=A.nextSibling);A;){var h=A;switch(A=A.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":vy(h),ze(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}c.removeChild(h)}}function h7(c,A,h,g){for(;c.nodeType===1;){var S=h;if(c.nodeName.toLowerCase()!==A.toLowerCase()){if(!g&&(c.nodeName!=="INPUT"||c.type!=="hidden"))break}else if(g){if(!c[Se])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=ti(c.nextSibling),c===null)break}return null}function x7(c,A,h){if(A==="")return null;for(;c.nodeType!==3;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!h||(c=ti(c.nextSibling),c===null))return null;return c}function d_(c,A){for(;c.nodeType!==8;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!A||(c=ti(c.nextSibling),c===null))return null;return c}function yy(c){return c.data==="$?"||c.data==="$~"}function wy(c){return c.data==="$!"||c.data==="$?"&&c.ownerDocument.readyState!=="loading"}function m7(c,A){var h=c.ownerDocument;if(c.data==="$~")c._reactRetry=A;else if(c.data!=="$?"||h.readyState!=="loading")A();else{var g=function(){A(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),c._reactRetry=g}}function ti(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 Ny=null;function u_(c){c=c.nextSibling;for(var A=0;c;){if(c.nodeType===8){var h=c.data;if(h==="/$"||h==="/&"){if(A===0)return ti(c.nextSibling);A--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||A++}c=c.nextSibling}return null}function A_(c){c=c.previousSibling;for(var A=0;c;){if(c.nodeType===8){var h=c.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(A===0)return c;A--}else h!=="/$"&&h!=="/&"||A++}c=c.previousSibling}return null}function f_(c,A,h){switch(A=ix(h),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 L0(c){for(var A=c.attributes;A.length;)c.removeAttributeNode(A[0]);ze(c)}var ri=new Map,p_=new Set;function lx(c){return typeof c.getRootNode=="function"?c.getRootNode():c.nodeType===9?c:c.ownerDocument}var Jl=K.d;K.d={f:g7,r:b7,D:v7,C:y7,L:w7,m:N7,X:k7,S:C7,M:j7};function g7(){var c=Jl.f(),A=Jh();return c||A}function b7(c){var A=Ze(c);A!==null&&A.tag===5&&A.type==="form"?T4(A):Jl.r(c)}var Pu=typeof document>"u"?null:document;function h_(c,A,h){var g=Pu;if(g&&typeof A=="string"&&A){var S=qs(A);S='link[rel="'+c+'"][href="'+S+'"]',typeof h=="string"&&(S+='[crossorigin="'+h+'"]'),p_.has(S)||(p_.add(S),c={rel:c,crossOrigin:h,href:A},g.querySelector(S)===null&&(A=g.createElement("link"),pn(A,"link",c),dt(A),g.head.appendChild(A)))}}function v7(c){Jl.D(c),h_("dns-prefetch",c,null)}function y7(c,A){Jl.C(c,A),h_("preconnect",c,A)}function w7(c,A,h){Jl.L(c,A,h);var g=Pu;if(g&&c&&A){var S='link[rel="preload"][as="'+qs(A)+'"]';A==="image"&&h&&h.imageSrcSet?(S+='[imagesrcset="'+qs(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(S+='[imagesizes="'+qs(h.imageSizes)+'"]')):S+='[href="'+qs(c)+'"]';var I=S;switch(A){case"style":I=Lu(c);break;case"script":I=Qu(c)}ri.has(I)||(c=p({rel:"preload",href:A==="image"&&h&&h.imageSrcSet?void 0:c,as:A},h),ri.set(I,c),g.querySelector(S)!==null||A==="style"&&g.querySelector(Q0(I))||A==="script"&&g.querySelector(H0(I))||(A=g.createElement("link"),pn(A,"link",c),dt(A),g.head.appendChild(A)))}}function N7(c,A){Jl.m(c,A);var h=Pu;if(h&&c){var g=A&&typeof A.as=="string"?A.as:"script",S='link[rel="modulepreload"][as="'+qs(g)+'"][href="'+qs(c)+'"]',I=S;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":I=Qu(c)}if(!ri.has(I)&&(c=p({rel:"modulepreload",href:c},A),ri.set(I,c),h.querySelector(S)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(H0(I)))return}g=h.createElement("link"),pn(g,"link",c),dt(g),h.head.appendChild(g)}}}function C7(c,A,h){Jl.S(c,A,h);var g=Pu;if(g&&c){var S=Je(g).hoistableStyles,I=Lu(c);A=A||"default";var V=S.get(I);if(!V){var se={loading:0,preload:null};if(V=g.querySelector(Q0(I)))se.loading=5;else{c=p({rel:"stylesheet",href:c,"data-precedence":A},h),(h=ri.get(I))&&Cy(c,h);var pe=V=g.createElement("link");dt(pe),pn(pe,"link",c),pe._p=new Promise(function(ke,Pe){pe.onload=ke,pe.onerror=Pe}),pe.addEventListener("load",function(){se.loading|=1}),pe.addEventListener("error",function(){se.loading|=2}),se.loading|=4,ox(V,A,g)}V={type:"stylesheet",instance:V,count:1,state:se},S.set(I,V)}}}function k7(c,A){Jl.X(c,A);var h=Pu;if(h&&c){var g=Je(h).hoistableScripts,S=Qu(c),I=g.get(S);I||(I=h.querySelector(H0(S)),I||(c=p({src:c,async:!0},A),(A=ri.get(S))&&ky(c,A),I=h.createElement("script"),dt(I),pn(I,"link",c),h.head.appendChild(I)),I={type:"script",instance:I,count:1,state:null},g.set(S,I))}}function j7(c,A){Jl.M(c,A);var h=Pu;if(h&&c){var g=Je(h).hoistableScripts,S=Qu(c),I=g.get(S);I||(I=h.querySelector(H0(S)),I||(c=p({src:c,async:!0,type:"module"},A),(A=ri.get(S))&&ky(c,A),I=h.createElement("script"),dt(I),pn(I,"link",c),h.head.appendChild(I)),I={type:"script",instance:I,count:1,state:null},g.set(S,I))}}function x_(c,A,h,g){var S=(S=re.current)?lx(S):null;if(!S)throw Error(a(446));switch(c){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(A=Lu(h.href),h=Je(S).hoistableStyles,g=h.get(A),g||(g={type:"style",instance:null,count:0,state:null},h.set(A,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){c=Lu(h.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(Q0(c)))&&!I._p&&(V.instance=I,V.state.loading=5),ri.has(c)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},ri.set(c,h),I||E7(S,c,h,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=h.async,h=h.src,typeof h=="string"&&A&&typeof A!="function"&&typeof A!="symbol"?(A=Qu(h),h=Je(S).hoistableScripts,g=h.get(A),g||(g={type:"script",instance:null,count:0,state:null},h.set(A,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,c))}}function Lu(c){return'href="'+qs(c)+'"'}function Q0(c){return'link[rel="stylesheet"]['+c+"]"}function m_(c){return p({},c,{"data-precedence":c.precedence,precedence:null})}function E7(c,A,h,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",h),dt(A),c.head.appendChild(A))}function Qu(c){return'[src="'+qs(c)+'"]'}function H0(c){return"script[async]"+c}function g_(c,A,h){if(A.count++,A.instance===null)switch(A.type){case"style":var g=c.querySelector('style[data-href~="'+qs(h.href)+'"]');if(g)return A.instance=g,dt(g),g;var S=p({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(c.ownerDocument||c).createElement("style"),dt(g),pn(g,"style",S),ox(g,h.precedence,c),A.instance=g;case"stylesheet":S=Lu(h.href);var I=c.querySelector(Q0(S));if(I)return A.state.loading|=4,A.instance=I,dt(I),I;g=m_(h),(S=ri.get(S))&&Cy(g,S),I=(c.ownerDocument||c).createElement("link"),dt(I);var V=I;return V._p=new Promise(function(se,pe){V.onload=se,V.onerror=pe}),pn(I,"link",g),A.state.loading|=4,ox(I,h.precedence,c),A.instance=I;case"script":return I=Qu(h.src),(S=c.querySelector(H0(I)))?(A.instance=S,dt(S),S):(g=h,(S=ri.get(I))&&(g=p({},h),ky(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,ox(g,h.precedence,c));return A.instance}function ox(c,A,h){for(var g=h.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=h.nodeType===9?h.head:h,A.insertBefore(c,A.firstChild))}function Cy(c,A){c.crossOrigin==null&&(c.crossOrigin=A.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=A.referrerPolicy),c.title==null&&(c.title=A.title)}function ky(c,A){c.crossOrigin==null&&(c.crossOrigin=A.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=A.referrerPolicy),c.integrity==null&&(c.integrity=A.integrity)}var cx=null;function b_(c,A,h){if(cx===null){var g=new Map,S=cx=new Map;S.set(h,g)}else S=cx,g=S.get(h),g||(g=new Map,S.set(h,g));if(g.has(c))return g;for(g.set(c,null),h=h.getElementsByTagName(c),S=0;S<h.length;S++){var I=h[S];if(!(I[Se]||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 v_(c,A,h){c=c.ownerDocument||c,c.head.insertBefore(h,A==="title"?c.querySelector("head > title"):null)}function S7(c,A,h){if(h===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 y_(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function B7(c,A,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var S=Lu(g.href),I=A.querySelector(Q0(S));if(I){A=I._p,A!==null&&typeof A=="object"&&typeof A.then=="function"&&(c.count++,c=dx.bind(c),A.then(c,c)),h.state.loading|=4,h.instance=I,dt(I);return}I=A.ownerDocument||A,g=m_(g),(S=ri.get(S))&&Cy(g,S),I=I.createElement("link"),dt(I);var V=I;V._p=new Promise(function(se,pe){V.onload=se,V.onerror=pe}),pn(I,"link",g),h.instance=I}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(h,A),(A=h.state.preload)&&(h.state.loading&3)===0&&(c.count++,h=dx.bind(c),A.addEventListener("load",h),A.addEventListener("error",h))}}var jy=0;function _7(c,A){return c.stylesheets&&c.count===0&&Ax(c,c.stylesheets),0<c.count||0<c.imgCount?function(h){var g=setTimeout(function(){if(c.stylesheets&&Ax(c,c.stylesheets),c.unsuspend){var I=c.unsuspend;c.unsuspend=null,I()}},6e4+A);0<c.imgBytes&&jy===0&&(jy=62500*d7());var S=setTimeout(function(){if(c.waitingForImages=!1,c.count===0&&(c.stylesheets&&Ax(c,c.stylesheets),c.unsuspend)){var I=c.unsuspend;c.unsuspend=null,I()}},(c.imgBytes>jy?50:800)+A);return c.unsuspend=h,function(){c.unsuspend=null,clearTimeout(g),clearTimeout(S)}}:null}function dx(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ax(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var ux=null;function Ax(c,A){c.stylesheets=null,c.unsuspend!==null&&(c.count++,ux=new Map,A.forEach(T7,c),ux=null,dx.call(c))}function T7(c,A){if(!(A.state.loading&4)){var h=ux.get(c);if(h)var g=h.get(null);else{h=new Map,ux.set(c,h);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")&&(h.set(V.dataset.precedence,V),g=V)}g&&h.set(null,g)}S=A.instance,V=S.getAttribute("data-precedence"),I=h.get(V)||g,I===g&&h.set(null,S),h.set(V,S),this.count++,g=dx.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 z0={$$typeof:C,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function I7(c,A,h,g,S,I,V,se,pe){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=Dl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dl(0),this.hiddenUpdates=Dl(null),this.identifierPrefix=g,this.onUncaughtError=S,this.onCaughtError=I,this.onRecoverableError=V,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=pe,this.incompleteTransitions=new Map}function w_(c,A,h,g,S,I,V,se,pe,ke,Pe,Qe){return c=new I7(c,A,h,V,pe,ke,Pe,Qe,se),A=1,I===!0&&(A|=24),I=Es(3,null,null,A),c.current=I,I.stateNode=c,A=s1(),A.refCount++,c.pooledCache=A,A.refCount++,I.memoizedState={element:g,isDehydrated:h,cache:A},c1(I),c}function N_(c){return c?(c=gu,c):gu}function C_(c,A,h,g,S,I){S=N_(S),g.context===null?g.context=S:g.pendingContext=S,g=Ko(A),g.payload={element:h},I=I===void 0?null:I,I!==null&&(g.callback=I),h=qo(c,g,A),h!==null&&(cs(h,c,A),y0(h,c,A))}function k_(c,A){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var h=c.retryLane;c.retryLane=h!==0&&h<A?h:A}}function Ey(c,A){k_(c,A),(c=c.alternate)&&k_(c,A)}function j_(c){if(c.tag===13||c.tag===31){var A=Zc(c,67108864);A!==null&&cs(A,c,67108864),Ey(c,67108864)}}function E_(c){if(c.tag===13||c.tag===31){var A=Is();A=We(A);var h=Zc(c,A);h!==null&&cs(h,c,A),Ey(c,A)}}var fx=!0;function F7(c,A,h,g){var S=Y.T;Y.T=null;var I=K.p;try{K.p=2,Sy(c,A,h,g)}finally{K.p=I,Y.T=S}}function D7(c,A,h,g){var S=Y.T;Y.T=null;var I=K.p;try{K.p=8,Sy(c,A,h,g)}finally{K.p=I,Y.T=S}}function Sy(c,A,h,g){if(fx){var S=By(g);if(S===null)py(c,A,g,px,h),B_(c,g);else if(M7(S,c,A,h,g))g.stopPropagation();else if(B_(c,g),A&4&&-1<U7.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 pe=1<<31-Nr(V);se.entanglements[1]|=pe,V&=~pe}sl(I),(ar&6)===0&&(Yh=ft()+500,R0(0))}}break;case 31:case 13:se=Zc(I,2),se!==null&&cs(se,I,2),Jh(),Ey(I,2)}if(I=By(g),I===null&&py(c,A,g,px,h),I===S)break;S=I}S!==null&&g.stopPropagation()}else py(c,A,g,null,h)}}function By(c){return c=Tv(c),_y(c)}var px=null;function _y(c){if(px=null,c=Ke(c),c!==null){var A=i(c);if(A===null)c=null;else{var h=A.tag;if(h===13){if(c=l(A),c!==null)return c;c=null}else if(h===31){if(c=o(A),c!==null)return c;c=null}else if(h===3){if(A.stateNode.current.memoizedState.isDehydrated)return A.tag===3?A.stateNode.containerInfo:null;c=null}else A!==c&&(c=null)}}return px=c,null}function S_(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(Br()){case Ar:return 2;case fa:return 8;case Ut:case _r:return 32;case st:return 268435456;default:return 32}default:return 32}}var Ty=!1,sc=null,ic=null,lc=null,$0=new Map,V0=new Map,oc=[],U7="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 B_(c,A){switch(c){case"focusin":case"focusout":sc=null;break;case"dragenter":case"dragleave":ic=null;break;case"mouseover":case"mouseout":lc=null;break;case"pointerover":case"pointerout":$0.delete(A.pointerId);break;case"gotpointercapture":case"lostpointercapture":V0.delete(A.pointerId)}}function G0(c,A,h,g,S,I){return c===null||c.nativeEvent!==I?(c={blockedOn:A,domEventName:h,eventSystemFlags:g,nativeEvent:I,targetContainers:[S]},A!==null&&(A=Ze(A),A!==null&&j_(A)),c):(c.eventSystemFlags|=g,A=c.targetContainers,S!==null&&A.indexOf(S)===-1&&A.push(S),c)}function M7(c,A,h,g,S){switch(A){case"focusin":return sc=G0(sc,c,A,h,g,S),!0;case"dragenter":return ic=G0(ic,c,A,h,g,S),!0;case"mouseover":return lc=G0(lc,c,A,h,g,S),!0;case"pointerover":var I=S.pointerId;return $0.set(I,G0($0.get(I)||null,c,A,h,g,S)),!0;case"gotpointercapture":return I=S.pointerId,V0.set(I,G0(V0.get(I)||null,c,A,h,g,S)),!0}return!1}function __(c){var A=Ke(c.target);if(A!==null){var h=i(A);if(h!==null){if(A=h.tag,A===13){if(A=l(h),A!==null){c.blockedOn=A,de(c.priority,function(){E_(h)});return}}else if(A===31){if(A=o(h),A!==null){c.blockedOn=A,de(c.priority,function(){E_(h)});return}}else if(A===3&&h.stateNode.current.memoizedState.isDehydrated){c.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}c.blockedOn=null}function hx(c){if(c.blockedOn!==null)return!1;for(var A=c.targetContainers;0<A.length;){var h=By(c.nativeEvent);if(h===null){h=c.nativeEvent;var g=new h.constructor(h.type,h);_v=g,h.target.dispatchEvent(g),_v=null}else return A=Ze(h),A!==null&&j_(A),c.blockedOn=h,!1;A.shift()}return!0}function T_(c,A,h){hx(c)&&h.delete(A)}function R7(){Ty=!1,sc!==null&&hx(sc)&&(sc=null),ic!==null&&hx(ic)&&(ic=null),lc!==null&&hx(lc)&&(lc=null),$0.forEach(T_),V0.forEach(T_)}function xx(c,A){c.blockedOn===A&&(c.blockedOn=null,Ty||(Ty=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,R7)))}var mx=null;function I_(c){mx!==c&&(mx=c,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){mx===c&&(mx=null);for(var A=0;A<c.length;A+=3){var h=c[A],g=c[A+1],S=c[A+2];if(typeof g!="function"){if(_y(g||h)===null)continue;break}var I=Ze(h);I!==null&&(c.splice(A,3),A-=3,B1(I,{pending:!0,data:S,method:h.method,action:g},g,S))}}))}function Hu(c){function A(pe){return xx(pe,c)}sc!==null&&xx(sc,c),ic!==null&&xx(ic,c),lc!==null&&xx(lc,c),$0.forEach(A),V0.forEach(A);for(var h=0;h<oc.length;h++){var g=oc[h];g.blockedOn===c&&(g.blockedOn=null)}for(;0<oc.length&&(h=oc[0],h.blockedOn===null);)__(h),h.blockedOn===null&&oc.shift();if(h=(c.ownerDocument||c).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var S=h[g],I=h[g+1],V=S[ue]||null;if(typeof I=="function")V||I_(h);else if(V){var se=null;if(I&&I.hasAttribute("formAction")){if(S=I,V=I[ue]||null)se=V.formAction;else if(_y(S)!==null)continue}else se=V.action;typeof se=="function"?h[g+1]=se:(h.splice(g,3),g-=3),I_(h)}}}function F_(){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(h,20)}function h(){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(h,100),function(){g=!0,navigation.removeEventListener("navigate",c),navigation.removeEventListener("navigatesuccess",A),navigation.removeEventListener("navigateerror",A),S!==null&&(S(),S=null)}}}function Iy(c){this._internalRoot=c}gx.prototype.render=Iy.prototype.render=function(c){var A=this._internalRoot;if(A===null)throw Error(a(409));var h=A.current,g=Is();C_(h,g,c,A,null,null)},gx.prototype.unmount=Iy.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var A=c.containerInfo;C_(c.current,2,null,c,null,null),Jh(),A[Ae]=null}};function gx(c){this._internalRoot=c}gx.prototype.unstable_scheduleHydration=function(c){if(c){var A=te();c={blockedOn:null,target:c,priority:A};for(var h=0;h<oc.length&&A!==0&&A<oc[h].priority;h++);oc.splice(h,0,c),h===0&&__(c)}};var D_=t.version;if(D_!=="19.2.4")throw Error(a(527,D_,"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 O7={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Y,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bx=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bx.isDisabled&&bx.supportsFiber)try{jt=bx.inject(O7),Kt=bx}catch{}}return q0.createRoot=function(c,A){if(!s(c))throw Error(a(299));var h=!1,g="",S=Q4,I=H4,V=z4;return A!=null&&(A.unstable_strictMode===!0&&(h=!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=w_(c,1,!1,null,null,h,g,null,S,I,V,F_),c[Ae]=A.current,fy(c),new Iy(A)},q0.hydrateRoot=function(c,A,h){if(!s(c))throw Error(a(299));var g=!1,S="",I=Q4,V=H4,se=z4,pe=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(S=h.identifierPrefix),h.onUncaughtError!==void 0&&(I=h.onUncaughtError),h.onCaughtError!==void 0&&(V=h.onCaughtError),h.onRecoverableError!==void 0&&(se=h.onRecoverableError),h.formState!==void 0&&(pe=h.formState)),A=w_(c,1,!0,A,h??null,g,S,pe,I,V,se,F_),A.context=N_(null),h=A.current,g=Is(),g=We(g),S=Ko(g),S.callback=null,qo(h,S,g),h=g,A.current.lanes=h,Ve(A,h),sl(A),c[Ae]=A.current,fy(c),new gx(A)},q0.version="19.2.4",q0}var $_;function X7(){if($_)return My.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(),My.exports=Y7(),My.exports}var J7=X7();const Z7=El(J7);/**
 * @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=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),tV=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,a)=>a?a.toUpperCase():r.toLowerCase()),V_=e=>{const t=tV(e);return t.charAt(0).toUpperCase()+t.slice(1)},wM=(...e)=>e.filter((t,r,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===r).join(" ").trim(),rV=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 aV={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 nV=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:a,className:s="",children:i,iconNode:l,...o},d)=>j.createElement("svg",{ref:d,...aV,width:t,height:t,stroke:e,strokeWidth:a?Number(r)*24/Number(t):r,className:wM("lucide",s),...!i&&!rV(o)&&{"aria-hidden":"true"},...o},[...l.map(([u,f])=>j.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 Te=(e,t)=>{const r=j.forwardRef(({className:a,...s},i)=>j.createElement(nV,{ref:i,iconNode:t,className:wM(`lucide-${eV(V_(e))}`,`lucide-${e}`,a),...s}));return r.displayName=V_(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 sV=[["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"}]],Ha=Te("activity",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 iV=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],lV=Te("arrow-down-right",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 oV=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],ms=Te("arrow-left",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:"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"}]],kA=Te("arrow-right-left",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 dV=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Bc=Te("arrow-right",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 uV=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],rk=Te("arrow-up-right",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:"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"}]],_f=Te("award",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=[["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=Te("banknote",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:"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"}]],NM=Te("book-open",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 hV=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],G_=Te("bookmark",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 xV=[["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"}]],K_=Te("bot",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 mV=[["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=Te("building-2",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=[["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"}]],gi=Te("calculator",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:"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"}]],CM=Te("calendar-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 vV=[["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"}]],q_=Te("calendar-days",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=[["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=Te("calendar",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:"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"}]],ak=Te("camera",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:"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"}]],po=Te("chart-column",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:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V9",key:"uvy0l4"}],["path",{d:"M19 21V3",key:"11j9sm"}]],kM=Te("chart-no-axes-column-increasing",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:"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"}]],Md=Te("chart-pie",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:"M20 6 9 17l-5-5",key:"1gmf2c"}]],W_=Te("check",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:"m6 9 6 6 6-6",key:"qrunsl"}]],nk=Te("chevron-down",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:"m9 18 6-6-6-6",key:"mthhwq"}]],Hs=Te("chevron-right",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:"m18 15-6-6-6 6",key:"153udz"}]],sk=Te("chevron-up",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=[["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=Te("circle-alert",_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=[["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"}]],IV=Te("circle-arrow-down",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 FV=[["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"}]],DV=Te("circle-arrow-up",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 UV=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Xi=Te("circle-check-big",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 MV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Gt=Te("circle-check",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 RV=[["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"}]],OV=Te("circle-play",RV);/**
 * @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:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],cb=Te("circle-plus",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=[["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"}]],QV=Te("circle-question-mark",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:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],jM=Te("circle-x",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=[["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"}]],$V=Te("circuit-board",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=[["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"}]],Xd=Te("clipboard-list",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=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Oc=Te("clock",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 KV=[["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"}]],qV=Te("code-xml",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 WV=[["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"}]],db=Te("copy",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:"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"}]],Ly=Te("cpu",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 XV=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Ip=Te("credit-card",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 JV=[["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"}]],ZV=Te("database-zap",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 eG=[["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"}]],ko=Te("database",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=[["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"}]],rG=Te("delete",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=[["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=Te("dollar-sign",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:"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"}]],ji=Te("download",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 sG=[["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"}]],iG=Te("earth",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 lG=[["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"}]],EM=Te("external-link",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:"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"}]],_c=Te("eye",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 cG=[["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"}]],Jd=Te("file-code",cG);/**
 * @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:"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"}]],Vf=Te("file-search",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:"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=Te("file-spreadsheet",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 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],yr=Te("file-text",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:"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"}]],pG=Te("fingerprint-pattern",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 hG=[["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=Te("folder-archive",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 xG=[["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"}]],Y_=Te("folder",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 mG=[["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"}]],ik=Te("funnel",mG);/**
 * @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:"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"}]],Er=Te("globe",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:"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"}]],Zd=Te("handshake",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=[["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"}]],yG=Te("hard-drive",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 wG=[["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=Te("history",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=[["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"}]],CG=Te("house",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=[["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"}]],Fp=Te("image",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=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],jn=Te("info",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 EG=[["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"}]],jA=Te("key",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 SG=[["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=Te("landmark",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=[["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"}]],Pc=Te("layers",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=[["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"}]],TG=Te("layout-dashboard",_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 IG=[["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"}]],FG=Te("layout-panel-left",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 DG=[["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=Te("layout-template",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:"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"}]],Gf=Te("link",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 MG=[["path",{d:"M2 5h20",key:"1fs1ex"}],["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M9 19h6",key:"456am0"}]],SM=Te("list-filter",MG);/**
 * @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=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],qi=Te("loader-circle",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:"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=Te("loader",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=[["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"}]],BM=Te("lock-open",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=[["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"}]],Rd=Te("lock",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:"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"}]],Kf=Te("log-out",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=[["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"}]],Pr=Te("mail",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=[["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"}]],_M=Te("map-pin",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:"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"}]],qf=Te("megaphone",$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:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],GG=Te("menu",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 KG=[["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"}]],rn=Te("message-circle",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:"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"}]],WG=Te("message-square-quote",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:"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"}]],XG=Te("message-square",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 JG=[["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"}]],ZG=Te("microwave",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 eK=[["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"}]],tK=Te("octagon-alert",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 rK=[["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"}]],lk=Te("panels-top-left",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 aK=[["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"}]],X_=Te("pen-line",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 nK=[["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"}]],vl=Te("pencil",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 sK=[["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"}]],gs=Te("percent",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.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"}]],ok=Te("phone",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:"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"}]],Sl=Te("plane",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=[["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"}]],cK=Te("play",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 dK=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],En=Te("plus",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:"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"}]],Nt=Te("printer",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 AK=[["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"}]],Wf=Te("radio",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 fK=[["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=Te("receipt-text",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:"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"}]],hK=Te("receipt",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:"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=Te("refresh-cw",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 mK=[["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"}]],gK=Te("rotate-cw",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:"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=Te("save",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:"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"}]],Dp=Te("scale",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 yK=[["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"}]],wK=Te("scissors",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 NK=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],er=Te("search",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=[["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"}]],kK=Te("send-horizontal",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:"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"}]],vi=Te("send",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:"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"}]],SK=Te("server-crash",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=[["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"}]],_K=Te("server",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 TK=[["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"}]],Up=Te("settings",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 IK=[["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"}]],ub=Te("settings-2",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 FK=[["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"}]],ya=Te("share-2",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 DK=[["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"}]],bs=Te("shield-alert",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:"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=Te("shield-check",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=[["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"}]],TM=Te("shield-x",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"}]],ho=Te("shield",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:"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"}]],Lc=Te("star",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:"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"}]],yl=Te("table",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:"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"}]],QK=Te("tag",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 HK=[["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"}]],ck=Te("target",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 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],dk=Te("terminal",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 $K=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],IM=Te("toggle-left",$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 VK=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],FM=Te("toggle-right",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:"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=Te("trash-2",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=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],Ab=Te("trending-down",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=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],da=Te("trending-up",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:"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=Te("triangle-alert",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:"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"}]],fb=Te("truck",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:"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"}]],JK=Te("type",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 ZK=[["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"}]],OA=Te("upload",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:"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"}]],DM=Te("user-check",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 tq=[["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"}]],rq=Te("user-minus",tq);/**
 * @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 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"}]],uN=Te("user-plus",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=[["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"}]],PA=Te("user-search",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 sq=[["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"}]],iq=Te("user-x",sq);/**
 * @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=[["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"}]],eu=Te("user",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"}],["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=Te("users",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 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"}]],Tc=Te("wallet",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:"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"}]],J_=Te("waves",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:"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"}]],Yf=Te("wrench",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:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xt=Te("x",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:"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=Te("zap",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=[["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"}]],hq=Te("zoom-in",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=[["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"}]],mq=Te("zoom-out",xq),gq="https://condominios.microautomatismo.com",bq="/CBO/SanDiego/AvDJC/UrbVDO/Tejar/",Mr=`${gq}${bq}`,ye=`${Mr}api`,Ln="Kernel V4.2.11 MC/MB",ba="El Tejar",_e=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],Fr=()=>{const e=new Date;return new Intl.DateTimeFormat("en-CA",{timeZone:"America/Caracas",year:"numeric",month:"2-digit",day:"2-digit"}).format(e)};let UM=!1,MM=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(UM&&MM!=="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}},ve={getInitialDebtData:async()=>(await(await Ge(`${ye}/get_initial_debt_data.php`)).json()).data||[],getArchivedAgreements:async()=>(await(await Ge(`${ye}/get_archived_agreements.php`)).json()).data||[],getModuleStatus:async()=>await(await Ge(`${ye}/get_modules.php`)).json(),saveModuleStatus:async(e,t)=>await Ge(`${ye}/save_module_status.php`,{method:"POST",body:JSON.stringify({moduleId:e,isActive:t})}),getFinancialTotals:async()=>await(await Ge(`${ye}/get_financial_totals.php`)).json(),runDiagnostics:async e=>await(await Ge(`${ye}/system_diagnostics.php`,{method:"POST",body:JSON.stringify({action:e})})).json(),getProviders:async()=>await(await Ge(`${ye}/get_providers.php`)).json(),saveProvider:async e=>await Ge(`${ye}/save_provider.php`,{method:"POST",body:JSON.stringify(e)}),deleteProvider:async e=>await Ge(`${ye}/delete_provider.php`,{method:"POST",body:JSON.stringify({rif:e})}),getProviderHistory:async e=>await(await Ge(`${ye}/get_provider_history.php?rif=${e}`)).json(),getAuditLogs:async()=>await(await Ge(`${ye}/get_logs.php`)).json(),clearAuditLogs:async()=>await Ge(`${ye}/clear_logs.php`,{method:"POST"}),logNavigation:async e=>{try{await fetch(`${ye}/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(`${ye}/send_welcome_email.php`,{method:"POST",body:JSON.stringify({userId:e})}),getExchangeRateHistory:async()=>{try{const t=await(await Ge(`${ye}/get_exchange_rates.php`)).json();return Array.isArray(t)?t:[]}catch{return[]}},saveExchangeRate:async e=>await Ge(`${ye}/save_exchange_rate.php`,{method:"POST",body:JSON.stringify(e)}),saveExchangeRateBatch:async e=>await Ge(`${ye}/save_exchange_rate_batch.php`,{method:"POST",body:JSON.stringify({rates:e})}),syncExternalDb:async()=>await Ge(`${ye}/sync_external_db.php`,{method:"POST"}),syncLiveRate:async()=>await(await Ge(`${ye}/sync_external_db.php`,{method:"POST"})).json(),syncMissingRates:async e=>({success:!1,message:"Auto-sync deshabilitado"}),getReservations:async()=>{const t=await(await Ge(`${ye}/get_reservations.php`)).json();return Array.isArray(t)?t:[]},saveReservation:async e=>await Ge(`${ye}/save_reservation.php`,{method:"POST",body:JSON.stringify(e)}),updateReservationStatus:async(e,t)=>await Ge(`${ye}/update_reservation_status.php`,{method:"POST",body:JSON.stringify({id:e,status:t})}),deleteReservation:async e=>await Ge(`${ye}/delete_reservation.php`,{method:"POST",body:JSON.stringify({id:e})}),getAnnouncements:async()=>{const t=await(await Ge(`${ye}/get_announcements.php`)).json();return Array.isArray(t)?t:[]},saveAnnouncement:async e=>await Ge(`${ye}/save_announcement.php`,{method:"POST",body:JSON.stringify(e)}),updateAnnouncementStatus:async(e,t)=>await Ge(`${ye}/update_announcement_status.php`,{method:"POST",body:JSON.stringify({id:e,status:t})}),deleteAnnouncement:async e=>await Ge(`${ye}/delete_announcement.php`,{method:"POST",body:JSON.stringify({id:e})}),getMaintenanceRequests:async()=>{const t=await(await Ge(`${ye}/get_maintenance.php`)).json();return Array.isArray(t)?t:[]},saveMaintenanceRequest:async e=>await Ge(`${ye}/save_maintenance.php`,{method:"POST",body:JSON.stringify(e)}),updateMaintenanceStatus:async(e,t)=>await Ge(`${ye}/update_maintenance_status.php`,{method:"POST",body:JSON.stringify({id:e,status:t})}),deleteMaintenance:async e=>await Ge(`${ye}/delete_maintenance.php`,{method:"POST",body:JSON.stringify({id:e})}),getSystemSettings:async()=>await(await Ge(`${ye}/get_settings.php`)).json(),updateSystemSetting:async(e,t)=>await Ge(`${ye}/update_setting.php`,{method:"POST",body:JSON.stringify({key:e,value:t})}),toggleMaintenanceMode:async e=>await(await Ge(`${ye}/toggle_maintenance_mode.php`,{method:"POST",body:JSON.stringify({enabled:e})})).json(),checkSession:async()=>{try{const t=await(await Ge(`${ye}/session.php`)).json();return t.active?t.user:null}catch{return null}},login:async e=>{const r=await(await Ge(`${ye}/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(`${ye}/logout.php`,{method:"POST"})}catch{console.warn("Logout API failed, continuing with local cleanup")}},getFees:async()=>{const t=await(await Ge(`${ye}/get_fees.php`)).json();return Array.isArray(t)?t:[]},saveFee:async e=>await Ge(`${ye}/save_fee.php`,{method:"POST",body:JSON.stringify(e)}),deleteFee:async e=>await Ge(`${ye}/delete_fee.php`,{method:"POST",body:JSON.stringify({id:e})}),registerPayment:async(e,t,r,a,s,i,l,o)=>await Ge(`${ye}/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(`${ye}/get_properties.php`)).json();return Array.isArray(t)?t:[]},saveProperty:async e=>await Ge(`${ye}/save_property.php`,{method:"POST",body:JSON.stringify(e)}),deleteProperty:async e=>await Ge(`${ye}/delete_property.php`,{method:"POST",body:JSON.stringify({id:e})}),getMyProperty:async e=>await(await Ge(`${ye}/get_my_status.php`)).json(),getResidents:async()=>{const t=await(await Ge(`${ye}/get_residents.php`)).json();return Array.isArray(t)?t:[]},saveResident:async e=>await Ge(`${ye}/save_resident.php`,{method:"POST",body:JSON.stringify(e)}),deleteResident:async e=>await Ge(`${ye}/delete_resident.php`,{method:"POST",body:JSON.stringify({id:e})}),getUsers:async()=>{const t=await(await Ge(`${ye}/get_users.php`)).json();return Array.isArray(t)?t:[]},saveUser:async e=>await Ge(`${ye}/save_user.php`,{method:"POST",body:JSON.stringify(e)}),deleteUser:async e=>await Ge(`${ye}/delete_user.php`,{method:"POST",body:JSON.stringify({id:e})}),getDashboardStats:async()=>await(await Ge(`${ye}/get_dashboard_stats.php`)).json(),getBankTransactions:async e=>{const t=e?`${ye}/get_bank_transactions.php?role=${e}`:`${ye}/get_bank_transactions.php`,a=await(await Ge(t)).json();return Array.isArray(a)?a:[]},getCriticalBills:async()=>{const t=await(await Ge(`${ye}/get_critical_bills.php`)).json();return Array.isArray(t)?t:[]},getBankPreciseTransactions:async(e,t)=>{const a=await(await Ge(`${ye}/get_bank_precise.php?month=${e}&year=${t}`)).json();return Array.isArray(a.transactions)?a.transactions:[]},getPendingBills:async()=>{const t=await(await Ge(`${ye}/get_pending_bills.php`)).json();return Array.isArray(t)?t:[]},savePendingBill:async e=>await Ge(`${ye}/save_pending_bill.php`,{method:"POST",body:JSON.stringify(e)}),deletePendingBill:async e=>await Ge(`${ye}/delete_pending_bill.php`,{method:"POST",body:JSON.stringify({id:e})}),payPendingBill:async(e,t,r,a)=>await Ge(`${ye}/pay_pending_bill.php`,{method:"POST",body:JSON.stringify({id:e,reference:t,source:r,date:a})}),getPolls:async()=>{const t=await(await Ge(`${ye}/get_polls.php`)).json();return Array.isArray(t)?t:[]},savePoll:async e=>await Ge(`${ye}/save_poll.php`,{method:"POST",body:JSON.stringify(e)}),closePoll:async e=>await Ge(`${ye}/close_poll.php`,{method:"POST",body:JSON.stringify({id:e})}),deletePoll:async e=>await Ge(`${ye}/delete_poll.php`,{method:"POST",body:JSON.stringify({id:e})}),submitVote:async(e,t)=>await Ge(`${ye}/submit_vote.php`,{method:"POST",body:JSON.stringify({pollId:e,answers:t})}),getDataForms:async()=>{const t=await(await Ge(`${ye}/get_data_forms.php`)).json();return Array.isArray(t)?t:[]},saveDataForm:async e=>await Ge(`${ye}/save_data_form.php`,{method:"POST",body:JSON.stringify(e)}),deleteDataForm:async e=>await Ge(`${ye}/delete_data_form.php`,{method:"POST",body:JSON.stringify({id:e})}),toggleDataFormStatus:async e=>await Ge(`${ye}/toggle_data_form_status.php`,{method:"POST",body:JSON.stringify({id:e})}),submitDataFormResponse:async(e,t)=>await Ge(`${ye}/submit_data_form_response.php`,{method:"POST",body:JSON.stringify({formId:e,data:t})}),getLiveVotes:async()=>{const t=await(await Ge(`${ye}/get_live_votes.php`)).json();return Array.isArray(t)?t:[]},saveLiveVote:async e=>await Ge(`${ye}/save_live_vote.php`,{method:"POST",body:JSON.stringify(e)}),updateLiveVoteStatus:async(e,t)=>await Ge(`${ye}/update_live_vote_status.php`,{method:"POST",body:JSON.stringify({id:e,status:t})}),castLiveVote:async(e,t)=>await Ge(`${ye}/cast_live_vote.php`,{method:"POST",body:JSON.stringify({voteId:e,optionId:t})}),deleteLiveVote:async e=>await Ge(`${ye}/delete_live_vote.php`,{method:"POST",body:JSON.stringify({id:e})}),getAssemblies:async()=>{const t=await(await Ge(`${ye}/get_assemblies.php`)).json();return Array.isArray(t)?t:[]},saveAssembly:async e=>await Ge(`${ye}/save_assembly.php`,{method:"POST",body:JSON.stringify(e)}),deleteAssembly:async e=>await Ge(`${ye}/delete_assembly.php`,{method:"POST",body:JSON.stringify({id:e})}),getReserveFundHistory:async(e,t)=>{const r=e&&t?`${ye}/get_reserve_fund_history.php?start=${e}&end=${t}`:`${ye}/get_reserve_fund_history.php`;return await(await Ge(r)).json()},getDetailedExcelReport:async(e,t,r)=>await(await Ge(`${ye}/get_detailed_excel_report.php?month=${e}&year=${t}&type=${r}`)).json(),getCreditBalances:async()=>{const t=await(await Ge(`${ye}/get_credit_balances.php`)).json();return Array.isArray(t.data)?t.data:[]},exportDatabaseSQL:()=>{window.open(`${ye}/export_sql.php`,"_blank")},getMonthlyCollectionHistory:async()=>{const t=await(await Ge(`${ye}/get_monthly_collection.php`)).json();return Array.isArray(t)?t:[]},syncMonthlyCollection:async()=>await(await Ge(`${ye}/sync_monthly_collection.php`)).json(),deleteMonthlyCollection:async e=>await(await Ge(`${ye}/delete_monthly_collection.php?id=${e}`)).json(),getPaymentReports:async e=>{const t=e?`${ye}/get_payment_reports.php?propertyId=${e}`:`${ye}/get_payment_reports.php`,a=await(await Ge(t)).json();return Array.isArray(a)?a:[]},savePaymentReport:async e=>await Ge(`${ye}/report_payment_owner.php`,{method:"POST",body:JSON.stringify(e)}),updatePaymentReportStatus:async(e,t,r,a,s)=>await Ge(`${ye}/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(`${ye}/get_debt_list.php?month=${e}&year=${t}`)).json(),getSolventList:async(e,t)=>await(await Ge(`${ye}/get_solvent_list.php?month=${e}&year=${t}`)).json(),getSaldoDesglosado:async(e,t,r)=>await(await Ge(`${ye}/get_saldo_desglosado.php?propertyId=${e}&month=${t}&year=${r}`)).json(),saveSaldoDesglosadoVisibility:async e=>await Ge(`${ye}/save_module_status.php`,{method:"POST",body:JSON.stringify({moduleId:"saldo-desglosado",isActive:e})}),setElectricalFailure:e=>{UM=e},setUserRole:e=>{MM=e}},RM=j.createContext(void 0),vq=({children:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState([]),[i,l]=j.useState([]),[o,d]=j.useState([]),[u,f]=j.useState([]),[p,x]=j.useState([]),[m,b]=j.useState([]),[v,y]=j.useState([]),[k,_]=j.useState([]),[C,E]=j.useState([]),[T,B]=j.useState([]),[F,M]=j.useState([]),[U,D]=j.useState([]),[L,P]=j.useState([]),[G,H]=j.useState([]),[Q,Y]=j.useState(null),[K,ee]=j.useState([]),[J,W]=j.useState(!1),[R,O]=j.useState({incomeTransferPercent:0,expenseTransferPercent:0}),[q,z]=j.useState(!1),[X,re]=j.useState(null),le=j.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=j.useCallback(async Ve=>{const It=Ve||X;z(!0);try{const[ra,Ma,me,We,tt,te,de,oe,ce,ue,Ae,we,Re,Ne,Ee,Se,ze,Ke]=await Promise.all([ve.getFees().catch(()=>[]),ve.getProperties().catch(()=>[]),ve.getResidents().catch(()=>[]),It==="admin"||It==="programmer"?ve.getUsers().catch(()=>[]):Promise.resolve([]),ve.getProviders().catch(()=>[]),It==="admin"||It==="programmer"?ve.getBankTransactions("admin").catch(()=>[]):Promise.resolve([]),ve.getExchangeRateHistory().catch(()=>[]),ve.getPendingBills().catch(()=>[]),ve.getPolls().catch(()=>[]),ve.getDataForms().catch(()=>[]),ve.getLiveVotes().catch(()=>[]),ve.getReservations().catch(()=>[]),ve.getAnnouncements().catch(()=>[]),ve.getMaintenanceRequests().catch(()=>[]),ve.getSystemSettings().catch(()=>({pool_enabled:"false"})),ve.getAssemblies().catch(()=>[]),ve.getFinancialTotals().catch(()=>null),ve.getModuleStatus().catch(()=>[])]);r(ra),s(Ma),l(me),d(We),f(tt),x(te),y(de),b(oe),_(ce),E(ue),B(Ae),M(we),D(Re),P(Ne),W(Ee.pool_enabled==="true"),H(Se),Y(ze),ee(Ke)}catch(ra){console.error(ra)}finally{z(!1)}},[X]),ae=j.useCallback(Ve=>{re(Ve)},[]),ie=async(Ve,It)=>{await ve.saveModuleStatus(Ve,It),await ne()},he=async Ve=>{await ve.saveReservation(Ve),await ne()},Z=async(Ve,It)=>{await ve.updateReservationStatus(Ve,It),await ne()},Ue=async Ve=>{await ve.deleteReservation(Ve),await ne()},Ie=async Ve=>{await ve.saveAnnouncement(Ve),await ne()},be=async(Ve,It)=>{await ve.updateAnnouncementStatus(Ve,It),await ne()},je=async Ve=>{await ve.deleteAnnouncement(Ve),await ne()},fe=async Ve=>{await ve.saveMaintenanceRequest(Ve),await ne()},Me=async(Ve,It)=>{await ve.updateMaintenanceStatus(Ve,It),await ne()},Xe=async Ve=>{await ve.deleteMaintenance(Ve),await ne()},it=async Ve=>{await ve.updateSystemSetting("pool_enabled",String(Ve)),await ne()},at=async Ve=>{await ve.saveAssembly(Ve),await ne()},Ct=async Ve=>{await ve.deleteAssembly(Ve),await ne()},kt=async Ve=>{await ve.saveFee(Ve),await ne()},ft=async Ve=>{await ve.deleteFee(Ve),await ne()},Br=async(Ve,It,ra,Ma,me,We,tt,te)=>{const de=await fetch(`${ye}/register_payment.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:Ve,propertyId:It,amount:ra,method:Ma,reference:me,date:We,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(`${ye}/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()},fa=async(Ve,It,ra)=>{const Ma=await fetch(`${ye}/update_payment.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:Ve,propertyId:It,payment:ra})}),me=await Ma.json();if(!Ma.ok)throw new Error(me.error||"Fallo al actualizar pago");await ne()},Ut=async Ve=>{},_r=async Ve=>{},st=async Ve=>{},Rt=async Ve=>{await ve.savePendingBill(Ve),await ne()},Et=async Ve=>{await ve.deletePendingBill(Ve),await ne()},jt=async Ve=>{await ve.savePendingBill(Ve),await ne()},Kt=async(Ve,It,ra,Ma)=>{await ve.payPendingBill(Ve,It,ra,Ma),await ne()},fr=async(Ve,It,ra)=>{await ve.updateSystemSetting("receipt_sent","true"),await ne()},Nr=Ve=>O(Ve),cn=async Ve=>{await ve.savePoll(Ve),await ne()},$n=async Ve=>{await ve.closePoll(Ve),await ne()},Cs=async Ve=>{await ve.deletePoll(Ve),await ne()},ks=async(Ve,It)=>{await ve.submitVote(Ve,It),await ne()},Bi=async Ve=>{await ve.saveDataForm(Ve),await ne()},ta=async Ve=>{await ve.deleteDataForm(Ve),await ne()},dn=async Ve=>{await ve.toggleDataFormStatus(Ve),await ne()},el=async(Ve,It)=>{await ve.submitDataFormResponse(Ve,It),await ne()},_i=async Ve=>{await ve.saveLiveVote(Ve),await ne()},qc=async(Ve,It)=>{await ve.updateLiveVoteStatus(Ve,It),await ne()},Po=async(Ve,It)=>{await ve.castLiveVote(Ve,It),await ne()},Dl=async Ve=>{await ve.deleteLiveVote(Ve),await ne()};return n.jsx(RM.Provider,{value:{fees:t,properties:a,residents:i,users:o,providers:u,transactions:p,pendingBills:m,exchangeRateHistory:v,polls:k,dataForms:C,liveVotes:T,reservations:F,announcements:U,maintenance:L,assemblies:G,financialTotals:Q,moduleStatus:K,isPoolEnabled:J,loading:q,refreshData:ne,setUserRole:ae,latestRate:le,updateModuleStatus:ie,addFee:kt,deleteFee:ft,registerPayment:Br,deletePayment:Ar,updatePayment:fa,addTransaction:Ut,deleteTransaction:_r,updateTransaction:st,addPendingBill:Rt,deletePendingBill:Et,updatePendingBill:jt,markReceiptSent:fr,payPendingBill:Kt,bankFees:R,updateBankFees:Nr,addPoll:cn,closePoll:$n,deletePoll:Cs,submitVote:ks,addDataForm:Bi,deleteDataForm:ta,toggleDataFormStatus:dn,submitDataForm:el,addLiveVote:_i,updateLiveVoteStatus:qc,castLiveVote:Po,deleteLiveVote:Dl,addReservation:he,updateReservationStatus:Z,deleteReservation:Ue,addAnnouncement:Ie,updateAnnouncementStatus:be,deleteAnnouncement:je,addMaintenance:fe,updateMaintenanceStatus:Me,deleteMaintenance:Xe,togglePoolAvailability:it,addAssembly:at,deleteAssembly:Ct},children:e})},mt=()=>{const e=j.useContext(RM);if(!e)throw new Error("useData must be used within DataProvider");return e};function OM(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=OM(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=OM(e))&&(a&&(a+=" "),a+=t);return a}var yq=["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 uk(e){if(typeof e!="string")return!1;var t=yq;return t.includes(e)}var wq=["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"],Nq=new Set(wq);function PM(e){return typeof e!="string"?!1:Nq.has(e)}function LM(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)&&(PM(r)||LM(r))&&(t[r]=e[r]);return t}function pb(e){if(e==null)return null;if(j.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 yi(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(PM(r)||LM(r)||uk(r))&&(t[r]=e[r]);return t}function Cq(e){return e==null?null:j.isValidElement(e)?yi(e.props):typeof e=="object"&&!Array.isArray(e)?yi(e):null}var kq=["children","width","height","viewBox","className","style","title","desc"];function AN(){return AN=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},AN.apply(null,arguments)}function jq(e,t){if(e==null)return{};var r,a,s=Eq(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 Eq(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 QM=j.forwardRef((e,t)=>{var{children:r,width:a,height:s,viewBox:i,className:l,style:o,title:d,desc:u}=e,f=jq(e,kq),p=i||{width:a,height:s,x:0,y:0},x=Lr("recharts-surface",l);return j.createElement("svg",AN({},yi(f),{className:x,width:a,height:s,style:o,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height),ref:t}),j.createElement("title",null,d),j.createElement("desc",null,u),r)}),Sq=["children","className"];function fN(){return fN=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},fN.apply(null,arguments)}function Bq(e,t){if(e==null)return{};var r,a,s=_q(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 _q(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 wl=j.forwardRef((e,t)=>{var{children:r,className:a}=e,s=Bq(e,Sq),i=Lr("recharts-layer",a);return j.createElement("g",fN({className:i},yi(s),{ref:t}),r)}),HM=yM(),Tq=j.createContext(null);function ia(e){return function(){return e}}const pN=Math.PI,hN=2*pN,pd=1e-6,Iq=hN-pd;function zM(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Fq(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return zM;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 Dq{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?zM:Fq(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,x=f*f+p*p;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(x>pd)if(!(Math.abs(p*d-u*f)>pd)||!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,k=Math.sqrt(v),_=Math.sqrt(x),C=i*Math.tan((pN-Math.acos((v+x-y)/(2*k*_)))/2),E=C/_,T=C/k;Math.abs(E-1)>pd&&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,x=l?s-i:i-s;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>pd||Math.abs(this._y1-f)>pd)&&this._append`L${u},${f}`,a&&(x<0&&(x=x%hN+hN),x>Iq?this._append`A${a},${a},0,1,${p},${t-o},${r-d}A${a},${a},0,1,${p},${this._x1=u},${this._y1=f}`:x>pd&&this._append`A${a},${a},0,${+(x>=pN)},${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 $M(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 Dq(t)}function Ak(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function VM(e){this._context=e}VM.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 VM(e)}function GM(e){return e[0]}function KM(e){return e[1]}function qM(e,t){var r=ia(!0),a=null,s=hb,i=null,l=$M(o);e=typeof e=="function"?e:e===void 0?GM:ia(e),t=typeof t=="function"?t:t===void 0?KM:ia(t);function o(d){var u,f=(d=Ak(d)).length,p,x=!1,m;for(a==null&&(i=s(m=l())),u=0;u<=f;++u)!(u<f&&r(p=d[u],u,d))===x&&((x=!x)?i.lineStart():i.lineEnd()),x&&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 vx(e,t,r){var a=null,s=ia(!0),i=null,l=hb,o=null,d=$M(u);e=typeof e=="function"?e:e===void 0?GM:ia(+e),t=typeof t=="function"?t:ia(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?KM:ia(+r);function u(p){var x,m,b,v=(p=Ak(p)).length,y,k=!1,_,C=new Array(v),E=new Array(v);for(i==null&&(o=l(_=d())),x=0;x<=v;++x){if(!(x<v&&s(y=p[x],x,p))===k)if(k=!k)m=x,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),b=x-1;b>=m;--b)o.point(C[b],E[b]);o.lineEnd(),o.areaEnd()}k&&(C[x]=+e(y,x,p),E[x]=+t(y,x,p),o.point(a?+a(y,x,p):C[x],r?+r(y,x,p):E[x]))}if(_)return o=null,_+""||null}function f(){return qM().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 WM{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 Uq(e){return new WM(e,!0)}function Mq(e){return new WM(e,!1)}function Hm(){}function zm(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 YM(e){this._context=e}YM.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:zm(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:zm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Rq(e){return new YM(e)}function XM(e){this._context=e}XM.prototype={areaStart:Hm,areaEnd:Hm,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:zm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Oq(e){return new XM(e)}function JM(e){this._context=e}JM.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:zm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Pq(e){return new JM(e)}function ZM(e){this._context=e}ZM.prototype={areaStart:Hm,areaEnd:Hm,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 Lq(e){return new ZM(e)}function Z_(e){return e<0?-1:1}function eT(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(Z_(i)+Z_(l))*Math.min(Math.abs(i),Math.abs(l),.5*Math.abs(o))||0}function tT(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Qy(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 $m(e){this._context=e}$m.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:Qy(this,this._t0,tT(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,Qy(this,tT(this,r=eT(this,e,t)),r);break;default:Qy(this,this._t0,r=eT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function eR(e){this._context=new tR(e)}(eR.prototype=Object.create($m.prototype)).point=function(e,t){$m.prototype.point.call(this,t,e)};function tR(e){this._context=e}tR.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 Qq(e){return new $m(e)}function Hq(e){return new eR(e)}function rR(e){this._context=e}rR.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=rT(e),s=rT(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 rT(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 zq(e){return new rR(e)}function xb(e,t){this._context=e,this._t=t}xb.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 $q(e){return new xb(e,.5)}function Vq(e){return new xb(e,0)}function Gq(e){return new xb(e,1)}function Od(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 xN(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function Kq(e,t){return e[t]}function qq(e){const t=[];return t.key=e,t}function Wq(){var e=ia([]),t=xN,r=Od,a=Kq;function s(i){var l=Array.from(e.apply(this,arguments),qq),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=Ak(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?xN:typeof i=="function"?i:ia(Array.from(i)),s):t},s.offset=function(i){return arguments.length?(r=i??Od,s):r},s}function Yq(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}Od(e,t)}}function Xq(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}Od(e,t)}}function Jq(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,x=f[a-1][1]||0,m=(p-x)/2,b=0;b<o;++b){var v=e[t[b]],y=v[a][1]||0,k=v[a-1][1]||0;m+=y-k}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,Od(e,t)}}var Hy={},zy={},aT;function Zq(){return aT||(aT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t})(zy)),zy}var $y={},nT;function aR(){return nT||(nT=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})($y)),$y}var Vy={},sT;function fk(){return sT||(sT=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})(Vy)),Vy}var Gy={},Ky={},iT;function eW(){return iT||(iT=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})(Ky)),Ky}var lT;function pk(){return lT||(lT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=eW(),r=fk();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})(Gy)),Gy}var oT;function hk(){return oT||(oT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Zq(),r=aR(),a=fk(),s=pk();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})(Hy)),Hy}var qy,cT;function tW(){return cT||(cT=1,qy=hk().get),qy}var rW=tW();const mb=El(rW);var aW=4;function gc(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:aW,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+gc(o)+i:s+i},"")}var fi=e=>e===0?0:e>0?1:-1,Nl=e=>typeof e=="number"&&e!=+e,Pd=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,At=e=>(typeof e=="number"||e instanceof Number)&&!Nl(e),Cl=e=>At(e)||typeof e=="string",nW=0,Xf=e=>{var t=++nW;return"".concat(e||"").concat(t)},Ic=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(Pd(t)){if(r==null)return a;var l=t.indexOf("%");i=r*parseFloat(t.slice(0,l))/100}else i=+t;return Nl(i)&&(i=a),s&&r!=null&&i>r&&(i=r),i},nR=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)?gc(e+r*(t-e)):t}function sR(e,t,r){if(!(!e||!e.length))return e.find(a=>a&&(typeof t=="function"?t(a):mb(a,t))===r)}var Qn=e=>e===null||typeof e>"u",xk=e=>Qn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function ps(e){return e!=null}function LA(){}var iR=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,mk=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(j.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var a={};return Object.keys(r).forEach(s=>{uk(s)&&(a[s]=(i=>r[s](r,i)))}),a},sW=(e,t,r)=>a=>(e(t,r,a),null),iW=(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];uk(s)&&typeof i=="function"&&(a||(a={}),a[s]=sW(i,t,r))}),a};function dT(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 lW(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dT(Object(r),!0).forEach(function(a){oW(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dT(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function oW(e,t,r){return(t=cW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cW(e){var t=dW(e,"string");return typeof t=="symbol"?t:t+""}function dW(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 Vs(e,t){var r=lW({},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 Wy={},Yy={},uT;function uW(){return uT||(uT=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})(Yy)),Yy}var Xy={},AT;function AW(){return AT||(AT=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})(Xy)),Xy}var Jy={},fT;function lR(){return fT||(fT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r}e.identity=t})(Jy)),Jy}var Zy={},ew={},tw={},pT;function fW(){return pT||(pT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=t})(tw)),tw}var hT;function gk(){return hT||(hT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fW();function r(a){return a!=null&&typeof a!="function"&&t.isLength(a.length)}e.isArrayLike=r})(ew)),ew}var rw={},xT;function pW(){return xT||(xT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})(rw)),rw}var mT;function hW(){return mT||(mT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gk(),r=pW();function a(s){return r.isObjectLike(s)&&t.isArrayLike(s)}e.isArrayLikeObject=a})(Zy)),Zy}var aw={},nw={},gT;function xW(){return gT||(gT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hk();function r(a){return function(s){return t.get(s,a)}}e.property=r})(nw)),nw}var sw={},iw={},lw={},ow={},bT;function oR(){return bT||(bT=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})(ow)),ow}var cw={},vT;function cR(){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.isPrimitive=t})(cw)),cw}var dw={},yT;function dR(){return yT||(yT=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})(dw)),dw}var wT;function mW(){return wT||(wT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oR(),r=cR(),a=dR();function s(f,p,x){return typeof x!="function"?s(f,p,()=>{}):i(f,p,function m(b,v,y,k,_,C){const E=x(b,v,y,k,_,C);return E!==void 0?!!E:i(b,v,m,C)},new Map)}function i(f,p,x,m){if(p===f)return!0;switch(typeof p){case"object":return l(f,p,x,m);case"function":return Object.keys(p).length>0?i(f,{...p},x,m):a.isEqualsSameValueZero(f,p);default:return t.isObject(f)?typeof p=="string"?p==="":!0:a.isEqualsSameValueZero(f,p)}}function l(f,p,x,m){if(p==null)return!0;if(Array.isArray(p))return d(f,p,x,m);if(p instanceof Map)return o(f,p,x,m);if(p instanceof Set)return u(f,p,x,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||!x(f[y],p[y],y,f,p,m))return!1}return!0}finally{m==null||m.delete(p)}}function o(f,p,x,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(x(y,v,b,f,p,m)===!1)return!1}return!0}function d(f,p,x,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 k=!1;for(let _=0;_<f.length;_++){if(b.has(_))continue;const C=f[_];let E=!1;if(x(C,y,v,f,p,m)&&(E=!0),E){b.add(_),k=!0;break}}if(!k)return!1}return!0}function u(f,p,x,m){return p.size===0?!0:f instanceof Set?d([...f],[...p],x,m):!1}e.isMatchWith=s,e.isSetMatch=u})(lw)),lw}var NT;function uR(){return NT||(NT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mW();function r(a,s){return t.isMatchWith(a,s,()=>{})}e.isMatch=r})(iw)),iw}var uw={},Aw={},fw={},CT;function gW(){return CT||(CT=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})(fw)),fw}var pw={},kT;function bk(){return kT||(kT=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})(pw)),pw}var hw={},jT;function AR(){return jT||(jT=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]",x="[object ArrayBuffer]",m="[object Object]",b="[object Error]",v="[object DataView]",y="[object Uint8Array]",k="[object Uint8ClampedArray]",_="[object Uint16Array]",C="[object Uint32Array]",E="[object BigUint64Array]",T="[object Int8Array]",B="[object Int16Array]",F="[object Int32Array]",M="[object BigInt64Array]",U="[object Float32Array]",D="[object Float64Array]";e.argumentsTag=i,e.arrayBufferTag=x,e.arrayTag=f,e.bigInt64ArrayTag=M,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=C,e.uint8ArrayTag=y,e.uint8ClampedArrayTag=k})(hw)),hw}var xw={},ET;function bW(){return ET||(ET=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t})(xw)),xw}var ST;function fR(){return ST||(ST=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gW(),r=bk(),a=AR(),s=cR(),i=bW();function l(f,p){return o(f,void 0,f,new Map,p)}function o(f,p,x,m=new Map,b=void 0){const v=b==null?void 0:b(f,p,x,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 k=0;k<f.length;k++)y[k]=o(f[k],k,x,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[k,_]of f)y.set(k,o(_,k,x,m,b));return y}if(f instanceof Set){const y=new Set;m.set(f,y);for(const k of f)y.add(o(k,void 0,x,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 k=0;k<f.length;k++)y[k]=o(f[k],k,x,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,x,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,x,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,x,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,x,m,b),y}if(f instanceof Boolean){const y=new Boolean(f.valueOf());return m.set(f,y),d(y,f,x,m,b),y}if(f instanceof Number){const y=new Number(f.valueOf());return m.set(f,y),d(y,f,x,m,b),y}if(f instanceof String){const y=new String(f.valueOf());return m.set(f,y),d(y,f,x,m,b),y}if(typeof f=="object"&&u(f)){const y=Object.create(Object.getPrototypeOf(f));return m.set(f,y),d(y,f,x,m,b),y}return f}function d(f,p,x=f,m,b){const v=[...Object.keys(p),...t.getSymbols(p)];for(let y=0;y<v.length;y++){const k=v[y],_=Object.getOwnPropertyDescriptor(f,k);(_==null||_.writable)&&(f[k]=o(p[k],k,x,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})(Aw)),Aw}var BT;function vW(){return BT||(BT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fR();function r(a){return t.cloneDeepWithImpl(a,void 0,a,new Map,void 0)}e.cloneDeep=r})(uw)),uw}var _T;function yW(){return _T||(_T=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=uR(),r=vW();function a(s){return s=r.cloneDeep(s),i=>t.isMatch(i,s)}e.matches=a})(sw)),sw}var mw={},gw={},bw={},TT;function wW(){return TT||(TT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fR(),r=bk(),a=AR();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 x={};return f.set(i,x),t.copyProperties(x,i,u,f),x}switch(Object.prototype.toString.call(i)){case a.numberTag:case a.stringTag:case a.booleanTag:{const x=new i.constructor(i==null?void 0:i.valueOf());return t.copyProperties(x,i),x}case a.argumentsTag:{const x={};return t.copyProperties(x,i),x.length=i.length,x[Symbol.iterator]=i[Symbol.iterator],x}default:return}}})}e.cloneDeepWith=s})(bw)),bw}var IT;function NW(){return IT||(IT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wW();function r(a){return t.cloneDeepWith(a)}e.cloneDeep=r})(gw)),gw}var vw={},yw={},FT;function pR(){return FT||(FT=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})(yw)),yw}var ww={},DT;function CW(){return DT||(DT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bk();function r(a){return a!==null&&typeof a=="object"&&t.getTag(a)==="[object Arguments]"}e.isArguments=r})(ww)),ww}var UT;function kW(){return UT||(UT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=aR(),r=pR(),a=CW(),s=pk();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})(vw)),vw}var MT;function jW(){return MT||(MT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=uR(),r=fk(),a=NW(),s=hk(),i=kW();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})(mw)),mw}var RT;function EW(){return RT||(RT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lR(),r=xW(),a=yW(),s=jW();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})(aw)),aw}var OT;function SW(){return OT||(OT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=uW(),r=AW(),a=lR(),s=hW(),i=EW();function l(o,d=a.identity){return s.isArrayLikeObject(o)?t.uniqBy(Array.from(o),r.ary(i.iteratee(d),1)):[]}e.uniqBy=l})(Wy)),Wy}var Nw,PT;function BW(){return PT||(PT=1,Nw=SW().uniqBy),Nw}var _W=BW();const LT=El(_W);function TW(e,t,r){return t===!0?LT(e,r):typeof t=="function"?LT(e,t):e}var Cw={exports:{}},kw={},jw={exports:{}},Ew={};/**
 * @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 QT;function IW(){if(QT)return Ew;QT=1;var e=RA();function t(p,x){return p===x&&(p!==0||1/p===1/x)||p!==p&&x!==x}var r=typeof Object.is=="function"?Object.is:t,a=e.useState,s=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function o(p,x){var m=x(),b=a({inst:{value:m,getSnapshot:x}}),v=b[0].inst,y=b[1];return i(function(){v.value=m,v.getSnapshot=x,d(v)&&y({inst:v})},[p,m,x]),s(function(){return d(v)&&y({inst:v}),p(function(){d(v)&&y({inst:v})})},[p]),l(m),m}function d(p){var x=p.getSnapshot;p=p.value;try{var m=x();return!r(p,m)}catch{return!0}}function u(p,x){return x()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return Ew.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Ew}var HT;function FW(){return HT||(HT=1,jw.exports=IW()),jw.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 zT;function DW(){if(zT)return kw;zT=1;var e=RA(),t=FW();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 kw.useSyncExternalStoreWithSelector=function(u,f,p,x,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 k(B){if(!_){if(_=!0,C=B,B=x(B),m!==void 0&&v.hasValue){var F=v.value;if(m(F,B))return E=F}return E=B}if(F=E,a(C,B))return F;var M=x(B);return m!==void 0&&m(F,M)?(C=B,F):(C=B,E=M)}var _=!1,C,E,T=p===void 0?null:p;return[function(){return k(f())},T===null?void 0:function(){return k(T())}]},[f,p,x,m]);var y=s(u,b[0],b[1]);return l(function(){v.hasValue=!0,v.value=y},[y]),d(y),y},kw}var $T;function UW(){return $T||($T=1,Cw.exports=DW()),Cw.exports}var MW=UW(),vk=j.createContext(null),RW=e=>e,an=()=>{var e=j.useContext(vk);return e?e.store.dispatch:RW},Em=()=>{},OW=()=>Em,PW=(e,t)=>e===t;function gt(e){var t=j.useContext(vk),r=j.useMemo(()=>t?a=>{if(a!=null)return e(a)}:Em,[t,e]);return MW.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:OW,t?t.store.getState:Em,t?t.store.getState:Em,r,PW)}function LW(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function QW(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function HW(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 VT=e=>Array.isArray(e)?e:[e];function zW(e){const t=Array.isArray(e[0])?e[0]:e;return HW(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function $W(e,t){const r=[],{length:a}=e;for(let s=0;s<a;s++)r.push(e[s].apply(null,t));return r}var VW=class{constructor(e){this.value=e}deref(){return this.value}},GW=typeof WeakRef<"u"?WeakRef:VW,KW=0,GT=1;function yx(){return{s:KW,v:void 0,o:null,p:null}}function hR(e,t={}){let r=yx();const{resultEqualityCheck:a}=t;let s,i=0;function l(){var p;let o=r;const{length:d}=arguments;for(let x=0,m=d;x<m;x++){const b=arguments[x];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=yx(),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=yx(),v.set(b,o)):o=y}}const u=o;let f;if(o.s===GT)f=o.v;else if(f=e.apply(null,arguments),i++,a){const x=((p=s==null?void 0:s.deref)==null?void 0:p.call(s))??s;x!=null&&a(x,f)&&(f=x,i!==0&&i--),s=typeof f=="object"&&f!==null||typeof f=="function"?new GW(f):f}return u.s=GT,u.v=f,f}return l.clearCache=()=>{r=yx(),l.resetResultsCount()},l.resultsCount=()=>i,l.resetResultsCount=()=>{i=0},l}function qW(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()),LW(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const f={...r,...d},{memoize:p,memoizeOptions:x=[],argsMemoize:m=hR,argsMemoizeOptions:b=[]}=f,v=VT(x),y=VT(b),k=zW(s),_=p(function(){return i++,u.apply(null,arguments)},...v),C=m(function(){l++;const T=$W(k,arguments);return o=_.apply(null,T),o},...y);return Object.assign(C,{resultFunc:u,memoizedResultFunc:_,dependencies:k,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=qW(hR),WW=Object.assign((e,t=De)=>{QW(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:()=>WW}),Sw={},Bw={},_w={},KT;function YW(){return KT||(KT=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})(_w)),_w}var Tw={},Iw={},qT;function xR(){return qT||(qT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=t})(Iw)),Iw}var WT;function XW(){return WT||(WT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xR(),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})(Tw)),Tw}var YT;function JW(){return YT||(YT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=YW(),r=XW(),a=pk();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})(Bw)),Bw}var Fw={},XT;function ZW(){return XT||(XT=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})(Fw)),Fw}var Dw={},JT;function mR(){return JT||(JT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pR(),r=gk(),a=oR(),s=dR();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})(Dw)),Dw}var ZT;function eY(){return ZT||(ZT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=JW(),r=ZW(),a=mR();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})(Sw)),Sw}var Uw,eI;function tY(){return eI||(eI=1,Uw=eY().sortBy),Uw}var rY=tY();const gb=El(rY);var gR=e=>e.legend.settings,aY=e=>e.legend.size,nY=e=>e.legend.payload;De([nY,gR],(e,t)=>{var{itemSorter:r}=t,a=e.flat(1);return r?gb(a,r):a});var wx=1;function sY(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,r]=j.useState({height:0,left:0,top:0,width:0}),a=j.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)>wx||Math.abs(l.left-t.left)>wx||Math.abs(l.top-t.top)>wx||Math.abs(l.width-t.width)>wx)&&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 xn(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 iY=typeof Symbol=="function"&&Symbol.observable||"@@observable",tI=iY,Mw=()=>Math.random().toString(36).substring(7).split("").join("."),lY={INIT:`@@redux/INIT${Mw()}`,REPLACE:`@@redux/REPLACE${Mw()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Mw()}`},Vm=lY;function yk(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 bR(e,t,r){if(typeof e!="function")throw new Error(xn(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(xn(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(xn(1));return r(bR)(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,k)=>{l.set(k,y)}))}function f(){if(d)throw new Error(xn(3));return s}function p(y){if(typeof y!="function")throw new Error(xn(4));if(d)throw new Error(xn(5));let k=!0;u();const _=o++;return l.set(_,y),function(){if(k){if(d)throw new Error(xn(6));k=!1,u(),l.delete(_),i=null}}}function x(y){if(!yk(y))throw new Error(xn(7));if(typeof y.type>"u")throw new Error(xn(8));if(typeof y.type!="string")throw new Error(xn(17));if(d)throw new Error(xn(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(xn(10));a=y,x({type:Vm.REPLACE})}function b(){const y=p;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(xn(11));function _(){const E=k;E.next&&E.next(f())}return _(),{unsubscribe:y(_)}},[tI](){return this}}}return x({type:Vm.INIT}),{dispatch:x,subscribe:p,getState:f,replaceReducer:m,[tI]:b}}function oY(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Vm.INIT})>"u")throw new Error(xn(12));if(typeof r(void 0,{type:Vm.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(xn(13))})}function vR(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{oY(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],x=r[p],m=l[p],b=x(m,o);if(typeof b>"u")throw o&&o.type,new Error(xn(14));u[p]=b,d=d||b!==m}return d=d||a.length!==Object.keys(l).length,d?u:l}}function Gm(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...a)=>t(r(...a)))}function cY(...e){return t=>(r,a)=>{const s=t(r,a);let i=()=>{throw new Error(xn(15))};const l={getState:s.getState,dispatch:(d,...u)=>i(d,...u)},o=e.map(d=>d(l));return i=Gm(...o)(s.dispatch),{...s,dispatch:i}}}function yR(e){return yk(e)&&"type"in e&&typeof e.type=="string"}var wR=Symbol.for("immer-nothing"),rI=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,EA=Ps.getPrototypeOf,Km="constructor",bb="prototype",mN="configurable",qm="enumerable",Sm="writable",Jf="value",xo=e=>!!e&&!!e[es];function Yi(e){var t;return e?NR(e)||yb(e)||!!e[rI]||!!((t=e[Km])!=null&&t[rI])||wb(e)||Nb(e):!1}var dY=Ps[bb][Km].toString(),aI=new WeakMap;function NR(e){if(!e||!wk(e))return!1;const t=EA(e);if(t===null||t===Ps[bb])return!0;const r=Ps.hasOwnProperty.call(t,Km)&&t[Km];if(r===Object)return!0;if(!nA(r))return!1;let a=aI.get(r);return a===void 0&&(a=Function.toString.call(r),aI.set(r,a)),a===dY}function vb(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_:yb(e)?1:wb(e)?2:Nb(e)?3:0}var nI=(e,t,r=Mp(e))=>r===2?e.has(t):Ps[bb].hasOwnProperty.call(e,t),gN=(e,t,r=Mp(e))=>r===2?e.get(t):e[t],Wm=(e,t,r,a=Mp(e))=>{a===2?e.set(t,r):a===3?e.add(r):e[t]=r};function uY(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var yb=Array.isArray,wb=e=>e instanceof Map,Nb=e=>e instanceof Set,wk=e=>typeof e=="object",nA=e=>typeof e=="function",Rw=e=>typeof e=="boolean";function AY(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ro=e=>e.copy_||e.base_,Nk=e=>e.modified_?e.copy_:e.base_;function bN(e,t){if(wb(e))return new Map(e);if(Nb(e))return new Set(e);if(yb(e))return Array[bb].slice.call(e);const r=NR(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[mN]=!0),(o.get||o.set)&&(a[l]={[mN]:!0,[Sm]:!0,[qm]:o[qm],[Jf]:e[l]})}return Ps.create(EA(e),a)}else{const a=EA(e);if(a!==null&&r)return{...e};const s=Ps.create(a);return Ps.assign(s,e)}}function Ck(e,t=!1){return Cb(e)||xo(e)||!Yi(e)||(Mp(e)>1&&Ps.defineProperties(e,{set:Nx,add:Nx,clear:Nx,delete:Nx}),Ps.freeze(e),t&&vb(e,(r,a)=>{Ck(a,!0)},!1)),e}function fY(){Mi(2)}var Nx={[Jf]:fY};function Cb(e){return e===null||!wk(e)?!0:Ps.isFrozen(e)}var Ym="MapSet",vN="Patches",sI="ArrayMethods",CR={};function Ld(e){const t=CR[e];return t||Mi(0,e),t}var iI=e=>!!CR[e],Zf,kR=()=>Zf,pY=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:iI(Ym)?Ld(Ym):void 0,arrayMethodsPlugin_:iI(sI)?Ld(sI):void 0});function lI(e,t){t&&(e.patchPlugin_=Ld(vN),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function yN(e){wN(e),e.drafts_.forEach(hY),e.drafts_=null}function wN(e){e===Zf&&(Zf=e.parent_)}var oI=e=>Zf=pY(Zf,e);function hY(e){const t=e[es];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function cI(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[es].modified_&&(yN(t),Mi(4)),Yi(e)&&(e=dI(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(r[es].base_,e,t)}else e=dI(t,r);return xY(t,e,!0),yN(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==wR?e:void 0}function dI(e,t){if(Cb(t))return t;const r=t[es];if(!r)return Xm(t,e.handledSet_,e);if(!kb(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);SR(r,e)}return r.copy_}function xY(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ck(t,r)}function jR(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var kb=(e,t)=>e.scope_===t,mY=[];function ER(e,t,r,a){const s=ro(e),i=e.type_;if(a!==void 0&&gN(s,a,i)===t){Wm(s,a,r,i);return}if(!e.draftLocations_){const o=e.draftLocations_=new Map;vb(s,(d,u)=>{if(xo(u)){const f=o.get(u)||[];f.push(d),o.set(u,f)}})}const l=e.draftLocations_.get(t)??mY;for(const o of l)Wm(s,o,r,i)}function gY(e,t,r){e.callbacks_.push(function(s){var o;const i=t;if(!i||!kb(i,s))return;(o=s.mapSetPlugin_)==null||o.fixSetContents(i);const l=Nk(i);ER(e,i.draft_??i,l,r),SR(i,s)})}function SR(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)}jR(e)}}function bY(e,t,r){const{scope_:a}=e;if(xo(r)){const s=r[es];kb(s,a)&&s.callbacks_.push(function(){Bm(e);const l=Nk(s);ER(e,r,l,t)})}else Yi(r)&&e.callbacks_.push(function(){const i=ro(e);e.type_===3?i.has(r)&&Xm(r,a.handledSet_,a):gN(i,t,e.type_)===r&&a.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Xm(gN(e.copy_,t,e.type_),a.handledSet_,a)})}function Xm(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||xo(e)||t.has(e)||!Yi(e)||Cb(e)||(t.add(e),vb(e,(a,s)=>{if(xo(s)){const i=s[es];if(kb(i,r)){const l=Nk(i);Wm(e,a,l,e.type_),jR(i)}}else Yi(s)&&Xm(s,t,r)})),e}function vY(e,t){const r=yb(e),a={type_:r?1:0,scope_:t?t.scope_:kR(),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=Jm;r&&(s=[a],i=ep);const{revoke:l,proxy:o}=Proxy.revocable(s,i);return a.draft_=o,a.revoke_=l,[o,a]}var Jm={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=ro(e);if(!nI(s,t,e.type_))return yY(e,s,t);const i=s[t];if(e.finalized_||!Yi(i)||a&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&AY(t))return i;if(i===Ow(e.base_,t)){Bm(e);const l=e.type_===1?+t:t,o=CN(e.scope_,i,e,l);return e.copy_[l]=o}return i},has(e,t){return t in ro(e)},ownKeys(e){return Reflect.ownKeys(ro(e))},set(e,t,r){const a=BR(ro(e),t);if(a!=null&&a.set)return a.set.call(e.draft_,r),!0;if(!e.modified_){const s=Ow(ro(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(uY(r,s)&&(r!==void 0||nI(e.base_,t,e.type_)))return!0;Bm(e),NN(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),bY(e,t,r)),!0},deleteProperty(e,t){return Bm(e),Ow(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),NN(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ro(e),a=Reflect.getOwnPropertyDescriptor(r,t);return a&&{[Sm]:!0,[mN]:e.type_!==1||t!=="length",[qm]:a[qm],[Jf]:r[t]}},defineProperty(){Mi(11)},getPrototypeOf(e){return EA(e.base_)},setPrototypeOf(){Mi(12)}},ep={};for(let e in Jm){let t=Jm[e];ep[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}ep.deleteProperty=function(e,t){return ep.set.call(this,e,t,void 0)};ep.set=function(e,t,r){return Jm.set.call(this,e[0],t,r,e[0])};function Ow(e,t){const r=e[es];return(r?ro(r):e)[t]}function yY(e,t,r){var s;const a=BR(t,r);return a?Jf in a?a[Jf]:(s=a.get)==null?void 0:s.call(e.draft_):void 0}function BR(e,t){if(!(t in e))return;let r=EA(e);for(;r;){const a=Object.getOwnPropertyDescriptor(r,t);if(a)return a;r=EA(r)}}function NN(e){e.modified_||(e.modified_=!0,e.parent_&&NN(e.parent_))}function Bm(e){e.copy_||(e.assigned_=new Map,e.copy_=bN(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var wY=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,a,s)=>{if(nA(r)&&!nA(a)){const l=a;a=r;const o=this;return function(u=l,...f){return o.produce(u,p=>a.call(this,p,...f))}}nA(a)||Mi(6),s!==void 0&&!nA(s)&&Mi(7);let i;if(Yi(r)){const l=oI(this),o=CN(l,r,void 0);let d=!0;try{i=a(o),d=!1}finally{d?yN(l):wN(l)}return lI(l,s),cI(i,l)}else if(!r||!wk(r)){if(i=a(r),i===void 0&&(i=r),i===wR&&(i=void 0),this.autoFreeze_&&Ck(i,!0),s){const l=[],o=[];Ld(vN).generateReplacementPatches_(r,i,{patches_:l,inversePatches_:o}),s(l,o)}return i}else Mi(1,r)},this.produceWithPatches=(r,a)=>{if(nA(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]},Rw(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Rw(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Rw(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Yi(t)||Mi(8),xo(t)&&(t=Hi(t));const r=oI(this),a=CN(r,t,void 0);return a[es].isManual_=!0,wN(r),a}finishDraft(t,r){const a=t&&t[es];(!a||!a.isManual_)&&Mi(9);const{scope_:s}=a;return lI(s,r),cI(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=Ld(vN).applyPatches_;return xo(t)?s(t,r):this.produce(t,i=>s(i,r))}};function CN(e,t,r,a){const[s,i]=wb(t)?Ld(Ym).proxyMap_(t,r):Nb(t)?Ld(Ym).proxySet_(t,r):vY(t,r);return((r==null?void 0:r.scope_)??kR()).drafts_.push(s),i.callbacks_=(r==null?void 0:r.callbacks_)??[],i.key_=a,r&&a!==void 0?gY(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 xo(e)||Mi(10,e),_R(e)}function _R(e){if(!Yi(e)||Cb(e))return e;const t=e[es];let r,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=bN(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else r=bN(e,!0);return vb(r,(s,i)=>{Wm(r,s,_R(i))},a),t&&(t.finalized_=!1),r}var NY=new wY,TR=NY.produce;function IR(e){return({dispatch:r,getState:a})=>s=>i=>typeof i=="function"?i(r,a,e):s(i)}var CY=IR(),kY=IR,jY=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Gm:Gm.apply(null,arguments)};function wi(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=>yR(a)&&a.type===e,r}var FR=class xf extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,xf.prototype)}static get[Symbol.species](){return xf}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new xf(...t[0].concat(this)):new xf(...t.concat(this))}};function uI(e){return Yi(e)?TR(e,()=>{}):e}function Cx(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function EY(e){return typeof e=="boolean"}var SY=()=>function(t){const{thunk:r=!0,immutableCheck:a=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=t??{};let l=new FR;return r&&(EY(r)?l.push(CY):l.push(kY(r.extraArgument))),l},DR="RTK_autoBatch",Gr=()=>e=>({payload:e,meta:{[DR]:!0}}),AI=e=>t=>{setTimeout(t,e)},UR=(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:AI(10):e.type==="callback"?e.queueNotification:AI(e.timeout),u=()=>{l=!1,i&&(i=!1,o.forEach(f=>f()))};return Object.assign({},a,{subscribe(f){const p=()=>s&&f(),x=a.subscribe(p);return o.add(f),()=>{x(),o.delete(f)}},dispatch(f){var p;try{return s=!((p=f==null?void 0:f.meta)!=null&&p[DR]),i=!s,i&&(l||(l=!0,d(u))),a.dispatch(f)}finally{s=!0}}})},BY=e=>function(r){const{autoBatch:a=!0}=r??{};let s=new FR(e);return a&&s.push(UR(typeof a=="object"?a:void 0)),s};function _Y(e){const t=SY(),{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(yk(r))o=vR(r);else throw new Error(Qs(1));let d;typeof a=="function"?d=a(t):d=t();let u=Gm;s&&(u=jY({trace:!1,...typeof s=="object"&&s}));const f=cY(...d),p=BY(f);let x=typeof l=="function"?l(p):p();const m=u(...x);return bR(o,i,m)}function MR(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 TY(e){return typeof e=="function"}function IY(e,t){let[r,a,s]=MR(t),i;if(TY(e))i=()=>uI(e());else{const o=uI(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(xo(f)){const m=p(f,d);return m===void 0?f:m}else{if(Yi(f))return TR(f,x=>p(x,d));{const x=p(f,d);if(x===void 0){if(f===null)return f;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return f},o)}return l.getInitialState=i,l}var FY="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",DY=(e=21)=>{let t="",r=e;for(;r--;)t+=FY[Math.random()*64|0];return t},UY=Symbol.for("rtk-slice-createasyncthunk");function MY(e,t){return`${e}/${t}`}function RY({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[UY];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(PY()):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:MY(i,E),createNotation:typeof s.reducers=="function"};QY(T)?zY(B,T,f,t):LY(B,T,f)});function p(){const[E={},T=[],B=void 0]=typeof s.extraReducers=="function"?MR(s.extraReducers):[s.extraReducers],F={...E,...u.sliceCaseReducersByType};return IY(s.initialState,M=>{for(let U in F)M.addCase(U,F[U]);for(let U of u.sliceMatchers)M.addMatcher(U.matcher,U.reducer);for(let U of T)M.addMatcher(U.matcher,U.reducer);B&&M.addDefaultCase(B)})}const x=E=>E,m=new Map,b=new WeakMap;let v;function y(E,T){return v||(v=p()),v(E,T)}function k(){return v||(v=p()),v.getInitialState()}function _(E,T=!1){function B(M){let U=M[E];return typeof U>"u"&&T&&(U=Cx(b,B,k)),U}function F(M=x){const U=Cx(m,T,()=>new WeakMap);return Cx(U,M,()=>{const D={};for(const[L,P]of Object.entries(s.selectors??{}))D[L]=OY(P,M,()=>Cx(b,M,k),T);return D})}return{reducerPath:E,getSelectors:F,get selectors(){return F(B)},selectSlice:B}}const C={name:i,reducer:y,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:k,..._(l),injectInto(E,{reducerPath:T,...B}={}){const F=T??l;return E.inject({reducerPath:F,reducer:y},B),{...C,..._(F,!0)}}};return C}}function OY(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=RY();function PY(){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 LY({type:e,reducerName:t,createNotation:r},a,s){let i,l;if("reducer"in a){if(r&&!HY(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?wi(e,l):wi(e))}function QY(e){return e._reducerDefinitionType==="asyncThunk"}function HY(e){return e._reducerDefinitionType==="reducerWithPrepare"}function zY({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||kx,pending:o||kx,rejected:d||kx,settled:u||kx})}function kx(){}var $Y="task",RR="listener",OR="completed",kk="cancelled",VY=`task-${kk}`,GY=`task-${OR}`,kN=`${RR}-${kk}`,KY=`${RR}-${OR}`,jb=class{constructor(e){Fy(this,"name","TaskAbortError");Fy(this,"message");this.code=e,this.message=`${$Y} ${kk} (reason: ${e})`}},jk=(e,t)=>{if(typeof e!="function")throw new TypeError(Qs(32))},Zm=()=>{},PR=(e,t=Zm)=>(e.catch(t),e),LR=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),jd=e=>{if(e.aborted)throw new jb(e.reason)};function QR(e,t){let r=Zm;return new Promise((a,s)=>{const i=()=>s(new jb(e.reason));if(e.aborted){i();return}r=LR(e,i),t.finally(()=>r()).then(a,s)}).finally(()=>{r=Zm})}var qY=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof jb?"cancelled":"rejected",error:r}}finally{t==null||t()}},eg=e=>t=>PR(QR(e,t).then(r=>(jd(e),r))),HR=e=>{const t=eg(e);return r=>t(new Promise(a=>setTimeout(a,r)))},{assign:xA}=Object,fI={},Eb="listenerMiddleware",WY=(e,t)=>{const r=a=>LR(e,()=>a.abort(e.reason));return(a,s)=>{jk(a);const i=new AbortController;r(i);const l=qY(async()=>{jd(e),jd(i.signal);const o=await a({pause:eg(i.signal),delay:HR(i.signal),signal:i.signal});return jd(i.signal),o},()=>i.abort(GY));return s!=null&&s.autoJoin&&t.push(l.catch(Zm)),{result:eg(e)(l),cancel(){i.abort(VY)}}}},YY=(e,t)=>{const r=async(a,s)=>{jd(t);let i=()=>{};const o=[new Promise((d,u)=>{let f=e({predicate:a,effect:(p,x)=>{x.unsubscribe(),d([p,x.getState(),x.getOriginalState()])}});i=()=>{f(),u()}})];s!=null&&o.push(new Promise(d=>setTimeout(d,s,null)));try{const d=await QR(t,Promise.race(o));return jd(t),d}finally{i()}};return(a,s)=>PR(r(a,s))},zR=e=>{let{type:t,actionCreator:r,matcher:a,predicate:s,effect:i}=e;if(t)s=wi(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 jk(i),{predicate:s,type:t,effect:i}},$R=xA(e=>{const{type:t,predicate:r,effect:a}=zR(e);return{id:DY(),effect:a,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Qs(22))}}},{withTypes:()=>$R}),pI=(e,t)=>{const{type:r,effect:a,predicate:s}=zR(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===s)&&i.effect===a)},jN=e=>{e.pending.forEach(t=>{t.abort(kN)})},XY=(e,t)=>()=>{for(const r of t.keys())jN(r);e.clear()},hI=(e,t,r)=>{try{e(t,r)}catch(a){setTimeout(()=>{throw a},0)}},VR=xA(wi(`${Eb}/add`),{withTypes:()=>VR}),JY=wi(`${Eb}/removeAll`),GR=xA(wi(`${Eb}/remove`),{withTypes:()=>GR}),ZY=(...e)=>{console.error(`${Eb}/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=ZY}=e;jk(l);const o=m=>(m.unsubscribe=()=>t.delete(m.id),t.set(m.id,m),b=>{m.unsubscribe(),b!=null&&b.cancelActive&&jN(m)}),d=m=>{const b=pI(t,m)??$R(m);return o(b)};xA(d,{withTypes:()=>d});const u=m=>{const b=pI(t,m);return b&&(b.unsubscribe(),m.cancelActive&&jN(b)),!!b};xA(u,{withTypes:()=>u});const f=async(m,b,v,y)=>{const k=new AbortController,_=YY(d,k.signal),C=[];try{m.pending.add(k),a(m),await Promise.resolve(m.effect(b,xA({},v,{getOriginalState:y,condition:(E,T)=>_(E,T).then(Boolean),take:_,delay:HR(k.signal),pause:eg(k.signal),extra:i,signal:k.signal,fork:WY(k.signal,C),unsubscribe:m.unsubscribe,subscribe:()=>{t.set(m.id,m)},cancelActiveListeners:()=>{m.pending.forEach((E,T,B)=>{E!==k&&(E.abort(kN),B.delete(E))})},cancel:()=>{k.abort(kN),m.pending.delete(k)},throwIfCancelled:()=>{jd(k.signal)}})))}catch(E){E instanceof jb||hI(l,E,{raisedBy:"effect"})}finally{await Promise.all(C),k.abort(KY),s(m),m.pending.delete(k)}},p=XY(t,r);return{middleware:m=>b=>v=>{if(!yR(v))return b(v);if(VR.match(v))return d(v.payload);if(JY.match(v)){p();return}if(GR.match(v))return u(v.payload);let y=m.getState();const k=()=>{if(y===fI)throw new Error(Qs(23));return y};let _;try{if(_=b(v),t.size>0){const C=m.getState(),E=Array.from(t.values());for(const T of E){let B=!1;try{B=T.predicate(v,C,y)}catch(F){B=!1,hI(l,F,{raisedBy:"predicate"})}B&&f(T,v,m,k)}}}finally{y=fI}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 eX={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},KR=ws({name:"chartLayout",initialState:eX,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:tX,setLayout:rX,setChartSize:aX,setScale:nX}=KR.actions,sX=KR.reducer;function qR(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 kl(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function xI(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 cA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xI(Object(r),!0).forEach(function(a){iX(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function iX(e,t,r){return(t=lX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lX(e){var t=oX(e,"string");return typeof t=="symbol"?t:t+""}function oX(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:Cl(t)?mb(e,t,r):typeof t=="function"?t(e):r}var cX=(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 cA(cA({},e),{},{[i]:e[i]+(a||0)});if((o==="horizontal"||o==="vertical"&&i==="center")&&l!=="middle"&&At(e[l]))return cA(cA({},e),{},{[l]:e[l]+(s||0)})}return e},Bl=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",WR=(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},YR=(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:x,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?fi(i[0]-i[1])*2*v:v,p||x){var y=(p||x||[]).map((k,_)=>{var C=a?a.indexOf(k):k,E=l.map(C);return Vt(E)?{coordinate:E+v,value:k,offset:v,index:_}:null}).filter(ps);return y}return d&&u?u.map((k,_)=>{var C=l.map(k);return Vt(C)?{coordinate:C+v,value:k,index:_,offset:v}:null}).filter(ps):l.ticks&&f!=null?l.ticks(f).map((k,_)=>{var C=l.map(k);return Vt(C)?{coordinate:C+v,value:k,index:_,offset:v}:null}).filter(ps):l.domain().map((k,_)=>{var C=l.map(k);return Vt(C)?{coordinate:C+v,value:a?a[k]:k,index:_,offset:v}:null}).filter(ps)},dX=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],x=Nl(f)?p:f;x>=0?(u[0]=i,i+=x,u[1]=i):(u[0]=l,l+=x,u[1]=l)}}}},uX=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=Nl(d[1])?d[0]:d[1];u>=0?(d[0]=i,i+=u,d[1]=i):(d[0]=0,d[1]=0)}}}},AX={sign:dX,expand:Yq,none:Od,silhouette:Xq,wiggle:Jq,positive:uX},fX=(e,t,r)=>{var a,s=(a=AX[r])!==null&&a!==void 0?a:Od,i=Wq().keys(t).value((o,d)=>Number(Cn(o,d,0))).order(xN).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 pX(e){return e==null?void 0:String(e)}function mI(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=sR(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 hX=e=>{var t=e.flat(2).filter(At);return[Math.min(...t),Math.max(...t)]},xX=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],mX=(e,t,r)=>{if(e!=null)return xX(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=qR(u,t,r),p=hX(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]))},gI=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,bI=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,tg=(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=gb(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 vI(e){var{tooltipEntrySettings:t,dataKey:r,payload:a,value:s,name:i}=e;return cA(cA({},t),{},{dataKey:r,payload:a,value:s,name:i})}function XR(e,t){if(e)return String(e);if(typeof t=="string")return t}var gX=(e,t)=>{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},bX=(e,t)=>t==="centric"?e.angle:e.radius,jo=e=>e.layout.width,Eo=e=>e.layout.height,vX=e=>e.layout.scale,JR=e=>e.layout.margin,Sb=De(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Bb=De(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),yX="data-recharts-item-index",wX="data-recharts-item-id",Op=60;function yI(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 jx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yI(Object(r),!0).forEach(function(a){NX(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function NX(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=kX(e,"string");return typeof t=="symbol"?t:t+""}function kX(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 jX=e=>e.brush.height;function EX(e){var t=Bb(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 SX(e){var t=Bb(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 BX(e){var t=Sb(e);return t.reduce((r,a)=>a.orientation==="top"&&!a.mirror&&!a.hide?r+a.height:r,0)}function _X(e){var t=Sb(e);return t.reduce((r,a)=>a.orientation==="bottom"&&!a.mirror&&!a.hide?r+a.height:r,0)}var Sn=De([jo,Eo,JR,jX,EX,SX,BX,_X,gR,aY],(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},x=jx(jx({},p),f),m=x.bottom;x.bottom+=a,x=cX(x,d,u);var b=e-x.left-x.right,v=t-x.top-x.bottom;return jx(jx({brushBottom:m},x),{},{width:Math.max(b,0),height:Math.max(v,0)})}),TX=De(Sn,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),ZR=De(jo,Eo,(e,t)=>({x:0,y:0,width:e,height:t})),IX=j.createContext(null),Ns=()=>j.useContext(IX)!=null,_b=e=>e.brush,Tb=De([_b,Sn,JR],(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})),Pw={},Lw={},Qw={},wI;function FX(){return wI||(wI=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 x=null;const m=()=>{x!=null&&clearTimeout(x),x=setTimeout(()=>{x=null,p()},a)},b=()=>{x!==null&&(clearTimeout(x),x=null)},v=()=>{b(),l=void 0,o=null},y=()=>{f()},k=function(..._){if(s!=null&&s.aborted)return;l=this,o=_;const C=x==null;m(),d&&C&&f()};return k.schedule=m,k.cancel=v,k.flush=y,s==null||s.addEventListener("abort",v,{once:!0}),k}e.debounce=t})(Qw)),Qw}var NI;function DX(){return NI||(NI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=FX();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 x=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(),x.cancel(),x.schedule(),f):(x.apply(this,v),f)},b=()=>(x.flush(),f);return m.cancel=x.cancel,m.flush=b,m}e.debounce=r})(Lw)),Lw}var CI;function UX(){return CI||(CI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=DX();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})(Pw)),Pw}var Hw,kI;function MX(){return kI||(kI=1,Hw=UX().throttle),Hw}var RX=MX();const OX=El(RX);var rg=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++]))}},hl={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},e8=(e,t,r)=>{var{width:a=hl.width,height:s=hl.height,aspect:i,maxHeight:l}=r,o=Pd(a)?e:Number(a),d=Pd(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}},PX={width:0,height:0,overflow:"visible"},LX={width:0,overflowX:"visible"},QX={height:0,overflowY:"visible"},HX={},zX=e=>{var{width:t,height:r}=e,a=Pd(t),s=Pd(r);return a&&s?PX:a?LX:s?QX:HX};function $X(e){var{width:t,height:r,aspect:a}=e,s=t,i=r;return s===void 0&&i===void 0?(s=hl.width,i=hl.height):s===void 0?s=a&&a>0?void 0:hl.width:i===void 0&&(i=a&&a>0?void 0:hl.height),{width:s,height:i}}function EN(){return EN=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},EN.apply(null,arguments)}function jI(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 EI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jI(Object(r),!0).forEach(function(a){VX(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function VX(e,t,r){return(t=GX(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GX(e){var t=KX(e,"string");return typeof t=="symbol"?t:t+""}function KX(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 t8=j.createContext(hl.initialDimension);function qX(e){return kl(e.width)&&kl(e.height)}function r8(e){var{children:t,width:r,height:a}=e,s=j.useMemo(()=>({width:r,height:a}),[r,a]);return qX(s)?j.createElement(t8.Provider,{value:s},t):null}var Ek=()=>j.useContext(t8),WX=j.forwardRef((e,t)=>{var{aspect:r,initialDimension:a=hl.initialDimension,width:s,height:i,minWidth:l=hl.minWidth,minHeight:o,maxHeight:d,children:u,debounce:f=hl.debounce,id:p,className:x,onResize:m,style:b={}}=e,v=j.useRef(null),y=j.useRef();y.current=m,j.useImperativeHandle(t,()=>v.current);var[k,_]=j.useState({containerWidth:a.width,containerHeight:a.height}),C=j.useCallback((M,U)=>{_(D=>{var L=Math.round(M),P=Math.round(U);return D.containerWidth===L&&D.containerHeight===P?D:{containerWidth:L,containerHeight:P}})},[]);j.useEffect(()=>{if(v.current==null||typeof ResizeObserver>"u")return LA;var M=P=>{var G,H=P[0];if(H!=null){var{width:Q,height:Y}=H.contentRect;C(Q,Y),(G=y.current)===null||G===void 0||G.call(y,Q,Y)}};f>0&&(M=OX(M,f,{trailing:!0,leading:!1}));var U=new ResizeObserver(M),{width:D,height:L}=v.current.getBoundingClientRect();return C(D,L),U.observe(v.current),()=>{U.disconnect()}},[C,f]);var{containerWidth:E,containerHeight:T}=k;rg(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:B,calculatedHeight:F}=e8(E,T,{width:s,height:i,aspect:r,maxHeight:d});return rg(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),j.createElement("div",{id:p?"".concat(p):void 0,className:Lr("recharts-responsive-container",x),style:EI(EI({},b),{},{width:s,height:i,minWidth:l,minHeight:o,maxHeight:d}),ref:v},j.createElement("div",{style:zX({width:s,height:i})},j.createElement(r8,{width:B,height:F},u)))}),Sk=j.forwardRef((e,t)=>{var r=Ek();if(kl(r.width)&&kl(r.height))return e.children;var{width:a,height:s}=$X({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:i,calculatedHeight:l}=e8(void 0,void 0,{width:a,height:s,aspect:e.aspect,maxHeight:e.maxHeight});return At(i)&&At(l)?j.createElement(r8,{width:i,height:l},e.children):j.createElement(WX,EN({},e,{width:a,height:s,ref:t}))});function Bk(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 Ib=()=>{var e,t=Ns(),r=gt(TX),a=gt(Tb),s=(e=gt(_b))===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}},YX={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},a8=()=>{var e;return(e=gt(Sn))!==null&&e!==void 0?e:YX},n8=()=>gt(jo),s8=()=>gt(Eo),Yr=e=>e.layout.layoutType,QA=()=>gt(Yr),_k=()=>{var e=QA();if(e==="horizontal"||e==="vertical")return e},i8=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},XX=()=>{var e=QA();return e!==void 0},Pp=e=>{var t=an(),r=Ns(),{width:a,height:s}=e,i=Ek(),l=a,o=s;return i&&(l=i.width>0?i.width:a,o=i.height>0?i.height:s),j.useEffect(()=>{!r&&kl(l)&&kl(o)&&t(aX({width:l,height:o}))},[t,r,l,o]),null},l8=Symbol.for("immer-nothing"),SI=Symbol.for("immer-draftable"),zs=Symbol.for("immer-state");function Ri(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var tp=Object.getPrototypeOf;function SA(e){return!!e&&!!e[zs]}function Qd(e){var t;return e?o8(e)||Array.isArray(e)||!!e[SI]||!!((t=e.constructor)!=null&&t[SI])||Lp(e)||Db(e):!1}var JX=Object.prototype.constructor.toString(),BI=new WeakMap;function o8(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=BI.get(r);return a===void 0&&(a=Function.toString.call(r),BI.set(r,a)),a===JX}function ag(e,t,r=!0){Fb(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 Fb(e){const t=e[zs];return t?t.type_:Array.isArray(e)?1:Lp(e)?2:Db(e)?3:0}function SN(e,t){return Fb(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function c8(e,t,r){const a=Fb(e);a===2?e.set(t,r):a===3?e.add(r):e[t]=r}function ZX(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Lp(e){return e instanceof Map}function Db(e){return e instanceof Set}function hd(e){return e.copy_||e.base_}function BN(e,t){if(Lp(e))return new Map(e);if(Db(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=o8(e);if(t===!0||t==="class_only"&&!r){const a=Object.getOwnPropertyDescriptors(e);delete a[zs];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(tp(e),a)}else{const a=tp(e);if(a!==null&&r)return{...e};const s=Object.create(a);return Object.assign(s,e)}}function Tk(e,t=!1){return Ub(e)||SA(e)||!Qd(e)||(Fb(e)>1&&Object.defineProperties(e,{set:Ex,add:Ex,clear:Ex,delete:Ex}),Object.freeze(e),t&&Object.values(e).forEach(r=>Tk(r,!0))),e}function eJ(){Ri(2)}var Ex={value:eJ};function Ub(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var tJ={};function Hd(e){const t=tJ[e];return t||Ri(0,e),t}var rp;function d8(){return rp}function rJ(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function _I(e,t){t&&(Hd("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function _N(e){TN(e),e.drafts_.forEach(aJ),e.drafts_=null}function TN(e){e===rp&&(rp=e.parent_)}function TI(e){return rp=rJ(rp,e)}function aJ(e){const t=e[zs];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function II(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[zs].modified_&&(_N(t),Ri(4)),Qd(e)&&(e=ng(t,e),t.parent_||sg(t,e)),t.patches_&&Hd("Patches").generateReplacementPatches_(r[zs].base_,e,t.patches_,t.inversePatches_)):e=ng(t,r,[]),_N(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==l8?e:void 0}function ng(e,t,r){if(Ub(t))return t;const a=e.immer_.shouldUseStrictIteration(),s=t[zs];if(!s)return ag(t,(i,l)=>FI(e,s,t,i,l,r),a),t;if(s.scope_!==e)return t;if(!s.modified_)return sg(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),ag(l,(d,u)=>FI(e,s,i,d,u,r,o),a),sg(e,i,!1),r&&e.patches_&&Hd("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function FI(e,t,r,a,s,i,l){if(s==null||typeof s!="object"&&!l)return;const o=Ub(s);if(!(o&&!l)){if(SA(s)){const d=i&&t&&t.type_!==3&&!SN(t.assigned_,a)?i.concat(a):void 0,u=ng(e,s,d);if(c8(r,a,u),SA(u))e.canAutoFreeze_=!1;else return}else l&&r.add(s);if(Qd(s)&&!o){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[a]===s&&o)return;ng(e,s),(!t||!t.scope_.parent_)&&typeof a!="symbol"&&(Lp(r)?r.has(a):Object.prototype.propertyIsEnumerable.call(r,a))&&sg(e,s)}}}function sg(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Tk(t,r)}function nJ(e,t){const r=Array.isArray(e),a={type_:r?1:0,scope_:t?t.scope_:d8(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=a,i=Ik;r&&(s=[a],i=ap);const{revoke:l,proxy:o}=Proxy.revocable(s,i);return a.draft_=o,a.revoke_=l,o}var Ik={get(e,t){if(t===zs)return e;const r=hd(e);if(!SN(r,t))return sJ(e,r,t);const a=r[t];return e.finalized_||!Qd(a)?a:a===zw(e.base_,t)?($w(e),e.copy_[t]=FN(a,e)):a},has(e,t){return t in hd(e)},ownKeys(e){return Reflect.ownKeys(hd(e))},set(e,t,r){const a=u8(hd(e),t);if(a!=null&&a.set)return a.set.call(e.draft_,r),!0;if(!e.modified_){const s=zw(hd(e),t),i=s==null?void 0:s[zs];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(ZX(r,s)&&(r!==void 0||SN(e.base_,t)))return!0;$w(e),IN(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 zw(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,$w(e),IN(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 tp(e.base_)},setPrototypeOf(){Ri(12)}},ap={};ag(Ik,(e,t)=>{ap[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ap.deleteProperty=function(e,t){return ap.set.call(this,e,t,void 0)};ap.set=function(e,t,r){return Ik.set.call(this,e[0],t,r,e[0])};function zw(e,t){const r=e[zs];return(r?hd(r):e)[t]}function sJ(e,t,r){var s;const a=u8(t,r);return a?"value"in a?a.value:(s=a.get)==null?void 0:s.call(e.draft_):void 0}function u8(e,t){if(!(t in e))return;let r=tp(e);for(;r;){const a=Object.getOwnPropertyDescriptor(r,t);if(a)return a;r=tp(r)}}function IN(e){e.modified_||(e.modified_=!0,e.parent_&&IN(e.parent_))}function $w(e){e.copy_||(e.copy_=BN(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var iJ=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(Qd(t)){const i=TI(this),l=FN(t,void 0);let o=!0;try{s=r(l),o=!1}finally{o?_N(i):TN(i)}return _I(i,a),II(s,i)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===l8&&(s=void 0),this.autoFreeze_&&Tk(s,!0),a){const i=[],l=[];Hd("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){Qd(e)||Ri(8),SA(e)&&(e=lJ(e));const t=TI(this),r=FN(e,void 0);return r[zs].isManual_=!0,TN(t),r}finishDraft(e,t){const r=e&&e[zs];(!r||!r.isManual_)&&Ri(9);const{scope_:a}=r;return _I(a,t),II(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=Hd("Patches").applyPatches_;return SA(e)?a(e,t):this.produce(e,s=>a(s,t))}};function FN(e,t){const r=Lp(e)?Hd("MapSet").proxyMap_(e,t):Db(e)?Hd("MapSet").proxySet_(e,t):nJ(e,t);return(t?t.scope_:d8()).drafts_.push(r),r}function lJ(e){return SA(e)||Ri(10,e),A8(e)}function A8(e){if(!Qd(e)||Ub(e))return e;const t=e[zs];let r,a=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=BN(e,t.scope_.immer_.useStrictShallowCopy_),a=t.scope_.immer_.shouldUseStrictIteration()}else r=BN(e,!0);return ag(r,(s,i)=>{c8(r,s,A8(i))},a),t&&(t.finalized_=!1),r}var oJ=new iJ;oJ.produce;var cJ={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},f8=ws({name:"legend",initialState:cJ,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:gFe,setLegendSettings:bFe,addLegendPayload:dJ,replaceLegendPayload:uJ,removeLegendPayload:AJ}=f8.actions,fJ=f8.reducer;function DN(){return DN=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},DN.apply(null,arguments)}function DI(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 W0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DI(Object(r),!0).forEach(function(a){pJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function pJ(e,t,r){return(t=hJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hJ(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)}function mJ(e){return Array.isArray(e)&&Cl(e[0])&&Cl(e[1])?e.join(" ~ "):e}var zu={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},gJ=e=>{var{separator:t=zu.separator,contentStyle:r,itemStyle:a,labelStyle:s=zu.labelStyle,payload:i,formatter:l,itemSorter:o,wrapperClassName:d,labelClassName:u,label:f,labelFormatter:p,accessibilityLayer:x=zu.accessibilityLayer}=e,m=()=>{if(i&&i.length){var T={padding:0,margin:0},B=(o?gb(i,o):i).map((F,M)=>{if(F.type==="none")return null;var U=F.formatter||l||mJ,{value:D,name:L}=F,P=D,G=L;if(U){var H=U(D,L,F,M,i);if(Array.isArray(H))[P,G]=H;else if(H!=null)P=H;else return null}var Q=W0(W0({},zu.itemStyle),{},{color:F.color||zu.itemStyle.color},a);return j.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(M),style:Q},Cl(G)?j.createElement("span",{className:"recharts-tooltip-item-name"},G):null,Cl(G)?j.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,j.createElement("span",{className:"recharts-tooltip-item-value"},P),j.createElement("span",{className:"recharts-tooltip-item-unit"},F.unit||""))});return j.createElement("ul",{className:"recharts-tooltip-item-list",style:T},B)}return null},b=W0(W0({},zu.contentStyle),r),v=W0({margin:0},s),y=!Qn(f),k=y?f:"",_=Lr("recharts-default-tooltip",d),C=Lr("recharts-tooltip-label",u);y&&p&&i!==void 0&&i!==null&&(k=p(f,i));var E=x?{role:"status","aria-live":"assertive"}:{};return j.createElement("div",DN({className:_,style:b},E),j.createElement("p",{className:C,style:v},j.isValidElement(k)?k:"".concat(k)),m())},Y0="recharts-tooltip-wrapper",bJ={visibility:"hidden"};function vJ(e){var{coordinate:t,translateX:r,translateY:a}=e;return Lr(Y0,{["".concat(Y0,"-right")]:At(r)&&t&&At(t.x)&&r>=t.x,["".concat(Y0,"-left")]:At(r)&&t&&At(t.x)&&r<t.x,["".concat(Y0,"-bottom")]:At(a)&&t&&At(t.y)&&a>=t.y,["".concat(Y0,"-top")]:At(a)&&t&&At(t.y)&&a<t.y})}function UI(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 x=d[a];if(x==null)return 0;if(l[a]){var m=f,b=x;return m<b?Math.max(p,x):Math.max(f,x)}if(u==null)return 0;var v=p+o,y=x+u;return v>y?Math.max(f,x):Math.max(p,x)}function yJ(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 wJ(e){var{allowEscapeViewBox:t,coordinate:r,offsetTop:a,offsetLeft:s,position:i,reverseDirection:l,tooltipBox:o,useTranslate3d:d,viewBox:u}=e,f,p,x;return o.height>0&&o.width>0&&r?(p=UI({allowEscapeViewBox:t,coordinate:r,key:"x",offset:s,position:i,reverseDirection:l,tooltipDimension:o.width,viewBox:u,viewBoxDimension:u.width}),x=UI({allowEscapeViewBox:t,coordinate:r,key:"y",offset:a,position:i,reverseDirection:l,tooltipDimension:o.height,viewBox:u,viewBoxDimension:u.height}),f=yJ({translateX:p,translateY:x,useTranslate3d:d})):f=bJ,{cssProperties:f,cssClasses:vJ({translateX:p,translateY:x,coordinate:r})}}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 Sx(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){UN(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 UN(e,t,r){return(t=NJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NJ(e){var t=CJ(e,"string");return typeof t=="symbol"?t:t+""}function CJ(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 kJ extends j.PureComponent{constructor(){super(...arguments),UN(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),UN(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:x,viewBox:m,wrapperStyle:b,lastBoundingBox:v,innerRef:y,hasPortalFromProps:k}=this.props,_=typeof u=="number"?u:u.x,C=typeof u=="number"?u:u.y,{cssClasses:E,cssProperties:T}=wJ({allowEscapeViewBox:r,coordinate:l,offsetLeft:_,offsetTop:C,position:f,reverseDirection:p,tooltipBox:{height:v.height,width:v.width},useTranslate3d:x,viewBox:m}),B=k?{}:Sx(Sx({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=Sx(Sx({},B),{},{visibility:!this.state.dismissed&&t&&o?"visible":"hidden"},b);return j.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:E,style:F,ref:y},i)}}var p8=()=>{var e;return(e=gt(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};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 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 OI(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){jJ(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 jJ(e,t,r){return(t=EJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EJ(e){var t=SJ(e,"string");return typeof t=="symbol"?t:t+""}function SJ(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 PI={curveBasisClosed:Oq,curveBasisOpen:Pq,curveBasis:Rq,curveBumpX:Uq,curveBumpY:Mq,curveLinearClosed:Lq,curveLinear:hb,curveMonotoneX:Qq,curveMonotoneY:Hq,curveNatural:zq,curveStep:$q,curveStepAfter:Gq,curveStepBefore:Vq},ig=e=>Vt(e.x)&&Vt(e.y),LI=e=>e.base!=null&&ig(e.base)&&ig(e),X0=e=>e.x,J0=e=>e.y,BJ=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(xk(e));if((r==="curveMonotone"||r==="curveBump")&&t){var a=PI["".concat(r).concat(t==="vertical"?"Y":"X")];if(a)return a}return PI[r]||hb},QI={connectNulls:!1,type:"linear"},_J=e=>{var{type:t=QI.type,points:r=[],baseLine:a,layout:s,connectNulls:i=QI.connectNulls}=e,l=BJ(t,s),o=i?r.filter(ig):r;if(Array.isArray(a)){var d,u=r.map((b,v)=>OI(OI({},b),{},{base:a[v]}));s==="vertical"?d=vx().y(J0).x1(X0).x0(b=>b.base.x):d=vx().x(X0).y1(J0).y0(b=>b.base.y);var f=d.defined(LI).curve(l),p=i?u.filter(LI):u;return f(p)}var x;s==="vertical"&&At(a)?x=vx().y(J0).x1(X0).x0(a):At(a)?x=vx().x(X0).y1(J0).y0(a):x=qM().x(X0).y(J0);var m=x.defined(ig).curve(l);return m(o)},_m=e=>{var{className:t,points:r,path:a,pathRef:s}=e,i=QA();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?_J(l):a;return j.createElement("path",MN({},Wi(e),mk(e),{className:Lr("recharts-curve",t),d:o===null?void 0:o,ref:s}))},TJ=["x","y","top","left","width","height","className"];function RN(){return RN=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},RN.apply(null,arguments)}function HI(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 IJ(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HI(Object(r),!0).forEach(function(a){FJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function FJ(e,t,r){return(t=DJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DJ(e){var t=UJ(e,"string");return typeof t=="symbol"?t:t+""}function UJ(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 MJ(e,t){if(e==null)return{};var r,a,s=RJ(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 RJ(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 OJ=(e,t,r,a,s,i)=>"M".concat(e,",").concat(s,"v").concat(a,"M").concat(i,",").concat(t,"h").concat(r),PJ=e=>{var{x:t=0,y:r=0,top:a=0,left:s=0,width:i=0,height:l=0,className:o}=e,d=MJ(e,TJ),u=IJ({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:j.createElement("path",RN({},yi(u),{className:Lr("recharts-cross",o),d:OJ(t,r,i,l,a,s)}))};function LJ(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 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 $I(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){QJ(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 QJ(e,t,r){return(t=HJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HJ(e){var t=zJ(e,"string");return typeof t=="symbol"?t:t+""}function zJ(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 $J=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),VJ=(e,t,r)=>e.map(a=>"".concat($J(a)," ").concat(t,"ms ").concat(r)).join(","),GJ=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((r,a)=>r.filter(s=>a.includes(s))),np=(e,t)=>Object.keys(t).reduce((r,a)=>$I($I({},r),{},{[a]:e(a,t[a])}),{});function VI(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?VI(Object(r),!0).forEach(function(a){KJ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VI(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function KJ(e,t,r){return(t=qJ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qJ(e){var t=WJ(e,"string");return typeof t=="symbol"?t:t+""}function WJ(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 lg=(e,t,r)=>e+(t-e)*r,ON=e=>{var{from:t,to:r}=e;return t!==r},h8=(e,t,r)=>{var a=np((s,i)=>{if(ON(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?np((s,i)=>ON(i)&&a[s]!=null?Pa(Pa({},i),{},{velocity:lg(i.velocity,a[s].velocity,r),from:lg(i.from,a[s].from,r)}):i,t):h8(e,a,r-1)};function YJ(e,t,r,a,s,i){var l,o=a.reduce((x,m)=>Pa(Pa({},x),{},{[m]:{from:e[m],velocity:0,to:t[m]}}),{}),d=()=>np((x,m)=>m.from,o),u=()=>!Object.values(o).filter(ON).length,f=null,p=x=>{l||(l=x);var m=x-l,b=m/r.dt;o=h8(r,o,b),s(Pa(Pa(Pa({},e),t),d())),l=x,u()||(f=i.setTimeout(p))};return()=>(f=i.setTimeout(p),()=>{var x;(x=f)===null||x===void 0||x()})}function XJ(e,t,r,a,s,i,l){var o=null,d=s.reduce((p,x)=>{var m=e[x],b=t[x];return m==null||b==null?p:Pa(Pa({},p),{},{[x]:[m,b]})},{}),u,f=p=>{u||(u=p);var x=(p-u)/a,m=np((v,y)=>lg(...y,r(x)),d);if(i(Pa(Pa(Pa({},e),t),m)),x<1)o=l.setTimeout(f);else{var b=np((v,y)=>lg(...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 JJ=(e,t,r,a,s,i)=>{var l=GJ(e,t);return r==null?()=>(s(Pa(Pa({},e),t)),()=>{}):r.isStepper===!0?YJ(e,t,r,l,s,i):XJ(e,t,r,a,l,s,i)};var og=1e-4,x8=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],m8=(e,t)=>e.map((r,a)=>r*t**a).reduce((r,a)=>r+a),GI=(e,t)=>r=>{var a=x8(e,t);return m8(a,r)},ZJ=(e,t)=>r=>{var a=x8(e,t),s=[...a.map((i,l)=>i*l).slice(1),0];return m8(s,r)},eZ=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]]},tZ=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=eZ(r[0]);if(s)return s}}return r.length===4?r:[0,0,1,1]},rZ=(e,t,r,a)=>{var s=GI(e,r),i=GI(t,a),l=ZJ(e,r),o=u=>u>1?1:u<0?0:u,d=u=>{for(var f=u>1?1:u,p=f,x=0;x<8;++x){var m=s(p)-f,b=l(p);if(Math.abs(m-f)<og||b<og)return i(p);p=o(p-m/b)}return i(p)};return d.isStepper=!1,d},KI=function(){return rZ(...tZ(...arguments))},aZ=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,x=d*s/1e3+l;return Math.abs(x-o)<og&&Math.abs(p)<og?[o,0]:[x,p]};return i.isStepper=!0,i.dt=s,i},nZ=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return KI(e);case"spring":return aZ();default:if(e.split("(")[0]==="cubic-bezier")return KI(e)}return typeof e=="function"?e:null};function sZ(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 iZ{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 lZ(){return sZ(new iZ)}var oZ=j.createContext(lZ);function cZ(e,t){var r=j.useContext(oZ);return j.useMemo(()=>t??r(e),[e,t,r])}var dZ=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Qp={isSsr:dZ()},uZ={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},qI={t:0},Vw={t:1};function g8(e){var t=Vs(e,uZ),{isActive:r,canBegin:a,duration:s,easing:i,begin:l,onAnimationEnd:o,onAnimationStart:d,children:u}=t,f=r==="auto"?!Qp.isSsr:r,p=cZ(t.animationId,t.animationManager),[x,m]=j.useState(f?qI:Vw),b=j.useRef(null);return j.useEffect(()=>{f||m(Vw)},[f]),j.useEffect(()=>{if(!f||!a)return LA;var v=JJ(qI,Vw,nZ(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(x.t)}function b8(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=j.useRef(Xf(t)),a=j.useRef(e);return a.current!==e&&(r.current=Xf(t),a.current=e),r.current}var AZ=["radius"],fZ=["radius"],WI,YI,XI,JI,ZI,eF,tF,rF,aF,nF;function sF(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 iF(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sF(Object(r),!0).forEach(function(a){pZ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sF(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function pZ(e,t,r){return(t=hZ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hZ(e){var t=xZ(e,"string");return typeof t=="symbol"?t:t+""}function xZ(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 cg(){return cg=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},cg.apply(null,arguments)}function lF(e,t){if(e==null)return{};var r,a,s=mZ(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 mZ(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 oF=(e,t,r,a,s)=>{var i=gc(r),l=gc(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 x=[0,0,0,0],m=0,b=4;m<b;m++){var v,y=(v=s[m])!==null&&v!==void 0?v:0;x[m]=y>o?o:y}p=mn(WI||(WI=il(["M",",",""])),e,t+d*x[0]),x[0]>0&&(p+=mn(YI||(YI=il(["A ",",",",0,0,",",",",",""])),x[0],x[0],f,e+u*x[0],t)),p+=mn(XI||(XI=il(["L ",",",""])),e+r-u*x[1],t),x[1]>0&&(p+=mn(JI||(JI=il(["A ",",",",0,0,",`,
        `,",",""])),x[1],x[1],f,e+r,t+d*x[1])),p+=mn(ZI||(ZI=il(["L ",",",""])),e+r,t+a-d*x[2]),x[2]>0&&(p+=mn(eF||(eF=il(["A ",",",",0,0,",`,
        `,",",""])),x[2],x[2],f,e+r-u*x[2],t+a)),p+=mn(tF||(tF=il(["L ",",",""])),e+u*x[3],t+a),x[3]>0&&(p+=mn(rF||(rF=il(["A ",",",",0,0,",`,
        `,",",""])),x[3],x[3],f,e,t+a-d*x[3])),p+="Z"}else if(o>0&&s===+s&&s>0){var k=Math.min(o,s);p=mn(aF||(aF=il(["M ",",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",",",`
            L `,",",`
            A `,",",",0,0,",",",","," Z"])),e,t+d*k,k,k,f,e+u*k,t,e+r-u*k,t,k,k,f,e+r,t+d*k,e+r,t+a-d*k,k,k,f,e+r-u*k,t+a,e+u*k,t+a,k,k,f,e,t+a-d*k)}else p=mn(nF||(nF=il(["M ",","," h "," v "," h "," Z"])),e,t,r,a,-r);return p},cF={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},gZ=e=>{var t=Vs(e,cF),r=j.useRef(null),[a,s]=j.useState(-1);j.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:x,animationBegin:m,isAnimationActive:b,isUpdateAnimationActive:v}=t,y=j.useRef(o),k=j.useRef(d),_=j.useRef(i),C=j.useRef(l),E=j.useMemo(()=>({x:i,y:l,width:o,height:d,radius:u}),[i,l,o,d,u]),T=b8(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=yi(t),{radius:M}=F,U=lF(F,AZ);return j.createElement("path",cg({},U,{x:gc(i),y:gc(l),width:gc(o),height:gc(d),radius:typeof u=="number"?u:void 0,className:B,d:oF(i,l,o,d,u)}))}var D=y.current,L=k.current,P=_.current,G=C.current,H="0px ".concat(a===-1?1:a,"px"),Q="".concat(a,"px 0px"),Y=VJ(["strokeDasharray"],x,typeof p=="string"?p:cF.animationEasing);return j.createElement(g8,{animationId:T,key:T,canBegin:a>0,duration:x,easing:p,isActive:v,begin:m},K=>{var ee=pl(D,o,K),J=pl(L,d,K),W=pl(P,i,K),R=pl(G,l,K);r.current&&(y.current=ee,k.current=J,_.current=W,C.current=R);var O;b?K>0?O={transition:Y,strokeDasharray:Q}:O={strokeDasharray:H}:O={strokeDasharray:Q};var q=yi(t),{radius:z}=q,X=lF(q,fZ);return j.createElement("path",cg({},X,{radius:typeof u=="number"?u:void 0,className:B,d:oF(W,R,ee,J,u),ref:r,style:iF(iF({},O),t.style)}))})};function dF(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 uF(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dF(Object(r),!0).forEach(function(a){bZ(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dF(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function bZ(e,t,r){return(t=vZ(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vZ(e){var t=yZ(e,"string");return typeof t=="symbol"?t:t+""}function yZ(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 dg=Math.PI/180,wZ=e=>e*180/Math.PI,wn=(e,t,r,a)=>({x:e+Math.cos(-dg*a)*r,y:t+Math.sin(-dg*a)*r}),NZ=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},CZ=(e,t)=>{var{x:r,y:a}=e,{x:s,y:i}=t;return Math.sqrt((r-s)**2+(a-i)**2)},kZ=(e,t)=>{var{x:r,y:a}=e,{cx:s,cy:i}=t,l=CZ({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:wZ(d),angleInRadian:d}},jZ=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}},EZ=(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},SZ=(e,t)=>{var{chartX:r,chartY:a}=e,{radius:s,angle:i}=kZ({x:r,y:a},t),{innerRadius:l,outerRadius:o}=t;if(s<l||s>o||s===0)return null;var{startAngle:d,endAngle:u}=jZ(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?uF(uF({},t),{},{radius:s,angle:EZ(f,t)}):null};function v8(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 AF,fF,pF,hF,xF,mF,gF;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 vd(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var BZ=(e,t)=>{var r=fi(t-e),a=Math.min(Math.abs(t-e),359.999);return r*a},Bx=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)/dg,p=d?s:s+i*f,x=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*dg),b);return{center:x,circleTangency:m,lineTangency:v,theta:f}},y8=e=>{var{cx:t,cy:r,innerRadius:a,outerRadius:s,startAngle:i,endAngle:l}=e,o=BZ(i,l),d=i+o,u=wn(t,r,s,i),f=wn(t,r,s,d),p=mn(AF||(AF=vd(["M ",",",`
    A `,",",`,0,
    `,",",`,
    `,",",`
  `])),u.x,u.y,s,s,+(Math.abs(o)>180),+(i>d),f.x,f.y);if(a>0){var x=wn(t,r,a,i),m=wn(t,r,a,d);p+=mn(fF||(fF=vd(["L ",",",`
            A `,",",`,0,
            `,",",`,
            `,","," Z"])),m.x,m.y,a,a,+(Math.abs(o)>180),+(i<=d),x.x,x.y)}else p+=mn(pF||(pF=vd(["L ",","," Z"])),t,r);return p},_Z=e=>{var{cx:t,cy:r,innerRadius:a,outerRadius:s,cornerRadius:i,forceCornerRadius:l,cornerIsExternal:o,startAngle:d,endAngle:u}=e,f=fi(u-d),{circleTangency:p,lineTangency:x,theta:m}=Bx({cx:t,cy:r,radius:s,angle:d,sign:f,cornerRadius:i,cornerIsExternal:o}),{circleTangency:b,lineTangency:v,theta:y}=Bx({cx:t,cy:r,radius:s,angle:u,sign:-f,cornerRadius:i,cornerIsExternal:o}),k=o?Math.abs(d-u):Math.abs(d-u)-m-y;if(k<0)return l?mn(hF||(hF=vd(["M ",",",`
        a`,",",",0,0,1,",`,0
        a`,",",",0,0,1,",`,0
      `])),x.x,x.y,i,i,i*2,i,i,-i*2):y8({cx:t,cy:r,innerRadius:a,outerRadius:s,startAngle:d,endAngle:u});var _=mn(xF||(xF=vd(["M ",",",`
    A`,",",",0,0,",",",",",`
    A`,",",",0,",",",",",",",`
    A`,",",",0,0,",",",",",`
  `])),x.x,x.y,i,i,+(f<0),p.x,p.y,s,s,+(k>180),+(f<0),b.x,b.y,i,i,+(f<0),v.x,v.y);if(a>0){var{circleTangency:C,lineTangency:E,theta:T}=Bx({cx:t,cy:r,radius:a,angle:d,sign:f,isExternal:!0,cornerRadius:i,cornerIsExternal:o}),{circleTangency:B,lineTangency:F,theta:M}=Bx({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-M;if(U<0&&i===0)return"".concat(_,"L").concat(t,",").concat(r,"Z");_+=mn(mF||(mF=vd(["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),C.x,C.y,i,i,+(f<0),E.x,E.y)}else _+=mn(gF||(gF=vd(["L",",","Z"])),t,r);return _},TZ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},IZ=e=>{var t=Vs(e,TZ),{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 x=Lr("recharts-sector",p),m=i-s,b=Ic(l,m,0,!0),v;return b>0&&Math.abs(u-f)<360?v=_Z({cx:r,cy:a,innerRadius:s,outerRadius:i,cornerRadius:Math.min(b,m/2),forceCornerRadius:o,cornerIsExternal:d,startAngle:u,endAngle:f}):v=y8({cx:r,cy:a,innerRadius:s,outerRadius:i,startAngle:u,endAngle:f}),j.createElement("path",PN({},yi(t),{className:x,d:v}))};function FZ(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(iR(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 v8(t)}}var Gw={},Kw={},qw={},bF;function DZ(){return bF||(bF=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=xR();function r(a){return t.isSymbol(a)?NaN:Number(a)}e.toNumber=r})(qw)),qw}var vF;function UZ(){return vF||(vF=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=DZ();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})(Kw)),Kw}var yF;function MZ(){return yF||(yF=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mR(),r=UZ();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})(Gw)),Gw}var Ww,wF;function RZ(){return wF||(wF=1,Ww=MZ().range),Ww}var OZ=RZ();const w8=El(OZ);function kc(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function PZ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Fk(e){let t,r,a;e.length!==2?(t=kc,r=(o,d)=>kc(e(o),d),a=(o,d)=>e(o)-d):(t=e===kc||e===PZ?e:LZ,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 LZ(){return 0}function N8(e){return e===null?NaN:+e}function*QZ(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const HZ=Fk(kc),Hp=HZ.right;Fk(N8).center;class NF extends Map{constructor(t,r=VZ){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(CF(this,t))}has(t){return super.has(CF(this,t))}set(t,r){return super.set(zZ(this,t),r)}delete(t){return super.delete($Z(this,t))}}function CF({_intern:e,_key:t},r){const a=t(r);return e.has(a)?e.get(a):r}function zZ({_intern:e,_key:t},r){const a=t(r);return e.has(a)?e.get(a):(e.set(a,r),r)}function $Z({_intern:e,_key:t},r){const a=t(r);return e.has(a)&&(r=e.get(a),e.delete(a)),r}function VZ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function GZ(e=kc){if(e===kc)return C8;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 C8(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const KZ=Math.sqrt(50),qZ=Math.sqrt(10),WZ=Math.sqrt(2);function ug(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>=KZ?10:i>=qZ?5:i>=WZ?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?ug(e,t,r*2):[o,d,u]}function LN(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?ug(t,e,r):ug(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 QN(e,t,r){return t=+t,e=+e,r=+r,ug(e,t,r)[2]}function HN(e,t,r){t=+t,e=+e,r=+r;const a=t<e,s=a?QN(t,e,r):QN(e,t,r);return(a?-1:1)*(s<0?1/-s:s)}function kF(e,t){let r;for(const a of e)a!=null&&(r<a||r===void 0&&a>=a)&&(r=a);return r}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 k8(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?C8:GZ(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),x=.5*Math.sqrt(f*p*(d-p)/d)*(u-d/2<0?-1:1),m=Math.max(r,Math.floor(t-u*p/d+x)),b=Math.min(a,Math.floor(t+(d-u)*p/d+x));k8(e,t,m,b,s)}const i=e[t];let l=r,o=a;for(Z0(e,r,t),s(e[a],i)>0&&Z0(e,r,a);l<o;){for(Z0(e,l,o),++l,--o;s(e[l],i)<0;)++l;for(;s(e[o],i)>0;)--o}s(e[r],i)===0?Z0(e,r,o):(++o,Z0(e,o,a)),o<=t&&(r=o+1),t<=o&&(a=o-1)}return e}function Z0(e,t,r){const a=e[t];e[t]=e[r],e[r]=a}function YZ(e,t,r){if(e=Float64Array.from(QZ(e)),!(!(a=e.length)||isNaN(t=+t))){if(t<=0||a<2)return jF(e);if(t>=1)return kF(e);var a,s=(a-1)*t,i=Math.floor(s),l=kF(k8(e,i).subarray(0,i+1)),o=jF(e.subarray(i+1));return l+(o-l)*(s-i)}}function XZ(e,t,r=N8){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 JZ(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 So(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 zN=Symbol("implicit");function Dk(){var e=new NF,t=[],r=[],a=zN;function s(i){let l=e.get(i);if(l===void 0){if(a!==zN)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 NF;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 Dk(t,r).unknown(a)},Ei.apply(s,arguments),s}function Uk(){var e=Dk().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 x=t().length,m=s<a,b=m?s:a,v=m?a:s;i=(v-b)/Math.max(1,x-d+u*2),o&&(i=Math.floor(i)),b+=(v-b-i*(x-d))*f,l=i*(1-d),o&&(b=Math.round(b),l=Math.round(l));var y=JZ(x).map(function(k){return b+i*k});return r(m?y.reverse():y)}return e.domain=function(x){return arguments.length?(t(x),p()):t()},e.range=function(x){return arguments.length?([a,s]=x,a=+a,s=+s,p()):[a,s]},e.rangeRound=function(x){return[a,s]=x,a=+a,s=+s,o=!0,p()},e.bandwidth=function(){return l},e.step=function(){return i},e.round=function(x){return arguments.length?(o=!!x,p()):o},e.padding=function(x){return arguments.length?(d=Math.min(1,u=+x),p()):d},e.paddingInner=function(x){return arguments.length?(d=Math.min(1,x),p()):d},e.paddingOuter=function(x){return arguments.length?(u=+x,p()):u},e.align=function(x){return arguments.length?(f=Math.max(0,Math.min(1,x)),p()):f},e.copy=function(){return Uk(t(),[a,s]).round(o).paddingInner(d).paddingOuter(u).align(f)},Ei.apply(p(),arguments)}function j8(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return j8(t())},e}function ZZ(){return j8(Uk.apply(null,arguments).paddingInner(1))}function Mk(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function E8(e,t){var r=Object.create(e.prototype);for(var a in t)r[a]=t[a];return r}function zp(){}var sp=.7,Ag=1/sp,mA="\\s*([+-]?\\d+)\\s*",ip="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",eee=/^#([0-9a-f]{3,8})$/,tee=new RegExp(`^rgb\\(${mA},${mA},${mA}\\)$`),ree=new RegExp(`^rgb\\(${bl},${bl},${bl}\\)$`),aee=new RegExp(`^rgba\\(${mA},${mA},${mA},${ip}\\)$`),nee=new RegExp(`^rgba\\(${bl},${bl},${bl},${ip}\\)$`),see=new RegExp(`^hsl\\(${ip},${bl},${bl}\\)$`),iee=new RegExp(`^hsla\\(${ip},${bl},${bl},${ip}\\)$`),EF={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};Mk(zp,lp,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:SF,formatHex:SF,formatHex8:lee,formatHsl:oee,formatRgb:BF,toString:BF});function SF(){return this.rgb().formatHex()}function lee(){return this.rgb().formatHex8()}function oee(){return S8(this).formatHsl()}function BF(){return this.rgb().formatRgb()}function lp(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=eee.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?_F(t):r===3?new hs(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?_x(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?_x(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=tee.exec(e))?new hs(t[1],t[2],t[3],1):(t=ree.exec(e))?new hs(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=aee.exec(e))?_x(t[1],t[2],t[3],t[4]):(t=nee.exec(e))?_x(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=see.exec(e))?FF(t[1],t[2]/100,t[3]/100,1):(t=iee.exec(e))?FF(t[1],t[2]/100,t[3]/100,t[4]):EF.hasOwnProperty(e)?_F(EF[e]):e==="transparent"?new hs(NaN,NaN,NaN,0):null}function _F(e){return new hs(e>>16&255,e>>8&255,e&255,1)}function _x(e,t,r,a){return a<=0&&(e=t=r=NaN),new hs(e,t,r,a)}function cee(e){return e instanceof zp||(e=lp(e)),e?(e=e.rgb(),new hs(e.r,e.g,e.b,e.opacity)):new hs}function $N(e,t,r,a){return arguments.length===1?cee(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}Mk(hs,$N,E8(zp,{brighter(e){return e=e==null?Ag:Math.pow(Ag,e),new hs(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?sp:Math.pow(sp,e),new hs(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hs(Ed(this.r),Ed(this.g),Ed(this.b),fg(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:TF,formatHex:TF,formatHex8:dee,formatRgb:IF,toString:IF}));function TF(){return`#${yd(this.r)}${yd(this.g)}${yd(this.b)}`}function dee(){return`#${yd(this.r)}${yd(this.g)}${yd(this.b)}${yd((isNaN(this.opacity)?1:this.opacity)*255)}`}function IF(){const e=fg(this.opacity);return`${e===1?"rgb(":"rgba("}${Ed(this.r)}, ${Ed(this.g)}, ${Ed(this.b)}${e===1?")":`, ${e})`}`}function fg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ed(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function yd(e){return e=Ed(e),(e<16?"0":"")+e.toString(16)}function FF(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 S8(e){if(e instanceof Oi)return new Oi(e.h,e.s,e.l,e.opacity);if(e instanceof zp||(e=lp(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 uee(e,t,r,a){return arguments.length===1?S8(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}Mk(Oi,uee,E8(zp,{brighter(e){return e=e==null?Ag:Math.pow(Ag,e),new Oi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?sp:Math.pow(sp,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(Yw(e>=240?e-240:e+120,s,a),Yw(e,s,a),Yw(e<120?e+240:e-120,s,a),this.opacity)},clamp(){return new Oi(DF(this.h),Tx(this.s),Tx(this.l),fg(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=fg(this.opacity);return`${e===1?"hsl(":"hsla("}${DF(this.h)}, ${Tx(this.s)*100}%, ${Tx(this.l)*100}%${e===1?")":`, ${e})`}`}}));function DF(e){return e=(e||0)%360,e<0?e+360:e}function Tx(e){return Math.max(0,Math.min(1,e||0))}function Yw(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 Rk=e=>()=>e;function Aee(e,t){return function(r){return e+r*t}}function fee(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 pee(e){return(e=+e)==1?B8:function(t,r){return r-t?fee(t,r,e):Rk(isNaN(t)?r:t)}}function B8(e,t){var r=t-e;return r?Aee(e,r):Rk(isNaN(e)?t:e)}const UF=(function e(t){var r=pee(t);function a(s,i){var l=r((s=$N(s)).r,(i=$N(i)).r),o=r(s.g,i.g),d=r(s.b,i.b),u=B8(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 hee(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 xee(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function mee(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]=HA(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 gee(e,t){var r=new Date;return e=+e,t=+t,function(a){return r.setTime(e*(1-a)+t*a),r}}function pg(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function bee(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]=HA(e[s],t[s]):a[s]=t[s];return function(i){for(s in r)a[s]=r[s](i);return a}}var VN=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xw=new RegExp(VN.source,"g");function vee(e){return function(){return e}}function yee(e){return function(t){return e(t)+""}}function wee(e,t){var r=VN.lastIndex=Xw.lastIndex=0,a,s,i,l=-1,o=[],d=[];for(e=e+"",t=t+"";(a=VN.exec(e))&&(s=Xw.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:pg(a,s)})),r=Xw.lastIndex;return r<t.length&&(i=t.slice(r),o[l]?o[l]+=i:o[++l]=i),o.length<2?d[0]?yee(d[0].x):vee(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 HA(e,t){var r=typeof t,a;return t==null||r==="boolean"?Rk(t):(r==="number"?pg:r==="string"?(a=lp(t))?(t=a,UF):wee:t instanceof lp?UF:t instanceof Date?gee:xee(t)?hee:Array.isArray(t)?mee:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?bee:pg)(e,t)}function Ok(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function Nee(e,t){t===void 0&&(t=e,e=HA);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 Cee(e){return function(){return e}}function hg(e){return+e}var MF=[0,1];function Yn(e){return e}function GN(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:Cee(isNaN(t)?NaN:.5)}function kee(e,t){var r;return e>t&&(r=e,e=t,t=r),function(a){return Math.max(e,Math.min(t,a))}}function jee(e,t,r){var a=e[0],s=e[1],i=t[0],l=t[1];return s<a?(a=GN(s,a),i=r(l,i)):(a=GN(a,s),i=r(i,l)),function(o){return i(a(o))}}function Eee(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]=GN(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 Mb(){var e=MF,t=MF,r=HA,a,s,i,l=Yn,o,d,u;function f(){var x=Math.min(e.length,t.length);return l!==Yn&&(l=kee(e[0],e[x-1])),o=x>2?Eee:jee,d=u=null,p}function p(x){return x==null||isNaN(x=+x)?i:(d||(d=o(e.map(a),t,r)))(a(l(x)))}return p.invert=function(x){return l(s((u||(u=o(t,e.map(a),pg)))(x)))},p.domain=function(x){return arguments.length?(e=Array.from(x,hg),f()):e.slice()},p.range=function(x){return arguments.length?(t=Array.from(x),f()):t.slice()},p.rangeRound=function(x){return t=Array.from(x),r=Ok,f()},p.clamp=function(x){return arguments.length?(l=x?!0:Yn,f()):l!==Yn},p.interpolate=function(x){return arguments.length?(r=x,f()):r},p.unknown=function(x){return arguments.length?(i=x,p):i},function(x,m){return a=x,s=m,f()}}function Pk(){return Mb()(Yn,Yn)}function See(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function xg(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 BA(e){return e=xg(Math.abs(e)),e?e[1]:NaN}function Bee(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 _ee(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var Tee=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function op(e){if(!(t=Tee.exec(e)))throw new Error("invalid format: "+e);var t;return new Lk({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]})}op.prototype=Lk.prototype;function Lk(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+""}Lk.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 Iee(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 mg;function Fee(e,t){var r=xg(e,t);if(!r)return mg=void 0,e.toPrecision(t);var a=r[0],s=r[1],i=s-(mg=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")+xg(e,Math.max(0,t+i-1))[0]}function RF(e,t){var r=xg(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 OF={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:See,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)=>RF(e*100,t),r:RF,s:Fee,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function PF(e){return e}var LF=Array.prototype.map,QF=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Dee(e){var t=e.grouping===void 0||e.thousands===void 0?PF:Bee(LF.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?PF:_ee(LF.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,x){p=op(p);var m=p.fill,b=p.align,v=p.sign,y=p.symbol,k=p.zero,_=p.width,C=p.comma,E=p.precision,T=p.trim,B=p.type;B==="n"?(C=!0,B="g"):OF[B]||(E===void 0&&(E=12),T=!0,B="g"),(k||m==="0"&&b==="=")&&(k=!0,m="0",b="=");var F=(x&&x.prefix!==void 0?x.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(B)?"0"+B.toLowerCase():""),M=(y==="$"?a:/[%p]/.test(B)?l:"")+(x&&x.suffix!==void 0?x.suffix:""),U=OF[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,H=M,Q,Y,K;if(B==="c")H=U(P)+H,P="";else{P=+P;var ee=P<0||1/P<0;if(P=isNaN(P)?d:U(Math.abs(P),E),T&&(P=Iee(P)),ee&&+P==0&&v!=="+"&&(ee=!1),G=(ee?v==="("?v:o:v==="-"||v==="("?"":v)+G,H=(B==="s"&&!isNaN(P)&&mg!==void 0?QF[8+mg/3]:"")+H+(ee&&v==="("?")":""),D){for(Q=-1,Y=P.length;++Q<Y;)if(K=P.charCodeAt(Q),48>K||K>57){H=(K===46?s+P.slice(Q+1):P.slice(Q))+H,P=P.slice(0,Q);break}}}C&&!k&&(P=t(P,1/0));var J=G.length+P.length+H.length,W=J<_?new Array(_-J+1).join(m):"";switch(C&&k&&(P=t(W+P,W.length?_-H.length:1/0),W=""),b){case"<":P=G+P+H+W;break;case"=":P=G+W+P+H;break;case"^":P=W.slice(0,J=W.length>>1)+G+P+H+W.slice(J);break;default:P=W+G+P+H;break}return i(P)}return L.toString=function(){return p+""},L}function f(p,x){var m=Math.max(-8,Math.min(8,Math.floor(BA(x)/3)))*3,b=Math.pow(10,-m),v=u((p=op(p),p.type="f",p),{suffix:QF[8+m/3]});return function(y){return v(b*y)}}return{format:u,formatPrefix:f}}var Ix,Qk,_8;Uee({thousands:",",grouping:[3],currency:["$",""]});function Uee(e){return Ix=Dee(e),Qk=Ix.format,_8=Ix.formatPrefix,Ix}function Mee(e){return Math.max(0,-BA(Math.abs(e)))}function Ree(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(BA(t)/3)))*3-BA(Math.abs(e)))}function Oee(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,BA(t)-BA(e))+1}function T8(e,t,r,a){var s=HN(e,t,r),i;switch(a=op(a??",f"),a.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return a.precision==null&&!isNaN(i=Ree(s,l))&&(a.precision=i),_8(a,l)}case"":case"e":case"g":case"p":case"r":{a.precision==null&&!isNaN(i=Oee(s,Math.max(Math.abs(e),Math.abs(t))))&&(a.precision=i-(a.type==="e"));break}case"f":case"%":{a.precision==null&&!isNaN(i=Mee(s))&&(a.precision=i-(a.type==="%")*2);break}}return Qk(a)}function Qc(e){var t=e.domain;return e.ticks=function(r){var a=t();return LN(a[0],a[a.length-1],r??10)},e.tickFormat=function(r,a){var s=t();return T8(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=QN(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 I8(){var e=Pk();return e.copy=function(){return $p(e,I8())},Ei.apply(e,arguments),Qc(e)}function F8(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 F8(e).unknown(t)},e=arguments.length?Array.from(e,hg):[0,1],Qc(r)}function D8(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 HF(e){return Math.log(e)}function zF(e){return Math.exp(e)}function Pee(e){return-Math.log(-e)}function Lee(e){return-Math.exp(-e)}function Qee(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Hee(e){return e===10?Qee:e===Math.E?Math.exp:t=>Math.pow(e,t)}function zee(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 $F(e){return(t,r)=>-e(-t,r)}function Hk(e){const t=e(HF,zF),r=t.domain;let a=10,s,i;function l(){return s=zee(a),i=Hee(a),r()[0]<0?(s=$F(s),i=$F(i),e(Pee,Lee)):e(HF,zF),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 x=s(u),m=s(f),b,v;const y=o==null?10:+o;let k=[];if(!(a%1)&&m-x<y){if(x=Math.floor(x),m=Math.ceil(m),u>0){for(;x<=m;++x)for(b=1;b<a;++b)if(v=x<0?b/i(-x):b*i(x),!(v<u)){if(v>f)break;k.push(v)}}else for(;x<=m;++x)for(b=a-1;b>=1;--b)if(v=x>0?b/i(-x):b*i(x),!(v<u)){if(v>f)break;k.push(v)}k.length*2<y&&(k=LN(u,f,y))}else k=LN(x,m,Math.min(m-x,y)).map(i);return p?k.reverse():k},t.tickFormat=(o,d)=>{if(o==null&&(o=10),d==null&&(d=a===10?"s":","),typeof d!="function"&&(!(a%1)&&(d=op(d)).precision==null&&(d.trim=!0),d=Qk(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(D8(r(),{floor:o=>i(Math.floor(s(o))),ceil:o=>i(Math.ceil(s(o)))})),t}function U8(){const e=Hk(Mb()).domain([1,10]);return e.copy=()=>$p(e,U8()).base(e.base()),Ei.apply(e,arguments),e}function VF(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function GF(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function zk(e){var t=1,r=e(VF(t),GF(t));return r.constant=function(a){return arguments.length?e(VF(t=+a),GF(t)):t},Qc(r)}function M8(){var e=zk(Mb());return e.copy=function(){return $p(e,M8()).constant(e.constant())},Ei.apply(e,arguments)}function KF(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function $ee(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Vee(e){return e<0?-e*e:e*e}function $k(e){var t=e(Yn,Yn),r=1;function a(){return r===1?e(Yn,Yn):r===.5?e($ee,Vee):e(KF(r),KF(1/r))}return t.exponent=function(s){return arguments.length?(r=+s,a()):r},Qc(t)}function Vk(){var e=$k(Mb());return e.copy=function(){return $p(e,Vk()).exponent(e.exponent())},Ei.apply(e,arguments),e}function Gee(){return Vk.apply(null,arguments).exponent(.5)}function qF(e){return Math.sign(e)*e*e}function Kee(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function R8(){var e=Pk(),t=[0,1],r=!1,a;function s(i){var l=Kee(e(i));return isNaN(l)?a:r?Math.round(l):l}return s.invert=function(i){return e.invert(qF(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(qF)),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 R8(e.domain(),t).round(r).clamp(e.clamp()).unknown(a)},Ei.apply(s,arguments),Qc(s)}function O8(){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]=XZ(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(kc),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 O8().domain(e).range(t).unknown(a)},Ei.apply(i,arguments)}function P8(){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 P8().domain([e,t]).range(s).unknown(i)},Ei.apply(Qc(l),arguments)}function L8(){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 L8().domain(e).range(t).unknown(r)},Ei.apply(s,arguments)}const Jw=new Date,Zw=new Date;function $a(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=>$a(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)=>(Jw.setTime(+i),Zw.setTime(+l),e(Jw),e(Zw),Math.floor(r(Jw,Zw))),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 gg=$a(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);gg.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?$a(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):gg);gg.range;const no=1e3,pi=no*60,so=pi*60,mo=so*24,Gk=mo*7,WF=mo*30,e2=mo*365,wd=$a(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*no)},(e,t)=>(t-e)/no,e=>e.getUTCSeconds());wd.range;const Kk=$a(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*no)},(e,t)=>{e.setTime(+e+t*pi)},(e,t)=>(t-e)/pi,e=>e.getMinutes());Kk.range;const qk=$a(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*pi)},(e,t)=>(t-e)/pi,e=>e.getUTCMinutes());qk.range;const Wk=$a(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*no-e.getMinutes()*pi)},(e,t)=>{e.setTime(+e+t*so)},(e,t)=>(t-e)/so,e=>e.getHours());Wk.range;const Yk=$a(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*so)},(e,t)=>(t-e)/so,e=>e.getUTCHours());Yk.range;const Vp=$a(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pi)/mo,e=>e.getDate()-1);Vp.range;const Rb=$a(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/mo,e=>e.getUTCDate()-1);Rb.range;const Q8=$a(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/mo,e=>Math.floor(e/mo));Q8.range;function tu(e){return $a(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())*pi)/Gk)}const Ob=tu(0),bg=tu(1),qee=tu(2),Wee=tu(3),_A=tu(4),Yee=tu(5),Xee=tu(6);Ob.range;bg.range;qee.range;Wee.range;_A.range;Yee.range;Xee.range;function ru(e){return $a(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)/Gk)}const Pb=ru(0),vg=ru(1),Jee=ru(2),Zee=ru(3),TA=ru(4),ete=ru(5),tte=ru(6);Pb.range;vg.range;Jee.range;Zee.range;TA.range;ete.range;tte.range;const Xk=$a(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());Xk.range;const Jk=$a(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());Jk.range;const go=$a(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());go.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:$a(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)});go.range;const bo=$a(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());bo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:$a(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)});bo.range;function H8(e,t,r,a,s,i){const l=[[wd,1,no],[wd,5,5*no],[wd,15,15*no],[wd,30,30*no],[i,1,pi],[i,5,5*pi],[i,15,15*pi],[i,30,30*pi],[s,1,so],[s,3,3*so],[s,6,6*so],[s,12,12*so],[a,1,mo],[a,2,2*mo],[r,1,Gk],[t,1,WF],[t,3,3*WF],[e,1,e2]];function o(u,f,p){const x=f<u;x&&([u,f]=[f,u]);const m=p&&typeof p.range=="function"?p:d(u,f,p),b=m?m.range(u,+f+1):[];return x?b.reverse():b}function d(u,f,p){const x=Math.abs(f-u)/p,m=Fk(([,,y])=>y).right(l,x);if(m===l.length)return e.every(HN(u/e2,f/e2,p));if(m===0)return gg.every(Math.max(HN(u,f,p),1));const[b,v]=l[x/l[m-1][2]<l[m][2]/x?m-1:m];return b.every(v)}return[o,d]}const[rte,ate]=H8(bo,Jk,Pb,Q8,Yk,qk),[nte,ste]=H8(go,Xk,Ob,Vp,Wk,Kk);function t2(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 r2(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 ef(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function ite(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=tf(s),f=rf(s),p=tf(i),x=rf(i),m=tf(l),b=rf(l),v=tf(o),y=rf(o),k=tf(d),_=rf(d),C={a:K,A:ee,b:J,B:W,c:null,d:t5,e:t5,f:Bte,g:Pte,G:Qte,H:jte,I:Ete,j:Ste,L:z8,m:_te,M:Tte,p:R,q:O,Q:n5,s:s5,S:Ite,u:Fte,U:Dte,V:Ute,w:Mte,W:Rte,x:null,X:null,y:Ote,Y:Lte,Z:Hte,"%":a5},E={a:q,A:z,b:X,B:re,c:null,d:r5,e:r5,f:Gte,g:rre,G:nre,H:zte,I:$te,j:Vte,L:V8,m:Kte,M:qte,p:le,q:ne,Q:n5,s:s5,S:Wte,u:Yte,U:Xte,V:Jte,w:Zte,W:ere,x:null,X:null,y:tre,Y:are,Z:sre,"%":a5},T={a:D,A:L,b:P,B:G,c:H,d:ZF,e:ZF,f:wte,g:JF,G:XF,H:e5,I:e5,j:gte,L:yte,m:mte,M:bte,p:U,q:xte,Q:Cte,s:kte,S:vte,u:ute,U:Ate,V:fte,w:dte,W:pte,x:Q,X:Y,y:JF,Y:XF,Z:hte,"%":Nte};C.x=B(r,C),C.X=B(a,C),C.c=B(t,C),E.x=B(r,E),E.X=B(a,E),E.c=B(t,E);function B(ae,ie){return function(he){var Z=[],Ue=-1,Ie=0,be=ae.length,je,fe,Me;for(he instanceof Date||(he=new Date(+he));++Ue<be;)ae.charCodeAt(Ue)===37&&(Z.push(ae.slice(Ie,Ue)),(fe=YF[je=ae.charAt(++Ue)])!=null?je=ae.charAt(++Ue):fe=je==="e"?" ":"0",(Me=ie[je])&&(je=Me(he,fe)),Z.push(je),Ie=Ue+1);return Z.push(ae.slice(Ie,Ue)),Z.join("")}}function F(ae,ie){return function(he){var Z=ef(1900,void 0,1),Ue=M(Z,ae,he+="",0),Ie,be;if(Ue!=he.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?(Ie=r2(ef(Z.y,0,1)),be=Ie.getUTCDay(),Ie=be>4||be===0?vg.ceil(Ie):vg(Ie),Ie=Rb.offset(Ie,(Z.V-1)*7),Z.y=Ie.getUTCFullYear(),Z.m=Ie.getUTCMonth(),Z.d=Ie.getUTCDate()+(Z.w+6)%7):(Ie=t2(ef(Z.y,0,1)),be=Ie.getDay(),Ie=be>4||be===0?bg.ceil(Ie):bg(Ie),Ie=Vp.offset(Ie,(Z.V-1)*7),Z.y=Ie.getFullYear(),Z.m=Ie.getMonth(),Z.d=Ie.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),be="Z"in Z?r2(ef(Z.y,0,1)).getUTCDay():t2(ef(Z.y,0,1)).getDay(),Z.m=0,Z.d="W"in Z?(Z.w+6)%7+Z.W*7-(be+5)%7:Z.w+Z.U*7-(be+6)%7);return"Z"in Z?(Z.H+=Z.Z/100|0,Z.M+=Z.Z%100,r2(Z)):t2(Z)}}function M(ae,ie,he,Z){for(var Ue=0,Ie=ie.length,be=he.length,je,fe;Ue<Ie;){if(Z>=be)return-1;if(je=ie.charCodeAt(Ue++),je===37){if(je=ie.charAt(Ue++),fe=T[je in YF?ie.charAt(Ue++):je],!fe||(Z=fe(ae,he,Z))<0)return-1}else if(je!=he.charCodeAt(Z++))return-1}return Z}function U(ae,ie,he){var Z=u.exec(ie.slice(he));return Z?(ae.p=f.get(Z[0].toLowerCase()),he+Z[0].length):-1}function D(ae,ie,he){var Z=m.exec(ie.slice(he));return Z?(ae.w=b.get(Z[0].toLowerCase()),he+Z[0].length):-1}function L(ae,ie,he){var Z=p.exec(ie.slice(he));return Z?(ae.w=x.get(Z[0].toLowerCase()),he+Z[0].length):-1}function P(ae,ie,he){var Z=k.exec(ie.slice(he));return Z?(ae.m=_.get(Z[0].toLowerCase()),he+Z[0].length):-1}function G(ae,ie,he){var Z=v.exec(ie.slice(he));return Z?(ae.m=y.get(Z[0].toLowerCase()),he+Z[0].length):-1}function H(ae,ie,he){return M(ae,t,ie,he)}function Q(ae,ie,he){return M(ae,r,ie,he)}function Y(ae,ie,he){return M(ae,a,ie,he)}function K(ae){return l[ae.getDay()]}function ee(ae){return i[ae.getDay()]}function J(ae){return d[ae.getMonth()]}function W(ae){return o[ae.getMonth()]}function R(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 X(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+="",C);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 YF={"-":"",_:" ",0:"0"},nn=/^\s*\d+/,lte=/^%/,ote=/[\\^$*+?|[\]().{}]/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 cte(e){return e.replace(ote,"\\$&")}function tf(e){return new RegExp("^(?:"+e.map(cte).join("|")+")","i")}function rf(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function dte(e,t,r){var a=nn.exec(t.slice(r,r+1));return a?(e.w=+a[0],r+a[0].length):-1}function ute(e,t,r){var a=nn.exec(t.slice(r,r+1));return a?(e.u=+a[0],r+a[0].length):-1}function Ate(e,t,r){var a=nn.exec(t.slice(r,r+2));return a?(e.U=+a[0],r+a[0].length):-1}function fte(e,t,r){var a=nn.exec(t.slice(r,r+2));return a?(e.V=+a[0],r+a[0].length):-1}function pte(e,t,r){var a=nn.exec(t.slice(r,r+2));return a?(e.W=+a[0],r+a[0].length):-1}function XF(e,t,r){var a=nn.exec(t.slice(r,r+4));return a?(e.y=+a[0],r+a[0].length):-1}function JF(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 hte(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 xte(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 mte(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 ZF(e,t,r){var a=nn.exec(t.slice(r,r+2));return a?(e.d=+a[0],r+a[0].length):-1}function gte(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 e5(e,t,r){var a=nn.exec(t.slice(r,r+2));return a?(e.H=+a[0],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],r+a[0].length):-1}function vte(e,t,r){var a=nn.exec(t.slice(r,r+2));return a?(e.S=+a[0],r+a[0].length):-1}function yte(e,t,r){var a=nn.exec(t.slice(r,r+3));return a?(e.L=+a[0],r+a[0].length):-1}function wte(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 Nte(e,t,r){var a=lte.exec(t.slice(r,r+1));return a?r+a[0].length:-1}function Cte(e,t,r){var a=nn.exec(t.slice(r));return a?(e.Q=+a[0],r+a[0].length):-1}function kte(e,t,r){var a=nn.exec(t.slice(r));return a?(e.s=+a[0],r+a[0].length):-1}function t5(e,t){return tr(e.getDate(),t,2)}function jte(e,t){return tr(e.getHours(),t,2)}function Ete(e,t){return tr(e.getHours()%12||12,t,2)}function Ste(e,t){return tr(1+Vp.count(go(e),e),t,3)}function z8(e,t){return tr(e.getMilliseconds(),t,3)}function Bte(e,t){return z8(e,t)+"000"}function _te(e,t){return tr(e.getMonth()+1,t,2)}function Tte(e,t){return tr(e.getMinutes(),t,2)}function Ite(e,t){return tr(e.getSeconds(),t,2)}function Fte(e){var t=e.getDay();return t===0?7:t}function Dte(e,t){return tr(Ob.count(go(e)-1,e),t,2)}function $8(e){var t=e.getDay();return t>=4||t===0?_A(e):_A.ceil(e)}function Ute(e,t){return e=$8(e),tr(_A.count(go(e),e)+(go(e).getDay()===4),t,2)}function Mte(e){return e.getDay()}function Rte(e,t){return tr(bg.count(go(e)-1,e),t,2)}function Ote(e,t){return tr(e.getFullYear()%100,t,2)}function Pte(e,t){return e=$8(e),tr(e.getFullYear()%100,t,2)}function Lte(e,t){return tr(e.getFullYear()%1e4,t,4)}function Qte(e,t){var r=e.getDay();return e=r>=4||r===0?_A(e):_A.ceil(e),tr(e.getFullYear()%1e4,t,4)}function Hte(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+tr(t/60|0,"0",2)+tr(t%60,"0",2)}function r5(e,t){return tr(e.getUTCDate(),t,2)}function zte(e,t){return tr(e.getUTCHours(),t,2)}function $te(e,t){return tr(e.getUTCHours()%12||12,t,2)}function Vte(e,t){return tr(1+Rb.count(bo(e),e),t,3)}function V8(e,t){return tr(e.getUTCMilliseconds(),t,3)}function Gte(e,t){return V8(e,t)+"000"}function Kte(e,t){return tr(e.getUTCMonth()+1,t,2)}function qte(e,t){return tr(e.getUTCMinutes(),t,2)}function Wte(e,t){return tr(e.getUTCSeconds(),t,2)}function Yte(e){var t=e.getUTCDay();return t===0?7:t}function Xte(e,t){return tr(Pb.count(bo(e)-1,e),t,2)}function G8(e){var t=e.getUTCDay();return t>=4||t===0?TA(e):TA.ceil(e)}function Jte(e,t){return e=G8(e),tr(TA.count(bo(e),e)+(bo(e).getUTCDay()===4),t,2)}function Zte(e){return e.getUTCDay()}function ere(e,t){return tr(vg.count(bo(e)-1,e),t,2)}function tre(e,t){return tr(e.getUTCFullYear()%100,t,2)}function rre(e,t){return e=G8(e),tr(e.getUTCFullYear()%100,t,2)}function are(e,t){return tr(e.getUTCFullYear()%1e4,t,4)}function nre(e,t){var r=e.getUTCDay();return e=r>=4||r===0?TA(e):TA.ceil(e),tr(e.getUTCFullYear()%1e4,t,4)}function sre(){return"+0000"}function a5(){return"%"}function n5(e){return+e}function s5(e){return Math.floor(+e/1e3)}var $u,K8,q8;ire({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 ire(e){return $u=ite(e),K8=$u.format,$u.parse,q8=$u.utcFormat,$u.utcParse,$u}function lre(e){return new Date(e)}function ore(e){return e instanceof Date?+e:+new Date(+e)}function Zk(e,t,r,a,s,i,l,o,d,u){var f=Pk(),p=f.invert,x=f.domain,m=u(".%L"),b=u(":%S"),v=u("%I:%M"),y=u("%I %p"),k=u("%a %d"),_=u("%b %d"),C=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?k:_:r(B)<B?C:E)(B)}return f.invert=function(B){return new Date(p(B))},f.domain=function(B){return arguments.length?x(Array.from(B,ore)):x().map(lre)},f.ticks=function(B){var F=x();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=x();return(!B||typeof B.range!="function")&&(B=t(F[0],F[F.length-1],B??10)),B?x(D8(F,B)):f},f.copy=function(){return $p(f,Zk(e,t,r,a,s,i,l,o,d,u))},f}function cre(){return Ei.apply(Zk(nte,ste,go,Xk,Ob,Vp,Wk,Kk,wd,K8).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function dre(){return Ei.apply(Zk(rte,ate,bo,Jk,Pb,Rb,Yk,qk,wd,q8).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Lb(){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(x){var m,b;return arguments.length?([m,b]=x,l=p(m,b),u):[l(0),l(1)]}}return u.range=f(HA),u.rangeRound=f(Ok),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 Hc(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function W8(){var e=Qc(Lb()(Yn));return e.copy=function(){return Hc(e,W8())},So.apply(e,arguments)}function Y8(){var e=Hk(Lb()).domain([1,10]);return e.copy=function(){return Hc(e,Y8()).base(e.base())},So.apply(e,arguments)}function X8(){var e=zk(Lb());return e.copy=function(){return Hc(e,X8()).constant(e.constant())},So.apply(e,arguments)}function ej(){var e=$k(Lb());return e.copy=function(){return Hc(e,ej()).exponent(e.exponent())},So.apply(e,arguments)}function ure(){return ej.apply(null,arguments).exponent(.5)}function J8(){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(kc),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)=>YZ(e,i/a))},r.copy=function(){return J8(t).domain(e)},So.apply(r,arguments)}function Qb(){var e=0,t=.5,r=1,a=1,s,i,l,o,d,u=Yn,f,p=!1,x;function m(v){return isNaN(v=+v)?x:(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 k,_,C;return arguments.length?([k,_,C]=y,u=Nee(v,[k,_,C]),m):[u(0),u(.5),u(1)]}}return m.range=b(HA),m.rangeRound=b(Ok),m.unknown=function(v){return arguments.length?(x=v,m):x},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 Z8(){var e=Qc(Qb()(Yn));return e.copy=function(){return Hc(e,Z8())},So.apply(e,arguments)}function eO(){var e=Hk(Qb()).domain([.1,1,10]);return e.copy=function(){return Hc(e,eO()).base(e.base())},So.apply(e,arguments)}function tO(){var e=zk(Qb());return e.copy=function(){return Hc(e,tO()).constant(e.constant())},So.apply(e,arguments)}function tj(){var e=$k(Qb());return e.copy=function(){return Hc(e,tj()).exponent(e.exponent())},So.apply(e,arguments)}function Are(){return tj.apply(null,arguments).exponent(.5)}const mf=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Uk,scaleDiverging:Z8,scaleDivergingLog:eO,scaleDivergingPow:tj,scaleDivergingSqrt:Are,scaleDivergingSymlog:tO,scaleIdentity:F8,scaleImplicit:zN,scaleLinear:I8,scaleLog:U8,scaleOrdinal:Dk,scalePoint:ZZ,scalePow:Vk,scaleQuantile:O8,scaleQuantize:P8,scaleRadial:R8,scaleSequential:W8,scaleSequentialLog:Y8,scaleSequentialPow:ej,scaleSequentialQuantile:J8,scaleSequentialSqrt:ure,scaleSequentialSymlog:X8,scaleSqrt:Gee,scaleSymlog:M8,scaleThreshold:L8,scaleTime:cre,scaleUtc:dre,tickFormat:T8},Symbol.toStringTag,{value:"Module"}));var Bo=e=>e.chartData,rO=De([Bo],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),aO=(e,t,r,a)=>a?rO(e):Bo(e),fre=(e,t,r)=>r?rO(e):Bo(e);function vo(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(Vt(t)&&Vt(r))return!0}return!1}function i5(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function nO(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(vo(l))return l}}function pre(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var a=e(t,r);if(vo(a))return i5(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"&&gI.test(s)){var d=gI.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"&&bI.test(i)){var f=bI.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 x=[l,o];if(vo(x))return t==null?x:i5(x,t,r)}}}var zA=1e9,hre={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},aj,qr=!0,Ni="[DecimalError] ",Sd=Ni+"Invalid argument: ",rj=Ni+"Exponent out of range: ",$A=Math.floor,xd=Math.pow,xre=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ms,Xa=1e7,Dr=7,sO=9007199254740991,yg=$A(sO/Dr),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)*Dr;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 lo(this,new this.constructor(e))};lt.dividedToIntegerBy=lt.idiv=function(e){var t=this,r=t.constructor;return wr(lo(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(Ni+"NaN");if(r.s<1)throw Error(Ni+(r.s?"NaN":"-Infinity"));return r.eq(Ms)?new a(0):(qr=!1,t=lo(cp(r,i),cp(e,i),i),qr=!0,wr(t,s))};lt.minus=lt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?oO(t,e):iO(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(Ni+"NaN");return r.s?(qr=!1,t=lo(r,e,0,1).times(e),qr=!0,r.minus(t)):wr(new a(r),s)};lt.naturalExponential=lt.exp=function(){return lO(this)};lt.naturalLogarithm=lt.ln=function(){return cp(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?iO(t,e):oO(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(Sd+e);if(t=Fa(s)+1,a=s.d.length-1,r=a*Dr+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(Ni+"NaN")}for(e=Fa(o),qr=!1,s=Math.sqrt(+o),s==0||s==1/0?(t=xl(o.d),(t.length+e)%2==0&&(t+="0"),s=Math.sqrt(t),e=$A((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(lo(o,i,l+2)).times(.5),xl(i.d).slice(0,l)===(t=xl(a.d)).slice(0,l)){if(t=t.slice(l-3,l+1),s==l&&t=="4999"){if(wr(i,r+1,0),i.times(i).eq(o)){a=i;break}}else if(t!="9999")break;l+=4}return qr=!0,wr(a,r)};lt.times=lt.mul=function(e){var t,r,a,s,i,l,o,d,u,f=this,p=f.constructor,x=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=x.length,u=m.length,d<u&&(i=x,x=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]*x[s-a-1]+t,i[s--]=o%Xa|0,t=o/Xa|0;i[s]=(i[s]+t)%Xa|0}for(;!i[--l];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,qr?wr(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:(jl(e,0,zA),t===void 0?t=a.rounding:jl(t,0,8),wr(r,e+Fa(r)+1,t))};lt.toExponential=function(e,t){var r,a=this,s=a.constructor;return e===void 0?r=zd(a,!0):(jl(e,0,zA),t===void 0?t=s.rounding:jl(t,0,8),a=wr(new s(a),e+1,t),r=zd(a,!0,e+1)),r};lt.toFixed=function(e,t){var r,a,s=this,i=s.constructor;return e===void 0?zd(s):(jl(e,0,zA),t===void 0?t=i.rounding:jl(t,0,8),a=wr(new i(s),e+Fa(s)+1,t),r=zd(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 wr(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(Ni+"Infinity");return o}if(o.eq(Ms))return o;if(a=d.precision,e.eq(Ms))return wr(o,a);if(t=e.e,r=e.d.length-1,l=t>=r,i=o.s,l){if((r=f<0?-f:f)<=sO){for(s=new d(Ms),t=Math.ceil(a/Dr+4),qr=!1;r%2&&(s=s.times(o),o5(s.d,t)),r=$A(r/2),r!==0;)o=o.times(o),o5(o.d,t);return qr=!0,e.s<0?new d(Ms).div(s):wr(s,a)}}else if(i<0)throw Error(Ni+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,o.s=1,qr=!1,s=e.times(cp(o,a+u)),qr=!0,s=lO(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=zd(s,r<=i.toExpNeg||r>=i.toExpPos)):(jl(e,1,zA),t===void 0?t=i.rounding:jl(t,0,8),s=wr(new i(s),e,t),r=Fa(s),a=zd(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):(jl(e,1,zA),t===void 0?t=a.rounding:jl(t,0,8)),wr(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 zd(e,t<=r.toExpNeg||t>=r.toExpPos)};function iO(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?wr(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/Dr),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)/Xa|0,d[i]%=Xa;for(r&&(d.unshift(r),++s),o=d.length;d[--o]==0;)d.pop();return t.d=d,t.e=s,qr?wr(t,p):t}function jl(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Sd+e)}function xl(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=Dr-a.length,r&&(i+=pc(r)),i+=a;l=e[t],a=l+"",r=Dr-a.length,r&&(i+=pc(r))}else if(l===0)return"0";for(;l%10===0;)l/=10;return i+l}var lo=(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%Xa|0,l=i/Xa|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*Xa+a[i]-s[i];for(;!a[0]&&a.length>1;)a.shift()}return function(a,s,i,l){var o,d,u,f,p,x,m,b,v,y,k,_,C,E,T,B,F,M,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(Ni+"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(_=_/Dr+2|0,u=0,F==1)for(f=0,P=P[0],_++;(u<T||f)&&_--;u++)C=f*Xa+(L[u]||0),b[u]=C/P|0,f=C%P|0;else{for(f=Xa/(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;M=P.slice(),M.unshift(0),B=P[0],P[1]>=Xa/2&&++B;do f=0,o=t(P,v,F,y),o<0?(k=v[0],F!=y&&(k=k*Xa+(v[1]||0)),f=k/B|0,f>1?(f>=Xa&&(f=Xa-1),p=e(P,f),x=p.length,y=v.length,o=t(p,v,x,y),o==1&&(f--,r(p,F<x?M:P,x))):(f==0&&(o=f=1),p=P.slice()),x=p.length,x<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?M: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,wr(m,l?i+Fa(m)+1:i)}})();function lO(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(rj+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(xd(2,u))/Math.LN10*2+5|0,o+=a,r=s=i=new f(Ms),f.precision=o;;){if(s=wr(s.times(e),o),r=r.times(++d),l=i.plus(lo(s,r,o)),xl(l.d).slice(0,o)===xl(i.d).slice(0,o)){for(;u--;)i=wr(i.times(i),o);return f.precision=p,t==null?(qr=!0,wr(i,p)):i}i=l}}function Fa(e){for(var t=e.e*Dr,r=e.d[0];r>=10;r/=10)t++;return t}function a2(e,t,r){if(t>e.LN10.sd())throw qr=!0,r&&(e.precision=r),Error(Ni+"LN10 precision limit exceeded");return wr(new e(e.LN10),t)}function pc(e){for(var t="";e--;)t+="0";return t}function cp(e,t){var r,a,s,i,l,o,d,u,f,p=1,x=10,m=e,b=m.d,v=m.constructor,y=v.precision;if(m.s<1)throw Error(Ni+(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),a2(v,u);if(u+=x,v.precision=u,r=xl(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=xl(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=a2(v,u+2,y).times(i+""),m=cp(new v(a+"."+r.slice(1)),u-x).plus(d),v.precision=y,t==null?(qr=!0,wr(m,y)):m;for(o=l=m=lo(m.minus(Ms),m.plus(Ms),u),f=wr(m.times(m),u),s=3;;){if(l=wr(l.times(f),u),d=o.plus(lo(l,new v(s),u)),xl(d.d).slice(0,u)===xl(o.d).slice(0,u))return o=o.times(2),i!==0&&(o=o.plus(a2(v,u+2,y).times(i+""))),o=lo(o,new v(p),u),v.precision=y,t==null?(qr=!0,wr(o,y)):o;o=d,s+=2}}function l5(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=$A(r/Dr),e.d=[],a=(r+1)%Dr,r<0&&(a+=Dr),a<s){for(a&&e.d.push(+t.slice(0,a)),s-=Dr;a<s;)e.d.push(+t.slice(a,a+=Dr));t=t.slice(a),a=Dr-t.length}else a-=s;for(;a--;)t+="0";if(e.d.push(+t),qr&&(e.e>yg||e.e<-yg))throw Error(rj+r)}else e.s=0,e.e=0,e.d=[0];return e}function wr(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+=Dr,s=t,u=p[f=0];else{if(f=Math.ceil((a+1)/Dr),i=p.length,f>=i)return e;for(u=i=p[f],l=1;i>=10;i/=10)l++;a%=Dr,s=a-Dr+l}if(r!==void 0&&(i=xd(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/xd(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]=xd(10,(Dr-t%Dr)%Dr),e.e=$A(-t/Dr)||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=xd(10,Dr-a),p[f]=s>0?(u/xd(10,l-s)%xd(10,s)|0)*i:0),d)for(;;)if(f==0){(p[0]+=i)==Xa&&(p[0]=1,++e.e);break}else{if(p[f]+=i,p[f]!=Xa)break;p[f--]=0,i=1}for(a=p.length;p[--a]===0;)p.pop();if(qr&&(e.e>yg||e.e<-yg))throw Error(rj+Fa(e));return e}function oO(e,t){var r,a,s,i,l,o,d,u,f,p,x=e.constructor,m=x.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new x(e),qr?wr(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/Dr),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]=Xa-1;--d[i],d[s]+=Xa}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?wr(t,m):t):new x(0)}function zd(e,t,r){var a,s=Fa(e),i=xl(e.d),l=i.length;return t?(r&&(a=r-l)>0?i=i.charAt(0)+"."+i.slice(1)+pc(a):l>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+pc(-s-1)+i,r&&(a=r-l)>0&&(i+=pc(a))):s>=l?(i+=pc(s+1-l),r&&(a=r-s-1)>0&&(i=i+"."+pc(a))):((a=s+1)<l&&(i=i.slice(0,a)+"."+i.slice(a)),r&&(a=r-l)>0&&(s+1===l&&(i+="."),i+=pc(a))),e.s<0?"-"+i:i}function o5(e,t){if(e.length>t)return e.length=t,!0}function cO(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(Sd+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 l5(l,i.toString())}else if(typeof i!="string")throw Error(Sd+i);if(i.charCodeAt(0)===45?(i=i.slice(1),l.s=-1):l.s=1,xre.test(i))l5(l,i);else throw Error(Sd+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=cO,s.config=s.set=mre,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 mre(e){if(!e||typeof e!="object")throw Error(Ni+"Object expected");var t,r,a,s=["precision",1,zA,"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($A(a)===a&&a>=s[t+1]&&a<=s[t+2])this[r]=a;else throw Error(Sd+r+": "+a);if((a=e[r="LN10"])!==void 0)if(a==Math.LN10)this[r]=new this(a);else throw Error(Sd+r+": "+a);return this}var aj=cO(hre);Ms=new aj(1);const dr=aj;function dO(e){var t;return e===0?t=1:t=Math.floor(new dr(e).abs().log(10).toNumber())+1,t}function uO(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 AO=e=>{var[t,r]=e,[a,s]=[t,r];return t>r&&([a,s]=[r,t]),[a,s]},fO=(e,t,r)=>{if(e.lte(0))return new dr(0);var a=dO(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()))},gre=(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(dO(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},pO=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=fO(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?pO(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))})},bre=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]=AO([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 gre(o,s,i);var{step:f,tickMin:p,tickMax:x}=pO(o,d,l,i,0),m=uO(p,x.add(new dr(.1).mul(f)),f);return r>a?m.reverse():m},vre=function(t,r){var[a,s]=t,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[l,o]=AO([a,s]);if(l===-1/0||o===1/0)return[a,s];if(l===o)return[l];var d=Math.max(r,2),u=fO(new dr(o).sub(l).div(d-1),i,0),f=[...uO(new dr(l),new dr(o),u),o];return i===!1&&(f=f.map(p=>Math.round(p))),a>s?f.reverse():f},yre=e=>e.rootProps.barCategoryGap,Hb=e=>e.rootProps.stackOffset,hO=e=>e.rootProps.reverseStackOrder,nj=e=>e.options.chartName,sj=e=>e.rootProps.syncId,xO=e=>e.rootProps.syncMethod,ij=e=>e.options.eventEmitter,wre=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},Ad={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"},zb=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function $b(e,t,r){if(r!=="auto")return r;if(e!=null)return Bl(e,t)?"category":"number"}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 wg(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){Nre(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 Nre(e,t,r){return(t=Cre(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cre(e){var t=kre(e,"string");return typeof t=="symbol"?t:t+""}function kre(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 d5={allowDataOverflow:Ad.allowDataOverflow,allowDecimals:Ad.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Ad.angleAxisId,includeHidden:!1,name:void 0,reversed:Ad.reversed,scale:Ad.scale,tick:Ad.tick,tickCount:void 0,ticks:void 0,type:Ad.type,unit:void 0},u5={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},jre=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},lj=De([jre,i8],(e,t)=>{var r;if(e!=null)return e;var a=(r=$b(t,"angleAxis",d5.type))!==null&&r!==void 0?r:"category";return wg(wg({},d5),{},{type:a})}),Ere=(e,t)=>e.polarAxis.radiusAxis[t],oj=De([Ere,i8],(e,t)=>{var r;if(e!=null)return e;var a=(r=$b(t,"radiusAxis",u5.type))!==null&&r!==void 0?r:"category";return wg(wg({},u5),{},{type:a})}),Vb=e=>e.polarOptions,cj=De([jo,Eo,Sn],NZ),mO=De([Vb,cj],(e,t)=>{if(e!=null)return Ic(e.innerRadius,t,0)}),gO=De([Vb,cj],(e,t)=>{if(e!=null)return Ic(e.outerRadius,t,t*.8)}),Sre=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},bO=De([Vb],Sre);De([lj,bO],zb);var vO=De([cj,mO,gO],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});De([oj,vO],zb);var yO=De([Yr,Vb,mO,gO,jo,Eo],(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:Ic(l,s,s/2),cy:Ic(o,i,i/2),innerRadius:r,outerRadius:a,startAngle:d,endAngle:u,clockWise:!1}}}),sn=(e,t)=>t,Gb=(e,t,r)=>r;function dj(e){return e==null?void 0:e.id}function wO(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=dj(o);u.forEach((p,x)=>{var m=i==null||s?x: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 uj(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Kb=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function qb(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Bre(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"},VA=e=>e.tooltip.settings.axisId;function _re(e){if(e in mf)return mf[e]();var t="scale".concat(xk(e));if(t in mf)return mf[t]()}function A5(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 f5(e,t,r){if(typeof e=="function")return A5(e.copy().domain(t).range(r));if(e!=null){var a=_re(e);if(a!=null)return a.domain(t).range(r),A5(a)}}var Tre=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!vo(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 p5(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?p5(Object(r),!0).forEach(function(a){Ire(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Ire(e,t,r){return(t=Fre(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fre(e){var t=Dre(e,"string");return typeof t=="symbol"?t:t+""}function Dre(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 KN=[0,"auto"],Wa={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},NO=(e,t)=>e.cartesianAxis.xAxis[t],_o=(e,t)=>{var r=NO(e,t);return r??Wa},Ya={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:KN,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},CO=(e,t)=>e.cartesianAxis.yAxis[t],To=(e,t)=>{var r=CO(e,t);return r??Ya},Ure={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:""},Aj=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??Ure},rs=(e,t,r)=>{switch(t){case"xAxis":return _o(e,r);case"yAxis":return To(e,r);case"zAxis":return Aj(e,r);case"angleAxis":return lj(e,r);case"radiusAxis":return oj(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},Mre=(e,t,r)=>{switch(t){case"xAxis":return _o(e,r);case"yAxis":return To(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},Gp=(e,t,r)=>{switch(t){case"xAxis":return _o(e,r);case"yAxis":return To(e,r);case"angleAxis":return lj(e,r);case"radiusAxis":return oj(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},kO=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function jO(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 EO=e=>e.graphicalItems.cartesianItems,Rre=De([sn,Gb],jO),SO=(e,t,r)=>e.filter(r).filter(a=>(t==null?void 0:t.includeHidden)===!0?!0:!a.hide),Kp=De([EO,rs,Rre],SO,{memoizeOptions:{resultEqualityCheck:qb}}),BO=De([Kp],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(uj)),_O=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Ore=De([Kp],_O),TO=e=>e.map(t=>t.data).filter(Boolean).flat(1),Pre=De([Kp],TO,{memoizeOptions:{resultEqualityCheck:qb}}),IO=(e,t)=>{var{chartData:r=[],dataStartIndex:a,dataEndIndex:s}=t;return e.length>0?e:r.slice(a,s+1)},fj=De([Pre,aO],IO),FO=(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})),Wb=De([fj,rs,Kp],FO);function DO(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Tm(e){if(Cl(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 vo(t)?t:void 0}var r=Tm(e);if(r!=null)return[r,r]}function yo(e){return e.map(Tm).filter(ps)}function Lre(e,t,r){return!r||typeof t!="number"||Nl(t)?[]:r.length?yo(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 Va=e=>{var t=ln(e),r=VA(e);return Gp(e,t,r)},qp=De([Va],e=>e==null?void 0:e.dataKey),Qre=De([BO,aO,Va],wO),UO=(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(dj);return[o,{stackedData:fX(e,f,r),graphicalItems:u}]}))},MO=De([Qre,BO,Hb,hO],UO),RO=(e,t,r,a)=>{var{dataStartIndex:s,dataEndIndex:i}=t;if(a==null&&r!=="zAxis"){var l=mX(e,s,i);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},Hre=De([rs],e=>e.allowDataOverflow),pj=e=>{var t;if(e==null||!("domain"in e))return KN;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=yo(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:KN},OO=De([rs],pj),PO=De([OO,Hre],nO),zre=De([MO,Bo,sn,PO],RO,{memoizeOptions:{resultEqualityCheck:Kb}}),hj=e=>e.errorBars,$re=(e,t,r)=>e.flatMap(a=>t[a.id]).filter(Boolean).filter(a=>DO(r,a)),Cg=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]}},LO=(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(k=>DO(s,k)),x=Cn(o,(f=t.dataKey)!==null&&f!==void 0?f:d.dataKey),m=Lre(o,x,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(x);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]},Vre=De([fj,rs,Ore,hj,sn],LO,{memoizeOptions:{resultEqualityCheck:Kb}});function Gre(e){var{value:t}=e;if(Cl(t)||t instanceof Date)return t}var Kre=(e,t,r)=>{var a=e.map(Gre).filter(s=>s!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&nR(a))?w8(0,e.length):t.allowDuplicatedCategory?a:Array.from(new Set(a))},QO=e=>e.referenceElements.dots,GA=(e,t,r)=>e.filter(a=>a.ifOverflow==="extendDomain").filter(a=>t==="xAxis"?a.xAxisId===r:a.yAxisId===r),qre=De([QO,sn,Gb],GA),HO=e=>e.referenceElements.areas,Wre=De([HO,sn,Gb],GA),zO=e=>e.referenceElements.lines,Yre=De([zO,sn,Gb],GA),$O=(e,t)=>{if(e!=null){var r=yo(e.map(a=>t==="xAxis"?a.x:a.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Xre=De(qre,sn,$O),VO=(e,t)=>{if(e!=null){var r=yo(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)]}},Jre=De([Wre,sn],VO);function Zre(e){var t;if(e.x!=null)return yo([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.x);return r==null||r.length===0?[]:yo(r)}function eae(e){var t;if(e.y!=null)return yo([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(a=>a.y);return r==null||r.length===0?[]:yo(r)}var GO=(e,t)=>{if(e!=null){var r=e.flatMap(a=>t==="xAxis"?Zre(a):eae(a));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},tae=De([Yre,sn],GO),rae=De(Xre,tae,Jre,(e,t,r)=>Cg(e,r,t)),KO=(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?Cg(a,i,s):Cg(i,s);return pre(t,u,e.allowDataOverflow)},aae=De([rs,OO,PO,zre,Vre,rae,Yr,sn],KO,{memoizeOptions:{resultEqualityCheck:Kb}}),nae=[0,1],qO=(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=Bl(t,i);if(u&&o==null){var f;return w8(0,(f=r==null?void 0:r.length)!==null&&f!==void 0?f:0)}return d==="category"?Kre(a,e,u):s==="expand"?nae:l}},xj=De([rs,Yr,fj,Wb,Hb,sn,aae],qO);function sae(e){return e in mf}var WO=(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(xk(a));return sae(i)?i:"point"}}},KA=De([rs,kO,nj],WO);function mj(e,t,r,a){if(!(r==null||a==null))return typeof e.scale=="function"?f5(e.scale,r,a):f5(t,r,a)}var YO=(e,t,r)=>{var a=pj(t);if(!(r!=="auto"&&r!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(a)&&(a[0]==="auto"||a[1]==="auto")&&vo(e))return bre(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&vo(e))return vre(e,t.tickCount,t.allowDecimals)}},gj=De([xj,Gp,KA],YO),XO=(e,t,r,a)=>{if(a!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&vo(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},iae=De([rs,xj,gj,sn],XO),lae=De(Wb,rs,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,a=Array.from(yo(e.map(p=>p.value))).sort((p,x)=>p-x),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}}),JO=De(lae,Yr,yre,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=Ic(r,e*i),o=e*i/2;return o-l-(o-l)/i*l}return 0}),oae=(e,t,r)=>{var a=_o(e,t);return a==null||typeof a.padding!="string"?0:JO(e,"xAxis",t,r,a.padding)},cae=(e,t,r)=>{var a=To(e,t);return a==null||typeof a.padding!="string"?0:JO(e,"yAxis",t,r,a.padding)},dae=De(_o,oae,(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}}),uae=De(To,cae,(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}}),Aae=De([Sn,dae,Tb,_b,(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]}),fae=De([Sn,Yr,uae,Tb,_b,(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 Aae(e,r,a);case"yAxis":return fae(e,r,a);case"zAxis":return(s=Aj(e,r))===null||s===void 0?void 0:s.range;case"angleAxis":return bO(e);case"radiusAxis":return vO(e,r);default:return}},ZO=De([rs,Wp],zb),pae=De([KA,iae],Tre),Yb=De([rs,KA,pae,ZO],mj);De([Kp,hj,sn],$re);function eP(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Xb=(e,t)=>t,Jb=(e,t,r)=>r,hae=De(Sb,Xb,Jb,(e,t,r)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===r).sort(eP)),xae=De(Bb,Xb,Jb,(e,t,r)=>e.filter(a=>a.orientation===t).filter(a=>a.mirror===r).sort(eP)),tP=(e,t)=>({width:e.width,height:t.height}),mae=(e,t)=>{var r=typeof t.width=="number"?t.width:Op;return{width:r,height:e.height}},gae=De(Sn,_o,tP),bae=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},vae=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},yae=De(Eo,Sn,hae,Xb,Jb,(e,t,r,a,s)=>{var i={},l;return r.forEach(o=>{var d=tP(t,o);l==null&&(l=bae(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}),wae=De(jo,Sn,xae,Xb,Jb,(e,t,r,a,s)=>{var i={},l;return r.forEach(o=>{var d=mae(t,o);l==null&&(l=vae(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}),Nae=(e,t)=>{var r=_o(e,t);if(r!=null)return yae(e,r.orientation,r.mirror)},Cae=De([Sn,_o,Nae,(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}}}),kae=(e,t)=>{var r=To(e,t);if(r!=null)return wae(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:0,y:e.top}:{x:s,y:e.top}}}),Eae=De(Sn,To,(e,t)=>{var r=typeof t.width=="number"?t.width:Op;return{width:r,height:e.height}}),rP=(e,t,r,a)=>{if(r!=null){var{allowDuplicatedCategory:s,type:i,dataKey:l}=r,o=Bl(e,a),d=t.map(u=>u.value);if(l&&o&&i==="category"&&s&&nR(d))return d}},bj=De([Yr,Wb,rs,sn],rP),aP=(e,t,r,a)=>{if(!(r==null||r.dataKey==null)){var{type:s,scale:i}=r,l=Bl(e,a);if(l&&(s==="number"||i!=="auto"))return t.map(o=>o.value)}},vj=De([Yr,Wb,Gp,sn],aP),x5=De([Yr,Mre,KA,Yb,bj,vj,Wp,gj,sn],(e,t,r,a,s,i,l,o,d)=>{if(t!=null){var u=Bl(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}}}),Sae=(e,t,r,a,s,i,l,o,d)=>{if(!(t==null||a==null)){var u=Bl(e,d),{type:f,ticks:p,tickCount:x}=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?fi(i[0]-i[1])*2*b:b;var v=p||s;return v?v.map((y,k)=>{var _=l?l.indexOf(y):y,C=a.map(_);return Vt(C)?{index:k,coordinate:C+b,value:y,offset:b}:null}).filter(ps):u&&o?o.map((y,k)=>{var _=a.map(y);return Vt(_)?{coordinate:_+b,value:y,index:k,offset:b}:null}).filter(ps):a.ticks?a.ticks(x).map((y,k)=>{var _=a.map(y);return Vt(_)?{coordinate:_+b,value:y,index:k,offset:b}:null}).filter(ps):a.domain().map((y,k)=>{var _=a.map(y);return Vt(_)?{coordinate:_+b,value:l?l[y]:y,index:k,offset:b}:null}).filter(ps)}},nP=De([Yr,Gp,KA,Yb,gj,Wp,bj,vj,sn],Sae),Bae=(e,t,r,a,s,i,l)=>{if(!(t==null||r==null||a==null||a[0]===a[1])){var o=Bl(e,l),{tickCount:d}=t,u=0;return u=l==="angleAxis"&&(a==null?void 0:a.length)>=2?fi(a[0]-a[1])*2*u:u,o&&i?i.map((f,p)=>{var x=r.map(f);return Vt(x)?{coordinate:x+u,value:f,index:p,offset:u}:null}).filter(ps):r.ticks?r.ticks(d).map((f,p)=>{var x=r.map(f);return Vt(x)?{coordinate:x+u,value:f,index:p,offset:u}:null}).filter(ps):r.domain().map((f,p)=>{var x=r.map(f);return Vt(x)?{coordinate:x+u,value:s?s[f]:f,index:p,offset:u}:null}).filter(ps)}},sP=De([Yr,Gp,Yb,Wp,bj,vj,sn],Bae),iP=De(rs,Yb,(e,t)=>{if(!(e==null||t==null))return Ng(Ng({},e),{},{scale:t})}),_ae=De([rs,KA,xj,ZO],mj);De((e,t,r)=>Aj(e,r),_ae,(e,t)=>{if(!(e==null||t==null))return Ng(Ng({},e),{},{scale:t})});var Tae=De([Yr,Sb,Bb],(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}}),lP=e=>e.options.defaultTooltipEventType,oP=e=>e.options.validateTooltipEventTypes;function cP(e,t,r){if(e==null)return t;var a=e?"axis":"item";return r==null?t:r.includes(a)?a:t}function yj(e,t){var r=lP(e),a=oP(e);return cP(t,r,a)}function Iae(e){return gt(t=>yj(t,e))}var dP=(e,t)=>{var r,a=Number(t);if(!(Nl(a)||t==null))return a>=0?e==null||(r=e[a])===null||r===void 0?void 0:r.value:void 0},Fae=e=>e.tooltip.settings,mc={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},Dae={itemInteraction:{click:mc,hover:mc},axisInteraction:{click:mc,hover:mc},keyboardInteraction:mc,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}},uP=ws({name:"tooltip",initialState:Dae,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:Uae,replaceTooltipEntrySettings:Mae,removeTooltipEntrySettings:Rae,setTooltipSettingsState:Oae,setActiveMouseOverItemIndex:Pae,mouseLeaveItem:vFe,mouseLeaveChart:AP,setActiveClickItemIndex:yFe,setMouseOverAxisIndex:fP,setMouseClickAxisIndex:Lae,setSyncInteraction:qN,setKeyboardInteraction:WN}=uP.actions,Qae=uP.reducer;function m5(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 Fx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?m5(Object(r),!0).forEach(function(a){Hae(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Hae(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=$ae(e,"string");return typeof t=="symbol"?t:t+""}function $ae(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 Vae(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Gae(e){return e.index!=null}var pP=(e,t,r,a)=>{if(t==null)return mc;var s=Vae(e,t,r);if(s==null)return mc;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(Gae(s)){if(i)return Fx(Fx({},s),{},{active:!0})}else if(a!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:a,graphicalItemId:void 0};return Fx(Fx({},mc),{},{coordinate:s.coordinate})};function Kae(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 qae(e,t){var r=Kae(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 Wae(e,t,r){if(r==null||t==null)return!0;var a=Cn(e,t);return a==null||!vo(r)?!0:qae(a,r)}var wj=(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||Wae(u,r,a)?String(d):null},hP=(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}}}},xP=(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})},mP=e=>e.options.tooltipPayloadSearcher,qA=e=>e.tooltip;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 b5(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){Yae(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 Yae(e,t,r){return(t=Xae(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xae(e){var t=Jae(e,"string");return typeof t=="symbol"?t:t+""}function Jae(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 Zae(e,t){return e??t}var gP=(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((x,m)=>{var b,{dataDefinedOnItem:v,settings:y}=m,k=Zae(v,o),_=Array.isArray(k)?qR(k,u,f):k,C=(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=sR(_,a,s):T=i(_,t,d,E),Array.isArray(T))T.forEach(F=>{var M=b5(b5({},y),{},{name:F.name,unit:F.unit,color:void 0,fill:void 0});x.push(vI({tooltipEntrySettings:M,dataKey:F.dataKey,payload:F.payload,value:Cn(F.payload,F.dataKey),name:F.name}))});else{var B;x.push(vI({tooltipEntrySettings:y,dataKey:C,payload:T,value:Cn(T,C),name:(B=Cn(T,E))!==null&&B!==void 0?B:y==null?void 0:y.name}))}return x},p)}},Nj=De([Va,kO,nj],WO),ene=De([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),tne=De([ln,VA],jO),WA=De([ene,Va,tne],SO,{memoizeOptions:{resultEqualityCheck:qb}}),rne=De([WA],e=>e.filter(uj)),ane=De([WA],TO,{memoizeOptions:{resultEqualityCheck:qb}}),YA=De([ane,Bo],IO),nne=De([rne,Bo,Va],wO),Cj=De([YA,Va,WA],FO),bP=De([Va],pj),sne=De([Va],e=>e.allowDataOverflow),vP=De([bP,sne],nO),ine=De([WA],e=>e.filter(uj)),lne=De([nne,ine,Hb,hO],UO),one=De([lne,Bo,ln,vP],RO),cne=De([WA],_O),dne=De([YA,Va,cne,hj,ln],LO,{memoizeOptions:{resultEqualityCheck:Kb}}),une=De([QO,ln,VA],GA),Ane=De([une,ln],$O),fne=De([HO,ln,VA],GA),pne=De([fne,ln],VO),hne=De([zO,ln,VA],GA),xne=De([hne,ln],GO),mne=De([Ane,xne,pne],Cg),gne=De([Va,bP,vP,one,dne,mne,Yr,ln],KO),Yp=De([Va,Yr,YA,Cj,Hb,ln,gne],qO),bne=De([Yp,Va,Nj],YO),vne=De([Va,Yp,bne,ln],XO),yP=e=>{var t=ln(e),r=VA(e),a=!1;return Wp(e,t,r,a)},wP=De([Va,yP],zb),NP=De([Va,Nj,vne,wP],mj),yne=De([Yr,Cj,Va,ln],rP),wne=De([Yr,Cj,Va,ln],aP),Nne=(e,t,r,a,s,i,l,o)=>{if(t){var{type:d}=t,u=Bl(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?fi(s[0]-s[1])*2*p:p,u&&l?l.map((x,m)=>{var b=a.map(x);return Vt(b)?{coordinate:b+p,value:x,index:m,offset:p}:null}).filter(ps):a.domain().map((x,m)=>{var b=a.map(x);return Vt(b)?{coordinate:b+p,value:i?i[x]:x,index:m,offset:p}:null}).filter(ps)}}},Io=De([Yr,Va,Nj,NP,yP,yne,wne,ln],Nne),kj=De([lP,oP,Fae],(e,t,r)=>cP(r.shared,e,t)),CP=e=>e.tooltip.settings.trigger,jj=e=>e.tooltip.settings.defaultIndex,Xp=De([qA,kj,CP,jj],pP),dp=De([Xp,YA,qp,Yp],wj),kP=De([Io,dp],dP),Cne=De([Xp],e=>{if(e)return e.dataKey});De([Xp],e=>{if(e)return e.graphicalItemId});var jP=De([qA,kj,CP,jj],xP),kne=De([jo,Eo,Yr,Sn,Io,jj,jP],hP),jne=De([Xp,kne],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),Ene=De([Xp],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),Sne=De([jP,dp,Bo,qp,kP,mP,kj],gP),Bne=De([Sne],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function v5(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 y5(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?v5(Object(r),!0).forEach(function(a){_ne(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function _ne(e,t,r){return(t=Tne(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tne(e){var t=Ine(e,"string");return typeof t=="symbol"?t:t+""}function Ine(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 Fne=()=>gt(Va),Dne=()=>{var e=Fne(),t=gt(Io),r=gt(NP);return tg(!e||!r?void 0:y5(y5({},e),{},{scale:r}),t)};function w5(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 Vu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?w5(Object(r),!0).forEach(function(a){Une(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Une(e,t,r){return(t=Mne(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mne(e){var t=Rne(e,"string");return typeof t=="symbol"?t:t+""}function Rne(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 One=(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}},Pne=(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 Vu(Vu(Vu({},a),wn(a.cx,a.cy,l,i)),{},{angle:i,radius:l})}var o=s.coordinate,{angle:d}=a;return Vu(Vu(Vu({},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 Lne(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 EP=(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,x,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:(x=r[o+1])===null||x===void 0?void 0:x.coordinate,y=void 0;if(!(m==null||b==null||v==null))if(fi(b-m)!==fi(v-b)){var k=[];if(fi(v-b)===fi(s[1]-s[0])){y=v;var _=b+s[1]-s[0];k[0]=Math.min(_,(_+m)/2),k[1]=Math.max(_,(_+m)/2)}else{y=m;var C=v+s[1]-s[0];k[0]=Math.min(b,(C+b)/2),k[1]=Math.max(b,(C+b)/2)}var E=[Math.min(b,(y+b)/2),Math.max(b,(y+b)/2)];if(e>E[0]&&e<=E[1]||e>=k[0]&&e<=k[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 M;return(M=r[o])===null||M===void 0?void 0:M.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},SP=()=>gt(nj),Ej=(e,t)=>t,BP=(e,t,r)=>r,Sj=(e,t,r,a)=>a,Qne=De(Io,e=>gb(e,t=>t.coordinate)),Bj=De([qA,Ej,BP,Sj],pP),_j=De([Bj,YA,qp,Yp],wj),Hne=(e,t,r)=>{if(t!=null){var a=qA(e);return t==="axis"?r==="hover"?a.axisInteraction.hover.dataKey:a.axisInteraction.click.dataKey:r==="hover"?a.itemInteraction.hover.dataKey:a.itemInteraction.click.dataKey}},_P=De([qA,Ej,BP,Sj],xP),kg=De([jo,Eo,Yr,Sn,Io,Sj,_P],hP),zne=De([Bj,kg],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),TP=De([Io,_j],dP),$ne=De([_P,_j,Bo,qp,TP,mP,Ej],gP),Vne=De([Bj,_j],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Gne=(e,t,r,a,s,i,l)=>{if(!(!e||!r||!a||!s)&&Lne(e,l)){var o=gX(e,t),d=EP(o,i,s,r,a),u=One(t,s,d,e);return{activeIndex:String(d),activeCoordinate:u}}},Kne=(e,t,r,a,s,i,l)=>{if(!(!e||!a||!s||!i||!r)){var o=SZ(e,r);if(o){var d=bX(o,t),u=EP(d,l,i,a,s),f=Pne(t,i,u,o);return{activeIndex:String(u),activeCoordinate:f}}}},qne=(e,t,r,a,s,i,l,o)=>{if(!(!e||!t||!a||!s||!i))return t==="horizontal"||t==="vertical"?Gne(e,t,a,s,i,l,o):Kne(e,t,r,a,s,i,l)},Wne=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}}),Yne=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:Bre}});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 C5(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){Xne(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 Xne(e,t,r){return(t=Jne(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jne(e){var t=Zne(e,"string");return typeof t=="symbol"?t:t+""}function Zne(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 ese={},tse={zIndexMap:Object.values(Xn).reduce((e,t)=>C5(C5({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),ese)},rse=new Set(Object.values(Xn));function ase(e){return rse.has(e)}var IP=ws({name:"zIndex",initialState:tse,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&&!ase(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:nse,unregisterZIndexPortal:sse,registerZIndexPortalElement:ise,unregisterZIndexPortalElement:lse}=IP.actions,ose=IP.reducer;function Fo(e){var{zIndex:t,children:r}=e,a=XX(),s=a&&t!==void 0&&t!==0,i=Ns(),l=an();j.useLayoutEffect(()=>s?(l(nse({zIndex:t})),()=>{l(sse({zIndex:t}))}):LA,[l,t,s]);var o=gt(d=>Wne(d,t,i));return s?o?HM.createPortal(r,o):null:r}function YN(){return YN=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},YN.apply(null,arguments)}function k5(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 Dx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?k5(Object(r),!0).forEach(function(a){cse(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function cse(e,t,r){return(t=dse(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dse(e){var t=use(e,"string");return typeof t=="symbol"?t:t+""}function use(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 Ase(e){var{cursor:t,cursorComp:r,cursorProps:a}=e;return j.isValidElement(t)?j.cloneElement(t,a):j.createElement(r,a)}function fse(e){var t,{coordinate:r,payload:a,index:s,offset:i,tooltipAxisBandSize:l,layout:o,cursor:d,tooltipEventType:u,chartName:f}=e,p=r,x=a,m=s;if(!d||!p||f!=="ScatterChart"&&u!=="axis")return null;var b,v,y;if(f==="ScatterChart")b=p,v=PJ,y=Xn.cursorLine;else if(f==="BarChart")b=LJ(o,p,i,l),v=gZ,y=Xn.cursorRectangle;else if(o==="radial"&&iR(p)){var{cx:k,cy:_,radius:C,startAngle:E,endAngle:T}=v8(p);b={cx:k,cy:_,startAngle:E,endAngle:T,innerRadius:C,outerRadius:C},v=IZ,y=Xn.cursorLine}else b={points:FZ(o,p,i)},v=_m,y=Xn.cursorLine;var B=typeof d=="object"&&"className"in d?d.className:void 0,F=Dx(Dx(Dx(Dx({stroke:"#ccc",pointerEvents:"none"},i),b),pb(d)),{},{payload:x,payloadIndex:m,className:Lr("recharts-tooltip-cursor",B)});return j.createElement(Fo,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:y},j.createElement(Ase,{cursor:d,cursorComp:v,cursorProps:F}))}function pse(e){var t=Dne(),r=a8(),a=QA(),s=SP();return t==null||r==null||a==null||s==null?null:j.createElement(fse,YN({},e,{offset:r,layout:a,tooltipAxisBandSize:t,chartName:s}))}var FP=j.createContext(null),hse=()=>j.useContext(FP),n2={exports:{}},j5;function xse(){return j5||(j5=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,x){if(typeof f!="function")throw new TypeError("The listener must be a function");var m=new s(f,p||d,x),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 x=0,m=p.length,b=new Array(m);x<m;x++)b[x]=p[x].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,x,m,b){var v=r?r+u:u;if(!this._events[v])return!1;var y=this._events[v],k=arguments.length,_,C;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),k){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,x),!0;case 5:return y.fn.call(y.context,f,p,x,m),!0;case 6:return y.fn.call(y.context,f,p,x,m,b),!0}for(C=1,_=new Array(k-1);C<k;C++)_[C-1]=arguments[C];y.fn.apply(y.context,_)}else{var E=y.length,T;for(C=0;C<E;C++)switch(y[C].once&&this.removeListener(u,y[C].fn,void 0,!0),k){case 1:y[C].fn.call(y[C].context);break;case 2:y[C].fn.call(y[C].context,f);break;case 3:y[C].fn.call(y[C].context,f,p);break;case 4:y[C].fn.call(y[C].context,f,p,x);break;default:if(!_)for(T=1,_=new Array(k-1);T<k;T++)_[T-1]=arguments[T];y[C].fn.apply(y[C].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,x){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&&(!x||b.once)&&(!p||b.context===p)&&l(this,m);else{for(var v=0,y=[],k=b.length;v<k;v++)(b[v].fn!==f||x&&!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})(n2)),n2.exports}var mse=xse();const gse=El(mse);var up=new gse,XN="recharts.syncEvent.tooltip",E5="recharts.syncEvent.brush",bse=(e,t)=>{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Nl(r))return e[r]}},vse={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},DP=ws({name:"options",initialState:vse,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),yse=DP.reducer,{createEventEmitter:wse}=DP.actions;function Nse(e){return e.tooltip.syncInteraction}var Cse={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},UP=ws({name:"chartData",initialState:Cse,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:S5,setDataStartEndIndexes:kse,setComputedData:wFe}=UP.actions,jse=UP.reducer,Ese=["x","y"];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 Gu(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){Sse(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 Sse(e,t,r){return(t=Bse(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bse(e){var t=_se(e,"string");return typeof t=="symbol"?t:t+""}function _se(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 Tse(e,t){if(e==null)return{};var r,a,s=Ise(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 Ise(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 Fse(){var e=gt(sj),t=gt(ij),r=an(),a=gt(xO),s=gt(Io),i=QA(),l=Ib(),o=gt(d=>d.rootProps.className);j.useEffect(()=>{if(e==null)return LA;var d=(u,f,p)=>{if(t!==p&&e===u){if(a==="index"){var x;if(l&&f!==null&&f!==void 0&&(x=f.payload)!==null&&x!==void 0&&x.coordinate&&f.payload.sourceViewBox){var m=f.payload.coordinate,{x:b,y:v}=m,y=Tse(m,Ese),{x:k,y:_,width:C,height:E}=f.payload.sourceViewBox,T=Gu(Gu({},y),{},{x:l.x+(C?(b-k)/C:0)*l.width,y:l.y+(E?(v-_)/E:0)*l.height});r(Gu(Gu({},f),{},{payload:Gu(Gu({},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},M=a(s,F);B=s[M]}else a==="value"&&(B=s.find(Y=>String(Y.value)===f.payload.label));var{coordinate:U}=f.payload;if(B==null||f.payload.active===!1||U==null||l==null){r(qN({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),H={x:i==="horizontal"?B.coordinate:P,y:i==="horizontal"?G:B.coordinate},Q=qN({active:f.payload.active,coordinate:H,dataKey:f.payload.dataKey,index:String(B.index),label:f.payload.label,sourceViewBox:f.payload.sourceViewBox,graphicalItemId:f.payload.graphicalItemId});r(Q)}}};return up.on(XN,d),()=>{up.off(XN,d)}},[o,r,t,e,a,s,i,l])}function Dse(){var e=gt(sj),t=gt(ij),r=an();j.useEffect(()=>{if(e==null)return LA;var a=(s,i,l)=>{t!==l&&e===s&&r(kse(i))};return up.on(E5,a),()=>{up.off(E5,a)}},[r,t,e])}function Use(){var e=an();j.useEffect(()=>{e(wse())},[e]),Fse(),Dse()}function Mse(e,t,r,a,s,i){var l=gt(m=>Hne(m,e,t)),o=gt(ij),d=gt(sj),u=gt(xO),f=gt(Nse),p=f==null?void 0:f.active,x=Ib();j.useEffect(()=>{if(!p&&d!=null&&o!=null){var m=qN({active:i,coordinate:r,dataKey:l,index:s,label:typeof a=="number"?String(a):a,sourceViewBox:x,graphicalItemId:void 0});up.emit(XN,d,m,o)}},[p,r,l,s,a,o,d,u,i,x])}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 T5(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){Rse(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 Rse(e,t,r){return(t=Ose(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ose(e){var t=Pse(e,"string");return typeof t=="symbol"?t:t+""}function Pse(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 Lse(e){return e.dataKey}function Qse(e,t){return j.isValidElement(e)?j.cloneElement(e,t):typeof e=="function"?j.createElement(e,t):j.createElement(gJ,t)}var I5=[],Hse={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 Tj(e){var t,r,a=Vs(e,Hse),{active:s,allowEscapeViewBox:i,animationDuration:l,animationEasing:o,content:d,filterNull:u,isAnimationActive:f,offset:p,payloadUniqBy:x,position:m,reverseDirection:b,useTranslate3d:v,wrapperStyle:y,cursor:k,shared:_,trigger:C,defaultIndex:E,portal:T,axisId:B}=a,F=an(),M=typeof E=="number"?String(E):E;j.useEffect(()=>{F(Oae({shared:_,trigger:C,axisId:B,active:s,defaultIndex:M}))},[F,_,C,B,s,M]);var U=Ib(),D=p8(),L=Iae(_),{activeIndex:P,isActive:G}=(t=gt(le=>Vne(le,L,C,M)))!==null&&t!==void 0?t:{},H=gt(le=>$ne(le,L,C,M)),Q=gt(le=>TP(le,L,C,M)),Y=gt(le=>zne(le,L,C,M)),K=H,ee=hse(),J=(r=s??G)!==null&&r!==void 0?r:!1,[W,R]=sY([K,J]),O=L==="axis"?Q:void 0;Mse(L,C,Y,O,P,J);var q=T??ee;if(q==null||U==null||L==null)return null;var z=K??I5;J||(z=I5),u&&z.length&&(z=TW(z.filter(le=>le.value!=null&&(le.hide!==!0||a.includeHidden)),x,Lse));var X=z.length>0,re=j.createElement(kJ,{allowEscapeViewBox:i,animationDuration:l,animationEasing:o,isAnimationActive:f,active:J,coordinate:Y,hasPayload:X,offset:p,position:m,reverseDirection:b,useTranslate3d:v,viewBox:U,wrapperStyle:y,lastBoundingBox:W,innerRef:R,hasPortalFromProps:!!T},Qse(d,T5(T5({},a),{},{payload:z,label:O,active:J,activeIndex:P,coordinate:Y,accessibilityLayer:D})));return j.createElement(j.Fragment,null,HM.createPortal(re,q),J&&j.createElement(pse,{cursor:k,tooltipEventType:L,coordinate:Y,payload:z,index:P}))}function zse(e,t,r){return(t=$se(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $se(e){var t=Vse(e,"string");return typeof t=="symbol"?t:t+""}function Vse(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 Gse{constructor(t){zse(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 F5(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 Kse(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?F5(Object(r),!0).forEach(function(a){qse(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function qse(e,t,r){return(t=Wse(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wse(e){var t=Yse(e,"string");return typeof t=="symbol"?t:t+""}function Yse(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 Xse={cacheSize:2e3,enableCache:!0},MP=Kse({},Xse),D5=new Gse(MP.cacheSize),Jse={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},U5="recharts_measurement_span";function Zse(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 M5=(e,t)=>{try{var r=document.getElementById(U5);r||(r=document.createElement("span"),r.setAttribute("id",U5),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,Jse,t),r.textContent="".concat(e);var a=r.getBoundingClientRect();return{width:a.width,height:a.height}}catch{return{width:0,height:0}}},Tf=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Qp.isSsr)return{width:0,height:0};if(!MP.enableCache)return M5(t,r);var a=Zse(t,r),s=D5.get(a);if(s)return s;var i=M5(t,r);return D5.set(a,i),i},RP;function eie(e,t,r){return(t=tie(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tie(e){var t=rie(e,"string");return typeof t=="symbol"?t:t+""}function rie(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 R5=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,O5=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,aie=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,nie=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,sie={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},iie=["cm","mm","pt","pc","in","Q","px"];function lie(e){return iie.includes(e)}var dA="NaN";function oie(e,t){return e*sie[t]}class gn{static parse(t){var r,[,a,s]=(r=nie.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,Nl(t)&&(this.unit=""),r!==""&&!aie.test(r)&&(this.num=NaN,this.unit=""),lie(r)&&(this.num=oie(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 Nl(this.num)}}RP=gn;eie(gn,"NaN",new RP(NaN,""));function OP(e){if(e==null||e.includes(dA))return dA;for(var t=e;t.includes("*")||t.includes("/");){var r,[,a,s,i]=(r=R5.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 dA;t=t.replace(R5,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,f,p,x]=(u=O5.exec(t))!==null&&u!==void 0?u:[],m=gn.parse(f??""),b=gn.parse(x??""),v=p==="+"?m.add(b):m.subtract(b);if(v.isNaN())return dA;t=t.replace(O5,v.toString())}return t}var P5=/\(([^()]*)\)/;function cie(e){for(var t=e,r;(r=P5.exec(t))!=null;){var[,a]=r;t=t.replace(P5,OP(a))}return t}function die(e){var t=e.replace(/\s+/g,"");return t=cie(t),t=OP(t),t}function uie(e){try{return die(e)}catch{return dA}}function s2(e){var t=uie(e.slice(5,-1));return t===dA?"":t}var Aie=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],fie=["dx","dy","angle","className","breakAll"];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 L5(e,t){if(e==null)return{};var r,a,s=pie(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 pie(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 PP=/[ \f\n\r\t\v\u2028\u2029]+/,LP=e=>{var{children:t,breakAll:r,style:a}=e;try{var s=[];Qn(t)||(r?s=t.toString().split(""):s=t.toString().split(PP));var i=s.map(o=>({word:o,width:Tf(o,a).width})),l=r?0:Tf(" ",a).width;return{wordsWithComputedWidth:i,spaceWidth:l}}catch{return null}};function hie(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var QP=(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},[]),HP=e=>e.reduce((t,r)=>t.width>r.width?t:r),xie="…",Q5=(e,t,r,a,s,i,l,o)=>{var d=e.slice(0,t),u=LP({breakAll:r,style:a,children:d+xie});if(!u)return[!1,[]];var f=QP(u.wordsWithComputedWidth,i,l,o),p=f.length>s||HP(f).width>Number(i);return[p,f]},mie=(e,t,r,a,s)=>{var{maxLines:i,children:l,style:o,breakAll:d}=e,u=At(i),f=String(l),p=QP(t,a,r,s);if(!u||s)return p;var x=p.length>i||HP(p).width>Number(a);if(!x)return p;for(var m=0,b=f.length-1,v=0,y;m<=b&&v<=f.length-1;){var k=Math.floor((m+b)/2),_=k-1,[C,E]=Q5(f,_,d,o,i,a,r,s),[T]=Q5(f,k,d,o,i,a,r,s);if(!C&&!T&&(m=k+1),C&&T&&(b=k-1),!C&&T){y=E;break}v++}return y||p},H5=e=>{var t=Qn(e)?[]:e.toString().split(PP);return[{words:t,width:void 0}]},gie=e=>{var{width:t,scaleToFit:r,children:a,style:s,breakAll:i,maxLines:l}=e;if((t||r)&&!Qp.isSsr){var o,d,u=LP({breakAll:i,children:a,style:s});if(u){var{wordsWithComputedWidth:f,spaceWidth:p}=u;o=f,d=p}else return H5(a);return mie({breakAll:i,children:a,maxLines:l,style:s},o,d,t,!!r)}return H5(a)},zP="#808080",bie={angle:0,breakAll:!1,capHeight:"0.71em",fill:zP,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Ij=j.forwardRef((e,t)=>{var r=Vs(e,bie),{x:a,y:s,lineHeight:i,capHeight:l,fill:o,scaleToFit:d,textAnchor:u,verticalAnchor:f}=r,p=L5(r,Aie),x=j.useMemo(()=>gie({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:k}=p,_=L5(p,fie);if(!Cl(a)||!Cl(s)||x.length===0)return null;var C=Number(a)+(At(m)?m:0),E=Number(s)+(At(b)?b:0);if(!Vt(C)||!Vt(E))return null;var T;switch(f){case"start":T=s2("calc(".concat(l,")"));break;case"middle":T=s2("calc(".concat((x.length-1)/2," * -").concat(i," + (").concat(l," / 2))"));break;default:T=s2("calc(".concat(x.length-1," * -").concat(i,")"));break}var B=[],F=x[0];if(d&&F!=null){var M=F.width,{width:U}=p;B.push("scale(".concat(At(U)&&At(M)?U/M:1,")"))}return v&&B.push("rotate(".concat(v,", ").concat(C,", ").concat(E,")")),B.length&&(_.transform=B.join(" ")),j.createElement("text",JN({},yi(_),{ref:t,x:C,y:E,className:Lr("recharts-text",y),textAnchor:u,fill:o.includes("url")?zP:o}),x.map((D,L)=>{var P=D.words.join(k?"":" ");return j.createElement("tspan",{x:C,dy:L===0?T:i,key:"".concat(P,"-").concat(L)},P)}))});Ij.displayName="Text";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 ol(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){vie(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 vie(e,t,r){return(t=yie(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yie(e){var t=wie(e,"string");return typeof t=="symbol"?t:t+""}function wie(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 Nie=e=>{var{viewBox:t,position:r,offset:a=0,parentViewBox:s}=e,{x:i,y:l,height:o,upperWidth:d,lowerWidth:u}=Bk(t),f=i,p=i+(d-u)/2,x=(f+p)/2,m=(d+u)/2,b=f+d/2,v=o>=0?1:-1,y=v*a,k=v>0?"end":"start",_=v>0?"start":"end",C=d>=0?1:-1,E=C*a,T=C>0?"end":"start",B=C>0?"start":"end",F=s;if(r==="top"){var M={x:f+d/2,y:l-y,horizontalAnchor:"middle",verticalAnchor:k};return F&&(M.height=Math.max(l-F.y,0),M.width=d),M}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:x-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:x+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:x+E,y:l+o/2,horizontalAnchor:B,verticalAnchor:"middle"},P):r==="insideRight"?ol({x:x+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:k},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:k},P):r==="insideBottomRight"?ol({x:p+u-E,y:l+o-y,horizontalAnchor:T,verticalAnchor:k},P):r&&typeof r=="object"&&(At(r.x)||Pd(r.x))&&(At(r.y)||Pd(r.y))?ol({x:i+Ic(r.x,m),y:l+Ic(r.y,o),horizontalAnchor:"end",verticalAnchor:"end"},P):ol({x:b,y:l+o/2,horizontalAnchor:"middle",verticalAnchor:"middle"},P)},Cie=["labelRef"],kie=["content"];function $5(e,t){if(e==null)return{};var r,a,s=jie(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 jie(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 V5(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 gf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?V5(Object(r),!0).forEach(function(a){Eie(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V5(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Eie(e,t,r){return(t=Sie(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sie(e){var t=Bie(e,"string");return typeof t=="symbol"?t:t+""}function Bie(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 ao(){return ao=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},ao.apply(null,arguments)}var $P=j.createContext(null),_ie=e=>{var{x:t,y:r,upperWidth:a,lowerWidth:s,width:i,height:l,children:o}=e,d=j.useMemo(()=>({x:t,y:r,upperWidth:a,lowerWidth:s,width:i,height:l}),[t,r,a,s,i,l]);return j.createElement($P.Provider,{value:d},o)},VP=()=>{var e=j.useContext($P),t=Ib();return e||(t?Bk(t):void 0)},Tie=j.createContext(null),Iie=()=>{var e=j.useContext(Tie),t=gt(yO);return e||t},Fie=e=>{var{value:t,formatter:r}=e,a=Qn(e.children)?t:e.children;return typeof r=="function"?r(a):a},Fj=e=>e!=null&&typeof e=="function",Die=(e,t)=>{var r=fi(t-e),a=Math.min(Math.abs(t-e),360);return r*a},Uie=(e,t,r,a,s)=>{var{offset:i,className:l}=e,{cx:o,cy:d,innerRadius:u,outerRadius:f,startAngle:p,endAngle:x,clockWise:m}=s,b=(u+f)/2,v=Die(p,x),y=v>=0?1:-1,k,_;switch(t){case"insideStart":k=p+y*i,_=m;break;case"insideEnd":k=x-y*i,_=!m;break;case"end":k=x+y*i,_=m;break;default:throw new Error("Unsupported position ".concat(t))}_=v<=0?_:!_;var C=wn(o,d,b,k),E=wn(o,d,b,k+(_?1:-1)*359),T="M".concat(C.x,",").concat(C.y,`
    A`).concat(b,",").concat(b,",0,1,").concat(_?0:1,`,
    `).concat(E.x,",").concat(E.y),B=Qn(e.id)?Xf("recharts-radial-line-"):e.id;return j.createElement("text",ao({},a,{dominantBaseline:"central",className:Lr("recharts-radial-bar-label",l)}),j.createElement("defs",null,j.createElement("path",{id:B,d:T})),j.createElement("textPath",{xlinkHref:"#".concat(B)},r))},Mie=(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 x=(i+l)/2,{x:m,y:b}=wn(a,s,x,u);return{x:m,y:b,textAnchor:"middle",verticalAnchor:"middle"}},Im=e=>e!=null&&"cx"in e&&At(e.cx),Rie={angle:0,offset:5,zIndex:Xn.label,position:"middle",textBreakAll:!1};function Oie(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=Vs(e,Rie),{viewBox:r,parentViewBox:a,position:s,value:i,children:l,content:o,className:d="",textBreakAll:u,labelRef:f}=t,p=Iie(),x=VP(),m=s==="center"?x:p??x,b,v,y;r==null?b=m:Im(r)?b=r:b=Bk(r);var k=Oie(b);if(!b||Qn(i)&&Qn(l)&&!j.isValidElement(o)&&typeof o!="function")return null;var _=gf(gf({},t),{},{viewBox:b});if(j.isValidElement(o)){var{labelRef:C}=_,E=$5(_,Cie);return j.cloneElement(o,E)}if(typeof o=="function"){var{content:T}=_,B=$5(_,kie);if(v=j.createElement(o,B),j.isValidElement(v))return v}else v=Fie(t);var F=yi(t);if(Im(b)){if(s==="insideStart"||s==="insideEnd"||s==="end")return Uie(t,s,v,F,b);y=Mie(b,t.offset,t.position)}else{if(!k)return null;var M=Nie({viewBox:k,position:s,offset:t.offset,parentViewBox:Im(a)?void 0:a});y=gf(gf({x:M.x,y:M.y,textAnchor:M.horizontalAnchor,verticalAnchor:M.verticalAnchor},M.width!==void 0?{width:M.width}:{}),M.height!==void 0?{height:M.height}:{})}return j.createElement(Fo,{zIndex:t.zIndex},j.createElement(Ij,ao({ref:f,className:Lr("recharts-label",d)},F,y,{textAnchor:hie(F.textAnchor)?F.textAnchor:y.textAnchor,breakAll:u}),v))}hc.displayName="Label";var Pie=(e,t,r)=>{if(!e)return null;var a={viewBox:t,labelRef:r};return e===!0?j.createElement(hc,ao({key:"label-implicit"},a)):Cl(e)?j.createElement(hc,ao({key:"label-implicit",value:e},a)):j.isValidElement(e)?e.type===hc?j.cloneElement(e,gf({key:"label-implicit"},a)):j.createElement(hc,ao({key:"label-implicit",content:e},a)):Fj(e)?j.createElement(hc,ao({key:"label-implicit",content:e},a)):e&&typeof e=="object"?j.createElement(hc,ao({},e,{key:"label-implicit"},a)):null};function Lie(e){var{label:t,labelRef:r}=e,a=VP();return Pie(t,a,r)||null}var i2={},l2={},G5;function Qie(){return G5||(G5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(l2)),l2}var o2={},K5;function Hie(){return K5||(K5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(o2)),o2}var q5;function zie(){return q5||(q5=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Qie(),r=Hie(),a=gk();function s(i){if(a.isArrayLike(i))return t.last(r.toArray(i))}e.last=s})(i2)),i2}var c2,W5;function $ie(){return W5||(W5=1,c2=zie().last),c2}var Vie=$ie();const Gie=El(Vie);var Kie=["valueAccessor"],qie=["dataKey","clockWise","id","textBreakAll","zIndex"];function jg(){return jg=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},jg.apply(null,arguments)}function Y5(e,t){if(e==null)return{};var r,a,s=Wie(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 Wie(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 Yie=e=>Array.isArray(e.value)?Gie(e.value):e.value,GP=j.createContext(void 0),Xie=GP.Provider,KP=j.createContext(void 0);KP.Provider;function Jie(){return j.useContext(GP)}function Zie(){return j.useContext(KP)}function Fm(e){var{valueAccessor:t=Yie}=e,r=Y5(e,Kie),{dataKey:a,clockWise:s,id:i,textBreakAll:l,zIndex:o}=r,d=Y5(r,qie),u=Jie(),f=Zie(),p=u||f;return!p||!p.length?null:j.createElement(Fo,{zIndex:o??Xn.label},j.createElement(wl,{className:"recharts-label-list"},p.map((x,m)=>{var b,v=Qn(a)?t(x,m):Cn(x.payload,a),y=Qn(i)?{}:{id:"".concat(i,"-").concat(m)};return j.createElement(hc,jg({key:"label-".concat(m)},yi(x),d,y,{fill:(b=r.fill)!==null&&b!==void 0?b:x.fill,parentViewBox:x.parentViewBox,value:v,textBreakAll:l,viewBox:x.viewBox,index:m,zIndex:0}))})))}Fm.displayName="LabelList";function ele(e){var{label:t}=e;return t?t===!0?j.createElement(Fm,{key:"labelList-implicit"}):j.isValidElement(t)||Fj(t)?j.createElement(Fm,{key:"labelList-implicit",content:t}):typeof t=="object"?j.createElement(Fm,jg({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function ZN(){return ZN=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},ZN.apply(null,arguments)}var qP=e=>{var{cx:t,cy:r,r:a,className:s}=e,i=Lr("recharts-dot",s);return At(t)&&At(r)&&At(a)?j.createElement("circle",ZN({},Wi(e),mk(e),{className:i,cx:t,cy:r,r:a})):null},tle={radiusAxis:{},angleAxis:{}},WP=ws({name:"polarAxis",initialState:tle,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:NFe,removeRadiusAxis:CFe,addAngleAxis:kFe,removeAngleAxis:jFe}=WP.actions,rle=WP.reducer;function ale(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var YP=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function nle(e){var{tooltipEntrySettings:t}=e,r=an(),a=Ns(),s=j.useRef(null);return j.useLayoutEffect(()=>{a||(s.current===null?r(Uae(t)):s.current!==t&&r(Mae({prev:s.current,next:t})),s.current=t)},[t,r,a]),j.useLayoutEffect(()=>()=>{s.current&&(r(Rae(s.current)),s.current=null)},[r]),null}function sle(e){var{legendPayload:t}=e,r=an(),a=Ns(),s=j.useRef(null);return j.useLayoutEffect(()=>{a||(s.current===null?r(dJ(t)):s.current!==t&&r(uJ({prev:s.current,next:t})),s.current=t)},[r,a,t]),j.useLayoutEffect(()=>()=>{s.current&&(r(AJ(s.current)),s.current=null)},[r]),null}var d2,ile=()=>{var[e]=j.useState(()=>Xf("uid-"));return e},lle=(d2=G7.useId)!==null&&d2!==void 0?d2:ile;function ole(e,t){var r=lle();return t||(e?"".concat(e,"-").concat(r):r)}var cle=j.createContext(void 0),dle=e=>{var{id:t,type:r,children:a}=e,s=ole("recharts-".concat(r),t);return j.createElement(cle.Provider,{value:s},a(s))},ule={cartesianItems:[],polarItems:[]},XP=ws({name:"graphicalItems",initialState:ule,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:Ale,replaceCartesianGraphicalItem:fle,removeCartesianGraphicalItem:ple,addPolarGraphicalItem:EFe,removePolarGraphicalItem:SFe}=XP.actions,hle=XP.reducer,xle=e=>{var t=an(),r=j.useRef(null);return j.useLayoutEffect(()=>{r.current===null?t(Ale(e)):r.current!==e&&t(fle({prev:r.current,next:e})),r.current=e},[t,e]),j.useLayoutEffect(()=>()=>{r.current&&(t(ple(r.current)),r.current=null)},[t]),null},mle=j.memo(xle),gle=["points"];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 u2(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){ble(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 ble(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=yle(e,"string");return typeof t=="symbol"?t:t+""}function yle(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 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 wle(e,t){if(e==null)return{};var r,a,s=Nle(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 Nle(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 Cle(e){var{option:t,dotProps:r,className:a}=e;if(j.isValidElement(t))return j.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=wle(i,gle);return j.createElement(qP,Eg({},o,{className:s}))}function kle(e,t){return e==null?!1:t?!0:e.length===1}function jle(e){var{points:t,dot:r,className:a,dotClassName:s,dataKey:i,baseProps:l,needClip:o,clipPathId:d,zIndex:u=Xn.scatter}=e;if(!kle(t,r))return null;var f=YP(r),p=Cq(r),x=t.map((b,v)=>{var y,k,_=u2(u2(u2({r:3},l),p),{},{index:v,cx:(y=b.x)!==null&&y!==void 0?y:void 0,cy:(k=b.y)!==null&&k!==void 0?k:void 0,dataKey:i,value:b.value,payload:b.payload,points:t});return j.createElement(Cle,{key:"dot-".concat(v),option:r,dotProps:_,className:s})}),m={};return o&&d!=null&&(m.clipPath="url(#clipPath-".concat(f?"":"dots-").concat(d,")")),j.createElement(Fo,{zIndex:u},j.createElement(wl,Eg({className:a},m),x))}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 Z5(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){Ele(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 Ele(e,t,r){return(t=Sle(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sle(e){var t=Ble(e,"string");return typeof t=="symbol"?t:t+""}function Ble(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 JP=0,_le={xAxis:{},yAxis:{},zAxis:{}},ZP=ws({name:"cartesianAxis",initialState:_le,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]=Z5(Z5({},s),{},{width:a,widthHistory:o})}}}}),{addXAxis:Tle,replaceXAxis:Ile,removeXAxis:Fle,addYAxis:Dle,replaceYAxis:Ule,removeYAxis:Mle,addZAxis:BFe,replaceZAxis:_Fe,removeZAxis:TFe,updateYAxisWidth:Rle}=ZP.actions,Ole=ZP.reducer,Ple=De([Sn],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Lle=De([Ple,jo,Eo],(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)}}),Dj=()=>gt(Lle),Qle=()=>gt(Bne);function e6(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?e6(Object(r),!0).forEach(function(a){Hle(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):e6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Hle(e,t,r){return(t=zle(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zle(e){var t=$le(e,"string");return typeof t=="symbol"?t:t+""}function $le(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 Vle=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=A2(A2(A2({},o),pb(s)),mk(s)),u;return j.isValidElement(s)?u=j.cloneElement(s,d):typeof s=="function"?u=s(d):u=j.createElement(qP,d),j.createElement(wl,{className:"recharts-active-dot",clipPath:l},u)};function t6(e){var{points:t,mainColor:r,activeDot:a,itemDataKey:s,clipPath:i,zIndex:l=Xn.activeDot}=e,o=gt(dp),d=Qle();if(t==null||d==null)return null;var u=t.find(f=>d.includes(f.payload));return Qn(u)?null:j.createElement(Fo,{zIndex:l},j.createElement(Vle,{point:u,childIndex:Number(o),mainColor:r,dataKey:s,activeDot:a,clipPath:i}))}var Gle=e=>{var{chartData:t}=e,r=an(),a=Ns();return j.useEffect(()=>a?()=>{}:(r(S5(t)),()=>{r(S5(void 0))}),[t,r,a]),null},r6={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},eL=ws({name:"brush",initialState:r6,reducers:{setBrushSettings(e,t){return t.payload==null?r6:t.payload}}}),{setBrushSettings:IFe}=eL.actions,Kle=eL.reducer;function qle(e){return(e%180+180)%180}var Wle=function(t){var{width:r,height:a}=t,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=qle(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)},Yle={dots:[],areas:[],lines:[]},tL=ws({name:"referenceElements",initialState:Yle,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:FFe,removeDot:DFe,addArea:UFe,removeArea:MFe,addLine:RFe,removeLine:OFe}=tL.actions,Xle=tL.reducer,Jle=j.createContext(void 0),Zle=e=>{var{children:t}=e,[r]=j.useState("".concat(Xf("recharts"),"-clip")),a=Dj();if(a==null)return null;var{x:s,y:i,width:l,height:o}=a;return j.createElement(Jle.Provider,{value:r},j.createElement("defs",null,j.createElement("clipPath",{id:r},j.createElement("rect",{x:s,y:i,height:o,width:l}))),t)};function rL(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 eoe(e,t,r){var a={width:e.width+t.width,height:e.height+t.height};return Wle(a,r)}function toe(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 Ap(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 roe(e,t){return rL(e,t+1)}function aoe(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:rL(a,u)};var v=d,y,k=()=>(y===void 0&&(y=r(b,v)),y),_=b.coordinate,C=d===0||Ap(e,_,k,f,o);C||(d=0,f=l,u+=1),C&&(f=_+e*(k()/2+s),d+=u)},x;u<=i.length;)if(x=p(),x)return x.v;return[]}function noe(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,x=!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),M=E.coordinate,U=v===f||Ap(e,M,F,p,d);if(!U)return x=!1,1;U&&(p=M+e*(F()/2+s))},b,v=f;v<l&&(b=m(),!(b!==0&&b===1));v+=u);if(x){for(var y=[],k=f;k<l;k+=u){var _=a[k];_!=null&&y.push(_)}return y}}return[]}function a6(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?a6(Object(r),!0).forEach(function(a){soe(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function soe(e,t,r){return(t=ioe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ioe(e){var t=loe(e,"string");return typeof t=="symbol"?t:t+""}function loe(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 ooe(e,t,r,a,s){for(var i=(a||[]).slice(),l=i.length,{start:o}=t,{end:d}=t,u=function(x){var m=i[x];if(m==null)return 1;var b=m,v,y=()=>(v===void 0&&(v=r(m,x)),v);if(x===l-1){var k=e*(b.coordinate+e*y()/2-d);i[x]=b=In(In({},b),{},{tickCoord:k>0?b.coordinate-k*e:b.coordinate})}else i[x]=b=In(In({},b),{},{tickCoord:b.coordinate});if(b.tickCoord!=null){var _=Ap(e,b.tickCoord,y,o,d);_&&(d=b.tickCoord-e*(y()/2+s),i[x]=In(In({},b),{},{isShow:!0}))}},f=l-1;f>=0;f--)u(f);return i}function coe(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),x=e*(f.coordinate+e*p/2-u);if(l[o-1]=f=In(In({},f),{},{tickCoord:x>0?f.coordinate-x*e:f.coordinate}),f.tickCoord!=null){var m=Ap(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 C=l[_];if(C==null)return 1;var E=C,T,B=()=>(T===void 0&&(T=r(C,_)),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 M=Ap(e,E.tickCoord,B,d,u);M&&(d=E.tickCoord+e*(B()/2+s),l[_]=In(In({},E),{},{isShow:!0}))}},y=0;y<b;y++)v(y);return l}function Uj(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 x;return(x=roe(s,At(d)?d:0))!==null&&x!==void 0?x:[]}var m=[],b=o==="top"||o==="bottom"?"width":"height",v=f&&b==="width"?Tf(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"?eoe(Tf(F,{fontSize:t,letterSpacing:r}),v,p):Tf(F,{fontSize:t,letterSpacing:r})[b]},k=s[0],_=s[1],C=s.length>=2&&k!=null&&_!=null?fi(_.coordinate-k.coordinate):1,E=toe(i,C,b);return d==="equidistantPreserveStart"?aoe(C,E,y,s,l):d==="equidistantPreserveEnd"?noe(C,E,y,s,l):(d==="preserveStart"||d==="preserveStartEnd"?m=coe(C,E,y,s,l,d==="preserveStartEnd"):m=ooe(C,E,y,s,l),m.filter(T=>T.isShow))}var doe=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},uoe=["axisLine","width","height","className","hide","ticks","axisType"];function Aoe(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}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 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 la(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){poe(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 poe(e,t,r){return(t=hoe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hoe(e){var t=xoe(e,"string");return typeof t=="symbol"?t:t+""}function xoe(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 oo={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 moe(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 j.createElement("line",$d({},u,{className:Lr("recharts-cartesian-axis-line",mb(o,"className"))}))}function goe(e,t,r,a,s,i,l,o,d){var u,f,p,x,m,b,v=o?-1:1,y=e.tickSize||l,k=At(e.tickCoord)?e.tickCoord:e.coordinate;switch(i){case"top":u=f=e.coordinate,x=r+ +!o*s,p=x-v*y,b=p-v*d,m=k;break;case"left":p=x=e.coordinate,f=t+ +!o*a,u=f-v*y,m=u-v*d,b=k;break;case"right":p=x=e.coordinate,f=t+ +o*a,u=f+v*y,m=u+v*d,b=k;break;default:u=f=e.coordinate,x=r+ +o*s,p=x+v*y,b=p+v*d,m=k;break}return{line:{x1:u,y1:p,x2:f,y2:x},tick:{x:m,y:b}}}function boe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function voe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function yoe(e){var{option:t,tickProps:r,value:a}=e,s,i=Lr(r.className,"recharts-cartesian-axis-tick-value");if(j.isValidElement(t))s=j.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,ale(t))),s=j.createElement(Ij,$d({},r,{className:l}),a)}return s}var woe=j.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,y:m,width:b,height:v,tickSize:y,tickMargin:k,fontSize:_,letterSpacing:C,getTicksConfig:E,events:T,axisType:B}=e,F=Uj(la(la({},E),{},{ticks:r}),_,C),M=boe(f,p),U=voe(f,p),D=Wi(E),L=pb(a),P={};typeof s=="object"&&(P=s);var G=la(la({},D),{},{fill:"none"},P),H=F.map(K=>la({entry:K},goe(K,x,m,b,v,f,y,p,k))),Q=H.map(K=>{var{entry:ee,line:J}=K;return j.createElement(wl,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(ee.value,"-").concat(ee.coordinate,"-").concat(ee.tickCoord)},s&&j.createElement("line",$d({},G,J,{className:Lr("recharts-cartesian-axis-tick-line",mb(s,"className"))})))}),Y=H.map((K,ee)=>{var J,W,{entry:R,tick:O}=K,q=la(la(la(la({verticalAnchor:U},D),{},{textAnchor:M,stroke:"none",fill:i},O),{},{index:ee,payload:R,visibleTicksCount:F.length,tickFormatter:l,padding:d},u),{},{angle:(J=(W=u==null?void 0:u.angle)!==null&&W!==void 0?W:D.angle)!==null&&J!==void 0?J:0}),z=la(la({},q),L);return j.createElement(wl,$d({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(R.value,"-").concat(R.coordinate,"-").concat(R.tickCoord)},iW(T,R,ee)),a&&j.createElement(yoe,{option:a,tickProps:z,value:"".concat(typeof l=="function"?l(R.value,ee):R.value).concat(o||"")}))});return j.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(B,"-ticks")},Y.length>0&&j.createElement(Fo,{zIndex:Xn.label},j.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(B,"-tick-labels"),ref:t},Y)),Q.length>0&&j.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(B,"-tick-lines")},Q))}),Noe=j.forwardRef((e,t)=>{var{axisLine:r,width:a,height:s,className:i,hide:l,ticks:o,axisType:d}=e,u=Aoe(e,uoe),[f,p]=j.useState(""),[x,m]=j.useState(""),b=j.useRef(null);j.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var y;return doe({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=j.useCallback(y=>{if(y){var k=y.getElementsByClassName("recharts-cartesian-axis-tick-value");b.current=k;var _=k[0];if(_){var C=window.getComputedStyle(_),E=C.fontSize,T=C.letterSpacing;(E!==f||T!==x)&&(p(E),m(T))}}},[f,x]);return l||a!=null&&a<=0||s!=null&&s<=0?null:j.createElement(Fo,{zIndex:e.zIndex},j.createElement(wl,{className:Lr("recharts-cartesian-axis",i)},j.createElement(moe,{x:e.x,y:e.y,width:a,height:s,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:Wi(e)}),j.createElement(woe,{ref:v,axisType:d,events:u,fontSize:f,getTicksConfig:e,height:e.height,letterSpacing:x,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}),j.createElement(_ie,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},j.createElement(Lie,{label:e.label,labelRef:e.labelRef}),e.children)))}),Mj=j.forwardRef((e,t)=>{var r=Vs(e,oo);return j.createElement(Noe,$d({},r,{ref:t}))});Mj.displayName="CartesianAxis";var Coe=["x1","y1","x2","y2","key"],koe=["offset"],joe=["xAxisId","yAxisId"],Eoe=["xAxisId","yAxisId"];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 Mn(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){Soe(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 Soe(e,t,r){return(t=Boe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Boe(e){var t=_oe(e,"string");return typeof t=="symbol"?t:t+""}function _oe(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 Nd(){return Nd=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},Nd.apply(null,arguments)}function Sg(e,t){if(e==null)return{};var r,a,s=Toe(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 Toe(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 Ioe=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 j.createElement("rect",{x:a,y:s,ry:o,width:i,height:l,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function aL(e){var{option:t,lineItemProps:r}=e,a;if(j.isValidElement(t))a=j.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=Sg(r,Coe),p=(s=Wi(f))!==null&&s!==void 0?s:{},{offset:x}=p,m=Sg(p,koe);a=j.createElement("line",Nd({},m,{x1:i,y1:l,x2:o,y2:d,fill:"none",key:u}))}return a}function Foe(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=Sg(e,joe),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 j.createElement(aL,{key:"line-".concat(f),option:a,lineItemProps:p})});return j.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function Doe(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=Sg(e,Eoe),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 j.createElement(aL,{option:a,lineItemProps:p,key:"line-".concat(f)})});return j.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function Uoe(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,x)=>p-x);s!==u[0]&&u.unshift(0);var f=u.map((p,x)=>{var m=u[x+1],b=m==null,v=b?s+l-p:m-p;if(v<=0)return null;var y=x%t.length;return j.createElement("rect",{key:"react-".concat(x),y:p,x:a,height:v,width:i,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return j.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function Moe(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,x)=>p-x);s!==u[0]&&u.unshift(0);var f=u.map((p,x)=>{var m=u[x+1],b=m==null,v=b?s+l-p:m-p;if(v<=0)return null;var y=x%r.length;return j.createElement("rect",{key:"react-".concat(x),x:p,y:i,width:v,height:o,stroke:"none",fill:r[y],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return j.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Roe=(e,t)=>{var{xAxis:r,width:a,height:s,offset:i}=e;return WR(Uj(Mn(Mn(Mn({},oo),r),{},{ticks:YR(r),viewBox:{x:0,y:0,width:a,height:s}})),i.left,i.left+i.width,t)},Ooe=(e,t)=>{var{yAxis:r,width:a,height:s,offset:i}=e;return WR(Uj(Mn(Mn(Mn({},oo),r),{},{ticks:YR(r),viewBox:{x:0,y:0,width:a,height:s}})),i.top,i.top+i.height,t)},Poe={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Xn.grid};function Zb(e){var t=n8(),r=s8(),a=a8(),s=Mn(Mn({},Vs(e,Poe)),{},{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:x,verticalValues:m}=s,b=Ns(),v=gt(U=>x5(U,"xAxis",i,b)),y=gt(U=>x5(U,"yAxis",l,b));if(!kl(u)||!kl(f)||!At(o)||!At(d))return null;var k=s.verticalCoordinatesGenerator||Roe,_=s.horizontalCoordinatesGenerator||Ooe,{horizontalPoints:C,verticalPoints:E}=s;if((!C||!C.length)&&typeof _=="function"){var T=x&&x.length,B=_({yAxis:y?Mn(Mn({},y),{},{ticks:T?x:y.ticks}):void 0,width:t??u,height:r??f,offset:a},T?!0:p);rg(Array.isArray(B),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof B,"]")),Array.isArray(B)&&(C=B)}if((!E||!E.length)&&typeof k=="function"){var F=m&&m.length,M=k({xAxis:v?Mn(Mn({},v),{},{ticks:F?m:v.ticks}):void 0,width:t??u,height:r??f,offset:a},F?!0:p);rg(Array.isArray(M),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof M,"]")),Array.isArray(M)&&(E=M)}return j.createElement(Fo,{zIndex:s.zIndex},j.createElement("g",{className:"recharts-cartesian-grid"},j.createElement(Ioe,{fill:s.fill,fillOpacity:s.fillOpacity,x:s.x,y:s.y,width:s.width,height:s.height,ry:s.ry}),j.createElement(Uoe,Nd({},s,{horizontalPoints:C})),j.createElement(Moe,Nd({},s,{verticalPoints:E})),j.createElement(Foe,Nd({},s,{offset:a,horizontalPoints:C,xAxis:v,yAxis:y})),j.createElement(Doe,Nd({},s,{offset:a,verticalPoints:E,xAxis:v,yAxis:y}))))}Zb.displayName="CartesianGrid";var Loe={},nL=ws({name:"errorBars",initialState:Loe,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:PFe,replaceErrorBar:LFe,removeErrorBar:QFe}=nL.actions,Qoe=nL.reducer;function sL(e,t){var r,a,s=gt(u=>_o(u,e)),i=gt(u=>To(u,t)),l=(r=s==null?void 0:s.allowDataOverflow)!==null&&r!==void 0?r:Wa.allowDataOverflow,o=(a=i==null?void 0:i.allowDataOverflow)!==null&&a!==void 0?a:Ya.allowDataOverflow,d=l||o;return{needClip:d,needClipX:l,needClipY:o}}function Hoe(e){var{xAxisId:t,yAxisId:r,clipPathId:a}=e,s=Dj(),{needClipX:i,needClipY:l,needClip:o}=sL(t,r);if(!o||!s)return null;var{x:d,y:u,width:f,height:p}=s;return j.createElement("clipPath",{id:"clipPath-".concat(a)},j.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 zoe(e){var t=pb(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 f2={exports:{}},p2={};/**
 * @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 i6;function $oe(){if(i6)return p2;i6=1;var e=RA();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 p2.useSyncExternalStoreWithSelector=function(d,u,f,p,x){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(!k){if(k=!0,_=T,T=p(T),x!==void 0&&b.hasValue){var B=b.value;if(x(B,T))return C=B}return C=T}if(B=C,r(_,T))return B;var F=p(T);return x!==void 0&&x(B,F)?(_=T,B):(_=T,C=F)}var k=!1,_,C,E=f===void 0?null:f;return[function(){return y(u())},E===null?void 0:function(){return y(E())}]},[u,f,p,x]);var v=a(d,m[0],m[1]);return i(function(){b.hasValue=!0,b.value=v},[v]),o(v),v},p2}var l6;function Voe(){return l6||(l6=1,f2.exports=$oe()),f2.exports}Voe();function Goe(e){e()}function Koe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Goe(()=>{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 o6={notify(){},get:()=>[]};function qoe(e,t){let r,a=o6,s=0,i=!1;function l(v){f();const y=a.subscribe(v);let k=!1;return()=>{k||(k=!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=Koe())}function p(){s--,r&&s===0&&(r(),r=void 0,a.clear(),a=o6)}function x(){i||(i=!0,f())}function m(){i&&(i=!1,p())}const b={addNestedSub:l,notifyNestedSubs:o,handleChangeWrapper:d,isSubscribed:u,trySubscribe:x,tryUnsubscribe:m,getListeners:()=>a};return b}var Woe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Yoe=Woe(),Xoe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Joe=Xoe(),Zoe=()=>Yoe||Joe?j.useLayoutEffect:j.useEffect,ece=Zoe();function c6(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function tce(e,t){if(c6(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])||!c6(e[r[s]],t[r[s]]))return!1;return!0}var h2=Symbol.for("react-redux-context"),x2=typeof globalThis<"u"?globalThis:{};function rce(){if(!j.createContext)return{};const e=x2[h2]??(x2[h2]=new Map);let t=e.get(j.createContext);return t||(t=j.createContext(null),e.set(j.createContext,t)),t}var ace=rce();function nce(e){const{children:t,context:r,serverState:a,store:s}=e,i=j.useMemo(()=>{const d=qoe(s);return{store:s,subscription:d,getServerState:a?()=>a:void 0}},[s,a]),l=j.useMemo(()=>s.getState(),[s]);ece(()=>{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||ace;return j.createElement(o.Provider,{value:i},t)}var sce=nce,ice=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function lce(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Rj(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var a of r)if(ice.has(a)){if(e[a]==null&&t[a]==null)continue;if(!tce(e[a],t[a]))return!1}else if(!lce(e[a],t[a]))return!1;return!0}function Oj(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:JP}function Pj(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:JP}var iL=(e,t,r)=>iP(e,"xAxis",Oj(e,t),r),lL=(e,t,r)=>sP(e,"xAxis",Oj(e,t),r),oL=(e,t,r)=>iP(e,"yAxis",Pj(e,t),r),cL=(e,t,r)=>sP(e,"yAxis",Pj(e,t),r),oce=De([Yr,iL,oL,lL,cL],(e,t,r,a,s)=>Bl(e,"xAxis")?tg(t,a,!1):tg(r,s,!1)),cce=(e,t)=>t,dL=De([EO,cce],(e,t)=>e.filter(r=>r.type==="area").find(r=>r.id===t)),uL=e=>{var t=Yr(e),r=Bl(t,"xAxis");return r?"yAxis":"xAxis"},dce=(e,t)=>{var r=uL(e);return r==="yAxis"?Pj(e,t):Oj(e,t)},uce=(e,t,r)=>MO(e,uL(e),dce(e,t),r),Ace=De([dL,uce],(e,t)=>{var r;if(!(e==null||t==null)){var{stackId:a}=e,s=dj(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]])}}}),fce=De([Yr,iL,oL,lL,cL,Ace,fre,oce,dL,wre],(e,t,r,a,s,i,l,o,d,u)=>{var{chartData:f,dataStartIndex:p,dataEndIndex:x}=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,x+1),b!=null)return Ice({layout:e,xAxis:t,yAxis:r,xAxisTicks:a,yAxisTicks:s,dataStartIndex:p,areaSettings:d,stackedData:i,displayedData:b,chartBaseValue:u,bandSize:o})}}),pce=["id"],hce=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Bd(){return Bd=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},Bd.apply(null,arguments)}function AL(e,t){if(e==null)return{};var r,a,s=xce(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 xce(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 d6(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 uA(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?d6(Object(r),!0).forEach(function(a){mce(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function mce(e,t,r){return(t=gce(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gce(e){var t=bce(e,"string");return typeof t=="symbol"?t:t+""}function bce(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 Bg(e,t){return e&&e!=="none"?e:t}var vce=e=>{var{dataKey:t,name:r,stroke:a,fill:s,legendType:i,hide:l}=e;return[{inactive:l,dataKey:t,type:i,color:Bg(a,s),value:XR(r,t),payload:e}]},yce=j.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:LA,settings:{stroke:a,strokeWidth:s,fill:i,dataKey:t,nameKey:void 0,name:XR(l,t),hide:o,type:u,color:Bg(a,i),unit:d,graphicalItemId:f}};return j.createElement(nle,{tooltipEntrySettings:p})});function wce(e){var{clipPathId:t,points:r,props:a}=e,{needClip:s,dot:i,dataKey:l}=a,o=Wi(a);return j.createElement(jle,{points:r,dot:i,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:o,needClip:s,clipPathId:t})}function Nce(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 uA(uA({},d),{},{value:i.value,payload:i.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return j.createElement(Xie,{value:t?s:void 0},r)}function u6(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,x=AL(i,pce),m=Wi(x),b=yi(x);return j.createElement(j.Fragment,null,(t==null?void 0:t.length)>1&&j.createElement(wl,{clipPath:a?"url(#clipPath-".concat(s,")"):void 0},j.createElement(_m,Bd({},b,{id:p,points:t,connectNulls:u,type:o,baseLine:r,layout:l,stroke:"none",className:"recharts-area-area"})),d!=="none"&&j.createElement(_m,Bd({},m,{className:"recharts-area-curve",layout:l,type:o,connectNulls:u,fill:"none",points:t})),d!=="none"&&f&&j.createElement(_m,Bd({},m,{className:"recharts-area-curve",layout:l,type:o,connectNulls:u,fill:"none",points:r}))),j.createElement(wce,{points:t,props:x,clipPathId:s}))}function Cce(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)?j.createElement("rect",{x:0,y:o<d?o:o-u,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(u)}):null}function kce(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)?j.createElement("rect",{x:o<d?o:o-u,y:0,width:u,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}function jce(e){var{alpha:t,layout:r,points:a,baseLine:s,strokeWidth:i}=e;return r==="vertical"?j.createElement(Cce,{alpha:t,points:a,baseLine:s,strokeWidth:i}):j.createElement(kce,{alpha:t,points:a,baseLine:s,strokeWidth:i})}function Ece(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:x,onAnimationEnd:m}=a,b=j.useMemo(()=>({points:l,baseLine:o}),[l,o]),v=b8(b,"recharts-area-"),y=_k(),[k,_]=j.useState(!1),C=!k,E=j.useCallback(()=>{typeof m=="function"&&m(),_(!1)},[m]),T=j.useCallback(()=>{typeof x=="function"&&x(),_(!0)},[x]);if(y==null)return null;var B=s.current,F=i.current;return j.createElement(Nce,{showLabels:C,points:l},a.children,j.createElement(g8,{animationId:v,begin:u,duration:f,isActive:d,easing:p,onAnimationEnd:E,onAnimationStart:T,key:v},M=>{if(B){var U=B.length/l.length,D=M===1?l:l.map((P,G)=>{var H=Math.floor(G*U);if(B[H]){var Q=B[H];return uA(uA({},P),{},{x:pl(Q.x,P.x,M),y:pl(Q.y,P.y,M)})}return P}),L;return At(o)?L=pl(F,o,M):Qn(o)||Nl(o)?L=pl(F,0,M):L=o.map((P,G)=>{var H=Math.floor(G*U);if(Array.isArray(F)&&F[H]){var Q=F[H];return uA(uA({},P),{},{x:pl(Q.x,P.x,M),y:pl(Q.y,P.y,M)})}return P}),M>0&&(s.current=D,i.current=L),j.createElement(u6,{points:D,baseLine:L,needClip:t,clipPathId:r,props:a})}return M>0&&(s.current=l,i.current=o),j.createElement(wl,null,d&&j.createElement("defs",null,j.createElement("clipPath",{id:"animationClipPath-".concat(r)},j.createElement(jce,{alpha:M,points:l,baseLine:o,layout:y,strokeWidth:a.strokeWidth}))),j.createElement(wl,{clipPath:"url(#animationClipPath-".concat(r,")")},j.createElement(u6,{points:l,baseLine:o,needClip:t,clipPathId:r,props:a})))}),j.createElement(ele,{label:a.label}))}function Sce(e){var{needClip:t,clipPathId:r,props:a}=e,s=j.useRef(null),i=j.useRef();return j.createElement(Ece,{needClip:t,clipPathId:r,props:a,previousPointsRef:s,previousBaselineRef:i})}class Bce extends j.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:x,baseLine:m,zIndex:b}=this.props;if(t)return null;var v=Lr("recharts-area",s),y=x,{r:k,strokeWidth:_}=zoe(r),C=YP(r),E=k*2+_,T=o?"url(#clipPath-".concat(C?"":"dots-").concat(y,")"):void 0;return j.createElement(Fo,{zIndex:b},j.createElement(wl,{className:v},o&&j.createElement("defs",null,j.createElement(Hoe,{clipPathId:y,xAxisId:d,yAxisId:u}),!C&&j.createElement("clipPath",{id:"clipPath-dots-".concat(y)},j.createElement("rect",{x:l-E/2,y:i-E/2,width:f+E,height:p+E}))),j.createElement(Sce,{needClip:o,clipPathId:y,props:this.props})),j.createElement(t6,{points:a,mainColor:Bg(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}),this.props.isRange&&Array.isArray(m)&&j.createElement(t6,{points:m,mainColor:Bg(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:T}))}}var fL={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 _ce(e){var t,r=Vs(e,fL),{activeDot:a,animationBegin:s,animationDuration:i,animationEasing:l,connectNulls:o,dot:d,fill:u,fillOpacity:f,hide:p,isAnimationActive:x,legendType:m,stroke:b,xAxisId:v,yAxisId:y}=r,k=AL(r,hce),_=QA(),C=SP(),{needClip:E}=sL(v,y),T=Ns(),{points:B,isRange:F,baseLine:M}=(t=gt(H=>fce(H,e.id,T)))!==null&&t!==void 0?t:{},U=Dj();if(_!=="horizontal"&&_!=="vertical"||U==null||C!=="AreaChart"&&C!=="ComposedChart")return null;var{height:D,width:L,x:P,y:G}=U;return!B||!B.length?null:j.createElement(Bce,Bd({},k,{activeDot:a,animationBegin:s,animationDuration:i,animationEasing:l,baseLine:M,connectNulls:o,dot:d,fill:u,fillOpacity:f,height:D,hide:p,layout:_,isAnimationActive:x==="auto"?!Qp.isSsr:x,isRange:F,legendType:m,needClip:E,points:B,stroke:b,width:L,left:P,top:G,xAxisId:v,yAxisId:y}))}var Tce=(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 Ice(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:x,bandSize:m}=e,b=s&&s.length,v=Tce(i,l,r,o,d),y=i==="horizontal",k=!1,_=u.map((E,T)=>{var B,F,M,U;if(b)U=s[f+T];else{var D=Cn(E,a);Array.isArray(D)?(U=D,k=!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:mI({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:(M=o.scale.map(L))!==null&&M!==void 0?M:null,y:mI({axis:d,ticks:x,bandSize:m,entry:E,index:T}),value:U,payload:E}}),C;return b||k?C=_.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}}):C=y?d.scale.map(v):o.scale.map(v),{points:_,baseLine:C??0,isRange:k}}function Fce(e){var t=Vs(e,fL),r=Ns();return j.createElement(dle,{id:t.id,type:"area"},a=>j.createElement(j.Fragment,null,j.createElement(sle,{legendPayload:vce(t)}),j.createElement(yce,{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}),j.createElement(mle,{type:"area",id:a,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:pX(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:r,connectNulls:t.connectNulls}),j.createElement(_ce,Bd({},t,{id:a}))))}var IA=j.memo(Fce,Rj);IA.displayName="Area";var Dce=["domain","range"],Uce=["domain","range"];function A6(e,t){if(e==null)return{};var r,a,s=Mce(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 Mce(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 f6(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 pL(e,t){if(e===t)return!0;var{domain:r,range:a}=e,s=A6(e,Dce),{domain:i,range:l}=t,o=A6(t,Uce);return!f6(r,i)||!f6(a,l)?!1:Rj(s,o)}var Rce=["type"],Oce=["dangerouslySetInnerHTML","ticks","scale"],Pce=["id","scale"];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 p6(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?p6(Object(r),!0).forEach(function(a){Lce(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Lce(e,t,r){return(t=Qce(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qce(e){var t=Hce(e,"string");return typeof t=="symbol"?t:t+""}function Hce(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 tC(e,t){if(e==null)return{};var r,a,s=zce(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 zce(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 $ce(e){var t=an(),r=j.useRef(null),a=_k(),{type:s}=e,i=tC(e,Rce),l=$b(a,"xAxis",s),o=j.useMemo(()=>{if(l!=null)return h6(h6({},i),{},{type:l})},[i,l]);return j.useLayoutEffect(()=>{o!=null&&(r.current===null?t(Tle(o)):r.current!==o&&t(Ile({prev:r.current,next:o})),r.current=o)},[o,t]),j.useLayoutEffect(()=>()=>{r.current&&(t(Fle(r.current)),r.current=null)},[t]),null}var Vce=e=>{var{xAxisId:t,className:r}=e,a=gt(ZR),s=Ns(),i="xAxis",l=gt(k=>nP(k,i,t,s)),o=gt(k=>gae(k,t)),d=gt(k=>Cae(k,t)),u=gt(k=>NO(k,t));if(o==null||d==null||u==null)return null;var{dangerouslySetInnerHTML:f,ticks:p,scale:x}=e,m=tC(e,Oce),{id:b,scale:v}=u,y=tC(u,Pce);return j.createElement(Mj,eC({},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}))},Gce={allowDataOverflow:Wa.allowDataOverflow,allowDecimals:Wa.allowDecimals,allowDuplicatedCategory:Wa.allowDuplicatedCategory,angle:Wa.angle,axisLine:oo.axisLine,height:Wa.height,hide:!1,includeHidden:Wa.includeHidden,interval:Wa.interval,label:!1,minTickGap:Wa.minTickGap,mirror:Wa.mirror,orientation:Wa.orientation,padding:Wa.padding,reversed:Wa.reversed,scale:Wa.scale,tick:Wa.tick,tickCount:Wa.tickCount,tickLine:oo.tickLine,tickSize:oo.tickSize,type:Wa.type,xAxisId:0},Kce=e=>{var t=Vs(e,Gce);return j.createElement(j.Fragment,null,j.createElement($ce,{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}),j.createElement(Vce,t))},ev=j.memo(Kce,pL);ev.displayName="XAxis";var qce=["type"],Wce=["dangerouslySetInnerHTML","ticks","scale"],Yce=["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 m6(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){Xce(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 Xce(e,t,r){return(t=Jce(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Jce(e){var t=Zce(e,"string");return typeof t=="symbol"?t:t+""}function Zce(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=ede(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 ede(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 tde(e){var t=an(),r=j.useRef(null),a=_k(),{type:s}=e,i=aC(e,qce),l=$b(a,"yAxis",s),o=j.useMemo(()=>{if(l!=null)return m6(m6({},i),{},{type:l})},[l,i]);return j.useLayoutEffect(()=>{o!=null&&(r.current===null?t(Dle(o)):r.current!==o&&t(Ule({prev:r.current,next:o})),r.current=o)},[o,t]),j.useLayoutEffect(()=>()=>{r.current&&(t(Mle(r.current)),r.current=null)},[t]),null}function rde(e){var{yAxisId:t,className:r,width:a,label:s}=e,i=j.useRef(null),l=j.useRef(null),o=gt(ZR),d=Ns(),u=an(),f="yAxis",p=gt(B=>Eae(B,t)),x=gt(B=>jae(B,t)),m=gt(B=>nP(B,f,t,d)),b=gt(B=>CO(B,t));if(j.useLayoutEffect(()=>{if(!(a!=="auto"||!p||Fj(s)||j.isValidElement(s)||b==null)){var B=i.current;if(B){var F=B.getCalculatedWidth();Math.round(p.width)!==Math.round(F)&&u(Rle({id:t,width:F}))}}},[m,p,u,s,t,a,b]),p==null||x==null||b==null)return null;var{dangerouslySetInnerHTML:v,ticks:y,scale:k}=e,_=aC(e,Wce),{id:C,scale:E}=b,T=aC(b,Yce);return j.createElement(Mj,rC({},_,T,{ref:i,labelRef:l,x:x.x,y:x.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 ade={allowDataOverflow:Ya.allowDataOverflow,allowDecimals:Ya.allowDecimals,allowDuplicatedCategory:Ya.allowDuplicatedCategory,angle:Ya.angle,axisLine:oo.axisLine,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:oo.tickLine,tickSize:oo.tickSize,type:Ya.type,width:Ya.width,yAxisId:0},nde=e=>{var t=Vs(e,ade);return j.createElement(j.Fragment,null,j.createElement(tde,{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}),j.createElement(rde,t))},tv=j.memo(nde,pL);tv.displayName="YAxis";var sde=(e,t)=>t,Lj=De([sde,Yr,yO,ln,wP,Io,Qne,Sn],qne),Qj=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)}},hL=wi("mouseClick"),xL=Rp();xL.startListening({actionCreator:hL,effect:(e,t)=>{var r=e.payload,a=Lj(t.getState(),Qj(r));(a==null?void 0:a.activeIndex)!=null&&t.dispatch(Lae({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}});var nC=wi("mouseMove"),mL=Rp(),Ux=null;mL.startListening({actionCreator:nC,effect:(e,t)=>{var r=e.payload;Ux!==null&&cancelAnimationFrame(Ux);var a=Qj(r);Ux=requestAnimationFrame(()=>{var s=t.getState(),i=yj(s,s.tooltip.settings.shared);if(i==="axis"){var l=Lj(s,a);(l==null?void 0:l.activeIndex)!=null?t.dispatch(fP({activeIndex:l.activeIndex,activeDataKey:void 0,activeCoordinate:l.activeCoordinate})):t.dispatch(AP())}Ux=null})}});function ide(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 g6={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},gL=ws({name:"rootProps",initialState:g6,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:g6.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}}}),lde=gL.reducer,{updateOptions:ode}=gL.actions,cde=null,dde={updatePolarOptions:(e,t)=>t.payload},bL=ws({name:"polarOptions",initialState:cde,reducers:dde}),{updatePolarOptions:HFe}=bL.actions,ude=bL.reducer,vL=wi("keyDown"),yL=wi("focus"),Hj=Rp();Hj.startListening({actionCreator:vL,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=wj(s,YA(r),qp(r),Yp(r)),o=l==null?-1:Number(l);if(!(!Number.isFinite(o)||o<0)){var d=Io(r);if(i==="Enter"){var u=kg(r,"axis","hover",String(s.index));t.dispatch(WN({active:!s.active,activeIndex:s.index,activeCoordinate:u}));return}var f=Tae(r),p=f==="left-to-right"?1:-1,x=i==="ArrowRight"?1:-1,m=o+x*p;if(!(d==null||m>=d.length||m<0)){var b=kg(r,"axis","hover",String(m));t.dispatch(WN({active:!0,activeIndex:m.toString(),activeCoordinate:b}))}}}}}});Hj.startListening({actionCreator:yL,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=kg(r,"axis","hover",String(i));t.dispatch(WN({active:!0,activeIndex:i,activeCoordinate:l}))}}}});var si=wi("externalEvent"),wL=Rp(),m2=new Map;wL.startListening({actionCreator:si,effect:(e,t)=>{var{handler:r,reactEvent:a}=e.payload;if(r!=null){a.persist();var s=a.type,i=m2.get(s);i!==void 0&&cancelAnimationFrame(i);var l=requestAnimationFrame(()=>{try{var o=t.getState(),d={activeCoordinate:jne(o),activeDataKey:Cne(o),activeIndex:dp(o),activeLabel:kP(o),activeTooltipIndex:dp(o),isTooltipActive:Ene(o)};r(d,a)}finally{m2.delete(s)}});m2.set(s,l)}}});var Ade=De([qA],e=>e.tooltipItemPayloads),fde=De([Ade,(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)}}}),NL=wi("touchMove"),CL=Rp();CL.startListening({actionCreator:NL,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){var a=t.getState(),s=yj(a,a.tooltip.settings.shared);if(s==="axis"){var i=r.touches[0];if(i==null)return;var l=Lj(a,Qj({clientX:i.clientX,clientY:i.clientY,currentTarget:r.currentTarget}));(l==null?void 0:l.activeIndex)!=null&&t.dispatch(fP({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(yX),p=(o=u.getAttribute(wX))!==null&&o!==void 0?o:void 0,x=WA(a).find(v=>v.id===p);if(f==null||x==null||p==null)return;var{dataKey:m}=x,b=fde(a,f,p);t.dispatch(Pae({activeDataKey:m,activeIndex:f,activeCoordinate:b,activeGraphicalItemId:p}))}}}});var pde=vR({brush:Kle,cartesianAxis:Ole,chartData:jse,errorBars:Qoe,graphicalItems:hle,layout:sX,legend:fJ,options:yse,polarAxis:rle,polarOptions:ude,referenceElements:Xle,rootProps:lde,tooltip:Qae,zIndex:ose}),hde=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return _Y({reducer:pde,preloadedState:t,middleware:a=>{var s;return a({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([xL.middleware,mL.middleware,Hj.middleware,wL.middleware,CL.middleware])},enhancers:a=>{var s=a;return typeof a=="function"&&(s=a()),s.concat(UR({type:"raf"}))},devTools:{serialize:{replacer:ide},name:"recharts-".concat(r)}})};function xde(e){var{preloadedState:t,children:r,reduxStoreName:a}=e,s=Ns(),i=j.useRef(null);if(s)return r;i.current==null&&(i.current=hde(t,a));var l=vk;return j.createElement(sce,{context:l,store:i.current},r)}function mde(e){var{layout:t,margin:r}=e,a=an(),s=Ns();return j.useEffect(()=>{s||(a(rX(t)),a(tX(r)))},[a,s,t,r]),null}var gde=j.memo(mde,Rj);function bde(e){var t=an();return j.useEffect(()=>{t(ode(e))},[t,e]),null}function b6(e){var{zIndex:t,isPanorama:r}=e,a=j.useRef(null),s=an();return j.useLayoutEffect(()=>(a.current&&s(ise({zIndex:t,element:a.current,isPanorama:r})),()=>{s(lse({zIndex:t,isPanorama:r}))}),[s,t,r]),j.createElement("g",{tabIndex:-1,ref:a})}function v6(e){var{children:t,isPanorama:r}=e,a=gt(Yne);if(!a||a.length===0)return t;var s=a.filter(l=>l<0),i=a.filter(l=>l>0);return j.createElement(j.Fragment,null,s.map(l=>j.createElement(b6,{key:l,zIndex:l,isPanorama:r})),t,i.map(l=>j.createElement(b6,{key:l,zIndex:l,isPanorama:r})))}var vde=["children"];function yde(e,t){if(e==null)return{};var r,a,s=wde(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 wde(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 _g(){return _g=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},_g.apply(null,arguments)}var Nde={width:"100%",height:"100%",display:"block"},Cde=j.forwardRef((e,t)=>{var r=n8(),a=s8(),s=p8();if(!kl(r)||!kl(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),j.createElement(QM,_g({},l,{title:o,desc:d,role:f,tabIndex:u,width:r,height:a,style:Nde,ref:t}),i)}),kde=e=>{var{children:t}=e,r=gt(Tb);if(!r)return null;var{width:a,height:s,y:i,x:l}=r;return j.createElement(QM,{width:a,height:s,x:l,y:i},t)},y6=j.forwardRef((e,t)=>{var{children:r}=e,a=yde(e,vde),s=Ns();return s?j.createElement(kde,null,j.createElement(v6,{isPanorama:!0},r)):j.createElement(Cde,_g({ref:t},a),j.createElement(v6,{isPanorama:!1},r))});function jde(){var e=an(),[t,r]=j.useState(null),a=gt(vX);return j.useEffect(()=>{if(t!=null){var s=t.getBoundingClientRect(),i=s.width/t.offsetWidth;Vt(i)&&i!==a&&e(nX(i))}},[t,e,a]),r}function w6(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 Ede(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?w6(Object(r),!0).forEach(function(a){Sde(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w6(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Sde(e,t,r){return(t=Bde(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bde(e){var t=_de(e,"string");return typeof t=="symbol"?t:t+""}function _de(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 jc(){return jc=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},jc.apply(null,arguments)}var Tde=()=>(Use(),null);function Tg(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var Ide=j.forwardRef((e,t)=>{var r,a,s=j.useRef(null),[i,l]=j.useState({containerWidth:Tg((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Tg((a=e.style)===null||a===void 0?void 0:a.height)}),o=j.useCallback((u,f)=>{l(p=>{var x=Math.round(u),m=Math.round(f);return p.containerWidth===x&&p.containerHeight===m?p:{containerWidth:x,containerHeight:m}})},[]),d=j.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:f,height:p}=u.getBoundingClientRect();o(f,p);var x=b=>{var v=b[0];if(v!=null){var{width:y,height:k}=v.contentRect;o(y,k)}},m=new ResizeObserver(x);m.observe(u),s.current=m}},[t,o]);return j.useEffect(()=>()=>{var u=s.current;u!=null&&u.disconnect()},[o]),j.createElement(j.Fragment,null,j.createElement(Pp,{width:i.containerWidth,height:i.containerHeight}),j.createElement("div",jc({ref:d},e)))}),Fde=j.forwardRef((e,t)=>{var{width:r,height:a}=e,[s,i]=j.useState({containerWidth:Tg(r),containerHeight:Tg(a)}),l=j.useCallback((d,u)=>{i(f=>{var p=Math.round(d),x=Math.round(u);return f.containerWidth===p&&f.containerHeight===x?f:{containerWidth:p,containerHeight:x}})},[]),o=j.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:u,height:f}=d.getBoundingClientRect();l(u,f)}},[t,l]);return j.createElement(j.Fragment,null,j.createElement(Pp,{width:s.containerWidth,height:s.containerHeight}),j.createElement("div",jc({ref:o},e)))}),Dde=j.forwardRef((e,t)=>{var{width:r,height:a}=e;return j.createElement(j.Fragment,null,j.createElement(Pp,{width:r,height:a}),j.createElement("div",jc({ref:t},e)))}),Ude=j.forwardRef((e,t)=>{var{width:r,height:a}=e;return typeof r=="string"||typeof a=="string"?j.createElement(Fde,jc({},e,{ref:t})):typeof r=="number"&&typeof a=="number"?j.createElement(Dde,jc({},e,{width:r,height:a,ref:t})):j.createElement(j.Fragment,null,j.createElement(Pp,{width:r,height:a}),j.createElement("div",jc({ref:t},e)))});function Mde(e){return e?Ide:Ude}var Rde=j.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:x,onTouchEnd:m,onTouchMove:b,onTouchStart:v,style:y,width:k,responsive:_,dispatchTouchEvents:C=!0}=e,E=j.useRef(null),T=an(),[B,F]=j.useState(null),[M,U]=j.useState(null),D=jde(),L=Ek(),P=(L==null?void 0:L.width)>0?L.width:k,G=(L==null?void 0:L.height)>0?L.height:s,H=j.useCallback(ae=>{D(ae),typeof t=="function"&&t(ae),F(ae),U(ae),ae!=null&&(E.current=ae)},[D,t,F,U]),Q=j.useCallback(ae=>{T(hL(ae)),T(si({handler:i,reactEvent:ae}))},[T,i]),Y=j.useCallback(ae=>{T(nC(ae)),T(si({handler:u,reactEvent:ae}))},[T,u]),K=j.useCallback(ae=>{T(AP()),T(si({handler:f,reactEvent:ae}))},[T,f]),ee=j.useCallback(ae=>{T(nC(ae)),T(si({handler:p,reactEvent:ae}))},[T,p]),J=j.useCallback(()=>{T(yL())},[T]),W=j.useCallback(ae=>{T(vL(ae.key))},[T]),R=j.useCallback(ae=>{T(si({handler:l,reactEvent:ae}))},[T,l]),O=j.useCallback(ae=>{T(si({handler:o,reactEvent:ae}))},[T,o]),q=j.useCallback(ae=>{T(si({handler:d,reactEvent:ae}))},[T,d]),z=j.useCallback(ae=>{T(si({handler:x,reactEvent:ae}))},[T,x]),X=j.useCallback(ae=>{T(si({handler:v,reactEvent:ae}))},[T,v]),re=j.useCallback(ae=>{C&&T(NL(ae)),T(si({handler:b,reactEvent:ae}))},[T,C,b]),le=j.useCallback(ae=>{T(si({handler:m,reactEvent:ae}))},[T,m]),ne=Mde(_);return j.createElement(FP.Provider,{value:B},j.createElement(Tq.Provider,{value:M},j.createElement(ne,{width:P??(y==null?void 0:y.width),height:G??(y==null?void 0:y.height),className:Lr("recharts-wrapper",a),style:Ede({position:"relative",cursor:"default",width:P,height:G},y),onClick:Q,onContextMenu:R,onDoubleClick:O,onFocus:J,onKeyDown:W,onMouseDown:q,onMouseEnter:Y,onMouseLeave:K,onMouseMove:ee,onMouseUp:z,onTouchEnd:le,onTouchMove:re,onTouchStart:X,ref:H},j.createElement(Tde,null),r)))}),Ode=["width","height","responsive","children","className","style","compact","title","desc"];function Pde(e,t){if(e==null)return{};var r,a,s=Lde(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 Lde(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 Qde=j.forwardRef((e,t)=>{var{width:r,height:a,responsive:s,children:i,className:l,style:o,compact:d,title:u,desc:f}=e,p=Pde(e,Ode),x=Wi(p);return d?j.createElement(j.Fragment,null,j.createElement(Pp,{width:r,height:a}),j.createElement(y6,{otherAttributes:x,title:u,desc:f},i)):j.createElement(Rde,{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},j.createElement(y6,{otherAttributes:x,title:u,desc:f,ref:t},j.createElement(Zle,null,i)))});function sC(){return sC=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},sC.apply(null,arguments)}var Hde={top:5,right:5,bottom:5,left:5},zde={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:Hde,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},$de=j.forwardRef(function(t,r){var a,s=Vs(t.categoricalChartProps,zde),{chartName:i,defaultTooltipEventType:l,validateTooltipEventTypes:o,tooltipPayloadSearcher:d,categoricalChartProps:u}=t,f={chartName:i,defaultTooltipEventType:l,validateTooltipEventTypes:o,tooltipPayloadSearcher:d,eventEmitter:void 0};return j.createElement(xde,{preloadedState:{options:f},reduxStoreName:(a=u.id)!==null&&a!==void 0?a:i},j.createElement(Gle,{chartData:u.data}),j.createElement(gde,{layout:s.layout,margin:s.margin}),j.createElement(bde,{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}),j.createElement(Qde,sC({},s,{ref:r})))}),Vde=["axis"],zj=j.forwardRef((e,t)=>j.createElement($de,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Vde,tooltipPayloadSearcher:bse,categoricalChartProps:e,ref:t}));const N6=({user:e,onNavigate:t})=>{var F,M;const{maintenance:r,refreshData:a,financialTotals:s}=mt(),[i,l]=j.useState(null),[o,d]=j.useState([]),[u,f]=j.useState([]),[p,x]=j.useState(!0),[m,b]=j.useState(null),[v,y]=j.useState(!1),[k,_]=j.useState({president:"",secretary:"",treasurer:"",nextAssembly:"S/A"}),C=["admin","programmer","board"].includes(e.role),E=async()=>{x(!0),b(null);try{const[U,D,L]=await Promise.all([ve.getDashboardStats(),ve.getAnnouncements(),ve.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"}),C){const P=await ve.getCriticalBills();f(P||[])}}catch(U){console.error("Error loading dashboard",U),b(U.message||"Error al cargar datos del panel.")}finally{x(!1)}};j.useEffect(()=>{E();const U=setTimeout(()=>y(!0),200);return()=>clearTimeout(U)},[e.role,C]);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=((M=(F=e==null?void 0:e.fullName)==null?void 0:F.split(" "))==null?void 0:M[0])||"Usuario";return n.jsxs("div",{className:"space-y-6 sm:space-y-8 animate-in fade-in duration-700",children:[C&&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(tK,{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(af,{title:"Recaudado",value:`$${((i==null?void 0:i.totalCollection)??0).toLocaleString()}`,icon:kn,color:"blue",trend:"+12% mes"}),e.role==="programmer"&&n.jsx(af,{title:"Caja en Divisa",value:`$${((s==null?void 0:s.initialCashUsd)??0).toLocaleString(void 0,{minimumFractionDigits:2})}`,icon:Tc,color:"emerald",trend:"Efectivo"}),n.jsx(af,{title:"Fondo Reserva",value:`$ ${((s==null?void 0:s.reserveFundUsd)??0).toLocaleString(void 0,{maximumFractionDigits:0})}`,icon:ho,color:"indigo",trend:"Patrimonio"}),n.jsx(af,{title:"Fallas",value:T.toString(),icon:Yf,color:"amber",trend:"Tickets"}),n.jsx(af,{title:"Asamblea",value:k.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(Sk,{width:"100%",height:"100%",minWidth:0,children:n.jsxs(zj,{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(Zb,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),n.jsx(ev,{dataKey:"label",stroke:"#94a3b8",fontSize:10,fontStyle:"bold",axisLine:!1,tickLine:!1}),n.jsx(tv,{stroke:"#94a3b8",fontSize:10,fontStyle:"bold",axisLine:!1,tickLine:!1}),n.jsx(Tj,{cursor:{stroke:"#e2e8f0",strokeWidth:2},contentStyle:{backgroundColor:"#fff",border:"1px solid #e2e8f0",borderRadius:"15px",fontSize:"12px"}}),n.jsx(IA,{type:"monotone",dataKey:"total",stroke:"#cbd5e1",fill:"transparent",strokeWidth:2,strokeDasharray:"6 6"}),n.jsx(IA,{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:k.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:k.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:k.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(Oc,{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(g2,{color:"blue",icon:kn,title:"Pagar Recibo",desc:"Cargar comprobante",onClick:()=>t(e.role==="owner"?"properties":"view-fees")}),n.jsx(g2,{color:"indigo",icon:Wr,title:"Reservar Áreas",desc:"Cancha, Caney, Salón",onClick:()=>t("reservations")}),n.jsx(g2,{color:"slate",icon:Xd,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"})]})})]})},af=({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(rk,{size:10,className:"text-blue-600"}),n.jsx("span",{className:"text-[7px] sm:text-[10px] text-slate-600 font-bold whitespace-nowrap",children:s})]})})]})},g2=({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"})]})},Gde=({user:e})=>{const{fees:t,properties:r}=mt(),[a,s]=j.useState(null),[i,l]=j.useState(!0);j.useEffect(()=>{(async()=>{try{const m=await ve.getMyProperty(e.propertyCode||"");s(m)}catch(m){console.error("Error fetching property status",m)}finally{l(!1)}})()},[e.propertyCode]);const o=j.useMemo(()=>{if(!a)return null;for(const x of t){const m=x.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,x.month))} ${x.year}`}}return null},[t,a]),d=j.useMemo(()=>{const x=[];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=>{x.push({...v,feeName:`${new Intl.DateTimeFormat("es-ES",{month:"long"}).format(new Date(0,m.month))} ${m.year}`})})}),x.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(Lc,{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(Oc,{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((x,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:x.feeName}),n.jsx("p",{className:"text-sm sm:text-lg font-black text-slate-800 tracking-tight truncate uppercase",children:x.method}),n.jsxs("p",{className:"text-[8px] sm:text-[10px] text-slate-400 font-bold uppercase truncate",children:["REF: ",x.reference," • ",x.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(x.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(Tc,{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(Tc,{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;
        }
      `})]})},zc=(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)},Kde=({user:e})=>{const{transactions:t,refreshData:r,exchangeRateHistory:a,loading:s,financialTotals:i,properties:l}=mt(),[o,d]=j.useState(new Date().getMonth()),[u,f]=j.useState(new Date().getFullYear()),[p,x]=j.useState(""),[m,b]=j.useState(!1),[v,y]=j.useState(!1),[k,_]=j.useState(!1),[C,E]=j.useState(!1),[T,B]=j.useState(null),[F,M]=j.useState({income:1.5,expense:.3}),[U,D]=j.useState(!1),[L,P]=j.useState({type:"Ingreso",category:"Ingresos",date:Fr(),amountBs:0,description:"",reference:""}),[G,H]=j.useState({propertyId:"",amountBs:0,date:Fr(),reference:"",description:"ABONO DIRECTO A SALDO A FAVOR"});j.useEffect(()=>{(async()=>{const X=await ve.getSystemSettings();M({income:parseFloat(X.bank_comm_income||"1.5"),expense:parseFloat(X.bank_comm_expense||"0.3")})})()},[]);const Q=j.useMemo(()=>{if(!a||a.length===0)return 45;const z=a[0],X=Number(z.pmValue)>0?Number(z.pmValue):Number(z.amValue)>0?Number(z.amValue):45;return Number(X)},[a]),Y=z=>{if(!a||a.length===0)return 45;const X=a.find(ae=>ae.date===z);if(X)return Number(X.pmValue)>0?Number(X.pmValue):Number(X.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=j.useMemo(()=>t.reduce((z,X)=>{if(X.category==="Cierre/Apertura")return z;const re=Number(X.amountBs)||0;return X.type==="Ingreso"?z+re:z-re},0),[t]),ee=j.useMemo(()=>t.filter(z=>{var ae;const[X,re]=z.date.split("-").map(Number),le=X===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,X)=>new Date(X.date).getTime()-new Date(z.date).getTime()),[t,o,u,p]),J=async z=>{z.preventDefault(),D(!0);try{const X=Y(L.date||Fr()),re={...L,amount:(Number(L.amountBs)||0)/X,commissionsConfig:F},le=await fetch(`${ye}/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:Fr(),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)}},W=async()=>{if(!L.amountBs||L.amountBs<=0){alert("Por favor ingrese un monto de apertura válido.");return}D(!0);try{const z=Y(L.date||Fr()),X={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(`${ye}/save_bank_transaction.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(X)});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)}},R=async z=>{try{(await fetch(`${ye}/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 X=Y(G.date||Fr()),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)/X,type:"Ingreso",category:"Ingresos",reference:G.reference,propertyId:parseInt(G.propertyId),isCredit:!0,commissionsConfig:F},ne=await fetch(`${ye}/save_bank_transaction.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(le)});if(ne.ok)await r(),E(!1),H({propertyId:"",amountBs:0,date:Fr(),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 ve.updateSystemSetting("bank_comm_income",String(F.income)),await ve.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)/Q).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(Q).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(gs,{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(Ha,{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:_e.map((z,X)=>n.jsx("option",{value:X,children:z},X))}),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=>x(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"],X=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})}`]);zc("Estado de Cuenta Bancario",z,X)},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(Nt,{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 X=Y(z.date),re=Number(z.amountBs)/Number(X);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(Ab,{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(X).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:()=>R(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(xt,{size:24})})]}),n.jsxs("form",{onSubmit:J,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)/Y(L.date||Fr())).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(xt,{})})]}),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=>M({...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=>M({...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"})]})]})}),k&&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(xt,{})})]}),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:W,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"})]})]})}),C&&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(xt,{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=>H({...G,propertyId:z.target.value}),children:[n.jsx("option",{value:"",children:"Seleccione Unidad"}),l.sort((z,X)=>z.code.localeCompare(X.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=>H({...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=>H({...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=>H({...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=>H({...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(gs,{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})},Ig=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},qde=()=>{const{properties:e,residents:t}=mt(),r=j.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"})]})},Wde=({onCancel:e,existingFee:t,onTabChange:r})=>{const{addFee:a,exchangeRateHistory:s,properties:i,refreshData:l}=mt(),[o,d]=j.useState(!1),[u,f]=j.useState(!1),p=()=>{if(!s||s.length===0)return 45.5;const R=s[0];return Number(R.pmValue)>0?Number(R.pmValue):Number(R.amValue)},[x,m]=j.useState((t==null?void 0:t.month)??new Date().getMonth()),[b,v]=j.useState((t==null?void 0:t.year)??new Date().getFullYear()),[y,k]=j.useState((t==null?void 0:t.exchangeRate)??p()),_=R=>Array(R).fill(null).map(()=>({description:"",amountUsd:0,isUncommon:!1,isSpecial:!1,specialPropertyIds:[]})),[C,E]=j.useState(t?[...t.fixedExpenses,..._(Math.max(0,20-t.fixedExpenses.length))]:_(20)),[T,B]=j.useState(t?[...t.variableExpenses,..._(Math.max(0,15-t.variableExpenses.length))]:_(15)),[F,M]=j.useState(t?[...t.otherExpenses,..._(Math.max(0,8-t.otherExpenses.length))]:_(8)),[U,D]=j.useState((t==null?void 0:t.reserveFundPercent)??10),L=async()=>{f(!0);try{const O=await(await fetch(`${ye}/get_prefill_expenses.php?month=${x}&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"),X=O.filter(re=>re.category==="other");E([...q,..._(Math.max(0,20-q.length))]),B([...z,..._(Math.max(0,15-z.length))]),M([...X,..._(Math.max(0,8-X.length))]),alert(`¡Importación Exitosa! Se cargaron ${O.length} conceptos.`)}}catch{alert("Error al importar datos.")}finally{f(!1)}},P=(R,O,q,z,X)=>{const re=[...z];re[R]={...re[R],[O]:q},X(re)},G=(R,O,q,z)=>{const X=[...q],re=X[R].specialPropertyIds||[];re.includes(O)?X[R].specialPropertyIds=re.filter(le=>le!==O):X[R].specialPropertyIds=[...re,O],z(X)},H=R=>R.reduce((O,q)=>O+(Number(q.amountUsd)||0),0),Q=Number(H(C))+Number(H(T))+Number(H(F)),Y=Number(Q)*(Number(U)/100),K=Number(Q)+Number(Y),ee=Number(K)*Number(y),J=async()=>{if(Math.abs(K)<.01&&K!==0){alert("Monto total inválido.");return}if(confirm(`¿Generar cuota para ${_e[x]} ${b}?`)){d(!0);try{await a({id:(t==null?void 0:t.id)||`fee-${x}-${b}-${Date.now()}`,month:x,year:b,exchangeRate:y,fixedExpenses:C.filter(R=>R.description&&Number(R.amountUsd)!==0),variableExpenses:T.filter(R=>R.description&&Number(R.amountUsd)!==0),otherExpenses:F.filter(R=>R.description&&Number(R.amountUsd)!==0),reserveFundPercent:U,totalUsd:K,totalBs:ee,status:"Generada",createdAt:(t==null?void 0:t.createdAt)||Fr()}),alert("¡Facturación Generada con Éxito!"),r?r("view-fees"):e()}catch(R){alert("Error: "+R.message)}finally{d(!1)}}},W=j.useMemo(()=>[...i].sort((R,O)=>R.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(gi,{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(xt,{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:x,onChange:R=>m(Number(R.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:_e.map((R,O)=>n.jsx("option",{value:O,children:R},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:R=>v(Number(R.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:R=>k(Number(R.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:R=>D(Number(R.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 R=[...C];R[0].specialPropertyIds=i.map(O=>O.id),E(R)},className:"hidden",children:"Trigger"}),n.jsxs("button",{disabled:o,onClick:J,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:C,setter:E},{title:"Gastos Variables",data:T,setter:B},{title:"Otros Gastos",data:F,setter:M}].map((R,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:R.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:R.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:X=>P(z,"description",X.target.value,R.data,R.setter)}),n.jsx("div",{className:"w-10 flex justify-center",children:n.jsx("button",{type:"button",onClick:()=>P(z,"isUncommon",!q.isUncommon,R.data,R.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(Lc,{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,R.data,R.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(ub,{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:X=>P(z,"amountUsd",Number(X.target.value),R.data,R.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(ck,{size:14})," Seleccionar Unidades"]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{type:"button",onClick:()=>{const X=[...R.data];X[z].specialPropertyIds=i.map(re=>re.id),R.setter(X)},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",[],R.data,R.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:W.map(X=>{var le;const re=(le=q.specialPropertyIds)==null?void 0:le.includes(X.id);return n.jsx("button",{type:"button",onClick:()=>G(z,X.id,R.data,R.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:X.code},X.id)})})]})]},z))})]},O))})]})},Yde=({user:e,onEdit:t,onTabChange:r})=>{const{fees:a,deleteFee:s,exchangeRateHistory:i,properties:l}=mt(),[o,d]=j.useState(null),u=["admin","programmer","board"].includes(e.role),f=j.useMemo(()=>{if(!i||i.length===0)return 45;const x=i[0];return Number(x.pmValue)>0?Number(x.pmValue):Number(x.amValue)},[i]),p=j.useMemo(()=>a.find(x=>x.id===o)||null,[a,o]);return p?n.jsx(eue,{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(qde,{}),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(x=>{const m=Number(x.totalUsd)||0,b=(x.debts||[]).reduce((y,k)=>y+(Number(k.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:x.year}),n.jsx("span",{className:"font-black text-slate-800 text-lg uppercase tracking-tight",children:_e[x.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. ",Ig(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(x.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(x.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(_c,{size:18})}),u&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>t(x),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(vl,{size:18})}),n.jsx("button",{onClick:()=>{confirm("¿Eliminar?")&&s(x.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})})]})]})})]},x.id)})})]})})})]})},C6=({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:x}=mt(),[m,b]=j.useState(l?(Number(l.amount)*(l.appliedRate||r)).toString():""),[v,y]=j.useState((l==null?void 0:l.method)||"Transferencia Bancaria"),[k,_]=j.useState("pm"),[C,E]=j.useState((l==null?void 0:l.reference)||""),[T,B]=j.useState((l==null?void 0:l.date)||Fr()),[F,M]=j.useState(!1),[U,D]=j.useState(null),[L,P]=j.useState(!1),G=async R=>{if(!(!R||R==="S/R"||R.length<3))try{const q=await(await fetch(`${ye}/check_duplicate_reference.php?reference=${R}`,{credentials:"include"})).json();q.duplicate?D(q):D(null)}catch(O){console.error("Error checking duplicate",O)}},H=j.useMemo(()=>x.find(R=>R.id===t),[x,t]),Q=Number((H==null?void 0:H.initialDebt)||0),Y=Number((H==null?void 0:H.creditBalance)||0),K=j.useMemo(()=>{const R=f.find(q=>q.date===T);if(!R)return Number(r);if(k==="parallel")return Number(R.parallelValue)||Number(r);if(k==="am")return Number(R.amValue)||Number(R.pmValue)||Number(r);const O=Number(R.pmValue)>0?R.pmValue:R.amValue;return Number(O)||Number(r)},[T,f,r,k]),ee=Number(m)>0?Number(m)/Number(K):0,J=Math.max(0,ee-a),W=async R=>{if(R.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(!C&&v!=="Efectivo / Divisa"){alert("Referencia obligatoria.");return}M(!0);try{if(i&&!l){const q=await fetch(`${ye}/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:C||"EFECTIVO",date:T,slot:k})}),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:C||"EFECTIVO",date:T,slot:k}),alert("¡Pago Actualizado con Éxito!")):(await d(e,t,Number(ee.toFixed(2)),v,C||"EFECTIVO",T,k,O),alert("¡Pago Registrado Directamente!"));o()}catch(q){alert("ERROR: "+(q.message||"Fallo de red."))}finally{M(!1)}};return n.jsxs("form",{onSubmit:W,className:"space-y-6",children:[n.jsxs("div",{className:"space-y-3",children:[Q>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:["$",Q.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"})]}),Y>0&&n.jsxs("div",{className:"flex items-center gap-3 p-4 bg-blue-50 border border-blue-100 rounded-2xl",children:[n.jsx(Lc,{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: $",Y.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 ${k==="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 ${k==="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 ${k==="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:R=>b(R.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:R=>B(R.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 ${J>0?"bg-emerald-50 border-emerald-100":"bg-slate-50 border-slate-100"}`,children:[n.jsx("span",{className:`text-[8px] font-black uppercase block ${J>0?"text-emerald-400":"text-slate-400"}`,children:"Excedente"}),n.jsxs("span",{className:`text-sm font-black ${J>0?"text-emerald-700":"text-slate-400"}`,children:["$",sr(J)]})]})]})]})]}),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:C,onChange:R=>{const O=R.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((R,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:["[",R.source,"]"]})," ",R.detail," - ",R.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:R=>P(R.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:R=>y(R.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"]})]})},Xde=({feeId:e,propertyId:t,feeRate:r,onSuccess:a})=>{const{exchangeRateHistory:s,refreshData:i}=mt(),[l,o]=j.useState(""),[d,u]=j.useState(""),[f,p]=j.useState("pm"),[x,m]=j.useState(Fr()),[b,v]=j.useState(""),[y,k]=j.useState(!1),[_,C]=j.useState(!1),E=Tp.useMemo(()=>{const F=s.find(U=>U.date===x);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 M=Number(F.pmValue)>0?F.pmValue:F.amValue;return Number(M)||Number(r)},[x,s,r,f]),T=_?Number(l)>0?Number(l)/Number(E):0:Number(d),B=async F=>{F.preventDefault();const M=Number(T.toFixed(2));if(M<=0){alert("Monto inválido.");return}k(!0);try{const U=await fetch(`${ye}/add_extra_charge.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:e,propertyId:t,amount:M,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{k(!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:()=>C(!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:()=>C(!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:x,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(cb,{size:24})," AGREGAR CARGO EXTRA"]})]})},Jde=({fee:e,user:t,onBack:r})=>{const{properties:a,financialTotals:s,latestRate:i}=mt(),l=["admin","programmer","board"].includes(t.role),o=t.propertyId,d=j.useMemo(()=>a.find(_=>_.id===o),[a,o]),u=Number(d==null?void 0:d.aliquot)||0,f=!!(d!=null&&d.hasUncommonExpense),p=j.useMemo(()=>a.filter(_=>_.hasUncommonExpense).length,[a]),x=j.useMemo(()=>{const _=C=>{var F,M;const E=Number(C.amountUsd)||0;let T=0,B="";if(l)T=E,B="GLOBAL";else if(C.isSpecial){const U=((F=C.specialPropertyIds)==null?void 0:F.length)||1,D=(M=C.specialPropertyIds)==null?void 0:M.includes(o);T=D?E/U:0,B=D?`ESP (1/${U})`:"Exento"}else C.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{...C,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=x.reduce((_,C)=>_+C.items.reduce((E,T)=>E+T.myPortion,0),0),b=x.reduce((_,C)=>_+C.items.reduce((E,T)=>E+T.global,0),0),v=Number(e.reserveFundPercent)||10,y=m*(v/100),k=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(ms,{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(Nt,{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:[_e[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. ",Ig((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:x.map((_,C)=>{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(ub,{size:12,className:"text-amber-500 no-print"}):T.isUncommon?n.jsx(Lc,{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)]})]})]})]})})]},C)})}),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):k)]})]}),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. ",Ig((l?b*(1+v/100):k)*Number(l?e.exchangeRate:i))]})]}),n.jsx(Ki,{size:32,className:"text-blue-400 opacity-50 print:w-6 print:h-6"})]})]}),n.jsx(Dp,{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"})})]})},Zde=({debt:e,property:t,onClose:r})=>{const{residents:a,users:s,latestRate:i}=mt(),[l,o]=j.useState(null),d=e.payments||[],u=d.reduce((_,C)=>_+Number(C.amount),0),f=Number(e.amountUsd),p=f-u,x=u>=f,m=j.useMemo(()=>{if(!t)return null;const _=a.find(E=>E.propertyId===t.id&&E.isOwner),C=s.find(E=>E.cedula===(_==null?void 0:_.cedula));return{fullName:(_==null?void 0:_.fullName)||"Propietario",email:(C==null?void 0:C.email)||"",phone:(_==null?void 0:_.phone)||(C==null?void 0:C.phone)||"",telegramId:(C==null?void 0:C.telegramChatId)||"",propertyCode:t.code}},[t,a,s]),b=_=>{if(!_)return"";let C=_.trim();return C.startsWith("+")?C.replace(/\D/g,""):C.startsWith("0")?"58"+C.substring(1).replace(/\D/g,""):C.length===10?"58"+C.replace(/\D/g,""):C.replace(/\D/g,"")},v=()=>{if(!t||!e)return"";const _=x?"✅ SOLVENTE":"⚠️ PAGO PARCIAL",C=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:* ${_}
`+C+`------------------------------------------
Fecha de Emisión: ${new Date().toLocaleDateString()}

¡Gracias por su compromiso!`},y=async _=>{if(!m||!t||!e)return;const C=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(C)}`,"_blank");return}if(_==="share"){if(navigator.share)try{await navigator.share({title:`Recibo de Pago - ${t.code}`,text:C.replace(/\*/g,""),url:Mr})}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:x?"Solvente":"Parcial",balance:sr(p)}]},B=await(await fetch(`${ye}/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)}},k=()=>{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(xt,{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((_,C)=>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)]})]},C))]})]}),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(Nt,{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(rn,{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(Sl,{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(Pr,{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(ya,{size:20})})]}),n.jsxs("button",{onClick:k,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(db,{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."})})]})})},eue=({fee:e,user:t,onBack:r})=>{var P,G,H,Q,Y,K,ee,J,W;const{properties:a,residents:s,users:i,deletePayment:l,refreshData:o}=mt(),[d,u]=j.useState("debts"),[f,p]=j.useState(null),[x,m]=j.useState(null),[b,v]=j.useState(null),[y,k]=j.useState(!1),[_,C]=j.useState(null),[E,T]=j.useState(null),B=["admin","programmer","board"].includes(t.role),[F,M]=j.useState(!1),U=async R=>{k(!0);try{const O=await fetch(`${ye}/approve_payment.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:e.id,propertyId:R.propertyId})});if(O.ok)alert("¡Pago Validado y Registrado en el Sistema!"),await o(),C(null);else{const q=await O.json();alert("Error: "+q.error)}}catch{alert("Fallo de conexión.")}finally{k(!1)}},D=async R=>{const O=prompt("Indique el motivo del rechazo para que el propietario pueda corregirlo:","Comprobante no coincide con el banco.");if(O!==null){k(!0);try{(await fetch(`${ye}/reject_payment.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feeId:e.id,propertyId:R.propertyId,reason:O})})).ok&&(alert("Reporte rechazado. El propietario será notificado."),await o(),C(null))}catch{alert("Fallo de conexión.")}finally{k(!1)}}};if(d==="breakdown")return n.jsx(Jde,{fee:e,user:t,onBack:()=>u("debts")});const L=[...e.debts||[]].sort((R,O)=>{var X,re;const q=((X=a.find(le=>le.id===R.propertyId))==null?void 0:X.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(ms,{size:16})," Volver al Listado"]}),n.jsx("button",{onClick:()=>{const R=["Unidad","Propietario","Monto $","Pagado $","Pendiente $","Estatus"],O=L.map(q=>{const z=a.find(le=>le.id===q.propertyId),X=s.find(le=>le.propertyId===q.propertyId&&le.isOwner),re=Number(q.amountUsd)-Number(q.paidAmount);return[(z==null?void 0:z.code)||"",(X==null?void 0:X.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"]});zc(`Monitor de Cobranza - ${_e[e.month]} ${e.year}`,R,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(Nt,{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(Pc,{size:18})," Ver Relación de Gastos"]})]}),n.jsxs("div",{className:`bg-white rounded-[3rem] border border-slate-200 shadow-sm overflow-hidden ${x?"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: ",_e[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(R=>{const O=a.find(re=>re.id===R.propertyId),q=s.find(re=>re.propertyId===R.propertyId&&re.isOwner),z=R.pendingPayment!==null,X=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(R.amountUsd)]}),(R.paidAmount||0)>0&&R.status!=="Pagado"&&n.jsxs("span",{className:"text-[9px] font-black text-amber-600 uppercase tracking-tighter",children:["Pendiente: $",sr(R.amountUsd-(R.paidAmount||0))]}),Number(R.previousDebt)>0&&Number(R.paidAmount)<Number(R.previousDebt)&&n.jsxs("span",{className:"text-[9px] font-black text-rose-600 uppercase tracking-tighter",children:["Deuda Ant: $",sr(Number(R.previousDebt)-Number(R.paidAmount))]})]})}),n.jsxs("td",{className:"px-8 py-6 text-right font-mono font-black text-slate-800 text-lg",children:["$",sr(R.amountUsd),X&&R.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 ${R.status==="Pagado"?"bg-emerald-50 text-emerald-600 border-emerald-100":R.status==="Parcial"?"bg-amber-50 text-amber-600 border-amber-100":"bg-red-50 text-red-600 border-red-100"}`,children:R.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:()=>C(R),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(Vf,{size:18})," REVISAR"]})}),!z&&n.jsxs("div",{className:"flex justify-end gap-2",children:[R.payments&&R.payments.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:()=>m(R),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({...R,payment:R.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(vl,{size:18})}),n.jsx("button",{onClick:()=>{confirm("¿Anular pago?")&&l(R.payments[R.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(R),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(Ip,{size:18})}),n.jsx("button",{onClick:()=>T(R),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(cb,{size:18})})]})]})]})})]},R.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(Vf,{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(R=>R.id===_.propertyId))==null?void 0:P.code]})]})]}),n.jsx("button",{onClick:()=>C(null),className:"p-2 bg-slate-100 rounded-full hover:bg-red-500 hover:text-white transition-all",children:n.jsx(xt,{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. ",Ig((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((H=_.pendingPayment)==null?void 0:H.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:["#",(Q=_.pendingPayment)==null?void 0:Q.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:(Y=_.pendingPayment)==null?void 0:Y.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(iq,{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(R=>R.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(xt,{size:24})})]}),n.jsx(C6,{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: ",(J=a.find(R=>R.id===b.propertyId))==null?void 0:J.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(xt,{size:24})})]}),n.jsx(C6,{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)})]})}),x&&n.jsx(Zde,{debt:x,property:a.find(R=>R.id===x.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(xt,{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: ",(W=a.find(R=>R.id===E.propertyId))==null?void 0:W.code]})]}),n.jsx(Xde,{feeId:e.id,propertyId:E.propertyId,feeRate:Number(e.exchangeRate),onSuccess:()=>T(null)})]})})]})},k6=({user:e,viewMode:t,onTabChange:r})=>{const[a,s]=j.useState(t),[i,l]=j.useState();return j.useEffect(()=>{s(t)},[t]),a==="generate"?n.jsx(Wde,{onCancel:()=>s("list"),existingFee:i,onTabChange:r}):n.jsx(Yde,{user:e,onEdit:o=>{l(o),s("generate")},onTabChange:r})};var nf={exports:{}},b2={},v2,j6;function tue(){if(j6)return v2;j6=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 v2=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},v2}var E6;function rue(){return E6||(E6=1,(function(e){var t=tue();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),x=Array.prototype.slice.call(arguments,1),m=x.pop();x.push(function(b){p.retry(b)||(b&&(arguments[0]=p.mainError()),m.apply(this,arguments))}),p.attempt(function(){f.apply(r,x)})}).bind(r,d),r[o].options=a}}})(b2)),b2}var y2,S6;function aue(){return S6||(S6=1,y2=rue()),y2}var B6;function nue(){if(B6)return nf.exports;B6=1;const e=aue(),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(x){if(!(x instanceof Error)){u(new TypeError(`Non-error was thrown: "${x}". You should only throw errors.`));return}if(x instanceof r)f.stop(),u(x.originalError);else if(x instanceof TypeError&&!s(x.message))f.stop(),u(x);else{a(x,p,o);try{await o.onFailedAttempt(x)}catch(m){u(m);return}f.retry(x)||u(f.mainError())}}})});return nf.exports=i,nf.exports.default=i,nf.exports.AbortError=r,nf.exports}var kL=nue();const sue=El(kL);var iue={};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */let lue,oue;function cue(){return{geminiUrl:lue,vertexUrl:oue}}function due(e,t,r,a){var s,i;if(!(e!=null&&e.baseUrl)){const l=cue();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 Do{}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 N(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];N(f,t.slice(i+1),r[u])}else for(const u of d)N(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];N(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 uue(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)}iC(e,s,i,0,l)}}function iC(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])iC(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 x of r.slice(a))x==="*"?p.push(u):p.push(x);N(l,p,f)}for(const u of o)delete l[u]}}else{const l=e;i in l&&iC(l[i],t,r,a+1,s)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function $j(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 Aue(e){const t={},r=w(e,["operationName"]);r!=null&&N(t,["operationName"],r);const a=w(e,["resourceName"]);return a!=null&&N(t,["_url","resourceName"],a),t}function fue(e){const t={},r=w(e,["name"]);r!=null&&N(t,["name"],r);const a=w(e,["metadata"]);a!=null&&N(t,["metadata"],a);const s=w(e,["done"]);s!=null&&N(t,["done"],s);const i=w(e,["error"]);i!=null&&N(t,["error"],i);const l=w(e,["response","generateVideoResponse"]);return l!=null&&N(t,["response"],hue(l)),t}function pue(e){const t={},r=w(e,["name"]);r!=null&&N(t,["name"],r);const a=w(e,["metadata"]);a!=null&&N(t,["metadata"],a);const s=w(e,["done"]);s!=null&&N(t,["done"],s);const i=w(e,["error"]);i!=null&&N(t,["error"],i);const l=w(e,["response"]);return l!=null&&N(t,["response"],xue(l)),t}function hue(e){const t={},r=w(e,["generatedSamples"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(l=>mue(l))),N(t,["generatedVideos"],i)}const a=w(e,["raiMediaFilteredCount"]);a!=null&&N(t,["raiMediaFilteredCount"],a);const s=w(e,["raiMediaFilteredReasons"]);return s!=null&&N(t,["raiMediaFilteredReasons"],s),t}function xue(e){const t={},r=w(e,["videos"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(l=>gue(l))),N(t,["generatedVideos"],i)}const a=w(e,["raiMediaFilteredCount"]);a!=null&&N(t,["raiMediaFilteredCount"],a);const s=w(e,["raiMediaFilteredReasons"]);return s!=null&&N(t,["raiMediaFilteredReasons"],s),t}function mue(e){const t={},r=w(e,["video"]);return r!=null&&N(t,["video"],Cue(r)),t}function gue(e){const t={},r=w(e,["_self"]);return r!=null&&N(t,["video"],kue(r)),t}function bue(e){const t={},r=w(e,["operationName"]);return r!=null&&N(t,["_url","operationName"],r),t}function vue(e){const t={},r=w(e,["operationName"]);return r!=null&&N(t,["_url","operationName"],r),t}function yue(e){const t={},r=w(e,["name"]);r!=null&&N(t,["name"],r);const a=w(e,["metadata"]);a!=null&&N(t,["metadata"],a);const s=w(e,["done"]);s!=null&&N(t,["done"],s);const i=w(e,["error"]);i!=null&&N(t,["error"],i);const l=w(e,["response"]);return l!=null&&N(t,["response"],wue(l)),t}function wue(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["parent"]);a!=null&&N(t,["parent"],a);const s=w(e,["documentName"]);return s!=null&&N(t,["documentName"],s),t}function jL(e){const t={},r=w(e,["name"]);r!=null&&N(t,["name"],r);const a=w(e,["metadata"]);a!=null&&N(t,["metadata"],a);const s=w(e,["done"]);s!=null&&N(t,["done"],s);const i=w(e,["error"]);i!=null&&N(t,["error"],i);const l=w(e,["response"]);return l!=null&&N(t,["response"],Nue(l)),t}function Nue(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["parent"]);a!=null&&N(t,["parent"],a);const s=w(e,["documentName"]);return s!=null&&N(t,["documentName"],s),t}function Cue(e){const t={},r=w(e,["uri"]);r!=null&&N(t,["uri"],r);const a=w(e,["encodedVideo"]);a!=null&&N(t,["videoBytes"],$j(a));const s=w(e,["encoding"]);return s!=null&&N(t,["mimeType"],s),t}function kue(e){const t={},r=w(e,["gcsUri"]);r!=null&&N(t,["uri"],r);const a=w(e,["bytesBase64Encoded"]);a!=null&&N(t,["videoBytes"],$j(a));const s=w(e,["mimeType"]);return s!=null&&N(t,["mimeType"],s),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var _6;(function(e){e.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",e.OUTCOME_OK="OUTCOME_OK",e.OUTCOME_FAILED="OUTCOME_FAILED",e.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(_6||(_6={}));var T6;(function(e){e.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",e.PYTHON="PYTHON"})(T6||(T6={}));var I6;(function(e){e.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",e.SILENT="SILENT",e.WHEN_IDLE="WHEN_IDLE",e.INTERRUPT="INTERRUPT"})(I6||(I6={}));var bc;(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"})(bc||(bc={}));var F6;(function(e){e.API_SPEC_UNSPECIFIED="API_SPEC_UNSPECIFIED",e.SIMPLE_SEARCH="SIMPLE_SEARCH",e.ELASTIC_SEARCH="ELASTIC_SEARCH"})(F6||(F6={}));var D6;(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"})(D6||(D6={}));var U6;(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"})(U6||(U6={}));var M6;(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"})(M6||(M6={}));var R6;(function(e){e.UNSPECIFIED="UNSPECIFIED",e.BLOCKING="BLOCKING",e.NON_BLOCKING="NON_BLOCKING"})(R6||(R6={}));var O6;(function(e){e.MODE_UNSPECIFIED="MODE_UNSPECIFIED",e.MODE_DYNAMIC="MODE_DYNAMIC"})(O6||(O6={}));var P6;(function(e){e.MODE_UNSPECIFIED="MODE_UNSPECIFIED",e.AUTO="AUTO",e.ANY="ANY",e.NONE="NONE",e.VALIDATED="VALIDATED"})(P6||(P6={}));var L6;(function(e){e.THINKING_LEVEL_UNSPECIFIED="THINKING_LEVEL_UNSPECIFIED",e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH",e.MINIMAL="MINIMAL"})(L6||(L6={}));var Q6;(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"})(Q6||(Q6={}));var H6;(function(e){e.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",e.SEVERITY="SEVERITY",e.PROBABILITY="PROBABILITY"})(H6||(H6={}));var z6;(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"})(z6||(z6={}));var $6;(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"})($6||($6={}));var V6;(function(e){e.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",e.NEGLIGIBLE="NEGLIGIBLE",e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH"})(V6||(V6={}));var G6;(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"})(G6||(G6={}));var K6;(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"})(K6||(K6={}));var q6;(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"})(q6||(q6={}));var W6;(function(e){e.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",e.ON_DEMAND="ON_DEMAND",e.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(W6||(W6={}));var Fg;(function(e){e.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",e.TEXT="TEXT",e.IMAGE="IMAGE",e.AUDIO="AUDIO"})(Fg||(Fg={}));var Y6;(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"})(Y6||(Y6={}));var X6;(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"})(X6||(X6={}));var J6;(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"})(J6||(J6={}));var lC;(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"})(lC||(lC={}));var Z6;(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"})(Z6||(Z6={}));var e3;(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"})(e3||(e3={}));var oC;(function(e){e.COLLECTION="COLLECTION"})(oC||(oC={}));var t3;(function(e){e.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",e.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",e.BALANCED="BALANCED",e.PRIORITIZE_COST="PRIORITIZE_COST"})(t3||(t3={}));var r3;(function(e){e.ENVIRONMENT_UNSPECIFIED="ENVIRONMENT_UNSPECIFIED",e.ENVIRONMENT_BROWSER="ENVIRONMENT_BROWSER"})(r3||(r3={}));var Dg;(function(e){e.PREDICT="PREDICT",e.EMBED_CONTENT="EMBED_CONTENT"})(Dg||(Dg={}));var a3;(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"})(a3||(a3={}));var n3;(function(e){e.DONT_ALLOW="DONT_ALLOW",e.ALLOW_ADULT="ALLOW_ADULT",e.ALLOW_ALL="ALLOW_ALL"})(n3||(n3={}));var s3;(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"})(s3||(s3={}));var i3;(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"})(i3||(i3={}));var l3;(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"})(l3||(l3={}));var o3;(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"})(o3||(o3={}));var c3;(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"})(c3||(c3={}));var d3;(function(e){e.FOREGROUND="FOREGROUND",e.BACKGROUND="BACKGROUND",e.PROMPT="PROMPT",e.SEMANTIC="SEMANTIC",e.INTERACTIVE="INTERACTIVE"})(d3||(d3={}));var u3;(function(e){e.ASSET="ASSET",e.STYLE="STYLE"})(u3||(u3={}));var A3;(function(e){e.INSERT="INSERT",e.REMOVE="REMOVE",e.REMOVE_STATIC="REMOVE_STATIC",e.OUTPAINT="OUTPAINT"})(A3||(A3={}));var f3;(function(e){e.OPTIMIZED="OPTIMIZED",e.LOSSLESS="LOSSLESS"})(f3||(f3={}));var p3;(function(e){e.SUPERVISED_FINE_TUNING="SUPERVISED_FINE_TUNING",e.PREFERENCE_TUNING="PREFERENCE_TUNING",e.DISTILLATION="DISTILLATION"})(p3||(p3={}));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 x3;(function(e){e.STATE_UNSPECIFIED="STATE_UNSPECIFIED",e.PROCESSING="PROCESSING",e.ACTIVE="ACTIVE",e.FAILED="FAILED"})(x3||(x3={}));var m3;(function(e){e.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",e.UPLOADED="UPLOADED",e.GENERATED="GENERATED",e.REGISTERED="REGISTERED"})(m3||(m3={}));var g3;(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"})(g3||(g3={}));var b3;(function(e){e.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",e.TEXT="TEXT",e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.AUDIO="AUDIO",e.DOCUMENT="DOCUMENT"})(b3||(b3={}));var v3;(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"})(v3||(v3={}));var y3;(function(e){e.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",e.ACTIVITY_START="ACTIVITY_START",e.ACTIVITY_END="ACTIVITY_END"})(y3||(y3={}));var w3;(function(e){e.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",e.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",e.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(w3||(w3={}));var N3;(function(e){e.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",e.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",e.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(N3||(N3={}));var C3;(function(e){e.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",e.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",e.NO_INTERRUPTION="NO_INTERRUPTION"})(C3||(C3={}));var k3;(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"})(k3||(k3={}));var j3;(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"})(j3||(j3={}));var E3;(function(e){e.MUSIC_GENERATION_MODE_UNSPECIFIED="MUSIC_GENERATION_MODE_UNSPECIFIED",e.QUALITY="QUALITY",e.DIVERSITY="DIVERSITY",e.VOCALIZATION="VOCALIZATION"})(E3||(E3={}));var AA;(function(e){e.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",e.PLAY="PLAY",e.PAUSE="PAUSE",e.STOP="STOP",e.RESET_CONTEXT="RESET_CONTEXT"})(AA||(AA={}));class cC{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 sf{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 x 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(x))m!=="text"&&m!=="thought"&&m!=="thoughtSignature"&&(b!==null||b!==void 0)&&p.push(m);if(typeof x.text=="string"){if(typeof x.thought=="boolean"&&x.thought)continue;f=!0,u+=x.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[x,m]of Object.entries(p))x!=="inlineData"&&(m!==null||m!==void 0)&&f.push(x);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 S3{}class B3{}class jue{}class Eue{}class Sue{}class Bue{}class _3{}class T3{}class I3{}class _ue{}class Ug{_fromAPIResponse({apiResponse:t,_isVertexAI:r}){const a=new Ug;let s;const i=t;return r?s=pue(i):s=fue(i),Object.assign(a,s),a}}class F3{}class D3{}class U3{}class M3{}class Tue{}class Iue{}class Fue{}class Vj{_fromAPIResponse({apiResponse:t,_isVertexAI:r}){const a=new Vj,i=yue(t);return Object.assign(a,i),a}}class Due{}class Uue{}class Mue{}class Rue{}class R3{}class Oue{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 Pue{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}}class Gj{_fromAPIResponse({apiResponse:t,_isVertexAI:r}){const a=new Gj,i=jL(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 EL(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 SL(e){return Array.isArray(e)?e.map(t=>Mg(t)):[Mg(e)]}function Mg(e){if(typeof e=="object"&&e!==null)return e;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof e}`)}function BL(e){const t=Mg(e);if(t.mimeType&&t.mimeType.startsWith("image/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function _L(e){const t=Mg(e);if(t.mimeType&&t.mimeType.startsWith("audio/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function O3(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 TL(e){if(e==null||Array.isArray(e)&&e.length===0)throw new Error("PartListUnion is required");return Array.isArray(e)?e.map(t=>O3(t)):[O3(e)]}function dC(e){return e!=null&&typeof e=="object"&&"parts"in e&&Array.isArray(e.parts)}function P3(e){return e!=null&&typeof e=="object"&&"functionCall"in e}function L3(e){return e!=null&&typeof e=="object"&&"functionResponse"in e}function en(e){if(e==null)throw new Error("ContentUnion is required");return dC(e)?e:{role:"user",parts:TL(e)}}function Kj(e,t){if(!t)return[];if(e.isVertexAI()&&Array.isArray(t))return t.flatMap(r=>{const a=en(r);return a.parts&&a.parts.length>0&&a.parts[0].text!==void 0?[a.parts[0].text]:[]});if(e.isVertexAI()){const r=en(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=>en(r)):[en(t)]}function Ls(e){if(e==null||Array.isArray(e)&&e.length===0)throw new Error("contents are required");if(!Array.isArray(e)){if(P3(e)||L3(e))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[en(e)]}const t=[],r=[],a=dC(e[0]);for(const s of e){const i=dC(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(P3(s)||L3(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:TL(r)}),t}function Lue(e,t){e.includes("null")&&(t.nullable=!0);const r=e.filter(a=>a!=="null");if(r.length===1)t.type=Object.values(bc).includes(r[0].toUpperCase())?r[0].toUpperCase():bc.TYPE_UNSPECIFIED;else{t.anyOf=[];for(const a of r)t.anyOf.push({type:Object.values(bc).includes(a.toUpperCase())?a.toUpperCase():bc.TYPE_UNSPECIFIED})}}function gA(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&&Lue(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(bc).includes(o.toUpperCase())?o.toUpperCase():bc.TYPE_UNSPECIFIED}else if(r.includes(l))t[l]=gA(o);else if(a.includes(l)){const d=[];for(const u of o){if(u.type=="null"){t.nullable=!0;continue}d.push(gA(u))}t[l]=d}else if(s.includes(l)){const d={};for(const[u,f]of Object.entries(o))d[u]=gA(f);t[l]=d}else{if(l==="additionalProperties")continue;t[l]=o}return t}function qj(e){return gA(e)}function Wj(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 Yj(e){if("multiSpeakerVoiceConfig"in e)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return e}function XA(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=gA(t.parameters)),t.response&&(Object.keys(t.response).includes("$schema")?t.responseJsonSchema||(t.responseJsonSchema=t.response,delete t.response):t.response=gA(t.response));return e}function JA(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 Que(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 Uo(e,t){if(typeof t!="string")throw new Error("name must be a string");return Que(e,t,"cachedContents")}function IL(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 $c(e){return $j(e)}function Hue(e){return e!=null&&typeof e=="object"&&"name"in e}function zue(e){return e!=null&&typeof e=="object"&&"video"in e}function $ue(e){return e!=null&&typeof e=="object"&&"uri"in e}function FL(e){var t;let r;if(Hue(e)&&(r=e.name),!($ue(e)&&(r=e.uri,r===void 0))&&!(zue(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 DL(e,t){let r;return e.isVertexAI()?r=t?"publishers/google/models":"models":r=t?"models":"tunedModels",r}function UL(e){for(const t of["models","tunedModels","publisherModels"])if(Vue(e,t))return e[t];return[]}function Vue(e,t){return e!==null&&typeof e=="object"&&t in e}function Gue(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 Kue(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=Gue(s,t);l.functionDeclarations&&r.push(...l.functionDeclarations)}return{functionDeclarations:r}}function ML(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 que(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 RL(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 ZA(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 OL(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 Wue(e){return e.includes("gemini")&&e!=="gemini-embedding-001"||e.includes("maas")}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Yue(e){const t={},r=w(e,["responsesFile"]);r!=null&&N(t,["fileName"],r);const a=w(e,["inlinedResponses","inlinedResponses"]);if(a!=null){let i=a;Array.isArray(i)&&(i=i.map(l=>_Ae(l))),N(t,["inlinedResponses"],i)}const s=w(e,["inlinedEmbedContentResponses","inlinedResponses"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(t,["inlinedEmbedContentResponses"],i)}return t}function Xue(e){const t={},r=w(e,["predictionsFormat"]);r!=null&&N(t,["format"],r);const a=w(e,["gcsDestination","outputUriPrefix"]);a!=null&&N(t,["gcsUri"],a);const s=w(e,["bigqueryDestination","outputUri"]);return s!=null&&N(t,["bigqueryUri"],s),t}function Jue(e){const t={},r=w(e,["format"]);r!=null&&N(t,["predictionsFormat"],r);const a=w(e,["gcsUri"]);a!=null&&N(t,["gcsDestination","outputUriPrefix"],a);const s=w(e,["bigqueryUri"]);if(s!=null&&N(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&&N(t,["name"],r);const a=w(e,["metadata","displayName"]);a!=null&&N(t,["displayName"],a);const s=w(e,["metadata","state"]);s!=null&&N(t,["state"],OL(s));const i=w(e,["metadata","createTime"]);i!=null&&N(t,["createTime"],i);const l=w(e,["metadata","endTime"]);l!=null&&N(t,["endTime"],l);const o=w(e,["metadata","updateTime"]);o!=null&&N(t,["updateTime"],o);const d=w(e,["metadata","model"]);d!=null&&N(t,["model"],d);const u=w(e,["metadata","output"]);return u!=null&&N(t,["dest"],Yue(RL(u))),t}function uC(e){const t={},r=w(e,["name"]);r!=null&&N(t,["name"],r);const a=w(e,["displayName"]);a!=null&&N(t,["displayName"],a);const s=w(e,["state"]);s!=null&&N(t,["state"],OL(s));const i=w(e,["error"]);i!=null&&N(t,["error"],i);const l=w(e,["createTime"]);l!=null&&N(t,["createTime"],l);const o=w(e,["startTime"]);o!=null&&N(t,["startTime"],o);const d=w(e,["endTime"]);d!=null&&N(t,["endTime"],d);const u=w(e,["updateTime"]);u!=null&&N(t,["updateTime"],u);const f=w(e,["model"]);f!=null&&N(t,["model"],f);const p=w(e,["inputConfig"]);p!=null&&N(t,["src"],Zue(p));const x=w(e,["outputConfig"]);x!=null&&N(t,["dest"],Xue(RL(x)));const m=w(e,["completionStats"]);return m!=null&&N(t,["completionStats"],m),t}function Zue(e){const t={},r=w(e,["instancesFormat"]);r!=null&&N(t,["format"],r);const a=w(e,["gcsSource","uris"]);a!=null&&N(t,["gcsUri"],a);const s=w(e,["bigquerySource","inputUri"]);return s!=null&&N(t,["bigqueryUri"],s),t}function eAe(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&&N(r,["fileName"],a);const s=w(t,["inlinedRequests"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>BAe(e,l))),N(r,["requests","requests"],i)}return r}function tAe(e){const t={},r=w(e,["format"]);r!=null&&N(t,["instancesFormat"],r);const a=w(e,["gcsUri"]);a!=null&&N(t,["gcsSource","uris"],a);const s=w(e,["bigqueryUri"]);if(s!=null&&N(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 rAe(e){const t={},r=w(e,["data"]);if(r!=null&&N(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&&N(t,["mimeType"],a),t}function aAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],ZA(e,a)),r}function nAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],ZA(e,a)),r}function sAe(e){const t={},r=w(e,["content"]);r!=null&&N(t,["content"],r);const a=w(e,["citationMetadata"]);a!=null&&N(t,["citationMetadata"],iAe(a));const s=w(e,["tokenCount"]);s!=null&&N(t,["tokenCount"],s);const i=w(e,["finishReason"]);i!=null&&N(t,["finishReason"],i);const l=w(e,["avgLogprobs"]);l!=null&&N(t,["avgLogprobs"],l);const o=w(e,["groundingMetadata"]);o!=null&&N(t,["groundingMetadata"],o);const d=w(e,["index"]);d!=null&&N(t,["index"],d);const u=w(e,["logprobsResult"]);u!=null&&N(t,["logprobsResult"],u);const f=w(e,["safetyRatings"]);if(f!=null){let x=f;Array.isArray(x)&&(x=x.map(m=>m)),N(t,["safetyRatings"],x)}const p=w(e,["urlContextMetadata"]);return p!=null&&N(t,["urlContextMetadata"],p),t}function iAe(e){const t={},r=w(e,["citationSources"]);if(r!=null){let a=r;Array.isArray(a)&&(a=a.map(s=>s)),N(t,["citations"],a)}return t}function PL(e){const t={},r=w(e,["parts"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>RAe(i))),N(t,["parts"],s)}const a=w(e,["role"]);return a!=null&&N(t,["role"],a),t}function lAe(e,t){const r={},a=w(e,["displayName"]);if(t!==void 0&&a!=null&&N(t,["batch","displayName"],a),w(e,["dest"])!==void 0)throw new Error("dest parameter is not supported in Gemini API.");return r}function oAe(e,t){const r={},a=w(e,["displayName"]);t!==void 0&&a!=null&&N(t,["displayName"],a);const s=w(e,["dest"]);return t!==void 0&&s!=null&&N(t,["outputConfig"],Jue(que(s))),r}function Q3(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["_url","model"],rr(e,a));const s=w(t,["src"]);s!=null&&N(r,["batch","inputConfig"],eAe(e,ML(e,s)));const i=w(t,["config"]);return i!=null&&lAe(i,r),r}function cAe(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["model"],rr(e,a));const s=w(t,["src"]);s!=null&&N(r,["inputConfig"],tAe(ML(e,s)));const i=w(t,["config"]);return i!=null&&oAe(i,r),r}function dAe(e,t){const r={},a=w(e,["displayName"]);return t!==void 0&&a!=null&&N(t,["batch","displayName"],a),r}function uAe(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["_url","model"],rr(e,a));const s=w(t,["src"]);s!=null&&N(r,["batch","inputConfig"],gAe(e,s));const i=w(t,["config"]);return i!=null&&dAe(i,r),r}function AAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],ZA(e,a)),r}function fAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],ZA(e,a)),r}function pAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["name"]);a!=null&&N(t,["name"],a);const s=w(e,["done"]);s!=null&&N(t,["done"],s);const i=w(e,["error"]);return i!=null&&N(t,["error"],i),t}function hAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["name"]);a!=null&&N(t,["name"],a);const s=w(e,["done"]);s!=null&&N(t,["done"],s);const i=w(e,["error"]);return i!=null&&N(t,["error"],i),t}function xAe(e,t){const r={},a=w(t,["contents"]);if(a!=null){let i=Kj(e,a);Array.isArray(i)&&(i=i.map(l=>l)),N(r,["requests[]","request","content"],i)}const s=w(t,["config"]);return s!=null&&(N(r,["_self"],mAe(s,r)),uue(r,{"requests[].*":"requests[].request.*"})),r}function mAe(e,t){const r={},a=w(e,["taskType"]);t!==void 0&&a!=null&&N(t,["requests[]","taskType"],a);const s=w(e,["title"]);t!==void 0&&s!=null&&N(t,["requests[]","title"],s);const i=w(e,["outputDimensionality"]);if(t!==void 0&&i!=null&&N(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 gAe(e,t){const r={},a=w(t,["fileName"]);a!=null&&N(r,["file_name"],a);const s=w(t,["inlinedRequests"]);return s!=null&&N(r,["requests"],xAe(e,s)),r}function bAe(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&&N(t,["fileUri"],r);const a=w(e,["mimeType"]);return a!=null&&N(t,["mimeType"],a),t}function vAe(e){const t={},r=w(e,["id"]);r!=null&&N(t,["id"],r);const a=w(e,["args"]);a!=null&&N(t,["args"],a);const s=w(e,["name"]);if(s!=null&&N(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 yAe(e){const t={},r=w(e,["allowedFunctionNames"]);r!=null&&N(t,["allowedFunctionNames"],r);const a=w(e,["mode"]);if(a!=null&&N(t,["mode"],a),w(e,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function wAe(e,t,r){const a={},s=w(t,["systemInstruction"]);r!==void 0&&s!=null&&N(r,["systemInstruction"],PL(en(s)));const i=w(t,["temperature"]);i!=null&&N(a,["temperature"],i);const l=w(t,["topP"]);l!=null&&N(a,["topP"],l);const o=w(t,["topK"]);o!=null&&N(a,["topK"],o);const d=w(t,["candidateCount"]);d!=null&&N(a,["candidateCount"],d);const u=w(t,["maxOutputTokens"]);u!=null&&N(a,["maxOutputTokens"],u);const f=w(t,["stopSequences"]);f!=null&&N(a,["stopSequences"],f);const p=w(t,["responseLogprobs"]);p!=null&&N(a,["responseLogprobs"],p);const x=w(t,["logprobs"]);x!=null&&N(a,["logprobs"],x);const m=w(t,["presencePenalty"]);m!=null&&N(a,["presencePenalty"],m);const b=w(t,["frequencyPenalty"]);b!=null&&N(a,["frequencyPenalty"],b);const v=w(t,["seed"]);v!=null&&N(a,["seed"],v);const y=w(t,["responseMimeType"]);y!=null&&N(a,["responseMimeType"],y);const k=w(t,["responseSchema"]);k!=null&&N(a,["responseSchema"],qj(k));const _=w(t,["responseJsonSchema"]);if(_!=null&&N(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 C=w(t,["safetySettings"]);if(r!==void 0&&C!=null){let G=C;Array.isArray(G)&&(G=G.map(H=>OAe(H))),N(r,["safetySettings"],G)}const E=w(t,["tools"]);if(r!==void 0&&E!=null){let G=JA(E);Array.isArray(G)&&(G=G.map(H=>LAe(XA(H)))),N(r,["tools"],G)}const T=w(t,["toolConfig"]);if(r!==void 0&&T!=null&&N(r,["toolConfig"],PAe(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&&N(r,["cachedContent"],Uo(e,B));const F=w(t,["responseModalities"]);F!=null&&N(a,["responseModalities"],F);const M=w(t,["mediaResolution"]);M!=null&&N(a,["mediaResolution"],M);const U=w(t,["speechConfig"]);if(U!=null&&N(a,["speechConfig"],Wj(U)),w(t,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const D=w(t,["thinkingConfig"]);D!=null&&N(a,["thinkingConfig"],D);const L=w(t,["imageConfig"]);L!=null&&N(a,["imageConfig"],SAe(L));const P=w(t,["enableEnhancedCivicAnswers"]);if(P!=null&&N(a,["enableEnhancedCivicAnswers"],P),w(t,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");return a}function NAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["candidates"]);if(a!=null){let d=a;Array.isArray(d)&&(d=d.map(u=>sAe(u))),N(t,["candidates"],d)}const s=w(e,["modelVersion"]);s!=null&&N(t,["modelVersion"],s);const i=w(e,["promptFeedback"]);i!=null&&N(t,["promptFeedback"],i);const l=w(e,["responseId"]);l!=null&&N(t,["responseId"],l);const o=w(e,["usageMetadata"]);return o!=null&&N(t,["usageMetadata"],o),t}function CAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],ZA(e,a)),r}function kAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],ZA(e,a)),r}function jAe(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&&N(t,["enableWidget"],r),t}function EAe(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&&N(t,["timeRangeFilter"],r),t}function SAe(e){const t={},r=w(e,["aspectRatio"]);r!=null&&N(t,["aspectRatio"],r);const a=w(e,["imageSize"]);if(a!=null&&N(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 BAe(e,t){const r={},a=w(t,["model"]);a!=null&&N(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=>PL(d))),N(r,["request","contents"],o)}const i=w(t,["metadata"]);i!=null&&N(r,["metadata"],i);const l=w(t,["config"]);return l!=null&&N(r,["request","generationConfig"],wAe(e,l,w(r,["request"],{}))),r}function _Ae(e){const t={},r=w(e,["response"]);r!=null&&N(t,["response"],NAe(r));const a=w(e,["metadata"]);a!=null&&N(t,["metadata"],a);const s=w(e,["error"]);return s!=null&&N(t,["error"],s),t}function TAe(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&N(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);if(t!==void 0&&s!=null&&N(t,["_query","pageToken"],s),w(e,["filter"])!==void 0)throw new Error("filter parameter is not supported in Gemini API.");return r}function IAe(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&N(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);t!==void 0&&s!=null&&N(t,["_query","pageToken"],s);const i=w(e,["filter"]);return t!==void 0&&i!=null&&N(t,["_query","filter"],i),r}function FAe(e){const t={},r=w(e,["config"]);return r!=null&&TAe(r,t),t}function DAe(e){const t={},r=w(e,["config"]);return r!=null&&IAe(r,t),t}function UAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&N(t,["nextPageToken"],a);const s=w(e,["operations"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>Dm(l))),N(t,["batchJobs"],i)}return t}function MAe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&N(t,["nextPageToken"],a);const s=w(e,["batchPredictionJobs"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>uC(l))),N(t,["batchJobs"],i)}return t}function RAe(e){const t={},r=w(e,["mediaResolution"]);r!=null&&N(t,["mediaResolution"],r);const a=w(e,["codeExecutionResult"]);a!=null&&N(t,["codeExecutionResult"],a);const s=w(e,["executableCode"]);s!=null&&N(t,["executableCode"],s);const i=w(e,["fileData"]);i!=null&&N(t,["fileData"],bAe(i));const l=w(e,["functionCall"]);l!=null&&N(t,["functionCall"],vAe(l));const o=w(e,["functionResponse"]);o!=null&&N(t,["functionResponse"],o);const d=w(e,["inlineData"]);d!=null&&N(t,["inlineData"],rAe(d));const u=w(e,["text"]);u!=null&&N(t,["text"],u);const f=w(e,["thought"]);f!=null&&N(t,["thought"],f);const p=w(e,["thoughtSignature"]);p!=null&&N(t,["thoughtSignature"],p);const x=w(e,["videoMetadata"]);return x!=null&&N(t,["videoMetadata"],x),t}function OAe(e){const t={},r=w(e,["category"]);if(r!=null&&N(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&&N(t,["threshold"],a),t}function PAe(e){const t={},r=w(e,["retrievalConfig"]);r!=null&&N(t,["retrievalConfig"],r);const a=w(e,["functionCallingConfig"]);return a!=null&&N(t,["functionCallingConfig"],yAe(a)),t}function LAe(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&&N(t,["computerUse"],r);const a=w(e,["fileSearch"]);a!=null&&N(t,["fileSearch"],a);const s=w(e,["codeExecution"]);if(s!=null&&N(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)),N(t,["functionDeclarations"],f)}const l=w(e,["googleMaps"]);l!=null&&N(t,["googleMaps"],jAe(l));const o=w(e,["googleSearch"]);o!=null&&N(t,["googleSearch"],EAe(o));const d=w(e,["googleSearchRetrieval"]);d!=null&&N(t,["googleSearchRetrieval"],d);const u=w(e,["urlContext"]);return u!=null&&N(t,["urlContext"],u),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var wo;(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"})(wo||(wo={}));class au{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 QAe extends Do{constructor(t){super(),this.apiClient=t,this.list=async(r={})=>new au(wo.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=Q3(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 x=p.systemInstruction;delete p.systemInstruction;const m=p.request;m.systemInstruction=x,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=cAe(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=>uC(f))}else{const u=Q3(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=uAe(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=kAe(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=>uC(f))}else{const u=CAe(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=nAe(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=aAe(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=DAe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=MAe(f),x=new R3;return Object.assign(x,p),x})}else{const u=FAe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=UAe(f),x=new R3;return Object.assign(x,p),x})}}async delete(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=fAe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>hAe(f))}else{const u=AAe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>pAe(f))}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function HAe(e){const t={},r=w(e,["data"]);if(r!=null&&N(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&&N(t,["mimeType"],a),t}function H3(e){const t={},r=w(e,["parts"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>u0e(i))),N(t,["parts"],s)}const a=w(e,["role"]);return a!=null&&N(t,["role"],a),t}function zAe(e,t){const r={},a=w(e,["ttl"]);t!==void 0&&a!=null&&N(t,["ttl"],a);const s=w(e,["expireTime"]);t!==void 0&&s!=null&&N(t,["expireTime"],s);const i=w(e,["displayName"]);t!==void 0&&i!=null&&N(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=>H3(p))),N(t,["contents"],f)}const o=w(e,["systemInstruction"]);t!==void 0&&o!=null&&N(t,["systemInstruction"],H3(en(o)));const d=w(e,["tools"]);if(t!==void 0&&d!=null){let f=d;Array.isArray(f)&&(f=f.map(p=>f0e(p))),N(t,["tools"],f)}const u=w(e,["toolConfig"]);if(t!==void 0&&u!=null&&N(t,["toolConfig"],A0e(u)),w(e,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is not supported in Gemini API.");return r}function $Ae(e,t){const r={},a=w(e,["ttl"]);t!==void 0&&a!=null&&N(t,["ttl"],a);const s=w(e,["expireTime"]);t!==void 0&&s!=null&&N(t,["expireTime"],s);const i=w(e,["displayName"]);t!==void 0&&i!=null&&N(t,["displayName"],i);const l=w(e,["contents"]);if(t!==void 0&&l!=null){let p=Ls(l);Array.isArray(p)&&(p=p.map(x=>x)),N(t,["contents"],p)}const o=w(e,["systemInstruction"]);t!==void 0&&o!=null&&N(t,["systemInstruction"],en(o));const d=w(e,["tools"]);if(t!==void 0&&d!=null){let p=d;Array.isArray(p)&&(p=p.map(x=>p0e(x))),N(t,["tools"],p)}const u=w(e,["toolConfig"]);t!==void 0&&u!=null&&N(t,["toolConfig"],u);const f=w(e,["kmsKeyName"]);return t!==void 0&&f!=null&&N(t,["encryption_spec","kmsKeyName"],f),r}function VAe(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["model"],EL(e,a));const s=w(t,["config"]);return s!=null&&zAe(s,r),r}function GAe(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["model"],EL(e,a));const s=w(t,["config"]);return s!=null&&$Ae(s,r),r}function KAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],Uo(e,a)),r}function qAe(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],Uo(e,a)),r}function WAe(e){const t={},r=w(e,["sdkHttpResponse"]);return r!=null&&N(t,["sdkHttpResponse"],r),t}function YAe(e){const t={},r=w(e,["sdkHttpResponse"]);return r!=null&&N(t,["sdkHttpResponse"],r),t}function XAe(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&&N(t,["fileUri"],r);const a=w(e,["mimeType"]);return a!=null&&N(t,["mimeType"],a),t}function JAe(e){const t={},r=w(e,["id"]);r!=null&&N(t,["id"],r);const a=w(e,["args"]);a!=null&&N(t,["args"],a);const s=w(e,["name"]);if(s!=null&&N(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 ZAe(e){const t={},r=w(e,["allowedFunctionNames"]);r!=null&&N(t,["allowedFunctionNames"],r);const a=w(e,["mode"]);if(a!=null&&N(t,["mode"],a),w(e,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function e0e(e){const t={},r=w(e,["description"]);r!=null&&N(t,["description"],r);const a=w(e,["name"]);a!=null&&N(t,["name"],a);const s=w(e,["parameters"]);s!=null&&N(t,["parameters"],s);const i=w(e,["parametersJsonSchema"]);i!=null&&N(t,["parametersJsonSchema"],i);const l=w(e,["response"]);l!=null&&N(t,["response"],l);const o=w(e,["responseJsonSchema"]);if(o!=null&&N(t,["responseJsonSchema"],o),w(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function t0e(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],Uo(e,a)),r}function r0e(e,t){const r={},a=w(t,["name"]);return a!=null&&N(r,["_url","name"],Uo(e,a)),r}function a0e(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&&N(t,["enableWidget"],r),t}function n0e(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&&N(t,["timeRangeFilter"],r),t}function s0e(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&N(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);return t!==void 0&&s!=null&&N(t,["_query","pageToken"],s),r}function i0e(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&N(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);return t!==void 0&&s!=null&&N(t,["_query","pageToken"],s),r}function l0e(e){const t={},r=w(e,["config"]);return r!=null&&s0e(r,t),t}function o0e(e){const t={},r=w(e,["config"]);return r!=null&&i0e(r,t),t}function c0e(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&N(t,["nextPageToken"],a);const s=w(e,["cachedContents"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(t,["cachedContents"],i)}return t}function d0e(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&N(t,["nextPageToken"],a);const s=w(e,["cachedContents"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(t,["cachedContents"],i)}return t}function u0e(e){const t={},r=w(e,["mediaResolution"]);r!=null&&N(t,["mediaResolution"],r);const a=w(e,["codeExecutionResult"]);a!=null&&N(t,["codeExecutionResult"],a);const s=w(e,["executableCode"]);s!=null&&N(t,["executableCode"],s);const i=w(e,["fileData"]);i!=null&&N(t,["fileData"],XAe(i));const l=w(e,["functionCall"]);l!=null&&N(t,["functionCall"],JAe(l));const o=w(e,["functionResponse"]);o!=null&&N(t,["functionResponse"],o);const d=w(e,["inlineData"]);d!=null&&N(t,["inlineData"],HAe(d));const u=w(e,["text"]);u!=null&&N(t,["text"],u);const f=w(e,["thought"]);f!=null&&N(t,["thought"],f);const p=w(e,["thoughtSignature"]);p!=null&&N(t,["thoughtSignature"],p);const x=w(e,["videoMetadata"]);return x!=null&&N(t,["videoMetadata"],x),t}function A0e(e){const t={},r=w(e,["retrievalConfig"]);r!=null&&N(t,["retrievalConfig"],r);const a=w(e,["functionCallingConfig"]);return a!=null&&N(t,["functionCallingConfig"],ZAe(a)),t}function f0e(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&&N(t,["computerUse"],r);const a=w(e,["fileSearch"]);a!=null&&N(t,["fileSearch"],a);const s=w(e,["codeExecution"]);if(s!=null&&N(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)),N(t,["functionDeclarations"],f)}const l=w(e,["googleMaps"]);l!=null&&N(t,["googleMaps"],a0e(l));const o=w(e,["googleSearch"]);o!=null&&N(t,["googleSearch"],n0e(o));const d=w(e,["googleSearchRetrieval"]);d!=null&&N(t,["googleSearchRetrieval"],d);const u=w(e,["urlContext"]);return u!=null&&N(t,["urlContext"],u),t}function p0e(e){const t={},r=w(e,["retrieval"]);r!=null&&N(t,["retrieval"],r);const a=w(e,["computerUse"]);if(a!=null&&N(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&&N(t,["codeExecution"],s);const i=w(e,["enterpriseWebSearch"]);i!=null&&N(t,["enterpriseWebSearch"],i);const l=w(e,["functionDeclarations"]);if(l!=null){let p=l;Array.isArray(p)&&(p=p.map(x=>e0e(x))),N(t,["functionDeclarations"],p)}const o=w(e,["googleMaps"]);o!=null&&N(t,["googleMaps"],o);const d=w(e,["googleSearch"]);d!=null&&N(t,["googleSearch"],d);const u=w(e,["googleSearchRetrieval"]);u!=null&&N(t,["googleSearchRetrieval"],u);const f=w(e,["urlContext"]);return f!=null&&N(t,["urlContext"],f),t}function h0e(e,t){const r={},a=w(e,["ttl"]);t!==void 0&&a!=null&&N(t,["ttl"],a);const s=w(e,["expireTime"]);return t!==void 0&&s!=null&&N(t,["expireTime"],s),r}function x0e(e,t){const r={},a=w(e,["ttl"]);t!==void 0&&a!=null&&N(t,["ttl"],a);const s=w(e,["expireTime"]);return t!==void 0&&s!=null&&N(t,["expireTime"],s),r}function m0e(e,t){const r={},a=w(t,["name"]);a!=null&&N(r,["_url","name"],Uo(e,a));const s=w(t,["config"]);return s!=null&&h0e(s,r),r}function g0e(e,t){const r={},a=w(t,["name"]);a!=null&&N(r,["_url","name"],Uo(e,a));const s=w(t,["config"]);return s!=null&&x0e(s,r),r}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class b0e extends Do{constructor(t){super(),this.apiClient=t,this.list=async(r={})=>new au(wo.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=GAe(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=VAe(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=r0e(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=t0e(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=qAe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=YAe(f),x=new U3;return Object.assign(x,p),x})}else{const u=KAe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=WAe(f),x=new U3;return Object.assign(x,p),x})}}async update(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=g0e(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=m0e(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=o0e(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=d0e(f),x=new M3;return Object.assign(x,p),x})}else{const u=l0e(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=c0e(f),x=new M3;return Object.assign(x,p),x})}}}function Rg(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 z3(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,k){i.push([m,v,y,k])>1||d(m,v)})},b&&(s[m]=b(s[m])))}function d(m,b){try{u(a[m](b))}catch(v){x(i[0][3],v)}}function u(m){m.value instanceof St?Promise.resolve(m.value.v).then(f,p):x(i[0][2],m)}function f(m){d("next",m)}function p(m){d("throw",m)}function x(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 z3=="function"?z3(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 v0e(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:LL(r)}function LL(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 y0e(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 $3(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&&!LL(e[a])&&(i=!1),a++;i?t.push(...s):t.pop()}return t}class w0e{constructor(t,r){this.modelsModule=t,this.apiClient=r}create(t){return new N0e(this.apiClient,this.modelsModule,t.model,t.config,structuredClone(t.history))}}class N0e{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(),y0e(i)}async sendMessage(t){var r;await this.sendPromise;const a=en(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 x=[];f!=null&&(x=(o=f.slice(p))!==null&&o!==void 0?o:[]);const m=u?[u]:[];this.recordHistory(a,m,x)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),s}async sendMessageStream(t){var r;await this.sendPromise;const a=en(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?$3(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,x=$i(t),m;m=yield St(x.next()),s=m.done,!s;p=!0){o=m.value,p=!1;const b=o;if(v0e(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=x.return)&&(yield St(l.call(x)))}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(...$3(a)):this.history.push(t),this.history.push(...s)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class fp extends Error{constructor(t){super(t.message),this.name="ApiError",this.status=t.status,Object.setPrototypeOf(this,fp.prototype)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function C0e(e){const t={},r=w(e,["file"]);return r!=null&&N(t,["file"],r),t}function k0e(e){const t={},r=w(e,["sdkHttpResponse"]);return r!=null&&N(t,["sdkHttpResponse"],r),t}function j0e(e){const t={},r=w(e,["name"]);return r!=null&&N(t,["_url","file"],FL(r)),t}function E0e(e){const t={},r=w(e,["sdkHttpResponse"]);return r!=null&&N(t,["sdkHttpResponse"],r),t}function S0e(e){const t={},r=w(e,["name"]);return r!=null&&N(t,["_url","file"],FL(r)),t}function B0e(e){const t={},r=w(e,["uris"]);return r!=null&&N(t,["uris"],r),t}function _0e(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&N(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);return t!==void 0&&s!=null&&N(t,["_query","pageToken"],s),r}function T0e(e){const t={},r=w(e,["config"]);return r!=null&&_0e(r,t),t}function I0e(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&N(t,["nextPageToken"],a);const s=w(e,["files"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(t,["files"],i)}return t}function F0e(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["files"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(i=>i)),N(t,["files"],s)}return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class D0e extends Do{constructor(t){super(),this.apiClient=t,this.list=async(r={})=>new au(wo.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=T0e(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=I0e(d),f=new Due;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=C0e(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=k0e(d),f=new Uue;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=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:"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=j0e(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=E0e(d),f=new Mue;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=B0e(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=F0e(d),f=new Rue;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&&N(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&&N(t,["mimeType"],a),t}function U0e(e){const t={},r=w(e,["parts"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>X0e(i))),N(t,["parts"],s)}const a=w(e,["role"]);return a!=null&&N(t,["role"],a),t}function M0e(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&&N(t,["fileUri"],r);const a=w(e,["mimeType"]);return a!=null&&N(t,["mimeType"],a),t}function R0e(e){const t={},r=w(e,["id"]);r!=null&&N(t,["id"],r);const a=w(e,["args"]);a!=null&&N(t,["args"],a);const s=w(e,["name"]);if(s!=null&&N(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 O0e(e){const t={},r=w(e,["description"]);r!=null&&N(t,["description"],r);const a=w(e,["name"]);a!=null&&N(t,["name"],a);const s=w(e,["parameters"]);s!=null&&N(t,["parameters"],s);const i=w(e,["parametersJsonSchema"]);i!=null&&N(t,["parametersJsonSchema"],i);const l=w(e,["response"]);l!=null&&N(t,["response"],l);const o=w(e,["responseJsonSchema"]);if(o!=null&&N(t,["responseJsonSchema"],o),w(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function P0e(e){const t={},r=w(e,["modelSelectionConfig"]);r!=null&&N(t,["modelConfig"],r);const a=w(e,["responseJsonSchema"]);a!=null&&N(t,["responseJsonSchema"],a);const s=w(e,["audioTimestamp"]);s!=null&&N(t,["audioTimestamp"],s);const i=w(e,["candidateCount"]);i!=null&&N(t,["candidateCount"],i);const l=w(e,["enableAffectiveDialog"]);l!=null&&N(t,["enableAffectiveDialog"],l);const o=w(e,["frequencyPenalty"]);o!=null&&N(t,["frequencyPenalty"],o);const d=w(e,["logprobs"]);d!=null&&N(t,["logprobs"],d);const u=w(e,["maxOutputTokens"]);u!=null&&N(t,["maxOutputTokens"],u);const f=w(e,["mediaResolution"]);f!=null&&N(t,["mediaResolution"],f);const p=w(e,["presencePenalty"]);p!=null&&N(t,["presencePenalty"],p);const x=w(e,["responseLogprobs"]);x!=null&&N(t,["responseLogprobs"],x);const m=w(e,["responseMimeType"]);m!=null&&N(t,["responseMimeType"],m);const b=w(e,["responseModalities"]);b!=null&&N(t,["responseModalities"],b);const v=w(e,["responseSchema"]);v!=null&&N(t,["responseSchema"],v);const y=w(e,["routingConfig"]);y!=null&&N(t,["routingConfig"],y);const k=w(e,["seed"]);k!=null&&N(t,["seed"],k);const _=w(e,["speechConfig"]);_!=null&&N(t,["speechConfig"],_);const C=w(e,["stopSequences"]);C!=null&&N(t,["stopSequences"],C);const E=w(e,["temperature"]);E!=null&&N(t,["temperature"],E);const T=w(e,["thinkingConfig"]);T!=null&&N(t,["thinkingConfig"],T);const B=w(e,["topK"]);B!=null&&N(t,["topK"],B);const F=w(e,["topP"]);if(F!=null&&N(t,["topP"],F),w(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return t}function L0e(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&&N(t,["enableWidget"],r),t}function Q0e(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&&N(t,["timeRangeFilter"],r),t}function H0e(e,t){const r={},a=w(e,["generationConfig"]);t!==void 0&&a!=null&&N(t,["setup","generationConfig"],a);const s=w(e,["responseModalities"]);t!==void 0&&s!=null&&N(t,["setup","generationConfig","responseModalities"],s);const i=w(e,["temperature"]);t!==void 0&&i!=null&&N(t,["setup","generationConfig","temperature"],i);const l=w(e,["topP"]);t!==void 0&&l!=null&&N(t,["setup","generationConfig","topP"],l);const o=w(e,["topK"]);t!==void 0&&o!=null&&N(t,["setup","generationConfig","topK"],o);const d=w(e,["maxOutputTokens"]);t!==void 0&&d!=null&&N(t,["setup","generationConfig","maxOutputTokens"],d);const u=w(e,["mediaResolution"]);t!==void 0&&u!=null&&N(t,["setup","generationConfig","mediaResolution"],u);const f=w(e,["seed"]);t!==void 0&&f!=null&&N(t,["setup","generationConfig","seed"],f);const p=w(e,["speechConfig"]);t!==void 0&&p!=null&&N(t,["setup","generationConfig","speechConfig"],Yj(p));const x=w(e,["thinkingConfig"]);t!==void 0&&x!=null&&N(t,["setup","generationConfig","thinkingConfig"],x);const m=w(e,["enableAffectiveDialog"]);t!==void 0&&m!=null&&N(t,["setup","generationConfig","enableAffectiveDialog"],m);const b=w(e,["systemInstruction"]);t!==void 0&&b!=null&&N(t,["setup","systemInstruction"],U0e(en(b)));const v=w(e,["tools"]);if(t!==void 0&&v!=null){let B=JA(v);Array.isArray(B)&&(B=B.map(F=>Z0e(XA(F)))),N(t,["setup","tools"],B)}const y=w(e,["sessionResumption"]);t!==void 0&&y!=null&&N(t,["setup","sessionResumption"],J0e(y));const k=w(e,["inputAudioTranscription"]);t!==void 0&&k!=null&&N(t,["setup","inputAudioTranscription"],k);const _=w(e,["outputAudioTranscription"]);t!==void 0&&_!=null&&N(t,["setup","outputAudioTranscription"],_);const C=w(e,["realtimeInputConfig"]);t!==void 0&&C!=null&&N(t,["setup","realtimeInputConfig"],C);const E=w(e,["contextWindowCompression"]);t!==void 0&&E!=null&&N(t,["setup","contextWindowCompression"],E);const T=w(e,["proactivity"]);if(t!==void 0&&T!=null&&N(t,["setup","proactivity"],T),w(e,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return r}function z0e(e,t){const r={},a=w(e,["generationConfig"]);t!==void 0&&a!=null&&N(t,["setup","generationConfig"],P0e(a));const s=w(e,["responseModalities"]);t!==void 0&&s!=null&&N(t,["setup","generationConfig","responseModalities"],s);const i=w(e,["temperature"]);t!==void 0&&i!=null&&N(t,["setup","generationConfig","temperature"],i);const l=w(e,["topP"]);t!==void 0&&l!=null&&N(t,["setup","generationConfig","topP"],l);const o=w(e,["topK"]);t!==void 0&&o!=null&&N(t,["setup","generationConfig","topK"],o);const d=w(e,["maxOutputTokens"]);t!==void 0&&d!=null&&N(t,["setup","generationConfig","maxOutputTokens"],d);const u=w(e,["mediaResolution"]);t!==void 0&&u!=null&&N(t,["setup","generationConfig","mediaResolution"],u);const f=w(e,["seed"]);t!==void 0&&f!=null&&N(t,["setup","generationConfig","seed"],f);const p=w(e,["speechConfig"]);t!==void 0&&p!=null&&N(t,["setup","generationConfig","speechConfig"],Yj(p));const x=w(e,["thinkingConfig"]);t!==void 0&&x!=null&&N(t,["setup","generationConfig","thinkingConfig"],x);const m=w(e,["enableAffectiveDialog"]);t!==void 0&&m!=null&&N(t,["setup","generationConfig","enableAffectiveDialog"],m);const b=w(e,["systemInstruction"]);t!==void 0&&b!=null&&N(t,["setup","systemInstruction"],en(b));const v=w(e,["tools"]);if(t!==void 0&&v!=null){let F=JA(v);Array.isArray(F)&&(F=F.map(M=>efe(XA(M)))),N(t,["setup","tools"],F)}const y=w(e,["sessionResumption"]);t!==void 0&&y!=null&&N(t,["setup","sessionResumption"],y);const k=w(e,["inputAudioTranscription"]);t!==void 0&&k!=null&&N(t,["setup","inputAudioTranscription"],k);const _=w(e,["outputAudioTranscription"]);t!==void 0&&_!=null&&N(t,["setup","outputAudioTranscription"],_);const C=w(e,["realtimeInputConfig"]);t!==void 0&&C!=null&&N(t,["setup","realtimeInputConfig"],C);const E=w(e,["contextWindowCompression"]);t!==void 0&&E!=null&&N(t,["setup","contextWindowCompression"],E);const T=w(e,["proactivity"]);t!==void 0&&T!=null&&N(t,["setup","proactivity"],T);const B=w(e,["explicitVadSignal"]);return t!==void 0&&B!=null&&N(t,["setup","explicitVadSignal"],B),r}function $0e(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["setup","model"],rr(e,a));const s=w(t,["config"]);return s!=null&&N(r,["config"],H0e(s,r)),r}function V0e(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["setup","model"],rr(e,a));const s=w(t,["config"]);return s!=null&&N(r,["config"],z0e(s,r)),r}function G0e(e){const t={},r=w(e,["musicGenerationConfig"]);return r!=null&&N(t,["musicGenerationConfig"],r),t}function K0e(e){const t={},r=w(e,["weightedPrompts"]);if(r!=null){let a=r;Array.isArray(a)&&(a=a.map(s=>s)),N(t,["weightedPrompts"],a)}return t}function q0e(e){const t={},r=w(e,["media"]);if(r!=null){let u=SL(r);Array.isArray(u)&&(u=u.map(f=>Um(f))),N(t,["mediaChunks"],u)}const a=w(e,["audio"]);a!=null&&N(t,["audio"],Um(_L(a)));const s=w(e,["audioStreamEnd"]);s!=null&&N(t,["audioStreamEnd"],s);const i=w(e,["video"]);i!=null&&N(t,["video"],Um(BL(i)));const l=w(e,["text"]);l!=null&&N(t,["text"],l);const o=w(e,["activityStart"]);o!=null&&N(t,["activityStart"],o);const d=w(e,["activityEnd"]);return d!=null&&N(t,["activityEnd"],d),t}function W0e(e){const t={},r=w(e,["media"]);if(r!=null){let u=SL(r);Array.isArray(u)&&(u=u.map(f=>f)),N(t,["mediaChunks"],u)}const a=w(e,["audio"]);a!=null&&N(t,["audio"],_L(a));const s=w(e,["audioStreamEnd"]);s!=null&&N(t,["audioStreamEnd"],s);const i=w(e,["video"]);i!=null&&N(t,["video"],BL(i));const l=w(e,["text"]);l!=null&&N(t,["text"],l);const o=w(e,["activityStart"]);o!=null&&N(t,["activityStart"],o);const d=w(e,["activityEnd"]);return d!=null&&N(t,["activityEnd"],d),t}function Y0e(e){const t={},r=w(e,["setupComplete"]);r!=null&&N(t,["setupComplete"],r);const a=w(e,["serverContent"]);a!=null&&N(t,["serverContent"],a);const s=w(e,["toolCall"]);s!=null&&N(t,["toolCall"],s);const i=w(e,["toolCallCancellation"]);i!=null&&N(t,["toolCallCancellation"],i);const l=w(e,["usageMetadata"]);l!=null&&N(t,["usageMetadata"],tfe(l));const o=w(e,["goAway"]);o!=null&&N(t,["goAway"],o);const d=w(e,["sessionResumptionUpdate"]);d!=null&&N(t,["sessionResumptionUpdate"],d);const u=w(e,["voiceActivityDetectionSignal"]);u!=null&&N(t,["voiceActivityDetectionSignal"],u);const f=w(e,["voiceActivity"]);return f!=null&&N(t,["voiceActivity"],rfe(f)),t}function X0e(e){const t={},r=w(e,["mediaResolution"]);r!=null&&N(t,["mediaResolution"],r);const a=w(e,["codeExecutionResult"]);a!=null&&N(t,["codeExecutionResult"],a);const s=w(e,["executableCode"]);s!=null&&N(t,["executableCode"],s);const i=w(e,["fileData"]);i!=null&&N(t,["fileData"],M0e(i));const l=w(e,["functionCall"]);l!=null&&N(t,["functionCall"],R0e(l));const o=w(e,["functionResponse"]);o!=null&&N(t,["functionResponse"],o);const d=w(e,["inlineData"]);d!=null&&N(t,["inlineData"],Um(d));const u=w(e,["text"]);u!=null&&N(t,["text"],u);const f=w(e,["thought"]);f!=null&&N(t,["thought"],f);const p=w(e,["thoughtSignature"]);p!=null&&N(t,["thoughtSignature"],p);const x=w(e,["videoMetadata"]);return x!=null&&N(t,["videoMetadata"],x),t}function J0e(e){const t={},r=w(e,["handle"]);if(r!=null&&N(t,["handle"],r),w(e,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function Z0e(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&&N(t,["computerUse"],r);const a=w(e,["fileSearch"]);a!=null&&N(t,["fileSearch"],a);const s=w(e,["codeExecution"]);if(s!=null&&N(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)),N(t,["functionDeclarations"],f)}const l=w(e,["googleMaps"]);l!=null&&N(t,["googleMaps"],L0e(l));const o=w(e,["googleSearch"]);o!=null&&N(t,["googleSearch"],Q0e(o));const d=w(e,["googleSearchRetrieval"]);d!=null&&N(t,["googleSearchRetrieval"],d);const u=w(e,["urlContext"]);return u!=null&&N(t,["urlContext"],u),t}function efe(e){const t={},r=w(e,["retrieval"]);r!=null&&N(t,["retrieval"],r);const a=w(e,["computerUse"]);if(a!=null&&N(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&&N(t,["codeExecution"],s);const i=w(e,["enterpriseWebSearch"]);i!=null&&N(t,["enterpriseWebSearch"],i);const l=w(e,["functionDeclarations"]);if(l!=null){let p=l;Array.isArray(p)&&(p=p.map(x=>O0e(x))),N(t,["functionDeclarations"],p)}const o=w(e,["googleMaps"]);o!=null&&N(t,["googleMaps"],o);const d=w(e,["googleSearch"]);d!=null&&N(t,["googleSearch"],d);const u=w(e,["googleSearchRetrieval"]);u!=null&&N(t,["googleSearchRetrieval"],u);const f=w(e,["urlContext"]);return f!=null&&N(t,["urlContext"],f),t}function tfe(e){const t={},r=w(e,["promptTokenCount"]);r!=null&&N(t,["promptTokenCount"],r);const a=w(e,["cachedContentTokenCount"]);a!=null&&N(t,["cachedContentTokenCount"],a);const s=w(e,["candidatesTokenCount"]);s!=null&&N(t,["responseTokenCount"],s);const i=w(e,["toolUsePromptTokenCount"]);i!=null&&N(t,["toolUsePromptTokenCount"],i);const l=w(e,["thoughtsTokenCount"]);l!=null&&N(t,["thoughtsTokenCount"],l);const o=w(e,["totalTokenCount"]);o!=null&&N(t,["totalTokenCount"],o);const d=w(e,["promptTokensDetails"]);if(d!=null){let m=d;Array.isArray(m)&&(m=m.map(b=>b)),N(t,["promptTokensDetails"],m)}const u=w(e,["cacheTokensDetails"]);if(u!=null){let m=u;Array.isArray(m)&&(m=m.map(b=>b)),N(t,["cacheTokensDetails"],m)}const f=w(e,["candidatesTokensDetails"]);if(f!=null){let m=f;Array.isArray(m)&&(m=m.map(b=>b)),N(t,["responseTokensDetails"],m)}const p=w(e,["toolUsePromptTokensDetails"]);if(p!=null){let m=p;Array.isArray(m)&&(m=m.map(b=>b)),N(t,["toolUsePromptTokensDetails"],m)}const x=w(e,["trafficType"]);return x!=null&&N(t,["trafficType"],x),t}function rfe(e){const t={},r=w(e,["type"]);return r!=null&&N(t,["voiceActivityType"],r),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function afe(e,t){const r={},a=w(e,["data"]);if(a!=null&&N(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&&N(r,["mimeType"],s),r}function nfe(e,t){const r={},a=w(e,["content"]);a!=null&&N(r,["content"],a);const s=w(e,["citationMetadata"]);s!=null&&N(r,["citationMetadata"],sfe(s));const i=w(e,["tokenCount"]);i!=null&&N(r,["tokenCount"],i);const l=w(e,["finishReason"]);l!=null&&N(r,["finishReason"],l);const o=w(e,["avgLogprobs"]);o!=null&&N(r,["avgLogprobs"],o);const d=w(e,["groundingMetadata"]);d!=null&&N(r,["groundingMetadata"],d);const u=w(e,["index"]);u!=null&&N(r,["index"],u);const f=w(e,["logprobsResult"]);f!=null&&N(r,["logprobsResult"],f);const p=w(e,["safetyRatings"]);if(p!=null){let m=p;Array.isArray(m)&&(m=m.map(b=>b)),N(r,["safetyRatings"],m)}const x=w(e,["urlContextMetadata"]);return x!=null&&N(r,["urlContextMetadata"],x),r}function sfe(e,t){const r={},a=w(e,["citationSources"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(i=>i)),N(r,["citations"],s)}return r}function ife(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(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)),N(a,["contents"],l)}return a}function lfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["tokensInfo"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(r,["tokensInfo"],i)}return r}function ofe(e,t){const r={},a=w(e,["values"]);a!=null&&N(r,["values"],a);const s=w(e,["statistics"]);return s!=null&&N(r,["statistics"],cfe(s)),r}function cfe(e,t){const r={},a=w(e,["truncated"]);a!=null&&N(r,["truncated"],a);const s=w(e,["token_count"]);return s!=null&&N(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=>gpe(l))),N(r,["parts"],i)}const s=w(e,["role"]);return s!=null&&N(r,["role"],s),r}function dfe(e,t){const r={},a=w(e,["controlType"]);a!=null&&N(r,["controlType"],a);const s=w(e,["enableControlImageComputation"]);return s!=null&&N(r,["computeControl"],s),r}function ufe(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 Afe(e,t,r){const a={},s=w(e,["systemInstruction"]);t!==void 0&&s!=null&&N(t,["systemInstruction"],en(s));const i=w(e,["tools"]);if(t!==void 0&&i!=null){let o=i;Array.isArray(o)&&(o=o.map(d=>$L(d))),N(t,["tools"],o)}const l=w(e,["generationConfig"]);return t!==void 0&&l!=null&&N(t,["generationConfig"],ape(l)),a}function ffe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(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))),N(a,["contents"],o)}const l=w(t,["config"]);return l!=null&&ufe(l),a}function pfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(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)),N(a,["contents"],o)}const l=w(t,["config"]);return l!=null&&Afe(l,a),a}function hfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["totalTokens"]);s!=null&&N(r,["totalTokens"],s);const i=w(e,["cachedContentTokenCount"]);return i!=null&&N(r,["cachedContentTokenCount"],i),r}function xfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["totalTokens"]);return s!=null&&N(r,["totalTokens"],s),r}function mfe(e,t,r){const a={},s=w(t,["model"]);return s!=null&&N(a,["_url","name"],rr(e,s)),a}function gfe(e,t,r){const a={},s=w(t,["model"]);return s!=null&&N(a,["_url","name"],rr(e,s)),a}function bfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);return a!=null&&N(r,["sdkHttpResponse"],a),r}function vfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);return a!=null&&N(r,["sdkHttpResponse"],a),r}function yfe(e,t,r){const a={},s=w(e,["outputGcsUri"]);t!==void 0&&s!=null&&N(t,["parameters","storageUri"],s);const i=w(e,["negativePrompt"]);t!==void 0&&i!=null&&N(t,["parameters","negativePrompt"],i);const l=w(e,["numberOfImages"]);t!==void 0&&l!=null&&N(t,["parameters","sampleCount"],l);const o=w(e,["aspectRatio"]);t!==void 0&&o!=null&&N(t,["parameters","aspectRatio"],o);const d=w(e,["guidanceScale"]);t!==void 0&&d!=null&&N(t,["parameters","guidanceScale"],d);const u=w(e,["seed"]);t!==void 0&&u!=null&&N(t,["parameters","seed"],u);const f=w(e,["safetyFilterLevel"]);t!==void 0&&f!=null&&N(t,["parameters","safetySetting"],f);const p=w(e,["personGeneration"]);t!==void 0&&p!=null&&N(t,["parameters","personGeneration"],p);const x=w(e,["includeSafetyAttributes"]);t!==void 0&&x!=null&&N(t,["parameters","includeSafetyAttributes"],x);const m=w(e,["includeRaiReason"]);t!==void 0&&m!=null&&N(t,["parameters","includeRaiReason"],m);const b=w(e,["language"]);t!==void 0&&b!=null&&N(t,["parameters","language"],b);const v=w(e,["outputMimeType"]);t!==void 0&&v!=null&&N(t,["parameters","outputOptions","mimeType"],v);const y=w(e,["outputCompressionQuality"]);t!==void 0&&y!=null&&N(t,["parameters","outputOptions","compressionQuality"],y);const k=w(e,["addWatermark"]);t!==void 0&&k!=null&&N(t,["parameters","addWatermark"],k);const _=w(e,["labels"]);t!==void 0&&_!=null&&N(t,["labels"],_);const C=w(e,["editMode"]);t!==void 0&&C!=null&&N(t,["parameters","editMode"],C);const E=w(e,["baseSteps"]);return t!==void 0&&E!=null&&N(t,["parameters","editConfig","baseSteps"],E),a}function wfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],rr(e,s));const i=w(t,["prompt"]);i!=null&&N(a,["instances[0]","prompt"],i);const l=w(t,["referenceImages"]);if(l!=null){let d=l;Array.isArray(d)&&(d=d.map(u=>Cpe(u))),N(a,["instances[0]","referenceImages"],d)}const o=w(t,["config"]);return o!=null&&yfe(o,a),a}function Nfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["predictions"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>rv(l))),N(r,["generatedImages"],i)}return r}function Cfe(e,t,r){const a={},s=w(e,["taskType"]);t!==void 0&&s!=null&&N(t,["requests[]","taskType"],s);const i=w(e,["title"]);t!==void 0&&i!=null&&N(t,["requests[]","title"],i);const l=w(e,["outputDimensionality"]);if(t!==void 0&&l!=null&&N(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 kfe(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&&N(t,["instances[]","task_type"],u)}else if(s==="EMBED_CONTENT"){const u=w(e,["taskType"]);t!==void 0&&u!=null&&N(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&&N(t,["instances[]","title"],u)}else if(i==="EMBED_CONTENT"){const u=w(e,["title"]);t!==void 0&&u!=null&&N(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&&N(t,["parameters","outputDimensionality"],u)}else if(l==="EMBED_CONTENT"){const u=w(e,["outputDimensionality"]);t!==void 0&&u!=null&&N(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&&N(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&&N(t,["parameters","autoTruncate"],u)}else if(d==="EMBED_CONTENT"){const u=w(e,["autoTruncate"]);t!==void 0&&u!=null&&N(t,["autoTruncate"],u)}return a}function jfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],rr(e,s));const i=w(t,["contents"]);if(i!=null){let u=Kj(e,i);Array.isArray(u)&&(u=u.map(f=>f)),N(a,["requests[]","content"],u)}const l=w(t,["content"]);l!=null&&Jp(en(l));const o=w(t,["config"]);o!=null&&Cfe(o,a);const d=w(t,["model"]);return d!==void 0&&N(a,["requests[]","model"],rr(e,d)),a}function Efe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(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=Kj(e,d);Array.isArray(u)&&(u=u.map(f=>f)),N(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&&N(a,["content"],en(d))}const o=w(t,["config"]);return o!=null&&kfe(o,a,r),a}function Sfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["embeddings"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(o=>o)),N(r,["embeddings"],l)}const i=w(e,["metadata"]);return i!=null&&N(r,["metadata"],i),r}function Bfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["predictions[]","embeddings"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(o=>ofe(o))),N(r,["embeddings"],l)}const i=w(e,["metadata"]);if(i!=null&&N(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,N(r,["embeddings"],[l])}}return r}function _fe(e,t){const r={},a=w(e,["endpoint"]);a!=null&&N(r,["name"],a);const s=w(e,["deployedModelId"]);return s!=null&&N(r,["deployedModelId"],s),r}function Tfe(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&&N(r,["fileUri"],a);const s=w(e,["mimeType"]);return s!=null&&N(r,["mimeType"],s),r}function Ife(e,t){const r={},a=w(e,["id"]);a!=null&&N(r,["id"],a);const s=w(e,["args"]);s!=null&&N(r,["args"],s);const i=w(e,["name"]);if(i!=null&&N(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 Ffe(e,t){const r={},a=w(e,["allowedFunctionNames"]);a!=null&&N(r,["allowedFunctionNames"],a);const s=w(e,["mode"]);if(s!=null&&N(r,["mode"],s),w(e,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return r}function Dfe(e,t){const r={},a=w(e,["description"]);a!=null&&N(r,["description"],a);const s=w(e,["name"]);s!=null&&N(r,["name"],s);const i=w(e,["parameters"]);i!=null&&N(r,["parameters"],i);const l=w(e,["parametersJsonSchema"]);l!=null&&N(r,["parametersJsonSchema"],l);const o=w(e,["response"]);o!=null&&N(r,["response"],o);const d=w(e,["responseJsonSchema"]);if(d!=null&&N(r,["responseJsonSchema"],d),w(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return r}function Ufe(e,t,r,a){const s={},i=w(t,["systemInstruction"]);r!==void 0&&i!=null&&N(r,["systemInstruction"],Jp(en(i)));const l=w(t,["temperature"]);l!=null&&N(s,["temperature"],l);const o=w(t,["topP"]);o!=null&&N(s,["topP"],o);const d=w(t,["topK"]);d!=null&&N(s,["topK"],d);const u=w(t,["candidateCount"]);u!=null&&N(s,["candidateCount"],u);const f=w(t,["maxOutputTokens"]);f!=null&&N(s,["maxOutputTokens"],f);const p=w(t,["stopSequences"]);p!=null&&N(s,["stopSequences"],p);const x=w(t,["responseLogprobs"]);x!=null&&N(s,["responseLogprobs"],x);const m=w(t,["logprobs"]);m!=null&&N(s,["logprobs"],m);const b=w(t,["presencePenalty"]);b!=null&&N(s,["presencePenalty"],b);const v=w(t,["frequencyPenalty"]);v!=null&&N(s,["frequencyPenalty"],v);const y=w(t,["seed"]);y!=null&&N(s,["seed"],y);const k=w(t,["responseMimeType"]);k!=null&&N(s,["responseMimeType"],k);const _=w(t,["responseSchema"]);_!=null&&N(s,["responseSchema"],qj(_));const C=w(t,["responseJsonSchema"]);if(C!=null&&N(s,["responseJsonSchema"],C),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 H=E;Array.isArray(H)&&(H=H.map(Q=>kpe(Q))),N(r,["safetySettings"],H)}const T=w(t,["tools"]);if(r!==void 0&&T!=null){let H=JA(T);Array.isArray(H)&&(H=H.map(Q=>Ipe(XA(Q)))),N(r,["tools"],H)}const B=w(t,["toolConfig"]);if(r!==void 0&&B!=null&&N(r,["toolConfig"],Tpe(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&&N(r,["cachedContent"],Uo(e,F));const M=w(t,["responseModalities"]);M!=null&&N(s,["responseModalities"],M);const U=w(t,["mediaResolution"]);U!=null&&N(s,["mediaResolution"],U);const D=w(t,["speechConfig"]);if(D!=null&&N(s,["speechConfig"],Wj(D)),w(t,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const L=w(t,["thinkingConfig"]);L!=null&&N(s,["thinkingConfig"],L);const P=w(t,["imageConfig"]);P!=null&&N(s,["imageConfig"],ope(P));const G=w(t,["enableEnhancedCivicAnswers"]);if(G!=null&&N(s,["enableEnhancedCivicAnswers"],G),w(t,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");return s}function Mfe(e,t,r,a){const s={},i=w(t,["systemInstruction"]);r!==void 0&&i!=null&&N(r,["systemInstruction"],en(i));const l=w(t,["temperature"]);l!=null&&N(s,["temperature"],l);const o=w(t,["topP"]);o!=null&&N(s,["topP"],o);const d=w(t,["topK"]);d!=null&&N(s,["topK"],d);const u=w(t,["candidateCount"]);u!=null&&N(s,["candidateCount"],u);const f=w(t,["maxOutputTokens"]);f!=null&&N(s,["maxOutputTokens"],f);const p=w(t,["stopSequences"]);p!=null&&N(s,["stopSequences"],p);const x=w(t,["responseLogprobs"]);x!=null&&N(s,["responseLogprobs"],x);const m=w(t,["logprobs"]);m!=null&&N(s,["logprobs"],m);const b=w(t,["presencePenalty"]);b!=null&&N(s,["presencePenalty"],b);const v=w(t,["frequencyPenalty"]);v!=null&&N(s,["frequencyPenalty"],v);const y=w(t,["seed"]);y!=null&&N(s,["seed"],y);const k=w(t,["responseMimeType"]);k!=null&&N(s,["responseMimeType"],k);const _=w(t,["responseSchema"]);_!=null&&N(s,["responseSchema"],qj(_));const C=w(t,["responseJsonSchema"]);C!=null&&N(s,["responseJsonSchema"],C);const E=w(t,["routingConfig"]);E!=null&&N(s,["routingConfig"],E);const T=w(t,["modelSelectionConfig"]);T!=null&&N(s,["modelConfig"],T);const B=w(t,["safetySettings"]);if(r!==void 0&&B!=null){let ee=B;Array.isArray(ee)&&(ee=ee.map(J=>J)),N(r,["safetySettings"],ee)}const F=w(t,["tools"]);if(r!==void 0&&F!=null){let ee=JA(F);Array.isArray(ee)&&(ee=ee.map(J=>$L(XA(J)))),N(r,["tools"],ee)}const M=w(t,["toolConfig"]);r!==void 0&&M!=null&&N(r,["toolConfig"],M);const U=w(t,["labels"]);r!==void 0&&U!=null&&N(r,["labels"],U);const D=w(t,["cachedContent"]);r!==void 0&&D!=null&&N(r,["cachedContent"],Uo(e,D));const L=w(t,["responseModalities"]);L!=null&&N(s,["responseModalities"],L);const P=w(t,["mediaResolution"]);P!=null&&N(s,["mediaResolution"],P);const G=w(t,["speechConfig"]);G!=null&&N(s,["speechConfig"],Wj(G));const H=w(t,["audioTimestamp"]);H!=null&&N(s,["audioTimestamp"],H);const Q=w(t,["thinkingConfig"]);Q!=null&&N(s,["thinkingConfig"],Q);const Y=w(t,["imageConfig"]);if(Y!=null&&N(s,["imageConfig"],cpe(Y)),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&&N(r,["modelArmorConfig"],K),s}function V3(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(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))),N(a,["contents"],o)}const l=w(t,["config"]);return l!=null&&N(a,["generationConfig"],Ufe(e,l,a)),a}function G3(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(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)),N(a,["contents"],o)}const l=w(t,["config"]);return l!=null&&N(a,["generationConfig"],Mfe(e,l,a)),a}function K3(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["candidates"]);if(s!=null){let u=s;Array.isArray(u)&&(u=u.map(f=>nfe(f))),N(r,["candidates"],u)}const i=w(e,["modelVersion"]);i!=null&&N(r,["modelVersion"],i);const l=w(e,["promptFeedback"]);l!=null&&N(r,["promptFeedback"],l);const o=w(e,["responseId"]);o!=null&&N(r,["responseId"],o);const d=w(e,["usageMetadata"]);return d!=null&&N(r,["usageMetadata"],d),r}function q3(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["candidates"]);if(s!=null){let f=s;Array.isArray(f)&&(f=f.map(p=>p)),N(r,["candidates"],f)}const i=w(e,["createTime"]);i!=null&&N(r,["createTime"],i);const l=w(e,["modelVersion"]);l!=null&&N(r,["modelVersion"],l);const o=w(e,["promptFeedback"]);o!=null&&N(r,["promptFeedback"],o);const d=w(e,["responseId"]);d!=null&&N(r,["responseId"],d);const u=w(e,["usageMetadata"]);return u!=null&&N(r,["usageMetadata"],u),r}function Rfe(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&&N(t,["parameters","sampleCount"],s);const i=w(e,["aspectRatio"]);t!==void 0&&i!=null&&N(t,["parameters","aspectRatio"],i);const l=w(e,["guidanceScale"]);if(t!==void 0&&l!=null&&N(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&&N(t,["parameters","safetySetting"],o);const d=w(e,["personGeneration"]);t!==void 0&&d!=null&&N(t,["parameters","personGeneration"],d);const u=w(e,["includeSafetyAttributes"]);t!==void 0&&u!=null&&N(t,["parameters","includeSafetyAttributes"],u);const f=w(e,["includeRaiReason"]);t!==void 0&&f!=null&&N(t,["parameters","includeRaiReason"],f);const p=w(e,["language"]);t!==void 0&&p!=null&&N(t,["parameters","language"],p);const x=w(e,["outputMimeType"]);t!==void 0&&x!=null&&N(t,["parameters","outputOptions","mimeType"],x);const m=w(e,["outputCompressionQuality"]);if(t!==void 0&&m!=null&&N(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&&N(t,["parameters","sampleImageSize"],b),w(e,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return a}function Ofe(e,t,r){const a={},s=w(e,["outputGcsUri"]);t!==void 0&&s!=null&&N(t,["parameters","storageUri"],s);const i=w(e,["negativePrompt"]);t!==void 0&&i!=null&&N(t,["parameters","negativePrompt"],i);const l=w(e,["numberOfImages"]);t!==void 0&&l!=null&&N(t,["parameters","sampleCount"],l);const o=w(e,["aspectRatio"]);t!==void 0&&o!=null&&N(t,["parameters","aspectRatio"],o);const d=w(e,["guidanceScale"]);t!==void 0&&d!=null&&N(t,["parameters","guidanceScale"],d);const u=w(e,["seed"]);t!==void 0&&u!=null&&N(t,["parameters","seed"],u);const f=w(e,["safetyFilterLevel"]);t!==void 0&&f!=null&&N(t,["parameters","safetySetting"],f);const p=w(e,["personGeneration"]);t!==void 0&&p!=null&&N(t,["parameters","personGeneration"],p);const x=w(e,["includeSafetyAttributes"]);t!==void 0&&x!=null&&N(t,["parameters","includeSafetyAttributes"],x);const m=w(e,["includeRaiReason"]);t!==void 0&&m!=null&&N(t,["parameters","includeRaiReason"],m);const b=w(e,["language"]);t!==void 0&&b!=null&&N(t,["parameters","language"],b);const v=w(e,["outputMimeType"]);t!==void 0&&v!=null&&N(t,["parameters","outputOptions","mimeType"],v);const y=w(e,["outputCompressionQuality"]);t!==void 0&&y!=null&&N(t,["parameters","outputOptions","compressionQuality"],y);const k=w(e,["addWatermark"]);t!==void 0&&k!=null&&N(t,["parameters","addWatermark"],k);const _=w(e,["labels"]);t!==void 0&&_!=null&&N(t,["labels"],_);const C=w(e,["imageSize"]);t!==void 0&&C!=null&&N(t,["parameters","sampleImageSize"],C);const E=w(e,["enhancePrompt"]);return t!==void 0&&E!=null&&N(t,["parameters","enhancePrompt"],E),a}function Pfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],rr(e,s));const i=w(t,["prompt"]);i!=null&&N(a,["instances[0]","prompt"],i);const l=w(t,["config"]);return l!=null&&Rfe(l,a),a}function Lfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],rr(e,s));const i=w(t,["prompt"]);i!=null&&N(a,["instances[0]","prompt"],i);const l=w(t,["config"]);return l!=null&&Ofe(l,a),a}function Qfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["predictions"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(o=>Zfe(o))),N(r,["generatedImages"],l)}const i=w(e,["positivePromptSafetyAttributes"]);return i!=null&&N(r,["positivePromptSafetyAttributes"],HL(i)),r}function Hfe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["predictions"]);if(s!=null){let l=s;Array.isArray(l)&&(l=l.map(o=>rv(o))),N(r,["generatedImages"],l)}const i=w(e,["positivePromptSafetyAttributes"]);return i!=null&&N(r,["positivePromptSafetyAttributes"],zL(i)),r}function zfe(e,t,r){const a={},s=w(e,["numberOfVideos"]);if(t!==void 0&&s!=null&&N(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&&N(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&&N(t,["parameters","aspectRatio"],l);const o=w(e,["resolution"]);t!==void 0&&o!=null&&N(t,["parameters","resolution"],o);const d=w(e,["personGeneration"]);if(t!==void 0&&d!=null&&N(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&&N(t,["parameters","negativePrompt"],u);const f=w(e,["enhancePrompt"]);if(t!==void 0&&f!=null&&N(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&&N(t,["instances[0]","lastFrame"],av(p));const x=w(e,["referenceImages"]);if(t!==void 0&&x!=null){let m=x;Array.isArray(m)&&(m=m.map(b=>Vpe(b))),N(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 $fe(e,t,r){const a={},s=w(e,["numberOfVideos"]);t!==void 0&&s!=null&&N(t,["parameters","sampleCount"],s);const i=w(e,["outputGcsUri"]);t!==void 0&&i!=null&&N(t,["parameters","storageUri"],i);const l=w(e,["fps"]);t!==void 0&&l!=null&&N(t,["parameters","fps"],l);const o=w(e,["durationSeconds"]);t!==void 0&&o!=null&&N(t,["parameters","durationSeconds"],o);const d=w(e,["seed"]);t!==void 0&&d!=null&&N(t,["parameters","seed"],d);const u=w(e,["aspectRatio"]);t!==void 0&&u!=null&&N(t,["parameters","aspectRatio"],u);const f=w(e,["resolution"]);t!==void 0&&f!=null&&N(t,["parameters","resolution"],f);const p=w(e,["personGeneration"]);t!==void 0&&p!=null&&N(t,["parameters","personGeneration"],p);const x=w(e,["pubsubTopic"]);t!==void 0&&x!=null&&N(t,["parameters","pubsubTopic"],x);const m=w(e,["negativePrompt"]);t!==void 0&&m!=null&&N(t,["parameters","negativePrompt"],m);const b=w(e,["enhancePrompt"]);t!==void 0&&b!=null&&N(t,["parameters","enhancePrompt"],b);const v=w(e,["generateAudio"]);t!==void 0&&v!=null&&N(t,["parameters","generateAudio"],v);const y=w(e,["lastFrame"]);t!==void 0&&y!=null&&N(t,["instances[0]","lastFrame"],Ji(y));const k=w(e,["referenceImages"]);if(t!==void 0&&k!=null){let E=k;Array.isArray(E)&&(E=E.map(T=>Gpe(T))),N(t,["instances[0]","referenceImages"],E)}const _=w(e,["mask"]);t!==void 0&&_!=null&&N(t,["instances[0]","mask"],$pe(_));const C=w(e,["compressionQuality"]);return t!==void 0&&C!=null&&N(t,["parameters","compressionQuality"],C),a}function Vfe(e,t){const r={},a=w(e,["name"]);a!=null&&N(r,["name"],a);const s=w(e,["metadata"]);s!=null&&N(r,["metadata"],s);const i=w(e,["done"]);i!=null&&N(r,["done"],i);const l=w(e,["error"]);l!=null&&N(r,["error"],l);const o=w(e,["response","generateVideoResponse"]);return o!=null&&N(r,["response"],Wfe(o)),r}function Gfe(e,t){const r={},a=w(e,["name"]);a!=null&&N(r,["name"],a);const s=w(e,["metadata"]);s!=null&&N(r,["metadata"],s);const i=w(e,["done"]);i!=null&&N(r,["done"],i);const l=w(e,["error"]);l!=null&&N(r,["error"],l);const o=w(e,["response"]);return o!=null&&N(r,["response"],Yfe(o)),r}function Kfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],rr(e,s));const i=w(t,["prompt"]);i!=null&&N(a,["instances[0]","prompt"],i);const l=w(t,["image"]);l!=null&&N(a,["instances[0]","image"],av(l));const o=w(t,["video"]);o!=null&&N(a,["instances[0]","video"],VL(o));const d=w(t,["source"]);d!=null&&Xfe(d,a);const u=w(t,["config"]);return u!=null&&zfe(u,a),a}function qfe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],rr(e,s));const i=w(t,["prompt"]);i!=null&&N(a,["instances[0]","prompt"],i);const l=w(t,["image"]);l!=null&&N(a,["instances[0]","image"],Ji(l));const o=w(t,["video"]);o!=null&&N(a,["instances[0]","video"],GL(o));const d=w(t,["source"]);d!=null&&Jfe(d,a);const u=w(t,["config"]);return u!=null&&$fe(u,a),a}function Wfe(e,t){const r={},a=w(e,["generatedSamples"]);if(a!=null){let l=a;Array.isArray(l)&&(l=l.map(o=>tpe(o))),N(r,["generatedVideos"],l)}const s=w(e,["raiMediaFilteredCount"]);s!=null&&N(r,["raiMediaFilteredCount"],s);const i=w(e,["raiMediaFilteredReasons"]);return i!=null&&N(r,["raiMediaFilteredReasons"],i),r}function Yfe(e,t){const r={},a=w(e,["videos"]);if(a!=null){let l=a;Array.isArray(l)&&(l=l.map(o=>rpe(o))),N(r,["generatedVideos"],l)}const s=w(e,["raiMediaFilteredCount"]);s!=null&&N(r,["raiMediaFilteredCount"],s);const i=w(e,["raiMediaFilteredReasons"]);return i!=null&&N(r,["raiMediaFilteredReasons"],i),r}function Xfe(e,t,r){const a={},s=w(e,["prompt"]);t!==void 0&&s!=null&&N(t,["instances[0]","prompt"],s);const i=w(e,["image"]);t!==void 0&&i!=null&&N(t,["instances[0]","image"],av(i));const l=w(e,["video"]);return t!==void 0&&l!=null&&N(t,["instances[0]","video"],VL(l)),a}function Jfe(e,t,r){const a={},s=w(e,["prompt"]);t!==void 0&&s!=null&&N(t,["instances[0]","prompt"],s);const i=w(e,["image"]);t!==void 0&&i!=null&&N(t,["instances[0]","image"],Ji(i));const l=w(e,["video"]);return t!==void 0&&l!=null&&N(t,["instances[0]","video"],GL(l)),a}function Zfe(e,t){const r={},a=w(e,["_self"]);a!=null&&N(r,["image"],dpe(a));const s=w(e,["raiFilteredReason"]);s!=null&&N(r,["raiFilteredReason"],s);const i=w(e,["_self"]);return i!=null&&N(r,["safetyAttributes"],HL(i)),r}function rv(e,t){const r={},a=w(e,["_self"]);a!=null&&N(r,["image"],QL(a));const s=w(e,["raiFilteredReason"]);s!=null&&N(r,["raiFilteredReason"],s);const i=w(e,["_self"]);i!=null&&N(r,["safetyAttributes"],zL(i));const l=w(e,["prompt"]);return l!=null&&N(r,["enhancedPrompt"],l),r}function epe(e,t){const r={},a=w(e,["_self"]);a!=null&&N(r,["mask"],QL(a));const s=w(e,["labels"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(r,["labels"],i)}return r}function tpe(e,t){const r={},a=w(e,["video"]);return a!=null&&N(r,["video"],Hpe(a)),r}function rpe(e,t){const r={},a=w(e,["_self"]);return a!=null&&N(r,["video"],zpe(a)),r}function ape(e,t){const r={},a=w(e,["modelSelectionConfig"]);a!=null&&N(r,["modelConfig"],a);const s=w(e,["responseJsonSchema"]);s!=null&&N(r,["responseJsonSchema"],s);const i=w(e,["audioTimestamp"]);i!=null&&N(r,["audioTimestamp"],i);const l=w(e,["candidateCount"]);l!=null&&N(r,["candidateCount"],l);const o=w(e,["enableAffectiveDialog"]);o!=null&&N(r,["enableAffectiveDialog"],o);const d=w(e,["frequencyPenalty"]);d!=null&&N(r,["frequencyPenalty"],d);const u=w(e,["logprobs"]);u!=null&&N(r,["logprobs"],u);const f=w(e,["maxOutputTokens"]);f!=null&&N(r,["maxOutputTokens"],f);const p=w(e,["mediaResolution"]);p!=null&&N(r,["mediaResolution"],p);const x=w(e,["presencePenalty"]);x!=null&&N(r,["presencePenalty"],x);const m=w(e,["responseLogprobs"]);m!=null&&N(r,["responseLogprobs"],m);const b=w(e,["responseMimeType"]);b!=null&&N(r,["responseMimeType"],b);const v=w(e,["responseModalities"]);v!=null&&N(r,["responseModalities"],v);const y=w(e,["responseSchema"]);y!=null&&N(r,["responseSchema"],y);const k=w(e,["routingConfig"]);k!=null&&N(r,["routingConfig"],k);const _=w(e,["seed"]);_!=null&&N(r,["seed"],_);const C=w(e,["speechConfig"]);C!=null&&N(r,["speechConfig"],C);const E=w(e,["stopSequences"]);E!=null&&N(r,["stopSequences"],E);const T=w(e,["temperature"]);T!=null&&N(r,["temperature"],T);const B=w(e,["thinkingConfig"]);B!=null&&N(r,["thinkingConfig"],B);const F=w(e,["topK"]);F!=null&&N(r,["topK"],F);const M=w(e,["topP"]);if(M!=null&&N(r,["topP"],M),w(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return r}function npe(e,t,r){const a={},s=w(t,["model"]);return s!=null&&N(a,["_url","name"],rr(e,s)),a}function spe(e,t,r){const a={},s=w(t,["model"]);return s!=null&&N(a,["_url","name"],rr(e,s)),a}function ipe(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&&N(r,["enableWidget"],a),r}function lpe(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&&N(r,["timeRangeFilter"],a),r}function ope(e,t){const r={},a=w(e,["aspectRatio"]);a!=null&&N(r,["aspectRatio"],a);const s=w(e,["imageSize"]);if(s!=null&&N(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 cpe(e,t){const r={},a=w(e,["aspectRatio"]);a!=null&&N(r,["aspectRatio"],a);const s=w(e,["imageSize"]);s!=null&&N(r,["imageSize"],s);const i=w(e,["personGeneration"]);i!=null&&N(r,["personGeneration"],i);const l=w(e,["outputMimeType"]);l!=null&&N(r,["imageOutputOptions","mimeType"],l);const o=w(e,["outputCompressionQuality"]);return o!=null&&N(r,["imageOutputOptions","compressionQuality"],o),r}function dpe(e,t){const r={},a=w(e,["bytesBase64Encoded"]);a!=null&&N(r,["imageBytes"],$c(a));const s=w(e,["mimeType"]);return s!=null&&N(r,["mimeType"],s),r}function QL(e,t){const r={},a=w(e,["gcsUri"]);a!=null&&N(r,["gcsUri"],a);const s=w(e,["bytesBase64Encoded"]);s!=null&&N(r,["imageBytes"],$c(s));const i=w(e,["mimeType"]);return i!=null&&N(r,["mimeType"],i),r}function av(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&&N(r,["bytesBase64Encoded"],$c(a));const s=w(e,["mimeType"]);return s!=null&&N(r,["mimeType"],s),r}function Ji(e,t){const r={},a=w(e,["gcsUri"]);a!=null&&N(r,["gcsUri"],a);const s=w(e,["imageBytes"]);s!=null&&N(r,["bytesBase64Encoded"],$c(s));const i=w(e,["mimeType"]);return i!=null&&N(r,["mimeType"],i),r}function upe(e,t,r,a){const s={},i=w(t,["pageSize"]);r!==void 0&&i!=null&&N(r,["_query","pageSize"],i);const l=w(t,["pageToken"]);r!==void 0&&l!=null&&N(r,["_query","pageToken"],l);const o=w(t,["filter"]);r!==void 0&&o!=null&&N(r,["_query","filter"],o);const d=w(t,["queryBase"]);return r!==void 0&&d!=null&&N(r,["_url","models_url"],DL(e,d)),s}function Ape(e,t,r,a){const s={},i=w(t,["pageSize"]);r!==void 0&&i!=null&&N(r,["_query","pageSize"],i);const l=w(t,["pageToken"]);r!==void 0&&l!=null&&N(r,["_query","pageToken"],l);const o=w(t,["filter"]);r!==void 0&&o!=null&&N(r,["_query","filter"],o);const d=w(t,["queryBase"]);return r!==void 0&&d!=null&&N(r,["_url","models_url"],DL(e,d)),s}function fpe(e,t,r){const a={},s=w(t,["config"]);return s!=null&&upe(e,s,a),a}function ppe(e,t,r){const a={},s=w(t,["config"]);return s!=null&&Ape(e,s,a),a}function hpe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["nextPageToken"]);s!=null&&N(r,["nextPageToken"],s);const i=w(e,["_self"]);if(i!=null){let l=UL(i);Array.isArray(l)&&(l=l.map(o=>AC(o))),N(r,["models"],l)}return r}function xpe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["nextPageToken"]);s!=null&&N(r,["nextPageToken"],s);const i=w(e,["_self"]);if(i!=null){let l=UL(i);Array.isArray(l)&&(l=l.map(o=>fC(o))),N(r,["models"],l)}return r}function mpe(e,t){const r={},a=w(e,["maskMode"]);a!=null&&N(r,["maskMode"],a);const s=w(e,["segmentationClasses"]);s!=null&&N(r,["maskClasses"],s);const i=w(e,["maskDilation"]);return i!=null&&N(r,["dilation"],i),r}function AC(e,t){const r={},a=w(e,["name"]);a!=null&&N(r,["name"],a);const s=w(e,["displayName"]);s!=null&&N(r,["displayName"],s);const i=w(e,["description"]);i!=null&&N(r,["description"],i);const l=w(e,["version"]);l!=null&&N(r,["version"],l);const o=w(e,["_self"]);o!=null&&N(r,["tunedModelInfo"],Fpe(o));const d=w(e,["inputTokenLimit"]);d!=null&&N(r,["inputTokenLimit"],d);const u=w(e,["outputTokenLimit"]);u!=null&&N(r,["outputTokenLimit"],u);const f=w(e,["supportedGenerationMethods"]);f!=null&&N(r,["supportedActions"],f);const p=w(e,["temperature"]);p!=null&&N(r,["temperature"],p);const x=w(e,["maxTemperature"]);x!=null&&N(r,["maxTemperature"],x);const m=w(e,["topP"]);m!=null&&N(r,["topP"],m);const b=w(e,["topK"]);b!=null&&N(r,["topK"],b);const v=w(e,["thinking"]);return v!=null&&N(r,["thinking"],v),r}function fC(e,t){const r={},a=w(e,["name"]);a!=null&&N(r,["name"],a);const s=w(e,["displayName"]);s!=null&&N(r,["displayName"],s);const i=w(e,["description"]);i!=null&&N(r,["description"],i);const l=w(e,["versionId"]);l!=null&&N(r,["version"],l);const o=w(e,["deployedModels"]);if(o!=null){let x=o;Array.isArray(x)&&(x=x.map(m=>_fe(m))),N(r,["endpoints"],x)}const d=w(e,["labels"]);d!=null&&N(r,["labels"],d);const u=w(e,["_self"]);u!=null&&N(r,["tunedModelInfo"],Dpe(u));const f=w(e,["defaultCheckpointId"]);f!=null&&N(r,["defaultCheckpointId"],f);const p=w(e,["checkpoints"]);if(p!=null){let x=p;Array.isArray(x)&&(x=x.map(m=>m)),N(r,["checkpoints"],x)}return r}function gpe(e,t){const r={},a=w(e,["mediaResolution"]);a!=null&&N(r,["mediaResolution"],a);const s=w(e,["codeExecutionResult"]);s!=null&&N(r,["codeExecutionResult"],s);const i=w(e,["executableCode"]);i!=null&&N(r,["executableCode"],i);const l=w(e,["fileData"]);l!=null&&N(r,["fileData"],Tfe(l));const o=w(e,["functionCall"]);o!=null&&N(r,["functionCall"],Ife(o));const d=w(e,["functionResponse"]);d!=null&&N(r,["functionResponse"],d);const u=w(e,["inlineData"]);u!=null&&N(r,["inlineData"],afe(u));const f=w(e,["text"]);f!=null&&N(r,["text"],f);const p=w(e,["thought"]);p!=null&&N(r,["thought"],p);const x=w(e,["thoughtSignature"]);x!=null&&N(r,["thoughtSignature"],x);const m=w(e,["videoMetadata"]);return m!=null&&N(r,["videoMetadata"],m),r}function bpe(e,t){const r={},a=w(e,["productImage"]);return a!=null&&N(r,["image"],Ji(a)),r}function vpe(e,t,r){const a={},s=w(e,["numberOfImages"]);t!==void 0&&s!=null&&N(t,["parameters","sampleCount"],s);const i=w(e,["baseSteps"]);t!==void 0&&i!=null&&N(t,["parameters","baseSteps"],i);const l=w(e,["outputGcsUri"]);t!==void 0&&l!=null&&N(t,["parameters","storageUri"],l);const o=w(e,["seed"]);t!==void 0&&o!=null&&N(t,["parameters","seed"],o);const d=w(e,["safetyFilterLevel"]);t!==void 0&&d!=null&&N(t,["parameters","safetySetting"],d);const u=w(e,["personGeneration"]);t!==void 0&&u!=null&&N(t,["parameters","personGeneration"],u);const f=w(e,["addWatermark"]);t!==void 0&&f!=null&&N(t,["parameters","addWatermark"],f);const p=w(e,["outputMimeType"]);t!==void 0&&p!=null&&N(t,["parameters","outputOptions","mimeType"],p);const x=w(e,["outputCompressionQuality"]);t!==void 0&&x!=null&&N(t,["parameters","outputOptions","compressionQuality"],x);const m=w(e,["enhancePrompt"]);t!==void 0&&m!=null&&N(t,["parameters","enhancePrompt"],m);const b=w(e,["labels"]);return t!==void 0&&b!=null&&N(t,["labels"],b),a}function ype(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],rr(e,s));const i=w(t,["source"]);i!=null&&Npe(i,a);const l=w(t,["config"]);return l!=null&&vpe(l,a),a}function wpe(e,t){const r={},a=w(e,["predictions"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(i=>rv(i))),N(r,["generatedImages"],s)}return r}function Npe(e,t,r){const a={},s=w(e,["prompt"]);t!==void 0&&s!=null&&N(t,["instances[0]","prompt"],s);const i=w(e,["personImage"]);t!==void 0&&i!=null&&N(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=>bpe(d))),N(t,["instances[0]","productImages"],o)}return a}function Cpe(e,t){const r={},a=w(e,["referenceImage"]);a!=null&&N(r,["referenceImage"],Ji(a));const s=w(e,["referenceId"]);s!=null&&N(r,["referenceId"],s);const i=w(e,["referenceType"]);i!=null&&N(r,["referenceType"],i);const l=w(e,["maskImageConfig"]);l!=null&&N(r,["maskImageConfig"],mpe(l));const o=w(e,["controlImageConfig"]);o!=null&&N(r,["controlImageConfig"],dfe(o));const d=w(e,["styleImageConfig"]);d!=null&&N(r,["styleImageConfig"],d);const u=w(e,["subjectImageConfig"]);return u!=null&&N(r,["subjectImageConfig"],u),r}function HL(e,t){const r={},a=w(e,["safetyAttributes","categories"]);a!=null&&N(r,["categories"],a);const s=w(e,["safetyAttributes","scores"]);s!=null&&N(r,["scores"],s);const i=w(e,["contentType"]);return i!=null&&N(r,["contentType"],i),r}function zL(e,t){const r={},a=w(e,["safetyAttributes","categories"]);a!=null&&N(r,["categories"],a);const s=w(e,["safetyAttributes","scores"]);s!=null&&N(r,["scores"],s);const i=w(e,["contentType"]);return i!=null&&N(r,["contentType"],i),r}function kpe(e,t){const r={},a=w(e,["category"]);if(a!=null&&N(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&&N(r,["threshold"],s),r}function jpe(e,t){const r={},a=w(e,["image"]);return a!=null&&N(r,["image"],Ji(a)),r}function Epe(e,t,r){const a={},s=w(e,["mode"]);t!==void 0&&s!=null&&N(t,["parameters","mode"],s);const i=w(e,["maxPredictions"]);t!==void 0&&i!=null&&N(t,["parameters","maxPredictions"],i);const l=w(e,["confidenceThreshold"]);t!==void 0&&l!=null&&N(t,["parameters","confidenceThreshold"],l);const o=w(e,["maskDilation"]);t!==void 0&&o!=null&&N(t,["parameters","maskDilation"],o);const d=w(e,["binaryColorThreshold"]);t!==void 0&&d!=null&&N(t,["parameters","binaryColorThreshold"],d);const u=w(e,["labels"]);return t!==void 0&&u!=null&&N(t,["labels"],u),a}function Spe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],rr(e,s));const i=w(t,["source"]);i!=null&&_pe(i,a);const l=w(t,["config"]);return l!=null&&Epe(l,a),a}function Bpe(e,t){const r={},a=w(e,["predictions"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(i=>epe(i))),N(r,["generatedMasks"],s)}return r}function _pe(e,t,r){const a={},s=w(e,["prompt"]);t!==void 0&&s!=null&&N(t,["instances[0]","prompt"],s);const i=w(e,["image"]);t!==void 0&&i!=null&&N(t,["instances[0]","image"],Ji(i));const l=w(e,["scribbleImage"]);return t!==void 0&&l!=null&&N(t,["instances[0]","scribble"],jpe(l)),a}function Tpe(e,t){const r={},a=w(e,["retrievalConfig"]);a!=null&&N(r,["retrievalConfig"],a);const s=w(e,["functionCallingConfig"]);return s!=null&&N(r,["functionCallingConfig"],Ffe(s)),r}function Ipe(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&&N(r,["computerUse"],a);const s=w(e,["fileSearch"]);s!=null&&N(r,["fileSearch"],s);const i=w(e,["codeExecution"]);if(i!=null&&N(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(x=>x)),N(r,["functionDeclarations"],p)}const o=w(e,["googleMaps"]);o!=null&&N(r,["googleMaps"],ipe(o));const d=w(e,["googleSearch"]);d!=null&&N(r,["googleSearch"],lpe(d));const u=w(e,["googleSearchRetrieval"]);u!=null&&N(r,["googleSearchRetrieval"],u);const f=w(e,["urlContext"]);return f!=null&&N(r,["urlContext"],f),r}function $L(e,t){const r={},a=w(e,["retrieval"]);a!=null&&N(r,["retrieval"],a);const s=w(e,["computerUse"]);if(s!=null&&N(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&&N(r,["codeExecution"],i);const l=w(e,["enterpriseWebSearch"]);l!=null&&N(r,["enterpriseWebSearch"],l);const o=w(e,["functionDeclarations"]);if(o!=null){let x=o;Array.isArray(x)&&(x=x.map(m=>Dfe(m))),N(r,["functionDeclarations"],x)}const d=w(e,["googleMaps"]);d!=null&&N(r,["googleMaps"],d);const u=w(e,["googleSearch"]);u!=null&&N(r,["googleSearch"],u);const f=w(e,["googleSearchRetrieval"]);f!=null&&N(r,["googleSearchRetrieval"],f);const p=w(e,["urlContext"]);return p!=null&&N(r,["urlContext"],p),r}function Fpe(e,t){const r={},a=w(e,["baseModel"]);a!=null&&N(r,["baseModel"],a);const s=w(e,["createTime"]);s!=null&&N(r,["createTime"],s);const i=w(e,["updateTime"]);return i!=null&&N(r,["updateTime"],i),r}function Dpe(e,t){const r={},a=w(e,["labels","google-vertex-llm-tuning-base-model-id"]);a!=null&&N(r,["baseModel"],a);const s=w(e,["createTime"]);s!=null&&N(r,["createTime"],s);const i=w(e,["updateTime"]);return i!=null&&N(r,["updateTime"],i),r}function Upe(e,t,r){const a={},s=w(e,["displayName"]);t!==void 0&&s!=null&&N(t,["displayName"],s);const i=w(e,["description"]);t!==void 0&&i!=null&&N(t,["description"],i);const l=w(e,["defaultCheckpointId"]);return t!==void 0&&l!=null&&N(t,["defaultCheckpointId"],l),a}function Mpe(e,t,r){const a={},s=w(e,["displayName"]);t!==void 0&&s!=null&&N(t,["displayName"],s);const i=w(e,["description"]);t!==void 0&&i!=null&&N(t,["description"],i);const l=w(e,["defaultCheckpointId"]);return t!==void 0&&l!=null&&N(t,["defaultCheckpointId"],l),a}function Rpe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","name"],rr(e,s));const i=w(t,["config"]);return i!=null&&Upe(i,a),a}function Ope(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],rr(e,s));const i=w(t,["config"]);return i!=null&&Mpe(i,a),a}function Ppe(e,t,r){const a={},s=w(e,["outputGcsUri"]);t!==void 0&&s!=null&&N(t,["parameters","storageUri"],s);const i=w(e,["safetyFilterLevel"]);t!==void 0&&i!=null&&N(t,["parameters","safetySetting"],i);const l=w(e,["personGeneration"]);t!==void 0&&l!=null&&N(t,["parameters","personGeneration"],l);const o=w(e,["includeRaiReason"]);t!==void 0&&o!=null&&N(t,["parameters","includeRaiReason"],o);const d=w(e,["outputMimeType"]);t!==void 0&&d!=null&&N(t,["parameters","outputOptions","mimeType"],d);const u=w(e,["outputCompressionQuality"]);t!==void 0&&u!=null&&N(t,["parameters","outputOptions","compressionQuality"],u);const f=w(e,["enhanceInputImage"]);t!==void 0&&f!=null&&N(t,["parameters","upscaleConfig","enhanceInputImage"],f);const p=w(e,["imagePreservationFactor"]);t!==void 0&&p!=null&&N(t,["parameters","upscaleConfig","imagePreservationFactor"],p);const x=w(e,["labels"]);t!==void 0&&x!=null&&N(t,["labels"],x);const m=w(e,["numberOfImages"]);t!==void 0&&m!=null&&N(t,["parameters","sampleCount"],m);const b=w(e,["mode"]);return t!==void 0&&b!=null&&N(t,["parameters","mode"],b),a}function Lpe(e,t,r){const a={},s=w(t,["model"]);s!=null&&N(a,["_url","model"],rr(e,s));const i=w(t,["image"]);i!=null&&N(a,["instances[0]","image"],Ji(i));const l=w(t,["upscaleFactor"]);l!=null&&N(a,["parameters","upscaleConfig","upscaleFactor"],l);const o=w(t,["config"]);return o!=null&&Ppe(o,a),a}function Qpe(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["predictions"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>rv(l))),N(r,["generatedImages"],i)}return r}function Hpe(e,t){const r={},a=w(e,["uri"]);a!=null&&N(r,["uri"],a);const s=w(e,["encodedVideo"]);s!=null&&N(r,["videoBytes"],$c(s));const i=w(e,["encoding"]);return i!=null&&N(r,["mimeType"],i),r}function zpe(e,t){const r={},a=w(e,["gcsUri"]);a!=null&&N(r,["uri"],a);const s=w(e,["bytesBase64Encoded"]);s!=null&&N(r,["videoBytes"],$c(s));const i=w(e,["mimeType"]);return i!=null&&N(r,["mimeType"],i),r}function $pe(e,t){const r={},a=w(e,["image"]);a!=null&&N(r,["_self"],Ji(a));const s=w(e,["maskMode"]);return s!=null&&N(r,["maskMode"],s),r}function Vpe(e,t){const r={},a=w(e,["image"]);a!=null&&N(r,["image"],av(a));const s=w(e,["referenceType"]);return s!=null&&N(r,["referenceType"],s),r}function Gpe(e,t){const r={},a=w(e,["image"]);a!=null&&N(r,["image"],Ji(a));const s=w(e,["referenceType"]);return s!=null&&N(r,["referenceType"],s),r}function VL(e,t){const r={},a=w(e,["uri"]);a!=null&&N(r,["uri"],a);const s=w(e,["videoBytes"]);s!=null&&N(r,["encodedVideo"],$c(s));const i=w(e,["mimeType"]);return i!=null&&N(r,["encoding"],i),r}function GL(e,t){const r={},a=w(e,["uri"]);a!=null&&N(r,["gcsUri"],a);const s=w(e,["videoBytes"]);s!=null&&N(r,["bytesBase64Encoded"],$c(s));const i=w(e,["mimeType"]);return i!=null&&N(r,["mimeType"],i),r}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Kpe(e,t){const r={},a=w(e,["displayName"]);return t!==void 0&&a!=null&&N(t,["displayName"],a),r}function qpe(e){const t={},r=w(e,["config"]);return r!=null&&Kpe(r,t),t}function Wpe(e,t){const r={},a=w(e,["force"]);return t!==void 0&&a!=null&&N(t,["_query","force"],a),r}function Ype(e){const t={},r=w(e,["name"]);r!=null&&N(t,["_url","name"],r);const a=w(e,["config"]);return a!=null&&Wpe(a,t),t}function Xpe(e){const t={},r=w(e,["name"]);return r!=null&&N(t,["_url","name"],r),t}function Jpe(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)),N(t,["customMetadata"],i)}const s=w(e,["chunkingConfig"]);return t!==void 0&&s!=null&&N(t,["chunkingConfig"],s),r}function Zpe(e){const t={},r=w(e,["name"]);r!=null&&N(t,["name"],r);const a=w(e,["metadata"]);a!=null&&N(t,["metadata"],a);const s=w(e,["done"]);s!=null&&N(t,["done"],s);const i=w(e,["error"]);i!=null&&N(t,["error"],i);const l=w(e,["response"]);return l!=null&&N(t,["response"],the(l)),t}function ehe(e){const t={},r=w(e,["fileSearchStoreName"]);r!=null&&N(t,["_url","file_search_store_name"],r);const a=w(e,["fileName"]);a!=null&&N(t,["fileName"],a);const s=w(e,["config"]);return s!=null&&Jpe(s,t),t}function the(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["parent"]);a!=null&&N(t,["parent"],a);const s=w(e,["documentName"]);return s!=null&&N(t,["documentName"],s),t}function rhe(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&N(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);return t!==void 0&&s!=null&&N(t,["_query","pageToken"],s),r}function ahe(e){const t={},r=w(e,["config"]);return r!=null&&rhe(r,t),t}function nhe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&N(t,["nextPageToken"],a);const s=w(e,["fileSearchStores"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(t,["fileSearchStores"],i)}return t}function KL(e,t){const r={},a=w(e,["mimeType"]);t!==void 0&&a!=null&&N(t,["mimeType"],a);const s=w(e,["displayName"]);t!==void 0&&s!=null&&N(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)),N(t,["customMetadata"],o)}const l=w(e,["chunkingConfig"]);return t!==void 0&&l!=null&&N(t,["chunkingConfig"],l),r}function she(e){const t={},r=w(e,["fileSearchStoreName"]);r!=null&&N(t,["_url","file_search_store_name"],r);const a=w(e,["config"]);return a!=null&&KL(a,t),t}function ihe(e){const t={},r=w(e,["sdkHttpResponse"]);return r!=null&&N(t,["sdkHttpResponse"],r),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const lhe="Content-Type",ohe="X-Server-Timeout",che="User-Agent",pC="x-goog-api-client",dhe="1.42.0",uhe=`google-genai-sdk/${dhe}`,Ahe="v1beta1",fhe="v1beta",phe=5,hhe=[408,429,500,502,503,504];class xhe{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:Ahe}else{if(!this.clientOptions.apiKey)throw new fp({message:"API key must be set when using the Gemini API.",status:403});i.apiVersion=(s=this.clientOptions.apiVersion)!==null&&s!==void 0?s:fhe,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===oC.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&&mhe(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 W3(s),new cC(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 W3(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,k=v.code,_=`got status: ${y}. ${JSON.stringify(b)}`;if(k>=400&&k<600)throw new fp({message:_,status:k})}}catch(b){if(b.name==="ApiError")throw b}l+=p;let x=-1,m=0;for(;;){x=-1,m=0;for(const y of d){const k=l.indexOf(y);k!==-1&&(x===-1||k<x)&&(x=k,m=y.length)}if(x===-1)break;const b=l.substring(0,x);l=l.substring(x+m);const v=b.trim();if(v.startsWith(o)){const y=v.substring(o.length).trim();try{const k=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 cC(k))}catch(k){throw new Error(`exception parsing stream chunk ${y}. ${k}`)}}}}}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 sue(async()=>{const l=await fetch(t,r);if(l.ok)return l;throw hhe.includes(l.status)?new Error(`Retryable HTTP Error: ${l.statusText}`):new kL.AbortError(`Non-retryable exception ${l.statusText} sending request`)},{retries:((a=s.attempts)!==null&&a!==void 0?a:phe)-1})}getDefaultHeaders(){const t={},r=uhe+" "+this.clientOptions.userAgentExtra;return t[che]=r,t[pC]=r,t[lhe]="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(ohe,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&&KL(a,p);const x=await this.fetchUploadUrl(u,o,d,f,p,a==null?void 0:a.httpOptions);return i.uploadToFileSearchStore(r,x,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 W3(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 fp({message:s,status:r}):new Error(s)}}function mhe(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 ghe="mcp_used/unknown";let bhe=!1;function qL(e){for(const t of e)if(vhe(t)||typeof t=="object"&&"inputSchema"in t)return!0;return bhe}function WL(e){var t;const r=(t=e[pC])!==null&&t!==void 0?t:"";e[pC]=(r+` ${ghe}`).trimStart()}function vhe(e){return e!==null&&typeof e=="object"&&e instanceof Xj}function yhe(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 Xj{constructor(t=[],r){this.mcpTools=[],this.functionNameToMcpClient={},this.mcpClients=t,this.config=r}static create(t,r){return new Xj(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(yhe(f))),u;u=await d.next(),t=u.done,!t;o=!0){s=u.value,o=!1;const p=s;l.push(p);const x=p.name;if(i[x])throw new Error(`Duplicate function name ${x} found in MCP tools. Please ensure function names are unique.`);i[x]=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(),Kue(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 whe(e,t,r){const a=new Pue;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 Nhe{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=jhe(this.apiClient.getDefaultHeaders()),o=this.apiClient.getApiKey(),d=`${s}/ws/google.ai.generativelanguage.${i}.GenerativeService.BidiGenerateMusic?key=${o}`;let u=()=>{};const f=new Promise(C=>{u=C}),p=t.callbacks,x=function(){u({})},m=this.apiClient,b={onopen:x,onmessage:C=>{whe(m,p.onmessage,C)},onerror:(r=p==null?void 0:p.onerror)!==null&&r!==void 0?r:function(C){},onclose:(a=p==null?void 0:p.onclose)!==null&&a!==void 0?a:function(C){}},v=this.webSocketFactory.create(d,khe(l),b);v.connect(),await f;const _={setup:{model:rr(this.apiClient,t.model)}};return v.send(JSON.stringify(_)),new Che(v,this.apiClient)}}class Che{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=K0e(t);this.conn.send(JSON.stringify({clientContent:r}))}async setMusicGenerationConfig(t){t.musicGenerationConfig||(t.musicGenerationConfig={});const r=G0e(t);this.conn.send(JSON.stringify(r))}sendPlaybackControl(t){const r={playbackControl:t};this.conn.send(JSON.stringify(r))}play(){this.sendPlaybackControl(AA.PLAY)}pause(){this.sendPlaybackControl(AA.PAUSE)}stop(){this.sendPlaybackControl(AA.STOP)}resetContext(){this.sendPlaybackControl(AA.RESET_CONTEXT)}close(){this.conn.close()}}function khe(e){const t={};return e.forEach((r,a)=>{t[a]=r}),t}function jhe(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 Ehe="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";async function She(e,t,r){const a=new Oue;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=Y0e(i);Object.assign(a,l)}else Object.assign(a,i);t(a)}class Bhe{constructor(t,r,a){this.apiClient=t,this.auth=r,this.webSocketFactory=a,this.music=new Nhe(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&&qL(t.config.tools)&&WL(p);const x=Fhe(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(x,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({})},k=this.apiClient,_={onopen:y,onmessage:U=>{She(k,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){}},C=this.webSocketFactory.create(f,Ihe(x),_);C.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:[Fg.AUDIO]}:t.config.responseModalities=[Fg.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 M={model:E,config:t.config,callbacks:t.callbacks};return this.apiClient.isVertexAI()?T=V0e(this.apiClient,M):T=$0e(this.apiClient,M),delete T.config,C.send(JSON.stringify(T)),new The(C,this.apiClient)}isCallableTool(t){return"callTool"in t&&typeof t.callTool=="function"}}const _he={turnComplete:!0};class The{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(Ehe)}return{toolResponse:{functionResponses:a}}}sendClientContent(t){t=Object.assign(Object.assign({},_he),t);const r=this.tLiveClientContent(this.apiClient,t);this.conn.send(JSON.stringify(r))}sendRealtimeInput(t){let r={};this.apiClient.isVertexAI()?r={realtimeInput:W0e(t)}:r={realtimeInput:q0e(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 Ihe(e){const t={};return e.forEach((r,a)=>{t[a]=r}),t}function Fhe(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 Y3=10;function X3(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(bA(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 bA(e){return"callTool"in e&&typeof e.callTool=="function"}function Dhe(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=>bA(s)))!==null&&a!==void 0?a:!1}function J3(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(bA(a))return;const i=a;i.functionDeclarations&&i.functionDeclarations.length>0&&r.push(s)}),r}function Z3(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 Uhe extends Do{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:Dg.EMBED_CONTENT});return await this.embedContentInternal(i)}else{const s=Object.assign(Object.assign({},r),{embeddingApiType:Dg.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),!Dhe(r)||X3(r.config))return await this.generateContentInternal(d);const u=J3(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 x=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:Y3;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 k of(o=(l=r.config)===null||l===void 0?void 0:l.tools)!==null&&o!==void 0?o:[])if(bA(k)){const C=await k.callTool(f.functionCalls);y.push(...C)}b++,p={role:"user",parts:y},d.contents=Ls(d.contents),d.contents.push(v),d.contents.push(p),Z3(d.config)&&(x.push(v),x.push(p))}return Z3(d.config)&&(f.automaticFunctionCallingHistory=x),f},this.generateContentStream=async r=>{var a,s,i,l,o;if(this.maybeMoveToResponseJsonSchem(r),X3(r.config)){const p=await this.processParamsMaybeAddMcpUsage(r);return await this.generateContentStreamInternal(p)}const d=J3(r);if(d.length>0){const p=d.map(x=>`tools[${x}]`).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 au(wo.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=>bA(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&&qL(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()),WL(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(bA(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:Y3;let l=!1,o=0;const d=await this.initAfcToolsMap(t);return(function(u,f,p){return zi(this,arguments,function*(){for(var x,m,b,v,y,k;o<i;){l&&(o++,l=!1);const T=yield St(u.processParamsMaybeAddMcpUsage(p)),B=yield St(u.generateContentStreamInternal(T)),F=[],M=[];try{for(var _=!0,C=(m=void 0,$i(B)),E;E=yield St(C.next()),x=E.done,!x;_=!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)){M.push(U.candidates[0].content);for(const D of(k=U.candidates[0].content.parts)!==null&&k!==void 0?k:[])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{!_&&!x&&(b=C.return)&&(yield St(b.call(C)))}finally{if(m)throw m.error}}if(F.length>0){l=!0;const U=new sf;U.candidates=[{content:{role:"user",parts:F}}],yield yield St(U);const D=[];D.push(...M),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=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:(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=q3(f),x=new sf;return Object.assign(x,p),x})}else{const u=V3(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=K3(f),x=new sf;return Object.assign(x,p),x})}}async generateContentStreamInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){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:(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 x,m,b,v;try{for(var y=!0,k=$i(p),_;_=yield St(k.next()),x=_.done,!x;y=!0){v=_.value,y=!1;const C=v,E=q3(yield St(C.json()),t);E.sdkHttpResponse={headers:C.headers};const T=new sf;Object.assign(T,E),yield yield St(T)}}catch(C){m={error:C}}finally{try{!y&&!x&&(b=k.return)&&(yield St(b.call(k)))}finally{if(m)throw m.error}}})})}else{const u=V3(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 x,m,b,v;try{for(var y=!0,k=$i(p),_;_=yield St(k.next()),x=_.done,!x;y=!0){v=_.value,y=!1;const C=v,E=K3(yield St(C.json()),t);E.sdkHttpResponse={headers:C.headers};const T=new sf;Object.assign(T,E),yield yield St(T)}}catch(C){m={error:C}}finally{try{!y&&!x&&(b=k.return)&&(yield St(b.call(k)))}finally{if(m)throw m.error}}})})}}async embedContentInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Efe(this.apiClient,t,t),f=Wue(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(x=>{const m=x;return m.sdkHttpResponse={headers:p.headers},m})),l.then(p=>{const x=Bfe(p,t),m=new S3;return Object.assign(m,x),m})}else{const u=jfe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=Sfe(f),x=new S3;return Object.assign(x,p),x})}}async generateImagesInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Lfe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=Hfe(f),x=new B3;return Object.assign(x,p),x})}else{const u=Pfe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=Qfe(f),x=new B3;return Object.assign(x,p),x})}}async editImageInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=wfe(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=Nfe(d),f=new jue;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=Lpe(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=Qpe(d),f=new Eue;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=ype(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=wpe(d),f=new Sue;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=Spe(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=Bpe(d),f=new Bue;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=spe(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=>fC(f))}else{const u=npe(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=>AC(f))}}async listInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=ppe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=xpe(f),x=new _3;return Object.assign(x,p),x})}else{const u=fpe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=hpe(f),x=new _3;return Object.assign(x,p),x})}}async update(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Ope(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=>fC(f))}else{const u=Rpe(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=>AC(f))}}async delete(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=gfe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=vfe(f),x=new T3;return Object.assign(x,p),x})}else{const u=mfe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=bfe(f),x=new T3;return Object.assign(x,p),x})}}async countTokens(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=pfe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=xfe(f),x=new I3;return Object.assign(x,p),x})}else{const u=ffe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=hfe(f),x=new I3;return Object.assign(x,p),x})}}async computeTokens(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=ife(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=lfe(d),f=new _ue;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=qfe(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=Gfe(f),x=new Ug;return Object.assign(x,p),x})}else{const u=Kfe(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=Vfe(f),x=new Ug;return Object.assign(x,p),x})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Mhe extends Do{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=vue(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=bue(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=Aue(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 Rhe(e){const t={},r=w(e,["data"]);if(r!=null&&N(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&&N(t,["mimeType"],a),t}function Ohe(e){const t={},r=w(e,["parts"]);if(r!=null){let s=r;Array.isArray(s)&&(s=s.map(i=>Khe(i))),N(t,["parts"],s)}const a=w(e,["role"]);return a!=null&&N(t,["role"],a),t}function Phe(e,t,r){const a={},s=w(t,["expireTime"]);r!==void 0&&s!=null&&N(r,["expireTime"],s);const i=w(t,["newSessionExpireTime"]);r!==void 0&&i!=null&&N(r,["newSessionExpireTime"],i);const l=w(t,["uses"]);r!==void 0&&l!=null&&N(r,["uses"],l);const o=w(t,["liveConnectConstraints"]);r!==void 0&&o!=null&&N(r,["bidiGenerateContentSetup"],Ghe(e,o));const d=w(t,["lockAdditionalFields"]);return r!==void 0&&d!=null&&N(r,["fieldMask"],d),a}function Lhe(e,t){const r={},a=w(t,["config"]);return a!=null&&N(r,["config"],Phe(e,a,r)),r}function Qhe(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&&N(t,["fileUri"],r);const a=w(e,["mimeType"]);return a!=null&&N(t,["mimeType"],a),t}function Hhe(e){const t={},r=w(e,["id"]);r!=null&&N(t,["id"],r);const a=w(e,["args"]);a!=null&&N(t,["args"],a);const s=w(e,["name"]);if(s!=null&&N(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 zhe(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&&N(t,["enableWidget"],r),t}function $he(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&&N(t,["timeRangeFilter"],r),t}function Vhe(e,t){const r={},a=w(e,["generationConfig"]);t!==void 0&&a!=null&&N(t,["setup","generationConfig"],a);const s=w(e,["responseModalities"]);t!==void 0&&s!=null&&N(t,["setup","generationConfig","responseModalities"],s);const i=w(e,["temperature"]);t!==void 0&&i!=null&&N(t,["setup","generationConfig","temperature"],i);const l=w(e,["topP"]);t!==void 0&&l!=null&&N(t,["setup","generationConfig","topP"],l);const o=w(e,["topK"]);t!==void 0&&o!=null&&N(t,["setup","generationConfig","topK"],o);const d=w(e,["maxOutputTokens"]);t!==void 0&&d!=null&&N(t,["setup","generationConfig","maxOutputTokens"],d);const u=w(e,["mediaResolution"]);t!==void 0&&u!=null&&N(t,["setup","generationConfig","mediaResolution"],u);const f=w(e,["seed"]);t!==void 0&&f!=null&&N(t,["setup","generationConfig","seed"],f);const p=w(e,["speechConfig"]);t!==void 0&&p!=null&&N(t,["setup","generationConfig","speechConfig"],Yj(p));const x=w(e,["thinkingConfig"]);t!==void 0&&x!=null&&N(t,["setup","generationConfig","thinkingConfig"],x);const m=w(e,["enableAffectiveDialog"]);t!==void 0&&m!=null&&N(t,["setup","generationConfig","enableAffectiveDialog"],m);const b=w(e,["systemInstruction"]);t!==void 0&&b!=null&&N(t,["setup","systemInstruction"],Ohe(en(b)));const v=w(e,["tools"]);if(t!==void 0&&v!=null){let B=JA(v);Array.isArray(B)&&(B=B.map(F=>Whe(XA(F)))),N(t,["setup","tools"],B)}const y=w(e,["sessionResumption"]);t!==void 0&&y!=null&&N(t,["setup","sessionResumption"],qhe(y));const k=w(e,["inputAudioTranscription"]);t!==void 0&&k!=null&&N(t,["setup","inputAudioTranscription"],k);const _=w(e,["outputAudioTranscription"]);t!==void 0&&_!=null&&N(t,["setup","outputAudioTranscription"],_);const C=w(e,["realtimeInputConfig"]);t!==void 0&&C!=null&&N(t,["setup","realtimeInputConfig"],C);const E=w(e,["contextWindowCompression"]);t!==void 0&&E!=null&&N(t,["setup","contextWindowCompression"],E);const T=w(e,["proactivity"]);if(t!==void 0&&T!=null&&N(t,["setup","proactivity"],T),w(e,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return r}function Ghe(e,t){const r={},a=w(t,["model"]);a!=null&&N(r,["setup","model"],rr(e,a));const s=w(t,["config"]);return s!=null&&N(r,["config"],Vhe(s,r)),r}function Khe(e){const t={},r=w(e,["mediaResolution"]);r!=null&&N(t,["mediaResolution"],r);const a=w(e,["codeExecutionResult"]);a!=null&&N(t,["codeExecutionResult"],a);const s=w(e,["executableCode"]);s!=null&&N(t,["executableCode"],s);const i=w(e,["fileData"]);i!=null&&N(t,["fileData"],Qhe(i));const l=w(e,["functionCall"]);l!=null&&N(t,["functionCall"],Hhe(l));const o=w(e,["functionResponse"]);o!=null&&N(t,["functionResponse"],o);const d=w(e,["inlineData"]);d!=null&&N(t,["inlineData"],Rhe(d));const u=w(e,["text"]);u!=null&&N(t,["text"],u);const f=w(e,["thought"]);f!=null&&N(t,["thought"],f);const p=w(e,["thoughtSignature"]);p!=null&&N(t,["thoughtSignature"],p);const x=w(e,["videoMetadata"]);return x!=null&&N(t,["videoMetadata"],x),t}function qhe(e){const t={},r=w(e,["handle"]);if(r!=null&&N(t,["handle"],r),w(e,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function Whe(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&&N(t,["computerUse"],r);const a=w(e,["fileSearch"]);a!=null&&N(t,["fileSearch"],a);const s=w(e,["codeExecution"]);if(s!=null&&N(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)),N(t,["functionDeclarations"],f)}const l=w(e,["googleMaps"]);l!=null&&N(t,["googleMaps"],zhe(l));const o=w(e,["googleSearch"]);o!=null&&N(t,["googleSearch"],$he(o));const d=w(e,["googleSearchRetrieval"]);d!=null&&N(t,["googleSearchRetrieval"],d);const u=w(e,["urlContext"]);return u!=null&&N(t,["urlContext"],u),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Yhe(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 Xhe(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=Yhe(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 Jhe extends Do{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=Lhe(this.apiClient,t);i=et("auth_tokens",o._url),l=o._query,delete o.config,delete o._url,delete o._query;const d=Xhe(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 Zhe(e,t){const r={},a=w(e,["force"]);return t!==void 0&&a!=null&&N(t,["_query","force"],a),r}function exe(e){const t={},r=w(e,["name"]);r!=null&&N(t,["_url","name"],r);const a=w(e,["config"]);return a!=null&&Zhe(a,t),t}function txe(e){const t={},r=w(e,["name"]);return r!=null&&N(t,["_url","name"],r),t}function rxe(e,t){const r={},a=w(e,["pageSize"]);t!==void 0&&a!=null&&N(t,["_query","pageSize"],a);const s=w(e,["pageToken"]);return t!==void 0&&s!=null&&N(t,["_query","pageToken"],s),r}function axe(e){const t={},r=w(e,["parent"]);r!=null&&N(t,["_url","parent"],r);const a=w(e,["config"]);return a!=null&&rxe(a,t),t}function nxe(e){const t={},r=w(e,["sdkHttpResponse"]);r!=null&&N(t,["sdkHttpResponse"],r);const a=w(e,["nextPageToken"]);a!=null&&N(t,["nextPageToken"],a);const s=w(e,["documents"]);if(s!=null){let i=s;Array.isArray(i)&&(i=i.map(l=>l)),N(t,["documents"],i)}return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class sxe extends Do{constructor(t){super(),this.apiClient=t,this.list=async r=>new au(wo.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=txe(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=exe(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=axe(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=nxe(d),f=new Tue;return Object.assign(f,u),f})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class ixe extends Do{constructor(t,r=new sxe(t)){super(),this.apiClient=t,this.documents=r,this.list=async(a={})=>new au(wo.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=qpe(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=Xpe(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=Ype(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=ahe(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=nhe(d),f=new Iue;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=she(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=ihe(d),f=new Fue;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=ehe(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=Zpe(d),f=new Vj;return Object.assign(f,u),f})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */let YL=function(){const{crypto:e}=globalThis;if(e!=null&&e.randomUUID)return YL=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 lxe=()=>YL();/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function hC(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const xC=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 Ci extends Error{}class ts extends Ci{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 nv({message:a,cause:xC(r)});const i=r;return t===400?new JL(t,i,a,s):t===401?new ZL(t,i,a,s):t===403?new eQ(t,i,a,s):t===404?new tQ(t,i,a,s):t===409?new rQ(t,i,a,s):t===422?new aQ(t,i,a,s):t===429?new nQ(t,i,a,s):t>=500?new sQ(t,i,a,s):new ts(t,i,a,s)}}class mC extends ts{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}}class nv extends ts{constructor({message:t,cause:r}){super(void 0,void 0,t||"Connection error.",void 0),r&&(this.cause=r)}}class XL extends nv{constructor({message:t}={}){super({message:t??"Request timed out."})}}class JL extends ts{}class ZL extends ts{}class eQ extends ts{}class tQ extends ts{}class rQ extends ts{}class aQ extends ts{}class nQ extends ts{}class sQ extends ts{}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const oxe=/^[a-z][a-z0-9+.-]*:/i,cxe=e=>oxe.test(e);let gC=e=>(gC=Array.isArray,gC(e));const dxe=gC;let uxe=dxe;const eD=uxe;function Axe(e){if(!e)return!0;for(const t in e)return!1;return!0}function fxe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const pxe=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new Ci(`${e} must be an integer`);if(t<0)throw new Ci(`${e} must be a positive integer`);return t},hxe=e=>{try{return JSON.parse(e)}catch{return}};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const xxe=e=>new Promise(t=>setTimeout(t,e));/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const sA="0.0.1";/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function mxe(){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 gxe=()=>{var e,t,r,a,s;const i=mxe();if(i==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sA,"X-Stainless-OS":rD(Deno.build.os),"X-Stainless-Arch":tD(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":sA,"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":sA,"X-Stainless-OS":rD((r=globalThis.process.platform)!==null&&r!==void 0?r:"unknown"),"X-Stainless-Arch":tD((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=bxe();return l?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":sA,"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":sA,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function bxe(){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 tD=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",rD=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 Mx;const vxe=()=>Mx??(Mx=gxe());/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function yxe(){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 iQ(...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 wxe(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return iQ({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 lQ(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 Nxe(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 Cxe=({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 oQ=()=>{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 w2(e,t,r){return oQ(),new File(e,t??"unknown_file",r)}function kxe(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 jxe=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function";/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const cQ=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",Exe=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&cQ(e),Sxe=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function Bxe(e,t,r){if(oQ(),e=await e,Exe(e))return e instanceof File?e:w2([await e.arrayBuffer()],e.name);if(Sxe(e)){const s=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),w2(await bC(s),t,r)}const a=await bC(e);if(t||(t=kxe(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 w2(a,t,r)}async function bC(e){var t,r,a,s,i;let l=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)l.push(e);else if(cQ(e))l.push(e instanceof Blob?e:await e.arrayBuffer());else if(jxe(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 bC(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}`:""}${_xe(e)}`)}return l}function _xe(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 dQ{constructor(t){this._client=t}}dQ._key=[];/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function uQ(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const aD=Object.freeze(Object.create(null)),Txe=(e=uQ)=>(function(r,...a){if(r.length===1)return r[0];let s=!1;const i=[],l=r.reduce((f,p,x)=>{var m,b,v;/[?#]/.test(p)&&(s=!0);const y=a[x];let k=(s?encodeURIComponent:e)(""+y);return x!==a.length&&(y==null||typeof y=="object"&&y.toString===((v=Object.getPrototypeOf((b=Object.getPrototypeOf((m=y.hasOwnProperty)!==null&&m!==void 0?m:aD))!==null&&b!==void 0?b:aD))===null||v===void 0?void 0:v.toString))&&(k=y+"",i.push({start:f.length+p.length,length:k.length,error:`Value of type ${Object.prototype.toString.call(y).slice(8,-1)} is not a valid path parameter`})),f+p+(x===a.length?"":k)},""),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((x,m)=>{const b=" ".repeat(m.start-f),v="^".repeat(m.length);return f=m.start+m.length,x+b+v},"");throw new Ci(`Path parameters result in path with invalid segments:
${i.map(x=>x.error).join(`
`)}
${l}
${p}`)}return l}),Rx=Txe(uQ);/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class AQ extends dQ{create(t,r){var a;const{api_version:s=this._client.apiVersion}=t,i=Rg(t,["api_version"]);if("model"in i&&"agent_config"in i)throw new Ci("Invalid request: specified `model` and `agent_config`. If specifying `model`, use `generation_config`.");if("agent"in i&&"generation_config"in i)throw new Ci("Invalid request: specified `agent` and `generation_config`. If specifying `agent`, use `agent_config`.");return this._client.post(Rx`/${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(Rx`/${s}/interactions/${t}`,a)}cancel(t,r={},a){const{api_version:s=this._client.apiVersion}=r??{};return this._client.post(Rx`/${s}/interactions/${t}/cancel`,a)}get(t,r={},a){var s;const i=r??{},{api_version:l=this._client.apiVersion}=i,o=Rg(i,["api_version"]);return this._client.get(Rx`/${l}/interactions/${t}`,Object.assign(Object.assign({query:o},a),{stream:(s=r==null?void 0:r.stream)!==null&&s!==void 0?s:!1}))}}AQ._key=Object.freeze(["interactions"]);class fQ extends AQ{}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Ixe(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 Ox;function Jj(e){let t;return(Ox??(t=new globalThis.TextEncoder,Ox=t.encode.bind(t)))(e)}let Px;function nD(e){let t;return(Px??(t=new globalThis.TextDecoder,Px=t.decode.bind(t)))(e)}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class sv{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"?Jj(t):t;this.buffer=Ixe([this.buffer,r]);const a=[];let s;for(;(s=Fxe(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(nD(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=nD(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(`
`):[]}}sv.NEWLINE_CHARS=new Set([`
`,"\r"]);sv.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Fxe(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 Dxe(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 Og={off:0,error:200,warn:300,info:400,debug:500},sD=(e,t,r)=>{if(e){if(fxe(Og,e))return e;Gn(r).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Og))}`)}};function bf(){}function Lx(e,t,r){return!t||Og[e]>Og[r]?bf:t[e].bind(t)}const Uxe={error:bf,warn:bf,info:bf,debug:bf};let iD=new WeakMap;function Gn(e){var t;const r=e.logger,a=(t=e.logLevel)!==null&&t!==void 0?t:"off";if(!r)return Uxe;const s=iD.get(r);if(s&&s[0]===a)return s[1];const i={error:Lx("error",r,a),warn:Lx("warn",r,a),info:Lx("info",r,a),debug:Lx("debug",r,a)};return iD.set(r,[a,i]),i}const md=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 fA{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 Ci("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let x=!1;try{try{for(var m=!0,b=$i(Mxe(t,r)),v;v=yield St(b.next()),d=v.done,!d;m=!0){p=v.value,m=!1;const y=p;if(!x)if(y.data.startsWith("[DONE]")){x=!0;continue}else try{yield yield St(JSON.parse(y.data))}catch(k){throw i.error("Could not parse message into JSON:",y.data),i.error("From chunk:",y.raw),k}}}catch(y){u={error:y}}finally{try{!m&&!d&&(f=b.return)&&(yield St(f.call(b)))}finally{if(u)throw u.error}}x=!0}catch(y){if(hC(y))return yield St(void 0);throw y}finally{x||r.abort()}})}return new fA(l,r,a)}static fromReadableStream(t,r,a){let s=!1;function i(){return zi(this,arguments,function*(){var d,u,f,p;const x=new sv,m=lQ(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 k=p;for(const _ of x.decode(k))yield yield St(_)}}catch(k){u={error:k}}finally{try{!b&&!d&&(f=v.return)&&(yield St(f.call(v)))}finally{if(u)throw u.error}}for(const k of x.flush())yield yield St(k)})}function l(){return zi(this,arguments,function*(){var d,u,f,p;if(s)throw new Ci("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let x=!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;x||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}}x=!0}catch(y){if(hC(y))return yield St(void 0);throw y}finally{x||r.abort()}})}return new fA(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 fA(()=>s(t),this.controller,this.client),new fA(()=>s(r),this.controller,this.client)]}toReadableStream(){const t=this;let r;return iQ({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=Jj(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 Mxe(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 Ci("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 Ci("Attempted to iterate over a response with no body");const o=new Oxe,d=new sv,u=lQ(e.body);try{for(var f=!0,p=$i(Rxe(u)),x;x=yield St(p.next()),a=x.done,!a;f=!0){l=x.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 Rxe(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"?Jj(f):f;let x=new Uint8Array(l.length+p.length);x.set(l),x.set(p,l.length),l=x;let m;for(;(m=Dxe(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 Oxe{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]=Pxe(t,":");return s.startsWith(" ")&&(s=s.substring(1)),r==="event"?this.event=s:r==="data"&&this.data.push(s),null}}function Pxe(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 Lxe(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):fA.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`,md({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 Zj extends Promise{constructor(t,r,a=Lxe){super(s=>{s(null)}),this.responsePromise=r,this.parseResponse=a,this.client=t}_thenUnwrap(t){return new Zj(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 pQ=Symbol("brand.privateNullableHeaders");function*Qxe(e){if(!e)return;if(pQ 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():eD(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=eD(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 lf=e=>{const t=new Headers,r=new Set;for(const a of e){const s=new Set;for(const[i,l]of Qxe(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{[pQ]:!0,values:t,nulls:r}};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const N2=e=>{var t,r,a,s,i,l;if(typeof globalThis.process<"u")return(a=(r=(t=iue)===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 hQ;class iv{constructor(t){var r,a,s,i,l,o,d,{baseURL:u=N2("GEMINI_NEXT_GEN_API_BASE_URL"),apiKey:f=(r=N2("GEMINI_API_KEY"))!==null&&r!==void 0?r:null,apiVersion:p="v1beta"}=t,x=Rg(t,["baseURL","apiKey","apiVersion"]);const m=Object.assign(Object.assign({apiKey:f,apiVersion:p},x),{baseURL:u||"https://generativelanguage.googleapis.com"});this.baseURL=m.baseURL,this.timeout=(a=m.timeout)!==null&&a!==void 0?a:iv.DEFAULT_TIMEOUT,this.logger=(s=m.logger)!==null&&s!==void 0?s:console;const b="warn";this.logLevel=b,this.logLevel=(l=(i=sD(m.logLevel,"ClientOptions.logLevel",this))!==null&&i!==void 0?i:sD(N2("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:yxe(),this.encoder=Cxe,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=lf([t.headers]);if(!(r.values.has("authorization")||r.values.has("x-goog-api-key"))){if(this.apiKey)return lf([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter.isVertexAI())return lf([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 Ci(`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 ${sA}`}defaultIdempotencyKey(){return`stainless-node-retry-${lxe()}`}makeStatusError(t,r,a,s){return ts.generate(t,r,a,s)}buildURL(t,r,a){const s=!this.baseURLOverridden()&&a||this.baseURL,i=cxe(t)?new URL(t):new URL(s+(s.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),l=this.defaultQuery();return Axe(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 Zj(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 x="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),m=a===void 0?"":`, retryOf: ${a}`,b=Date.now();if(Gn(this).debug(`[${x}] sending request`,md({retryOfRequestLogID:a,method:o.method,url:f,options:o,headers:u.headers})),!((i=o.signal)===null||i===void 0)&&i.aborted)throw new mC;const v=new AbortController,y=await this.fetchWithTimeout(f,u,p,v).catch(xC),k=Date.now();if(y instanceof globalThis.Error){const C=`retrying, ${r} attempts remaining`;if(!((l=o.signal)===null||l===void 0)&&l.aborted)throw new mC;const E=hC(y)||/timed? ?out/i.test(String(y)+("cause"in y?String(y.cause):""));if(r)return Gn(this).info(`[${x}] connection ${E?"timed out":"failed"} - ${C}`),Gn(this).debug(`[${x}] connection ${E?"timed out":"failed"} (${C})`,md({retryOfRequestLogID:a,url:f,durationMs:k-b,message:y.message})),this.retryRequest(o,r,a??x);throw Gn(this).info(`[${x}] connection ${E?"timed out":"failed"} - error; no more retries left`),Gn(this).debug(`[${x}] connection ${E?"timed out":"failed"} (error; no more retries left)`,md({retryOfRequestLogID:a,url:f,durationMs:k-b,message:y.message})),E?new XL:new nv({cause:y})}const _=`[${x}${m}] ${u.method} ${f} ${y.ok?"succeeded":"failed"} with status ${y.status} in ${k-b}ms`;if(!y.ok){const C=await this.shouldRetry(y);if(r&&C){const U=`retrying, ${r} attempts remaining`;return await Nxe(y.body),Gn(this).info(`${_} - ${U}`),Gn(this).debug(`[${x}] response error (${U})`,md({retryOfRequestLogID:a,url:y.url,status:y.status,headers:y.headers,durationMs:k-b})),this.retryRequest(o,r,a??x,y.headers)}const E=C?"error; no more retries left":"error; not retryable";Gn(this).info(`${_} - ${E}`);const T=await y.text().catch(U=>xC(U).message),B=hxe(T),F=B?void 0:T;throw Gn(this).debug(`[${x}] response error (${E})`,md({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(`[${x}] response start`,md({retryOfRequestLogID:a,url:y.url,status:y.status,headers:y.headers,durationMs:k-b})),{response:y,options:o,controller:v,requestLogID:x,retryOfRequestLogID:a,startTime:b}}async fetchWithTimeout(t,r,a,s){const i=r||{},{signal:l,method:o}=i,d=Rg(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,x=Object.assign(Object.assign(Object.assign({signal:s.signal},p?{duplex:"half"}:{}),{method:"GET"}),d);o&&(x.method=o.toUpperCase());try{return await this.fetch.call(void 0,t,x)}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 xxe(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&&pxe("timeout",l.timeout),l.timeout=(a=l.timeout)!==null&&a!==void 0?a:this.timeout;const{bodyHeaders:x,body:m}=this.buildBody({options:l}),b=await this.buildHeaders({options:t,method:o,bodyHeaders:x,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=lf([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))}:{}),vxe()),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=lf([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:wxe(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})}}iv.DEFAULT_TIMEOUT=6e4;class on extends iv{constructor(){super(...arguments),this.interactions=new fQ(this)}}hQ=on;on.GeminiNextGenAPIClient=hQ;on.GeminiNextGenAPIClientError=Ci;on.APIError=ts;on.APIConnectionError=nv;on.APIConnectionTimeoutError=XL;on.APIUserAbortError=mC;on.NotFoundError=tQ;on.ConflictError=rQ;on.RateLimitError=nQ;on.BadRequestError=JL;on.AuthenticationError=ZL;on.InternalServerError=sQ;on.PermissionDeniedError=eQ;on.UnprocessableEntityError=aQ;on.toFile=Bxe;on.Interactions=fQ;/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Hxe(e,t){const r={},a=w(e,["name"]);return a!=null&&N(r,["_url","name"],a),r}function zxe(e,t){const r={},a=w(e,["name"]);return a!=null&&N(r,["_url","name"],a),r}function $xe(e,t){const r={},a=w(e,["sdkHttpResponse"]);return a!=null&&N(r,["sdkHttpResponse"],a),r}function Vxe(e,t){const r={},a=w(e,["sdkHttpResponse"]);return a!=null&&N(r,["sdkHttpResponse"],a),r}function Gxe(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&&N(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&&N(t,["tuningTask","hyperparameters","epochCount"],i);const l=w(e,["learningRateMultiplier"]);if(l!=null&&N(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&&N(t,["tuningTask","hyperparameters","batchSize"],o);const d=w(e,["learningRate"]);if(t!==void 0&&d!=null&&N(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 Kxe(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&&N(t,["supervisedTuningSpec"],C2(B))}else if(s==="PREFERENCE_TUNING"){const B=w(e,["validationDataset"]);t!==void 0&&B!=null&&N(t,["preferenceOptimizationSpec"],C2(B))}else if(s==="DISTILLATION"){const B=w(e,["validationDataset"]);t!==void 0&&B!=null&&N(t,["distillationSpec"],C2(B))}const i=w(e,["tunedModelDisplayName"]);t!==void 0&&i!=null&&N(t,["tunedModelDisplayName"],i);const l=w(e,["description"]);t!==void 0&&l!=null&&N(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&&N(t,["supervisedTuningSpec","hyperParameters","epochCount"],B)}else if(o==="PREFERENCE_TUNING"){const B=w(e,["epochCount"]);t!==void 0&&B!=null&&N(t,["preferenceOptimizationSpec","hyperParameters","epochCount"],B)}else if(o==="DISTILLATION"){const B=w(e,["epochCount"]);t!==void 0&&B!=null&&N(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&&N(t,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],B)}else if(d==="PREFERENCE_TUNING"){const B=w(e,["learningRateMultiplier"]);t!==void 0&&B!=null&&N(t,["preferenceOptimizationSpec","hyperParameters","learningRateMultiplier"],B)}else if(d==="DISTILLATION"){const B=w(e,["learningRateMultiplier"]);t!==void 0&&B!=null&&N(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&&N(t,["supervisedTuningSpec","exportLastCheckpointOnly"],B)}else if(u==="PREFERENCE_TUNING"){const B=w(e,["exportLastCheckpointOnly"]);t!==void 0&&B!=null&&N(t,["preferenceOptimizationSpec","exportLastCheckpointOnly"],B)}else if(u==="DISTILLATION"){const B=w(e,["exportLastCheckpointOnly"]);t!==void 0&&B!=null&&N(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&&N(t,["supervisedTuningSpec","hyperParameters","adapterSize"],B)}else if(f==="PREFERENCE_TUNING"){const B=w(e,["adapterSize"]);t!==void 0&&B!=null&&N(t,["preferenceOptimizationSpec","hyperParameters","adapterSize"],B)}else if(f==="DISTILLATION"){const B=w(e,["adapterSize"]);t!==void 0&&B!=null&&N(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&&N(t,["supervisedTuningSpec","tuningMode"],B)}const x=w(e,["customBaseModel"]);t!==void 0&&x!=null&&N(t,["customBaseModel"],x);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&&N(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&&N(t,["supervisedTuningSpec","hyperParameters","learningRate"],B)}const v=w(e,["labels"]);t!==void 0&&v!=null&&N(t,["labels"],v);const y=w(e,["beta"]);t!==void 0&&y!=null&&N(t,["preferenceOptimizationSpec","hyperParameters","beta"],y);const k=w(e,["baseTeacherModel"]);t!==void 0&&k!=null&&N(t,["distillationSpec","baseTeacherModel"],k);const _=w(e,["tunedTeacherModelSource"]);t!==void 0&&_!=null&&N(t,["distillationSpec","tunedTeacherModelSource"],_);const C=w(e,["sftLossWeightMultiplier"]);t!==void 0&&C!=null&&N(t,["distillationSpec","hyperParameters","sftLossWeightMultiplier"],C);const E=w(e,["outputUri"]);t!==void 0&&E!=null&&N(t,["outputUri"],E);const T=w(e,["encryptionSpec"]);return t!==void 0&&T!=null&&N(t,["encryptionSpec"],T),a}function qxe(e,t){const r={},a=w(e,["baseModel"]);a!=null&&N(r,["baseModel"],a);const s=w(e,["preTunedModel"]);s!=null&&N(r,["preTunedModel"],s);const i=w(e,["trainingDataset"]);i!=null&&sme(i);const l=w(e,["config"]);return l!=null&&Gxe(l,r),r}function Wxe(e,t){const r={},a=w(e,["baseModel"]);a!=null&&N(r,["baseModel"],a);const s=w(e,["preTunedModel"]);s!=null&&N(r,["preTunedModel"],s);const i=w(e,["trainingDataset"]);i!=null&&ime(i,r,t);const l=w(e,["config"]);return l!=null&&Kxe(l,r,t),r}function Yxe(e,t){const r={},a=w(e,["name"]);return a!=null&&N(r,["_url","name"],a),r}function Xxe(e,t){const r={},a=w(e,["name"]);return a!=null&&N(r,["_url","name"],a),r}function Jxe(e,t,r){const a={},s=w(e,["pageSize"]);t!==void 0&&s!=null&&N(t,["_query","pageSize"],s);const i=w(e,["pageToken"]);t!==void 0&&i!=null&&N(t,["_query","pageToken"],i);const l=w(e,["filter"]);return t!==void 0&&l!=null&&N(t,["_query","filter"],l),a}function Zxe(e,t,r){const a={},s=w(e,["pageSize"]);t!==void 0&&s!=null&&N(t,["_query","pageSize"],s);const i=w(e,["pageToken"]);t!==void 0&&i!=null&&N(t,["_query","pageToken"],i);const l=w(e,["filter"]);return t!==void 0&&l!=null&&N(t,["_query","filter"],l),a}function eme(e,t){const r={},a=w(e,["config"]);return a!=null&&Jxe(a,r),r}function tme(e,t){const r={},a=w(e,["config"]);return a!=null&&Zxe(a,r),r}function rme(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["nextPageToken"]);s!=null&&N(r,["nextPageToken"],s);const i=w(e,["tunedModels"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(o=>xQ(o))),N(r,["tuningJobs"],l)}return r}function ame(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["nextPageToken"]);s!=null&&N(r,["nextPageToken"],s);const i=w(e,["tuningJobs"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(o=>vC(o))),N(r,["tuningJobs"],l)}return r}function nme(e,t){const r={},a=w(e,["name"]);a!=null&&N(r,["model"],a);const s=w(e,["name"]);return s!=null&&N(r,["endpoint"],s),r}function sme(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)),N(r,["examples","examples"],s)}return r}function ime(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&&N(t,["supervisedTuningSpec","trainingDatasetUri"],l)}else if(s==="PREFERENCE_TUNING"){const l=w(e,["gcsUri"]);t!==void 0&&l!=null&&N(t,["preferenceOptimizationSpec","trainingDatasetUri"],l)}else if(s==="DISTILLATION"){const l=w(e,["gcsUri"]);t!==void 0&&l!=null&&N(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&&N(t,["supervisedTuningSpec","trainingDatasetUri"],l)}else if(i==="PREFERENCE_TUNING"){const l=w(e,["vertexDatasetResource"]);t!==void 0&&l!=null&&N(t,["preferenceOptimizationSpec","trainingDatasetUri"],l)}else if(i==="DISTILLATION"){const l=w(e,["vertexDatasetResource"]);t!==void 0&&l!=null&&N(t,["distillationSpec","promptDatasetUri"],l)}if(w(e,["examples"])!==void 0)throw new Error("examples parameter is not supported in Vertex AI.");return a}function xQ(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["name"]);s!=null&&N(r,["name"],s);const i=w(e,["state"]);i!=null&&N(r,["state"],IL(i));const l=w(e,["createTime"]);l!=null&&N(r,["createTime"],l);const o=w(e,["tuningTask","startTime"]);o!=null&&N(r,["startTime"],o);const d=w(e,["tuningTask","completeTime"]);d!=null&&N(r,["endTime"],d);const u=w(e,["updateTime"]);u!=null&&N(r,["updateTime"],u);const f=w(e,["description"]);f!=null&&N(r,["description"],f);const p=w(e,["baseModel"]);p!=null&&N(r,["baseModel"],p);const x=w(e,["_self"]);return x!=null&&N(r,["tunedModel"],nme(x)),r}function vC(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["name"]);s!=null&&N(r,["name"],s);const i=w(e,["state"]);i!=null&&N(r,["state"],IL(i));const l=w(e,["createTime"]);l!=null&&N(r,["createTime"],l);const o=w(e,["startTime"]);o!=null&&N(r,["startTime"],o);const d=w(e,["endTime"]);d!=null&&N(r,["endTime"],d);const u=w(e,["updateTime"]);u!=null&&N(r,["updateTime"],u);const f=w(e,["error"]);f!=null&&N(r,["error"],f);const p=w(e,["description"]);p!=null&&N(r,["description"],p);const x=w(e,["baseModel"]);x!=null&&N(r,["baseModel"],x);const m=w(e,["tunedModel"]);m!=null&&N(r,["tunedModel"],m);const b=w(e,["preTunedModel"]);b!=null&&N(r,["preTunedModel"],b);const v=w(e,["supervisedTuningSpec"]);v!=null&&N(r,["supervisedTuningSpec"],v);const y=w(e,["preferenceOptimizationSpec"]);y!=null&&N(r,["preferenceOptimizationSpec"],y);const k=w(e,["distillationSpec"]);k!=null&&N(r,["distillationSpec"],k);const _=w(e,["tuningDataStats"]);_!=null&&N(r,["tuningDataStats"],_);const C=w(e,["encryptionSpec"]);C!=null&&N(r,["encryptionSpec"],C);const E=w(e,["partnerModelTuningSpec"]);E!=null&&N(r,["partnerModelTuningSpec"],E);const T=w(e,["customBaseModel"]);T!=null&&N(r,["customBaseModel"],T);const B=w(e,["experiment"]);B!=null&&N(r,["experiment"],B);const F=w(e,["labels"]);F!=null&&N(r,["labels"],F);const M=w(e,["outputUri"]);M!=null&&N(r,["outputUri"],M);const U=w(e,["pipelineJob"]);U!=null&&N(r,["pipelineJob"],U);const D=w(e,["serviceAccount"]);D!=null&&N(r,["serviceAccount"],D);const L=w(e,["tunedModelDisplayName"]);L!=null&&N(r,["tunedModelDisplayName"],L);const P=w(e,["veoTuningSpec"]);return P!=null&&N(r,["veoTuningSpec"],P),r}function lme(e,t){const r={},a=w(e,["sdkHttpResponse"]);a!=null&&N(r,["sdkHttpResponse"],a);const s=w(e,["name"]);s!=null&&N(r,["name"],s);const i=w(e,["metadata"]);i!=null&&N(r,["metadata"],i);const l=w(e,["done"]);l!=null&&N(r,["done"],l);const o=w(e,["error"]);return o!=null&&N(r,["error"],o),r}function C2(e,t){const r={},a=w(e,["gcsUri"]);a!=null&&N(r,["validationDatasetUri"],a);const s=w(e,["vertexDatasetResource"]);return s!=null&&N(r,["validationDatasetUri"],s),r}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class ome extends Do{constructor(t){super(),this.apiClient=t,this.list=async(r={})=>new au(wo.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:lC.JOB_STATE_QUEUED}}}}async getInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=Xxe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>vC(f))}else{const u=Yxe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>xQ(f))}}async listInternal(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=tme(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=ame(f),x=new F3;return Object.assign(x,p),x})}else{const u=eme(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=rme(f),x=new F3;return Object.assign(x,p),x})}}async cancel(t){var r,a,s,i;let l,o="",d={};if(this.apiClient.isVertexAI()){const u=zxe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=Vxe(f),x=new D3;return Object.assign(x,p),x})}else{const u=Hxe(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 x=p;return x.sdkHttpResponse={headers:f.headers},x})),l.then(f=>{const p=$xe(f),x=new D3;return Object.assign(x,p),x})}}async tuneInternal(t){var r,a;let s,i="",l={};if(this.apiClient.isVertexAI()){const o=Wxe(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=>vC(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=qxe(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=>lme(d))}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class cme{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 dme=1024*1024*8,ume=3,Ame=1e3,fme=2,Pg="x-goog-upload-status";async function pme(e,t,r){var a;const s=await mQ(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[Pg])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return i.file}async function hme(e,t,r){var a;const s=await mQ(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[Pg])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");const l=jL(i),o=new Gj;return Object.assign(o,l),o}async function mQ(e,t,r){var a,s;let i=0,l=0,o=new cC(new Response),d="upload";for(i=e.size;l<i;){const u=Math.min(dme,i-l),f=e.slice(l,l+u);l+u>=i&&(d+=", finalize");let p=0,x=Ame;for(;p<ume&&(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[Pg]));)p++,await mme(x),x=x*fme;if(l+=u,((s=o==null?void 0:o.headers)===null||s===void 0?void 0:s[Pg])!=="active")break;if(i<=l)throw new Error("All content has been uploaded, but the upload status is not finalized.")}return o}async function xme(e){return{size:e.size,type:e.type}}function mme(e){return new Promise(t=>setTimeout(t,e))}class gme{async upload(t,r,a){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await pme(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 hme(t,r,a)}async stat(t){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await xme(t)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class bme{create(t,r,a){return new vme(t,r,a)}}class vme{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 lD="x-goog-api-key";class yme{constructor(t){this.apiKey=t}async addAuthHeaders(t,r){if(t.get(lD)===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(lD,this.apiKey)}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const wme="gl-node/";class Nme{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=due(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 yme(this.apiKey);this.apiClient=new xhe({auth:s,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:this.httpOptions,userAgentExtra:wme+"web",uploader:new gme,downloader:new cme}),this.models=new Uhe(this.apiClient),this.live=new Bhe(this.apiClient,s,new bme),this.batches=new QAe(this.apiClient),this.chats=new w0e(this.models,this.apiClient),this.caches=new b0e(this.apiClient),this.files=new D0e(this.apiClient),this.operations=new Mhe(this.apiClient),this.authTokens=new Jhe(this.apiClient),this.tunings=new ome(this.apiClient),this.fileSearchStores=new ixe(this.apiClient)}}async function Cme(e){try{const t=new Nme({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}),kme=({user:e})=>{const{fees:t,pendingBills:r,transactions:a,refreshData:s,loading:i,financialTotals:l}=mt(),[o,d]=j.useState(new Date().getMonth()),[u,f]=j.useState(new Date().getFullYear()),[p,x]=j.useState(null),[m,b]=j.useState(!1);j.useEffect(()=>{s()},[]);const v=j.useMemo(()=>{let _=0,C=0,E=0;t.forEach(M=>{M.month===o&&M.year===u&&(M.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:C+=L})})}),a.forEach(M=>{const U=(M.description||"").toUpperCase();if(M.type==="Ingreso"&&(U.includes("RECUPERACIÓN DEUDA HISTÓRICA")||U.includes("RECUPERACIÓN DEUDA ANTERIOR"))){const[D,L]=M.date.split("-").map(Number);if(D===u&&L-1===o){const P=Number(M.amount)||0;_+=P,U.includes("(EFECTIVO/CAJA)")?E+=P:C+=P}}});let T=0,B=0;a.forEach(M=>{if(M.type==="Egreso"){const[U,D]=M.date.split("-").map(Number);U===u&&D-1===o&&(T+=Number(M.amount)||0)}}),r.forEach(M=>{if(M.status==="Pagado"&&M.paidDate&&(M.paymentSource||"").toLowerCase()==="efectivo"){const[U,D]=M.paidDate.split("-").map(Number);U===u&&D-1===o&&(B+=Number(M.amount)||0)}});const F=T+B;return{ingresos:{total:_,banco:C,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 Cme({periodo:`${_e[o]} ${u}`,conciliacion_ingresos:v.ingresos,conciliacion_egresos:v.egresos,caja_chica:v.cajaChica,disponibilidad_efectivo_usd:(l==null?void 0:l.initialCashUsd)||0});x(_)}catch{alert("Error al conectar con el servicio de IA.")}finally{b(!1)}},k=()=>{const _=`
        <!DOCTYPE html>
        <html lang="es">
        <head>
            <meta charset="UTF-8">
            <title>Auditoría Financiera - ${_e[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 - ${_e[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>
    `,C=new Blob([_],{type:"text/html"}),E=URL.createObjectURL(C),T=document.createElement("a");T.href=E,T.download=`Auditoria_${_e[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:_e.map((_,C)=>n.jsx("option",{value:C,children:_},C))}),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:k,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(Jd,{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(Nt,{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(K_,{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:[_e[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(W_,{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(Ab,{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(W_,{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(K_,{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:()=>x(null),className:"p-3 bg-slate-900 text-white rounded-xl",children:n.jsx(xt,{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}})]})})]})},jme=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState(!0),[i,l]=j.useState(!1),[o,d]=j.useState(null),[u,f]=j.useState(""),[p,x]=j.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 ve.getProperties();r(E)}catch(E){console.error(E)}finally{s(!1)}};j.useEffect(()=>{b()},[]);const v=E=>{E?(d(E),x(E)):(d(null),x({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 ve.deleteProperty(E),b()}catch{alert("Error")}},k=async E=>{E.preventDefault();try{await ve.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;"}),M=URL.createObjectURL(F),U=document.createElement("a");U.setAttribute("href",M),U.setAttribute("download","sac_propiedades_mirror.csv"),document.body.appendChild(U),U.click(),document.body.removeChild(U)},C=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(ji,{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..."})]})}):C.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."})}):C.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(Lc,{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(vl,{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(xt,{size:24})})]}),n.jsxs("form",{onSubmit:k,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=>x({...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=>x({...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=>x({...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=>x({...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(Tc,{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=>x({...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=>x({...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=>x({...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"]})]})]})]})})]})},Eme=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState([]),[i,l]=j.useState([]),[o,d]=j.useState(!0),[u,f]=j.useState(!1),[p,x]=j.useState(null),[m,b]=j.useState(null),[v,y]=j.useState(""),[k,_]=j.useState(""),[C,E]=j.useState(0),[T,B]=j.useState(""),[F,M]=j.useState(!1),U=["programmer","admin"].includes(e.role),D=async()=>{d(!0);try{const[Y,K,ee]=await Promise.all([ve.getResidents(),ve.getProperties(),ve.getUsers()]);r(Y),s(K),l(ee),K.length>0&&E(K[0].id)}catch(Y){console.error(Y)}finally{d(!1)}};j.useEffect(()=>{D()},[]);const L=Y=>{var K;Y?(x(Y),y(Y.cedula),_(Y.fullName),b(null),B(Y.phone),E(Y.propertyId),M(Y.isOwner)):(x(null),b(null),y(""),_(""),B(""),E(((K=a[0])==null?void 0:K.id)||0),M(!1)),f(!0)},P=Y=>{const K=Number(Y),ee=i.find(J=>J.id===K);ee?(b(K),y(ee.cedula||"S/C"),_(ee.fullName),B(ee.phone||""),ee.role==="owner"&&M(!0)):(b(null),y(""),_(""),B(""))},G=async Y=>{if(confirm("¿Desea desvincular a este residente?"))try{await ve.deleteResident(Y),D()}catch{alert("Error al eliminar")}},H=async Y=>{Y.preventDefault();try{if(p)await ve.saveResident({id:p.id,propertyId:C,phone:T,isOwner:F});else{if(!m){alert("Debe seleccionar un usuario válido.");return}await ve.saveResident({userId:m,propertyId:C,phone:T,isOwner:F})}f(!1),D()}catch(K){alert(K.message||"Error al guardar asignación")}},Q=i.filter(Y=>Y.cedula&&Y.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(uN,{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(Y=>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:Y.fullName}),n.jsx("td",{className:"px-8 py-6 text-slate-500 font-medium",children:Y.cedula}),n.jsx("td",{className:"px-8 py-6",children:n.jsxs("span",{className:"text-slate-700 font-bold text-sm",children:[Y.propertyType," ",Y.propertyNumber," (",Y.propertyCode,")"]})}),n.jsx("td",{className:"px-8 py-6 text-slate-500",children:Y.phone}),n.jsx("td",{className:"px-8 py-6",children:Y.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(Y),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(vl,{size:18})}),n.jsx("button",{onClick:()=>G(Y.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(rq,{size:18})})]})})]},Y.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(uN,{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(xt,{size:24})})]}),n.jsxs("form",{onSubmit:H,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(jA,{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:k}),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:Y=>P(Y.target.value),defaultValue:"",children:[n.jsx("option",{value:"",disabled:!0,children:"-- Seleccione por Cédula / Nombre --"}),Q.map(Y=>n.jsxs("option",{value:Y.id,children:[Y.cedula," - ",Y.fullName]},Y.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:k})]}),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(CG,{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:C,onChange:Y=>E(Number(Y.target.value)),children:a.map(Y=>n.jsxs("option",{value:Y.id,children:[Y.type," ",Y.number," - ",Y.code]},Y.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:Y=>B(Y.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:()=>M(!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:()=>M(!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"]})]})]})]})})]})},Sme=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState(!0),[i,l]=j.useState(!1),[o,d]=j.useState(""),[u,f]=j.useState(null),[p,x]=j.useState(null),[m,b]=j.useState(""),[v,y]=j.useState(""),[k,_]=j.useState(""),[C,E]=j.useState(""),[T,B]=j.useState(""),[F,M]=j.useState(""),[U,D]=j.useState(""),[L,P]=j.useState("owner"),[G,H]=j.useState(""),[Q,Y]=j.useState("Activo"),[K,ee]=j.useState(null),J=async()=>{s(!0);try{const le=await ve.getUsers();r(le)}catch(le){console.error(le)}finally{s(!1)}};j.useEffect(()=>{J()},[]);const W=async le=>{f(le);try{const ae=await(await ve.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)}},R=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}x(le.id);try{(await fetch(`${ye}/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.`),J()):alert("Error al activar demo en el servidor.")}catch{alert("Fallo de red.")}finally{x(null)}},O=()=>{if(t.length===0)return;const le=`cedula,nombre_completo,correo,telefono,rol,telegram_id
`,ne=t.map(Ue=>[Ue.cedula||Ue.username,Ue.fullName,Ue.email,Ue.phone,Ue.role,Ue.telegramChatId||""]),ae=le+ne.map(Ue=>Ue.join(",")).join(`
`),ie=new Blob([ae],{type:"text/csv;charset=utf-8;"}),he=URL.createObjectURL(ie),Z=document.createElement("a");Z.setAttribute("href",he),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(bs,{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||""),M(le.telegramChatId||""),D(""),P(le.role),H(le.relationship||""),Y(le.status==="Activo"||le.status==="active"?"Activo":"Inactivo")}else ee(null),b(""),y(""),_(""),E(""),B(""),M(""),D(""),P("owner"),H(""),Y("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 ve.deleteUser(le),J()}catch{alert("Error al eliminar")}},X=async le=>{le.preventDefault();const ne=`${m} ${v}`.trim(),ae={id:K,username:k,fullName:ne,cedula:k,phone:C,email:T,telegramChatId:F,password:U||void 0,role:L,relationship:G,status:Q==="Activo"?"active":"inactive"};try{await ve.saveUser(ae),l(!1),J(),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(ji,{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(uN,{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:()=>R(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(Oc,{size:18})}),n.jsx("button",{onClick:()=>W(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(Pr,{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(vl,{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(xt,{size:24})})]}),n.jsxs("form",{onSubmit:X,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:k,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(XG,{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(Pr,{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(ok,{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:C,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(kK,{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=>M(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(jA,{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})},Ku=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},Bme=({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:x}=mt(),[m,b]=j.useState("payable"),[v,y]=j.useState(new Date().getMonth()),[k,_]=j.useState(new Date().getFullYear()),[C,E]=j.useState(""),[T,B]=j.useState(!1),[F,M]=j.useState(!1),[U,D]=j.useState(!1),[L,P]=j.useState(null),[G,H]=j.useState(null),[Q,Y]=j.useState(!1),[K,ee]=j.useState(null),[J,W]=j.useState(!1),R=async me=>{if(!me||me==="S/R"||me.length<3){ee(null);return}try{const tt=await(await fetch(`${ye}/check_duplicate_reference.php?reference=${me}`)).json();tt.isDuplicate?ee(tt):ee(null)}catch(We){console.error("Error checking duplicate:",We)}},O=()=>{const me=window.open("","","width=900,height=900");if(!me)return;const We=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("");me.document.write(`
        <html>
        <head>
            <title>Cuentas por Pagar - ${_e[v]} ${k}</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: ${_e[v]} ${k}</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>${We}</tbody>
            </table>
            <div class="footer">Reporte generado el ${new Date().toLocaleString()} • SAC Kernel V4.1.70 MC/MB</div>
        </body>
        </html>
    `),me.document.close(),me.print()},q=()=>{const me=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(""),We=`
        <!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: ${_e[v]} ${k}</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>${me}</tbody>
            </table>
        </body>
        </html>
    `,tt=new Blob([We],{type:"text/html"}),te=URL.createObjectURL(tt),de=document.createElement("a");de.href=te,de.download=`Cuentas_por_Pagar_${_e[v]}_${k}.html`,de.click(),URL.revokeObjectURL(te)},[z,X]=j.useState(!1),[re,le]=j.useState(2),[ne,ae]=j.useState([]),[ie,he]=j.useState({status:"Pendiente",dueDate:Fr(),creationDate:Fr(),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,Ue]=j.useState("am"),[Ie,be]=j.useState(null),[je,fe]=j.useState(""),[Me,Xe]=j.useState(""),[it,at]=j.useState("Banco"),[Ct,kt]=j.useState(Fr()),[ft,Br]=j.useState(!1),[Ar,fa]=j.useState(!1),[Ut,_r]=j.useState([]),[st,Rt]=j.useState("pm"),[Et,jt]=j.useState(""),[Kt,fr]=j.useState(!1),Nr=j.useMemo(()=>Et?l.filter(me=>me.name.toLowerCase().includes(Et.toLowerCase())||me.rif.toLowerCase().includes(Et.toLowerCase())):[],[l,Et]),cn=(me,We="pm")=>{const tt=p.find(de=>de.date===me);if(!tt)return 45;if(We==="parallel")return Number(tt.parallelValue)||45;const te=We==="am"?Number(tt.amValue)||Number(tt.pmValue):Number(tt.pmValue)||Number(tt.amValue);return Number(te)||45},$n=j.useMemo(()=>cn(ie.creationDate||Fr(),Z),[ie.creationDate,Z,p]),Cs=j.useMemo(()=>$n<=0?0:Number(ie.amountBs)/Number($n),[ie.amountBs,$n]),ks=j.useMemo(()=>{if(!p||p.length===0)return 45;const me=p[0];return Number(me.pmValue)>0?Number(me.pmValue):Number(me.amValue)},[p]),Bi=j.useMemo(()=>{let me=0;const We=[],tt=r.find(te=>te.month===v&&te.year===k);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);(!C||(oe==null?void 0:oe.code.toLowerCase().includes(C.toLowerCase()))||(ce==null?void 0:ce.fullName.toLowerCase().includes(C.toLowerCase())))&&(We.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}),me+=de)}}),{totalDebt:me,items:We.sort((te,de)=>de.amount-te.amount)}},[r,s,a,v,k,ks,C]),ta=j.useMemo(()=>{const me=i.filter(ce=>{const[ue,Ae]=ce.dueDate.split("-").map(Number),we=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,Ne=!C||ce.provider.toLowerCase().includes(C.toLowerCase())||ce.description.toLowerCase().includes(C.toLowerCase());return Re===k&&we===v&&Ne}),We=me.reduce((ce,ue)=>ce+Number(ue.amount),0),tt=me.reduce((ce,ue)=>ce+Number(ue.amountBs),0),te=me.reduce((ce,ue)=>ce+(Number(ue.paid_amount_usd)||0),0),de=me.reduce((ce,ue)=>ce+(Number(ue.paid_amount_bs)||0),0);return{pendingTotal:We-te,totalUsd:We,totalBs:tt,paidUsd:te,paidBs:de,items:me.sort((ce,ue)=>new Date(ce.dueDate).getTime()-new Date(ue.dueDate).getTime())}},[i,v,k,C]),dn=me=>{X(!1),le(2),ae([]),me?(H(me.id),he({...me,prefill_fee:!!me.prefill_fee,is_uncommon:!!me.is_uncommon,is_special:!!me.is_special,is_silent:!!me.is_silent,special_props_json:me.special_props_json||[],target_month:me.target_month??new Date().getMonth(),target_year:me.target_year??new Date().getFullYear()}),jt(me.provider)):(H(null),he({status:"Pendiente",dueDate:Fr(),creationDate:Fr(),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 me=>{if(me.preventDefault(),!ie.provider)return alert("Seleccione un proveedor.");if(z&&ne.length!==re)return alert(`Debe seleccionar exactamente ${re} meses para el fraccionamiento.`);const We={...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(`${ye}/save_pending_bill.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(We)});if(tt.ok)B(!1),x();else{const te=await tt.json();alert("Error: "+te.error)}}catch{alert("Error de conexión.")}},_i=me=>{ne.includes(me)?ae(We=>We.filter(tt=>tt!==me)):ne.length<re&&ae(We=>[...We,me].sort((tt,te)=>tt-te))},qc=me=>{const We=Number(me.amount)-(Number(me.paid_amount_usd)||0),tt=cn(Fr(),"pm");be(me),fe(Number(We*tt).toFixed(2)),Xe(""),at("Banco"),kt(Fr()),Br(!!me.is_silent),fa(!1),_r([{amountBs:(We*tt).toFixed(2),ref:"",date:Fr()}]),M(!0)},Po=()=>{_r([...Ut,{amountBs:"0.00",ref:"",date:Fr()}])},Dl=me=>{Ut.length>1&&_r(Ut.filter((We,tt)=>tt!==me))},Ve=(me,We,tt)=>{const te=[...Ut];te[me]={...te[me],[We]:tt},_r(te)},It=async me=>{if(me.preventDefault(),!Ie)return;const We=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(`${ye}/check_duplicate_reference.php?reference=${te.ref}`)).json()).isDuplicate&&!J){alert(We?`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(`${ye}/pay_pending_bill.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:Ie.id,is_multiple:!0,payments:tt,source:it,is_silent:ft,force_close:U})})).ok)throw new Error("Kernel Error");M(!1),D(!1),W(!1),ee(null),x(),alert("Múltiples Abonos Registrados")}catch(te){alert("Error al liquidar factura: "+(te.message||"Fallo desconocido"))}}else{if(Me&&Me!=="S/R"&&Me.length>=3&&(await(await fetch(`${ye}/check_duplicate_reference.php?reference=${Me}`)).json()).isDuplicate&&!J){alert(We?`El código de transferencia ${Me} 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 ${Me} ya ha sido usado. Por favor, envíe el comprobante a la administración para su verificación manual.`);return}const tt=cn(Ct,st),te=parseFloat(je),de=ra(te/tt,2);try{if(!(await fetch(`${ye}/pay_pending_bill.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:Ie.id,amount_bs:te,amount_usd:de,reference:Me||"S/R",source:it,date:Ct,is_silent:ft,force_close:U})})).ok)throw new Error("Kernel Error");M(!1),D(!1),W(!1),ee(null),x(),alert(U||de>=Number(Ie.amount)-(Number(Ie.paid_amount_usd)||0)?"Factura Liquidada Completa":"Abono Parcial Registrado")}catch(oe){alert("Error al liquidar factura: "+(oe.message||"Fallo desconocido"))}}},ra=(me,We)=>{const tt=Math.pow(10,We);return Math.round(me*tt)/tt},Ma=j.useMemo(()=>[...s].sort((me,We)=>me.code.localeCompare(We.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 ${Q?"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(Dp,{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(Nt,{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(Jd,{size:18})," HTML"]}),n.jsxs("button",{onClick:()=>Y(!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(Nt,{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:me=>y(Number(me.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:_e.map((me,We)=>n.jsx("option",{value:We,children:me},We))}),n.jsx("input",{type:"number",value:k,onChange:me=>_(Number(me.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:C,onChange:me=>E(me.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((me,We)=>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:me.code}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:me.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 ${me.amount<0?"bg-blue-50 text-blue-600 border-blue-100":me.status==="Pendiente"?"bg-red-50 text-red-600 border-red-100":"bg-amber-50 text-amber-600 border-amber-100"}`,children:me.amount<0?"REEMBOLSO":me.status})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsx("p",{className:`font-black text-xl tracking-tighter ${me.amount<0?"text-blue-600":"text-slate-900"}`,children:me.amount<0?`(${Oa(Math.abs(me.amount))})`:`$${Oa(me.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(hK,{size:18})})})]},We)):ta.items.map(me=>{const We=Number(me.paid_amount_usd)||0,tt=Number(me.amount),te=tt-We,de=We>0&&We<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 ${me.prefill_fee?"bg-blue-600 text-white":"bg-slate-50 text-slate-400"}`,children:me.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:me.provider}),n.jsx("p",{className:"text-xs font-bold text-slate-500 mt-1 uppercase line-clamp-1 italic opacity-70",children:me.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 ${me.status==="Pagado"?"bg-emerald-50 text-emerald-600 border-emerald-100":me.status==="Parcial"?"bg-amber-50 text-amber-600 border-amber-100 animate-pulse":"bg-slate-100 text-slate-500"}`,children:[me.status==="Pagado"&&n.jsx(Xi,{size:12}),me.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:`${We/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. ",Ku(te*ks)]}),We>0&&n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:["Pagado: $",Oa(We)," de $",Oa(tt)]})]}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("div",{className:"flex justify-end gap-2",children:[me.status!=="Pagado"&&n.jsx("button",{onClick:()=>qc(me),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"}),We>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(me),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(vl,{size:18})}),n.jsx("button",{onClick:()=>P({id:me.id,provider:me.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})})]})})]},me.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(bs,{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),x()},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(xt,{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(fb,{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:me=>{jt(me.target.value),he({...ie,provider:me.target.value}),fr(!0)},onFocus:()=>fr(!0),placeholder:"Buscar o escribir nombre..."}),Kt&&(Et.length>0||Nr.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:Nr.map(me=>n.jsx("button",{type:"button",onClick:()=>{he({...ie,provider:me.name}),jt(me.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:me.name},me.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:me=>he({...ie,description:me.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:me=>he({...ie,creationDate:me.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:me=>he({...ie,dueDate:me.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:()=>Ue("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:()=>Ue("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:()=>Ue("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:me=>he({...ie,amountBs:parseFloat(me.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:()=>he({...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(wK,{size:14})," ¿Fraccionar este Pago?"]}),n.jsx("button",{type:"button",onClick:()=>X(!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:me=>{le(parseInt(me.target.value)),ae([])},children:[2,3,4,5,6,8,10,12].map(me=>n.jsxs("option",{value:me,className:"text-slate-900",children:[me," Partes"]},me))})]}),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:_e.map((me,We)=>n.jsx("button",{type:"button",onClick:()=>_i(We),className:`py-2 rounded-lg text-[8px] font-black border transition-all ${ne.includes(We)?"bg-blue-600 border-blue-500 text-white":"bg-white/5 border-white/10 text-slate-500"}`,children:me.substring(0,3).toUpperCase()},We))})]})]}):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:me=>he({...ie,target_month:parseInt(me.target.value)}),children:_e.map((me,We)=>n.jsx("option",{value:We,children:me},We))})]}),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:me=>he({...ie,target_year:parseInt(me.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(me=>n.jsx("button",{type:"button",onClick:()=>he({...ie,fee_category:me}),className:`flex-1 py-3 rounded-xl text-[9px] font-black uppercase border transition-all ${ie.fee_category===me?"bg-blue-600 border-blue-600 text-white shadow-lg":"bg-white/5 border-white/10 text-slate-400 hover:text-white"}`,children:me==="fixed"?"Fijo":me==="variable"?"Variable":"Otros"},me))})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[n.jsxs("button",{type:"button",onClick:()=>he({...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(Lc,{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:()=>he({...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(ck,{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:()=>he({...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(me=>{var We;return n.jsx("button",{type:"button",onClick:()=>{const tt=ie.special_props_json||[];he({...ie,special_props_json:tt.includes(me.id)?tt.filter(te=>te!==me.id):[...tt,me.id]})},className:`py-2 rounded-lg text-[8px] font-black border transition-all ${(We=ie.special_props_json)!=null&&We.includes(me.id)?"bg-blue-600 border-blue-500 text-white":"bg-white/5 border-white/10 text-slate-500 hover:text-white"}`,children:me.code.split("-")[1]||me.code},me.id)})})]})]}):n.jsxs("div",{className:"py-20 text-center opacity-30",children:[n.jsx(bs,{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&&Ie&&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:()=>M(!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(xt,{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: ",Ie.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(Ie.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(Ie.amount)-(Number(Ie.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(Pc,{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:()=>fa(!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((me,We)=>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:me.amountBs,onChange:tt=>Ve(We,"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:me.ref,onChange:tt=>{Ve(We,"ref",tt.target.value),tt.target.value.length>=3&&R(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:me.date,onChange:tt=>Ve(We,"date",tt.target.value)})]})]}),Ut.length>1&&n.jsx("button",{type:"button",onClick:()=>Dl(We),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(xt,{size:12})})]},We)),n.jsxs("button",{type:"button",onClick:Po,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((me,We)=>me+parseFloat(We.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 ${st==="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 ${st==="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 ${st==="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:je,onChange:me=>fe(me.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(je)/cn(Ct,st))]})]}),n.jsx(Ha,{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:Me,onChange:me=>{Xe(me.target.value),me.target.value.length>=3&&R(me.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:me=>kt(me.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((me,We)=>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:[me.table==="payment_reports"?"Reporte":me.table==="payments"?"Pago":me.table==="bank_transactions"?"Banco":"CxP",": ",me.details]}),n.jsx("span",{className:"text-amber-600",children:me.date})]},We))})]}),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:J,onChange:me=>W(me.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(me=>n.jsx("button",{type:"button",onClick:()=>at(me),className:`flex-1 py-3 rounded-xl font-black text-[9px] uppercase transition-all ${it===me?"bg-slate-900 text-white shadow-lg":"bg-slate-50 text-slate-400 border border-slate-100"}`,children:me},me))})]}),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:()=>Br(!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:me=>D(me.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"})]})]})}),Q&&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: ",_e[v]," ",k]})]}),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(Nt,{size:16})," Imprimir / PDF"]}),n.jsx("button",{onClick:()=>Y(!1),className:"p-3 bg-white text-slate-400 hover:text-slate-600 rounded-xl border border-slate-200 transition-all",children:n.jsx(xt,{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: ",_e[v]," ",k]})]}),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(me=>n.jsxs(Tp.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:me.provider}),n.jsx("p",{className:"text-[10px] font-bold text-slate-500 mt-0.5",children:me.description})]}),n.jsx("td",{className:"py-4 text-center text-[10px] font-bold text-slate-600",children:me.dueDate}),n.jsxs("td",{className:"py-4 text-right text-xs font-black text-slate-900",children:["$ ",Oa(me.amount)]}),n.jsxs("td",{className:"py-4 text-right text-xs font-black text-slate-600",children:["Bs. ",Ku(me.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 ${me.status==="Pagado"?"bg-emerald-100 text-emerald-700":me.status==="Parcial"?"bg-amber-100 text-amber-700":"bg-rose-100 text-rose-700"}`,children:me.status})})]}),me.payments&&me.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:me.payments.map(We=>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:We.payment_date}),n.jsx("td",{className:"py-2 text-[9px] font-black text-slate-900",children:We.reference}),n.jsx("td",{className:"py-2 text-[9px] font-bold text-slate-500",children:We.source}),n.jsxs("td",{className:"py-2 text-right text-[9px] font-black text-slate-900",children:["$ ",Oa(We.amount_usd)]}),n.jsxs("td",{className:"py-2 text-right text-[9px] font-black text-slate-600",children:["Bs. ",Ku(We.amount_bs)]})]},We.id))})]})]})})})]},me.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. ",Ku(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. ",Ku(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. ",Ku(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 Lg={};Lg.version="0.18.5";var gQ=1252,_me=[874,932,936,949,950,1250,1251,1252,1253,1254,1255,1256,1257,1258,1e4],eE={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},tE=function(e){_me.indexOf(e)!=-1&&(gQ=eE[0]=e)};function Tme(){tE(1252)}var Pi=function(e){tE(e)};function rE(){Pi(1200),Tme()}function oD(e){for(var t=[],r=0,a=e.length;r<a;++r)t[r]=e.charCodeAt(r);return t}function Ime(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 bQ(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 vf=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1);return t==255&&r==254?Ime(e.slice(2)):t==254&&r==255?bQ(e.slice(2)):t==65279?e.slice(1):e},Qx=function(t){return String.fromCharCode(t)},cD=function(t){return String.fromCharCode(t)},pp,vc="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+=vc.charAt(i)+vc.charAt(l)+vc.charAt(o)+vc.charAt(d);return t}function $s(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=vc.indexOf(e.charAt(u++)),l=vc.indexOf(e.charAt(u++)),r=i<<2|l>>4,t+=String.fromCharCode(r),o=vc.indexOf(e.charAt(u++)),a=(l&15)<<4|o>>2,o!==64&&(t+=String.fromCharCode(a)),d=vc.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})(),Mo=(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 Fc(e){return Mt?Buffer.alloc?Buffer.alloc(e):new Buffer(e):typeof Uint8Array<"u"?new Uint8Array(e):new Array(e)}function dD(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?Mo(t,"binary"):t.split("").map(function(r){return r.charCodeAt(0)&255})};function lv(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 Vc(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 Fme(e){if(typeof Uint8Array>"u")throw new Error("Unsupported");return new Uint8Array(e)}function aE(e){if(typeof ArrayBuffer>"u")throw new Error("Unsupported");if(e instanceof ArrayBuffer)return aE(new Uint8Array(e));for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=e[r];return t}var Za=Mt?function(e){return Buffer.concat(e.map(function(t){return Buffer.isBuffer(t)?t:Mo(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 Dme(e){for(var t=[],r=0,a=e.length+250,s=Fc(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=Fc(65535),a=65530)}return t.push(s.slice(0,r)),Za(t)}var Jn=/\u0000/g,yf=/[\u0001-\u0006]/g;function vA(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 nE(e,t){var r=""+e;return r.length>=t?r:oa(" ",t-r.length)+r}function Qg(e,t){var r=""+e;return r.length>=t?r:r+oa(" ",t-r.length)}function Ume(e,t){var r=""+Math.round(e);return r.length>=t?r:oa("0",t-r.length)+r}function Mme(e,t){var r=""+e;return r.length>=t?r:oa("0",t-r.length)+r}var uD=Math.pow(2,32);function qu(e,t){if(e>uD||e<-uD)return Ume(e,t);var r=Math.round(e);return Mme(r,t)}function Hg(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 AD=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],k2=[["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 Rme(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"秒 "'},fD={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},Ome={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 zg(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 x=Math.floor(a*o/f);return[x,a*o-x*f,f]}function Cd(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=$me(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 vQ=new Date(1899,11,31,0,0,0),Pme=vQ.getTime(),Lme=new Date(1900,2,1,0,0,0);function yQ(e,t){var r=e.getTime();return t?r-=1461*24*60*60*1e3:e>=Lme&&(r+=1440*60*1e3),(r-(Pme+(e.getTimezoneOffset()-vQ.getTimezoneOffset())*6e4))/(1440*60*1e3)}function sE(e){return e.indexOf(".")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)$/,"$1")}function Qme(e){return e.indexOf("E")==-1?e:e.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/,"$1E").replace(/(E[+-])(\d)$/,"$10$2")}function Hme(e){var t=e<0?12:11,r=sE(e.toFixed(12));return r.length<=t||(r=e.toPrecision(10),r.length<=t)?r:e.toExponential(5)}function zme(e){var t=sE(e.toFixed(11));return t.length>(e<0?12:11)||t==="0"||t==="-0"?e.toPrecision(6):t}function xp(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=Hme(e):t===10?r=e.toFixed(10).substr(0,12):r=zme(e),sE(Qme(r.toUpperCase()))}function Vd(e,t){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(e|0)===e?e.toString(10):xp(e);case"undefined":return"";case"object":if(e==null)return"";if(e instanceof Date)return ki(14,yQ(e,t&&t.date1904),t)}throw new Error("unsupported value in General format: "+e)}function $me(e,t){t[0]-=581;var r=e.getDay();return e<60&&(r=(r+6)%7),r}function Vme(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 k2[r.m-1][1];case 5:return k2[r.m-1][0];default:return k2[r.m-1][2]}break;case 100:switch(t.length){case 1:case 2:d=r.d,u=t.length;break;case 3:return AD[r.q][0];default:return AD[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 yc(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 wQ=/%/g;function Gme(e,t,r){var a=t.replace(wQ,""),s=t.length-a.length;return co(e,a,r*Math.pow(10,2*s))+oa("%",s)}function Kme(e,t,r){for(var a=t.length-1;t.charCodeAt(a-1)===44;)--a;return co(e,t.substr(0,a),r/Math.pow(10,3*(t.length-a)))}function NQ(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"-"+NQ(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 CQ=/# (\?+)( ?)\/( ?)(\d+)/;function qme(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):nE(l,e[1].length)+e[2]+"/"+e[3]+Li(o,e[4].length))}function Wme(e,t,r){return r+(t===0?"":""+t)+oa(" ",e[1].length+2+e[4].length)}var kQ=/^#*0*\.([0#]+)/,jQ=/\).*[0#]/,EQ=/\(###\) ###\\?-####/;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 pD(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 Yme(e,t){return t<(""+Math.round((e-Math.floor(e))*Math.pow(10,t))).length?1:0}function Xme(e){return e<2147483647&&e>-2147483648?""+(e>=0?e|0:e-1|0):""+Math.floor(e)}function ii(e,t,r){if(e.charCodeAt(0)===40&&!t.match(jQ)){var a=t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return r>=0?ii("n",a,r):"("+ii("n",a,-r)+")"}if(t.charCodeAt(t.length-1)===44)return Kme(e,t,r);if(t.indexOf("%")!==-1)return Gme(e,t,r);if(t.indexOf("E")!==-1)return NQ(t,r);if(t.charCodeAt(0)===36)return"$"+ii(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+qu(d,t.length);if(t.match(/^[#?]+$/))return s=qu(r,0),s==="0"&&(s=""),s.length>t.length?s:qn(t.substr(0,t.length-s.length))+s;if(i=t.match(CQ))return qme(i,d,u);if(t.match(/^#+0+$/))return u+qu(d,t.length-t.indexOf("0"));if(i=t.match(kQ))return s=pD(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+pD(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+yc(qu(d,0));if(i=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+ii(e,t,-r):yc(""+(Math.floor(r)+Yme(r,i[1].length)))+"."+Li(hD(r,i[1].length),i[1].length);if(i=t.match(/^#,#*,#0/))return ii(e,t.replace(/^#,#*,/,""),r);if(i=t.match(/^([0#]+)(\\?-([0#]+))+$/))return s=vA(ii(e,t.replace(/[\\-]/g,""),r)),l=0,vA(vA(t.replace(/\\/g,"")).replace(/[0#]/g,function(b){return l<s.length?s.charAt(l++):b==="0"?"0":""}));if(t.match(EQ))return s=ii(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=zg(d,Math.pow(10,l)-1,!1),s=""+u,f=co("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=Qg(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=zg(d,Math.pow(10,l)-1,!0),u+(o[0]||(o[1]?"":"0"))+" "+(o[1]?nE(o[1],l)+i[2]+"/"+i[3]+Qg(o[2],l):oa(" ",2*l+1+i[2].length+i[3].length));if(i=t.match(/^[#0?]+$/))return s=qu(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,x=t.length-s.length-p;return qn(t.substr(0,p)+s+t.substr(t.length-x))}if(i=t.match(/^00,000\.([#0]*0)$/))return l=hD(r,i[1].length),r<0?"-"+ii(e,t,-r):yc(Xme(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 ii(e,"#,##0.00",r);case"###,###":case"##,###":case"#,###":var m=yc(qu(d,0));return m!=="0"?u+m:"";case"###,###.00":return ii(e,"###,##0.00",r).replace(/^0\./,".");case"#,###.00":return ii(e,"#,##0.00",r).replace(/^0\./,".")}throw new Error("unsupported format |"+t+"|")}function Jme(e,t,r){for(var a=t.length-1;t.charCodeAt(a-1)===44;)--a;return co(e,t.substr(0,a),r/Math.pow(10,3*(t.length-a)))}function Zme(e,t,r){var a=t.replace(wQ,""),s=t.length-a.length;return co(e,a,r*Math.pow(10,2*s))+oa("%",s)}function SQ(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"-"+SQ(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(jQ)){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 Jme(e,t,r);if(t.indexOf("%")!==-1)return Zme(e,t,r);if(t.indexOf("E")!==-1)return SQ(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(CQ))return Wme(i,d,u);if(t.match(/^#+0+$/))return u+Li(d,t.length-t.indexOf("0"));if(i=t.match(kQ))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+yc(""+d);if(i=t.match(/^#,##0\.([#0]*0)$/))return r<0?"-"+Al(e,t,-r):yc(""+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=vA(Al(e,t.replace(/[\\-]/g,""),r)),l=0,vA(vA(t.replace(/\\/g,"")).replace(/[0#]/g,function(b){return l<s.length?s.charAt(l++):b==="0"?"0":""}));if(t.match(EQ))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=zg(d,Math.pow(10,l)-1,!1),s=""+u,f=co("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=Qg(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=zg(d,Math.pow(10,l)-1,!0),u+(o[0]||(o[1]?"":"0"))+" "+(o[1]?nE(o[1],l)+i[2]+"/"+i[3]+Qg(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,x=t.length-s.length-p;return qn(t.substr(0,p)+s+t.substr(t.length-x))}if(i=t.match(/^00,000\.([#0]*0)$/))return r<0?"-"+Al(e,t,-r):yc(""+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=yc(""+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 co(e,t,r){return(r|0)===r?Al(e,t,r):ii(e,t,r)}function ege(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 BQ=/\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;function e0(e){for(var t=0,r="",a="";t<e.length;)switch(r=e.charAt(t)){case"G":Hg(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(BQ))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 tge(e,t,r,a){for(var s=[],i="",l=0,o="",d="t",u,f,p,x="H";l<e.length;)switch(o=e.charAt(l)){case"G":if(!Hg(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=Cd(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=Cd(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=x),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=Cd(t,r)),e.substr(l,3).toUpperCase()==="A/P"?(u!=null&&(v.v=u.H>=12?"P":"A"),v.t="T",x="h",l+=3):e.substr(l,5).toUpperCase()==="AM/PM"?(u!=null&&(v.v=u.H>=12?"PM":"AM"),v.t="T",l+=5,x="h"):e.substr(l,5).toUpperCase()==="上午/下午"?(u!=null&&(v.v=u.H>=12?"下午":"上午"),v.t="T",l+=5,x="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(BQ)){if(u==null&&(u=Cd(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]||"$",e0(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,k=0,_;for(l=s.length-1,d="t";l>=0;--l)switch(s[l].t){case"h":case"H":s[l].t=x,d="h",y<1&&(y=1);break;case"s":(_=s[l].v.match(/\.0+$/))&&(k=Math.max(k,_[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 C="",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=Vme(s[l].t.charCodeAt(0),s[l].v,u,k),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;C+=s[l].v,l=E-1;break;case"G":s[l].t="t",s[l].v=Vd(t,r);break}var T="",B,F;if(C.length>0){C.charCodeAt(0)==40?(B=t<0&&C.charCodeAt(0)===45?-t:t,F=co("n",C,B)):(B=t<0&&a>1?-t:t,F=co("n",C,B),B<0&&s[0]&&s[0].t=="t"&&(F=F.substr(1),s[0].v="-"+s[0].v)),E=F.length-1;var M=s.length;for(l=0;l<s.length;++l)if(s[l]!=null&&s[l].t!="t"&&s[l].v.indexOf(".")>-1){M=l;break}var U=s.length;if(M===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(M!==s.length&&F.indexOf("E")===-1){for(E=F.indexOf(".")-1,l=M;l>=0;--l)if(!(s[l]==null||"n?".indexOf(s[l].t)===-1)){for(f=s[l].v.indexOf(".")>-1&&l===M?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=M;l<s.length;++l)if(!(s[l]==null||"n?(".indexOf(s[l].t)===-1&&l!==M)){for(f=s[l].v.indexOf(".")>-1&&l===M?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=co(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 xD=/\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;function mD(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 rge(e,t){var r=ege(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(xD),o=r[1].match(xD);return mD(t,l)?[a,r[0]]:mD(t,o)?[a,r[1]]:[a,r[l!=null&&o!=null?2:1]]}return[a,i]}function ki(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[fD[e]]||vt[fD[e]]),a==null&&(a=Ome[e]||"General");break}if(Hg(a,0))return Vd(t,r);t instanceof Date&&(t=yQ(t,r.date1904));var s=rge(a,t);if(Hg(s[1]))return Vd(t,r);if(t===!0)t="TRUE";else if(t===!1)t="FALSE";else if(t===""||t==null)return"";return tge(s[1],t,r,s[0])}function uo(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 ov(e){for(var t=0;t!=392;++t)e[t]!==void 0&&uo(e[t],t)}function t0(){vt=Rme()}var age={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"},_Q=/[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;function nge(e){var t=typeof e=="number"?vt[e]:e;return t=t.replace(_Q,"(\\d+)"),new RegExp("^"+t+"$")}function sge(e,t,r){var a=-1,s=-1,i=-1,l=-1,o=-1,d=-1;(t.match(_Q)||[]).forEach(function(p,x){var m=parseInt(r[x+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 ige=(function(){var e={};e.version="1.2.0";function t(){for(var F=0,M=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,M[U]=F;return typeof Int32Array<"u"?new Int32Array(M):M}var r=t();function a(F){var M=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],M=256+D;M<4096;M+=256)U=L[M]=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],x=s[7],m=s[8],b=s[9],v=s[10],y=s[11],k=s[12],_=s[13],C=s[14];function E(F,M){for(var U=M^-1,D=0,L=F.length;D<L;)U=U>>>8^r[(U^F.charCodeAt(D++))&255];return~U}function T(F,M){for(var U=M^-1,D=F.length-15,L=0;L<D;)U=C[F[L++]^U&255]^_[F[L++]^U>>8&255]^k[F[L++]^U>>16&255]^y[F[L++]^U>>>24]^v[F[L++]]^b[F[L++]]^m[F[L++]]^x[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,M){for(var U=M^-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})(),ht=(function(){var t={};t.version="1.2.1";function r(te,de){for(var oe=te.split("/"),ce=de.split("/"),ue=0,Ae=0,we=Math.min(oe.length,ce.length);ue<we;++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 we=de&31;de>>>=5;var Re=de&63;return de>>>=6,ce.setHours(de),ce.setMinutes(Re),ce.setSeconds(we<<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,we={};switch(ce){case 21589:oe=te.read_shift(1),oe&1&&(we.mtime=te.read_shift(4)),ue>5&&(oe&2&&(we.atime=te.read_shift(4)),oe&4&&(we.ctime=te.read_shift(4))),we.mtime&&(we.mt=new Date(we.mtime*1e3));break}te.l=Ae,de[ce]=we}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,we=0,Re=0,Ne=0,Ee=[],Se=te.slice(0,512);vn(Se,0);var ze=p(Se);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&&(Se=te.slice(0,ce),vn(Se,28));var Ke=te.slice(0,ce);x(Se,oe);var Ze=Se.read_shift(4,"i");if(oe===3&&Ze!==0)throw new Error("# Directory Sectors: Expected 0 saw "+Ze);Se.l+=4,we=Se.read_shift(4,"i"),Se.l+=4,Se.chk("00100000","Mini Stream Cutoff Size: "),Re=Se.read_shift(4,"i"),ue=Se.read_shift(4,"i"),Ne=Se.read_shift(4,"i"),Ae=Se.read_shift(4,"i");for(var $e=-1,Je=0;Je<109&&($e=Se.read_shift(4,"i"),!($e<0));++Je)Ee[Je]=$e;var dt=m(te,ce);y(Ne,Ae,dt,ce,Ee);var Cr=_(dt,we,Ee,ce);Cr[we].name="!Directory",ue>0&&Re!==G&&(Cr[Re].name="!MiniFAT"),Cr[Ee[0]].name="!FAT",Cr.fat_addrs=Ee,Cr.ssz=ce;var kr={},Qr=[],Gs=[],Wc=[];C(we,Cr,dt,Qr,ue,kr,Gs,Re),b(Gs,Wc,Qr),Qr.shift();var Lo={FileIndex:Gs,FullPaths:Wc};return de&&de.raw&&(Lo.raw={header:Ke,sectors:dt}),Lo}function p(te){if(te[te.l]==80&&te[te.l+1]==75)return[0,0];te.chk(H,"Header Signature: "),te.l+=16;var de=te.read_shift(2,"u");return[te.read_shift(2,"u"),de]}function x(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,we=0,Re=0,Ne=oe.length,Ee=[],Se=[];ce<Ne;++ce)Ee[ce]=Se[ce]=ce,de[ce]=oe[ce];for(;Re<Se.length;++Re)ce=Se[Re],ue=te[ce].L,Ae=te[ce].R,we=te[ce].C,Ee[ce]===ce&&(ue!==-1&&Ee[ue]!==ue&&(Ee[ce]=Ee[ue]),Ae!==-1&&Ee[Ae]!==Ae&&(Ee[ce]=Ee[Ae])),we!==-1&&(Ee[we]=ce),ue!==-1&&ce!=Ee[ce]&&(Ee[ue]=Ee[ce],Se.lastIndexOf(ue)<Re&&Se.push(ue)),Ae!==-1&&ce!=Ee[ce]&&(Ee[Ae]=Ee[ce],Se.lastIndexOf(Ae)<Re&&Se.push(Ae));for(ce=1;ce<Ne;++ce)Ee[ce]===ce&&(Ae!==-1&&Ee[Ae]!==Ae?Ee[ce]=Ee[Ae]:ue!==-1&&Ee[ue]!==ue&&(Ee[ce]=Ee[ue]));for(ce=1;ce<Ne;++ce)if(te[ce].type!==0){if(Re=ce,Re!=Ee[Re])do Re=Ee[Re],de[ce]=de[Re]+"/"+de[ce];while(Re!==0&&Ee[Re]!==-1&&Re!=Ee[Re]);Ee[ce]=-1}for(de[0]+="/",ce=1;ce<Ne;++ce)te[ce].type!==2&&(de[ce]+="/")}function v(te,de,oe){for(var ce=te.start,ue=te.size,Ae=[],we=ce;oe&&ue>0&&we>=0;)Ae.push(de.slice(we*P,we*P+P)),ue-=P,we=gd(oe,we*4);return Ae.length===0?Oe(0):Za(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 we=oe[te],Re=(ce>>>2)-1;if(!we)return;for(var Ne=0;Ne<Re&&(Ae=gd(we,Ne*4))!==G;++Ne)ue.push(Ae);y(gd(we,ce-4),de-1,oe,ce,ue)}}function k(te,de,oe,ce,ue){var Ae=[],we=[];ue||(ue=[]);var Re=ce-1,Ne=0,Ee=0;for(Ne=de;Ne>=0;){ue[Ne]=!0,Ae[Ae.length]=Ne,we.push(te[Ne]);var Se=oe[Math.floor(Ne*4/ce)];if(Ee=Ne*4&Re,ce<4+Ee)throw new Error("FAT boundary crossed: "+Ne+" 4 "+ce);if(!te[Se])break;Ne=gd(te[Se],Ee)}return{nodes:Ae,data:BD([we])}}function _(te,de,oe,ce){var ue=te.length,Ae=[],we=[],Re=[],Ne=[],Ee=ce-1,Se=0,ze=0,Ke=0,Ze=0;for(Se=0;Se<ue;++Se)if(Re=[],Ke=Se+de,Ke>=ue&&(Ke-=ue),!we[Ke]){Ne=[];var $e=[];for(ze=Ke;ze>=0;){$e[ze]=!0,we[ze]=!0,Re[Re.length]=ze,Ne.push(te[ze]);var Je=oe[Math.floor(ze*4/ce)];if(Ze=ze*4&Ee,ce<4+Ze)throw new Error("FAT boundary crossed: "+ze+" 4 "+ce);if(!te[Je]||(ze=gd(te[Je],Ze),$e[ze]))break}Ae[Ke]={nodes:Re,data:BD([Ne])}}return Ae}function C(te,de,oe,ce,ue,Ae,we,Re){for(var Ne=0,Ee=ce.length?2:0,Se=de[te].data,ze=0,Ke=0,Ze;ze<Se.length;ze+=128){var $e=Se.slice(ze,ze+128);vn($e,64),Ke=$e.read_shift(2),Ze=AE($e,0,Ke-Ee),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 Cr=$e.read_shift(2)+$e.read_shift(2)+$e.read_shift(2)+$e.read_shift(2);Cr!==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?(Ne=Je.start,ue>0&&Ne!==G&&(de[Ne].name="!StreamData")):Je.size>=4096?(Je.storage="fat",de[Je.start]===void 0&&(de[Je.start]=k(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:Ne!==G&&Je.start!==G&&de[Ne]&&(Je.content=v(Je,de[Ne].data,(de[Re]||{}).data))),Je.content&&vn(Je.content,0),Ae[Ze]=Je,we.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($s(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),M(te)}function M(te){var de="Sh33tJ5";if(!ht.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 we=new Date(1987,1,19),Re=0,Ne=Object.create?Object.create(null):{},Ee=[];for(ue=0;ue<te.FullPaths.length;++ue)Ne[te.FullPaths[ue]]=!0,te.FileIndex[ue].type!==0&&Ee.push([te.FullPaths[ue],te.FileIndex[ue]]);for(ue=0;ue<Ee.length;++ue){var Se=a(Ee[ue][0]);ce=Ne[Se],ce||(Ee.push([Se,{name:s(Se).replace("/",""),type:1,clsid:Y,ct:we,mt:we,content:null}]),Ne[Se]=!0)}for(Ee.sort(function(Ze,$e){return r(Ze[0],$e[0])}),te.FullPaths=[],te.FileIndex=[],ue=0;ue<Ee.length;++ue)te.FullPaths[ue]=Ee[ue][0],te.FileIndex[ue]=Ee[ue][1];for(ue=0;ue<Ee.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||Y,ue===0)ze.C=Ee.length>1?1:-1,ze.size=0,ze.type=5;else if(Ke.slice(-1)=="/"){for(Re=ue+1;Re<Ee.length&&a(te.FullPaths[Re])!=Ke;++Re);for(ze.C=Re>=Ee.length?-1:Re,Re=ue+1;Re<Ee.length&&a(te.FullPaths[Re])!=a(Ke);++Re);ze.R=Re>=Ee.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 Cr=Ze.FileIndex[dt];if(Cr.content){var kr=Cr.content.length;kr>0&&(kr<4096?$e+=kr+63>>6:Je+=kr+511>>9)}}for(var Qr=Ze.FullPaths.length+3>>2,Gs=$e+7>>3,Wc=$e+127>>7,Lo=Gs+Je+Qr+Wc,tl=Lo+127>>7,s0=tl<=109?0:Math.ceil((tl-109)/127);Lo+tl+s0+127>>7>tl;)s0=++tl<=109?0:Math.ceil((tl-109)/127);var as=[1,s0,tl,Wc,Qr,Je,$e,0];return Ze.FileIndex[0].size=$e<<6,as[7]=(Ze.FileIndex[0].start=as[0]+as[1]+as[2]+as[3]+as[4]+as[5])+(as[6]+7>>3),as})(te),ue=Oe(ce[7]<<9),Ae=0,we=0;{for(Ae=0;Ae<8;++Ae)ue.write_shift(1,Q[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(we=0;we<ce[1];++we){for(;Ae<236+we*127;++Ae)ue.write_shift(-4,Ae<ce[2]?ce[1]+Ae:-1);ue.write_shift(-4,we===ce[1]-1?G:we+1)}var Re=function(Ze){for(we+=Ze;Ae<we-1;++Ae)ue.write_shift(-4,Ae+1);Ze&&(++Ae,ue.write_shift(-4,G))};for(we=Ae=0,we+=ce[1];Ae<we;++Ae)ue.write_shift(-4,K.DIFSECT);for(we+=ce[2];Ae<we;++Ae)ue.write_shift(-4,K.FATSECT);Re(ce[3]),Re(ce[4]);for(var Ne=0,Ee=0,Se=te.FileIndex[0];Ne<te.FileIndex.length;++Ne)Se=te.FileIndex[Ne],Se.content&&(Ee=Se.content.length,!(Ee<4096)&&(Se.start=we,Re(Ee+511>>9)));for(Re(ce[6]+7>>3);ue.l&511;)ue.write_shift(-4,K.ENDOFCHAIN);for(we=Ae=0,Ne=0;Ne<te.FileIndex.length;++Ne)Se=te.FileIndex[Ne],Se.content&&(Ee=Se.content.length,!(!Ee||Ee>=4096)&&(Se.start=we,Re(Ee+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(Ne=0;Ne<17;++Ne)ue.write_shift(4,0);for(Ne=0;Ne<3;++Ne)ue.write_shift(4,-1);for(Ne=0;Ne<12;++Ne)ue.write_shift(4,0);continue}Se=te.FileIndex[Ae],Ae===0&&(Se.start=Se.size?Se.start-1:G);var Ke=Ae===0&&oe.root||Se.name;if(Ee=2*(Ke.length+1),ue.write_shift(64,Ke,"utf16le"),ue.write_shift(2,Ee),ue.write_shift(1,Se.type),ue.write_shift(1,Se.color),ue.write_shift(-4,Se.L),ue.write_shift(-4,Se.R),ue.write_shift(-4,Se.C),Se.clsid)ue.write_shift(16,Se.clsid,"hex");else for(Ne=0;Ne<4;++Ne)ue.write_shift(4,0);ue.write_shift(4,Se.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,Se.start),ue.write_shift(4,Se.size),ue.write_shift(4,0)}for(Ae=1;Ae<te.FileIndex.length;++Ae)if(Se=te.FileIndex[Ae],Se.size>=4096)if(ue.l=Se.start+1<<9,Mt&&Buffer.isBuffer(Se.content))Se.content.copy(ue,ue.l,0,Se.size),ue.l+=Se.size+511&-512;else{for(Ne=0;Ne<Se.size;++Ne)ue.write_shift(1,Se.content[Ne]);for(;Ne&511;++Ne)ue.write_shift(1,0)}for(Ae=1;Ae<te.FileIndex.length;++Ae)if(Se=te.FileIndex[Ae],Se.size>0&&Se.size<4096)if(Mt&&Buffer.isBuffer(Se.content))Se.content.copy(ue,ue.l,0,Se.size),ue.l+=Se.size+63&-64;else{for(Ne=0;Ne<Se.size;++Ne)ue.write_shift(1,Se.content[Ne]);for(;Ne&63;++Ne)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(Ne){return Ne.toUpperCase()}),ce=oe.map(function(Ne){var Ee=Ne.split("/");return Ee[Ee.length-(Ne.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(),we=ue===!0?oe.indexOf(Ae):ce.indexOf(Ae);if(we!==-1)return te.FileIndex[we];var Re=!Ae.match(yf);for(Ae=Ae.replace(Jn,""),Re&&(Ae=Ae.replace(yf,"!")),we=0;we<oe.length;++we)if((Re?oe[we].replace(yf,"!"):oe[we]).replace(Jn,"")==Ae||(Re?ce[we].replace(yf,"!"):ce[we]).replace(Jn,"")==Ae)return te.FileIndex[we];return null}var P=64,G=-2,H="d0cf11e0a1b11ae1",Q=[208,207,17,224,161,177,26,225],Y="00000000000000000000000000000000",K={MAXREGSECT:-6,DIFSECT:-4,FATSECT:-3,ENDOFCHAIN:G,FREESECT:-1,HEADER_SIGNATURE:H,HEADER_MINOR_VERSION:"3e00",MAXREGSID:-6,NOSTREAM:-1,HEADER_CLSID:Y,EntryTypes:["unknown","storage","stream","lockbytes","property","root"]};function ee(te,de,oe){u();var ce=D(te,oe);d.writeFileSync(de,ce)}function J(te){for(var de=new Array(te.length),oe=0;oe<te.length;++oe)de[oe]=String.fromCharCode(te[oe]);return de.join("")}function W(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:J(oe);case"base64":return hp(typeof oe=="string"?oe:J(oe));case"buffer":if(Mt)return Buffer.isBuffer(oe)?oe:Mo(oe);case"array":return typeof oe=="string"?Rs(oe):oe}return oe}var R;function O(te){try{var de=te.InflateRaw,oe=new de;if(oe._processChunk(new Uint8Array([3,0]),oe._finishFlushFlag),oe.bytesRead)R=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(!R)return $n(te,de);var oe=R.InflateRaw,ce=new oe,ue=ce._processChunk(te.slice(te.l),ce._finishFlushFlag);return te.l+=ce.bytesRead,ue}function z(te){return R?R.deflateRawSync(te):st(te)}var X=[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):[],he=0;he<256;++he)ie[he]=ne(he);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 Ue(te,de){var oe=de&7,ce=de>>>3;return(te[ce]|(oe<=6?0:te[ce+1]<<8))>>>oe&3}function Ie(te,de){var oe=de&7,ce=de>>>3;return(te[ce]|(oe<=5?0:te[ce+1]<<8))>>>oe&7}function be(te,de){var oe=de&7,ce=de>>>3;return(te[ce]|(oe<=4?0:te[ce+1]<<8))>>>oe&15}function je(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 Me(te,de,oe){var ce=de&7,ue=de>>>3,Ae=(1<<oe)-1,we=te[ue]>>>ce;return oe<8-ce||(we|=te[ue+1]<<8-ce,oe<16-ce)||(we|=te[ue+2]<<16-ce,oe<24-ce)||(we|=te[ue+3]<<24-ce),we&Ae}function Xe(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 it(te,de,oe){var ce=de&7,ue=de>>>3;return oe=(oe&1)<<ce,te[ue]|=oe,de+1}function at(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=dD(ce);if(te.copy)te.copy(Ae);else for(;ue<te.length;++ue)Ae[ue]=te[ue];return Ae}else if(ae){var we=new Uint8Array(ce);if(we.set)we.set(te);else for(;ue<oe;++ue)we[ue]=te[ue];return we}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 Br(te,de,oe){var ce=1,ue=0,Ae=0,we=0,Re=0,Ne=te.length,Ee=ae?new Uint16Array(32):ft(32);for(Ae=0;Ae<32;++Ae)Ee[Ae]=0;for(Ae=Ne;Ae<oe;++Ae)te[Ae]=0;Ne=te.length;var Se=ae?new Uint16Array(Ne):ft(Ne);for(Ae=0;Ae<Ne;++Ae)Ee[ue=te[Ae]]++,ce<ue&&(ce=ue),Se[Ae]=0;for(Ee[0]=0,Ae=1;Ae<=ce;++Ae)Ee[Ae+16]=Re=Re+Ee[Ae-1]<<1;for(Ae=0;Ae<Ne;++Ae)Re=te[Ae],Re!=0&&(Se[Ae]=Ee[Re+16]++);var ze=0;for(Ae=0;Ae<Ne;++Ae)if(ze=te[Ae],ze!=0)for(Re=Z(Se[Ae],ce)>>ce-ze,we=(1<<ce+4-ze)-1;we>=0;--we)de[Re|we<<ze]=ze&15|Ae<<4;return ce}var Ar=ae?new Uint16Array(512):ft(512),fa=ae?new Uint16Array(32):ft(32);if(!ae){for(var Ut=0;Ut<512;++Ut)Ar[Ut]=0;for(Ut=0;Ut<32;++Ut)fa[Ut]=0}(function(){for(var te=[],de=0;de<32;de++)te.push(5);Br(te,fa,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);Br(oe,Ar,288)})();var _r=(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,Ne){for(var Ee=0;Ee<Re.length;){var Se=Math.min(65535,Re.length-Ee),ze=Ee+Se==Re.length;for(Ne.write_shift(1,+ze),Ne.write_shift(2,Se),Ne.write_shift(2,~Se&65535);Se-- >0;)Ne[Ne.l++]=Re[Ee++]}return Ne.l}function we(Re,Ne){for(var Ee=0,Se=0,ze=ae?new Uint16Array(32768):[];Se<Re.length;){var Ke=Math.min(65535,Re.length-Se);if(Ke<10){for(Ee=Xe(Ne,Ee,+(Se+Ke==Re.length)),Ee&7&&(Ee+=8-(Ee&7)),Ne.l=Ee/8|0,Ne.write_shift(2,Ke),Ne.write_shift(2,~Ke&65535);Ke-- >0;)Ne[Ne.l++]=Re[Se++];Ee=Ne.l*8;continue}Ee=Xe(Ne,Ee,+(Se+Ke==Re.length)+2);for(var Ze=0;Ke-- >0;){var $e=Re[Se];Ze=(Ze<<5^$e)&32767;var Je=-1,dt=0;if((Je=ze[Ze])&&(Je|=Se&-32768,Je>Se&&(Je-=32768),Je<Se))for(;Re[Je+dt]==Re[Se+dt]&&dt<250;)++dt;if(dt>2){$e=ue[dt],$e<=22?Ee=at(Ne,Ee,ie[$e+1]>>1)-1:(at(Ne,Ee,3),Ee+=5,at(Ne,Ee,ie[$e-23]>>5),Ee+=3);var Cr=$e<8?0:$e-4>>2;Cr>0&&(Ct(Ne,Ee,dt-re[$e]),Ee+=Cr),$e=de[Se-Je],Ee=at(Ne,Ee,ie[$e]>>3),Ee-=3;var kr=$e<4?0:$e-2>>1;kr>0&&(Ct(Ne,Ee,Se-Je-le[$e]),Ee+=kr);for(var Qr=0;Qr<dt;++Qr)ze[Ze]=Se&32767,Ze=(Ze<<5^Re[Se])&32767,++Se;Ke-=dt-1}else $e<=143?$e=$e+48:Ee=it(Ne,Ee,1),Ee=at(Ne,Ee,ie[$e]),ze[Ze]=Se&32767,++Se}Ee=at(Ne,Ee,0)-1}return Ne.l=(Ee+7)/8|0,Ne.l}return function(Ne,Ee){return Ne.length<8?Ae(Ne,Ee):we(Ne,Ee)}})();function st(te){var de=Oe(50+Math.floor(te.length*1.1)),oe=_r(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 Nr(te,de){var oe=je(te,de)+257;de+=5;var ce=je(te,de)+1;de+=5;var ue=be(te,de)+4;de+=4;for(var Ae=0,we=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],Ne=1,Ee=ae?new Uint8Array(8):ft(8),Se=ae?new Uint8Array(8):ft(8),ze=we.length,Ke=0;Ke<ue;++Ke)we[X[Ke]]=Ae=Ie(te,de),Ne<Ae&&(Ne=Ae),Ee[Ae]++,de+=3;var Ze=0;for(Ee[0]=0,Ke=1;Ke<=Ne;++Ke)Se[Ke]=Ze=Ze+Ee[Ke-1]<<1;for(Ke=0;Ke<ze;++Ke)(Ze=we[Ke])!=0&&(Re[Ke]=Se[Ze]++);var $e=0;for(Ke=0;Ke<ze;++Ke)if($e=we[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(Ne=1;dt.length<oe+ce;)switch(Ze=jt[fe(te,de)],de+=Ze&7,Ze>>>=3){case 16:for(Ae=3+Ue(te,de),de+=2,Ze=dt[dt.length-1];Ae-- >0;)dt.push(Ze);break;case 17:for(Ae=3+Ie(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),Ne<Ze&&(Ne=Ze);break}var Cr=dt.slice(0,oe),kr=dt.slice(oe);for(Ke=oe;Ke<286;++Ke)Cr[Ke]=0;for(Ke=ce;Ke<30;++Ke)kr[Ke]=0;return Kt=Br(Cr,Rt,286),fr=Br(kr,Et,30),de}function cn(te,de){if(te[0]==3&&!(te[1]&3))return[Fc(de),2];for(var oe=0,ce=0,ue=dD(de||1<<18),Ae=0,we=ue.length>>>0,Re=0,Ne=0;(ce&1)==0;){if(ce=Ie(te,oe),oe+=3,ce>>>1)ce>>1==1?(Re=9,Ne=5):(oe=Nr(te,oe),Re=Kt,Ne=fr);else{oe&7&&(oe+=8-(oe&7));var Ee=te[oe>>>3]|te[(oe>>>3)+1]<<8;if(oe+=32,Ee>0)for(!de&&we<Ae+Ee&&(ue=kt(ue,Ae+Ee),we=ue.length);Ee-- >0;)ue[Ae++]=te[oe>>>3],oe+=8;continue}for(;;){!de&&we<Ae+32767&&(ue=kt(ue,Ae+32767),we=ue.length);var Se=Me(te,oe,Re),ze=ce>>>1==1?Ar[Se]:Rt[Se];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+=Me(te,oe,Ke),oe+=Ke),Se=Me(te,oe,Ne),ze=ce>>>1==1?fa[Se]:Et[Se],oe+=ze&15,ze>>>=4;var $e=ze<4?0:ze-2>>1,Je=le[ze];for($e>0&&(Je+=Me(te,oe,$e),oe+=$e),!de&&we<Ze&&(ue=kt(ue,Ze+100),we=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 we=oe.length-4;(oe[we]!=80||oe[we+1]!=75||oe[we+2]!=5||oe[we+3]!=6)&&we>=0;)--we;oe.l=we+4,oe.l+=4;var Re=oe.read_shift(2);oe.l+=6;var Ne=oe.read_shift(4);for(oe.l=Ne,we=0;we<Re;++we){oe.l+=20;var Ee=oe.read_shift(4),Se=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,Ee,Se,Ae,Je),oe.l=dt}return Ae}function Bi(te,de,oe,ce,ue){te.l+=2;var Ae=te.read_shift(2),we=te.read_shift(2),Re=l(te);if(Ae&8257)throw new Error("Unsupported ZIP encryption");for(var Ne=te.read_shift(4),Ee=te.read_shift(4),Se=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+Ee);switch(we){case 8:dt=q(te,Se);break;case 0:break;default:throw new Error("Unsupported ZIP Compression method "+we)}var Cr=!1;Ae&8&&(Ne=te.read_shift(4),Ne==134695760&&(Ne=te.read_shift(4),Cr=!0),Ee=te.read_shift(4),Se=te.read_shift(4)),Ee!=de&&Cs(Cr,"Bad compressed size: "+de+" != "+Ee),Se!=oe&&Cs(Cr,"Bad uncompressed size: "+oe+" != "+Se),Ma(ce,Ze,dt,{unsafe:!0,mt:Re})}function ta(te,de){var oe=de||{},ce=[],ue=[],Ae=Oe(1),we=oe.compression?8:0,Re=0,Ne=0,Ee=0,Se=0,ze=0,Ke=te.FullPaths[0],Ze=Ke,$e=te.FileIndex[0],Je=[],dt=0;for(Ne=1;Ne<te.FullPaths.length;++Ne)if(Ze=te.FullPaths[Ne].slice(Ke.length),$e=te.FileIndex[Ne],!(!$e.size||!$e.content||Ze=="Sh33tJ5")){var Cr=Se,kr=Oe(Ze.length);for(Ee=0;Ee<Ze.length;++Ee)kr.write_shift(1,Ze.charCodeAt(Ee)&127);kr=kr.slice(0,kr.l),Je[ze]=ige.buf($e.content,0);var Qr=$e.content;we==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,we),$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,kr.length),Ae.write_shift(2,0),Se+=Ae.length,ce.push(Ae),Se+=kr.length,ce.push(kr),Se+=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,we),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,kr.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,Cr),dt+=Ae.l,ue.push(Ae),dt+=kr.length,ue.push(kr),++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,Se),Ae.write_shift(2,0),Za([Za(ce),Za(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 qc(te){var de=te.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g,function(Ee){var Se=Ee.charCodeAt(0).toString(16).toUpperCase();return"="+(Se.length==1?"0"+Se:Se)});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 we=0;we<Ae.length;){var Re=76,Ne=Ae.slice(we,we+Re);Ne.charAt(Re-1)=="="?Re--:Ne.charAt(Re-2)=="="?Re-=2:Ne.charAt(Re-3)=="="&&(Re-=3),Ne=Ae.slice(we,we+Re),we+=Re,we<Ae.length&&(Ne+="="),oe.push(Ne)}}return oe.join(`\r
`)}function Po(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 Dl(te,de,oe){for(var ce="",ue="",Ae="",we,Re=0;Re<10;++Re){var Ne=de[Re];if(!Ne||Ne.match(/^\s*$/))break;var Ee=Ne.match(/^(.*?):\s*([^\s].*)$/);if(Ee)switch(Ee[1].toLowerCase()){case"content-location":ce=Ee[2].trim();break;case"content-type":Ae=Ee[2].trim();break;case"content-transfer-encoding":ue=Ee[2].trim();break}}switch(++Re,ue.toLowerCase()){case"base64":we=Rs($s(de.slice(Re).join("")));break;case"quoted-printable":we=Po(de.slice(Re));break;default:throw new Error("Unsupported Content-Transfer-Encoding "+ue)}var Se=Ma(te,ce.slice(oe.length),we,{unsafe:!0});Ae&&(Se.ctype=Ae)}function Ve(te,de){if(J(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"):J(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 we=(ce[1]||"").match(/boundary="(.*?)"/);if(!we)throw new Error("MAD cannot find boundary");var Re="--"+(we[1]||""),Ne=[],Ee=[],Se={FileIndex:Ne,FullPaths:Ee};F(Se);var ze,Ke=0;for(ue=0;ue<ce.length;++ue){var Ze=ce[ue];Ze!==Re&&Ze!==Re+"--"||(Ke++&&Dl(Se,ce.slice(ze,ue),oe),ze=ue)}return Se}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],we=Ae,Re=te.FileIndex[0],Ne=1;Ne<te.FullPaths.length;++Ne)if(we=te.FullPaths[Ne].slice(Ae.length),Re=te.FileIndex[Ne],!(!Re.size||!Re.content||we=="Sh33tJ5")){we=we.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 Ee=Re.content,Se=Mt&&Buffer.isBuffer(Ee)?Ee.toString("binary"):J(Ee),ze=0,Ke=Math.min(1024,Se.length),Ze=0,$e=0;$e<=Ke;++$e)(Ze=Se.charCodeAt($e))>=32&&Ze<128&&++ze;var Je=ze>=Ke*4/5;ue.push(ce),ue.push("Content-Location: "+(oe.root||"file:///C:/SheetJS/")+we),ue.push("Content-Transfer-Encoding: "+(Je?"quoted-printable":"base64")),ue.push("Content-Type: "+el(Re,we)),ue.push(""),ue.push(Je?qc(Se):_i(Se))}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&&ht.find(te,de);if(!Ae){var we=te.FullPaths[0];de.slice(0,we.length)==we?we=de:(we.slice(-1)!="/"&&(we+="/"),we=(we+de).replace("//","/")),Ae={name:s(de),type:2},te.FileIndex.push(Ae),te.FullPaths.push(we),ue||ht.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 me(te,de){F(te);var oe=ht.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 We(te,de,oe){F(te);var ce=ht.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=W,t.writeFile=ee,t.utils={cfb_new:ra,cfb_add:Ma,cfb_del:me,cfb_mov:We,cfb_gc:tt,ReadShift:If,CheckField:JQ,prep_blob:vn,bconcat:Za,use_zlib:O,_deflateRaw:st,_inflateRaw:$n,consts:K},t})();function lge(e){return typeof e=="string"?lv(e):Array.isArray(e)?Fme(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=lv(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([lge(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=Vc(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 oge(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 Aa(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 gD(e,t){for(var r=[],a=Aa(e),s=0;s!==a.length;++s)r[e[a[s]][t]]==null&&(r[e[a[s]][t]]=a[s]);return r}function cv(e){for(var t=[],r=Aa(e),a=0;a!==r.length;++a)t[e[r[a]]]=r[a];return t}function dv(e){for(var t=[],r=Aa(e),a=0;a!==r.length;++a)t[e[r[a]]]=parseInt(r[a],10);return t}function cge(e){for(var t=[],r=Aa(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 $g=new Date(1899,11,30,0,0,0);function za(e,t){var r=e.getTime(),a=$g.getTime()+(e.getTimezoneOffset()-$g.getTimezoneOffset())*6e4;return(r-a)/(1440*60*1e3)}var TQ=new Date,dge=$g.getTime()+(TQ.getTimezoneOffset()-$g.getTimezoneOffset())*6e4,bD=TQ.getTimezoneOffset();function uv(e){var t=new Date;return t.setTime(e*24*60*60*1e3+dge),t.getTimezoneOffset()!==bD&&t.setTime(t.getTime()+(t.getTimezoneOffset()-bD)*6e4),t}function uge(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 vD=new Date("2017-02-19T19:06:09.000Z"),IQ=isNaN(vD.getFullYear())?new Date("2/19/17"):vD,Age=IQ.getFullYear()==2017;function Rr(e,t){var r=new Date(e);if(Age)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(IQ.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 Gd(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(bQ(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 Or(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]=Or(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 fge=["january","february","march","april","may","june","july","august","september","october","november","december"];function FA(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&&fge.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 pge=(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 FQ(e){return e?e.content&&e.type?Gd(e.content,!0):e.data?vf(e.data):e.asNodeBuffer&&Mt?vf(e.asNodeBuffer().toString("binary")):e.asBinary?vf(e.asBinary()):e._data&&e._data.getContent?vf(Gd(Array.prototype.slice.call(e._data.getContent(),0))):null:null}function DQ(e){if(!e)return null;if(e.data)return oD(e.data);if(e.asNodeBuffer&&Mt)return e.asNodeBuffer();if(e._data&&e._data.getContent){var t=e._data.getContent();return typeof t=="string"?oD(t):Array.prototype.slice.call(t)}return e.content&&e.type?e.content:null}function hge(e){return e&&e.name.slice(-4)===".bin"?DQ(e):FQ(e)}function ci(e,t){for(var r=e.FullPaths||Aa(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 iE(e,t){var r=ci(e,t);if(r==null)throw new Error("Cannot find file "+t+" in zip");return r}function Ba(e,t,r){if(!r)return hge(iE(e,t));if(!t)return null;try{return Ba(e,t)}catch{return null}}function Os(e,t,r){if(!r)return FQ(iE(e,t));if(!t)return null;try{return Os(e,t)}catch{return null}}function xge(e,t,r){return DQ(iE(e,t))}function yD(e){for(var t=e.FullPaths||Aa(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=Mo(r):a=Dme(r),ht.utils.cfb_add(e,t,a)}ht.utils.cfb_add(e,t,r)}else e.file(t,r)}function lE(){return ht.utils.cfb_new()}function UQ(e,t){switch(t.type){case"base64":return ht.read(e,{type:"base64"});case"binary":return ht.read(e,{type:"binary"});case"buffer":case"array":return ht.read(e,{type:"buffer"})}throw new Error("Unrecognized type "+t.type)}function wf(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
`,mge=/([^"\s?>\/]+)\s*=\s*((?:")([^"]*)(?:")|(?:')([^']*)(?:')|([^'">\s]+))/g,wD=/<[\/\?]?[a-zA-Z0-9:_-]+(?:\s+[^"\s?>\/]+\s*=\s*(?:"[^"]*"|'[^']*'|[^'">\s=]+))*\s*[\/\?]?>/mg,gge=/<[^>]*>/g,zn=wa.match(wD)?wD:gge,bge=/<\w*:/,vge=/<(\/?)\w+:/;function wt(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(mge),o=0,d="",u=0,f="",p="",x=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(x=(s=p.charCodeAt(i+1))==34||s==39?1:0,d=p.slice(i+1+x,p.length-x),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 _l(e){return e.replace(vge,"<$1")}var MQ={"&quot;":'"',"&apos;":"'","&gt;":">","&lt;":"<","&amp;":"&"},oE=cv(MQ),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 MQ[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))}})(),cE=/[&<>'"]/g,yge=/[\u0000-\u0008\u000b-\u001f]/g;function ur(e){var t=e+"";return t.replace(cE,function(r){return oE[r]}).replace(yge,function(r){return"_x"+("000"+r.charCodeAt(0).toString(16)).slice(-4)+"_"})}function ND(e){return ur(e).replace(/ /g,"_x0020_")}var RQ=/[\u0000-\u001f]/g;function dE(e){var t=e+"";return t.replace(cE,function(r){return oE[r]}).replace(/\n/g,"<br/>").replace(RQ,function(r){return"&#x"+("000"+r.charCodeAt(0).toString(16)).slice(-4)+";"})}function wge(e){var t=e+"";return t.replace(cE,function(r){return oE[r]}).replace(RQ,function(r){return"&#x"+r.charCodeAt(0).toString(16).toUpperCase()+";"})}var CD=(function(){var e=/&#(\d+);/g;function t(r,a){return String.fromCharCode(parseInt(a,10))}return function(a){return a.replace(e,t)}})();function Nge(e){return e.replace(/(\r\n|[\r\n])/g,"&#10;")}function Ur(e){switch(e){case 1:case!0:case"1":case"true":case"TRUE":return!0;default:return!1}}function j2(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 kD(e){var t=Fc(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 jD(e){return Mo(e,"binary").toString("utf8")}var Hx="foo bar bazâð£",gr=Mt&&(jD(Hx)==j2(Hx)&&jD||kD(Hx)==j2(Hx)&&kD)||j2,ml=Mt?function(e){return Mo(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("")},mp=(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||"")}})(),OQ=(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}})(),Cge=(function(){var e={};return function(r){return e[r]!==void 0?e[r]:e[r]=new RegExp("<(?:vt:)?"+r+">([\\s\\S]*?)</(?:vt:)?"+r+">","g")}})(),kge=/<\/?(?:vt:)?variant>/g,jge=/<(?:vt:)([^>]*)>([\s\S]*)</;function ED(e,t){var r=wt(e),a=e.match(Cge(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(kge,"").match(jge);l&&s.push({v:gr(l[2]),t:l[1]})}),s}var PQ=/(^\s|\s$|\n)/;function yn(e,t){return"<"+e+(t.match(PQ)?' xml:space="preserve"':"")+">"+t+"</"+e+">"}function gp(e){return Aa(e).map(function(t){return" "+t+'="'+e[t]+'"'}).join("")}function qe(e,t,r){return"<"+e+(r!=null?gp(r):"")+(t!=null?(t.match(PQ)?' xml:space="preserve"':"")+">"+t+"</"+e:"/")+">"}function yC(e,t){try{return e.toISOString().replace(/\.\d*/,"")}catch(r){if(t)throw r}return""}function Ege(e,t){switch(typeof e){case"string":var r=qe("vt:lpwstr",ur(e));return r=r.replace(/&quot;/g,"_x0022_"),r;case"number":return qe((e|0)==e?"vt:i4":"vt:r8",ur(String(e)));case"boolean":return qe("vt:bool",e?"true":"false")}if(e instanceof Date)return qe("vt:filetime",yC(e));throw new Error("Unable to serialize "+e)}function uE(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(Vc(aE(e)));throw new Error("Bad input format: expected Buffer or string")}var bp=/<(\/?)([^\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"},nu=["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 Sge(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 Bge(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 SD=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},BD=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:Mo(t)})):SD(e)}:SD,_D=function(e,t,r){for(var a=[],s=t;s<r;s+=2)a.push(String.fromCharCode(io(e,s)));return a.join("").replace(Jn,"")},AE=Mt?function(e,t,r){return Buffer.isBuffer(e)?e.toString("utf16le",t,r).replace(Jn,""):_D(e,t,r)}:_D,TD=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("")},LQ=Mt?function(e,t,r){return Buffer.isBuffer(e)?e.toString("hex",t,t+r):TD(e,t,r)}:TD,ID=function(e,t,r){for(var a=[],s=t;s<r;s++)a.push(String.fromCharCode(iA(e,s)));return a.join("")},eh=Mt?function(t,r,a){return Buffer.isBuffer(t)?t.toString("utf8",r,a):ID(t,r,a)}:ID,QQ=function(e,t){var r=Us(e,t);return r>0?eh(e,t+4,t+4+r-1):""},HQ=QQ,zQ=function(e,t){var r=Us(e,t);return r>0?eh(e,t+4,t+4+r-1):""},$Q=zQ,VQ=function(e,t){var r=2*Us(e,t);return r>0?eh(e,t+4,t+4+r-1):""},GQ=VQ,KQ=function(t,r){var a=Us(t,r);return a>0?AE(t,r+4,r+4+a):""},qQ=KQ,WQ=function(e,t){var r=Us(e,t);return r>0?eh(e,t+4,t+4+r):""},YQ=WQ,XQ=function(e,t){return Sge(e,t)},Vg=XQ,fE=function(t){return Array.isArray(t)||typeof Uint8Array<"u"&&t instanceof Uint8Array};Mt&&(HQ=function(t,r){if(!Buffer.isBuffer(t))return QQ(t,r);var a=t.readUInt32LE(r);return a>0?t.toString("utf8",r+4,r+4+a-1):""},$Q=function(t,r){if(!Buffer.isBuffer(t))return zQ(t,r);var a=t.readUInt32LE(r);return a>0?t.toString("utf8",r+4,r+4+a-1):""},GQ=function(t,r){if(!Buffer.isBuffer(t))return VQ(t,r);var a=2*t.readUInt32LE(r);return t.toString("utf16le",r+4,r+4+a-1)},qQ=function(t,r){if(!Buffer.isBuffer(t))return KQ(t,r);var a=t.readUInt32LE(r);return t.toString("utf16le",r+4,r+4+a)},YQ=function(t,r){if(!Buffer.isBuffer(t))return WQ(t,r);var a=t.readUInt32LE(r);return t.toString("utf8",r+4,r+4+a)},Vg=function(t,r){return Buffer.isBuffer(t)?t.readDoubleLE(r):XQ(t,r)},fE=function(t){return Buffer.isBuffer(t)||Array.isArray(t)||typeof Uint8Array<"u"&&t instanceof Uint8Array});var iA=function(e,t){return e[t]},io=function(e,t){return e[t+1]*256+e[t]},_ge=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]},gd=function(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]},Tge=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};function If(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(io(this,u)),u+=2;e*=2;break;case"utf8":r=eh(this,this.l,this.l+e);break;case"utf16le":e*=2,r=AE(this,this.l,this.l+e);break;case"wstr":return If.call(this,e,"dbcs");case"lpstr-ansi":r=HQ(this,this.l),e=4+Us(this,this.l);break;case"lpstr-cp":r=$Q(this,this.l),e=4+Us(this,this.l);break;case"lpwstr":r=GQ(this,this.l),e=4+2*Us(this,this.l);break;case"lpp4":e=4+Us(this,this.l),r=qQ(this,this.l),e&2&&(e+=2);break;case"8lpp4":e=4+Us(this,this.l),r=YQ(this,this.l),e&3&&(e+=4-(e&3));break;case"cstr":for(e=0,r="";(l=iA(this,this.l+e++))!==0;)i.push(Qx(l));r=i.join("");break;case"_wstr":for(e=0,r="";(l=io(this,this.l+e))!==0;)i.push(Qx(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=iA(this,u),this.l=u+1,o=If.call(this,e-d,l?"dbcs-cont":"sbcs-cont"),i.join("")+o;i.push(Qx(io(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=iA(this,u),this.l=u+1,o=If.call(this,e-d,l?"dbcs-cont":"sbcs-cont"),i.join("")+o;i.push(Qx(iA(this,u))),u+=1}r=i.join("");break;default:switch(e){case 1:return a=iA(this,this.l),this.l++,a;case 2:return a=(t==="i"?_ge:io)(this,this.l),this.l+=2,a;case 4:case-4:return t==="i"||(this[this.l+3]&128)===0?(a=(e>0?gd:Tge)(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=Vg(this,this.l):s=Vg([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=LQ(this,this.l,e);break}}return this.l+=e,r}var Ige=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},Fge=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},Dge=function(e,t,r){e[r]=t&255,e[r+1]=t>>>8&255};function Uge(e,t,r){var a=0,s=0;if(r==="dbcs"){for(s=0;s!=t.length;++s)Dge(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,Ige(this,t,this.l);break;case 8:if(a=8,r==="f"){Bge(this,t,this.l);break}case 16:break;case-4:a=4,Fge(this,t,this.l);break}return this.l+=a,this}function JQ(e,t){var r=LQ(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=If,e.chk=JQ,e.write_shift=Uge}function Hn(e,t){e.l+=t}function Oe(e){var t=Fc(e);return vn(t,0),t}function Ro(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=kp[o]||kp[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 xs(){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(),Za(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=kp[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&&fE(r)&&e.push(r)}}function Ff(e,t,r){var a=Or(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 FD(e,t,r){var a=Or(e);return a.s=Ff(a.s,t.s,r),a.e=Ff(a.e,t.s,r),a}function Df(e,t){if(e.cRel&&e.c<0)for(e=Or(e);e.c<0;)e.c+=t>8?16384:256;if(e.rRel&&e.r<0)for(e=Or(e);e.r<0;)e.r+=t>8?1048576:t>5?65536:16384;var r=yt(e);return!e.cRel&&e.cRel!=null&&(r=Oge(r)),!e.rRel&&e.rRel!=null&&(r=Mge(r)),r}function E2(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?"":"$")+va(e.s.r)+":"+(e.e.rRel?"":"$")+va(e.e.r):Df(e.s,t.biff)+":"+Df(e.e,t.biff)}function pE(e){return parseInt(Rge(e),10)-1}function va(e){return""+(e+1)}function Mge(e){return e.replace(/([A-Z]|^)(\d+)$/,"$1$$$2")}function Rge(e){return e.replace(/\$(\d+)$/,"$1")}function hE(e){for(var t=Pge(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 Oge(e){return e.replace(/^([A-Z])/,"$$$1")}function Pge(e){return e.replace(/^\$([A-Z])/,"$1")}function Lge(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 vs(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 DD(e,t){var r=e.t=="d"&&t instanceof Date;if(e.z!=null)try{return e.w=ki(e.z,r?za(t):t)}catch{}try{return e.w=ki((e.XF||{}).numFmtId||(r?14:0),r?za(t):t)}catch{return""+t}}function No(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"?Oo[e.v]||e.v:t==null?DD(e,e.v):DD(e,t))}function Gc(e,t){var r=t&&t.sheet?t.sheet:"Sheet1",a={};return a[r]=e,{SheetNames:[r],Sheets:a}}function ZQ(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 x=0;x!=t[p].length;++x)if(!(typeof t[p][x]>"u")){var m={v:t[p][x]},b=l+p,v=o+x;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][x]&&typeof t[p][x]=="object"&&!Array.isArray(t[p][x])&&!(t[p][x]instanceof Date))m=t[p][x];else if(Array.isArray(m.v)&&(m.f=t[p][x][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=ki(m.z,za(m.v))):(m.t="n",m.v=za(m.v),m.w=ki(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 r0(e,t){return ZQ(null,e,t)}function Qge(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 tn(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 Hge(e){return{ich:e.read_shift(2),ifnt:e.read_shift(2)}}function zge(e,t){return t||(t=Oe(4)),t.write_shift(2,0),t.write_shift(2,0),t}function xE(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(Hge(e));l.r=i}else l.r=[{ich:0,ifnt:0}];return e.l=r+t,l}function $ge(e,t){var r=!1;return t==null&&(r=!0,t=Oe(15+4*e.t.length)),t.write_shift(1,0),tn(e.t,t),r?t.slice(0,t.l):t}var Vge=xE;function Gge(e,t){var r=!1;return t==null&&(r=!0,t=Oe(23+4*e.t.length)),t.write_shift(1,1),tn(e.t,t),t.write_shift(4,1),zge({},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 su(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 iu(e){var t=e.read_shift(2);return t+=e.read_shift(1)<<16,e.l++,{c:-1,iStyleRef:t}}function lu(e,t){return t==null&&(t=Oe(4)),t.write_shift(3,e.iStyleRef||e.s),t.write_shift(1,0),t}var Kge=Pn,e9=tn;function mE(e){var t=e.read_shift(4);return t===0||t===4294967295?"":e.read_shift(t,"dbcs")}function Gg(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 qge=Pn,wC=mE,gE=Gg;function bE(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?Vg([0,0,0,0,t[0]&252,t[1],t[2],t[3]],0):gd(t,0)>>2;return r?s/100:s}function t9(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 r9(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 Wge(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 ou=r9,a0=Wge;function On(e){if(e.length-e.l<8)throw"XLS Xnum Buffer underflow";return e.read_shift(8,"f")}function Kd(e,t){return(t||Oe(8)).write_shift(8,e,"f")}function Yge(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=_d[s];u&&(t.rgb=yp(u));break;case 2:t.rgb=yp([l,o,d]);break;case 3:t.theme=s;break}return i!=0&&(t.tint=i>0?i/32767:i/32768),t}function Kg(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 Xge(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 Jge(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 a9(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 Zge(e){return a9(e,1)}function ebe(e){return a9(e,2)}var vE=2,As=3,zx=11,UD=12,qg=19,$x=64,tbe=65,rbe=71,abe=4108,nbe=4126,Ja=80,n9=81,sbe=[Ja,n9],NC={1:{n:"CodePage",t:vE},2:{n:"Category",t:Ja},3:{n:"PresentationFormat",t:Ja},4:{n:"ByteCount",t:As},5:{n:"LineCount",t:As},6:{n:"ParagraphCount",t:As},7:{n:"SlideCount",t:As},8:{n:"NoteCount",t:As},9:{n:"HiddenCount",t:As},10:{n:"MultimediaClipCount",t:As},11:{n:"ScaleCrop",t:zx},12:{n:"HeadingPairs",t:abe},13:{n:"TitlesOfParts",t:nbe},14:{n:"Manager",t:Ja},15:{n:"Company",t:Ja},16:{n:"LinksUpToDate",t:zx},17:{n:"CharacterCount",t:As},19:{n:"SharedDoc",t:zx},22:{n:"HyperlinksChanged",t:zx},23:{n:"AppVersion",t:As,p:"version"},24:{n:"DigSig",t:tbe},26:{n:"ContentType",t:Ja},27:{n:"ContentStatus",t:Ja},28:{n:"Language",t:Ja},29:{n:"Version",t:Ja},255:{},2147483648:{n:"Locale",t:qg},2147483651:{n:"Behavior",t:qg},1919054434:{}},CC={1:{n:"CodePage",t:vE},2:{n:"Title",t:Ja},3:{n:"Subject",t:Ja},4:{n:"Author",t:Ja},5:{n:"Keywords",t:Ja},6:{n:"Comments",t:Ja},7:{n:"Template",t:Ja},8:{n:"LastAuthor",t:Ja},9:{n:"RevNumber",t:Ja},10:{n:"EditTime",t:$x},11:{n:"LastPrinted",t:$x},12:{n:"CreatedDate",t:$x},13:{n:"ModifiedDate",t:$x},14:{n:"PageCount",t:As},15:{n:"WordCount",t:As},16:{n:"CharCount",t:As},17:{n:"Thumbnail",t:rbe},18:{n:"Application",t:Ja},19:{n:"DocSecurity",t:As},255:{},2147483648:{n:"Locale",t:qg},2147483651:{n:"Behavior",t:qg},1919054434:{}},MD={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"},ibe=[null,"solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"];function lbe(e){return e.map(function(t){return[t>>16&255,t>>8&255,t&255]})}var obe=lbe([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]),_d=Or(obe),Oo={0:"#NULL!",7:"#DIV/0!",15:"#VALUE!",23:"#REF!",29:"#NAME?",36:"#NUM!",42:"#N/A",43:"#GETTING_DATA",255:"#WTF?"},s9={"#NULL!":0,"#DIV/0!":7,"#VALUE!":15,"#REF!":23,"#NAME?":29,"#NUM!":36,"#N/A":42,"#GETTING_DATA":43,"#WTF?":255},kC={"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"},Vx={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 yE(){return{workbooks:[],sheets:[],charts:[],dialogs:[],macros:[],rels:[],strs:[],comments:[],threadedcomments:[],links:[],coreprops:[],extprops:[],custprops:[],themes:[],styles:[],calcchains:[],vba:[],drawings:[],metadata:[],people:[],TODO:[],xmlns:""}}function cbe(e){var t=yE();if(!e||!e.match)return t;var r={};if((e.match(zn)||[]).forEach(function(a){var s=wt(a);switch(s[0].replace(bge,"<")){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[kC[s.ContentType]]!==void 0&&t[kC[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 i9(e,t){var r=cge(kC),a=[],s;a[a.length]=wa,a[a.length]=qe("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 qe("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]=qe("Override",null,{PartName:(s[0]=="/"?"":"/")+s,ContentType:Vx[d][t.bookType]||Vx[d].xlsx}))},l=function(d){(e[d]||[]).forEach(function(u){a[a.length]=qe("Override",null,{PartName:(u[0]=="/"?"":"/")+u,ContentType:Vx[d][t.bookType]||Vx[d].xlsx})})},o=function(d){(e[d]||[]).forEach(function(u){a[a.length]=qe("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 vp(e){var t=e.lastIndexOf("/");return e.slice(0,t+1)+"_rels/"+e.slice(t+1)+".rels"}function Uf(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=wt(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:wf(i.Target,t);r[o]=l,a[i.Id]=l}}),r["!id"]=a,r}function yA(e){var t=[wa,qe("Relationships",null,{xmlns:Qa.RELS})];return Aa(e["!id"]).forEach(function(r){t[t.length]=qe("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 dbe="application/vnd.oasis.opendocument.spreadsheet";function ube(e,t){for(var r=uE(e),a,s;a=bp.exec(r);)switch(a[3]){case"manifest":break;case"file-entry":if(s=wt(a[0],!1),s.path=="/"&&s.type!==dbe)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 Abe(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 RD(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 fbe(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 pbe(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(RD(e[r][0],e[r][1])),t.push(fbe("",e[r][0]));return t.push(RD("","Document","pkg")),t.push("</rdf:RDF>"),t.join("")}function l9(){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 '+Lg.version+"</meta:generator></office:meta></office:document-meta>"}var bi=[["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"]],hbe=(function(){for(var e=new Array(bi.length),t=0;t<bi.length;++t){var r=bi[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 o9(e){var t={};e=gr(e);for(var r=0;r<bi.length;++r){var a=bi[r],s=e.match(hbe[r]);s!=null&&s.length>0&&(t[a[1]]=Wt(s[1])),a[2]==="date"&&t[a[1]]&&(t[a[1]]=Rr(t[a[1]]))}return t}function S2(e,t,r,a,s){s[e]!=null||t==null||t===""||(s[e]=t,t=ur(t),a[a.length]=r?qe(e,t,r):yn(e,t))}function c9(e,t){var r=t||{},a=[wa,qe("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&&S2("dcterms:created",typeof e.CreatedDate=="string"?e.CreatedDate:yC(e.CreatedDate,r.WTF),{"xsi:type":"dcterms:W3CDTF"},a,s),e.ModifiedDate!=null&&S2("dcterms:modified",typeof e.ModifiedDate=="string"?e.ModifiedDate:yC(e.ModifiedDate,r.WTF),{"xsi:type":"dcterms:W3CDTF"},a,s));for(var i=0;i!=bi.length;++i){var l=bi[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&&S2(l[0],o,null,a,s)}return a.length>2&&(a[a.length]="</cp:coreProperties>",a[1]=a[1].replace("/>",">")),a.join("")}var Td=[["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"]],d9=["Worksheets","SheetNames","NamedRanges","DefinedNames","Chartsheets","ChartNames"];function u9(e,t,r,a){var s=[];if(typeof e=="string")s=ED(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"?ED(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 xbe(e,t,r){var a={};return t||(t={}),e=gr(e),Td.forEach(function(s){var i=(e.match(mp(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&&u9(a.HeadingPairs,a.TitlesOfParts,t,r),t}function A9(e){var t=[],r=qe;return e||(e={}),e.Application="SheetJS",t[t.length]=wa,t[t.length]=qe("Properties",null,{xmlns:Qa.EXT_PROPS,"xmlns:vt":Qa.vt}),Td.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 mbe=/<[^>]+>[^<]*/g;function gbe(e,t){var r={},a="",s=e.match(mbe);if(s)for(var i=0;i!=s.length;++i){var l=s[i],o=wt(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]=Ur(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]=Rr(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 f9(e){var t=[wa,qe("Properties",null,{xmlns:Qa.CUST_PROPS,"xmlns:vt":Qa.vt})];if(!e)return t.join("");var r=1;return Aa(e).forEach(function(s){++r,t[t.length]=qe("property",Ege(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 jC={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"},B2;function bbe(e,t,r){B2||(B2=cv(jC)),t=B2[t]||t,e[t]=r}function vbe(e,t){var r=[];return Aa(jC).map(function(a){for(var s=0;s<bi.length;++s)if(bi[s][1]==a)return bi[s];for(s=0;s<Td.length;++s)if(Td[s][1]==a)return Td[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(jC[a[1]]||a[1],s))}}),qe("DocumentProperties",r.join(""),{xmlns:Ds.o})}function ybe(e,t){var r=["Worksheets","SheetNames"],a="CustomDocumentProperties",s=[];return e&&Aa(e).forEach(function(i){if(Object.prototype.hasOwnProperty.call(e,i)){for(var l=0;l<bi.length;++l)if(i==bi[l][1])return;for(l=0;l<Td.length;++l)if(i==Td[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(qe(ND(i),o,{"dt:dt":d}))}}),t&&Aa(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(qe(ND(i),l,{"dt:dt":o}))}}),"<"+a+' xmlns="'+Ds.o+'">'+s.join("")+"</"+a+">"}function wE(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 wbe(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 p9(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 h9(e,t,r){var a=e.read_shift(0,"lpwstr");return a}function x9(e,t,r){return t===31?h9(e):p9(e,t,r)}function EC(e,t,r){return x9(e,t,r===!1?0:4)}function Nbe(e,t){if(!t)throw new Error("VtUnalignedString must have positive length");return x9(e,t,0)}function Cbe(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 kbe(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 jbe(e){var t=e.l,r=Wg(e,n9);e[e.l]==0&&e[e.l+1]==0&&e.l-t&2&&(e.l+=2);var a=Wg(e,As);return[r,a]}function Ebe(e){for(var t=e.read_shift(4),r=[],a=0;a<t/2;++a)r.push(jbe(e));return r}function OD(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(yf,"!"),t===1200&&l%2&&(e.l+=2)}return e.l&3&&(e.l=e.l>>3<<2),a}function m9(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 Sbe(e){var t={};return t.Size=e.read_shift(4),e.l+=t.Size+3-(t.Size-1)%4,t}function Wg(e,t,r){var a=e.read_shift(2),s,i=r||{};if(e.l+=2,t!==UD&&a!==t&&sbe.indexOf(t)===-1&&!((t&65534)==4126&&(a&65534)==4126))throw new Error("Expected type "+t+" saw "+a);switch(t===UD?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 p9(e,a,4).replace(Jn,"");case 31:return h9(e);case 64:return wE(e);case 65:return m9(e);case 71:return Sbe(e);case 80:return EC(e,a,!i.raw).replace(Jn,"");case 81:return Nbe(e,a).replace(Jn,"");case 4108:return Ebe(e);case 4126:case 4127:return a==4127?Cbe(e):kbe(e);default:throw new Error("TypedPropertyValue unrecognized type "+t+" "+a)}}function PD(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=wbe(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 Za([r,a])}function LD(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(_,C){return _[1]-C[1]});var x={};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(x[b.n]=Wg(e,b.t,{raw:!0}),b.p==="version"&&(x[b.n]=String(x[b.n]>>16)+"."+("0000"+String(x[b.n]&65535)).slice(-4)),b.n=="CodePage")switch(x[b.n]){case 0:x[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=x[b.n]>>>0&65535);break;default:throw new Error("Unsupported CodePage: "+x[b.n])}}else if(i[l][0]===1){if(o=x.CodePage=Wg(e,vE),Pi(o),d!==-1){var v=e.l;e.l=i[d][1],u=OD(e,o),e.l=v}}else if(i[l][0]===0){if(o===0){d=l,e.l=i[l+1][1];continue}u=OD(e,o)}else{var y=u[i[l][0]],k;switch(e[e.l]){case 65:e.l+=4,k=m9(e);break;case 30:e.l+=4,k=EC(e,e[e.l-4]).replace(/\u0000+$/,"");break;case 31:e.l+=4,k=EC(e,e[e.l-4]).replace(/\u0000+$/,"");break;case 3:e.l+=4,k=e.read_shift(4,"i");break;case 19:e.l+=4,k=e.read_shift(4);break;case 5:e.l+=4,k=e.read_shift(8,"f");break;case 11:e.l+=4,k=ma(e,4);break;case 64:e.l+=4,k=Rr(wE(e));break;default:throw new Error("unparsed value: "+e[e.l])}x[y]=k}}return e.l=r+a,x}var g9=["CodePage","Thumbnail","_PID_LINKBASE","_PID_HLINKS","SystemIdentifier","FMTID"];function Bbe(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 QD(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=Za(f),i.unshift(d),l+=8+d.length}for(o=0;o<e.length;++o)if(!(t&&!t[e[o][0]])&&!(g9.indexOf(e[o][0])>-1||d9.indexOf(e[o][0])>-1)&&e[o][1]!=null){var x=e[o][1],m=0;if(t){m=+t[e[o][0]];var b=r[m];if(b.p=="version"&&typeof x=="string"){var v=x.split(".");x=(+v[0]<<16)+(+v[1]||0)}d=PD(b.t,x)}else{var y=Bbe(x);y==-1&&(y=31,x=String(x)),d=PD(y,x)}i.push(d),u=Oe(8),u.write_shift(4,t?m:2+o),s.push(u),l+=8+d.length}var k=8*(i.length+1);for(o=0;o<i.length;++o)s[o].write_shift(4,k),k+=i[o].length;return a.write_shift(4,l),a.write_shift(4,i.length),Za([a].concat(s).concat(i))}function HD(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!==ht.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=LD(a,t),x={SystemIdentifier:u};for(var m in p)x[m]=p[m];if(x.FMTID=i,s===1)return x;if(d-a.l==2&&(a.l+=2),a.l!==d)throw new Error("Length mismatch 2: "+a.l+" !== "+d);var b;try{b=LD(a,null)}catch{}for(m in b)x[m]=b[m];return x.FMTID=[i,l],x}function zD(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,ht.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=QD(e,r,a);if(o.push(d),s){var u=QD(s,null,null);l.write_shift(16,i,"hex"),l.write_shift(4,68+d.length),o.push(u)}return Za(o)}function dc(e,t){return e.read_shift(t),null}function _be(e,t){t||(t=Oe(e));for(var r=0;r<e;++r)t.write_shift(1,0);return t}function Tbe(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 ma(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 ui(e,t){return t||(t=Oe(2)),t.write_shift(2,e),t}function b9(e,t){return Tbe(e,t,_a)}function Ibe(e){var t=e.read_shift(1),r=e.read_shift(1);return r===1?t:t===1}function v9(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 th(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 Fbe(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 Dbe(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 Za(s)}function qd(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 rh(e,t,r){var a=e.read_shift(r&&r.biff==2?1:2);return a===0?(e.l++,""):qd(e,a,r)}function cu(e,t,r){if(r.biff>5)return rh(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 y9(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 Ube(e){var t=e.read_shift(1);e.l++;var r=e.read_shift(2);return e.l+=2,[t,r]}function Mbe(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 Rbe(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 Obe(e,t){var r=e.read_shift(16);switch(r){case"e0c9ea79f9bace118c8200aa004ba90b":return Mbe(e);case"0303000000000000c000000000000046":return Rbe(e);default:throw new Error("Unsupported Moniker "+r)}}function Gx(e){var t=e.read_shift(4),r=t>0?e.read_shift(t,"utf16le").replace(Jn,""):"";return r}function $D(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 Pbe(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=Gx(e,r-e.l)),s&128&&(l=Gx(e,r-e.l)),(s&257)===257&&(o=Gx(e,r-e.l)),(s&257)===1&&(d=Obe(e,r-e.l)),s&8&&(u=Gx(e,r-e.l)),s&32&&(f=e.read_shift(16)),s&64&&(p=wE(e)),e.l=r;var x=l||o||d||"";x&&u&&(x+="#"+u),x||(x="#"+u),s&2&&x.charAt(0)=="/"&&x.charAt(1)!="/"&&(x="file://"+x);var m={Target:x};return f&&(m.guid=f),p&&(m.time=p),i&&(m.Tooltip=i),m}function Lbe(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),$D(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&&$D(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 w9(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 N9(e,t){var r=w9(e);return r[3]=0,r}function Tl(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 Wd(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 Qbe(e){var t=e.read_shift(2),r=e.read_shift(2);return e.l+=8,{type:t,flags:r}}function Hbe(e,t,r){return t===0?"":cu(e,t,r)}function zbe(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 C9(e){var t=e.read_shift(2),r=bE(e);return[t,r]}function $be(e,t,r){e.l+=4,t-=4;var a=e.l+t,s=th(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 Av(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 k9(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 j9(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 Vbe=j9;function E9(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 Gbe(e){var t={};return e.l+=4,e.l+=16,t.fSharedNote=e.read_shift(2),e.l+=4,t}function Kbe(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 qbe={0:_n,4:_n,5:_n,6:_n,7:Kbe,8:_n,9:_n,10:_n,11:_n,12:_n,13:Gbe,14:_n,15:_n,16:_n,17:_n,18:_n,19:_n,20:_n,21:E9};function Wbe(e,t){for(var r=e.l+t,a=[];e.l<r;){var s=e.read_shift(2);e.l-=2;try{a.push(qbe[s](e,r-e.l))}catch{return e.l=r,a}}return e.l!=r&&(e.l=r),a}function Kx(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 NE(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 Ybe(e,t){return t===0||e.read_shift(2),1200}function Xbe(e,t,r){if(r.enc)return e.l+=t,"";var a=e.l,s=cu(e,0,r);return e.read_shift(t+a-e.l),s}function Jbe(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 Zbe(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 eve(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=th(e,0,r);return l.length===0&&(l="Sheet1"),{pos:a,hs:s,dt:i,name:l}}function tve(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 rve(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(Fbe(e));return i.Count=a,i.Unique=s,i}function ave(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]=Dbe(e[s]);var i=Za([r].concat(a));return i.parts=[r.length].concat(a.map(function(l){return l.length})),i}function nve(e,t){var r={};return r.dsst=e.read_shift(2),e.l+=t-2,r}function sve(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 ive(e){var t=Qbe(e);if(t.type!=2211)throw new Error("Invalid Future Record "+t.type);var r=e.read_shift(4);return r!==0}function lve(e){return e.read_shift(2),e.read_shift(4)}function VD(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 ove(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 cve(){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 dve(e,t,r){if(r&&r.biff>=2&&r.biff<5)return{};var a=e.read_shift(2);return{RTL:a&64}}function uve(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 Ave(){}function fve(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=th(e,0,r),a}function pve(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 hve(e){var t=Tl(e);return t.isst=e.read_shift(4),t}function xve(e,t,r,a){var s=Oe(10);return Wd(e,t,a,s),s.write_shift(4,r),s}function mve(e,t,r){r.biffguess&&r.biff==2&&(r.biff=5);var a=e.l+t,s=Tl(e);r.biff==2&&e.l++;var i=rh(e,a-e.l,r);return s.val=i,s}function gve(e,t,r,a,s){var i=!s||s.biff==8,l=Oe(8+ +i+(1+i)*r.length);return Wd(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 bve(e,t,r){var a=e.read_shift(2),s=cu(e,0,r);return[a,s]}function vve(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 yve=cu;function GD(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 wve(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 Nve(e){var t=e.read_shift(2),r=e.read_shift(2),a=C9(e);return{r:t,c:r,ixfe:a[0],rknum:a[1]}}function Cve(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(C9(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 kve(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 jve(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=ibe[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 Eve(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=jve(e,t,a.fStyle,r),a}function KD(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 Sve(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 Bve(e){var t=Oe(8);return t.write_shift(4,0),t.write_shift(2,0),t.write_shift(2,0),t}function qD(e,t,r){var a=Tl(e);(r.biff==2||t==9)&&++e.l;var s=Ibe(e);return a.val=s,a.t=s===!0||s===!1?"b":"e",a}function _ve(e,t,r,a,s,i){var l=Oe(8);return Wd(e,t,a,l),v9(r,i,l),l}function Tve(e,t,r){r.biffguess&&r.biff==2&&(r.biff=5);var a=Tl(e),s=On(e);return a.val=s,a}function Ive(e,t,r,a){var s=Oe(14);return Wd(e,t,a,s),Kd(r,s),s}var WD=Hbe;function Fve(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=qd(e,i),o=[];a>e.l;)o.push(rh(e));return[i,s,l,o]}function YD(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=$be(e,t-2,r)),i.body=s||e.read_shift(t-2),typeof s=="string"&&(i.Name=s),i}var Dve=["_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 XD(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=qd(e,l,r);s&32&&(u=Dve[u.charCodeAt(0)]);var f=a-e.l;r&&r.biff==2&&--f;var p=a==e.l||o===0||!(f>0)?[]:W2e(e,f,r,o);return{chKey:i,Name:u,itab:d,rgce:p}}function S9(e,t,r){if(r.biff<8)return Uve(e,t,r);for(var a=[],s=e.l+t,i=e.read_shift(r.biff>8?4:2);i--!==0;)a.push(zbe(e,r.biff>8?12:6,r));if(e.l!=s)throw new Error("Bad ExternSheet: "+e.l+" != "+s);return a}function Uve(e,t,r){e[e.l+1]==3&&e[e.l]++;var a=th(e,t,r);return a.charCodeAt(0)==3?a.slice(1):a}function Mve(e,t,r){if(r.biff<8){e.l+=t;return}var a=e.read_shift(2),s=e.read_shift(2),i=qd(e,a,r),l=qd(e,s,r);return[i,l]}function Rve(e,t,r){var a=j9(e);e.l++;var s=e.read_shift(1);return t-=8,[Y2e(e,t,r),s,a]}function JD(e,t,r){var a=Vbe(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,K2e(e,t,r)]}function Ove(e){var t=e.read_shift(4)!==0,r=e.read_shift(4)!==0,a=e.read_shift(4);return[t,r,a]}function Pve(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=cu(e,0,r);return r.biff<8&&e.read_shift(1),[{r:a,c:s},o,l,i]}}function Lve(e,t,r){return Pve(e,t,r)}function Qve(e,t){for(var r=[],a=e.read_shift(2);a--;)r.push(Av(e));return r}function Hve(e){var t=Oe(2+e.length*8);t.write_shift(2,e.length);for(var r=0;r<e.length;++r)k9(e[r],t);return t}function zve(e,t,r){if(r&&r.biff<8)return Vve(e,t,r);var a=E9(e),s=Wbe(e,t-22,a[1]);return{cmo:a,ft:s}}var $ve={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 Vve(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(($ve[a]||Hn)(e,t,r)),{cmo:[s,a,i],ft:l}}function Gve(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=Ube(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=qd(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 Kve(e,t){var r=Av(e);e.l+=16;var a=Pbe(e,t-24);return[r,a]}function qve(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 Za([t,Lbe(e[1])])}function Wve(e,t){e.read_shift(2);var r=Av(e),a=e.read_shift((t-10)/2,"dbcs-cont");return a=a.replace(Jn,""),[r,a]}function Yve(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 Xve(e){var t=[0,0],r;return r=e.read_shift(2),t[0]=MD[r]||r,r=e.read_shift(2),t[1]=MD[r]||r,t}function Jve(e){return e||(e=Oe(4)),e.write_shift(2,1),e.write_shift(2,1),e}function Zve(e){for(var t=e.read_shift(2),r=[];t-- >0;)r.push(N9(e));return r}function e1e(e){for(var t=e.read_shift(2),r=[];t-- >0;)r.push(N9(e));return r}function t1e(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 B9(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 r1e(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 a1e(e,t){var r={};return t<32||(e.l+=16,r.header=On(e),r.footer=On(e),e.l+=2),r}function n1e(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 s1e(e){for(var t=Oe(2*e),r=0;r<e;++r)t.write_shift(2,r+1);return t}var i1e=Tl,l1e=b9,o1e=rh;function c1e(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 d1e(e,t,r){r.biffguess&&r.biff==5&&(r.biff=2);var a=Tl(e);++e.l;var s=cu(e,t-7,r);return a.t="str",a.val=s,a}function u1e(e){var t=Tl(e);++e.l;var r=On(e);return t.t="n",t.val=r,t}function A1e(e,t,r){var a=Oe(15);return ih(a,e,t),a.write_shift(8,r,"f"),a}function f1e(e){var t=Tl(e);++e.l;var r=e.read_shift(2);return t.t="n",t.val=r,t}function p1e(e,t,r){var a=Oe(9);return ih(a,e,t),a.write_shift(2,r),a}function h1e(e){var t=e.read_shift(1);return t===0?(e.l++,""):e.read_shift(t,"sbcs-cont")}function x1e(e,t){e.l+=6,e.l+=2,e.l+=1,e.l+=3,e.l+=1,e.l+=t-13}function m1e(e,t,r){var a=e.l+t,s=Tl(e),i=e.read_shift(2),l=qd(e,i,r);return e.l=a,s.t="str",s.val=l,s}var g1e=[2,3,48,49,131,139,140,245],SC=(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=cv({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=Fc(1);switch(d.type){case"base64":f=Rs($s(o));break;case"binary":f=Rs(o);break;case"buffer":case"array":f=o;break}vn(f,0);var p=f.read_shift(1),x=!!(p&136),m=!1,b=!1;switch(p){case 2:break;case 3:break;case 48:m=!0,x=!0;break;case 49:m=!0,x=!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 k=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 C=[],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=pp.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&&C.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,M=0;for(u[0]=[],M=0;M!=C.length;++M)u[0][M]=C[M].name;for(;v-- >0;){if(f[f.l]===42){f.l+=k;continue}for(++f.l,u[++F]=[],M=0,M=0;M!=C.length;++M){var U=f.slice(f.l,f.l+C[M].len);f.l+=C[M].len,vn(U,0);var D=pp.utils.decode(_,U);switch(C[M].type){case"C":D.trim().length&&(u[F][M]=D.replace(/\s+$/,""));break;case"D":D.length===8?u[F][M]=new Date(+D.slice(0,4),+D.slice(4,6)-1,+D.slice(6,8)):u[F][M]=D;break;case"F":u[F][M]=parseFloat(D.trim());break;case"+":case"I":u[F][M]=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][M]=!0;break;case"N":case"F":u[F][M]=!1;break;case"":case"?":break;default:throw new Error("DBF Unrecognized L:|"+D+"|")}break;case"M":if(!x)throw new Error("DBF Unexpected MEMO for type "+p.toString(16));u[F][M]="##MEMO##"+(b?parseInt(D.trim(),10):U.read_shift(4));break;case"N":D=D.replace(/\u0000/g,"").trim(),D&&D!="."&&(u[F][M]=+D||0);break;case"@":u[F][M]=new Date(U.read_shift(-8,"f")-621356832e5);break;case"T":u[F][M]=new Date((U.read_shift(4)-2440588)*864e5+U.read_shift(4));break;case"Y":u[F][M]=U.read_shift(4,"i")/1e4+U.read_shift(4,"i")/1e4*Math.pow(2,32);break;case"O":u[F][M]=-U.read_shift(-8,"f");break;case"B":if(m&&C[M].len==8){u[F][M]=U.read_shift(8,"f");break}case"G":case"P":U.l+=C[M].len;break;case"0":if(C[M].name==="_NullFlags")break;default:throw new Error("DBF Unsupported data type "+C[M].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=C,u}function a(o,d){var u=d||{};u.dateNF||(u.dateNF="yyyymmdd");var f=r0(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 Gc(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=xs(),p=Jg(o,{header:1,raw:!0,cellDates:!0}),x=p[0],m=p.slice(1),b=o["!cols"]||[],v=0,y=0,k=0,_=1;for(v=0;v<x.length;++v){if(((b[v]||{}).DBF||{}).name){x[v]=b[v].DBF.name,++k;continue}if(x[v]!=null){if(++k,typeof x[v]=="number"&&(x[v]=x[v].toString(10)),typeof x[v]!="string")throw new Error("DBF Invalid column name "+x[v]+" |"+typeof x[v]+"|");if(x.indexOf(x[v])!==v){for(y=0;y<1024;++y)if(x.indexOf(x[v]+"_"+y)==-1){x[v]+="_"+y;break}}}}var C=Yt(o["!ref"]),E=[],T=[],B=[];for(v=0;v<=C.e.c-C.s.c;++v){var F="",M="",U=0,D=[];for(y=0;y<m.length;++y)m[y][v]!=null&&D.push(m[y][v]);if(D.length==0||x[v]==null){E[v]="?";continue}for(y=0;y<D.length;++y){switch(typeof D[y]){case"number":M="B";break;case"string":M="C";break;case"boolean":M="L";break;case"object":M=D[y]instanceof Date?"D":"C";break;default:M="C"}U=Math.max(U,String(D[y]).length),F=F&&F!=M?"C":M}U>250&&(U=250),M=((b[v]||{}).DBF||{}).type,M=="C"&&b[v].DBF.len>U&&(U=b[v].DBF.len),F=="B"&&M=="N"&&(F="N",B[v]=b[v].DBF.dec,U=b[v].DBF.len),T[v]=F=="C"||M=="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*k),L.write_shift(2,_),v=0;v<4;++v)L.write_shift(4,0);for(L.write_shift(4,0|(+t[gQ]||3)<<8),v=0,y=0;v<x.length;++v)if(x[v]!=null){var P=f.next(32),G=(x[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 H=f.next(264);for(H.write_shift(4,13),v=0;v<65;++v)H.write_shift(4,0);for(v=0;v<m.length;++v){var Q=f.next(_);for(Q.write_shift(1,0),y=0;y<x.length;++y)if(x[y]!=null)switch(E[y]){case"L":Q.write_shift(1,m[v][y]==null?63:m[v][y]?84:70);break;case"B":Q.write_shift(8,m[v][y]||0,"f");break;case"N":var Y="0";for(typeof m[v][y]=="number"&&(Y=m[v][y].toFixed(B[y]||0)),k=0;k<T[y]-Y.length;++k)Q.write_shift(1,32);Q.write_shift(1,Y,"sbcs");break;case"D":m[v][y]?(Q.write_shift(4,("0000"+m[v][y].getFullYear()).slice(-4),"sbcs"),Q.write_shift(2,("00"+(m[v][y].getMonth()+1)).slice(-2),"sbcs"),Q.write_shift(2,("00"+m[v][y].getDate()).slice(-2),"sbcs")):Q.write_shift(8,"00000000","sbcs");break;case"C":var K=String(m[v][y]!=null?m[v][y]:"").slice(0,T[y]);for(Q.write_shift(1,K,"sbcs"),k=0;k<T[y]-K.length;++k)Q.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}})(),_9=(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("+Aa(e).join("|").replace(/\|\|\|/,"|\\||").replace(/([?()+])/g,"\\$1")+"|\\|)","gm"),r=function(x,m){var b=e[m];return typeof b=="number"?cD(b):b},a=function(x,m,b){var v=m.charCodeAt(0)-32<<4|b.charCodeAt(0)-48;return v==59?x:cD(v)};e["|"]=254;function s(x,m){switch(m.type){case"base64":return i($s(x),m);case"binary":return i(x,m);case"buffer":return i(Mt&&Buffer.isBuffer(x)?x.toString("binary"):Vc(x),m);case"array":return i(Gd(x),m)}throw new Error("Unrecognized type "+m.type)}function i(x,m){var b=x.split(/[\n\r]+/),v=-1,y=-1,k=0,_=0,C=[],E=[],T=null,B={},F=[],M=[],U=[],D=0,L;for(+m.codepage>=0&&Pi(+m.codepage);k!==b.length;++k){D=0;var P=b[k].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g,a).replace(t,r),G=P.replace(/;;/g,"\0").split(";").map(function(X){return X.replace(/\u0000/g,";")}),H=G[0],Q;if(P.length>0)switch(H){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 Y=!1,K=!1,ee=!1,J=!1,W=-1,R=-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=C.length;L<=v;++L)C[L]=[];break;case"K":Q=G[_].slice(1),Q.charAt(0)==='"'?Q=Q.slice(1,Q.length-1):Q==="TRUE"?Q=!0:Q==="FALSE"?Q=!1:isNaN(Vi(Q))?isNaN(FA(Q).getDate())||(Q=Rr(Q)):(Q=Vi(Q),T!==null&&e0(T)&&(Q=uv(Q))),Y=!0;break;case"E":J=!0;var O=wA(G[_].slice(1),{r:v,c:y});C[v][y]=[C[v][y],O];break;case"S":ee=!0,C[v][y]=[C[v][y],"S5S"];break;case"G":break;case"R":W=parseInt(G[_].slice(1))-1;break;case"C":R=parseInt(G[_].slice(1))-1;break;default:if(m&&m.WTF)throw new Error("SYLK bad record "+P)}if(Y&&(C[v][y]&&C[v][y].length==2?C[v][y][0]=Q:C[v][y]=Q,T=null),ee){if(J)throw new Error("SYLK shared formula cannot have own formula");var q=W>-1&&C[W][R];if(!q||!q[1])throw new Error("SYLK shared formula cannot find base");C[v][y][1]=q9(q[1],{r:v-W,c:y-R})}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=C.length;L<=v;++L)C[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),M[L-1]=D===0?{hidden:!0}:{wch:D},Dc(M[L-1]);break;case"C":y=parseInt(G[_].slice(1))-1,M[y]||(M[y]={});break;case"R":v=parseInt(G[_].slice(1))-1,F[v]||(F[v]={}),D>0?(F[v].hpt=D,F[v].hpx=UA(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),M.length>0&&(B["!cols"]=M),m&&m.sheetRows&&(C=C.slice(0,m.sheetRows)),[C,B]}function l(x,m){var b=s(x,m),v=b[0],y=b[1],k=r0(v,m);return Aa(y).forEach(function(_){k[_]=y[_]}),k}function o(x,m){return Gc(l(x,m),m)}function d(x,m,b,v){var y="C;Y"+(b+1)+";X"+(v+1)+";K";switch(x.t){case"n":y+=x.v||0,x.f&&!x.F&&(y+=";E"+BE(x.f,{r:b,c:v}));break;case"b":y+=x.v?"TRUE":"FALSE";break;case"e":y+=x.w||x.v;break;case"d":y+='"'+(x.w||x.v)+'"';break;case"s":y+='"'+x.v.replace(/"/g,"").replace(/;/g,";;")+'"';break}return y}function u(x,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=wp(b.width)),typeof b.wpx=="number"&&!b.wch&&(b.wch=Np(b.wpx)),typeof b.wch=="number"&&(y+=Math.round(b.wch))),y.charAt(y.length-1)!=" "&&x.push(y)})}function f(x,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*Cp(b.hpx)+";"),y.length>2&&x.push(y+"R"+(v+1))})}function p(x,m){var b=["ID;PWXL;N;E"],v=[],y=Yt(x["!ref"]),k,_=Array.isArray(x),C=`\r
`;b.push("P;PGeneral"),b.push("F;P0;DG0G8;M255"),x["!cols"]&&u(b,x["!cols"]),x["!rows"]&&f(b,x["!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});k=_?(x[E]||[])[T]:x[B],!(!k||k.v==null&&(!k.f||k.F))&&v.push(d(k,x,E,T))}return b.join(C)+C+v.join(C)+C+"E"+C}return{to_workbook:o,to_sheet:l,from_sheet:p}})(),T9=(function(){function e(i,l){switch(l.type){case"base64":return t($s(i),l);case"binary":return t(i,l);case"buffer":return t(Mt&&Buffer.isBuffer(i)?i.toString("binary"):Vc(i),l);case"array":return t(Gd(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 x=o[f].trim().split(","),m=x[0],b=x[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(FA(b).getDate())?p[d][u]=b:p[d][u]=Rr(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 r0(e(i,l),l)}function a(i,l){return Gc(r(i,l),l)}var s=(function(){var i=function(d,u,f,p,x){d.push(u),d.push(f+","+p),d.push('"'+x.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,x=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=x?(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=ki(p.z||vt[14],za(Rr(p.v)))),l(u,0,p.w,"V");break;default:l(u,1,0,"")}}}l(u,-1,0,"EOD");var k=`\r
`,_=u.join(k);return _}})();return{to_workbook:a,to_sheet:r,from_sheet:s}})(),I9=(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,x){for(var m=p.split(`
`),b=-1,v=-1,y=0,k=[];y!==m.length;++y){var _=m[y].trim().split(":");if(_[0]==="cell"){var C=Zr(_[1]);if(k.length<=C.r)for(b=k.length;b<=C.r;++b)k[b]||(k[b]=[]);switch(b=C.r,v=C.c,_[2]){case"t":k[b][v]=e(_[3]);break;case"v":k[b][v]=+_[3];break;case"vtf":var E=_[_.length-1];case"vtc":switch(_[3]){case"nl":k[b][v]=!!+_[4];break;default:k[b][v]=+_[4];break}_[2]=="vtf"&&(k[b][v]=[k[b][v],E])}}}return x&&x.sheetRows&&(k=k.slice(0,x.sheetRows)),k}function a(p,x){return r0(r(p,x),x)}function s(p,x){return Gc(a(p,x),x)}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 x=[],m=[],b,v="",y=vs(p["!ref"]),k=Array.isArray(p),_=y.s.r;_<=y.e.r;++_)for(var C=y.s.c;C<=y.e.c;++C)if(v=yt({r:_,c:C}),b=k?(p[_]||[])[C]: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=za(Rr(b.v));m[2]="vtc",m[3]="nd",m[4]=""+E,m[5]=b.w||ki(b.z||vt[14],E);break;case"e":continue}x.push(m.join(":"))}return x.push("sheet:c:"+(y.e.c-y.s.c+1)+":r:"+(y.e.r-y.s.r+1)+":tvf:1"),x.push("valueformat:1:text-wiki"),x.join(`
`)}function f(p){return[i,l,o,l,u(p),d].join(`
`)}return{to_workbook:s,to_sheet:a,from_sheet:f}})(),DA=(function(){function e(f,p,x,m,b){b.raw?p[x][m]=f:f===""||(f==="TRUE"?p[x][m]=!0:f==="FALSE"?p[x][m]=!1:isNaN(Vi(f))?isNaN(FA(f).getDate())?p[x][m]=f:p[x][m]=Rr(f):p[x][m]=Vi(f))}function t(f,p){var x=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,k=0,_=0;_<=v;++_)k=b[_].indexOf(" "),k==-1?k=b[_].length:k++,y=Math.max(y,k);for(_=0;_<=v;++_){m[_]=[];var C=0;for(e(b[_].slice(0,y).trim(),m,_,C,x),C=1;C<=(b[_].length-y)/10+1;++C)e(b[_].slice(y+(C-1)*10,y+C*10).trim(),m,_,C,x)}return x.sheetRows&&(m=m.slice(0,x.sheetRows)),m}var r={44:",",9:"	",59:";",124:"|"},a={44:3,9:2,59:1,124:0};function s(f){for(var p={},x=!1,m=0,b=0;m<f.length;++m)(b=f.charCodeAt(m))==34?x=!x:!x&&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 x=p||{},m="",b=x.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)):x&&x.FS?m=x.FS:m=s(f.slice(0,1024));var y=0,k=0,_=0,C=0,E=0,T=m.charCodeAt(0),B=!1,F=0,M=f.charCodeAt(0);f=f.replace(/\r\n/mg,`
`);var U=x.dateNF!=null?nge(x.dateNF):null;function D(){var L=f.slice(C,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(x.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,'"')):Fwe(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",x.cellText!==!1&&(P.w=L),P.v=_;else if(!isNaN(FA(L).getDate())||U&&L.match(U)){P.z=x.dateNF||vt[14];var G=0;U&&L.match(U)&&(L=sge(L,x.dateNF,L.match(U)||[]),G=1),x.cellDates?(P.t="d",P.v=Rr(L,G)):(P.t="n",P.v=za(Rr(L,G))),x.cellText!==!1&&(P.w=ki(P.z,P.v instanceof Date?za(P.v):P.v)),x.cellNF||delete P.z}else P.t="s",P.v=L;if(P.t=="z"||(x.dense?(b[y]||(b[y]=[]),b[y][k]=P):b[yt({c:k,r:y})]=P),C=E+1,M=f.charCodeAt(C),v.e.c<k&&(v.e.c=k),v.e.r<y&&(v.e.r=y),F==T)++k;else if(k=0,++y,x.sheetRows&&x.sheetRows<=y)return!0}e:for(;E<f.length;++E)switch(F=f.charCodeAt(E)){case 34:M===34&&(B=!B);break;case T:case 10:case 13:if(!B&&D())break e;break}return E-C>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):r0(t(f,p),p)}function o(f,p){var x="",m=p.type=="string"?[0,0,0,0]:RE(f,p);switch(p.type){case"base64":x=$s(f);break;case"binary":x=f;break;case"buffer":p.codepage==65001?x=f.toString("utf8"):p.codepage&&typeof pp<"u"||(x=Mt&&Buffer.isBuffer(f)?f.toString("binary"):Vc(f));break;case"array":x=Gd(f);break;case"string":x=f;break;default:throw new Error("Unrecognized type "+p.type)}return m[0]==239&&m[1]==187&&m[2]==191?x=gr(x.slice(3)):p.type!="string"&&p.type!="buffer"&&p.codepage==65001?x=gr(x):p.type=="binary"&&typeof pp<"u",x.slice(0,19)=="socialcalc:version:"?I9.to_sheet(p.type=="string"?x:gr(x),p):l(x,p)}function d(f,p){return Gc(o(f,p),p)}function u(f){for(var p=[],x=Yt(f["!ref"]),m,b=Array.isArray(f),v=x.s.r;v<=x.e.r;++v){for(var y=[],k=x.s.c;k<=x.e.c;++k){var _=yt({r:v,c:k});if(m=b?(f[v]||[])[k]:f[_],!m||m.v==null){y.push("          ");continue}for(var C=(m.w||(No(m),m.w)||"").slice(0,10);C.length<10;)C+=" ";y.push(C+(k===0?" ":""))}p.push(y.join(""))}return p.join(`
`)}return{to_workbook:d,to_sheet:o,from_sheet:u}})();function b1e(e,t){var r=t||{},a=!!r.WTF;r.WTF=!0;try{var s=_9.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 DA.to_workbook(e,t)}}var Id=(function(){function e(O,q,z){if(O){vn(O,O.l||0);for(var X=z.Enum||W;O.l<O.length;){var re=O.read_shift(2),le=X[re]||X[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($s(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||{},X=z.dense?[]:{},re="Sheet1",le="",ne=0,ae={},ie=[],he=[],Z={s:{r:0,c:0},e:{r:0,c:0}},Ue=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=W,e(O,function(fe,Me,Xe){switch(Xe){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:Xe==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=uv(fe[1].v))),z.qpro&&fe[3]>ne&&(X["!ref"]=Tt(Z),ae[re]=X,ie.push(re),X=z.dense?[]:{},Z={s:{r:0,c:0},e:{r:0,c:0}},ne=fe[3],re=le||"Sheet"+(ne+1),le="");var it=z.dense?(X[fe[0].r]||[])[fe[0].c]:X[yt(fe[0])];if(it){it.t=fe[1].t,it.v=fe[1].v,fe[1].z!=null&&(it.z=fe[1].z),fe[1].f!=null&&(it.f=fe[1].f);break}z.dense?(X[fe[0].r]||(X[fe[0].r]=[]),X[fe[0].r][fe[0].c]=fe[1]):X[yt(fe[0])]=fe[1];break}},z);else if(O[2]==26||O[2]==14)z.Enum=R,O[2]==14&&(z.qpro=!0,O.l=0),e(O,function(fe,Me,Xe){switch(Xe){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&&(X["!ref"]=Tt(Z),ae[re]=X,ie.push(re),X=z.dense?[]:{},Z={s:{r:0,c:0},e:{r:0,c:0}},ne=fe[3],re="Sheet"+(ne+1)),Ue>0&&fe[0].r>=Ue)break;z.dense?(X[fe[0].r]||(X[fe[0].r]=[]),X[fe[0].r][fe[0].c]=fe[1]):X[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]&&(he[fe[14e3][0]]=fe[14e3][1]);break;case 1537:he[fe[0]]=fe[1],fe[0]==ne&&(re=fe[1]);break}},z);else throw new Error("Unrecognized LOTUS BOF "+O[2]);if(X["!ref"]=Tt(Z),ae[le||re]=X,ie.push(le||re),!he.length)return{SheetNames:ie,Sheets:ae};for(var Ie={},be=[],je=0;je<he.length;++je)ae[ie[je]]?(be.push(he[je]||ie[je]),Ie[he[je]]=ae[he[je]]||ae[ie[je]]):(be.push(he[je]),Ie[he[je]]={"!ref":"A1"});return{SheetNames:be,Sheets:Ie}}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 X=xs(),re=Yt(O["!ref"]),le=Array.isArray(O),ne=[];Ye(X,0,i(1030)),Ye(X,6,d(re));for(var ae=Math.min(re.e.r,8191),ie=re.s.r;ie<=ae;++ie)for(var he=va(ie),Z=re.s.c;Z<=re.e.c;++Z){ie===re.s.r&&(ne[Z]=Jr(Z));var Ue=ne[Z]+he,Ie=le?(O[ie]||[])[Z]:O[Ue];if(!(!Ie||Ie.t=="z"))if(Ie.t=="n")(Ie.v|0)==Ie.v&&Ie.v>=-32768&&Ie.v<=32767?Ye(X,13,m(ie,Z,Ie.v)):Ye(X,14,v(ie,Z,Ie.v));else{var be=No(Ie);Ye(X,15,p(ie,Z,be.slice(0,239)))}}return Ye(X,1),X.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 X=xs();Ye(X,0,l(O));for(var re=0,le=0;re<O.SheetNames.length;++re)(O.Sheets[O.SheetNames[re]]||{})["!ref"]&&Ye(X,27,J(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"]),he=Array.isArray(ae),Z=[],Ue=Math.min(ie.e.r,8191),Ie=ie.s.r;Ie<=Ue;++Ie)for(var be=va(Ie),je=ie.s.c;je<=ie.e.c;++je){Ie===ie.s.r&&(Z[je]=Jr(je));var fe=Z[je]+be,Me=he?(ae[Ie]||[])[je]:ae[fe];if(!(!Me||Me.t=="z"))if(Me.t=="n")Ye(X,23,D(Ie,je,ne,Me.v));else{var Xe=No(Me);Ye(X,22,F(Ie,je,ne,Xe.slice(0,239)))}}++ne}}return Ye(X,1),X.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,X=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=vs(ae["!ref"]);z<ie.e.r&&(z=ie.e.r),X<ie.e.c&&(X=ie.e.c)}}return z>8191&&(z=8191),q.write_shift(2,z),q.write_shift(1,re),q.write_shift(1,X),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 X={s:{c:0,r:0},e:{c:0,r:0}};return q==8&&z.qpro?(X.s.c=O.read_shift(1),O.l++,X.s.r=O.read_shift(2),X.e.c=O.read_shift(1),O.l++,X.e.r=O.read_shift(2),X):(X.s.c=O.read_shift(2),X.s.r=O.read_shift(2),q==12&&z.qpro&&(O.l+=2),X.e.c=O.read_shift(2),X.e.r=O.read_shift(2),q==12&&z.qpro&&(O.l+=2),X.s.c==65535&&(X.s.c=X.e.c=X.s.r=X.e.r=0),X)}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 X=[{c:0,r:0},{t:"n",v:0},0,0];return z.qpro&&z.vers!=20768?(X[0].c=O.read_shift(1),X[3]=O.read_shift(1),X[0].r=O.read_shift(2),O.l+=2):(X[2]=O.read_shift(1),X[0].c=O.read_shift(2),X[0].r=O.read_shift(2)),X}function f(O,q,z){var X=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(X-O.l,"cstr"),re}function p(O,q,z){var X=Oe(7+z.length);X.write_shift(1,255),X.write_shift(2,q),X.write_shift(2,O),X.write_shift(1,39);for(var re=0;re<X.length;++re){var le=z.charCodeAt(re);X.write_shift(1,le>=128?95:le)}return X.write_shift(1,0),X}function x(O,q,z){var X=u(O,q,z);return X[1].v=O.read_shift(2,"i"),X}function m(O,q,z){var X=Oe(7);return X.write_shift(1,255),X.write_shift(2,q),X.write_shift(2,O),X.write_shift(2,z,"i"),X}function b(O,q,z){var X=u(O,q,z);return X[1].v=O.read_shift(8,"f"),X}function v(O,q,z){var X=Oe(13);return X.write_shift(1,255),X.write_shift(2,q),X.write_shift(2,O),X.write_shift(8,z,"f"),X}function y(O,q,z){var X=O.l+q,re=u(O,q,z);if(re[1].v=O.read_shift(8,"f"),z.qpro)O.l=X;else{var le=O.read_shift(2);E(O.slice(O.l,O.l+le),re),O.l+=le}return re}function k(O,q,z){var X=q&32768;return q&=-32769,q=(X?O:0)+(q>=8192?q-16384:q),(X?"":"$")+(z?Jr(q):va(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]},C=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];function E(O,q){vn(O,0);for(var z=[],X=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=k(q[0].c,O.read_shift(2),!0),re=k(q[0].r,O.read_shift(2),!1),z.push(le+re);break;case 2:{var he=k(q[0].c,O.read_shift(2),!0),Z=k(q[0].r,O.read_shift(2),!1);le=k(q[0].c,O.read_shift(2),!0),re=k(q[0].r,O.read_shift(2),!1),z.push(he+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 Ue="";ie=O[O.l++];)Ue+=String.fromCharCode(ie);z.push('"'+Ue.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&&C[ie])ae=z.pop(),ne=z.pop(),z.push(ne+C[ie]+ae);else if(_[ie]){if(X=_[ie][1],X==69&&(X=O[O.l++]),X>z.length){console.error("WK1 bad formula parse 0x"+ie.toString(16)+":|"+z.join("|")+"|");return}var Ie=z.slice(-X);z.length-=X,z.push(_[ie][0]+"("+Ie.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,X){var re=Oe(6+X.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<X.length;++le){var ne=X.charCodeAt(le);re.write_shift(1,ne>=128?95:ne)}return re.write_shift(1,0),re}function M(O,q){var z=T(O);z[1].v=O.read_shift(2);var X=z[1].v>>1;if(z[1].v&1)switch(X&7){case 0:X=(X>>3)*5e3;break;case 1:X=(X>>3)*500;break;case 2:X=(X>>3)/20;break;case 3:X=(X>>3)/200;break;case 4:X=(X>>3)/2e3;break;case 5:X=(X>>3)/2e4;break;case 6:X=(X>>3)/16;break;case 7:X=(X>>3)/64;break}return z[1].v=X,z}function U(O,q){var z=T(O),X=O.read_shift(4),re=O.read_shift(4),le=O.read_shift(2);if(le==65535)return X===0&&re===3221225472?(z[1].t="e",z[1].v=15):X===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)+X*Math.pow(2,le)),z}function D(O,q,z,X){var re=Oe(14);if(re.write_shift(2,O),re.write_shift(1,z),re.write_shift(1,q),X==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 X<0&&(le=1,X=-X),ne=Math.log2(X)|0,X/=Math.pow(2,ne-31),ie=X>>>0,(ie&2147483648)==0&&(X/=2,++ne,ie=X>>>0),X-=ie,ie|=2147483648,ie>>>=0,X*=Math.pow(2,32),ae=X>>>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),X=O.read_shift(4);return z[1].v=X>>6,z}function G(O,q){var z=T(O),X=O.read_shift(8,"f");return z[1].v=X,z}function H(O,q){var z=G(O);return O.l+=q-10,z}function Q(O,q){return O[O.l+q-1]==0?O.read_shift(q,"cstr"):""}function Y(O,q){var z=O[O.l++];z>q-1&&(z=q-1);for(var X="";X.length<z;)X+=String.fromCharCode(O[O.l++]);return X}function K(O,q,z){if(!(!z.qpro||q<21)){var X=O.read_shift(1);O.l+=17,O.l+=1,O.l+=2;var re=O.read_shift(q-21,"cstr");return[X,re]}}function ee(O,q){for(var z={},X=O.l+q;O.l<X;){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 J(O,q){var z=Oe(5+O.length);z.write_shift(2,14e3),z.write_shift(2,q);for(var X=0;X<O.length;++X){var re=O.charCodeAt(X);z[z.l++]=re>127?95:re}return z[z.l++]=0,z}var W={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:x},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:Q},222:{n:"SHEETNAMELP",f:Y},65535:{n:""}},R={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:M},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:H},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:Q},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 v1e(e){var t={},r=e.match(zn),a=0,s=!1;if(r)for(;a!=r.length;++a){var i=wt(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=eE[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 y1e=(function(){var e=mp("t"),t=mp("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=v1e(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})}})(),w1e=(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("")}})(),N1e=/<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g,C1e=/<(?:\w+:)?r>/,k1e=/<(?:\w+:)?rPh.*?>([\s\S]*?)<\/(?:\w+:)?rPh>/g;function CE(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=dE(a.t))):e.match(C1e)&&(a.r=gr(e),a.t=Wt(gr((e.replace(k1e,"").match(N1e)||[]).join("").replace(zn,""))),r&&(a.h=w1e(y1e(a.r)))),a):{t:""}}var j1e=/<(?:\w+:)?sst([^>]*)>([\s\S]*)<\/(?:\w+:)?sst>/,E1e=/<(?:\w+:)?(?:si|sstItem)>/g,S1e=/<\/(?:\w+:)?(?:si|sstItem)>/;function B1e(e,t){var r=[],a="";if(!e)return r;var s=e.match(j1e);if(s){a=s[2].replace(E1e,"").split(S1e);for(var i=0;i!=a.length;++i){var l=CE(a[i].trim(),t);l!=null&&(r[r.length]=l)}s=wt(s[1]),r.Count=s.count,r.Unique=s.uniqueCount}return r}var _1e=/^\s|\s$|[\t\n\r]/;function F9(e,t){if(!t.bookSST)return"";var r=[wa];r[r.length]=qe("sst",null,{xmlns:nu[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(_1e)&&(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 T1e(e){return[e.read_shift(4),e.read_shift(4)]}function I1e(e,t){var r=[],a=!1;return Ro(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 F1e(e,t){return t||(t=Oe(8)),t.write_shift(4,e.Count),t.write_shift(4,e.Unique),t}var D1e=$ge;function U1e(e){var t=xs();He(t,159,F1e(e));for(var r=0;r<e.length;++r)He(t,19,D1e(e[r]));return He(t,160),t.end()}function D9(e){for(var t=[],r=e.split(""),a=0;a<r.length;++a)t[a]=r[a].charCodeAt(0);return t}function Ao(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 M1e(e){var t={};return t.id=e.read_shift(0,"lpp4"),t.R=Ao(e,4),t.U=Ao(e,4),t.W=Ao(e,4),t}function R1e(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 O1e(e){var t=[];e.l+=4;for(var r=e.read_shift(4);r-- >0;)t.push(R1e(e));return t}function P1e(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 L1e(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=Ao(e,4),t.U=Ao(e,4),t.W=Ao(e,4),t}function Q1e(e){var t=L1e(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 U9(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 M9(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 H1e(e){var t=Ao(e);switch(t.Minor){case 2:return[t.Minor,z1e(e)];case 3:return[t.Minor,$1e()];case 4:return[t.Minor,V1e(e)]}throw new Error("ECMA-376 Encrypted file unrecognized Version: "+t.Minor)}function z1e(e){var t=e.read_shift(4);if((t&63)!=36)throw new Error("EncryptionInfo mismatch");var r=e.read_shift(4),a=U9(e,r),s=M9(e,e.length-e.l);return{t:"Std",h:a,v:s}}function $1e(){throw new Error("File is password-protected: ECMA-376 Extensible")}function V1e(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=wt(i);switch(_l(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 G1e(e,t){var r={},a=r.EncryptionVersionInfo=Ao(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=U9(e,s),t-=s,r.EncryptionVerifier=M9(e,t),r}function K1e(e){var t={},r=t.EncryptionVersionInfo=Ao(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 kE(e){var t=0,r,a=D9(e),s=a.length+1,i,l,o,d,u;for(r=Fc(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 R9=(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=D9(l),d=i(o),u=o.length,f=Fc(16),p=0;p!=16;++p)f[p]=0;var x,m,b;for((u&1)===1&&(x=d>>8,f[u]=s(e[0],x),--u,x=d&255,m=o[o.length-1],f[u]=s(m,x));u>0;)--u,x=d>>8,f[u]=s(o[u],x),--u,x=d&255,f[u]=s(o[u],x);for(u=15,b=15-o.length;b>0;)x=d>>8,f[u]=s(e[b],x),--u,--b,x=d&255,f[u]=s(o[u],x),--u,--b;return f}})(),q1e=function(e,t,r,a,s){s||(s=t),a||(a=R9(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]},W1e=function(e){var t=0,r=R9(e);return function(a){var s=q1e("",a,t,r);return t=s[1],s[0]}};function Y1e(e,t,r,a){var s={key:_a(e),verificationBytes:_a(e)};return r.password&&(s.verifier=kE(r.password)),a.valid=s.verificationBytes===s.verifier,a.valid&&(a.insitu=W1e(r.password)),s}function X1e(e,t,r){var a=r||{};return a.Info=e.read_shift(2),e.l-=2,a.Info===1?a.Data=K1e(e):a.Data=G1e(e,t),a}function J1e(e,t,r){var a={Type:r.biff>=8?e.read_shift(2):0};return a.Type?X1e(e,t-2,a):Y1e(e,r.biff>=8?t:t-2,r,a),a}var O9=(function(){function e(s,i){switch(i.type){case"base64":return t($s(s),i);case"binary":return t(s,i);case"buffer":return t(Mt&&Buffer.isBuffer(s)?s.toString("binary"):Vc(s),i);case"array":return t(Gd(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 x=/\\\w+\b/g,m=0,b,v=-1;b=x.exec(f);){switch(b[0]){case"\\cell":var y=f.slice(m,x.lastIndex-b[0].length);if(y[0]==" "&&(y=y.slice(1)),++v,y.length){var k={v:y,t:"s"};Array.isArray(o)?o[p][v]=k:o[yt({r:p,c:v})]=k}break}m=x.lastIndex}v>u.e.c&&(u.e.c=v)}),o["!ref"]=Tt(u),o}function r(s,i){return Gc(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||(No(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 Z1e(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 yp(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 eye(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 tye(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 Yg(e,t){if(t===0)return e;var r=eye(Z1e(e));return t<0?r[2]=r[2]*(1+t):r[2]=1-(1-r[2])*(1-t),yp(tye(r))}var P9=6,rye=15,aye=1,Rn=P9;function wp(e){return Math.floor((e+Math.round(128/Rn)/256)*Rn)}function Np(e){return Math.floor((e-5)/Rn*100+.5)/100}function Xg(e){return Math.round((e*Rn+5)/Rn*256)/256}function _2(e){return Xg(Np(wp(e)))}function jE(e){var t=Math.abs(e-_2(e)),r=Rn;if(t>.005)for(Rn=aye;Rn<rye;++Rn)Math.abs(e-_2(e))<=t&&(t=Math.abs(e-_2(e)),r=Rn);Rn=r}function Dc(e){e.width?(e.wpx=wp(e.width),e.wch=Np(e.wpx),e.MDW=Rn):e.wpx?(e.wch=Np(e.wpx),e.width=Xg(e.wch),e.MDW=Rn):typeof e.wch=="number"&&(e.width=Xg(e.wch),e.wpx=wp(e.width),e.MDW=Rn),e.customWidth&&delete e.customWidth}var nye=96,L9=nye;function Cp(e){return e*96/L9}function UA(e){return e*L9/96}var sye={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 iye(e,t,r,a){t.Borders=[];var s={},i=!1;(e[0].match(zn)||[]).forEach(function(l){var o=wt(l);switch(_l(o[0])){case"<borders":case"<borders>":case"</borders>":break;case"<border":case"<border>":case"<border/>":s={},o.diagonalUp&&(s.diagonalUp=Ur(o.diagonalUp)),o.diagonalDown&&(s.diagonalDown=Ur(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 lye(e,t,r,a){t.Fills=[];var s={},i=!1;(e[0].match(zn)||[]).forEach(function(l){var o=wt(l);switch(_l(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 oye(e,t,r,a){t.Fonts=[];var s={},i=!1;(e[0].match(zn)||[]).forEach(function(l){var o=wt(l);switch(_l(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?Ur(o.val):1;break;case"<b/>":s.bold=1;break;case"<i":s.italic=o.val?Ur(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?Ur(o.val):1;break;case"<strike/>":s.strike=1;break;case"<outline":s.outline=o.val?Ur(o.val):1;break;case"<outline/>":s.outline=1;break;case"<shadow":s.shadow=o.val?Ur(o.val):1;break;case"<shadow/>":s.shadow=1;break;case"<condense":s.condense=o.val?Ur(o.val):1;break;case"<condense/>":s.condense=1;break;case"<extend":s.extend=o.val?Ur(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=eE[parseInt(o.val,10)];break;case"<color":if(s.color||(s.color={}),o.auto&&(s.color.auto=Ur(o.auto)),o.rgb)s.color.rgb=o.rgb.slice(-6);else if(o.indexed){s.color.index=parseInt(o.indexed,10);var d=_d[s.color.index];s.color.index==81&&(d=_d[1]),d||(d=_d[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=Yg(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 cye(e,t,r){t.NumberFmt=[];for(var a=Aa(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=wt(i[s]);switch(_l(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}uo(o,d)}}break;case"</numFmt>":break;default:if(r.WTF)throw new Error("unrecognized "+l[0]+" in numFmts")}}}function dye(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]=qe("numFmt",null,{numFmtId:a,formatCode:ur(e[a])}))}),t.length===1?"":(t[t.length]="</numFmts>",t[0]=qe("numFmts",null,{count:t.length-2}).replace("/>",">"),t.join(""))}var qx=["numFmtId","fillId","fontId","borderId","xfId"],Wx=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];function uye(e,t,r){t.CellXf=[];var a,s=!1;(e[0].match(zn)||[]).forEach(function(i){var l=wt(i),o=0;switch(_l(l[0])){case"<cellXfs":case"<cellXfs>":case"<cellXfs/>":case"</cellXfs>":break;case"<xf":case"<xf/>":for(a=l,delete a[0],o=0;o<qx.length;++o)a[qx[o]]&&(a[qx[o]]=parseInt(a[qx[o]],10));for(o=0;o<Wx.length;++o)a[Wx[o]]&&(a[Wx[o]]=Ur(a[Wx[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=Ur(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 Aye(e){var t=[];return t[t.length]=qe("cellXfs",null),e.forEach(function(r){t[t.length]=qe("xf",null,r)}),t[t.length]="</cellXfs>",t.length===2?"":(t[0]=qe("cellXfs",null,{count:t.length-2}).replace("/>",">"),t.join(""))}var fye=(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))&&cye(p,f,u),(p=o.match(s))&&oye(p,f,d,u),(p=o.match(a))&&lye(p,f,d,u),(p=o.match(i))&&iye(p,f,d,u),(p=o.match(r))&&uye(p,f,u),f}})();function Q9(e,t){var r=[wa,qe("styleSheet",null,{xmlns:nu[0],"xmlns:vt":Qa.vt})],a;return e.SSF&&(a=dye(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=Aye(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 pye(e,t){var r=e.read_shift(2),a=Pn(e);return[r,a]}function hye(e,t,r){r||(r=Oe(6+4*t.length)),r.write_shift(2,e),tn(t,r);var a=r.length>r.l?r.slice(0,r.l):r;return r.l==null&&(r.l=r.length),a}function xye(e,t,r){var a={};a.sz=e.read_shift(2)/20;var s=Xge(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=Yge(e),e.read_shift(1)){case 1:a.scheme="major";break;case 2:a.scheme="minor";break}return a.name=Pn(e),a}function mye(e,t){t||(t=Oe(153)),t.write_shift(2,e.sz*20),Jge(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),Kg(e.color,t);var a=0;return a=2,t.write_shift(1,a),tn(e.name,t),t.length>t.l?t.slice(0,t.l):t}var gye=["none","solid","mediumGray","darkGray","lightGray","darkHorizontal","darkVertical","darkDown","darkUp","darkGrid","darkTrellis","lightHorizontal","lightVertical","lightDown","lightUp","lightGrid","lightTrellis","gray125","gray0625"],T2,bye=Hn;function ZD(e,t){t||(t=Oe(84)),T2||(T2=cv(gye));var r=T2[e.patternType];r==null&&(r=40),t.write_shift(4,r);var a=0;if(r!=40)for(Kg({auto:1},t),Kg({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 vye(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 H9(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 of(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 yye=Hn;function wye(e,t){return t||(t=Oe(51)),t.write_shift(1,0),of(null,t),of(null,t),of(null,t),of(null,t),of(null,t),t.length>t.l?t.slice(0,t.l):t}function Nye(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),Gg(e.name||"",t),t.length>t.l?t.slice(0,t.l):t}function Cye(e,t,r){var a=Oe(2052);return a.write_shift(4,e),Gg(t,a),Gg(r,a),a.length>a.l?a.slice(0,a.l):a}function kye(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 Ro(e,function(d,u,f){switch(f){case 44:a.NumberFmt[d[0]]=d[1],uo(d[1],d[0]);break;case 43:a.Fonts.push(d),d.color.theme!=null&&t&&t.themeElements&&t.themeElements.clrScheme&&(d.color.rgb=Yg(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 jye(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,hye(s,t[s]))}),He(e,616))}}function Eye(e){var t=1;He(e,611,Gi(t)),He(e,43,mye({sz:12,color:{theme:1},name:"Calibri",family:2})),He(e,612)}function Sye(e){var t=2;He(e,603,Gi(t)),He(e,45,ZD({patternType:"none"})),He(e,45,ZD({patternType:"gray125"})),He(e,604)}function Bye(e){var t=1;He(e,613,Gi(t)),He(e,46,wye()),He(e,614)}function _ye(e){var t=1;He(e,626,Gi(t)),He(e,47,H9({numFmtId:0},65535)),He(e,627)}function Tye(e,t){He(e,617,Gi(t.length)),t.forEach(function(r){He(e,47,H9(r,0))}),He(e,618)}function Iye(e){var t=1;He(e,619,Gi(t)),He(e,48,Nye({xfId:0,name:"Normal"})),He(e,620)}function Fye(e){var t=0;He(e,505,Gi(t)),He(e,506)}function Dye(e){var t=0;He(e,508,Cye(t,"TableStyleMedium9","PivotStyleMedium4")),He(e,509)}function Uye(e,t){var r=xs();return He(r,278),jye(r,e.SSF),Eye(r),Sye(r),Bye(r),_ye(r),Tye(r,t.cellXfs),Iye(r),Fye(r),Dye(r),He(r,279),r.end()}var Mye=["</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 Rye(e,t,r){t.themeElements.clrScheme=[];var a={};(e[0].match(zn)||[]).forEach(function(s){var i=wt(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[Mye.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 Oye(){}function Pye(){}var Lye=/<a:clrScheme([^>]*)>[\s\S]*<\/a:clrScheme>/,Qye=/<a:fontScheme([^>]*)>[\s\S]*<\/a:fontScheme>/,Hye=/<a:fmtScheme([^>]*)>[\s\S]*<\/a:fmtScheme>/;function zye(e,t,r){t.themeElements={};var a;[["clrScheme",Lye,Rye],["fontScheme",Qye,Oye],["fmtScheme",Hye,Pye]].forEach(function(s){if(!(a=e.match(s[1])))throw new Error(s[0]+" not found in themeElements");s[2](a,t,r)})}var $ye=/<a:themeElements([^>]*)>[\s\S]*<\/a:themeElements>/;function z9(e,t){(!e||e.length===0)&&(e=EE());var r,a={};if(!(r=e.match($ye)))throw new Error("themeElements not found in theme");return zye(r[0],a,t),a.raw=e,a}function EE(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 Vye(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=UQ(i,{type:"array"})}catch{return}var o=Os(l,"theme/theme/theme1.xml",!0);if(o)return z9(o,r)}}function Gye(e){return e.read_shift(4)}function Kye(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=qye(e,4);break;case 2:t.xclrValue=w9(e);break;case 3:t.xclrValue=Gye(e);break;case 4:e.l+=4;break}return e.l+=8,t}function qye(e,t){return Hn(e,t)}function Wye(e,t){return Hn(e,t)}function Yye(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]=Kye(e);break;case 6:a[1]=Wye(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 Xye(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(Yye(e,r-e.l));return{ixfe:a,ext:i}}function Jye(e,t){t.forEach(function(r){r[0]})}function Zye(e,t){return{flags:e.read_shift(4),version:e.read_shift(4),name:Pn(e)}}function ewe(e){var t=Oe(12+2*e.name.length);return t.write_shift(4,e.flags),t.write_shift(4,e.version),tn(e.name,t),t.slice(0,t.l)}function twe(e){for(var t=[],r=e.read_shift(4);r-- >0;)t.push([e.read_shift(4),e.read_shift(4)]);return t}function rwe(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 awe(e,t){var r=Oe(8+2*t.length);return r.write_shift(4,e),tn(t,r),r.slice(0,r.l)}function nwe(e){return e.l+=4,e.read_shift(4)!=0}function swe(e,t){var r=Oe(8);return r.write_shift(4,e),r.write_shift(4,1),r}function iwe(e,t,r){var a={Types:[],Cell:[],Value:[]},s=r||{},i=[],l=!1,o=2;return Ro(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 lwe(){var e=xs();return He(e,332),He(e,334,Gi(1)),He(e,335,ewe({name:"XLDAPR",version:12e4,flags:3496657072})),He(e,336),He(e,339,awe(1,"XLDAPR")),He(e,52),He(e,35,Gi(514)),He(e,4096,Gi(0)),He(e,4097,ui(1)),He(e,36),He(e,53),He(e,340),He(e,337,swe(1)),He(e,51,rwe([[1,0]])),He(e,338),He(e,333),e.end()}function owe(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=wt(o);switch(_l(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 $9(){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 cwe(e){var t=[];if(!e)return t;var r=1;return(e.match(zn)||[]).forEach(function(a){var s=wt(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 dwe(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 uwe(e,t,r){var a=[];return Ro(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 Awe(e,t,r,a){if(!e)return e;var s=a||{},i=!1;Ro(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 fwe(e,t){if(!e)return"??";var r=(e.match(/<c:chart [^>]*r:id="([^"]*)"/)||["",""])[1];return t["!id"][r].Target}var pA=1024;function V9(e,t){for(var r=[21600,21600],a=["m0,0l0",r[1],r[0],r[1],r[0],"0xe"].join(","),s=[qe("xml",null,{"xmlns:v":Ds.v,"xmlns:o":Ds.o,"xmlns:x":Ds.x,"xmlns:mv":Ds.mv}).replace(/\/>/,">"),qe("o:shapelayout",qe("o:idmap",null,{"v:ext":"edit",data:e}),{"v:ext":"edit"}),qe("v:shapetype",[qe("v:stroke",null,{joinstyle:"miter"}),qe("v:path",null,{gradientshapeok:"t","o:connecttype":"rect"})].join(""),{id:"_x0000_t202","o:spt":202,coordsize:r.join(","),path:a})];pA<e*1e3;)pA+=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"?qe("o:fill",null,{type:"gradientUnscaled","v:ext":"view"}):null,u=qe("v:fill",d,o),f={on:"t",obscured:"t"};++pA,s=s.concat(["<v:shape"+gp({id:"_x0000_s"+pA,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,qe("v:shadow",null,f),qe("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 eU(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 pwe(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=wt(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>/),x=!!p&&!!p[1]&&CE(p[1])||{r:"",t:"",h:""};u.r=x.r,x.r=="<t></t>"&&(x.t=x.h=""),u.t=(x.t||"").replace(/\r\n/g,`
`).replace(/\r/g,`
`),t.cellHTML&&(u.h=x.h),a.push(u)}}}}),a}function G9(e){var t=[wa,qe("comments",null,{xmlns:nu[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 hwe(e,t){var r=[],a=!1,s={},i=0;return e.replace(zn,function(o,d){var u=wt(o);switch(_l(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 xwe(e,t,r){var a=[wa,qe("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(qe("threadedComment",yn("text",l.t||""),d))})}),a.push("</ThreadedComments>"),a.join("")}function mwe(e,t){var r=[],a=!1;return e.replace(zn,function(i){var l=wt(i);switch(_l(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 gwe(e){var t=[wa,qe("personList",null,{xmlns:Qa.TCMNT,"xmlns:x":nu[0]}).replace(/[\/]>/,">")];return e.forEach(function(r,a){t.push(qe("person",null,{displayName:r,id:"{54EE7950-7262-4200-6969-"+("000000000000"+a).slice(-12)+"}",userId:r,providerId:"None"}))}),t.push("</personList>"),t.join("")}function bwe(e){var t={};t.iauthor=e.read_shift(4);var r=ou(e);return t.rfx=r.s,t.ref=yt(r.s),e.l+=16,t}function vwe(e,t){return t==null&&(t=Oe(36)),t.write_shift(4,e[1].iauthor),a0(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 ywe=Pn;function wwe(e){return tn(e.slice(0,54))}function Nwe(e,t){var r=[],a=[],s={},i=!1;return Ro(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 Cwe(e){var t=xs(),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,wwe(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,vwe([i,s])),s.t&&s.t.length>0&&He(t,637,Gge(s)),He(t,636),delete s.iauthor})}),He(t,634),He(t,629),t.end()}var kwe="application/vnd.ms-office.vbaProject";function jwe(e){var t=ht.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*/,"");ht.utils.cfb_add(t,s,e.FileIndex[a].content)}}),ht.write(t)}function Ewe(e,t){t.FullPaths.forEach(function(r,a){if(a!=0){var s=r.replace(/[^\/]*[\/]/,"/_VBA_PROJECT_CUR/");s.slice(-1)!=="/"&&ht.utils.cfb_add(e,s,t.FileIndex[a].content)}})}var K9=["xlsb","xlsm","xlam","biff8","xla"];function Swe(){return{"!type":"dialog"}}function Bwe(){return{"!type":"dialog"}}function _we(){return{"!type":"macro"}}function Twe(){return{"!type":"macro"}}var wA=(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?"":"$")+va(u)}return function(s,i){return t=i,s.replace(e,r)}})(),SE=/(^|[^._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,BE=(function(){return function(t,r){return t.replace(SE,function(a,s,i,l,o,d){var u=hE(l)-(i?0:r.c),f=pE(d)-(o?0:r.r),p=f==0?"":o?f+1:"["+f+"]",x=u==0?"":i?u+1:"["+u+"]";return s+"R"+p+"C"+x})}})();function q9(e,t){return e.replace(SE,function(r,a,s,i,l,o){return a+(s=="$"?s+i:Jr(hE(i)+t.c))+(l=="$"?l+o:va(pE(o)+t.r))})}function Iwe(e,t,r){var a=vs(t),s=a.s,i=Zr(r),l={r:i.r-s.r,c:i.c-s.c};return q9(e,l)}function Fwe(e){return e.length!=1}function tU(e){return e.replace(/_xlfn\./g,"")}function Sa(e){e.l+=1}function Uc(e,t){var r=e.read_shift(2);return[r&16383,r>>14&1,r>>15&1]}function W9(e,t,r){var a=2;if(r){if(r.biff>=2&&r.biff<=5)return Y9(e);r.biff==12&&(a=4)}var s=e.read_shift(a),i=e.read_shift(a),l=Uc(e),o=Uc(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 Y9(e){var t=Uc(e),r=Uc(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 Dwe(e,t,r){if(r.biff<8)return Y9(e);var a=e.read_shift(r.biff==12?4:2),s=e.read_shift(r.biff==12?4:2),i=Uc(e),l=Uc(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 X9(e,t,r){if(r&&r.biff>=2&&r.biff<=5)return Uwe(e);var a=e.read_shift(r&&r.biff==12?4:2),s=Uc(e);return{r:a,c:s[0],cRel:s[1],rRel:s[2]}}function Uwe(e){var t=Uc(e),r=e.read_shift(1);return{r:t[0],c:r,cRel:t[1],rRel:t[2]}}function Mwe(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 Rwe(e,t,r){var a=r&&r.biff?r.biff:8;if(a>=2&&a<=5)return Owe(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 Owe(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 Pwe(e,t,r){var a=(e[e.l++]&96)>>5,s=W9(e,r.biff>=2&&r.biff<=5?6:8,r);return[a,s]}function Lwe(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=W9(e,i,r);return[a,s,l]}function Qwe(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 Hwe(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 zwe(e,t,r){var a=(e[e.l++]&96)>>5,s=Dwe(e,t-1,r);return[a,s]}function $we(e,t,r){var a=(e[e.l++]&96)>>5;return e.l+=r.biff==2?6:r.biff==12?14:7,[a]}function rU(e){var t=e[e.l+1]&1,r=1;return e.l+=4,[t,r]}function Vwe(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 Gwe(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 Kwe(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 qwe(e){var t=e[e.l+1]&255?1:0;return e.l+=2,[t,e.read_shift(2)]}function Wwe(e,t,r){var a=e[e.l+1]&255?1:0;return e.l+=r&&r.biff==2?3:4,[a]}function J9(e){var t=e.read_shift(1),r=e.read_shift(1);return[t,r]}function Ywe(e){return e.read_shift(2),J9(e)}function Xwe(e){return e.read_shift(2),J9(e)}function Jwe(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var s=X9(e,0,r);return[a,s]}function Zwe(e,t,r){var a=(e[e.l]&96)>>5;e.l+=1;var s=Rwe(e,0,r);return[a,s]}function e2e(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=X9(e,0,r);return[a,s,i]}function t2e(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[nNe[s],tH[s],a]}function r2e(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)]:a2e(e);return[s,(i[0]===0?tH:aNe)[i[1]]]}function a2e(e){return[e[e.l+1]>>7,e.read_shift(2)&32767]}function n2e(e,t,r){e.l+=r&&r.biff==2?3:4}function s2e(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 i2e(e){return e.l++,Oo[e.read_shift(1)]}function l2e(e){return e.l++,e.read_shift(2)}function o2e(e){return e.l++,e.read_shift(1)!==0}function c2e(e){return e.l++,On(e)}function d2e(e,t,r){return e.l++,th(e,t-1,r)}function u2e(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]=ma(e,1)?"TRUE":"FALSE",t!=12&&(e.l+=7);break;case 37:case 16:r[1]=Oo[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]=cu(e,0,{biff:t>0&&t<8?2:t});break;default:throw new Error("Bad SerAr: "+r[0])}return r}function A2e(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?ou:Av)(e));return s}function f2e(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]=u2e(e,r.biff);return l}function p2e(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 h2e(e,t,r){if(r.biff==5)return x2e(e);var a=e.read_shift(1)>>>5&3,s=e.read_shift(2),i=e.read_shift(4);return[a,s,i]}function x2e(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 m2e(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 g2e(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 b2e(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 v2e(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 y2e=Hn,w2e=Hn,N2e=Hn;function ah(e,t,r){return e.l+=2,[Mwe(e)]}function _E(e){return e.l+=6,[]}var C2e=ah,k2e=_E,j2e=_E,E2e=ah;function Z9(e){return e.l+=2,[_a(e),e.read_shift(2)&1]}var S2e=ah,B2e=Z9,_2e=_E,T2e=ah,I2e=ah,F2e=["Data","All","Headers","??","?Data2","??","?DataHeaders","??","Totals","??","??","??","?DataTotals","??","??","??","?Current"];function D2e(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=F2e[r>>2&31];return{ixti:t,coltype:r&3,rt:l,idx:a,c:s,C:i}}function U2e(e){return e.l+=2,[e.read_shift(4)]}function M2e(e,t,r){return e.l+=5,e.l+=2,e.l+=r.biff==2?1:4,["PTGSHEET"]}function R2e(e,t,r){return e.l+=r.biff==2?4:5,["PTGENDSHEET"]}function O2e(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function P2e(e){var t=e.read_shift(1)>>>5&3,r=e.read_shift(2);return[t,r]}function L2e(e){return e.l+=4,[0,0]}var aU={1:{n:"PtgExp",f:s2e},2:{n:"PtgTbl",f:N2e},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:d2e},26:{n:"PtgSheet",f:M2e},27:{n:"PtgEndSheet",f:R2e},28:{n:"PtgErr",f:i2e},29:{n:"PtgBool",f:o2e},30:{n:"PtgInt",f:l2e},31:{n:"PtgNum",f:c2e},32:{n:"PtgArray",f:$we},33:{n:"PtgFunc",f:t2e},34:{n:"PtgFuncVar",f:r2e},35:{n:"PtgName",f:p2e},36:{n:"PtgRef",f:Jwe},37:{n:"PtgArea",f:Pwe},38:{n:"PtgMemArea",f:m2e},39:{n:"PtgMemErr",f:y2e},40:{n:"PtgMemNoMem",f:w2e},41:{n:"PtgMemFunc",f:g2e},42:{n:"PtgRefErr",f:b2e},43:{n:"PtgAreaErr",f:Qwe},44:{n:"PtgRefN",f:Zwe},45:{n:"PtgAreaN",f:zwe},46:{n:"PtgMemAreaN",f:O2e},47:{n:"PtgMemNoMemN",f:P2e},57:{n:"PtgNameX",f:h2e},58:{n:"PtgRef3d",f:e2e},59:{n:"PtgArea3d",f:Lwe},60:{n:"PtgRefErr3d",f:v2e},61:{n:"PtgAreaErr3d",f:Hwe},255:{}},Q2e={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},H2e={1:{n:"PtgElfLel",f:Z9},2:{n:"PtgElfRw",f:T2e},3:{n:"PtgElfCol",f:C2e},6:{n:"PtgElfRwV",f:I2e},7:{n:"PtgElfColV",f:E2e},10:{n:"PtgElfRadical",f:S2e},11:{n:"PtgElfRadicalS",f:_2e},13:{n:"PtgElfColS",f:k2e},15:{n:"PtgElfColSV",f:j2e},16:{n:"PtgElfRadicalLel",f:B2e},25:{n:"PtgList",f:D2e},29:{n:"PtgSxName",f:U2e},255:{}},z2e={0:{n:"PtgAttrNoop",f:L2e},1:{n:"PtgAttrSemi",f:Wwe},2:{n:"PtgAttrIf",f:Kwe},4:{n:"PtgAttrChoose",f:Vwe},8:{n:"PtgAttrGoto",f:Gwe},16:{n:"PtgAttrSum",f:n2e},32:{n:"PtgAttrBaxcel",f:rU},33:{n:"PtgAttrBaxcel",f:rU},64:{n:"PtgAttrSpace",f:Ywe},65:{n:"PtgAttrSpaceSemi",f:Xwe},128:{n:"PtgAttrIfError",f:qwe},255:{}};function nh(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]=f2e(e,0,a),i.push(r[l][1]);break;case"PtgMemArea":r[l][2]=A2e(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 sh(e,t,r){for(var a=e.l+t,s,i,l=[];a!=e.l;)t=a-e.l,i=e[e.l],s=aU[i]||aU[Q2e[i]],(i===24||i===25)&&(s=(i===24?H2e:z2e)[e[e.l+1]]),!s||!s.f?Hn(e,t):l.push([s.n,s.f(e,t,r)]);return l}function $2e(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 V2e={PtgAdd:"+",PtgConcat:"&",PtgDiv:"/",PtgEq:"=",PtgGe:">=",PtgGt:">",PtgLe:"<=",PtgLt:"<",PtgMul:"*",PtgNe:"<>",PtgPower:"^",PtgSub:"-"};function G2e(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 eH(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 nU(e,t,r){var a=eH(e,t,r);return a=="#REF"?a:G2e(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,x=0,m,b="";if(!e[0]||!e[0][0])return"";for(var v=-1,y="",k=0,_=e[0].length;k<_;++k){var C=e[0][k];switch(C[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+V2e[C[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=Ff(C[1][1],l,s),o.push(Df(f,i));break;case"PtgRefN":f=r?Ff(C[1][1],r,s):C[1][1],o.push(Df(f,i));break;case"PtgRef3d":p=C[1][1],f=Ff(C[1][2],l,s),b=nU(a,p,s),o.push(b+"!"+Df(f,i));break;case"PtgFunc":case"PtgFuncVar":var E=C[1][0],T=C[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(C[1]?"TRUE":"FALSE");break;case"PtgInt":o.push(C[1]);break;case"PtgNum":o.push(String(C[1]));break;case"PtgStr":o.push('"'+C[1].replace(/"/g,'""')+'"');break;case"PtgErr":o.push(C[1]);break;case"PtgAreaN":m=FD(C[1][1],r?{s:r}:l,s),o.push(E2(m,s));break;case"PtgArea":m=FD(C[1][1],l,s),o.push(E2(m,s));break;case"PtgArea3d":p=C[1][1],m=C[1][2],b=nU(a,p,s),o.push(b+"!"+E2(m,s));break;case"PtgAttrSum":o.push("SUM("+o.pop()+")");break;case"PtgAttrBaxcel":case"PtgAttrSemi":break;case"PtgName":x=C[1][2];var F=(a.names||[])[x-1]||(a[0]||[])[x],M=F?F.Name:"SH33TJSNAME"+String(x);M&&M.slice(0,6)=="_xlfn."&&!s.xlfn&&(M=M.slice(6)),o.push(M);break;case"PtgNameX":var U=C[1][1];x=C[1][2];var D;if(s.biff<=5)U<0&&(U=-U),a[U]&&(D=a[U][x]);else{var L="";if(((a[U]||[])[0]||[])[0]==14849||(((a[U]||[])[0]||[])[0]==1025?a[U][x]&&a[U][x].itab>0&&(L=a.SheetNames[a[U][x].itab-1]+"!"):L=a.SheetNames[x-1]+"!"),a[U]&&a[U][x])L+=a[U][x].Name;else if(a[0]&&a[0][x])L+=a[0][x].Name;else{var P=(eH(a,U,s)||"").split(";;");P[x-1]?L=P[x-1]:L+="SH33TJSERRX"}o.push(L);break}D||(D={Name:"SH33TJSERRY"}),o.push(D.Name);break;case"PtgParen":var G="(",H=")";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:H=oa(" ",e[0][v][1][1])+H;break;case 5:H=oa("\r",e[0][v][1][1])+H;break;default:if(s.WTF)throw new Error("Unexpected PtgAttrSpaceType "+e[0][v][1][0])}v=-1}o.push(G+o.pop()+H);break;case"PtgRefErr":o.push("#REF!");break;case"PtgRefErr3d":o.push("#REF!");break;case"PtgExp":f={c:C[1][1],r:C[1][0]};var Q={c:r.c,r:r.r};if(a.sharedf[yt(f)]){var Y=a.sharedf[yt(f)];o.push(Dn(Y,l,Q,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,Q,a,s)),K=!0;break}K||o.push(C[1])}break;case"PtgArray":o.push("{"+$2e(C[1])+"}");break;case"PtgMemArea":break;case"PtgAttrSpace":case"PtgAttrSpaceSemi":v=k;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"+C[1].idx+"[#"+C[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(C));default:throw new Error("Unrecognized Formula Token: "+String(C))}var ee=["PtgAttrSpace","PtgAttrSpaceSemi","PtgAttrGoto"];if(s.biff!=3&&v>=0&&ee.indexOf(e[0][k][0])==-1){C=e[0][v];var J=!0;switch(C[1][0]){case 4:J=!1;case 0:y=oa(" ",C[1][1]);break;case 5:J=!1;case 1:y=oa("\r",C[1][1]);break;default:if(y="",s.WTF)throw new Error("Unexpected PtgAttrSpaceType "+C[1][0])}o.push((J?y:"")+o.pop()+(J?"":y)),v=-1}}if(o.length>1&&s.WTF)throw new Error("bad formula stack");return o[0]}function K2e(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=sh(e,l,r);return t!==l+s&&(i=nh(e,t-l-s,o,r)),e.l=a,[o,i]}function q2e(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=sh(e,l,r);return t!==l+s&&(i=nh(e,t-l-s,o,r)),e.l=a,[o,i]}function W2e(e,t,r,a){var s=e.l+t,i=sh(e,a,r),l;return s!==e.l&&(l=nh(e,s-e.l,i,r)),[i,l]}function Y2e(e,t,r){var a=e.l+t,s,i=e.read_shift(2),l=sh(e,i,r);return i==65535?[[],Hn(e,t-2)]:(t!==i+2&&(s=nh(e,a-i-2,l,r)),[l,s])}function X2e(e){var t;if(io(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 J2e(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 Kd(e);return Kd(0)}function I2(e,t,r){var a=e.l+t,s=Tl(e);r.biff==2&&++e.l;var i=X2e(e),l=e.read_shift(1);r.biff!=2&&(e.read_shift(1),r.biff>=5&&e.read_shift(4));var o=q2e(e,a-e.l,r);return{cell:s,val:i[0],formula:o,shared:l>>3&1,tt:i[1]}}function Z2e(e,t,r,a,s){var i=Wd(t,r,s),l=J2e(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=Za([i,l,o,u]);return p}function fv(e,t,r){var a=e.read_shift(4),s=sh(e,a,r),i=e.read_shift(4),l=i>0?nh(e,i,s,r):null;return[s,l]}var eNe=fv,pv=fv,tNe=fv,rNe=fv,aNe={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"},tH={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"},nNe={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 sU(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 sNe(e){var t="of:="+e.replace(SE,"$1[.$2$3$4$5]").replace(/\]:\[/g,":");return t.replace(/;/g,"|").replace(/,/g,";")}function F2(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 iNe(e){return e.replace(/\./,"!")}var Mf={},NA={},Rf=typeof Map<"u";function TE(e,t,r){var a=0,s=e.length;if(r){if(Rf?r.has(t):Object.prototype.hasOwnProperty.call(r,t)){for(var i=Rf?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&&(Rf?(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=Np(t.wpx):t.wch!=null&&(a=t.wch),a>-1?(r.width=Xg(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 Fd(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 Kc(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){uo(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 rH(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=Rr(e.v)),(!a||a.cellText!==!1)&&e.t!=="z")try{if(vt[t]==null&&uo(age[t]||"General",t),e.t==="e")e.w=e.w||Oo[e.v];else if(t===0)if(e.t==="n")(e.v|0)===e.v?e.w=e.v.toString(10):e.w=xp(e.v);else if(e.t==="d"){var l=za(e.v);(l|0)===l?e.w=l.toString(10):e.w=xp(l)}else{if(e.v===void 0)return"";e.w=Vd(e.v,NA)}else e.t==="d"?e.w=ki(t,za(e.v),NA):e.w=ki(t,e.v,NA)}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=Yg(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=Yg(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 lNe(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 oNe(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 cNe=/<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g,dNe=/<(?:\w+:)?sheetData[^>]*>([\s\S]*)<\/(?:\w+:)?sheetData>/,uNe=/<(?:\w:)?hyperlink [^>]*>/mg,ANe=/"(\w*:\w*)"/,fNe=/<(?:\w:)?col\b[^>]*[\/]?>/g,pNe=/<(?:\w:)?autoFilter[^>]*([\/]|>([\s\S]*)<\/(?:\w:)?autoFilter)>/g,hNe=/<(?:\w:)?pageMargins[^>]*\/>/g,aH=/<(?:\w:)?sheetPr\b(?:[^>a-z][^>]*)?\/>/,xNe=/<(?:\w:)?sheetPr[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetPr)>/,mNe=/<(?:\w:)?sheetViews[^>]*(?:[\/]|>([\s\S]*)<\/(?:\w:)?sheetViews)>/;function gNe(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(dNe);p?(u=e.slice(0,p.index),f=e.slice(p.index+p[0].length)):u=f=e;var x=u.match(aH);x?IE(x[0],o,s,r):(x=u.match(xNe))&&vNe(x[0],x[1]||"",o,s,r);var m=(u.match(/<(?:\w*:)?dimension/)||{index:-1}).index;if(m>0){var b=u.slice(m,m+50).match(ANe);b&&oNe(o,b[1])}var v=u.match(mNe);v&&v[1]&&FNe(v[1],s);var y=[];if(t.cellStyles){var k=u.match(fNe);k&&SNe(y,k)}p&&MNe(p[1],o,t,d,i,l);var _=f.match(pNe);_&&(o["!autofilter"]=_Ne(_[0]));var C=[],E=f.match(cNe);if(E)for(m=0;m!=E.length;++m)C[m]=Yt(E[m].slice(E[m].indexOf('"')+1));var T=f.match(uNe);T&&kNe(o,T,a);var B=f.match(hNe);if(B&&(o["!margins"]=jNe(wt(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),C.length>0&&(o["!merges"]=C),o}function bNe(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 IE(e,t,r,a){var s=wt(e);r.Sheets[a]||(r.Sheets[a]={}),s.codeName&&(r.Sheets[a].CodeName=Wt(gr(s.codeName)))}function vNe(e,t,r,a,s){IE(e.slice(0,e.indexOf(">")),r,a,s)}function yNe(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||"")+qe("outlinePr",null,u)}!i&&!o||(s[s.length]=qe("sheetPr",o,l))}var wNe=["objects","scenarios","selectLockedCells","selectUnlockedCells"],NNe=["formatColumns","formatRows","formatCells","insertColumns","insertRows","insertHyperlinks","deleteColumns","deleteRows","sort","autoFilter","pivotTables"];function CNe(e){var t={sheet:1};return wNe.forEach(function(r){e[r]!=null&&e[r]&&(t[r]="1")}),NNe.forEach(function(r){e[r]!=null&&!e[r]&&(t[r]="0")}),e.password&&(t.password=kE(e.password).toString(16).toUpperCase()),qe("sheetProtection",null,t)}function kNe(e,t,r){for(var a=Array.isArray(e),s=0;s!=t.length;++s){var i=wt(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 jNe(e){var t={};return["left","right","top","bottom","header","footer"].forEach(function(r){e[r]&&(t[r]=parseFloat(e[r]))}),t}function ENe(e){return Fd(e),qe("pageMargins",null,e)}function SNe(e,t){for(var r=!1,a=0;a!=t.length;++a){var s=wt(t[a],!0);s.hidden&&(s.hidden=Ur(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,jE(s.width)),Dc(s);i<=l;)e[i++]=Or(s)}}function BNe(e,t){for(var r=["<cols>"],a,s=0;s!=t.length;++s)(a=t[s])&&(r[r.length]=qe("col",null,hv(s,a)));return r[r.length]="</cols>",r.join("")}function _Ne(e){var t={ref:(e.match(/ref="([^"]*)"/)||[])[1]};return t}function TNe(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=vs(s);l.s.r==l.e.r&&(l.e.r=vs(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}),qe("autoFilter",null,{ref:s})}var INe=/<(?:\w:)?sheetView(?:[^>a-z][^>]*)?\/?>/;function FNe(e,t){t.Views||(t.Views=[{}]),(e.match(INe)||[]).forEach(function(r,a){var s=wt(r);t.Views[a]||(t.Views[a]={}),+s.zoomScale&&(t.Views[a].zoom=+s.zoomScale),Ur(s.rightToLeft)&&(t.Views[a].RTL=!0)})}function DNe(e,t,r,a){var s={workbookViewId:"0"};return(((a||{}).Workbook||{}).Views||[])[0]&&(s.rightToLeft=a.Workbook.Views[0].RTL?"1":"0"),qe("sheetViews",qe("sheetView",null,s),{})}function UNe(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=Oo[e.v];break;case"d":a&&a.cellDates?s=Rr(e.v,-1).toISOString():(e=Or(e),e.t="n",s=""+(e.v=za(Rr(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=Kc(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",""+TE(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=qe("f",ur(e.f),f)+(e.v!=null?o:"")}return e.l&&r["!links"].push([t,e.l]),e.D&&(d.cm=1),qe("c",o,d)}var MNe=(function(){var e=/<(?:\w+:)?c[ \/>]/,t=/<\/(?:\w+:)?row>/,r=/r=["']([^"']*)["']/,a=/<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/,s=/ref=["']([^"']*)["']/,i=mp("v"),l=mp("f");return function(d,u,f,p,x,m){for(var b=0,v="",y=[],k=[],_=0,C=0,E=0,T="",B,F,M=0,U=0,D,L,P=0,G=0,H=Array.isArray(m.CellXf),Q,Y=[],K=[],ee=Array.isArray(u),J=[],W={},R=!1,O=!!f.sheetStubs,q=d.split(t),z=0,X=q.length;z!=X;++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=wt(v.slice(le,b),!0),M=F.r!=null?parseInt(F.r,10):M+1,U=-1,f.sheetRows&&f.sheetRows<M)continue;W={},R=!1,F.ht&&(R=!0,W.hpt=parseFloat(F.ht),W.hpx=UA(W.hpt)),F.hidden=="1"&&(R=!0,W.hidden=!0),F.outlineLevel!=null&&(R=!0,W.level=+F.outlineLevel),R&&(J[M-1]=W)}break;case"<":le=b;break}if(le>=b)break;if(F=wt(v.slice(le,b),!0),M=F.r!=null?parseInt(F.r,10):M+1,U=-1,!(f.sheetRows&&f.sheetRows<M)){p.s.r>M-1&&(p.s.r=M-1),p.e.r<M-1&&(p.e.r=M-1),f&&f.cellStyles&&(W={},R=!1,F.ht&&(R=!0,W.hpt=parseFloat(F.ht),W.hpx=UA(W.hpt)),F.hidden=="1"&&(R=!0,W.hidden=!0),F.outlineLevel!=null&&(R=!0,W.level=+F.outlineLevel),R&&(J[M-1]=W)),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(k=v.match(r),_=b,C=0,E=0,v="<c "+(v.slice(0,1)=="<"?">":"")+v,k!=null&&k.length===2){for(_=0,T=k[1],C=0;C!=T.length&&!((E=T.charCodeAt(C)-64)<1||E>26);++C)_=26*_+E;--_,U=_}else++U;for(C=0;C!=v.length&&v.charCodeAt(C)!==62;++C);if(++C,F=wt(v.slice(0,C),!0),F.r||(F.r=yt({r:M-1,c:U})),T=v.slice(C),B={t:""},(k=T.match(i))!=null&&k[1]!==""&&(B.v=Wt(k[1])),f.cellFormula){if((k=T.match(l))!=null&&k[1]!==""){if(B.f=Wt(gr(k[1])).replace(/\r\n/g,`
`),f.xlfn||(B.f=tU(B.f)),k[0].indexOf('t="array"')>-1)B.F=(T.match(s)||[])[1],B.F.indexOf(":")>-1&&Y.push([Yt(B.F),B.F]);else if(k[0].indexOf('t="shared"')>-1){L=wt(k[0]);var ae=Wt(gr(k[1]));f.xlfn||(ae=tU(ae)),K[parseInt(L.si,10)]=[L,ae,F.r]}}else(k=T.match(/<f[^>]*\/>/))&&(L=wt(k[0]),K[L.si]&&(B.f=Iwe(K[L.si][1],K[L.si][2],F.r)));var ie=Zr(F.r);for(C=0;C<Y.length;++C)ie.r>=Y[C][0].s.r&&ie.r<=Y[C][0].e.r&&ie.c>=Y[C][0].s.c&&ie.c<=Y[C][0].e.c&&(B.F=Y[C][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=Mf[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=dE(B.v));break;case"inlineStr":k=T.match(a),B.t="s",k!=null&&(D=CE(k[1]))?(B.v=D.t,f.cellHTML&&(B.h=D.h)):B.v="";break;case"b":B.v=Ur(B.v);break;case"d":f.cellDates?B.v=Rr(B.v,1):(B.v=za(Rr(B.v,1)),B.t="n");break;case"e":(!f||f.cellText!==!1)&&(B.w=B.v),B.v=s9[B.v];break}if(P=G=0,Q=null,H&&F.s!==void 0&&(Q=m.CellXf[F.s],Q!=null&&(Q.numFmtId!=null&&(P=Q.numFmtId),f.cellStyles&&Q.fillId!=null&&(G=Q.fillId))),rH(B,P,G,f,x,m),f.cellDates&&H&&B.t=="n"&&e0(vt[P])&&(B.t="d",B.v=uv(B.v)),F.cm&&f.xlmeta){var he=(f.xlmeta.Cell||[])[+F.cm-1];he&&he.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}}}}J.length>0&&(u["!rows"]=J)}})();function RNe(e,t,r,a){var s=[],i=[],l=Yt(e["!ref"]),o="",d,u="",f=[],p=0,x=0,m=e["!rows"],b=Array.isArray(e),v={r:u},y,k=-1;for(x=l.s.c;x<=l.e.c;++x)f[x]=Jr(x);for(p=l.s.r;p<=l.e.r;++p){for(i=[],u=va(p),x=l.s.c;x<=l.e.c;++x){d=f[x]+u;var _=b?(e[p]||[])[x]:e[d];_!==void 0&&(o=UNe(_,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),k=-1,y.hpx?k=Cp(y.hpx):y.hpt&&(k=y.hpt),k>-1&&(v.ht=k,v.customHeight=1),y.level&&(v.outlineLevel=y.level)),s[s.length]=qe("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),k=-1,y.hpx?k=Cp(y.hpx):y.hpt&&(k=y.hpt),k>-1&&(v.ht=k,v.customHeight=1),y.level&&(v.outlineLevel=y.level),s[s.length]=qe("row","",v));return s.join("")}function nH(e,t,r,a){var s=[wa,qe("worksheet",null,{xmlns:nu[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=[];yNe(d,r,e,t,s),s[s.length]=qe("dimension",null,{ref:u}),s[s.length]=DNe(d,t,e,r),t.sheetFormat&&(s[s.length]=qe("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]=BNe(d,d["!cols"])),s[l=s.length]="<sheetData/>",d["!links"]=[],d["!ref"]!=null&&(o=RNe(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]=CNe(d["!protect"])),d["!autofilter"]!=null&&(s[s.length]=TNe(d["!autofilter"],d,r,e)),d["!merges"]!=null&&d["!merges"].length>0&&(s[s.length]=bNe(d["!merges"]));var x=-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),(x=v[1].Target.indexOf("#"))>-1&&(m.location=ur(v[1].Target.slice(x+1))),v[1].Tooltip&&(m.tooltip=ur(v[1].Tooltip)),s[s.length]=qe("hyperlink",null,m))}),s[s.length]="</hyperlinks>"),delete d["!links"],d["!margins"]!=null&&(s[s.length]=ENe(d["!margins"])),(!t||t.ignoreEC||t.ignoreEC==null)&&(s[s.length]=yn("ignoredErrors",qe("ignoredError",null,{numberStoredAsText:1,sqref:u}))),p.length>0&&(b=cr(a,-1,"../drawings/drawing"+(e+1)+".xml",Ot.DRAW),s[s.length]=qe("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]=qe("legacyDrawing",null,{"r:id":"rId"+b}),d["!legacy"]=b),s.length>1&&(s[s.length]="</worksheet>",s[1]=s[1].replace("/>",">")),s.join("")}function ONe(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 PNe(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=Cp(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,x=-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),x=m)}p<0||(++o,a.write_shift(4,p),a.write_shift(4,x))}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 LNe(e,t,r,a){var s=PNe(a,r,t);(s.length>17||(t["!rows"]||[])[a])&&He(e,0,s)}var QNe=ou,HNe=a0;function zNe(){}function $Ne(e,t){var r={},a=e[e.l];return++e.l,r.above=!(a&64),r.left=!(a&128),e.l+=18,r.name=Kge(e),r}function VNe(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 Kg({auto:1},r),r.write_shift(-4,-1),r.write_shift(-4,-1),e9(e,r),r.slice(0,r.l)}function GNe(e){var t=Si(e);return[t]}function KNe(e,t,r){return r==null&&(r=Oe(8)),su(t,r)}function qNe(e){var t=iu(e);return[t]}function WNe(e,t,r){return r==null&&(r=Oe(4)),lu(t,r)}function YNe(e){var t=Si(e),r=e.read_shift(1);return[t,r,"b"]}function XNe(e,t,r){return r==null&&(r=Oe(9)),su(t,r),r.write_shift(1,e.v?1:0),r}function JNe(e){var t=iu(e),r=e.read_shift(1);return[t,r,"b"]}function ZNe(e,t,r){return r==null&&(r=Oe(5)),lu(t,r),r.write_shift(1,e.v?1:0),r}function eCe(e){var t=Si(e),r=e.read_shift(1);return[t,r,"e"]}function tCe(e,t,r){return r==null&&(r=Oe(9)),su(t,r),r.write_shift(1,e.v),r}function rCe(e){var t=iu(e),r=e.read_shift(1);return[t,r,"e"]}function aCe(e,t,r){return r==null&&(r=Oe(8)),lu(t,r),r.write_shift(1,e.v),r.write_shift(2,0),r.write_shift(1,0),r}function nCe(e){var t=Si(e),r=e.read_shift(4);return[t,r,"s"]}function sCe(e,t,r){return r==null&&(r=Oe(12)),su(t,r),r.write_shift(4,t.v),r}function iCe(e){var t=iu(e),r=e.read_shift(4);return[t,r,"s"]}function lCe(e,t,r){return r==null&&(r=Oe(8)),lu(t,r),r.write_shift(4,t.v),r}function oCe(e){var t=Si(e),r=On(e);return[t,r,"n"]}function cCe(e,t,r){return r==null&&(r=Oe(16)),su(t,r),Kd(e.v,r),r}function sH(e){var t=iu(e),r=On(e);return[t,r,"n"]}function dCe(e,t,r){return r==null&&(r=Oe(12)),lu(t,r),Kd(e.v,r),r}function uCe(e){var t=Si(e),r=bE(e);return[t,r,"n"]}function ACe(e,t,r){return r==null&&(r=Oe(12)),su(t,r),t9(e.v,r),r}function fCe(e){var t=iu(e),r=bE(e);return[t,r,"n"]}function pCe(e,t,r){return r==null&&(r=Oe(8)),lu(t,r),t9(e.v,r),r}function hCe(e){var t=Si(e),r=xE(e);return[t,r,"is"]}function xCe(e){var t=Si(e),r=Pn(e);return[t,r,"str"]}function mCe(e,t,r){return r==null&&(r=Oe(12+4*e.v.length)),su(t,r),tn(e.v,r),r.length>r.l?r.slice(0,r.l):r}function gCe(e){var t=iu(e),r=Pn(e);return[t,r,"str"]}function bCe(e,t,r){return r==null&&(r=Oe(8+4*e.v.length)),lu(t,r),tn(e.v,r),r.length>r.l?r.slice(0,r.l):r}function vCe(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=pv(e,a-e.l,r);l[3]=Dn(o,null,s,r.supbooks,r)}else e.l=a;return l}function yCe(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=pv(e,a-e.l,r);l[3]=Dn(o,null,s,r.supbooks,r)}else e.l=a;return l}function wCe(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=pv(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=Pn(e),l=[s,i,"str"];if(r.cellFormula){e.l+=2;var o=pv(e,a-e.l,r);l[3]=Dn(o,null,s,r.supbooks,r)}else e.l=a;return l}var CCe=ou,kCe=a0;function jCe(e,t){return t==null&&(t=Oe(4)),t.write_shift(4,e),t}function ECe(e,t){var r=e.l+t,a=ou(e),s=mE(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 SCe(e,t){var r=Oe(50+4*(e[1].Target.length+(e[1].Tooltip||"").length));a0({s:Zr(e[0]),e:Zr(e[0])},r),gE("rId"+t,r);var a=e[1].Target.indexOf("#"),s=a==-1?"":e[1].Target.slice(a+1);return tn(s||"",r),tn(e[1].Tooltip||"",r),tn("",r),r.slice(0,r.l)}function BCe(){}function _Ce(e,t,r){var a=e.l+t,s=r9(e),i=e.read_shift(1),l=[s];if(l[2]=i,r.cellFormula){var o=eNe(e,a-e.l,r);l[1]=o}else e.l=a;return l}function TCe(e,t,r){var a=e.l+t,s=ou(e),i=[s];if(r.cellFormula){var l=rNe(e,a-e.l,r);i[1]=l,e.l=a}else e.l=a;return i}function ICe(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 iH=["left","right","top","bottom","header","footer"];function FCe(e){var t={};return iH.forEach(function(r){t[r]=On(e)}),t}function DCe(e,t){return t==null&&(t=Oe(48)),Fd(e),iH.forEach(function(r){Kd(e[r],t)}),t}function UCe(e){var t=e.read_shift(2);return e.l+=28,{RTL:t&32}}function MCe(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 RCe(e){var t=Oe(24);return t.write_shift(4,4),t.write_shift(4,1),a0(e,t),t}function OCe(e,t){return t==null&&(t=Oe(66)),t.write_shift(2,e.password?kE(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 PCe(){}function LCe(){}function QCe(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,x=!1,m,b,v,y,k,_,C,E,T,B=[];o.biff=12,o["!row"]=0;var F=0,M=!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=[],H=[],Q=!1;kp[16]={n:"BrtShortReal",f:sH};var Y;if(Ro(e,function(J,W,R){if(!x)switch(R){case 148:u=J;break;case 0:m=J,o.sheetRows&&o.sheetRows<=m.r&&(x=!0),E=va(y=m.r),o["!row"]=m.r,(J.hidden||J.hpt||J.level!=null)&&(J.hpt&&(J.hpx=UA(J.hpt)),H[J.r]=J);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:J[2]},J[2]){case"n":b.v=J[1];break;case"s":C=Mf[J[1]],b.v=C.t,b.r=C.r;break;case"b":b.v=!!J[1];break;case"e":b.v=J[1],o.cellText!==!1&&(b.w=Oo[b.v]);break;case"str":b.t="s",b.v=J[1];break;case"is":b.t="s",b.v=J[1].t;break}if((v=l.CellXf[J[0].iStyleRef])&&rH(b,v.numFmtId,null,o,i,l),k=J[0].c==-1?k+1:J[0].c,o.dense?(d[y]||(d[y]=[]),d[y][k]=b):d[Jr(k)+E]=b,o.cellFormula){for(M=!1,F=0;F<U.length;++F){var O=U[F];m.r>=O[0].s.r&&m.r<=O[0].e.r&&k>=O[0].s.c&&k<=O[0].e.c&&(b.F=Tt(O[0]),M=!0)}!M&&J.length>3&&(b.f=J[3])}if(f.s.r>m.r&&(f.s.r=m.r),f.s.c>k&&(f.s.c=k),f.e.r<m.r&&(f.e.r=m.r),f.e.c<k&&(f.e.c=k),o.cellDates&&v&&b.t=="n"&&e0(vt[v.numFmtId])){var q=Cd(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))}Y&&(Y.type=="XLDAPR"&&(b.D=!0),Y=void 0);break;case 1:case 12:if(!o.sheetStubs||p)break;b={t:"z",v:void 0},k=J[0].c==-1?k+1:J[0].c,o.dense?(d[y]||(d[y]=[]),d[y][k]=b):d[Jr(k)+E]=b,f.s.r>m.r&&(f.s.r=m.r),f.s.c>k&&(f.s.c=k),f.e.r<m.r&&(f.e.r=m.r),f.e.c<k&&(f.e.c=k),Y&&(Y.type=="XLDAPR"&&(b.D=!0),Y=void 0);break;case 176:B.push(J);break;case 49:Y=((o.xlmeta||{}).Cell||[])[J-1];break;case 494:var z=a["!id"][J.relId];for(z?(J.Target=z.Target,J.loc&&(J.Target+="#"+J.loc),J.Rel=z):J.relId==""&&(J.Target="#"+J.loc),y=J.rfx.s.r;y<=J.rfx.e.r;++y)for(k=J.rfx.s.c;k<=J.rfx.e.c;++k)o.dense?(d[y]||(d[y]=[]),d[y][k]||(d[y][k]={t:"z",v:void 0}),d[y][k].l=J):(_=yt({c:k,r:y}),d[_]||(d[_]={t:"z",v:void 0}),d[_].l=J);break;case 426:if(!o.cellFormula)break;U.push(J),T=o.dense?d[y][k]:d[Jr(k)+E],T.f=Dn(J[1],f,{r:m.r,c:k},L,o),T.F=Tt(J[0]);break;case 427:if(!o.cellFormula)break;D[yt(J[0].s)]=J[1],T=o.dense?d[y][k]:d[Jr(k)+E],T.f=Dn(J[1],f,{r:m.r,c:k},L,o);break;case 60:if(!o.cellStyles)break;for(;J.e>=J.s;)G[J.e--]={width:J.w/256,hidden:!!(J.flags&1),level:J.level},Q||(Q=!0,jE(J.w/256)),Dc(G[J.e+1]);break;case 161:d["!autofilter"]={ref:Tt(J)};break;case 476:d["!margins"]=J;break;case 147:s.Sheets[r]||(s.Sheets[r]={}),J.name&&(s.Sheets[r].CodeName=J.name),(J.above||J.left)&&(d["!outline"]={above:J.above,left:J.left});break;case 137:s.Views||(s.Views=[{}]),s.Views[0]||(s.Views[0]={}),J.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(!W.T){if(!p||o.WTF)throw new Error("Unexpected record 0x"+R.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),H.length>0&&(d["!rows"]=H),d}function HCe(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=Or(t),t.z=t.z||vt[14],t.v=za(Rr(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=Kc(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=TE(s.Strings,t.v,s.revStrings),d.t="s",d.v=o,l?He(e,18,lCe(t,d)):He(e,7,sCe(t,d))):(d.t="str",l?He(e,17,bCe(t,d)):He(e,6,mCe(t,d))),!0;case"n":return t.v==(t.v|0)&&t.v>-1e3&&t.v<1e3?l?He(e,13,pCe(t,d)):He(e,2,ACe(t,d)):l?He(e,16,dCe(t,d)):He(e,5,cCe(t,d)),!0;case"b":return d.t="b",l?He(e,15,ZNe(t,d)):He(e,4,XNe(t,d)),!0;case"e":return d.t="e",l?He(e,14,aCe(t,d)):He(e,3,tCe(t,d)),!0}return l?He(e,12,WNe(t,d)):He(e,1,KNe(t,d)),!0}function zCe(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=va(f),LNe(e,t,s,f);var p=!1;if(f<=s.e.r)for(var x=s.s.c;x<=s.e.c;++x){f===s.s.r&&(o[x]=Jr(x)),i=o[x]+l;var m=d?(t[f]||[])[x]:t[i];if(!m){p=!1;continue}p=HCe(e,m,f,x,a,t,p)}}He(e,146)}function $Ce(e,t){!t||!t["!merges"]||(He(e,177,jCe(t["!merges"].length)),t["!merges"].forEach(function(r){He(e,176,kCe(r))}),He(e,178))}function VCe(e,t){!t||!t["!cols"]||(He(e,390),t["!cols"].forEach(function(r,a){r&&He(e,60,ICe(a,r))}),He(e,391))}function GCe(e,t){!t||!t["!ref"]||(He(e,648),He(e,649,RCe(Yt(t["!ref"]))),He(e,650))}function KCe(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,SCe(a,s))}}),delete t["!links"]}function qCe(e,t,r,a){if(t["!comments"].length>0){var s=cr(a,-1,"../drawings/vmlDrawing"+(r+1)+".vml",Ot.VML);He(e,551,gE("rId"+s)),t["!legacy"]=s}}function WCe(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=vs(i);o.s.r==o.e.r&&(o.e.r=vs(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,a0(Yt(i))),He(e,162)}}function YCe(e,t,r){He(e,133),He(e,137,MCe(t,r)),He(e,138),He(e,134)}function XCe(e,t){t["!protect"]&&He(e,535,OCe(t["!protect"]))}function JCe(e,t,r,a){var s=xs(),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,VNe(o,l["!outline"])),He(s,148,HNe(d)),YCe(s,l,r.Workbook),VCe(s,l),zCe(s,l,e,t),XCe(s,l),WCe(s,l,r,e),$Ce(s,l),KCe(s,l,a),l["!margins"]&&He(s,476,DCe(l["!margins"])),(!t||t.ignoreEC||t.ignoreEC==null)&&GCe(s,l),qCe(s,l,e,a),He(s,130),s.end()}function ZCe(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 eke(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 x=ZCe(p);f.s.r=f.s.c=0,f.e.c=o,u=Jr(o),x[0].forEach(function(m,b){l[u+va(b)]={t:"n",v:m,z:x[1]},d=b}),f.e.r<d&&(f.e.r=d),++o}),o>0&&(l["!ref"]=Tt(f)),l}function tke(e,t,r,a,s){if(!e)return e;a||(a={"!id":{}});var i={"!type":"chart","!drawel":null,"!rel":""},l,o=e.match(aH);return o&&IE(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 rke(e,t){e.l+=10;var r=Pn(e);return{name:r}}function ake(e,t,r,a,s){if(!e)return e;a||(a={"!id":{}});var i={"!type":"chart","!drawel":null,"!rel":""},l=!1;return Ro(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 FE=[["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"]],nke=[["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"]],ske=[],ike=[["calcCompleted","true"],["calcMode","auto"],["calcOnSave","true"],["concurrentCalc","true"],["fullCalcOnLoad","false"],["fullPrecision","true"],["iterate","false"],["iterateCount","100"],["iterateDelta","0.001"],["refMode","A1"]];function iU(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]]=Ur(a[i[0]]));break;case"int":typeof a[i[0]]=="string"&&(a[i[0]]=parseInt(a[i[0]],10));break}}}function lU(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]]=Ur(e[a[0]]));break;case"int":typeof e[a[0]]=="string"&&(e[a[0]]=parseInt(e[a[0]],10));break}}}function lH(e){lU(e.WBProps,FE),lU(e.CalcPr,ike),iU(e.WBView,nke),iU(e.Sheets,ske),NA.date1904=Ur(e.WBProps.date1904)}function lke(e){return!e.Workbook||!e.Workbook.WBProps?"false":Ur(e.Workbook.WBProps.date1904)?"true":"false"}var oke="][*?/\\".split("");function oH(e,t){if(e.length>31)throw new Error("Sheet names cannot exceed 31 chars");var r=!0;return oke.forEach(function(a){if(e.indexOf(a)!=-1)throw new Error("Sheet name cannot contain : \\ / ? * [ ]")}),r}function cke(e,t,r){e.forEach(function(a,s){oH(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 dke(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||[];cke(e.SheetNames,t,!!e.vbaraw);for(var r=0;r<e.SheetNames.length;++r)lNe(e.Sheets[e.SheetNames[r]],e.SheetNames[r],r)}var uke=/<\w+:workbook/;function Ake(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=wt(d);switch(_l(f[0])){case"<?xml":break;case"<workbook":d.match(uke)&&(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/>":FE.forEach(function(p){if(f[p[0]]!=null)switch(p[2]){case"bool":r.WBProps[p[0]]=Ur(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),Ur(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}),nu.indexOf(r.xmlns)===-1)throw new Error("Unknown Namespace: "+r.xmlns);return lH(r),r}function cH(e){var t=[wa];t[t.length]=qe("workbook",null,{xmlns:nu[0],"xmlns:r":Qa.r});var r=e.Workbook&&(e.Workbook.Names||[]).length>0,a={codeName:"ThisWorkbook"};e.Workbook&&e.Workbook.WBProps&&(FE.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]=qe("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]=qe("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]=qe("definedName",ur(o.Ref),d))}),t[t.length]="</definedNames>"),t.length>2&&(t[t.length]="</workbook>",t[1]=t[1].replace("/>",">")),t.join("")}function fke(e,t){var r={};return r.Hidden=e.read_shift(4),r.iTabID=e.read_shift(4),r.strRelID=wC(e),r.name=Pn(e),r}function pke(e,t){return t||(t=Oe(127)),t.write_shift(4,e.Hidden),t.write_shift(4,e.iTabID),gE(e.strRelID,t),tn(e.name.slice(0,31),t),t.length>t.l?t.slice(0,t.l):t}function hke(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 xke(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),e9(e&&e.CodeName||"ThisWorkbook",t),t.slice(0,t.l)}function mke(e,t){var r={};return e.read_shift(4),r.ArchID=e.read_shift(4),e.l+=t-8,r}function gke(e,t,r){var a=e.l+t;e.l+=4,e.l+=1;var s=e.read_shift(4),i=qge(e),l=tNe(e,0,r),o=mE(e);e.l=a;var d={Name:i,Ptg:l};return s<268435455&&(d.Sheet=s),o&&(d.Comment=o),d}function bke(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=[],kp[16]={n:"BrtFRTArchID$",f:mke},Ro(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),lH(r),r.Names=i,r.supbooks=l,r}function vke(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,pke(s))}He(e,144)}function yke(e,t){t||(t=Oe(127));for(var r=0;r!=4;++r)t.write_shift(4,0);return tn("SheetJS",t),tn(Lg.version,t),tn(Lg.version,t),tn("7262",t),t.length>t.l?t.slice(0,t.l):t}function wke(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 Nke(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,wke(s)),He(e,136))}}function Cke(e,t){var r=xs();return He(r,131),He(r,128,yke()),He(r,153,xke(e.Workbook&&e.Workbook.WBProps||null)),Nke(r,e),vke(r,e),He(r,132),r.end()}function kke(e,t,r){return t.slice(-4)===".bin"?bke(e,r):Ake(e,r)}function jke(e,t,r,a,s,i,l,o){return t.slice(-4)===".bin"?QCe(e,a,r,s,i,l,o):gNe(e,a,r,s,i,l,o)}function Eke(e,t,r,a,s,i,l,o){return t.slice(-4)===".bin"?ake(e,a,r,s,i):tke(e,a,r,s,i)}function Ske(e,t,r,a,s,i,l,o){return t.slice(-4)===".bin"?_we():Twe()}function Bke(e,t,r,a,s,i,l,o){return t.slice(-4)===".bin"?Swe():Bwe()}function _ke(e,t,r,a){return t.slice(-4)===".bin"?kye(e,r,a):fye(e,r,a)}function Tke(e,t,r){return z9(e,r)}function Ike(e,t,r){return t.slice(-4)===".bin"?I1e(e,r):B1e(e,r)}function Fke(e,t,r){return t.slice(-4)===".bin"?Nwe(e,r):pwe(e,r)}function Dke(e,t,r){return t.slice(-4)===".bin"?uwe(e):cwe(e)}function Uke(e,t,r,a){return r.slice(-4)===".bin"?Awe(e,t,r,a):void 0}function Mke(e,t,r){return t.slice(-4)===".bin"?iwe(e,t,r):owe(e,t,r)}function Rke(e,t,r){return(t.slice(-4)===".bin"?Cke:cH)(e)}function Oke(e,t,r,a,s){return(t.slice(-4)===".bin"?JCe:nH)(e,r,a,s)}function Pke(e,t,r){return(t.slice(-4)===".bin"?Uye:Q9)(e,r)}function Lke(e,t,r){return(t.slice(-4)===".bin"?U1e:F9)(e,r)}function Qke(e,t,r){return(t.slice(-4)===".bin"?Cwe:G9)(e)}function Hke(e){return(e.slice(-4)===".bin"?lwe:$9)()}var dH=/([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g,uH=/([\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(dH),i,l,o,d;if(s)for(d=0;d!=s.length;++d)i=s[d].match(uH),(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 zke(e){var t=e.split(/\s+/),r={};if(t.length===1)return r;var a=e.match(dH),s,i,l,o;if(a)for(o=0;o!=a.length;++o)s=a[o].match(uH),(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 Of;function $ke(e,t){var r=Of[e]||Wt(e);return r==="General"?Vd(t):ki(r,t)}function Vke(e,t,r,a){var s=a;switch((r[0].match(/dt:dt="([\w.]+)"/)||["",""])[1]){case"boolean":s=Ur(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=Rr(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 Gke(e,t,r){if(e.t!=="z"){if(!r||r.cellText!==!1)try{e.t==="e"?e.w=e.w||Oo[e.v]:t==="General"?e.t==="n"?(e.v|0)===e.v?e.w=e.v.toString(10):e.w=xp(e.v):e.w=Vd(e.v):e.w=$ke(t||"General",e.v)}catch(i){if(r.WTF)throw i}try{var a=Of[t]||t||"General";if(r.cellNF&&(e.z=a),r.cellDates&&e.t=="n"&&e0(a)){var s=Cd(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 Kke(e,t,r){if(r.cellStyles&&t.Interior){var a=t.Interior;a.Pattern&&(a.patternType=sye[a.Pattern]||a.Pattern)}e[t.ID]=t}function qke(e,t,r,a,s,i,l,o,d,u){var f="General",p=a.StyleID,x={};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=Ur(e);break;case"String":a.t="s",a.r=CD(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=(Rr(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=s9[e],u.cellText!==!1&&(a.w=e);break;default:e==""&&t==""?a.t="z":(a.t="s",a.v=CD(t||e));break}if(Gke(a,f,u),u.cellFormula!==!1)if(a.Formula){var v=Wt(a.Formula);v.charCodeAt(0)==61&&(v=v.slice(1)),a.f=wA(v,s),delete a.Formula,a.ArrayRange=="RC"?a.F=wA("RC:RC",s):a.ArrayRange&&(a.F=wA(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){!x.patternType&&y.patternType&&(x.patternType=y.patternType)}),a.s=x),a.StyleID!==void 0&&(a.ixfe=a.StyleID)}function Wke(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 D2(e,t){var r=t||{};t0();var a=vf(uE(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=Or(r);return l.type="string",DA.to_workbook(a,l)}if(s.indexOf("<?xml")==-1&&["html","table","head","meta","script","style","div"].forEach(function(Me){s.indexOf("<"+Me)>=0&&(i=!0)}),i)return Dje(a,r);Of={"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=[],x=r.dense?[]:{},m="",b={},v={},y=Di('<Data ss:Type="String">'),k=0,_=0,C=0,E={s:{r:2e6,c:2e6},e:{r:0,c:0}},T={},B={},F="",M=0,U=[],D={},L={},P=0,G=[],H=[],Q={},Y=[],K,ee=!1,J=[],W=[],R={},O=0,q=0,z={Sheets:[],WBProps:{date1904:!1}},X={};bp.lastIndex=0,a=a.replace(/<!--([\s\S]*?)-->/mg,"");for(var re="";o=bp.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]==="/"?qke(a.slice(k,o.index),F,y,d[d.length-1][0]=="comment"?Q:b,{c:_,r:C},T,Y[_],v,J,r):(F="",y=Di(o[0]),k=o.index+o[0].length);break;case"cell":if(o[1]==="/")if(H.length>0&&(b.c=H),(!r.sheetRows||r.sheetRows>C)&&b.v!==void 0&&(r.dense?(x[C]||(x[C]=[]),x[C][_]=b):x[Jr(_)+va(C)]=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=C+(parseInt(b.MergeDown,10)|0),U.push({s:{c:_,r:C},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=C;ne<=q;++ne)(le>_||ne>C)&&(r.dense?(x[ne]||(x[ne]=[]),x[ne][le]={t:"z"}):x[Jr(le)+va(ne)]={t:"z"});_=O+1}else++_;else b=zke(o[0]),b.Index&&(_=+b.Index-1),_<E.s.c&&(E.s.c=_),_>E.e.c&&(E.e.c=_),o[0].slice(-2)==="/>"&&++_,H=[];break;case"row":o[1]==="/"||o[0].slice(-2)==="/>"?(C<E.s.r&&(E.s.r=C),C>E.e.r&&(E.e.r=C),o[0].slice(-2)==="/>"&&(v=Di(o[0]),v.Index&&(C=+v.Index-1)),_=0,++C):(v=Di(o[0]),v.Index&&(C=+v.Index-1),R={},(v.AutoFitHeight=="0"||v.Height)&&(R.hpx=parseInt(v.Height,10),R.hpt=Cp(R.hpx),W[C]=R),v.Hidden=="1"&&(R.hidden=!0,W[C]=R));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&&(x["!ref"]=Tt(E),r.sheetRows&&r.sheetRows<=E.e.r&&(x["!fullref"]=x["!ref"],E.e.r=r.sheetRows-1,x["!ref"]=Tt(E))),U.length&&(x["!merges"]=U),Y.length>0&&(x["!cols"]=Y),W.length>0&&(x["!rows"]=W),f[m]=x}else E={s:{r:2e6,c:2e6},e:{r:0,c:0}},C=_=0,d.push([o[3],!1]),u=Di(o[0]),m=Wt(u.Name),x=r.dense?[]:{},U=[],J=[],W=[],X={name:m,Hidden:0},z.Sheets.push(X);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]),Y=[],ee=!1}break;case"style":o[1]==="/"?Kke(T,B,r):B=Di(o[0]);break;case"numberformat":B.nf=Wt(Di(o[0]).Format||"General"),Of[B.nf]&&(B.nf=Of[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){uo(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=P9;for(var ie=0;ie<Y.length;++ie)Y[ie]&&Dc(Y[ie])}ee&&Dc(K),Y[K.Index-1||Y.length]=K;for(var he=0;he<+K.Span;++he)Y[Y.length]=Or(K);break;case"namedrange":if(o[1]==="/")break;z.Names||(z.Names=[]);var Z=wt(o[0]),Ue={Name:Z.Name,Ref:wA(Z.RefersTo.slice(1),{r:0,c:0})};z.Sheets.length>0&&(Ue.Sheet=z.Sheets.length-1),z.Names.push(Ue);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(M,o.index):M=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]==="/"?bbe(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("|"));Wke(Q),H.push(Q)}else d.push([o[3],!1]),u=Di(o[0]),Q={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 Ie=Di(o[0]);x["!autofilter"]={ref:wA(Ie.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 AU(a,r);var be=!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:be=!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:be=!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:be=!1}break;case"workbookoptions":switch(o[3]){case"owcversion":break;case"height":break;case"width":break;default:be=!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":X.Hidden=1;break;case"SheetVeryHidden":X.Hidden=2;break}else P=o.index+o[0].length;break;case"header":x["!margins"]||Fd(x["!margins"]={},"xlml"),isNaN(+wt(o[0]).Margin)||(x["!margins"].header=+wt(o[0]).Margin);break;case"footer":x["!margins"]||Fd(x["!margins"]={},"xlml"),isNaN(+wt(o[0]).Margin)||(x["!margins"].footer=+wt(o[0]).Margin);break;case"pagemargins":var je=wt(o[0]);x["!margins"]||Fd(x["!margins"]={},"xlml"),isNaN(+je.Top)||(x["!margins"].top=+je.Top),isNaN(+je.Left)||(x["!margins"].left=+je.Left),isNaN(+je.Right)||(x["!margins"].right=+je.Right),isNaN(+je.Bottom)||(x["!margins"].bottom=+je.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":x["!outline"]||(x["!outline"]={}),x["!outline"].above=!0;break;case"tabcolorindex":break;case"donotdisplayheadings":break;case"showpagelayoutzoom":break;case"nosummarycolumnsrightdetail":x["!outline"]||(x["!outline"]={}),x["!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:be=!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:be=!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:be=!1}break;case"autofilter":switch(o[3]){case"autofiltercolumn":break;case"autofiltercondition":break;case"autofilterand":break;case"autofilteror":break;default:be=!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:be=!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:be=!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:be=!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:be=!1}break;case"smarttags":break;default:be=!1;break}if(be||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]==="/"?Vke(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=Or(vt),fe.Props=D,fe.Custprops=L,fe}function BC(e,t){switch(UE(t=t||{}),t.type||"base64"){case"base64":return D2($s(e),t);case"binary":case"buffer":case"file":return D2(e,t);case"array":return D2(Vc(e),t)}}function Yke(e,t){var r=[];return e.Props&&r.push(vbe(e.Props,t)),e.Custprops&&r.push(ybe(e.Props,e.Custprops)),r.join("")}function Xke(){return""}function Jke(e,t){var r=['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];return t.cellXfs.forEach(function(a,s){var i=[];i.push(qe("NumberFormat",null,{"ss:Format":ur(vt[a.numFmtId])}));var l={"ss:ID":"s"+(21+s)};r.push(qe("Style",i.join(""),l))}),qe("Styles",r.join(""))}function AH(e){return qe("NamedRange",null,{"ss:Name":e.Name,"ss:RefersTo":"="+BE(e.Ref,{r:0,c:0})})}function Zke(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(AH(s)))}return qe("Names",r.join(""))}function eje(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(AH(o)))}return i.join("")}function tje(e,t,r,a){if(!e)return"";var s=[];if(e["!margins"]&&(s.push("<PageSetup>"),e["!margins"].header&&s.push(qe("Header",null,{"x:Margin":e["!margins"].header})),e["!margins"].footer&&s.push(qe("Footer",null,{"x:Margin":e["!margins"].footer})),s.push(qe("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(qe("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?"":qe("WorksheetOptions",s.join(""),{xmlns:Ds.x})}function rje(e){return e.map(function(t){var r=Nge(t.t||""),a=qe("ss:Data",r,{xmlns:"http://www.w3.org/TR/REC-html40"});return qe("Comment",a,{"ss:Author":t.a})}).join("")}function aje(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(BE(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="",x="";switch(e.t){case"z":if(!a.sheetStubs)return"";break;case"n":p="Number",x=String(e.v);break;case"b":p="Boolean",x=e.v?"1":"0";break;case"e":p="Error",x=Oo[e.v];break;case"d":p="DateTime",x=new Date(e.v).toISOString(),e.z==null&&(e.z=e.z||vt[14]);break;case"s":p="String",x=wge(e.v||"");break}var m=Kc(a.cellXfs,e,a);o["ss:StyleID"]="s"+(21+m),o["ss:Index"]=l.c+1;var b=e.v!=null?x:"",v=e.t=="z"?"":'<Data ss:Type="'+p+'">'+b+"</Data>";return(e.c||[]).length>0&&(v+=rje(e.c)),qe("Cell",v,o)}function nje(e,t){var r='<Row ss:Index="'+(e+1)+'"';return t&&(t.hpt&&!t.hpx&&(t.hpx=UA(t.hpt)),t.hpx&&(r+=' ss:AutoFitHeight="0" ss:Height="'+t.hpx+'"'),t.hidden&&(r+=' ss:Hidden="1"')),r+">"}function sje(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,k){Dc(y);var _=!!y.width,C=hv(k,y),E={"ss:Index":k+1};_&&(E["ss:Width"]=wp(C.width)),y.hidden&&(E["ss:Hidden"]="1"),o.push(qe("Column",null,E))});for(var d=Array.isArray(e),u=s.s.r;u<=s.e.r;++u){for(var f=[nje(u,(e["!rows"]||[])[u])],p=s.s.c;p<=s.e.c;++p){var x=!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)&&(x=!0);break}if(!x){var m={r:u,c:p},b=yt(m),v=d?(e[u]||[])[p]:e[b];f.push(aje(v,b,e,t,r,a,m))}}f.push("</Row>"),f.length>2&&o.push(f.join(""))}return o.join("")}function ije(e,t,r){var a=[],s=r.SheetNames[e],i=r.Sheets[s],l=i?eje(i,t,e,r):"";return l.length>0&&a.push("<Names>"+l+"</Names>"),l=i?sje(i,t,e,r):"",l.length>0&&a.push("<Table>"+l+"</Table>"),a.push(tje(i,t,e,r)),a.join("")}function lje(e,t){t||(t={}),e.SSF||(e.SSF=Or(vt)),e.SSF&&(t0(),ov(e.SSF),t.revssf=dv(e.SSF),t.revssf[e.SSF[65535]]=0,t.ssf=e.SSF,t.cellXfs=[],Kc(t.cellXfs,{},{revssf:{General:0}}));var r=[];r.push(Yke(e,t)),r.push(Xke()),r.push(""),r.push("");for(var a=0;a<e.SheetNames.length;++a)r.push(qe("Worksheet",ije(a,t,e),{"ss:Name":ur(e.SheetNames[a])}));return r[2]=Jke(e,t),r[3]=Zke(e),wa+qe("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 oje(e){var t={},r=e.content;if(r.l=28,t.AnsiUserType=r.read_shift(0,"lpstr-ansi"),t.AnsiClipboardFormat=Zge(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=ebe(r),a=r.read_shift(4),a==0||a>40))return t;r.l-=4,t.Reserved2=r.read_shift(0,"lpwstr")}var cje=[60,1084,2066,2165,2175];function dje(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=io(r,r.l),u=_C[d],f=0;u!=null&&cje.indexOf(d)>-1;)i=io(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=_C[d=io(r,r.l)];var p=Za(l);vn(p,0);var x=0;p.lens=[];for(var m=0;m<l.length;++m)p.lens.push(x),x+=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||Oo[e.v]:a===0||a=="General"?e.t==="n"?(e.v|0)===e.v?e.w=e.v.toString(10):e.w=xp(e.v):e.w=Vd(e.v):e.w=ki(a,e.v,{date1904:!!r,dateNF:t&&t.dateNF})}catch(i){if(t.WTF)throw i}if(t.cellDates&&a&&e.t=="n"&&e0(vt[a]||String(a))){var s=Cd(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 Yx(e,t,r){return{v:e,ixfe:t,t:r}}function uje(e,t){var r={opts:{}},a={},s=t.dense?[]:{},i={},l={},o=null,d=[],u="",f={},p,x="",m,b,v,y,k={},_=[],C,E,T=[],B=[],F={Sheets:[],WBProps:{date1904:!1},Views:[{}]},M={},U=function(st){return st<8?_d[st]:st<64&&B[st-8]||_d[st]},D=function(st,Rt,Et){var jt=Rt.XF.data;if(!(!jt||!jt.patternType||!Et||!Et.cellStyles)){Rt.s={},Rt.s.patternType=jt.patternType;var Kt;(Kt=yp(U(jt.icvFore)))&&(Rt.s.fgColor={rgb:Kt}),(Kt=yp(U(jt.icvBack)))&&(Rt.s.bgColor={rgb:Kt})}},L=function(st,Rt,Et){if(!(R>1)&&!(Et.sheetRows&&st.r>=Et.sheetRows)){if(Et.cellStyles&&Rt.XF&&Rt.XF.data&&D(st,Rt,Et),delete Rt.ixfe,delete Rt.XF,p=st,x=yt(st),(!l||!l.s||!l.e)&&(l={s:{r:0,c:0},e:{r:0,c:0}}),st.r<l.s.r&&(l.s.r=st.r),st.c<l.s.c&&(l.s.c=st.c),st.r+1>l.e.r&&(l.e.r=st.r+1),st.c+1>l.e.c&&(l.e.c=st.c+1),Et.cellFormula&&Rt.f){for(var jt=0;jt<_.length;++jt)if(!(_[jt][0].s.c>st.c||_[jt][0].s.r>st.r)&&!(_[jt][0].e.c<st.c||_[jt][0].e.r<st.r)){Rt.F=Tt(_[jt][0]),(_[jt][0].s.c!=st.c||_[jt][0].s.r!=st.r)&&delete Rt.f,Rt.f&&(Rt.f=""+Dn(_[jt][1],l,st,J,P));break}}Et.dense?(s[st.r]||(s[st.r]=[]),s[st.r][st.c]=Rt):s[x]=Rt}},P={enc:!1,sbcch:0,snames:[],sharedf:k,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,H=[],Q=[],Y=[],K=[],ee=!1,J=[];J.SheetNames=P.snames,J.sharedf=P.sharedf,J.arrayf=P.arrayf,J.names=[],J.XTI=[];var W=0,R=0,O=0,q=[],z=[],X;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&&W===10)break;var ae=e.l===e.length?0:e.read_shift(2),ie=_C[ne];if(ie&&ie.f){if(t.bookSheets&&W===133&&ne!==133)break;if(W=ne,ie.r===2||ie.r==12){var he=e.read_shift(2);if(ae-=2,!P.enc&&he!==ne&&((he&255)<<8|he>>8)!==ne)throw new Error("rt mismatch: "+he+"!="+ne);ie.r==12&&(e.l+=10,ae-=10)}var Z={};if(ne===10?Z=ie.f(e,ae,P):Z=dje(ne,ie,e,ae,P),R==0&&[9,521,1033,2057].indexOf(W)===-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 Ue=Number(Z);switch(Ue){case 21010:Ue=1200;break;case 32768:Ue=1e4;break;case 32769:Ue=1252;break}Pi(P.codepage=Ue),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:J.push([Z]),J[J.length-1].XTI=[];break;case 35:case 547:J[J.length-1].push(Z);break;case 24:case 536:X={Name:Z.Name,Ref:Dn(Z.rgce,l,null,J,P)},Z.itab>0&&(X.Sheet=Z.itab-1),J.names.push(X),J[0]||(J[0]=[],J[0].XTI=[]),J[J.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:J.length==0&&(J[0]=[],J[0].XTI=[]),J[J.length-1].XTI=J[J.length-1].XTI.concat(Z),J.XTI=J.XTI.concat(Z);break;case 2196:if(P.biff<8)break;X!=null&&(X.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(--R)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 Ie=l.e.r;l.e.r=t.sheetRows-1,s["!fullref"]=s["!ref"],s["!ref"]=Tt(l),l.e.r=Ie}l.e.r++,l.e.c++}H.length>0&&(s["!merges"]=H),Q.length>0&&(s["!objects"]=Q),Y.length>0&&(s["!cols"]=Y),K.length>0&&(s["!rows"]=K),F.Sheets.push(M)}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),R++)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 be={pos:e.l-ae,name:u};i[be.pos]=be,P.snames.push(u)}else u=(i[le]||{name:""}).name;Z.dt==32&&(s["!type"]="chart"),Z.dt==64&&(s["!type"]="macro"),H=[],Q=[],P.arrayf=_=[],Y=[],K=[],ee=!1,M={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,C={ixfe:Z.ixfe,XF:T[Z.ixfe]||{},v:Z.val,t:"n"},O>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:Z.c,r:Z.r},C,t);break;case 5:case 517:C={ixfe:Z.ixfe,XF:T[Z.ixfe],v:Z.val,t:Z.t},O>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:Z.c,r:Z.r},C,t);break;case 638:C={ixfe:Z.ixfe,XF:T[Z.ixfe],v:Z.rknum,t:"n"},O>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:Z.c,r:Z.r},C,t);break;case 189:for(var je=Z.c;je<=Z.C;++je){var fe=Z.rkrec[je-Z.c][0];C={ixfe:fe,XF:T[fe],v:Z.rkrec[je-Z.c][1],t:"n"},O>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:je,r:Z.r},C,t)}break;case 6:case 518:case 1030:{if(Z.val=="String"){o=Z;break}if(C=Yx(Z.val,Z.cell.ixfe,Z.tt),C.XF=T[C.ixfe],t.cellFormula){var Me=Z.formula;if(Me&&Me[0]&&Me[0][0]&&Me[0][0][0]=="PtgExp"){var Xe=Me[0][0][1][0],it=Me[0][0][1][1],at=yt({r:Xe,c:it});k[at]?C.f=""+Dn(Z.formula,l,Z.cell,J,P):C.F=((t.dense?(s[Xe]||[])[it]:s[at])||{}).F}else C.f=""+Dn(Z.formula,l,Z.cell,J,P)}O>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L(Z.cell,C,t),o=Z}break;case 7:case 519:if(o)o.val=Z,C=Yx(Z,o.cell.ixfe,"s"),C.XF=T[C.ixfe],t.cellFormula&&(C.f=""+Dn(o.formula,l,o.cell,J,P)),O>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L(o.cell,C,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],J,P),m.F=Tt(Z[0])}}break;case 1212:{if(!t.cellFormula)break;if(x){if(!o)break;k[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,J,P)}}break;case 253:C=Yx(d[Z.isst].t,Z.ixfe,"s"),d[Z.isst].h&&(C.h=d[Z.isst].h),C.XF=T[C.ixfe],O>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:Z.c,r:Z.r},C,t);break;case 513:t.sheetStubs&&(C={ixfe:Z.ixfe,XF:T[Z.ixfe],t:"z"},O>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:Z.c,r:Z.r},C,t));break;case 190:if(t.sheetStubs)for(var kt=Z.c;kt<=Z.C;++kt){var ft=Z.ixfe[kt-Z.c];C={ixfe:ft,XF:T[ft],t:"z"},O>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:kt,r:Z.r},C,t)}break;case 214:case 516:case 4:C=Yx(Z.val,Z.ixfe,"s"),C.XF=T[C.ixfe],O>0&&(C.z=q[C.ixfe>>8&63]),cl(C,t,r.opts.Date1904),L({c:Z.c,r:Z.r},C,t);break;case 0:case 512:R===1&&(l=Z);break;case 252:d=Z;break;case 1054:if(P.biff==4){q[O++]=Z[1];for(var Br=0;Br<O+163&&vt[Br]!=Z[1];++Br);Br>=163&&uo(Z[1],O+163)}else uo(Z[1],Z[0]);break;case 30:{q[O++]=Z;for(var Ar=0;Ar<O+163&&vt[Ar]!=Z;++Ar);Ar>=163&&uo(Z,O+163)}break;case 229:H=H.concat(Z);break;case 93:Q[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 fa=Q[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:fa.TxO.t},m.c.push(b)}break;case 2173:Jye(T[Z.ixfe],Z.ext);break;case 125:{if(!P.cellStyles)break;for(;Z.e>=Z.s;)Y[Z.e--]={width:Z.w/256,level:Z.level||0,hidden:!!(Z.flags&1)},ee||(ee=!0,jE(Z.w/256)),Dc(Y[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=UA(Z.hpt))}break;case 38:case 39:case 40:case 41:s["!margins"]||Fd(s["!margins"]={}),s["!margins"][{38:"left",39:"right",40:"top",41:"bottom"}[ne]]=Z;break;case 161:s["!margins"]||Fd(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?M.CodeName=Z||M.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=Aa(i).sort(function(_r,st){return Number(_r)-Number(st)}).map(function(_r){return i[_r].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(_r,st){r.Sheets[r.SheetNames[st]]["!autofilter"]=_r}),r.Strings=d,r.SSF=Or(vt),P.enc&&(r.Encryption=P.enc),G&&(r.Themes=G),r.Metadata={},E!==void 0&&(r.Metadata.Country=E),J.names.length>0&&(F.Names=J.names),r.Workbook=F,r}var Pf={SI:"e0859ff2f94f6810ab9108002b27b3d9",DSI:"02d5cdd59c2e1b10939708002b2cf9ae",UDI:"05d5cdd59c2e1b10939708002b2cf9ae"};function Aje(e,t,r){var a=ht.find(e,"/!DocumentSummaryInformation");if(a&&a.size>0)try{var s=HD(a,NC,Pf.DSI);for(var i in s)t[i]=s[i]}catch(u){if(r.WTF)throw u}var l=ht.find(e,"/!SummaryInformation");if(l&&l.size>0)try{var o=HD(l,CC,Pf.SI);for(var d in o)t[d]==null&&(t[d]=o[d])}catch(u){if(r.WTF)throw u}t.HeadingPairs&&t.TitlesOfParts&&(u9(t.HeadingPairs,t.TitlesOfParts,t,r),delete t.HeadingPairs,delete t.TitlesOfParts)}function fje(e,t){var r=[],a=[],s=[],i=0,l,o=gD(NC,"n"),d=gD(CC,"n");if(e.Props)for(l=Aa(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=Aa(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)g9.indexOf(s[i][0])>-1||d9.indexOf(s[i][0])>-1||s[i][1]!=null&&u.push(s[i]);a.length&&ht.utils.cfb_add(t,"/SummaryInformation",zD(a,Pf.SI,d,CC)),(r.length||u.length)&&ht.utils.cfb_add(t,"/DocumentSummaryInformation",zD(r,Pf.DSI,o,NC,u.length?u:null,Pf.UDI))}function fH(e,t){t||(t={}),UE(t),rE(),t.codepage&&tE(t.codepage);var r,a;if(e.FullPaths){if(ht.find(e,"/encryption"))throw new Error("File is password-protected");r=ht.find(e,"!CompObj"),a=ht.find(e,"/Workbook")||ht.find(e,"/Book")}else{switch(t.type){case"base64":e=Rs($s(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&&oje(r),t.bookProps&&!t.bookSheets)s={};else{var l=Mt?"buffer":"array";if(a&&a.content)s=uje(a.content,t);else if((i=ht.find(e,"PerfectOffice_MAIN"))&&i.content)s=Id.to_workbook(i.content,(t.type=l,t));else if((i=ht.find(e,"NativeContent_MAIN"))&&i.content)s=Id.to_workbook(i.content,(t.type=l,t));else throw(i=ht.find(e,"MN0"))&&i.content?new Error("Unsupported Works 4 for Mac file"):new Error("Cannot find Workbook stream");t.bookVBA&&e.FullPaths&&ht.find(e,"/_VBA_PROJECT_CUR/VBA/dir")&&(s.vbaraw=jwe(e))}var o={};return e.FullPaths&&Aje(e,o,t),s.Props=s.Custprops=o,t.bookFiles&&(s.cfb=e),s}function pje(e,t){var r=t||{},a=ht.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 ht.utils.cfb_add(a,s,pH(e,r)),r.biff==8&&(e.Props||e.Custprops)&&fje(e,a),r.biff==8&&e.vbaraw&&Ewe(a,ht.read(e.vbaraw,{type:typeof e.vbaraw=="string"?"binary":"buffer"})),a}var kp={0:{f:ONe},1:{f:GNe},2:{f:uCe},3:{f:eCe},4:{f:YNe},5:{f:oCe},6:{f:xCe},7:{f:nCe},8:{f:NCe},9:{f:wCe},10:{f:vCe},11:{f:yCe},12:{f:qNe},13:{f:fCe},14:{f:rCe},15:{f:JNe},16:{f:sH},17:{f:gCe},18:{f:iCe},19:{f:xE},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:gke},40:{},42:{},43:{f:xye},44:{f:pye},45:{f:bye},46:{f:yye},47:{f:vye},48:{},49:{f:Qge},50:{},51:{f:twe},52:{T:1},53:{T:-1},54:{T:1},55:{T:-1},56:{T:1},57:{T:-1},58:{},59:{},60:{f:B9},62:{f:hCe},63:{f:dwe},64:{f:PCe},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:UCe},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:$Ne},148:{f:QNe,p:16},151:{f:BCe},152:{},153:{f:hke},154:{},155:{},156:{f:fke},157:{},158:{},159:{T:1,f:T1e},160:{T:-1},161:{T:1,f:ou},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:CCe},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:Zye},336:{T:-1},337:{f:nwe,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:wC},357:{},358:{},359:{},360:{T:1},361:{},362:{f:S9},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:_Ce},427:{f:TCe},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:FCe},477:{},478:{},479:{T:1},480:{T:-1},481:{T:1},482:{T:-1},483:{T:1},484:{T:-1},485:{f:zNe},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:ECe},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:wC},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:ywe},633:{T:1},634:{T:-1},635:{T:1,f:bwe},636:{T:-1},637:{f:Vge},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:rke},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:LCe},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:""}},_C={6:{f:I2},10:{f:dc},12:{f:_a},13:{f:_a},14:{f:ma},15:{f:ma},16:{f:On},17:{f:ma},18:{f:ma},19:{f:_a},20:{f:WD},21:{f:WD},23:{f:S9},24:{f:XD},25:{f:ma},26:{},27:{},28:{f:Lve},29:{},34:{f:ma},35:{f:YD},38:{f:On},39:{f:On},40:{f:On},41:{f:On},42:{f:ma},43:{f:ma},47:{f:J1e},49:{f:fve},51:{f:_a},60:{},61:{f:ove},64:{f:ma},65:{f:Ave},66:{f:_a},77:{},80:{},81:{},82:{},85:{f:_a},89:{},90:{},91:{},92:{f:Xbe},93:{f:zve},94:{},95:{f:ma},96:{},97:{},99:{f:ma},125:{f:B9},128:{f:Sve},129:{f:Zbe},130:{f:_a},131:{f:ma},132:{f:ma},133:{f:eve},134:{},140:{f:Xve},141:{f:_a},144:{},146:{f:e1e},151:{},152:{},153:{},154:{},155:{},156:{f:_a},157:{},158:{},160:{f:l1e},161:{f:a1e},174:{},175:{},176:{},177:{},178:{},180:{},181:{},182:{},184:{},185:{},189:{f:Cve},190:{f:kve},193:{f:dc},197:{},198:{},199:{},200:{},201:{},202:{f:ma},203:{},204:{},205:{},206:{},207:{},208:{},209:{},210:{},211:{},213:{},215:{},216:{},217:{},218:{f:_a},220:{},221:{f:ma},222:{},224:{f:Eve},225:{f:Ybe},226:{f:dc},227:{},229:{f:Qve},233:{},235:{},236:{},237:{},239:{},240:{},241:{},242:{},244:{},245:{},246:{},247:{},248:{},249:{},251:{},252:{f:rve},253:{f:hve},255:{f:nve},256:{},259:{},290:{},311:{},312:{},315:{},317:{f:b9},318:{},319:{},320:{},330:{},331:{},333:{},334:{},335:{},336:{},337:{},338:{},339:{},340:{},351:{},352:{f:ma},353:{f:dc},401:{},402:{},403:{},404:{},405:{},406:{},407:{},408:{},425:{},426:{},427:{},428:{},429:{},430:{f:Fve},431:{f:ma},432:{},433:{},434:{},437:{},438:{f:Gve},439:{f:ma},440:{f:Kve},441:{},442:{f:rh},443:{},444:{f:_a},445:{},446:{},448:{f:dc},449:{f:lve,r:2},450:{f:dc},512:{f:GD},513:{f:i1e},515:{f:Tve},516:{f:mve},517:{f:qD},519:{f:o1e},520:{f:sve},523:{},545:{f:JD},549:{f:VD},566:{},574:{f:dve},638:{f:Nve},659:{},1048:{},1054:{f:bve},1084:{},1212:{f:Rve},2048:{f:Wve},2049:{},2050:{},2051:{},2052:{},2053:{},2054:{},2055:{},2056:{},2057:{f:Kx},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:dc},2152:{},2154:{},2155:{},2156:{},2161:{},2162:{},2164:{},2165:{},2166:{},2167:{},2168:{},2169:{},2170:{},2171:{},2172:{f:t1e,r:12},2173:{f:Xye,r:12},2174:{},2175:{},2180:{},2181:{},2182:{},2183:{},2184:{},2185:{},2186:{},2187:{},2188:{f:ma,r:12},2189:{},2190:{r:12},2191:{},2192:{},2194:{},2195:{},2196:{f:Mve,r:12},2197:{},2198:{f:Vye,r:12},2199:{},2200:{},2201:{},2202:{f:Ove,r:12},2203:{f:dc},2204:{},2205:{},2206:{},2207:{},2211:{f:ive},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:n1e},4165:{},4166:{},4168:{},4170:{},4171:{},4174:{},4175:{},4176:{},4177:{},4187:{},4188:{f:Zve},4189:{},4191:{},4192:{},4193:{},4194:{},4195:{},4196:{},4197:{},4198:{},4199:{},4200:{},0:{f:GD},1:{},2:{f:f1e},3:{f:u1e},4:{f:d1e},5:{f:qD},7:{f:h1e},8:{},9:{f:Kx},11:{},22:{f:_a},30:{f:yve},31:{},32:{},33:{f:JD},36:{},37:{f:VD},50:{f:x1e},62:{},52:{},67:{},68:{f:_a},69:{},86:{},126:{},127:{f:c1e},135:{},136:{},137:{},145:{},148:{},149:{},150:{},169:{},171:{},188:{},191:{},192:{},194:{},195:{},214:{f:m1e},223:{},234:{},354:{},421:{},518:{f:I2},521:{f:Kx},536:{f:XD},547:{f:YD},561:{},579:{},1030:{f:I2},1033:{f:Kx},1091:{},2157:{},2163:{},2177:{},2240:{},2241:{},2242:{},2243:{},2244:{},2245:{},2246:{},2247:{},2248:{},2249:{},2250:{},2251:{},2262:{r:12},29282:{}};function Ye(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&&fE(r)&&e.push(r)}}function hje(e,t,r,a){var s=(r||[]).length||0;if(s<=8224)return Ye(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 ih(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 xje(e,t,r,a){var s=Oe(9);return ih(s,e,t),v9(r,a||"b",s),s}function mje(e,t,r){var a=Oe(8+2*r.length);return ih(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 gje(e,t,r,a){if(t.v!=null)switch(t.t){case"d":case"n":var s=t.t=="d"?za(Rr(t.v)):t.v;s==(s|0)&&s>=0&&s<65536?Ye(e,2,p1e(r,a,s)):Ye(e,3,A1e(r,a,s));return;case"b":case"e":Ye(e,5,xje(r,a,t.v,t.t));return;case"s":case"str":Ye(e,4,mje(r,a,(t.v||"").slice(0,255)));return}Ye(e,1,ih(null,r,a))}function bje(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=va(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&&gje(e,p,u,f)}}}function vje(e,t){for(var r=t||{},a=xs(),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 Ye(a,r.biff==4?1033:r.biff==3?521:9,NE(e,16,r)),bje(a,e.Sheets[e.SheetNames[s]],s,r),Ye(a,10),a.end()}function yje(e,t,r){Ye(e,49,pve({sz:12,name:"Arial"},r))}function wje(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&&Ye(e,1054,vve(s,t[s],r))})}function Nje(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),Ye(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),k9(Yt(t["!ref"]||"A1"),r),r.write_shift(4,4),Ye(e,2152,r)}function Cje(e,t){for(var r=0;r<16;++r)Ye(e,224,KD({numFmtId:0,style:!0},0,t));t.cellXfs.forEach(function(a){Ye(e,224,KD(a,0,t))})}function kje(e,t){for(var r=0;r<t["!links"].length;++r){var a=t["!links"][r];Ye(e,440,qve(a)),a[1].Tooltip&&Ye(e,2048,Yve(a))}delete t["!links"]}function jje(e,t){if(t){var r=0;t.forEach(function(a,s){++r<=256&&a&&Ye(e,125,r1e(hv(s,a),s))})}}function Eje(e,t,r,a,s){var i=16+Kc(s.cellXfs,t,s);if(t.v==null&&!t.bf){Ye(e,513,Wd(r,a,i));return}if(t.bf)Ye(e,6,Z2e(t,r,a,s,i));else switch(t.t){case"d":case"n":var l=t.t=="d"?za(Rr(t.v)):t.v;Ye(e,515,Ive(r,a,l,i));break;case"b":case"e":Ye(e,517,_ve(r,a,t.v,i,s,t.t));break;case"s":case"str":if(s.bookSST){var o=TE(s.Strings,t.v,s.revStrings);Ye(e,253,xve(r,a,o,i))}else Ye(e,516,gve(r,a,(t.v||"").slice(0,255),i,s));break;default:Ye(e,513,Wd(r,a,i))}}function Sje(e,t,r){var a=xs(),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="",x=[],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)}Ye(a,2057,NE(r,16,t)),Ye(a,13,ui(1)),Ye(a,12,ui(100)),Ye(a,15,Wn(!0)),Ye(a,17,Wn(!1)),Ye(a,16,Kd(.001)),Ye(a,95,Wn(!0)),Ye(a,42,Wn(!1)),Ye(a,43,Wn(!1)),Ye(a,130,ui(1)),Ye(a,128,Bve()),Ye(a,131,Wn(!1)),Ye(a,132,Wn(!1)),u&&jje(a,i["!cols"]),Ye(a,512,wve(m,t)),u&&(i["!links"]=[]);for(var v=m.s.r;v<=m.e.r;++v){p=va(v);for(var y=m.s.c;y<=m.e.c;++y){v===m.s.r&&(x[y]=Jr(y)),f=x[y]+p;var k=d?(i[v]||[])[y]:i[f];k&&(Eje(a,k,v,y,t),u&&k.l&&i["!links"].push([f,k.l]))}}var _=o.CodeName||o.name||s;return u&&Ye(a,574,uve((l.Views||[])[0])),u&&(i["!merges"]||[]).length&&Ye(a,229,Hve(i["!merges"])),u&&kje(a,i),Ye(a,442,y9(_)),u&&Nje(a,i),Ye(a,10),a.end()}function Bje(e,t,r){var a=xs(),s=(e||{}).Workbook||{},i=s.Sheets||[],l=s.WBProps||{},o=r.biff==8,d=r.biff==5;if(Ye(a,2057,NE(e,5,r)),r.bookType=="xla"&&Ye(a,135),Ye(a,225,o?ui(1200):null),Ye(a,193,_be(2)),d&&Ye(a,191),d&&Ye(a,192),Ye(a,226),Ye(a,92,Jbe("SheetJS",r)),Ye(a,66,ui(o?1200:1252)),o&&Ye(a,353,ui(0)),o&&Ye(a,448),Ye(a,317,s1e(e.SheetNames.length)),o&&e.vbaraw&&Ye(a,211),o&&e.vbaraw){var u=l.CodeName||"ThisWorkbook";Ye(a,442,y9(u))}Ye(a,156,ui(17)),Ye(a,25,Wn(!1)),Ye(a,18,Wn(!1)),Ye(a,19,ui(0)),o&&Ye(a,431,Wn(!1)),o&&Ye(a,444,ui(0)),Ye(a,61,cve()),Ye(a,64,Wn(!1)),Ye(a,141,ui(0)),Ye(a,34,Wn(lke(e)=="true")),Ye(a,14,Wn(!0)),o&&Ye(a,439,Wn(!1)),Ye(a,218,ui(0)),yje(a,e,r),wje(a,e.SSF,r),Cje(a,r),o&&Ye(a,352,Wn(!1));var f=a.end(),p=xs();o&&Ye(p,140,Jve()),o&&r.Strings&&hje(p,252,ave(r.Strings)),Ye(p,10);var x=p.end(),m=xs(),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+x.length;for(v=0;v<e.SheetNames.length;++v){var k=i[v]||{};Ye(m,133,tve({pos:y,hs:k.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 C=[];return f.length&&C.push(f),_.length&&C.push(_),x.length&&C.push(x),Za(C)}function _je(e,t){var r=t||{},a=[];e&&!e.SSF&&(e.SSF=Or(vt)),e&&e.SSF&&(t0(),ov(e.SSF),r.revssf=dv(e.SSF),r.revssf[e.SSF[65535]]=0,r.ssf=e.SSF),r.Strings=[],r.Strings.Count=0,r.Strings.Unique=0,ME(r),r.cellXfs=[],Kc(r.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={});for(var s=0;s<e.SheetNames.length;++s)a[a.length]=Sje(s,r,e);return a.unshift(Bje(e,a,r)),Za(a)}function pH(e,t){for(var r=0;r<=e.SheetNames.length;++r){var a=e.Sheets[e.SheetNames[r]];if(!(!a||!a["!ref"])){var s=vs(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 _je(e,t);case 4:case 3:case 2:return vje(e,t)}throw new Error("invalid type "+i.bookType+" for BIFF")}function oU(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=pge(e.slice(l,o),/(:?<tr[^>]*>)/i,"<tr>"),u=-1,f=0,p=0,x=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 k=v.split(/<\/t[dh]>/i);for(o=0;o<k.length;++o){var _=k[o].trim();if(_.match(/<t[dh]/i)){for(var C=_,E=0;C.charAt(0)=="<"&&(E=C.indexOf(">"))>-1;)C=C.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=wt(_.slice(0,_.indexOf(">")));x=F.colspan?+F.colspan:1,((p=+F.rowspan)>1||x>1)&&b.push({s:{r:u,c:f},e:{r:u+(p||1)-1,c:f+x-1}});var M=F.t||F["data-t"]||"";if(!C.length){f+=x;continue}if(C=OQ(C),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),!C.length){f+=x;continue}var U={t:"s",v:C};r.raw||!C.trim().length||M=="s"||(C==="TRUE"?U={t:"b",v:!0}:C==="FALSE"?U={t:"b",v:!1}:isNaN(Vi(C))?isNaN(FA(C).getDate())||(U={t:"d",v:Rr(C)},r.cellDates||(U={t:"n",v:za(U.v)}),U.z=r.dateNF||vt[14]):U={t:"n",v:Vi(C)}),r.dense?(a[u]||(a[u]=[]),a[u][f]=U):a[yt({r:u,c:f})]=U,f+=x}}}}return a["!ref"]=Tt(m),b.length&&(a["!merges"]=b),a}function Tje(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],x=p&&p.v!=null&&(p.h||dE(p.w||(No(p),p.w)||""))||"",m={};o>1&&(m.rowspan=o),d>1&&(m.colspan=d),a.editable?x='<span contenteditable="true">'+x+"</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)!="#"&&(x='<a href="'+p.l.Target+'">'+x+"</a>")),m.id=(a.id||"sjs")+"-"+f,i.push(qe("td",x,m))}}var b="<tr>";return b+i.join("")+"</tr>"}var Ije='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>',Fje="</body></html>";function Dje(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 Gc(oU(r[0],t),t);var a=LE();return r.forEach(function(s,i){QE(a,oU(s,t),"Sheet"+(i+1))}),a}function Uje(e,t,r){var a=[];return a.join("")+"<table"+(r&&r.id?' id="'+r.id+'"':"")+">"}function hH(e,t){var r=t||{},a=r.header!=null?r.header:Ije,s=r.footer!=null?r.footer:Fje,i=[a],l=vs(e["!ref"]);r.dense=Array.isArray(e),i.push(Uje(e,l,r));for(var o=l.s.r;o<=l.e.r;++o)i.push(Tje(e,l,o,r));return i.push("</table>"+s),i.join("")}function xH(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=vs(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=[],x=0,m=e["!rows"]||(e["!rows"]=[]),b=0,v=0,y=0,k=0,_=0,C=0;for(e["!cols"]||(e["!cols"]=[]);b<o.length&&v<d;++b){var E=o[b];if(cU(E)){if(a.display)continue;m[v]={hidden:!0}}var T=E.children;for(y=k=0;y<T.length;++y){var B=T[y];if(!(a.display&&cU(B))){var F=B.hasAttribute("data-v")?B.getAttribute("data-v"):B.hasAttribute("v")?B.getAttribute("v"):OQ(B.innerHTML),M=B.getAttribute("data-z")||B.getAttribute("z");for(x=0;x<p.length;++x){var U=p[x];U.s.c==k+i&&U.s.r<v+s&&v+s<=U.e.r&&(k=U.e.c+1-i,x=-1)}C=+B.getAttribute("colspan")||1,((_=+B.getAttribute("rowspan")||1)>1||C>1)&&p.push({s:{r:v+s,c:k+i},e:{r:v+s+(_||1)-1,c:k+i+(C||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(FA(F).getDate())||(D={t:"d",v:Rr(F)},a.cellDates||(D={t:"n",v:za(D.v)}),D.z=a.dateNF||vt[14]):D={t:"n",v:Vi(F)})),D.z===void 0&&M!=null&&(D.z=M);var P="",G=B.getElementsByTagName("A");if(G&&G.length)for(var H=0;H<G.length&&!(G[H].hasAttribute("href")&&(P=G[H].getAttribute("href"),P.charAt(0)!="#"));++H);P&&P.charAt(0)!="#"&&(D.l={Target:P}),a.dense?(e[v+s]||(e[v+s]=[]),e[v+s][k+i]=D):e[yt({c:k+i,r:v+s})]=D,u.e.c<k+i&&(u.e.c=k+i),k+=C}}++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 mH(e,t){var r=t||{},a=r.dense?[]:{};return xH(a,e,t)}function Mje(e,t){return Gc(mH(e,t),t)}function cU(e){var t="",r=Rje(e);return r&&(t=r(e).getPropertyValue("display")),t||(t=e.style&&e.style.display),t==="none"}function Rje(e){return e.ownerDocument.defaultView&&typeof e.ownerDocument.defaultView.getComputedStyle=="function"?e.ownerDocument.defaultView.getComputedStyle:typeof getComputedStyle=="function"?getComputedStyle:null}function Oje(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 dU={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 gH(e,t){var r=t||{},a=uE(e),s=[],i,l,o={name:""},d="",u=0,f,p,x={},m=[],b=r.dense?[]:{},v,y,k={value:""},_="",C=0,E=[],T=-1,B=-1,F={s:{r:1e6,c:1e7},e:{r:0,c:0}},M=0,U={},D=[],L={},P=0,G=0,H=[],Q=1,Y=1,K=[],ee={Names:[]},J={},W=["",""],R=[],O={},q="",z=0,X=!1,re=!1,le=0;for(bp.lastIndex=0,a=a.replace(/<!--([\s\S]*?)-->/mg,"").replace(/<!DOCTYPE[^\[]*\[[^\]]*\]>/gm,"");v=bp.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),H.length&&(b["!rows"]=H),f.name=f.名称||f.name,typeof JSON<"u"&&JSON.stringify(f),m.push(f.name),x[f.name]=b,re=!1):v[0].charAt(v[0].length-2)!=="/"&&(f=wt(v[0],!1),T=B=-1,F.s.r=F.s.c=1e7,F.e.r=F.e.c=0,b=r.dense?[]:{},D=[],H=[],re=!0);break;case"table-row-group":v[1]==="/"?--M:++M;break;case"table-row":case"行":if(v[1]==="/"){T+=Q,Q=1;break}if(p=wt(v[0],!1),p.行号?T=p.行号-1:T==-1&&(T=0),Q=+p["number-rows-repeated"]||1,Q<10)for(le=0;le<Q;++le)M>0&&(H[T+le]={level:M});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,k=wt(v[0],!1),Y=parseInt(k["number-columns-repeated"]||"1",10),y={t:"z",v:null},k.formula&&r.cellFormula!=!1&&(y.f=sU(Wt(k.formula))),(k.数据类型||k["value-type"])=="string"&&(y.t="s",y.v=Wt(k["string-value"]||""),r.dense?(b[T]||(b[T]=[]),b[T][B]=y):b[yt({r:T,c:B})]=y),B+=Y-1;else if(v[1]!=="/"){++B,_="",C=0,E=[],Y=1;var ne=Q?T+Q-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),k=wt(v[0],!1),R=[],O={},y={t:k.数据类型||k["value-type"],v:null},r.cellFormula)if(k.formula&&(k.formula=Wt(k.formula)),k["number-matrix-columns-spanned"]&&k["number-matrix-rows-spanned"]&&(P=parseInt(k["number-matrix-rows-spanned"],10)||0,G=parseInt(k["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])),k.formula)y.f=sU(k.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((k["number-columns-spanned"]||k["number-rows-spanned"])&&(P=parseInt(k["number-rows-spanned"],10)||0,G=parseInt(k["number-columns-spanned"],10)||0,L={s:{r:T,c:B},e:{r:T+P-1,c:B+G-1}},D.push(L)),k["number-columns-repeated"]&&(Y=parseInt(k["number-columns-repeated"],10)),y.t){case"boolean":y.t="b",y.v=Ur(k["boolean-value"]);break;case"float":y.t="n",y.v=parseFloat(k.value);break;case"percentage":y.t="n",y.v=parseFloat(k.value);break;case"currency":y.t="n",y.v=parseFloat(k.value);break;case"date":y.t="d",y.v=Rr(k["date-value"]),r.cellDates||(y.t="n",y.v=za(y.v)),y.z="m/d/yy";break;case"time":y.t="n",y.v=uge(k["time-value"])/86400,r.cellDates&&(y.t="d",y.v=uv(y.v)),y.z="HH:MM:SS";break;case"number":y.t="n",y.v=parseFloat(k.数据数值);break;default:if(y.t==="string"||y.t==="text"||!y.t)y.t="s",k["string-value"]!=null&&(_=Wt(k["string-value"]),E=[]);else throw new Error("Unsupported value type "+y.t)}}else{if(X=!1,y.t==="s"&&(y.v=_||"",E.length&&(y.R=E),X=C==0),J.Target&&(y.l=J),R.length>0&&(y.c=R,R=[]),_&&r.cellText!==!1&&(y.w=_),X&&(y.t="z",delete y.v),(!X||r.sheetStubs)&&!(r.sheetRows&&r.sheetRows<=T))for(var ae=0;ae<Q;++ae){if(Y=parseInt(k["number-columns-repeated"]||"1",10),r.dense)for(b[T+ae]||(b[T+ae]=[]),b[T+ae][B]=ae==0?y:Or(y);--Y>0;)b[T+ae][B+Y]=Or(y);else for(b[yt({r:T+ae,c:B})]=y;--Y>0;)b[yt({r:T+ae,c:B+Y})]=Or(y);F.e.c<=B&&(F.e.c=B)}Y=parseInt(k["number-columns-repeated"]||"1",10),B+=Y-1,Y=0,y={},_="",E=[]}J={};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,R.push(O)}else v[0].charAt(v[0].length-2)!=="/"&&s.push([v[3],!1]);q="",z=0,_="",C=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]);_="",C=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=wt(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=wt(v[0],!1),d+=dU[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=wt(v[0],!1),d+=dU[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=wt(v[0],!1),W=F2(l["cell-range-address"]);var ie={Name:l.name,Ref:W[0]+"!"+W[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]==="/"&&(!k||!k["string-value"])){var he=Oje(a.slice(C,v.index));_=(_.length>0?_+`
`:"")+he[0]}else wt(v[0],!1),C=v.index+v[0].length;break;case"s":break;case"database-range":if(v[1]==="/")break;try{W=F2(wt(v[0])["target-range-address"]),x[W[0]]["!autofilter"]={ref:W[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(J=wt(v[0],!1),!J.href)break;J.Target=Wt(J.href),delete J.href,J.Target.charAt(0)=="#"&&J.Target.indexOf(".")>-1?(W=F2(J.Target.slice(1)),J.Target="#"+W[0]+"!"+W[1]):J.Target.match(/^\.\.[\\\/]/)&&(J.Target=J.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:x,SheetNames:m,Workbook:ee};return r.bookSheets&&delete Z.Sheets,Z}function uU(e,t){t=t||{},ci(e,"META-INF/manifest.xml")&&ube(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=gH(gr(r),t);return ci(e,"meta.xml")&&(a.Props=o9(Ba(e,"meta.xml"))),a}function AU(e,t){return gH(e,t)}var Pje=(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 "+gp({"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}})(),fU=(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=vs(i["!ref"]||"A1"),x=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 k=!1,_={},C="";for(m=0;m!=x.length;++m)if(!(x[m].s.c>f)&&!(x[m].s.r>u)&&!(x[m].e.c<f)&&!(x[m].e.r<u)){(x[m].s.c!=f||x[m].s.r!=u)&&(k=!0),_["table:number-columns-spanned"]=x[m].e.c-x[m].s.c+1,_["table:number-rows-spanned"]=x[m].e.r-x[m].s.r+1;break}if(k){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(sNe(T.f)),T.F&&T.F.slice(0,E.length)==E)){var B=vs(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":C=T.v?"TRUE":"FALSE",_["office:value-type"]="boolean",_["office:boolean-value"]=T.v?"true":"false";break;case"n":C=T.w||String(T.v||0),_["office:value-type"]="float",_["office:value"]=T.v||0;break;case"s":case"str":C=T.v==null?"":T.v,_["office:value-type"]="string";break;case"d":C=T.w||Rr(T.v).toISOString(),_["office:value-type"]="date",_["office:date-value"]=Rr(T.v).toISOString(),_["table:style-name"]="ce1";break;default:d.push(t);continue}var F=e(C);if(T.l&&T.l.Target){var M=T.l.Target;M=M.charAt(0)=="#"?"#"+iNe(M.slice(1)):M,M.charAt(0)!="#"&&!M.match(/^\w+:/)&&(M="../"+M),F=qe("text:a",F,{"xlink:href":M.replace(/&/g,"&amp;")})}d.push("          "+qe("table:table-cell",qe("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;Dc(p),p.ods=o;var x=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="'+x+`"/>
`),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=gp({"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=gp({"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(l9().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 bH(e,t){if(t.bookType=="fods")return fU(e,t);var r=lE(),a="",s=[],i=[];return a="mimetype",Dt(r,a,"application/vnd.oasis.opendocument.spreadsheet"),a="content.xml",Dt(r,a,fU(e,t)),s.push([a,"text/xml"]),i.push([a,"ContentFile"]),a="styles.xml",Dt(r,a,Pje(e,t)),s.push([a,"text/xml"]),i.push([a,"StylesFile"]),a="meta.xml",Dt(r,a,wa+l9()),s.push([a,"text/xml"]),i.push([a,"MetadataFile"]),a="manifest.rdf",Dt(r,a,pbe(i)),s.push([a,"application/rdf+xml"]),a="META-INF/manifest.xml",Dt(r,a,Abe(s)),r}/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */function Yd(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function TC(e){return typeof TextDecoder<"u"?new TextDecoder().decode(e):gr(Vc(e))}function Lje(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):Rs(ml(e))}function Qje(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 Mc(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 pU(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>>24}function Hje(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 zje(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 jp(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=jp(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=jp(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 hn(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))})}),Mc(t)}function DE(e,t){return(e==null?void 0:e.map(function(r){return t(r.data)}))||[]}function li(e){for(var t,r=[],a=[0];a[0]<e.length;){var s=jp(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 Wu(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:hn(l.meta),type:2})});var i=hn(a);t.push(or(i.length)),t.push(i),s.forEach(function(l){return t.push(l)})}),Mc(t)}function $je(e,t){if(e!=0)throw new Error("Unexpected Snappy chunk type ".concat(e));for(var r=[0],a=jp(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=[Mc(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=Mc(s);if(f.length!=a)throw new Error("Unexpected length: ".concat(f.length," != ").concat(a));return f}function oi(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($je(a,e.slice(r,r+s))),r+=s}if(r!==e.length)throw new Error("data is not a valid framed stream!");return Mc(t)}function Yu(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 Mc(t)}function Vje(e,t,r,a){var s=Yd(e),i=s.getUint32(4,!0),l=(a>1?12:8)+pU(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+=pU(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 Gje(e,t,r){var a=Yd(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=Hje(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 U2(e,t){var r=new Uint8Array(32),a=Yd(r),s=12,i=0;switch(r[0]=5,e.t){case"n":r[1]=2,zje(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 M2(e,t){var r=new Uint8Array(32),a=Yd(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 Kje(e,t,r){switch(e[0]){case 0:case 1:case 2:case 3:return Vje(e,t,r,e[0]);case 5:return Gje(e,t,r);default:throw new Error("Unsupported payload version ".concat(e[0]))}}function Fn(e){var t=Zt(e);return jp(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]=TC(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],x=ua(p.meta[1][0].data);if(x!=2001)throw new Error("2000 unexpected reference to ".concat(x));var m=Zt(p.data);i[d]=m[3].map(function(b){return TC(b.data)}).join("")}break}}),i}function qje(e,t){var r,a,s,i,l,o,d,u,f,p,x,m,b,v,y=Zt(e),k=ua(y[1][0].data)>>>0,_=ua(y[2][0].data)>>>0,C=((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=(x=y[4])==null?void 0:x[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=C?4:1,F=Yd(E),M=[],U=0;U<E.length/2;++U){var D=F.getUint16(U*2,!0);D<65535&&M.push([U,D])}if(M.length!=_)throw"Expected ".concat(_," cells, found ").concat(M.length);var L=[];for(U=0;U<M.length-1;++U)L[M[U][0]]=T.subarray(M[U][1]*B,M[U+1][1]*B);return M.length>=1&&(L[M[M.length-1][0]]=T.subarray(M[M.length-1][1]*B)),{R:k,cells:L}}function Wje(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=DE(a[5],function(l){return qje(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 Yje(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 x=Zt(p.data),m=e[Fn(x[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=Wje(e,m);v.data.forEach(function(y,k){y.forEach(function(_,C){var E=yt({r:f+k,c:C}),T=Kje(_,o,d);T&&(r[E]=T)})}),f+=v.nrows})}function Xje(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 Yje(e,s[0],a),a}function Jje(e,t){var r,a=Zt(t.data),s={name:(r=a[1])!=null&&r[0]?TC(a[1][0].data):"",sheets:[]},i=DE(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(Xje(e,o))})}),s}function Zje(e,t){var r=LE(),a=Zt(t.data),s=DE(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=Jje(e,l);d.sheets.forEach(function(u,f){QE(r,u,f==0?d.name:d.name+"_"+f,!0)})}})}),r.SheetNames.length==0)throw new Error("Empty NUMBERS file");return r}function R2(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=oi(d.content)}catch(p){return console.log("?? "+d.content.length+" "+(p.message||p))}var f;try{f=li(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 Zje(i,o)}function eEe(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=Yd(e[7][0].data),f=0,p=[],x=Yd(e[4][0].data),m=0,b=[],v=0;v<t.length;++v){if(t[v]==null){u.setUint16(v*2,65535,!0),x.setUint16(v*2,65535);continue}u.setUint16(v*2,f,!0),x.setUint16(v*2,m,!0);var y,k;switch(typeof t[v]){case"string":y=U2({t:"s",v:t[v]},r),k=M2({t:"s",v:t[v]},r);break;case"number":y=U2({t:"n",v:t[v]},r),k=M2({t:"n",v:t[v]},r);break;case"boolean":y=U2({t:"b",v:t[v]},r),k=M2({t:"b",v:t[v]},r);break;default:throw new Error("Unsupported value "+t[v])}p.push(y),f+=y.length,b.push(k),m+=k.length,++d}for(e[2][0].data=or(d);v<e[7][0].data.length/2;++v)u.setUint16(v*2,65535,!0),x.setUint16(v*2,65535,!0);return e[6][0].data=Mc(p),e[3][0].data=Mc(b),d}function tEe(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=vs(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=Jg(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=ht.read(t.numbers,{type:"base64"});u.FileIndex.map(function(q,z){return[q,u.FullPaths[z]]}).forEach(function(q){var z=q[0],X=q[1];if(z.type==2&&z.name.match(/\.iwa/)){var re=z.content,le=oi(re),ne=li(le);ne.forEach(function(ae){d.push(ae.id),o[ae.id]={deps:[],location:X,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 X=li(oi(z.content));X.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&&Qje(ae.data,ne[1])})&&o[ne[0]].deps.push(re.id)})})})}});for(var p=ht.find(u,o[1].location),x=li(oi(p.content)),m,b=0;b<x.length;++b){var v=x[b];v.id==1&&(m=v)}var y=Fn(Zt(m.messages[0].data)[1][0].data);for(p=ht.find(u,o[y].location),x=li(oi(p.content)),b=0;b<x.length;++b)v=x[b],v.id==y&&(m=v);for(y=Fn(Zt(m.messages[0].data)[2][0].data),p=ht.find(u,o[y].location),x=li(oi(p.content)),b=0;b<x.length;++b)v=x[b],v.id==y&&(m=v);for(y=Fn(Zt(m.messages[0].data)[2][0].data),p=ht.find(u,o[y].location),x=li(oi(p.content)),b=0;b<x.length;++b)v=x[b],v.id==y&&(m=v);var k=Zt(m.messages[0].data);{k[6][0].data=or(a.e.r+1),k[7][0].data=or(a.e.c+1);var _=Fn(k[46][0].data),C=ht.find(u,o[_].location),E=li(oi(C.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 M=[];M[1]=M[2]=[{type:0,data:or(F+420690)}],B[1].push({type:2,data:hn(M)}),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)M=[],M[1]=M[2]=[{type:0,data:or(U+726270)}],B[4].push({type:2,data:hn(M)}),B[5].push({type:0,data:or(U)}),B[6].push({type:0,data:or(U)});E[T].messages[0].data=hn(B)}C.content=Yu(Wu(E)),C.size=C.content.length,delete k[46];var D=Zt(k[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);C=ht.find(u,o[P].location),E=li(oi(C.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 H=Zt(G[2][0].data);H[1][0].data=or(U),H[4][0].data=or(i[U].length),G[2][U]={type:G[2][0].type,data:hn(H)}}E[0].messages[0].data=hn(G)}C.content=Yu(Wu(E)),C.size=C.content.length;var Q=Fn(D[2][0].data);C=ht.find(u,o[Q].location),E=li(oi(C.content));{if(E[0].id!=Q)throw"Bad HeaderStorageBucket";for(G=Zt(E[0].messages[0].data),F=0;F<=a.e.c;++F)H=Zt(G[2][0].data),H[1][0].data=or(F),H[4][0].data=or(a.e.r+1),G[2][F]={type:G[2][0].type,data:hn(H)};E[0].messages[0].data=hn(G)}C.content=Yu(Wu(E)),C.size=C.content.length;var Y=Fn(D[4][0].data);(function(){for(var q=ht.find(u,o[Y].location),z=li(oi(q.content)),X,re=0;re<z.length;++re){var le=z[re];le.id==Y&&(X=le)}var ne=Zt(X.messages[0].data);{ne[3]=[];var ae=[];l.forEach(function(Z,Ue){ae[1]=[{type:0,data:or(Ue)}],ae[2]=[{type:0,data:or(1)}],ae[3]=[{type:2,data:Lje(Z)}],ne[3].push({type:2,data:hn(ae)})})}X.messages[0].data=hn(ne);var ie=Wu(z),he=Yu(ie);q.content=he,q.size=q.content.length})();var K=Zt(D[3][0].data);{var ee=K[1][0];delete K[2];var J=Zt(ee.data);{var W=Fn(J[2][0].data);(function(){for(var q=ht.find(u,o[W].location),z=li(oi(q.content)),X,re=0;re<z.length;++re){var le=z[re];le.id==W&&(X=le)}var ne=Zt(X.messages[0].data);{delete ne[6],delete K[7];var ae=new Uint8Array(ne[5][0].data);ne[5]=[];for(var ie=0,he=0;he<=a.e.r;++he){var Z=Zt(ae);ie+=eEe(Z,i[he],l),Z[1][0].data=or(he),ne[5].push({data:hn(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)}]}X.messages[0].data=hn(ne);var Ue=Wu(z),Ie=Yu(Ue);q.content=Ie,q.size=q.content.length})()}ee.data=hn(J)}D[3][0].data=hn(K)}k[4][0].data=hn(D)}m.messages[0].data=hn(k);var R=Wu(x),O=Yu(R);return p.content=O,p.size=p.content.length,u}function vH(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 UE(e){vH([["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 ME(e){vH([["cellDates",!1],["bookSST",!1],["bookType","xlsx"],["compression",!1],["WTF",!1]])(e)}function rEe(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 aEe(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,rEe(e["!id"][a.id].Type)]})}catch{return null}return!e||e.length===0?null:e}function nEe(e,t,r,a,s,i,l,o,d,u,f,p){try{i[a]=Uf(Os(e,r,!0),t);var x=Ba(e,t),m;switch(o){case"sheet":m=jke(x,t,s,d,i[a],u,f,p);break;case"chart":if(m=Eke(x,t,s,d,i[a],u,f,p),!m||!m["!drawel"])break;var b=wf(m["!drawel"].Target,t),v=vp(b),y=fwe(Os(e,b,!0),Uf(Os(e,v,!0),b)),k=wf(y,b),_=vp(k);m=eke(Os(e,k,!0),k,d,Uf(Os(e,_,!0),k),u,m);break;case"macro":m=Ske(x,t,s,d,i[a],u,f,p);break;case"dialog":m=Bke(x,t,s,d,i[a],u,f,p);break;default:throw new Error("Unrecognized sheet type "+o)}l[a]=m;var C=[];i&&i[a]&&Aa(i[a]).forEach(function(E){var T="";if(i[a][E].Type==Ot.CMNT){T=wf(i[a][E].Target,t);var B=Fke(Ba(e,T,!0),T,d);if(!B||!B.length)return;eU(m,B,!1)}i[a][E].Type==Ot.TCMNT&&(T=wf(i[a][E].Target,t),C=C.concat(hwe(Ba(e,T,!0),d)))}),C&&C.length&&eU(m,C,!0,d.people||[])}catch(E){if(d.WTF)throw E}}function ai(e){return e.charAt(0)=="/"?e.slice(1):e}function sEe(e,t){if(t0(),t=t||{},UE(t),ci(e,"META-INF/manifest.xml")||ci(e,"objectdata.xml"))return uU(e,t);if(ci(e,"Index/Document.iwa")){if(typeof Uint8Array>"u")throw new Error("NUMBERS file parsing requires Uint8Array support");if(typeof R2<"u"){if(e.FileIndex)return R2(e);var r=ht.utils.cfb_new();return yD(e).forEach(function(H){Dt(r,H,xge(e,H))}),R2(r)}throw new Error("Unsupported NUMBERS file")}if(!ci(e,"[Content_Types].xml"))throw ci(e,"index.xml.gz")?new Error("Unsupported NUMBERS 08 file"):ci(e,"index.xml")?new Error("Unsupported NUMBERS 09 file"):new Error("Unsupported ZIP file");var a=yD(e),s=cbe(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(Mf=[],s.sst)try{Mf=Ike(Ba(e,ai(s.sst)),s.sst,t)}catch(H){if(t.WTF)throw H}t.cellStyles&&s.themes.length&&(d=Tke(Os(e,s.themes[0].replace(/^\//,""),!0)||"",s.themes[0],t)),s.style&&(u=_ke(Ba(e,ai(s.style)),s.style,d,t))}s.links.map(function(H){try{var Q=Uf(Os(e,vp(ai(H))),H);return Uke(Ba(e,ai(H)),Q,H,t)}catch{}});var f=kke(Ba(e,ai(s.workbooks[0])),s.workbooks[0],t),p={},x="";s.coreprops.length&&(x=Ba(e,ai(s.coreprops[0]),!0),x&&(p=o9(x)),s.extprops.length!==0&&(x=Ba(e,ai(s.extprops[0]),!0),x&&xbe(x,p,t)));var m={};(!t.bookSheets||t.bookProps)&&s.custprops.length!==0&&(x=Os(e,ai(s.custprops[0]),!0),x&&(m=gbe(x,t)));var b={};if((t.bookSheets||t.bookProps)&&(f.Sheets?l=f.Sheets.map(function(Q){return Q.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=Dke(Ba(e,ai(s.calcchain)),s.calcchain));var y=0,k={},_,C;{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("/"),M=(s.workbooks[0].slice(0,F+1)+"_rels/"+s.workbooks[0].slice(F+1)+".rels").replace(/^\//,"");ci(e,M)||(M="xl/_rels/workbook."+B+".rels");var U=Uf(Os(e,M,!0),M.replace(/_rels.*/,"s5s"));(s.metadata||[]).length>=1&&(t.xlmeta=Mke(Ba(e,ai(s.metadata[0])),s.metadata[0],t)),(s.people||[]).length>=1&&(t.people=mwe(Ba(e,ai(s.people[0])),t)),U&&(U=aEe(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\//,""),ci(e,_)||(_=U[y][1]),ci(e,_)||(_=M.replace(/_rels\/.*$/,"")+U[y][1]),L=U[y][2]):(_="xl/worksheets/sheet"+(y+1-D)+"."+B,_=_.replace(/sheet0\./,"sheet.")),C=_.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}}nEe(e,_,C,p.SheetNames[y],y,k,l,L,t,f,d,u)}return b={Directory:s,Workbook:f,Props:p,Custprops:m,Deps:v,Sheets:l,SheetNames:p.SheetNames,Strings:Mf,Styles:u,Themes:d,SSF:Or(vt)},t&&t.bookFiles&&(e.files?(b.keys=a,b.files=e.files):(b.keys=[],b.files={},e.FullPaths.forEach(function(H,Q){H=H.replace(/^Root Entry[\/]/,""),b.keys.push(H),b.files[H]=e.FileIndex[Q]}))),t&&t.bookVBA&&(s.vba.length>0?b.vbaraw=Ba(e,ai(s.vba[0]),!0):s.defaults&&s.defaults.bin===kwe&&(b.vbaraw=Ba(e,"xl/vbaProject.bin",!0))),b}function iEe(e,t){var r=t||{},a="Workbook",s=ht.find(e,a);try{if(a="/!DataSpaces/Version",s=ht.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);if(M1e(s.content),a="/!DataSpaces/DataSpaceMap",s=ht.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);var i=O1e(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=ht.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);var l=P1e(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=ht.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);Q1e(s.content)}catch{}if(a="/EncryptionInfo",s=ht.find(e,a),!s||!s.content)throw new Error("ECMA-376 Encrypted file missing "+a);var o=H1e(s.content);if(a="/EncryptedPackage",s=ht.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 lEe(e,t){return t.bookType=="ods"?bH(e,t):t.bookType=="numbers"?tEe(e,t):t.bookType=="xlsb"?oEe(e,t):cEe(e,t)}function oEe(e,t){pA=1024,e&&!e.SSF&&(e.SSF=Or(vt)),e&&e.SSF&&(t0(),ov(e.SSF),t.revssf=dv(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,Rf?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r=t.bookType=="xlsb"?"bin":"xml",a=K9.indexOf(t.bookType)>-1,s=yE();ME(t=t||{});var i=lE(),l="",o=0;if(t.cellXfs=[],Kc(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),l="docProps/core.xml",Dt(i,l,c9(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,A9(e.Props)),s.extprops.push(l),cr(t.rels,3,l,Ot.EXT_PROPS),e.Custprops!==e.Props&&Aa(e.Custprops||{}).length>0&&(l="docProps/custom.xml",Dt(i,l,f9(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]],x=(p||{})["!type"]||"sheet";switch(x){case"chart":default:l="xl/worksheets/sheet"+o+"."+r,Dt(i,l,Oke(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,Qke(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",V9(o,p["!comments"])),delete p["!comments"],delete p["!legacy"]}f["!id"].rId1&&Dt(i,vp(l),yA(f))}return t.Strings!=null&&t.Strings.length>0&&(l="xl/sharedStrings."+r,Dt(i,l,Lke(t.Strings,l,t)),s.strs.push(l),cr(t.wbrels,-1,"sharedStrings."+r,Ot.SST)),l="xl/workbook."+r,Dt(i,l,Rke(e,l)),s.workbooks.push(l),cr(t.rels,1,l,Ot.WB),l="xl/theme/theme1.xml",Dt(i,l,EE(e.Themes,t)),s.themes.push(l),cr(t.wbrels,-1,"theme/theme1.xml",Ot.THEME),l="xl/styles."+r,Dt(i,l,Pke(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,Hke(l)),s.metadata.push(l),cr(t.wbrels,-1,"metadata."+r,Ot.XLMETA),Dt(i,"[Content_Types].xml",i9(s,t)),Dt(i,"_rels/.rels",yA(t.rels)),Dt(i,"xl/_rels/workbook."+r+".rels",yA(t.wbrels)),delete t.revssf,delete t.ssf,i}function cEe(e,t){pA=1024,e&&!e.SSF&&(e.SSF=Or(vt)),e&&e.SSF&&(t0(),ov(e.SSF),t.revssf=dv(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,Rf?t.revStrings=new Map:(t.revStrings={},t.revStrings.foo=[],delete t.revStrings.foo);var r="xml",a=K9.indexOf(t.bookType)>-1,s=yE();ME(t=t||{});var i=lE(),l="",o=0;if(t.cellXfs=[],Kc(t.cellXfs,{},{revssf:{General:0}}),e.Props||(e.Props={}),l="docProps/core.xml",Dt(i,l,c9(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,A9(e.Props)),s.extprops.push(l),cr(t.rels,3,l,Ot.EXT_PROPS),e.Custprops!==e.Props&&Aa(e.Custprops||{}).length>0&&(l="docProps/custom.xml",Dt(i,l,f9(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":{}},x=e.Sheets[e.SheetNames[o-1]],m=(x||{})["!type"]||"sheet";switch(m){case"chart":default:l="xl/worksheets/sheet"+o+"."+r,Dt(i,l,nH(o-1,t,e,p)),s.sheets.push(l),cr(t.wbrels,-1,"worksheets/sheet"+o+"."+r,Ot.WS[0])}if(x){var b=x["!comments"],v=!1,y="";if(b&&b.length>0){var k=!1;b.forEach(function(_){_[1].forEach(function(C){C.T==!0&&(k=!0)})}),k&&(y="xl/threadedComments/threadedComment"+o+"."+r,Dt(i,y,xwe(b,f,t)),s.threadedcomments.push(y),cr(p,-1,"../threadedComments/threadedComment"+o+"."+r,Ot.TCMNT)),y="xl/comments"+o+"."+r,Dt(i,y,G9(b)),s.comments.push(y),cr(p,-1,"../comments"+o+"."+r,Ot.CMNT),v=!0}x["!legacy"]&&v&&Dt(i,"xl/drawings/vmlDrawing"+o+".vml",V9(o,x["!comments"])),delete x["!comments"],delete x["!legacy"]}p["!id"].rId1&&Dt(i,vp(l),yA(p))}return t.Strings!=null&&t.Strings.length>0&&(l="xl/sharedStrings."+r,Dt(i,l,F9(t.Strings,t)),s.strs.push(l),cr(t.wbrels,-1,"sharedStrings."+r,Ot.SST)),l="xl/workbook."+r,Dt(i,l,cH(e)),s.workbooks.push(l),cr(t.rels,1,l,Ot.WB),l="xl/theme/theme1.xml",Dt(i,l,EE(e.Themes,t)),s.themes.push(l),cr(t.wbrels,-1,"theme/theme1.xml",Ot.THEME),l="xl/styles."+r,Dt(i,l,Q9(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,$9()),s.metadata.push(l),cr(t.wbrels,-1,"metadata."+r,Ot.XLMETA),f.length>1&&(l="xl/persons/person.xml",Dt(i,l,gwe(f)),s.people.push(l),cr(t.wbrels,-1,"persons/person.xml",Ot.PEOPLE)),Dt(i,"[Content_Types].xml",i9(s,t)),Dt(i,"_rels/.rels",yA(t.rels)),Dt(i,"xl/_rels/workbook."+r+".rels",yA(t.wbrels)),delete t.revssf,delete t.ssf,i}function RE(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=$s(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 dEe(e,t){return ht.find(e,"EncryptedPackage")?iEe(e,t):fH(e,t)}function uEe(e,t){var r,a=e,s=t||{};return s.type||(s.type=Mt&&Buffer.isBuffer(e)?"buffer":"base64"),r=UQ(a,s),sEe(r,s)}function yH(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 BC(e.slice(r),t);default:break e}return DA.to_workbook(e,t)}function AEe(e,t){var r="",a=RE(e,t);switch(t.type){case"base64":r=$s(e);break;case"binary":r=e;break;case"buffer":r=e.toString("binary");break;case"array":r=Gd(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",yH(r,t)}function fEe(e,t){var r=e;return t.type=="base64"&&(r=$s(r)),r=pp.utils.decode(1200,r.slice(2),"str"),t.type="binary",yH(r,t)}function pEe(e){return e.match(/[^\x00-\x7F]/)?ml(e):e}function O2(e,t,r,a){return a?(r.type="string",DA.to_workbook(e,r)):DA.to_workbook(t,r)}function IC(e,t){rE();var r=t||{};if(typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer)return IC(new Uint8Array(e),(r=Or(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),NA={},r.dateNF&&(NA.dateNF=r.dateNF),r.type||(r.type=Mt&&Buffer.isBuffer(e)?"buffer":"base64"),r.type=="file"&&(r.type=Mt?"buffer":"binary",a=oge(e),typeof Uint8Array<"u"&&!Mt&&(r.type="array")),r.type=="string"&&(i=!0,r.type="binary",r.codepage=65001,a=pEe(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=Or(r),r.type="array",IC(aE(a),r)}switch((s=RE(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 dEe(ht.read(a,r),r);break;case 9:if(s[1]<=8)return fH(a,r);break;case 60:return BC(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 b1e(a,r);break;case 84:if(s[1]===65&&s[2]===66&&s[3]===76)return T9.to_workbook(a,r);break;case 80:return s[1]===75&&s[2]<9&&s[3]<9?uEe(a,r):O2(e,a,r,i);case 239:return s[3]===60?BC(a,r):O2(e,a,r,i);case 255:if(s[1]===254)return fEe(a,r);if(s[1]===0&&s[2]===2&&s[3]===0)return Id.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 Id.to_workbook(a,r);break;case 3:case 131:case 139:case 140:return SC.to_workbook(a,r);case 123:if(s[1]===92&&s[2]===114&&s[3]===116)return O9.to_workbook(a,r);break;case 10:case 13:case 32:return AEe(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 g1e.indexOf(s[0])>-1&&s[2]<=12&&s[3]<=31?SC.to_workbook(a,r):O2(e,a,r,i)}function wH(e,t){switch(t.type){case"base64":case"binary":break;case"buffer":case"array":t.type="";break;case"file":return Zp(t.file,ht.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 ht.write(e,t)}function hEe(e,t){var r=Or(t||{}),a=lEe(e,r);return xEe(a,r)}function xEe(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?ht.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(lv(s))}return t.password&&typeof encrypt_agile<"u"?wH(encrypt_agile(s,t.password),t):t.type==="file"?Zp(t.file,s):t.type=="string"?gr(s):s}function mEe(e,t){var r=t||{},a=pje(e,r);return wH(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?Mo(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 gEe(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?Mo(e,"binary"):e.split("").map(function(r){return r.charCodeAt(0)})}throw new Error("Unrecognized type "+t.type)}function Xx(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 NH(e,t){rE(),dke(e);var r=Or(t||{});if(r.cellStyles&&(r.cellNF=!0,r.sheetStubs=!0),r.type=="array"){r.type="binary";var a=NH(e,r);return r.type="array",lv(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(lje(e,r),r);case"slk":case"sylk":return fl(_9.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"htm":case"html":return fl(hH(e.Sheets[e.SheetNames[s]],r),r);case"txt":return gEe(CH(e.Sheets[e.SheetNames[s]],r),r);case"csv":return fl(PE(e.Sheets[e.SheetNames[s]],r),r,"\uFEFF");case"dif":return fl(T9.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"dbf":return Xx(SC.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"prn":return fl(DA.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"rtf":return fl(O9.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"eth":return fl(I9.from_sheet(e.Sheets[e.SheetNames[s]],r),r);case"fods":return fl(bH(e,r),r);case"wk1":return Xx(Id.sheet_to_wk1(e.Sheets[e.SheetNames[s]],r),r);case"wk3":return Xx(Id.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),Xx(pH(e,r),r);case"biff5":r.biff||(r.biff=5);case"biff8":case"xla":case"xls":return r.biff||(r.biff=8),mEe(e,r);case"xlsx":case"xlsm":case"xlam":case"xlsb":case"numbers":case"ods":return hEe(e,r);default:throw new Error("Unrecognized bookType |"+r.bookType+"|")}}function bEe(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 OE(e,t,r){var a={};return a.type="file",a.file=t,bEe(a),NH(e,a)}function vEe(e,t,r,a,s,i,l,o){var d=va(r),u=o.defval,f=o.raw||!Object.prototype.hasOwnProperty.call(o,"raw"),p=!0,x=s===1?[]:{};if(s!==1)if(Object.defineProperty)try{Object.defineProperty(x,"__rowNum__",{value:r,enumerable:!1})}catch{x.__rowNum__=r}else x.__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&&(x[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)x[i[m]]=null;else if(u!==void 0)x[i[m]]=u;else if(f&&v===null)x[i[m]]=null;else continue;else x[i[m]]=f&&(b.t!=="n"||b.t==="n"&&o.rawNumbers!==!1)?v:No(b,v,o);v!=null&&(p=!1)}}return{row:x,isempty:p}}function Jg(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=va(d.s.r),x=[],m=[],b=0,v=0,y=Array.isArray(e),k=d.s.r,_=0,C={};y&&!e[k]&&(e[k]=[]);var E=u.skipHidden&&e["!cols"]||[],T=u.skipHidden&&e["!rows"]||[];for(_=d.s.c;_<=d.e.c;++_)if(!(E[_]||{}).hidden)switch(x[_]=Jr(_),r=y?e[k][_]:e[x[_]+p],a){case 1:i[_]=_-d.s.c;break;case 2:i[_]=x[_];break;case 3:i[_]=u.header[_-d.s.c];break;default:if(r==null&&(r={w:"__EMPTY",t:"s"}),o=l=No(r,null,u),v=C[l]||0,!v)C[l]=1;else{do o=l+"_"+v++;while(C[o]);C[l]=v,C[o]=1}i[_]=o}for(k=d.s.r+s;k<=d.e.r;++k)if(!(T[k]||{}).hidden){var B=vEe(e,d,k,x,a,i,y,u);(B.isempty===!1||(a===1?u.blankrows!==!1:u.blankrows))&&(m[b++]=B.row)}return m.length=b,m}var xU=/"/g;function yEe(e,t,r,a,s,i,l,o){for(var d=!0,u=[],f="",p=va(r),x=t.s.c;x<=t.e.c;++x)if(a[x]){var m=o.dense?(e[r]||[])[x]:e[a[x]+p];if(m==null)f="";else if(m.v!=null){d=!1,f=""+(o.rawNumbers&&m.t=="n"?m.v:No(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(xU,'""')+'"';break}f=="ID"&&(f='"ID"')}else m.f!=null&&!m.F?(d=!1,f="="+m.f,f.indexOf(",")>=0&&(f='"'+f.replace(xU,'""')+'"')):f="";u.push(f)}return o.blankrows===!1&&d?null:u.join(l)}function PE(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 x=a.skipHidden&&e["!cols"]||[],m=a.skipHidden&&e["!rows"]||[],b=s.s.c;b<=s.e.c;++b)(x[b]||{}).hidden||(p[b]=Jr(b));for(var v=0,y=s.s.r;y<=s.e.r;++y)(m[y]||{}).hidden||(f=yEe(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 CH(e,t){t||(t={}),t.FS="	",t.RS=`
`;var r=PE(e,t);return r}function wEe(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=va(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 kH(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 x=a.header||[],m=0;t.forEach(function(v,y){Aa(v).forEach(function(k){(m=x.indexOf(k))==-1&&(x[m=x.length]=k);var _=v[k],C="z",E="",T=yt({c:o+m,r:l+y+s});u=Ep(i,T),_&&typeof _=="object"&&!(_ instanceof Date)?i[T]=_:(typeof _=="number"?C="n":typeof _=="boolean"?C="b":typeof _=="string"?C="s":_ instanceof Date?(C="d",a.cellDates||(C="n",_=za(_)),E=a.dateNF||vt[14]):_===null&&a.nullError&&(C="e",_=0),u?(u.t=C,u.v=_,delete u.w,delete u.R,E&&(u.z=E)):i[T]=u={t:C,v:_},E&&(u.z=E))})}),f.e.c=Math.max(f.e.c,o+x.length-1);var b=va(l);if(s)for(m=0;m<x.length;++m)i[Jr(m+o)+b]={t:"s",v:x[m]};return i["!ref"]=Tt(f),i}function NEe(e,t){return kH(null,e,t)}function Ep(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"?Ep(e,yt(t)):Ep(e,yt({r:t,c:r||0}))}function CEe(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 LE(){return{SheetNames:[],Sheets:{}}}function QE(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(oH(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 kEe(e,t,r){e.Workbook||(e.Workbook={}),e.Workbook.Sheets||(e.Workbook.Sheets=[]);var a=CEe(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 jEe(e,t){return e.z=t,e}function jH(e,t,r){return t?(e.l={Target:t},r&&(e.l.Tooltip=r)):delete e.l,e}function EEe(e,t,r){return jH(e,"#"+t,r)}function SEe(e,t,r){e.c||(e.c=[]),e.c.push({t,a:r||"SheetJS"})}function BEe(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=Ep(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 hi={encode_col:Jr,encode_row:va,encode_cell:yt,encode_range:Tt,decode_col:hE,decode_row:pE,split_cell:Lge,decode_cell:Zr,decode_range:vs,format_cell:No,sheet_add_aoa:ZQ,sheet_add_json:kH,sheet_add_dom:xH,aoa_to_sheet:r0,json_to_sheet:NEe,table_to_sheet:mH,table_to_book:Mje,sheet_to_csv:PE,sheet_to_txt:CH,sheet_to_json:Jg,sheet_to_html:hH,sheet_to_formulae:wEe,sheet_to_row_object_array:Jg,sheet_get_cell:Ep,book_new:LE,book_append_sheet:QE,book_set_sheet_visibility:kEe,cell_set_number_format:jEe,cell_set_hyperlink:jH,cell_set_internal_link:EEe,cell_add_comment:SEe,sheet_set_array_formula:BEe,consts:{SHEET_VISIBLE:0,SHEET_HIDDEN:1,SHEET_VERY_HIDDEN:2}};const _Ee=()=>{const{exchangeRateHistory:e,refreshData:t,loading:r}=mt(),[a,s]=j.useState(""),[i,l]=j.useState(""),[o,d]=j.useState(""),[u,f]=j.useState(Fr()),[p,x]=j.useState(!1),[m,b]=j.useState(null),[v,y]=j.useState(new Date().getMonth()),[k,_]=j.useState(new Date().getFullYear()),[C,E]=j.useState(null),[T,B]=j.useState({}),F=j.useRef(null),M=(Q,Y)=>{let K=Q.trim().replace(/"/g,""),ee=Y.trim().replace(/"/g,"").replace(",",".");if(!K||!ee)return null;let J="";const W=K.match(/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/);if(W)J=`${W[3]}-${W[2].padStart(2,"0")}-${W[1].padStart(2,"0")}`;else{const O=K.match(/^(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2,4})$/);if(O){let[q,z,X,re]=O;re.length===2&&(re="20"+re),J=`${re}-${X.padStart(2,"0")}-${z.padStart(2,"0")}`}else J=K}const R=parseFloat(ee);return J.length===10&&!isNaN(R)?{date:J,val:R}:null},U=Q=>{var ee;const Y=(ee=Q.target.files)==null?void 0:ee[0];if(!Y)return;const K=new FileReader;K.onload=async J=>{var W;try{const R=new Uint8Array((W=J.target)==null?void 0:W.result),O=IC(R,{type:"array"}),q=O.SheetNames[0],z=O.Sheets[q],X=hi.sheet_to_json(z,{header:1});if(X.length<2){alert("El archivo parece estar vacío o no tiene la estructura correcta.");return}const re=[],le=X[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")),he=le.findIndex(Z=>Z.includes("paralel")||Z.includes("blue"));for(let Z=1;Z<X.length;Z++){const Ue=X[Z];if(!Ue||Ue.length<2)continue;const Ie=String(Ue[ne!==-1?ne:0]),be=String(Ue[ae!==-1?ae:1]),je=String(Ue[ie!==-1?ie:ae!==-1?ae+1:2]),fe=he!==-1?String(Ue[he]):null,Me=M(Ie,be);if(Me){const Xe=parseFloat(be.replace(",",".")),it=parseFloat(je.replace(",",".")),at=fe?parseFloat(fe.replace(",",".")):it;!isNaN(Xe)&&!isNaN(it)&&re.push({date:Me.date,amValue:Xe,pmValue:it,parallelValue:isNaN(at)?it:at})}}re.length>0?(x(!0),b(null),await ve.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(R){b(`Error procesando Excel: ${R.message}`)}finally{x(!1),F.current&&(F.current.value="")}},K.readAsArrayBuffer(Y)},D=()=>{if(e.length===0)return;const Q=`Fecha,Tasa AM,Tasa PM,Tasa Paralela
`,Y=e.map(W=>`${W.date},${Number(W.amValue).toFixed(2)},${Number(W.pmValue).toFixed(2)},${Number(W.parallelValue||W.pmValue).toFixed(2)}`).join(`
`),K=new Blob([Q+Y],{type:"text/csv;charset=utf-8;"}),ee=URL.createObjectURL(K),J=document.createElement("a");J.href=ee,J.download="SAC_Historico_Tasas.csv",J.click()},L=async()=>{x(!0),b(null);try{await ve.syncLiveRate(),await t(),alert("Sincronización completada exitosamente.")}catch(Q){b(Q.message||"Error al sincronizar tasas.")}finally{x(!1)}},P=j.useMemo(()=>e.filter(Q=>{const[Y,K]=Q.date.split("-").map(Number);return Y===k&&K-1===v}).sort((Q,Y)=>Y.date.localeCompare(Q.date)),[e,v,k]),G=async Q=>{Q.preventDefault();const Y=parseFloat(a),K=parseFloat(i)||Y,ee=parseFloat(o)||K;if(!(isNaN(Y)||Y<=0)){x(!0),b(null);try{const J=u;await ve.saveExchangeRate({date:J,amValue:Y,pmValue:K,parallelValue:ee});const[W,R]=J.split("-").map(Number);y(R-1),_(W),s(""),l(""),d(""),await t(),alert("Tasas registradas correctamente.")}catch{b("Fallo al registrar tasa manual.")}finally{x(!1)}}},H=async()=>{var ee,J,W;if(!C||!T.date)return;const Q=parseFloat(((ee=T.amValue)==null?void 0:ee.toString().replace(",","."))||"0"),Y=parseFloat(((J=T.pmValue)==null?void 0:J.toString().replace(",","."))||"0"),K=parseFloat(((W=T.parallelValue)==null?void 0:W.toString().replace(",","."))||Y.toString());if(isNaN(Q)||isNaN(Y)||isNaN(K)){alert("Error: Valores numéricos inválidos.");return}x(!0);try{const O=await(await ve.saveExchangeRate({...T,amValue:Q,pmValue:Y,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{x(!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(SK,{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(xt,{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(Ha,{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 Q;return(Q=F.current)==null?void 0:Q.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(OA,{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(ya,{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(ik,{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:Q=>y(Number(Q.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:_e.map((Q,Y)=>n.jsx("option",{value:Y,children:Q},Y))})]}),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:k,onChange:Q=>_(Number(Q.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(vl,{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:Q=>f(Q.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:Q=>s(Q.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:Q=>l(Q.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:Q=>d(Q.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:[_e[v]," ",k]})]}),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 Q;return(Q=document.getElementById("manual-form-section"))==null?void 0:Q.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(cb,{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(Q=>{const Y=C===Q.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:Q.date.split("-")[2]}),n.jsx("span",{className:"font-black text-slate-900 text-lg tracking-tighter",children:Q.date})]})}),n.jsx("td",{className:"px-10 py-7 text-center",children:Y?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(Q.amValue)>0?"bg-blue-50 text-blue-600 border border-blue-100":"bg-slate-100 text-slate-300"}`,children:Number(Q.amValue)>0?Number(Q.amValue).toFixed(2):"--.--"})}),n.jsx("td",{className:"px-10 py-7 text-center",children:Y?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(Q.pmValue)>0?"bg-indigo-50 text-indigo-600 border border-indigo-100":"bg-slate-100 text-slate-300"}`,children:Number(Q.pmValue)>0?Number(Q.pmValue).toFixed(2):"--.--"})}),n.jsx("td",{className:"px-10 py-7 text-center",children:Y?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(Q.parallelValue)>0?"bg-amber-50 text-amber-600 border border-amber-100":"bg-slate-100 text-slate-300"}`,children:Number(Q.parallelValue)>0?Number(Q.parallelValue).toFixed(2):"--.--"})}),n.jsx("td",{className:"px-10 py-7 text-right",children:n.jsx("div",{className:"flex justify-end gap-3",children:Y?n.jsxs(n.Fragment,{children:[n.jsx("button",{onClick:H,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(xt,{size:18})})]}):n.jsx("button",{onClick:()=>{E(Q.date),B(Q)},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(vl,{size:18})})})})]},Q.date)})})]})})]})]})]})},TEe=({user:e})=>{const{residents:t,properties:r,fees:a,users:s}=mt(),[i,l]=j.useState(new Date().getMonth()),[o,d]=j.useState(new Date().getFullYear()),[u,f]=j.useState("fee"),[p,x]=j.useState(""),[m,b]=j.useState("Comunicado Importante SAC 2026"),[v,y]=j.useState(!1),[k,_]=j.useState([]),[C,E]=j.useState(0),[T,B]=j.useState(!1),M=(()=>{const P=a.find(G=>G.month===i&&G.year===o);return t.filter(G=>G.isOwner).map(G=>{const H=r.find(J=>J.id===G.propertyId),Q=s.find(J=>J.cedula===G.cedula),Y=G.phone||(Q==null?void 0:Q.phone)||"";let K=0,ee="Pendiente";if(P){const J=P.debts.find(W=>W.propertyId===G.propertyId);J&&(K=Number(J.amountUsd),ee=J.status)}return{id:G.id,name:G.fullName,phone:Y,email:Q==null?void 0:Q.email,telegramId:Q==null?void 0:Q.telegramChatId,propName:H?`${H.type} ${H.number}`:"S/I",debtAmount:K,status:ee,isPaid:ee==="Pagado"}})})(),U=()=>{const P=M.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=k[C];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:* ${_e[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:* ${Mr}

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

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

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

`,G+=`${p}

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

`,G+="_Atentamente, Junta de Condominio El Tejar_");let H=P.phone.trim(),Q="";H.startsWith("+")?Q=H.replace(/\D/g,""):H.startsWith("0")?Q="58"+H.substring(1).replace(/\D/g,""):H.length===10?Q="58"+H.replace(/\D/g,""):Q=H.replace(/\D/g,"");const Y=`https://wa.me/${Q}?text=${encodeURIComponent(G)}`;window.open(Y,"_blank"),C<k.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 ${M.length} propietarios?`))return;y(!0);const G={channel:P,subject:u==="fee"?`Aviso de Cobro SAC 2026 - ${_e[i]} ${o}`:m,messageType:u,customMessage:p,recipients:M.map(H=>({name:H.name,email:H.email,telegramChatId:H.telegramId,amount:H.debtAmount.toFixed(2),status:H.status,propName:H.propName})),monthName:_e[i],year:o};try{const H=await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(G)});if(!H.ok)throw new Error(`HTTP ${H.status}`);const Q=await H.json();Q.status==="success"?alert(`¡Proceso Completado!
Enviados con éxito: ${Q.sent}
Fallidos: ${Q.failed}`):alert("Error en el servidor de envío: "+(Q.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:[M.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(lk,{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:_e.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=>x(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(Pr,{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:M.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(Sl,{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:M.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(rn,{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:M.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&&k.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(rn,{size:24})}),n.jsx("button",{onClick:()=>B(!1),className:"text-slate-400 hover:text-red-500",children:n.jsx(xt,{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 ",C+1," de ",k.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:k[C].name}),n.jsxs("p",{className:"text-xs font-bold text-blue-600 flex items-center gap-2",children:[n.jsx(Bc,{size:12})," ",k[C].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:["$$",k[C].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:`${(C+1)/k.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(EM,{size:18})]}),n.jsx("button",{onClick:()=>E(P=>Math.min(k.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"})]})]})})]})},IEe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,markReceiptSent:i}=mt(),[l,o]=j.useState(new Date().getMonth()),[d,u]=j.useState(new Date().getFullYear()),[f,p]=j.useState(null),[x,m]=j.useState(""),[b,v]=j.useState("standard"),[y,k]=j.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:* ${Mr}`);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(bs,{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 C=(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,_e[l]||""),P=P.replace(/\[telefono\]/g,L.phone||""),P},E=D=>{k(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=j.useMemo(()=>a.filter(D=>D.isOwner).map(D=>{const L=r.find(H=>H.id===D.propertyId),P=s.find(H=>H.cedula===D.cedula),G=B==null?void 0:B.debts.find(H=>H.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=x.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,x]),M=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:C(y,D),subject:b==="standard"?`Aviso de Cobro SAC 2026 - ${_e[l]}`:"Comunicado Condominio El Tejar",recipients:[{name:D.fullName,email:D.email,amount:D.amount,status:D.status,propName:D.propName}],monthName:_e[l],year:d};try{const G=await(await fetch(`${ye}/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:C(y,D),recipients:[{name:D.fullName,telegramChatId:D.telegramId,amount:D.amount,status:D.status,propName:D.propName}],monthName:_e[l],year:d};try{const G=await(await fetch(`${ye}/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:_e.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(lk,{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(WG,{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=>k(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(QK,{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:x,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 *${_e[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:* ${Mr}

¡Muchas gracias!`:C(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(rn,{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(xt,{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(Sl,{size:18})}),n.jsx("button",{onClick:()=>M(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(Pr,{size:18})})]})})]},D.id)})})]})})]})]})},EH=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})},FEe=({user:e,onActionComplete:t})=>{const{polls:r,addPoll:a,closePoll:s,deletePoll:i,submitVote:l,properties:o,residents:d,loading:u,refreshData:f}=mt(),[p,x]=j.useState(null),[m,b]=j.useState(!1),[v,y]=j.useState(""),[k,_]=j.useState(""),[C,E]=j.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=()=>{C.length>=3||E([...C,{id:Date.now(),text:"",type:"single",options:[{id:1,text:"Opción 1"},{id:2,text:"Opción 2"}]}])},M=ee=>{E(C.filter(J=>J.id!==ee))},U=(ee,J,W)=>{E(C.map(R=>R.id===ee?{...R,[J]:W}:R))},D=ee=>{E(C.map(J=>J.id===ee?{...J,options:[...J.options,{id:Date.now(),text:`Opción ${J.options.length+1}`}]}:J))},L=(ee,J,W)=>{E(C.map(R=>R.id===ee?{...R,options:R.options.map(O=>O.id===J?{...O,text:W}:O)}:R))},P=(ee,J)=>{E(C.map(W=>W.id===ee?{...W,options:W.options.filter(R=>R.id!==J)}:W))},G=ee=>{ee.preventDefault();const J={id:Date.now(),title:v,description:k,status:"Abierta",createdAt:new Date().toISOString(),questions:C,responses:[]};a(J),b(!1),H()},H=()=>{y(""),_(""),E([{id:1,text:"",type:"single",options:[{id:1,text:"Opción 1"},{id:2,text:"Opción 2"}]}])},Q=async(ee,J)=>{await l(ee,J),t&&t(),f()},Y=ee=>{const J=ee.responses||[],W=B>0?(J.length/B*100).toFixed(1):"0",R=window.open("","","width=900,height=800");if(!R)return;let O=ee.questions.map(q=>{const z=q.options.map(X=>{const re=J.filter(ne=>ne.answers&&Array.isArray(ne.answers)&&ne.answers.some(ae=>ae.questionId===q.id&&ae.selectedOptionIds&&ae.selectedOptionIds.includes(X.id))).length,le=J.length>0?(re/J.length*100).toFixed(1):"0";return`<tr><td style="padding:8px">${X.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("");R.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> ${EH(ee.createdAt)}</p>
            <p><b>Participación:</b> ${J.length} de ${B} Unidades Inmobiliarias (${W}%)</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>
    `),R.document.close(),R.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(Md,{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(Md,{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(DEe,{poll:ee,user:e,totalUnits:B,isExpanded:p===ee.id,onExpand:()=>x(p===ee.id?null:ee.id),onPrint:()=>Y(ee),onClose:()=>{confirm("¿Cerrar votación?")&&s(ee.id)},onDelete:()=>K(ee.id),onSubmitVote:J=>Q(ee.id,J)},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(Xd,{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(xt,{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:k,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(QV,{className:"text-indigo-600",size:18})," Preguntas"]}),C.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"})]}),C.map((ee,J)=>n.jsxs("div",{className:"bg-slate-50 p-8 rounded-[2.5rem] border border-slate-200 space-y-6 relative",children:[C.length>1&&n.jsx("button",{type:"button",onClick:()=>M(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:W=>U(ee.id,"text",W.target.value),placeholder:`Enunciado de Pregunta ${J+1}`}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[ee.options.map((W,R)=>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:W.text,onChange:O=>L(ee.id,W.id,O.target.value)}),ee.options.length>2&&n.jsx("button",{type:"button",onClick:()=>P(ee.id,W.id),className:"p-2 text-slate-300 hover:text-red-500",children:n.jsx(xt,{size:14})})]},W.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"]})]})]})]})})]})},DEe=({poll:e,user:t,totalUnits:r,isExpanded:a,onExpand:s,onPrint:i,onClose:l,onDelete:o,onSubmitVote:d})=>{var C,E;const u=["admin","programmer","board"].includes(t.role),f=t.role==="owner",p=(e==null?void 0:e.responses)||[],x=p.length,m=r>0?Math.round(x/r*100):0,b=p.some(T=>T.propertyId===(t==null?void 0:t.propertyId)),[v,y]=j.useState([]),k=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 M=[...v];const U=M.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):M.push({questionId:T,selectedOptionIds:[B]}),y(M)};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(Md,{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})," ",x," / ",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: ",EH(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(Nt,{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(Rd,{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(sk,{size:20}):n.jsx(nk,{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:[(C=e.questions)==null?void 0:C.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(M=>{var D,L;const U=(L=(D=v.find(P=>P.questionId===T.id))==null?void 0:D.selectedOptionIds)==null?void 0:L.includes(M.id);return n.jsxs("button",{onClick:()=>_(T.id,M.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:M.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"})})]},M.id)})})]},T.id)}),n.jsx("button",{onClick:k,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 M=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(M/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,"% (",M," 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:[x," de ",r," Unidades"]})]})})]})})]})},SH=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{dataForms:r,addDataForm:a,deleteDataForm:s,toggleDataFormStatus:i,submitDataForm:l,properties:o,residents:d,users:u,loading:f,refreshData:p}=mt(),[x,m]=j.useState(!1),[b,v]=j.useState(null),[y,k]=j.useState(null),[_,C]=j.useState(null),[E,T]=j.useState(""),[B,F]=j.useState(""),[M,U]=j.useState([{id:"f1",label:"",type:"text",required:!0}]),D=["admin","programmer","board"].includes(e.role.toLowerCase()),L=o.length||90;j.useEffect(()=>{const ee=e.propertyId;if(!ee)return;const J=r.find(W=>W.status==="Activo"&&!(W.responses||[]).some(R=>R.propertyId===ee));J&&!D&&(k(J.id),v(J.id))},[r,e.propertyId,D]);const P=()=>{M.length>=20||U([...M,{id:`f${Date.now()}`,label:"",type:"text",required:!0}])},G=(ee,J,W)=>{U(M.map(R=>R.id===ee?{...R,[J]:W}:R))},H=ee=>{U(M.filter(J=>J.id!==ee))},Q=async ee=>{if(ee.preventDefault(),!E||M.some(W=>!W.label)){alert("Complete el título y las etiquetas de todos los campos.");return}const J={title:E,description:B,fields:M};try{await a(J),m(!1),Y()}catch{alert("Error al publicar censo. Verifique sus permisos.")}},Y=()=>{T(""),F(""),U([{id:"f1",label:"",type:"text",required:!0}])},K=async ee=>{try{await l(y,ee),k(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(Xd,{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(lk,{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(MEe,{form:ee,user:e,totalUnits:L,isExpanded:b===ee.id,onExpand:()=>v(b===ee.id?null:ee.id),onFill:()=>k(ee.id),onViewResponses:()=>C(ee.id),onToggleStatus:()=>i(ee.id),onDelete:()=>{confirm("¿Eliminar?")&&s(ee.id)}},ee.id))}),x&&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(xt,{size:24})})]}),n.jsxs("form",{onSubmit:Q,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:M.map((ee,J)=>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:W=>G(ee.id,"label",W.target.value),placeholder:`Etiqueta del Campo ${J+1}`})}),n.jsxs("select",{className:"bg-slate-900 text-white text-[10px] font-black rounded-xl px-3 outline-none",value:ee.type,onChange:W=>G(ee.id,"type",W.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"})]}),M.length>1&&n.jsx("button",{type:"button",onClick:()=>H(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:W=>G(ee.id,"required",W.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(OEe,{formId:y,user:e,onClose:()=>k(null),onSubmit:K}),_&&n.jsx(REe,{formId:_,user:e,properties:o,onClose:()=>C(null)})]})},MEe=({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,x=(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(Xd,{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: ",SH(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(_c,{size:18})}),n.jsx("button",{onClick:o,className:"p-3 rounded-xl bg-slate-50 text-slate-500",children:e.status==="Activo"?n.jsx(Rd,{size:18}):n.jsx(BM,{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})})]}):!x&&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(Bc,{size:14})]}),x&&!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(sk,{size:20}):n.jsx(nk,{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})]})})]})},REe=({formId:e,user:t,properties:r,onClose:a})=>{const{dataForms:s}=mt(),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(po,{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(Nt,{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(xt,{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:SH(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},OEe=({formId:e,user:t,onClose:r,onSubmit:a})=>{const{dataForms:s}=mt(),i=s.find(p=>p.id===e),[l,o]=j.useState({}),[d,u]=j.useState(!1);if(!i)return null;const f=async p=>{if(p.preventDefault(),u(!0),!t.propertyId)return alert("Error: Unidad no vinculada.");const x={propertyId:t.propertyId,userId:t.id,submittedAt:new Date().toISOString(),data:l};await a(x),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(xt,{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:x=>o({...l,[p.id]:x.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"})]})]})})},P2=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})},HE=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}},PEe=({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}=mt(),[x,m]=j.useState(!1),[b,v]=j.useState(!1),[y,k]=j.useState(null),[_,C]=j.useState(""),[E,T]=j.useState(["A favor","En contra","Abstención"]),B=["admin","programmer","board"].includes(e.role),F=r.find(Q=>Q.status==="Activa"),M=d.length;j.useEffect(()=>{let Q;return F?(v(!0),Q=setInterval(()=>{o()},4e3)):v(!1),()=>clearInterval(Q)},[F,o]);const U=()=>{E.length<5&&T([...E,`Opción ${E.length+1}`])},D=Q=>{E.length>2&&T(E.filter((Y,K)=>K!==Q))},L=async Q=>{Q.preventDefault();const Y={question:_,options:E.map((K,ee)=>({id:ee+1,text:K})),status:"Borrador"};await a(Y),m(!1),P(),o()},P=()=>{C(""),T(["A favor","En contra","Abstención"])},G=async Q=>{if(confirm("¿Borrar esta votación?"))try{await l(Q),o()}catch(Y){alert(Y.message)}},H=Q=>{const Y=HE(Q),K=window.open("","","width=850,height=900");if(!K)return;const ee=Q.responses||[],J=M>0?Math.round(ee.length/M*100):0;let W=ee.map(R=>{const O=f.find(re=>re.id===R.userId),q=Q.options.find(re=>re.id===R.optionId),z=u.find(re=>re.cedula===(O==null?void 0:O.cedula)),X=d.find(re=>re.id===(z==null?void 0:z.propertyId));return{usr:O,opt:q,prop:X,date:R.date}}).sort((R,O)=>{var q,z;return(((q=R.prop)==null?void 0:q.code)||"").localeCompare(((z=O.prop)==null?void 0:z.code)||"",void 0,{numeric:!0,sensitivity:"base"})}).map(R=>{var O,q;return`<tr>
            <td style="border:1px solid #e2e8f0;padding:10px">${R.prop?`${R.prop.type} ${R.prop.number} (${R.prop.code})`:"N/A"}</td>
            <td style="border:1px solid #e2e8f0;padding:10px">${(O=R.usr)==null?void 0:O.fullName}</td>
            <td style="border:1px solid #e2e8f0;padding:10px;text-align:center"><b>${(q=R.opt)==null?void 0:q.text}</b></td>
            <td style="border:1px solid #e2e8f0;padding:10px;text-align:right;font-size:8pt">${P2(R.date)}</td>
          </tr>`}).join("");K.document.write(`
          <html><head><title>Acta: ${Q.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> ${Q.question}</p>
                <p><b>Inicio de Sesión (VET):</b> ${P2(Q.createdAt)}</p>
                <p><b>Quórum:</b> ${ee.length} de ${M} Unidades (${J}%)</p>
              </div>
              <h3>RESULTADO DEL ESCRUTINIO:</h3>
              <ul>${Q.options.map(R=>{const O=Y.counts[R.id]||0,q=Y.total>0?Math.round(O/Y.total*100):0;return`<li><b>${R.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>${W}</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(Wf,{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 ",M," 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(LEe,{vote:F,user:e,properties:d,totalUnits:M,onCast:async Q=>{await i(F.id,Q),t&&t()},onClose:()=>{confirm("¿Cerrar?")&&s(F.id,"Finalizada")}}):n.jsx("div",{className:"grid grid-cols-1 gap-6",children:r.filter(Q=>Q.status!=="Activa").map(Q=>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(Wf,{size:28})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xl font-black text-slate-800",children:Q.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 ${Q.status==="Finalizada"?"bg-slate-100":"bg-amber-50 text-amber-600"}`,children:Q.status}),n.jsxs("span",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:["Iniciada: ",P2(Q.createdAt)]})]})]})]}),n.jsxs("div",{className:"flex gap-2",children:[B&&Q.status==="Borrador"&&n.jsxs("button",{onClick:()=>s(Q.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(OV,{size:16})," Activar"]}),n.jsx("button",{onClick:()=>k(Q.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(_c,{size:18})}),n.jsx("button",{onClick:()=>H(Q),className:"p-3 bg-slate-100 text-slate-500 rounded-xl hover:bg-slate-200 transition-all",children:n.jsx(Nt,{size:18})}),B&&n.jsx("button",{onClick:()=>G(Q.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})})]})]},Q.id))}),x&&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(xt,{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:Q=>C(Q.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((Q,Y)=>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:Q,onChange:K=>{const ee=[...E];ee[Y]=K.target.value,T(ee)}}),E.length>2&&n.jsx("button",{type:"button",onClick:()=>D(Y),className:"p-2 text-slate-300 hover:text-red-500",children:n.jsx(xt,{size:16})})]},Y))})]}),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(QEe,{vote:r.find(Q=>Q.id===y),properties:d,onClose:()=>k(null)})]})},LEe=({vote:e,user:t,properties:r,totalUnits:a,onCast:s,onClose:i})=>{const l=j.useMemo(()=>HE(e),[e]),o=["admin","programmer","board"].includes(t.role),d=t.role==="owner",u=(e.responses||[]).some(x=>x.propertyId===t.propertyId),f=a>0?Math.round(l.total/a*100):0,p=j.useMemo(()=>[...r].sort((x,m)=>x.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(x=>{const m=l.total>0?Math.round(l.counts[x.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:x.text}),n.jsxs("span",{className:"text-sm font-black text-blue-600",children:[l.counts[x.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}%`}})})]},x.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(x=>n.jsx("button",{onClick:()=>{confirm(`¿Confirmar voto: ${x.text}?`)&&s(x.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:x.text},x.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(Wf,{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(x=>{const m=(e.responses||[]).some(b=>b.propertyId===x.id);return n.jsx("div",{title:x.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:x.code.split("-")[1]||x.code},x.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"})]})]})]})})]})})})},QEe=({vote:e,properties:t,onClose:r})=>{const a=HE(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(Md,{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(xt,{})})]}),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)})})]})})]})]})})]})})},HEe=()=>{const{exchangeRateHistory:e}=mt(),[t,r]=j.useState(!0),[a,s]=j.useState(""),[i,l]=j.useState([]),[o,d]=j.useState([]),[u,f]=j.useState(!1),[p,x]=j.useState(!1),[m,b]=j.useState(""),v=j.useRef(null),y=j.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]);j.useEffect(()=>{const D=setTimeout(()=>r(!1),600),L=localStorage.getItem("sac_calc_vars");return L&&d(JSON.parse(L)),()=>clearTimeout(D)},[]),j.useEffect(()=>{v.current&&v.current.scrollIntoView({behavior:"smooth"})},[i,a]);const k=D=>{s(a==="Error"?D:L=>L+D)},_=()=>s(""),C=()=>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)},M=()=>{!a||a==="Error"||(b(""),x(!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)),x(!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(gi,{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(G_,{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?C():k(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(rG,{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:M,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(xt,{})}),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(G_,{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(FG,{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:()=>k(D.value),className:"p-1.5 bg-blue-600 text-white rounded-md shadow-sm",children:n.jsx(cK,{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:()=>x(!1),className:"p-1 text-slate-300",children:n.jsx(xt,{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"})]})]})})]})},zEe=()=>{const{fees:e,financialTotals:t,exchangeRateHistory:r}=mt(),[a,s]=j.useState(!1);j.useEffect(()=>{const o=setTimeout(()=>s(!0),300);return()=>clearTimeout(o)},[]);const i=j.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=j.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,x=(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+x-p,k=[...e||[]].sort((D,L)=>L.year*12+L.month-(D.year*12+D.month)).slice(0,6).reverse().map(D=>{var G,H;const L=D.globalStats?D.globalStats.totalBilled:((G=D.debts)==null?void 0:G.reduce((Q,Y)=>Q+Number(Y.amountUsd||0),0))||0,P=D.globalStats?D.globalStats.totalCollected:((H=D.debts)==null?void 0:H.reduce((Q,Y)=>Q+Number(Y.paidAmount||0),0))||0;return{name:_e[D.month].substring(0,3),proyectado:L,cobrado:P}}),_=k.length>0?k.reduce((D,L)=>D+L.cobrado,0)/k.length:1e3,E=x*i*.0033,T=E*30,B=m>0?b/m*100:0,F=x/(m||1)*100,M=p>0?f/p*100:100,U=f/(m||1)*100;return{receivablesUsd:x,cashUsd:f,payablesUsd:p,netPosition:v,historyData:k,lossTodayBs:E,lossMonthBs:T,collectionIndex:B,debtIndex:F,solvencyIndex:M,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(Xu,{label:"NAV (VALOR NETO)",value:`$${l.netPosition.toLocaleString(void 0,{minimumFractionDigits:2})}`,trend:l.netPosition>=0?"up":"down"}),n.jsx(Xu,{label:"TASA SELLO",value:`${i.toFixed(2)} VES`,color:"text-blue-400"}),n.jsx(Xu,{label:"CASH TOTAL (BANCO+CASH)",value:`$${l.cashUsd.toLocaleString()}`}),n.jsx(Xu,{label:"ÍNDICE RECAUDACIÓN",value:`${l.collectionIndex.toFixed(1)}%`,trend:"up"}),n.jsx(Xu,{label:"MOROSIDAD ACUMULADA",value:`$${l.receivablesUsd.toLocaleString()}`,color:"text-rose-400"}),n.jsx(Xu,{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(Jx,{label:"CARTERA POR COBRAR",valUsd:l.receivablesUsd,sub:"Total Morosidad Global",icon:da,color:"emerald"}),n.jsx(Jx,{label:"EGRESOS PENDIENTES",valUsd:l.payablesUsd,sub:"Compromisos Cuentas Pagar",icon:Ab,color:"rose"}),n.jsx(Jx,{label:"LIQUIDEZ TOTAL",valUsd:l.cashUsd,sub:"Suma Banco + Cash USD",icon:Ha,color:"blue"}),n.jsx(Jx,{label:"POSICIÓN NETA",valUsd:l.netPosition,sub:"Patrimonio Común Activo",icon:Dp,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(po,{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(Sk,{width:"100%",height:"100%",minWidth:0,children:n.jsxs(zj,{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(Zb,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),n.jsx(ev,{dataKey:"name",fontSize:12,fontWeight:"bold",axisLine:!1,tickLine:!1,dy:10}),n.jsx(tv,{fontSize:12,fontWeight:"bold",axisLine:!1,tickLine:!1}),n.jsx(Tj,{contentStyle:{borderRadius:"16px",border:"none",boxShadow:"0 20px 25px -5px rgba(0,0,0,0.1)",fontSize:"14px",fontWeight:"bold"}}),n.jsx(IA,{type:"monotone",dataKey:"proyectado",stroke:"#cbd5e1",strokeWidth:1,fill:"transparent",strokeDasharray:"5 5"}),n.jsx(IA,{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(Er,{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(rk,{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(bs,{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(ck,{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(Zx,{label:"COBRANZA",val:`${l.collectionIndex.toFixed(1)}%`,color:"emerald"}),n.jsx(Zx,{label:"DEUDA",val:`${l.debtIndex.toFixed(1)}%`,color:"rose"}),n.jsx(Zx,{label:"SOLVENCIA",val:`${l.solvencyIndex.toFixed(0)}%`,color:"blue"}),n.jsx(Zx,{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(Md,{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(Er,{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;
          }
      `})]})},Xu=({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(rk,{size:10}):n.jsx(lV,{size:10})})]}),Jx=({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})]})]})},Zx=({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})]})},$Ee=({user:e})=>{const{reservations:t,addReservation:r,updateReservationStatus:a,deleteReservation:s,isPoolEnabled:i,togglePoolAvailability:l,properties:o,residents:d,loading:u,refreshData:f}=mt(),[p,x]=j.useState(!1),[m,b]=j.useState({facility:"Caney",whatsapp:e.phone||""}),v=e.role==="programmer",y=["admin","board","programmer"].includes(e.role),k=e.propertyCode||"S/I",_=e.propertyId,C=j.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 M={facility:m.facility,date:m.date,propertyId:F,residentName:e.fullName,whatsapp:m.whatsapp,status:y?"Aprobada":"Pendiente"};try{await r(M),x(!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(Rd,{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(J_,{size:16}):n.jsx(xt,{size:16})," Piscina: ",i?"DISPONIBLE":"BLOQUEADA"]}),n.jsx(J_,{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(q_,{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:()=>x(!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(q_,{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(_M,{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:()=>x(!1),className:"p-3 bg-slate-100 rounded-full hover:bg-slate-200 transition-colors",children:n.jsx(xt,{})})]}),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(M=>M.propertyId===B.id&&M.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:[k," - ",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:C.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"})]})]})})]})},VEe=({user:e})=>{const{announcements:t,addAnnouncement:r,updateAnnouncementStatus:a,deleteAnnouncement:s,refreshData:i,loading:l}=mt(),[o,d]=j.useState(""),[u,f]=j.useState(""),[p,x]=j.useState("Media"),m=["admin","programmer","board"].includes(e.role),b=e.role==="family";j.useEffect(()=>{i()},[]);const v=async C=>{C.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 C=>{confirm("¿ELIMINAR PERMANENTEMENTE? Esta acción borrará el registro de la base de datos de forma irreversible.")&&await s(C)},k=t.filter(C=>C.status==="Publicado"),_=t.filter(C=>C.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(C=>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:C.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:C.date})]}),n.jsx("p",{className:"text-slate-500 text-sm font-medium leading-relaxed",children:C.content}),n.jsxs("p",{className:"text-[10px] font-black text-indigo-600 mt-4 uppercase tracking-widest",children:["Autor original: ",C.author]})]}),n.jsxs("div",{className:"flex gap-2 w-full lg:w-auto",children:[n.jsx("button",{onClick:()=>a(C.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(C.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"})]})]},C.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(qf,{size:32,className:k.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:k.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"})]}):k.map(C=>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:["[",C.date,"]"]}),n.jsx("span",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:C.author})]}),C.priority==="Alta"&&n.jsx(Lc,{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:["» ",C.title]}),n.jsx("p",{className:"text-slate-300 text-lg leading-relaxed font-medium",children:C.content}),m&&n.jsx("button",{onClick:()=>y(C.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})})]},C.id))})]}),n.jsx(qf,{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(vi,{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:C=>d(C.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(C=>n.jsx("button",{type:"button",onClick:()=>x(C),className:`flex-1 py-3 rounded-xl text-[10px] font-black uppercase tracking-widest border transition-all ${p===C?"bg-slate-900 text-white border-slate-900 shadow-lg":"bg-white text-slate-400 border-slate-200 hover:bg-slate-50"}`,children:C},C))})]})]}),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:C=>f(C.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"})]})]})]})]})},GEe=({user:e})=>{const{maintenance:t,addMaintenance:r,updateMaintenanceStatus:a,deleteMaintenance:s,properties:i,residents:l}=mt(),[o,d]=j.useState(!1),[u,f]=j.useState({type:"Servicio",description:""}),p=["admin","programmer","board"].includes(e.role),x=e.role==="family",m=e.propertyCode||"S/I",b=e.propertyId,v=async C=>{C.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 C=>{confirm("¿Borrar ticket de falla permanentemente del historial?")&&await s(C)},k=t.filter(C=>C.status==="Por Aprobar"),_=t.filter(C=>C.status!=="Por Aprobar"&&C.status!=="Rechazada");return n.jsxs("div",{className:"space-y-10 animate-in fade-in duration-500 pb-20",children:[p&&k.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 (",k.length,")"]}),n.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:k.map(C=>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:C.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: ",C.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:['"',C.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:(C.requestedBy||"?")[0]}),n.jsxs("span",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-tight",children:["Reportado por: ",C.requestedBy]})]}),n.jsx("span",{className:"text-[9px] font-black text-slate-300 uppercase",children:C.requestDate})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>a(C.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(C.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"})]})]},C.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(Yf,{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."})]})]}),!x&&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(Ha,{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(C=>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(Yf,{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:C.type}),n.jsx("span",{className:`px-4 py-1 rounded-full text-[9px] font-black uppercase tracking-widest border ${C.status==="Completado"?"bg-emerald-50 text-emerald-600 border-emerald-100":C.status==="En Proceso"?"bg-blue-50 text-blue-600 border-blue-100":"bg-amber-50 text-amber-600 border-amber-100"}`,children:C.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: ",C.propertyCode||"GRAL"]}),p&&n.jsx("button",{onClick:()=>y(C.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:C.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: ",C.requestDate]})]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(eu,{size:10,className:"text-slate-300"}),n.jsxs("span",{className:"text-[9px] font-black text-slate-400 uppercase",children:["Emisor: ",C.requestedBy]})]}),C.attendedAt&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Bc,{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: ",C.attendedAt]})]}),C.closedAt&&n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Bc,{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: ",C.closedAt]})]})]})]})]}),p&&C.status!=="Completado"&&n.jsxs("div",{className:"flex gap-2 w-full lg:w-auto",children:[C.status==="Pendiente"&&n.jsx("button",{onClick:()=>a(C.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(C.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"})]}),C.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})})]},C.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(xt,{})})]}),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:C=>f({...u,propertyId:Number(C.target.value)}),children:[n.jsx("option",{value:"",children:"-- Mantenimiento General --"}),i.map(C=>n.jsx("option",{value:C.id,children:C.code},C.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:C=>f({...u,type:C.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:C=>f({...u,description:C.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"})]})]})})]})},KEe=({user:e})=>{const{assemblies:t,addAssembly:r,deleteAssembly:a,properties:s,refreshData:i}=mt(),[l,o]=j.useState(new Date().getFullYear()),[d,u]=j.useState(new Date().getMonth()),[f,p]=j.useState(!1),[x,m]=j.useState(!1),[b,v]=j.useState(""),[y,k]=j.useState(""),[_,C]=j.useState(""),[E,T]=j.useState([]),[B,F]=j.useState(null),[M,U]=j.useState(""),D=["programmer","admin","board"].includes(e.role);j.useEffect(()=>{(async()=>{const W=await ve.getSystemSettings();v(W.next_assembly_date||"")})()},[]);const L=async()=>{try{await ve.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(J=>J.year===l&&J.month===d),G=s.length,H=async J=>{if(J.preventDefault(),!y||!_)return;const W=G>0?Math.round(E.length/G*100):0,R={title:y,content:_,date:Fr(),month:d,year:l,attendancePropertyIds:E,quorumPercent:W};try{await r(R),p(!1),Q(),alert("Acta guardada exitosamente en el Libro de Asambleas.")}catch{alert("Error al guardar el acta.")}},Q=()=>{k(""),C(""),T([]),U("")},Y=J=>{T(W=>W.includes(J)?W.filter(R=>R!==J):[...W,J])},K=(J,W)=>{J.stopPropagation();const R=window.open("","","width=900,height=900");if(!R)return;const O=s.filter(q=>W.attendancePropertyIds.includes(q.id));R.document.write(`
          <html>
          <head>
              <title>Acta de Asamblea: ${W.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> ${W.title} <br>
                  <b>Fecha:</b> ${W.date} | <b>Periodo:</b> ${_e[W.month]} ${W.year} <br>
                  <b>Quórum Registrado:</b> ${W.quorumPercent}% (${W.attendancePropertyIds.length} de ${G} Unidades)
              </div>
              
              <div class="content">${W.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>
      `),R.document.close(),R.print()},ee=s.filter(J=>J.code.toLowerCase().includes(M.toLowerCase())||J.number.toLowerCase().includes(M.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:J=>u(Number(J.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:_e.map((J,W)=>n.jsx("option",{value:W,children:J},W))}),n.jsx("input",{type:"number",value:l,onChange:J=>o(Number(J.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(Up,{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(J=>n.jsxs("div",{className:`bg-white rounded-[2.5rem] border border-slate-200 overflow-hidden transition-all duration-300 shadow-sm ${B===J.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===J.id?null:J.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:J.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:J.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(DM,{size:12})," Quórum: ",J.quorumPercent,"%"]})]})]})]}),n.jsxs("div",{className:"flex items-center gap-3 mt-6 md:mt-0",children:[n.jsx("button",{onClick:W=>K(W,J),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(Nt,{size:20})}),D&&n.jsx("button",{onClick:W=>{W.stopPropagation(),confirm("¿Eliminar este acta permanentemente?")&&a(J.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===J.id?n.jsx(sk,{size:24}):n.jsx(nk,{size:24})})]})]}),B===J.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:J.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:J.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:`${J.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(W=>J.attendancePropertyIds.includes(W.id)).map(W=>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:W.code},W.id))})]})]})]})})]},J.id))}),x&&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(xt,{})})]}),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:J=>v(J.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: ",_e[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(xt,{size:24})})]}),n.jsxs("form",{onSubmit:H,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:J=>k(J.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:J=>C(J.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:M,onChange:J=>U(J.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(J=>n.jsxs("button",{type:"button",onClick:()=>Y(J.id),className:`flex items-center justify-between p-4 rounded-2xl border transition-all text-left ${E.includes(J.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(J.id)?"text-blue-200":"text-slate-300"}),n.jsx("span",{className:"text-[11px] font-black uppercase tracking-tighter",children:J.code})]}),E.includes(J.id)?n.jsx(Gt,{size:16}):n.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-slate-300"})]},J.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"]})]})]})]})})]})},qEe=({user:e})=>{const{refreshData:t}=mt(),[r,a]=j.useState("db"),[s,i]=j.useState(!1),[l,o]=j.useState(null),[d,u]=j.useState("andresmathison@gmail.com"),[f,p]=j.useState([]),[x,m]=j.useState(""),[b,v]=j.useState(""),[y,k]=j.useState(""),[_,C]=j.useState(""),[E,T]=j.useState(""),[B,F]=j.useState(""),[M,U]=j.useState(""),[D,L]=j.useState(""),[P,G]=j.useState(""),[H,Q]=j.useState(""),[Y,K]=j.useState("0"),[ee,J]=j.useState("0"),[W,R]=j.useState(!1),[O,q]=j.useState(!1);if(j.useEffect(()=>{(async()=>{const ae=await ve.getSystemSettings();L(ae.board_president||""),G(ae.board_secretary||""),Q(ae.board_treasurer||""),K(ae.initial_reserve_bs||"0"),J(ae.initial_cash_usd||"0"),R(ae.system_maintenance_mode==="true"),q(ae.electrical_failure_mode==="true"),m(ae.payment_bank_name||""),v(ae.payment_account_type||""),k(ae.payment_account_number||""),C(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(bs,{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?")&&ve.exportDatabaseSQL()},X=async()=>{i(!0);try{const ae=await(await fetch(`${ye}/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 ve.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 ve.updateSystemSetting("board_president",D),await ve.updateSystemSetting("board_secretary",P),await ve.updateSystemSetting("board_treasurer",H),await ve.updateSystemSetting("initial_reserve_bs",Y),await ve.updateSystemSetting("initial_cash_usd",ee),await ve.updateSystemSetting("payment_bank_name",x),await ve.updateSystemSetting("payment_account_type",b),await ve.updateSystemSetting("payment_account_number",y),await ve.updateSystemSetting("payment_rif",_),await ve.updateSystemSetting("payment_mobile_phone",E),await ve.updateSystemSetting("payment_emails",B),await ve.updateSystemSetting("payment_whatsapp",M),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(Ly,{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(dk,{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(ko,{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(ji,{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(Pr,{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:X,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(Ly,{className:"animate-spin"}):n.jsx(vi,{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:H,onChange:ne=>Q(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:x,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=>k(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=>C(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:M,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:Y,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=>J(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(qV,{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(bs,{size:14})," MODO MANTENIMIENTO"]}),n.jsxs("button",{onClick:async()=>{if(confirm("¿Activar/Desactivar bloqueo global?")){const ne=!W;await ve.toggleMaintenanceMode(ne),R(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 ${W?"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 ${W?"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(ZG,{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(Ly,{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($V,{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(iG,{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(_K,{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(yG,{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(Ha,{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 ve.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."})]})]})]})]})},WEe=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState({size_kb:0,count:0}),[i,l]=j.useState(!0),[o,d]=j.useState(null),[u,f]=j.useState(""),[p,x]=j.useState(null),m=async()=>{l(!0),d(null);try{const E=await ve.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)}};j.useEffect(()=>{e.role==="programmer"&&m()},[e.role]);const b=j.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",M=new Blob([F+B],{type:"text/csv;charset=utf-8;"}),U=URL.createObjectURL(M),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 ve.clearAuditLogs(),m()}catch(E){alert("Error al limpiar: "+E.message)}},k=(a.size_kb/1024).toFixed(2),_=200,C=Math.min(100,parseFloat(k)/_*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(bs,{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(dk,{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(Er,{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(ko,{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:[k," ",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 ${C>80?"bg-red-500":"bg-blue-500"}`,style:{width:`${C}%`}})}),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(Ha,{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(Ha,{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"})]}),C>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 (",k,"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(Pr,{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(ji,{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(ZV,{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(Oc,{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(Er,{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:()=>x(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(_c,{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:()=>x(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(xt,{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"})})]})})]})},YEe=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)})},XEe=({user:e})=>{const{fees:t,announcements:r,reservations:a,assemblies:s,maintenance:i}=mt(),[l,o]=j.useState([]),d=j.useRef(r.length),u=j.useRef(t.length),f=j.useRef(a.length),p=j.useRef(s.length),x=j.useRef(i.length),m=j.useRef(!0),b=(v,y,k,_)=>{const C=Date.now();o(E=>[...E,{id:C,title:v,message:y,type:k}]),YEe(_),setTimeout(()=>o(E=>E.filter(T=>T.id!==C)),8e3)};return j.useEffect(()=>{if(m.current){m.current=!1,d.current=r.length,u.current=t.length,f.current=a.length,p.current=s.length,x.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>x.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,x.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(Ip,{className:"w-5 h-5 text-yellow-600"}),v.type==="info"&&n.jsx(qf,{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(k=>k.id!==v.id)),className:"ml-2 text-gray-400 hover:text-gray-600",children:n.jsx(xt,{className:"w-4 h-4"})})]},v.id))})},JEe=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState(!0),[i,l]=j.useState(""),[o,d]=j.useState(null),u=async()=>{s(!0);try{const x=await ve.getUsers();r(x)}catch(x){console.error(x)}finally{s(!1)}};j.useEffect(()=>{e.role==="programmer"&&u()},[e.role]);const f=async x=>{if(!x.cedula)return alert("Este usuario no tiene cédula registrada.");if(confirm(`¿Resetear la clave de ${x.fullName} a su cédula (${x.cedula}) en formato HASH?`)){d(x.id);try{(await fetch(`${ye}/save_user.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...x,password:x.cedula,status:x.status==="Activo"||x.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(x=>x.fullName.toLowerCase().includes(i.toLowerCase())||(x.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(bs,{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(pG,{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(jA,{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:x=>l(x.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((x,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(x=>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:x.fullName[0]}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-800 text-sm uppercase leading-tight",children:x.fullName}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest mt-0.5",children:x.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:x.cedula||x.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 ${x.role==="programmer"?"bg-blue-50 text-blue-600 border-blue-100":"bg-slate-100 text-slate-500 border-slate-200"}`,children:x.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 ${x.status==="Activo"||x.status==="active"?"bg-emerald-500 animate-pulse":"bg-slate-300"}`}),n.jsx("span",{className:"text-[10px] font-black text-slate-600 uppercase",children:x.status==="active"?"Activo":x.status})]})}),n.jsx("td",{className:"px-8 py-5 text-right",children:n.jsxs("button",{disabled:o===x.id||!x.cedula,onClick:()=>f(x),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===x.id?n.jsx(qi,{className:"animate-spin",size:12}):n.jsx(ct,{size:12}),"Reset a Cédula"]})})]},x.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(bs,{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."})]})]})]})},ZEe=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState(!0),[i,l]=j.useState(""),[o,d]=j.useState(!1),[u,f]=j.useState(null),[p,x]=j.useState([]),[m,b]=j.useState(!1),[v,y]=j.useState(null),[k,_]=j.useState({rif:"",name:"",contactPerson:"",email:"",phonePrimary:"",phoneOffice:"",country:"Venezuela",serviceType:"Mantenimiento",taxAddress:""}),[C,E]=j.useState({year:new Date().getFullYear(),month:-1,search:""}),T=["admin","programmer","board"].includes(e.role),B=async()=>{s(!0);try{const H=await ve.getProviders();r(H)}catch(H){console.error(H)}finally{s(!1)}};j.useEffect(()=>{B()},[]);const F=H=>{H?(y(H.rif),_(H)):(y(null),_({rif:"",name:"",contactPerson:"",email:"",phonePrimary:"",phoneOffice:"",country:"Venezuela",serviceType:"Mantenimiento",taxAddress:""})),d(!0)},M=async H=>{if(H.preventDefault(),!/^[A-Z][0-9]{1,9}$/.test(k.rif)){alert("RIF Inválido: Debe iniciar con letra mayúscula seguida de números, sin guiones (Máx 10 carac).");return}try{await ve.saveProvider(k),d(!1),B()}catch(Y){alert(Y.message)}},U=async H=>{if(confirm(`¿Eliminar al proveedor con RIF ${H}? Se perderá el rastro en el listado desplegable.`))try{await ve.deleteProvider(H),B()}catch{alert("Error al eliminar")}},D=async H=>{f(H),b(!0);try{const Q=await ve.getProviderHistory(H.rif);x(Q)}catch(Q){console.error(Q)}finally{b(!1)}},L=()=>{if(t.length===0)return;const H=window.open("","","width=1000,height=900");if(!H)return;const Q=t.map((Y,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;">${Y.name}</td>
                <td style="padding: 12px; font-size: 11px; font-weight: bold; color: #2563eb;">${Y.rif}</td>
                <td style="padding: 12px; font-size: 11px; color: #475569;">${Y.contactPerson||"-"}</td>
                <td style="padding: 12px; font-size: 11px; color: #475569;">${Y.phonePrimary}</td>
                <td style="padding: 12px; font-size: 10px; font-weight: 900; text-transform: uppercase; color: #64748b;">${Y.serviceType}</td>
                <td style="padding: 12px; font-size: 10px; color: #94a3b8;">${Y.email||"-"}</td>
            </tr>
        `).join("");H.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>${Q}</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>
        `),H.document.close(),H.focus(),setTimeout(()=>{H.print()},500)},P=j.useMemo(()=>t.filter(H=>H.name.toLowerCase().includes(i.toLowerCase())||H.rif.toLowerCase().includes(i.toLowerCase())||H.serviceType.toLowerCase().includes(i.toLowerCase())),[t,i]),G=j.useMemo(()=>p.filter(H=>{const Q=new Date(H.date),Y=Q.getFullYear()===C.year,K=C.month===-1||Q.getMonth()===C.month,ee=H.description.toLowerCase().includes(C.search.toLowerCase())||(H.reference||"").includes(C.search);return Y&&K&&ee}),[p,C]);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(Nt,{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:H=>l(H.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(H=>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:H.name}),n.jsx("p",{className:"text-[10px] font-bold text-blue-500 mt-1 uppercase tracking-widest",children:H.rif})]})]})}),n.jsxs("td",{className:"px-8 py-6",children:[n.jsx("p",{className:"text-sm font-bold text-slate-700",children:H.contactPerson}),n.jsx("p",{className:"text-[10px] text-slate-400 truncate max-w-[150px]",children:H.email})]}),n.jsxs("td",{className:"px-8 py-6",children:[n.jsx("p",{className:"text-xs font-black text-slate-600",children:H.phonePrimary}),H.phoneOffice&&n.jsxs("p",{className:"text-[10px] text-slate-400",children:["Ofic: ",H.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:H.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(H),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(po,{size:18})}),n.jsx("button",{onClick:()=>F(H),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(vl,{size:18})}),n.jsx("button",{onClick:()=>U(H.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})})]})})]},H.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(fb,{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(xt,{size:24})})]}),n.jsxs("form",{onSubmit:M,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:k.rif,onChange:H=>_({...k,rif:H.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:k.name,onChange:H=>_({...k,name:H.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:k.contactPerson,onChange:H=>_({...k,contactPerson:H.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:k.serviceType,onChange:H=>_({...k,serviceType:H.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:k.email,onChange:H=>_({...k,email:H.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:k.phonePrimary,onChange:H=>_({...k,phonePrimary:H.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:k.taxAddress,onChange:H=>_({...k,taxAddress:H.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(po,{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(xt,{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:C.year,onChange:H=>E({...C,year:parseInt(H.target.value)}),children:[2023,2024,2025].map(H=>n.jsx("option",{value:H,children:H},H))})]}),n.jsxs("div",{className:"bg-white border border-slate-200 rounded-xl px-4 py-2 flex items-center gap-3",children:[n.jsx(ik,{size:14,className:"text-slate-400"}),n.jsxs("select",{className:"text-xs font-black uppercase text-slate-700 outline-none bg-transparent",value:C.month,onChange:H=>E({...C,month:parseInt(H.target.value)}),children:[n.jsx("option",{value:-1,children:"Todos los Meses"}),_e.map((H,Q)=>n.jsx("option",{value:Q,children:H},Q))]})]}),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:C.search,onChange:H=>E({...C,search:H.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(H=>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:H.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})," ",H.date]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx(yr,{size:12})," REF: ",H.reference||"S/R"]}),n.jsx("span",{className:"px-2 py-0.5 bg-slate-100 rounded text-[9px]",children:H.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. ",H.amountBs.toLocaleString("es-VE",{minimumFractionDigits:2})]}),n.jsxs("p",{className:"text-[10px] font-black text-slate-400 uppercase tracking-tight",children:["Equiv: $",H.amountUsd.toFixed(2)," USD"]})]})]},H.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((H,Q)=>H+Q.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"})})]})]})})]})},eSe=({user:e})=>{const{transactions:t,refreshData:r,loading:a}=mt(),[s,i]=j.useState(new Date().getMonth()),[l,o]=j.useState(new Date().getFullYear()),[d,u]=j.useState(""),[f,p]=j.useState(!1);j.useEffect(()=>{r()},[]);const x=j.useMemo(()=>t.filter(k=>{var B;if(k.category!=="Comisiones"||k.type!=="Egreso")return!1;const[_,C]=k.date.split("-").map(Number),E=_===l&&C-1===s,T=!d||k.description.toLowerCase().includes(d.toLowerCase())||((B=k.reference)==null?void 0:B.toLowerCase().includes(d.toLowerCase()));return E&&T}).sort((k,_)=>k.date.localeCompare(_.date)),[t,s,l,d]),m=j.useMemo(()=>x.reduce((k,_)=>k+(Number(_.amount)||0),0),[x]),b=j.useMemo(()=>x.reduce((k,_)=>k+(Number(_.amountBs)||0),0),[x]),v=async()=>{if(m<=0){alert("No hay comisiones acumuladas para facturar en este periodo.");return}const k=(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 ${_e[k]} ${_}?`)){p(!0);try{const E=await(await fetch(`${ye}/auto_apply_commissions.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({month:s,year:l,amountUsd:m,amountBs:b,targetMonth:k,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 k=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Reporte de Comisiones - ${_e[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 - ${_e[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>
                ${x.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([k],{type:"text/html"}),C=URL.createObjectURL(_),E=document.createElement("a");E.href=C,E.download=`Comisiones_${_e[s]}_${l}.html`,E.click(),URL.revokeObjectURL(C)};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(gs,{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:k=>i(Number(k.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:_e.map((k,_)=>n.jsx("option",{value:_,children:k},_))}),n.jsx("input",{type:"number",value:l,onChange:k=>o(Number(k.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:k=>u(k.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(Nt,{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(Er,{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:x.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:x.map((k,_)=>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:k.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:k.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: ",k.reference||"S/R"]}),n.jsxs("span",{className:"text-[8px] font-bold text-slate-300 uppercase",children:["AUDIT-ID: ",k.id]})]})]}),n.jsxs("td",{className:"px-10 py-6 text-right font-black text-rose-600",children:["$",Number(k.amount).toFixed(2)]}),n.jsx("td",{className:"px-10 py-6 text-right font-bold text-slate-400",children:Number(k.amountBs).toLocaleString("es-VE",{minimumFractionDigits:2})})]},_))})}),x.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(gi,{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.'})]})]})]})},tSe=({user:e})=>{const{properties:t,fees:r,exchangeRateHistory:a,registerPayment:s,refreshData:i}=mt(),[l,o]=j.useState(null),[d,u]=j.useState([]),[f,p]=j.useState([]),[x,m]=j.useState(!1),[b,v]=j.useState(""),[y,k]=j.useState("TODOS"),_=j.useRef(null),[C,E]=j.useState(null),[T,B]=j.useState(null),[F,M]=j.useState(""),[U,D]=j.useState(""),[L,P]=j.useState("pm"),[G,H]=j.useState(!1),[Q,Y]=j.useState(!1),[K,ee]=j.useState(null),[J,W]=j.useState(!1),R=async ne=>{if(!(!ne||ne==="S/R"||ne.length<3))try{const ie=await(await fetch(`${ye}/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 he;const ae=(he=ne.target.files)==null?void 0:he[0];if(!ae)return;m(!0);const ie=new FormData;ie.append("file",ae),fetch(`${ye}/process_banplus_statement.php`,{method:"POST",body:ie,credentials:"include"}).then(Z=>Z.json()).then(Z=>{if(Z.success){o(Z.metadata);const Ue=(Z.movements||[]).map(Ie=>{if(!(Ie.category==="INGRESOS"||Ie.category==="EGRESOS"))return Ie;const je=Z.movements.some(fe=>fe.reference===Ie.reference&&fe!==Ie&&(fe.category==="COMISIONES"||fe.description.includes("COMISION")));return{...Ie,hasMissingCommission:!je}});u(Ue),p(Z.summary)}else alert(Z.error)}).catch(()=>alert("Error de conexión con el motor de análisis.")).finally(()=>m(!1))},q=j.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(Ue=>Ue.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((Ue,Ie)=>Ie.date.localeCompare(Ue.date)).find(Ue=>Ue.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},X=async()=>{if(!(!C||!T||!F)){if(K&&!J){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}Y(!0);try{const ne=z(U||C.date,L),ae=Number((C.credit/ne).toFixed(2)),ie=await fetch(`${ye}/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:C.reference,date:U||C.date,slot:L,amount_bs:C.credit,skip_commission:G})});if(!ie.ok){const he=await ie.json();throw new Error(he.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{Y(!1)}}},re=j.useMemo(()=>[...t].sort((ne,ae)=>ne.code.localeCompare(ae.code,void 0,{numeric:!0})),[t]),le=j.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(ko,{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:x?n.jsx(ct,{className:"animate-spin",size:40}):n.jsx(OA,{size:40})}),n.jsx("button",{onClick:()=>{var ne;return(ne=_.current)==null?void 0:ne.click()},disabled:x,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:x?"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(Ha,{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(yl,{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(Nt,{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),M(""),D(ne.date),H(ne.hasMissingCommission||!1),ee(null),W(!1),R(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(Gf,{size:16})}):n.jsx("div",{className:"w-10"})})]},ae))})]})})]})]}),C&&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(Gf,{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: #",C.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(xt,{size:24})})]}),n.jsxs("div",{className:"space-y-6",children:[C.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||C.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(Oc,{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||C.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:["$",(C.credit/z(U||C.date,L)).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),n.jsxs("p",{className:"text-[8px] font-bold uppercase mt-2 opacity-50",children:["Bs. ",C.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(gs,{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:()=>H(!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(yl,{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=>M(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:J,onChange:ne=>W(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:Q||!T||!F,onClick:X,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:[Q?n.jsx(ct,{className:"animate-spin"}):n.jsx(Xi,{size:20}),Q?"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."]})]})]})]})})]})},rSe=({user:e})=>{const{properties:t,fees:r,exchangeRateHistory:a,refreshData:s}=mt(),[i,l]=j.useState([]),[o,d]=j.useState(!1),[u,f]=j.useState(""),[p,x]=j.useState("TODOS"),m=j.useRef(null),[b,v]=j.useState(null),[y,k]=j.useState(null),[_,C]=j.useState(""),[E,T]=j.useState(""),[B,F]=j.useState("pm"),[M,U]=j.useState(!1),[D,L]=j.useState(null),[P,G]=j.useState(!1),H=async O=>{if(!(!O||O==="S/R"||O.length<3))try{const z=await(await fetch(`${ye}/check_duplicate_reference.php?reference=${O}`,{credentials:"include"})).json();z.duplicate?L(z):L(null)}catch(q){console.error("Error checking duplicate",q)}},Q=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,he,Z,Ue,Ie,be,je,fe,Me,Xe]=ne,it=at=>{if(!at||at.trim()===""||at.trim()==="0")return 0;const Ct=at.replace(/\./g,"").replace(",",".").trim();return parseFloat(Ct)};return{date:ae.trim(),time:ie.trim(),reference:he.trim(),cod:Z.trim(),type:Ue.trim(),operation:Ie.trim(),description:be.trim(),debit:Math.abs(it(je)),credit:it(fe),balance:it(Me),reference2:Xe?Xe.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,he=Number((ie*.015).toFixed(2)),Z=Number((ie*.003).toFixed(2)),Ue=re.find((Ie,be)=>{if(be===ne||!(Ie.description.toUpperCase().includes("COMISIÓN")||Ie.description.toUpperCase().includes("COMISION")||Ie.operation.toUpperCase().includes("COMISIÓN"))||!(Ie.reference===le.reference||le.reference.length>=8&&Ie.reference.endsWith(le.reference.slice(-8))||Ie.reference.length>=8&&le.reference.endsWith(Ie.reference.slice(-8))))return!1;const Me=Ie.debit||Ie.credit;return Math.abs(Me-he)<.1||Math.abs(Me-Z)<.1});return{...le,hasCommission:!!Ue,commissionPair:Ue}})},Y=O=>{var X;const q=(X=O.target.files)==null?void 0:X[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=Q(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=j.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 X=!0;return p==="INGRESOS"&&(X=O.credit>0&&!O.isCommission),p==="EGRESOS"&&(X=O.debit>0&&!O.isCommission),p==="COMISIONES"&&(X=O.isCommission===!0),z&&X}),[i,u,p]),ee=(O,q)=>{const z=O.split("/");if(z.length!==3)return 45;const X=`${z[2]}-${z[1]}-${z[0]}`,re=a.find(ae=>ae.date===X);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<X);return ne?q==="parallel"&&ne.parallelValue?Number(ne.parallelValue):q==="am"&&ne.amValue?Number(ne.amValue):Number(ne.pmValue)||Number(ne.amValue):45},J=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("/"),X=z.length===3?`${z[2]}-${z[1]}-${z[0]}`:E,re=await fetch(`${ye}/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:X,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)}}},W=j.useMemo(()=>[...t].sort((O,q)=>O.code.localeCompare(q.code,void 0,{numeric:!0})),[t]),R=j.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: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",children:o?n.jsx(ct,{className:"animate-spin",size:40}):n.jsx(OA,{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(Ha,{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:()=>x(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(yl,{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(Nt,{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(gs,{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),k(null),C(""),T(O.date),L(null),G(!1),H(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(Gf,{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(eu,{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(xt,{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(Oc,{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=>k(Number(O.target.value)),children:[n.jsx("option",{value:"",children:"-- Buscar Inmueble --"}),W.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(yl,{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=>C(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))]})]})]})]}),R&&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:["$",R.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:["$",R.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 ${R.pending<=0?"text-emerald-400":"text-rose-400"}`,children:["$",R.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:M||!y||!_,onClick:J,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:[M?n.jsx(ct,{className:"animate-spin"}):n.jsx(Xi,{size:20}),M?"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."]})]})]})]})})]})},aSe=({user:e})=>{const{properties:t,fees:r,exchangeRateHistory:a,refreshData:s}=mt(),[i,l]=j.useState(null),[o,d]=j.useState(!1),[u,f]=j.useState(""),[p,x]=j.useState("TODOS"),m=j.useRef(null),[b,v]=j.useState(null),[y,k]=j.useState(null),[_,C]=j.useState(""),[E,T]=j.useState(""),[B,F]=j.useState(!1),[M,U]=j.useState(!1),[D,L]=j.useState(null),[P,G]=j.useState(!1),H=async R=>{if(!(!R||R==="S/R"||R.length<3))try{const q=await(await fetch(`${ye}/check_duplicate_reference.php?reference=${R}`,{credentials:"include"})).json();q.duplicate?L(q):L(null)}catch(O){console.error("Error checking duplicate",O)}},Q=R=>{var z;const O=(z=R.target.files)==null?void 0:z[0];if(!O)return;d(!0);const q=new FormData;q.append("file",O),fetch(`${ye}/process_banplus_detailed.php`,{method:"POST",body:q,credentials:"include"}).then(X=>X.json()).then(X=>{X.success?l(X):alert(X.error||"Fallo en el protocolo de lectura.")}).catch(()=>alert("Error crítico en el Kernel de Auditoría.")).finally(()=>d(!1))},Y=R=>{if(!R)return 45;const O=a.find(X=>X.date===R);if(O)return Number(O.pmValue)||Number(O.amValue);const z=[...a].sort((X,re)=>re.date.localeCompare(X.date)).find(X=>X.date<R);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 R=Y(E||b.date),O=Number((b.credit/R).toFixed(2)),q=await fetch(`${ye}/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(R){alert("Error al vincular: "+R.message)}finally{U(!1)}}},ee=j.useMemo(()=>{if(!_||!y)return null;const R=r.find(q=>q.id===_),O=R==null?void 0:R.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]),J=j.useMemo(()=>[...t].sort((R,O)=>R.code.localeCompare(O.code,void 0,{numeric:!0})),[t]),W=j.useMemo(()=>i?i.movements.filter(R=>{const O=(R.credit||R.debit).toString(),q=R.desc.includes(u.toUpperCase())||R.ref.includes(u)||O.includes(u),z=p==="TODOS"||R.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(Pc,{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:Q,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(OA,{size:40})}),n.jsx("button",{onClick:()=>{var R;return(R=m.current)==null?void 0:R.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:R=>f(R.target.value)})]}),n.jsx("div",{className:"flex gap-2 w-full lg:w-auto",children:["TODOS","INGRESOS_OPERATIVOS","COMISION_BANCARIA"].map(R=>n.jsx("button",{onClick:()=>x(R),className:`flex-1 lg:flex-none px-6 py-4 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${p===R?"bg-slate-900 text-white shadow-lg":"bg-slate-50 text-slate-400"}`,children:R.replace("_"," ")},R))})]}),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(Nt,{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:W.map((R,O)=>n.jsxs("tr",{className:`hover:bg-slate-50 transition-all group ${R.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:R.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:["#",R.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:R.desc}),n.jsxs("span",{className:"text-[8px] font-bold text-slate-400 uppercase tracking-tighter",children:["Canal: ",R.channel]})]}),R.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 ${R.type==="INGRESO"?"text-emerald-600":"text-rose-600"}`,children:[R.type==="INGRESO"?"+":"-"," ",(R.credit||R.debit).toLocaleString("es-VE",{minimumFractionDigits:2})]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:R.credit>0&&R.category==="INGRESOS_OPERATIVOS"?n.jsx("button",{onClick:()=>{v(R),k(null),C(""),T(R.date),F(R.hasMissingCommission||!1),L(null),G(!1),H(R.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(Gf,{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(Gf,{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(xt,{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:R=>T(R.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:[Y(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/Y(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(gs,{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:R=>k(Number(R.target.value)),children:[n.jsx("option",{value:"",children:"-- Seleccionar --"}),J.map(R=>n.jsxs("option",{value:R.id,children:[R.code," - ",R.type," ",R.number]},R.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(yl,{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:R=>C(R.target.value),children:[n.jsx("option",{value:"",children:"-- Seleccionar --"}),r.map(R=>n.jsxs("option",{value:R.id,children:[_e[R.month].toUpperCase()," ",R.year]},R.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((R,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:R.date}),n.jsxs("span",{className:"font-black",children:["Bs. ",Number(R.amount_bs||R.amount).toLocaleString()]}),n.jsx("span",{children:R.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:R=>G(R.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:M||!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:[M?n.jsx(ct,{className:"animate-spin"}):n.jsx(Xi,{size:20}),M?"SELLANDO LIBROS...":"CONFIRMAR VINCULACIÓN"]})]})]})})]})},nSe=({user:e})=>{const[t,r]=j.useState(null),[a,s]=j.useState(!1),[i,l]=j.useState(""),[o,d]=j.useState("TODOS"),u=j.useRef(null),[f,p]=j.useState(new Date().getMonth()+1),[x,m]=j.useState(new Date().getFullYear()),[b,v]=j.useState(null),y=T=>{s(!0);const B=new FormData;B.append("file",T),B.append("month",f.toString()),B.append("year",x.toString()),fetch(`${ye}/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))},k=T=>{var F;const B=(F=T.target.files)==null?void 0:F[0];B&&(v(B),y(B))},_=j.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]),C=[{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(kA,{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",x.toString()),s(!0),fetch(`${ye}/process_bank_vs_bank.php`,{method:"POST",body:F,credentials:"include"}).then(M=>M.json()).then(M=>{M.success&&r(M)}).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:C.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:x,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(`${ye}/process_bank_vs_bank.php`,{method:"POST",body:F,credentials:"include"}).then(M=>M.json()).then(M=>{M.success&&r(M)}).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:k,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(ko,{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(Ha,{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(Pc,{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]);zc("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(Nt,{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(bs,{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;
          }
      `})]})},sSe=({user:e})=>{const[t,r]=j.useState(null),[a,s]=j.useState(!1),[i,l]=j.useState(""),[o,d]=j.useState("TODOS"),u=j.useRef(null),[f,p]=j.useState(new Date().getMonth()+1),[x,m]=j.useState(new Date().getFullYear()),b=E=>{const T=E.split(`
`),B=T.findIndex(M=>M.includes("Fecha	Hora	Referencia"));return B===-1?[]:T.slice(B+1).map(M=>{const U=M.split("	");if(U.length<10)return null;const[D,L,P,G,H,Q,Y,K,ee,J,W]=U,R=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:Y.trim(),amount:R(ee)||-Math.abs(R(K)),type:R(ee)>0?"INGRESO":"EGRESO"}}).filter(M=>M!==null&&M.date)},v=async E=>{s(!0);try{const T=await E.text(),B=b(T),M=await(await fetch(`${ye}/get_system_bank_movements.php?month=${f}&year=${x}`,{credentials:"include"})).json();if(!M.success)throw new Error(M.error);const U=M.movements,D=[];let L=0;B.forEach(P=>{if(P.amount===0)return;U.find(H=>H.reference===P.reference||P.reference.length>=8&&H.reference.endsWith(P.reference.slice(-8))||H.reference.length>=8&&P.reference.endsWith(H.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)},k=j.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"}],C=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(kA,{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:x,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:C.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(ko,{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(Ha,{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(Pc,{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=k.map(B=>[B.date,B.ref,B.desc,`$${Number(B.amount).toFixed(2)}`,B.type]);zc("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(Nt,{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:k.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."})}):k.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(bs,{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."})]})]})},iSe=({user:e})=>{const[t,r]=j.useState(null),[a,s]=j.useState(!0),[i,l]=j.useState(""),[o,d]=j.useState(""),[u,f]=j.useState(!1),[p,x]=j.useState({amount:"",currency:"USD",reference:"",date:Fr(),months:"1"}),m=async()=>{s(!0);try{const y=await(await fetch(`${ye}/get_license_status.php`)).json();r(y),l(y.expiration_date),d(y.monthly_rate)}catch(v){console.error(v)}finally{s(!1)}};j.useEffect(()=>{m()},[]);const b=async(v,y)=>{if(confirm(`¿Ejecutar acción: ${v.toUpperCase()}?`)){f(!0);try{(await fetch(`${ye}/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"&&x({amount:"",currency:"USD",reference:"",date:Fr(),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(bs,{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(Rd,{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(dk,{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(Up,{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(Ip,{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=>x({...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=>x({...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=>x({...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=>x({...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(Rd,{size:48}):n.jsx(BM,{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"})]})]})]})]})]})},lSe=({user:e})=>{const[t,r]=j.useState(!1),[a,s]=j.useState(null),i=j.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 x=>{var m;try{const b=(m=x.target)==null?void 0:m.result,v=o(b);if(v.length===0)throw new Error("El archivo está vacío.");const k=await(await fetch(`${ye}/bulk_load_properties.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rows:v})})).json();s(k)}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(x=>x.trim().replace(/"/g,"")),p=[];for(let x=1;x<u.length;x++){if(!u[x].trim())continue;const m=u[x].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(OA,{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(yl,{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..."})]})})]})]})},oSe=({user:e})=>{const[t,r]=j.useState(!1),[a,s]=j.useState(null),i=j.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 x=>{var m;try{const b=(m=x.target)==null?void 0:m.result,v=o(b);if(v.length===0)throw new Error("Archivo inválido.");const k=await(await fetch(`${ye}/bulk_load_users.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rows:v})})).json();s(k)}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(x=>x.trim().replace(/"/g,"")),p=[];for(let x=1;x<u.length;x++){if(!u[x].trim())continue;const m=u[x].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(jA,{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(OA,{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(yl,{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(jA,{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"})]})})]})]})},cSe=({user:e})=>{const{exchangeRateHistory:t}=mt(),[r,a]=j.useState(new Date().getMonth()),[s,i]=j.useState(new Date().getFullYear()),[l,o]=j.useState(!1),[d,u]=j.useState([]),[f,p]=j.useState(10),x=()=>{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]=j.useState(x()),v=async()=>{o(!0);try{const T=await(await fetch(`${ye}/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))},k=()=>{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 - ${_e[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>${ba}</p>
            <p>Periodo: ${_e[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>$${C.subtotal.toFixed(2)}</span></div>
            <div class="total-row" style="color: #94a3b8"><span>Fondo de Reserva (${f}%):</span> <span>$${C.reserve.toFixed(2)}</span></div>
            <div class="total-row grand-total"><span>TOTAL PROYECTADO:</span> <span>$${C.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. ${C.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),M=document.createElement("a");M.href=F,M.download=`Simulacion_${_e[r]}_${s}.html`,document.body.appendChild(M),M.click(),document.body.removeChild(M),URL.revokeObjectURL(F)},_=async()=>{const E=`Simulación de Cuota ${_e[r]} ${s} - ${ba}
Total Proyectado: $${C.totalUsd.toFixed(2)} (Bs. ${C.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)}},C=j.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),M=T+B+F,U=M*(f/100),D=M+U,L=D*m;return{subFixed:T,subVariable:B,subOther:F,subtotal:M,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:_e.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(Vf,{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(Pc,{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:["$",C.subFixed.toFixed(2)]})]}),n.jsxs("div",{className:"space-y-3",children:[d.filter(E=>E.category==="fixed").map(E=>n.jsx(L2,{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:["$",C.subVariable.toFixed(2)]})]}),n.jsxs("div",{className:"space-y-3",children:[d.filter(E=>E.category==="variable").map(E=>n.jsx(L2,{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:["$",C.subOther.toFixed(2)]})]}),n.jsxs("div",{className:"space-y-3",children:[d.filter(E=>E.category==="other").map(E=>n.jsx(L2,{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(gi,{className:"text-blue-600"})," Resultados Proyectados"]}),n.jsxs("div",{className:"flex items-center gap-2 mb-8 no-print",children:[n.jsxs("button",{onClick:k,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(Jd,{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(Nt,{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(ya,{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:["$",C.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:["+$",C.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:C.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. ",C.totalBs.toLocaleString("es-VE",{minimumFractionDigits:2})]})]}),n.jsx(Ki,{className:"text-blue-500/20",size:40})]}),n.jsx(Ha,{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".'})]})]})]})})]})]})},L2=({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(jM,{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)]})})]}),dSe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,financialTotals:i,markReceiptSent:l,latestRate:o}=mt(),[d,u]=j.useState(new Date().getMonth()),[f,p]=j.useState(new Date().getFullYear()),[x,m]=j.useState(null),[b,v]=j.useState("selection"),[y,k]=j.useState(null),[_,C]=j.useState({});j.useEffect(()=>{(async()=>{try{const Q=await ve.getSystemSettings();C(Q||{})}catch(Q){console.error("Error fetching settings",Q)}})()},[]);const E=j.useMemo(()=>t.find(H=>H.month===d&&H.year===f),[t,d,f]),T=j.useMemo(()=>r.find(H=>H.id===x),[r,x]),B=j.useMemo(()=>{if(!T)return null;const H=a.find(Y=>Y.propertyId===T.id&&Y.isOwner),Q=s.find(Y=>Y.cedula===(H==null?void 0:H.cedula));return{fullName:(H==null?void 0:H.fullName)||"Propietario",email:(Q==null?void 0:Q.email)||"",phone:(H==null?void 0:H.phone)||(Q==null?void 0:Q.phone)||"",telegramId:(Q==null?void 0:Q.telegramChatId)||"",propertyCode:T.code,propertyId:T.id,role:"owner"}},[T,a,s]),F=H=>Number(H).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),M=H=>Number(H).toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2}),U=H=>{if(!H)return"";let Q=H.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,"")},D=async()=>{if(!(B!=null&&B.email)||!E)return alert("Datos insuficientes.");k("email");const H=E.debts.find(K=>K.propertyId===x),Q=H?(Number(H.amountUsd)-Number(H.paidAmount)).toFixed(2):"0.00",Y={channel:"email",messageType:"fee",subject:`Aviso de Cobro SAC 2026 - ${_e[d]}`,recipients:[{name:B.fullName,email:B.email,amount:Q,status:(H==null?void 0:H.status)||"Pendiente",propName:`${T==null?void 0:T.type} ${T==null?void 0:T.number}`}],monthName:_e[d],year:f};try{const ee=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(Y)})).json();ee.status==="success"?(await l(E.id,x,"email"),alert("¡Éxito! Email entregado.")):alert("Error: "+ee.message)}catch{alert("Fallo de red.")}finally{k(null)}},L=async()=>{if(!(B!=null&&B.telegramId)||!E)return alert("Datos insuficientes.");k("telegram");const H=E.debts.find(K=>K.propertyId===x),Q=H?(Number(H.amountUsd)-Number(H.paidAmount)).toFixed(2):"0.00",Y={channel:"telegram",messageType:"fee",recipients:[{name:B.fullName,telegramChatId:B.telegramId,amount:Q,status:(H==null?void 0:H.status)||"Pendiente",propName:`${T==null?void 0:T.type} ${T==null?void 0:T.number}`}],monthName:_e[d],year:f};try{const ee=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(Y)})).json();ee.status==="success"?(await l(E.id,x,"telegram"),alert("¡Éxito! Telegram enviado.")):alert("Error: "+ee.message)}catch{alert("Fallo de red.")}finally{k(null)}},P=()=>{if(G(),B&&E){const H=U(B.phone);if(H){const Q=E.debts.find(ee=>ee.propertyId===x),Y=Q?(Number(Q.amountUsd)-Number(Q.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 *${_e[d]} ${f}*.

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

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

🔗 *ACCEDER AL PORTAL:* ${Mr}

¡Muchas gracias!`;window.open(`https://wa.me/${H}?text=${encodeURIComponent(K)}`,"_blank"),l(E.id,x,"whatsapp")}else alert("El usuario no tiene un teléfono registrado para WhatsApp.")}},G=()=>{if(!T||!B||!E)return;const H=E.debts.find(ie=>ie.propertyId===x),Q=Number(T.aliquot)||0,Y=!!T.hasUncommonExpense,K=r.filter(ie=>ie.hasUncommonExpense).length,ee=ie=>{var Ie,be;const he=Number(ie.amountUsd)||0;let Z=0,Ue="";if(ie.isSpecial){const je=((Ie=ie.specialPropertyIds)==null?void 0:Ie.length)||1,fe=(be=ie.specialPropertyIds)==null?void 0:be.includes(x);Z=fe?he/je:0,Ue=fe?`ESP (1/${je})`:"Exento"}else ie.isUncommon?(Z=Y&&K>0?he/K:0,Ue=Y&&K>0?`GNC (1/${K})`:"Exento"):(Z=he*(Q/100),Ue=`ALIQ (${Q.toFixed(4)}%)`);return{...ie,global:he,myPortion:Z,basisDesc:Ue}},J=[{title:"Gastos Fijos",items:E.fixedExpenses.map(ee)},{title:"Gastos Variables",items:E.variableExpenses.map(ee)},{title:"Otros Gastos",items:E.otherExpenses.map(ee)}],W=J.reduce((ie,he)=>ie+he.items.reduce((Z,Ue)=>Z+Ue.myPortion,0),0);J.reduce((ie,he)=>ie+he.items.reduce((Z,Ue)=>Z+Ue.global,0),0);const R=Number(E.reserveFundPercent)||10,O=W*(R/100),z=(W+O-(H?Number(H.paidAmount):0)).toFixed(2),X=ie=>ie.map(he=>`
                <tr>
                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-transform: uppercase;">${he.description}</td>
                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 10px; text-align: center; color: #64748b;">${he.basisDesc}</td>
                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-align: right;">$ ${F(he.global)}</td>
                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: 11px; text-align: right; font-weight: 700; background: #f8fafc;">$ ${F(he.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">${ba}</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}) / ${Q.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: ${_e[d].toUpperCase()} ${f}</div>
            <div>TASA: Bs. ${o.toFixed(2)}</div>
        </div>

        ${J.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>
                    ${X(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(W)}</div>
                </div>
                <div>
                    <div class="total-label">Fondo Reserva (${R}%)</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. ${M(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}_${_e[d]}.html`,ae.click(),URL.revokeObjectURL(ne)};if(b==="breakdown"&&E&&T&&B){const H=async ae=>{{if(navigator.share)try{await navigator.share({title:`Aviso de Cobro - ${T.code}`,text:le.replace(/\*/g,""),url:Mr})}catch(ie){console.warn("Share failed",ie)}else alert("La función de compartir no está disponible en este navegador.");return}},Q=Number(T.aliquot)||0,Y=!!T.hasUncommonExpense,K=r.filter(ae=>ae.hasUncommonExpense).length,ee=ae=>{var Ue,Ie;const ie=Number(ae.amountUsd)||0;let he=0,Z="";if(ae.isSpecial){const be=((Ue=ae.specialPropertyIds)==null?void 0:Ue.length)||1,je=(Ie=ae.specialPropertyIds)==null?void 0:Ie.includes(x);he=je?ie/be:0,Z=je?`ESP (1/${be})`:"Exento"}else ae.isUncommon?(he=Y&&K>0?ie/K:0,Z=Y&&K>0?`GNC (1/${K})`:"Exento"):(he=ie*(Q/100),Z=`ALIQ (${Q.toFixed(4)}%)`);return{...ae,global:ie,myPortion:he,basisDesc:Z}},J=[{title:"Gastos Fijos",items:E.fixedExpenses.map(ee)},{title:"Gastos Variables",items:E.variableExpenses.map(ee)},{title:"Otros Gastos",items:E.otherExpenses.map(ee)}],W=J.reduce((ae,ie)=>ae+ie.items.reduce((he,Z)=>he+Z.myPortion,0),0),R=J.reduce((ae,ie)=>ae+ie.items.reduce((he,Z)=>he+Z.global,0),0),O=Number(E.reserveFundPercent)||10,q=W*(O/100),z=W+q,X=E.debts.find(ae=>ae.propertyId===x),re=(z-(X?Number(X.paidAmount):0)).toFixed(2),le=`🏢 *AVISO DE COBRO - SAC 2026*

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

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

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

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

¡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(ms,{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(Nt,{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(Er,{size:20})}),ne&&n.jsx("a",{href:`https://wa.me/${ne}?text=${encodeURIComponent(le)}`,target:"_blank",rel:"noreferrer",onClick:()=>l(E.id,x,"whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Enviar WhatsApp",children:n.jsx(rn,{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(Er,{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(Sl,{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(Pr,{size:20})}),n.jsx("button",{onClick:()=>H(),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir",children:n.jsx(ya,{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:[_e[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. ",M((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:[Q.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:J.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((he,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:[he.isSpecial?n.jsx(ub,{size:12,className:"text-amber-500 no-print"}):he.isUncommon?n.jsx(Lc,{size:12,className:"text-indigo-500 no-print",fill:"currentColor"}):n.jsx("div",{className:"w-3 no-print"}),he.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:he.basisDesc})}),n.jsxs("td",{className:"py-4 text-xs font-black text-right text-slate-400 print:py-0.5",children:["$",F(he.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(he.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(W)]})]}),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(R)]})]})]})]}),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(Pr,{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. ",M(Number(re)*o)]})]}),n.jsx(Ki,{size:32,className:"text-blue-400 opacity-50 print:w-6 print:h-6"})]})]}),n.jsx(Dp,{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:H=>u(Number(H.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:_e.map((H,Q)=>n.jsx("option",{value:Q,children:H},Q))}),n.jsx("input",{type:"number",value:f,onChange:H=>p(Number(H.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(PA,{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:x||"",onChange:H=>m(Number(H.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((H,Q)=>H.code.localeCompare(Q.code,void 0,{numeric:!0})).map(H=>n.jsxs("option",{value:H.id,children:[H.code," - ",H.type," ",H.number]},H.id))]})]}),n.jsx("button",{disabled:!x||!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 FC=function(e,t){return FC=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])},FC(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");FC(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var DC=function(){return DC=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},DC.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 Co=(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})(),xv=function(e,t){return Co.fromClientRect(e,t.getBoundingClientRect())},uSe=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 Co(0,0,a,s)},mv=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},ga=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},mU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ASe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var tm=0;tm<mU.length;tm++)ASe[mU.charCodeAt(tm)]=tm;var gU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Nf=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var rm=0;rm<gU.length;rm++)Nf[gU.charCodeAt(rm)]=rm;var fSe=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=Nf[e.charCodeAt(a)],l=Nf[e.charCodeAt(a+1)],o=Nf[e.charCodeAt(a+2)],d=Nf[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},pSe=function(e){for(var t=e.length,r=[],a=0;a<t;a+=2)r.push(e[a+1]<<8|e[a]);return r},hSe=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},Dd=5,zE=11,Q2=2,xSe=zE-Dd,BH=65536>>Dd,mSe=1<<Dd,H2=mSe-1,gSe=1024>>Dd,bSe=BH+gSe,vSe=bSe,ySe=32,wSe=vSe+ySe,NSe=65536>>zE,CSe=1<<xSe,kSe=CSe-1,bU=function(e,t,r){return e.slice?e.slice(t,r):new Uint16Array(Array.prototype.slice.call(e,t,r))},jSe=function(e,t,r){return e.slice?e.slice(t,r):new Uint32Array(Array.prototype.slice.call(e,t,r))},ESe=function(e,t){var r=fSe(e),a=Array.isArray(r)?hSe(r):new Uint32Array(r),s=Array.isArray(r)?pSe(r):new Uint16Array(r),i=24,l=bU(s,i/2,a[4]/2),o=a[5]===2?bU(s,(i+a[4])/2):jSe(a,Math.ceil((i+a[4])/4));return new SSe(a[0],a[1],a[2],a[3],l,o)},SSe=(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>>Dd],r=(r<<Q2)+(t&H2),this.data[r];if(t<=65535)return r=this.index[BH+(t-55296>>Dd)],r=(r<<Q2)+(t&H2),this.data[r];if(t<this.highStart)return r=wSe-NSe+(t>>zE),r=this.index[r],r+=t>>Dd&kSe,r=this.index[r],r=(r<<Q2)+(t&H2),this.data[r];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e})(),vU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",BSe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var am=0;am<vU.length;am++)BSe[vU.charCodeAt(am)]=am;var _Se=" ",yU=50,TSe=1,_H=2,TH=3,ISe=4,FSe=5,wU=7,IH=8,NU=9,wc=10,UC=11,CU=12,MC=13,DSe=14,Cf=15,RC=16,nm=17,cf=18,USe=19,kU=20,OC=21,df=22,z2=23,Ju=24,Fs=25,kf=26,jf=27,Zu=28,MSe=29,bd=30,RSe=31,sm=32,im=33,PC=34,LC=35,QC=36,Sp=37,HC=38,Mm=39,Rm=40,$2=41,FH=42,OSe=43,PSe=[9001,65288],DH="!",zt="×",lm="÷",zC=ESe(_Se),Zl=[bd,QC],$C=[TSe,_H,TH,FSe],UH=[wc,IH],jU=[jf,kf],LSe=$C.concat(UH),EU=[HC,Mm,Rm,PC,LC],QSe=[Cf,MC],HSe=function(e,t){t===void 0&&(t="strict");var r=[],a=[],s=[];return e.forEach(function(i,l){var o=zC.get(i);if(o>yU?(s.push(!0),o-=yU):s.push(!1),["normal","auto","loose"].indexOf(t)!==-1&&[8208,8211,12316,12448].indexOf(i)!==-1)return a.push(l),r.push(RC);if(o===ISe||o===UC){if(l===0)return a.push(l),r.push(bd);var d=r[l-1];return LSe.indexOf(d)===-1?(a.push(a[l-1]),r.push(d)):(a.push(l),r.push(bd))}if(a.push(l),o===RSe)return r.push(t==="strict"?OC:Sp);if(o===FH||o===MSe)return r.push(bd);if(o===OSe)return i>=131072&&i<=196605||i>=196608&&i<=262141?r.push(Sp):r.push(bd);r.push(o)}),[a,r,s]},V2=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!==wc)break}if(s===wc)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!==wc)break}if(o!==wc)break}return!1},SU=function(e,t){for(var r=e;r>=0;){var a=t[r];if(a===wc)r--;else return a}return 0},zSe=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===_H&&f===TH)return zt;if($C.indexOf(d)!==-1)return DH;if($C.indexOf(f)!==-1||UH.indexOf(f)!==-1)return zt;if(SU(i,t)===IH)return lm;if(zC.get(e[i])===UC||(d===sm||d===im)&&zC.get(e[o])===UC||d===wU||f===wU||d===NU||[wc,MC,Cf].indexOf(d)===-1&&f===NU||[nm,cf,USe,Ju,Zu].indexOf(f)!==-1||SU(i,t)===df||V2(z2,df,i,t)||V2([nm,cf],OC,i,t)||V2(CU,CU,i,t))return zt;if(d===wc)return lm;if(d===z2||f===z2)return zt;if(f===RC||d===RC)return lm;if([MC,Cf,OC].indexOf(f)!==-1||d===DSe||u===QC&&QSe.indexOf(d)!==-1||d===Zu&&f===QC||f===kU||Zl.indexOf(f)!==-1&&d===Fs||Zl.indexOf(d)!==-1&&f===Fs||d===jf&&[Sp,sm,im].indexOf(f)!==-1||[Sp,sm,im].indexOf(d)!==-1&&f===kf||Zl.indexOf(d)!==-1&&jU.indexOf(f)!==-1||jU.indexOf(d)!==-1&&Zl.indexOf(f)!==-1||[jf,kf].indexOf(d)!==-1&&(f===Fs||[df,Cf].indexOf(f)!==-1&&t[o+1]===Fs)||[df,Cf].indexOf(d)!==-1&&f===Fs||d===Fs&&[Fs,Zu,Ju].indexOf(f)!==-1)return zt;if([Fs,Zu,Ju,nm,cf].indexOf(f)!==-1)for(var p=i;p>=0;){var x=t[p];if(x===Fs)return zt;if([Zu,Ju].indexOf(x)!==-1)p--;else break}if([jf,kf].indexOf(f)!==-1)for(var p=[nm,cf].indexOf(d)!==-1?l:i;p>=0;){var x=t[p];if(x===Fs)return zt;if([Zu,Ju].indexOf(x)!==-1)p--;else break}if(HC===d&&[HC,Mm,PC,LC].indexOf(f)!==-1||[Mm,PC].indexOf(d)!==-1&&[Mm,Rm].indexOf(f)!==-1||[Rm,LC].indexOf(d)!==-1&&f===Rm||EU.indexOf(d)!==-1&&[kU,kf].indexOf(f)!==-1||EU.indexOf(f)!==-1&&d===jf||Zl.indexOf(d)!==-1&&Zl.indexOf(f)!==-1||d===Ju&&Zl.indexOf(f)!==-1||Zl.concat(Fs).indexOf(d)!==-1&&f===df&&PSe.indexOf(e[o])===-1||Zl.concat(Fs).indexOf(f)!==-1&&d===cf)return zt;if(d===$2&&f===$2){for(var m=r[i],b=1;m>0&&(m--,t[m]===$2);)b++;if(b%2!==0)return zt}return d===sm&&f===im?zt:lm},$Se=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var r=HSe(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,bd,FH].indexOf(o)!==-1?Sp: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]},VSe=(function(){function e(t,r,a,s){this.codePoints=t,this.required=r===DH,this.start=a,this.end=s}return e.prototype.slice=function(){return ga.apply(void 0,this.codePoints.slice(this.start,this.end))},e})(),GSe=function(e,t){var r=mv(e),a=$Se(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=zSe(r,i,s,++u,l))===zt;);if(f!==zt||u===o){var p=new VSe(r,f,d,u);return d=u,{value:p,done:!1}}return{done:!0,value:null}}}},KSe=1,qSe=2,lh=4,BU=8,Zg=10,_U=47,Lf=92,WSe=9,YSe=32,om=34,uf=61,XSe=35,JSe=36,ZSe=37,cm=39,dm=40,Af=41,e4e=95,fs=45,t4e=33,r4e=60,a4e=62,n4e=64,s4e=91,i4e=93,l4e=61,o4e=123,um=63,c4e=125,TU=124,d4e=126,u4e=128,IU=65533,G2=42,kd=43,A4e=44,f4e=58,p4e=59,Bp=46,h4e=0,x4e=8,m4e=11,g4e=14,b4e=31,v4e=127,dl=-1,MH=48,RH=97,OH=101,y4e=102,w4e=117,N4e=122,PH=65,LH=69,QH=70,C4e=85,k4e=90,Un=function(e){return e>=MH&&e<=57},j4e=function(e){return e>=55296&&e<=57343},eA=function(e){return Un(e)||e>=PH&&e<=QH||e>=RH&&e<=y4e},E4e=function(e){return e>=RH&&e<=N4e},S4e=function(e){return e>=PH&&e<=k4e},B4e=function(e){return E4e(e)||S4e(e)},_4e=function(e){return e>=u4e},Am=function(e){return e===Zg||e===WSe||e===YSe},eb=function(e){return B4e(e)||_4e(e)||e===e4e},FU=function(e){return eb(e)||Un(e)||e===fs},T4e=function(e){return e>=h4e&&e<=x4e||e===m4e||e>=g4e&&e<=b4e||e===v4e},xc=function(e,t){return e!==Lf?!1:t!==Zg},fm=function(e,t,r){return e===fs?eb(t)||xc(t,r):eb(e)?!0:!!(e===Lf&&xc(e,t))},K2=function(e,t,r){return e===kd||e===fs?Un(t)?!0:t===Bp&&Un(r):Un(e===Bp?t:e)},I4e=function(e){var t=0,r=1;(e[t]===kd||e[t]===fs)&&(e[t]===fs&&(r=-1),t++);for(var a=[];Un(e[t]);)a.push(e[t++]);var s=a.length?parseInt(ga.apply(void 0,a),10):0;e[t]===Bp&&t++;for(var i=[];Un(e[t]);)i.push(e[t++]);var l=i.length,o=l?parseInt(ga.apply(void 0,i),10):0;(e[t]===LH||e[t]===OH)&&t++;var d=1;(e[t]===kd||e[t]===fs)&&(e[t]===fs&&(d=-1),t++);for(var u=[];Un(e[t]);)u.push(e[t++]);var f=u.length?parseInt(ga.apply(void 0,u),10):0;return r*(s+o*Math.pow(10,-l))*Math.pow(10,d*f)},F4e={type:2},D4e={type:3},U4e={type:4},M4e={type:13},R4e={type:8},O4e={type:21},P4e={type:9},L4e={type:10},Q4e={type:11},H4e={type:12},z4e={type:14},pm={type:23},$4e={type:1},V4e={type:25},G4e={type:24},K4e={type:26},q4e={type:27},W4e={type:28},Y4e={type:29},X4e={type:31},VC={type:32},HH=(function(){function e(){this._value=[]}return e.prototype.write=function(t){this._value=this._value.concat(mv(t))},e.prototype.read=function(){for(var t=[],r=this.consumeToken();r!==VC;)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 XSe:var r=this.peekCodePoint(0),a=this.peekCodePoint(1),s=this.peekCodePoint(2);if(FU(r)||xc(a,s)){var i=fm(r,a,s)?qSe:KSe,l=this.consumeName();return{type:5,value:l,flags:i}}break;case JSe:if(this.peekCodePoint(0)===uf)return this.consumeCodePoint(),M4e;break;case cm:return this.consumeStringToken(cm);case dm:return F4e;case Af:return D4e;case G2:if(this.peekCodePoint(0)===uf)return this.consumeCodePoint(),z4e;break;case kd:if(K2(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case A4e:return U4e;case fs:var o=t,d=this.peekCodePoint(0),u=this.peekCodePoint(1);if(K2(o,d,u))return this.reconsumeCodePoint(t),this.consumeNumericToken();if(fm(o,d,u))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();if(d===fs&&u===a4e)return this.consumeCodePoint(),this.consumeCodePoint(),G4e;break;case Bp:if(K2(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case _U:if(this.peekCodePoint(0)===G2)for(this.consumeCodePoint();;){var f=this.consumeCodePoint();if(f===G2&&(f=this.consumeCodePoint(),f===_U))return this.consumeToken();if(f===dl)return this.consumeToken()}break;case f4e:return K4e;case p4e:return q4e;case r4e:if(this.peekCodePoint(0)===t4e&&this.peekCodePoint(1)===fs&&this.peekCodePoint(2)===fs)return this.consumeCodePoint(),this.consumeCodePoint(),V4e;break;case n4e:var p=this.peekCodePoint(0),x=this.peekCodePoint(1),m=this.peekCodePoint(2);if(fm(p,x,m)){var l=this.consumeName();return{type:7,value:l}}break;case s4e:return W4e;case Lf:if(xc(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();break;case i4e:return Y4e;case l4e:if(this.peekCodePoint(0)===uf)return this.consumeCodePoint(),R4e;break;case o4e:return Q4e;case c4e:return H4e;case w4e:case C4e:var b=this.peekCodePoint(0),v=this.peekCodePoint(1);return b===kd&&(eA(v)||v===um)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(t),this.consumeIdentLikeToken();case TU:if(this.peekCodePoint(0)===uf)return this.consumeCodePoint(),P4e;if(this.peekCodePoint(0)===TU)return this.consumeCodePoint(),O4e;break;case d4e:if(this.peekCodePoint(0)===uf)return this.consumeCodePoint(),L4e;break;case dl:return VC}return Am(t)?(this.consumeWhiteSpace(),X4e):Un(t)?(this.reconsumeCodePoint(t),this.consumeNumericToken()):eb(t)?(this.reconsumeCodePoint(t),this.consumeIdentLikeToken()):{type:6,value:ga(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();eA(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(ga.apply(void 0,t.map(function(d){return d===um?MH:d})),16),i=parseInt(ga.apply(void 0,t.map(function(d){return d===um?QH:d})),16);return{type:30,start:s,end:i}}var l=parseInt(ga.apply(void 0,t),16);if(this.peekCodePoint(0)===fs&&eA(this.peekCodePoint(1))){this.consumeCodePoint(),r=this.consumeCodePoint();for(var o=[];eA(r)&&o.length<6;)o.push(r),r=this.consumeCodePoint();var i=parseInt(ga.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)===Af)?(this.consumeCodePoint(),{type:22,value:a.value}):(this.consumeBadUrlRemnants(),pm)}for(;;){var s=this.consumeCodePoint();if(s===dl||s===Af)return{type:22,value:ga.apply(void 0,t)};if(Am(s))return this.consumeWhiteSpace(),this.peekCodePoint(0)===dl||this.peekCodePoint(0)===Af?(this.consumeCodePoint(),{type:22,value:ga.apply(void 0,t)}):(this.consumeBadUrlRemnants(),pm);if(s===om||s===cm||s===dm||T4e(s))return this.consumeBadUrlRemnants(),pm;if(s===Lf)if(xc(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===Af||t===dl)return;xc(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+=ga.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===Zg)return this._value.splice(0,a),$4e;if(s===Lf){var i=this._value[a+1];i!==dl&&i!==void 0&&(i===Zg?(r+=this.consumeStringSlice(a),a=-1,this._value.shift()):xc(s,i)&&(r+=this.consumeStringSlice(a),r+=ga(this.consumeEscapedCodePoint()),a=-1))}a++}while(!0)},e.prototype.consumeNumber=function(){var t=[],r=lh,a=this.peekCodePoint(0);for((a===kd||a===fs)&&t.push(this.consumeCodePoint());Un(this.peekCodePoint(0));)t.push(this.consumeCodePoint());a=this.peekCodePoint(0);var s=this.peekCodePoint(1);if(a===Bp&&Un(s))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),r=BU;Un(this.peekCodePoint(0));)t.push(this.consumeCodePoint());a=this.peekCodePoint(0),s=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((a===LH||a===OH)&&((s===kd||s===fs)&&Un(i)||Un(s)))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),r=BU;Un(this.peekCodePoint(0));)t.push(this.consumeCodePoint());return[I4e(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===ZSe?(this.consumeCodePoint(),{type:16,number:r,flags:a}):{type:17,number:r,flags:a}},e.prototype.consumeEscapedCodePoint=function(){var t=this.consumeCodePoint();if(eA(t)){for(var r=ga(t);eA(this.peekCodePoint(0))&&r.length<6;)r+=ga(this.consumeCodePoint());Am(this.peekCodePoint(0))&&this.consumeCodePoint();var a=parseInt(r,16);return a===0||j4e(a)||a>1114111?IU:a}return t===dl?IU:t},e.prototype.consumeName=function(){for(var t="";;){var r=this.consumeCodePoint();if(FU(r))t+=ga(r);else if(xc(r,this.peekCodePoint(0)))t+=ga(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(r),t}},e})(),zH=(function(){function e(t){this._tokens=t}return e.create=function(t){var r=new HH;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||Z4e(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"?VC:t},e.prototype.reconsumeToken=function(t){this._tokens.unshift(t)},e})(),oh=function(e){return e.type===15},n0=function(e){return e.type===17},mr=function(e){return e.type===20},J4e=function(e){return e.type===0},GC=function(e,t){return mr(e)&&e.value===t},$H=function(e){return e.type!==31},MA=function(e){return e.type!==31&&e.type!==4},Il=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},Z4e=function(e,t){return t===11&&e.type===12||t===28&&e.type===29?!0:t===2&&e.type===3},Rc=function(e){return e.type===17||e.type===15},Ta=function(e){return e.type===16||Rc(e)},VH=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},Nn={type:17,number:0,flags:lh},$E={type:16,number:50,flags:lh},Nc={type:16,number:100,flags:lh},Ef=function(e,t,r){var a=e[0],s=e[1];return[jr(a,t),jr(typeof s<"u"?s:a,r)]},jr=function(e,t){if(e.type===16)return e.number/100*t;if(oh(e))switch(e.unit){case"rem":case"em":return 16*e.number;case"px":default:return e.number}return e.number},GH="deg",KH="grad",qH="rad",WH="turn",gv={name:"angle",parse:function(e,t){if(t.type===15)switch(t.unit){case GH:return Math.PI*t.number/180;case KH:return Math.PI/200*t.number;case qH:return t.number;case WH:return Math.PI*2*t.number}throw new Error("Unsupported angle type")}},YH=function(e){return e.type===15&&(e.unit===GH||e.unit===KH||e.unit===qH||e.unit===WH)},XH=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 xi(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[Nn,Nc];case"to right":case"left":return xi(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Nc,Nc];case"to bottom":case"top":return xi(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Nc,Nn];case"to left":case"right":return xi(270)}return 0},xi=function(e){return Math.PI*e/180},Ec={name:"color",parse:function(e,t){if(t.type===18){var r=eBe[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 Cc(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 Cc(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 Cc(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 Cc(parseInt(a,16),parseInt(s,16),parseInt(i,16),parseInt(l,16)/255)}}if(t.type===20){var o=fo[t.value.toUpperCase()];if(typeof o<"u")return o}return fo.TRANSPARENT}},Sc=function(e){return(255&e)===0},qa=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+")"},Cc=function(e,t,r,a){return(e<<24|t<<16|r<<8|Math.round(a*255)<<0)>>>0},DU=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},UU=function(e,t){var r=t.filter(MA);if(r.length===3){var a=r.map(DU),s=a[0],i=a[1],l=a[2];return Cc(s,i,l,1)}if(r.length===4){var o=r.map(DU),s=o[0],i=o[1],l=o[2],d=o[3];return Cc(s,i,l,d)}return 0};function q2(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 MU=function(e,t){var r=t.filter(MA),a=r[0],s=r[1],i=r[2],l=r[3],o=(a.type===17?xi(a.number):gv.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)?jr(l,1):1;if(d===0)return Cc(u*255,u*255,u*255,1);var p=u<=.5?u*(d+1):u+d-u*d,x=u*2-p,m=q2(x,p,o+1/3),b=q2(x,p,o),v=q2(x,p,o-1/3);return Cc(m*255,b*255,v*255,f)},eBe={hsl:MU,hsla:MU,rgb:UU,rgba:UU},Qf=function(e,t){return Ec.parse(e,zH.create(t).parseComponentValue())},fo={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},tBe={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})}},rBe={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},bv=function(e,t){var r=Ec.parse(e,t[0]),a=t[1];return a&&Ta(a)?{color:r,stop:a}:{color:r,stop:null}},RU=function(e,t){var r=e[0],a=e[e.length-1];r.stop===null&&(r.stop=Nn),a.stop===null&&(a.stop=Nc);for(var s=[],i=0,l=0;l<e.length;l++){var o=e[l].stop;if(o!==null){var d=jr(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,x=s[u-1],m=(f-x)/(p+1),b=1;b<=p;b++)s[u+b-1]=m*b;u=null}}return e.map(function(v,y){var k=v.color;return{color:k,stop:Math.max(Math.min(1,s[y]/t),0)}})},aBe=function(e,t,r){var a=t/2,s=r/2,i=jr(e[0],t)-a,l=s-jr(e[1],r);return(Math.atan2(l,i)+Math.PI*2)%(Math.PI*2)},nBe=function(e,t,r){var a=typeof e=="number"?e:aBe(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)},OU=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},sBe=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=OU(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=OU(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=jr(e.size[0],a),l=e.size.length===2?jr(e.size[1],s):i),[i,l]},iBe=function(e,t){var r=xi(180),a=[];return Il(t).forEach(function(s,i){if(i===0){var l=s[0];if(l.type===20&&l.value==="to"){r=XH(s);return}else if(YH(l)){r=gv.parse(e,l);return}}var o=bv(e,s);a.push(o)}),{angle:r,stops:a,type:1}},hm=function(e,t){var r=xi(180),a=[];return Il(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=XH(s);return}else if(YH(l)){r=(gv.parse(e,l)+xi(270))%xi(360);return}}var o=bv(e,s);a.push(o)}),{angle:r,stops:a,type:1}},lBe=function(e,t){var r=xi(180),a=[],s=1,i=0,l=3,o=[];return Il(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=Ec.parse(e,f.values[0]);a.push({stop:Nn,color:p})}else if(f.name==="to"){var p=Ec.parse(e,f.values[0]);a.push({stop:Nc,color:p})}else if(f.name==="color-stop"){var x=f.values.filter(MA);if(x.length===2){var p=Ec.parse(e,x[1]),m=x[0];n0(m)&&a.push({stop:{type:16,number:m.number*100,flags:m.flags},color:p})}}}}),s===1?{angle:(r+xi(180))%xi(360),stops:a,type:s}:{size:l,shape:i,stops:a,position:o,type:s}},JH="closest-side",ZH="farthest-side",ez="closest-corner",tz="farthest-corner",rz="circle",az="ellipse",nz="cover",sz="contain",oBe=function(e,t){var r=0,a=3,s=[],i=[];return Il(t).forEach(function(l,o){var d=!0;if(o===0){var u=!1;d=l.reduce(function(p,x){if(u)if(mr(x))switch(x.value){case"center":return i.push($E),p;case"top":case"left":return i.push(Nn),p;case"right":case"bottom":return i.push(Nc),p}else(Ta(x)||Rc(x))&&i.push(x);else if(mr(x))switch(x.value){case rz:return r=0,!1;case az:return r=1,!1;case"at":return u=!0,!1;case JH:return a=0,!1;case nz:case ZH:return a=1,!1;case sz:case ez:return a=2,!1;case tz:return a=3,!1}else if(Rc(x)||Ta(x))return Array.isArray(a)||(a=[]),a.push(x),!1;return p},d)}if(d){var f=bv(e,l);s.push(f)}}),{size:a,shape:r,stops:s,position:i,type:2}},xm=function(e,t){var r=0,a=3,s=[],i=[];return Il(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($E),!1;case"top":case"left":return i.push(Nn),!1;case"right":case"bottom":return i.push(Nc),!1}else if(Ta(p)||Rc(p))return i.push(p),!1;return f},d):o===1&&(d=l.reduce(function(f,p){if(mr(p))switch(p.value){case rz:return r=0,!1;case az:return r=1,!1;case sz:case JH:return a=0,!1;case ZH:return a=1,!1;case ez:return a=2,!1;case nz:case tz:return a=3,!1}else if(Rc(p)||Ta(p))return Array.isArray(a)||(a=[]),a.push(p),!1;return f},d)),d){var u=bv(e,l);s.push(u)}}),{size:a,shape:r,stops:s,position:i,type:2}},cBe=function(e){return e.type===1},dBe=function(e){return e.type===2},VE={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=iz[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 uBe(e){return!(e.type===20&&e.value==="none")&&(e.type!==18||!!iz[e.name])}var iz={"linear-gradient":iBe,"-moz-linear-gradient":hm,"-ms-linear-gradient":hm,"-o-linear-gradient":hm,"-webkit-linear-gradient":hm,"radial-gradient":oBe,"-moz-radial-gradient":xm,"-ms-radial-gradient":xm,"-o-radial-gradient":xm,"-webkit-radial-gradient":xm,"-webkit-gradient":lBe},ABe={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 MA(a)&&uBe(a)}).map(function(a){return VE.parse(e,a)})}},fBe={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})}},pBe={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return Il(t).map(function(r){return r.filter(Ta)}).map(VH)}},hBe={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return Il(t).map(function(r){return r.filter(mr).map(function(a){return a.value}).join(" ")}).map(xBe)}},xBe=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}},CA;(function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"})(CA||(CA={}));var mBe={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return Il(t).map(function(r){return r.filter(gBe)})}},gBe=function(e){return mr(e)||Ta(e)},vv=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},bBe=vv("top"),vBe=vv("right"),yBe=vv("bottom"),wBe=vv("left"),yv=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(t,r){return VH(r.filter(Ta))}}},NBe=yv("top-left"),CBe=yv("top-right"),kBe=yv("bottom-right"),jBe=yv("bottom-left"),wv=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}}},EBe=wv("top"),SBe=wv("right"),BBe=wv("bottom"),_Be=wv("left"),Nv=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(t,r){return oh(r)?r.number:0}}},TBe=Nv("top"),IBe=Nv("right"),FBe=Nv("bottom"),DBe=Nv("left"),UBe={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},MBe={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){switch(t){case"rtl":return 1;case"ltr":default:return 0}}},RBe={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(mr).reduce(function(r,a){return r|OBe(a.value)},0)}},OBe=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},PBe={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}},LBe={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}},tb;(function(e){e.NORMAL="normal",e.STRICT="strict"})(tb||(tb={}));var QBe={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"strict":return tb.STRICT;case"normal":default:return tb.NORMAL}}},HBe={name:"line-height",initialValue:"normal",prefix:!1,type:4},PU=function(e,t){return mr(e)&&e.value==="normal"?1.2*t:e.type===17?t*e.number:Ta(e)?jr(e,t):t},zBe={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return t.type===20&&t.value==="none"?null:VE.parse(e,t)}},$Be={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}}},KC={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}}},Cv=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},VBe=Cv("top"),GBe=Cv("right"),KBe=Cv("bottom"),qBe=Cv("left"),WBe={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}})}},YBe={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"}}},kv=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},XBe=kv("top"),JBe=kv("right"),ZBe=kv("bottom"),e_e=kv("left"),t_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}}},r_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}},a_e={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.length===1&&GC(t[0],"none")?[]:Il(t).map(function(r){for(var a={color:fo.TRANSPARENT,offsetX:Nn,offsetY:Nn,blur:Nn},s=0,i=0;i<r.length;i++){var l=r[i];Rc(l)?(s===0?a.offsetX=l:s===1?a.offsetY=l:a.blur=l,s++):a.color=Ec.parse(e,l)}return a})}},n_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}},s_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=o_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}},i_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},l_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},o_e={matrix:i_e,matrix3d:l_e},LU={type:16,number:50,flags:lh},c_e=[LU,LU],d_e={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var r=t.filter(Ta);return r.length!==2?c_e:[r[0],r[1]]}},u_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}}},Hf;(function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"})(Hf||(Hf={}));var A_e={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return Hf.BREAK_ALL;case"keep-all":return Hf.KEEP_ALL;case"normal":default:return Hf.NORMAL}}},f_e={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(t.type===20)return{auto:!0,order:0};if(n0(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},lz={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")}},p_e={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return n0(t)?t.number:1}},h_e={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},x_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})}},m_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+"'"})}},g_e={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},b_e={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){if(n0(t))return t.number;if(mr(t))switch(t.value){case"bold":return 700;case"normal":default:return 400}return 400}},v_e={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(mr).map(function(r){return r.value})}},y_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},w_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}},N_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($H),i=0;i<s.length;i++){var l=s[i],o=s[i+1];if(l.type===20){var d=o&&n0(o)?o.number:1;a.push({counter:l.value,increment:d})}}return a}},C_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($H),s=0;s<a.length;s++){var i=a[s],l=a[s+1];if(mr(i)&&i.value!=="none"){var o=l&&n0(l)?l.number:0;r.push({counter:i.value,reset:o})}}return r}},k_e={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(oh).map(function(r){return lz.parse(e,r)})}},j_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(J4e);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}},QU=function(e,t,r){if(!e)return"";var a=e[Math.min(t,e.length-1)];return a?r?a.open:a.close:""},E_e={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.length===1&&GC(t[0],"none")?[]:Il(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];GC(l,"inset")?a.inset=!0:Rc(l)?(s===0?a.offsetX=l:s===1?a.offsetY=l:s===2?a.blur=l:a.spread=l,s++):a.color=Ec.parse(e,l)}return a})}},S_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}},B_e={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},__e={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return oh(t)?t.number:0}},T_e=(function(){function e(t,r){var a,s;this.animationDuration=nt(t,k_e,r.animationDuration),this.backgroundClip=nt(t,tBe,r.backgroundClip),this.backgroundColor=nt(t,rBe,r.backgroundColor),this.backgroundImage=nt(t,ABe,r.backgroundImage),this.backgroundOrigin=nt(t,fBe,r.backgroundOrigin),this.backgroundPosition=nt(t,pBe,r.backgroundPosition),this.backgroundRepeat=nt(t,hBe,r.backgroundRepeat),this.backgroundSize=nt(t,mBe,r.backgroundSize),this.borderTopColor=nt(t,bBe,r.borderTopColor),this.borderRightColor=nt(t,vBe,r.borderRightColor),this.borderBottomColor=nt(t,yBe,r.borderBottomColor),this.borderLeftColor=nt(t,wBe,r.borderLeftColor),this.borderTopLeftRadius=nt(t,NBe,r.borderTopLeftRadius),this.borderTopRightRadius=nt(t,CBe,r.borderTopRightRadius),this.borderBottomRightRadius=nt(t,kBe,r.borderBottomRightRadius),this.borderBottomLeftRadius=nt(t,jBe,r.borderBottomLeftRadius),this.borderTopStyle=nt(t,EBe,r.borderTopStyle),this.borderRightStyle=nt(t,SBe,r.borderRightStyle),this.borderBottomStyle=nt(t,BBe,r.borderBottomStyle),this.borderLeftStyle=nt(t,_Be,r.borderLeftStyle),this.borderTopWidth=nt(t,TBe,r.borderTopWidth),this.borderRightWidth=nt(t,IBe,r.borderRightWidth),this.borderBottomWidth=nt(t,FBe,r.borderBottomWidth),this.borderLeftWidth=nt(t,DBe,r.borderLeftWidth),this.boxShadow=nt(t,E_e,r.boxShadow),this.color=nt(t,UBe,r.color),this.direction=nt(t,MBe,r.direction),this.display=nt(t,RBe,r.display),this.float=nt(t,PBe,r.cssFloat),this.fontFamily=nt(t,m_e,r.fontFamily),this.fontSize=nt(t,g_e,r.fontSize),this.fontStyle=nt(t,y_e,r.fontStyle),this.fontVariant=nt(t,v_e,r.fontVariant),this.fontWeight=nt(t,b_e,r.fontWeight),this.letterSpacing=nt(t,LBe,r.letterSpacing),this.lineBreak=nt(t,QBe,r.lineBreak),this.lineHeight=nt(t,HBe,r.lineHeight),this.listStyleImage=nt(t,zBe,r.listStyleImage),this.listStylePosition=nt(t,$Be,r.listStylePosition),this.listStyleType=nt(t,KC,r.listStyleType),this.marginTop=nt(t,VBe,r.marginTop),this.marginRight=nt(t,GBe,r.marginRight),this.marginBottom=nt(t,KBe,r.marginBottom),this.marginLeft=nt(t,qBe,r.marginLeft),this.opacity=nt(t,p_e,r.opacity);var i=nt(t,WBe,r.overflow);this.overflowX=i[0],this.overflowY=i[i.length>1?1:0],this.overflowWrap=nt(t,YBe,r.overflowWrap),this.paddingTop=nt(t,XBe,r.paddingTop),this.paddingRight=nt(t,JBe,r.paddingRight),this.paddingBottom=nt(t,ZBe,r.paddingBottom),this.paddingLeft=nt(t,e_e,r.paddingLeft),this.paintOrder=nt(t,S_e,r.paintOrder),this.position=nt(t,r_e,r.position),this.textAlign=nt(t,t_e,r.textAlign),this.textDecorationColor=nt(t,h_e,(a=r.textDecorationColor)!==null&&a!==void 0?a:r.color),this.textDecorationLine=nt(t,x_e,(s=r.textDecorationLine)!==null&&s!==void 0?s:r.textDecoration),this.textShadow=nt(t,a_e,r.textShadow),this.textTransform=nt(t,n_e,r.textTransform),this.transform=nt(t,s_e,r.transform),this.transformOrigin=nt(t,d_e,r.transformOrigin),this.visibility=nt(t,u_e,r.visibility),this.webkitTextStrokeColor=nt(t,B_e,r.webkitTextStrokeColor),this.webkitTextStrokeWidth=nt(t,__e,r.webkitTextStrokeWidth),this.wordBreak=nt(t,A_e,r.wordBreak),this.zIndex=nt(t,f_e,r.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},e.prototype.isTransparent=function(){return Sc(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})(),I_e=(function(){function e(t,r){this.content=nt(t,w_e,r.content),this.quotes=nt(t,j_e,r.quotes)}return e})(),HU=(function(){function e(t,r){this.counterIncrement=nt(t,N_e,r.counterIncrement),this.counterReset=nt(t,C_e,r.counterReset)}return e})(),nt=function(e,t,r){var a=new HH,s=r!==null&&typeof r<"u"?r.toString():t.initialValue;a.write(s);var i=new zH(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 gv.parse(e,i.parseComponentValue());case"color":return Ec.parse(e,i.parseComponentValue());case"image":return VE.parse(e,i.parseComponentValue());case"length":var o=i.parseComponentValue();return Rc(o)?o:Nn;case"length-percentage":var d=i.parseComponentValue();return Ta(d)?d:Nn;case"time":return lz.parse(e,i.parseComponentValue())}break}},F_e="data-html2canvas-debug",D_e=function(e){var t=e.getAttribute(F_e);switch(t){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},qC=function(e,t){var r=D_e(e);return r===1||t===r},Fl=(function(){function e(t,r){if(this.context=t,this.textNodes=[],this.elements=[],this.flags=0,qC(r,3))debugger;this.styles=new T_e(t,window.getComputedStyle(r,null)),XC(r)&&(this.styles.animationDuration.some(function(a){return a>0})&&(r.style.animationDuration="0s"),this.styles.transform!==null&&(r.style.transform="none")),this.bounds=xv(this.context,r),qC(r,4)&&(this.flags|=16)}return e})(),U_e=" ",zU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sf=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var mm=0;mm<zU.length;mm++)Sf[zU.charCodeAt(mm)]=mm;var M_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=Sf[e.charCodeAt(a)],l=Sf[e.charCodeAt(a+1)],o=Sf[e.charCodeAt(a+2)],d=Sf[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},R_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},O_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},Ud=5,GE=11,W2=2,P_e=GE-Ud,oz=65536>>Ud,L_e=1<<Ud,Y2=L_e-1,Q_e=1024>>Ud,H_e=oz+Q_e,z_e=H_e,$_e=32,V_e=z_e+$_e,G_e=65536>>GE,K_e=1<<P_e,q_e=K_e-1,$U=function(e,t,r){return e.slice?e.slice(t,r):new Uint16Array(Array.prototype.slice.call(e,t,r))},W_e=function(e,t,r){return e.slice?e.slice(t,r):new Uint32Array(Array.prototype.slice.call(e,t,r))},Y_e=function(e,t){var r=M_e(e),a=Array.isArray(r)?O_e(r):new Uint32Array(r),s=Array.isArray(r)?R_e(r):new Uint16Array(r),i=24,l=$U(s,i/2,a[4]/2),o=a[5]===2?$U(s,(i+a[4])/2):W_e(a,Math.ceil((i+a[4])/4));return new X_e(a[0],a[1],a[2],a[3],l,o)},X_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>>Ud],r=(r<<W2)+(t&Y2),this.data[r];if(t<=65535)return r=this.index[oz+(t-55296>>Ud)],r=(r<<W2)+(t&Y2),this.data[r];if(t<this.highStart)return r=V_e-G_e+(t>>GE),r=this.index[r],r+=t>>Ud&q_e,r=this.index[r],r=(r<<W2)+(t&Y2),this.data[r];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e})(),VU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",J_e=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var gm=0;gm<VU.length;gm++)J_e[VU.charCodeAt(gm)]=gm;var Z_e=1,X2=2,J2=3,GU=4,KU=5,eTe=7,qU=8,Z2=9,eN=10,WU=11,YU=12,XU=13,JU=14,tN=15,tTe=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},rTe=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},aTe=Y_e(U_e),di="×",rN="÷",nTe=function(e){return aTe.get(e)},sTe=function(e,t,r){var a=r-2,s=t[a],i=t[r-1],l=t[r];if(i===X2&&l===J2)return di;if(i===X2||i===J2||i===GU||l===X2||l===J2||l===GU)return rN;if(i===qU&&[qU,Z2,WU,YU].indexOf(l)!==-1||(i===WU||i===Z2)&&(l===Z2||l===eN)||(i===YU||i===eN)&&l===eN||l===XU||l===KU||l===eTe||i===Z_e)return di;if(i===XU&&l===JU){for(;s===KU;)s=t[--a];if(s===JU)return di}if(i===tN&&l===tN){for(var o=0;s===tN;)o++,s=t[--a];if(o%2===0)return di}return rN},iTe=function(e){var t=tTe(e),r=t.length,a=0,s=0,i=t.map(nTe);return{next:function(){if(a>=r)return{done:!0,value:null};for(var l=di;a<r&&(l=sTe(t,i,++a))===di;);if(l!==di||a===r){var o=rTe.apply(null,t.slice(s,a));return s=a,{value:o,done:!1}}return{done:!0,value:null}}}},lTe=function(e){for(var t=iTe(e),r=[],a;!(a=t.next()).done;)a.value&&r.push(a.value.slice());return r},oTe=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},cTe=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=mv(a.data).map(function(d){return ga(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},dTe=function(){return typeof new Image().crossOrigin<"u"},uTe=function(){return typeof new XMLHttpRequest().responseType=="string"},ATe=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},ZU=function(e){return e[0]===0&&e[1]===255&&e[2]===0&&e[3]===255},fTe=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=WC(r,r,0,0,s);return a.fillStyle="red",a.fillRect(0,0,r,r),eM(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",ZU(d)?eM(WC(r,r,0,0,u)):Promise.reject(!1)}).then(function(o){return a.drawImage(o,0,0),ZU(a.getImageData(0,0,r,r).data)}).catch(function(){return!1})},WC=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},eM=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=oTe(document);return Object.defineProperty(bn,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=bn.SUPPORT_RANGE_BOUNDS&&cTe(document);return Object.defineProperty(bn,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=ATe(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"?fTe(document):Promise.resolve(!1);return Object.defineProperty(bn,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=dTe();return Object.defineProperty(bn,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=uTe();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}},zf=(function(){function e(t,r){this.text=t,this.bounds=r}return e})(),pTe=function(e,t,r,a){var s=mTe(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=tM(a,l,o.length).getClientRects();if(d.length>1){var u=KE(o),f=0;u.forEach(function(x){i.push(new zf(x,Co.fromDOMRectList(e,tM(a,f+l,x.length).getClientRects()))),f+=x.length})}else i.push(new zf(o,Co.fromDOMRectList(e,d)))}else{var p=a.splitText(o.length);i.push(new zf(o,hTe(e,a))),a=p}else bn.SUPPORT_RANGE_BOUNDS||(a=a.splitText(o.length));l+=o.length}),i},hTe=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=xv(e,a);return a.firstChild&&s.replaceChild(a.firstChild,a),i}}return Co.EMPTY},tM=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},KE=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 lTe(e)},xTe=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 bTe(e,t)},mTe=function(e,t){return t.letterSpacing!==0?KE(e):xTe(e,t)},gTe=[32,160,4961,65792,65793,4153,4241],bTe=function(e,t){for(var r=GSe(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=mv(l),d="";o.forEach(function(u){gTe.indexOf(u)===-1?d+=ga(u):(d.length&&a.push(d),a.push(ga(u)),d="")}),d.length&&a.push(d)}};!(s=r.next()).done;)i();return a},vTe=(function(){function e(t,r,a){this.text=yTe(r.data,a.textTransform),this.textBounds=pTe(t,this.text,a,r)}return e})(),yTe=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(wTe,NTe);case 2:return e.toUpperCase();default:return e}},wTe=/(^|\s|:|-|\(|\))([a-z])/g,NTe=function(e,t,r){return e.length>0?t+r.toUpperCase():e},cz=(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})(Fl),dz=(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})(Fl),uz=(function(e){Zi(t,e);function t(r,a){var s=e.call(this,r,a)||this,i=new XMLSerializer,l=xv(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})(Fl),Az=(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})(Fl),YC=(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})(Fl),CTe=[{type:15,flags:0,unit:"px",number:3}],kTe=[{type:16,flags:0,number:50}],jTe=function(e){return e.width>e.height?new Co(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new Co(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e},ETe=function(e){var t=e.type===STe?new Array(e.value.length+1).join("•"):e.value;return t.length===0?e.placeholder||"":t},rb="checkbox",ab="radio",STe="password",rM=707406591,qE=(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=ETe(a),(s.type===rb||s.type===ab)&&(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=jTe(s.bounds)),s.type){case rb:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=CTe;break;case ab:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=kTe;break}return s}return t})(Fl),fz=(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})(Fl),pz=(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})(Fl),hz=(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=mz(r,a.contentWindow.document.documentElement);var i=a.contentWindow.document.documentElement?Qf(r,getComputedStyle(a.contentWindow.document.documentElement).backgroundColor):fo.TRANSPARENT,l=a.contentWindow.document.body?Qf(r,getComputedStyle(a.contentWindow.document.body).backgroundColor):fo.TRANSPARENT;s.backgroundColor=Sc(i)?Sc(l)?s.styles.backgroundColor:l:i}}catch{}return s}return t})(Fl),BTe=["OL","UL","MENU"],Om=function(e,t,r,a){for(var s=t.firstChild,i=void 0;s;s=i)if(i=s.nextSibling,gz(s)&&s.data.trim().length>0)r.textNodes.push(new vTe(e,s,r.styles));else if(hA(s))if(wz(s)&&s.assignedNodes)s.assignedNodes().forEach(function(o){return Om(e,o,r,a)});else{var l=xz(e,s);l.styles.isVisible()&&(_Te(s,l,a)?l.flags|=4:TTe(l.styles)&&(l.flags|=2),BTe.indexOf(s.tagName)!==-1&&(l.flags|=8),r.elements.push(l),s.slot,s.shadowRoot?Om(e,s.shadowRoot,l,a):!nb(s)&&!bz(s)&&!sb(s)&&Om(e,s,l,a))}},xz=function(e,t){return JC(t)?new cz(e,t):vz(t)?new dz(e,t):bz(t)?new uz(e,t):ITe(t)?new Az(e,t):FTe(t)?new YC(e,t):DTe(t)?new qE(e,t):sb(t)?new fz(e,t):nb(t)?new pz(e,t):yz(t)?new hz(e,t):new Fl(e,t)},mz=function(e,t){var r=xz(e,t);return r.flags|=4,Om(e,t,r,r),r},_Te=function(e,t,r){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||WE(e)&&r.styles.isTransparent()},TTe=function(e){return e.isPositioned()||e.isFloating()},gz=function(e){return e.nodeType===Node.TEXT_NODE},hA=function(e){return e.nodeType===Node.ELEMENT_NODE},XC=function(e){return hA(e)&&typeof e.style<"u"&&!Pm(e)},Pm=function(e){return typeof e.className=="object"},ITe=function(e){return e.tagName==="LI"},FTe=function(e){return e.tagName==="OL"},DTe=function(e){return e.tagName==="INPUT"},UTe=function(e){return e.tagName==="HTML"},bz=function(e){return e.tagName==="svg"},WE=function(e){return e.tagName==="BODY"},vz=function(e){return e.tagName==="CANVAS"},aM=function(e){return e.tagName==="VIDEO"},JC=function(e){return e.tagName==="IMG"},yz=function(e){return e.tagName==="IFRAME"},nM=function(e){return e.tagName==="STYLE"},MTe=function(e){return e.tagName==="SCRIPT"},nb=function(e){return e.tagName==="TEXTAREA"},sb=function(e){return e.tagName==="SELECT"},wz=function(e){return e.tagName==="SLOT"},sM=function(e){return e.tagName.indexOf("-")>0},RTe=(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})(),iM={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"]},lM={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:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},OTe={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:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},PTe={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:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},tA=function(e,t,r,a,s,i){return e<t||e>r?_p(e,s,i.length>0):a.integers.reduce(function(l,o,d){for(;e>=o;)e-=o,l+=a.values[d];return l},"")+i},Nz=function(e,t,r,a){var s="";do r||e--,s=a(e)+s,e/=t;while(e*t>=t);return s},xa=function(e,t,r,a,s){var i=r-t+1;return(e<0?"-":"")+(Nz(Math.abs(e),i,a,function(l){return ga(Math.floor(l%i)+t)})+s)},fd=function(e,t,r){r===void 0&&(r=". ");var a=t.length;return Nz(Math.abs(e),a,!1,function(s){return t[Math.floor(s%a)]})+r},lA=1,Ac=2,fc=4,Bf=8,eo=function(e,t,r,a,s,i){if(e<-9999||e>9999)return _p(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,lA)&&o!==""?o=t[u]+o:u>1||u===1&&d===0||u===1&&d===1&&La(i,Ac)||u===1&&d===1&&La(i,fc)&&e>100||u===1&&d>1&&La(i,Bf)?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},oM="十百千萬",cM="拾佰仟萬",dM="マイナス",aN="마이너스",_p=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=xa(e,48,57,!0,a);return o.length<4?"0"+o:o;case 4:return fd(e,"〇一二三四五六七八九",s);case 6:return tA(e,1,3999,iM,3,a).toLowerCase();case 7:return tA(e,1,3999,iM,3,a);case 8:return xa(e,945,969,!1,a);case 9:return xa(e,97,122,!1,a);case 10:return xa(e,65,90,!1,a);case 11:return xa(e,1632,1641,!0,a);case 12:case 49:return tA(e,1,9999,lM,3,a);case 35:return tA(e,1,9999,lM,3,a).toLowerCase();case 13:return xa(e,2534,2543,!0,a);case 14:case 30:return xa(e,6112,6121,!0,a);case 15:return fd(e,"子丑寅卯辰巳午未申酉戌亥",s);case 16:return fd(e,"甲乙丙丁戊己庚辛壬癸",s);case 17:case 48:return eo(e,"零一二三四五六七八九",oM,"負",s,Ac|fc|Bf);case 47:return eo(e,"零壹貳參肆伍陸柒捌玖",cM,"負",s,lA|Ac|fc|Bf);case 42:return eo(e,"零一二三四五六七八九",oM,"负",s,Ac|fc|Bf);case 41:return eo(e,"零壹贰叁肆伍陆柒捌玖",cM,"负",s,lA|Ac|fc|Bf);case 26:return eo(e,"〇一二三四五六七八九","十百千万",dM,s,0);case 25:return eo(e,"零壱弐参四伍六七八九","拾百千万",dM,s,lA|Ac|fc);case 31:return eo(e,"영일이삼사오육칠팔구","십백천만",aN,i,lA|Ac|fc);case 33:return eo(e,"零一二三四五六七八九","十百千萬",aN,i,0);case 32:return eo(e,"零壹貳參四五六七八九","拾百千",aN,i,lA|Ac|fc);case 18:return xa(e,2406,2415,!0,a);case 20:return tA(e,1,19999,PTe,3,a);case 21:return xa(e,2790,2799,!0,a);case 22:return xa(e,2662,2671,!0,a);case 22:return tA(e,1,10999,OTe,3,a);case 23:return fd(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return fd(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return xa(e,3302,3311,!0,a);case 28:return fd(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",s);case 29:return fd(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",s);case 34:return xa(e,3792,3801,!0,a);case 37:return xa(e,6160,6169,!0,a);case 38:return xa(e,4160,4169,!0,a);case 39:return xa(e,2918,2927,!0,a);case 40:return xa(e,1776,1785,!0,a);case 43:return xa(e,3046,3055,!0,a);case 44:return xa(e,3174,3183,!0,a);case 45:return xa(e,3664,3673,!0,a);case 46:return xa(e,3872,3881,!0,a);case 3:default:return xa(e,48,57,!0,a)}},Cz="data-html2canvas-ignore",uM=(function(){function e(t,r,a){if(this.context=t,this.options=a,this.scrolledElements=[],this.referenceElement=r,this.counters=new RTe,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=LTe(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=zTe(s).then(function(){return Kn(a,void 0,void 0,function(){var f,p;return Tn(this,function(x){switch(x.label){case 0:return this.scrolledElements.forEach(KTe),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:x.sent(),x.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,HTe(d)]:[3,4];case 3:x.sent(),x.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(VTe(document.doctype)+"<html></html>"),GTe(this.referenceElement.ownerDocument,i,l),d.replaceChild(d.adoptNode(this.documentElement),d.documentElement),d.close(),u},e.prototype.createElementClone=function(t){if(qC(t,2))debugger;if(vz(t))return this.createCanvasClone(t);if(aM(t))return this.createVideoClone(t);if(nM(t))return this.createStyleClone(t);var r=t.cloneNode(!1);return JC(r)&&(JC(t)&&t.currentSrc&&t.currentSrc!==t.src&&(r.src=t.currentSrc,r.srcset=""),r.loading==="lazy"&&(r.loading="eager")),sM(r)?this.createCustomElementClone(r):r},e.prototype.createCustomElementClone=function(t){var r=document.createElement("html2canvascustomelement");return nN(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)||!MTe(r)&&!r.hasAttribute(Cz)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(r)))&&(!this.options.copyStyles||!hA(r)||!nM(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)&&wz(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(gz(t))return document.createTextNode(t.data);if(!t.ownerDocument)return t.cloneNode(!1);var a=t.ownerDocument.defaultView;if(a&&hA(t)&&(XC(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&&XC(s)&&(this.clonedReferenceElement=s),WE(s)&&YTe(s);var d=this.counters.parse(new HU(this.context,i)),u=this.resolvePseudoContent(t,s,l,$f.BEFORE);sM(t)&&(r=!0),aM(t)||this.cloneChildNodes(t,s,r),u&&s.insertBefore(u,s.firstChild);var f=this.resolvePseudoContent(t,s,o,$f.AFTER);return f&&s.appendChild(f),this.counters.pop(d),(i&&(this.options.copyStyles||Pm(t))&&!yz(t)||r)&&nN(i,s),(t.scrollTop!==0||t.scrollLeft!==0)&&this.scrolledElements.push([s,t.scrollLeft,t.scrollTop]),(nb(t)||sb(t))&&(nb(s)||sb(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 HU(this.context,a));var d=new I_e(this.context,a),u=o.createElement("html2canvaspseudoelement");nN(a,u),d.content.forEach(function(p){if(p.type===0)u.appendChild(o.createTextNode(p.value));else if(p.type===22){var x=o.createElement("img");x.src=p.value,x.style.opacity="1",u.appendChild(x)}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(MA),v=b[0],y=b[1];if(v&&mr(v)){var k=i.counters.getCounterValue(v.value),_=y&&mr(y)?KC.parse(i.context,y.value):3;u.appendChild(o.createTextNode(_p(k,_,!1)))}}else if(p.name==="counters"){var C=p.values.filter(MA),v=C[0],E=C[1],y=C[2];if(v&&mr(v)){var T=i.counters.getCounterValues(v.value),B=y&&mr(y)?KC.parse(i.context,y.value):3,F=E&&E.type===0?E.value:"",M=T.map(function(L){return _p(L,B,!1)}).join(F);u.appendChild(o.createTextNode(M))}}}else if(p.type===20)switch(p.value){case"open-quote":u.appendChild(o.createTextNode(QU(d.quotes,i.quoteDepth++,!0)));break;case"close-quote":u.appendChild(o.createTextNode(QU(d.quotes,--i.quoteDepth,!1)));break;default:u.appendChild(o.createTextNode(p.value))}}),u.className=ZC+" "+ek;var f=s===$f.BEFORE?" "+ZC:" "+ek;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})(),$f;(function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"})($f||($f={}));var LTe=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(Cz,"true"),e.body.appendChild(r),r},QTe=function(e){return new Promise(function(t){if(e.complete){t();return}if(!e.src){t();return}e.onload=t,e.onerror=t})},HTe=function(e){return Promise.all([].slice.call(e.images,0).map(QTe))},zTe=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)}})},$Te=["all","d","content"],nN=function(e,t){for(var r=e.length-1;r>=0;r--){var a=e.item(r);$Te.indexOf(a)===-1&&t.style.setProperty(a,e.getPropertyValue(a))}return t},VTe=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},GTe=function(e,t,r){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||r!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,r)},KTe=function(e){var t=e[0],r=e[1],a=e[2];t.scrollLeft=r,t.scrollTop=a},qTe=":before",WTe=":after",ZC="___html2canvas___pseudoelement_before",ek="___html2canvas___pseudoelement_after",AM=`{
    content: "" !important;
    display: none !important;
}`,YTe=function(e){XTe(e,"."+ZC+qTe+AM+`
         .`+ek+WTe+AM)},XTe=function(e,t){var r=e.ownerDocument;if(r){var a=r.createElement("style");a.textContent=t,e.appendChild(a)}},kz=(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})(),JTe=(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)||(iN(t)||rIe(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=kz.isSameOrigin(t),a=!sN(t)&&this._options.useCORS===!0&&bn.SUPPORT_CORS_IMAGES&&!r,s=!sN(t)&&!r&&!iN(t)&&typeof this._options.proxy=="string"&&bn.SUPPORT_CORS_XHR&&!a,!r&&this._options.allowTaint===!1&&!sN(t)&&!iN(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,(aIe(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(x){return l(x)},!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})(),ZTe=/^data:image\/svg\+xml/i,eIe=/^data:image\/.*;base64,/i,tIe=/^data:image\/.*/i,rIe=function(e){return bn.SUPPORT_SVG_DRAWING||!nIe(e)},sN=function(e){return tIe.test(e)},aIe=function(e){return eIe.test(e)},iN=function(e){return e.substr(0,4)==="blob"},nIe=function(e){return e.substr(-3).toLowerCase()==="svg"||ZTe.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})(),rA=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=rA(this.start,this.startControl,t),s=rA(this.startControl,this.endControl,t),i=rA(this.endControl,this.end,t),l=rA(a,s,t),o=rA(s,i,t),d=rA(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})(),Ai=function(e){return e.type===1},sIe=(function(){function e(t){var r=t.styles,a=t.bounds,s=Ef(r.borderTopLeftRadius,a.width,a.height),i=s[0],l=s[1],o=Ef(r.borderTopRightRadius,a.width,a.height),d=o[0],u=o[1],f=Ef(r.borderBottomRightRadius,a.width,a.height),p=f[0],x=f[1],m=Ef(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+x)/a.height);var k=Math.max.apply(Math,y);k>1&&(i/=k,l/=k,d/=k,u/=k,p/=k,x/=k,b/=k,v/=k);var _=a.width-d,C=a.height-x,E=a.width-p,T=a.height-v,B=r.borderTopWidth,F=r.borderRightWidth,M=r.borderBottomWidth,U=r.borderLeftWidth,D=jr(r.paddingTop,t.bounds.width),L=jr(r.paddingRight,t.bounds.width),P=jr(r.paddingBottom,t.bounds.width),G=jr(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||x>0?zr(a.left+E,a.top+C,p-F/3,x-M/3,nr.BOTTOM_RIGHT):new rt(a.left+a.width-F/3,a.top+a.height-M/3),this.bottomLeftBorderDoubleOuterBox=b>0||v>0?zr(a.left+U/3,a.top+T,b-U/3,v-M/3,nr.BOTTOM_LEFT):new rt(a.left+U/3,a.top+a.height-M/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||x>0?zr(a.left+E,a.top+C,p-F*2/3,x-M*2/3,nr.BOTTOM_RIGHT):new rt(a.left+a.width-F*2/3,a.top+a.height-M*2/3),this.bottomLeftBorderDoubleInnerBox=b>0||v>0?zr(a.left+U*2/3,a.top+T,b-U*2/3,v-M*2/3,nr.BOTTOM_LEFT):new rt(a.left+U*2/3,a.top+a.height-M*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||x>0?zr(a.left+E,a.top+C,p-F/2,x-M/2,nr.BOTTOM_RIGHT):new rt(a.left+a.width-F/2,a.top+a.height-M/2),this.bottomLeftBorderStroke=b>0||v>0?zr(a.left+U/2,a.top+T,b-U/2,v-M/2,nr.BOTTOM_LEFT):new rt(a.left+U/2,a.top+a.height-M/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||x>0?zr(a.left+E,a.top+C,p,x,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||x>0?zr(a.left+Math.min(E,a.width-U),a.top+Math.min(C,a.height-M),Math.max(0,p-F),Math.max(0,x-M),nr.BOTTOM_RIGHT):new rt(a.left+a.width-F,a.top+a.height-M),this.bottomLeftPaddingBox=b>0||v>0?zr(a.left+U,a.top+Math.min(T,a.height-M),Math.max(0,b-U),Math.max(0,v-M),nr.BOTTOM_LEFT):new rt(a.left+U,a.top+a.height-M),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||x>0?zr(a.left+Math.min(E,a.width-(U+G)),a.top+Math.min(C,a.height+B+D),Math.max(0,p-(F+L)),x-(M+P),nr.BOTTOM_RIGHT):new rt(a.left+a.width-(F+L),a.top+a.height-(M+P)),this.bottomLeftContentBox=b>0||v>0?zr(a.left+U+G,a.top+T,Math.max(0,b-(U+G)),v-(M+P),nr.BOTTOM_LEFT):new rt(a.left+U+G,a.top+a.height-(M+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))}},ib=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},iIe=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},lb=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},lIe=(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})(),oIe=(function(){function e(t){this.opacity=t,this.type=2,this.target=6}return e})(),cIe=function(e){return e.type===0},jz=function(e){return e.type===1},dIe=function(e){return e.type===2},fM=function(e,t){return e.length===t.length?e.some(function(r,a){return r===t[a]}):!1},uIe=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})},Ez=(function(){function e(t){this.element=t,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e})(),Sz=(function(){function e(t,r){if(this.container=t,this.parent=r,this.effects=[],this.curves=new sIe(this.container),this.container.styles.opacity<1&&this.effects.push(new oIe(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 lIe(a,s,i))}if(this.container.styles.overflowX!==0){var l=ib(this.curves),o=lb(this.curves);fM(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!jz(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=ib(a.curves),o=lb(a.curves);fM(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})(),tk=function(e,t,r,a){e.container.elements.forEach(function(s){var i=La(s.flags,4),l=La(s.flags,2),o=new Sz(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 Ez(o);if(s.styles.isPositioned()||s.styles.opacity<1||s.styles.isTransformed()){var p=s.styles.zIndex.order;if(p<0){var x=0;u.negativeZIndex.some(function(b,v){return p>b.element.container.styles.zIndex.order?(x=v,!1):x>0}),u.negativeZIndex.splice(x,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);tk(o,f,i?f:r,d)}else s.styles.isInlineLevel()?t.inlineLevel.push(o):t.nonInlineLevel.push(o),tk(o,t,r,d);La(s.flags,8)&&Bz(s,d)})},Bz=function(e,t){for(var r=e instanceof YC?e.start:1,a=e instanceof YC?e.reversed:!1,s=0;s<t.length;s++){var i=t[s];i.container instanceof Az&&typeof i.container.value=="number"&&i.container.value!==0&&(r=i.container.value),i.listValue=_p(r,i.container.styles.listStyleType,!0),r+=a?-1:1}},AIe=function(e){var t=new Sz(e,null),r=new Ez(t),a=[];return tk(t,r,r,a),Bz(t.container,a),r},pM=function(e,t){switch(t){case 0:return mi(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return mi(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return mi(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);case 3:default:return mi(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},fIe=function(e,t){switch(t){case 0:return mi(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return mi(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return mi(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);case 3:default:return mi(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},pIe=function(e,t){switch(t){case 0:return mi(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return mi(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return mi(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);case 3:default:return mi(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},hIe=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 Ai(e)?r.push(e.subdivide(.5,!1)):r.push(e),Ai(t)?r.push(t.subdivide(.5,!0)):r.push(t),r},mi=function(e,t,r,a){var s=[];return Ai(e)?s.push(e.subdivide(.5,!1)):s.push(e),Ai(r)?s.push(r.subdivide(.5,!0)):s.push(r),Ai(a)?s.push(a.subdivide(.5,!0).reverse()):s.push(a),Ai(t)?s.push(t.subdivide(.5,!1).reverse()):s.push(t),s},_z=function(e){var t=e.bounds,r=e.styles;return t.add(r.borderLeftWidth,r.borderTopWidth,-(r.borderRightWidth+r.borderLeftWidth),-(r.borderTopWidth+r.borderBottomWidth))},ob=function(e){var t=e.styles,r=e.bounds,a=jr(t.paddingLeft,r.width),s=jr(t.paddingRight,r.width),i=jr(t.paddingTop,r.width),l=jr(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))},xIe=function(e,t){return e===0?t.bounds:e===2?ob(t):_z(t)},mIe=function(e,t){return e===0?t.bounds:e===2?ob(t):_z(t)},lN=function(e,t,r){var a=xIe(oA(e.styles.backgroundOrigin,t),e),s=mIe(oA(e.styles.backgroundClip,t),e),i=gIe(oA(e.styles.backgroundSize,t),r,a),l=i[0],o=i[1],d=Ef(oA(e.styles.backgroundPosition,t),a.width-l,a.height-o),u=bIe(oA(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]},aA=function(e){return mr(e)&&e.value===CA.AUTO},wm=function(e){return typeof e=="number"},gIe=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[jr(l,r.width),jr(o,r.height)];var d=wm(i);if(mr(l)&&(l.value===CA.CONTAIN||l.value===CA.COVER)){if(wm(i)){var u=r.width/r.height;return u<i!=(l.value===CA.COVER)?[r.width,r.width/i]:[r.height*i,r.height]}return[r.width,r.height]}var f=wm(a),p=wm(s),x=f||p;if(aA(l)&&(!o||aA(o))){if(f&&p)return[a,s];if(!d&&!x)return[r.width,r.height];if(x&&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 k=0,_=0;return Ta(l)?k=jr(l,r.width):Ta(o)&&(_=jr(o,r.height)),aA(l)?k=_*i:(!o||aA(o))&&(_=k/i),[k,_]}var C=null,E=null;if(Ta(l)?C=jr(l,r.width):o&&Ta(o)&&(E=jr(o,r.height)),C!==null&&(!o||aA(o))&&(E=f&&p?C/a*s:r.height),E!==null&&aA(l)&&(C=f&&p?E/s*a:r.width),C!==null&&E!==null)return[C,E];throw new Error("Unable to calculate background-size for element")},oA=function(e,t){var r=e[t];return typeof r>"u"?e[0]:r},bIe=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))]}},vIe="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",hM="Hidden Text",yIe=(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=vIe,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})(),Tz=(function(){function e(t,r){this.context=t,this.options=r}return e})(),wIe=1e4,NIe=(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 yIe(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(),dIe(r)&&(this.ctx.globalAlpha=r.opacity),cIe(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)),jz(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=KE(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=SIe(r.fontFamily).join(", "),i=oh(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,x=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:x.ctx.fillStyle=qa(a.color),x.renderTextWithLetterSpacing(b,a.letterSpacing,u);var y=a.textShadow;y.length&&b.text.trim().length&&(y.slice(0).reverse().forEach(function(k){x.ctx.shadowColor=qa(k.color),x.ctx.shadowOffsetX=k.offsetX.number*x.options.scale,x.ctx.shadowOffsetY=k.offsetY.number*x.options.scale,x.ctx.shadowBlur=k.blur.number,x.renderTextWithLetterSpacing(b,a.letterSpacing,u)}),x.ctx.shadowColor="",x.ctx.shadowOffsetX=0,x.ctx.shadowOffsetY=0,x.ctx.shadowBlur=0),a.textDecorationLine.length&&(x.ctx.fillStyle=qa(a.textDecorationColor||a.color),a.textDecorationLine.forEach(function(k){switch(k){case 1:x.ctx.fillRect(b.bounds.left,Math.round(b.bounds.top+u),b.bounds.width,1);break;case 2:x.ctx.fillRect(b.bounds.left,Math.round(b.bounds.top),b.bounds.width,1);break;case 3:x.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&&(x.ctx.strokeStyle=qa(a.webkitTextStrokeColor),x.ctx.lineWidth=a.webkitTextStrokeWidth,x.ctx.lineJoin=window.chrome?"miter":"round",x.ctx.strokeText(b.text,b.bounds.left,b.bounds.top+u)),x.ctx.strokeStyle="",x.ctx.lineWidth=0,x.ctx.lineJoin="miter";break}})}),[2]})})},t.prototype.renderReplacedElement=function(r,a,s){if(s&&r.intrinsicWidth>0&&r.intrinsicHeight>0){var i=ob(r),l=lb(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,x,E,m,b,T,v,y,k,_,C,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 cz))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 dz&&this.renderReplacedElement(a,s,a.canvas),!(a instanceof uz))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 hz&&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 qE&&(p=Math.min(a.bounds.width,a.bounds.height),a.type===rb?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=qa(rM),this.ctx.fill(),this.ctx.restore()):a.type===ab&&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=qa(rM),this.ctx.fill(),this.ctx.restore())),CIe(a)&&a.value.length){switch(x=this.createFontStyle(i),E=x[0],m=x[1],b=this.fontMetrics.getMetrics(E,m).baseline,this.ctx.font=E,this.ctx.fillStyle=qa(i.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=jIe(a.styles.textAlign),T=ob(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 zf(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(k=a.styles.listStyleImage,k.type!==0)return[3,18];_=void 0,C=k.url,B.label=15;case 15:return B.trys.push([15,17,,18]),[4,this.context.cache.match(C)];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 "+C),[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=qa(i.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",T=new Co(a.bounds.left,a.bounds.top+jr(a.styles.paddingTop,a.bounds.width),a.bounds.width,PU(i.lineHeight,i.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new zf(r.listValue,T),i.letterSpacing,PU(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,k,i,l,k,o,d,k,u,f,k,p,x,k,m,b,k,v,y,k;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?(k=s[a],[4,this.renderStack(k)]):[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?(k=l[i],[4,this.renderNode(k)]):[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?(k=d[o],[4,this.renderStack(k)]):[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?(k=f[u],[4,this.renderStack(k)]):[3,18];case 16:_.sent(),_.label=17;case 17:return u++,[3,15];case 18:p=0,x=r.inlineLevel,_.label=19;case 19:return p<x.length?(k=x[p],[4,this.renderNode(k)]):[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?(k=b[m],[4,this.renderStack(k)]):[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?(k=y[v],[4,this.renderStack(k)]):[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=Ai(s)?s.start:s;i===0?a.ctx.moveTo(l.x,l.y):a.ctx.lineTo(l.x,l.y),Ai(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,x,m,D,Y,K,G,H,M,b,D,Y,K,G,H,v,y,k,_,C,E,T,B,F,M,U,D,L,P,G,H,Q,Y,K,ee,J,W,R,O,q,z,X;return Tn(this,function(re){switch(re.label){case 0:if(f.type!==0)return[3,5];p=void 0,x=f.url,re.label=1;case 1:return re.trys.push([1,3,,4]),[4,i.context.cache.match(x)];case 2:return p=re.sent(),[3,4];case 3:return re.sent(),i.context.logger.error("Error loading background-image "+x),[3,4];case 4:return p&&(m=lN(r,a,[p.width,p.height,p.width/p.height]),D=m[0],Y=m[1],K=m[2],G=m[3],H=m[4],M=i.ctx.createPattern(i.resizeImage(p,G,H),"repeat"),i.renderRepeat(D,M,Y,K)),[3,6];case 5:cBe(f)?(b=lN(r,a,[null,null,null]),D=b[0],Y=b[1],K=b[2],G=b[3],H=b[4],v=nBe(f.angle,G,H),y=v[0],k=v[1],_=v[2],C=v[3],E=v[4],T=document.createElement("canvas"),T.width=G,T.height=H,B=T.getContext("2d"),F=B.createLinearGradient(k,C,_,E),RU(f.stops,y).forEach(function(le){return F.addColorStop(le.stop,qa(le.color))}),B.fillStyle=F,B.fillRect(0,0,G,H),G>0&&H>0&&(M=i.ctx.createPattern(T,"repeat"),i.renderRepeat(D,M,Y,K))):dBe(f)&&(U=lN(r,a,[null,null,null]),D=U[0],L=U[1],P=U[2],G=U[3],H=U[4],Q=f.position.length===0?[$E]:f.position,Y=jr(Q[0],G),K=jr(Q[Q.length-1],H),ee=sBe(f,Y,K,G,H),J=ee[0],W=ee[1],J>0&&W>0&&(R=i.ctx.createRadialGradient(L+Y,P+K,0,L+Y,P+K,J),RU(f.stops,J*2).forEach(function(le){return R.addColorStop(le.stop,qa(le.color))}),i.path(D),i.ctx.fillStyle=R,J!==W?(O=r.bounds.left+.5*r.bounds.width,q=r.bounds.top+.5*r.bounds.height,z=W/J,X=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,X*(P-q)+q,G,H*X),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(pM(s,a)),this.ctx.fillStyle=qa(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=fIe(i,s),this.path(l),this.ctx.fillStyle=qa(r),this.ctx.fill(),o=pIe(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(x){switch(x.label){case 0:return this.applyEffects(r.getEffects(2)),a=r.container.styles,s=!Sc(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=kIe(oA(a.backgroundClip,0),r.curves),s||a.boxShadow.length?(this.ctx.save(),this.path(l),this.ctx.clip(),Sc(a.backgroundColor)||(this.ctx.fillStyle=qa(a.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(r.container)]):[3,2];case 1:x.sent(),this.ctx.restore(),a.boxShadow.slice(0).reverse().forEach(function(m){p.ctx.save();var b=ib(r.curves),v=m.inset?0:wIe,y=uIe(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=qa(m.color),p.ctx.shadowBlur=m.blur.number,p.ctx.fillStyle=m.inset?qa(m.color):"rgba(0,0,0,1)",p.ctx.fill(),p.ctx.restore()}),x.label=2;case 2:o=0,d=0,u=i,x.label=3;case 3:return d<u.length?(f=u[d],f.style!==0&&!Sc(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 x.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 x.sent(),[3,11];case 7:return f.style!==4?[3,9]:[4,this.renderDoubleBorder(f.color,f.width,o,r.curves)];case 8:return x.sent(),[3,11];case 9:return[4,this.renderSolidBorder(f.color,o,r.curves)];case 10:x.sent(),x.label=11;case 11:o++,x.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,x,m,b,v,y,k,_,C,E,T,B,T,B;return Tn(this,function(F){return this.ctx.save(),o=hIe(i,s),d=pM(i,s),l===2&&(this.path(d),this.ctx.clip()),Ai(d[0])?(u=d[0].start.x,f=d[0].start.y):(u=d[0].x,f=d[0].y),Ai(d[1])?(p=d[1].end.x,x=d[1].end.y):(p=d[1].x,x=d[1].y),s===0||s===2?m=Math.abs(u-p):m=Math.abs(f-x),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?(k=m/(2*b+v),b*=k,v*=k):(_=Math.floor((m+v)/(b+v)),C=(m-_*b)/(_-1),E=(m-(_+1)*b)/_,v=E<=0||Math.abs(v-C)<Math.abs(v-E)?C: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=qa(r),this.ctx.stroke(),this.ctx.setLineDash([]),l===2&&(Ai(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()),Ai(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=qa(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),a=AIe(r),[4,this.renderStack(a)];case 1:return s.sent(),this.applyEffects([]),[2,this.canvas]}})})},t})(Tz),CIe=function(e){return e instanceof pz||e instanceof fz?!0:e instanceof qE&&e.type!==ab&&e.type!==rb},kIe=function(e,t){switch(e){case 0:return ib(t);case 2:return iIe(t);case 1:default:return lb(t)}},jIe=function(e){switch(e){case 1:return"center";case 2:return"right";case 0:default:return"left"}},EIe=["-apple-system","system-ui"],SIe=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(t){return EIe.indexOf(t)===-1}):e},BIe=(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=WC(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,r),[4,_Ie(a)];case 1:return s=i.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=qa(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})(Tz),_Ie=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))})},TIe=(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})(),IIe=(function(){function e(t,r){var a;this.windowBounds=r,this.instanceName="#"+e.instanceCount++,this.logger=new TIe({id:this.instanceName,enabled:t.logging}),this.cache=(a=t.cache)!==null&&a!==void 0?a:new JTe(this,t)}return e.instanceCount=1,e})(),ys=function(e,t){return t===void 0&&(t={}),FIe(e,t)};typeof window<"u"&&kz.setContext(window);var FIe=function(e,t){return Kn(void 0,void 0,void 0,function(){var r,a,s,i,l,o,d,u,f,p,x,m,b,v,y,k,_,C,E,T,F,B,F,M,U,D,L,P,G,H,Q,Y,K,ee,J,W,R,O,q,z;return Tn(this,function(X){switch(X.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:(M=t.allowTaint)!==null&&M!==void 0?M:!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=DC({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:(H=t.scrollX)!==null&&H!==void 0?H:a.pageXOffset,scrollY:(Q=t.scrollY)!==null&&Q!==void 0?Q:a.pageYOffset},o=new Co(l.scrollX,l.scrollY,l.windowWidth,l.windowHeight),d=new IIe(i,o),u=(Y=t.foreignObjectRendering)!==null&&Y!==void 0?Y:!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 uM(d,e,f),x=p.clonedReferenceElement,x?[4,p.toIFrame(r,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return m=X.sent(),b=WE(x)||UTe(x)?uSe(x.ownerDocument):xv(d,x),v=b.width,y=b.height,k=b.left,_=b.top,C=DIe(d,x,t.backgroundColor),E={canvas:t.canvas,backgroundColor:C,scale:(J=(ee=t.scale)!==null&&ee!==void 0?ee:a.devicePixelRatio)!==null&&J!==void 0?J:1,x:((W=t.x)!==null&&W!==void 0?W:0)+k,y:((R=t.y)!==null&&R!==void 0?R: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 BIe(d,E),[4,F.render(x)]):[3,3];case 2:return T=X.sent(),[3,5];case 3:return d.logger.debug("Document cloned, element located at "+k+","+_+" with size "+v+"x"+y+" using computed rendering"),d.logger.debug("Starting DOM parsing"),B=mz(d,x),C===B.styles.backgroundColor&&(B.styles.backgroundColor=fo.TRANSPARENT),d.logger.debug("Starting renderer for element at "+E.x+","+E.y+" with size "+E.width+"x"+E.height),F=new NIe(d,E),[4,F.render(B)];case 4:T=X.sent(),X.label=5;case 5:return(!((z=t.removeContainer)!==null&&z!==void 0)||z)&&(uM.destroy(m)||d.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),d.logger.debug("Finished rendering"),[2,T]}})})},DIe=function(e,t,r){var a=t.ownerDocument,s=a.documentElement?Qf(e,getComputedStyle(a.documentElement).backgroundColor):fo.TRANSPARENT,i=a.body?Qf(e,getComputedStyle(a.body).backgroundColor):fo.TRANSPARENT,l=typeof r=="string"?Qf(e,r):r===null?fo.TRANSPARENT:4294967295;return t===a.documentElement?Sc(s)?Sc(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})},xM=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},UIe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,financialTotals:i,markReceiptSent:l,latestRate:o}=mt(),[d,u]=j.useState(new Date().getMonth()),[f,p]=j.useState(new Date().getFullYear()),[x,m]=j.useState("selection"),[b,v]=j.useState("fee"),[y,k]=j.useState(null),[_,C]=j.useState(null),[E,T]=j.useState(null),[B,F]=j.useState([]),[M,U]=j.useState(0),[D,L]=j.useState(null),[P,G]=j.useState(!1),[H,Q]=j.useState([]),[Y,K]=j.useState(!1),[ee,J]=j.useState({}),W=j.useRef(null);j.useEffect(()=>{(async()=>{K(!0);try{const[je,fe]=await Promise.all([ve.getInitialDebtData(),ve.getSystemSettings()]);Array.isArray(je)?Q(je):je&&je.success&&Q(je.data||[]),J(fe||{})}catch(je){console.error("Error fetching data",je)}finally{K(!1)}})()},[]);const R=j.useMemo(()=>t.find(be=>be.month===d&&be.year===f),[t,d,f]),O=j.useMemo(()=>[...r].sort((be,je)=>be.code.localeCompare(je.code,void 0,{numeric:!0})),[r]),q=j.useMemo(()=>x==="report"?r.find(be=>be.id===y):x==="bulk"?B[M]:null,[x,r,y,B,M]),z=j.useMemo(()=>H.find(be=>be.id===(q==null?void 0:q.id)),[H,q]),X=j.useMemo(()=>{if(!q)return null;const be=a.find(fe=>fe.propertyId===q.id&&fe.isOwner),je=s.find(fe=>fe.cedula===(be==null?void 0:be.cedula));return{fullName:(be==null?void 0:be.fullName)||"Propietario",email:(je==null?void 0:je.email)||"",phone:(be==null?void 0:be.phone)||(je==null?void 0:je.phone)||"",telegramId:(je==null?void 0:je.telegramChatId)||"",propertyCode:q.code,propertyId:q.id}},[q,a,s]),re=be=>{if(!be)return"";let je=be.trim();return je.startsWith("+")?je.replace(/\D/g,""):je.startsWith("0")?"58"+je.substring(1).replace(/\D/g,""):je.length===10?"58"+je.replace(/\D/g,""):je.replace(/\D/g,"")},le=async()=>{if(W.current){G(!0);try{const je=(await ys(W.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"})).toDataURL("image/png"),fe=document.createElement("a");fe.href=je,fe.download=`Aviso_${q==null?void 0:q.code}_${_e[d]}.png`,fe.click()}catch(be){console.error("Capture failed",be),alert("Error al capturar imagen.")}finally{G(!1)}}},ne=async()=>{if(W.current){G(!0);try{const be=await ys(W.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"}),je=await new Promise(Xe=>be.toBlob(Xe,"image/png"));if(!je)throw new Error("Blob creation failed");const fe=`Aviso_${q==null?void 0:q.code}_${_e[d]}.png`,Me=new File([je],fe,{type:"image/png"});if(navigator.share&&navigator.canShare&&navigator.canShare({files:[Me]}))await navigator.share({files:[Me],title:`Aviso de Cobro - ${q==null?void 0:q.code}`,text:`Aviso de Cobro de ${_e[d]} ${f} para la unidad ${q==null?void 0:q.code}`});else{const Xe=be.toDataURL("image/png"),it=document.createElement("a");it.href=Xe,it.download=fe,it.click(),alert("La función de compartir archivos no es compatible con este navegador. La imagen se ha descargado.")}}catch(be){console.error("Share failed",be),alert("Error al compartir imagen.")}finally{G(!1)}}},ae=async be=>{if(!X||!q||!R)return;const je=R.debts.find(at=>at.propertyId===q.id),fe=je?Number(je.amountUsd)-Number(je.paidAmount):0,Me=(z==null?void 0:z.current_debt)||0,Xe=fe+Me,it=`🏢 *AVISO DE COBRO - SAC 2026*

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

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

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

¡Gracias!`;if(be==="whatsapp"){const at=re(X.phone);if(!at)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${at}?text=${encodeURIComponent(it)}`,"_blank"),x==="bulk"&&await l(R.id,q.id,"whatsapp");return}if(be==="share"){if(navigator.share)try{await navigator.share({title:`Aviso de Cobro - ${q.code}`,text:it.replace(/\*/g,""),url:Mr})}catch(at){console.warn("Share failed",at)}else alert("La función de compartir no está disponible en este navegador.");return}L(be);try{const at={channel:be,messageType:"custom",subject:`Aviso de Cobro SAC 2026 - ${q.code}`,recipients:[{name:X.fullName,email:X.email,telegramChatId:X.telegramId,customMessage:it.replace(/\*/g,"")}]},kt=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(at)})).json();kt.status==="success"?(await l(R.id,q.id,be),alert(`¡Éxito! Mensaje enviado por ${be}.`)):alert("Error: "+kt.message)}catch{alert("Error de red al enviar.")}finally{L(null)}},ie=()=>{if(!q||!X||!R||!Ie)return;const be=b==="statement",je=()=>be?`
                    <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(at=>at.year===f||at.year===f-1).sort((at,Ct)=>Ct.year*12+Ct.month-(at.year*12+at.month)).slice(0,12).map(at=>{const Ct=at.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;">${_e[at.month]} ${at.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>
                `:Ie.sections.map(at=>at.items.length>0?`
                    <div class="section-title">${at.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>
                            ${at.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>${be?"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">${ba}</div>
                <div style="font-size: 12px; font-weight: 700; color: #64748b; margin-top: 5px;">${be?"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">${(X==null?void 0:X.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: ${_e[d].toUpperCase()} ${f}</div>
            <div>TASA: Bs. ${o.toFixed(2)}</div>
        </div>

        ${je()}

        <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(Ie.totalIndividualSubtotal)}</div>
                </div>
                <div style="display: flex; gap: 20px;">
                    <div>
                        <div class="total-label">Reserva (${Ie.reserveFundPct}%)</div>
                        <div style="font-size: 14px; font-weight: 700;">$ ${$r(Ie.individualReserve)}</div>
                    </div>
                    <div>
                        <div class="total-label">Convenio</div>
                        <div style="font-size: 14px; font-weight: 700;">$ ${$r(Ie.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(Ie.finalTotal)}</div>
                <div class="ves-value">Bs. ${xM(Ie.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>`,Me=new Blob([fe],{type:"text/html"}),Xe=URL.createObjectURL(Me),it=document.createElement("a");it.href=Xe,it.download=`${be?"Estado":"Cuota"}_${q.code}_${_e[d]}.html`,it.click(),URL.revokeObjectURL(Xe)},he=()=>{if(ie(),X&&q&&Ie){const be=re(X.phone);if(be){const je=b==="statement",fe=`🏢 *AVISO DE COBRO - SAC 2026*

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

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

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

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

🔗 *ACCEDER AL PORTAL:* ${Mr}

¡Muchas gracias!`;window.open(`https://wa.me/${be}?text=${encodeURIComponent(fe)}`,"_blank"),x==="bulk"&&l(R.id,q.id,"whatsapp")}else alert("El usuario no tiene un teléfono registrado para WhatsApp.")}},Z=()=>{if(!_||!E)return;const be=O.findIndex(Me=>Me.id===_),je=O.findIndex(Me=>Me.id===E);if(be===-1||je===-1||be>je)return alert("Rango inválido.");const fe=O.slice(be,je+1);F(fe),U(0),m("bulk")},Ue=be=>{if(!R)return null;const je=Number(be.aliquot)||0,fe=!!be.hasUncommonExpense,Me=r.filter(st=>st.hasUncommonExpense).length,Xe=st=>{var Kt,fr;const Rt=Number(st.amountUsd)||0;let Et=0,jt="";if(st.isSpecial){const Nr=((Kt=st.specialPropertyIds)==null?void 0:Kt.length)||1,cn=(fr=st.specialPropertyIds)==null?void 0:fr.includes(be.id);Et=cn?Rt/Nr:0,jt=cn?`ESP (1/${Nr})`:"Exento"}else st.isUncommon?(Et=fe&&Me>0?Rt/Me:0,jt=fe&&Me>0?`GNC (1/${Me})`:"Exento"):(Et=Rt*(je/100),jt=`ALIQ (${je.toFixed(4)}%)`);return{...st,global:Rt,myPortion:Et,basisDesc:jt}},it=[{title:"Gastos Fijos",items:R.fixedExpenses.map(Xe)},{title:"Gastos Variables",items:R.variableExpenses.map(Xe)},{title:"Otros Gastos",items:R.otherExpenses.map(Xe)}],at=it.reduce((st,Rt)=>st+Rt.items.reduce((Et,jt)=>Et+jt.myPortion,0),0),Ct=Number(R.reserveFundPercent)||10,kt=at*(Ct/100),ft=at+kt,Br=R.debts.find(st=>st.propertyId===be.id),Ar=ft-(Br?Number(Br.paidAmount):0),fa=H.find(st=>st.id===be.id),Ut=(fa==null?void 0:fa.current_debt)||0,_r=Ar+Ut;return{sections:it,totalIndividualSubtotal:at,individualReserve:kt,totalOwnerUsd:ft,amountToPay:Ar,agreementPending:Ut,finalTotal:_r,reserveFundPct:Ct}},Ie=j.useMemo(()=>q?Ue(q):null,[q,R,H]);return x!=="selection"&&q&&Ie?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(ms,{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:[x==="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: ",M+1," / ",B.length]}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx("button",{disabled:M===0,onClick:()=>U(be=>be-1),className:"p-1 text-slate-400 hover:text-blue-600 disabled:opacity-30",children:n.jsx(ms,{size:16})}),n.jsx("button",{disabled:M===B.length-1,onClick:()=>U(be=>be+1),className:"p-1 text-slate-400 hover:text-blue-600 disabled:opacity-30",children:n.jsx(Bc,{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(Nt,{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(Fp,{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(ya,{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(rn,{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(Er,{size:20})}),n.jsxs("button",{onClick:he,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(Er,{size:20}),n.jsx("span",{className:"text-[9px] font-black uppercase tracking-wider",children:"HTML/WA"})]}),n.jsx("button",{onClick:()=>ae("telegram"),disabled:!(X!=null&&X.telegramId)||!!D,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${X!=null&&X.telegramId?"bg-sky-500":"bg-slate-200"}`,title:"Enviar Telegram",children:D==="telegram"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Sl,{size:20})}),n.jsx("button",{onClick:()=>ae("email"),disabled:!(X!=null&&X.email)||!!D,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${X!=null&&X.email?"bg-indigo-600":"bg-slate-200"}`,title:"Enviar Email",children:D==="email"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Pr,{size:20})})]})]}),n.jsxs("div",{ref:W,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:[_e[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:X==null?void 0:X.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:Ie.sections.map((be,je)=>be.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"})," ",be.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:be.items.map((fe,Me)=>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)]})]},Me))})]})})]},je))}):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(be=>be.year===f||be.year===f-1).sort((be,je)=>je.year*12+je.month-(be.year*12+be.month)).slice(0,12).map((be,je)=>{const fe=be.debts.find(Xe=>Xe.propertyId===q.id);if(!fe)return null;const Me=Number(fe.amountUsd)-Number(fe.paidAmount);return Me<=0?null:n.jsxs("tr",{children:[n.jsxs("td",{className:"py-3 text-[11px] font-bold text-slate-600 uppercase",children:[_e[be.month]," ",be.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(Me)]})]},je)}),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(Ie.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 (",Ie.reserveFundPct,"%)"]}),n.jsxs("span",{className:"text-sm font-black text-blue-600",children:["$",$r(Ie.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(Ie.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(Ie.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. ",xM(Ie.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(Pr,{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((be,je)=>n.jsx("p",{className:"text-[11px] font-bold text-slate-700",children:be.trim()},je)),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:be=>u(Number(be.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:_e.map((be,je)=>n.jsx("option",{value:je,children:be},je))}),n.jsx("input",{type:"number",value:f,onChange:be=>p(Number(be.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(PA,{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:be=>k(Number(be.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(be=>n.jsxs("option",{value:be.id,children:[be.code," - ",be.type," ",be.number]},be.id))]})]}),n.jsx("button",{disabled:!y||!R,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:R?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(SM,{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:be=>C(Number(be.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(be=>n.jsx("option",{value:be.id,children:be.code},be.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:be=>T(Number(be.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(be=>n.jsx("option",{value:be.id,children:be.code},be.id))]})]})]}),n.jsx("button",{disabled:!_||!E||!R,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:R?n.jsxs(n.Fragment,{children:["INICIAR PROCESO POR LOTE ",n.jsx(Hs,{size:16})]}):n.jsx(n.Fragment,{children:"CUOTA NO GENERADA"})})]})]}),!R&&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})},mM=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},MIe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,financialTotals:i,markReceiptSent:l,latestRate:o}=mt(),[d,u]=j.useState(new Date().getMonth()),[f,p]=j.useState(new Date().getFullYear()),[x,m]=j.useState("selection"),[b,v]=j.useState("fee"),[y,k]=j.useState(null),[_,C]=j.useState(null),[E,T]=j.useState(null),[B,F]=j.useState([]),[M,U]=j.useState(0),[D,L]=j.useState(null),[P,G]=j.useState(!1),[H,Q]=j.useState([]),[Y,K]=j.useState(!1),[ee,J]=j.useState({}),[W,R]=j.useState(16),O=j.useRef(null);j.useEffect(()=>{(async()=>{K(!0);try{const[Me,Xe]=await Promise.all([ve.getInitialDebtData(),ve.getSystemSettings()]);Array.isArray(Me)?Q(Me):Me&&Me.success&&Q(Me.data||[]),J(Xe||{})}catch(Me){console.error("Error fetching data",Me)}finally{K(!1)}})()},[]);const q=j.useMemo(()=>t.find(fe=>fe.month===d&&fe.year===f),[t,d,f]),z=j.useMemo(()=>[...r].sort((fe,Me)=>fe.code.localeCompare(Me.code,void 0,{numeric:!0})),[r]),X=j.useMemo(()=>x==="report"?r.find(fe=>fe.id===y):x==="bulk"?B[M]:null,[x,r,y,B,M]),re=j.useMemo(()=>H.find(fe=>fe.id===(X==null?void 0:X.id)),[H,X]),le=j.useMemo(()=>{if(!X)return null;const fe=a.find(Xe=>Xe.propertyId===X.id&&Xe.isOwner),Me=s.find(Xe=>Xe.cedula===(fe==null?void 0:fe.cedula));return{fullName:(fe==null?void 0:fe.fullName)||"Propietario",email:(Me==null?void 0:Me.email)||"",phone:(fe==null?void 0:fe.phone)||(Me==null?void 0:Me.phone)||"",telegramId:(Me==null?void 0:Me.telegramChatId)||"",propertyCode:X.code,propertyId:X.id}},[X,a,s]),ne=fe=>{if(!fe)return"";let Me=fe.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,"")},ae=async()=>{if(O.current){G(!0);try{const Me=(await ys(O.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"})).toDataURL("image/png"),Xe=document.createElement("a");Xe.href=Me,Xe.download=`Aviso_Grande_${X==null?void 0:X.code}_${_e[d]}.png`,Xe.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 ys(O.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"}),Me=await new Promise(at=>fe.toBlob(at,"image/png"));if(!Me)throw new Error("Blob creation failed");const Xe=`Aviso_Grande_${X==null?void 0:X.code}_${_e[d]}.png`,it=new File([Me],Xe,{type:"image/png"});if(navigator.share&&navigator.canShare&&navigator.canShare({files:[it]}))await navigator.share({files:[it],title:`Aviso de Cobro - ${X==null?void 0:X.code}`,text:`Aviso de Cobro de ${_e[d]} ${f} para la unidad ${X==null?void 0:X.code}`});else{const at=fe.toDataURL("image/png"),Ct=document.createElement("a");Ct.href=at,Ct.download=Xe,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)}}},he=async fe=>{if(!le||!X||!q)return;const Me=q.debts.find(kt=>kt.propertyId===X.id),Xe=Me?Number(Me.amountUsd)-Number(Me.paidAmount):0,it=(re==null?void 0:re.current_debt)||0,at=Xe+it,Ct=`🏢 *AVISO DE COBRO - SAC 2026*

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

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

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

¡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"),x==="bulk"&&await l(q.id,X.id,"whatsapp");return}},Z=()=>{if(!X||!le||!q||!je)return;const fe=b==="statement",Me=()=>fe?`
                    <div class="section-title">Resumen de Cuenta</div>
                    <table>
                        <thead>
                            <tr>
                                <th style="width: 40%; text-align: left; font-size: ${W*.6}px;">Periodo</th>
                                <th style="text-align: right; font-size: ${W*.6}px;">Monto ($)</th>
                                <th style="text-align: right; font-size: ${W*.6}px;">Pagado ($)</th>
                                <th style="text-align: right; background: #f8fafc; font-size: ${W*.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===X.id);if(!ft)return"";const Br=Number(ft.amountUsd)-Number(ft.paidAmount);return Br<=0?"":`
                                        <tr>
                                            <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${W*.7}px; text-transform: uppercase; font-weight: 700;">${_e[kt.month]} ${kt.year}</td>
                                            <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${W*.7}px; text-align: right; color: #64748b;">$ ${Vr(ft.amountUsd)}</td>
                                            <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${W*.7}px; text-align: right; color: #10b981;">$ ${Vr(ft.paidAmount)}</td>
                                            <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${W*.8}px; text-align: right; font-weight: 700; background: #f8fafc; color: #1e3a8a;">$ ${Vr(Br)}</td>
                                        </tr>
                                    `}).join("")}
                            ${re&&re.current_debt>0?`
                                <tr style="background-color: #fef3c7;">
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${W*.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: ${W*.7}px; text-align: right; color: #64748b;">-</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${W*.7}px; text-align: right; color: #10b981;">-</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${W*.8}px; text-align: right; font-weight: 800; color: #b45309; background: #fffbeb;">$ ${Vr(re.current_debt)}</td>
                                </tr>
                            `:""}
                        </tbody>
                    </table>
                `:je.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: ${W*.6}px;">Concepto</th>
                                <th style="text-align: center; font-size: ${W*.6}px;">Base</th>
                                <th style="text-align: right; font-size: ${W*.6}px;">Global ($)</th>
                                <th style="text-align: right; background: #f8fafc; font-size: ${W*.6}px;">Su Cuota ($)</th>
                            </tr>
                        </thead>
                        <tbody>
                            ${kt.items.map(ft=>`
                                <tr>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${W*.7}px; text-transform: uppercase;">${ft.description}</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${W*.5}px; text-align: center; color: #64748b;">${ft.basisDesc}</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${W*.7}px; text-align: right; color: #64748b;">$ ${Vr(ft.global)}</td>
                                    <td style="padding: 8px; border-bottom: 1px solid #f1f5f9; font-size: ${W*.8}px; text-align: right; font-weight: 700; background: #f8fafc; color: #1e3a8a;">$ ${Vr(ft.myPortion)}</td>
                                </tr>
                            `).join("")}
                        </tbody>
                    </table>
                `:"").join(""),Xe=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>${fe?"Estado de Cuenta":"Aviso de Cobro"} - ${X.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: ${W}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: ${W*1.5}px; font-weight: 900; color: #0f172a; letter-spacing: -1px; }
        .logo-subtitle { font-size: ${W*.6}px; font-weight: 900; color: #2563eb; text-transform: uppercase; letter-spacing: 2px; }
        .property-info { text-align: right; }
        .prop-label { font-size: ${W*.5}px; font-weight: 900; color: #64748b; text-transform: uppercase; }
        .prop-value { font-size: ${W*.8}px; font-weight: 700; color: #1e293b; }
        .section-title { font-size: ${W*.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: ${W*.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: ${W*.6}px; font-weight: 900; color: #94a3b8; text-transform: uppercase; letter-spacing: 1px; }
        .total-value { font-size: ${W*1.8}px; font-weight: 900; color: #60a5fa; letter-spacing: -1px; }
        .ves-value { font-size: ${W}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: ${W*.7}px; line-height: 1.5; }
        .payment-title { font-size: ${W*.6}px; font-weight: 900; color: #2563eb; text-transform: uppercase; margin-bottom: 8px; }
        .footer { text-align: center; font-size: ${W*.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">${ba}</div>
                <div style="font-size: ${W*.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">${X.code} (${X.type} ${X.number}) / ${(Number(X.aliquot)||0).toFixed(4)}%</div>
                </div>
            </div>
        </div>

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

        ${Me()}

        <div class="summary-box">
            <div>
                <div style="margin-bottom: 15px;">
                    <div class="total-label">Subtotal Mes</div>
                    <div style="font-size: ${W}px; font-weight: 700;">$ ${Vr(je.totalIndividualSubtotal)}</div>
                </div>
                <div style="display: flex; gap: 20px;">
                    <div>
                        <div class="total-label">Reserva (${je.reserveFundPct}%)</div>
                        <div style="font-size: ${W*.8}px; font-weight: 700;">$ ${Vr(je.individualReserve)}</div>
                    </div>
                    <div>
                        <div class="total-label">Convenio</div>
                        <div style="font-size: ${W*.8}px; font-weight: 700;">$ ${Vr(je.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(je.finalTotal)}</div>
                <div class="ves-value">Bs. ${mM(je.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: ${W*.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: ${W*.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 • ${X.code} • GENERADO EL ${new Date().toLocaleString()}
        </div>
    </div>
</body>
</html>`,it=new Blob([Xe],{type:"text/html"}),at=URL.createObjectURL(it),Ct=document.createElement("a");Ct.href=at,Ct.download=`${fe?"Estado":"Cuota"}_Grande_${X.code}_${_e[d]}.html`,Ct.click(),URL.revokeObjectURL(at)},Ue=()=>{if(Z(),le&&X&&je){const fe=ne(le.phone);if(fe){const Me=b==="statement",Xe=`🏢 *AVISO DE COBRO - SAC 2026*

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

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

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

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

🔗 *ACCEDER AL PORTAL:* ${Mr}

¡Muchas gracias!`;window.open(`https://wa.me/${fe}?text=${encodeURIComponent(Xe)}`,"_blank"),x==="bulk"&&l(q.id,X.id,"whatsapp")}else alert("El usuario no tiene un teléfono registrado para WhatsApp.")}},Ie=()=>{if(!_||!E)return;const fe=z.findIndex(it=>it.id===_),Me=z.findIndex(it=>it.id===E);if(fe===-1||Me===-1||fe>Me)return alert("Rango inválido.");const Xe=z.slice(fe,Me+1);F(Xe),U(0),m("bulk")},be=fe=>{if(!q)return null;const Me=Number(fe.aliquot)||0,Xe=!!fe.hasUncommonExpense,it=r.filter(Et=>Et.hasUncommonExpense).length,at=Et=>{var Nr,cn;const jt=Number(Et.amountUsd)||0;let Kt=0,fr="";if(Et.isSpecial){const $n=((Nr=Et.specialPropertyIds)==null?void 0:Nr.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=Xe&&it>0?jt/it:0,fr=Xe&&it>0?`GNC (1/${it})`:"Exento"):(Kt=jt*(Me/100),fr=`ALIQ (${Me.toFixed(4)}%)`);return{...Et,global:jt,myPortion:Kt,basisDesc:fr}},Ct=[{title:"Gastos Fijos",items:q.fixedExpenses.map(at)},{title:"Gastos Variables",items:q.variableExpenses.map(at)},{title:"Otros Gastos",items:q.otherExpenses.map(at)}],kt=Ct.reduce((Et,jt)=>Et+jt.items.reduce((Kt,fr)=>Kt+fr.myPortion,0),0),ft=Number(q.reserveFundPercent)||10,Br=kt*(ft/100),Ar=kt+Br,fa=q.debts.find(Et=>Et.propertyId===fe.id),Ut=fa?Number(fa.amountUsd)-Number(fa.paidAmount):Ar,_r=H.find(Et=>Et.id===fe.id),st=(_r==null?void 0:_r.current_debt)||0,Rt=Ut+st;return{sections:Ct,totalIndividualSubtotal:kt,individualReserve:Br,totalOwnerUsd:Ar,amountToPay:Ut,agreementPending:st,finalTotal:Rt,reserveFundPct:ft}},je=j.useMemo(()=>X?be(X):null,[X,q,H]);return x!=="selection"&&X&&je?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(ms,{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(JK,{size:16,className:"text-slate-400"}),n.jsx("button",{onClick:()=>R(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:[W,"px"]}),n.jsx("button",{onClick:()=>R(fe=>Math.min(32,fe+2)),className:"p-1 text-slate-500 hover:text-blue-600 font-black",children:"+"})]}),x==="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: ",M+1," / ",B.length]}),n.jsxs("div",{className:"flex gap-1",children:[n.jsx("button",{disabled:M===0,onClick:()=>U(fe=>fe-1),className:"p-1 text-slate-400 hover:text-blue-600 disabled:opacity-30",children:n.jsx(ms,{size:16})}),n.jsx("button",{disabled:M===B.length-1,onClick:()=>U(fe=>fe+1),className:"p-1 text-slate-400 hover:text-blue-600 disabled:opacity-30",children:n.jsx(Bc,{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(Nt,{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(Fp,{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(ya,{size:20})}),n.jsx("button",{onClick:()=>he(),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Enviar WhatsApp (Texto)",children:n.jsx(rn,{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(Er,{size:20})}),n.jsxs("button",{onClick:Ue,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(Er,{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:`${W}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:`${W*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:`${W*.7}px`},children:[_e[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:`${W*.5}px`},children:"Inmueble"}),n.jsxs("p",{className:"font-black text-blue-300",style:{fontSize:`${W*1.2}px`},children:[X.type," ",X.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:`${W*.5}px`},children:"Alícuota"}),n.jsxs("p",{className:"font-black text-emerald-400",style:{fontSize:`${W*1.2}px`},children:[(Number(X.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:`${W*.5}px`},children:"Tasa del Día"}),n.jsxs("p",{className:"font-black text-amber-400",style:{fontSize:`${W*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:`${W*.6}px`},children:"Propietario"}),n.jsx("p",{className:"font-black text-slate-900 uppercase",style:{fontSize:`${W*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:`${W*.6}px`},children:"Unidad"}),n.jsx("p",{className:"font-black text-blue-600 uppercase",style:{fontSize:`${W*1.2}px`},children:X.code})]})]}),b==="fee"?n.jsx(n.Fragment,{children:je.sections.map((fe,Me)=>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:`${W*.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:`${W*.6}px`},children:"Concepto"}),n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 text-center",style:{fontSize:`${W*.6}px`},children:"Base"}),n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 text-right",style:{fontSize:`${W*.6}px`},children:"Gasto Global ($)"}),n.jsx("th",{className:"py-3 font-black uppercase text-blue-600 text-right px-4",style:{fontSize:`${W*.6}px`},children:"Su Cuota ($)"})]})}),n.jsx("tbody",{className:"divide-y divide-slate-50",children:fe.items.map((Xe,it)=>n.jsxs("tr",{children:[n.jsx("td",{className:"py-3 font-bold text-slate-600 uppercase",style:{fontSize:`${W*.7}px`},children:Xe.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:`${W*.5}px`},children:Xe.basisDesc})}),n.jsxs("td",{className:"py-3 font-black text-right text-slate-400",style:{fontSize:`${W*.7}px`},children:["$",Vr(Xe.global)]}),n.jsxs("td",{className:"py-3 font-black text-blue-900 text-right px-4",style:{fontSize:`${W*.8}px`},children:["$",Vr(Xe.myPortion)]})]},it))})]})})]},Me))}):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:`${W*.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:`${W*.6}px`},children:"Periodo"}),n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 text-right",style:{fontSize:`${W*.6}px`},children:"Monto ($)"}),n.jsx("th",{className:"py-3 font-black uppercase text-slate-400 text-right",style:{fontSize:`${W*.6}px`},children:"Pagado ($)"}),n.jsx("th",{className:"py-3 font-black uppercase text-blue-600 text-right px-4",style:{fontSize:`${W*.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,Me)=>Me.year*12+Me.month-(fe.year*12+fe.month)).slice(0,12).map((fe,Me)=>{const Xe=fe.debts.find(at=>at.propertyId===X.id);if(!Xe)return null;const it=Number(Xe.amountUsd)-Number(Xe.paidAmount);return it<=0?null:n.jsxs("tr",{children:[n.jsxs("td",{className:"py-3 font-bold text-slate-600 uppercase",style:{fontSize:`${W*.7}px`},children:[_e[fe.month]," ",fe.year]}),n.jsxs("td",{className:"py-3 font-black text-right text-slate-400",style:{fontSize:`${W*.7}px`},children:["$",Vr(Xe.amountUsd)]}),n.jsxs("td",{className:"py-3 font-black text-right text-emerald-500",style:{fontSize:`${W*.7}px`},children:["$",Vr(Xe.paidAmount)]}),n.jsxs("td",{className:"py-3 font-black text-blue-900 text-right px-4",style:{fontSize:`${W*.8}px`},children:["$",Vr(it)]})]},Me)}),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:`${W*.7}px`},children:"CONVENIO DE PAGO"}),n.jsx("td",{className:"py-3 font-black text-right text-slate-400",style:{fontSize:`${W*.7}px`},children:"-"}),n.jsx("td",{className:"py-3 font-black text-right text-emerald-500",style:{fontSize:`${W*.7}px`},children:"-"}),n.jsxs("td",{className:"py-3 font-black text-amber-700 text-right px-4",style:{fontSize:`${W*.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:`${W*.5}px`},children:"Subtotal Mes"}),n.jsxs("span",{className:"font-black text-slate-800",style:{fontSize:`${W*.9}px`},children:["$",Vr(je.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:`${W*.5}px`},children:["Reserva (",je.reserveFundPct,"%)"]}),n.jsxs("span",{className:"font-black text-blue-600",style:{fontSize:`${W*.9}px`},children:["$",Vr(je.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:`${W*.5}px`},children:"Convenio"}),n.jsxs("span",{className:"font-black text-amber-600",style:{fontSize:`${W*.9}px`},children:["$",Vr(je.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:`${W*.5}px`},children:"Total a Pagar"}),n.jsxs("span",{className:"font-black text-white",style:{fontSize:`${W*.9}px`},children:["$",Vr(je.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:`${W*.6}px`},children:"Equivalente en Bolívares"}),n.jsxs("p",{className:"font-black tracking-tighter",style:{fontSize:`${W*1.8}px`},children:["Bs. ",mM(je.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:`${W*.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:`${W*.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:`${W*.7}px`},children:["# ",ee.payment_account_number||"0174-0124-6812-4414-5759"]}),n.jsxs("p",{className:"font-bold text-slate-600 uppercase",style:{fontSize:`${W*.7}px`},children:["RIF: ",ee.payment_rif||"J-313266507"]}),n.jsxs("p",{className:"font-bold text-slate-600 uppercase",style:{fontSize:`${W*.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:`${W*.6}px`},children:[n.jsx(Pr,{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:`${W*.6}px`},children:"Enviar comprobante a:"}),(ee.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map((fe,Me)=>n.jsx("p",{className:"font-bold text-slate-700",style:{fontSize:`${W*.7}px`},children:fe.trim()},Me)),n.jsxs("p",{className:"font-bold text-slate-600 uppercase mt-1",style:{fontSize:`${W*.7}px`},children:["WhatsApp: ",ee.payment_whatsapp||"0412-8213310"]}),n.jsx("p",{className:"font-black text-amber-600 uppercase italic mt-2",style:{fontSize:`${W*.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:`${W*.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:_e.map((fe,Me)=>n.jsx("option",{value:Me,children:fe},Me))}),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(PA,{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=>k(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(SM,{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=>C(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:Ie,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".'})]})]})},RIe=({user:e})=>{const{moduleStatus:t,updateModuleStatus:r,loading:a}=mt(),[s,i]=j.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(TM,{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:OIe(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."})]})]})]})},OIe=e=>({"prefill-simulator":n.jsx(Kr,{size:24}),"bank-reconciliation":n.jsx(kA,{size:24}),"bank-reconciliation-bnc":n.jsx(kA,{size:24}),"statement-analyzer":n.jsx(Vf,{size:24}),"statement-analyzer-bnc":n.jsx(br,{size:24}),"statement-detailed":n.jsx(Pc,{size:24}),"banplus-commissions":n.jsx(gs,{size:24}),commissions:n.jsx(gs,{size:24}),audit:n.jsx(po,{size:24}),currency:n.jsx(Ha,{size:24}),messages:n.jsx(vi,{size:24}),polls:n.jsx(Md,{size:24}),"data-forms":n.jsx(Xd,{size:24}),"live-voting":n.jsx(Wf,{size:24}),reservations:n.jsx(CM,{size:24}),announcements:n.jsx(qf,{size:24}),services:n.jsx(Yf,{size:24}),assemblies:n.jsx(NM,{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(Zd,{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(gi,{size:24}),statistics:n.jsx(kM,{size:24}),"payment-status":n.jsx(Gt,{size:24}),"payment-receipt":n.jsx(ca,{size:24}),"individual-fee-view":n.jsx(PA,{size:24}),"individual-fee-html":n.jsx(Er,{size:24}),"individual-fee-html-large":n.jsx(Er,{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(vi,{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(yl,{size:24}),"congratulate-owner":n.jsx(_f,{size:24})})[e]||n.jsx(ub,{size:24}),Ka=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},PIe=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},LIe=({user:e})=>{const{properties:t,residents:r,refreshData:a}=mt(),[s,i]=j.useState(!0),[l,o]=j.useState(""),[d,u]=j.useState([]),[f,p]=j.useState(null);["admin","programmer","board"].includes(e.role);const x=async()=>{i(!0);try{const k=await ve.getInitialDebtData();Array.isArray(k)?u(k):k&&k.success?u(k.data||[]):console.error("Kernel Response Error:",k)}catch(k){console.error("Kernel Sync Failed:",k)}finally{i(!1)}};j.useEffect(()=>{x()},[]);const m=j.useMemo(()=>d.filter(k=>(k.code||"").toLowerCase().includes(l.toLowerCase())||(k.ownerName||"").toLowerCase().includes(l.toLowerCase())),[d,l]),b=k=>{const _=window.open("","","width=900,height=900");if(!_)return;const C=(k.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;">$${Ka(E.amount_usd)}</td>
            </tr>
        `).join("");_.document.write(`
            <html>
            <head>
                <title>Convenio de Pago - ${k.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> ${k.code}</p>
                    <p><b>TITULAR:</b> ${k.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">$${Ka(k.original_debt)}</div></div>
                    <div class="stat-box"><div class="stat-label">Total Abonado</div><div class="stat-val" style="color: #10b981;">$${Ka(k.total_paid)}</div></div>
                    <div class="stat-box"><div class="stat-label">Saldo Pendiente</div><div class="stat-val" style="color: #ef4444;">$${Ka(k.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>${C||'<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 k=window.open("","","width=900,height=900");if(!k)return;const _=m.map(C=>`
            <tr>
                <td style="padding:10px; border-bottom:1px solid #eee;">${C.code}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${C.ownerName}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${Ka(C.original_debt)}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${Ka(C.total_paid)}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right; font-weight:bold;">$${Ka(C.current_debt)}</td>
            </tr>
        `).join("");k.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>
        `),k.document.close(),k.print()},y=()=>{const k=m.map(B=>`
            <tr>
                <td>${B.code}</td>
                <td>${B.ownerName}</td>
                <td>$${Ka(B.original_debt)}</td>
                <td>$${Ka(B.total_paid)}</td>
                <td>$${Ka(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>${k}</tbody>
                </table>
            </body>
            </html>
        `,C=new Blob([_],{type:"text/html"}),E=URL.createObjectURL(C),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(Zd,{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:["$",Ka(d.reduce((k,_)=>k+(_.total_paid||0),0))]}),n.jsx("div",{className:"w-full h-px bg-slate-100 my-6"}),n.jsxs("button",{onClick:x,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(Ha,{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:k=>o(k.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(Nt,{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(Jd,{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((k,_)=>{const C=k.original_debt>0?k.total_paid/k.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:k.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:k.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:["$ ",Ka(k.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:["$ ",Ka(k.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:`${C}%`}})})]})}),n.jsx("td",{className:"px-10 py-6 text-right",children:n.jsxs("span",{className:`text-lg font-black tracking-tighter ${k.current_debt>0?"text-rose-600":"text-emerald-500"}`,children:["$ ",Ka(k.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(k),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(k),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(Nt,{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(xt,{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:["$ ",Ka(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:["$ ",Ka(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:["$ ",Ka(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((k,_)=>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:k.date.split("-")[2]}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-800 text-xs uppercase leading-tight",children:k.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: ",k.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:["$ ",Ka(k.amount_usd)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:["Bs. ",PIe(k.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(Nt,{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"})]})]})})]})},uc=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},QIe=({user:e})=>{const[t,r]=j.useState(!0),[a,s]=j.useState(""),[i,l]=j.useState([]),[o,d]=j.useState(null),u=async()=>{r(!0);try{const v=await(await fetch(`${ye}/get_archived_agreements.php`,{credentials:"include"})).json();v.success&&l(v.data||[])}catch(b){console.error("Archive Sync Failed:",b)}finally{r(!1)}};j.useEffect(()=>{u()},[]);const f=j.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(C=>{const E=C.description||"";return new RegExp(`RECUPERACIÓN DEUDA (HISTÓRICA|ANTERIOR): ${b.code}([^0-9]|$)`,"i").test(E)}).map(C=>`
            <tr>
                <td style="padding:10px; border-bottom:1px solid #eee;">${C.date}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; font-size:10px;">${C.description}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; font-family:monospace;">${C.reference}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${uc(C.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">$${uc(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()},x=()=>{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;">$${uc(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(C=>`
            <tr>
                <td>${C.code}</td>
                <td>${C.owner_name}</td>
                <td>$${uc(C.original_amount)}</td>
                <td>${C.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"}),k=URL.createObjectURL(y),_=document.createElement("a");_.href=k,_.download=`Historico_Convenios_${new Date().toISOString().split("T")[0]}.html`,_.click(),URL.revokeObjectURL(k)};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:["$",uc(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(Ha,{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:x,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(Nt,{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(Jd,{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:["$ ",uc(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(_c,{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(Nt,{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(xt,{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:["$ ",uc(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 k=y.description||"";return new RegExp(`RECUPERACIÓN DEUDA (HISTÓRICA|ANTERIOR): ${o.code}([^0-9]|$)`,"i").test(k)}).map((y,k)=>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:["$ ",uc(y.amount_usd)]})})]},k))]})]}),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(Nt,{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"})]})]})})]})},HIe=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState(null),[i,l]=j.useState([]),[o,d]=j.useState(!0),[u,f]=j.useState(""),[p,x]=j.useState(null),[m,b]=j.useState(1),[v,y]=j.useState(0),k=async()=>{d(!0);try{const U=await(await fetch(`${ye}/get_vault_files.php`,{credentials:"include"})).json();U.success&&r(U.folders||[])}catch(M){console.error("Vault Sync Error",M)}finally{d(!1)}};j.useEffect(()=>{k()},[]);const _=async M=>{d(!0),s(M);try{const D=await(await fetch(`${ye}/get_vault_files.php?folder=${M}`,{credentials:"include"})).json();D.success&&l(D.files||[])}catch(U){console.error("Folder Fetch Error",U)}finally{d(!1)}},C=j.useMemo(()=>{if(!u)return i;const M=u.toLowerCase();return i.filter(U=>U.name.toLowerCase().includes(M)||U.provider&&U.provider.toLowerCase().includes(M)||U.ref&&U.ref.toLowerCase().includes(M))},[i,u]),E=()=>{s(null),l([]),f("")},T=()=>{b(1),y(0)},B=()=>{if(!a)return;const M=window.open("","","width=900,height=900");if(!M)return;const U=C.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("");M.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>
        `),M.document.close(),M.print()},F=()=>{if(!a)return;const M=C.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>${M}</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:k,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(ms,{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:M=>f(M.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(Nt,{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(Jd,{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})}):C.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:C.map((M,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:M.path,alt:M.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:()=>{x(M),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: ",M.ref||"S/R"]}),n.jsx("p",{className:"font-black uppercase truncate",children:M.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:M.name}),n.jsxs("p",{className:"text-[10px] font-bold text-indigo-600 mt-1 uppercase",children:["ID SISTEMA: ",M.id||"?"]})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>{x(M),T()},className:"p-2 bg-slate-50 hover:bg-indigo-600 hover:text-white rounded-lg transition-all text-slate-400",children:n.jsx(_c,{size:16})}),n.jsx("a",{href:M.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(ji,{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:M.size}),n.jsxs("span",{className:"text-sm font-black text-slate-900",children:["$",M.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((M,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(Y_,{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(M=>n.jsxs("button",{onClick:()=>_(M),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(Y_,{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:M.replace("_"," / ")})]},M))}),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:()=>x(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(xt,{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(M=>Math.max(.5,M-.2)),className:"p-2 text-white hover:bg-white/10 rounded-lg",children:n.jsx(mq,{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(M=>Math.min(3,M+.2)),className:"p-2 text-white hover:bg-white/10 rounded-lg",children:n.jsx(hq,{size:20})}),n.jsx("div",{className:"w-px h-6 bg-white/10 mx-2"}),n.jsx("button",{onClick:()=>y(M=>M+90),className:"p-2 text-white hover:bg-white/10 rounded-lg",children:n.jsx(gK,{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(Nt,{size:18})," Imprimir Comprobante"]})})]})]})},zIe=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState(!0),[i,l]=j.useState("banco"),[o,d]=j.useState(""),[u,f]=j.useState({month:new Date().getMonth(),year:new Date().getFullYear()}),p=async()=>{s(!0);try{const v=await(await fetch(`${ye}/get_recaudacion_detallada.php`,{credentials:"include"})).json();v.success&&r(v.data||[])}catch(b){console.error("Fetch Recaudacion Error",b)}finally{s(!1)}};j.useEffect(()=>{p()},[]);const x=j.useMemo(()=>t.filter(b=>{const v=b.metodo.toLowerCase().includes("efectivo")||b.metodo.toLowerCase().includes("divisa"),y=i==="efectivo"?v:!v,k=o.toLowerCase(),_=!o||b.prop_code.toLowerCase().includes(k)||b.owner_name.toLowerCase().includes(k)||b.referencia.toLowerCase().includes(k),[C,E]=b.fecha.split("-").map(Number),T=C===u.year&&E-1===u.month;return y&&_&&T}),[t,i,o,u]),m=j.useMemo(()=>{const b=t.filter(k=>{const[_,C]=k.fecha.split("-").map(Number);return _===u.year&&C-1===u.month}),v=b.filter(k=>!(k.metodo.toLowerCase().includes("efectivo")||k.metodo.toLowerCase().includes("divisa"))),y=b.filter(k=>k.metodo.toLowerCase().includes("efectivo")||k.metodo.toLowerCase().includes("divisa"));return{total_banco:v.reduce((k,_)=>k+Number(_.monto_usd),0),total_efectivo:y.reduce((k,_)=>k+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:_e.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})})}):x.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"})]})}):x.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=x.map(y=>[y.fecha,y.prop_code,y.owner_name,y.referencia,`$ ${Number(y.monto_usd).toFixed(2)}`,y.metodo]);zc(`Recaudación Digital - ${_e[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(Nt,{size:16})," Imprimir Reporte"]})]})]})]})]})},$Ie=({user:e})=>{const{exchangeRateHistory:t,refreshData:r}=mt(),[a,s]=j.useState([]),[i,l]=j.useState(!0),[o,d]=j.useState(""),[u,f]=j.useState({month:new Date().getMonth(),year:new Date().getFullYear()}),[p,x]=j.useState(null),[m,b]=j.useState(!1),v=async()=>{l(!0);try{const E=await(await fetch(`${ye}/get_bill_payments_history.php`,{credentials:"include"})).json();E.success&&s(E.data||[])}catch(C){console.error("Fetch Bill Payments Error",C)}finally{l(!1)}};j.useEffect(()=>{v()},[]);const y=j.useMemo(()=>a.filter(C=>{const E=o.toLowerCase(),T=!o||C.provider.toLowerCase().includes(E)||C.reference.toLowerCase().includes(E)||C.bill_desc.toLowerCase().includes(E),[B,F]=C.payment_date.split("-").map(Number),M=B===u.year&&F-1===u.month;return T&&M}),[a,o,u]),k=async C=>{C.preventDefault(),b(!0);try{const T=await(await fetch(`${ye}/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!"),x(null),v(),r()):alert("Error: "+T.error)}catch{alert("Error de conexión con el Kernel.")}finally{b(!1)}},_=async C=>{if(confirm(`¿ANULAR ABONO? Esta acción eliminará el rastro en el Libro Diario de Banco y devolverá la deuda a la factura de ${C.provider}. ¿Proceder?`)){b(!0);try{const T=await(await fetch(`${ye}/delete_bill_payment.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:C.id,bill_id:C.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((C,E)=>C+Number(E.amount_usd),0).toFixed(2)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-300 mt-2",children:["Bs. ",y.reduce((C,E)=>C+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:C=>f({...u,month:parseInt(C.target.value)}),children:_e.map((C,E)=>n.jsx("option",{value:E,children:C},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:C=>f({...u,year:parseInt(C.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:C=>d(C.target.value)})]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>{const C=["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})}`]);zc("Auditoría de Egresos",C,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(Nt,{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((C,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:C.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(fb,{size:20})}),n.jsxs("div",{children:[n.jsx("p",{className:"font-black text-slate-900 text-[13px] uppercase leading-none",children:C.provider}),n.jsx("p",{className:"text-[10px] font-bold text-slate-400 uppercase mt-1 truncate max-w-[200px]",children:C.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:["#",C.reference]}),n.jsx("p",{className:"text-[9px] font-bold text-slate-400 uppercase mt-1",children:C.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(C.amount_usd).toFixed(2)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-300 uppercase mt-0.5",children:["Bs. ",Number(C.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:()=>x(C),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(vl,{size:18})}),n.jsx("button",{disabled:m,onClick:()=>_(C),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:()=>x(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(xt,{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:k,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:C=>x({...p,amount_bs:parseFloat(C.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:C=>x({...p,reference:C.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:C=>x({...p,payment_date:C.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"]})]})]})})]})},VIe=({user:e})=>{const[t,r]=j.useState(!1),[a,s]=j.useState({start:"",end:""}),[i,l]=j.useState([]),[o,d]=j.useState(!1),[u,f]=j.useState({type:null,message:""}),[p,x]=j.useState([]);Tp.useEffect(()=>{i.includes("fondo-reserva")&&ve.getReserveFundHistory(a.start,a.end).then(y=>x(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:gi,description:"Estado actual de cuentas y fondos."},{id:"recaudacion",label:"Recaudación Digital",icon:Tc,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:Zd,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:gs,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:po,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(k=>k.includes(y)?k.filter(_=>_!==y):[...k,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=hi.book_new();for(const k of i){let _=[],C="";switch(k){case"banco":_=(await ve.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})),C="Banco";break;case"balance":const T=await ve.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}],C="Balance General";break;case"recaudacion":_=(await ve.getFees()).flatMap(K=>K.debts.flatMap(ee=>ee.payments.map(J=>({Mes:`${K.month}/${K.year}`,Propiedad:ee.propertyId,Fecha:J.date,Referencia:J.reference,Método:J.method,"Monto ($)":J.amount,Turno:J.slot||""})))),C="Recaudación";break;case"egresos":_=(await ve.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||""})),C="Auditoría Egresos";break;case"convenios":_=(await ve.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})),C="Convenios Activos";break;case"historico-convenios":_=(await ve.getArchivedAgreements()).map(K=>({Propiedad:K.code,Propietario:K.owner_name,"Monto Original ($)":K.original_amount,"Fecha Finalización":K.completion_date,Estatus:"Finalizado"})),C="Histórico Convenios";break;case"efectivo-recibido":_=(await ve.getFees()).flatMap(K=>K.debts.flatMap(ee=>ee.payments.filter(J=>J.method.toLowerCase().includes("efectivo")).map(J=>({Fecha:J.date,Propiedad:ee.propertyId,Referencia:J.reference,"Monto ($)":J.amount,Concepto:`Pago Cuota ${K.month}/${K.year}`})))),C="Efectivo Recibido";break;case"efectivo-pagado":_=(await ve.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||""})),C="Efectivo Pagado";break;case"comisiones":_=(await ve.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})),C="Comisiones";break;case"cobro-propietario":const G=await ve.getProperties();_=(await ve.getFees()).flatMap(K=>K.debts.flatMap(ee=>{const J=G.find(W=>W.id===ee.propertyId);return ee.payments.map(W=>({Mes:`${K.month}/${K.year}`,Propiedad:J?J.code:ee.propertyId,Propietario:J?J.number:"",Fecha:W.date,Referencia:W.reference,Método:W.method,"Monto ($)":W.amount}))})),C="Cobro Propietario";break;case"auditoria":_=(await ve.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})),C="Auditoría Sistema";break;case"fondo-reserva":_=(await ve.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})),C="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=hi.json_to_sheet(_);hi.book_append_sheet(y,E,C)}}if(y.SheetNames.length===0)f({type:"error",message:"No se encontraron datos para los criterios seleccionados."});else if(o){for(const k of y.SheetNames){const _=y.Sheets[k],C=hi.sheet_to_csv(_),E=new Blob([C],{type:"text/csv;charset=utf-8;"}),T=URL.createObjectURL(E),B=document.createElement("a");B.href=T,B.setAttribute("download",`Reporte_${k.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 OE(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(k=>({...k,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(k=>({...k,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 k=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 ${k?"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 ${k?"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 ${k?"text-white":"text-slate-900"}`,children:y.label}),n.jsx("p",{className:`text-[10px] font-medium leading-relaxed ${k?"text-blue-100":"text-slate-500"}`,children:y.description}),k&&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 ${k?"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(Sk,{width:"100%",height:"100%",children:n.jsxs(zj,{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(Zb,{strokeDasharray:"3 3",vertical:!1,stroke:"#f1f5f9"}),n.jsx(ev,{dataKey:"period",hide:!0}),n.jsx(tv,{hide:!0}),n.jsx(Tj,{contentStyle:{borderRadius:"1rem",border:"none",boxShadow:"0 10px 15px -3px rgb(0 0 0 / 0.1)",fontSize:"10px",fontWeight:"bold"}}),n.jsx(IA,{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(ji,{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(ko,{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."})]})]})})]})},GIe=({user:e})=>{const[t,r]=j.useState(!1),[a,s]=j.useState("receivable"),[i,l]=j.useState(new Date().getMonth()+1),[o,d]=j.useState(new Date().getFullYear()),[u,f]=j.useState(!1),[p,x]=j.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,k)=>new Date().getFullYear()-k),v=async()=>{r(!0),x({type:null,message:""});try{const y=await ve.getDetailedExcelReport(i,o,a);if(y.length===0){x({type:"error",message:"No se encontraron registros para el periodo seleccionado."}),r(!1);return}const k=hi.book_new(),_=hi.json_to_sheet(y),C=a==="receivable"?"Cuentas por Cobrar":"Cuentas por Pagar";hi.book_append_sheet(k,_,C);const E=`Reporte_Detallado_${C.replace(/\s+/g,"_")}_${i}_${o}`;if(u){const T=hi.sheet_to_csv(_),B=new Blob([T],{type:"text/csv;charset=utf-8;"}),F=URL.createObjectURL(B),M=document.createElement("a");M.href=F,M.setAttribute("download",`${E}.csv`),document.body.appendChild(M),M.click(),document.body.removeChild(M),x({type:"success",message:"Archivo CSV generado exitosamente."})}else OE(k,`${E}.xlsx`),x({type:"success",message:"Reporte Excel generado exitosamente."})}catch(y){console.error("Detailed Report Error",y),x({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(ik,{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(ji,{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."]})]})]})]})})]})]})]})},KIe=({user:e})=>{const[t,r]=j.useState(!1),[a,s]=j.useState({start:"",end:""}),[i,l]=j.useState(null),[o,d]=j.useState(null),[u,f]=j.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:gi,description:"Estado actual de cuentas y fondos."},{id:"recaudacion",label:"Recaudación Digital",icon:Tc,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:Zd,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:gs,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:po,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."}],x=async b=>{r(!0),f({type:null,message:""}),l(b);try{let v=[],y="",k=[];switch(b){case"banco":const _=await ve.getBankTransactions();y="Libro de Banco / Movimientos",k=["Fecha","Descripción","Tipo","Categoría","Referencia","Monto ($)","Monto (Bs)"],v=_.map(Q=>[Q.date,Q.description,Q.type,Q.category,Q.reference||"",Q.amount,Q.amountBs||0]);break;case"balance":const C=await ve.getFinancialTotals();y="Balance General",k=["Concepto","Valor"],v=[["Saldo Caja (Bs)",C.cashBalanceBs],["Cuentas por Pagar (USD)",C.accountsPayableUsd],["Cuentas por Cobrar (USD)",C.receivablesUsd],["Total Facturado (USD)",C.totalBilledUsd],["Total Recaudado (USD)",C.totalCollectedUsd],["Fondo de Reserva (USD)",C.reserveFundUsd],["Fondo de Reserva (Bs)",C.reserveFundBs],["Fondo en Divisa (USD)",C.initialCashUsd||0]];break;case"recaudacion":const E=await ve.getFees();y="Recaudación Digital",k=["Mes","Propiedad","Fecha","Referencia","Método","Monto ($)","Turno"],v=E.flatMap(Q=>Q.debts.flatMap(Y=>Y.payments.map(K=>[`${Q.month}/${Q.year}`,Y.propertyId,K.date,K.reference,K.method,K.amount,K.slot||""])));break;case"egresos":const T=await ve.getPendingBills();y="Auditoría de Egresos",k=["Fecha","Proveedor","Descripción","Monto ($)","Monto (Bs)","Estatus","Fecha Pago","Fuente Pago","Referencia"],v=T.map(Q=>[Q.creationDate,Q.provider,Q.description,Q.amount,Q.amountBs,Q.status,Q.paidDate||"",Q.paymentSource||"",Q.paymentReference||""]);break;case"convenios":const B=await ve.getInitialDebtData();y="Convenios de Pago Activos",k=["Propiedad","Propietario","Deuda Original ($)","Total Pagado ($)","Deuda Pendiente ($)","Cant. Pagos"],v=B.map(Q=>[Q.code,Q.ownerName,Q.original_debt,Q.total_paid,Q.current_debt,Q.history?Q.history.length:0]);break;case"historico-convenios":const F=await ve.getArchivedAgreements();y="Histórico de Convenios",k=["Propiedad","Propietario","Monto Original ($)","Fecha Finalización","Estatus"],v=F.map(Q=>[Q.code,Q.owner_name,Q.original_amount,Q.completion_date,"Finalizado"]);break;case"efectivo-recibido":const M=await ve.getFees();y="Efectivo Recibido (Oficina)",k=["Fecha","Propiedad","Referencia","Monto ($)","Concepto"],v=M.flatMap(Q=>Q.debts.flatMap(Y=>Y.payments.filter(K=>K.method.toLowerCase().includes("efectivo")).map(K=>[K.date,Y.propertyId,K.reference,K.amount,`Pago Cuota ${Q.month}/${Q.year}`])));break;case"efectivo-pagado":const U=await ve.getPendingBills();y="Efectivo Pagado (Proveedores)",k=["Fecha","Proveedor","Descripción","Monto ($)","Referencia"],v=U.filter(Q=>Q.paymentSource==="Efectivo").map(Q=>[Q.paidDate||Q.creationDate,Q.provider,Q.description,Q.amount,Q.paymentReference||""]);break;case"comisiones":const D=await ve.getBankTransactions();y="Cálculo de Comisiones",k=["Fecha","Descripción","Referencia","Monto ($)","Monto (Bs)"],v=D.filter(Q=>Q.category==="Comisiones"&&Q.type==="Egreso").map(Q=>[Q.date,Q.description,Q.reference||"",Q.amount,Q.amountBs||0]);break;case"cobro-propietario":const L=await ve.getProperties(),P=await ve.getFees();y="Control Cobro Propietario",k=["Mes","Propiedad","Propietario","Fecha","Referencia","Método","Monto ($)"],v=P.flatMap(Q=>Q.debts.flatMap(Y=>{const K=L.find(ee=>ee.id===Y.propertyId);return Y.payments.map(ee=>[`${Q.month}/${Q.year}`,K?K.code:Y.propertyId,K?K.number:"",ee.date,ee.reference,ee.method,ee.amount])}));break;case"auditoria":const G=await ve.getAuditLogs();y="Informes y Auditoría",k=["Fecha","Usuario","Rol","Acción","Módulo","IP"],v=G.logs.map(Q=>[Q.created_at,Q.username,Q.user_role,Q.action,Q.module,Q.ip_address]);break;case"fondo-reserva":const H=await ve.getReserveFundHistory(a.start,a.end);y="Fondo de Reserva (Histórico)",k=["Periodo","Aporte Mensual (Bs)","Aporte Mensual ($)","Acumulado (Bs)","Acumulado ($)"],v=H.history.map(Q=>[Q.period,Q.monthly_bs,Q.monthly_usd,Q.accumulated_bs,Q.accumulated_usd]);break}a.start&&a.end&&(v=v.filter(_=>{const C=_[0];return typeof C=="string"&&C.match(/^\d{4}-\d{2}-\d{2}/)?C>=a.start&&C<=a.end:!0})),v.length===0?f({type:"error",message:"No se encontraron datos para los criterios seleccionados."}):d({title:y,headers:k,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:()=>x(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(_c,{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(Nt,{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(xt,{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,k)=>n.jsx("td",{className:"p-4 text-xs font-bold text-slate-700",children:typeof y=="number"?y.toLocaleString("en-US",{minimumFractionDigits:2}):y},k))},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(ko,{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,k)=>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},k))},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(_c,{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."})]})]})})]})},to=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})},qIe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,financialTotals:i,latestRate:l}=mt(),[o,d]=j.useState(new Date().getMonth()),[u,f]=j.useState(new Date().getFullYear()),[p,x]=j.useState(e.role==="owner"&&e.propertyId||null),[m,b]=j.useState("selection"),[v,y]=j.useState([]),[k,_]=j.useState(!1),[C,E]=j.useState(null),[T,B]=j.useState({});j.useEffect(()=>{(async()=>{_(!0);try{const[Q,Y]=await Promise.all([ve.getInitialDebtData(),ve.getSystemSettings()]);Array.isArray(Q)?y(Q):Q&&Q.success&&y(Q.data||[]),B(Y||{})}catch(Q){console.error("Error fetching data",Q)}finally{_(!1)}})()},[]);const F=j.useMemo(()=>t.find(H=>H.month===o&&H.year===u),[t,o,u]),M=j.useMemo(()=>r.find(H=>H.id===p),[r,p]),U=j.useMemo(()=>v.find(H=>H.id===p),[v,p]),D=j.useMemo(()=>{if(!M)return null;const H=a.find(Y=>Y.propertyId===M.id&&Y.isOwner),Q=s.find(Y=>Y.cedula===(H==null?void 0:H.cedula));return{fullName:(H==null?void 0:H.fullName)||"Propietario",email:(Q==null?void 0:Q.email)||"",phone:(H==null?void 0:H.phone)||(Q==null?void 0:Q.phone)||"",telegramId:(Q==null?void 0:Q.telegramChatId)||"",propertyCode:M.code,propertyId:M.id}},[M,a,s]),L=H=>{if(!H)return"";let Q=H.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,"")},P=async H=>{if(!D||!M)return;const Q=F==null?void 0:F.debts.find(W=>W.propertyId===p),Y=Q?Number(Q.amountUsd)-Number(Q.paidAmount):0,K=(U==null?void 0:U.current_debt)||0,ee=Y+K,J=`🏢 *ESTADO DE CUENTA INDIVIDUAL - SAC 2026*

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

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

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

¡Gracias!`;if(H==="whatsapp"){const W=L(D.phone);if(!W)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${W}?text=${encodeURIComponent(J)}`,"_blank");return}if(H==="share"){if(navigator.share)try{await navigator.share({title:`Estado de Cuenta Individual - ${M.code}`,text:J.replace(/\*/g,""),url:Mr})}catch(W){console.warn("Share failed",W)}else alert("La función de compartir no está disponible en este navegador.");return}E(H);try{const W={channel:H,messageType:"custom",subject:`Estado de Cuenta SAC 2026 - ${M.code}`,recipients:[{name:D.fullName,email:D.email,telegramChatId:D.telegramId,customMessage:J.replace(/\*/g,"")}]},O=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)})).json();O.status==="success"?alert(`¡Éxito! Mensaje enviado por ${H}.`):alert("Error: "+O.message)}catch{alert("Error de red al enviar.")}finally{E(null)}},G=()=>{if(!M||!D)return;const H=F==null?void 0:F.debts.find(O=>O.propertyId===p),Q=H?Number(H.amountUsd)-Number(H.paidAmount):0,Y=(U==null?void 0:U.current_debt)||0,K=Q+Y,ee=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Estado de Cuenta - ${M.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 - ${_e[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">${M.code} (${M.type} ${M.number})</div>
            </div>
        </div>
        <div class="detail-row">
            <span class="detail-label">Cuota del Mes</span>
            <span class="detail-value">$ ${to(Q)}</span>
        </div>
        <div class="detail-row">
            <span class="detail-label">Convenio de Pago</span>
            <span class="detail-value">$ ${to(Y)}</span>
        </div>
        <div class="amount-box">
            <div class="amount-label">Total Pendiente</div>
            <div class="amount-value">$ ${to(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>`,J=new Blob([ee],{type:"text/html"}),W=URL.createObjectURL(J),R=document.createElement("a");R.href=W,R.download=`EstadoCuenta_${M.code}.html`,R.click(),URL.revokeObjectURL(W)};if(m==="report"&&M&&D){const H=F==null?void 0:F.debts.find(ee=>ee.propertyId===p),Q=H?Number(H.amountUsd)-Number(H.paidAmount):0,Y=(U==null?void 0:U.current_debt)||0,K=Q+Y;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(ms,{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(Nt,{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(Er,{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(rn,{size:20})}),n.jsx("button",{onClick:()=>P("telegram"),disabled:!D.telegramId||!!C,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${D.telegramId?"bg-sky-500":"bg-slate-200"}`,children:C==="telegram"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Sl,{size:20})}),n.jsx("button",{onClick:()=>P("email"),disabled:!D.email||!!C,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${D.email?"bg-indigo-600":"bg-slate-200"}`,children:C==="email"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Pr,{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(ya,{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:[M.type," ",M.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(M.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:[M.type," ",M.number," (",M.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:[_e[o]," ",u]})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("p",{className:"text-xl font-black text-slate-900",children:["$ ",to(Q)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["Bs. ",Nm(Q*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(Zd,{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:["$ ",to(Y)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["Bs. ",Nm(Y*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:["$ ",to(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(Pr,{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,J)=>n.jsx("p",{className:"text-[11px] font-bold text-slate-700",children:ee.trim()},J)),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:H=>d(Number(H.target.value)),className:"bg-transparent border-none text-xs font-black uppercase tracking-widest text-slate-500 outline-none px-4 cursor-pointer",children:_e.map((H,Q)=>n.jsx("option",{value:Q,children:H},Q))}),n.jsx("input",{type:"number",value:u,onChange:H=>f(Number(H.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(PA,{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:H=>x(Number(H.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(H=>e.role!=="owner"||H.id===e.propertyId).sort((H,Q)=>H.code.localeCompare(Q.code,void 0,{numeric:!0})).map(H=>n.jsxs("option",{value:H.id,children:[H.code," - ",H.type," ",H.number]},H.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})]}),k&&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})},WIe=({user:e})=>{var L,P;const{properties:t,residents:r,users:a,latestRate:s}=mt(),[i,l]=j.useState(new Date().getMonth()),[o,d]=j.useState(new Date().getFullYear()),[u,f]=j.useState(null),[p,x]=j.useState("selection"),[m,b]=j.useState(!1),[v,y]=j.useState(null),[k,_]=j.useState(null),[C,E]=j.useState({});j.useEffect(()=>{(async()=>{try{const H=await ve.getSystemSettings();E(H||{})}catch(H){console.error("Error fetching settings",H)}})()},[]);const T=j.useMemo(()=>t.find(G=>G.id===u),[t,u]),B=j.useMemo(()=>{if(!T)return null;const G=r.find(Q=>Q.propertyId===T.id&&Q.isOwner),H=a.find(Q=>Q.cedula===(G==null?void 0:G.cedula));return{fullName:(G==null?void 0:G.fullName)||"Propietario",email:(H==null?void 0:H.email)||"",phone:(G==null?void 0:G.phone)||(H==null?void 0:H.phone)||"",telegramId:(H==null?void 0:H.telegramChatId)||"",propertyCode:T.code,propertyId:T.id}},[T,r,a]),F=async()=>{if(u){b(!0);try{const H=await(await fetch(`${ye}/get_detailed_account_status.php?propertyId=${u}&month=${i}&year=${o}`,{credentials:"include"})).json();H.success?(y(H),x("report")):alert("Error: "+H.error)}catch{alert("Error de red al obtener el reporte.")}finally{b(!1)}}},M=G=>{if(!G)return"";let H=G.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,"")},U=async G=>{var K;if(!B||!T||!v)return;const H=_e[i],Q=v.movements.reduce((ee,J)=>ee+J.amount,0);let Y=`🏢 *ESTADO DE CUENTA DETALLADO - SAC 2026*

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

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

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

¡Gracias!`,G==="whatsapp"){const ee=M(B.phone);if(!ee)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${ee}?text=${encodeURIComponent(Y)}`,"_blank");return}if(G==="share"){if(navigator.share)try{await navigator.share({title:`Estado de Cuenta Detallado - ${T.code}`,text:Y.replace(/\*/g,""),url:Mr})}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:Y.replace(/\*/g,"")}]},W=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)})).json();W.status==="success"?alert(`¡Éxito! Mensaje enviado por ${G}.`):alert("Error: "+W.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 - ${_e[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;">${C.payment_bank_name||"BanPlus"} ${C.payment_account_type||"Cta Cte"}</div>
                    <div style="font-weight: 900; color: #1e3a8a; margin: 2px 0;"># ${C.payment_account_number||"0174-0124-6812-4414-5759"}</div>
                    <div style="color: #475569;">RIF: ${C.payment_rif||"J-313266507"}</div>
                    <div style="color: #475569;">Pago Móvil: ${C.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>
                    ${(C.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: ${C.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>`,H=new Blob([G],{type:"text/html"}),Q=URL.createObjectURL(H),Y=document.createElement("a");Y.href=Q,Y.download=`DetalleCuenta_${T.code}.html`,Y.click(),URL.revokeObjectURL(Q)};if(p==="report"&&T&&B&&v){const G=v.movements.reduce((H,Q)=>H+Q.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:()=>x("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(ms,{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(Nt,{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(Er,{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(rn,{size:20})}),n.jsx("button",{onClick:()=>U("telegram"),disabled:!B.telegramId||!!k,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${B.telegramId?"bg-sky-500":"bg-slate-200"}`,children:k==="telegram"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Sl,{size:20})}),n.jsx("button",{onClick:()=>U("email"),disabled:!B.email||!!k,className:`p-3 rounded-xl text-white shadow-lg active:scale-95 transition-all ${B.email?"bg-indigo-600":"bg-slate-200"}`,children:k==="email"?n.jsx($t,{size:20,className:"animate-spin"}):n.jsx(Pr,{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(ya,{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 (",_e[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((H,Q)=>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:H.description}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest",children:[H.date," • Ref: ",H.reference]})]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("p",{className:"text-sm font-black text-emerald-600",children:["+ $ ",ul(H.amount)]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase",children:["Bs. ",Cm(H.amount*s)]})]})]},Q)),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(Oc,{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:[C.payment_bank_name||"BanPlus"," ",C.payment_account_type||"Cta Cte"]}),n.jsxs("p",{className:"text-[11px] font-black text-blue-900 tracking-wider",children:["# ",C.payment_account_number||"0174-0124-6812-4414-5759"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase",children:["RIF: ",C.payment_rif||"J-313266507"]}),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase",children:["Pago Móvil: ",C.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(Pr,{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:"}),(C.payment_emails||"tejarcondominio@gmail.com, condominiotejar@gmail.com").split(",").map((H,Q)=>n.jsx("p",{className:"text-[11px] font-bold text-slate-700",children:H.trim()},Q)),n.jsxs("p",{className:"text-[11px] font-bold text-slate-600 uppercase mt-1",children:["WhatsApp: ",C.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:_e.map((G,H)=>n.jsx("option",{value:H,children:G},H))}),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,H)=>G.code.localeCompare(H.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"]})]})})]})},ds=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},oN=({user:e,initialMode:t,onNavigate:r})=>{const{fees:a,properties:s,residents:i,users:l,latestRate:o}=mt(),[d,u]=j.useState(new Date().getMonth()),[f,p]=j.useState(new Date().getFullYear()),[x,m]=j.useState(null),[b,v]=j.useState("selection"),[y,k]=j.useState(null),[_,C]=j.useState(!1),[E,T]=j.useState([]),[B,F]=j.useState(!1),M=j.useRef(null);j.useEffect(()=>{(async()=>{F(!0);try{const he=await ve.getInitialDebtData();T(Array.isArray(he)?he:[])}catch(he){console.error("Error fetching agreements:",he)}finally{F(!1)}})()},[]);const U=j.useMemo(()=>a.find(ie=>ie.month===d&&ie.year===f),[a,d,f]),D=j.useMemo(()=>s.find(ie=>ie.id===x),[s,x]),L=j.useMemo(()=>{if(!D)return null;const ie=i.find(Z=>Z.propertyId===D.id&&Z.isOwner),he=l.find(Z=>Z.cedula===(ie==null?void 0:ie.cedula));return{fullName:(ie==null?void 0:ie.fullName)||"Propietario",email:(he==null?void 0:he.email)||"",phone:(ie==null?void 0:ie.phone)||(he==null?void 0:he.phone)||"",telegramId:(he==null?void 0:he.telegramChatId)||"",propertyCode:D.code}},[D,i,l]),P=j.useMemo(()=>!U||!x?null:U.debts.find(ie=>ie.propertyId===x),[U,x]),G=j.useMemo(()=>{if(!x)return{totalDebt:0,isFullySolvent:!0};let ie=0;return a.forEach(he=>{const Z=he.debts.find(Ue=>Ue.propertyId===x);Z&&(ie+=Number(Z.amountUsd)-Number(Z.paidAmount))}),{totalDebt:ie,isFullySolvent:ie<=0}},[a,x]),[H,Q]=j.useState(!1),[Y,K]=j.useState({date:new Date().toLocaleDateString("es-ES",{day:"numeric",month:"long",year:"numeric"}),city:"San Diego",recipientName:"",recipientId:"",mode:"html"}),[ee,J]=j.useState(null);j.useEffect(()=>{t&&x&&b==="receipt"&&(K(ie=>({...ie,mode:t})),Q(!0))},[t,x,b]),j.useEffect(()=>{!["admin","programmer"].includes(e.role)&&e.propertyId&&m(e.propertyId)},[e]),j.useEffect(()=>{(async()=>{try{const he=await ve.getSystemSettings();J(he)}catch(he){console.error("Error fetching settings",he)}})()},[]);const W=j.useMemo(()=>D?E.find(ie=>ie.code===D.code):null,[E,D]),R=j.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(),he=`
<!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">${Y.city}, ${Y.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>${Y.recipientName.toUpperCase()||L.fullName.toUpperCase()}</strong>, 
            titular de la Cédula de Identidad N° <strong>${Y.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>${_e[d].toUpperCase()} ${f}</strong>.
            <br><br>
            Se expide la presente a petición de la parte interesada, en la ciudad de ${Y.city}, a los ${Y.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, ${Y.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(he),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: ${Y.city.toUpperCase()}
FECHA: ${Y.date.toUpperCase()}

A QUIEN PUEDA INTERESAR:

Por medio de la presente se hace constar que el ciudadano(a) ${Y.recipientName.toUpperCase()||L.fullName.toUpperCase()}, titular de la Cédula de Identidad N° ${Y.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 ${_e[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, ${Y.city.toUpperCase()}, ${Y.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.
----------------------------------------------------------
        `,he=new Blob([ie],{type:"text/plain"}),Z=URL.createObjectURL(he),Ue=document.createElement("a");Ue.href=Z,Ue.download=`Solvencia_${D.code}_${_e[d]}.txt`,Ue.click(),URL.revokeObjectURL(Z)},z=ie=>{if(!ie)return"";let he=ie.trim();return he.startsWith("+")?he.replace(/\D/g,""):he.startsWith("0")?"58"+he.substring(1).replace(/\D/g,""):he.length===10?"58"+he.replace(/\D/g,""):he.replace(/\D/g,"")},X=()=>{if(!L||!D||!P)return"";const ie=R?"✅ SOLVENTE":"⚠️ PENDIENTE",he=Number(P.paidAmount),Z=Number(P.amountUsd),Ue=Z-he;return`📄 *ACUSE DE RECIBO - SAC 2026*

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

🔗 *ACCEDER AL PORTAL:* ${Mr}

¡Gracias por su compromiso!`},re=async ie=>{if(!L||!D||!P)return;const he=X();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(he)}`,"_blank");return}if(ie==="share"){if(navigator.share)try{await navigator.share({title:`Acuse de Recibo - ${D.code}`,text:he.replace(/\*/g,""),url:Mr})}catch(Z){console.warn("Share failed",Z)}else alert("La función de compartir no está disponible en este navegador.");return}k(ie);try{const Z=Number(P.paidAmount),Ue=Number(P.amountUsd),Ie=Ue-Z,be={channel:ie,messageType:"receipt",monthName:_e[d],year:f,recipients:[{name:L.fullName,email:L.email,telegramChatId:L.telegramId,propName:`${D.code} (${D.type} ${D.number})`,amount:ds(Ue),paid:ds(Z),status:R?"Solvente":"Pendiente",balance:ds(Ie)}]},fe=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(be)})).json();fe.status==="success"?alert(`¡Éxito! Recibo enviado por ${ie}.`):alert("Error: "+fe.message)}catch{alert("Error de red al enviar.")}finally{k(null)}},le=()=>{const ie=X();navigator.clipboard.writeText(ie),alert("Copiado al portapapeles")},ne=async()=>{if(M.current){C(!0);try{const he=(await ys(M.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"})).toDataURL("image/png"),Z=document.createElement("a");Z.href=he,Z.download=`Recibo_${D==null?void 0:D.code}_${_e[d]}.png`,Z.click()}catch(ie){console.error("Capture failed",ie),alert("Error al capturar imagen.")}finally{C(!1)}}},ae=async()=>{if(M.current){C(!0);try{const ie=await ys(M.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"}),he=await new Promise(Ie=>ie.toBlob(Ie,"image/png"));if(!he)throw new Error("Blob creation failed");const Z=`Recibo_${D==null?void 0:D.code}_${_e[d]}.png`,Ue=new File([he],Z,{type:"image/png"});if(navigator.share&&navigator.canShare&&navigator.canShare({files:[Ue]}))await navigator.share({files:[Ue],title:`Acuse de Recibo - ${D==null?void 0:D.code}`,text:`Acuse de Recibo de ${_e[d]} ${f} para la unidad ${D==null?void 0:D.code}`});else{const Ie=ie.toDataURL("image/png"),be=document.createElement("a");be.href=Ie,be.download=Z,be.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{C(!1)}}};if(b==="receipt"&&D&&L&&P){const ie=Number(P.paidAmount),he=Number(P.amountUsd),Z=he-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(ms,{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(Nt,{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(Fp,{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(ya,{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(rn,{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(Sl,{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(Pr,{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(ya,{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(db,{size:20})})]})]}),n.jsxs("div",{ref:M,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:["$ ",ds(he)]})]}),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:["$ ",ds(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:["$ ",ds(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 ${R?"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:R?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:R?"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:[_e[d]," ",f]})]}),R&&n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsxs("button",{onClick:()=>{K(Ue=>({...Ue,mode:"html"})),Q(!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(Er,{size:16}),"Solvencia HTML Pro"]}),n.jsxs("button",{onClick:()=>{K(Ue=>({...Ue,mode:"txt"})),Q(!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: $ ${ds(G.totalDebt)}`}),W&&W.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:["$",ds(W.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((Ue,Ie)=>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:[Ue.method," - Ref: ",Ue.reference]}),n.jsxs("p",{className:"text-[9px] font-bold text-slate-400 uppercase tracking-widest",children:[Ue.date," • ",Ue.slot]})]})]}),n.jsxs("p",{className:"text-sm font-black text-slate-900",children:["$ ",ds(Ue.amount)]})]},Ie))})]}),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"})})]})]}),H&&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:()=>Q(!1),className:"p-3 hover:bg-white/10 rounded-2xl transition-colors",children:n.jsx(xt,{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:Y.date,onChange:Ue=>K({...Y,date:Ue.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(_M,{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:Y.city,onChange:Ue=>K({...Y,city:Ue.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(eu,{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:Y.recipientName,onChange:Ue=>K({...Y,recipientName:Ue.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(Ip,{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:Y.recipientId,onChange:Ue=>K({...Y,recipientId:Ue.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:()=>Q(!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"}),Y.mode==="html"?n.jsxs("button",{onClick:()=>{O(),Q(!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(Er,{size:18}),"GENERAR SOLVENCIA HTML"]}):n.jsxs("button",{onClick:()=>{q(),Q(!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(ji,{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:_e.map((ie,he)=>n.jsx("option",{value:he,children:ie},he))}),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:x||"",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,he)=>ie.code.localeCompare(he.code,void 0,{numeric:!0})).map(ie=>n.jsxs("option",{value:ie.id,children:[ie.code," - ",ie.type," ",ie.number]},ie.id))]})]}),x&&W&&W.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:["$",ds(W.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(ms,{size:12,className:"rotate-180"}),' Diríjase al menú "Estado de Cuenta Individual" para más detalles']})]}),n.jsxs("button",{disabled:!x||!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&&x&&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})},YIe=({user:e})=>{const{properties:t,latestRate:r}=mt(),[a,s]=j.useState(!1),[i,l]=j.useState([]),[o,d]=j.useState(""),[u,f]=j.useState(null),p=async()=>{s(!0);try{const k=await ve.getCreditBalances();l(k)}catch(k){console.error("Error fetching credit balances",k)}finally{s(!1)}};j.useEffect(()=>{p()},[]);const x=j.useMemo(()=>i.filter(k=>k.propertyCode.toLowerCase().includes(o.toLowerCase())||k.ownerName.toLowerCase().includes(o.toLowerCase())),[i,o]),m=j.useMemo(()=>u?i.find(k=>k.propertyId===u):null,[i,u]),b=()=>{const k=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||""})),_=hi.json_to_sheet(k),C=hi.book_new();hi.book_append_sheet(C,_,"Saldos a Favor"),OE(C,`Saldos_a_Favor_${new Date().toISOString().split("T")[0]}.xlsx`)},v=()=>{const k=window.open("","","width=900,height=900");if(!k)return;const _=x.map(C=>`
            <tr>
                <td style="padding:10px; border-bottom:1px solid #eee;">${C.propertyCode}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${C.ownerName}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">$${km(C.amountUsd)}</td>
                <td style="padding:10px; border-bottom:1px solid #eee; text-align:right;">Bs. ${jm(C.amountBs)}</td>
                <td style="padding:10px; border-bottom:1px solid #eee;">${C.lastUpdate}</td>
            </tr>
        `).join("");k.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>
        `),k.document.close(),k.print()},y=()=>{const k=x.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>${k}</tbody>
                </table>
            </body>
            </html>
        `,C=new Blob([_],{type:"text/html"}),E=URL.createObjectURL(C),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(Nt,{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(Jd,{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:k=>f(Number(k.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((k,_)=>k.code.localeCompare(_.code,void 0,{numeric:!0})).map(k=>n.jsxs("option",{value:k.id,children:[k.code," - ",k.type," ",k.number]},k.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:k=>d(k.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..."})]})}):x.length>0?x.map(k=>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:k.propertyCode}),n.jsxs("span",{className:"text-xs font-black text-slate-900 uppercase tracking-tighter",children:["Unidad ",k.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:k.ownerName}),n.jsxs("p",{className:"text-[9px] font-medium text-slate-400 uppercase tracking-widest",children:["Act: ",k.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(k.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(k.amountBs)]})})]},k.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"})]})})})]})})]})]})]})},XIe=({user:e})=>{const[t,r]=j.useState([]),[a,s]=j.useState(!0),[i,l]=j.useState(!1),[o,d]=j.useState(null),u=async()=>{s(!0);try{const m=await ve.getMonthlyCollectionHistory();r(m)}catch(m){console.error("Fetch Monthly Collection Error",m)}finally{s(!1)}};j.useEffect(()=>{u()},[]);const f=async()=>{l(!0);try{const m=await ve.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 ve.deleteMonthlyCollection(m)).success&&(r(v=>v.filter(y=>y.id!==m)),d(null))}catch(b){console.error("Delete Error",b)}},x=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(po,{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:[_e[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=>[`${_e[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)}%`]);zc("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:x,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(ya,{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(Nt,{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"})]})]})})})]})},ff=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},cN=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2})},JIe=({user:e})=>{const{properties:t,residents:r,latestRate:a,fees:s}=mt(),[i,l]=j.useState([]),[o,d]=j.useState(!0),[u,f]=j.useState(!1),[p,x]=j.useState(null),[m,b]=j.useState(!1),v=async W=>{if(!(!W||W==="S/R"||W.length<3))try{const O=await(await fetch(`${ye}/check_duplicate_reference.php?reference=${W}`,{credentials:"include"})).json();O.duplicate?x(O):x(null)}catch(R){console.error("Error checking duplicate",R)}},[y,k]=j.useState((e.role==="owner","list")),[_,C]=j.useState([]),[E,T]=j.useState({amountUsd:"",amountBs:"",paymentDate:new Date().toISOString().split("T")[0],reference:"",bankName:"",method:"Transferencia",observations:""}),[B,F]=j.useState(""),[M,U]=j.useState("Pendiente"),[D,L]=j.useState(null),[P,G]=j.useState({status:"",observations:"",assignedTo:"",targetId:""}),H=["admin","programmer","board"].includes(e.role),Q=async()=>{d(!0);try{const[W,R]=await Promise.all([ve.getPaymentReports(e.role==="owner"?e.propertyId:void 0),ve.getInitialDebtData()]);l(W),C(Array.isArray(R)?R:R.data||[])}catch(W){console.error("Error loading reports",W)}finally{d(!1)}};j.useEffect(()=>{Q()},[e.propertyId,e.role]);const Y=async W=>{if(W.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 R=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:(R==null?void 0:R.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 ve.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:""}),k("list"),Q()}catch{alert("Error al enviar el reporte.")}finally{f(!1)}},K=async()=>{if(D){f(!0);try{await ve.updatePaymentReportStatus(D.id,P.status,P.observations,P.assignedTo,P.targetId),alert("Estatus actualizado."),L(null),Q()}catch{alert("Error al actualizar.")}finally{f(!1)}}},ee=j.useMemo(()=>i.filter(W=>{const R=W.propertyCode.toLowerCase().includes(B.toLowerCase())||W.ownerName.toLowerCase().includes(B.toLowerCase()),O=M==="Todos"||W.status===M;return R&&O}),[i,B,M]),J=j.useMemo(()=>{if(e.role!=="owner"||!e.propertyId)return null;let W=0;s.forEach(q=>{const z=q.debts.find(X=>X.propertyId===e.propertyId);z&&z.status!=="Pagado"&&(W+=Number(z.amountUsd)-Number(z.paidAmount||0))});const R=_.find(q=>q.id===e.propertyId),O=(R==null?void 0:R.current_debt)||0;return{totalFees:W,agreementDebt:O,total:W+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:()=>k("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(vi,{size:16})," Reportar Nuevo Pago"]}),e.role==="owner"&&y==="form"&&n.jsxs("button",{onClick:()=>k("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:Y,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:W=>{const R=W.target.value;T({...E,amountUsd:R,amountBs:R?(Number(R)*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:W=>{const R=W.target.value;T({...E,amountBs:R,amountUsd:R?(Number(R)/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:W=>T({...E,paymentDate:W.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:W=>{const R=W.target.value;T({...E,reference:R}),R.length>=3&&v(R)}})]})]}),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:W=>T({...E,bankName:W.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(Ip,{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:W=>T({...E,method:W.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:W=>T({...E,observations:W.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((W,R)=>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:["[",W.source,"]"]})," ",W.detail," - ",W.date]},R)),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:W=>b(W.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(vi,{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:["$ ",ff((J==null?void 0:J.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:["$ ",ff((J==null?void 0:J.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:["$ ",ff((J==null?void 0:J.total)||0)]}),n.jsxs("p",{className:"text-xl font-black text-blue-300 tracking-tight mt-2",children:["Bs. ",cN(((J==null?void 0:J.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:W=>F(W.target.value)})]}),n.jsx("div",{className:"flex gap-2",children:["Todos","Pendiente","Asignado","Rechazado"].map(W=>n.jsx("button",{onClick:()=>U(W),className:`px-6 py-3 rounded-xl font-black text-[9px] uppercase tracking-widest transition-all ${M===W?"bg-slate-900 text-white shadow-lg":"bg-slate-50 text-slate-400 hover:bg-slate-100"}`,children:W},W))})]}),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(W=>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:W.propertyCode}),n.jsxs("div",{children:[n.jsx("p",{className:"text-sm font-black text-slate-900 uppercase",children:W.ownerName}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-widest",children:[W.bankName," • ",W.method]})]})]})}),n.jsxs("td",{className:"px-8 py-6",children:[n.jsx("p",{className:"text-sm font-black text-slate-700",children:W.paymentDate}),n.jsxs("p",{className:"text-[10px] font-bold text-blue-600 uppercase tracking-widest",children:["REF: ",W.reference]})]}),n.jsxs("td",{className:"px-8 py-6 text-right",children:[n.jsxs("p",{className:"text-sm font-black text-slate-900",children:["$ ",ff(W.amountUsd)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["Bs. ",cN(W.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 ${W.status==="Asignado"?"bg-emerald-50 text-emerald-600":W.status==="Rechazado"?"bg-red-50 text-red-600":"bg-amber-50 text-amber-600"}`,children:[W.status==="Asignado"?n.jsx(Gt,{size:12}):W.status==="Rechazado"?n.jsx(jM,{size:12}):n.jsx(Oc,{size:12}),W.status]})})}),n.jsx("td",{className:"px-8 py-6 text-right",children:H?n.jsx("button",{onClick:()=>{L(W),G({status:W.status,observations:W.observations||"",assignedTo:W.assignedTo||"",targetId:W.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(ZIe,{size:18})}):n.jsx("button",{onClick:()=>L(W),className:"p-3 bg-slate-100 text-slate-400 rounded-xl hover:bg-slate-200 transition-all",children:n.jsx(yr,{size:18})})})]},W.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(eFe,{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:["$ ",ff(D.amountUsd)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-400 uppercase",children:["Bs. ",cN(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,'"']})]}),H&&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:W=>G({...P,status:W.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:W=>G({...P,assignedTo:W.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:W=>G({...P,observations:W.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"]})]}),!H&&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."})]})]})]})})]})},ZIe=({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"})]}),eFe=({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"})]}),tFe=()=>{const[e,t]=j.useState(!1),[r,a]=j.useState([]),[s,i]=j.useState(""),[l,o]=j.useState(new Date().getMonth()+1),[d,u]=j.useState(new Date().getFullYear()),f=async()=>{t(!0);try{const y=await ve.getDebtList(l,d);a(Array.isArray(y)?y:[])}catch(y){console.error("Error fetching debt list:",y)}finally{t(!1)}};j.useEffect(()=>{f()},[l,d]);const p=r.filter(y=>y.propertyNumber.toLowerCase().includes(s.toLowerCase())||y.ownerName.toLowerCase().includes(s.toLowerCase())),x=p.reduce((y,k)=>y+k.totalDebt,0),m=()=>{window.print()},b=()=>{const y=`*LISTADO DE DEUDORES - ${ba}*
Corte: ${_e[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: $${x.toFixed(2)}*`,k=`https://wa.me/?text=${encodeURIComponent(y)}`;window.open(k,"_blank")},v=()=>{const y=`
            <!DOCTYPE html>
            <html>
            <head>
                <title>Listado de Deudores - ${ba}</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> ${ba}</p>
                <p><strong>Corte:</strong> ${_e[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">$${x.toFixed(2)}</td>
                        </tr>
                    </tfoot>
                </table>
                <div class="footer">
                    Generado por SAC 2026 - ${Ln}
                </div>
            </body>
            </html>
        `,k=new Blob([y],{type:"text/html"}),_=URL.createObjectURL(k),C=document.createElement("a");C.href=_,C.download=`Deudores_${_e[l-1]}_${d}.html`,document.body.appendChild(C),C.click(),document.body.removeChild(C),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: ",_e[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(Nt,{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(ya,{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(ji,{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:_e.map((y,k)=>n.jsx("option",{value:k+1,children:y},k))}),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,k)=>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(eu,{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(ok,{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(Pr,{size:14})}),n.jsx("span",{className:"text-xs font-medium text-slate-500",children:y.email})]})})]},k))}),!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:x.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:ba}),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: ",_e[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,k)=>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})]},k))}),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:["$ ",x.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()]})]})]})]})},rFe=()=>{const[e,t]=j.useState(!1),[r,a]=j.useState([]),[s,i]=j.useState(""),[l,o]=j.useState(new Date().getMonth()+1),[d,u]=j.useState(new Date().getFullYear()),f=j.useRef(null),p=async()=>{t(!0);try{const T=await ve.getSolventList(l,d);a(Array.isArray(T)?T:[])}catch(T){console.error("Error fetching solvent list:",T)}finally{t(!1)}};j.useEffect(()=>{p()},[l,d]);const x=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 ys(f.current,{backgroundColor:"#ffffff",scale:2,logging:!1,useCORS:!0})).toDataURL("image/png"),F=document.createElement("a");F.href=B,F.download=`Solventes_${_e[l-1]}_${d}.png`,F.click()}catch(T){console.error("Capture failed:",T)}finally{t(!1)}}},v=()=>`*LISTADO DE SOLVENTES - ${ba}*
Periodo: ${_e[l-1]} ${d}

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

*Total Solventes: ${x.length}*`,y=()=>{const T=`https://wa.me/?text=${encodeURIComponent(v())}`;window.open(T,"_blank")},k=()=>{const T=encodeURIComponent(`Listado de Solventes - ${ba}`),B=encodeURIComponent(v());window.open(`mailto:?subject=${T}&body=${B}`)},_=()=>{navigator.clipboard.writeText(v()),alert("Formato copiado al portapapeles")},C=async()=>{if(navigator.share)try{await navigator.share({title:`Solventes ${ba}`,text:v()})}catch{console.log("Share cancelled")}else _()},E=()=>{const T=`
            <!DOCTYPE html>
            <html>
            <head>
                <title>Listado de Solventes - ${ba}</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> ${ba}</p>
                <p><strong>Periodo:</strong> ${_e[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>
                        ${x.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> ${x.length}</p>
                <div class="footer">
                    Generado por SAC 2026 - ${Ln}
                </div>
            </body>
            </html>
        `,B=new Blob([T],{type:"text/html"}),F=URL.createObjectURL(B),M=document.createElement("a");M.href=F,M.download=`Solventes_${_e[l-1]}_${d}.html`,document.body.appendChild(M),M.click(),document.body.removeChild(M),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: ",_e[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(Nt,{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(Fp,{size:14})," Capturar"]}),n.jsxs("button",{onClick:C,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(ya,{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(vi,{size:14})," WhatsApp"]}),n.jsxs("button",{onClick:k,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(Pr,{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(db,{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(Er,{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:_e.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:ba}),n.jsxs("p",{className:"text-slate-500 font-bold text-xs uppercase tracking-widest",children:["Listado de Solventes - ",_e[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..."})]})}):x.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."})]})}):x.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(eu,{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(ok,{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(Pr,{size:14})}),n.jsx("span",{className:"text-xs font-medium text-slate-500",children:T.email})]})})]},B))}),!e&&x.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:x.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()})]})]})]})},pf=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},aFe=({user:e})=>{const{fees:t,properties:r,residents:a,users:s,latestRate:i}=mt(),[l,o]=j.useState(new Date().getMonth()),[d,u]=j.useState(new Date().getFullYear()),[f,p]=j.useState(null),[x,m]=j.useState("selection"),[b,v]=j.useState(!1),[y,k]=j.useState(null),[_,C]=j.useState(null),E=j.useRef(null);j.useEffect(()=>{(async()=>{try{const ee=await ve.getSystemSettings();C(ee)}catch(ee){console.error("Error fetching settings",ee)}})()},[]),j.useEffect(()=>{e.role==="owner"&&e.propertyId&&p(e.propertyId)},[e]);const T=j.useMemo(()=>t.find(K=>K.month===l&&K.year===d),[t,l,d]),B=j.useMemo(()=>r.find(K=>K.id===f),[r,f]),F=j.useMemo(()=>{if(!B)return null;const K=a.find(J=>J.propertyId===B.id&&J.isOwner),ee=s.find(J=>J.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]),M=j.useMemo(()=>!T||!f?null:T.debts.find(K=>K.propertyId===f),[T,f]),U=j.useMemo(()=>M?Number(M.paidAmount)>=Number(M.amountUsd):!1,[M]),D=()=>{window.print()},L=async()=>{if(E.current){v(!0);try{const ee=(await ys(E.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"})).toDataURL("image/png"),J=document.createElement("a");J.href=ee,J.download=`Recibo_Pago_${B==null?void 0:B.code}_${_e[l]}.png`,J.click()}catch{alert("Error al capturar imagen.")}finally{v(!1)}}},P=async()=>{if(E.current){v(!0);try{const K=await ys(E.current,{scale:2,useCORS:!0,backgroundColor:"#ffffff"}),ee=await new Promise(R=>K.toBlob(R,"image/png"));if(!ee)throw new Error("Blob creation failed");const J=`Recibo_Pago_${B==null?void 0:B.code}_${_e[l]}.png`,W=new File([ee],J,{type:"image/png"});if(navigator.share&&navigator.canShare&&navigator.canShare({files:[W]}))await navigator.share({files:[W],title:`Recibo de Pago - ${B==null?void 0:B.code}`,text:`Recibo de Pago de ${_e[l]} ${d} para la unidad ${B==null?void 0:B.code}`});else{const R=K.toDataURL("image/png"),O=document.createElement("a");O.href=R,O.download=J,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,"")},H=()=>!F||!B||!M?"":`📄 *RECIBO DE PAGO - SAC 2026*

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

🔗 *Portal:* ${Mr}`,Q=async K=>{if(!F||!B||!M)return;const ee=H();if(K==="whatsapp"){const J=G(F.phone);if(!J)return alert("No hay teléfono registrado.");window.open(`https://wa.me/${J}?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:Mr})}catch{}else alert("Compartir no disponible.");return}k(K);try{const J={channel:K,messageType:"receipt",monthName:_e[l],year:d,recipients:[{name:F.fullName,email:F.email,telegramChatId:F.telegramId,propName:`${B.code}`,amount:pf(M.amountUsd),paid:pf(M.paidAmount||0),status:"Pagado",balance:"0.00"}]},R=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)})).json();R.status==="success"?alert(`Enviado por ${K}.`):alert("Error: "+R.message)}catch{alert("Error de red.")}finally{k(null)}},Y=()=>{const K=H();navigator.clipboard.writeText(K),alert("Copiado al portapapeles")};return x==="receipt"&&B&&F&&M?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(ms,{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(Nt,{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(Fp,{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(ya,{size:20})}),n.jsx("button",{onClick:()=>Q("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"WhatsApp",children:n.jsx(rn,{size:20})}),n.jsx("button",{onClick:()=>Q("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(Sl,{size:20})}),n.jsx("button",{onClick:()=>Q("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(Pr,{size:20})}),n.jsx("button",{onClick:()=>Q("share"),className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Compartir",children:n.jsx(ya,{size:20})}),n.jsx("button",{onClick:Y,className:"p-3 bg-slate-200 text-slate-600 rounded-xl shadow-lg active:scale-95 transition-all",title:"Copiar Formato",children:n.jsx(db,{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:[_e[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:["$ ",pf(M.paidAmount||0)]}),n.jsxs("p",{className:"text-[10px] font-bold text-slate-500 mt-2 uppercase",children:["Equivalente en Bs: ",pf((M.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:_e.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(Bc,{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."})]})]})})]})},nFe=({user:e})=>{const[t,r]=j.useState(null),[a,s]=j.useState(!1),[i,l]=j.useState(""),o=j.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(`${ye}/process_banplus_commissions.php`,{method:"POST",body:v,credentials:"include"}).then(async k=>{if(!k.ok){const _=await k.text();throw new Error(`Error ${k.status}: ${_.substring(0,100)}`)}return k.json()}).then(k=>{k.success?r(k):alert(k.error||"Error al procesar el estado de cuenta.")}).catch(k=>alert("Error crítico en el servidor: "+k.message)).finally(()=>s(!1))},u=j.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=j.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()},x=()=>{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(gs,{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(gs,{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(ji,{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(Nt,{size:18}),n.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest",children:"Imprimir"})]}),n.jsxs("button",{onClick:x,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(ya,{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(gi,{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})]})})]})})]})})]})]})]})},sFe=({user:e})=>{const{exchangeRateHistory:t,loading:r,financialTotals:a,properties:s}=mt(),[i,l]=j.useState(new Date().getMonth()),[o,d]=j.useState(new Date().getFullYear()),[u,f]=j.useState(""),[p,x]=j.useState([]),[m,b]=j.useState(!1),[v,y]=j.useState(!1),[k,_]=j.useState(null),[C,E]=j.useState({type:"Ingreso",category:"Ingresos",date:new Date().toISOString().split("T")[0],amountBs:0,description:"",reference:""}),T=async()=>{b(!0);try{const L=await ve.getBankPreciseTransactions(i+1,o);x(L)}catch(L){console.error("Error al cargar banco preciso",L)}finally{b(!1)}};j.useEffect(()=>{T()},[i,o]);const B=j.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=j.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]),M=j.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(`${ye}/save_bank_transaction.php`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)});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 - ${_e[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(ya,{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(Nt,{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(Ha,{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:_e.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=M.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)}`]);zc("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:M.length===0?n.jsx("tr",{children:n.jsxs("td",{colSpan:5,className:"py-24 text-center",children:[n.jsx(Tc,{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"})]})}):M.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(Ab,{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(xt,{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({...C,type:"Ingreso",category:"Ingresos"}),className:`flex-1 py-4 rounded-2xl font-black text-xs uppercase tracking-widest border transition-all ${C.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({...C,type:"Egreso",category:"Gastos"}),className:`flex-1 py-4 rounded-2xl font-black text-xs uppercase tracking-widest border transition-all ${C.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:C.description,onChange:L=>E({...C,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:C.date,onChange:L=>E({...C,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:C.reference,onChange:L=>E({...C,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:C.amountBs||"",onChange:L=>E({...C,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"]})]})]})})]})},ni=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})},iFe=({user:e})=>{const{properties:t,residents:r,users:a,latestRate:s}=mt(),[i,l]=j.useState(null),o=j.useMemo(()=>["admin","programmer"].includes(e.role)?t:t.filter(D=>D.id===e.propertyId),[t,e]);j.useEffect(()=>{!["admin","programmer"].includes(e.role)&&e.propertyId&&l(e.propertyId)},[e]);const[d,u]=j.useState("selection"),[f,p]=j.useState(!1),[x,m]=j.useState(null),[b,v]=j.useState(null),[y,k]=j.useState({}),_=j.useRef(null);j.useEffect(()=>{(async()=>{try{const L=await ve.getSystemSettings();k(L||{})}catch(L){console.error("Error fetching settings",L)}})()},[]);const C=j.useMemo(()=>t.find(D=>D.id===i),[t,i]),E=j.useMemo(()=>{if(!C)return null;const D=r.find(P=>P.propertyId===C.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:C.code,propertyId:C.id}},[C,r,a]),T=async()=>{if(i){p(!0);try{const L=await(await fetch(`${ye}/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||!C||!x)return;let L=`🏢 *ESTADO DE CUENTA - DEUDA MESES*

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

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

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

¡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 - ${C.code}`,text:L.replace(/\*/g,""),url:Mr})}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 - ${C.code}`,recipients:[{name:E.fullName,email:E.email,telegramChatId:E.telegramId,customMessage:L.replace(/\*/g,"")}]},Q=await(await fetch(`${ye}/mailer.php`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(G)})).json();Q.status==="success"?alert(`¡Éxito! Mensaje enviado por ${D}.`):alert("Error: "+Q.message)}catch{alert("Error de red al enviar.")}finally{v(null)}},M=async()=>{if(_.current){p(!0);try{const L=(await ys(_.current,{scale:2,useCORS:!0,backgroundColor:"#f8fafc"})).toDataURL("image/png"),P=document.createElement("a");P.href=L,P.download=`DeudaMeses_${C==null?void 0:C.code}.png`,P.click()}catch{alert("Error al capturar imagen.")}finally{p(!1)}}},U=()=>{if(!C||!E||!x)return;const D=x.property.initialDebt+x.pendingMonths.reduce((Q,Y)=>Q+Number(Y.pending_amount),0)-x.property.creditBalance,L=`
<!DOCTYPE html>
<html lang="es">
<head>
    <meta charset="UTF-8">
    <title>Deuda Meses - ${C.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 - ${C.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> ${C.type} ${C.number}</div>
        </div>
        
        <div style="border: 1px solid #f1f5f9; border-radius: 16px; overflow: hidden;">
            ${x.property.initialDebt>0?`
            <div class="item-row" style="background: #f8fafc;">
                <div class="item-label">Convenio de Pago</div>
                <div class="item-value">$ ${ni(x.property.initialDebt)}</div>
            </div>`:""}

            ${x.pendingMonths.map(Q=>`
            <div class="item-row">
                <div class="item-label">${_e[Q.month]} ${Q.year}</div>
                <div class="item-value">$ ${ni(Q.pending_amount)}</div>
            </div>`).join("")}

            ${x.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;">- $ ${ni(x.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;">$ ${ni(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. ${gM(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),H=document.createElement("a");H.href=G,H.download=`DeudaMeses_${C.code}.html`,H.click(),URL.revokeObjectURL(G)};if(d==="report"&&C&&E&&x){const D=x.property.initialDebt+x.pendingMonths.reduce((L,P)=>L+Number(P.pending_amount),0)-x.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(ms,{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(Nt,{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(Er,{size:20})}),n.jsx("button",{onClick:M,className:"p-3 bg-orange-500 text-white rounded-xl shadow-lg active:scale-95 transition-all",title:"Capturar Imagen",children:n.jsx(ak,{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(rn,{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(Sl,{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(Pr,{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(ya,{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:C.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:[C.type," ",C.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(Xd,{size:14,className:"text-blue-600"})," Desglose de Deuda"]}),n.jsxs("div",{className:"border border-slate-100 rounded-[2rem] overflow-hidden shadow-sm",children:[x.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(Zd,{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:["$ ",ni(x.property.initialDebt)]})]}),x.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:[_e[L.month]," ",L.year]})]}),n.jsxs("p",{className:"text-lg font-black text-slate-900",children:["$ ",ni(L.pending_amount)]})]},P)),x.pendingMonths.length===0&&x.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"})]}),x.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:["- $ ",ni(x.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:["$ ",ni(Math.max(0,D))]}),n.jsxs("p",{className:"text-xl font-black text-blue-300 tracking-tight mt-1",children:["Bs. ",gM(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"]})]})})]})},hf=e=>{const t=Number(e);return isNaN(t)?"0.00":t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},lFe=({user:e})=>{const{properties:t,residents:r,users:a}=mt(),[s,i]=j.useState([]),[l,o]=j.useState(0),[d,u]=j.useState(!1),[f,p]=j.useState(null),[x,m]=j.useState(!1),v=(()=>{const T=[],B=[...t].sort((M,U)=>M.code.localeCompare(U.code,void 0,{numeric:!0})),F=["admin","programmer"].includes(e.role);return B.forEach(M=>{if(F){const U=r.filter(D=>D.propertyId===M.id);U.length===0?T.push({propertyId:M.id,propertyCode:M.code,propertyName:`${M.type} ${M.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:M.id,propertyCode:M.code,propertyName:`${M.type} ${M.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===M.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:M.id,propertyCode:M.code,propertyName:`${M.type} ${M.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),k(T[0].propertyId)},k=async T=>{m(!0),p(null);try{const F=await(await fetch(`${ye}/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,"")},C=()=>{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:* $${hf(f.property.initialDebt)}
`),f.pendingMonths.length>0?(B+=`📅 *Meses Pendientes:*
`,f.pendingMonths.forEach(U=>{B+=`• ${_e[U.month]} ${U.year}: $${hf(U.pending_amount)}
`})):B+=`✅ No tiene meses pendientes.
`,f.property.creditBalance>0&&(B+=`💰 *Saldo a Favor:* $${hf(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:* $${hf(Math.max(0,F))}

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

¡Gracias!`;const M=_(T.phone);if(!M)return alert("No hay teléfono registrado.");if(window.open(`https://wa.me/${M}?text=${encodeURIComponent(B)}`,"_blank"),l<s.length-1){const U=l+1;o(U),k(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),k(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(rn,{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(rn,{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(rn,{size:24})}),n.jsx("button",{onClick:()=>u(!1),className:"text-slate-400 hover:text-red-500",children:n.jsx(xt,{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(Bc,{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:"}),x?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:["$ ",hf(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:C,disabled:x||!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(EM,{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"})]})]})})]})},us=e=>Number(e).toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2}),bM=e=>Number(e).toLocaleString("es-VE",{minimumFractionDigits:2,maximumFractionDigits:2}),oFe=({user:e})=>{const{properties:t,moduleStatus:r,refreshData:a}=mt(),[s,i]=j.useState(new Date().getMonth()),[l,o]=j.useState(new Date().getFullYear()),[d,u]=j.useState(null),[f,p]=j.useState("selection"),[x,m]=j.useState(!1),[b,v]=j.useState(null),[y,k]=j.useState(!1),_=j.useRef(null),C=j.useMemo(()=>{const U=r.find(D=>D.id==="saldo-desglosado");return U?U.isActive:!1},[r]);j.useEffect(()=>{e.role==="owner"&&(t.find(U=>!0),t.length===1&&u(t[0].id))},[e,t]);const E=async()=>{k(!0);try{await ve.saveSaldoDesglosadoVisibility(!C),await a()}catch{alert("Error al cambiar visibilidad")}finally{k(!1)}},T=async()=>{if(d){m(!0);try{const U=await ve.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 ys(_.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 - ${ba}*
Unidad: ${b.property.code}
Mes: ${_e[s]} ${l}
Saldo Inicial: $${us(b.initial_debt)}
Cuota Mes: $${us(b.current_fee)}
Abonos: $${us(b.payments.reduce((L,P)=>L+P.amount_usd,0))}
*SALDO FINAL: $${us(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})},M=()=>{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> ${_e[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>${bM(G.amount_bs)}</td><td>${G.rate}</td><td>${us(G.amount_usd)}</td><td>${us(G.applied_to_old)}</td><td>${us(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(Nt,{size:20})}),n.jsx("button",{onClick:M,className:"p-3 bg-blue-600 text-white rounded-xl shadow-lg hover:bg-blue-500 transition-all",title:"Exportar HTML",children:n.jsx(Er,{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(ak,{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(rn,{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(vi,{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(ya,{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:_e[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:["$ ",us(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:["$ ",us(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:["$ ",us(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:["$ ",us(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:bM(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:["$ ",us(U.amount_usd)]}),n.jsxs("td",{className:"px-6 py-4 text-right font-bold text-blue-600 text-xs",children:["$ ",us(U.applied_to_old)]}),n.jsxs("td",{className:"px-6 py-4 text-right font-bold text-emerald-600 text-xs",children:["$ ",us(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 ${C?"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}):C?n.jsx(FM,{size:20}):n.jsx(IM,{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:C?"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:_e.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||x,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:[x?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}),cFe=({user:e})=>{const{properties:t,moduleStatus:r,refreshData:a}=mt(),[s,i]=j.useState(new Date().getMonth()),[l,o]=j.useState(new Date().getFullYear()),[d,u]=j.useState(null),[f,p]=j.useState("selection"),[x,m]=j.useState(!1),[b,v]=j.useState(null),[y,k]=j.useState(!1),_=j.useRef(null),C=j.useMemo(()=>{const D=r.find(L=>L.id==="saldo-desglosado-avanzado");return D?D.isActive:!1},[r]),E=async()=>{k(!0);try{await ve.saveModuleStatus("saldo-desglosado-avanzado",!C),await a()}catch{alert("Error al cambiar visibilidad")}finally{k(!1)}},T=async()=>{if(d){m(!0);try{const D=await ve.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 ys(_.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 ys(_.current,{scale:2})).toDataURL("image/png"),P=document.createElement("a");P.href=L,P.download=`Saldo_Avanzado_${b.property.code}.png`,P.click()},M=async D=>{const L=`📊 *TRAZABILIDAD CONTABLE AVANZADA - ${ba}*
Unidad: ${b.property.code}
Balance: ${_e[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> ${_e[s]} ${l}</p>
                    </div>
                    <div>
                        <p><b>CONDOMINIO:</b> ${ba}</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(H=>`
                        <tr>
                            <td>${H.date}</td>
                            <td>PAGO RECIBIDO - REF: ${H.reference}</td>
                            <td class="text-right">0.00</td>
                            <td class="text-right">${sa(H.amount_usd)}</td>
                            <td class="text-right italic font-bold" style="color: #059669">- ${sa(H.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(Nt,{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(Er,{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(ji,{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(ak,{size:20})}),n.jsx("button",{onClick:()=>M("whatsapp"),className:"p-3 bg-emerald-500 text-white rounded-xl shadow-lg hover:bg-emerald-400 transition-all",title:"WhatsApp",children:n.jsx(rn,{size:20})}),n.jsx("button",{onClick:()=>M("telegram"),className:"p-3 bg-sky-500 text-white rounded-xl shadow-lg hover:bg-sky-400 transition-all",title:"Telegram",children:n.jsx(vi,{size:20})}),n.jsx("button",{onClick:()=>M("email"),className:"p-3 bg-slate-500 text-white rounded-xl shadow-lg hover:bg-slate-400 transition-all",title:"Email",children:n.jsx(Pr,{size:20})}),n.jsx("button",{onClick:()=>M("share"),className:"p-3 bg-violet-600 text-white rounded-xl shadow-lg hover:bg-violet-500 transition-all",title:"Compatir",children:n.jsx(ya,{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:ba}),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:_e[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(IV,{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(DV,{size:12,className:"text-blue-200"}),n.jsxs("span",{children:["CUOTA MES ACTUAL - GESTIÓN ",_e[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(gi,{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 ${C?"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}):C?n.jsx(FM,{size:24}):n.jsx(IM,{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:C?"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(yl,{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(gi,{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:_e.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||x,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:[x?n.jsx(qi,{className:"animate-spin",size:24}):n.jsx(gi,{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"]})]})]})]})]})},dN=[{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]"}],vM=[{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."}],dFe=({user:e})=>{const{properties:t,residents:r,fees:a}=mt(),[s,i]=j.useState(null),[l,o]=j.useState(new Date().getMonth()),[d,u]=j.useState(new Date().getFullYear()),[f,p]=j.useState("cream"),[x,m]=j.useState("emotivo"),[b,v]=j.useState("CONSEJO DE ADMINISTRACIÓN"),[y,k]=j.useState("COMITÉ DE CONVIVENCIA"),[_,C]=j.useState("C. R. EL TEJAR"),[E,T]=j.useState(""),[B,F]=j.useState(""),[M,U]=j.useState(!1),[D,L]=j.useState(!1),P=j.useRef(null);j.useEffect(()=>{(async()=>{L(!0);try{const le=await ve.getSystemSettings();le.board_president&&v(le.board_president),le.board_secretary&&k(le.board_secretary),le.condominium_name&&C(le.condominium_name)}catch{console.warn("No se pudieron cargar nombres reales del presidente y secretario, usando placeholders")}finally{L(!1)}})()},[]),j.useEffect(()=>{const re=vM.find(le=>le.id===x);re&&(T(re.title),F(re.body))},[x]),j.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=j.useMemo(()=>t.find(re=>re.id===s)||null,[t,s]),H=j.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]),Q=j.useMemo(()=>dN.find(re=>re.id===f)||dN[0],[f]),Y=j.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 ys(P.current,{scale:2,backgroundColor:null,useCORS:!0,logging:!1})).toDataURL("image/png"),ne=document.createElement("a");ne.download=`Felicitacion_${G.code}_${_e[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">${H}</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>${_e[l].toUpperCase()} ${d}</strong>`)}
                </div>
                
                <div class="issue-date">Emitido en San Diego, Carabobo el ${Y}</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"}),he=document.createElement("a");he.href=URL.createObjectURL(ie),he.download=`Felicitacion_${G.code}_${_e[l]}.html`,he.click()},J=()=>{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">${H}</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 ${Y}</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())},W=j.useMemo(()=>G?`🌟 *RECONOCIMIENTO DE SOLVENCIA Y AGRADECIMIENTO* 🌟
Condominio *${_}*

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

Nos complace felicitarle por encontrarse completamente *SOLVENTE* en el mes de *${_e[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,_,H,l,d,B,b,y]),R=()=>{const re=encodeURIComponent(W);window.open(`https://api.whatsapp.com/send?text=${re}`,"_blank")},O=()=>{const re=encodeURIComponent(W);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(W);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:W})}catch{console.warn("Share API falló o fue cancelado, copiando al portapapeles..."),X()}else X()},X=()=>{navigator.clipboard.writeText(W),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(_f,{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(_f,{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(Up,{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(DM,{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:_e.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:dN.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:vM.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 ${x===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(X_,{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(X_,{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=>k(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=>C(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:J,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(Nt,{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(Er,{size:14}),"HTML"]}),n.jsxs("button",{onClick:K,disabled:M,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:[M?n.jsx(ct,{className:"animate-spin",size:14}):n.jsx(ji,{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(ya,{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:R,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(rn,{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(vi,{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(Pr,{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 ${Q.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 ${Q.accent} border border-amber-500/20 shadow-md`,children:n.jsx(_f,{size:32,className:Q.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:H.toUpperCase()}),n.jsxs("p",{className:`text-xs font-black uppercase tracking-wider ${Q.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 ${_e[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 ",Y]}),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..."})]})]})]})]})},uFe=()=>{const[e,t]=j.useState(null),[r,a]=j.useState(!0),[s,i]=j.useState("dashboard"),[l,o]=j.useState(!1),[d,u]=j.useState(null),[f,p]=j.useState(!1),[x,m]=j.useState(!1),[b,v]=j.useState(!1),[y,k]=j.useState(null),[_,C]=j.useState(null),E=j.useRef(!1),{refreshData:T,moduleStatus:B,financialTotals:F,latestRate:M,exchangeRateHistory:U,setUserRole:D}=mt(),L=j.useRef(!1);j.useEffect(()=>{L.current=!0},[]);const P=async()=>{try{const W=await(await fetch(`${ye}/get_license_status.php`)).json();k(W),W.status==="locked"&&(e==null?void 0:e.role)!=="programmer"?p(!0):p(!1);const R=await ve.getSystemSettings();R.system_maintenance_mode==="true"?m(!0):m(!1);const O=R.electrical_failure_mode==="true";v(O),ve.setElectricalFailure(O)}catch{console.warn("License/Maintenance Check Failed")}},G=j.useCallback(async J=>{if(!["admin","programmer","board"].includes(J.role))try{const R=await(await fetch(`${ye}/get_blocking_status.php`,{credentials:"include"})).json();R.blocking&&R.target_tab?(C(R),(!E.current||_&&_.item_id!==R.item_id)&&(i(R.target_tab),E.current=!0)):C(null)}catch(W){console.error("Blocking Engine Error",W)}},[_]),H=()=>{C(null),E.current=!1};j.useEffect(()=>{(async()=>{try{const W=await ve.checkSession();W&&(t(W),D(W.role),ve.setUserRole(W.role),await P(),await G(W),T(W.role))}catch{console.warn("Sesión no iniciada.")}finally{a(!1)}})()},[T,G,D]),j.useEffect(()=>{e&&ve.logNavigation(s)},[s,e]);const Q=async J=>{a(!0),u(null);try{const W=await ve.login(J);t(W),D(W.role),ve.setUserRole(W.role),await P(),E.current=!1,await G(W),await T(W.role)}catch(W){u(W.message)}finally{a(!1)}},Y=async()=>{await ve.logout(),t(null),D(null),ve.setUserRole(null),i("dashboard"),C(null),p(!1),v(!1),ve.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(fFe,{onLogin:Q,isLoading:r,error:d,latestRate:M});if(x&&e.role!=="programmer")return n.jsx(AFe,{logout:Y});if(b&&e.role!=="programmer")return n.jsx(pFe,{logout:Y});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(TM,{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:Y,className:"text-slate-400 font-black text-xs uppercase tracking-widest hover:text-slate-600 flex items-center gap-2",children:[n.jsx(Kf,{size:16})," Salir del Portal"]})}),n.jsx(Er,{className:"absolute right-[-40px] bottom-[-40px] w-64 h-64 text-slate-100 pointer-events-none"})]})});const K=()=>{const J=["admin","programmer","board"].includes(e.role);switch(s){case"dashboard":return n.jsx(N6,{user:e,onNavigate:i});case"monthly-collection":return n.jsx(XIe,{user:e});case"debt-list":return n.jsx(tFe,{});case"solvent-list":return n.jsx(rFe,{});case"payment-report":return n.jsx(JIe,{user:e});case"properties":return J?n.jsx(jme,{user:e}):n.jsx(Gde,{user:e});case"bulk-load-properties":return n.jsx(lSe,{user:e});case"residents":return n.jsx(Eme,{user:e});case"users":return n.jsx(Sme,{user:e});case"bulk-load-users":return n.jsx(oSe,{user:e});case"providers":return n.jsx(ZEe,{user:e});case"prefill-simulator":return n.jsx(cSe,{user:e});case"recaudacion-detallada":return n.jsx(zIe,{user:e});case"generate-fees":return n.jsx(k6,{user:e,viewMode:"generate",onTabChange:i});case"view-fees":return n.jsx(k6,{user:e,viewMode:"list",onTabChange:i});case"balance":return n.jsx(Bme,{user:e,onNavigate:i});case"historial-pagos-egresos":return n.jsx($Ie,{user:e});case"expediente-digital":return n.jsx(HIe,{user:e});case"payment-agreements":return n.jsx(LIe,{user:e});case"history-agreements":return n.jsx(QIe,{user:e});case"banks":return n.jsx(Kde,{user:e});case"bank-precise":return n.jsx(sFe,{user:e});case"bank-reconciliation":return n.jsx(nSe,{user:e});case"bank-reconciliation-bnc":return n.jsx(sSe,{user:e});case"statement-analyzer":return n.jsx(tSe,{user:e});case"statement-analyzer-bnc":return n.jsx(rSe,{user:e});case"statement-detailed":return n.jsx(aSe,{user:e});case"banplus-commissions":return n.jsx(nFe,{user:e});case"commissions":return n.jsx(eSe,{user:e});case"currency":return n.jsx(_Ee,{});case"audit":return n.jsx(kme,{user:e});case"bulk-messages":return n.jsx(TEe,{user:e});case"messages":return n.jsx(IEe,{user:e});case"polls":return n.jsx(FEe,{user:e,onActionComplete:H});case"data-forms":return n.jsx(UEe,{user:e,onActionComplete:H});case"live-voting":return n.jsx(PEe,{user:e,onActionComplete:H});case"calculator":return n.jsx(HEe,{});case"statistics":return n.jsx(zEe,{});case"reservations":return n.jsx($Ee,{user:e});case"announcements":return n.jsx(VEe,{user:e});case"services":return n.jsx(GEe,{user:e});case"assemblies":return n.jsx(KEe,{user:e});case"maintenance":return n.jsx(qEe,{user:e});case"license-control":return n.jsx(iSe,{user:e});case"menu-selection":return n.jsx(RIe,{user:e});case"system-audit":return n.jsx(WEe,{user:e});case"excel-reports":return n.jsx(VIe,{user:e});case"detailed-excel-reports":return n.jsx(GIe,{user:e});case"html-reports":return n.jsx(KIe,{user:e});case"individual-account-status":return n.jsx(qIe,{user:e});case"detailed-account-status":return n.jsx(WIe,{user:e});case"monthly-debt-status":return n.jsx(iFe,{user:e});case"monthly-debt-status-massive":return n.jsx(lFe,{user:e});case"credit-balances":return n.jsx(YIe,{user:e});case"saldo-desglosado":return n.jsx(oFe,{user:e});case"saldo-desglosado-avanzado":return n.jsx(cFe,{user:e});case"congratulate-owner":return n.jsx(dFe,{user:e});case"payment-status":return n.jsx(oN,{user:e,onNavigate:i});case"payment-receipt":return n.jsx(aFe,{user:e});case"solvencia-html":return n.jsx(oN,{user:e,initialMode:"html",onNavigate:i});case"solvencia-txt":return n.jsx(oN,{user:e,initialMode:"txt",onNavigate:i});case"password-manager":return n.jsx(JEe,{user:e});case"individual-fee-view":return n.jsx(dSe,{user:e});case"individual-fee-html":return n.jsx(UIe,{user:e});case"individual-fee-html-large":return n.jsx(MIe,{user:e});default:return n.jsx(N6,{user:e,onNavigate:i})}},ee=[{id:"dashboard",label:"DashBoard",icon:TG,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:ko,roles:["programmer"],core:!0},{id:"providers",label:"Proveedores",icon:fb,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:cb,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:_f,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:Er,roles:["programmer"]},{id:"solvencia-txt",label:".TXT Solvencia",icon:yr,roles:["programmer"]},{id:"individual-fee-view",label:"Cuota por Usuario Individual",icon:PA,roles:["admin","board","programmer"]},{id:"individual-fee-html",label:"Cuota por Usuario Individual HTML",icon:Er,roles:["admin","board","programmer"],core:!0},{id:"individual-fee-html-large",label:"Cuota por Usuario Individual HTML Grande",icon:Er,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:yl,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:vi,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:Dp,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:Zd,roles:["admin","board","programmer"]},{id:"history-agreements",label:"Histórico Convenios",icon:Da,roles:["admin","board","programmer"]},{id:"banks",label:"Banco",icon:Tc,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:kA,roles:["admin","board","programmer"]},{id:"bank-reconciliation-bnc",label:"Banco VS Banco BNC",icon:kA,roles:["admin","board","programmer"]},{id:"statement-analyzer",label:"Analizador Estados BanPlus",icon:Vf,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:Pc,roles:["admin","board","programmer"]},{id:"banplus-commissions",label:"Comisiones Banplus desde Estado Cuenta",icon:gs,roles:["admin","board","programmer"]},{id:"commissions",label:"Cálculo Comisiones",icon:gs,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:po,roles:["admin","board","programmer"]},{id:"currency",label:"Tasas",icon:Ha,roles:["admin","board","programmer"]},{id:"bulk-messages",label:"Mensajería Masiva",icon:Pr,roles:["admin","board","programmer"],core:!0},{id:"messages",label:"Mensajería Individual",icon:vi,roles:["admin","board","programmer"]},{id:"polls",label:"Carta Consulta",icon:Md,roles:["admin","owner","board","programmer","family"]},{id:"data-forms",label:"Censos",icon:Xd,roles:["admin","owner","board","programmer","family"]},{id:"live-voting",label:"Asamblea Live",icon:Wf,roles:["admin","owner","board","programmer","family","guest"]},{id:"calculator",label:"Calculadora Pro",icon:gi,roles:["admin","owner","board","programmer","family","guest"]},{id:"statistics",label:"Estadísticas Pro",icon:kM,roles:["admin","owner","board","programmer","family","guest"]},{id:"reservations",label:"Reservas",icon:CM,roles:["admin","owner","board","programmer","family"]},{id:"announcements",label:"Comunicados",icon:qf,roles:["admin","owner","board","programmer","family"]},{id:"services",label:"Servicios",icon:Yf,roles:["admin","owner","board","programmer","family"]},{id:"assemblies",label:"Asambleas",icon:NM,roles:["admin","owner","board","programmer","family"]},{id:"maintenance",label:"Mantenimiento",icon:Up,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:Rd,roles:["programmer"],core:!0},{id:"password-manager",label:"Password Usuarios",icon:jA,roles:["programmer"],core:!0},{id:"system-audit",label:"DataLogger (ip)",icon:bs,roles:["programmer"],core:!0}].filter(J=>{if(!J.roles.includes(e.role))return!1;if(J.core||["admin","programmer"].includes(e.role))return!0;const R=B.find(O=>O.id===J.id);return R?R.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(XEe,{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:ba.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(xt,{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(J=>{const W=J.icon,R=s===J.id;return n.jsxs("button",{onClick:()=>{i(J.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 ${R?"bg-blue-600 text-white shadow-xl shadow-blue-500/20":"text-slate-400 hover:bg-slate-800 hover:text-white"}`,children:[n.jsx(W,{size:18}),J.label]},J.id)})}),n.jsx("div",{className:"p-4 mt-auto border-t border-slate-800/50 shrink-0",children:n.jsxs("button",{onClick:Y,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(Kf,{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(GG,{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(eu,{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()})})]})]})},AFe=({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(Up,{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(Ha,{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(ko,{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(Kf,{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"})]})]})]}),fFe=({onLogin:e,isLoading:t,error:r,latestRate:a})=>{const[s,i]=j.useState(""),[l,o]=j.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:ba.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(eu,{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(Rd,{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(Kf,{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"]})})]})})},pFe=({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(Kf,{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"})]})]})]}),Iz=document.getElementById("root");if(!Iz)throw new Error("Could not find root element to mount to");const hFe=Z7.createRoot(Iz);hFe.render(n.jsx(Tp.StrictMode,{children:n.jsx(vq,{children:n.jsx(uFe,{})})}));
